From 4591d64818385843fa202070db5b6097ce73b988 Mon Sep 17 00:00:00 2001 From: lili Date: Sun, 14 Jun 2026 10:42:49 -0700 Subject: [PATCH] =?UTF-8?q?verify(host):=20=E9=87=8D=E6=89=93=E5=8C=85?= =?UTF-8?q?=E9=94=AE=E7=9B=98=E6=AC=BE=E8=AF=81=20host=20=E9=94=AE?= =?UTF-8?q?=E7=9B=98=E6=A1=A5=E7=94=9F=E6=95=88(tetris=20=E7=BF=BB?= =?UTF-8?q?=E7=BB=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 补宿主键盘桥(d754b71)后重打包 t2048/tetris/asteroids 重跑九门:tetris ✅整盘翻绿(piecesLocked 0→10 + latch 驻留;修前 0→1 重力假性)、t2048 score 0→4 真合并(修前 0→0)、asteroids F_wiring 0→27 + latch✓(船真动真开火;修前全冻 0)。键盘根因坐实。残留 t2048-latch(2048 盲态难死锁)/asteroids-score(盲射没瞄准)=harness driver 跟进,非键盘非模型。 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../2026-06-14-WG1-scale20-短板量化报告.md | 2 + .../games/_wg1-gen/asteroids/bundle.iife.js | 24 +- .../asteroids/bundle.iife.js.meta.json | 2 +- .../asteroids/evidence/after-play.png | Bin 43501 -> 49871 bytes .../asteroids/evidence/first-paint.png | Bin 40897 -> 41045 bytes .../_wg1-gen/asteroids/evidence/verdict.json | 54 +-- .../games/_wg1-gen/t2048/bundle.iife.js | 22 +- .../_wg1-gen/t2048/bundle.iife.js.meta.json | 2 +- .../_wg1-gen/t2048/evidence/after-play.png | Bin 24523 -> 22779 bytes .../_wg1-gen/t2048/evidence/first-paint.png | Bin 24391 -> 24407 bytes .../_wg1-gen/t2048/evidence/verdict.json | 36 +- .../games/_wg1-gen/t2048/play-spec.json | 2 +- .../games/_wg1-gen/tetris/bundle.iife.js | 24 +- .../_wg1-gen/tetris/bundle.iife.js.meta.json | 2 +- .../_wg1-gen/tetris/evidence/after-play.png | Bin 15283 -> 26044 bytes .../_wg1-gen/tetris/evidence/verdict.json | 339 +++++++++--------- 16 files changed, 269 insertions(+), 240 deletions(-) diff --git a/docs/agent-specs/2026-06-14-WG1-scale20-短板量化报告.md b/docs/agent-specs/2026-06-14-WG1-scale20-短板量化报告.md index d6f1acf8..48f94f88 100644 --- a/docs/agent-specs/2026-06-14-WG1-scale20-短板量化报告.md +++ b/docs/agent-specs/2026-06-14-WG1-scale20-短板量化报告.md @@ -79,6 +79,8 @@ **压测批结论**:6 款里 **0 个是"便宜模型造不出"**——match3 真可玩;3 款键盘款挂在**同一处宿主缺键盘桥**;multiball/愤怒小鸟挂在 harness driver 覆盖。**spec 预判的 CCD/match-finding/手势/文本 HUD 缺口全部未成立**(详 §八)。 +> **★ host 修复已验证(`fix/host-keyboard-bridge` 分支 · commit d754b71 · 2026-06-14,经创始人授权隔离执行)**:补宿主键盘桥 + 重打包 3 款重跑九门——**键盘输入全部接通**:**tetris 整盘翻绿**(piecesLocked 0→10 + latch✓,修前 0→1 是重力假性)、t2048 **score 0→4 真合并**(修前 0→0)、asteroids **F_wiring 0→27 + latch✓**(船真动真开火,修前全冻 0)。残留:t2048 latch(2048 盲态几乎不死锁)、asteroids score(盲射没瞄准)= driver-coverage 跟进,**非键盘非模型**。→ host 键盘桥根因**坐实**,供 L0 cherry-pick `d754b71` 到 dev/2.0.0。 + --- ## 七、三方对照:确定性门 vs M3 便宜 player vs Opus 教师审计(核心实证) diff --git a/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js b/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js index 78b893f3..09c7cc44 100644 --- a/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js +++ b/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js @@ -1,34 +1,34 @@ -"use strict";var __GameBundle=(()=>{var zi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var Hr=(n,t)=>{for(var e in t)zi(n,e,{get:t[e],enumerable:!0})},Bc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&zi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Nc=n=>Bc(zi({},"__esModule",{value:!0}),n);var Ic={};Hr(Ic,{ASSERT:()=>f,BLACK:()=>it,BLUE:()=>Za,Box2dDistanceJoint:()=>Ti,Box2dFrictionJoint:()=>$o,Box2dGearJoint:()=>qo,Box2dJoint:()=>Ht,Box2dKinematicObject:()=>No,Box2dMotorJoint:()=>Qo,Box2dObject:()=>_s,Box2dPinJoint:()=>Uo,Box2dPlugin:()=>Ai,Box2dPrismaticJoint:()=>Ho,Box2dPulleyJoint:()=>Ko,Box2dRaycastResult:()=>wi,Box2dRevoluteJoint:()=>Wo,Box2dRopeJoint:()=>Vo,Box2dStaticObject:()=>Si,Box2dTargetJoint:()=>Jo,Box2dTileLayer:()=>zo,Box2dWeldJoint:()=>Yo,Box2dWheelJoint:()=>Xo,CLEAR_BLACK:()=>pe,CLEAR_WHITE:()=>rn,CYAN:()=>ql,CanvasLayer:()=>ui,Color:()=>wt,Ease:()=>Ci,EngineObject:()=>Je,GRAY:()=>Vl,GREEN:()=>Qa,ImageFont:()=>ii,LOG:()=>xt,Light:()=>Oo,LightSystemPlugin:()=>Lo,MAGENTA:()=>Hl,Medal:()=>xi,NewgroundsMedal:()=>_o,NewgroundsPlugin:()=>Ro,ORANGE:()=>Wl,PI:()=>X,PURPLE:()=>tc,Particle:()=>hi,ParticleEmitter:()=>vo,PathFinder:()=>Zo,PathFinderNode:()=>_i,PostProcessPlugin:()=>Po,RED:()=>rr,RandomGenerator:()=>go,Sound:()=>bs,SoundInstance:()=>ci,TextureInfo:()=>Ue,TileCollisionLayer:()=>vs,TileInfo:()=>Re,TileLayer:()=>xs,TileLayerData:()=>wn,Timer:()=>Ee,Tween:()=>Ei,UIButton:()=>Cs,UICheckbox:()=>Go,UILayout:()=>Bo,UIObject:()=>re,UISlider:()=>Fo,UISystemPlugin:()=>Io,UIText:()=>vi,UITextInput:()=>Mo,UITile:()=>ko,UIVideo:()=>jo,Vector2:()=>ot,WHITE:()=>W,YELLOW:()=>Ka,ZzFXMusic:()=>Do,abs:()=>nt,atan2:()=>sr,audioContext:()=>ft,audioDefaultSampleRate:()=>Qn,audioIsRunning:()=>ms,audioMasterGain:()=>ze,box2d:()=>m,box2dDebug:()=>qr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>Q,cameraFit:()=>rh,cameraPos:()=>_t,cameraScale:()=>H,canvasClearColor:()=>tn,canvasColorTiles:()=>Pi,canvasFixedSize:()=>Gn,canvasMaxAspect:()=>kn,canvasMaxSize:()=>Mn,canvasMinAspect:()=>os,canvasPixelRatio:()=>en,canvasPixelated:()=>lr,ceil:()=>us,clamp:()=>N,combineCanvases:()=>wr,cos:()=>ct,debug:()=>Ft,debugCircle:()=>Jt,debugClear:()=>Ml,debugLine:()=>we,debugOverlap:()=>fo,debugOverlay:()=>Ie,debugPoint:()=>nr,debugPointSize:()=>ka,debugPoly:()=>Il,debugRect:()=>bt,debugScreenshot:()=>Fa,debugShowErrors:()=>kl,debugText:()=>In,debugVideoCaptureIsActive:()=>Te,debugVideoCaptureStart:()=>ja,debugVideoCaptureStop:()=>Ba,debugWatermark:()=>Ri,distanceAngle:()=>zl,distanceWrap:()=>ir,drawCanvas2D:()=>Rn,drawCircle:()=>si,drawCircleGradient:()=>sh,drawContext:()=>Et,drawCount:()=>Ce,drawCrescent:()=>ud,drawEllipse:()=>ic,drawEllipseGradient:()=>oc,drawLine:()=>mn,drawLineList:()=>mo,drawNineSlice:()=>_c,drawNineSliceScreen:()=>cd,drawPoly:()=>Un,drawRect:()=>ni,drawRectGradient:()=>th,drawRegularPoly:()=>sc,drawText:()=>ih,drawTextScreen:()=>nn,drawTextureWrapped:()=>eh,drawThreeSlice:()=>Rc,drawThreeSliceScreen:()=>ld,drawTile:()=>It,enablePhysicsSolver:()=>Ii,engineAddPlugin:()=>Cn,engineImageFont:()=>lc,engineInit:()=>Pl,engineName:()=>Hs,engineObjects:()=>vt,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>er,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Ia,engineVersion:()=>Xs,fetchJSON:()=>Xl,floor:()=>St,fontDefault:()=>Rs,formatTime:()=>ar,frame:()=>Oa,frameRate:()=>Cl,gamepadConnected:()=>xo,gamepadDirectionEmulateStick:()=>yr,gamepadDpad:()=>bo,gamepadIsDown:()=>De,gamepadPrimary:()=>mt,gamepadStick:()=>gs,gamepadStickCount:()=>uc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Rr,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Mi,getCameraSize:()=>ac,getCrescentPoints:()=>Pc,getNoteFrequency:()=>gc,getPaused:()=>_l,glAntialias:()=>Mr,glCanvas:()=>et,glCircleSides:()=>Ps,glClearCanvas:()=>vc,glClearRect:()=>Ec,glCompileShader:()=>Co,glContext:()=>g,glCopyToContext:()=>Br,glCreateProgram:()=>Xn,glCreateTexture:()=>ji,glDeleteTexture:()=>wc,glDraw:()=>Ts,glDrawColoredPoints:()=>Jr,glDrawOutlineTransform:()=>zr,glDrawPoints:()=>Ac,glDrawPointsTransform:()=>Nr,glDrawUntextured:()=>Tc,glEnable:()=>G,glFlush:()=>Rt,glSetAntialias:()=>Yh,glSetRenderTarget:()=>is,glSetTexture:()=>Fr,glSetTextureData:()=>jr,glSetTextureWrap:()=>Sc,gravity:()=>Ut,headlessMode:()=>z,hsl:()=>ke,hypot:()=>Na,inputClear:()=>ks,inputClearKey:()=>Cr,inputMouseMoveThreshold:()=>Er,inputPreventDefault:()=>Fn,inputWASDEmulateDirection:()=>rs,isArray:()=>de,isColor:()=>U,isFullscreen:()=>cc,isIntersecting:()=>Va,isNumber:()=>L,isOnScreen:()=>ah,isOverlapping:()=>Qs,isPowerOfTwo:()=>hs,isStringLike:()=>V,isTouchDevice:()=>ie,isUsingGamepad:()=>Bn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>Dt,keyWasPressed:()=>kt,keyWasReleased:()=>_r,lastInputDevice:()=>Qe,lerp:()=>Vt,lerpAngle:()=>Jl,lerpWrap:()=>Ua,lightSystem:()=>q,lineTest:()=>qa,log2:()=>za,mainCanvas:()=>B,mainCanvasSize:()=>I,mainContext:()=>ut,max:()=>K,medalDisplaySize:()=>mi,medalDisplaySlideTime:()=>jn,medalDisplayTime:()=>yi,medals:()=>As,medalsForEach:()=>Bi,medalsInit:()=>Zh,medalsPreventUnlock:()=>Ur,medalsReset:()=>td,min:()=>tt,mod:()=>se,mouseDelta:()=>Tr,mouseDeltaScreen:()=>xe,mouseInWindow:()=>oi,mouseIsDown:()=>cs,mousePos:()=>Oe,mousePosScreen:()=>zt,mouseWasPressed:()=>ps,mouseWasReleased:()=>xh,mouseWheel:()=>Ar,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Es,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>fr,objectDefaultDamping:()=>dr,objectDefaultFriction:()=>gr,objectDefaultMass:()=>hr,objectDefaultRestitution:()=>pr,objectMaxSpeed:()=>Ge,oscillate:()=>Wa,particleEmitRateScale:()=>Zs,paused:()=>Ae,percent:()=>jt,percentLerp:()=>Nl,playSamples:()=>Ir,pointerLockExit:()=>Eh,pointerLockIsActive:()=>hc,pointerLockRequest:()=>Ah,postProcess:()=>Mt,primitiveCount:()=>_e,rand:()=>dt,randBool:()=>Ha,randColor:()=>po,randInCircle:()=>$a,randInt:()=>or,randSign:()=>Xa,randVec2:()=>Ya,readSaveData:()=>Kl,rgb:()=>J,round:()=>$s,saveCanvas:()=>ec,saveDataURL:()=>ds,saveText:()=>Yl,screenToWorld:()=>Is,screenToWorldDelta:()=>rc,screenToWorldTransform:()=>Ms,setAdditiveBlendMode:()=>fs,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>nc,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Cu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Eu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Mu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Bu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Nu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Iu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>ur,sign:()=>ne,sin:()=>st,smoothStep:()=>Ks,soundDefaultRange:()=>xr,soundDefaultTaper:()=>vr,soundEnable:()=>qt,soundVolume:()=>Sn,speak:()=>Nh,speakStop:()=>zh,tan:()=>Ja,textureInfos:()=>cn,tile:()=>Ds,tileCollisionGetData:()=>li,tileCollisionLayers:()=>sn,tileCollisionRaycast:()=>yc,tileCollisionTest:()=>$e,tileDefaultBleed:()=>Di,tileDefaultPadding:()=>Oi,tileDefaultSize:()=>Li,tileLayersLoad:()=>Uh,tilesPixelated:()=>Tn,time:()=>$t,timeDelta:()=>tr,timeReal:()=>on,timeScale:()=>cr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>br,touchGamepadAnalog:()=>Ls,touchGamepadButtonCount:()=>Yn,touchGamepadCenterButtonSize:()=>fe,touchGamepadDisplayTime:()=>as,touchGamepadEnable:()=>an,touchGamepadFloating:()=>ln,touchGamepadLeftButtonCount:()=>$n,touchGamepadLeftStick:()=>_n,touchGamepadPassthrough:()=>mr,touchGamepadRightStick:()=>Kn,touchGamepadSize:()=>Wt,touchGamepadVibration:()=>ti,touchInputEnable:()=>yn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Dc,uiDebug:()=>Wr,uiSetDebug:()=>od,uiSystem:()=>E,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>Pr,vibrateEnable:()=>Os,vibrateStop:()=>Th,workCanvas:()=>Be,workContext:()=>Ke,workReadCanvas:()=>Se,workReadContext:()=>Fe,worldToScreen:()=>Pn,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Gi,zzfxM:()=>Cc});function _l(){return Ae}function Rl(n=!0){Ae=n}function Cn(n,t,e,s){f(!bn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new uo(n,t,e,s);bn.push(i)}async function Pl(n,t,e,s,i,o=[],a){if(Da&&console.log(`${Hs} Engine v${Xs}`),f(!ut,"engine already initialized"),ut)return;f(de(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),a||(a=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function r(){I=b(B.width,B.height),ut.imageSmoothingEnabled=!Tn,Eo()}function c(y=0){let x=y-ao;ao||(x=0),ao=y,(Ft||Ri)&&(Ys=Vt(Ys,1e3/(x||1),.05));let v=Ft&&Dt("Equal"),w=Ft&&Dt("Minus"),_=v?10:w?.1:1;on+=x*_/1e3;let S=cr*_;x*=S,be+=Ae?0:x,S<=1&&(be=tt(be,50));let C=!1;if(Ae){C=!0,l(),Ea(),bn.forEach(T=>{var P;return(P=T.update)==null?void 0:P.call(T)});for(let T of vt)T.parent||T.updateTransforms();Sa(),e(),Ca(),Te()&&A()}else{let T=0;for(be<0&&be>-9&&(T=be,be=0);be>=0;be-=1e3/60)$t=Oa++/60,C=!0,l(),Ea(),t(),bn.forEach(P=>{var M;return(M=P.update)==null?void 0:M.call(P)}),Ia(),Sa(),e(),Ca(),Te()&&A();be+=T}Te()||A(),requestAnimationFrame(c);function A(){if(!z){C||l(),r(),s(),vt.sort((T,P)=>T.renderOrder-P.renderOrder);for(let T of vt)T.destroyed||T.render();i(),bn.forEach(T=>{var P;return(P=T.render)==null?void 0:P.call(T)}),_h(),Fl(),Rt(),jl(),Ce=0,_e=0}}}function l(){if(!z){if(Gn.x){I=Gn.copy();let y=innerWidth/innerHeight,x=Gn.x/Gn.y,v=ykn){let C=I.y*kn|0;I.x=tt(C,Mn.x)}else if(w0&&!G&&(ut.fillStyle=tn.toString(),ut.fillRect(0,0,I.x,I.y),ut.fillStyle=it.toString()),ut.lineJoin="round",ut.lineCap="round"}}if(z)return d();qh(a);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";a.style.cssText=u,B=a.appendChild(document.createElement("canvas")),Et=ut=B.getContext("2d"),Ch(),Bh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";B.style.cssText=h,et&&(et.style.cssText=h),nc(lr),l(),Eo(),Be=new OffscreenCanvas(64,64),Ke=Be.getContext("2d"),Se=new OffscreenCanvas(64,64),Fe=Se.getContext("2d",{willReadFrequently:!0});let p=o.map((y,x)=>Ta(x,y));return o.length||p.push(Ta(0)),p.push(dh()),ur&&p.push(new Promise(y=>{let x=0;v();function v(){ks(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(p),d();async function d(){await n(),c()}}function Ia(){er=vt.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of vt)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}vt=vt.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of vt)t.parent||t.destroy(n);vt=vt.filter(t=>!t.destroyed)}function Ma(n,t,e=vt){let s=[];if(n)if(t instanceof ot)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=vt){let s=[];for(let i of e)i.collideRaycast&&Va(n,t,i.pos,i.size)&&(he&&bt(i.pos,i.size,"#f00"),s.push(i));return he&&we(n,t,s.length?"#f00":"#00f",.02),s}function f(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function xt(...n){console.log(...n)}function bt(n,t=b(),e=W,s=0,i=0,o=!1,a=!1){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),f(L(i),"angle must be a number"),U(e)&&(e=e.toString());let r=new Ee(s);Ze.push({pos:n.copy(),size:t.copy(),color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Il(n,t,e=W,s=0,i=0,o=!1,a=!1){f(O(n),"pos must be a vec2"),f(de(t),"points must be an array"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),f(L(i),"angle must be a number"),U(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let r=new Ee(s);Ze.push({pos:n,points:t,color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Jt(n,t=0,e=W,s=0,i=!1,o=!1){f(O(n),"pos must be a vec2"),f(L(t),"size must be a number"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),U(e)&&(e=e.toString()),n=n.copy();let a=new Ee(s);Ze.push({pos:n,size:t,color:e,timer:a,angle:0,fill:i,screenSpace:o})}function nr(n,t,e,s,i=!1){bt(n,void 0,t,e,s,!1,i)}function we(n,t,e,s=.1,i=0,o=!1){f(O(n),"posA must be a vec2"),f(O(t),"posB must be a vec2"),f(L(s),"width must be a number");let a=b((t.x-n.x)/2,(t.y-n.y)/2),r=b(s,a.length()*2);bt(n.add(a),r,e,i,a.angle(),!0,o)}function fo(n,t,e,s,i,o,a=!1){f(O(n),"posA must be a vec2"),f(O(e),"posB must be a vec2"),f(O(t),"sizeA must be a vec2"),f(O(s),"sizeB must be a vec2");let r=b(tt(n.x-t.x/2,e.x-s.x/2),tt(n.y-t.y/2,e.y-s.y/2)),c=b(K(n.x+t.x/2,e.x+s.x/2),K(n.y+t.y/2,e.y+s.y/2));bt(r.lerp(c,.5),c.subtract(r),i,o,0,!1,a)}function In(n,t,e=1,s=W,i=0,o=0,a="monospace",r=!1){f(V(n),"text must be a string"),f(O(t),"pos must be a vec2"),f(L(e),"size must be a number"),f(V(s)||U(s),"color is invalid"),f(L(i),"time must be a number"),f(L(o),"angle must be a number"),f(V(a),"font must be a string"),U(s)&&(s=s.toString()),t=t.copy();let c=new Ee(i);Ze.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:a,screenSpace:r})}function Ml(){Ze=[]}function Fa(){ho=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
+"use strict";var __GameBundle=(()=>{var zi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var Hr=(n,t)=>{for(var e in t)zi(n,e,{get:t[e],enumerable:!0})},Bc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&zi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Nc=n=>Bc(zi({},"__esModule",{value:!0}),n);var Ic={};Hr(Ic,{ASSERT:()=>f,BLACK:()=>it,BLUE:()=>Za,Box2dDistanceJoint:()=>Ti,Box2dFrictionJoint:()=>$o,Box2dGearJoint:()=>qo,Box2dJoint:()=>Xt,Box2dKinematicObject:()=>No,Box2dMotorJoint:()=>Qo,Box2dObject:()=>_s,Box2dPinJoint:()=>Uo,Box2dPlugin:()=>Ai,Box2dPrismaticJoint:()=>Ho,Box2dPulleyJoint:()=>Ko,Box2dRaycastResult:()=>wi,Box2dRevoluteJoint:()=>Wo,Box2dRopeJoint:()=>Vo,Box2dStaticObject:()=>Si,Box2dTargetJoint:()=>Jo,Box2dTileLayer:()=>zo,Box2dWeldJoint:()=>Yo,Box2dWheelJoint:()=>Xo,CLEAR_BLACK:()=>pe,CLEAR_WHITE:()=>rn,CYAN:()=>ql,CanvasLayer:()=>ui,Color:()=>wt,Ease:()=>Ci,EngineObject:()=>Ue,GRAY:()=>Vl,GREEN:()=>Qa,ImageFont:()=>ii,LOG:()=>xt,Light:()=>Oo,LightSystemPlugin:()=>Lo,MAGENTA:()=>Hl,Medal:()=>xi,NewgroundsMedal:()=>_o,NewgroundsPlugin:()=>Ro,ORANGE:()=>Wl,PI:()=>X,PURPLE:()=>tc,Particle:()=>hi,ParticleEmitter:()=>vo,PathFinder:()=>Zo,PathFinderNode:()=>_i,PostProcessPlugin:()=>Po,RED:()=>rr,RandomGenerator:()=>go,Sound:()=>bs,SoundInstance:()=>ci,TextureInfo:()=>Ve,TileCollisionLayer:()=>vs,TileInfo:()=>Re,TileLayer:()=>xs,TileLayerData:()=>wn,Timer:()=>Ee,Tween:()=>Ei,UIButton:()=>Cs,UICheckbox:()=>Go,UILayout:()=>Bo,UIObject:()=>re,UISlider:()=>Fo,UISystemPlugin:()=>Io,UIText:()=>vi,UITextInput:()=>Mo,UITile:()=>ko,UIVideo:()=>jo,Vector2:()=>rt,WHITE:()=>W,YELLOW:()=>Ka,ZzFXMusic:()=>Do,abs:()=>nt,atan2:()=>sr,audioContext:()=>ft,audioDefaultSampleRate:()=>Qn,audioIsRunning:()=>ms,audioMasterGain:()=>Je,box2d:()=>m,box2dDebug:()=>qr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>Q,cameraFit:()=>rh,cameraPos:()=>_t,cameraScale:()=>H,canvasClearColor:()=>tn,canvasColorTiles:()=>Pi,canvasFixedSize:()=>Gn,canvasMaxAspect:()=>kn,canvasMaxSize:()=>Mn,canvasMinAspect:()=>os,canvasPixelRatio:()=>en,canvasPixelated:()=>lr,ceil:()=>us,clamp:()=>N,combineCanvases:()=>wr,cos:()=>lt,debug:()=>jt,debugCircle:()=>Ut,debugClear:()=>Ml,debugLine:()=>we,debugOverlap:()=>fo,debugOverlay:()=>Me,debugPoint:()=>nr,debugPointSize:()=>ka,debugPoly:()=>Il,debugRect:()=>bt,debugScreenshot:()=>Fa,debugShowErrors:()=>kl,debugText:()=>In,debugVideoCaptureIsActive:()=>Te,debugVideoCaptureStart:()=>ja,debugVideoCaptureStop:()=>Ba,debugWatermark:()=>Ri,distanceAngle:()=>zl,distanceWrap:()=>ir,drawCanvas2D:()=>Rn,drawCircle:()=>si,drawCircleGradient:()=>sh,drawContext:()=>Et,drawCount:()=>Ce,drawCrescent:()=>ud,drawEllipse:()=>ic,drawEllipseGradient:()=>oc,drawLine:()=>mn,drawLineList:()=>mo,drawNineSlice:()=>_c,drawNineSliceScreen:()=>cd,drawPoly:()=>Un,drawRect:()=>ni,drawRectGradient:()=>th,drawRegularPoly:()=>sc,drawText:()=>ih,drawTextScreen:()=>nn,drawTextureWrapped:()=>eh,drawThreeSlice:()=>Rc,drawThreeSliceScreen:()=>ld,drawTile:()=>Mt,enablePhysicsSolver:()=>Ii,engineAddPlugin:()=>Cn,engineImageFont:()=>lc,engineInit:()=>Pl,engineName:()=>Hs,engineObjects:()=>vt,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>er,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Ia,engineVersion:()=>Xs,fetchJSON:()=>Xl,floor:()=>St,fontDefault:()=>Rs,formatTime:()=>ar,frame:()=>Oa,frameRate:()=>Cl,gamepadConnected:()=>xo,gamepadDirectionEmulateStick:()=>yr,gamepadDpad:()=>bo,gamepadIsDown:()=>Ie,gamepadPrimary:()=>mt,gamepadStick:()=>gs,gamepadStickCount:()=>uc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Rr,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Mi,getCameraSize:()=>ac,getCrescentPoints:()=>Pc,getNoteFrequency:()=>gc,getPaused:()=>_l,glAntialias:()=>Mr,glCanvas:()=>et,glCircleSides:()=>Ps,glClearCanvas:()=>vc,glClearRect:()=>Ec,glCompileShader:()=>Co,glContext:()=>g,glCopyToContext:()=>Br,glCreateProgram:()=>Xn,glCreateTexture:()=>ji,glDeleteTexture:()=>wc,glDraw:()=>Ts,glDrawColoredPoints:()=>Jr,glDrawOutlineTransform:()=>zr,glDrawPoints:()=>Ac,glDrawPointsTransform:()=>Nr,glDrawUntextured:()=>Tc,glEnable:()=>G,glFlush:()=>Rt,glSetAntialias:()=>Yh,glSetRenderTarget:()=>is,glSetTexture:()=>Fr,glSetTextureData:()=>jr,glSetTextureWrap:()=>Sc,gravity:()=>Vt,headlessMode:()=>z,hsl:()=>Ge,hypot:()=>Na,inputClear:()=>ks,inputClearKey:()=>Cr,inputMouseMoveThreshold:()=>Er,inputPreventDefault:()=>Fn,inputWASDEmulateDirection:()=>rs,isArray:()=>de,isColor:()=>U,isFullscreen:()=>cc,isIntersecting:()=>Va,isNumber:()=>L,isOnScreen:()=>ah,isOverlapping:()=>Qs,isPowerOfTwo:()=>hs,isStringLike:()=>V,isTouchDevice:()=>ie,isUsingGamepad:()=>Bn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>It,keyWasPressed:()=>Gt,keyWasReleased:()=>_r,lastInputDevice:()=>Qe,lerp:()=>Wt,lerpAngle:()=>Jl,lerpWrap:()=>Ua,lightSystem:()=>q,lineTest:()=>qa,log2:()=>za,mainCanvas:()=>B,mainCanvasSize:()=>I,mainContext:()=>ut,max:()=>K,medalDisplaySize:()=>mi,medalDisplaySlideTime:()=>jn,medalDisplayTime:()=>yi,medals:()=>As,medalsForEach:()=>Bi,medalsInit:()=>Zh,medalsPreventUnlock:()=>Ur,medalsReset:()=>td,min:()=>tt,mod:()=>se,mouseDelta:()=>Tr,mouseDeltaScreen:()=>xe,mouseInWindow:()=>oi,mouseIsDown:()=>cs,mousePos:()=>De,mousePosScreen:()=>Jt,mouseWasPressed:()=>ps,mouseWasReleased:()=>xh,mouseWheel:()=>Ar,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Es,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>fr,objectDefaultDamping:()=>dr,objectDefaultFriction:()=>gr,objectDefaultMass:()=>hr,objectDefaultRestitution:()=>pr,objectMaxSpeed:()=>Fe,oscillate:()=>Wa,particleEmitRateScale:()=>Zs,paused:()=>Ae,percent:()=>Bt,percentLerp:()=>Nl,playSamples:()=>Ir,pointerLockExit:()=>Eh,pointerLockIsActive:()=>hc,pointerLockRequest:()=>Ah,postProcess:()=>kt,primitiveCount:()=>_e,rand:()=>dt,randBool:()=>Ha,randColor:()=>po,randInCircle:()=>$a,randInt:()=>or,randSign:()=>Xa,randVec2:()=>Ya,readSaveData:()=>Kl,rgb:()=>J,round:()=>$s,saveCanvas:()=>ec,saveDataURL:()=>ds,saveText:()=>Yl,screenToWorld:()=>Is,screenToWorldDelta:()=>rc,screenToWorldTransform:()=>Ms,setAdditiveBlendMode:()=>fs,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>nc,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Cu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Eu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Mu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Bu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Nu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Iu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>ur,sign:()=>ne,sin:()=>st,smoothStep:()=>Ks,soundDefaultRange:()=>xr,soundDefaultTaper:()=>vr,soundEnable:()=>Ht,soundVolume:()=>Sn,speak:()=>Nh,speakStop:()=>zh,tan:()=>Ja,textureInfos:()=>cn,tile:()=>Ds,tileCollisionGetData:()=>li,tileCollisionLayers:()=>sn,tileCollisionRaycast:()=>yc,tileCollisionTest:()=>$e,tileDefaultBleed:()=>Di,tileDefaultPadding:()=>Oi,tileDefaultSize:()=>Li,tileLayersLoad:()=>Uh,tilesPixelated:()=>Tn,time:()=>Kt,timeDelta:()=>tr,timeReal:()=>on,timeScale:()=>cr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>br,touchGamepadAnalog:()=>Ls,touchGamepadButtonCount:()=>Yn,touchGamepadCenterButtonSize:()=>fe,touchGamepadDisplayTime:()=>as,touchGamepadEnable:()=>an,touchGamepadFloating:()=>ln,touchGamepadLeftButtonCount:()=>$n,touchGamepadLeftStick:()=>_n,touchGamepadPassthrough:()=>mr,touchGamepadRightStick:()=>Kn,touchGamepadSize:()=>qt,touchGamepadVibration:()=>ti,touchInputEnable:()=>yn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Dc,uiDebug:()=>Wr,uiSetDebug:()=>od,uiSystem:()=>E,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>Pr,vibrateEnable:()=>Os,vibrateStop:()=>Th,workCanvas:()=>Ne,workContext:()=>Ke,workReadCanvas:()=>Se,workReadContext:()=>je,worldToScreen:()=>Pn,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Gi,zzfxM:()=>Cc});function _l(){return Ae}function Rl(n=!0){Ae=n}function Cn(n,t,e,s){f(!bn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new uo(n,t,e,s);bn.push(i)}async function Pl(n,t,e,s,i,o=[],a){if(Da&&console.log(`${Hs} Engine v${Xs}`),f(!ut,"engine already initialized"),ut)return;f(de(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),a||(a=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function r(){I=b(B.width,B.height),ut.imageSmoothingEnabled=!Tn,Eo()}function c(y=0){let x=y-ao;ao||(x=0),ao=y,(jt||Ri)&&(Ys=Wt(Ys,1e3/(x||1),.05));let v=jt&&It("Equal"),w=jt&&It("Minus"),_=v?10:w?.1:1;on+=x*_/1e3;let S=cr*_;x*=S,be+=Ae?0:x,S<=1&&(be=tt(be,50));let C=!1;if(Ae){C=!0,l(),Ea(),bn.forEach(T=>{var P;return(P=T.update)==null?void 0:P.call(T)});for(let T of vt)T.parent||T.updateTransforms();Sa(),e(),Ca(),Te()&&A()}else{let T=0;for(be<0&&be>-9&&(T=be,be=0);be>=0;be-=1e3/60)Kt=Oa++/60,C=!0,l(),Ea(),t(),bn.forEach(P=>{var M;return(M=P.update)==null?void 0:M.call(P)}),Ia(),Sa(),e(),Ca(),Te()&&A();be+=T}Te()||A(),requestAnimationFrame(c);function A(){if(!z){C||l(),r(),s(),vt.sort((T,P)=>T.renderOrder-P.renderOrder);for(let T of vt)T.destroyed||T.render();i(),bn.forEach(T=>{var P;return(P=T.render)==null?void 0:P.call(T)}),_h(),Fl(),Rt(),jl(),Ce=0,_e=0}}}function l(){if(!z){if(Gn.x){I=Gn.copy();let y=innerWidth/innerHeight,x=Gn.x/Gn.y,v=ykn){let C=I.y*kn|0;I.x=tt(C,Mn.x)}else if(w0&&!G&&(ut.fillStyle=tn.toString(),ut.fillRect(0,0,I.x,I.y),ut.fillStyle=it.toString()),ut.lineJoin="round",ut.lineCap="round"}}if(z)return d();qh(a);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";a.style.cssText=u,B=a.appendChild(document.createElement("canvas")),Et=ut=B.getContext("2d"),Ch(),Bh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";B.style.cssText=h,et&&(et.style.cssText=h),nc(lr),l(),Eo(),Ne=new OffscreenCanvas(64,64),Ke=Ne.getContext("2d"),Se=new OffscreenCanvas(64,64),je=Se.getContext("2d",{willReadFrequently:!0});let p=o.map((y,x)=>Ta(x,y));return o.length||p.push(Ta(0)),p.push(dh()),ur&&p.push(new Promise(y=>{let x=0;v();function v(){ks(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(p),d();async function d(){await n(),c()}}function Ia(){er=vt.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of vt)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}vt=vt.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of vt)t.parent||t.destroy(n);vt=vt.filter(t=>!t.destroyed)}function Ma(n,t,e=vt){let s=[];if(n)if(t instanceof rt)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=vt){let s=[];for(let i of e)i.collideRaycast&&Va(n,t,i.pos,i.size)&&(he&&bt(i.pos,i.size,"#f00"),s.push(i));return he&&we(n,t,s.length?"#f00":"#00f",.02),s}function f(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function xt(...n){console.log(...n)}function bt(n,t=b(),e=W,s=0,i=0,o=!1,a=!1){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),f(L(i),"angle must be a number"),U(e)&&(e=e.toString());let r=new Ee(s);Ze.push({pos:n.copy(),size:t.copy(),color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Il(n,t,e=W,s=0,i=0,o=!1,a=!1){f(O(n),"pos must be a vec2"),f(de(t),"points must be an array"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),f(L(i),"angle must be a number"),U(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let r=new Ee(s);Ze.push({pos:n,points:t,color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Ut(n,t=0,e=W,s=0,i=!1,o=!1){f(O(n),"pos must be a vec2"),f(L(t),"size must be a number"),f(V(e)||U(e),"color is invalid"),f(L(s),"time must be a number"),U(e)&&(e=e.toString()),n=n.copy();let a=new Ee(s);Ze.push({pos:n,size:t,color:e,timer:a,angle:0,fill:i,screenSpace:o})}function nr(n,t,e,s,i=!1){bt(n,void 0,t,e,s,!1,i)}function we(n,t,e,s=.1,i=0,o=!1){f(O(n),"posA must be a vec2"),f(O(t),"posB must be a vec2"),f(L(s),"width must be a number");let a=b((t.x-n.x)/2,(t.y-n.y)/2),r=b(s,a.length()*2);bt(n.add(a),r,e,i,a.angle(),!0,o)}function fo(n,t,e,s,i,o,a=!1){f(O(n),"posA must be a vec2"),f(O(e),"posB must be a vec2"),f(O(t),"sizeA must be a vec2"),f(O(s),"sizeB must be a vec2");let r=b(tt(n.x-t.x/2,e.x-s.x/2),tt(n.y-t.y/2,e.y-s.y/2)),c=b(K(n.x+t.x/2,e.x+s.x/2),K(n.y+t.y/2,e.y+s.y/2));bt(r.lerp(c,.5),c.subtract(r),i,o,0,!1,a)}function In(n,t,e=1,s=W,i=0,o=0,a="monospace",r=!1){f(V(n),"text must be a string"),f(O(t),"pos must be a vec2"),f(L(e),"size must be a number"),f(V(s)||U(s),"color is invalid"),f(L(i),"time must be a number"),f(L(o),"angle must be a number"),f(V(a),"font must be a string"),U(s)&&(s=s.toString()),t=t.copy();let c=new Ee(i);Ze.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:a,screenSpace:r})}function Ml(){Ze=[]}function Fa(){ho=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
 `+i+`
 `+o}},onunhandledrejection=e=>n(e.reason.stack||e.reason),onerror=(e,s,i,o)=>n(`${e}
 ${s}
-Ln ${i}, Col ${o}`)}function Gl(){Da&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function Sa(){Ft&&(kt(Ga)&&(Ie=!Ie),Ie&&(kt("Digit1")&&(ue=!ue,xn=!1),kt("Digit2")&&(xn=!xn,ue=!1),kt("Digit3")&&(vn=!vn),kt("Digit4")&&(he=!he),kt("Digit5")&&Fa(),kt("Digit7")&&(Jn=!Jn)),Te()?(!Ie||kt("Digit6"))&&Ba():Ie&&kt("Digit6")&&ja())}function Fl(){if(Te())return;Rt();let n=Ce,t=_e;ho&&(wr(),ec(B),ho=0);let e=ut;if(vn&&Mi){let o=0;for(let a=0;a<8;a++)xo(a)&&o++;for(let a=0;a<8;a++){if(!xo(a))continue;let r=1,c=.2,l=_t.add(b(-r*2,((o-1)/2-a)*r*3));In(a,l.add(b(-r,r)),1),a===mt&&In("Main",l.add(b(-r*2,0)),1,"#0f0");let u=ve[a].length;for(let p=0;p{e.save();let o=i.pos,a=1,r=i.angle;if(i.screenSpace||(o=Pn(i.pos),a=H,r-=Q),e.translate(o.x|0,o.y|0),e.rotate(r),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*a+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(a).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=ka*a;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(a).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*a/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),Ze=Ze.filter(i=>i.timer<0),s){let i=yc(s.pos,Oe);i&&ni(i.floor().add(b(.5)),b(1),J(0,1,1,.3),0,!1),mn(Oe,s.pos,.1,i?J(1,0,0,.5):J(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+Oe;sn.length&&(o+=`
-mouse collision = `+li(Oe)),o+=`
+Ln ${i}, Col ${o}`)}function Gl(){Da&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function Sa(){jt&&(Gt(Ga)&&(Me=!Me),Me&&(Gt("Digit1")&&(ue=!ue,xn=!1),Gt("Digit2")&&(xn=!xn,ue=!1),Gt("Digit3")&&(vn=!vn),Gt("Digit4")&&(he=!he),Gt("Digit5")&&Fa(),Gt("Digit7")&&(Jn=!Jn)),Te()?(!Me||Gt("Digit6"))&&Ba():Me&&Gt("Digit6")&&ja())}function Fl(){if(Te())return;Rt();let n=Ce,t=_e;ho&&(wr(),ec(B),ho=0);let e=ut;if(vn&&Mi){let o=0;for(let a=0;a<8;a++)xo(a)&&o++;for(let a=0;a<8;a++){if(!xo(a))continue;let r=1,c=.2,l=_t.add(b(-r*2,((o-1)/2-a)*r*3));In(a,l.add(b(-r,r)),1),a===mt&&In("Main",l.add(b(-r*2,0)),1,"#0f0");let u=ve[a].length;for(let p=0;p{e.save();let o=i.pos,a=1,r=i.angle;if(i.screenSpace||(o=Pn(i.pos),a=H,r-=Q),e.translate(o.x|0,o.y|0),e.rotate(r),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*a+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(a).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=ka*a;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(a).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*a/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),Ze=Ze.filter(i=>i.timer<0),s){let i=yc(s.pos,De);i&&ni(i.floor().add(b(.5)),b(1),J(0,1,1,.3),0,!1),mn(De,s.pos,.1,i?J(1,0,0,.5):J(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+De;sn.length&&(o+=`
+mouse collision = `+li(De)),o+=`
 
 --- object info ---
-`,o+=s.toString(),nn(o,zt,24,J(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let a=9,r=0,c=24;if(Ie){e.fillText(`${Hs} v${Xs}`,a,r+=c/2),e.fillText("Time: "+ar($t),a,r+=c),e.fillText("FPS: "+Ys.toFixed(1)+(G?" WebGL":" Canvas2D"),a,r+=c),e.fillText("Objects: "+vt.length,a,r+=c),e.fillText("Draw Calls: "+Ce,a,r+=c),e.fillText("Primitives: "+_e,a,r+=c),e.fillText("---------",a,r+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",a,r+=c),e.fillStyle=ue?"#f00":"#fff",e.fillText("1: Debug Physics",a,r+=c),e.fillStyle=xn?"#f00":"#fff",e.fillText("2: Debug Particles",a,r+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("3: Debug Gamepads",a,r+=c),e.fillStyle=he?"#f00":"#fff",e.fillText("4: Debug Raycasts",a,r+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",a,r+=c),e.fillText("6: Toggle Video Capture",a,r+=c),e.fillStyle=Jn?"#f00":"#fff",e.fillText("7: Debug Sound",a,r+=c);let l="",u="";for(let h in Y[0])Dt(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,a,r+=c),l&&e.fillText("Keys: "+l,a,r+=c);for(let h=1;hs.push(r.data),i.onstop=()=>{let r=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(r);ds(c,"capture.webm",1e3)};let o,a;if(qt){a=new ConstantSourceNode(ft,{offset:0}),a.connect(ze),a.start(),o=ft.createMediaStreamDestination(),ze.connect(o);for(let r of o.stream.getAudioTracks())n.addTrack(r)}try{i.start()}catch{xt("Video capture not supported in this browser!"),a==null||a.stop();return}xt("Video capture started."),Me={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:a,audioStreamDestination:o}}function Ba(){var n,t,e;f(Te(),"Not capturing video!"),xt(`Video capture ended. ${Me.captureTimer.get().toFixed(2)} seconds recorded.`),le.style.display="none",(n=Me.silentAudioSource)==null||n.stop(),(t=Me.mediaRecorder)==null||t.stop(),(e=Me.videoTrack)==null||e.stop(),Me=void 0}function Bl(){f(Te(),"Not capturing video!"),wr(),Me.videoTrack.requestFrame(),le.textContent="\u25CF REC "+ar(Me.captureTimer)}function Qt(n){if(Ft){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{f(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function se(n,t=1){return(n%t+t)%t}function N(n,t=0,e=1){return ne?e:n}function jt(n,t,e){return(e-=t)?N((n-t)/e):0}function Vt(n,t,e){return n+N(e)*(t-n)}function Nl(n,t,e,s,i){return Vt(s,i,jt(n,t,e))}function ir(n,t,e=1){f(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ua(n,t,e,s=1){return n+N(e)*ir(t,n,s)}function zl(n,t){return ir(n,t,2*X)}function Jl(n,t,e){return Ua(n,t,e,2*X)}function Ks(n){return n*n*(3-2*n)}function hs(n){return!(n&n-1)}function Ul(n){return 2**us(za(n))}function Qs(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,a=t.x+s.x,r=t.y+s.y;return nt(i)p)return!1;h=K(y,h)}else{if(y0?r.x+1:r.x,x=h>0?r.y+1:r.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,C=w,A=pr.x&&(T.x=r.x+1-P),M.yr.y&&(T.y=r.y+1-P),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;f(V(n),"shareURL requires title string"),f(V(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){f(V(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{xt("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{xt("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){f(V(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{xt("writeSaveData: failed to write",n)}}function yo(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=St(n);return Vt(yo(t),yo(t+1),Ks(n-t))}function tu(n,t){let e=St(n),s=St(t),i=Ks(n-e),o=Ks(t-s),a=(r,c)=>yo(r+c*374761393);return Vt(Vt(a(e,s),a(e+1,s),i),Vt(a(e,s+1),a(e+1,s+1),i),o)}function eu(n){_t=n.copy()}function nu(n){Q=n}function su(n){H=n}function iu(n){cr=n}function ou(n){Pi=n}function ru(n){tn=n.copy()}function au(n){Mn=n.copy()}function cu(n){os=n}function lu(n){kn=n}function uu(n){Gn=n.copy()}function nc(n){lr=n,B&&(B.style.imageRendering=n?"pixelated":""),et&&(et.style.imageRendering=n?"pixelated":"")}function hu(n){Tn=n}function du(n){en=n}function fu(n){Rs=n}function pu(n){ur=n}function gu(n){z=n}function yu(n){if(n&&!Ao){console.warn("Can not enable WebGL if it was disabled on start.");return}G=n,et&&(et.style.display=n?"":"none")}function mu(n){Ps=n}function bu(n){Li=n.copy()}function xu(n){Oi=n}function vu(n){Di=n}function Su(n){Ii=n}function wu(n){hr=n}function Tu(n){dr=n}function Au(n){fr=n}function Eu(n){pr=n}function Cu(n){gr=n}function _u(n){Ge=n}function Ru(n){Ut=n.copy()}function Pu(n){Zs=n}function Lu(n){Mi=n}function Ou(n){yr=n}function Du(n){rs=n}function Iu(n){yn=n}function Mu(n){an=n}function ku(n){mr=n}function Gu(n){fe=n}function Fu(n){Yn=n,n>0&&(Kn=!1)}function ju(n){_n=n,n&&($n=0)}function Bu(n){$n=n,n>0&&(_n=!1)}function Nu(n){Kn=n,n&&(Yn=0)}function zu(n){Ls=n}function Ju(n){ln=n}function Uu(n){Wt=n}function Vu(n){br=n}function Wu(n){as=n}function qu(n){ti=n}function Hu(n){Os=n}function Xu(n){qt=n}function Yu(n){Sn=n,qt&&!z&&ze&&(ze.gain.value=n)}function $u(n){xr=n}function Ku(n){vr=n}function Qu(n){Ri=n}function Zu(n){Ga=n}function ei(n){return n.r>=1&&n.g>=1&&n.b>=1}function Sr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Ds(n=0,t=Li,e=0,s=Oi,i=Di){if(f(O(n)||typeof n=="number","index must be a vec2 or number"),f(O(t)||typeof t=="number","size must be a vec2 or number"),f(L(e)||e instanceof Ue,"texture must be a number or TextureInfo"),f(L(s),"padding must be a number"),z)return new Re;typeof t=="number"&&(f(t>0),t=new ot(t,t));let o=typeof e=="number"?cn[e]:e;f(o instanceof Ue,"tile texture is not loaded"),f(o.size.x>0,"tile texture is not loaded");let a=t.x+s*2,r=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/a|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new ot(c*a+s,l*r+s);return new Re(u,t,o,s,i)}function It(n,t=b(1),e,s=W,i=0,o,a,r=G,c=!1,l){var p;f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!a||U(a),"additiveColor must be a color"),f(!l||!r,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(p=e==null?void 0:e.bleed)!=null?p:0;if(r&&G)if(f(!!g,"WebGL is not enabled!"),c&&([n,t,i]=Ms(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(Fr(u.glTexture),h){let _=d.x*h,S=d.y*h;Ts(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),a&&a.rgbaInt())}else Ts(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),a&&a.rgbaInt())}else{let d=a?s.add(a):s;Tc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++Ce,++_e,Rn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,a,h)}else{let y=a?s.add(a):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function ni(n,t,e,s,i,o,a){It(n,t,void 0,e,s,!1,void 0,i,o,a)}function th(n,t,e=W,s=rn,i=0,o=G,a=!1,r){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!r||!o,"context only supported in canvas 2D mode"),o&&G){f(!!g,"WebGL is not enabled!"),a&&(n=Is(n),t=t.scale(1/H),i+=Q);let c=[],l=[],u=t.x/2,h=t.y/2,p=e.rgbaInt(),d=s.rgbaInt(),y=ct(-i),x=st(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,C=w*x+_*y,A=v&2?p:d;c.push(b(n.x+S,n.y+C)),l.push(A)}Jr(c,l)}else++Ce,++_e,Rn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},a,r)}function eh(n,t,e,s=0,i=W,o=0,a,r=G,c=!1,l){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(O(e),"wrapCount must be a vec2"),f(U(i),"color is invalid"),f(L(o),"angle must be a number"),f(!a||U(a),"additiveColor must be a color"),f(!l||!r,"context only supported in canvas 2D mode"),f(!(s instanceof Re),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),z)return;let u=typeof s=="number"?cn[s]:s;if(f(u instanceof Ue,"texture not loaded"),f(u.size.x>0,"texture not loaded"),f(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),r&&G){f(!!g,"WebGL is not enabled!"),c&&([n,t,o]=Ms(n,t,o)),Fr(u.glTexture),Ts(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),a&&a.rgbaInt());return}++Ce,++_e,c||(n=Pn(n),t=t.scale(H),o-=Q);let h=!Pi||(a?ei(i.add(a))&&a.a<=0:ei(i)),p=!h&&a&&!Sr(a),d=h?u.image:ch(u.image,i,a);l=l||Et,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=p?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function mo(n,t=.1,e=W,s=!1,i=b(),o=0,a=G,r=!1,c){if(f(de(n),"points must be an array"),f(L(t),"width must be a number"),f(U(e),"color is invalid"),f(O(i),"pos must be a vec2"),f(L(o),"angle must be a number"),f(!c||!a,"context only supported in canvas 2D mode"),a&&G){f(!!g,"WebGL is not enabled!");let l=b(1);r&&([i,l,o]=Ms(i,l,o)),zr(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++Ce,++_e,Rn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&zr(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Rn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},r,c)}function ic(n,t=b(1),e=W,s=0,i=0,o=it,a=G,r=!1,c){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(o),"color is invalid"),f(L(s),"angle must be a number"),f(L(i),"lineWidth must be a number"),f(i>=0,"lineWidth must be a positive value or 0"),f(!c||!a,"context only supported in canvas 2D mode"),i=N(i,0,tt(t.x,t.y)),a&&G?sc(n,t,Ps,e,i,o,s,a,r,c):Rn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},r,c)}function si(n,t=1,e=W,s=0,i=it,o=G,a=!1,r){f(L(t),"size must be a number"),ic(n,b(t),e,0,s,i,o,a,r)}function oc(n,t=b(1),e=W,s=rn,i=0,o=G,a=!1,r){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!r||!o,"context only supported in canvas 2D mode"),!z)if(o&&G){f(!!g,"WebGL is not enabled!"),a&&(n=Is(n),t=t.scale(1/H),i+=Q);let c=Ps,l=t.x/2,u=t.y/2,h=e.rgbaInt(),p=s.rgbaInt(),d=nh++,y=ct(-i),x=st(-i),v=C=>{let A=st(C)*l,T=ct(C)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*X*2,_=[v(w)],S=[p];for(let C=c;C--;){let A=(C+d)%c/c*X*2;_.push(n),S.push(h),_.push(v(A)),S.push(p)}Jr(_,S)}else++Ce,++_e,Rn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},a,r)}function sh(n,t=1,e=W,s=rn,i=G,o=!1,a){f(L(t),"size must be a number"),oc(n,b(t),e,s,0,i,o,a)}function Rn(n,t,e=0,s=!1,i,o=!1,a=Et){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(L(e),"angle must be a number"),f(typeof i=="function","drawFunction must be a function"),o||(n=Pn(n),t=t.scale(H),e-=Q),a.save(),a.translate(n.x+.5,n.y+.5),a.rotate(e),a.scale(s?-t.x:t.x,-t.y),i(a),a.restore()}function ih(n,t,e=1,s=W,i=0,o=it,a="center",r=Rs,c="",l,u=0,h=Et){t=Pn(t),e*=H,i*=H,u-=Q,u*=-1,nn(n,t,e,s,i,o,a,r,c,l,u,h)}function nn(n,t,e,s=W,i=0,o=it,a="center",r=Rs,c="",l,u=0,h=Et){f(V(n),"text must be a string"),f(O(t),"pos must be a vec2"),f(L(e),"size must be a number"),f(U(s),"color must be a color"),f(L(i),"lineWidth must be a number"),f(U(o),"lineColor must be a color"),f(["left","center","right"].includes(a),"align must be left, center, or right"),f(V(r),"font must be a string"),f(V(c),"fontStyle must be a string"),f(L(u),"angle must be a number");let p=(n+"").split(`
-`),d=t.y-(p.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=a,h.font=c+" "+e+"px "+r,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;p.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function Ta(n,t){f(L(n),"textureIndex must be a number"),f(!cn[n],"textureIndex is already loaded!"),f(!t||V(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),cn[n]=new Ue(e)}function Is(n){f(O(n),"screenPos must be a vec2");let t=(n.x-I.x/2+.5)/H,e=(n.y-I.y/2+.5)/-H;if(Q){let s=ct(-Q),i=st(-Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ot(t+_t.x,e+_t.y)}function Pn(n){f(O(n),"worldPos must be a vec2");let t=n.x-_t.x,e=n.y-_t.y;if(Q){let s=ct(Q),i=st(Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ot(t*H+I.x/2-.5,e*-H+I.y/2-.5)}function rc(n){f(O(n),"screenDelta must be a vec2");let t=n.x/H,e=n.y/-H;if(Q){let s=ct(-Q),i=st(-Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ot(t,e)}function oh(n){f(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(Q){let s=ct(Q),i=st(Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ot(t*H,e*-H)}function Ms(n,t,e=0){return f(O(n),"screenPos must be a vec2"),f(O(t),"screenSize must be a vec2"),f(L(e),"screenAngle must be a number"),[Is(n),t.scale(1/H),e+Q]}function ac(){return I.scale(1/H)}function rh(n,t,e,s){f(O(n),"center must be a vec2"),f(O(t),"size must be a vec2");let i=p(e),o=p(s),a=t.x+i.left+i.right,r=t.y+i.top+i.bottom,c=I.x-o.left-o.right,l=I.y-o.top-o.bottom;if(!(a>0&&r>0&&c>0&&l>0))return H;H=tt(c/a,l/r);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/H);return _t=n.add(u).add(h),H;function p(d){return(d===void 0||L(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(f(O(n),"pos must be a vec2"),f(O(t)||L(t),"size must be a vec2 or number"),!H)return!1;let e=n.x-_t.x,s=n.y-_t.y;if(Q){let a=ct(Q),r=st(Q),c=e*a-s*r,l=e*r+s*a;e=c,s=l}e*=H*2,s*=-H*2,t instanceof ot&&(t=t.length()),t*=H;let i=I.x,o=I.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=r,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new Ue(n),a=new Re(t,e,o,s,i);lc=new ii(a)}function fh(n=!0){Fn=n}function ph(n){Er=n}function gh(){return Qe==="mouse"}function yh(){return Qe==="keyboard"}function mh(){return Qe==="gamepad"}function Cr(n,t=0,e=!0,s=!0,i=!0){Y[t]&&(Y[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function ks(){Y.length=0,Y[0]=[],oe.length=0,An.length=0,Gs.length=0,ve.length=0,pn.length=0}function Dt(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&1)}function kt(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&2)}function _r(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){f(V(n),"up key must be a string"),f(V(t),"down key must be a string"),f(V(e),"left key must be a string"),f(V(s),"right key must be a string");let i=o=>Dt(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function cs(n){return f(L(n),"mouse button must be a number"),Dt(n)}function ps(n){return f(L(n),"mouse button must be a number"),kt(n)}function xh(n){return f(L(n),"mouse button must be a number"),_r(n)}function De(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),Dt(n,t+1)}function Rr(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),kt(n,t+1)}function vh(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),_r(n,t+1)}function gs(n,t=mt){var e,s;return f(L(n),"stick must be a number"),f(L(t),"gamepad must be a number"),(s=(e=ve[t])==null?void 0:e[n])!=null?s:b()}function bo(n=mt){var t;return f(L(n),"gamepad must be a number"),(t=pn[n])!=null?t:b()}function xo(n=mt){return f(L(n),"gamepad must be a number"),!!Y[n+1]}function uc(n=mt){var t,e;return f(L(n),"gamepad must be a number"),(e=(t=ve[n])==null?void 0:t.length)!=null?e:0}function Sh(n=mt,t=200,e=1,s=1,i=0){var a,r,c;if(f(L(n),"gamepad must be a number"),!Os||z)return;let o=(a=navigator==null?void 0:navigator.getGamepads)==null?void 0:a.call(navigator)[n];(c=(r=o==null?void 0:o.vibrationActuator)==null?void 0:r.playEffect)==null||c.call(r,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=mt){var e,s,i;if(f(L(n),"gamepad must be a number"),!Os||z)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function Pr(n=100){var t;f(L(n)||de(n),"pattern must be a number or array"),Os&&!z&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){Pr(0)}function Ah(){var n;!ie&&((n=B.requestPointerLock)==null||n.call(B))}function Eh(){var n;(n=document.exitPointerLock)==null||n.call(document)}function hc(){return document.pointerLockElement===B}function Ch(){if(z)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",a),document.addEventListener("wheel",r,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),ie&&yn&&u();function n(p){if(p.repeat||(Y[0][p.code]=3,rs&&(Y[0][e(p.code)]=3)),!Fn||!p.cancelable||!document.hasFocus()||p.ctrlKey||p.metaKey||p.altKey||x(p.target)||x(document.activeElement))return;let d=typeof p.key=="string"&&p.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(p.code)||d)&&p.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(p){Y[0][p.code]=Y[0][p.code]&2|4,rs&&(Y[0][e(p.code)]=4)}function e(p){return rs?p==="KeyW"?"ArrowUp":p==="KeyS"?"ArrowDown":p==="KeyA"?"ArrowLeft":p==="KeyD"?"ArrowRight":p:p}function s(p){if(ie&&yn)return;qt&&!z&&ft&&!ms()&&ft.resume(),Y[0][p.button]=3;let d=zt;zt=h(b(p.x,p.y)),xe=xe.add(zt.subtract(d)),Fn&&p.cancelable&&document.hasFocus()&&p.preventDefault()}function i(p){ie&&yn||(Y[0][p.button]=Y[0][p.button]&2|4)}function o(p){oi=!0;let d=zt;zt=h(b(p.x,p.y));let y=hc()?b(p.movementX,p.movementY):zt.subtract(d);xe=xe.add(y)}function a(){oi=!1}function r(p){p.ctrlKey||(Ar+=ne(p.deltaY)),Fn&&p.cancelable&&document.hasFocus()&&p.preventDefault()}function c(p){p.preventDefault()}function l(){ks(),je.clear(),oe.length=0,An.length=0,Gs.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let p;function d(y){if(yn){if(qt&&!z&&ft&&!ms()&&ft.resume(),!an||mr){let x=S=>ys.includes(S.target)||S.target===gn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),C=zt;zt=h(S),p?xe=xe.add(zt.subtract(C)):Y[0][_]=3}else p&&(Y[0][_]=Y[0][_]&2|4);p=w}return Fn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(p){let d=B.getBoundingClientRect(),y=jt(p.x,d.left,d.right),x=jt(p.y,d.top,d.bottom);return b(y*B.width,x*B.height)}}function Ea(){if(z)return;!(yn&&ie)&&!document.hasFocus()&&ks(),Oe=Is(zt),Tr=rc(xe),Rh(),t(),n();function n(){let e=cs(0)||cs(1)||cs(2)||xe.length()>Er,s=!1;for(let o=uc();o--&&!s;)s=gs(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=De(o);let i=!1;for(let o in Y[0])if(isNaN(+o)&&Y[0][o]&1){i=!0;break}s?Qe="gamepad":e?Qe="mouse":i&&(Qe="keyboard"),Bn=Qe==="gamepad"}function t(){var a,r,c,l,u,h,p;let e=d=>{let v=w=>w>.3?jt(w,.3,.8):w<-.3?-jt(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(an&&ie){if(f(!_n||!$n,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),f(!Kn||!Yn,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Vn.isSet())return;mt=0;let d=(a=ve[0])!=null?a:ve[0]=[],y=(r=pn[0])!=null?r:pn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!Ve(v))continue;let w=Dr(v);d[w]=b();let _=(c=An[v])!=null?c:b();if(Ls)d[w]=e(_);else if(_.lengthSquared()>.3){let S=N($s(_.x),-1,1),C=N($s(_.y),-1,1);d[w]=b(S,-C).clampLength(),w||y.set(S,-C)}}let x=(l=Y[1])!=null?l:Y[1]=[];for(let v=12;v--;){let w=De(v,0);x[v]=oe[v]?w?1:3:w?4:0,ti&&x[v]===3&&(v===9||Ph(v))&&Pr(ti)}return}try{if(!Mi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!Ft&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=tt(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let C=y.buttons[S],A=De(S,d);x[S]=C.pressed?A?1:3:A?4:0,C.pressed&&(!C.value||C.value>.9)&&(_=!0)}_&&(co[d]=!0,co[mt]||(mt=d)),y.mapping==="standard"&&w.set((De(15,d)&&1)-(De(14,d)&&1),(De(12,d)&&1)-(De(13,d)&&1)),yr&&(w.x||w.y)&&(v[0]=w.clampLength())}an&&Bn&&Vn.unset()}}function Ca(){if(!z){for(let n of Y)for(let t in n)n[t]&=1;Ar=0,Tr=b(),xe=b()}}function _h(){Ih()}function Rh(){if(Ye||!an||!ie||z||!document.body)return;let n=Ye=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=dc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Lr=document.createElementNS(ai,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>_a(o)),i.addEventListener("pointercancel",o=>_a(o)),t.appendChild(i),i};ys[0]=s(),ys[1]=s(),gn=s(),addEventListener("resize",()=>Wn=!0),document.body.appendChild(n),Wn=!0}function ki(){return dc.getBoundingClientRect()}function Ve(n){return n?Kn:_n}function Ln(n){return n?Yn:$n}function Or(n){return n?0:4}function Dr(n){return n&&_n?1:0}function qn(n){return Ve(n)||Ln(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Or(t);if(!Ve(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+a;if(Ae){for(let o of ys)o.style.display="none";fe?(i(gn,"inset:0"),gn.style.display=""):gn.style.display="none"}else{for(let a=0;a<2;a++){let r=ys[a],c=a?"right":"left";if(r.style.display=qn(a)?"":"none",ln){let l=qn(a?0:1)?"50%":"100%";i(r,`${c}:0;bottom:0;width:${l};height:60%`)}else i(r,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}gn.style.display=fe?"":"none";let o=fe;i(gn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),Wn=!1}function Oh(n,t){let e=Lr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=fc={face:[],thumb:[]},i=Wt,o=(r,c,l,u)=>{let h=document.createElementNS(ai,"circle");return h.setAttribute("cx",r),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},a=r=>{let c=i*.18,l=i*.5,u=r.x,h=r.y,p=document.createElementNS(ai,"path");p.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(p)};for(let r=0;r<2;r++){let c=Ln(r),l=Or(r),u=Ne(r,n,t);if(Ve(r))Ls?o(u.x,u.y,i/2):a(u),s.thumb[r]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?p:tt(p,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(p,i/2);c===2&&(y.x*=-1),r||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}Ft&&vn&&Dh(n,t)}function Dh(n,t){let e=Wt,s=Lr,i=(a,r,c)=>{let l=document.createElementNS(ai,a);for(let u in r)l.setAttribute(u,r[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(a,r,c)=>i("circle",{cx:a.x,cy:a.y,r},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let a=0;a<2;a++)if(Ve(a))if(ln){let r=t*.4,c=!qn(a?0:1),l=c?0:a?n/2:0;i("rect",{x:l,y:r,width:c?n:n/2,height:t-r},"#0ff")}else o(Ne(a,n,t),2*e,"#0ff");else Ln(a)>=1&&o(Ne(a,n,t),e,"#0ff");if(fe){o(b(n/2,t/2),fe,"#ff0");for(let a=0;a<2;a++)qn(a)&&o(Ne(a,n,t),2*e,"#f0f")}}function Ih(){var l;if(!Ye||z)return;if(!an||!ie){Ye.style.display!=="none"&&(Ye.style.display="none",je.clear(),oe.length=0,An.length=0,Gs.length=0);return}Ye.style.display="";let n=Ft&&vn,t=[Yn,$n,_n,Kn,Ls,Wt,ln,fe,Ae,n].join();t!==Aa&&(Aa=t,Wn=!0),Wn&&Lh();let e=as?jt(Vn.get(),as+1,as):1,s=n||Vn.isSet()&&e>0&&!Ae;if(Ye.style.opacity=s?n?1:e*br:0,!s)return;let i=ki(),o=i.width,a=i.height,r=Wt,c=fc;if(c){for(let u=0;u<2;u++)if(Ve(u)&&c.thumb[u]){let p=Ne(u,o,a).add(((l=An[u])!=null?l:b()).scale(r/2));c.thumb[u].setAttribute("cx",p.x),c.thumb[u].setAttribute("cy",p.y)}for(let u=0;u=Wt)return-1;if(i===1)return o;let r=a.subtract(t);n||(r.x*=-1);let c=i===2?r.xo:r&&Ne(a,t,e).distance(n)<2*s)return{role:"stick",side:a}}else if(Ln(a)>=1){let c=kh(a,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(fe){for(let a=0;a<2;a++)if(qn(a)&&Ne(a,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),p.buffer=h,p.playbackRate.value=e,p.loop=i,a=a||ft.createGain(),a.gain.value=t,a.connect(ze);let d=new StereoPannerNode(ft,{pan:N(s,-1,1)});p.connect(d).connect(a),p.addEventListener("ended",()=>{a.disconnect(),d.disconnect(),c&&c(p)});let y=r*e;return p.start(0,y),Ft&&Jn&&xt("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),p}function Jh(...n){return Ir([Gi(...n)])}function Gi(n=1,t=.05,e=220,s=0,i=0,o=.1,a=0,r=1,c=0,l=0,u=0,h=0,p=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,C=0){let A=Qn,T=X*2,P=c*=500*T/A/A,M=e*=(1+dt(t,-t))*T/A,pt=0,rt=0,at=0,yt=1,Bt,ge=[],Pt=0,ht=0,Lt=0,We,un=2,hn=T*nt(C)*2/A,ae=ct(hn),Pe=st(hn)/2/un,Zt=1+Pe,R=-2*ae/Zt,F=(1-Pe)/Zt,k=(1+ne(C)*ae)/2/Zt,j=-(ne(C)+ae)/Zt,$=k,Z=0,Tt=0,At=0,Ot=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,p=p*A|0,Bt=s+_+i+o+v|0;ht1?a>2?a>3?a>4?Pt/T%14?Lt:ne(Lt)*nt(Lt)**r)*(htht?0:(hth&&(e+=u,M+=u,yt=0),p&&!(++rt%p)&&(e=M,c=P,yt||(yt=1));return ge}function li(n,t=!0){for(let e of sn)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function $e(n,t=b(),e,s=!0){for(let i of sn)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function yc(n,t,e,s,i=!0){let o,a,r,c=s&&b();for(let l of sn)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{G=!1,et.style.display="none",e.preventDefault(),xt("WebGL context lost! Switching to Canvas2d rendering.");for(let s of ls)s.glTexture=void 0;Kt=void 0,Ct=0,En=!1,bn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),et.addEventListener("webglcontextrestored",()=>{G=!0,et.style.display="",xt("WebGL context restored, reinitializing..."),t();for(let e of ls)e.glTexture=ji(e.image,e.wrap);bn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){di=Xn(`#version 300 es
+`,o+=s.toString(),nn(o,Jt,24,J(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let a=9,r=0,c=24;if(Me){e.fillText(`${Hs} v${Xs}`,a,r+=c/2),e.fillText("Time: "+ar(Kt),a,r+=c),e.fillText("FPS: "+Ys.toFixed(1)+(G?" WebGL":" Canvas2D"),a,r+=c),e.fillText("Objects: "+vt.length,a,r+=c),e.fillText("Draw Calls: "+Ce,a,r+=c),e.fillText("Primitives: "+_e,a,r+=c),e.fillText("---------",a,r+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",a,r+=c),e.fillStyle=ue?"#f00":"#fff",e.fillText("1: Debug Physics",a,r+=c),e.fillStyle=xn?"#f00":"#fff",e.fillText("2: Debug Particles",a,r+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("3: Debug Gamepads",a,r+=c),e.fillStyle=he?"#f00":"#fff",e.fillText("4: Debug Raycasts",a,r+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",a,r+=c),e.fillText("6: Toggle Video Capture",a,r+=c),e.fillStyle=Jn?"#f00":"#fff",e.fillText("7: Debug Sound",a,r+=c);let l="",u="";for(let h in Y[0])It(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,a,r+=c),l&&e.fillText("Keys: "+l,a,r+=c);for(let h=1;hs.push(r.data),i.onstop=()=>{let r=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(r);ds(c,"capture.webm",1e3)};let o,a;if(Ht){a=new ConstantSourceNode(ft,{offset:0}),a.connect(Je),a.start(),o=ft.createMediaStreamDestination(),Je.connect(o);for(let r of o.stream.getAudioTracks())n.addTrack(r)}try{i.start()}catch{xt("Video capture not supported in this browser!"),a==null||a.stop();return}xt("Video capture started."),ke={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:a,audioStreamDestination:o}}function Ba(){var n,t,e;f(Te(),"Not capturing video!"),xt(`Video capture ended. ${ke.captureTimer.get().toFixed(2)} seconds recorded.`),le.style.display="none",(n=ke.silentAudioSource)==null||n.stop(),(t=ke.mediaRecorder)==null||t.stop(),(e=ke.videoTrack)==null||e.stop(),ke=void 0}function Bl(){f(Te(),"Not capturing video!"),wr(),ke.videoTrack.requestFrame(),le.textContent="\u25CF REC "+ar(ke.captureTimer)}function Zt(n){if(jt){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{f(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function se(n,t=1){return(n%t+t)%t}function N(n,t=0,e=1){return ne?e:n}function Bt(n,t,e){return(e-=t)?N((n-t)/e):0}function Wt(n,t,e){return n+N(e)*(t-n)}function Nl(n,t,e,s,i){return Wt(s,i,Bt(n,t,e))}function ir(n,t,e=1){f(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ua(n,t,e,s=1){return n+N(e)*ir(t,n,s)}function zl(n,t){return ir(n,t,2*X)}function Jl(n,t,e){return Ua(n,t,e,2*X)}function Ks(n){return n*n*(3-2*n)}function hs(n){return!(n&n-1)}function Ul(n){return 2**us(za(n))}function Qs(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,a=t.x+s.x,r=t.y+s.y;return nt(i)p)return!1;h=K(y,h)}else{if(y0?r.x+1:r.x,x=h>0?r.y+1:r.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,C=w,A=pr.x&&(T.x=r.x+1-P),M.yr.y&&(T.y=r.y+1-P),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;f(V(n),"shareURL requires title string"),f(V(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){f(V(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{xt("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{xt("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){f(V(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{xt("writeSaveData: failed to write",n)}}function yo(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=St(n);return Wt(yo(t),yo(t+1),Ks(n-t))}function tu(n,t){let e=St(n),s=St(t),i=Ks(n-e),o=Ks(t-s),a=(r,c)=>yo(r+c*374761393);return Wt(Wt(a(e,s),a(e+1,s),i),Wt(a(e,s+1),a(e+1,s+1),i),o)}function eu(n){_t=n.copy()}function nu(n){Q=n}function su(n){H=n}function iu(n){cr=n}function ou(n){Pi=n}function ru(n){tn=n.copy()}function au(n){Mn=n.copy()}function cu(n){os=n}function lu(n){kn=n}function uu(n){Gn=n.copy()}function nc(n){lr=n,B&&(B.style.imageRendering=n?"pixelated":""),et&&(et.style.imageRendering=n?"pixelated":"")}function hu(n){Tn=n}function du(n){en=n}function fu(n){Rs=n}function pu(n){ur=n}function gu(n){z=n}function yu(n){if(n&&!Ao){console.warn("Can not enable WebGL if it was disabled on start.");return}G=n,et&&(et.style.display=n?"":"none")}function mu(n){Ps=n}function bu(n){Li=n.copy()}function xu(n){Oi=n}function vu(n){Di=n}function Su(n){Ii=n}function wu(n){hr=n}function Tu(n){dr=n}function Au(n){fr=n}function Eu(n){pr=n}function Cu(n){gr=n}function _u(n){Fe=n}function Ru(n){Vt=n.copy()}function Pu(n){Zs=n}function Lu(n){Mi=n}function Ou(n){yr=n}function Du(n){rs=n}function Iu(n){yn=n}function Mu(n){an=n}function ku(n){mr=n}function Gu(n){fe=n}function Fu(n){Yn=n,n>0&&(Kn=!1)}function ju(n){_n=n,n&&($n=0)}function Bu(n){$n=n,n>0&&(_n=!1)}function Nu(n){Kn=n,n&&(Yn=0)}function zu(n){Ls=n}function Ju(n){ln=n}function Uu(n){qt=n}function Vu(n){br=n}function Wu(n){as=n}function qu(n){ti=n}function Hu(n){Os=n}function Xu(n){Ht=n}function Yu(n){Sn=n,Ht&&!z&&Je&&(Je.gain.value=n)}function $u(n){xr=n}function Ku(n){vr=n}function Qu(n){Ri=n}function Zu(n){Ga=n}function ei(n){return n.r>=1&&n.g>=1&&n.b>=1}function Sr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Ds(n=0,t=Li,e=0,s=Oi,i=Di){if(f(O(n)||typeof n=="number","index must be a vec2 or number"),f(O(t)||typeof t=="number","size must be a vec2 or number"),f(L(e)||e instanceof Ve,"texture must be a number or TextureInfo"),f(L(s),"padding must be a number"),z)return new Re;typeof t=="number"&&(f(t>0),t=new rt(t,t));let o=typeof e=="number"?cn[e]:e;f(o instanceof Ve,"tile texture is not loaded"),f(o.size.x>0,"tile texture is not loaded");let a=t.x+s*2,r=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/a|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new rt(c*a+s,l*r+s);return new Re(u,t,o,s,i)}function Mt(n,t=b(1),e,s=W,i=0,o,a,r=G,c=!1,l){var p;f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!a||U(a),"additiveColor must be a color"),f(!l||!r,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(p=e==null?void 0:e.bleed)!=null?p:0;if(r&&G)if(f(!!g,"WebGL is not enabled!"),c&&([n,t,i]=Ms(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(Fr(u.glTexture),h){let _=d.x*h,S=d.y*h;Ts(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),a&&a.rgbaInt())}else Ts(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),a&&a.rgbaInt())}else{let d=a?s.add(a):s;Tc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++Ce,++_e,Rn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,a,h)}else{let y=a?s.add(a):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function ni(n,t,e,s,i,o,a){Mt(n,t,void 0,e,s,!1,void 0,i,o,a)}function th(n,t,e=W,s=rn,i=0,o=G,a=!1,r){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!r||!o,"context only supported in canvas 2D mode"),o&&G){f(!!g,"WebGL is not enabled!"),a&&(n=Is(n),t=t.scale(1/H),i+=Q);let c=[],l=[],u=t.x/2,h=t.y/2,p=e.rgbaInt(),d=s.rgbaInt(),y=lt(-i),x=st(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,C=w*x+_*y,A=v&2?p:d;c.push(b(n.x+S,n.y+C)),l.push(A)}Jr(c,l)}else++Ce,++_e,Rn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},a,r)}function eh(n,t,e,s=0,i=W,o=0,a,r=G,c=!1,l){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(O(e),"wrapCount must be a vec2"),f(U(i),"color is invalid"),f(L(o),"angle must be a number"),f(!a||U(a),"additiveColor must be a color"),f(!l||!r,"context only supported in canvas 2D mode"),f(!(s instanceof Re),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),z)return;let u=typeof s=="number"?cn[s]:s;if(f(u instanceof Ve,"texture not loaded"),f(u.size.x>0,"texture not loaded"),f(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),r&&G){f(!!g,"WebGL is not enabled!"),c&&([n,t,o]=Ms(n,t,o)),Fr(u.glTexture),Ts(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),a&&a.rgbaInt());return}++Ce,++_e,c||(n=Pn(n),t=t.scale(H),o-=Q);let h=!Pi||(a?ei(i.add(a))&&a.a<=0:ei(i)),p=!h&&a&&!Sr(a),d=h?u.image:ch(u.image,i,a);l=l||Et,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=p?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function mo(n,t=.1,e=W,s=!1,i=b(),o=0,a=G,r=!1,c){if(f(de(n),"points must be an array"),f(L(t),"width must be a number"),f(U(e),"color is invalid"),f(O(i),"pos must be a vec2"),f(L(o),"angle must be a number"),f(!c||!a,"context only supported in canvas 2D mode"),a&&G){f(!!g,"WebGL is not enabled!");let l=b(1);r&&([i,l,o]=Ms(i,l,o)),zr(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++Ce,++_e,Rn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&zr(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Rn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},r,c)}function ic(n,t=b(1),e=W,s=0,i=0,o=it,a=G,r=!1,c){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(o),"color is invalid"),f(L(s),"angle must be a number"),f(L(i),"lineWidth must be a number"),f(i>=0,"lineWidth must be a positive value or 0"),f(!c||!a,"context only supported in canvas 2D mode"),i=N(i,0,tt(t.x,t.y)),a&&G?sc(n,t,Ps,e,i,o,s,a,r,c):Rn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},r,c)}function si(n,t=1,e=W,s=0,i=it,o=G,a=!1,r){f(L(t),"size must be a number"),ic(n,b(t),e,0,s,i,o,a,r)}function oc(n,t=b(1),e=W,s=rn,i=0,o=G,a=!1,r){if(f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(U(e)&&U(s),"color is invalid"),f(L(i),"angle must be a number"),f(!r||!o,"context only supported in canvas 2D mode"),!z)if(o&&G){f(!!g,"WebGL is not enabled!"),a&&(n=Is(n),t=t.scale(1/H),i+=Q);let c=Ps,l=t.x/2,u=t.y/2,h=e.rgbaInt(),p=s.rgbaInt(),d=nh++,y=lt(-i),x=st(-i),v=C=>{let A=st(C)*l,T=lt(C)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*X*2,_=[v(w)],S=[p];for(let C=c;C--;){let A=(C+d)%c/c*X*2;_.push(n),S.push(h),_.push(v(A)),S.push(p)}Jr(_,S)}else++Ce,++_e,Rn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},a,r)}function sh(n,t=1,e=W,s=rn,i=G,o=!1,a){f(L(t),"size must be a number"),oc(n,b(t),e,s,0,i,o,a)}function Rn(n,t,e=0,s=!1,i,o=!1,a=Et){f(O(n),"pos must be a vec2"),f(O(t),"size must be a vec2"),f(L(e),"angle must be a number"),f(typeof i=="function","drawFunction must be a function"),o||(n=Pn(n),t=t.scale(H),e-=Q),a.save(),a.translate(n.x+.5,n.y+.5),a.rotate(e),a.scale(s?-t.x:t.x,-t.y),i(a),a.restore()}function ih(n,t,e=1,s=W,i=0,o=it,a="center",r=Rs,c="",l,u=0,h=Et){t=Pn(t),e*=H,i*=H,u-=Q,u*=-1,nn(n,t,e,s,i,o,a,r,c,l,u,h)}function nn(n,t,e,s=W,i=0,o=it,a="center",r=Rs,c="",l,u=0,h=Et){f(V(n),"text must be a string"),f(O(t),"pos must be a vec2"),f(L(e),"size must be a number"),f(U(s),"color must be a color"),f(L(i),"lineWidth must be a number"),f(U(o),"lineColor must be a color"),f(["left","center","right"].includes(a),"align must be left, center, or right"),f(V(r),"font must be a string"),f(V(c),"fontStyle must be a string"),f(L(u),"angle must be a number");let p=(n+"").split(`
+`),d=t.y-(p.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=a,h.font=c+" "+e+"px "+r,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;p.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function Ta(n,t){f(L(n),"textureIndex must be a number"),f(!cn[n],"textureIndex is already loaded!"),f(!t||V(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),cn[n]=new Ve(e)}function Is(n){f(O(n),"screenPos must be a vec2");let t=(n.x-I.x/2+.5)/H,e=(n.y-I.y/2+.5)/-H;if(Q){let s=lt(-Q),i=st(-Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new rt(t+_t.x,e+_t.y)}function Pn(n){f(O(n),"worldPos must be a vec2");let t=n.x-_t.x,e=n.y-_t.y;if(Q){let s=lt(Q),i=st(Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new rt(t*H+I.x/2-.5,e*-H+I.y/2-.5)}function rc(n){f(O(n),"screenDelta must be a vec2");let t=n.x/H,e=n.y/-H;if(Q){let s=lt(-Q),i=st(-Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new rt(t,e)}function oh(n){f(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(Q){let s=lt(Q),i=st(Q),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new rt(t*H,e*-H)}function Ms(n,t,e=0){return f(O(n),"screenPos must be a vec2"),f(O(t),"screenSize must be a vec2"),f(L(e),"screenAngle must be a number"),[Is(n),t.scale(1/H),e+Q]}function ac(){return I.scale(1/H)}function rh(n,t,e,s){f(O(n),"center must be a vec2"),f(O(t),"size must be a vec2");let i=p(e),o=p(s),a=t.x+i.left+i.right,r=t.y+i.top+i.bottom,c=I.x-o.left-o.right,l=I.y-o.top-o.bottom;if(!(a>0&&r>0&&c>0&&l>0))return H;H=tt(c/a,l/r);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/H);return _t=n.add(u).add(h),H;function p(d){return(d===void 0||L(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(f(O(n),"pos must be a vec2"),f(O(t)||L(t),"size must be a vec2 or number"),!H)return!1;let e=n.x-_t.x,s=n.y-_t.y;if(Q){let a=lt(Q),r=st(Q),c=e*a-s*r,l=e*r+s*a;e=c,s=l}e*=H*2,s*=-H*2,t instanceof rt&&(t=t.length()),t*=H;let i=I.x,o=I.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=r,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new Ve(n),a=new Re(t,e,o,s,i);lc=new ii(a)}function fh(n=!0){Fn=n}function ph(n){Er=n}function gh(){return Qe==="mouse"}function yh(){return Qe==="keyboard"}function mh(){return Qe==="gamepad"}function Cr(n,t=0,e=!0,s=!0,i=!0){Y[t]&&(Y[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function ks(){Y.length=0,Y[0]=[],oe.length=0,An.length=0,Gs.length=0,ve.length=0,pn.length=0}function It(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&1)}function Gt(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&2)}function _r(n,t=0){var e;return f(V(n),"key must be a number or string"),f(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){f(V(n),"up key must be a string"),f(V(t),"down key must be a string"),f(V(e),"left key must be a string"),f(V(s),"right key must be a string");let i=o=>It(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function cs(n){return f(L(n),"mouse button must be a number"),It(n)}function ps(n){return f(L(n),"mouse button must be a number"),Gt(n)}function xh(n){return f(L(n),"mouse button must be a number"),_r(n)}function Ie(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),It(n,t+1)}function Rr(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),Gt(n,t+1)}function vh(n,t=mt){return f(L(n),"button must be a number"),f(L(t),"gamepad must be a number"),_r(n,t+1)}function gs(n,t=mt){var e,s;return f(L(n),"stick must be a number"),f(L(t),"gamepad must be a number"),(s=(e=ve[t])==null?void 0:e[n])!=null?s:b()}function bo(n=mt){var t;return f(L(n),"gamepad must be a number"),(t=pn[n])!=null?t:b()}function xo(n=mt){return f(L(n),"gamepad must be a number"),!!Y[n+1]}function uc(n=mt){var t,e;return f(L(n),"gamepad must be a number"),(e=(t=ve[n])==null?void 0:t.length)!=null?e:0}function Sh(n=mt,t=200,e=1,s=1,i=0){var a,r,c;if(f(L(n),"gamepad must be a number"),!Os||z)return;let o=(a=navigator==null?void 0:navigator.getGamepads)==null?void 0:a.call(navigator)[n];(c=(r=o==null?void 0:o.vibrationActuator)==null?void 0:r.playEffect)==null||c.call(r,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=mt){var e,s,i;if(f(L(n),"gamepad must be a number"),!Os||z)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function Pr(n=100){var t;f(L(n)||de(n),"pattern must be a number or array"),Os&&!z&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){Pr(0)}function Ah(){var n;!ie&&((n=B.requestPointerLock)==null||n.call(B))}function Eh(){var n;(n=document.exitPointerLock)==null||n.call(document)}function hc(){return document.pointerLockElement===B}function Ch(){if(z)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",a),document.addEventListener("wheel",r,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),ie&&yn&&u();function n(p){if(p.repeat||(Y[0][p.code]=3,rs&&(Y[0][e(p.code)]=3)),!Fn||!p.cancelable||!document.hasFocus()||p.ctrlKey||p.metaKey||p.altKey||x(p.target)||x(document.activeElement))return;let d=typeof p.key=="string"&&p.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(p.code)||d)&&p.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(p){Y[0][p.code]=Y[0][p.code]&2|4,rs&&(Y[0][e(p.code)]=4)}function e(p){return rs?p==="KeyW"?"ArrowUp":p==="KeyS"?"ArrowDown":p==="KeyA"?"ArrowLeft":p==="KeyD"?"ArrowRight":p:p}function s(p){if(ie&&yn)return;Ht&&!z&&ft&&!ms()&&ft.resume(),Y[0][p.button]=3;let d=Jt;Jt=h(b(p.x,p.y)),xe=xe.add(Jt.subtract(d)),Fn&&p.cancelable&&document.hasFocus()&&p.preventDefault()}function i(p){ie&&yn||(Y[0][p.button]=Y[0][p.button]&2|4)}function o(p){oi=!0;let d=Jt;Jt=h(b(p.x,p.y));let y=hc()?b(p.movementX,p.movementY):Jt.subtract(d);xe=xe.add(y)}function a(){oi=!1}function r(p){p.ctrlKey||(Ar+=ne(p.deltaY)),Fn&&p.cancelable&&document.hasFocus()&&p.preventDefault()}function c(p){p.preventDefault()}function l(){ks(),Be.clear(),oe.length=0,An.length=0,Gs.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let p;function d(y){if(yn){if(Ht&&!z&&ft&&!ms()&&ft.resume(),!an||mr){let x=S=>ys.includes(S.target)||S.target===gn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),C=Jt;Jt=h(S),p?xe=xe.add(Jt.subtract(C)):Y[0][_]=3}else p&&(Y[0][_]=Y[0][_]&2|4);p=w}return Fn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(p){let d=B.getBoundingClientRect(),y=Bt(p.x,d.left,d.right),x=Bt(p.y,d.top,d.bottom);return b(y*B.width,x*B.height)}}function Ea(){if(z)return;!(yn&&ie)&&!document.hasFocus()&&ks(),De=Is(Jt),Tr=rc(xe),Rh(),t(),n();function n(){let e=cs(0)||cs(1)||cs(2)||xe.length()>Er,s=!1;for(let o=uc();o--&&!s;)s=gs(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=Ie(o);let i=!1;for(let o in Y[0])if(isNaN(+o)&&Y[0][o]&1){i=!0;break}s?Qe="gamepad":e?Qe="mouse":i&&(Qe="keyboard"),Bn=Qe==="gamepad"}function t(){var a,r,c,l,u,h,p;let e=d=>{let v=w=>w>.3?Bt(w,.3,.8):w<-.3?-Bt(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(an&&ie){if(f(!_n||!$n,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),f(!Kn||!Yn,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Vn.isSet())return;mt=0;let d=(a=ve[0])!=null?a:ve[0]=[],y=(r=pn[0])!=null?r:pn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!We(v))continue;let w=Dr(v);d[w]=b();let _=(c=An[v])!=null?c:b();if(Ls)d[w]=e(_);else if(_.lengthSquared()>.3){let S=N($s(_.x),-1,1),C=N($s(_.y),-1,1);d[w]=b(S,-C).clampLength(),w||y.set(S,-C)}}let x=(l=Y[1])!=null?l:Y[1]=[];for(let v=12;v--;){let w=Ie(v,0);x[v]=oe[v]?w?1:3:w?4:0,ti&&x[v]===3&&(v===9||Ph(v))&&Pr(ti)}return}try{if(!Mi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!jt&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=tt(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let C=y.buttons[S],A=Ie(S,d);x[S]=C.pressed?A?1:3:A?4:0,C.pressed&&(!C.value||C.value>.9)&&(_=!0)}_&&(co[d]=!0,co[mt]||(mt=d)),y.mapping==="standard"&&w.set((Ie(15,d)&&1)-(Ie(14,d)&&1),(Ie(12,d)&&1)-(Ie(13,d)&&1)),yr&&(w.x||w.y)&&(v[0]=w.clampLength())}an&&Bn&&Vn.unset()}}function Ca(){if(!z){for(let n of Y)for(let t in n)n[t]&=1;Ar=0,Tr=b(),xe=b()}}function _h(){Ih()}function Rh(){if(Ye||!an||!ie||z||!document.body)return;let n=Ye=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=dc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Lr=document.createElementNS(ai,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>_a(o)),i.addEventListener("pointercancel",o=>_a(o)),t.appendChild(i),i};ys[0]=s(),ys[1]=s(),gn=s(),addEventListener("resize",()=>Wn=!0),document.body.appendChild(n),Wn=!0}function ki(){return dc.getBoundingClientRect()}function We(n){return n?Kn:_n}function Ln(n){return n?Yn:$n}function Or(n){return n?0:4}function Dr(n){return n&&_n?1:0}function qn(n){return We(n)||Ln(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Or(t);if(!We(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+a;if(Ae){for(let o of ys)o.style.display="none";fe?(i(gn,"inset:0"),gn.style.display=""):gn.style.display="none"}else{for(let a=0;a<2;a++){let r=ys[a],c=a?"right":"left";if(r.style.display=qn(a)?"":"none",ln){let l=qn(a?0:1)?"50%":"100%";i(r,`${c}:0;bottom:0;width:${l};height:60%`)}else i(r,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}gn.style.display=fe?"":"none";let o=fe;i(gn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),Wn=!1}function Oh(n,t){let e=Lr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=fc={face:[],thumb:[]},i=qt,o=(r,c,l,u)=>{let h=document.createElementNS(ai,"circle");return h.setAttribute("cx",r),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},a=r=>{let c=i*.18,l=i*.5,u=r.x,h=r.y,p=document.createElementNS(ai,"path");p.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(p)};for(let r=0;r<2;r++){let c=Ln(r),l=Or(r),u=ze(r,n,t);if(We(r))Ls?o(u.x,u.y,i/2):a(u),s.thumb[r]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?p:tt(p,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(p,i/2);c===2&&(y.x*=-1),r||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}jt&&vn&&Dh(n,t)}function Dh(n,t){let e=qt,s=Lr,i=(a,r,c)=>{let l=document.createElementNS(ai,a);for(let u in r)l.setAttribute(u,r[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(a,r,c)=>i("circle",{cx:a.x,cy:a.y,r},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let a=0;a<2;a++)if(We(a))if(ln){let r=t*.4,c=!qn(a?0:1),l=c?0:a?n/2:0;i("rect",{x:l,y:r,width:c?n:n/2,height:t-r},"#0ff")}else o(ze(a,n,t),2*e,"#0ff");else Ln(a)>=1&&o(ze(a,n,t),e,"#0ff");if(fe){o(b(n/2,t/2),fe,"#ff0");for(let a=0;a<2;a++)qn(a)&&o(ze(a,n,t),2*e,"#f0f")}}function Ih(){var l;if(!Ye||z)return;if(!an||!ie){Ye.style.display!=="none"&&(Ye.style.display="none",Be.clear(),oe.length=0,An.length=0,Gs.length=0);return}Ye.style.display="";let n=jt&&vn,t=[Yn,$n,_n,Kn,Ls,qt,ln,fe,Ae,n].join();t!==Aa&&(Aa=t,Wn=!0),Wn&&Lh();let e=as?Bt(Vn.get(),as+1,as):1,s=n||Vn.isSet()&&e>0&&!Ae;if(Ye.style.opacity=s?n?1:e*br:0,!s)return;let i=ki(),o=i.width,a=i.height,r=qt,c=fc;if(c){for(let u=0;u<2;u++)if(We(u)&&c.thumb[u]){let p=ze(u,o,a).add(((l=An[u])!=null?l:b()).scale(r/2));c.thumb[u].setAttribute("cx",p.x),c.thumb[u].setAttribute("cy",p.y)}for(let u=0;u=qt)return-1;if(i===1)return o;let r=a.subtract(t);n||(r.x*=-1);let c=i===2?r.xo:r&&ze(a,t,e).distance(n)<2*s)return{role:"stick",side:a}}else if(Ln(a)>=1){let c=kh(a,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(fe){for(let a=0;a<2;a++)if(qn(a)&&ze(a,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),p.buffer=h,p.playbackRate.value=e,p.loop=i,a=a||ft.createGain(),a.gain.value=t,a.connect(Je);let d=new StereoPannerNode(ft,{pan:N(s,-1,1)});p.connect(d).connect(a),p.addEventListener("ended",()=>{a.disconnect(),d.disconnect(),c&&c(p)});let y=r*e;return p.start(0,y),jt&&Jn&&xt("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),p}function Jh(...n){return Ir([Gi(...n)])}function Gi(n=1,t=.05,e=220,s=0,i=0,o=.1,a=0,r=1,c=0,l=0,u=0,h=0,p=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,C=0){let A=Qn,T=X*2,P=c*=500*T/A/A,M=e*=(1+dt(t,-t))*T/A,pt=0,at=0,ct=0,yt=1,Nt,ge=[],Pt=0,ht=0,Lt=0,Pe,un=2,hn=T*nt(C)*2/A,ae=lt(hn),Le=st(hn)/2/un,te=1+Le,R=-2*ae/te,F=(1-Le)/te,k=(1+ne(C)*ae)/2/te,j=-(ne(C)+ae)/te,$=k,Z=0,Tt=0,At=0,Ot=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,p=p*A|0,Nt=s+_+i+o+v|0;ht1?a>2?a>3?a>4?Pt/T%14?Lt:ne(Lt)*nt(Lt)**r)*(htht?0:(hth&&(e+=u,M+=u,yt=0),p&&!(++at%p)&&(e=M,c=P,yt||(yt=1));return ge}function li(n,t=!0){for(let e of sn)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function $e(n,t=b(),e,s=!0){for(let i of sn)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function yc(n,t,e,s,i=!0){let o,a,r,c=s&&b();for(let l of sn)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{G=!1,et.style.display="none",e.preventDefault(),xt("WebGL context lost! Switching to Canvas2d rendering.");for(let s of ls)s.glTexture=void 0;Qt=void 0,Ct=0,En=!1,bn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),et.addEventListener("webglcontextrestored",()=>{G=!0,et.style.display="",xt("WebGL context restored, reinitializing..."),t();for(let e of ls)e.glTexture=ji(e.image,e.wrap);bn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){di=Xn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 g;in vec4 p,u,c,a;in float r;out vec2 v;out vec4 d,e;void main(){vec2 s=(g-.5)*p.zw;gl_Position=m*vec4(p.xy+s*cos(r)-vec2(-s.y,s)*sin(r),1,1);v=mix(u.xw,u.zy,g);d=c;e=a;}`,`#version 300 es
 precision highp float;uniform sampler2D s;in vec2 v;in vec4 d,e;out vec4 c;void main(){c=texture(s,v)*d+e;}`),fi=Xn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 p;in vec4 c;out vec4 d;void main(){gl_Position=m*vec4(p,1,1);d=c;}`,`#version 300 es
-precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(gi);Gt=new Float32Array(e),Ss=new Uint32Array(e),So=g.createBuffer(),Nn=g.createBuffer(),kr=g.createFramebuffer(),Ct=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,Nn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,a,r=(c,l,u,h,p=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&a;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,p),i+=h*u};wo=g.createVertexArray(),g.bindVertexArray(wo),i=0,o=di,a=mc,g.bindBuffer(g.ARRAY_BUFFER,Nn),r("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,So),g.bufferData(g.ARRAY_BUFFER,gi,g.DYNAMIC_DRAW),r("p",g.FLOAT,4,4,1),r("u",g.FLOAT,4,4,1),r("c",g.UNSIGNED_BYTE,1,4,1),r("a",g.UNSIGNED_BYTE,1,4,1),r("r",g.FLOAT,4,1,1),To=g.createVertexArray(),g.bindVertexArray(To),i=0,o=fi,a=bc,r("p",g.FLOAT,4,2),r("c",g.UNSIGNED_BYTE,1,4)}}function ws(n=!1){!n&&!En||(Rt(),En=!1,g.useProgram(di),g.bindVertexArray(wo))}function xc(){En||(Rt(),En=!0,g.useProgram(fi),g.bindVertexArray(To))}function Eo(n=!0){if(!G||!g)return;f(!Ct,"glPreRender called with unflushed batch."),pi||(et.width=I.x,et.height=I.y),g.viewport(0,0,I.x,I.y),n&&vc();let t=b(2*H).divide(I);pi&&(t.y=-t.y);let e=_t.rotate(-Q),s=b(-1).subtract(e.multiply(t)),i=ct(Q),o=st(Q),a=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],r=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};r(fi,"m",a),r(di,"m",a),g.activeTexture(g.TEXTURE0),cn[0]&&(Kt=cn[0].glTexture,g.bindTexture(g.TEXTURE_2D,Kt)),g.bindBuffer(g.ARRAY_BUFFER,So),On=Hn=!1,ws(!0)}function vc(){if(!g)return;let n=tn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function Fr(n){!g||n===Kt||(Rt(),Kt=n,g.bindTexture(g.TEXTURE_2D,Kt))}function Sc(n,t=!0){if(!g||!n)return;let e=n===Kt;e?Rt():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&Kt&&g.bindTexture(g.TEXTURE_2D,Kt)}function Co(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),Ft&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Xn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Co(n,g.VERTEX_SHADER)),g.attachShader(e,Co(t,g.FRAGMENT_SHADER)),g.linkProgram(e),Ft&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ji(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)jr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!Tn&&hs(n.width)&&hs(n.height);else{let r=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,r)}let i=Tn?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let a=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,a),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,a),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Kt),e}function wc(n){g&&g.deleteTexture(n)}function jr(n,t){g&&(f((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!Tn&&hs(t.width)&&hs(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Kt))}function Hh(n){z||(ls.add(n),g&&(n.glTexture?jr(n.glTexture,n.image):n.glTexture=ji(n.image,n.wrap)))}function Xh(n){if(z)return;ls.delete(n);let t=n.glTexture;n.glTexture=void 0,wc(t)}function Rt(){if(G&&g&&Ct){let n=Hn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=Ct*(En?Fi:Gr);g.bufferSubData(g.ARRAY_BUFFER,0,Gt,0,t),En?g.drawArrays(g.TRIANGLE_STRIP,0,Ct):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,Ct),++Ce,_e+=Ct,Ct=0}Hn=On}function Br(n){!G||!g||(Rt(),n.drawImage(et,0,0))}function Yh(n=!0){f(!et,"must be called before engineInit"),Mr=n}function Ts(n,t,e,s,i=0,o=0,a=0,r=1,c=1,l=-1,u=0){(Ct>=Wh||Hn!==On)&&Rt(),ws();let h=Ct++*Gr;Gt[h++]=n,Gt[h++]=t,Gt[h++]=e,Gt[h++]=s,Gt[h++]=o,Gt[h++]=a,Gt[h++]=r,Gt[h++]=c,Ss[h++]=l,Ss[h++]=u,Gt[h++]=i}function Tc(n,t,e,s,i,o){Ts(n,t,e,s,i,0,0,0,0,0,o)}function Nr(n,t,e,s,i,o,a,r=!0){let c=[],l=st(-a),u=ct(-a);for(let p of n){let d=p.x*i,y=p.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=r?Kh(c):c;Ac(h,t)}function zr(n,t,e,s,i,o,a,r,c=!0){let l=$h(n,e,c);Nr(l,t,s,i,o,a,r,!1)}function Ac(n,t){if(!G||n.length<3)return;let e=n.length+2;if((Ct+e>=zn||Hn!==On)&&Rt(),f(e=zn)return;xc();let s=Ct*Fi;for(let i=e;i--;){let o=N(i-1,0,e-3),a=n[o];Gt[s++]=a.x,Gt[s++]=a.y,Ss[s++]=t}Ct+=e}function Jr(n,t){if(!G||n.length<3)return;let e=n.length+2;if((Ct+e>=zn||Hn!==On)&&Rt(),f(e=zn)return;xc();let s=Ct*Fi;for(let i=e;i--;){let o=N(i-1,0,e-3),a=n[o],r=t[o];Gt[s++]=a.x,Gt[s++]=a.y,Ss[s++]=r}Ct+=e}function is(n,t=!1){n?(pi=n,g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),Eo(t)):(Rt(),pi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y))}function Ec(n,t,e,s){G&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,a=1e-6,r=10;for(let c=0;ca?-d/y:0,S=y>a?p/y:0,C=w>a?-v/w:0,A=w>a?x/w:0,T=_+C,P=S+A,M=(T*T+P*P)**.5;if(Ma){let yt=tt(1/at,r);T*=yt,P*=yt}}let pt=b(u.x-T*s,u.y-P*s),rt=b(u.x+T*s,u.y+P*s);i.push(pt),i.push(rt)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),C=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(C&&A)},o=[];for(let d=0;d3&&r++{if(C>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(C,2)),T.addColorStop(1,h(C,1))}else s.fillStyle="#000";C>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,C=2*X,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*C),r(v,w-_,v,w+_,A,T)},l=(v,w,_,S,C)=>{s.beginPath(),s.rect(v,w,_,S*d),r(v,w+S,v+_,w,C)},u=(v,w,_,S)=>{s.beginPath();for(let C of v)s.lineTo(C.x,C.y);s.closePath(),r(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",p=Wa(1,1,n),d=jt(p,.1,.5),y=tt(6,tt(o,a)/99);s.translate(o/2,a/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[C],P,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*X,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,X/2,X*3/2),c(35,30,10,X/2,X*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*X,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,C=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(C,0,40,14)}s.restore()}function Zh(n){if(bi=n,!fn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Bi(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Vr()}Cn(void 0,t);function t(){if(!qs.length)return;let e=qs[0],s=on-Ws;if(!Ws)Ws=on;else if(s>yi)Ws=0,qs.shift();else{let i=yi-jn,o=si?(s-i)/jn:0;e.render(o)}}}function Bi(n){Object.values(As).forEach(t=>n(t))}function td(){Bi(n=>n.unlocked=!1),Vr()}function Vr(){if(!bi)return;let n={};Bi(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[bi]=JSON.stringify(n)}function ed(n){yi=n}function nd(n){jn=n}function sd(n){mi=n.copy()}function id(n){Ur=n}function Cc(n,t,e,s=125){let i,o,a,r,c,l,u,h,p,d,y,x,v,w=0,_,S=[],C=[],A=[],T=0,P=0,M=1,pt={},rt=Qn/s*60>>2;for(;M;T++)S=[M=h=x=0],e.forEach((at,yt)=>{for(u=t[at][T]||[0,0,0],M|=t[at][T]&&1,_=x+(t[at][0].length-2-(h?0:1))*rt,v=yt===e.length-1,i=2,a=x;irt-99&&p&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,C[a]=(C[a]||0)-l*P+l,A[a]=(A[a++]||0)+l*P+l;c&&(y=c%1,P=u[1]||0,(c|=0)&&(S=pt[[d=u[w=0]||0,c]]=pt[[d,c]]||(r=[...n[d]],r[2]=(r[2]||220)*2**(c/12-1),c>0?Gi(...r):[])))}x=_});return[C,A]}function od(n){Wr=typeof n=="boolean"?n?1:0:n}function rd(n){qr=n}async function ad(){return new Ai(await Box2D()),e(),Cn(n,t),m;function n(){if(!Ae){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(qr||ue)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new wt(l.get_r(),l.get_g(),l.get_b()),a=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),r=l=>a(l).scale(1,.8),c=(l,u)=>{let h=[];for(let p=u;p--;)h.push(m.vec2FromPointer(l+p*8));return h};i.DrawSegment=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),mn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=r(h);let p=c(l,u);Un(p,rn,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=r(h);let p=c(l,u);Un(p,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),si(l,u*2,rn,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,p){p=r(p),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),si(l,u*2,p,.1,p,!1),mn(b(),h,.1,p,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),p=b(1,0),d=J(.75,0,0,.8),y=b(0,1),x=J(0,.75,0,.8);mn(b(),p,.1,d,u,h,!1),mn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){_c(n,t,e,W,s,it,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,a=.05,r=0,c=G,l,u){let h=e.offset(e.size),p=t.add(b(a-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-r:r;It(n,p,h,s,r,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),C=b(_?i:p.x,_?p.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));It(n.add(S.rotate(v)),C,A,s,r,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,C=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));It(n.add(C.rotate(v)),d,A,s,r,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){Rc(n,t,e,W,s,it,i,o,!1,!0)}function Rc(n,t,e,s,i=1,o,a=.05,r=0,c=G,l,u){let h=e.frame(0),p=e.frame(1),d=e.frame(2),y=t.add(b(a-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-r:r;It(n,y,d,s,r,!1,o,c,l,u);for(let S=4;S--;){let C=r+S*X/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),P=b(A?y.y:y.x,i);It(n.add(T.rotate(_)),P,p,s,C,!1,o,c,l,u)}for(let S=4;S--;){let C=r+S*X/2,A=!S||S>2,T=S>1,P=v.multiply(b(A?-1:1,T?-w:w));It(n.add(P.rotate(_)),x,h,s,C,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=W,i=0,o=!1,a=0,r=it,c=G,l=!1,u){let h=Pc(b(),t,e,0,o);Un(h,s,a,r,n,i,c,l,u)}function Pc(n,t=1,e=0,s=0,i=!1,o=Ps){f(O(n),"pos must be a vec2"),f(L(t)&&L(e),"size and percent must be numbers");let a=se(e*4,4);a>=2&&(s+=X),a=a<=2?a-1:3-a,i&&(a=-a,s+=X);let r=[],c=K(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*X;r.push(b(l*ct(h),l*st(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*X;r.push(b(l*ct(h),-l*a*st(h)).rotate(s).add(n))}return r}function La(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){f(n!=null&&typeof n=="object","tweenProperty target must be an object"),f(V(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let a=t.split("."),r=a.pop(),c=l=>{let u=n;for(let h of a)u=u[h];u[r]=l};return new Ei(c,e,s,i,o)}function Lc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Lc(n),Yt.push(n),n.callback(n.interp(n.duration)))}function Oc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Oc(n),Yt.push(n),n.callback(n.interp(n.duration))}function Dc(n,t){n===void 0?(n=$t-Ra,t=on-Pa,Ra=$t,Pa=on):t===void 0&&(t=n);for(let e=Yt.length;e--;){let s=Yt[e];if(s.paused)continue;let i=s.useRealTime?t:n;if(!(i<=0))if(s.life-=i,s.life>0)s.callback(s.interp(s.life));else{s.callback(s.interp(0)),Yt.splice(e,1);let o=s.thenCallback;s.thenCallback=void 0,o&&o()}}}function dd(){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Restored=i}};Ft=!0,ka=.5,Ri=!0,Ga="Escape",Ie=!1,Ze=[],ue=!1,he=!1,xn=!1,vn=!1,Jn=!1;X=Math.PI,nt=Math.abs,St=Math.floor,us=Math.ceil,$s=Math.round,tt=Math.min,K=Math.max,ne=n=>Math.sign(n),Na=(...n)=>Math.hypot(...n),za=n=>Math.log2(n),st=Math.sin,ct=Math.cos,Ja=Math.tan,sr=Math.atan2;go=class{constructor(t=123456789){f(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return St(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=tt(t,e),o=K(t,e)-s,a=this.float(o*2);return at?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return sr(this.x,this.y)}setAngle(t=0,e=1){return Xt(t),Xt(e),this.x=e*st(t),this.y=e*ct(t),this}rotate(t){Xt(t);let e=ct(-t),s=st(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return Xt(t),Xt(e),t=se(t,4),f(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return nt(this.x)>nt(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(nt(this.x),nt(this.y))}floor(){return new n(St(this.x),St(this.y))}snap(t){return Xt(t),new n(St(this.x*t)/t,St(this.y*t)/t)}mod(t=1){return new n(se(this.x,t),se(this.y,t))}area(){return nt(this.x*this.y)}lerp(t,e){wa(t),Xt(e);let s=N(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=se(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=r(a,o,t+1/3),this.g=r(a,o,t),this.b=r(a,o,t-1/3),this.a=i,ss(this),this}HSLA(){let t=N(this.r),e=N(this.g),s=N(this.b),i=N(this.a),o=K(t,e,s),a=tt(t,e,s),r=(o+a)/2,c=0,l=0;if(o!==a){let u=o-a;l=r>.5?u/(2-o-a):u/(o+a),t===o?c=(e-s)/u+(e((s=N(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(f(V(t),"Color hex code must be a string"),f(t[0]==="#","Color hex code must start with #"),f([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>N(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>N(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return ss(this),this}rgbaInt(){let t=N(this.r)*255|0,e=N(this.g)*255<<8,s=N(this.b)*255<<16,i=N(this.a)*255<<24;return t+e+s+i}isValid(){return L(this.r)&&L(this.g)&&L(this.b)&&L(this.a)}},W=Qt(J()),rn=Qt(J(1,1,1,0)),it=Qt(J(0,0,0)),pe=Qt(J(0,0,0,0)),Vl=Qt(J(.5,.5,.5)),rr=Qt(J(1,0,0)),Wl=Qt(J(1,.5,0)),Ka=Qt(J(1,1,0)),Qa=Qt(J(0,1,0)),ql=Qt(J(0,1,1)),Za=Qt(J(0,0,1)),tc=Qt(J(.5,0,1)),Hl=Qt(J(1,0,1)),Ee=class{constructor(t,e=!1){f(t===void 0||L(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){f(L(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){f(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-jt(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?on:$t}toString(){return this.isSet()?nt(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};_t=b(),Q=0,H=32,cr=1,Pi=!0,tn=pe,Mn=b(1920,1080),os=0,kn=0,Gn=b(),lr=!1,Tn=!0,en=1,Rs="arial",ur=!1,z=!1,G=!0,Ps=32,Li=b(16),Oi=0,Di=0,Ii=!0,hr=1,dr=1,fr=1,pr=0,gr=.8,Ge=1,Ut=b(),Zs=1,Mi=!0,yr=!0,rs=!0,yn=!0,an=!1,mr=!1,fe=0,Yn=4,_n=!0,$n=0,Kn=!1,Ls=!0,ln=!1,Wt=100,br=.3,as=3,ti=0,Os=!0,qt=!0,Sn=.3,xr=40,vr=.7;Je=class n{constructor(t=b(),e=b(1),s,i=0,o=W,a=0){f(O(t),"object pos must be a vec2"),f(O(e),"object size must be a vec2"),f(!s||s instanceof Re,"object tileInfo should be a TileInfo or undefined"),f(typeof i=="number"&&isFinite(i),"object angle should be a number"),f(U(o),"object color should be a valid rgba color"),f(typeof a=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=hr,this.damping=dr,this.angleDamping=fr,this.restitution=pr,this.friction=gr,this.gravityScale=1,this.renderOrder=a,this.velocity=b(),this.angleVelocity=0,this.spawnTime=$t,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,vt.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,a=s.y,r=t.angle;if(r){let c=ct(-r),l=st(-r);this.pos.set(o*c-a*l+i.x,o*l+a*c+i.y)}else this.pos.set(o+i.x,a+i.y);this.angle=e*this.localAngle+r}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(f(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=N(this.velocity.x,-Ge,Ge),this.velocity.y=N(this.velocity.y,-Ge,Ge));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Ut.x*this.gravityScale,this.velocity.y+=Ut.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,f(this.angleDamping>=0&&this.angleDamping<=1),f(this.damping>=0&&this.damping<=1),!Ii||!this.mass)return;let e=this.velocity.y<0&&Ut.y<0||this.velocity.y>0&&Ut.y>0;if(this.groundObject){let s=K(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of er){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),a=i.collideWithObject(this);if(!o||!a)continue;if(Qs(t,this.size,i.pos,i.size)){let p=t.subtract(i.pos),d=p.length(),x=d<.001?b(0,1):p.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),ue&&fo(this.pos,this.size,i.pos,i.size,"#f00");continue}let r=this.size.add(i.size),c=(t.y-i.pos.y)*2>r.y+Ut.y,l=nt(t.y-i.pos.y)*20?-1:1)>0?St(t.y-this.size.y/2+1)+this.size.y/2+.001:us(t.y+this.size.y/2-1)-this.size.y/2-.001;if(nt(u-this.pos.y)<.1&&!$e(b(this.pos.x,u),this.size,this)){this.pos.y=u,ue&&bt(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-a}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Ut.y<0?St(t.y-this.size.y/2)+c:us(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-a}ue&&bt(this.pos,this.size,"#f00")}}}update(){}render(){It(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+X/2,t)}getAliveTime(){return $t-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return f(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(f(!t.parent&&!this.children.includes(t)),f(t instanceof n,"child must be an EngineObject"),f(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){f(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Qs(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){f(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
+precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(gi);Ft=new Float32Array(e),Ss=new Uint32Array(e),So=g.createBuffer(),Nn=g.createBuffer(),kr=g.createFramebuffer(),Ct=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,Nn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,a,r=(c,l,u,h,p=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&a;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,p),i+=h*u};wo=g.createVertexArray(),g.bindVertexArray(wo),i=0,o=di,a=mc,g.bindBuffer(g.ARRAY_BUFFER,Nn),r("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,So),g.bufferData(g.ARRAY_BUFFER,gi,g.DYNAMIC_DRAW),r("p",g.FLOAT,4,4,1),r("u",g.FLOAT,4,4,1),r("c",g.UNSIGNED_BYTE,1,4,1),r("a",g.UNSIGNED_BYTE,1,4,1),r("r",g.FLOAT,4,1,1),To=g.createVertexArray(),g.bindVertexArray(To),i=0,o=fi,a=bc,r("p",g.FLOAT,4,2),r("c",g.UNSIGNED_BYTE,1,4)}}function ws(n=!1){!n&&!En||(Rt(),En=!1,g.useProgram(di),g.bindVertexArray(wo))}function xc(){En||(Rt(),En=!0,g.useProgram(fi),g.bindVertexArray(To))}function Eo(n=!0){if(!G||!g)return;f(!Ct,"glPreRender called with unflushed batch."),pi||(et.width=I.x,et.height=I.y),g.viewport(0,0,I.x,I.y),n&&vc();let t=b(2*H).divide(I);pi&&(t.y=-t.y);let e=_t.rotate(-Q),s=b(-1).subtract(e.multiply(t)),i=lt(Q),o=st(Q),a=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],r=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};r(fi,"m",a),r(di,"m",a),g.activeTexture(g.TEXTURE0),cn[0]&&(Qt=cn[0].glTexture,g.bindTexture(g.TEXTURE_2D,Qt)),g.bindBuffer(g.ARRAY_BUFFER,So),On=Hn=!1,ws(!0)}function vc(){if(!g)return;let n=tn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function Fr(n){!g||n===Qt||(Rt(),Qt=n,g.bindTexture(g.TEXTURE_2D,Qt))}function Sc(n,t=!0){if(!g||!n)return;let e=n===Qt;e?Rt():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&Qt&&g.bindTexture(g.TEXTURE_2D,Qt)}function Co(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),jt&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Xn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Co(n,g.VERTEX_SHADER)),g.attachShader(e,Co(t,g.FRAGMENT_SHADER)),g.linkProgram(e),jt&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ji(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)jr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!Tn&&hs(n.width)&&hs(n.height);else{let r=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,r)}let i=Tn?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let a=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,a),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,a),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Qt),e}function wc(n){g&&g.deleteTexture(n)}function jr(n,t){g&&(f((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!Tn&&hs(t.width)&&hs(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Qt))}function Hh(n){z||(ls.add(n),g&&(n.glTexture?jr(n.glTexture,n.image):n.glTexture=ji(n.image,n.wrap)))}function Xh(n){if(z)return;ls.delete(n);let t=n.glTexture;n.glTexture=void 0,wc(t)}function Rt(){if(G&&g&&Ct){let n=Hn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=Ct*(En?Fi:Gr);g.bufferSubData(g.ARRAY_BUFFER,0,Ft,0,t),En?g.drawArrays(g.TRIANGLE_STRIP,0,Ct):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,Ct),++Ce,_e+=Ct,Ct=0}Hn=On}function Br(n){!G||!g||(Rt(),n.drawImage(et,0,0))}function Yh(n=!0){f(!et,"must be called before engineInit"),Mr=n}function Ts(n,t,e,s,i=0,o=0,a=0,r=1,c=1,l=-1,u=0){(Ct>=Wh||Hn!==On)&&Rt(),ws();let h=Ct++*Gr;Ft[h++]=n,Ft[h++]=t,Ft[h++]=e,Ft[h++]=s,Ft[h++]=o,Ft[h++]=a,Ft[h++]=r,Ft[h++]=c,Ss[h++]=l,Ss[h++]=u,Ft[h++]=i}function Tc(n,t,e,s,i,o){Ts(n,t,e,s,i,0,0,0,0,0,o)}function Nr(n,t,e,s,i,o,a,r=!0){let c=[],l=st(-a),u=lt(-a);for(let p of n){let d=p.x*i,y=p.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=r?Kh(c):c;Ac(h,t)}function zr(n,t,e,s,i,o,a,r,c=!0){let l=$h(n,e,c);Nr(l,t,s,i,o,a,r,!1)}function Ac(n,t){if(!G||n.length<3)return;let e=n.length+2;if((Ct+e>=zn||Hn!==On)&&Rt(),f(e=zn)return;xc();let s=Ct*Fi;for(let i=e;i--;){let o=N(i-1,0,e-3),a=n[o];Ft[s++]=a.x,Ft[s++]=a.y,Ss[s++]=t}Ct+=e}function Jr(n,t){if(!G||n.length<3)return;let e=n.length+2;if((Ct+e>=zn||Hn!==On)&&Rt(),f(e=zn)return;xc();let s=Ct*Fi;for(let i=e;i--;){let o=N(i-1,0,e-3),a=n[o],r=t[o];Ft[s++]=a.x,Ft[s++]=a.y,Ss[s++]=r}Ct+=e}function is(n,t=!1){n?(pi=n,g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),Eo(t)):(Rt(),pi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y))}function Ec(n,t,e,s){G&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,a=1e-6,r=10;for(let c=0;ca?-d/y:0,S=y>a?p/y:0,C=w>a?-v/w:0,A=w>a?x/w:0,T=_+C,P=S+A,M=(T*T+P*P)**.5;if(Ma){let yt=tt(1/ct,r);T*=yt,P*=yt}}let pt=b(u.x-T*s,u.y-P*s),at=b(u.x+T*s,u.y+P*s);i.push(pt),i.push(at)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),C=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(C&&A)},o=[];for(let d=0;d3&&r++{if(C>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(C,2)),T.addColorStop(1,h(C,1))}else s.fillStyle="#000";C>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,C=2*X,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*C),r(v,w-_,v,w+_,A,T)},l=(v,w,_,S,C)=>{s.beginPath(),s.rect(v,w,_,S*d),r(v,w+S,v+_,w,C)},u=(v,w,_,S)=>{s.beginPath();for(let C of v)s.lineTo(C.x,C.y);s.closePath(),r(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",p=Wa(1,1,n),d=Bt(p,.1,.5),y=tt(6,tt(o,a)/99);s.translate(o/2,a/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[C],P,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*X,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,X/2,X*3/2),c(35,30,10,X/2,X*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*X,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,C=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(C,0,40,14)}s.restore()}function Zh(n){if(bi=n,!fn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Bi(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Vr()}Cn(void 0,t);function t(){if(!qs.length)return;let e=qs[0],s=on-Ws;if(!Ws)Ws=on;else if(s>yi)Ws=0,qs.shift();else{let i=yi-jn,o=si?(s-i)/jn:0;e.render(o)}}}function Bi(n){Object.values(As).forEach(t=>n(t))}function td(){Bi(n=>n.unlocked=!1),Vr()}function Vr(){if(!bi)return;let n={};Bi(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[bi]=JSON.stringify(n)}function ed(n){yi=n}function nd(n){jn=n}function sd(n){mi=n.copy()}function id(n){Ur=n}function Cc(n,t,e,s=125){let i,o,a,r,c,l,u,h,p,d,y,x,v,w=0,_,S=[],C=[],A=[],T=0,P=0,M=1,pt={},at=Qn/s*60>>2;for(;M;T++)S=[M=h=x=0],e.forEach((ct,yt)=>{for(u=t[ct][T]||[0,0,0],M|=t[ct][T]&&1,_=x+(t[ct][0].length-2-(h?0:1))*at,v=yt===e.length-1,i=2,a=x;iat-99&&p&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,C[a]=(C[a]||0)-l*P+l,A[a]=(A[a++]||0)+l*P+l;c&&(y=c%1,P=u[1]||0,(c|=0)&&(S=pt[[d=u[w=0]||0,c]]=pt[[d,c]]||(r=[...n[d]],r[2]=(r[2]||220)*2**(c/12-1),c>0?Gi(...r):[])))}x=_});return[C,A]}function od(n){Wr=typeof n=="boolean"?n?1:0:n}function rd(n){qr=n}async function ad(){return new Ai(await Box2D()),e(),Cn(n,t),m;function n(){if(!Ae){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(qr||ue)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new wt(l.get_r(),l.get_g(),l.get_b()),a=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),r=l=>a(l).scale(1,.8),c=(l,u)=>{let h=[];for(let p=u;p--;)h.push(m.vec2FromPointer(l+p*8));return h};i.DrawSegment=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),mn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=r(h);let p=c(l,u);Un(p,rn,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=r(h);let p=c(l,u);Un(p,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),si(l,u*2,rn,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,p){p=r(p),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),si(l,u*2,p,.1,p,!1),mn(b(),h,.1,p,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),p=b(1,0),d=J(.75,0,0,.8),y=b(0,1),x=J(0,.75,0,.8);mn(b(),p,.1,d,u,h,!1),mn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){_c(n,t,e,W,s,it,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,a=.05,r=0,c=G,l,u){let h=e.offset(e.size),p=t.add(b(a-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-r:r;Mt(n,p,h,s,r,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),C=b(_?i:p.x,_?p.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));Mt(n.add(S.rotate(v)),C,A,s,r,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,C=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));Mt(n.add(C.rotate(v)),d,A,s,r,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){Rc(n,t,e,W,s,it,i,o,!1,!0)}function Rc(n,t,e,s,i=1,o,a=.05,r=0,c=G,l,u){let h=e.frame(0),p=e.frame(1),d=e.frame(2),y=t.add(b(a-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-r:r;Mt(n,y,d,s,r,!1,o,c,l,u);for(let S=4;S--;){let C=r+S*X/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),P=b(A?y.y:y.x,i);Mt(n.add(T.rotate(_)),P,p,s,C,!1,o,c,l,u)}for(let S=4;S--;){let C=r+S*X/2,A=!S||S>2,T=S>1,P=v.multiply(b(A?-1:1,T?-w:w));Mt(n.add(P.rotate(_)),x,h,s,C,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=W,i=0,o=!1,a=0,r=it,c=G,l=!1,u){let h=Pc(b(),t,e,0,o);Un(h,s,a,r,n,i,c,l,u)}function Pc(n,t=1,e=0,s=0,i=!1,o=Ps){f(O(n),"pos must be a vec2"),f(L(t)&&L(e),"size and percent must be numbers");let a=se(e*4,4);a>=2&&(s+=X),a=a<=2?a-1:3-a,i&&(a=-a,s+=X);let r=[],c=K(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*X;r.push(b(l*lt(h),l*st(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*X;r.push(b(l*lt(h),-l*a*st(h)).rotate(s).add(n))}return r}function La(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){f(n!=null&&typeof n=="object","tweenProperty target must be an object"),f(V(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let a=t.split("."),r=a.pop(),c=l=>{let u=n;for(let h of a)u=u[h];u[r]=l};return new Ei(c,e,s,i,o)}function Lc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Lc(n),$t.push(n),n.callback(n.interp(n.duration)))}function Oc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Oc(n),$t.push(n),n.callback(n.interp(n.duration))}function Dc(n,t){n===void 0?(n=Kt-Ra,t=on-Pa,Ra=Kt,Pa=on):t===void 0&&(t=n);for(let e=$t.length;e--;){let s=$t[e];if(s.paused)continue;let i=s.useRealTime?t:n;if(!(i<=0))if(s.life-=i,s.life>0)s.callback(s.interp(s.life));else{s.callback(s.interp(0)),$t.splice(e,1);let o=s.thenCallback;s.thenCallback=void 0,o&&o()}}}function dd(){for(let n of $t)n.thenCallback=void 0;$t.length=0}var Hs,Xs,Cl,tr,vt,er,Oa,Kt,on,Ae,ao,be,Ys,Da,bn,uo,jt,ka,Ri,Ga,Me,Ze,ue,he,xn,vn,Jn,ho,ke,le,X,nt,St,us,$s,tt,K,ne,Na,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...n)=>Math.hypot(...n),za=n=>Math.log2(n),st=Math.sin,lt=Math.cos,Ja=Math.tan,sr=Math.atan2;go=class{constructor(t=123456789){f(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return St(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=tt(t,e),o=K(t,e)-s,a=this.float(o*2);return at?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return sr(this.x,this.y)}setAngle(t=0,e=1){return Yt(t),Yt(e),this.x=e*st(t),this.y=e*lt(t),this}rotate(t){Yt(t);let e=lt(-t),s=st(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return Yt(t),Yt(e),t=se(t,4),f(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return nt(this.x)>nt(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(nt(this.x),nt(this.y))}floor(){return new n(St(this.x),St(this.y))}snap(t){return Yt(t),new n(St(this.x*t)/t,St(this.y*t)/t)}mod(t=1){return new n(se(this.x,t),se(this.y,t))}area(){return nt(this.x*this.y)}lerp(t,e){wa(t),Yt(e);let s=N(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=se(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=r(a,o,t+1/3),this.g=r(a,o,t),this.b=r(a,o,t-1/3),this.a=i,ss(this),this}HSLA(){let t=N(this.r),e=N(this.g),s=N(this.b),i=N(this.a),o=K(t,e,s),a=tt(t,e,s),r=(o+a)/2,c=0,l=0;if(o!==a){let u=o-a;l=r>.5?u/(2-o-a):u/(o+a),t===o?c=(e-s)/u+(e((s=N(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(f(V(t),"Color hex code must be a string"),f(t[0]==="#","Color hex code must start with #"),f([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>N(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>N(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return ss(this),this}rgbaInt(){let t=N(this.r)*255|0,e=N(this.g)*255<<8,s=N(this.b)*255<<16,i=N(this.a)*255<<24;return t+e+s+i}isValid(){return L(this.r)&&L(this.g)&&L(this.b)&&L(this.a)}},W=Zt(J()),rn=Zt(J(1,1,1,0)),it=Zt(J(0,0,0)),pe=Zt(J(0,0,0,0)),Vl=Zt(J(.5,.5,.5)),rr=Zt(J(1,0,0)),Wl=Zt(J(1,.5,0)),Ka=Zt(J(1,1,0)),Qa=Zt(J(0,1,0)),ql=Zt(J(0,1,1)),Za=Zt(J(0,0,1)),tc=Zt(J(.5,0,1)),Hl=Zt(J(1,0,1)),Ee=class{constructor(t,e=!1){f(t===void 0||L(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){f(L(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){f(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-Bt(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?on:Kt}toString(){return this.isSet()?nt(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};_t=b(),Q=0,H=32,cr=1,Pi=!0,tn=pe,Mn=b(1920,1080),os=0,kn=0,Gn=b(),lr=!1,Tn=!0,en=1,Rs="arial",ur=!1,z=!1,G=!0,Ps=32,Li=b(16),Oi=0,Di=0,Ii=!0,hr=1,dr=1,fr=1,pr=0,gr=.8,Fe=1,Vt=b(),Zs=1,Mi=!0,yr=!0,rs=!0,yn=!0,an=!1,mr=!1,fe=0,Yn=4,_n=!0,$n=0,Kn=!1,Ls=!0,ln=!1,qt=100,br=.3,as=3,ti=0,Os=!0,Ht=!0,Sn=.3,xr=40,vr=.7;Ue=class n{constructor(t=b(),e=b(1),s,i=0,o=W,a=0){f(O(t),"object pos must be a vec2"),f(O(e),"object size must be a vec2"),f(!s||s instanceof Re,"object tileInfo should be a TileInfo or undefined"),f(typeof i=="number"&&isFinite(i),"object angle should be a number"),f(U(o),"object color should be a valid rgba color"),f(typeof a=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=hr,this.damping=dr,this.angleDamping=fr,this.restitution=pr,this.friction=gr,this.gravityScale=1,this.renderOrder=a,this.velocity=b(),this.angleVelocity=0,this.spawnTime=Kt,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,vt.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,a=s.y,r=t.angle;if(r){let c=lt(-r),l=st(-r);this.pos.set(o*c-a*l+i.x,o*l+a*c+i.y)}else this.pos.set(o+i.x,a+i.y);this.angle=e*this.localAngle+r}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(f(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=N(this.velocity.x,-Fe,Fe),this.velocity.y=N(this.velocity.y,-Fe,Fe));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Vt.x*this.gravityScale,this.velocity.y+=Vt.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,f(this.angleDamping>=0&&this.angleDamping<=1),f(this.damping>=0&&this.damping<=1),!Ii||!this.mass)return;let e=this.velocity.y<0&&Vt.y<0||this.velocity.y>0&&Vt.y>0;if(this.groundObject){let s=K(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of er){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),a=i.collideWithObject(this);if(!o||!a)continue;if(Qs(t,this.size,i.pos,i.size)){let p=t.subtract(i.pos),d=p.length(),x=d<.001?b(0,1):p.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),ue&&fo(this.pos,this.size,i.pos,i.size,"#f00");continue}let r=this.size.add(i.size),c=(t.y-i.pos.y)*2>r.y+Vt.y,l=nt(t.y-i.pos.y)*20?-1:1)>0?St(t.y-this.size.y/2+1)+this.size.y/2+.001:us(t.y+this.size.y/2-1)-this.size.y/2-.001;if(nt(u-this.pos.y)<.1&&!$e(b(this.pos.x,u),this.size,this)){this.pos.y=u,ue&&bt(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-a}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Vt.y<0?St(t.y-this.size.y/2)+c:us(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-a}ue&&bt(this.pos,this.size,"#f00")}}}update(){}render(){Mt(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+X/2,t)}getAliveTime(){return Kt-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return f(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(f(!t.parent&&!this.children.includes(t)),f(t instanceof n,"child must be an EngineObject"),f(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){f(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Qs(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){f(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
 pos = `+this.pos),(this.velocity.x||this.velocity.y)&&(t+=`
 velocity = `+this.velocity),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.angle&&(t+=`
 angle = `+this.angle.toFixed(3)),this.color&&(t+=`
-color = `+this.color),t}renderDebugInfo(){if(!Ft)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b(K(this.size.x,.2),K(this.size.y,.2)),s=J(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);bt(this.pos,e,s,0,this.angle,t),this.parent&&bt(this.pos,e.scale(.8),J(1,1,1,.5),0,this.angle),this.parent&&we(this.pos,this.parent.pos,J(1,1,1,.5),.5)}},I=b(),cn=[];Re=class n{constructor(t=b(),e=Li,s=cn[0],i=Oi,o=Di){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){f(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return f(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new ot(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new ot,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Ds(t,this.size,this.textureInfo,this.padding,this.bleed)}},Ue=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,Sc(this.glTexture,t)}};nh=0;ii=class{constructor(t){f(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,a,r){f(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(f(s>0),s*=H,s=new ot(s,s)):s=s.scale(H),this.drawTextScreen(t,Pn(e),s,i,o,a,r)}drawTextScreen(t,e,s,i=!0,o=W,a=G,r){f(V(t),"text must be a string"),f(O(e),"pos must be a vec2"),f(O(s)||typeof s=="number","size must be a vec2 or number"),f(U(o),"color must be a color"),s=typeof s=="number"?new ot(s,s):s;let c=new ot,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,p=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
-`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,C=S%d,A=S/d|0;l.pos.x=C*h+u,l.pos.y=A*p+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,It(c,s,l,o,0,!1,void 0,a,!0,r)}})}};Oe=b(),zt=b(),Tr=b(),xe=b(),Ar=0,oi=!0,Bn=!1,Qe="mouse",Er=6,Fn=!0,mt=0,ie=!z&&window.ontouchstart!==void 0;Y=[[]],ve=[],pn=[],co=[],Vn=new Ee,oe=[],An=[],ri=[],Gs=[],je=new Map,ys=[],Wn=!0;ai="http://www.w3.org/2000/svg";ft=new AudioContext,Qn=44100;bs=class{constructor(t,e,s=xr,i=vr,o){var a;if(!(!qt||z)){if(f(!t||de(t)||V(t),"asset must be a file name or zzfx array"),f(e===void 0||L(e),"randomness must be a number"),f(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),f(L(s),"range must be a number"),f(L(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Qn,this.loadedPercent=0,this.onloadCallback=o,de(t)){let r=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(a=r[l])!=null?a:c,r[l]=0,this.sampleChannels=[Gi(...r)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let r=t;this.loadSound(r)}}}play(t,e=1,s=1,i=1,o=!1,a=!1){if(f(!t||O(t),"pos must be a vec2"),f(L(e),"volume must be a number"),f(L(s),"pitch must be a number"),f(L(i),"randomnessScale must be a number"),!qt||z||!this.sampleChannels)return;let r;if(t){let u=this.range;if(u){let h=_t.distanceSquared(t);if(h>u*u)return;e*=jt(h**.5,u,u*this.taper)}r=Pn(t).x*2/B.width-1}let c=s+s*this.randomness*i*dt(-1,1),l=new ci(this,e,c,r,o,a);return Ft&&Jn&&t&&(Jt(t,.5,"#0ff",.5,!0),this.range&&(Jt(t,2*this.range,"#0ff",.5),Jt(t,2*this.range*this.taper,"#0ff",.5)),In("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){f(L(t),"semitoneOffset must be a number");let i=gc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await ft.decodeAudioData(s),o=i.numberOfChannels,a=1e5,r=[];for(let l=0;lsetTimeout(v,0));let d=tt(p+a,h);for(;p=0,"Sound volume must be positive or zero"),f(s>=0,"Sound rate must be positive or zero"),f(L(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=r=>{r===this.source&&(this.source=void 0)},a||this.start()}start(t=0){f(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=ft.createGain(),this.source=Ir(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=ft.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){f(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(f(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=ft.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?se(ft.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};sn=[];wn=class{constructor(t,e=0,s=!1,i=new wt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new wt}},ui=class extends Je{constructor(t,e,s=0,i=0,o=b(512),a=!0){var r;f(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,W,i),this.canvas=z?void 0:new OffscreenCanvas(o.x,o.y),this.context=(r=this.canvas)==null?void 0:r.getContext("2d"),this.textureInfo=new Ue(this.canvas,a),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=W,i=0,o=!1,a,r=!1,c){let l=new Re().setFullImage(this.textureInfo),u=this.hasWebGL();It(t,e,l,s,i,o,a,u,r,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return G&&this.textureInfo.hasWebGL()}},xs=class extends ui{constructor(t,e,s=Ds(),i=0,o=!0){let a=s?e.multiply(s.size):e;if(super(t,e,0,i,a,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,z){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let r=this.size.area();r--;)this.data.push(new wn)}setData(t,e,s=!1){if(t=t.floor(),f(O(t),"layerPos must be a Vector2"),f(e instanceof wn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Et===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new wn,e)}getData(t){return f(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!G&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){f(Et!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&Rt(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;f(Et!==this.context),this.savedRenderSettings=[Et,I,_t,H,tn],Et=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);I=this.size.multiply(e),tn=pe,_t=this.size.multiply(e).scale(.5),H=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?is(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!Tn,t&&(this.canvas.width=I.x,this.canvas.height=I.y))}redrawEnd(){this.context&&(f(Et===this.context),this.isUsingWebGL&&is(),[Et,I,_t,H,tn]=this.savedRenderSettings)}drawTileData(t,e=!0){var r,c;if(!this.context)return;f(Et===this.context,"must call redrawStart() before drawing tiles");let s=(c=(r=this.tileInfo)==null?void 0:r.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let a=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,a,o.color,o.direction*X/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(f(Et!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=W,o=0,a,r){let c=t.add(e.scale(.5));It(c,e,s,i,o,a,r,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new wt,o=0,a=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let r=I;I=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&is(this.textureInfo.glTexture);let l=c?void 0:this.context;It(t,e,s,i,o,a,void 0,c,!0,l),c&&is(),I=r}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){f(Et===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Ec(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},vs=class extends xs{constructor(t,e,s=Ds(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),sn.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=sn.indexOf(this);f(t>=0,"tile collision layer not found in array"),t>=0&&sn.splice(t,1),super.destroy()}initCollision(t){f(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){f(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){f(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new ot,s){f(O(t)&&O(e),"pos and size must be Vector2s"),f(!s||typeof s=="function"||s instanceof Je,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(p,d)=>s(p,d):(p,d)=>s.collideWithTile(p,d):()=>!0,o=t.x-this.pos.x,a=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||a+e.y/2<0||a-e.y/2>this.size.y)return!1;let r=K(o-e.x/2|0,0),c=K(a-e.y/2|0,0),l=tt(K(o+e.x/2,r+1),this.size.x),u=tt(K(a+e.y/2,c+1),this.size.y),h=new ot;for(let p=c;ps(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,a=l=>{let u=this.getCollisionData(r.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},r=new ot,c=qa(t,e,a,i);if(he&&c){let l=c.floor().add(b(.5));bt(l,b(1),"#f008"),we(t,e,"#00f",.02),we(t,c,"#f00",.02),nr(c,"#0f0"),i&&we(c,c.add(i),"#ff0",.02)}return c}},vo=class extends Je{constructor(t,e,s=0,i=0,o=100,a=X,r,c=W,l=W,u=rn,h=rn,p=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,C=X,A=.1,T=.2,P=!1,M=!1,pt=!0,rt=M?1e9:0,at=!1){super(t,b(),r,e,void 0,rt),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=a,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=pt,this.particleTime=p,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=C,this.fadeRate=A,this.randomness=T,this.collideTiles=P,this.additive=M,this.localSpace=at,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(f(this.angleDamping>=0&&this.angleDamping<=1),f(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&Zs){let s=1/this.emitRate/Zs;for(this.emitTimeBuffer+=tr;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*dt(s,-s),o=i(this.particleTime),a=i(this.sizeStart),r=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Xa(),u=dt(this.emitConeAngle,-this.emitConeAngle),h=po(this.colorStartA,this.colorStartB,this.randomColorLinear),p=po(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*st(d),c*ct(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new hi(this,t,e,h,p,o,a,r,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new ot,hi=class{constructor(t,e,s,i,o,a,r,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(r),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=a,this.sizeStart=r,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=$t,this.mirror=Ha(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,a=t.gravityScale,r=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&$t-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Ut.x*a,this.pos.y+=this.velocity.y+=Ut.y*a,this.angle+=this.angleVelocity*=s,!Ii||!r)return;let u=this.velocity.lengthSquared();if(u>Ge*Ge){let p=Ge/u**.5;this.velocity.x*=p,this.velocity.y*=p}this.groundObject=void 0;let h=c?p=>{let d=li(p);return d&&c(this,d,p)}:p=>li(p)>0;if(h(this.pos)){let p=$e(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=K(i,p.restitution),v=K(o,p.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Ut.y<0||this.velocity.y>0&&Ut.y>0)&&(this.groundObject=p),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),ue&&bt(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,a=this.lifeTime>0?tt(($t-this.spawnTime)/this.lifeTime,1):1,r=1-a,c=r*this.sizeStart+a*this.sizeEnd,l=b(c),u=a1-o?(1-a)/o:1;this.color.r=r*this.colorStart.r+a*this.colorEnd.r,this.color.g=r*this.colorStart.g+a*this.colorEnd.g,this.color.b=r*this.colorStart.b+a*this.colorEnd.b,this.color.a=(r*this.colorStart.a+a*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),p=this.angle;if(e){let d=t.angle,y=ct(-d),x=st(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),p+=d}if(s&&fs(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=K(l.x,x),p=sr(d.x,d.y),It(h,l,this.tileInfo,this.color,p,this.mirror)}}else It(h,l,this.tileInfo,this.color,p,this.mirror);s&&fs(!1),xn&&bt(h,l,"#f005",0,p)}},Mr=!0,Ao=!0,gi=5e5,Gr=11,mc=Gr*4,Wh=gi/mc|0,Fi=3,bc=Fi*4,zn=gi/bc|0;fn=!1,yi=5,jn=.5,mi=b(640,80),Ur=!1,As={},qs=[];xi=class{constructor(t,e,s="",i="\u{1F3C6}",o){f(t>=0&&!As[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),As[t]=this}unlock(){Ur||this.unlocked||(f(bi,"save name must be set"),this.unlocked=!0,Vr(),qs.push(this))}render(t=0){let e=ut,s=tt(mi.x,B.width),i=mi.y,o=B.width-s,a=-i*t,r=ke(0,0,.9);e.save(),e.beginPath(),e.fillStyle=r.toString(),e.strokeStyle=it.toString(),e.lineWidth=3,e.rect(o,a,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,a+i/2),l);let u=i*.5,h=i*.3,p=b(o+l+2*c.x,a+c.y*2+u/2),d=s-l-3*c.x;nn(this.name,p,u,it,0,void 0,"left",void 0,void 0,d),p.y=a+i-c.y*2-h/2,nn(this.description,p,h,it,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?ut.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):nn(this.icon,t,e*.7,it)}};_o=class extends xi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Es&&Es.unlockMedal(this.id)}},Ro=class{constructor(t,e,s){var c,l,u;f(!Es,"there can only be one newgrounds object"),f(!e||s,"must provide cryptojs if there is a cipher"),Es=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){fn&&xt("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],fn&&xt(this.medals);for(let h of this.medals){let p=As[h.id];p&&(p.image=new Image,p.image.src=h.icon,p.name=h.name,p.description=h.description,p.unlocked=h.unlocked,p.difficulty=h.difficulty,p.value=h.value,p.value&&(p.description=p.description+` (${p.value})`))}let a=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=a==null?void 0:a.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],fn&&xt(this.scoreboards);let r=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),r)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),p=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(p.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},a=new FormData;a.append("input",JSON.stringify(o));let r=new XMLHttpRequest;r.open("POST","https://newgrounds.io/gateway_v3.php",!fn&&s);try{r.send(a)}catch(l){fn&&xt("newgrounds call failed",l);return}return fn&&xt(r.responseText),r.responseText&&JSON.parse(r.responseText)}},Po=class{constructor(t,e=!1,s=!1){f(!Mt,"Post process already initialized"),f(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),Mt=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),Cn(void 0,r,o,a);function i(){if(z)return;if(!G){console.warn("PostProcessPlugin: WebGL not enabled!");return}Mt.texture=ji(),Mt.shader=Xn(`#version 300 es
+color = `+this.color),t}renderDebugInfo(){if(!jt)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b(K(this.size.x,.2),K(this.size.y,.2)),s=J(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);bt(this.pos,e,s,0,this.angle,t),this.parent&&bt(this.pos,e.scale(.8),J(1,1,1,.5),0,this.angle),this.parent&&we(this.pos,this.parent.pos,J(1,1,1,.5),.5)}},I=b(),cn=[];Re=class n{constructor(t=b(),e=Li,s=cn[0],i=Oi,o=Di){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){f(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return f(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new rt(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new rt,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Ds(t,this.size,this.textureInfo,this.padding,this.bleed)}},Ve=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,Sc(this.glTexture,t)}};nh=0;ii=class{constructor(t){f(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,a,r){f(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(f(s>0),s*=H,s=new rt(s,s)):s=s.scale(H),this.drawTextScreen(t,Pn(e),s,i,o,a,r)}drawTextScreen(t,e,s,i=!0,o=W,a=G,r){f(V(t),"text must be a string"),f(O(e),"pos must be a vec2"),f(O(s)||typeof s=="number","size must be a vec2 or number"),f(U(o),"color must be a color"),s=typeof s=="number"?new rt(s,s):s;let c=new rt,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,p=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
+`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,C=S%d,A=S/d|0;l.pos.x=C*h+u,l.pos.y=A*p+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,Mt(c,s,l,o,0,!1,void 0,a,!0,r)}})}};De=b(),Jt=b(),Tr=b(),xe=b(),Ar=0,oi=!0,Bn=!1,Qe="mouse",Er=6,Fn=!0,mt=0,ie=!z&&window.ontouchstart!==void 0;Y=[[]],ve=[],pn=[],co=[],Vn=new Ee,oe=[],An=[],ri=[],Gs=[],Be=new Map,ys=[],Wn=!0;ai="http://www.w3.org/2000/svg";ft=new AudioContext,Qn=44100;bs=class{constructor(t,e,s=xr,i=vr,o){var a;if(!(!Ht||z)){if(f(!t||de(t)||V(t),"asset must be a file name or zzfx array"),f(e===void 0||L(e),"randomness must be a number"),f(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),f(L(s),"range must be a number"),f(L(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Qn,this.loadedPercent=0,this.onloadCallback=o,de(t)){let r=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(a=r[l])!=null?a:c,r[l]=0,this.sampleChannels=[Gi(...r)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let r=t;this.loadSound(r)}}}play(t,e=1,s=1,i=1,o=!1,a=!1){if(f(!t||O(t),"pos must be a vec2"),f(L(e),"volume must be a number"),f(L(s),"pitch must be a number"),f(L(i),"randomnessScale must be a number"),!Ht||z||!this.sampleChannels)return;let r;if(t){let u=this.range;if(u){let h=_t.distanceSquared(t);if(h>u*u)return;e*=Bt(h**.5,u,u*this.taper)}r=Pn(t).x*2/B.width-1}let c=s+s*this.randomness*i*dt(-1,1),l=new ci(this,e,c,r,o,a);return jt&&Jn&&t&&(Ut(t,.5,"#0ff",.5,!0),this.range&&(Ut(t,2*this.range,"#0ff",.5),Ut(t,2*this.range*this.taper,"#0ff",.5)),In("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){f(L(t),"semitoneOffset must be a number");let i=gc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await ft.decodeAudioData(s),o=i.numberOfChannels,a=1e5,r=[];for(let l=0;lsetTimeout(v,0));let d=tt(p+a,h);for(;p=0,"Sound volume must be positive or zero"),f(s>=0,"Sound rate must be positive or zero"),f(L(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=r=>{r===this.source&&(this.source=void 0)},a||this.start()}start(t=0){f(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=ft.createGain(),this.source=Ir(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=ft.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){f(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(f(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=ft.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?se(ft.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};sn=[];wn=class{constructor(t,e=0,s=!1,i=new wt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new wt}},ui=class extends Ue{constructor(t,e,s=0,i=0,o=b(512),a=!0){var r;f(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,W,i),this.canvas=z?void 0:new OffscreenCanvas(o.x,o.y),this.context=(r=this.canvas)==null?void 0:r.getContext("2d"),this.textureInfo=new Ve(this.canvas,a),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=W,i=0,o=!1,a,r=!1,c){let l=new Re().setFullImage(this.textureInfo),u=this.hasWebGL();Mt(t,e,l,s,i,o,a,u,r,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return G&&this.textureInfo.hasWebGL()}},xs=class extends ui{constructor(t,e,s=Ds(),i=0,o=!0){let a=s?e.multiply(s.size):e;if(super(t,e,0,i,a,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,z){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let r=this.size.area();r--;)this.data.push(new wn)}setData(t,e,s=!1){if(t=t.floor(),f(O(t),"layerPos must be a Vector2"),f(e instanceof wn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Et===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new wn,e)}getData(t){return f(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!G&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){f(Et!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&Rt(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;f(Et!==this.context),this.savedRenderSettings=[Et,I,_t,H,tn],Et=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);I=this.size.multiply(e),tn=pe,_t=this.size.multiply(e).scale(.5),H=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?is(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!Tn,t&&(this.canvas.width=I.x,this.canvas.height=I.y))}redrawEnd(){this.context&&(f(Et===this.context),this.isUsingWebGL&&is(),[Et,I,_t,H,tn]=this.savedRenderSettings)}drawTileData(t,e=!0){var r,c;if(!this.context)return;f(Et===this.context,"must call redrawStart() before drawing tiles");let s=(c=(r=this.tileInfo)==null?void 0:r.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let a=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,a,o.color,o.direction*X/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(f(Et!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=W,o=0,a,r){let c=t.add(e.scale(.5));Mt(c,e,s,i,o,a,r,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new wt,o=0,a=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let r=I;I=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&is(this.textureInfo.glTexture);let l=c?void 0:this.context;Mt(t,e,s,i,o,a,void 0,c,!0,l),c&&is(),I=r}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){f(Et===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Ec(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},vs=class extends xs{constructor(t,e,s=Ds(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),sn.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=sn.indexOf(this);f(t>=0,"tile collision layer not found in array"),t>=0&&sn.splice(t,1),super.destroy()}initCollision(t){f(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){f(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){f(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new rt,s){f(O(t)&&O(e),"pos and size must be Vector2s"),f(!s||typeof s=="function"||s instanceof Ue,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(p,d)=>s(p,d):(p,d)=>s.collideWithTile(p,d):()=>!0,o=t.x-this.pos.x,a=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||a+e.y/2<0||a-e.y/2>this.size.y)return!1;let r=K(o-e.x/2|0,0),c=K(a-e.y/2|0,0),l=tt(K(o+e.x/2,r+1),this.size.x),u=tt(K(a+e.y/2,c+1),this.size.y),h=new rt;for(let p=c;ps(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,a=l=>{let u=this.getCollisionData(r.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},r=new rt,c=qa(t,e,a,i);if(he&&c){let l=c.floor().add(b(.5));bt(l,b(1),"#f008"),we(t,e,"#00f",.02),we(t,c,"#f00",.02),nr(c,"#0f0"),i&&we(c,c.add(i),"#ff0",.02)}return c}},vo=class extends Ue{constructor(t,e,s=0,i=0,o=100,a=X,r,c=W,l=W,u=rn,h=rn,p=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,C=X,A=.1,T=.2,P=!1,M=!1,pt=!0,at=M?1e9:0,ct=!1){super(t,b(),r,e,void 0,at),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=a,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=pt,this.particleTime=p,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=C,this.fadeRate=A,this.randomness=T,this.collideTiles=P,this.additive=M,this.localSpace=ct,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(f(this.angleDamping>=0&&this.angleDamping<=1),f(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&Zs){let s=1/this.emitRate/Zs;for(this.emitTimeBuffer+=tr;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*dt(s,-s),o=i(this.particleTime),a=i(this.sizeStart),r=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Xa(),u=dt(this.emitConeAngle,-this.emitConeAngle),h=po(this.colorStartA,this.colorStartB,this.randomColorLinear),p=po(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*st(d),c*lt(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new hi(this,t,e,h,p,o,a,r,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new rt,hi=class{constructor(t,e,s,i,o,a,r,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(r),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=a,this.sizeStart=r,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=Kt,this.mirror=Ha(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,a=t.gravityScale,r=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&Kt-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Vt.x*a,this.pos.y+=this.velocity.y+=Vt.y*a,this.angle+=this.angleVelocity*=s,!Ii||!r)return;let u=this.velocity.lengthSquared();if(u>Fe*Fe){let p=Fe/u**.5;this.velocity.x*=p,this.velocity.y*=p}this.groundObject=void 0;let h=c?p=>{let d=li(p);return d&&c(this,d,p)}:p=>li(p)>0;if(h(this.pos)){let p=$e(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=K(i,p.restitution),v=K(o,p.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Vt.y<0||this.velocity.y>0&&Vt.y>0)&&(this.groundObject=p),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),ue&&bt(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,a=this.lifeTime>0?tt((Kt-this.spawnTime)/this.lifeTime,1):1,r=1-a,c=r*this.sizeStart+a*this.sizeEnd,l=b(c),u=a1-o?(1-a)/o:1;this.color.r=r*this.colorStart.r+a*this.colorEnd.r,this.color.g=r*this.colorStart.g+a*this.colorEnd.g,this.color.b=r*this.colorStart.b+a*this.colorEnd.b,this.color.a=(r*this.colorStart.a+a*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),p=this.angle;if(e){let d=t.angle,y=lt(-d),x=st(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),p+=d}if(s&&fs(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=K(l.x,x),p=sr(d.x,d.y),Mt(h,l,this.tileInfo,this.color,p,this.mirror)}}else Mt(h,l,this.tileInfo,this.color,p,this.mirror);s&&fs(!1),xn&&bt(h,l,"#f005",0,p)}},Mr=!0,Ao=!0,gi=5e5,Gr=11,mc=Gr*4,Wh=gi/mc|0,Fi=3,bc=Fi*4,zn=gi/bc|0;fn=!1,yi=5,jn=.5,mi=b(640,80),Ur=!1,As={},qs=[];xi=class{constructor(t,e,s="",i="\u{1F3C6}",o){f(t>=0&&!As[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),As[t]=this}unlock(){Ur||this.unlocked||(f(bi,"save name must be set"),this.unlocked=!0,Vr(),qs.push(this))}render(t=0){let e=ut,s=tt(mi.x,B.width),i=mi.y,o=B.width-s,a=-i*t,r=Ge(0,0,.9);e.save(),e.beginPath(),e.fillStyle=r.toString(),e.strokeStyle=it.toString(),e.lineWidth=3,e.rect(o,a,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,a+i/2),l);let u=i*.5,h=i*.3,p=b(o+l+2*c.x,a+c.y*2+u/2),d=s-l-3*c.x;nn(this.name,p,u,it,0,void 0,"left",void 0,void 0,d),p.y=a+i-c.y*2-h/2,nn(this.description,p,h,it,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?ut.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):nn(this.icon,t,e*.7,it)}};_o=class extends xi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Es&&Es.unlockMedal(this.id)}},Ro=class{constructor(t,e,s){var c,l,u;f(!Es,"there can only be one newgrounds object"),f(!e||s,"must provide cryptojs if there is a cipher"),Es=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){fn&&xt("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],fn&&xt(this.medals);for(let h of this.medals){let p=As[h.id];p&&(p.image=new Image,p.image.src=h.icon,p.name=h.name,p.description=h.description,p.unlocked=h.unlocked,p.difficulty=h.difficulty,p.value=h.value,p.value&&(p.description=p.description+` (${p.value})`))}let a=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=a==null?void 0:a.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],fn&&xt(this.scoreboards);let r=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),r)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),p=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(p.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},a=new FormData;a.append("input",JSON.stringify(o));let r=new XMLHttpRequest;r.open("POST","https://newgrounds.io/gateway_v3.php",!fn&&s);try{r.send(a)}catch(l){fn&&xt("newgrounds call failed",l);return}return fn&&xt(r.responseText),r.responseText&&JSON.parse(r.responseText)}},Po=class{constructor(t,e=!1,s=!1){f(!kt,"Post process already initialized"),f(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),kt=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),Cn(void 0,r,o,a);function i(){if(z)return;if(!G){console.warn("PostProcessPlugin: WebGL not enabled!");return}kt.texture=ji(),kt.shader=Xn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
 precision highp float;uniform sampler2D iChannel0;uniform vec3 iResolution;uniform float iTime;out vec4 c;
 `+t+`
-void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),Mt.vao=g.createVertexArray(),g.bindVertexArray(Mt.vao),g.bindBuffer(g.ARRAY_BUFFER,Nn);let c=8,l=g.getAttribLocation(Mt.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){Mt.shader=void 0,Mt.texture=void 0,xt("PostProcessPlugin: WebGL context lost")}function a(){i(),xt("PostProcessPlugin: WebGL context restored")}function r(){if(z||!G)return;Rt(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(Mt.shader),g.bindVertexArray(Mt.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,Mt.texture),e?(Be.width=I.x,Be.height=I.y,Br(Ke),Ke.drawImage(B,0,0),B.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,Be)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,et);let c=l=>g.getUniformLocation(Mt.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),$t),g.uniform3f(c("iResolution"),B.width,B.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,et),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),ws(!0)}}},Lo=class{constructor(t,e){f(!q,"LightSystemPlugin already initialized"),f(!Mt,"LightSystemPlugin must be created before PostProcessPlugin"),q=this,this.enabled=!0,this.ambientColor=(e||it).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),Cn(void 0,i,o,a);function s(){if(z)return;if(!G){console.warn("LightSystemPlugin: WebGL not enabled!");return}q.textureSize||(q.textureSize=I.copy()),q.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,q.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,q.textureSize.x,q.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),q.lightShader=Xn(`#version 300 es
+void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),kt.vao=g.createVertexArray(),g.bindVertexArray(kt.vao),g.bindBuffer(g.ARRAY_BUFFER,Nn);let c=8,l=g.getAttribLocation(kt.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){kt.shader=void 0,kt.texture=void 0,xt("PostProcessPlugin: WebGL context lost")}function a(){i(),xt("PostProcessPlugin: WebGL context restored")}function r(){if(z||!G)return;Rt(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(kt.shader),g.bindVertexArray(kt.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,kt.texture),e?(Ne.width=I.x,Ne.height=I.y,Br(Ke),Ke.drawImage(B,0,0),B.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,Ne)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,et);let c=l=>g.getUniformLocation(kt.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),Kt),g.uniform3f(c("iResolution"),B.width,B.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,et),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),ws(!0)}}},Lo=class{constructor(t,e){f(!q,"LightSystemPlugin already initialized"),f(!kt,"LightSystemPlugin must be created before PostProcessPlugin"),q=this,this.enabled=!0,this.ambientColor=(e||it).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),Cn(void 0,i,o,a);function s(){if(z)return;if(!G){console.warn("LightSystemPlugin: WebGL not enabled!");return}q.textureSize||(q.textureSize=I.copy()),q.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,q.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,q.textureSize.x,q.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),q.lightShader=Xn(`#version 300 es
 precision highp float;uniform mat4 m;uniform vec2 lightPos;uniform float radius;in vec2 g;out vec2 vWorldPos;void main(){vec2 worldP=lightPos+(g-.5)*2.*radius;gl_Position=m*vec4(worldP,1,1);vWorldPos=worldP;}`,`#version 300 es
 precision highp float;uniform vec2 lightPos;uniform float radius;uniform float fadeRange;uniform vec4 color;in vec2 vWorldPos;out vec4 c;void main(){float dist=distance(vWorldPos,lightPos);float t=clamp((radius-dist)/max(fadeRange,1e-6),0.,1.);c=vec4(color.rgb*t*color.a,1.);}`),q.compositeShader=Xn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
-precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),q.lightVAO=g.createVertexArray(),g.bindVertexArray(q.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,Nn);let r=g.getAttribLocation(q.lightShader,"g");g.enableVertexAttribArray(r),g.vertexAttribPointer(r,2,g.FLOAT,!1,8,0),q.compositeVAO=g.createVertexArray(),g.bindVertexArray(q.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,Nn);let c=g.getAttribLocation(q.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(z||!G||!q.enabled||!q.texture)return;Rt();let r=On,c=q.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,q.texture,0),g.viewport(0,0,q.textureSize.x,q.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),fs(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of vt)u.destroyed||u.renderLight();Rt(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y),g.useProgram(q.compositeShader),g.bindVertexArray(q.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,q.texture);let l=q.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),B.width,B.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),Kt&&g.bindTexture(g.TEXTURE_2D,Kt),fs(r),ws(!0)}function o(){q.texture=void 0,q.lightShader=void 0,q.compositeShader=void 0,q.lightVAO=void 0,q.compositeVAO=void 0,xt("LightSystemPlugin: WebGL context lost")}function a(){s(),xt("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(z||!G||!this.lightShader)return;Rt(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*H).divide(I),s=_t.rotate(-Q),i=b(-1).subtract(s.multiply(e)),o=ct(Q),a=st(Q),r=[e.x*o,e.y*a,0,0,-e.x*a,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,r),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),ws(!0)}},Oo=class extends Je{constructor(t,e,s,i){super(t,b(1),void 0,0,s),f(L(e)&&e>=0,"Light radius must be a non-negative number"),f(i===void 0||L(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){q&&q.drawLight(this)}},Do=class extends bs{constructor(t){super(void 0),!(!qt||z)&&(this.randomness=0,this.sampleChannels=Cc(...t),this.sampleRate=Qn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Wr=0;Io=class{constructor(t=ut){f(!E,"UI system already initialized"),E=this,this.activateOnPress=!1,this.defaultColor=W,this.defaultLineColor=it,this.defaultTextColor=it,this.defaultButtonColor=ke(0,0,.7),this.defaultHoverColor=ke(0,0,.9),this.defaultDisabledColor=ke(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Rs,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=pe,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Ee(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var a;return(a=this._keyInputObject)==null?void 0:a.onKeyDown(o)},Cn(s,i);function e(o){let a,r;o.parent?(a=o.parent.nativePos,r=o.parent.size):(a=E.screenToNative(I.scale(.5)),r=E.nativeHeight?b(I.x*E.nativeHeight/I.y,E.nativeHeight):I);let c=o.anchor;o.nativePos=a.add(r.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){E.activeObject&&!E.activeObject.visible&&(E.activeObject=void 0),E.lastHoverObject=E.hoverObject,E.hoverObject=void 0,ps(0)&&(E.navigationMode=!1,E.navigationObject=void 0),E.keyInputObject&&(E.activeObject=E.keyInputObject,E.hoverObject=E.keyInputObject,E.navigationMode=!1,E.navigationObject=void 0);let o=E.getNavigableObjects();if(!o.length)E.navigationObject=void 0;else if(!E.keyInputObject){if(o.includes(E.navigationObject)||(E.navigationObject=void 0),ie||E.navigationMode&&!E.navigationObject&&(E.navigationObject=o.find(r=>r.navigationAutoSelect)),!E.navigationTimer.active()){let r=ne(E.getNavigationDirection());if(r){let c;if(E.navigationObject){let l=o.indexOf(E.navigationObject),u=se(l+r,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=r>0?0:o.length-1;c=o[l]}E.navigationObject!==c&&(E.navigationMode=!0,E.hoverObject=void 0,E.navigationObject=c,E.navigationTimer.set(E.navigationDelay),c.soundPress&&c.soundPress.play())}}E.navigationObject&&E.getNavigationWasPressed()&&E.navigationObject.navigatePressed()}for(let r=E.uiObjects.length;r--;){let c=E.uiObjects[r];c.parent||a(c)}E.uiObjects=E.uiObjects.filter(r=>!r.destroyed);function a(r){if(!(r.destroyed||!r.visible)){e(r);for(let c=r.children.length;c--;){let l=r.children[c];l&&a(l)}r.destroyed||r.update()}}}function i(){let o=E.uiContext;if(o.save(),E.nativeHeight){let r=I.y/E.nativeHeight;o.translate(-r*I.x/2,0),o.scale(r,r),o.translate(I.x/2/r,0)}function a(r){if(r.visible){e(r),r.render();for(let c of r.children)a(c)}}if(E.uiObjects.forEach(r=>r.parent||a(r)),Wr>0){let r=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)r(u,l)};E.uiObjects.forEach(c=>c.parent||r(c))}o.restore()}}drawRect(t,e,s=W,i=0,o=it,a=0,r,c=it,l=0,u=b()){f(O(t),"pos must be a vec2"),f(O(e),"size must be a vec2"),f(U(s),"color must be a color"),f(L(i),"lineWidth must be a number"),f(U(o),"lineColor must be a color"),f(L(a),"cornerRadius must be a number");let h=E.uiContext;if(r){let p=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();p.addColorStop(0,d),p.addColorStop(.5,r.toString()),p.addColorStop(1,d),h.fillStyle=p}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),a&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,a):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=E.defaultLineWidth,i=E.defaultLineColor){f(O(t),"posA must be a vec2"),f(O(e),"posB must be a vec2"),f(L(s),"lineWidth must be a number"),f(U(i),"lineColor must be a color");let o=E.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=E.defaultColor,o=0,a=!1,r=it,c=0,l=b()){let u=E.uiContext;(c||l.x||l.y)&&r.a>0&&(u.shadowColor=r.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),It(t,e,s,i,o,a,pe,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=E.defaultColor,o=E.defaultLineWidth,a=E.defaultLineColor,r="center",c=E.defaultFont,l="",u=!0,h=void 0,p=it,d=0,y=b()){let x=E.uiContext;p.a>0&&(h&&nn(t,e.add(h),s.y,p,o,a,r,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=p.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),nn(t,e,s.y,i,o,a,r,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[a,r]of this._dragListeners)document.removeEventListener(a,r);this._dragListeners=[];let o=(a,r)=>{let c=l=>{l.preventDefault(),a&&a(l)};document.addEventListener(r,c),this._dragListeners.push([r,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!E.nativeHeight)return t;let e=I.y/E.nativeHeight,s=1/e,i=t.copy();return i.x+=e*I.x/2,i.x*=s,i.y*=s,i.x-=s*I.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=E.uiObjects.length;s--;){let i=E.uiObjects[s];E.confirmDialog&&i!==E.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=E.navigationDirection===1,e=E.navigationDirection===2;if(Bn){let l=gs(0,mt),u=bo(mt);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",a="ArrowRight";if(e)return Dt(s)||Dt(o)?-1:Dt(i)||Dt(a)?1:0;let r=t?s:o,c=t?i:a;return Dt(r)?-1:Dt(c)?1:0}getNavigationOtherDirection(){if(E.navigationDirection===2)return 0;let t=E.navigationDirection===1;if(Bn){let i=gs(0,mt),o=bo(mt);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return Dt(e)?-1:Dt(s)?1:0}getNavigationWasPressed(){return Bn?Rr(0,mt):kt("Space")||kt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){f(!E.confirmDialog);let a=E.navigationDirection;E.navigationDirection=2;let r=new re(b(),i);E.confirmDialog=r,r.onRender=()=>{let d=ke(0,0,0,.7);E.drawRect(b(),b(1e9),d)},r.onUpdate=()=>{kt(o)&&p()},r.isMouseOverlapping=()=>!0;let c=50,l=new vi(b(0,-50),b(i.x-c,70),t);r.addChild(l);let u=new Cs(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=ke(0,1,.5),u.onClick=()=>{p(),e&&e()},r.addChild(u);let h=new Cs(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{p(),s&&s()},r.addChild(h);function p(){f(E.confirmDialog===r),r.destroy(),E.confirmDialog=void 0,E.navigationDirection=a,ks()}}},re=class{constructor(t=b(),e=b()){var s,i;f(O(t),"ui object pos must be a vec2"),f(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=E.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=E.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=E.defaultTextColor.copy(),this.hoverColor=E.defaultHoverColor.copy(),this.lineColor=E.defaultLineColor.copy(),this.gradientColor=E.defaultGradientColor?E.defaultGradientColor.copy():void 0,this.lineWidth=E.defaultLineWidth,this.cornerRadius=E.defaultCornerRadius,this.font=E.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=E.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=E.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=E.defaultSoundPress,this.soundRelease=E.defaultSoundRelease,this.soundClick=E.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=E.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=E.defaultShadowBlur,this.shadowOffset=(i=E.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),E.uiObjects.push(this)}addChild(t){return f(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){f(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){E.activeObject===this&&(E.activeObject=void 0),E.hoverObject===this&&(E.hoverObject=void 0),E.lastHoverObject===this&&(E.lastHoverObject=void 0),E.navigationObject===this&&(E.navigationObject=void 0),E.keyInputObject===this&&(E.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!oi)return!1;let t=ie?this.size.add(b(this.extraTouchSize||0)):this.size,e=E.screenToNative(zt);return Qs(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===E.activeObject&&(E.activeObject=void 0),this===E.keyInputObject&&(E.keyInputObject=void 0)),E.keyInputObject)return;let t=E.lastHoverObject===this,e=this.isActiveObject(),s=cs(0),i=this.dragActivate?s:ps(0);this.canBeHover&&(E.navigationMode||(i||e||!s&&!ie)&&!E.hoverObject&&this.isMouseOverlapping()&&(E.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||ps(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),E.activeObject&&!e&&E.activeObject.onRelease(),E.activeObject=this,E.activateOnPress&&this.click(!this.soundPress)),E.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Cr(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),E.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);E.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return E.hoverObject===this}isActiveObject(){return E.activeObject===this}isNavigationObject(){return E.navigationObject===this}isKeyInputObject(){return E.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
+precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),q.lightVAO=g.createVertexArray(),g.bindVertexArray(q.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,Nn);let r=g.getAttribLocation(q.lightShader,"g");g.enableVertexAttribArray(r),g.vertexAttribPointer(r,2,g.FLOAT,!1,8,0),q.compositeVAO=g.createVertexArray(),g.bindVertexArray(q.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,Nn);let c=g.getAttribLocation(q.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(z||!G||!q.enabled||!q.texture)return;Rt();let r=On,c=q.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,q.texture,0),g.viewport(0,0,q.textureSize.x,q.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),fs(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of vt)u.destroyed||u.renderLight();Rt(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y),g.useProgram(q.compositeShader),g.bindVertexArray(q.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,q.texture);let l=q.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),B.width,B.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),Qt&&g.bindTexture(g.TEXTURE_2D,Qt),fs(r),ws(!0)}function o(){q.texture=void 0,q.lightShader=void 0,q.compositeShader=void 0,q.lightVAO=void 0,q.compositeVAO=void 0,xt("LightSystemPlugin: WebGL context lost")}function a(){s(),xt("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(z||!G||!this.lightShader)return;Rt(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*H).divide(I),s=_t.rotate(-Q),i=b(-1).subtract(s.multiply(e)),o=lt(Q),a=st(Q),r=[e.x*o,e.y*a,0,0,-e.x*a,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,r),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),ws(!0)}},Oo=class extends Ue{constructor(t,e,s,i){super(t,b(1),void 0,0,s),f(L(e)&&e>=0,"Light radius must be a non-negative number"),f(i===void 0||L(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){q&&q.drawLight(this)}},Do=class extends bs{constructor(t){super(void 0),!(!Ht||z)&&(this.randomness=0,this.sampleChannels=Cc(...t),this.sampleRate=Qn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Wr=0;Io=class{constructor(t=ut){f(!E,"UI system already initialized"),E=this,this.activateOnPress=!1,this.defaultColor=W,this.defaultLineColor=it,this.defaultTextColor=it,this.defaultButtonColor=Ge(0,0,.7),this.defaultHoverColor=Ge(0,0,.9),this.defaultDisabledColor=Ge(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Rs,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=pe,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Ee(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var a;return(a=this._keyInputObject)==null?void 0:a.onKeyDown(o)},Cn(s,i);function e(o){let a,r;o.parent?(a=o.parent.nativePos,r=o.parent.size):(a=E.screenToNative(I.scale(.5)),r=E.nativeHeight?b(I.x*E.nativeHeight/I.y,E.nativeHeight):I);let c=o.anchor;o.nativePos=a.add(r.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){E.activeObject&&!E.activeObject.visible&&(E.activeObject=void 0),E.lastHoverObject=E.hoverObject,E.hoverObject=void 0,ps(0)&&(E.navigationMode=!1,E.navigationObject=void 0),E.keyInputObject&&(E.activeObject=E.keyInputObject,E.hoverObject=E.keyInputObject,E.navigationMode=!1,E.navigationObject=void 0);let o=E.getNavigableObjects();if(!o.length)E.navigationObject=void 0;else if(!E.keyInputObject){if(o.includes(E.navigationObject)||(E.navigationObject=void 0),ie||E.navigationMode&&!E.navigationObject&&(E.navigationObject=o.find(r=>r.navigationAutoSelect)),!E.navigationTimer.active()){let r=ne(E.getNavigationDirection());if(r){let c;if(E.navigationObject){let l=o.indexOf(E.navigationObject),u=se(l+r,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=r>0?0:o.length-1;c=o[l]}E.navigationObject!==c&&(E.navigationMode=!0,E.hoverObject=void 0,E.navigationObject=c,E.navigationTimer.set(E.navigationDelay),c.soundPress&&c.soundPress.play())}}E.navigationObject&&E.getNavigationWasPressed()&&E.navigationObject.navigatePressed()}for(let r=E.uiObjects.length;r--;){let c=E.uiObjects[r];c.parent||a(c)}E.uiObjects=E.uiObjects.filter(r=>!r.destroyed);function a(r){if(!(r.destroyed||!r.visible)){e(r);for(let c=r.children.length;c--;){let l=r.children[c];l&&a(l)}r.destroyed||r.update()}}}function i(){let o=E.uiContext;if(o.save(),E.nativeHeight){let r=I.y/E.nativeHeight;o.translate(-r*I.x/2,0),o.scale(r,r),o.translate(I.x/2/r,0)}function a(r){if(r.visible){e(r),r.render();for(let c of r.children)a(c)}}if(E.uiObjects.forEach(r=>r.parent||a(r)),Wr>0){let r=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)r(u,l)};E.uiObjects.forEach(c=>c.parent||r(c))}o.restore()}}drawRect(t,e,s=W,i=0,o=it,a=0,r,c=it,l=0,u=b()){f(O(t),"pos must be a vec2"),f(O(e),"size must be a vec2"),f(U(s),"color must be a color"),f(L(i),"lineWidth must be a number"),f(U(o),"lineColor must be a color"),f(L(a),"cornerRadius must be a number");let h=E.uiContext;if(r){let p=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();p.addColorStop(0,d),p.addColorStop(.5,r.toString()),p.addColorStop(1,d),h.fillStyle=p}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),a&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,a):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=E.defaultLineWidth,i=E.defaultLineColor){f(O(t),"posA must be a vec2"),f(O(e),"posB must be a vec2"),f(L(s),"lineWidth must be a number"),f(U(i),"lineColor must be a color");let o=E.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=E.defaultColor,o=0,a=!1,r=it,c=0,l=b()){let u=E.uiContext;(c||l.x||l.y)&&r.a>0&&(u.shadowColor=r.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),Mt(t,e,s,i,o,a,pe,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=E.defaultColor,o=E.defaultLineWidth,a=E.defaultLineColor,r="center",c=E.defaultFont,l="",u=!0,h=void 0,p=it,d=0,y=b()){let x=E.uiContext;p.a>0&&(h&&nn(t,e.add(h),s.y,p,o,a,r,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=p.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),nn(t,e,s.y,i,o,a,r,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[a,r]of this._dragListeners)document.removeEventListener(a,r);this._dragListeners=[];let o=(a,r)=>{let c=l=>{l.preventDefault(),a&&a(l)};document.addEventListener(r,c),this._dragListeners.push([r,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!E.nativeHeight)return t;let e=I.y/E.nativeHeight,s=1/e,i=t.copy();return i.x+=e*I.x/2,i.x*=s,i.y*=s,i.x-=s*I.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=E.uiObjects.length;s--;){let i=E.uiObjects[s];E.confirmDialog&&i!==E.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=E.navigationDirection===1,e=E.navigationDirection===2;if(Bn){let l=gs(0,mt),u=bo(mt);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",a="ArrowRight";if(e)return It(s)||It(o)?-1:It(i)||It(a)?1:0;let r=t?s:o,c=t?i:a;return It(r)?-1:It(c)?1:0}getNavigationOtherDirection(){if(E.navigationDirection===2)return 0;let t=E.navigationDirection===1;if(Bn){let i=gs(0,mt),o=bo(mt);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return It(e)?-1:It(s)?1:0}getNavigationWasPressed(){return Bn?Rr(0,mt):Gt("Space")||Gt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){f(!E.confirmDialog);let a=E.navigationDirection;E.navigationDirection=2;let r=new re(b(),i);E.confirmDialog=r,r.onRender=()=>{let d=Ge(0,0,0,.7);E.drawRect(b(),b(1e9),d)},r.onUpdate=()=>{Gt(o)&&p()},r.isMouseOverlapping=()=>!0;let c=50,l=new vi(b(0,-50),b(i.x-c,70),t);r.addChild(l);let u=new Cs(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=Ge(0,1,.5),u.onClick=()=>{p(),e&&e()},r.addChild(u);let h=new Cs(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{p(),s&&s()},r.addChild(h);function p(){f(E.confirmDialog===r),r.destroy(),E.confirmDialog=void 0,E.navigationDirection=a,ks()}}},re=class{constructor(t=b(),e=b()){var s,i;f(O(t),"ui object pos must be a vec2"),f(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=E.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=E.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=E.defaultTextColor.copy(),this.hoverColor=E.defaultHoverColor.copy(),this.lineColor=E.defaultLineColor.copy(),this.gradientColor=E.defaultGradientColor?E.defaultGradientColor.copy():void 0,this.lineWidth=E.defaultLineWidth,this.cornerRadius=E.defaultCornerRadius,this.font=E.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=E.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=E.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=E.defaultSoundPress,this.soundRelease=E.defaultSoundRelease,this.soundClick=E.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=E.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=E.defaultShadowBlur,this.shadowOffset=(i=E.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),E.uiObjects.push(this)}addChild(t){return f(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){f(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){E.activeObject===this&&(E.activeObject=void 0),E.hoverObject===this&&(E.hoverObject=void 0),E.lastHoverObject===this&&(E.lastHoverObject=void 0),E.navigationObject===this&&(E.navigationObject=void 0),E.keyInputObject===this&&(E.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!oi)return!1;let t=ie?this.size.add(b(this.extraTouchSize||0)):this.size,e=E.screenToNative(Jt);return Qs(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===E.activeObject&&(E.activeObject=void 0),this===E.keyInputObject&&(E.keyInputObject=void 0)),E.keyInputObject)return;let t=E.lastHoverObject===this,e=this.isActiveObject(),s=cs(0),i=this.dragActivate?s:ps(0);this.canBeHover&&(E.navigationMode||(i||e||!s&&!ie)&&!E.hoverObject&&this.isMouseOverlapping()&&(E.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||ps(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),E.activeObject&&!e&&E.activeObject.onRelease(),E.activeObject=this,E.activateOnPress&&this.click(!this.soundPress)),E.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Cr(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),E.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);E.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return E.hoverObject===this}isActiveObject(){return E.activeObject===this}isNavigationObject(){return E.navigationObject===this}isKeyInputObject(){return E.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
 text = `+this.text),(this.nativePos.x||this.nativePos.y)&&(t+=`
 nativePos = `+this.nativePos),(this.localPos.x||this.localPos.y)&&(t+=`
 localPos = `+this.localPos),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.color&&(t+=`
-color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?Ka:this.disabled?tc:this.interactive?rr:Za:Qa;E.drawRect(this.nativePos,this.size,pe,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},vi=class extends re{constructor(t,e,s="",i="center",o=E.defaultFont){super(t,e),f(V(s),"ui text must be a string"),f(["left","center","right"].includes(i),"ui text align must be left, center, or right"),f(V(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=pe,this.shadowColor=pe,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();E.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Mo=class extends re{constructor(t,e,s=""){super(t,e),f(V(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){E.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),E.activeObject=void 0,E.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,a=i-s,r=o-a/2,c=o+a/2,l=E.screenToNative(zt);this.value=e?jt(l.x,r,c):jt(l.y,c,r)}else if(this.isNavigationObject()){let e=E.getNavigationOtherDirection();E.navigationTimer.active()||(this.value=N(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=tt(s,this.cornerRadius*2),a=Vt(o,e,this.value),r=(a-e)*(t?.5:-.5),c=this.nativePos.add(t?b(r,0):b(0,r)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(a,this.size.y):b(this.size.x,a);E.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=N(t?this.value:1-this.value),a=(e-s)*(o-.5),r=this.nativePos.add(t?b(a,0):b(0,a)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);E.drawRect(r,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();E.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},jo=class extends re{constructor(t,e,s,i=!1,o=!1,a=1){super(t,e||b()),f(V(s),"video src must be a string"),f(L(a),"video volume must be a number"),this.color=it,this.cornerRadius=0,this.volume=a,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=N(a*Sn),this.video.muted=!qt,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),f(L(s),"ui layout gap must be a number"),f(L(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=pe,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=pe),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=us(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let p=0;p=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=J(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=W,e=it,s=.1,i,o){this.getFixtureList().forEach(a=>{m.castShapeObject(a.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(a,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(a=>mo(a,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(a=>mo(a,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){f(L(e),"density must be a number"),f(L(s),"friction must be a number"),f(L(i),"restitution must be a number");let a=new m.instance.b2FixtureDef;return a.set_shape(t),a.set_density(e),a.set_friction(s),a.set_restitution(i),a.set_isSensor(o),this.body.CreateFixture(a)}addBox(t=b(1),e=b(),s=0,i,o,a,r){f(O(t),"size must be a Vector2"),f(t.x>0&&t.y>0,"size must be positive"),f(O(e),"offset must be a Vector2"),f(L(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,a,r)}addPoly(t,e,s,i,o){f(de(t),"points must be an array");function a(c){f(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let p=0,d=0;p>2]=c[p].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[p].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let r=a(t);return this.addShape(r,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,a){f(L(t)&&t>0,"diameter must be a positive number"),f(L(e)&&e>2,"sides must be a positive number greater than 2");let r=[],c=t/2;for(let l=e;l--;)r.push(b(c,0).rotate((l+.5)/e*X*2));return this.addPoly(r,s,i,o,a)}addRandomPoly(t=1,e,s,i,o){f(L(t)&&t>0,"diameter must be a positive number");let a=or(3,9),r=[],c=t/2;for(let l=a;l--;)r.push(b(dt(c/2,c*1.5),0).rotate(l/a*X*2));return this.addPoly(r,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,a){f(L(t)&&t>0,"diameter must be a positive number"),f(O(e),"offset must be a Vector2");let r=new m.instance.b2CircleShape;return r.set_m_p(m.vec2dTo(e)),r.set_m_radius(t/2),this.addShape(r,s,i,o,a)}addEdge(t,e,s,i,o,a){f(O(t),"point1 must be a Vector2"),f(O(e),"point2 must be a Vector2");let r=new m.instance.b2EdgeShape;return r.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(r,s,i,o,a)}addEdgeList(t,e,s,i,o){f(de(t),"points must be an array");let a=[],r=[];for(let c=0;ct[se(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},Si=class extends _s{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeStatic;super(t,e,s,i,o,r,a)}},No=class extends _s{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeKinematic;super(t,e,s,i,o,r,a)}},zo=class extends Si{constructor(t){f(t instanceof vs,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(a,r)=>a+r*this.size.x,o=(a,r)=>!s[i(a,r)]&&this.tileLayer.getCollisionData(b(a,r))>0;for(let a=0;ai.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ci.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,Yt.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Oc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,Yt.indexOf(this)<0&&Yt.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&Yt.indexOf(this)>=0}getPercent(){return jt(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return La(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=Yt.indexOf(this);t>=0&&Yt.splice(t,1),this.thenCallback=void 0}},Ci={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-ct(n*(X/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*st((37-40*n)*X/6),SPRING:n=>1-(st(X*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ci.PIECEWISE(n,Ci.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let a=1-o,r=3*a*a*o,c=3*a*o*o,l=o**3;return[r*n+c*e+l,r*t+c*s+l]};return o=>{let a=0,r=1;for(let c=0;c<128;c++){let l=(a+r)/2,[u,h]=i(l);if(nt(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(St(t.x-e),St(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&bt(r.posWorld,lo,J(1,0,0,tt(.2,l*.05)),this.debugTime):bt(r.posWorld,lo,J(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){f(t&&e,"aStarSearch needs both endpoints"),f(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),f(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,a=s[0].f;for(let c=1;cthis.maxLoop)break;r.isOpen=!1,s.splice(o,1),r.isClosed=!0,this.debug&&this.debugTime>0&&bt(r.posWorld,lo,J(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(r.pos.x+l,r.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(r.pos.x+l,r.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(r.pos.x,r.pos.y+c);if(!w||!w.walkable)continue;h=fd}let p=r.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(p>=u.g)continue;u.parent=r,u.g=p;let d=nt(e.pos.x-u.pos.x),y=nt(e.pos.y-u.pos.y),x=K(d,y)+(Math.SQRT2-1)*tt(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){f(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,a=St(t.x-i),r=St(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let p=-c;p<=c;++p){if(c>0&&nt(p)!==c&&nt(h)!==c)continue;let d=this.getNode(a+p,r+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Jt(i.posWorld,.3,J(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=K(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Jt(i.posWorld,.3,J(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=K(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Jt(i.posWorld,.3,J(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,C=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,P=C*C+A*A,M=T0&&Jt(i.posWorld,.3,J(0,1,0,.5),this.debugTime),l===h&&u===p){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=K(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&we(o.posWorld,t[t.length-1].posWorld,J(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){f(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),f(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=nt(s),a=nt(i),r=ne(s),c=ne(i),l=t.x,u=t.y;if(a===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=r,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ar.posWorld.copy());if(this.debug&&this.debugTime>0&&a.length>0){for(let r=1;rpd,bootGameHost:()=>yd,default:()=>gd});var js=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ji=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},Ui=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let a=e._subs.get(i)||[],r={handler:o,scope:s};return a.push(r),e._subs.set(i,a),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(r);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let a=e._subs.get(i);if(!a)return;let r=a.findIndex(c=>c.handler===o&&c.scope===s);r>=0&&a.splice(r,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let a=o.slice();for(let r of a)try{r.handler(i)}catch(c){qe("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(a=>a.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Vi.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Vi).join("/")+"\uFF09")}},Vi=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Xr(n){let t=n||{},e=new Ji(t.clock),s=new js(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new Ui(e),a=typeof t.audioFactory=="function"?t.audioFactory:null,r=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,p=new Map,d=0,y=0;function x(){if(r)return r;if(!a)return c||(qi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{r=a()}catch(C){qe("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",C),r=null}return r}function v(){if(u)return u;if(!l)return h||(qi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(C){qe("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",C),u=null}return u}function w(C,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(P){let M=d++;return p.set(M,P),{cancel(){p.delete(M)}}},getInput(){return o.sourceFor(C)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(C){y+=1;let A=Array.from(p.values());for(let T of A)try{T(C,y)}catch(P){qe("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,P)}},frameCount(){return y},inputBridge:o,deriveContextFor(C,A){let T=zc(i,C),P=new js(T);return w(A==null?C:A,P)}};return Object.defineProperty(_,Wi,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Wi=Symbol("zaomeng.coreProtocol.contextBundle"),Bs=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return qi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),qe("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let a=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:a}),qe("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,a)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Wi],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Wi],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let a=this._initOrder[o],r=this._plugins.get(a);if(r&&typeof r.dispose=="function")try{r.dispose(),t.push(a)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:a,error:l}),qe("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(a)}catch(c){qe("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let a=0;a<32;a+=8){let r=i>>>a&255;e^=r,e=Math.imul(e,s)>>>0}let o=String(t);for(let a=0;a>>0,e^=r>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function qe(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function qi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Vi)),Yr="core-protocol-v0";var $r=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Hi=$r.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set($r);function Xi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var Kr=Xi("runtime-probe::seed::v1");function Ns(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Ns).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Ns(n[e])).join(",")+"}"}function Qr(n){let t=Ns(n.extra==null?null:n.extra),e=Ns(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=Kr,e=-1;for(let s=0;stypeof C=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,a=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",r=()=>0,c=!1,l=0,u=Kr,h=[],p=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(C,A){let T=null;if(!Uc.has(C))T="unknown_anchor";else{p.has(C)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let M=Hi[C];MC.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=C.getInput().on(a,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:a})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(C=>({...C}))},toJSONL(){return h.map(C=>JSON.stringify(C)).join(`
-`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ta(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(r,c,l)=>(i("math.lerp"),o.lerp(r,c,l)),smoothStep:r=>(i("math.smoothStep"),o.smoothStep(r)),easing:Object.fromEntries(Object.keys(o.easing).map(r=>[r,c=>(i("math.easing."+r),o.easing[r](c))]))},particles:{spawnEmitter(r){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(r.pos.x,r.pos.y)),l=t.cameraScale,u=r.emitTime!=null?r.emitTime:r.count!=null?1/60:0,h=r.emitRate!=null?r.emitRate:r.count!=null?r.count*60:100,p=(r.speed!=null?r.speed:0)/l/60,d=r.damping!=null?r.damping:1,y=r.colorStart||{r:1,g:1,b:1,a:1},x=r.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,r.angle!=null?r.angle:0,(r.emitSize!=null?r.emitSize:0)/l,u,h,r.coneAngle!=null?r.coneAngle:Math.PI,void 0,v,v,w,w,r.particleTime!=null?r.particleTime:.5,(r.sizeStart!=null?r.sizeStart:6)/l,(r.sizeEnd!=null?r.sizeEnd:0)/l,p,0,d,1,r.gravityScale!=null?r.gravityScale:0,Math.PI,.1,0,!1,r.additive!=null?r.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:r=>{i("audio.synth.synthSfx");try{return t.zzfxG(...r)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(r,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(r,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function ce(n){return n<0?0:n>1?1:n}function ea(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),a=t.OUT(s),r=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,p)=>n.lerp(u,h,p),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(ce(u)),quadIn:u=>e(ce(u)),quadOut:u=>i(ce(u)),quadInOut:u=>o(ce(u)),cubicIn:u=>s(ce(u)),cubicOut:u=>a(ce(u)),cubicInOut:u=>r(ce(u)),backIn:u=>t.BACK(ce(u)),backOut:u=>c(ce(u)),elasticIn:u=>t.ELASTIC(ce(u)),elasticOut:u=>l(ce(u))}}}var He=2,zs=1/60;async function na(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",a=n.engineMode||"real",r=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},p=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let C=0,A=null,T=null,P=null,M=null,pt=[],rt={},at=null;function yt(D,lt){try{P&&P.mark(D,lt)}catch(te){v.push({type:"mark",message:String(te&&te.message||te)})}}function Bt(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(rt)}async function ge(D,lt){A=Xr({context2d:D,seed:i,audioFactory:S,clock:()=>C,engineFactory:()=>ta({LJS:a==="real"?s:null,engineMath:a==="real"?ea(s):null,engineMode:a,recHook:y})});let te=new Bs;for(let ye of p)te.register(ye);te.useContext(A.context),M=te.initAll(),pt=te.list().concat(["runtime-probe"]),P=Zr({pluginSet:pt,inputAnchorType:"pointerdown",autoBoot:!0});let ee=A.deriveContextFor("runtime-probe","runtime-probe");yt("t_boot",{by:"game-host",stage:"pre-init",engineMode:a}),yt("t_plugins_ready",{initialized:M.initialized.length,ok:M.ok});let Ni=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(Ni),await T.init({ctx:A.context,mainContext:D,canvas:lt(),seed:i}),at=T&&typeof T._forensicsView=="function"?T._forensicsView():null,yt("t_game_init",{hasForensics:!!at}),ht(),yt("t_first_paint",{frame:A.frameCount()});try{P.init(ee)}catch(ye){v.push({type:"probe-init",message:String(ye&&ye.message||ye)})}yt("t_game_start",{mode:o,engineMode:a}),Bt(),d(un,{bundle:A,game:T,probe:P,checklist:rt,uncaught:v,pluginSet:pt,initRes:M,getGameForensics:()=>at,mark:yt,stepOneFrame:ht})}let Pt=null;function ht(D){let lt=typeof D=="number"?D:zs;T&&(C+=lt*1e3,T.update(lt),a==="stub"&&Pt&&T.render(Pt),Bt())}function Lt(D){for(let lt=0;lt{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let un={seed:i,mode:o,engineMode:a,protocol:Yr,frameCount:()=>A?A.frameCount():0,stepFrames:Lt,startRaf:()=>F(),stopRaf:()=>k(),tap(D,lt){We(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:lt}),A.inputBridge._emit("pointerup",{x:D,y:lt}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>at?at.state():{phase:"booting"}};function hn(D){let lt=A.inputBridge;function te(ee,Ni){let ye=D.getBoundingClientRect();return{x:(ee-ye.left)/ye.width*r,y:(Ni-ye.top)/ye.height*c}}D.addEventListener("pointerdown",ee=>{We(),lt._emit("pointerdown",te(ee.clientX,ee.clientY))}),D.addEventListener("pointermove",ee=>{lt._emit("pointermove",te(ee.clientX,ee.clientY))}),D.addEventListener("pointerup",ee=>{lt._emit("pointerup",te(ee.clientX,ee.clientY))})}let ae=0,Pe=!1,Zt=0;function R(D){if(!Pe)return;Zt===0&&(Zt=D);let lt=(D-Zt)/1e3;Zt=D,lt>.05&&(lt=.05),ht(lt),ae=window.requestAnimationFrame(R)}function F(){a==="stub"&&(Pe||(Pe=!0,Zt=0,ae=window.requestAnimationFrame(R)))}function k(){Pe=!1,ae&&window.cancelAnimationFrame(ae),ae=0}function j(D){D.width=r*He,D.height=c*He,D.style.width=r+"px",D.style.height=c+"px";let lt=D.getContext("2d",{willReadFrequently:!0});return lt.setTransform(He,0,0,He,0,0),lt}async function $(){let D=j(t);return Pt=D,await ge(D,()=>t),hn(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),F()),un}let Z=()=>{},Tt=()=>{};function At(){window.__gameHostEngineInitFired=!0}function Ot(){Z()}function Le(){}function Zn(){Tt()}function dn(){}async function Fs(D){await ge(D,()=>s.mainCanvas),hn(s.mainCanvas),Z=()=>{T&&(C+=zs*1e3,T.update(zs))},Tt=()=>{if(T){D.save(),D.setTransform(He,0,0,He,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(a!=="real")return await $();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(r*He,c*He));let Dn=document.createElement("div");return Dn.id="engine-root",document.body.appendChild(Dn),await s.engineInit(At,Ot,Le,Zn,dn,[],Dn).then(()=>Fs(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),un}var Yi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),a=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:a}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:a}=this._cellRange(e),r=[];for(let l=i;l<=a;l++)for(let u=s;u<=o;u++){let h=u+","+l,p=this._cells.get(h);p||(p=new Set,this._cells.set(h,p)),p.add(t),r.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:r})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),a=new Set;for(let r=s;r<=o;r++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+r);if(l)for(let u of l)a.add(u)}return this._collect(a)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),a=this._cells.get(i+","+o);return a?this._collect(new Set(a)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function sa(n){let t=n||{},e=new Yi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function ia(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function Nt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=Nt(n),n*n),Yc=n=>(n=Nt(n),1-(1-n)*(1-n)),$c=n=>(n=Nt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=Nt(n),n*n*n),Qc=n=>{n=Nt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=Nt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),aa=2*Math.PI/3,oa=2*Math.PI/4.5,tl=n=>(n=Nt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*aa)),el=n=>(n=Nt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*aa)+1),nl=n=>(n=Nt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*oa))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*oa)/2+1),Us=1.70158,Js=Us*1.525,ca=Us+1,sl=n=>(n=Nt(n),ca*n*n*n-Us*n*n),il=n=>{n=Nt(n);let t=n-1;return 1+ca*t*t*t+Us*t*t},ol=n=>(n=Nt(n),n<.5?Math.pow(2*n,2)*((Js+1)*2*n-Js)/2:(Math.pow(2*n-2,2)*((Js+1)*(n*2-2)+Js)+2)/2),rl=n=>Nt(n),ra=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return ra;let e=i=>typeof t[i]=="function"?o=>t[i](Nt(o)):ra[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var $i=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let a of o){this._records.set(a,null);let r=t.on(a,c=>{this._records.set(a,c.tMs)});this._subs.push(r)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function la(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(a){let r=a.getInput();e=new $i(r,a.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=a.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function Vs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Ki(t):null}function Ki(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Ki(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:Vs(n.sizeCurve,0),sizeEnd:Vs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:Vs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:Vs(n.alphaCurve,1)},additive:!1}}function ua(n){let t=n||{},e=null,s=null,i=null,o=new Map,a=0,r={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,p=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=p+(1-p)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,P=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*P,d.y=Math.cos(d._phase*1.3)*P}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,P=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(P)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let P=T.canvas?T.canvas.width:0,M=T.canvas?T.canvas.height:0;T.fillRect(0,0,P,M),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(P=>{_(P)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,P,M){let pt=typeof A=="string"?ul(A):Ki(A);if(!pt)return-1;M&&(pt=Object.assign(pt,M));let rt=a++;if(!i)return o.set(rt,r),rt;let at=i.spawnEmitter(hl(pt,T,P));return o.set(rt,at),rt},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,p=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?p:1},getTimeScale(){return l},shakeScreen(A,T,P){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=P==null?30:P,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,P){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=P==null?4:P,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ha(n){let t=gt(n.r)/255,e=gt(n.g)/255,s=gt(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),a=(i+o)/2,r=0,c=0,l=i-o;return l>1e-12&&(c=a>.5?l/(2-i-o):l/(i+o),i===t?r=(e-s)/l%6:i===e?r=(s-t)/l+2:r=(t-e)/l+4,r*=60,r<0&&(r+=360)),{h:r,s:c,l:a}}function da(n){let t=(n.h%360+360)%360,e=Xe(n.s),s=Xe(n.l);if(e<1e-12){let r=Math.round(s*255);return{r,g:r,b:r}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,a=t/360;return{r:Math.round(Qi(o,i,a+1/3)*255),g:Math.round(Qi(o,i,a)*255),b:Math.round(Qi(o,i,a-1/3)*255)}}function Qi(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function gt(n){return n<0?0:n>255?255:n}function Xe(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:gt(r.r),g:gt(r.g),b:gt(r.b)})),to:o}}function Zi(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ha(n),s=e.h+(t.hue||0),i=Xe(e.s*(t.sat==null?1:t.sat)),o=Xe(e.l*(t.light==null?1:t.light));return da({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function fa(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:to(t.vignette&&t.vignette.enabled,!1),strength:eo(t.vignette&&t.vignette.strength,.5)},dither:{enabled:to(t.dither&&t.dither.enabled,!1),strength:eo(t.dither&&t.dither.strength,.5)},scanline:{enabled:to(t.scanline&&t.scanline.enabled,!1),strength:eo(t.scanline&&t.scanline.strength,.5)}};function o(r){let c=r!==void 0?r:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(r){e=r},dispose(){s||(e=null,s=!0)},applyPaletteMap(r,c){return dl(r,c)},applyPaletteMapToBuffer(r,c){return fl(r,c)},lerpPaletteMap(r,c,l){return yl(r,c,l)},shiftHsl(r,c){return ml(r,c)},rgbToHsl(r){return ha(r)},hslToRgb(r){return da(r)},setPost(r){if(r)for(let c of["vignette","dither","scanline"])r[c]&&(typeof r[c].enabled=="boolean"&&(i[c].enabled=r[c].enabled),typeof r[c].strength=="number"&&(i[c].strength=Xe(r[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(r){o(r)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=Xe(t);if(e<=0)return n;let{data:s,width:i}=n,a=255/(Math.max(2,Math.round(16-e*14))-1);for(let r=0;r+3>2)%i,l=Math.floor((r>>2)/i),u=(bl[l&3][c&3]/16-.5)*a;for(let h=0;h<3;h++){let p=s[r+h]+u,d=Math.round(p/a)*a;s[r+h]=d<0?0:d>255?255:d}}return n}function to(n,t){return typeof n=="boolean"?n:t}function eo(n,t){return typeof n=="number"?Xe(n):t}var so=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),pa=Object.keys(so);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let a=i[0]|0;Array.isArray(n.instruments)&&(a<0||a>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${a} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let r=i[1];(r<-1||r>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${r} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function me(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function ga(n,t){let e=me(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],a=typeof s.minIntensity=="number"?me(s.minIntensity):0,r=typeof s.maxIntensity=="number"?me(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?me(s.baseVolume):1;if(er)return{id:i,on:!1,volume:0,channelIndices:o};let u=r-a,h=u<=0?1:(e-a)/u,p=me(Sl(c,h)*l);return{id:i,on:!0,volume:p,channelIndices:o}})}function ya(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,a=Math.max(i.length,o.length);if(a===0)return null;let c=n.createBuffer(2,a,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=me(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return io("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ma(n){let t=n||{},e=typeof t.masterVolume=="number"?me(t.masterVolume):1,s=()=>null,i=null,o=null,a={voices:[]},r=1,c=null,l=!1,u=0,h=!1,p=!1;function d(){let S=s();return S==null?(u+=1,h||(no("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return io("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=ga(a,r);if(S.length===0)return 1;let C=0;for(let A of S)A.on&&(C=Math.max(C,A.volume));return C}function v(S,C){typeof C=="number"&&(r=me(C));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let P=me(e*x());c=ya(A,T,P,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let C=S.getEngine&&S.getEngine();i=C?C.audio.synth:null},dispose(){p||(w(),p=!0)},loadSong(S){let C=vl(S);return C.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:no("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+C.errors.join("\uFF1B")),C},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){a=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){r=me(S)},resolveVoices(S){return ga(a,S)},playSfx(S){let C=so[S];if(!C){no("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(C.params):null;if(!T)return;ya(A,[T,T],e,!1)}catch(T){io("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return so[S]},listPresets(){return pa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:r,voiceCount:a.voices.length,looping:l,silentNoops:u,presetCount:pa.length}}}}function io(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function no(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function ro(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ba(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?ro():t.adapter,a=e+":",r=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?a+String(d):a+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(a)===0):[]}catch(d){return ts("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!oo(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return ts("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return r+=1,l||(es("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!oo(d))return es("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,es("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,es("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,es("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,ts("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(oo(d))try{o.removeItem(u(d))}catch(y){ts("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){ts("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:r,rejectedWrites:c}}}}function oo(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function ts(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function es(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var El={w:390,h:844};function va(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=sa({cellSize:96}),s=ia(),i=la({inputBufferMs:260,inputTypes:["pointerdown"]}),o=ua({seed:t,maxParticles:600}),a=fa({vignette:{enabled:!0,strength:.22}}),r=ma({masterVolume:.8}),c;try{c=ba()}catch(p){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(p&&p.message)),c=ro()}let l=xa({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:a,audioMusic:r,save:l},registerOrder:[e,s,i,o,a,l,r],viewport:El,buildFactoryOpts:(p,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ns(n){let t=n||{},e=null,s=[],i="booting",o=null,a=0,r={x:0,y:0,vx:0,vy:0,angle:0,radius:15},c=[],l=[],u=0,h={},p=200,d=600,y=2e3,x=.99,v=15,w=30,_=15,S=40,C=80,A=5,T=200,P=3;function M(R){R.x<0?R.x+=390:R.x>390&&(R.x-=390),R.y<0?R.y+=844:R.y>844&&(R.y-=844)}function pt(R,F,k,j){let $=F.x-R.x,Z=F.y-R.y,Tt=R.x-k.x,At=R.y-k.y,Ot=$*$+Z*Z,Le=2*(Tt*$+At*Z),Zn=Tt*Tt+At*At-j*j,dn=Le*Le-4*Ot*Zn;if(dn<0)return!1;dn=Math.sqrt(dn);let Fs=(-Le-dn)/(2*Ot),Dn=(-Le+dn)/(2*Ot);return Fs>=0&&Fs<=1||Dn>=0&&Dn<=1}function rt(R,F,k,j){let $=R-k,Z=F-j;return Math.sqrt($*$+Z*Z)}function at(R,F,k,j,$){return{x:R,y:F,vx:j,vy:$,radius:k,isBig:k>=w}}function yt(){c=[];let R=e.random;for(let F=0;F{Z.key&&(h[Z.key]=!0)});s.push(k);let j=F.on("keyup",Z=>{Z.key&&(h[Z.key]=!1)});s.push(j);let $=F.on("pointerdown",()=>{i==="gameover"&&We()});s.push($),Lt(),i="playing",o=null}function hn(R){if(i==="gameover")return;let F=e.time.nowMs();h.ArrowLeft&&(r.angle-=P*R),h.ArrowRight&&(r.angle+=P*R),h.ArrowUp&&(r.vx+=Math.cos(r.angle)*T*R,r.vy+=Math.sin(r.angle)*T*R,ge(r.x-Math.cos(r.angle)*20,r.y-Math.sin(r.angle)*20,{r:1,g:.8,b:.2,a:1},{r:1,g:.4,b:0,a:0},5)),h.Space&&ht(),r.vx*=x,r.vy*=x,r.x+=r.vx*R,r.y+=r.vy*R,M(r);for(let k of c)k.x+=k.vx*R,k.y+=k.vy*R,M(k);for(let k=l.length-1;k>=0;k--){let j=l[k],$=j.x,Z=j.y;if(j.x+=j.vx*R,j.y+=j.vy*R,F-j.born>y){l.splice(k,1);continue}if(j.x<0||j.x>390||j.y<0||j.y>844){l.splice(k,1);continue}let Tt=!1;for(let At=c.length-1;At>=0;At--){let Ot=c[At];if(pt({x:$,y:Z},{x:j.x,y:j.y},{x:Ot.x,y:Ot.y},Ot.radius)){Tt=!0,a+=1,ge(j.x,j.y,{r:1,g:.9,b:.5,a:1},{r:1,g:.3,b:0,a:0},30),Pt([1,.1,880,,,.2,,.4]),Ot.isBig&&Bt(Ot),c.splice(At,1);break}}Tt&&l.splice(k,1)}for(let k of c){let j=r.x-k.x,$=r.y-k.y;if(j*j+$*$<(r.radius+k.radius)*(r.radius+k.radius)){i="gameover",o="lose",ge(r.x,r.y,{r:1,g:.2,b:.2,a:1},{r:.5,g:0,b:0,a:0},40),Pt([1,.2,100,,,.5,,1.5]);return}}c.length===0&&(i="gameover",o="win")}function ae(R){R.fillStyle="#0a0a1a",R.fillRect(0,0,390,844);for(let F of c)R.fillStyle=F.isBig?"#8b5e3c":"#a0744a",R.beginPath(),R.arc(F.x,F.y,F.radius,0,Math.PI*2),R.fill(),R.strokeStyle="#d4a76a",R.lineWidth=2,R.stroke();for(let F of l)R.fillStyle="#ffff00",R.beginPath(),R.arc(F.x,F.y,F.radius,0,Math.PI*2),R.fill();R.save(),R.translate(r.x,r.y),R.rotate(r.angle),R.fillStyle=i==="gameover"?"#ff4444":"#44aaff",R.beginPath(),R.moveTo(20,0),R.lineTo(-15,-12),R.lineTo(-10,0),R.lineTo(-15,12),R.closePath(),R.fill(),R.strokeStyle="#ffffff",R.lineWidth=1.5,R.stroke(),R.restore(),R.fillStyle="#ffffff",R.font="bold 16px monospace",R.fillText("Score: "+a,10,30),R.fillText("Asteroids: "+c.length,10,50),R.fillText("Phase: "+i,10,70),i==="gameover"&&(R.fillStyle=o==="win"?"#00ff00":"#ff0000",R.font="bold 28px monospace",R.textAlign="center",R.fillText(o==="win"?"YOU WIN!":"GAME OVER",195,400),R.font="16px monospace",R.fillStyle="#ffffff",R.fillText("Tap to restart",195,430),R.textAlign="start")}function Pe(){for(let R of s)try{R.cancel()}catch{}s=[],c=[],l=[],i="booting",o=null}function Zt(){return{seed:e&&e.random?e.random.seed:null,state:()=>({phase:i,result:o,score:a,asteroidsRemaining:c.length,ship:{x:r.x,y:r.y,angle:r.angle}})}}return{init:un,update:hn,render:ae,destroy:Pe,_forensicsView:Zt}}var pd=ns,gd=ns;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Ic)),s=(t.seed!=null?t.seed:305441741)>>>0,i=va({seed:s});return na({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ns,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Nc(md);})();
+color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?Ka:this.disabled?tc:this.interactive?rr:Za:Qa;E.drawRect(this.nativePos,this.size,pe,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},vi=class extends re{constructor(t,e,s="",i="center",o=E.defaultFont){super(t,e),f(V(s),"ui text must be a string"),f(["left","center","right"].includes(i),"ui text align must be left, center, or right"),f(V(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=pe,this.shadowColor=pe,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();E.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Mo=class extends re{constructor(t,e,s=""){super(t,e),f(V(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){E.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),E.activeObject=void 0,E.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,a=i-s,r=o-a/2,c=o+a/2,l=E.screenToNative(Jt);this.value=e?Bt(l.x,r,c):Bt(l.y,c,r)}else if(this.isNavigationObject()){let e=E.getNavigationOtherDirection();E.navigationTimer.active()||(this.value=N(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=tt(s,this.cornerRadius*2),a=Wt(o,e,this.value),r=(a-e)*(t?.5:-.5),c=this.nativePos.add(t?b(r,0):b(0,r)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(a,this.size.y):b(this.size.x,a);E.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=N(t?this.value:1-this.value),a=(e-s)*(o-.5),r=this.nativePos.add(t?b(a,0):b(0,a)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);E.drawRect(r,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();E.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},jo=class extends re{constructor(t,e,s,i=!1,o=!1,a=1){super(t,e||b()),f(V(s),"video src must be a string"),f(L(a),"video volume must be a number"),this.color=it,this.cornerRadius=0,this.volume=a,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=N(a*Sn),this.video.muted=!Ht,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),f(L(s),"ui layout gap must be a number"),f(L(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=pe,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=pe),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=us(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let p=0;p=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=J(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=W,e=it,s=.1,i,o){this.getFixtureList().forEach(a=>{m.castShapeObject(a.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(a,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(a=>mo(a,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(a=>mo(a,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){f(L(e),"density must be a number"),f(L(s),"friction must be a number"),f(L(i),"restitution must be a number");let a=new m.instance.b2FixtureDef;return a.set_shape(t),a.set_density(e),a.set_friction(s),a.set_restitution(i),a.set_isSensor(o),this.body.CreateFixture(a)}addBox(t=b(1),e=b(),s=0,i,o,a,r){f(O(t),"size must be a Vector2"),f(t.x>0&&t.y>0,"size must be positive"),f(O(e),"offset must be a Vector2"),f(L(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,a,r)}addPoly(t,e,s,i,o){f(de(t),"points must be an array");function a(c){f(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let p=0,d=0;p>2]=c[p].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[p].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let r=a(t);return this.addShape(r,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,a){f(L(t)&&t>0,"diameter must be a positive number"),f(L(e)&&e>2,"sides must be a positive number greater than 2");let r=[],c=t/2;for(let l=e;l--;)r.push(b(c,0).rotate((l+.5)/e*X*2));return this.addPoly(r,s,i,o,a)}addRandomPoly(t=1,e,s,i,o){f(L(t)&&t>0,"diameter must be a positive number");let a=or(3,9),r=[],c=t/2;for(let l=a;l--;)r.push(b(dt(c/2,c*1.5),0).rotate(l/a*X*2));return this.addPoly(r,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,a){f(L(t)&&t>0,"diameter must be a positive number"),f(O(e),"offset must be a Vector2");let r=new m.instance.b2CircleShape;return r.set_m_p(m.vec2dTo(e)),r.set_m_radius(t/2),this.addShape(r,s,i,o,a)}addEdge(t,e,s,i,o,a){f(O(t),"point1 must be a Vector2"),f(O(e),"point2 must be a Vector2");let r=new m.instance.b2EdgeShape;return r.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(r,s,i,o,a)}addEdgeList(t,e,s,i,o){f(de(t),"points must be an array");let a=[],r=[];for(let c=0;ct[se(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},Si=class extends _s{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeStatic;super(t,e,s,i,o,r,a)}},No=class extends _s{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeKinematic;super(t,e,s,i,o,r,a)}},zo=class extends Si{constructor(t){f(t instanceof vs,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(a,r)=>a+r*this.size.x,o=(a,r)=>!s[i(a,r)]&&this.tileLayer.getCollisionData(b(a,r))>0;for(let a=0;ai.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ci.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,$t.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Oc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,$t.indexOf(this)<0&&$t.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&$t.indexOf(this)>=0}getPercent(){return Bt(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return La(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=$t.indexOf(this);t>=0&&$t.splice(t,1),this.thenCallback=void 0}},Ci={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-lt(n*(X/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*st((37-40*n)*X/6),SPRING:n=>1-(st(X*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ci.PIECEWISE(n,Ci.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let a=1-o,r=3*a*a*o,c=3*a*o*o,l=o**3;return[r*n+c*e+l,r*t+c*s+l]};return o=>{let a=0,r=1;for(let c=0;c<128;c++){let l=(a+r)/2,[u,h]=i(l);if(nt(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(St(t.x-e),St(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&bt(r.posWorld,lo,J(1,0,0,tt(.2,l*.05)),this.debugTime):bt(r.posWorld,lo,J(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){f(t&&e,"aStarSearch needs both endpoints"),f(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),f(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,a=s[0].f;for(let c=1;cthis.maxLoop)break;r.isOpen=!1,s.splice(o,1),r.isClosed=!0,this.debug&&this.debugTime>0&&bt(r.posWorld,lo,J(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(r.pos.x+l,r.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(r.pos.x+l,r.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(r.pos.x,r.pos.y+c);if(!w||!w.walkable)continue;h=fd}let p=r.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(p>=u.g)continue;u.parent=r,u.g=p;let d=nt(e.pos.x-u.pos.x),y=nt(e.pos.y-u.pos.y),x=K(d,y)+(Math.SQRT2-1)*tt(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){f(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,a=St(t.x-i),r=St(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let p=-c;p<=c;++p){if(c>0&&nt(p)!==c&&nt(h)!==c)continue;let d=this.getNode(a+p,r+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Ut(i.posWorld,.3,J(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=K(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Ut(i.posWorld,.3,J(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=K(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Ut(i.posWorld,.3,J(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,C=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,P=C*C+A*A,M=T0&&Ut(i.posWorld,.3,J(0,1,0,.5),this.debugTime),l===h&&u===p){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=K(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&we(o.posWorld,t[t.length-1].posWorld,J(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){f(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),f(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=nt(s),a=nt(i),r=ne(s),c=ne(i),l=t.x,u=t.y;if(a===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=r,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ar.posWorld.copy());if(this.debug&&this.debugTime>0&&a.length>0){for(let r=1;rpd,bootGameHost:()=>yd,default:()=>gd});var js=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ji=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},Ui=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let a=e._subs.get(i)||[],r={handler:o,scope:s};return a.push(r),e._subs.set(i,a),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(r);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let a=e._subs.get(i);if(!a)return;let r=a.findIndex(c=>c.handler===o&&c.scope===s);r>=0&&a.splice(r,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let a=o.slice();for(let r of a)try{r.handler(i)}catch(c){qe("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(a=>a.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Vi.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Vi).join("/")+"\uFF09")}},Vi=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Xr(n){let t=n||{},e=new Ji(t.clock),s=new js(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new Ui(e),a=typeof t.audioFactory=="function"?t.audioFactory:null,r=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,p=new Map,d=0,y=0;function x(){if(r)return r;if(!a)return c||(qi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{r=a()}catch(C){qe("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",C),r=null}return r}function v(){if(u)return u;if(!l)return h||(qi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(C){qe("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",C),u=null}return u}function w(C,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(P){let M=d++;return p.set(M,P),{cancel(){p.delete(M)}}},getInput(){return o.sourceFor(C)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(C){y+=1;let A=Array.from(p.values());for(let T of A)try{T(C,y)}catch(P){qe("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,P)}},frameCount(){return y},inputBridge:o,deriveContextFor(C,A){let T=zc(i,C),P=new js(T);return w(A==null?C:A,P)}};return Object.defineProperty(_,Wi,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Wi=Symbol("zaomeng.coreProtocol.contextBundle"),Bs=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return qi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),qe("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let a=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:a}),qe("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,a)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Wi],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Wi],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let a=this._initOrder[o],r=this._plugins.get(a);if(r&&typeof r.dispose=="function")try{r.dispose(),t.push(a)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:a,error:l}),qe("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(a)}catch(c){qe("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let a=0;a<32;a+=8){let r=i>>>a&255;e^=r,e=Math.imul(e,s)>>>0}let o=String(t);for(let a=0;a>>0,e^=r>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function qe(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function qi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Vi)),Yr="core-protocol-v0";var $r=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Hi=$r.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set($r);function Xi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var Kr=Xi("runtime-probe::seed::v1");function Ns(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Ns).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Ns(n[e])).join(",")+"}"}function Qr(n){let t=Ns(n.extra==null?null:n.extra),e=Ns(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=Kr,e=-1;for(let s=0;stypeof C=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,a=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",r=()=>0,c=!1,l=0,u=Kr,h=[],p=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(C,A){let T=null;if(!Uc.has(C))T="unknown_anchor";else{p.has(C)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let M=Hi[C];MC.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=C.getInput().on(a,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:a})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(C=>({...C}))},toJSONL(){return h.map(C=>JSON.stringify(C)).join(`
+`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ta(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(r,c,l)=>(i("math.lerp"),o.lerp(r,c,l)),smoothStep:r=>(i("math.smoothStep"),o.smoothStep(r)),easing:Object.fromEntries(Object.keys(o.easing).map(r=>[r,c=>(i("math.easing."+r),o.easing[r](c))]))},particles:{spawnEmitter(r){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(r.pos.x,r.pos.y)),l=t.cameraScale,u=r.emitTime!=null?r.emitTime:r.count!=null?1/60:0,h=r.emitRate!=null?r.emitRate:r.count!=null?r.count*60:100,p=(r.speed!=null?r.speed:0)/l/60,d=r.damping!=null?r.damping:1,y=r.colorStart||{r:1,g:1,b:1,a:1},x=r.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,r.angle!=null?r.angle:0,(r.emitSize!=null?r.emitSize:0)/l,u,h,r.coneAngle!=null?r.coneAngle:Math.PI,void 0,v,v,w,w,r.particleTime!=null?r.particleTime:.5,(r.sizeStart!=null?r.sizeStart:6)/l,(r.sizeEnd!=null?r.sizeEnd:0)/l,p,0,d,1,r.gravityScale!=null?r.gravityScale:0,Math.PI,.1,0,!1,r.additive!=null?r.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:r=>{i("audio.synth.synthSfx");try{return t.zzfxG(...r)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(r,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(r,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function ce(n){return n<0?0:n>1?1:n}function ea(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),a=t.OUT(s),r=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,p)=>n.lerp(u,h,p),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(ce(u)),quadIn:u=>e(ce(u)),quadOut:u=>i(ce(u)),quadInOut:u=>o(ce(u)),cubicIn:u=>s(ce(u)),cubicOut:u=>a(ce(u)),cubicInOut:u=>r(ce(u)),backIn:u=>t.BACK(ce(u)),backOut:u=>c(ce(u)),elasticIn:u=>t.ELASTIC(ce(u)),elasticOut:u=>l(ce(u))}}}var He=2,zs=1/60;async function na(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",a=n.engineMode||"real",r=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},p=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let C=0,A=null,T=null,P=null,M=null,pt=[],at={},ct=null;function yt(D,ot){try{P&&P.mark(D,ot)}catch(ee){v.push({type:"mark",message:String(ee&&ee.message||ee)})}}function Nt(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(at)}async function ge(D,ot){A=Xr({context2d:D,seed:i,audioFactory:S,clock:()=>C,engineFactory:()=>ta({LJS:a==="real"?s:null,engineMath:a==="real"?ea(s):null,engineMode:a,recHook:y})});let ee=new Bs;for(let ye of p)ee.register(ye);ee.useContext(A.context),M=ee.initAll(),pt=ee.list().concat(["runtime-probe"]),P=Zr({pluginSet:pt,inputAnchorType:"pointerdown",autoBoot:!0});let Dt=A.deriveContextFor("runtime-probe","runtime-probe");yt("t_boot",{by:"game-host",stage:"pre-init",engineMode:a}),yt("t_plugins_ready",{initialized:M.initialized.length,ok:M.ok});let Ni=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(Ni),await T.init({ctx:A.context,mainContext:D,canvas:ot(),seed:i}),ct=T&&typeof T._forensicsView=="function"?T._forensicsView():null,yt("t_game_init",{hasForensics:!!ct}),ht(),yt("t_first_paint",{frame:A.frameCount()});try{P.init(Dt)}catch(ye){v.push({type:"probe-init",message:String(ye&&ye.message||ye)})}yt("t_game_start",{mode:o,engineMode:a}),Nt(),d(un,{bundle:A,game:T,probe:P,checklist:at,uncaught:v,pluginSet:pt,initRes:M,getGameForensics:()=>ct,mark:yt,stepOneFrame:ht})}let Pt=null;function ht(D){let ot=typeof D=="number"?D:zs;T&&(C+=ot*1e3,T.update(ot),a==="stub"&&Pt&&T.render(Pt),Nt())}function Lt(D){for(let ot=0;ot{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let un={seed:i,mode:o,engineMode:a,protocol:Yr,frameCount:()=>A?A.frameCount():0,stepFrames:Lt,startRaf:()=>F(),stopRaf:()=>k(),tap(D,ot){Pe(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:ot}),A.inputBridge._emit("pointerup",{x:D,y:ot}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>ct?ct.state():{phase:"booting"}};function hn(D){let ot=A.inputBridge;function ee(Dt,Ni){let ye=D.getBoundingClientRect();return{x:(Dt-ye.left)/ye.width*r,y:(Ni-ye.top)/ye.height*c}}D.addEventListener("pointerdown",Dt=>{Pe(),ot._emit("pointerdown",ee(Dt.clientX,Dt.clientY))}),D.addEventListener("pointermove",Dt=>{ot._emit("pointermove",ee(Dt.clientX,Dt.clientY))}),D.addEventListener("pointerup",Dt=>{ot._emit("pointerup",ee(Dt.clientX,Dt.clientY))}),window.addEventListener("keydown",Dt=>{Pe(),ot._emit("keydown",{key:Dt.key})}),window.addEventListener("keyup",Dt=>ot._emit("keyup",{key:Dt.key}))}let ae=0,Le=!1,te=0;function R(D){if(!Le)return;te===0&&(te=D);let ot=(D-te)/1e3;te=D,ot>.05&&(ot=.05),ht(ot),ae=window.requestAnimationFrame(R)}function F(){a==="stub"&&(Le||(Le=!0,te=0,ae=window.requestAnimationFrame(R)))}function k(){Le=!1,ae&&window.cancelAnimationFrame(ae),ae=0}function j(D){D.width=r*He,D.height=c*He,D.style.width=r+"px",D.style.height=c+"px";let ot=D.getContext("2d",{willReadFrequently:!0});return ot.setTransform(He,0,0,He,0,0),ot}async function $(){let D=j(t);return Pt=D,await ge(D,()=>t),hn(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),F()),un}let Z=()=>{},Tt=()=>{};function At(){window.__gameHostEngineInitFired=!0}function Ot(){Z()}function Oe(){}function Zn(){Tt()}function dn(){}async function Fs(D){await ge(D,()=>s.mainCanvas),hn(s.mainCanvas),Z=()=>{T&&(C+=zs*1e3,T.update(zs))},Tt=()=>{if(T){D.save(),D.setTransform(He,0,0,He,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(a!=="real")return await $();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(r*He,c*He));let Dn=document.createElement("div");return Dn.id="engine-root",document.body.appendChild(Dn),await s.engineInit(At,Ot,Oe,Zn,dn,[],Dn).then(()=>Fs(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),un}var Yi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),a=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:a}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:a}=this._cellRange(e),r=[];for(let l=i;l<=a;l++)for(let u=s;u<=o;u++){let h=u+","+l,p=this._cells.get(h);p||(p=new Set,this._cells.set(h,p)),p.add(t),r.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:r})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),a=new Set;for(let r=s;r<=o;r++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+r);if(l)for(let u of l)a.add(u)}return this._collect(a)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),a=this._cells.get(i+","+o);return a?this._collect(new Set(a)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function sa(n){let t=n||{},e=new Yi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function ia(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function zt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=zt(n),n*n),Yc=n=>(n=zt(n),1-(1-n)*(1-n)),$c=n=>(n=zt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=zt(n),n*n*n),Qc=n=>{n=zt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=zt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),aa=2*Math.PI/3,oa=2*Math.PI/4.5,tl=n=>(n=zt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*aa)),el=n=>(n=zt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*aa)+1),nl=n=>(n=zt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*oa))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*oa)/2+1),Us=1.70158,Js=Us*1.525,ca=Us+1,sl=n=>(n=zt(n),ca*n*n*n-Us*n*n),il=n=>{n=zt(n);let t=n-1;return 1+ca*t*t*t+Us*t*t},ol=n=>(n=zt(n),n<.5?Math.pow(2*n,2)*((Js+1)*2*n-Js)/2:(Math.pow(2*n-2,2)*((Js+1)*(n*2-2)+Js)+2)/2),rl=n=>zt(n),ra=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return ra;let e=i=>typeof t[i]=="function"?o=>t[i](zt(o)):ra[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var $i=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let a of o){this._records.set(a,null);let r=t.on(a,c=>{this._records.set(a,c.tMs)});this._subs.push(r)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function la(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(a){let r=a.getInput();e=new $i(r,a.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=a.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function Vs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Ki(t):null}function Ki(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Ki(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:Vs(n.sizeCurve,0),sizeEnd:Vs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:Vs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:Vs(n.alphaCurve,1)},additive:!1}}function ua(n){let t=n||{},e=null,s=null,i=null,o=new Map,a=0,r={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,p=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=p+(1-p)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,P=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*P,d.y=Math.cos(d._phase*1.3)*P}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,P=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(P)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let P=T.canvas?T.canvas.width:0,M=T.canvas?T.canvas.height:0;T.fillRect(0,0,P,M),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(P=>{_(P)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,P,M){let pt=typeof A=="string"?ul(A):Ki(A);if(!pt)return-1;M&&(pt=Object.assign(pt,M));let at=a++;if(!i)return o.set(at,r),at;let ct=i.spawnEmitter(hl(pt,T,P));return o.set(at,ct),at},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,p=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?p:1},getTimeScale(){return l},shakeScreen(A,T,P){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=P==null?30:P,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,P){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=P==null?4:P,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ha(n){let t=gt(n.r)/255,e=gt(n.g)/255,s=gt(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),a=(i+o)/2,r=0,c=0,l=i-o;return l>1e-12&&(c=a>.5?l/(2-i-o):l/(i+o),i===t?r=(e-s)/l%6:i===e?r=(s-t)/l+2:r=(t-e)/l+4,r*=60,r<0&&(r+=360)),{h:r,s:c,l:a}}function da(n){let t=(n.h%360+360)%360,e=Xe(n.s),s=Xe(n.l);if(e<1e-12){let r=Math.round(s*255);return{r,g:r,b:r}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,a=t/360;return{r:Math.round(Qi(o,i,a+1/3)*255),g:Math.round(Qi(o,i,a)*255),b:Math.round(Qi(o,i,a-1/3)*255)}}function Qi(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function gt(n){return n<0?0:n>255?255:n}function Xe(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:gt(r.r),g:gt(r.g),b:gt(r.b)})),to:o}}function Zi(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ha(n),s=e.h+(t.hue||0),i=Xe(e.s*(t.sat==null?1:t.sat)),o=Xe(e.l*(t.light==null?1:t.light));return da({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function fa(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:to(t.vignette&&t.vignette.enabled,!1),strength:eo(t.vignette&&t.vignette.strength,.5)},dither:{enabled:to(t.dither&&t.dither.enabled,!1),strength:eo(t.dither&&t.dither.strength,.5)},scanline:{enabled:to(t.scanline&&t.scanline.enabled,!1),strength:eo(t.scanline&&t.scanline.strength,.5)}};function o(r){let c=r!==void 0?r:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(r){e=r},dispose(){s||(e=null,s=!0)},applyPaletteMap(r,c){return dl(r,c)},applyPaletteMapToBuffer(r,c){return fl(r,c)},lerpPaletteMap(r,c,l){return yl(r,c,l)},shiftHsl(r,c){return ml(r,c)},rgbToHsl(r){return ha(r)},hslToRgb(r){return da(r)},setPost(r){if(r)for(let c of["vignette","dither","scanline"])r[c]&&(typeof r[c].enabled=="boolean"&&(i[c].enabled=r[c].enabled),typeof r[c].strength=="number"&&(i[c].strength=Xe(r[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(r){o(r)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=Xe(t);if(e<=0)return n;let{data:s,width:i}=n,a=255/(Math.max(2,Math.round(16-e*14))-1);for(let r=0;r+3>2)%i,l=Math.floor((r>>2)/i),u=(bl[l&3][c&3]/16-.5)*a;for(let h=0;h<3;h++){let p=s[r+h]+u,d=Math.round(p/a)*a;s[r+h]=d<0?0:d>255?255:d}}return n}function to(n,t){return typeof n=="boolean"?n:t}function eo(n,t){return typeof n=="number"?Xe(n):t}var so=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),pa=Object.keys(so);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let a=i[0]|0;Array.isArray(n.instruments)&&(a<0||a>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${a} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let r=i[1];(r<-1||r>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${r} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function me(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function ga(n,t){let e=me(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],a=typeof s.minIntensity=="number"?me(s.minIntensity):0,r=typeof s.maxIntensity=="number"?me(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?me(s.baseVolume):1;if(er)return{id:i,on:!1,volume:0,channelIndices:o};let u=r-a,h=u<=0?1:(e-a)/u,p=me(Sl(c,h)*l);return{id:i,on:!0,volume:p,channelIndices:o}})}function ya(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,a=Math.max(i.length,o.length);if(a===0)return null;let c=n.createBuffer(2,a,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=me(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return io("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ma(n){let t=n||{},e=typeof t.masterVolume=="number"?me(t.masterVolume):1,s=()=>null,i=null,o=null,a={voices:[]},r=1,c=null,l=!1,u=0,h=!1,p=!1;function d(){let S=s();return S==null?(u+=1,h||(no("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return io("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=ga(a,r);if(S.length===0)return 1;let C=0;for(let A of S)A.on&&(C=Math.max(C,A.volume));return C}function v(S,C){typeof C=="number"&&(r=me(C));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let P=me(e*x());c=ya(A,T,P,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let C=S.getEngine&&S.getEngine();i=C?C.audio.synth:null},dispose(){p||(w(),p=!0)},loadSong(S){let C=vl(S);return C.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:no("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+C.errors.join("\uFF1B")),C},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){a=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){r=me(S)},resolveVoices(S){return ga(a,S)},playSfx(S){let C=so[S];if(!C){no("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(C.params):null;if(!T)return;ya(A,[T,T],e,!1)}catch(T){io("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return so[S]},listPresets(){return pa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:r,voiceCount:a.voices.length,looping:l,silentNoops:u,presetCount:pa.length}}}}function io(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function no(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function ro(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ba(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?ro():t.adapter,a=e+":",r=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?a+String(d):a+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(a)===0):[]}catch(d){return ts("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!oo(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return ts("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return r+=1,l||(es("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!oo(d))return es("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,es("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,es("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,es("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,ts("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(oo(d))try{o.removeItem(u(d))}catch(y){ts("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){ts("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:r,rejectedWrites:c}}}}function oo(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function ts(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function es(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var El={w:390,h:844};function va(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=sa({cellSize:96}),s=ia(),i=la({inputBufferMs:260,inputTypes:["pointerdown"]}),o=ua({seed:t,maxParticles:600}),a=fa({vignette:{enabled:!0,strength:.22}}),r=ma({masterVolume:.8}),c;try{c=ba()}catch(p){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(p&&p.message)),c=ro()}let l=xa({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:a,audioMusic:r,save:l},registerOrder:[e,s,i,o,a,l,r],viewport:El,buildFactoryOpts:(p,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ns(n){let t=n||{},e=null,s=[],i="booting",o=null,a=0,r={x:0,y:0,vx:0,vy:0,angle:0,radius:15},c=[],l=[],u=0,h={},p=200,d=600,y=2e3,x=.99,v=15,w=30,_=15,S=40,C=80,A=5,T=200,P=3;function M(R){R.x<0?R.x+=390:R.x>390&&(R.x-=390),R.y<0?R.y+=844:R.y>844&&(R.y-=844)}function pt(R,F,k,j){let $=F.x-R.x,Z=F.y-R.y,Tt=R.x-k.x,At=R.y-k.y,Ot=$*$+Z*Z,Oe=2*(Tt*$+At*Z),Zn=Tt*Tt+At*At-j*j,dn=Oe*Oe-4*Ot*Zn;if(dn<0)return!1;dn=Math.sqrt(dn);let Fs=(-Oe-dn)/(2*Ot),Dn=(-Oe+dn)/(2*Ot);return Fs>=0&&Fs<=1||Dn>=0&&Dn<=1}function at(R,F,k,j){let $=R-k,Z=F-j;return Math.sqrt($*$+Z*Z)}function ct(R,F,k,j,$){return{x:R,y:F,vx:j,vy:$,radius:k,isBig:k>=w}}function yt(){c=[];let R=e.random;for(let F=0;F{Z.key&&(h[Z.key]=!0)});s.push(k);let j=F.on("keyup",Z=>{Z.key&&(h[Z.key]=!1)});s.push(j);let $=F.on("pointerdown",()=>{i==="gameover"&&Pe()});s.push($),Lt(),i="playing",o=null}function hn(R){if(i==="gameover")return;let F=e.time.nowMs();h.ArrowLeft&&(r.angle-=P*R),h.ArrowRight&&(r.angle+=P*R),h.ArrowUp&&(r.vx+=Math.cos(r.angle)*T*R,r.vy+=Math.sin(r.angle)*T*R,ge(r.x-Math.cos(r.angle)*20,r.y-Math.sin(r.angle)*20,{r:1,g:.8,b:.2,a:1},{r:1,g:.4,b:0,a:0},5)),h.Space&&ht(),r.vx*=x,r.vy*=x,r.x+=r.vx*R,r.y+=r.vy*R,M(r);for(let k of c)k.x+=k.vx*R,k.y+=k.vy*R,M(k);for(let k=l.length-1;k>=0;k--){let j=l[k],$=j.x,Z=j.y;if(j.x+=j.vx*R,j.y+=j.vy*R,F-j.born>y){l.splice(k,1);continue}if(j.x<0||j.x>390||j.y<0||j.y>844){l.splice(k,1);continue}let Tt=!1;for(let At=c.length-1;At>=0;At--){let Ot=c[At];if(pt({x:$,y:Z},{x:j.x,y:j.y},{x:Ot.x,y:Ot.y},Ot.radius)){Tt=!0,a+=1,ge(j.x,j.y,{r:1,g:.9,b:.5,a:1},{r:1,g:.3,b:0,a:0},30),Pt([1,.1,880,,,.2,,.4]),Ot.isBig&&Nt(Ot),c.splice(At,1);break}}Tt&&l.splice(k,1)}for(let k of c){let j=r.x-k.x,$=r.y-k.y;if(j*j+$*$<(r.radius+k.radius)*(r.radius+k.radius)){i="gameover",o="lose",ge(r.x,r.y,{r:1,g:.2,b:.2,a:1},{r:.5,g:0,b:0,a:0},40),Pt([1,.2,100,,,.5,,1.5]);return}}c.length===0&&(i="gameover",o="win")}function ae(R){R.fillStyle="#0a0a1a",R.fillRect(0,0,390,844);for(let F of c)R.fillStyle=F.isBig?"#8b5e3c":"#a0744a",R.beginPath(),R.arc(F.x,F.y,F.radius,0,Math.PI*2),R.fill(),R.strokeStyle="#d4a76a",R.lineWidth=2,R.stroke();for(let F of l)R.fillStyle="#ffff00",R.beginPath(),R.arc(F.x,F.y,F.radius,0,Math.PI*2),R.fill();R.save(),R.translate(r.x,r.y),R.rotate(r.angle),R.fillStyle=i==="gameover"?"#ff4444":"#44aaff",R.beginPath(),R.moveTo(20,0),R.lineTo(-15,-12),R.lineTo(-10,0),R.lineTo(-15,12),R.closePath(),R.fill(),R.strokeStyle="#ffffff",R.lineWidth=1.5,R.stroke(),R.restore(),R.fillStyle="#ffffff",R.font="bold 16px monospace",R.fillText("Score: "+a,10,30),R.fillText("Asteroids: "+c.length,10,50),R.fillText("Phase: "+i,10,70),i==="gameover"&&(R.fillStyle=o==="win"?"#00ff00":"#ff0000",R.font="bold 28px monospace",R.textAlign="center",R.fillText(o==="win"?"YOU WIN!":"GAME OVER",195,400),R.font="16px monospace",R.fillStyle="#ffffff",R.fillText("Tap to restart",195,430),R.textAlign="start")}function Le(){for(let R of s)try{R.cancel()}catch{}s=[],c=[],l=[],i="booting",o=null}function te(){return{seed:e&&e.random?e.random.seed:null,state:()=>({phase:i,result:o,score:a,asteroidsRemaining:c.length,ship:{x:r.x,y:r.y,angle:r.angle}})}}return{init:un,update:hn,render:ae,destroy:Le,_forensicsView:te}}var pd=ns,gd=ns;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Ic)),s=(t.seed!=null?t.seed:305441741)>>>0,i=va({seed:s});return na({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ns,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Nc(md);})();
diff --git a/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js.meta.json b/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js.meta.json
index edb5ff1b..54a7023c 100644
--- a/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js.meta.json
+++ b/game-runtime/games/_wg1-gen/asteroids/bundle.iife.js.meta.json
@@ -1 +1 @@
-{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":27676,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/asteroids/generated-factory.js":{"bytes":9418,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/asteroids/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/asteroids/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/asteroids/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/asteroids/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164254},"games/_wg1-gen/asteroids/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5358},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4166},"src/plugins/palette-post/impl.js":{"bytesInOutput":4216},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/asteroids/generated-factory.js":{"bytesInOutput":4408}},"bytes":212242}}}
\ No newline at end of file
+{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":28239,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/asteroids/generated-factory.js":{"bytes":9418,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/asteroids/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/asteroids/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/asteroids/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/asteroids/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164254},"games/_wg1-gen/asteroids/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5505},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4166},"src/plugins/palette-post/impl.js":{"bytesInOutput":4216},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/asteroids/generated-factory.js":{"bytesInOutput":4408}},"bytes":212389}}}
\ No newline at end of file
diff --git a/game-runtime/games/_wg1-gen/asteroids/evidence/after-play.png b/game-runtime/games/_wg1-gen/asteroids/evidence/after-play.png
index 79d97bc372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x@u7sGG85#ja3$npTcJR=UlAR)hNaKi5+z?Y+_Co0~tsoA9!~siM?1
zrmsAp3<6oLq#Ze+{s`s8zW~z2`dYaioSb+Z_~zx~4&_}*bA-pEQG9MP;fs=`EamiS
zx!u9bS}Y@p5jf8F#-Da7LdGuVqGt6
z=GAgF&C5|iEB@gx;2HsjHWr~Lafo$md<>95fuEW{AO+Nb{VT
z9ZP7%%%VSX_eoKZMJyT5pI;SXB)90YPSC?fNGBLzJ!U0w-;rYL9mqS;4um@enXZF)
z-+Dztw-WXL5DEP6apdmue}#tl-^~2~bY?CAKp1j!Bb!o83I0GqM#c9ac}ILX!q=4Z
Q;1h_XsH{lgyHB704<`h*j{pDw

diff --git a/game-runtime/games/_wg1-gen/asteroids/evidence/verdict.json b/game-runtime/games/_wg1-gen/asteroids/evidence/verdict.json
index 69f1aef4..c2fbe710 100644
--- a/game-runtime/games/_wg1-gen/asteroids/evidence/verdict.json
+++ b/game-runtime/games/_wg1-gen/asteroids/evidence/verdict.json
@@ -8,8 +8,8 @@
     },
     "C_frame": {
       "pass": true,
-      "f0": 49,
-      "f1": 79,
+      "f0": 48,
+      "f1": 78,
       "delta": 30
     },
     "I_control": {
@@ -18,22 +18,35 @@
     },
     "D_render": {
       "pass": true,
-      "bright": 66529,
+      "bright": 66491,
       "maxCh": 255
     },
     "E_live": {
       "pass": true,
-      "distinctStates": 52,
-      "samples": 52
+      "distinctStates": 37,
+      "samples": 37
     },
     "B_uncaught": {
       "pass": true,
       "uncaught": []
     },
     "F_wiring": {
-      "pass": false,
-      "callCount": 0,
-      "sample": [],
+      "pass": true,
+      "callCount": 27,
+      "sample": [
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "particles.spawnEmitter"
+      ],
       "expected": [
         "particles.",
         "audio.synth"
@@ -41,10 +54,10 @@
     },
     "G_input": {
       "pass": true,
-      "inputHash": "241aa975",
-      "controlHash": "7f223357",
-      "atFrame": 1241,
-      "ctrlFrame": 1244
+      "inputHash": "d2d3585d",
+      "controlHash": "f13eb61f",
+      "atFrame": 901,
+      "ctrlFrame": 905
     },
     "H_progress": {
       "pass": false,
@@ -59,9 +72,10 @@
         }
       ],
       "latch": {
-        "pass": false,
-        "reason": "真玩未到达 gameover 终态(终态不可达/无失败态/play-spec 未驱动到结束)",
-        "phaseNow": "playing"
+        "pass": true,
+        "dwelledMs": 600,
+        "after": "gameover",
+        "reason": ""
       },
       "state0": {
         "phase": "playing",
@@ -75,14 +89,14 @@
         }
       },
       "state1": {
-        "phase": "playing",
-        "result": null,
+        "phase": "gameover",
+        "result": "lose",
         "score": 0,
         "asteroidsRemaining": 5,
         "ship": {
-          "x": 195,
-          "y": 422,
-          "angle": -1.5707963267948966
+          "x": 152.8208837988882,
+          "y": 301.88159315392096,
+          "angle": -1.7707963267948967
         }
       }
     }
diff --git a/game-runtime/games/_wg1-gen/t2048/bundle.iife.js b/game-runtime/games/_wg1-gen/t2048/bundle.iife.js
index fc1e4a6b..67025bbf 100644
--- a/game-runtime/games/_wg1-gen/t2048/bundle.iife.js
+++ b/game-runtime/games/_wg1-gen/t2048/bundle.iife.js
@@ -1,34 +1,34 @@
-"use strict";var __GameBundle=(()=>{var Bi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var qr=(n,t)=>{for(var e in t)Bi(n,e,{get:t[e],enumerable:!0})},Bc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&Bi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Nc=n=>Bc(Bi({},"__esModule",{value:!0}),n);var Dc={};qr(Dc,{ASSERT:()=>p,BLACK:()=>at,BLUE:()=>Qa,Box2dDistanceJoint:()=>vi,Box2dFrictionJoint:()=>Xo,Box2dGearJoint:()=>Vo,Box2dJoint:()=>Qt,Box2dKinematicObject:()=>jo,Box2dMotorJoint:()=>$o,Box2dObject:()=>Cs,Box2dPinJoint:()=>zo,Box2dPlugin:()=>Si,Box2dPrismaticJoint:()=>Wo,Box2dPulleyJoint:()=>Yo,Box2dRaycastResult:()=>xi,Box2dRevoluteJoint:()=>Uo,Box2dRopeJoint:()=>Jo,Box2dStaticObject:()=>bi,Box2dTargetJoint:()=>No,Box2dTileLayer:()=>Bo,Box2dWeldJoint:()=>Ho,Box2dWheelJoint:()=>qo,CLEAR_BLACK:()=>xe,CLEAR_WHITE:()=>ln,CYAN:()=>ql,CanvasLayer:()=>ai,Color:()=>Lt,Ease:()=>Ti,EngineObject:()=>qe,GRAY:()=>Vl,GREEN:()=>Ka,ImageFont:()=>ei,LOG:()=>Et,Light:()=>Po,LightSystemPlugin:()=>Ro,MAGENTA:()=>Hl,Medal:()=>yi,NewgroundsMedal:()=>Co,NewgroundsPlugin:()=>Eo,ORANGE:()=>Wl,PI:()=>Q,PURPLE:()=>Za,Particle:()=>ci,ParticleEmitter:()=>bo,PathFinder:()=>Ko,PathFinderNode:()=>Ai,PostProcessPlugin:()=>_o,RED:()=>ir,RandomGenerator:()=>fo,Sound:()=>ys,SoundInstance:()=>oi,TextureInfo:()=>He,TileCollisionLayer:()=>bs,TileInfo:()=>De,TileLayer:()=>ms,TileLayerData:()=>wn,Timer:()=>Pe,Tween:()=>wi,UIButton:()=>As,UICheckbox:()=>Io,UILayout:()=>Fo,UIObject:()=>he,UISlider:()=>ko,UISystemPlugin:()=>Oo,UIText:()=>mi,UITextInput:()=>Do,UITile:()=>Mo,UIVideo:()=>Go,Vector2:()=>lt,WHITE:()=>H,YELLOW:()=>$a,ZzFXMusic:()=>Lo,abs:()=>ot,atan2:()=>er,audioContext:()=>mt,audioDefaultSampleRate:()=>Kn,audioIsRunning:()=>gs,audioMasterGain:()=>We,box2d:()=>m,box2dDebug:()=>Vr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>et,cameraFit:()=>rh,cameraPos:()=>Mt,cameraScale:()=>K,canvasClearColor:()=>sn,canvasColorTiles:()=>Ei,canvasFixedSize:()=>kn,canvasMaxAspect:()=>In,canvasMaxSize:()=>Mn,canvasMinAspect:()=>ss,canvasPixelRatio:()=>on,canvasPixelated:()=>ar,ceil:()=>cs,clamp:()=>z,combineCanvases:()=>vr,cos:()=>ut,debug:()=>zt,debugCircle:()=>Ht,debugClear:()=>Il,debugLine:()=>Ee,debugOverlap:()=>uo,debugOverlay:()=>Fe,debugPoint:()=>tr,debugPointSize:()=>Ia,debugPoly:()=>Ml,debugRect:()=>Ct,debugScreenshot:()=>Ga,debugShowErrors:()=>kl,debugText:()=>Dn,debugVideoCaptureIsActive:()=>_e,debugVideoCaptureStart:()=>Fa,debugVideoCaptureStop:()=>ja,debugWatermark:()=>Ci,distanceAngle:()=>zl,distanceWrap:()=>nr,drawCanvas2D:()=>Rn,drawCircle:()=>ti,drawCircleGradient:()=>sh,drawContext:()=>Ot,drawCount:()=>Le,drawCrescent:()=>ud,drawEllipse:()=>sc,drawEllipseGradient:()=>ic,drawLine:()=>mn,drawLineList:()=>go,drawNineSlice:()=>Ec,drawNineSliceScreen:()=>cd,drawPoly:()=>Jn,drawRect:()=>Zs,drawRectGradient:()=>th,drawRegularPoly:()=>nc,drawText:()=>ih,drawTextScreen:()=>rn,drawTextureWrapped:()=>eh,drawThreeSlice:()=>_c,drawThreeSliceScreen:()=>ld,drawTile:()=>Ft,enablePhysicsSolver:()=>Li,engineAddPlugin:()=>En,engineImageFont:()=>cc,engineInit:()=>Pl,engineName:()=>Vs,engineObjects:()=>_t,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>Zo,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Da,engineVersion:()=>Ws,fetchJSON:()=>Xl,floor:()=>Pt,fontDefault:()=>Es,formatTime:()=>or,frame:()=>La,frameRate:()=>El,gamepadConnected:()=>mo,gamepadDirectionEmulateStick:()=>pr,gamepadDpad:()=>yo,gamepadIsDown:()=>Ge,gamepadPrimary:()=>At,gamepadStick:()=>fs,gamepadStickCount:()=>lc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Er,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Oi,getCameraSize:()=>rc,getCrescentPoints:()=>Rc,getNoteFrequency:()=>pc,getPaused:()=>_l,glAntialias:()=>Dr,glCanvas:()=>it,glCircleSides:()=>_s,glClearCanvas:()=>xc,glClearRect:()=>Ac,glCompileShader:()=>Ao,glContext:()=>g,glCopyToContext:()=>Fr,glCreateProgram:()=>Hn,glCreateTexture:()=>ki,glDeleteTexture:()=>Sc,glDraw:()=>Ss,glDrawColoredPoints:()=>Nr,glDrawOutlineTransform:()=>Br,glDrawPoints:()=>Tc,glDrawPointsTransform:()=>jr,glDrawUntextured:()=>wc,glEnable:()=>j,glFlush:()=>It,glSetAntialias:()=>Yh,glSetRenderTarget:()=>ns,glSetTexture:()=>kr,glSetTextureData:()=>Gr,glSetTextureWrap:()=>vc,gravity:()=>Xt,headlessMode:()=>U,hsl:()=>Be,hypot:()=>Ba,inputClear:()=>Ms,inputClearKey:()=>Ar,inputMouseMoveThreshold:()=>Tr,inputPreventDefault:()=>Gn,inputWASDEmulateDirection:()=>is,isArray:()=>me,isColor:()=>W,isFullscreen:()=>ac,isIntersecting:()=>Ua,isNumber:()=>R,isOnScreen:()=>ah,isOverlapping:()=>Ys,isPowerOfTwo:()=>ls,isStringLike:()=>q,isTouchDevice:()=>le,isUsingGamepad:()=>jn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>Gt,keyWasPressed:()=>Bt,keyWasReleased:()=>Cr,lastInputDevice:()=>en,lerp:()=>Yt,lerpAngle:()=>Jl,lerpWrap:()=>Ja,lightSystem:()=>$,lineTest:()=>Wa,log2:()=>Na,mainCanvas:()=>N,mainCanvasSize:()=>k,mainContext:()=>pt,max:()=>tt,medalDisplaySize:()=>pi,medalDisplaySlideTime:()=>Fn,medalDisplayTime:()=>fi,medals:()=>ws,medalsForEach:()=>Gi,medalsInit:()=>Zh,medalsPreventUnlock:()=>zr,medalsReset:()=>td,min:()=>st,mod:()=>ce,mouseDelta:()=>Sr,mouseDeltaScreen:()=>Te,mouseInWindow:()=>ni,mouseIsDown:()=>rs,mousePos:()=>ke,mousePosScreen:()=>qt,mouseWasPressed:()=>ds,mouseWasReleased:()=>xh,mouseWheel:()=>wr,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Ts,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>hr,objectDefaultDamping:()=>ur,objectDefaultFriction:()=>fr,objectDefaultMass:()=>lr,objectDefaultRestitution:()=>dr,objectMaxSpeed:()=>Ne,oscillate:()=>Va,particleEmitRateScale:()=>$s,paused:()=>Re,percent:()=>Jt,percentLerp:()=>Nl,playSamples:()=>Or,pointerLockExit:()=>Ch,pointerLockIsActive:()=>uc,pointerLockRequest:()=>Ah,postProcess:()=>jt,primitiveCount:()=>Oe,rand:()=>yt,randBool:()=>qa,randColor:()=>ho,randInCircle:()=>Ya,randInt:()=>sr,randSign:()=>Ha,randVec2:()=>Xa,readSaveData:()=>Kl,rgb:()=>V,round:()=>Hs,saveCanvas:()=>tc,saveDataURL:()=>us,saveText:()=>Yl,screenToWorld:()=>Os,screenToWorldDelta:()=>oc,screenToWorldTransform:()=>Ds,setAdditiveBlendMode:()=>hs,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>ec,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Eu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Cu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Iu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Bu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Nu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Mu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>cr,sign:()=>ae,sin:()=>rt,smoothStep:()=>Xs,soundDefaultRange:()=>mr,soundDefaultTaper:()=>br,soundEnable:()=>Kt,soundVolume:()=>Sn,speak:()=>Nh,speakStop:()=>zh,tan:()=>za,textureInfos:()=>hn,tile:()=>Ls,tileCollisionGetData:()=>ri,tileCollisionLayers:()=>an,tileCollisionRaycast:()=>gc,tileCollisionTest:()=>Ze,tileDefaultBleed:()=>Pi,tileDefaultPadding:()=>Ri,tileDefaultSize:()=>_i,tileLayersLoad:()=>Uh,tilesPixelated:()=>Tn,time:()=>ee,timeDelta:()=>Qo,timeReal:()=>cn,timeScale:()=>rr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>yr,touchGamepadAnalog:()=>Rs,touchGamepadButtonCount:()=>Xn,touchGamepadCenterButtonSize:()=>be,touchGamepadDisplayTime:()=>os,touchGamepadEnable:()=>un,touchGamepadFloating:()=>dn,touchGamepadLeftButtonCount:()=>Yn,touchGamepadLeftStick:()=>_n,touchGamepadPassthrough:()=>gr,touchGamepadRightStick:()=>$n,touchGamepadSize:()=>$t,touchGamepadVibration:()=>Ks,touchInputEnable:()=>yn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Oc,uiDebug:()=>Ur,uiSetDebug:()=>od,uiSystem:()=>C,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>_r,vibrateEnable:()=>Ps,vibrateStop:()=>Th,workCanvas:()=>Ue,workContext:()=>tn,workReadCanvas:()=>Ce,workReadContext:()=>ze,worldToScreen:()=>Pn,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Mi,zzfxM:()=>Cc});function _l(){return Re}function Rl(n=!0){Re=n}function En(n,t,e,s){p(!bn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new co(n,t,e,s);bn.push(i)}async function Pl(n,t,e,s,i,o=[],a){if(Oa&&console.log(`${Vs} Engine v${Ws}`),p(!pt,"engine already initialized"),pt)return;p(me(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),a||(a=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function r(){k=b(N.width,N.height),pt.imageSmoothingEnabled=!Tn,To()}function c(y=0){let x=y-oo;oo||(x=0),oo=y,(zt||Ci)&&(qs=Yt(qs,1e3/(x||1),.05));let v=zt&&Gt("Equal"),w=zt&&Gt("Minus"),_=v?10:w?.1:1;cn+=x*_/1e3;let S=rr*_;x*=S,we+=Re?0:x,S<=1&&(we=st(we,50));let E=!1;if(Re){E=!0,l(),Aa(),bn.forEach(T=>{var P;return(P=T.update)==null?void 0:P.call(T)});for(let T of _t)T.parent||T.updateTransforms();va(),e(),Ca(),_e()&&A()}else{let T=0;for(we<0&&we>-9&&(T=we,we=0);we>=0;we-=1e3/60)ee=La++/60,E=!0,l(),Aa(),t(),bn.forEach(P=>{var F;return(F=P.update)==null?void 0:F.call(P)}),Da(),va(),e(),Ca(),_e()&&A();we+=T}_e()||A(),requestAnimationFrame(c);function A(){if(!U){E||l(),r(),s(),_t.sort((T,P)=>T.renderOrder-P.renderOrder);for(let T of _t)T.destroyed||T.render();i(),bn.forEach(T=>{var P;return(P=T.render)==null?void 0:P.call(T)}),_h(),Fl(),It(),jl(),Le=0,Oe=0}}}function l(){if(!U){if(kn.x){k=kn.copy();let y=innerWidth/innerHeight,x=kn.x/kn.y,v=yIn){let E=k.y*In|0;k.x=st(E,Mn.x)}else if(w0&&!j&&(pt.fillStyle=sn.toString(),pt.fillRect(0,0,k.x,k.y),pt.fillStyle=at.toString()),pt.lineJoin="round",pt.lineCap="round"}}if(U)return d();qh(a);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";a.style.cssText=u,N=a.appendChild(document.createElement("canvas")),Ot=pt=N.getContext("2d"),Eh(),Bh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";N.style.cssText=h,it&&(it.style.cssText=h),ec(ar),l(),To(),Ue=new OffscreenCanvas(64,64),tn=Ue.getContext("2d"),Ce=new OffscreenCanvas(64,64),ze=Ce.getContext("2d",{willReadFrequently:!0});let f=o.map((y,x)=>wa(x,y));return o.length||f.push(wa(0)),f.push(dh()),cr&&f.push(new Promise(y=>{let x=0;v();function v(){Ms(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(f),d();async function d(){await n(),c()}}function Da(){Zo=_t.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of _t)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}_t=_t.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of _t)t.parent||t.destroy(n);_t=_t.filter(t=>!t.destroyed)}function Ma(n,t,e=_t){let s=[];if(n)if(t instanceof lt)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=_t){let s=[];for(let i of e)i.collideRaycast&&Ua(n,t,i.pos,i.size)&&(ye&&Ct(i.pos,i.size,"#f00"),s.push(i));return ye&&Ee(n,t,s.length?"#f00":"#00f",.02),s}function p(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function Et(...n){console.log(...n)}function Ct(n,t=b(),e=H,s=0,i=0,o=!1,a=!1){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),p(R(i),"angle must be a number"),W(e)&&(e=e.toString());let r=new Pe(s);nn.push({pos:n.copy(),size:t.copy(),color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Ml(n,t,e=H,s=0,i=0,o=!1,a=!1){p(O(n),"pos must be a vec2"),p(me(t),"points must be an array"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),p(R(i),"angle must be a number"),W(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let r=new Pe(s);nn.push({pos:n,points:t,color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Ht(n,t=0,e=H,s=0,i=!1,o=!1){p(O(n),"pos must be a vec2"),p(R(t),"size must be a number"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),W(e)&&(e=e.toString()),n=n.copy();let a=new Pe(s);nn.push({pos:n,size:t,color:e,timer:a,angle:0,fill:i,screenSpace:o})}function tr(n,t,e,s,i=!1){Ct(n,void 0,t,e,s,!1,i)}function Ee(n,t,e,s=.1,i=0,o=!1){p(O(n),"posA must be a vec2"),p(O(t),"posB must be a vec2"),p(R(s),"width must be a number");let a=b((t.x-n.x)/2,(t.y-n.y)/2),r=b(s,a.length()*2);Ct(n.add(a),r,e,i,a.angle(),!0,o)}function uo(n,t,e,s,i,o,a=!1){p(O(n),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(O(t),"sizeA must be a vec2"),p(O(s),"sizeB must be a vec2");let r=b(st(n.x-t.x/2,e.x-s.x/2),st(n.y-t.y/2,e.y-s.y/2)),c=b(tt(n.x+t.x/2,e.x+s.x/2),tt(n.y+t.y/2,e.y+s.y/2));Ct(r.lerp(c,.5),c.subtract(r),i,o,0,!1,a)}function Dn(n,t,e=1,s=H,i=0,o=0,a="monospace",r=!1){p(q(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(R(e),"size must be a number"),p(q(s)||W(s),"color is invalid"),p(R(i),"time must be a number"),p(R(o),"angle must be a number"),p(q(a),"font must be a string"),W(s)&&(s=s.toString()),t=t.copy();let c=new Pe(i);nn.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:a,screenSpace:r})}function Il(){nn=[]}function Ga(){lo=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
+"use strict";var __GameBundle=(()=>{var Bi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var qr=(n,t)=>{for(var e in t)Bi(n,e,{get:t[e],enumerable:!0})},Bc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&Bi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Nc=n=>Bc(Bi({},"__esModule",{value:!0}),n);var Dc={};qr(Dc,{ASSERT:()=>p,BLACK:()=>at,BLUE:()=>Qa,Box2dDistanceJoint:()=>vi,Box2dFrictionJoint:()=>Xo,Box2dGearJoint:()=>Vo,Box2dJoint:()=>Zt,Box2dKinematicObject:()=>jo,Box2dMotorJoint:()=>$o,Box2dObject:()=>Cs,Box2dPinJoint:()=>zo,Box2dPlugin:()=>Si,Box2dPrismaticJoint:()=>Wo,Box2dPulleyJoint:()=>Yo,Box2dRaycastResult:()=>xi,Box2dRevoluteJoint:()=>Uo,Box2dRopeJoint:()=>Jo,Box2dStaticObject:()=>bi,Box2dTargetJoint:()=>No,Box2dTileLayer:()=>Bo,Box2dWeldJoint:()=>Ho,Box2dWheelJoint:()=>qo,CLEAR_BLACK:()=>xe,CLEAR_WHITE:()=>ln,CYAN:()=>ql,CanvasLayer:()=>ai,Color:()=>Lt,Ease:()=>Ti,EngineObject:()=>qe,GRAY:()=>Vl,GREEN:()=>Ka,ImageFont:()=>ei,LOG:()=>Et,Light:()=>Po,LightSystemPlugin:()=>Ro,MAGENTA:()=>Hl,Medal:()=>yi,NewgroundsMedal:()=>Co,NewgroundsPlugin:()=>Eo,ORANGE:()=>Wl,PI:()=>Q,PURPLE:()=>Za,Particle:()=>ci,ParticleEmitter:()=>bo,PathFinder:()=>Ko,PathFinderNode:()=>Ai,PostProcessPlugin:()=>_o,RED:()=>ir,RandomGenerator:()=>fo,Sound:()=>ys,SoundInstance:()=>oi,TextureInfo:()=>He,TileCollisionLayer:()=>bs,TileInfo:()=>De,TileLayer:()=>ms,TileLayerData:()=>wn,Timer:()=>Pe,Tween:()=>wi,UIButton:()=>As,UICheckbox:()=>Io,UILayout:()=>Fo,UIObject:()=>he,UISlider:()=>ko,UISystemPlugin:()=>Oo,UIText:()=>mi,UITextInput:()=>Do,UITile:()=>Mo,UIVideo:()=>Go,Vector2:()=>ut,WHITE:()=>H,YELLOW:()=>$a,ZzFXMusic:()=>Lo,abs:()=>ot,atan2:()=>er,audioContext:()=>mt,audioDefaultSampleRate:()=>Kn,audioIsRunning:()=>gs,audioMasterGain:()=>We,box2d:()=>m,box2dDebug:()=>Vr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>nt,cameraFit:()=>rh,cameraPos:()=>Mt,cameraScale:()=>K,canvasClearColor:()=>sn,canvasColorTiles:()=>Ei,canvasFixedSize:()=>kn,canvasMaxAspect:()=>In,canvasMaxSize:()=>Mn,canvasMinAspect:()=>ss,canvasPixelRatio:()=>on,canvasPixelated:()=>ar,ceil:()=>cs,clamp:()=>z,combineCanvases:()=>vr,cos:()=>ht,debug:()=>Jt,debugCircle:()=>Xt,debugClear:()=>Il,debugLine:()=>Ee,debugOverlap:()=>uo,debugOverlay:()=>Fe,debugPoint:()=>tr,debugPointSize:()=>Ia,debugPoly:()=>Ml,debugRect:()=>Ct,debugScreenshot:()=>Ga,debugShowErrors:()=>kl,debugText:()=>Dn,debugVideoCaptureIsActive:()=>_e,debugVideoCaptureStart:()=>Fa,debugVideoCaptureStop:()=>ja,debugWatermark:()=>Ci,distanceAngle:()=>zl,distanceWrap:()=>nr,drawCanvas2D:()=>Rn,drawCircle:()=>ti,drawCircleGradient:()=>sh,drawContext:()=>Ot,drawCount:()=>Le,drawCrescent:()=>ud,drawEllipse:()=>sc,drawEllipseGradient:()=>ic,drawLine:()=>mn,drawLineList:()=>go,drawNineSlice:()=>Ec,drawNineSliceScreen:()=>cd,drawPoly:()=>Jn,drawRect:()=>Zs,drawRectGradient:()=>th,drawRegularPoly:()=>nc,drawText:()=>ih,drawTextScreen:()=>rn,drawTextureWrapped:()=>eh,drawThreeSlice:()=>_c,drawThreeSliceScreen:()=>ld,drawTile:()=>jt,enablePhysicsSolver:()=>Li,engineAddPlugin:()=>En,engineImageFont:()=>cc,engineInit:()=>Pl,engineName:()=>Vs,engineObjects:()=>_t,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>Zo,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Da,engineVersion:()=>Ws,fetchJSON:()=>Xl,floor:()=>Pt,fontDefault:()=>Es,formatTime:()=>or,frame:()=>La,frameRate:()=>El,gamepadConnected:()=>mo,gamepadDirectionEmulateStick:()=>pr,gamepadDpad:()=>yo,gamepadIsDown:()=>Ge,gamepadPrimary:()=>At,gamepadStick:()=>fs,gamepadStickCount:()=>lc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Er,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Oi,getCameraSize:()=>rc,getCrescentPoints:()=>Rc,getNoteFrequency:()=>pc,getPaused:()=>_l,glAntialias:()=>Dr,glCanvas:()=>it,glCircleSides:()=>_s,glClearCanvas:()=>xc,glClearRect:()=>Ac,glCompileShader:()=>Ao,glContext:()=>g,glCopyToContext:()=>Fr,glCreateProgram:()=>Hn,glCreateTexture:()=>ki,glDeleteTexture:()=>Sc,glDraw:()=>Ss,glDrawColoredPoints:()=>Nr,glDrawOutlineTransform:()=>Br,glDrawPoints:()=>Tc,glDrawPointsTransform:()=>jr,glDrawUntextured:()=>wc,glEnable:()=>j,glFlush:()=>It,glSetAntialias:()=>Yh,glSetRenderTarget:()=>ns,glSetTexture:()=>kr,glSetTextureData:()=>Gr,glSetTextureWrap:()=>vc,gravity:()=>Yt,headlessMode:()=>U,hsl:()=>Be,hypot:()=>Ba,inputClear:()=>Ms,inputClearKey:()=>Ar,inputMouseMoveThreshold:()=>Tr,inputPreventDefault:()=>Gn,inputWASDEmulateDirection:()=>is,isArray:()=>me,isColor:()=>W,isFullscreen:()=>ac,isIntersecting:()=>Ua,isNumber:()=>R,isOnScreen:()=>ah,isOverlapping:()=>Ys,isPowerOfTwo:()=>ls,isStringLike:()=>q,isTouchDevice:()=>le,isUsingGamepad:()=>jn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>Ft,keyWasPressed:()=>Nt,keyWasReleased:()=>Cr,lastInputDevice:()=>en,lerp:()=>$t,lerpAngle:()=>Jl,lerpWrap:()=>Ja,lightSystem:()=>$,lineTest:()=>Wa,log2:()=>Na,mainCanvas:()=>N,mainCanvasSize:()=>k,mainContext:()=>pt,max:()=>tt,medalDisplaySize:()=>pi,medalDisplaySlideTime:()=>Fn,medalDisplayTime:()=>fi,medals:()=>ws,medalsForEach:()=>Gi,medalsInit:()=>Zh,medalsPreventUnlock:()=>zr,medalsReset:()=>td,min:()=>st,mod:()=>ce,mouseDelta:()=>Sr,mouseDeltaScreen:()=>Te,mouseInWindow:()=>ni,mouseIsDown:()=>rs,mousePos:()=>ke,mousePosScreen:()=>Ht,mouseWasPressed:()=>ds,mouseWasReleased:()=>xh,mouseWheel:()=>wr,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Ts,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>hr,objectDefaultDamping:()=>ur,objectDefaultFriction:()=>fr,objectDefaultMass:()=>lr,objectDefaultRestitution:()=>dr,objectMaxSpeed:()=>Ne,oscillate:()=>Va,particleEmitRateScale:()=>$s,paused:()=>Re,percent:()=>Ut,percentLerp:()=>Nl,playSamples:()=>Or,pointerLockExit:()=>Ch,pointerLockIsActive:()=>uc,pointerLockRequest:()=>Ah,postProcess:()=>Bt,primitiveCount:()=>Oe,rand:()=>yt,randBool:()=>qa,randColor:()=>ho,randInCircle:()=>Ya,randInt:()=>sr,randSign:()=>Ha,randVec2:()=>Xa,readSaveData:()=>Kl,rgb:()=>V,round:()=>Hs,saveCanvas:()=>tc,saveDataURL:()=>us,saveText:()=>Yl,screenToWorld:()=>Os,screenToWorldDelta:()=>oc,screenToWorldTransform:()=>Ds,setAdditiveBlendMode:()=>hs,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>ec,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Eu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Cu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Iu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Bu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Nu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Mu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>cr,sign:()=>ae,sin:()=>rt,smoothStep:()=>Xs,soundDefaultRange:()=>mr,soundDefaultTaper:()=>br,soundEnable:()=>Qt,soundVolume:()=>Sn,speak:()=>Nh,speakStop:()=>zh,tan:()=>za,textureInfos:()=>hn,tile:()=>Ls,tileCollisionGetData:()=>ri,tileCollisionLayers:()=>an,tileCollisionRaycast:()=>gc,tileCollisionTest:()=>Ze,tileDefaultBleed:()=>Pi,tileDefaultPadding:()=>Ri,tileDefaultSize:()=>_i,tileLayersLoad:()=>Uh,tilesPixelated:()=>Tn,time:()=>ne,timeDelta:()=>Qo,timeReal:()=>cn,timeScale:()=>rr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>yr,touchGamepadAnalog:()=>Rs,touchGamepadButtonCount:()=>Xn,touchGamepadCenterButtonSize:()=>be,touchGamepadDisplayTime:()=>os,touchGamepadEnable:()=>un,touchGamepadFloating:()=>dn,touchGamepadLeftButtonCount:()=>Yn,touchGamepadLeftStick:()=>_n,touchGamepadPassthrough:()=>gr,touchGamepadRightStick:()=>$n,touchGamepadSize:()=>Kt,touchGamepadVibration:()=>Ks,touchInputEnable:()=>yn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Oc,uiDebug:()=>Ur,uiSetDebug:()=>od,uiSystem:()=>C,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>_r,vibrateEnable:()=>Ps,vibrateStop:()=>Th,workCanvas:()=>Ue,workContext:()=>tn,workReadCanvas:()=>Ce,workReadContext:()=>ze,worldToScreen:()=>Pn,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Mi,zzfxM:()=>Cc});function _l(){return Re}function Rl(n=!0){Re=n}function En(n,t,e,s){p(!bn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new co(n,t,e,s);bn.push(i)}async function Pl(n,t,e,s,i,o=[],a){if(Oa&&console.log(`${Vs} Engine v${Ws}`),p(!pt,"engine already initialized"),pt)return;p(me(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),a||(a=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function r(){k=b(N.width,N.height),pt.imageSmoothingEnabled=!Tn,To()}function c(y=0){let x=y-oo;oo||(x=0),oo=y,(Jt||Ci)&&(qs=$t(qs,1e3/(x||1),.05));let v=Jt&&Ft("Equal"),w=Jt&&Ft("Minus"),_=v?10:w?.1:1;cn+=x*_/1e3;let S=rr*_;x*=S,we+=Re?0:x,S<=1&&(we=st(we,50));let E=!1;if(Re){E=!0,l(),Aa(),bn.forEach(T=>{var P;return(P=T.update)==null?void 0:P.call(T)});for(let T of _t)T.parent||T.updateTransforms();va(),e(),Ca(),_e()&&A()}else{let T=0;for(we<0&&we>-9&&(T=we,we=0);we>=0;we-=1e3/60)ne=La++/60,E=!0,l(),Aa(),t(),bn.forEach(P=>{var F;return(F=P.update)==null?void 0:F.call(P)}),Da(),va(),e(),Ca(),_e()&&A();we+=T}_e()||A(),requestAnimationFrame(c);function A(){if(!U){E||l(),r(),s(),_t.sort((T,P)=>T.renderOrder-P.renderOrder);for(let T of _t)T.destroyed||T.render();i(),bn.forEach(T=>{var P;return(P=T.render)==null?void 0:P.call(T)}),_h(),Fl(),It(),jl(),Le=0,Oe=0}}}function l(){if(!U){if(kn.x){k=kn.copy();let y=innerWidth/innerHeight,x=kn.x/kn.y,v=yIn){let E=k.y*In|0;k.x=st(E,Mn.x)}else if(w0&&!j&&(pt.fillStyle=sn.toString(),pt.fillRect(0,0,k.x,k.y),pt.fillStyle=at.toString()),pt.lineJoin="round",pt.lineCap="round"}}if(U)return d();qh(a);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";a.style.cssText=u,N=a.appendChild(document.createElement("canvas")),Ot=pt=N.getContext("2d"),Eh(),Bh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";N.style.cssText=h,it&&(it.style.cssText=h),ec(ar),l(),To(),Ue=new OffscreenCanvas(64,64),tn=Ue.getContext("2d"),Ce=new OffscreenCanvas(64,64),ze=Ce.getContext("2d",{willReadFrequently:!0});let f=o.map((y,x)=>wa(x,y));return o.length||f.push(wa(0)),f.push(dh()),cr&&f.push(new Promise(y=>{let x=0;v();function v(){Ms(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(f),d();async function d(){await n(),c()}}function Da(){Zo=_t.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of _t)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}_t=_t.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of _t)t.parent||t.destroy(n);_t=_t.filter(t=>!t.destroyed)}function Ma(n,t,e=_t){let s=[];if(n)if(t instanceof ut)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=_t){let s=[];for(let i of e)i.collideRaycast&&Ua(n,t,i.pos,i.size)&&(ye&&Ct(i.pos,i.size,"#f00"),s.push(i));return ye&&Ee(n,t,s.length?"#f00":"#00f",.02),s}function p(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function Et(...n){console.log(...n)}function Ct(n,t=b(),e=H,s=0,i=0,o=!1,a=!1){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),p(R(i),"angle must be a number"),W(e)&&(e=e.toString());let r=new Pe(s);nn.push({pos:n.copy(),size:t.copy(),color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Ml(n,t,e=H,s=0,i=0,o=!1,a=!1){p(O(n),"pos must be a vec2"),p(me(t),"points must be an array"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),p(R(i),"angle must be a number"),W(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let r=new Pe(s);nn.push({pos:n,points:t,color:e,timer:r,angle:i,fill:o,screenSpace:a})}function Xt(n,t=0,e=H,s=0,i=!1,o=!1){p(O(n),"pos must be a vec2"),p(R(t),"size must be a number"),p(q(e)||W(e),"color is invalid"),p(R(s),"time must be a number"),W(e)&&(e=e.toString()),n=n.copy();let a=new Pe(s);nn.push({pos:n,size:t,color:e,timer:a,angle:0,fill:i,screenSpace:o})}function tr(n,t,e,s,i=!1){Ct(n,void 0,t,e,s,!1,i)}function Ee(n,t,e,s=.1,i=0,o=!1){p(O(n),"posA must be a vec2"),p(O(t),"posB must be a vec2"),p(R(s),"width must be a number");let a=b((t.x-n.x)/2,(t.y-n.y)/2),r=b(s,a.length()*2);Ct(n.add(a),r,e,i,a.angle(),!0,o)}function uo(n,t,e,s,i,o,a=!1){p(O(n),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(O(t),"sizeA must be a vec2"),p(O(s),"sizeB must be a vec2");let r=b(st(n.x-t.x/2,e.x-s.x/2),st(n.y-t.y/2,e.y-s.y/2)),c=b(tt(n.x+t.x/2,e.x+s.x/2),tt(n.y+t.y/2,e.y+s.y/2));Ct(r.lerp(c,.5),c.subtract(r),i,o,0,!1,a)}function Dn(n,t,e=1,s=H,i=0,o=0,a="monospace",r=!1){p(q(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(R(e),"size must be a number"),p(q(s)||W(s),"color is invalid"),p(R(i),"time must be a number"),p(R(o),"angle must be a number"),p(q(a),"font must be a string"),W(s)&&(s=s.toString()),t=t.copy();let c=new Pe(i);nn.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:a,screenSpace:r})}function Il(){nn=[]}function Ga(){lo=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
 `+i+`
 `+o}},onunhandledrejection=e=>n(e.reason.stack||e.reason),onerror=(e,s,i,o)=>n(`${e}
 ${s}
-Ln ${i}, Col ${o}`)}function Gl(){Oa&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function va(){zt&&(Bt(ka)&&(Fe=!Fe),Fe&&(Bt("Digit1")&&(ge=!ge,xn=!1),Bt("Digit2")&&(xn=!xn,ge=!1),Bt("Digit3")&&(vn=!vn),Bt("Digit4")&&(ye=!ye),Bt("Digit5")&&Ga(),Bt("Digit7")&&(zn=!zn)),_e()?(!Fe||Bt("Digit6"))&&ja():Fe&&Bt("Digit6")&&Fa())}function Fl(){if(_e())return;It();let n=Le,t=Oe;lo&&(vr(),tc(N),lo=0);let e=pt;if(vn&&Oi){let o=0;for(let a=0;a<8;a++)mo(a)&&o++;for(let a=0;a<8;a++){if(!mo(a))continue;let r=1,c=.2,l=Mt.add(b(-r*2,((o-1)/2-a)*r*3));Dn(a,l.add(b(-r,r)),1),a===At&&Dn("Main",l.add(b(-r*2,0)),1,"#0f0");let u=Ae[a].length;for(let f=0;f{e.save();let o=i.pos,a=1,r=i.angle;if(i.screenSpace||(o=Pn(i.pos),a=K,r-=et),e.translate(o.x|0,o.y|0),e.rotate(r),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*a+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(a).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=Ia*a;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(a).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*a/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),nn=nn.filter(i=>i.timer<0),s){let i=gc(s.pos,ke);i&&Zs(i.floor().add(b(.5)),b(1),V(0,1,1,.3),0,!1),mn(ke,s.pos,.1,i?V(1,0,0,.5):V(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+ke;an.length&&(o+=`
+Ln ${i}, Col ${o}`)}function Gl(){Oa&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function va(){Jt&&(Nt(ka)&&(Fe=!Fe),Fe&&(Nt("Digit1")&&(ge=!ge,xn=!1),Nt("Digit2")&&(xn=!xn,ge=!1),Nt("Digit3")&&(vn=!vn),Nt("Digit4")&&(ye=!ye),Nt("Digit5")&&Ga(),Nt("Digit7")&&(zn=!zn)),_e()?(!Fe||Nt("Digit6"))&&ja():Fe&&Nt("Digit6")&&Fa())}function Fl(){if(_e())return;It();let n=Le,t=Oe;lo&&(vr(),tc(N),lo=0);let e=pt;if(vn&&Oi){let o=0;for(let a=0;a<8;a++)mo(a)&&o++;for(let a=0;a<8;a++){if(!mo(a))continue;let r=1,c=.2,l=Mt.add(b(-r*2,((o-1)/2-a)*r*3));Dn(a,l.add(b(-r,r)),1),a===At&&Dn("Main",l.add(b(-r*2,0)),1,"#0f0");let u=Ae[a].length;for(let f=0;f{e.save();let o=i.pos,a=1,r=i.angle;if(i.screenSpace||(o=Pn(i.pos),a=K,r-=nt),e.translate(o.x|0,o.y|0),e.rotate(r),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*a+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(a).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=Ia*a;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(a).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*a/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),nn=nn.filter(i=>i.timer<0),s){let i=gc(s.pos,ke);i&&Zs(i.floor().add(b(.5)),b(1),V(0,1,1,.3),0,!1),mn(ke,s.pos,.1,i?V(1,0,0,.5):V(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+ke;an.length&&(o+=`
 mouse collision = `+ri(ke)),o+=`
 
 --- object info ---
-`,o+=s.toString(),rn(o,qt,24,V(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let a=9,r=0,c=24;if(Fe){e.fillText(`${Vs} v${Ws}`,a,r+=c/2),e.fillText("Time: "+or(ee),a,r+=c),e.fillText("FPS: "+qs.toFixed(1)+(j?" WebGL":" Canvas2D"),a,r+=c),e.fillText("Objects: "+_t.length,a,r+=c),e.fillText("Draw Calls: "+Le,a,r+=c),e.fillText("Primitives: "+Oe,a,r+=c),e.fillText("---------",a,r+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",a,r+=c),e.fillStyle=ge?"#f00":"#fff",e.fillText("1: Debug Physics",a,r+=c),e.fillStyle=xn?"#f00":"#fff",e.fillText("2: Debug Particles",a,r+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("3: Debug Gamepads",a,r+=c),e.fillStyle=ye?"#f00":"#fff",e.fillText("4: Debug Raycasts",a,r+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",a,r+=c),e.fillText("6: Toggle Video Capture",a,r+=c),e.fillStyle=zn?"#f00":"#fff",e.fillText("7: Debug Sound",a,r+=c);let l="",u="";for(let h in Z[0])Gt(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,a,r+=c),l&&e.fillText("Keys: "+l,a,r+=c);for(let h=1;hs.push(r.data),i.onstop=()=>{let r=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(r);us(c,"capture.webm",1e3)};let o,a;if(Kt){a=new ConstantSourceNode(mt,{offset:0}),a.connect(We),a.start(),o=mt.createMediaStreamDestination(),We.connect(o);for(let r of o.stream.getAudioTracks())n.addTrack(r)}try{i.start()}catch{Et("Video capture not supported in this browser!"),a==null||a.stop();return}Et("Video capture started."),je={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:a,audioStreamDestination:o}}function ja(){var n,t,e;p(_e(),"Not capturing video!"),Et(`Video capture ended. ${je.captureTimer.get().toFixed(2)} seconds recorded.`),pe.style.display="none",(n=je.silentAudioSource)==null||n.stop(),(t=je.mediaRecorder)==null||t.stop(),(e=je.videoTrack)==null||e.stop(),je=void 0}function Bl(){p(_e(),"Not capturing video!"),vr(),je.videoTrack.requestFrame(),pe.textContent="\u25CF REC "+or(je.captureTimer)}function se(n){if(zt){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{p(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function ce(n,t=1){return(n%t+t)%t}function z(n,t=0,e=1){return ne?e:n}function Jt(n,t,e){return(e-=t)?z((n-t)/e):0}function Yt(n,t,e){return n+z(e)*(t-n)}function Nl(n,t,e,s,i){return Yt(s,i,Jt(n,t,e))}function nr(n,t,e=1){p(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ja(n,t,e,s=1){return n+z(e)*nr(t,n,s)}function zl(n,t){return nr(n,t,2*Q)}function Jl(n,t,e){return Ja(n,t,e,2*Q)}function Xs(n){return n*n*(3-2*n)}function ls(n){return!(n&n-1)}function Ul(n){return 2**cs(Na(n))}function Ys(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,a=t.x+s.x,r=t.y+s.y;return ot(i)f)return!1;h=tt(y,h)}else{if(y0?r.x+1:r.x,x=h>0?r.y+1:r.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,E=w,A=fr.x&&(T.x=r.x+1-P),F.yr.y&&(T.y=r.y+1-P),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;p(q(n),"shareURL requires title string"),p(q(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){p(q(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{Et("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{Et("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){p(q(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{Et("writeSaveData: failed to write",n)}}function po(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=Pt(n);return Yt(po(t),po(t+1),Xs(n-t))}function tu(n,t){let e=Pt(n),s=Pt(t),i=Xs(n-e),o=Xs(t-s),a=(r,c)=>po(r+c*374761393);return Yt(Yt(a(e,s),a(e+1,s),i),Yt(a(e,s+1),a(e+1,s+1),i),o)}function eu(n){Mt=n.copy()}function nu(n){et=n}function su(n){K=n}function iu(n){rr=n}function ou(n){Ei=n}function ru(n){sn=n.copy()}function au(n){Mn=n.copy()}function cu(n){ss=n}function lu(n){In=n}function uu(n){kn=n.copy()}function ec(n){ar=n,N&&(N.style.imageRendering=n?"pixelated":""),it&&(it.style.imageRendering=n?"pixelated":"")}function hu(n){Tn=n}function du(n){on=n}function fu(n){Es=n}function pu(n){cr=n}function gu(n){U=n}function yu(n){if(n&&!wo){console.warn("Can not enable WebGL if it was disabled on start.");return}j=n,it&&(it.style.display=n?"":"none")}function mu(n){_s=n}function bu(n){_i=n.copy()}function xu(n){Ri=n}function vu(n){Pi=n}function Su(n){Li=n}function wu(n){lr=n}function Tu(n){ur=n}function Au(n){hr=n}function Cu(n){dr=n}function Eu(n){fr=n}function _u(n){Ne=n}function Ru(n){Xt=n.copy()}function Pu(n){$s=n}function Lu(n){Oi=n}function Ou(n){pr=n}function Du(n){is=n}function Mu(n){yn=n}function Iu(n){un=n}function ku(n){gr=n}function Gu(n){be=n}function Fu(n){Xn=n,n>0&&($n=!1)}function ju(n){_n=n,n&&(Yn=0)}function Bu(n){Yn=n,n>0&&(_n=!1)}function Nu(n){$n=n,n&&(Xn=0)}function zu(n){Rs=n}function Ju(n){dn=n}function Uu(n){$t=n}function Vu(n){yr=n}function Wu(n){os=n}function qu(n){Ks=n}function Hu(n){Ps=n}function Xu(n){Kt=n}function Yu(n){Sn=n,Kt&&!U&&We&&(We.gain.value=n)}function $u(n){mr=n}function Ku(n){br=n}function Qu(n){Ci=n}function Zu(n){ka=n}function Qs(n){return n.r>=1&&n.g>=1&&n.b>=1}function xr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Ls(n=0,t=_i,e=0,s=Ri,i=Pi){if(p(O(n)||typeof n=="number","index must be a vec2 or number"),p(O(t)||typeof t=="number","size must be a vec2 or number"),p(R(e)||e instanceof He,"texture must be a number or TextureInfo"),p(R(s),"padding must be a number"),U)return new De;typeof t=="number"&&(p(t>0),t=new lt(t,t));let o=typeof e=="number"?hn[e]:e;p(o instanceof He,"tile texture is not loaded"),p(o.size.x>0,"tile texture is not loaded");let a=t.x+s*2,r=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/a|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new lt(c*a+s,l*r+s);return new De(u,t,o,s,i)}function Ft(n,t=b(1),e,s=H,i=0,o,a,r=j,c=!1,l){var f;p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!a||W(a),"additiveColor must be a color"),p(!l||!r,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(f=e==null?void 0:e.bleed)!=null?f:0;if(r&&j)if(p(!!g,"WebGL is not enabled!"),c&&([n,t,i]=Ds(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(kr(u.glTexture),h){let _=d.x*h,S=d.y*h;Ss(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),a&&a.rgbaInt())}else Ss(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),a&&a.rgbaInt())}else{let d=a?s.add(a):s;wc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++Le,++Oe,Rn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,a,h)}else{let y=a?s.add(a):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function Zs(n,t,e,s,i,o,a){Ft(n,t,void 0,e,s,!1,void 0,i,o,a)}function th(n,t,e=H,s=ln,i=0,o=j,a=!1,r){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!r||!o,"context only supported in canvas 2D mode"),o&&j){p(!!g,"WebGL is not enabled!"),a&&(n=Os(n),t=t.scale(1/K),i+=et);let c=[],l=[],u=t.x/2,h=t.y/2,f=e.rgbaInt(),d=s.rgbaInt(),y=ut(-i),x=rt(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,E=w*x+_*y,A=v&2?f:d;c.push(b(n.x+S,n.y+E)),l.push(A)}Nr(c,l)}else++Le,++Oe,Rn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},a,r)}function eh(n,t,e,s=0,i=H,o=0,a,r=j,c=!1,l){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(O(e),"wrapCount must be a vec2"),p(W(i),"color is invalid"),p(R(o),"angle must be a number"),p(!a||W(a),"additiveColor must be a color"),p(!l||!r,"context only supported in canvas 2D mode"),p(!(s instanceof De),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),U)return;let u=typeof s=="number"?hn[s]:s;if(p(u instanceof He,"texture not loaded"),p(u.size.x>0,"texture not loaded"),p(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),r&&j){p(!!g,"WebGL is not enabled!"),c&&([n,t,o]=Ds(n,t,o)),kr(u.glTexture),Ss(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),a&&a.rgbaInt());return}++Le,++Oe,c||(n=Pn(n),t=t.scale(K),o-=et);let h=!Ei||(a?Qs(i.add(a))&&a.a<=0:Qs(i)),f=!h&&a&&!xr(a),d=h?u.image:ch(u.image,i,a);l=l||Ot,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=f?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function go(n,t=.1,e=H,s=!1,i=b(),o=0,a=j,r=!1,c){if(p(me(n),"points must be an array"),p(R(t),"width must be a number"),p(W(e),"color is invalid"),p(O(i),"pos must be a vec2"),p(R(o),"angle must be a number"),p(!c||!a,"context only supported in canvas 2D mode"),a&&j){p(!!g,"WebGL is not enabled!");let l=b(1);r&&([i,l,o]=Ds(i,l,o)),Br(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++Le,++Oe,Rn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&Br(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Rn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},r,c)}function sc(n,t=b(1),e=H,s=0,i=0,o=at,a=j,r=!1,c){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(o),"color is invalid"),p(R(s),"angle must be a number"),p(R(i),"lineWidth must be a number"),p(i>=0,"lineWidth must be a positive value or 0"),p(!c||!a,"context only supported in canvas 2D mode"),i=z(i,0,st(t.x,t.y)),a&&j?nc(n,t,_s,e,i,o,s,a,r,c):Rn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},r,c)}function ti(n,t=1,e=H,s=0,i=at,o=j,a=!1,r){p(R(t),"size must be a number"),sc(n,b(t),e,0,s,i,o,a,r)}function ic(n,t=b(1),e=H,s=ln,i=0,o=j,a=!1,r){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!r||!o,"context only supported in canvas 2D mode"),!U)if(o&&j){p(!!g,"WebGL is not enabled!"),a&&(n=Os(n),t=t.scale(1/K),i+=et);let c=_s,l=t.x/2,u=t.y/2,h=e.rgbaInt(),f=s.rgbaInt(),d=nh++,y=ut(-i),x=rt(-i),v=E=>{let A=rt(E)*l,T=ut(E)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*Q*2,_=[v(w)],S=[f];for(let E=c;E--;){let A=(E+d)%c/c*Q*2;_.push(n),S.push(h),_.push(v(A)),S.push(f)}Nr(_,S)}else++Le,++Oe,Rn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},a,r)}function sh(n,t=1,e=H,s=ln,i=j,o=!1,a){p(R(t),"size must be a number"),ic(n,b(t),e,s,0,i,o,a)}function Rn(n,t,e=0,s=!1,i,o=!1,a=Ot){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(R(e),"angle must be a number"),p(typeof i=="function","drawFunction must be a function"),o||(n=Pn(n),t=t.scale(K),e-=et),a.save(),a.translate(n.x+.5,n.y+.5),a.rotate(e),a.scale(s?-t.x:t.x,-t.y),i(a),a.restore()}function ih(n,t,e=1,s=H,i=0,o=at,a="center",r=Es,c="",l,u=0,h=Ot){t=Pn(t),e*=K,i*=K,u-=et,u*=-1,rn(n,t,e,s,i,o,a,r,c,l,u,h)}function rn(n,t,e,s=H,i=0,o=at,a="center",r=Es,c="",l,u=0,h=Ot){p(q(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(R(e),"size must be a number"),p(W(s),"color must be a color"),p(R(i),"lineWidth must be a number"),p(W(o),"lineColor must be a color"),p(["left","center","right"].includes(a),"align must be left, center, or right"),p(q(r),"font must be a string"),p(q(c),"fontStyle must be a string"),p(R(u),"angle must be a number");let f=(n+"").split(`
-`),d=t.y-(f.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=a,h.font=c+" "+e+"px "+r,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;f.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function wa(n,t){p(R(n),"textureIndex must be a number"),p(!hn[n],"textureIndex is already loaded!"),p(!t||q(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),hn[n]=new He(e)}function Os(n){p(O(n),"screenPos must be a vec2");let t=(n.x-k.x/2+.5)/K,e=(n.y-k.y/2+.5)/-K;if(et){let s=ut(-et),i=rt(-et),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new lt(t+Mt.x,e+Mt.y)}function Pn(n){p(O(n),"worldPos must be a vec2");let t=n.x-Mt.x,e=n.y-Mt.y;if(et){let s=ut(et),i=rt(et),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new lt(t*K+k.x/2-.5,e*-K+k.y/2-.5)}function oc(n){p(O(n),"screenDelta must be a vec2");let t=n.x/K,e=n.y/-K;if(et){let s=ut(-et),i=rt(-et),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new lt(t,e)}function oh(n){p(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(et){let s=ut(et),i=rt(et),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new lt(t*K,e*-K)}function Ds(n,t,e=0){return p(O(n),"screenPos must be a vec2"),p(O(t),"screenSize must be a vec2"),p(R(e),"screenAngle must be a number"),[Os(n),t.scale(1/K),e+et]}function rc(){return k.scale(1/K)}function rh(n,t,e,s){p(O(n),"center must be a vec2"),p(O(t),"size must be a vec2");let i=f(e),o=f(s),a=t.x+i.left+i.right,r=t.y+i.top+i.bottom,c=k.x-o.left-o.right,l=k.y-o.top-o.bottom;if(!(a>0&&r>0&&c>0&&l>0))return K;K=st(c/a,l/r);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/K);return Mt=n.add(u).add(h),K;function f(d){return(d===void 0||R(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(p(O(n),"pos must be a vec2"),p(O(t)||R(t),"size must be a vec2 or number"),!K)return!1;let e=n.x-Mt.x,s=n.y-Mt.y;if(et){let a=ut(et),r=rt(et),c=e*a-s*r,l=e*r+s*a;e=c,s=l}e*=K*2,s*=-K*2,t instanceof lt&&(t=t.length()),t*=K;let i=k.x,o=k.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=r,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new He(n),a=new De(t,e,o,s,i);cc=new ei(a)}function fh(n=!0){Gn=n}function ph(n){Tr=n}function gh(){return en==="mouse"}function yh(){return en==="keyboard"}function mh(){return en==="gamepad"}function Ar(n,t=0,e=!0,s=!0,i=!0){Z[t]&&(Z[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function Ms(){Z.length=0,Z[0]=[],ue.length=0,An.length=0,Is.length=0,Ae.length=0,pn.length=0}function Gt(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&1)}function Bt(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&2)}function Cr(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){p(q(n),"up key must be a string"),p(q(t),"down key must be a string"),p(q(e),"left key must be a string"),p(q(s),"right key must be a string");let i=o=>Gt(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function rs(n){return p(R(n),"mouse button must be a number"),Gt(n)}function ds(n){return p(R(n),"mouse button must be a number"),Bt(n)}function xh(n){return p(R(n),"mouse button must be a number"),Cr(n)}function Ge(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Gt(n,t+1)}function Er(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Bt(n,t+1)}function vh(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Cr(n,t+1)}function fs(n,t=At){var e,s;return p(R(n),"stick must be a number"),p(R(t),"gamepad must be a number"),(s=(e=Ae[t])==null?void 0:e[n])!=null?s:b()}function yo(n=At){var t;return p(R(n),"gamepad must be a number"),(t=pn[n])!=null?t:b()}function mo(n=At){return p(R(n),"gamepad must be a number"),!!Z[n+1]}function lc(n=At){var t,e;return p(R(n),"gamepad must be a number"),(e=(t=Ae[n])==null?void 0:t.length)!=null?e:0}function Sh(n=At,t=200,e=1,s=1,i=0){var a,r,c;if(p(R(n),"gamepad must be a number"),!Ps||U)return;let o=(a=navigator==null?void 0:navigator.getGamepads)==null?void 0:a.call(navigator)[n];(c=(r=o==null?void 0:o.vibrationActuator)==null?void 0:r.playEffect)==null||c.call(r,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=At){var e,s,i;if(p(R(n),"gamepad must be a number"),!Ps||U)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function _r(n=100){var t;p(R(n)||me(n),"pattern must be a number or array"),Ps&&!U&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){_r(0)}function Ah(){var n;!le&&((n=N.requestPointerLock)==null||n.call(N))}function Ch(){var n;(n=document.exitPointerLock)==null||n.call(document)}function uc(){return document.pointerLockElement===N}function Eh(){if(U)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",a),document.addEventListener("wheel",r,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),le&&yn&&u();function n(f){if(f.repeat||(Z[0][f.code]=3,is&&(Z[0][e(f.code)]=3)),!Gn||!f.cancelable||!document.hasFocus()||f.ctrlKey||f.metaKey||f.altKey||x(f.target)||x(document.activeElement))return;let d=typeof f.key=="string"&&f.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(f.code)||d)&&f.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(f){Z[0][f.code]=Z[0][f.code]&2|4,is&&(Z[0][e(f.code)]=4)}function e(f){return is?f==="KeyW"?"ArrowUp":f==="KeyS"?"ArrowDown":f==="KeyA"?"ArrowLeft":f==="KeyD"?"ArrowRight":f:f}function s(f){if(le&&yn)return;Kt&&!U&&mt&&!gs()&&mt.resume(),Z[0][f.button]=3;let d=qt;qt=h(b(f.x,f.y)),Te=Te.add(qt.subtract(d)),Gn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function i(f){le&&yn||(Z[0][f.button]=Z[0][f.button]&2|4)}function o(f){ni=!0;let d=qt;qt=h(b(f.x,f.y));let y=uc()?b(f.movementX,f.movementY):qt.subtract(d);Te=Te.add(y)}function a(){ni=!1}function r(f){f.ctrlKey||(wr+=ae(f.deltaY)),Gn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function c(f){f.preventDefault()}function l(){Ms(),Je.clear(),ue.length=0,An.length=0,Is.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let f;function d(y){if(yn){if(Kt&&!U&&mt&&!gs()&&mt.resume(),!un||gr){let x=S=>ps.includes(S.target)||S.target===gn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),E=qt;qt=h(S),f?Te=Te.add(qt.subtract(E)):Z[0][_]=3}else f&&(Z[0][_]=Z[0][_]&2|4);f=w}return Gn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(f){let d=N.getBoundingClientRect(),y=Jt(f.x,d.left,d.right),x=Jt(f.y,d.top,d.bottom);return b(y*N.width,x*N.height)}}function Aa(){if(U)return;!(yn&&le)&&!document.hasFocus()&&Ms(),ke=Os(qt),Sr=oc(Te),Rh(),t(),n();function n(){let e=rs(0)||rs(1)||rs(2)||Te.length()>Tr,s=!1;for(let o=lc();o--&&!s;)s=fs(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=Ge(o);let i=!1;for(let o in Z[0])if(isNaN(+o)&&Z[0][o]&1){i=!0;break}s?en="gamepad":e?en="mouse":i&&(en="keyboard"),jn=en==="gamepad"}function t(){var a,r,c,l,u,h,f;let e=d=>{let v=w=>w>.3?Jt(w,.3,.8):w<-.3?-Jt(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(un&&le){if(p(!_n||!Yn,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),p(!$n||!Xn,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Un.isSet())return;At=0;let d=(a=Ae[0])!=null?a:Ae[0]=[],y=(r=pn[0])!=null?r:pn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!Xe(v))continue;let w=Lr(v);d[w]=b();let _=(c=An[v])!=null?c:b();if(Rs)d[w]=e(_);else if(_.lengthSquared()>.3){let S=z(Hs(_.x),-1,1),E=z(Hs(_.y),-1,1);d[w]=b(S,-E).clampLength(),w||y.set(S,-E)}}let x=(l=Z[1])!=null?l:Z[1]=[];for(let v=12;v--;){let w=Ge(v,0);x[v]=ue[v]?w?1:3:w?4:0,Ks&&x[v]===3&&(v===9||Ph(v))&&_r(Ks)}return}try{if(!Oi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!zt&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=st(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let E=y.buttons[S],A=Ge(S,d);x[S]=E.pressed?A?1:3:A?4:0,E.pressed&&(!E.value||E.value>.9)&&(_=!0)}_&&(ro[d]=!0,ro[At]||(At=d)),y.mapping==="standard"&&w.set((Ge(15,d)&&1)-(Ge(14,d)&&1),(Ge(12,d)&&1)-(Ge(13,d)&&1)),pr&&(w.x||w.y)&&(v[0]=w.clampLength())}un&&jn&&Un.unset()}}function Ca(){if(!U){for(let n of Z)for(let t in n)n[t]&=1;wr=0,Sr=b(),Te=b()}}function _h(){Mh()}function Rh(){if(Qe||!un||!le||U||!document.body)return;let n=Qe=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=hc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Rr=document.createElementNS(ii,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>Ea(o)),i.addEventListener("pointercancel",o=>Ea(o)),t.appendChild(i),i};ps[0]=s(),ps[1]=s(),gn=s(),addEventListener("resize",()=>Vn=!0),document.body.appendChild(n),Vn=!0}function Di(){return hc.getBoundingClientRect()}function Xe(n){return n?$n:_n}function Ln(n){return n?Xn:Yn}function Pr(n){return n?0:4}function Lr(n){return n&&_n?1:0}function Wn(n){return Xe(n)||Ln(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Pr(t);if(!Xe(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+a;if(Re){for(let o of ps)o.style.display="none";be?(i(gn,"inset:0"),gn.style.display=""):gn.style.display="none"}else{for(let a=0;a<2;a++){let r=ps[a],c=a?"right":"left";if(r.style.display=Wn(a)?"":"none",dn){let l=Wn(a?0:1)?"50%":"100%";i(r,`${c}:0;bottom:0;width:${l};height:60%`)}else i(r,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}gn.style.display=be?"":"none";let o=be;i(gn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),Vn=!1}function Oh(n,t){let e=Rr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=dc={face:[],thumb:[]},i=$t,o=(r,c,l,u)=>{let h=document.createElementNS(ii,"circle");return h.setAttribute("cx",r),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},a=r=>{let c=i*.18,l=i*.5,u=r.x,h=r.y,f=document.createElementNS(ii,"path");f.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(f)};for(let r=0;r<2;r++){let c=Ln(r),l=Pr(r),u=Ve(r,n,t);if(Xe(r))Rs?o(u.x,u.y,i/2):a(u),s.thumb[r]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?f:st(f,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(f,i/2);c===2&&(y.x*=-1),r||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}zt&&vn&&Dh(n,t)}function Dh(n,t){let e=$t,s=Rr,i=(a,r,c)=>{let l=document.createElementNS(ii,a);for(let u in r)l.setAttribute(u,r[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(a,r,c)=>i("circle",{cx:a.x,cy:a.y,r},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let a=0;a<2;a++)if(Xe(a))if(dn){let r=t*.4,c=!Wn(a?0:1),l=c?0:a?n/2:0;i("rect",{x:l,y:r,width:c?n:n/2,height:t-r},"#0ff")}else o(Ve(a,n,t),2*e,"#0ff");else Ln(a)>=1&&o(Ve(a,n,t),e,"#0ff");if(be){o(b(n/2,t/2),be,"#ff0");for(let a=0;a<2;a++)Wn(a)&&o(Ve(a,n,t),2*e,"#f0f")}}function Mh(){var l;if(!Qe||U)return;if(!un||!le){Qe.style.display!=="none"&&(Qe.style.display="none",Je.clear(),ue.length=0,An.length=0,Is.length=0);return}Qe.style.display="";let n=zt&&vn,t=[Xn,Yn,_n,$n,Rs,$t,dn,be,Re,n].join();t!==Ta&&(Ta=t,Vn=!0),Vn&&Lh();let e=os?Jt(Un.get(),os+1,os):1,s=n||Un.isSet()&&e>0&&!Re;if(Qe.style.opacity=s?n?1:e*yr:0,!s)return;let i=Di(),o=i.width,a=i.height,r=$t,c=dc;if(c){for(let u=0;u<2;u++)if(Xe(u)&&c.thumb[u]){let f=Ve(u,o,a).add(((l=An[u])!=null?l:b()).scale(r/2));c.thumb[u].setAttribute("cx",f.x),c.thumb[u].setAttribute("cy",f.y)}for(let u=0;u=$t)return-1;if(i===1)return o;let r=a.subtract(t);n||(r.x*=-1);let c=i===2?r.xo:r&&Ve(a,t,e).distance(n)<2*s)return{role:"stick",side:a}}else if(Ln(a)>=1){let c=kh(a,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(be){for(let a=0;a<2;a++)if(Wn(a)&&Ve(a,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),f.buffer=h,f.playbackRate.value=e,f.loop=i,a=a||mt.createGain(),a.gain.value=t,a.connect(We);let d=new StereoPannerNode(mt,{pan:z(s,-1,1)});f.connect(d).connect(a),f.addEventListener("ended",()=>{a.disconnect(),d.disconnect(),c&&c(f)});let y=r*e;return f.start(0,y),zt&&zn&&Et("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),f}function Jh(...n){return Or([Mi(...n)])}function Mi(n=1,t=.05,e=220,s=0,i=0,o=.1,a=0,r=1,c=0,l=0,u=0,h=0,f=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,E=0){let A=Kn,T=Q*2,P=c*=500*T/A/A,F=e*=(1+yt(t,-t))*T/A,bt=0,ct=0,gt=0,wt=1,Ut,L=[],I=0,M=0,B=0,nt,ht=2,xt=T*ot(E)*2/A,dt=ut(xt),vt=rt(xt)/2/ht,Tt=1+vt,de=-2*dt/Tt,Me=(1-vt)/Tt,G=(1+ae(E)*dt)/2/Tt,J=-(ae(E)+dt)/Tt,Rt=G,Ie=0,X=0,Y=0,kt=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,f=f*A|0,Ut=s+_+i+o+v|0;M1?a>2?a>3?a>4?I/T%14?B:ae(B)*ot(B)**r)*(MM?0:(Mh&&(e+=u,F+=u,wt=0),f&&!(++ct%f)&&(e=F,c=P,wt||(wt=1));return L}function ri(n,t=!0){for(let e of an)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function Ze(n,t=b(),e,s=!0){for(let i of an)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function gc(n,t,e,s,i=!0){let o,a,r,c=s&&b();for(let l of an)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{j=!1,it.style.display="none",e.preventDefault(),Et("WebGL context lost! Switching to Canvas2d rendering.");for(let s of as)s.glTexture=void 0;ne=void 0,Dt=0,Cn=!1,bn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),it.addEventListener("webglcontextrestored",()=>{j=!0,it.style.display="",Et("WebGL context restored, reinitializing..."),t();for(let e of as)e.glTexture=ki(e.image,e.wrap);bn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){li=Hn(`#version 300 es
+`,o+=s.toString(),rn(o,Ht,24,V(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let a=9,r=0,c=24;if(Fe){e.fillText(`${Vs} v${Ws}`,a,r+=c/2),e.fillText("Time: "+or(ne),a,r+=c),e.fillText("FPS: "+qs.toFixed(1)+(j?" WebGL":" Canvas2D"),a,r+=c),e.fillText("Objects: "+_t.length,a,r+=c),e.fillText("Draw Calls: "+Le,a,r+=c),e.fillText("Primitives: "+Oe,a,r+=c),e.fillText("---------",a,r+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",a,r+=c),e.fillStyle=ge?"#f00":"#fff",e.fillText("1: Debug Physics",a,r+=c),e.fillStyle=xn?"#f00":"#fff",e.fillText("2: Debug Particles",a,r+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("3: Debug Gamepads",a,r+=c),e.fillStyle=ye?"#f00":"#fff",e.fillText("4: Debug Raycasts",a,r+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",a,r+=c),e.fillText("6: Toggle Video Capture",a,r+=c),e.fillStyle=zn?"#f00":"#fff",e.fillText("7: Debug Sound",a,r+=c);let l="",u="";for(let h in Z[0])Ft(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,a,r+=c),l&&e.fillText("Keys: "+l,a,r+=c);for(let h=1;hs.push(r.data),i.onstop=()=>{let r=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(r);us(c,"capture.webm",1e3)};let o,a;if(Qt){a=new ConstantSourceNode(mt,{offset:0}),a.connect(We),a.start(),o=mt.createMediaStreamDestination(),We.connect(o);for(let r of o.stream.getAudioTracks())n.addTrack(r)}try{i.start()}catch{Et("Video capture not supported in this browser!"),a==null||a.stop();return}Et("Video capture started."),je={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:a,audioStreamDestination:o}}function ja(){var n,t,e;p(_e(),"Not capturing video!"),Et(`Video capture ended. ${je.captureTimer.get().toFixed(2)} seconds recorded.`),pe.style.display="none",(n=je.silentAudioSource)==null||n.stop(),(t=je.mediaRecorder)==null||t.stop(),(e=je.videoTrack)==null||e.stop(),je=void 0}function Bl(){p(_e(),"Not capturing video!"),vr(),je.videoTrack.requestFrame(),pe.textContent="\u25CF REC "+or(je.captureTimer)}function ie(n){if(Jt){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{p(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function ce(n,t=1){return(n%t+t)%t}function z(n,t=0,e=1){return ne?e:n}function Ut(n,t,e){return(e-=t)?z((n-t)/e):0}function $t(n,t,e){return n+z(e)*(t-n)}function Nl(n,t,e,s,i){return $t(s,i,Ut(n,t,e))}function nr(n,t,e=1){p(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ja(n,t,e,s=1){return n+z(e)*nr(t,n,s)}function zl(n,t){return nr(n,t,2*Q)}function Jl(n,t,e){return Ja(n,t,e,2*Q)}function Xs(n){return n*n*(3-2*n)}function ls(n){return!(n&n-1)}function Ul(n){return 2**cs(Na(n))}function Ys(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,a=t.x+s.x,r=t.y+s.y;return ot(i)f)return!1;h=tt(y,h)}else{if(y0?r.x+1:r.x,x=h>0?r.y+1:r.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,E=w,A=fr.x&&(T.x=r.x+1-P),F.yr.y&&(T.y=r.y+1-P),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;p(q(n),"shareURL requires title string"),p(q(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){p(q(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{Et("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{Et("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){p(q(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{Et("writeSaveData: failed to write",n)}}function po(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=Pt(n);return $t(po(t),po(t+1),Xs(n-t))}function tu(n,t){let e=Pt(n),s=Pt(t),i=Xs(n-e),o=Xs(t-s),a=(r,c)=>po(r+c*374761393);return $t($t(a(e,s),a(e+1,s),i),$t(a(e,s+1),a(e+1,s+1),i),o)}function eu(n){Mt=n.copy()}function nu(n){nt=n}function su(n){K=n}function iu(n){rr=n}function ou(n){Ei=n}function ru(n){sn=n.copy()}function au(n){Mn=n.copy()}function cu(n){ss=n}function lu(n){In=n}function uu(n){kn=n.copy()}function ec(n){ar=n,N&&(N.style.imageRendering=n?"pixelated":""),it&&(it.style.imageRendering=n?"pixelated":"")}function hu(n){Tn=n}function du(n){on=n}function fu(n){Es=n}function pu(n){cr=n}function gu(n){U=n}function yu(n){if(n&&!wo){console.warn("Can not enable WebGL if it was disabled on start.");return}j=n,it&&(it.style.display=n?"":"none")}function mu(n){_s=n}function bu(n){_i=n.copy()}function xu(n){Ri=n}function vu(n){Pi=n}function Su(n){Li=n}function wu(n){lr=n}function Tu(n){ur=n}function Au(n){hr=n}function Cu(n){dr=n}function Eu(n){fr=n}function _u(n){Ne=n}function Ru(n){Yt=n.copy()}function Pu(n){$s=n}function Lu(n){Oi=n}function Ou(n){pr=n}function Du(n){is=n}function Mu(n){yn=n}function Iu(n){un=n}function ku(n){gr=n}function Gu(n){be=n}function Fu(n){Xn=n,n>0&&($n=!1)}function ju(n){_n=n,n&&(Yn=0)}function Bu(n){Yn=n,n>0&&(_n=!1)}function Nu(n){$n=n,n&&(Xn=0)}function zu(n){Rs=n}function Ju(n){dn=n}function Uu(n){Kt=n}function Vu(n){yr=n}function Wu(n){os=n}function qu(n){Ks=n}function Hu(n){Ps=n}function Xu(n){Qt=n}function Yu(n){Sn=n,Qt&&!U&&We&&(We.gain.value=n)}function $u(n){mr=n}function Ku(n){br=n}function Qu(n){Ci=n}function Zu(n){ka=n}function Qs(n){return n.r>=1&&n.g>=1&&n.b>=1}function xr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Ls(n=0,t=_i,e=0,s=Ri,i=Pi){if(p(O(n)||typeof n=="number","index must be a vec2 or number"),p(O(t)||typeof t=="number","size must be a vec2 or number"),p(R(e)||e instanceof He,"texture must be a number or TextureInfo"),p(R(s),"padding must be a number"),U)return new De;typeof t=="number"&&(p(t>0),t=new ut(t,t));let o=typeof e=="number"?hn[e]:e;p(o instanceof He,"tile texture is not loaded"),p(o.size.x>0,"tile texture is not loaded");let a=t.x+s*2,r=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/a|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new ut(c*a+s,l*r+s);return new De(u,t,o,s,i)}function jt(n,t=b(1),e,s=H,i=0,o,a,r=j,c=!1,l){var f;p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!a||W(a),"additiveColor must be a color"),p(!l||!r,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(f=e==null?void 0:e.bleed)!=null?f:0;if(r&&j)if(p(!!g,"WebGL is not enabled!"),c&&([n,t,i]=Ds(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(kr(u.glTexture),h){let _=d.x*h,S=d.y*h;Ss(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),a&&a.rgbaInt())}else Ss(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),a&&a.rgbaInt())}else{let d=a?s.add(a):s;wc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++Le,++Oe,Rn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,a,h)}else{let y=a?s.add(a):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function Zs(n,t,e,s,i,o,a){jt(n,t,void 0,e,s,!1,void 0,i,o,a)}function th(n,t,e=H,s=ln,i=0,o=j,a=!1,r){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!r||!o,"context only supported in canvas 2D mode"),o&&j){p(!!g,"WebGL is not enabled!"),a&&(n=Os(n),t=t.scale(1/K),i+=nt);let c=[],l=[],u=t.x/2,h=t.y/2,f=e.rgbaInt(),d=s.rgbaInt(),y=ht(-i),x=rt(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,E=w*x+_*y,A=v&2?f:d;c.push(b(n.x+S,n.y+E)),l.push(A)}Nr(c,l)}else++Le,++Oe,Rn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},a,r)}function eh(n,t,e,s=0,i=H,o=0,a,r=j,c=!1,l){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(O(e),"wrapCount must be a vec2"),p(W(i),"color is invalid"),p(R(o),"angle must be a number"),p(!a||W(a),"additiveColor must be a color"),p(!l||!r,"context only supported in canvas 2D mode"),p(!(s instanceof De),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),U)return;let u=typeof s=="number"?hn[s]:s;if(p(u instanceof He,"texture not loaded"),p(u.size.x>0,"texture not loaded"),p(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),r&&j){p(!!g,"WebGL is not enabled!"),c&&([n,t,o]=Ds(n,t,o)),kr(u.glTexture),Ss(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),a&&a.rgbaInt());return}++Le,++Oe,c||(n=Pn(n),t=t.scale(K),o-=nt);let h=!Ei||(a?Qs(i.add(a))&&a.a<=0:Qs(i)),f=!h&&a&&!xr(a),d=h?u.image:ch(u.image,i,a);l=l||Ot,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=f?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function go(n,t=.1,e=H,s=!1,i=b(),o=0,a=j,r=!1,c){if(p(me(n),"points must be an array"),p(R(t),"width must be a number"),p(W(e),"color is invalid"),p(O(i),"pos must be a vec2"),p(R(o),"angle must be a number"),p(!c||!a,"context only supported in canvas 2D mode"),a&&j){p(!!g,"WebGL is not enabled!");let l=b(1);r&&([i,l,o]=Ds(i,l,o)),Br(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++Le,++Oe,Rn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&Br(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Rn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},r,c)}function sc(n,t=b(1),e=H,s=0,i=0,o=at,a=j,r=!1,c){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(o),"color is invalid"),p(R(s),"angle must be a number"),p(R(i),"lineWidth must be a number"),p(i>=0,"lineWidth must be a positive value or 0"),p(!c||!a,"context only supported in canvas 2D mode"),i=z(i,0,st(t.x,t.y)),a&&j?nc(n,t,_s,e,i,o,s,a,r,c):Rn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},r,c)}function ti(n,t=1,e=H,s=0,i=at,o=j,a=!1,r){p(R(t),"size must be a number"),sc(n,b(t),e,0,s,i,o,a,r)}function ic(n,t=b(1),e=H,s=ln,i=0,o=j,a=!1,r){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(W(e)&&W(s),"color is invalid"),p(R(i),"angle must be a number"),p(!r||!o,"context only supported in canvas 2D mode"),!U)if(o&&j){p(!!g,"WebGL is not enabled!"),a&&(n=Os(n),t=t.scale(1/K),i+=nt);let c=_s,l=t.x/2,u=t.y/2,h=e.rgbaInt(),f=s.rgbaInt(),d=nh++,y=ht(-i),x=rt(-i),v=E=>{let A=rt(E)*l,T=ht(E)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*Q*2,_=[v(w)],S=[f];for(let E=c;E--;){let A=(E+d)%c/c*Q*2;_.push(n),S.push(h),_.push(v(A)),S.push(f)}Nr(_,S)}else++Le,++Oe,Rn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},a,r)}function sh(n,t=1,e=H,s=ln,i=j,o=!1,a){p(R(t),"size must be a number"),ic(n,b(t),e,s,0,i,o,a)}function Rn(n,t,e=0,s=!1,i,o=!1,a=Ot){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(R(e),"angle must be a number"),p(typeof i=="function","drawFunction must be a function"),o||(n=Pn(n),t=t.scale(K),e-=nt),a.save(),a.translate(n.x+.5,n.y+.5),a.rotate(e),a.scale(s?-t.x:t.x,-t.y),i(a),a.restore()}function ih(n,t,e=1,s=H,i=0,o=at,a="center",r=Es,c="",l,u=0,h=Ot){t=Pn(t),e*=K,i*=K,u-=nt,u*=-1,rn(n,t,e,s,i,o,a,r,c,l,u,h)}function rn(n,t,e,s=H,i=0,o=at,a="center",r=Es,c="",l,u=0,h=Ot){p(q(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(R(e),"size must be a number"),p(W(s),"color must be a color"),p(R(i),"lineWidth must be a number"),p(W(o),"lineColor must be a color"),p(["left","center","right"].includes(a),"align must be left, center, or right"),p(q(r),"font must be a string"),p(q(c),"fontStyle must be a string"),p(R(u),"angle must be a number");let f=(n+"").split(`
+`),d=t.y-(f.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=a,h.font=c+" "+e+"px "+r,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;f.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function wa(n,t){p(R(n),"textureIndex must be a number"),p(!hn[n],"textureIndex is already loaded!"),p(!t||q(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),hn[n]=new He(e)}function Os(n){p(O(n),"screenPos must be a vec2");let t=(n.x-k.x/2+.5)/K,e=(n.y-k.y/2+.5)/-K;if(nt){let s=ht(-nt),i=rt(-nt),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ut(t+Mt.x,e+Mt.y)}function Pn(n){p(O(n),"worldPos must be a vec2");let t=n.x-Mt.x,e=n.y-Mt.y;if(nt){let s=ht(nt),i=rt(nt),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ut(t*K+k.x/2-.5,e*-K+k.y/2-.5)}function oc(n){p(O(n),"screenDelta must be a vec2");let t=n.x/K,e=n.y/-K;if(nt){let s=ht(-nt),i=rt(-nt),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ut(t,e)}function oh(n){p(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(nt){let s=ht(nt),i=rt(nt),o=t*s-e*i,a=t*i+e*s;t=o,e=a}return new ut(t*K,e*-K)}function Ds(n,t,e=0){return p(O(n),"screenPos must be a vec2"),p(O(t),"screenSize must be a vec2"),p(R(e),"screenAngle must be a number"),[Os(n),t.scale(1/K),e+nt]}function rc(){return k.scale(1/K)}function rh(n,t,e,s){p(O(n),"center must be a vec2"),p(O(t),"size must be a vec2");let i=f(e),o=f(s),a=t.x+i.left+i.right,r=t.y+i.top+i.bottom,c=k.x-o.left-o.right,l=k.y-o.top-o.bottom;if(!(a>0&&r>0&&c>0&&l>0))return K;K=st(c/a,l/r);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/K);return Mt=n.add(u).add(h),K;function f(d){return(d===void 0||R(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(p(O(n),"pos must be a vec2"),p(O(t)||R(t),"size must be a vec2 or number"),!K)return!1;let e=n.x-Mt.x,s=n.y-Mt.y;if(nt){let a=ht(nt),r=rt(nt),c=e*a-s*r,l=e*r+s*a;e=c,s=l}e*=K*2,s*=-K*2,t instanceof ut&&(t=t.length()),t*=K;let i=k.x,o=k.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=r,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new He(n),a=new De(t,e,o,s,i);cc=new ei(a)}function fh(n=!0){Gn=n}function ph(n){Tr=n}function gh(){return en==="mouse"}function yh(){return en==="keyboard"}function mh(){return en==="gamepad"}function Ar(n,t=0,e=!0,s=!0,i=!0){Z[t]&&(Z[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function Ms(){Z.length=0,Z[0]=[],ue.length=0,An.length=0,Is.length=0,Ae.length=0,pn.length=0}function Ft(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&1)}function Nt(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&2)}function Cr(n,t=0){var e;return p(q(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Z[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){p(q(n),"up key must be a string"),p(q(t),"down key must be a string"),p(q(e),"left key must be a string"),p(q(s),"right key must be a string");let i=o=>Ft(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function rs(n){return p(R(n),"mouse button must be a number"),Ft(n)}function ds(n){return p(R(n),"mouse button must be a number"),Nt(n)}function xh(n){return p(R(n),"mouse button must be a number"),Cr(n)}function Ge(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Ft(n,t+1)}function Er(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Nt(n,t+1)}function vh(n,t=At){return p(R(n),"button must be a number"),p(R(t),"gamepad must be a number"),Cr(n,t+1)}function fs(n,t=At){var e,s;return p(R(n),"stick must be a number"),p(R(t),"gamepad must be a number"),(s=(e=Ae[t])==null?void 0:e[n])!=null?s:b()}function yo(n=At){var t;return p(R(n),"gamepad must be a number"),(t=pn[n])!=null?t:b()}function mo(n=At){return p(R(n),"gamepad must be a number"),!!Z[n+1]}function lc(n=At){var t,e;return p(R(n),"gamepad must be a number"),(e=(t=Ae[n])==null?void 0:t.length)!=null?e:0}function Sh(n=At,t=200,e=1,s=1,i=0){var a,r,c;if(p(R(n),"gamepad must be a number"),!Ps||U)return;let o=(a=navigator==null?void 0:navigator.getGamepads)==null?void 0:a.call(navigator)[n];(c=(r=o==null?void 0:o.vibrationActuator)==null?void 0:r.playEffect)==null||c.call(r,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=At){var e,s,i;if(p(R(n),"gamepad must be a number"),!Ps||U)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function _r(n=100){var t;p(R(n)||me(n),"pattern must be a number or array"),Ps&&!U&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){_r(0)}function Ah(){var n;!le&&((n=N.requestPointerLock)==null||n.call(N))}function Ch(){var n;(n=document.exitPointerLock)==null||n.call(document)}function uc(){return document.pointerLockElement===N}function Eh(){if(U)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",a),document.addEventListener("wheel",r,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),le&&yn&&u();function n(f){if(f.repeat||(Z[0][f.code]=3,is&&(Z[0][e(f.code)]=3)),!Gn||!f.cancelable||!document.hasFocus()||f.ctrlKey||f.metaKey||f.altKey||x(f.target)||x(document.activeElement))return;let d=typeof f.key=="string"&&f.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(f.code)||d)&&f.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(f){Z[0][f.code]=Z[0][f.code]&2|4,is&&(Z[0][e(f.code)]=4)}function e(f){return is?f==="KeyW"?"ArrowUp":f==="KeyS"?"ArrowDown":f==="KeyA"?"ArrowLeft":f==="KeyD"?"ArrowRight":f:f}function s(f){if(le&&yn)return;Qt&&!U&&mt&&!gs()&&mt.resume(),Z[0][f.button]=3;let d=Ht;Ht=h(b(f.x,f.y)),Te=Te.add(Ht.subtract(d)),Gn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function i(f){le&&yn||(Z[0][f.button]=Z[0][f.button]&2|4)}function o(f){ni=!0;let d=Ht;Ht=h(b(f.x,f.y));let y=uc()?b(f.movementX,f.movementY):Ht.subtract(d);Te=Te.add(y)}function a(){ni=!1}function r(f){f.ctrlKey||(wr+=ae(f.deltaY)),Gn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function c(f){f.preventDefault()}function l(){Ms(),Je.clear(),ue.length=0,An.length=0,Is.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let f;function d(y){if(yn){if(Qt&&!U&&mt&&!gs()&&mt.resume(),!un||gr){let x=S=>ps.includes(S.target)||S.target===gn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),E=Ht;Ht=h(S),f?Te=Te.add(Ht.subtract(E)):Z[0][_]=3}else f&&(Z[0][_]=Z[0][_]&2|4);f=w}return Gn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(f){let d=N.getBoundingClientRect(),y=Ut(f.x,d.left,d.right),x=Ut(f.y,d.top,d.bottom);return b(y*N.width,x*N.height)}}function Aa(){if(U)return;!(yn&&le)&&!document.hasFocus()&&Ms(),ke=Os(Ht),Sr=oc(Te),Rh(),t(),n();function n(){let e=rs(0)||rs(1)||rs(2)||Te.length()>Tr,s=!1;for(let o=lc();o--&&!s;)s=fs(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=Ge(o);let i=!1;for(let o in Z[0])if(isNaN(+o)&&Z[0][o]&1){i=!0;break}s?en="gamepad":e?en="mouse":i&&(en="keyboard"),jn=en==="gamepad"}function t(){var a,r,c,l,u,h,f;let e=d=>{let v=w=>w>.3?Ut(w,.3,.8):w<-.3?-Ut(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(un&&le){if(p(!_n||!Yn,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),p(!$n||!Xn,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Un.isSet())return;At=0;let d=(a=Ae[0])!=null?a:Ae[0]=[],y=(r=pn[0])!=null?r:pn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!Xe(v))continue;let w=Lr(v);d[w]=b();let _=(c=An[v])!=null?c:b();if(Rs)d[w]=e(_);else if(_.lengthSquared()>.3){let S=z(Hs(_.x),-1,1),E=z(Hs(_.y),-1,1);d[w]=b(S,-E).clampLength(),w||y.set(S,-E)}}let x=(l=Z[1])!=null?l:Z[1]=[];for(let v=12;v--;){let w=Ge(v,0);x[v]=ue[v]?w?1:3:w?4:0,Ks&&x[v]===3&&(v===9||Ph(v))&&_r(Ks)}return}try{if(!Oi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!Jt&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=st(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let E=y.buttons[S],A=Ge(S,d);x[S]=E.pressed?A?1:3:A?4:0,E.pressed&&(!E.value||E.value>.9)&&(_=!0)}_&&(ro[d]=!0,ro[At]||(At=d)),y.mapping==="standard"&&w.set((Ge(15,d)&&1)-(Ge(14,d)&&1),(Ge(12,d)&&1)-(Ge(13,d)&&1)),pr&&(w.x||w.y)&&(v[0]=w.clampLength())}un&&jn&&Un.unset()}}function Ca(){if(!U){for(let n of Z)for(let t in n)n[t]&=1;wr=0,Sr=b(),Te=b()}}function _h(){Mh()}function Rh(){if(Qe||!un||!le||U||!document.body)return;let n=Qe=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=hc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Rr=document.createElementNS(ii,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>Ea(o)),i.addEventListener("pointercancel",o=>Ea(o)),t.appendChild(i),i};ps[0]=s(),ps[1]=s(),gn=s(),addEventListener("resize",()=>Vn=!0),document.body.appendChild(n),Vn=!0}function Di(){return hc.getBoundingClientRect()}function Xe(n){return n?$n:_n}function Ln(n){return n?Xn:Yn}function Pr(n){return n?0:4}function Lr(n){return n&&_n?1:0}function Wn(n){return Xe(n)||Ln(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Pr(t);if(!Xe(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+a;if(Re){for(let o of ps)o.style.display="none";be?(i(gn,"inset:0"),gn.style.display=""):gn.style.display="none"}else{for(let a=0;a<2;a++){let r=ps[a],c=a?"right":"left";if(r.style.display=Wn(a)?"":"none",dn){let l=Wn(a?0:1)?"50%":"100%";i(r,`${c}:0;bottom:0;width:${l};height:60%`)}else i(r,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}gn.style.display=be?"":"none";let o=be;i(gn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),Vn=!1}function Oh(n,t){let e=Rr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=dc={face:[],thumb:[]},i=Kt,o=(r,c,l,u)=>{let h=document.createElementNS(ii,"circle");return h.setAttribute("cx",r),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},a=r=>{let c=i*.18,l=i*.5,u=r.x,h=r.y,f=document.createElementNS(ii,"path");f.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(f)};for(let r=0;r<2;r++){let c=Ln(r),l=Pr(r),u=Ve(r,n,t);if(Xe(r))Rs?o(u.x,u.y,i/2):a(u),s.thumb[r]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?f:st(f,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(f,i/2);c===2&&(y.x*=-1),r||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}Jt&&vn&&Dh(n,t)}function Dh(n,t){let e=Kt,s=Rr,i=(a,r,c)=>{let l=document.createElementNS(ii,a);for(let u in r)l.setAttribute(u,r[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(a,r,c)=>i("circle",{cx:a.x,cy:a.y,r},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let a=0;a<2;a++)if(Xe(a))if(dn){let r=t*.4,c=!Wn(a?0:1),l=c?0:a?n/2:0;i("rect",{x:l,y:r,width:c?n:n/2,height:t-r},"#0ff")}else o(Ve(a,n,t),2*e,"#0ff");else Ln(a)>=1&&o(Ve(a,n,t),e,"#0ff");if(be){o(b(n/2,t/2),be,"#ff0");for(let a=0;a<2;a++)Wn(a)&&o(Ve(a,n,t),2*e,"#f0f")}}function Mh(){var l;if(!Qe||U)return;if(!un||!le){Qe.style.display!=="none"&&(Qe.style.display="none",Je.clear(),ue.length=0,An.length=0,Is.length=0);return}Qe.style.display="";let n=Jt&&vn,t=[Xn,Yn,_n,$n,Rs,Kt,dn,be,Re,n].join();t!==Ta&&(Ta=t,Vn=!0),Vn&&Lh();let e=os?Ut(Un.get(),os+1,os):1,s=n||Un.isSet()&&e>0&&!Re;if(Qe.style.opacity=s?n?1:e*yr:0,!s)return;let i=Di(),o=i.width,a=i.height,r=Kt,c=dc;if(c){for(let u=0;u<2;u++)if(Xe(u)&&c.thumb[u]){let f=Ve(u,o,a).add(((l=An[u])!=null?l:b()).scale(r/2));c.thumb[u].setAttribute("cx",f.x),c.thumb[u].setAttribute("cy",f.y)}for(let u=0;u=Kt)return-1;if(i===1)return o;let r=a.subtract(t);n||(r.x*=-1);let c=i===2?r.xo:r&&Ve(a,t,e).distance(n)<2*s)return{role:"stick",side:a}}else if(Ln(a)>=1){let c=kh(a,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(be){for(let a=0;a<2;a++)if(Wn(a)&&Ve(a,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),f.buffer=h,f.playbackRate.value=e,f.loop=i,a=a||mt.createGain(),a.gain.value=t,a.connect(We);let d=new StereoPannerNode(mt,{pan:z(s,-1,1)});f.connect(d).connect(a),f.addEventListener("ended",()=>{a.disconnect(),d.disconnect(),c&&c(f)});let y=r*e;return f.start(0,y),Jt&&zn&&Et("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),f}function Jh(...n){return Or([Mi(...n)])}function Mi(n=1,t=.05,e=220,s=0,i=0,o=.1,a=0,r=1,c=0,l=0,u=0,h=0,f=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,E=0){let A=Kn,T=Q*2,P=c*=500*T/A/A,F=e*=(1+yt(t,-t))*T/A,bt=0,ct=0,gt=0,wt=1,Vt,L=[],I=0,M=0,B=0,et,dt=2,xt=T*ot(E)*2/A,ft=ht(xt),vt=rt(xt)/2/dt,Tt=1+vt,de=-2*ft/Tt,Me=(1-vt)/Tt,G=(1+ae(E)*ft)/2/Tt,J=-(ae(E)+ft)/Tt,Rt=G,Ie=0,X=0,Y=0,kt=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,f=f*A|0,Vt=s+_+i+o+v|0;M1?a>2?a>3?a>4?I/T%14?B:ae(B)*ot(B)**r)*(MM?0:(Mh&&(e+=u,F+=u,wt=0),f&&!(++ct%f)&&(e=F,c=P,wt||(wt=1));return L}function ri(n,t=!0){for(let e of an)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function Ze(n,t=b(),e,s=!0){for(let i of an)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function gc(n,t,e,s,i=!0){let o,a,r,c=s&&b();for(let l of an)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{j=!1,it.style.display="none",e.preventDefault(),Et("WebGL context lost! Switching to Canvas2d rendering.");for(let s of as)s.glTexture=void 0;se=void 0,Dt=0,Cn=!1,bn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),it.addEventListener("webglcontextrestored",()=>{j=!0,it.style.display="",Et("WebGL context restored, reinitializing..."),t();for(let e of as)e.glTexture=ki(e.image,e.wrap);bn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){li=Hn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 g;in vec4 p,u,c,a;in float r;out vec2 v;out vec4 d,e;void main(){vec2 s=(g-.5)*p.zw;gl_Position=m*vec4(p.xy+s*cos(r)-vec2(-s.y,s)*sin(r),1,1);v=mix(u.xw,u.zy,g);d=c;e=a;}`,`#version 300 es
 precision highp float;uniform sampler2D s;in vec2 v;in vec4 d,e;out vec4 c;void main(){c=texture(s,v)*d+e;}`),ui=Hn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 p;in vec4 c;out vec4 d;void main(){gl_Position=m*vec4(p,1,1);d=c;}`,`#version 300 es
-precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(di);Nt=new Float32Array(e),xs=new Uint32Array(e),xo=g.createBuffer(),Bn=g.createBuffer(),Mr=g.createFramebuffer(),Dt=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,Bn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,a,r=(c,l,u,h,f=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&a;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,f),i+=h*u};vo=g.createVertexArray(),g.bindVertexArray(vo),i=0,o=li,a=yc,g.bindBuffer(g.ARRAY_BUFFER,Bn),r("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,xo),g.bufferData(g.ARRAY_BUFFER,di,g.DYNAMIC_DRAW),r("p",g.FLOAT,4,4,1),r("u",g.FLOAT,4,4,1),r("c",g.UNSIGNED_BYTE,1,4,1),r("a",g.UNSIGNED_BYTE,1,4,1),r("r",g.FLOAT,4,1,1),So=g.createVertexArray(),g.bindVertexArray(So),i=0,o=ui,a=mc,r("p",g.FLOAT,4,2),r("c",g.UNSIGNED_BYTE,1,4)}}function vs(n=!1){!n&&!Cn||(It(),Cn=!1,g.useProgram(li),g.bindVertexArray(vo))}function bc(){Cn||(It(),Cn=!0,g.useProgram(ui),g.bindVertexArray(So))}function To(n=!0){if(!j||!g)return;p(!Dt,"glPreRender called with unflushed batch."),hi||(it.width=k.x,it.height=k.y),g.viewport(0,0,k.x,k.y),n&&xc();let t=b(2*K).divide(k);hi&&(t.y=-t.y);let e=Mt.rotate(-et),s=b(-1).subtract(e.multiply(t)),i=ut(et),o=rt(et),a=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],r=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};r(ui,"m",a),r(li,"m",a),g.activeTexture(g.TEXTURE0),hn[0]&&(ne=hn[0].glTexture,g.bindTexture(g.TEXTURE_2D,ne)),g.bindBuffer(g.ARRAY_BUFFER,xo),On=qn=!1,vs(!0)}function xc(){if(!g)return;let n=sn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function kr(n){!g||n===ne||(It(),ne=n,g.bindTexture(g.TEXTURE_2D,ne))}function vc(n,t=!0){if(!g||!n)return;let e=n===ne;e?It():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&ne&&g.bindTexture(g.TEXTURE_2D,ne)}function Ao(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),zt&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Hn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Ao(n,g.VERTEX_SHADER)),g.attachShader(e,Ao(t,g.FRAGMENT_SHADER)),g.linkProgram(e),zt&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ki(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)Gr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!Tn&&ls(n.width)&&ls(n.height);else{let r=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,r)}let i=Tn?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let a=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,a),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,a),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,ne),e}function Sc(n){g&&g.deleteTexture(n)}function Gr(n,t){g&&(p((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!Tn&&ls(t.width)&&ls(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,ne))}function Hh(n){U||(as.add(n),g&&(n.glTexture?Gr(n.glTexture,n.image):n.glTexture=ki(n.image,n.wrap)))}function Xh(n){if(U)return;as.delete(n);let t=n.glTexture;n.glTexture=void 0,Sc(t)}function It(){if(j&&g&&Dt){let n=qn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=Dt*(Cn?Ii:Ir);g.bufferSubData(g.ARRAY_BUFFER,0,Nt,0,t),Cn?g.drawArrays(g.TRIANGLE_STRIP,0,Dt):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,Dt),++Le,Oe+=Dt,Dt=0}qn=On}function Fr(n){!j||!g||(It(),n.drawImage(it,0,0))}function Yh(n=!0){p(!it,"must be called before engineInit"),Dr=n}function Ss(n,t,e,s,i=0,o=0,a=0,r=1,c=1,l=-1,u=0){(Dt>=Wh||qn!==On)&&It(),vs();let h=Dt++*Ir;Nt[h++]=n,Nt[h++]=t,Nt[h++]=e,Nt[h++]=s,Nt[h++]=o,Nt[h++]=a,Nt[h++]=r,Nt[h++]=c,xs[h++]=l,xs[h++]=u,Nt[h++]=i}function wc(n,t,e,s,i,o){Ss(n,t,e,s,i,0,0,0,0,0,o)}function jr(n,t,e,s,i,o,a,r=!0){let c=[],l=rt(-a),u=ut(-a);for(let f of n){let d=f.x*i,y=f.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=r?Kh(c):c;Tc(h,t)}function Br(n,t,e,s,i,o,a,r,c=!0){let l=$h(n,e,c);jr(l,t,s,i,o,a,r,!1)}function Tc(n,t){if(!j||n.length<3)return;let e=n.length+2;if((Dt+e>=Nn||qn!==On)&&It(),p(e=Nn)return;bc();let s=Dt*Ii;for(let i=e;i--;){let o=z(i-1,0,e-3),a=n[o];Nt[s++]=a.x,Nt[s++]=a.y,xs[s++]=t}Dt+=e}function Nr(n,t){if(!j||n.length<3)return;let e=n.length+2;if((Dt+e>=Nn||qn!==On)&&It(),p(e=Nn)return;bc();let s=Dt*Ii;for(let i=e;i--;){let o=z(i-1,0,e-3),a=n[o],r=t[o];Nt[s++]=a.x,Nt[s++]=a.y,xs[s++]=r}Dt+=e}function ns(n,t=!1){n?(hi=n,g.bindFramebuffer(g.FRAMEBUFFER,Mr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),To(t)):(It(),hi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,k.x,k.y))}function Ac(n,t,e,s){j&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,a=1e-6,r=10;for(let c=0;ca?-d/y:0,S=y>a?f/y:0,E=w>a?-v/w:0,A=w>a?x/w:0,T=_+E,P=S+A,F=(T*T+P*P)**.5;if(Fa){let wt=st(1/gt,r);T*=wt,P*=wt}}let bt=b(u.x-T*s,u.y-P*s),ct=b(u.x+T*s,u.y+P*s);i.push(bt),i.push(ct)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),E=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(E&&A)},o=[];for(let d=0;d3&&r++{if(E>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(E,2)),T.addColorStop(1,h(E,1))}else s.fillStyle="#000";E>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,E=2*Q,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*E),r(v,w-_,v,w+_,A,T)},l=(v,w,_,S,E)=>{s.beginPath(),s.rect(v,w,_,S*d),r(v,w+S,v+_,w,E)},u=(v,w,_,S)=>{s.beginPath();for(let E of v)s.lineTo(E.x,E.y);s.closePath(),r(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",f=Va(1,1,n),d=Jt(f,.1,.5),y=st(6,st(o,a)/99);s.translate(o/2,a/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[E],P,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*Q,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,Q/2,Q*3/2),c(35,30,10,Q/2,Q*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*Q,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,E=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(E,0,40,14)}s.restore()}function Zh(n){if(gi=n,!fn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Gi(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Jr()}En(void 0,t);function t(){if(!Us.length)return;let e=Us[0],s=cn-Js;if(!Js)Js=cn;else if(s>fi)Js=0,Us.shift();else{let i=fi-Fn,o=si?(s-i)/Fn:0;e.render(o)}}}function Gi(n){Object.values(ws).forEach(t=>n(t))}function td(){Gi(n=>n.unlocked=!1),Jr()}function Jr(){if(!gi)return;let n={};Gi(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[gi]=JSON.stringify(n)}function ed(n){fi=n}function nd(n){Fn=n}function sd(n){pi=n.copy()}function id(n){zr=n}function Cc(n,t,e,s=125){let i,o,a,r,c,l,u,h,f,d,y,x,v,w=0,_,S=[],E=[],A=[],T=0,P=0,F=1,bt={},ct=Kn/s*60>>2;for(;F;T++)S=[F=h=x=0],e.forEach((gt,wt)=>{for(u=t[gt][T]||[0,0,0],F|=t[gt][T]&&1,_=x+(t[gt][0].length-2-(h?0:1))*ct,v=wt===e.length-1,i=2,a=x;ict-99&&f&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,E[a]=(E[a]||0)-l*P+l,A[a]=(A[a++]||0)+l*P+l;c&&(y=c%1,P=u[1]||0,(c|=0)&&(S=bt[[d=u[w=0]||0,c]]=bt[[d,c]]||(r=[...n[d]],r[2]=(r[2]||220)*2**(c/12-1),c>0?Mi(...r):[])))}x=_});return[E,A]}function od(n){Ur=typeof n=="boolean"?n?1:0:n}function rd(n){Vr=n}async function ad(){return new Si(await Box2D()),e(),En(n,t),m;function n(){if(!Re){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(Vr||ge)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new Lt(l.get_r(),l.get_g(),l.get_b()),a=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),r=l=>a(l).scale(1,.8),c=(l,u)=>{let h=[];for(let f=u;f--;)h.push(m.vec2FromPointer(l+f*8));return h};i.DrawSegment=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),mn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=r(h);let f=c(l,u);Jn(f,ln,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=r(h);let f=c(l,u);Jn(f,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),ti(l,u*2,ln,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,f){f=r(f),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),ti(l,u*2,f,.1,f,!1),mn(b(),h,.1,f,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),f=b(1,0),d=V(.75,0,0,.8),y=b(0,1),x=V(0,.75,0,.8);mn(b(),f,.1,d,u,h,!1),mn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){Ec(n,t,e,H,s,at,i,o,!1,!0)}function Ec(n,t,e,s,i=1,o,a=.05,r=0,c=j,l,u){let h=e.offset(e.size),f=t.add(b(a-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-r:r;Ft(n,f,h,s,r,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),E=b(_?i:f.x,_?f.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));Ft(n.add(S.rotate(v)),E,A,s,r,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,E=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));Ft(n.add(E.rotate(v)),d,A,s,r,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){_c(n,t,e,H,s,at,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,a=.05,r=0,c=j,l,u){let h=e.frame(0),f=e.frame(1),d=e.frame(2),y=t.add(b(a-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-r:r;Ft(n,y,d,s,r,!1,o,c,l,u);for(let S=4;S--;){let E=r+S*Q/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),P=b(A?y.y:y.x,i);Ft(n.add(T.rotate(_)),P,f,s,E,!1,o,c,l,u)}for(let S=4;S--;){let E=r+S*Q/2,A=!S||S>2,T=S>1,P=v.multiply(b(A?-1:1,T?-w:w));Ft(n.add(P.rotate(_)),x,h,s,E,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=H,i=0,o=!1,a=0,r=at,c=j,l=!1,u){let h=Rc(b(),t,e,0,o);Jn(h,s,a,r,n,i,c,l,u)}function Rc(n,t=1,e=0,s=0,i=!1,o=_s){p(O(n),"pos must be a vec2"),p(R(t)&&R(e),"size and percent must be numbers");let a=ce(e*4,4);a>=2&&(s+=Q),a=a<=2?a-1:3-a,i&&(a=-a,s+=Q);let r=[],c=tt(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*Q;r.push(b(l*ut(h),l*rt(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*Q;r.push(b(l*ut(h),-l*a*rt(h)).rotate(s).add(n))}return r}function Pa(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){p(n!=null&&typeof n=="object","tweenProperty target must be an object"),p(q(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let a=t.split("."),r=a.pop(),c=l=>{let u=n;for(let h of a)u=u[h];u[r]=l};return new wi(c,e,s,i,o)}function Pc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Pc(n),te.push(n),n.callback(n.interp(n.duration)))}function Lc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Lc(n),te.push(n),n.callback(n.interp(n.duration))}function Oc(n,t){n===void 0?(n=ee-_a,t=cn-Ra,_a=ee,Ra=cn):t===void 0&&(t=n);for(let e=te.length;e--;){let s=te[e];if(s.paused)continue;let i=s.useRealTime?t:n;if(!(i<=0))if(s.life-=i,s.life>0)s.callback(s.interp(s.life));else{s.callback(s.interp(0)),te.splice(e,1);let o=s.thenCallback;s.thenCallback=void 0,o&&o()}}}function dd(){for(let n of te)n.thenCallback=void 0;te.length=0}var Vs,Ws,El,Qo,_t,Zo,La,ee,cn,Re,oo,we,qs,Oa,bn,co,zt,Ia,Ci,ka,Fe,nn,ge,ye,xn,vn,zn,lo,je,pe,Q,ot,Pt,cs,Hs,st,tt,ae,Ba,Na,rt,ut,za,er,fo,lt,Lt,H,ln,at,xe,Vl,ir,Wl,$a,Ka,ql,Qa,Za,Hl,Pe,Mt,et,K,rr,Ei,sn,Mn,ss,In,kn,ar,Tn,on,Es,cr,U,j,_s,_i,Ri,Pi,Li,lr,ur,hr,dr,fr,Ne,Xt,$s,Oi,pr,is,yn,un,gr,be,Xn,_n,Yn,$n,Rs,dn,$t,yr,os,Ks,Ps,Kt,Sn,mr,br,qe,N,pt,Ot,Ue,tn,Ce,ze,k,hn,Le,Oe,De,He,nh,cc,ei,ke,qt,Sr,Te,wr,ni,jn,en,Tr,Gn,At,le,Z,Ae,pn,ro,Un,ue,An,si,Is,Je,Qe,hc,Rr,dc,ps,gn,Vn,Ta,ii,mt,We,Kn,ys,oi,an,wn,ai,ms,bs,bo,Vh,ci,it,g,Dr,li,ui,Cn,On,qn,ne,xo,Bn,Nt,xs,Dt,as,vo,So,Mr,hi,wo,di,Ir,yc,Wh,Ii,mc,Nn,fn,fi,Fn,pi,zr,ws,Us,gi,Js,yi,Ts,Co,Eo,jt,_o,$,Ro,Po,Lo,C,Ur,Oo,he,mi,Do,Mo,As,Io,ko,Go,Fo,m,Vr,Cs,bi,jo,Bo,xi,Qt,No,vi,zo,Jo,Uo,Vo,Wo,qo,Ho,Xo,Yo,$o,Si,te,_a,Ra,wi,Ti,fd,ao,Ai,Ko,Mc=jc(()=>{"use strict";Vs="LittleJS",Ws="1.18.19",El=60,Qo=.016666666666666666,_t=[],Zo=[],La=0,ee=0,cn=0,Re=!1;oo=0,we=0,qs=0,Oa=!0,bn=[],co=class{constructor(t,e,s,i){this.update=t,this.render=e,this.glContextLost=s,this.glContextRestored=i}};zt=!0,Ia=.5,Ci=!0,ka="Escape",Fe=!1,nn=[],ge=!1,ye=!1,xn=!1,vn=!1,zn=!1;Q=Math.PI,ot=Math.abs,Pt=Math.floor,cs=Math.ceil,Hs=Math.round,st=Math.min,tt=Math.max,ae=n=>Math.sign(n),Ba=(...n)=>Math.hypot(...n),Na=n=>Math.log2(n),rt=Math.sin,ut=Math.cos,za=Math.tan,er=Math.atan2;fo=class{constructor(t=123456789){p(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return Pt(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=st(t,e),o=tt(t,e)-s,a=this.float(o*2);return at?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return er(this.x,this.y)}setAngle(t=0,e=1){return Zt(t),Zt(e),this.x=e*rt(t),this.y=e*ut(t),this}rotate(t){Zt(t);let e=ut(-t),s=rt(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return Zt(t),Zt(e),t=ce(t,4),p(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return ot(this.x)>ot(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(ot(this.x),ot(this.y))}floor(){return new n(Pt(this.x),Pt(this.y))}snap(t){return Zt(t),new n(Pt(this.x*t)/t,Pt(this.y*t)/t)}mod(t=1){return new n(ce(this.x,t),ce(this.y,t))}area(){return ot(this.x*this.y)}lerp(t,e){Sa(t),Zt(e);let s=z(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=ce(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=r(a,o,t+1/3),this.g=r(a,o,t),this.b=r(a,o,t-1/3),this.a=i,es(this),this}HSLA(){let t=z(this.r),e=z(this.g),s=z(this.b),i=z(this.a),o=tt(t,e,s),a=st(t,e,s),r=(o+a)/2,c=0,l=0;if(o!==a){let u=o-a;l=r>.5?u/(2-o-a):u/(o+a),t===o?c=(e-s)/u+(e((s=z(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(p(q(t),"Color hex code must be a string"),p(t[0]==="#","Color hex code must start with #"),p([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>z(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>z(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return es(this),this}rgbaInt(){let t=z(this.r)*255|0,e=z(this.g)*255<<8,s=z(this.b)*255<<16,i=z(this.a)*255<<24;return t+e+s+i}isValid(){return R(this.r)&&R(this.g)&&R(this.b)&&R(this.a)}},H=se(V()),ln=se(V(1,1,1,0)),at=se(V(0,0,0)),xe=se(V(0,0,0,0)),Vl=se(V(.5,.5,.5)),ir=se(V(1,0,0)),Wl=se(V(1,.5,0)),$a=se(V(1,1,0)),Ka=se(V(0,1,0)),ql=se(V(0,1,1)),Qa=se(V(0,0,1)),Za=se(V(.5,0,1)),Hl=se(V(1,0,1)),Pe=class{constructor(t,e=!1){p(t===void 0||R(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){p(R(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){p(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-Jt(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?cn:ee}toString(){return this.isSet()?ot(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};Mt=b(),et=0,K=32,rr=1,Ei=!0,sn=xe,Mn=b(1920,1080),ss=0,In=0,kn=b(),ar=!1,Tn=!0,on=1,Es="arial",cr=!1,U=!1,j=!0,_s=32,_i=b(16),Ri=0,Pi=0,Li=!0,lr=1,ur=1,hr=1,dr=0,fr=.8,Ne=1,Xt=b(),$s=1,Oi=!0,pr=!0,is=!0,yn=!0,un=!1,gr=!1,be=0,Xn=4,_n=!0,Yn=0,$n=!1,Rs=!0,dn=!1,$t=100,yr=.3,os=3,Ks=0,Ps=!0,Kt=!0,Sn=.3,mr=40,br=.7;qe=class n{constructor(t=b(),e=b(1),s,i=0,o=H,a=0){p(O(t),"object pos must be a vec2"),p(O(e),"object size must be a vec2"),p(!s||s instanceof De,"object tileInfo should be a TileInfo or undefined"),p(typeof i=="number"&&isFinite(i),"object angle should be a number"),p(W(o),"object color should be a valid rgba color"),p(typeof a=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=lr,this.damping=ur,this.angleDamping=hr,this.restitution=dr,this.friction=fr,this.gravityScale=1,this.renderOrder=a,this.velocity=b(),this.angleVelocity=0,this.spawnTime=ee,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,_t.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,a=s.y,r=t.angle;if(r){let c=ut(-r),l=rt(-r);this.pos.set(o*c-a*l+i.x,o*l+a*c+i.y)}else this.pos.set(o+i.x,a+i.y);this.angle=e*this.localAngle+r}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(p(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=z(this.velocity.x,-Ne,Ne),this.velocity.y=z(this.velocity.y,-Ne,Ne));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Xt.x*this.gravityScale,this.velocity.y+=Xt.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),!Li||!this.mass)return;let e=this.velocity.y<0&&Xt.y<0||this.velocity.y>0&&Xt.y>0;if(this.groundObject){let s=tt(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of Zo){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),a=i.collideWithObject(this);if(!o||!a)continue;if(Ys(t,this.size,i.pos,i.size)){let f=t.subtract(i.pos),d=f.length(),x=d<.001?b(0,1):f.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),ge&&uo(this.pos,this.size,i.pos,i.size,"#f00");continue}let r=this.size.add(i.size),c=(t.y-i.pos.y)*2>r.y+Xt.y,l=ot(t.y-i.pos.y)*20?-1:1)>0?Pt(t.y-this.size.y/2+1)+this.size.y/2+.001:cs(t.y+this.size.y/2-1)-this.size.y/2-.001;if(ot(u-this.pos.y)<.1&&!Ze(b(this.pos.x,u),this.size,this)){this.pos.y=u,ge&&Ct(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-a}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Xt.y<0?Pt(t.y-this.size.y/2)+c:cs(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-a}ge&&Ct(this.pos,this.size,"#f00")}}}update(){}render(){Ft(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+Q/2,t)}getAliveTime(){return ee-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return p(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(p(!t.parent&&!this.children.includes(t)),p(t instanceof n,"child must be an EngineObject"),p(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Ys(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){p(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
+precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(di);zt=new Float32Array(e),xs=new Uint32Array(e),xo=g.createBuffer(),Bn=g.createBuffer(),Mr=g.createFramebuffer(),Dt=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,Bn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,a,r=(c,l,u,h,f=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&a;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,f),i+=h*u};vo=g.createVertexArray(),g.bindVertexArray(vo),i=0,o=li,a=yc,g.bindBuffer(g.ARRAY_BUFFER,Bn),r("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,xo),g.bufferData(g.ARRAY_BUFFER,di,g.DYNAMIC_DRAW),r("p",g.FLOAT,4,4,1),r("u",g.FLOAT,4,4,1),r("c",g.UNSIGNED_BYTE,1,4,1),r("a",g.UNSIGNED_BYTE,1,4,1),r("r",g.FLOAT,4,1,1),So=g.createVertexArray(),g.bindVertexArray(So),i=0,o=ui,a=mc,r("p",g.FLOAT,4,2),r("c",g.UNSIGNED_BYTE,1,4)}}function vs(n=!1){!n&&!Cn||(It(),Cn=!1,g.useProgram(li),g.bindVertexArray(vo))}function bc(){Cn||(It(),Cn=!0,g.useProgram(ui),g.bindVertexArray(So))}function To(n=!0){if(!j||!g)return;p(!Dt,"glPreRender called with unflushed batch."),hi||(it.width=k.x,it.height=k.y),g.viewport(0,0,k.x,k.y),n&&xc();let t=b(2*K).divide(k);hi&&(t.y=-t.y);let e=Mt.rotate(-nt),s=b(-1).subtract(e.multiply(t)),i=ht(nt),o=rt(nt),a=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],r=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};r(ui,"m",a),r(li,"m",a),g.activeTexture(g.TEXTURE0),hn[0]&&(se=hn[0].glTexture,g.bindTexture(g.TEXTURE_2D,se)),g.bindBuffer(g.ARRAY_BUFFER,xo),On=qn=!1,vs(!0)}function xc(){if(!g)return;let n=sn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function kr(n){!g||n===se||(It(),se=n,g.bindTexture(g.TEXTURE_2D,se))}function vc(n,t=!0){if(!g||!n)return;let e=n===se;e?It():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&se&&g.bindTexture(g.TEXTURE_2D,se)}function Ao(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),Jt&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Hn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Ao(n,g.VERTEX_SHADER)),g.attachShader(e,Ao(t,g.FRAGMENT_SHADER)),g.linkProgram(e),Jt&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ki(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)Gr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!Tn&&ls(n.width)&&ls(n.height);else{let r=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,r)}let i=Tn?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let a=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,a),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,a),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,se),e}function Sc(n){g&&g.deleteTexture(n)}function Gr(n,t){g&&(p((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!Tn&&ls(t.width)&&ls(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,se))}function Hh(n){U||(as.add(n),g&&(n.glTexture?Gr(n.glTexture,n.image):n.glTexture=ki(n.image,n.wrap)))}function Xh(n){if(U)return;as.delete(n);let t=n.glTexture;n.glTexture=void 0,Sc(t)}function It(){if(j&&g&&Dt){let n=qn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=Dt*(Cn?Ii:Ir);g.bufferSubData(g.ARRAY_BUFFER,0,zt,0,t),Cn?g.drawArrays(g.TRIANGLE_STRIP,0,Dt):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,Dt),++Le,Oe+=Dt,Dt=0}qn=On}function Fr(n){!j||!g||(It(),n.drawImage(it,0,0))}function Yh(n=!0){p(!it,"must be called before engineInit"),Dr=n}function Ss(n,t,e,s,i=0,o=0,a=0,r=1,c=1,l=-1,u=0){(Dt>=Wh||qn!==On)&&It(),vs();let h=Dt++*Ir;zt[h++]=n,zt[h++]=t,zt[h++]=e,zt[h++]=s,zt[h++]=o,zt[h++]=a,zt[h++]=r,zt[h++]=c,xs[h++]=l,xs[h++]=u,zt[h++]=i}function wc(n,t,e,s,i,o){Ss(n,t,e,s,i,0,0,0,0,0,o)}function jr(n,t,e,s,i,o,a,r=!0){let c=[],l=rt(-a),u=ht(-a);for(let f of n){let d=f.x*i,y=f.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=r?Kh(c):c;Tc(h,t)}function Br(n,t,e,s,i,o,a,r,c=!0){let l=$h(n,e,c);jr(l,t,s,i,o,a,r,!1)}function Tc(n,t){if(!j||n.length<3)return;let e=n.length+2;if((Dt+e>=Nn||qn!==On)&&It(),p(e=Nn)return;bc();let s=Dt*Ii;for(let i=e;i--;){let o=z(i-1,0,e-3),a=n[o];zt[s++]=a.x,zt[s++]=a.y,xs[s++]=t}Dt+=e}function Nr(n,t){if(!j||n.length<3)return;let e=n.length+2;if((Dt+e>=Nn||qn!==On)&&It(),p(e=Nn)return;bc();let s=Dt*Ii;for(let i=e;i--;){let o=z(i-1,0,e-3),a=n[o],r=t[o];zt[s++]=a.x,zt[s++]=a.y,xs[s++]=r}Dt+=e}function ns(n,t=!1){n?(hi=n,g.bindFramebuffer(g.FRAMEBUFFER,Mr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),To(t)):(It(),hi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,k.x,k.y))}function Ac(n,t,e,s){j&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,a=1e-6,r=10;for(let c=0;ca?-d/y:0,S=y>a?f/y:0,E=w>a?-v/w:0,A=w>a?x/w:0,T=_+E,P=S+A,F=(T*T+P*P)**.5;if(Fa){let wt=st(1/gt,r);T*=wt,P*=wt}}let bt=b(u.x-T*s,u.y-P*s),ct=b(u.x+T*s,u.y+P*s);i.push(bt),i.push(ct)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),E=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(E&&A)},o=[];for(let d=0;d3&&r++{if(E>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(E,2)),T.addColorStop(1,h(E,1))}else s.fillStyle="#000";E>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,E=2*Q,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*E),r(v,w-_,v,w+_,A,T)},l=(v,w,_,S,E)=>{s.beginPath(),s.rect(v,w,_,S*d),r(v,w+S,v+_,w,E)},u=(v,w,_,S)=>{s.beginPath();for(let E of v)s.lineTo(E.x,E.y);s.closePath(),r(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",f=Va(1,1,n),d=Ut(f,.1,.5),y=st(6,st(o,a)/99);s.translate(o/2,a/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[E],P,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*Q,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,Q/2,Q*3/2),c(35,30,10,Q/2,Q*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*Q,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,E=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(E,0,40,14)}s.restore()}function Zh(n){if(gi=n,!fn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Gi(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Jr()}En(void 0,t);function t(){if(!Us.length)return;let e=Us[0],s=cn-Js;if(!Js)Js=cn;else if(s>fi)Js=0,Us.shift();else{let i=fi-Fn,o=si?(s-i)/Fn:0;e.render(o)}}}function Gi(n){Object.values(ws).forEach(t=>n(t))}function td(){Gi(n=>n.unlocked=!1),Jr()}function Jr(){if(!gi)return;let n={};Gi(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[gi]=JSON.stringify(n)}function ed(n){fi=n}function nd(n){Fn=n}function sd(n){pi=n.copy()}function id(n){zr=n}function Cc(n,t,e,s=125){let i,o,a,r,c,l,u,h,f,d,y,x,v,w=0,_,S=[],E=[],A=[],T=0,P=0,F=1,bt={},ct=Kn/s*60>>2;for(;F;T++)S=[F=h=x=0],e.forEach((gt,wt)=>{for(u=t[gt][T]||[0,0,0],F|=t[gt][T]&&1,_=x+(t[gt][0].length-2-(h?0:1))*ct,v=wt===e.length-1,i=2,a=x;ict-99&&f&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,E[a]=(E[a]||0)-l*P+l,A[a]=(A[a++]||0)+l*P+l;c&&(y=c%1,P=u[1]||0,(c|=0)&&(S=bt[[d=u[w=0]||0,c]]=bt[[d,c]]||(r=[...n[d]],r[2]=(r[2]||220)*2**(c/12-1),c>0?Mi(...r):[])))}x=_});return[E,A]}function od(n){Ur=typeof n=="boolean"?n?1:0:n}function rd(n){Vr=n}async function ad(){return new Si(await Box2D()),e(),En(n,t),m;function n(){if(!Re){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(Vr||ge)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new Lt(l.get_r(),l.get_g(),l.get_b()),a=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),r=l=>a(l).scale(1,.8),c=(l,u)=>{let h=[];for(let f=u;f--;)h.push(m.vec2FromPointer(l+f*8));return h};i.DrawSegment=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),mn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=r(h);let f=c(l,u);Jn(f,ln,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=r(h);let f=c(l,u);Jn(f,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=r(h),l=m.vec2FromPointer(l),ti(l,u*2,ln,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,f){f=r(f),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),ti(l,u*2,f,.1,f,!1),mn(b(),h,.1,f,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),f=b(1,0),d=V(.75,0,0,.8),y=b(0,1),x=V(0,.75,0,.8);mn(b(),f,.1,d,u,h,!1),mn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){Ec(n,t,e,H,s,at,i,o,!1,!0)}function Ec(n,t,e,s,i=1,o,a=.05,r=0,c=j,l,u){let h=e.offset(e.size),f=t.add(b(a-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-r:r;jt(n,f,h,s,r,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),E=b(_?i:f.x,_?f.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));jt(n.add(S.rotate(v)),E,A,s,r,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,E=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));jt(n.add(E.rotate(v)),d,A,s,r,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){_c(n,t,e,H,s,at,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,a=.05,r=0,c=j,l,u){let h=e.frame(0),f=e.frame(1),d=e.frame(2),y=t.add(b(a-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-r:r;jt(n,y,d,s,r,!1,o,c,l,u);for(let S=4;S--;){let E=r+S*Q/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),P=b(A?y.y:y.x,i);jt(n.add(T.rotate(_)),P,f,s,E,!1,o,c,l,u)}for(let S=4;S--;){let E=r+S*Q/2,A=!S||S>2,T=S>1,P=v.multiply(b(A?-1:1,T?-w:w));jt(n.add(P.rotate(_)),x,h,s,E,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=H,i=0,o=!1,a=0,r=at,c=j,l=!1,u){let h=Rc(b(),t,e,0,o);Jn(h,s,a,r,n,i,c,l,u)}function Rc(n,t=1,e=0,s=0,i=!1,o=_s){p(O(n),"pos must be a vec2"),p(R(t)&&R(e),"size and percent must be numbers");let a=ce(e*4,4);a>=2&&(s+=Q),a=a<=2?a-1:3-a,i&&(a=-a,s+=Q);let r=[],c=tt(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*Q;r.push(b(l*ht(h),l*rt(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*Q;r.push(b(l*ht(h),-l*a*rt(h)).rotate(s).add(n))}return r}function Pa(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){p(n!=null&&typeof n=="object","tweenProperty target must be an object"),p(q(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let a=t.split("."),r=a.pop(),c=l=>{let u=n;for(let h of a)u=u[h];u[r]=l};return new wi(c,e,s,i,o)}function Pc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Pc(n),ee.push(n),n.callback(n.interp(n.duration)))}function Lc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Lc(n),ee.push(n),n.callback(n.interp(n.duration))}function Oc(n,t){n===void 0?(n=ne-_a,t=cn-Ra,_a=ne,Ra=cn):t===void 0&&(t=n);for(let e=ee.length;e--;){let s=ee[e];if(s.paused)continue;let i=s.useRealTime?t:n;if(!(i<=0))if(s.life-=i,s.life>0)s.callback(s.interp(s.life));else{s.callback(s.interp(0)),ee.splice(e,1);let o=s.thenCallback;s.thenCallback=void 0,o&&o()}}}function dd(){for(let n of ee)n.thenCallback=void 0;ee.length=0}var Vs,Ws,El,Qo,_t,Zo,La,ne,cn,Re,oo,we,qs,Oa,bn,co,Jt,Ia,Ci,ka,Fe,nn,ge,ye,xn,vn,zn,lo,je,pe,Q,ot,Pt,cs,Hs,st,tt,ae,Ba,Na,rt,ht,za,er,fo,ut,Lt,H,ln,at,xe,Vl,ir,Wl,$a,Ka,ql,Qa,Za,Hl,Pe,Mt,nt,K,rr,Ei,sn,Mn,ss,In,kn,ar,Tn,on,Es,cr,U,j,_s,_i,Ri,Pi,Li,lr,ur,hr,dr,fr,Ne,Yt,$s,Oi,pr,is,yn,un,gr,be,Xn,_n,Yn,$n,Rs,dn,Kt,yr,os,Ks,Ps,Qt,Sn,mr,br,qe,N,pt,Ot,Ue,tn,Ce,ze,k,hn,Le,Oe,De,He,nh,cc,ei,ke,Ht,Sr,Te,wr,ni,jn,en,Tr,Gn,At,le,Z,Ae,pn,ro,Un,ue,An,si,Is,Je,Qe,hc,Rr,dc,ps,gn,Vn,Ta,ii,mt,We,Kn,ys,oi,an,wn,ai,ms,bs,bo,Vh,ci,it,g,Dr,li,ui,Cn,On,qn,se,xo,Bn,zt,xs,Dt,as,vo,So,Mr,hi,wo,di,Ir,yc,Wh,Ii,mc,Nn,fn,fi,Fn,pi,zr,ws,Us,gi,Js,yi,Ts,Co,Eo,Bt,_o,$,Ro,Po,Lo,C,Ur,Oo,he,mi,Do,Mo,As,Io,ko,Go,Fo,m,Vr,Cs,bi,jo,Bo,xi,Zt,No,vi,zo,Jo,Uo,Vo,Wo,qo,Ho,Xo,Yo,$o,Si,ee,_a,Ra,wi,Ti,fd,ao,Ai,Ko,Mc=jc(()=>{"use strict";Vs="LittleJS",Ws="1.18.19",El=60,Qo=.016666666666666666,_t=[],Zo=[],La=0,ne=0,cn=0,Re=!1;oo=0,we=0,qs=0,Oa=!0,bn=[],co=class{constructor(t,e,s,i){this.update=t,this.render=e,this.glContextLost=s,this.glContextRestored=i}};Jt=!0,Ia=.5,Ci=!0,ka="Escape",Fe=!1,nn=[],ge=!1,ye=!1,xn=!1,vn=!1,zn=!1;Q=Math.PI,ot=Math.abs,Pt=Math.floor,cs=Math.ceil,Hs=Math.round,st=Math.min,tt=Math.max,ae=n=>Math.sign(n),Ba=(...n)=>Math.hypot(...n),Na=n=>Math.log2(n),rt=Math.sin,ht=Math.cos,za=Math.tan,er=Math.atan2;fo=class{constructor(t=123456789){p(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return Pt(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=st(t,e),o=tt(t,e)-s,a=this.float(o*2);return at?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return er(this.x,this.y)}setAngle(t=0,e=1){return te(t),te(e),this.x=e*rt(t),this.y=e*ht(t),this}rotate(t){te(t);let e=ht(-t),s=rt(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return te(t),te(e),t=ce(t,4),p(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return ot(this.x)>ot(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(ot(this.x),ot(this.y))}floor(){return new n(Pt(this.x),Pt(this.y))}snap(t){return te(t),new n(Pt(this.x*t)/t,Pt(this.y*t)/t)}mod(t=1){return new n(ce(this.x,t),ce(this.y,t))}area(){return ot(this.x*this.y)}lerp(t,e){Sa(t),te(e);let s=z(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=ce(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=r(a,o,t+1/3),this.g=r(a,o,t),this.b=r(a,o,t-1/3),this.a=i,es(this),this}HSLA(){let t=z(this.r),e=z(this.g),s=z(this.b),i=z(this.a),o=tt(t,e,s),a=st(t,e,s),r=(o+a)/2,c=0,l=0;if(o!==a){let u=o-a;l=r>.5?u/(2-o-a):u/(o+a),t===o?c=(e-s)/u+(e((s=z(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(p(q(t),"Color hex code must be a string"),p(t[0]==="#","Color hex code must start with #"),p([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>z(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>z(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return es(this),this}rgbaInt(){let t=z(this.r)*255|0,e=z(this.g)*255<<8,s=z(this.b)*255<<16,i=z(this.a)*255<<24;return t+e+s+i}isValid(){return R(this.r)&&R(this.g)&&R(this.b)&&R(this.a)}},H=ie(V()),ln=ie(V(1,1,1,0)),at=ie(V(0,0,0)),xe=ie(V(0,0,0,0)),Vl=ie(V(.5,.5,.5)),ir=ie(V(1,0,0)),Wl=ie(V(1,.5,0)),$a=ie(V(1,1,0)),Ka=ie(V(0,1,0)),ql=ie(V(0,1,1)),Qa=ie(V(0,0,1)),Za=ie(V(.5,0,1)),Hl=ie(V(1,0,1)),Pe=class{constructor(t,e=!1){p(t===void 0||R(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){p(R(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){p(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-Ut(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?cn:ne}toString(){return this.isSet()?ot(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};Mt=b(),nt=0,K=32,rr=1,Ei=!0,sn=xe,Mn=b(1920,1080),ss=0,In=0,kn=b(),ar=!1,Tn=!0,on=1,Es="arial",cr=!1,U=!1,j=!0,_s=32,_i=b(16),Ri=0,Pi=0,Li=!0,lr=1,ur=1,hr=1,dr=0,fr=.8,Ne=1,Yt=b(),$s=1,Oi=!0,pr=!0,is=!0,yn=!0,un=!1,gr=!1,be=0,Xn=4,_n=!0,Yn=0,$n=!1,Rs=!0,dn=!1,Kt=100,yr=.3,os=3,Ks=0,Ps=!0,Qt=!0,Sn=.3,mr=40,br=.7;qe=class n{constructor(t=b(),e=b(1),s,i=0,o=H,a=0){p(O(t),"object pos must be a vec2"),p(O(e),"object size must be a vec2"),p(!s||s instanceof De,"object tileInfo should be a TileInfo or undefined"),p(typeof i=="number"&&isFinite(i),"object angle should be a number"),p(W(o),"object color should be a valid rgba color"),p(typeof a=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=lr,this.damping=ur,this.angleDamping=hr,this.restitution=dr,this.friction=fr,this.gravityScale=1,this.renderOrder=a,this.velocity=b(),this.angleVelocity=0,this.spawnTime=ne,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,_t.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,a=s.y,r=t.angle;if(r){let c=ht(-r),l=rt(-r);this.pos.set(o*c-a*l+i.x,o*l+a*c+i.y)}else this.pos.set(o+i.x,a+i.y);this.angle=e*this.localAngle+r}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(p(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=z(this.velocity.x,-Ne,Ne),this.velocity.y=z(this.velocity.y,-Ne,Ne));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Yt.x*this.gravityScale,this.velocity.y+=Yt.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),!Li||!this.mass)return;let e=this.velocity.y<0&&Yt.y<0||this.velocity.y>0&&Yt.y>0;if(this.groundObject){let s=tt(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of Zo){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),a=i.collideWithObject(this);if(!o||!a)continue;if(Ys(t,this.size,i.pos,i.size)){let f=t.subtract(i.pos),d=f.length(),x=d<.001?b(0,1):f.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),ge&&uo(this.pos,this.size,i.pos,i.size,"#f00");continue}let r=this.size.add(i.size),c=(t.y-i.pos.y)*2>r.y+Yt.y,l=ot(t.y-i.pos.y)*20?-1:1)>0?Pt(t.y-this.size.y/2+1)+this.size.y/2+.001:cs(t.y+this.size.y/2-1)-this.size.y/2-.001;if(ot(u-this.pos.y)<.1&&!Ze(b(this.pos.x,u),this.size,this)){this.pos.y=u,ge&&Ct(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-a}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Yt.y<0?Pt(t.y-this.size.y/2)+c:cs(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-a}ge&&Ct(this.pos,this.size,"#f00")}}}update(){}render(){jt(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+Q/2,t)}getAliveTime(){return ne-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return p(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(p(!t.parent&&!this.children.includes(t)),p(t instanceof n,"child must be an EngineObject"),p(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Ys(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){p(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
 pos = `+this.pos),(this.velocity.x||this.velocity.y)&&(t+=`
 velocity = `+this.velocity),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.angle&&(t+=`
 angle = `+this.angle.toFixed(3)),this.color&&(t+=`
-color = `+this.color),t}renderDebugInfo(){if(!zt)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b(tt(this.size.x,.2),tt(this.size.y,.2)),s=V(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);Ct(this.pos,e,s,0,this.angle,t),this.parent&&Ct(this.pos,e.scale(.8),V(1,1,1,.5),0,this.angle),this.parent&&Ee(this.pos,this.parent.pos,V(1,1,1,.5),.5)}},k=b(),hn=[];De=class n{constructor(t=b(),e=_i,s=hn[0],i=Ri,o=Pi){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){p(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return p(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new lt(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new lt,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Ls(t,this.size,this.textureInfo,this.padding,this.bleed)}},He=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,vc(this.glTexture,t)}};nh=0;ei=class{constructor(t){p(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,a,r){p(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(p(s>0),s*=K,s=new lt(s,s)):s=s.scale(K),this.drawTextScreen(t,Pn(e),s,i,o,a,r)}drawTextScreen(t,e,s,i=!0,o=H,a=j,r){p(q(t),"text must be a string"),p(O(e),"pos must be a vec2"),p(O(s)||typeof s=="number","size must be a vec2 or number"),p(W(o),"color must be a color"),s=typeof s=="number"?new lt(s,s):s;let c=new lt,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,f=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
-`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,E=S%d,A=S/d|0;l.pos.x=E*h+u,l.pos.y=A*f+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,Ft(c,s,l,o,0,!1,void 0,a,!0,r)}})}};ke=b(),qt=b(),Sr=b(),Te=b(),wr=0,ni=!0,jn=!1,en="mouse",Tr=6,Gn=!0,At=0,le=!U&&window.ontouchstart!==void 0;Z=[[]],Ae=[],pn=[],ro=[],Un=new Pe,ue=[],An=[],si=[],Is=[],Je=new Map,ps=[],Vn=!0;ii="http://www.w3.org/2000/svg";mt=new AudioContext,Kn=44100;ys=class{constructor(t,e,s=mr,i=br,o){var a;if(!(!Kt||U)){if(p(!t||me(t)||q(t),"asset must be a file name or zzfx array"),p(e===void 0||R(e),"randomness must be a number"),p(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),p(R(s),"range must be a number"),p(R(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Kn,this.loadedPercent=0,this.onloadCallback=o,me(t)){let r=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(a=r[l])!=null?a:c,r[l]=0,this.sampleChannels=[Mi(...r)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let r=t;this.loadSound(r)}}}play(t,e=1,s=1,i=1,o=!1,a=!1){if(p(!t||O(t),"pos must be a vec2"),p(R(e),"volume must be a number"),p(R(s),"pitch must be a number"),p(R(i),"randomnessScale must be a number"),!Kt||U||!this.sampleChannels)return;let r;if(t){let u=this.range;if(u){let h=Mt.distanceSquared(t);if(h>u*u)return;e*=Jt(h**.5,u,u*this.taper)}r=Pn(t).x*2/N.width-1}let c=s+s*this.randomness*i*yt(-1,1),l=new oi(this,e,c,r,o,a);return zt&&zn&&t&&(Ht(t,.5,"#0ff",.5,!0),this.range&&(Ht(t,2*this.range,"#0ff",.5),Ht(t,2*this.range*this.taper,"#0ff",.5)),Dn("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){p(R(t),"semitoneOffset must be a number");let i=pc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await mt.decodeAudioData(s),o=i.numberOfChannels,a=1e5,r=[];for(let l=0;lsetTimeout(v,0));let d=st(f+a,h);for(;f=0,"Sound volume must be positive or zero"),p(s>=0,"Sound rate must be positive or zero"),p(R(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=r=>{r===this.source&&(this.source=void 0)},a||this.start()}start(t=0){p(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=mt.createGain(),this.source=Or(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=mt.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){p(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(p(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=mt.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?ce(mt.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};an=[];wn=class{constructor(t,e=0,s=!1,i=new Lt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new Lt}},ai=class extends qe{constructor(t,e,s=0,i=0,o=b(512),a=!0){var r;p(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,H,i),this.canvas=U?void 0:new OffscreenCanvas(o.x,o.y),this.context=(r=this.canvas)==null?void 0:r.getContext("2d"),this.textureInfo=new He(this.canvas,a),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=H,i=0,o=!1,a,r=!1,c){let l=new De().setFullImage(this.textureInfo),u=this.hasWebGL();Ft(t,e,l,s,i,o,a,u,r,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return j&&this.textureInfo.hasWebGL()}},ms=class extends ai{constructor(t,e,s=Ls(),i=0,o=!0){let a=s?e.multiply(s.size):e;if(super(t,e,0,i,a,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,U){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let r=this.size.area();r--;)this.data.push(new wn)}setData(t,e,s=!1){if(t=t.floor(),p(O(t),"layerPos must be a Vector2"),p(e instanceof wn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Ot===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new wn,e)}getData(t){return p(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!j&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){p(Ot!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&It(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;p(Ot!==this.context),this.savedRenderSettings=[Ot,k,Mt,K,sn],Ot=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);k=this.size.multiply(e),sn=xe,Mt=this.size.multiply(e).scale(.5),K=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?ns(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!Tn,t&&(this.canvas.width=k.x,this.canvas.height=k.y))}redrawEnd(){this.context&&(p(Ot===this.context),this.isUsingWebGL&&ns(),[Ot,k,Mt,K,sn]=this.savedRenderSettings)}drawTileData(t,e=!0){var r,c;if(!this.context)return;p(Ot===this.context,"must call redrawStart() before drawing tiles");let s=(c=(r=this.tileInfo)==null?void 0:r.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let a=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,a,o.color,o.direction*Q/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(p(Ot!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=H,o=0,a,r){let c=t.add(e.scale(.5));Ft(c,e,s,i,o,a,r,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new Lt,o=0,a=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let r=k;k=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&ns(this.textureInfo.glTexture);let l=c?void 0:this.context;Ft(t,e,s,i,o,a,void 0,c,!0,l),c&&ns(),k=r}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){p(Ot===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Ac(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},bs=class extends ms{constructor(t,e,s=Ls(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),an.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=an.indexOf(this);p(t>=0,"tile collision layer not found in array"),t>=0&&an.splice(t,1),super.destroy()}initCollision(t){p(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){p(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){p(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new lt,s){p(O(t)&&O(e),"pos and size must be Vector2s"),p(!s||typeof s=="function"||s instanceof qe,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(f,d)=>s(f,d):(f,d)=>s.collideWithTile(f,d):()=>!0,o=t.x-this.pos.x,a=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||a+e.y/2<0||a-e.y/2>this.size.y)return!1;let r=tt(o-e.x/2|0,0),c=tt(a-e.y/2|0,0),l=st(tt(o+e.x/2,r+1),this.size.x),u=st(tt(a+e.y/2,c+1),this.size.y),h=new lt;for(let f=c;fs(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,a=l=>{let u=this.getCollisionData(r.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},r=new lt,c=Wa(t,e,a,i);if(ye&&c){let l=c.floor().add(b(.5));Ct(l,b(1),"#f008"),Ee(t,e,"#00f",.02),Ee(t,c,"#f00",.02),tr(c,"#0f0"),i&&Ee(c,c.add(i),"#ff0",.02)}return c}},bo=class extends qe{constructor(t,e,s=0,i=0,o=100,a=Q,r,c=H,l=H,u=ln,h=ln,f=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,E=Q,A=.1,T=.2,P=!1,F=!1,bt=!0,ct=F?1e9:0,gt=!1){super(t,b(),r,e,void 0,ct),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=a,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=bt,this.particleTime=f,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=E,this.fadeRate=A,this.randomness=T,this.collideTiles=P,this.additive=F,this.localSpace=gt,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&$s){let s=1/this.emitRate/$s;for(this.emitTimeBuffer+=Qo;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*yt(s,-s),o=i(this.particleTime),a=i(this.sizeStart),r=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Ha(),u=yt(this.emitConeAngle,-this.emitConeAngle),h=ho(this.colorStartA,this.colorStartB,this.randomColorLinear),f=ho(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*rt(d),c*ut(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new ci(this,t,e,h,f,o,a,r,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new lt,ci=class{constructor(t,e,s,i,o,a,r,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(r),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=a,this.sizeStart=r,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=ee,this.mirror=qa(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,a=t.gravityScale,r=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&ee-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Xt.x*a,this.pos.y+=this.velocity.y+=Xt.y*a,this.angle+=this.angleVelocity*=s,!Li||!r)return;let u=this.velocity.lengthSquared();if(u>Ne*Ne){let f=Ne/u**.5;this.velocity.x*=f,this.velocity.y*=f}this.groundObject=void 0;let h=c?f=>{let d=ri(f);return d&&c(this,d,f)}:f=>ri(f)>0;if(h(this.pos)){let f=Ze(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=tt(i,f.restitution),v=tt(o,f.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Xt.y<0||this.velocity.y>0&&Xt.y>0)&&(this.groundObject=f),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),ge&&Ct(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,a=this.lifeTime>0?st((ee-this.spawnTime)/this.lifeTime,1):1,r=1-a,c=r*this.sizeStart+a*this.sizeEnd,l=b(c),u=a1-o?(1-a)/o:1;this.color.r=r*this.colorStart.r+a*this.colorEnd.r,this.color.g=r*this.colorStart.g+a*this.colorEnd.g,this.color.b=r*this.colorStart.b+a*this.colorEnd.b,this.color.a=(r*this.colorStart.a+a*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),f=this.angle;if(e){let d=t.angle,y=ut(-d),x=rt(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),f+=d}if(s&&hs(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=tt(l.x,x),f=er(d.x,d.y),Ft(h,l,this.tileInfo,this.color,f,this.mirror)}}else Ft(h,l,this.tileInfo,this.color,f,this.mirror);s&&hs(!1),xn&&Ct(h,l,"#f005",0,f)}},Dr=!0,wo=!0,di=5e5,Ir=11,yc=Ir*4,Wh=di/yc|0,Ii=3,mc=Ii*4,Nn=di/mc|0;fn=!1,fi=5,Fn=.5,pi=b(640,80),zr=!1,ws={},Us=[];yi=class{constructor(t,e,s="",i="\u{1F3C6}",o){p(t>=0&&!ws[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),ws[t]=this}unlock(){zr||this.unlocked||(p(gi,"save name must be set"),this.unlocked=!0,Jr(),Us.push(this))}render(t=0){let e=pt,s=st(pi.x,N.width),i=pi.y,o=N.width-s,a=-i*t,r=Be(0,0,.9);e.save(),e.beginPath(),e.fillStyle=r.toString(),e.strokeStyle=at.toString(),e.lineWidth=3,e.rect(o,a,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,a+i/2),l);let u=i*.5,h=i*.3,f=b(o+l+2*c.x,a+c.y*2+u/2),d=s-l-3*c.x;rn(this.name,f,u,at,0,void 0,"left",void 0,void 0,d),f.y=a+i-c.y*2-h/2,rn(this.description,f,h,at,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?pt.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):rn(this.icon,t,e*.7,at)}};Co=class extends yi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Ts&&Ts.unlockMedal(this.id)}},Eo=class{constructor(t,e,s){var c,l,u;p(!Ts,"there can only be one newgrounds object"),p(!e||s,"must provide cryptojs if there is a cipher"),Ts=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){fn&&Et("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],fn&&Et(this.medals);for(let h of this.medals){let f=ws[h.id];f&&(f.image=new Image,f.image.src=h.icon,f.name=h.name,f.description=h.description,f.unlocked=h.unlocked,f.difficulty=h.difficulty,f.value=h.value,f.value&&(f.description=f.description+` (${f.value})`))}let a=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=a==null?void 0:a.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],fn&&Et(this.scoreboards);let r=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),r)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),f=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(f.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},a=new FormData;a.append("input",JSON.stringify(o));let r=new XMLHttpRequest;r.open("POST","https://newgrounds.io/gateway_v3.php",!fn&&s);try{r.send(a)}catch(l){fn&&Et("newgrounds call failed",l);return}return fn&&Et(r.responseText),r.responseText&&JSON.parse(r.responseText)}},_o=class{constructor(t,e=!1,s=!1){p(!jt,"Post process already initialized"),p(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),jt=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),En(void 0,r,o,a);function i(){if(U)return;if(!j){console.warn("PostProcessPlugin: WebGL not enabled!");return}jt.texture=ki(),jt.shader=Hn(`#version 300 es
+color = `+this.color),t}renderDebugInfo(){if(!Jt)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b(tt(this.size.x,.2),tt(this.size.y,.2)),s=V(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);Ct(this.pos,e,s,0,this.angle,t),this.parent&&Ct(this.pos,e.scale(.8),V(1,1,1,.5),0,this.angle),this.parent&&Ee(this.pos,this.parent.pos,V(1,1,1,.5),.5)}},k=b(),hn=[];De=class n{constructor(t=b(),e=_i,s=hn[0],i=Ri,o=Pi){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){p(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return p(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new ut(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new ut,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Ls(t,this.size,this.textureInfo,this.padding,this.bleed)}},He=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,vc(this.glTexture,t)}};nh=0;ei=class{constructor(t){p(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,a,r){p(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(p(s>0),s*=K,s=new ut(s,s)):s=s.scale(K),this.drawTextScreen(t,Pn(e),s,i,o,a,r)}drawTextScreen(t,e,s,i=!0,o=H,a=j,r){p(q(t),"text must be a string"),p(O(e),"pos must be a vec2"),p(O(s)||typeof s=="number","size must be a vec2 or number"),p(W(o),"color must be a color"),s=typeof s=="number"?new ut(s,s):s;let c=new ut,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,f=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
+`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,E=S%d,A=S/d|0;l.pos.x=E*h+u,l.pos.y=A*f+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,jt(c,s,l,o,0,!1,void 0,a,!0,r)}})}};ke=b(),Ht=b(),Sr=b(),Te=b(),wr=0,ni=!0,jn=!1,en="mouse",Tr=6,Gn=!0,At=0,le=!U&&window.ontouchstart!==void 0;Z=[[]],Ae=[],pn=[],ro=[],Un=new Pe,ue=[],An=[],si=[],Is=[],Je=new Map,ps=[],Vn=!0;ii="http://www.w3.org/2000/svg";mt=new AudioContext,Kn=44100;ys=class{constructor(t,e,s=mr,i=br,o){var a;if(!(!Qt||U)){if(p(!t||me(t)||q(t),"asset must be a file name or zzfx array"),p(e===void 0||R(e),"randomness must be a number"),p(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),p(R(s),"range must be a number"),p(R(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Kn,this.loadedPercent=0,this.onloadCallback=o,me(t)){let r=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(a=r[l])!=null?a:c,r[l]=0,this.sampleChannels=[Mi(...r)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let r=t;this.loadSound(r)}}}play(t,e=1,s=1,i=1,o=!1,a=!1){if(p(!t||O(t),"pos must be a vec2"),p(R(e),"volume must be a number"),p(R(s),"pitch must be a number"),p(R(i),"randomnessScale must be a number"),!Qt||U||!this.sampleChannels)return;let r;if(t){let u=this.range;if(u){let h=Mt.distanceSquared(t);if(h>u*u)return;e*=Ut(h**.5,u,u*this.taper)}r=Pn(t).x*2/N.width-1}let c=s+s*this.randomness*i*yt(-1,1),l=new oi(this,e,c,r,o,a);return Jt&&zn&&t&&(Xt(t,.5,"#0ff",.5,!0),this.range&&(Xt(t,2*this.range,"#0ff",.5),Xt(t,2*this.range*this.taper,"#0ff",.5)),Dn("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){p(R(t),"semitoneOffset must be a number");let i=pc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await mt.decodeAudioData(s),o=i.numberOfChannels,a=1e5,r=[];for(let l=0;lsetTimeout(v,0));let d=st(f+a,h);for(;f=0,"Sound volume must be positive or zero"),p(s>=0,"Sound rate must be positive or zero"),p(R(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=r=>{r===this.source&&(this.source=void 0)},a||this.start()}start(t=0){p(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=mt.createGain(),this.source=Or(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=mt.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){p(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(p(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=mt.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?ce(mt.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};an=[];wn=class{constructor(t,e=0,s=!1,i=new Lt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new Lt}},ai=class extends qe{constructor(t,e,s=0,i=0,o=b(512),a=!0){var r;p(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,H,i),this.canvas=U?void 0:new OffscreenCanvas(o.x,o.y),this.context=(r=this.canvas)==null?void 0:r.getContext("2d"),this.textureInfo=new He(this.canvas,a),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=H,i=0,o=!1,a,r=!1,c){let l=new De().setFullImage(this.textureInfo),u=this.hasWebGL();jt(t,e,l,s,i,o,a,u,r,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return j&&this.textureInfo.hasWebGL()}},ms=class extends ai{constructor(t,e,s=Ls(),i=0,o=!0){let a=s?e.multiply(s.size):e;if(super(t,e,0,i,a,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,U){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let r=this.size.area();r--;)this.data.push(new wn)}setData(t,e,s=!1){if(t=t.floor(),p(O(t),"layerPos must be a Vector2"),p(e instanceof wn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Ot===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new wn,e)}getData(t){return p(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!j&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){p(Ot!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&It(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;p(Ot!==this.context),this.savedRenderSettings=[Ot,k,Mt,K,sn],Ot=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);k=this.size.multiply(e),sn=xe,Mt=this.size.multiply(e).scale(.5),K=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?ns(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!Tn,t&&(this.canvas.width=k.x,this.canvas.height=k.y))}redrawEnd(){this.context&&(p(Ot===this.context),this.isUsingWebGL&&ns(),[Ot,k,Mt,K,sn]=this.savedRenderSettings)}drawTileData(t,e=!0){var r,c;if(!this.context)return;p(Ot===this.context,"must call redrawStart() before drawing tiles");let s=(c=(r=this.tileInfo)==null?void 0:r.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let a=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,a,o.color,o.direction*Q/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(p(Ot!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=H,o=0,a,r){let c=t.add(e.scale(.5));jt(c,e,s,i,o,a,r,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new Lt,o=0,a=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let r=k;k=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&ns(this.textureInfo.glTexture);let l=c?void 0:this.context;jt(t,e,s,i,o,a,void 0,c,!0,l),c&&ns(),k=r}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){p(Ot===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Ac(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},bs=class extends ms{constructor(t,e,s=Ls(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),an.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=an.indexOf(this);p(t>=0,"tile collision layer not found in array"),t>=0&&an.splice(t,1),super.destroy()}initCollision(t){p(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){p(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){p(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new ut,s){p(O(t)&&O(e),"pos and size must be Vector2s"),p(!s||typeof s=="function"||s instanceof qe,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(f,d)=>s(f,d):(f,d)=>s.collideWithTile(f,d):()=>!0,o=t.x-this.pos.x,a=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||a+e.y/2<0||a-e.y/2>this.size.y)return!1;let r=tt(o-e.x/2|0,0),c=tt(a-e.y/2|0,0),l=st(tt(o+e.x/2,r+1),this.size.x),u=st(tt(a+e.y/2,c+1),this.size.y),h=new ut;for(let f=c;fs(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,a=l=>{let u=this.getCollisionData(r.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},r=new ut,c=Wa(t,e,a,i);if(ye&&c){let l=c.floor().add(b(.5));Ct(l,b(1),"#f008"),Ee(t,e,"#00f",.02),Ee(t,c,"#f00",.02),tr(c,"#0f0"),i&&Ee(c,c.add(i),"#ff0",.02)}return c}},bo=class extends qe{constructor(t,e,s=0,i=0,o=100,a=Q,r,c=H,l=H,u=ln,h=ln,f=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,E=Q,A=.1,T=.2,P=!1,F=!1,bt=!0,ct=F?1e9:0,gt=!1){super(t,b(),r,e,void 0,ct),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=a,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=bt,this.particleTime=f,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=E,this.fadeRate=A,this.randomness=T,this.collideTiles=P,this.additive=F,this.localSpace=gt,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&$s){let s=1/this.emitRate/$s;for(this.emitTimeBuffer+=Qo;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*yt(s,-s),o=i(this.particleTime),a=i(this.sizeStart),r=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Ha(),u=yt(this.emitConeAngle,-this.emitConeAngle),h=ho(this.colorStartA,this.colorStartB,this.randomColorLinear),f=ho(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*rt(d),c*ht(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new ci(this,t,e,h,f,o,a,r,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new ut,ci=class{constructor(t,e,s,i,o,a,r,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(r),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=a,this.sizeStart=r,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=ne,this.mirror=qa(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,a=t.gravityScale,r=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&ne-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Yt.x*a,this.pos.y+=this.velocity.y+=Yt.y*a,this.angle+=this.angleVelocity*=s,!Li||!r)return;let u=this.velocity.lengthSquared();if(u>Ne*Ne){let f=Ne/u**.5;this.velocity.x*=f,this.velocity.y*=f}this.groundObject=void 0;let h=c?f=>{let d=ri(f);return d&&c(this,d,f)}:f=>ri(f)>0;if(h(this.pos)){let f=Ze(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=tt(i,f.restitution),v=tt(o,f.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Yt.y<0||this.velocity.y>0&&Yt.y>0)&&(this.groundObject=f),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),ge&&Ct(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,a=this.lifeTime>0?st((ne-this.spawnTime)/this.lifeTime,1):1,r=1-a,c=r*this.sizeStart+a*this.sizeEnd,l=b(c),u=a1-o?(1-a)/o:1;this.color.r=r*this.colorStart.r+a*this.colorEnd.r,this.color.g=r*this.colorStart.g+a*this.colorEnd.g,this.color.b=r*this.colorStart.b+a*this.colorEnd.b,this.color.a=(r*this.colorStart.a+a*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),f=this.angle;if(e){let d=t.angle,y=ht(-d),x=rt(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),f+=d}if(s&&hs(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=tt(l.x,x),f=er(d.x,d.y),jt(h,l,this.tileInfo,this.color,f,this.mirror)}}else jt(h,l,this.tileInfo,this.color,f,this.mirror);s&&hs(!1),xn&&Ct(h,l,"#f005",0,f)}},Dr=!0,wo=!0,di=5e5,Ir=11,yc=Ir*4,Wh=di/yc|0,Ii=3,mc=Ii*4,Nn=di/mc|0;fn=!1,fi=5,Fn=.5,pi=b(640,80),zr=!1,ws={},Us=[];yi=class{constructor(t,e,s="",i="\u{1F3C6}",o){p(t>=0&&!ws[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),ws[t]=this}unlock(){zr||this.unlocked||(p(gi,"save name must be set"),this.unlocked=!0,Jr(),Us.push(this))}render(t=0){let e=pt,s=st(pi.x,N.width),i=pi.y,o=N.width-s,a=-i*t,r=Be(0,0,.9);e.save(),e.beginPath(),e.fillStyle=r.toString(),e.strokeStyle=at.toString(),e.lineWidth=3,e.rect(o,a,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,a+i/2),l);let u=i*.5,h=i*.3,f=b(o+l+2*c.x,a+c.y*2+u/2),d=s-l-3*c.x;rn(this.name,f,u,at,0,void 0,"left",void 0,void 0,d),f.y=a+i-c.y*2-h/2,rn(this.description,f,h,at,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?pt.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):rn(this.icon,t,e*.7,at)}};Co=class extends yi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Ts&&Ts.unlockMedal(this.id)}},Eo=class{constructor(t,e,s){var c,l,u;p(!Ts,"there can only be one newgrounds object"),p(!e||s,"must provide cryptojs if there is a cipher"),Ts=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){fn&&Et("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],fn&&Et(this.medals);for(let h of this.medals){let f=ws[h.id];f&&(f.image=new Image,f.image.src=h.icon,f.name=h.name,f.description=h.description,f.unlocked=h.unlocked,f.difficulty=h.difficulty,f.value=h.value,f.value&&(f.description=f.description+` (${f.value})`))}let a=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=a==null?void 0:a.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],fn&&Et(this.scoreboards);let r=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),r)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),f=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(f.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},a=new FormData;a.append("input",JSON.stringify(o));let r=new XMLHttpRequest;r.open("POST","https://newgrounds.io/gateway_v3.php",!fn&&s);try{r.send(a)}catch(l){fn&&Et("newgrounds call failed",l);return}return fn&&Et(r.responseText),r.responseText&&JSON.parse(r.responseText)}},_o=class{constructor(t,e=!1,s=!1){p(!Bt,"Post process already initialized"),p(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),Bt=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),En(void 0,r,o,a);function i(){if(U)return;if(!j){console.warn("PostProcessPlugin: WebGL not enabled!");return}Bt.texture=ki(),Bt.shader=Hn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
 precision highp float;uniform sampler2D iChannel0;uniform vec3 iResolution;uniform float iTime;out vec4 c;
 `+t+`
-void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),jt.vao=g.createVertexArray(),g.bindVertexArray(jt.vao),g.bindBuffer(g.ARRAY_BUFFER,Bn);let c=8,l=g.getAttribLocation(jt.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){jt.shader=void 0,jt.texture=void 0,Et("PostProcessPlugin: WebGL context lost")}function a(){i(),Et("PostProcessPlugin: WebGL context restored")}function r(){if(U||!j)return;It(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(jt.shader),g.bindVertexArray(jt.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,jt.texture),e?(Ue.width=k.x,Ue.height=k.y,Fr(tn),tn.drawImage(N,0,0),N.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,Ue)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,it);let c=l=>g.getUniformLocation(jt.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),ee),g.uniform3f(c("iResolution"),N.width,N.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,it),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),vs(!0)}}},Ro=class{constructor(t,e){p(!$,"LightSystemPlugin already initialized"),p(!jt,"LightSystemPlugin must be created before PostProcessPlugin"),$=this,this.enabled=!0,this.ambientColor=(e||at).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),En(void 0,i,o,a);function s(){if(U)return;if(!j){console.warn("LightSystemPlugin: WebGL not enabled!");return}$.textureSize||($.textureSize=k.copy()),$.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,$.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,$.textureSize.x,$.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),$.lightShader=Hn(`#version 300 es
+void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),Bt.vao=g.createVertexArray(),g.bindVertexArray(Bt.vao),g.bindBuffer(g.ARRAY_BUFFER,Bn);let c=8,l=g.getAttribLocation(Bt.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){Bt.shader=void 0,Bt.texture=void 0,Et("PostProcessPlugin: WebGL context lost")}function a(){i(),Et("PostProcessPlugin: WebGL context restored")}function r(){if(U||!j)return;It(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(Bt.shader),g.bindVertexArray(Bt.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,Bt.texture),e?(Ue.width=k.x,Ue.height=k.y,Fr(tn),tn.drawImage(N,0,0),N.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,Ue)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,it);let c=l=>g.getUniformLocation(Bt.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),ne),g.uniform3f(c("iResolution"),N.width,N.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,it),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),vs(!0)}}},Ro=class{constructor(t,e){p(!$,"LightSystemPlugin already initialized"),p(!Bt,"LightSystemPlugin must be created before PostProcessPlugin"),$=this,this.enabled=!0,this.ambientColor=(e||at).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),En(void 0,i,o,a);function s(){if(U)return;if(!j){console.warn("LightSystemPlugin: WebGL not enabled!");return}$.textureSize||($.textureSize=k.copy()),$.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,$.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,$.textureSize.x,$.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),$.lightShader=Hn(`#version 300 es
 precision highp float;uniform mat4 m;uniform vec2 lightPos;uniform float radius;in vec2 g;out vec2 vWorldPos;void main(){vec2 worldP=lightPos+(g-.5)*2.*radius;gl_Position=m*vec4(worldP,1,1);vWorldPos=worldP;}`,`#version 300 es
 precision highp float;uniform vec2 lightPos;uniform float radius;uniform float fadeRange;uniform vec4 color;in vec2 vWorldPos;out vec4 c;void main(){float dist=distance(vWorldPos,lightPos);float t=clamp((radius-dist)/max(fadeRange,1e-6),0.,1.);c=vec4(color.rgb*t*color.a,1.);}`),$.compositeShader=Hn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
-precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),$.lightVAO=g.createVertexArray(),g.bindVertexArray($.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,Bn);let r=g.getAttribLocation($.lightShader,"g");g.enableVertexAttribArray(r),g.vertexAttribPointer(r,2,g.FLOAT,!1,8,0),$.compositeVAO=g.createVertexArray(),g.bindVertexArray($.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,Bn);let c=g.getAttribLocation($.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(U||!j||!$.enabled||!$.texture)return;It();let r=On,c=$.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,Mr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,$.texture,0),g.viewport(0,0,$.textureSize.x,$.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),hs(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of _t)u.destroyed||u.renderLight();It(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,k.x,k.y),g.useProgram($.compositeShader),g.bindVertexArray($.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,$.texture);let l=$.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),N.width,N.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),ne&&g.bindTexture(g.TEXTURE_2D,ne),hs(r),vs(!0)}function o(){$.texture=void 0,$.lightShader=void 0,$.compositeShader=void 0,$.lightVAO=void 0,$.compositeVAO=void 0,Et("LightSystemPlugin: WebGL context lost")}function a(){s(),Et("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(U||!j||!this.lightShader)return;It(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*K).divide(k),s=Mt.rotate(-et),i=b(-1).subtract(s.multiply(e)),o=ut(et),a=rt(et),r=[e.x*o,e.y*a,0,0,-e.x*a,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,r),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),vs(!0)}},Po=class extends qe{constructor(t,e,s,i){super(t,b(1),void 0,0,s),p(R(e)&&e>=0,"Light radius must be a non-negative number"),p(i===void 0||R(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){$&&$.drawLight(this)}},Lo=class extends ys{constructor(t){super(void 0),!(!Kt||U)&&(this.randomness=0,this.sampleChannels=Cc(...t),this.sampleRate=Kn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Ur=0;Oo=class{constructor(t=pt){p(!C,"UI system already initialized"),C=this,this.activateOnPress=!1,this.defaultColor=H,this.defaultLineColor=at,this.defaultTextColor=at,this.defaultButtonColor=Be(0,0,.7),this.defaultHoverColor=Be(0,0,.9),this.defaultDisabledColor=Be(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Es,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=xe,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Pe(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var a;return(a=this._keyInputObject)==null?void 0:a.onKeyDown(o)},En(s,i);function e(o){let a,r;o.parent?(a=o.parent.nativePos,r=o.parent.size):(a=C.screenToNative(k.scale(.5)),r=C.nativeHeight?b(k.x*C.nativeHeight/k.y,C.nativeHeight):k);let c=o.anchor;o.nativePos=a.add(r.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){C.activeObject&&!C.activeObject.visible&&(C.activeObject=void 0),C.lastHoverObject=C.hoverObject,C.hoverObject=void 0,ds(0)&&(C.navigationMode=!1,C.navigationObject=void 0),C.keyInputObject&&(C.activeObject=C.keyInputObject,C.hoverObject=C.keyInputObject,C.navigationMode=!1,C.navigationObject=void 0);let o=C.getNavigableObjects();if(!o.length)C.navigationObject=void 0;else if(!C.keyInputObject){if(o.includes(C.navigationObject)||(C.navigationObject=void 0),le||C.navigationMode&&!C.navigationObject&&(C.navigationObject=o.find(r=>r.navigationAutoSelect)),!C.navigationTimer.active()){let r=ae(C.getNavigationDirection());if(r){let c;if(C.navigationObject){let l=o.indexOf(C.navigationObject),u=ce(l+r,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=r>0?0:o.length-1;c=o[l]}C.navigationObject!==c&&(C.navigationMode=!0,C.hoverObject=void 0,C.navigationObject=c,C.navigationTimer.set(C.navigationDelay),c.soundPress&&c.soundPress.play())}}C.navigationObject&&C.getNavigationWasPressed()&&C.navigationObject.navigatePressed()}for(let r=C.uiObjects.length;r--;){let c=C.uiObjects[r];c.parent||a(c)}C.uiObjects=C.uiObjects.filter(r=>!r.destroyed);function a(r){if(!(r.destroyed||!r.visible)){e(r);for(let c=r.children.length;c--;){let l=r.children[c];l&&a(l)}r.destroyed||r.update()}}}function i(){let o=C.uiContext;if(o.save(),C.nativeHeight){let r=k.y/C.nativeHeight;o.translate(-r*k.x/2,0),o.scale(r,r),o.translate(k.x/2/r,0)}function a(r){if(r.visible){e(r),r.render();for(let c of r.children)a(c)}}if(C.uiObjects.forEach(r=>r.parent||a(r)),Ur>0){let r=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)r(u,l)};C.uiObjects.forEach(c=>c.parent||r(c))}o.restore()}}drawRect(t,e,s=H,i=0,o=at,a=0,r,c=at,l=0,u=b()){p(O(t),"pos must be a vec2"),p(O(e),"size must be a vec2"),p(W(s),"color must be a color"),p(R(i),"lineWidth must be a number"),p(W(o),"lineColor must be a color"),p(R(a),"cornerRadius must be a number");let h=C.uiContext;if(r){let f=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();f.addColorStop(0,d),f.addColorStop(.5,r.toString()),f.addColorStop(1,d),h.fillStyle=f}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),a&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,a):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=C.defaultLineWidth,i=C.defaultLineColor){p(O(t),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(R(s),"lineWidth must be a number"),p(W(i),"lineColor must be a color");let o=C.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=C.defaultColor,o=0,a=!1,r=at,c=0,l=b()){let u=C.uiContext;(c||l.x||l.y)&&r.a>0&&(u.shadowColor=r.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),Ft(t,e,s,i,o,a,xe,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=C.defaultColor,o=C.defaultLineWidth,a=C.defaultLineColor,r="center",c=C.defaultFont,l="",u=!0,h=void 0,f=at,d=0,y=b()){let x=C.uiContext;f.a>0&&(h&&rn(t,e.add(h),s.y,f,o,a,r,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=f.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),rn(t,e,s.y,i,o,a,r,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[a,r]of this._dragListeners)document.removeEventListener(a,r);this._dragListeners=[];let o=(a,r)=>{let c=l=>{l.preventDefault(),a&&a(l)};document.addEventListener(r,c),this._dragListeners.push([r,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!C.nativeHeight)return t;let e=k.y/C.nativeHeight,s=1/e,i=t.copy();return i.x+=e*k.x/2,i.x*=s,i.y*=s,i.x-=s*k.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=C.uiObjects.length;s--;){let i=C.uiObjects[s];C.confirmDialog&&i!==C.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=C.navigationDirection===1,e=C.navigationDirection===2;if(jn){let l=fs(0,At),u=yo(At);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",a="ArrowRight";if(e)return Gt(s)||Gt(o)?-1:Gt(i)||Gt(a)?1:0;let r=t?s:o,c=t?i:a;return Gt(r)?-1:Gt(c)?1:0}getNavigationOtherDirection(){if(C.navigationDirection===2)return 0;let t=C.navigationDirection===1;if(jn){let i=fs(0,At),o=yo(At);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return Gt(e)?-1:Gt(s)?1:0}getNavigationWasPressed(){return jn?Er(0,At):Bt("Space")||Bt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){p(!C.confirmDialog);let a=C.navigationDirection;C.navigationDirection=2;let r=new he(b(),i);C.confirmDialog=r,r.onRender=()=>{let d=Be(0,0,0,.7);C.drawRect(b(),b(1e9),d)},r.onUpdate=()=>{Bt(o)&&f()},r.isMouseOverlapping=()=>!0;let c=50,l=new mi(b(0,-50),b(i.x-c,70),t);r.addChild(l);let u=new As(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=Be(0,1,.5),u.onClick=()=>{f(),e&&e()},r.addChild(u);let h=new As(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{f(),s&&s()},r.addChild(h);function f(){p(C.confirmDialog===r),r.destroy(),C.confirmDialog=void 0,C.navigationDirection=a,Ms()}}},he=class{constructor(t=b(),e=b()){var s,i;p(O(t),"ui object pos must be a vec2"),p(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=C.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=C.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=C.defaultTextColor.copy(),this.hoverColor=C.defaultHoverColor.copy(),this.lineColor=C.defaultLineColor.copy(),this.gradientColor=C.defaultGradientColor?C.defaultGradientColor.copy():void 0,this.lineWidth=C.defaultLineWidth,this.cornerRadius=C.defaultCornerRadius,this.font=C.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=C.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=C.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=C.defaultSoundPress,this.soundRelease=C.defaultSoundRelease,this.soundClick=C.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=C.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=C.defaultShadowBlur,this.shadowOffset=(i=C.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),C.uiObjects.push(this)}addChild(t){return p(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){C.activeObject===this&&(C.activeObject=void 0),C.hoverObject===this&&(C.hoverObject=void 0),C.lastHoverObject===this&&(C.lastHoverObject=void 0),C.navigationObject===this&&(C.navigationObject=void 0),C.keyInputObject===this&&(C.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!ni)return!1;let t=le?this.size.add(b(this.extraTouchSize||0)):this.size,e=C.screenToNative(qt);return Ys(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===C.activeObject&&(C.activeObject=void 0),this===C.keyInputObject&&(C.keyInputObject=void 0)),C.keyInputObject)return;let t=C.lastHoverObject===this,e=this.isActiveObject(),s=rs(0),i=this.dragActivate?s:ds(0);this.canBeHover&&(C.navigationMode||(i||e||!s&&!le)&&!C.hoverObject&&this.isMouseOverlapping()&&(C.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||ds(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),C.activeObject&&!e&&C.activeObject.onRelease(),C.activeObject=this,C.activateOnPress&&this.click(!this.soundPress)),C.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Ar(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);C.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return C.hoverObject===this}isActiveObject(){return C.activeObject===this}isNavigationObject(){return C.navigationObject===this}isKeyInputObject(){return C.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
+precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),$.lightVAO=g.createVertexArray(),g.bindVertexArray($.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,Bn);let r=g.getAttribLocation($.lightShader,"g");g.enableVertexAttribArray(r),g.vertexAttribPointer(r,2,g.FLOAT,!1,8,0),$.compositeVAO=g.createVertexArray(),g.bindVertexArray($.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,Bn);let c=g.getAttribLocation($.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(U||!j||!$.enabled||!$.texture)return;It();let r=On,c=$.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,Mr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,$.texture,0),g.viewport(0,0,$.textureSize.x,$.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),hs(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of _t)u.destroyed||u.renderLight();It(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,k.x,k.y),g.useProgram($.compositeShader),g.bindVertexArray($.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,$.texture);let l=$.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),N.width,N.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),se&&g.bindTexture(g.TEXTURE_2D,se),hs(r),vs(!0)}function o(){$.texture=void 0,$.lightShader=void 0,$.compositeShader=void 0,$.lightVAO=void 0,$.compositeVAO=void 0,Et("LightSystemPlugin: WebGL context lost")}function a(){s(),Et("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(U||!j||!this.lightShader)return;It(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*K).divide(k),s=Mt.rotate(-nt),i=b(-1).subtract(s.multiply(e)),o=ht(nt),a=rt(nt),r=[e.x*o,e.y*a,0,0,-e.x*a,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,r),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),vs(!0)}},Po=class extends qe{constructor(t,e,s,i){super(t,b(1),void 0,0,s),p(R(e)&&e>=0,"Light radius must be a non-negative number"),p(i===void 0||R(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){$&&$.drawLight(this)}},Lo=class extends ys{constructor(t){super(void 0),!(!Qt||U)&&(this.randomness=0,this.sampleChannels=Cc(...t),this.sampleRate=Kn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Ur=0;Oo=class{constructor(t=pt){p(!C,"UI system already initialized"),C=this,this.activateOnPress=!1,this.defaultColor=H,this.defaultLineColor=at,this.defaultTextColor=at,this.defaultButtonColor=Be(0,0,.7),this.defaultHoverColor=Be(0,0,.9),this.defaultDisabledColor=Be(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Es,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=xe,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Pe(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var a;return(a=this._keyInputObject)==null?void 0:a.onKeyDown(o)},En(s,i);function e(o){let a,r;o.parent?(a=o.parent.nativePos,r=o.parent.size):(a=C.screenToNative(k.scale(.5)),r=C.nativeHeight?b(k.x*C.nativeHeight/k.y,C.nativeHeight):k);let c=o.anchor;o.nativePos=a.add(r.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){C.activeObject&&!C.activeObject.visible&&(C.activeObject=void 0),C.lastHoverObject=C.hoverObject,C.hoverObject=void 0,ds(0)&&(C.navigationMode=!1,C.navigationObject=void 0),C.keyInputObject&&(C.activeObject=C.keyInputObject,C.hoverObject=C.keyInputObject,C.navigationMode=!1,C.navigationObject=void 0);let o=C.getNavigableObjects();if(!o.length)C.navigationObject=void 0;else if(!C.keyInputObject){if(o.includes(C.navigationObject)||(C.navigationObject=void 0),le||C.navigationMode&&!C.navigationObject&&(C.navigationObject=o.find(r=>r.navigationAutoSelect)),!C.navigationTimer.active()){let r=ae(C.getNavigationDirection());if(r){let c;if(C.navigationObject){let l=o.indexOf(C.navigationObject),u=ce(l+r,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=r>0?0:o.length-1;c=o[l]}C.navigationObject!==c&&(C.navigationMode=!0,C.hoverObject=void 0,C.navigationObject=c,C.navigationTimer.set(C.navigationDelay),c.soundPress&&c.soundPress.play())}}C.navigationObject&&C.getNavigationWasPressed()&&C.navigationObject.navigatePressed()}for(let r=C.uiObjects.length;r--;){let c=C.uiObjects[r];c.parent||a(c)}C.uiObjects=C.uiObjects.filter(r=>!r.destroyed);function a(r){if(!(r.destroyed||!r.visible)){e(r);for(let c=r.children.length;c--;){let l=r.children[c];l&&a(l)}r.destroyed||r.update()}}}function i(){let o=C.uiContext;if(o.save(),C.nativeHeight){let r=k.y/C.nativeHeight;o.translate(-r*k.x/2,0),o.scale(r,r),o.translate(k.x/2/r,0)}function a(r){if(r.visible){e(r),r.render();for(let c of r.children)a(c)}}if(C.uiObjects.forEach(r=>r.parent||a(r)),Ur>0){let r=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)r(u,l)};C.uiObjects.forEach(c=>c.parent||r(c))}o.restore()}}drawRect(t,e,s=H,i=0,o=at,a=0,r,c=at,l=0,u=b()){p(O(t),"pos must be a vec2"),p(O(e),"size must be a vec2"),p(W(s),"color must be a color"),p(R(i),"lineWidth must be a number"),p(W(o),"lineColor must be a color"),p(R(a),"cornerRadius must be a number");let h=C.uiContext;if(r){let f=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();f.addColorStop(0,d),f.addColorStop(.5,r.toString()),f.addColorStop(1,d),h.fillStyle=f}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),a&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,a):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=C.defaultLineWidth,i=C.defaultLineColor){p(O(t),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(R(s),"lineWidth must be a number"),p(W(i),"lineColor must be a color");let o=C.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=C.defaultColor,o=0,a=!1,r=at,c=0,l=b()){let u=C.uiContext;(c||l.x||l.y)&&r.a>0&&(u.shadowColor=r.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),jt(t,e,s,i,o,a,xe,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=C.defaultColor,o=C.defaultLineWidth,a=C.defaultLineColor,r="center",c=C.defaultFont,l="",u=!0,h=void 0,f=at,d=0,y=b()){let x=C.uiContext;f.a>0&&(h&&rn(t,e.add(h),s.y,f,o,a,r,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=f.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),rn(t,e,s.y,i,o,a,r,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[a,r]of this._dragListeners)document.removeEventListener(a,r);this._dragListeners=[];let o=(a,r)=>{let c=l=>{l.preventDefault(),a&&a(l)};document.addEventListener(r,c),this._dragListeners.push([r,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!C.nativeHeight)return t;let e=k.y/C.nativeHeight,s=1/e,i=t.copy();return i.x+=e*k.x/2,i.x*=s,i.y*=s,i.x-=s*k.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=C.uiObjects.length;s--;){let i=C.uiObjects[s];C.confirmDialog&&i!==C.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=C.navigationDirection===1,e=C.navigationDirection===2;if(jn){let l=fs(0,At),u=yo(At);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",a="ArrowRight";if(e)return Ft(s)||Ft(o)?-1:Ft(i)||Ft(a)?1:0;let r=t?s:o,c=t?i:a;return Ft(r)?-1:Ft(c)?1:0}getNavigationOtherDirection(){if(C.navigationDirection===2)return 0;let t=C.navigationDirection===1;if(jn){let i=fs(0,At),o=yo(At);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return Ft(e)?-1:Ft(s)?1:0}getNavigationWasPressed(){return jn?Er(0,At):Nt("Space")||Nt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){p(!C.confirmDialog);let a=C.navigationDirection;C.navigationDirection=2;let r=new he(b(),i);C.confirmDialog=r,r.onRender=()=>{let d=Be(0,0,0,.7);C.drawRect(b(),b(1e9),d)},r.onUpdate=()=>{Nt(o)&&f()},r.isMouseOverlapping=()=>!0;let c=50,l=new mi(b(0,-50),b(i.x-c,70),t);r.addChild(l);let u=new As(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=Be(0,1,.5),u.onClick=()=>{f(),e&&e()},r.addChild(u);let h=new As(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{f(),s&&s()},r.addChild(h);function f(){p(C.confirmDialog===r),r.destroy(),C.confirmDialog=void 0,C.navigationDirection=a,Ms()}}},he=class{constructor(t=b(),e=b()){var s,i;p(O(t),"ui object pos must be a vec2"),p(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=C.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=C.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=C.defaultTextColor.copy(),this.hoverColor=C.defaultHoverColor.copy(),this.lineColor=C.defaultLineColor.copy(),this.gradientColor=C.defaultGradientColor?C.defaultGradientColor.copy():void 0,this.lineWidth=C.defaultLineWidth,this.cornerRadius=C.defaultCornerRadius,this.font=C.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=C.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=C.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=C.defaultSoundPress,this.soundRelease=C.defaultSoundRelease,this.soundClick=C.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=C.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=C.defaultShadowBlur,this.shadowOffset=(i=C.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),C.uiObjects.push(this)}addChild(t){return p(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){C.activeObject===this&&(C.activeObject=void 0),C.hoverObject===this&&(C.hoverObject=void 0),C.lastHoverObject===this&&(C.lastHoverObject=void 0),C.navigationObject===this&&(C.navigationObject=void 0),C.keyInputObject===this&&(C.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!ni)return!1;let t=le?this.size.add(b(this.extraTouchSize||0)):this.size,e=C.screenToNative(Ht);return Ys(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===C.activeObject&&(C.activeObject=void 0),this===C.keyInputObject&&(C.keyInputObject=void 0)),C.keyInputObject)return;let t=C.lastHoverObject===this,e=this.isActiveObject(),s=rs(0),i=this.dragActivate?s:ds(0);this.canBeHover&&(C.navigationMode||(i||e||!s&&!le)&&!C.hoverObject&&this.isMouseOverlapping()&&(C.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||ds(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),C.activeObject&&!e&&C.activeObject.onRelease(),C.activeObject=this,C.activateOnPress&&this.click(!this.soundPress)),C.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Ar(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);C.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return C.hoverObject===this}isActiveObject(){return C.activeObject===this}isNavigationObject(){return C.navigationObject===this}isKeyInputObject(){return C.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
 text = `+this.text),(this.nativePos.x||this.nativePos.y)&&(t+=`
 nativePos = `+this.nativePos),(this.localPos.x||this.localPos.y)&&(t+=`
 localPos = `+this.localPos),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.color&&(t+=`
-color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?$a:this.disabled?Za:this.interactive?ir:Qa:Ka;C.drawRect(this.nativePos,this.size,xe,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},mi=class extends he{constructor(t,e,s="",i="center",o=C.defaultFont){super(t,e),p(q(s),"ui text must be a string"),p(["left","center","right"].includes(i),"ui text align must be left, center, or right"),p(q(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=xe,this.shadowColor=xe,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();C.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Do=class extends he{constructor(t,e,s=""){super(t,e),p(q(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){C.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0,C.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,a=i-s,r=o-a/2,c=o+a/2,l=C.screenToNative(qt);this.value=e?Jt(l.x,r,c):Jt(l.y,c,r)}else if(this.isNavigationObject()){let e=C.getNavigationOtherDirection();C.navigationTimer.active()||(this.value=z(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=st(s,this.cornerRadius*2),a=Yt(o,e,this.value),r=(a-e)*(t?.5:-.5),c=this.nativePos.add(t?b(r,0):b(0,r)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(a,this.size.y):b(this.size.x,a);C.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=z(t?this.value:1-this.value),a=(e-s)*(o-.5),r=this.nativePos.add(t?b(a,0):b(0,a)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);C.drawRect(r,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();C.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},Go=class extends he{constructor(t,e,s,i=!1,o=!1,a=1){super(t,e||b()),p(q(s),"video src must be a string"),p(R(a),"video volume must be a number"),this.color=at,this.cornerRadius=0,this.volume=a,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=z(a*Sn),this.video.muted=!Kt,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),p(R(s),"ui layout gap must be a number"),p(R(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=xe,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=xe),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=cs(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let f=0;f=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=V(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=H,e=at,s=.1,i,o){this.getFixtureList().forEach(a=>{m.castShapeObject(a.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(a,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(a=>go(a,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(a=>go(a,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){p(R(e),"density must be a number"),p(R(s),"friction must be a number"),p(R(i),"restitution must be a number");let a=new m.instance.b2FixtureDef;return a.set_shape(t),a.set_density(e),a.set_friction(s),a.set_restitution(i),a.set_isSensor(o),this.body.CreateFixture(a)}addBox(t=b(1),e=b(),s=0,i,o,a,r){p(O(t),"size must be a Vector2"),p(t.x>0&&t.y>0,"size must be positive"),p(O(e),"offset must be a Vector2"),p(R(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,a,r)}addPoly(t,e,s,i,o){p(me(t),"points must be an array");function a(c){p(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let f=0,d=0;f>2]=c[f].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[f].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let r=a(t);return this.addShape(r,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,a){p(R(t)&&t>0,"diameter must be a positive number"),p(R(e)&&e>2,"sides must be a positive number greater than 2");let r=[],c=t/2;for(let l=e;l--;)r.push(b(c,0).rotate((l+.5)/e*Q*2));return this.addPoly(r,s,i,o,a)}addRandomPoly(t=1,e,s,i,o){p(R(t)&&t>0,"diameter must be a positive number");let a=sr(3,9),r=[],c=t/2;for(let l=a;l--;)r.push(b(yt(c/2,c*1.5),0).rotate(l/a*Q*2));return this.addPoly(r,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,a){p(R(t)&&t>0,"diameter must be a positive number"),p(O(e),"offset must be a Vector2");let r=new m.instance.b2CircleShape;return r.set_m_p(m.vec2dTo(e)),r.set_m_radius(t/2),this.addShape(r,s,i,o,a)}addEdge(t,e,s,i,o,a){p(O(t),"point1 must be a Vector2"),p(O(e),"point2 must be a Vector2");let r=new m.instance.b2EdgeShape;return r.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(r,s,i,o,a)}addEdgeList(t,e,s,i,o){p(me(t),"points must be an array");let a=[],r=[];for(let c=0;ct[ce(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},bi=class extends Cs{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeStatic;super(t,e,s,i,o,r,a)}},jo=class extends Cs{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeKinematic;super(t,e,s,i,o,r,a)}},Bo=class extends bi{constructor(t){p(t instanceof bs,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(a,r)=>a+r*this.size.x,o=(a,r)=>!s[i(a,r)]&&this.tileLayer.getCollisionData(b(a,r))>0;for(let a=0;ai.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ti.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,te.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Pc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,te.indexOf(this)<0&&te.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&te.indexOf(this)>=0}getPercent(){return Jt(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return Pa(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=te.indexOf(this);t>=0&&te.splice(t,1),this.thenCallback=void 0}},Ti={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-ut(n*(Q/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*rt((37-40*n)*Q/6),SPRING:n=>1-(rt(Q*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ti.PIECEWISE(n,Ti.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let a=1-o,r=3*a*a*o,c=3*a*o*o,l=o**3;return[r*n+c*e+l,r*t+c*s+l]};return o=>{let a=0,r=1;for(let c=0;c<128;c++){let l=(a+r)/2,[u,h]=i(l);if(ot(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(Pt(t.x-e),Pt(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&Ct(r.posWorld,ao,V(1,0,0,st(.2,l*.05)),this.debugTime):Ct(r.posWorld,ao,V(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){p(t&&e,"aStarSearch needs both endpoints"),p(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),p(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,a=s[0].f;for(let c=1;cthis.maxLoop)break;r.isOpen=!1,s.splice(o,1),r.isClosed=!0,this.debug&&this.debugTime>0&&Ct(r.posWorld,ao,V(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(r.pos.x+l,r.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(r.pos.x+l,r.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(r.pos.x,r.pos.y+c);if(!w||!w.walkable)continue;h=fd}let f=r.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(f>=u.g)continue;u.parent=r,u.g=f;let d=ot(e.pos.x-u.pos.x),y=ot(e.pos.y-u.pos.y),x=tt(d,y)+(Math.SQRT2-1)*st(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){p(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,a=Pt(t.x-i),r=Pt(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let f=-c;f<=c;++f){if(c>0&&ot(f)!==c&&ot(h)!==c)continue;let d=this.getNode(a+f,r+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Ht(i.posWorld,.3,V(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=tt(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Ht(i.posWorld,.3,V(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=tt(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Ht(i.posWorld,.3,V(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,E=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,P=E*E+A*A,F=T0&&Ht(i.posWorld,.3,V(0,1,0,.5),this.debugTime),l===h&&u===f){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=tt(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&Ee(o.posWorld,t[t.length-1].posWorld,V(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){p(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),p(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=ot(s),a=ot(i),r=ae(s),c=ae(i),l=t.x,u=t.y;if(a===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=r,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ar.posWorld.copy());if(this.debug&&this.debugTime>0&&a.length>0){for(let r=1;rpd,bootGameHost:()=>yd,default:()=>gd});var ks=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ni=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},zi=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let a=e._subs.get(i)||[],r={handler:o,scope:s};return a.push(r),e._subs.set(i,a),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(r);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let a=e._subs.get(i);if(!a)return;let r=a.findIndex(c=>c.handler===o&&c.scope===s);r>=0&&a.splice(r,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let a=o.slice();for(let r of a)try{r.handler(i)}catch(c){Ye("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(a=>a.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Ji.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Ji).join("/")+"\uFF09")}},Ji=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Hr(n){let t=n||{},e=new Ni(t.clock),s=new ks(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new zi(e),a=typeof t.audioFactory=="function"?t.audioFactory:null,r=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,f=new Map,d=0,y=0;function x(){if(r)return r;if(!a)return c||(Vi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{r=a()}catch(E){Ye("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",E),r=null}return r}function v(){if(u)return u;if(!l)return h||(Vi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(E){Ye("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",E),u=null}return u}function w(E,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(P){let F=d++;return f.set(F,P),{cancel(){f.delete(F)}}},getInput(){return o.sourceFor(E)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(E){y+=1;let A=Array.from(f.values());for(let T of A)try{T(E,y)}catch(P){Ye("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,P)}},frameCount(){return y},inputBridge:o,deriveContextFor(E,A){let T=zc(i,E),P=new ks(T);return w(A==null?E:A,P)}};return Object.defineProperty(_,Ui,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Ui=Symbol("zaomeng.coreProtocol.contextBundle"),Gs=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return Vi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),Ye("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let a=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:a}),Ye("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,a)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Ui],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Ui],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let a=this._initOrder[o],r=this._plugins.get(a);if(r&&typeof r.dispose=="function")try{r.dispose(),t.push(a)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:a,error:l}),Ye("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(a)}catch(c){Ye("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let a=0;a<32;a+=8){let r=i>>>a&255;e^=r,e=Math.imul(e,s)>>>0}let o=String(t);for(let a=0;a>>0,e^=r>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function Ye(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Vi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Ji)),Xr="core-protocol-v0";var Yr=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Wi=Yr.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set(Yr);function qi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var $r=qi("runtime-probe::seed::v1");function Fs(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Fs).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Fs(n[e])).join(",")+"}"}function Kr(n){let t=Fs(n.extra==null?null:n.extra),e=Fs(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=$r,e=-1;for(let s=0;stypeof E=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,a=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",r=()=>0,c=!1,l=0,u=$r,h=[],f=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(E,A){let T=null;if(!Uc.has(E))T="unknown_anchor";else{f.has(E)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let F=Wi[E];FE.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=E.getInput().on(a,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:a})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(E=>({...E}))},toJSONL(){return h.map(E=>JSON.stringify(E)).join(`
-`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Zr(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(r,c,l)=>(i("math.lerp"),o.lerp(r,c,l)),smoothStep:r=>(i("math.smoothStep"),o.smoothStep(r)),easing:Object.fromEntries(Object.keys(o.easing).map(r=>[r,c=>(i("math.easing."+r),o.easing[r](c))]))},particles:{spawnEmitter(r){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(r.pos.x,r.pos.y)),l=t.cameraScale,u=r.emitTime!=null?r.emitTime:r.count!=null?1/60:0,h=r.emitRate!=null?r.emitRate:r.count!=null?r.count*60:100,f=(r.speed!=null?r.speed:0)/l/60,d=r.damping!=null?r.damping:1,y=r.colorStart||{r:1,g:1,b:1,a:1},x=r.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,r.angle!=null?r.angle:0,(r.emitSize!=null?r.emitSize:0)/l,u,h,r.coneAngle!=null?r.coneAngle:Math.PI,void 0,v,v,w,w,r.particleTime!=null?r.particleTime:.5,(r.sizeStart!=null?r.sizeStart:6)/l,(r.sizeEnd!=null?r.sizeEnd:0)/l,f,0,d,1,r.gravityScale!=null?r.gravityScale:0,Math.PI,.1,0,!1,r.additive!=null?r.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:r=>{i("audio.synth.synthSfx");try{return t.zzfxG(...r)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(r,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(r,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function fe(n){return n<0?0:n>1?1:n}function ta(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),a=t.OUT(s),r=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,f)=>n.lerp(u,h,f),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(fe(u)),quadIn:u=>e(fe(u)),quadOut:u=>i(fe(u)),quadInOut:u=>o(fe(u)),cubicIn:u=>s(fe(u)),cubicOut:u=>a(fe(u)),cubicInOut:u=>r(fe(u)),backIn:u=>t.BACK(fe(u)),backOut:u=>c(fe(u)),elasticIn:u=>t.ELASTIC(fe(u)),elasticOut:u=>l(fe(u))}}}var $e=2,js=1/60;async function ea(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",a=n.engineMode||"real",r=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},f=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let E=0,A=null,T=null,P=null,F=null,bt=[],ct={},gt=null;function wt(D,ft){try{P&&P.mark(D,ft)}catch(oe){v.push({type:"mark",message:String(oe&&oe.message||oe)})}}function Ut(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(ct)}async function L(D,ft){A=Hr({context2d:D,seed:i,audioFactory:S,clock:()=>E,engineFactory:()=>Zr({LJS:a==="real"?s:null,engineMath:a==="real"?ta(s):null,engineMode:a,recHook:y})});let oe=new Gs;for(let ve of f)oe.register(ve);oe.useContext(A.context),F=oe.initAll(),bt=oe.list().concat(["runtime-probe"]),P=Qr({pluginSet:bt,inputAnchorType:"pointerdown",autoBoot:!0});let re=A.deriveContextFor("runtime-probe","runtime-probe");wt("t_boot",{by:"game-host",stage:"pre-init",engineMode:a}),wt("t_plugins_ready",{initialized:F.initialized.length,ok:F.ok});let ji=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(ji),await T.init({ctx:A.context,mainContext:D,canvas:ft(),seed:i}),gt=T&&typeof T._forensicsView=="function"?T._forensicsView():null,wt("t_game_init",{hasForensics:!!gt}),M(),wt("t_first_paint",{frame:A.frameCount()});try{P.init(re)}catch(ve){v.push({type:"probe-init",message:String(ve&&ve.message||ve)})}wt("t_game_start",{mode:o,engineMode:a}),Ut(),d(ht,{bundle:A,game:T,probe:P,checklist:ct,uncaught:v,pluginSet:bt,initRes:F,getGameForensics:()=>gt,mark:wt,stepOneFrame:M})}let I=null;function M(D){let ft=typeof D=="number"?D:js;T&&(E+=ft*1e3,T.update(ft),a==="stub"&&I&&T.render(I),Ut())}function B(D){for(let ft=0;ft{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let ht={seed:i,mode:o,engineMode:a,protocol:Xr,frameCount:()=>A?A.frameCount():0,stepFrames:B,startRaf:()=>Me(),stopRaf:()=>G(),tap(D,ft){nt(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:ft}),A.inputBridge._emit("pointerup",{x:D,y:ft}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>gt?gt.state():{phase:"booting"}};function xt(D){let ft=A.inputBridge;function oe(re,ji){let ve=D.getBoundingClientRect();return{x:(re-ve.left)/ve.width*r,y:(ji-ve.top)/ve.height*c}}D.addEventListener("pointerdown",re=>{nt(),ft._emit("pointerdown",oe(re.clientX,re.clientY))}),D.addEventListener("pointermove",re=>{ft._emit("pointermove",oe(re.clientX,re.clientY))}),D.addEventListener("pointerup",re=>{ft._emit("pointerup",oe(re.clientX,re.clientY))})}let dt=0,vt=!1,Tt=0;function de(D){if(!vt)return;Tt===0&&(Tt=D);let ft=(D-Tt)/1e3;Tt=D,ft>.05&&(ft=.05),M(ft),dt=window.requestAnimationFrame(de)}function Me(){a==="stub"&&(vt||(vt=!0,Tt=0,dt=window.requestAnimationFrame(de)))}function G(){vt=!1,dt&&window.cancelAnimationFrame(dt),dt=0}function J(D){D.width=r*$e,D.height=c*$e,D.style.width=r+"px",D.style.height=c+"px";let ft=D.getContext("2d",{willReadFrequently:!0});return ft.setTransform($e,0,0,$e,0,0),ft}async function Rt(){let D=J(t);return I=D,await L(D,()=>t),xt(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),Me()),ht}let Ie=()=>{},X=()=>{};function Y(){window.__gameHostEngineInitFired=!0}function kt(){Ie()}function ie(){}function Vt(){X()}function Wr(){}async function Ic(D){await L(D,()=>s.mainCanvas),xt(s.mainCanvas),Ie=()=>{T&&(E+=js*1e3,T.update(js))},X=()=>{if(T){D.save(),D.setTransform($e,0,0,$e,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(a!=="real")return await Rt();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(r*$e,c*$e));let Fi=document.createElement("div");return Fi.id="engine-root",document.body.appendChild(Fi),await s.engineInit(Y,kt,ie,Vt,Wr,[],Fi).then(()=>Ic(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),ht}var Hi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),a=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:a}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:a}=this._cellRange(e),r=[];for(let l=i;l<=a;l++)for(let u=s;u<=o;u++){let h=u+","+l,f=this._cells.get(h);f||(f=new Set,this._cells.set(h,f)),f.add(t),r.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:r})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),a=new Set;for(let r=s;r<=o;r++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+r);if(l)for(let u of l)a.add(u)}return this._collect(a)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),a=this._cells.get(i+","+o);return a?this._collect(new Set(a)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function na(n){let t=n||{},e=new Hi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function sa(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function Wt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=Wt(n),n*n),Yc=n=>(n=Wt(n),1-(1-n)*(1-n)),$c=n=>(n=Wt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=Wt(n),n*n*n),Qc=n=>{n=Wt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=Wt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),ra=2*Math.PI/3,ia=2*Math.PI/4.5,tl=n=>(n=Wt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*ra)),el=n=>(n=Wt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*ra)+1),nl=n=>(n=Wt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*ia))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*ia)/2+1),Ns=1.70158,Bs=Ns*1.525,aa=Ns+1,sl=n=>(n=Wt(n),aa*n*n*n-Ns*n*n),il=n=>{n=Wt(n);let t=n-1;return 1+aa*t*t*t+Ns*t*t},ol=n=>(n=Wt(n),n<.5?Math.pow(2*n,2)*((Bs+1)*2*n-Bs)/2:(Math.pow(2*n-2,2)*((Bs+1)*(n*2-2)+Bs)+2)/2),rl=n=>Wt(n),oa=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return oa;let e=i=>typeof t[i]=="function"?o=>t[i](Wt(o)):oa[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var Xi=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let a of o){this._records.set(a,null);let r=t.on(a,c=>{this._records.set(a,c.tMs)});this._subs.push(r)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function ca(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(a){let r=a.getInput();e=new Xi(r,a.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=a.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function zs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Yi(t):null}function Yi(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Yi(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:zs(n.sizeCurve,0),sizeEnd:zs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:zs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:zs(n.alphaCurve,1)},additive:!1}}function la(n){let t=n||{},e=null,s=null,i=null,o=new Map,a=0,r={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,f=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=f+(1-f)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,P=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*P,d.y=Math.cos(d._phase*1.3)*P}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,P=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(P)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let P=T.canvas?T.canvas.width:0,F=T.canvas?T.canvas.height:0;T.fillRect(0,0,P,F),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(P=>{_(P)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,P,F){let bt=typeof A=="string"?ul(A):Yi(A);if(!bt)return-1;F&&(bt=Object.assign(bt,F));let ct=a++;if(!i)return o.set(ct,r),ct;let gt=i.spawnEmitter(hl(bt,T,P));return o.set(ct,gt),ct},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,f=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?f:1},getTimeScale(){return l},shakeScreen(A,T,P){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=P==null?30:P,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,P){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=P==null?4:P,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ua(n){let t=St(n.r)/255,e=St(n.g)/255,s=St(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),a=(i+o)/2,r=0,c=0,l=i-o;return l>1e-12&&(c=a>.5?l/(2-i-o):l/(i+o),i===t?r=(e-s)/l%6:i===e?r=(s-t)/l+2:r=(t-e)/l+4,r*=60,r<0&&(r+=360)),{h:r,s:c,l:a}}function ha(n){let t=(n.h%360+360)%360,e=Ke(n.s),s=Ke(n.l);if(e<1e-12){let r=Math.round(s*255);return{r,g:r,b:r}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,a=t/360;return{r:Math.round($i(o,i,a+1/3)*255),g:Math.round($i(o,i,a)*255),b:Math.round($i(o,i,a-1/3)*255)}}function $i(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function St(n){return n<0?0:n>255?255:n}function Ke(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:St(r.r),g:St(r.g),b:St(r.b)})),to:o}}function Ki(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ua(n),s=e.h+(t.hue||0),i=Ke(e.s*(t.sat==null?1:t.sat)),o=Ke(e.l*(t.light==null?1:t.light));return ha({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function da(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:Qi(t.vignette&&t.vignette.enabled,!1),strength:Zi(t.vignette&&t.vignette.strength,.5)},dither:{enabled:Qi(t.dither&&t.dither.enabled,!1),strength:Zi(t.dither&&t.dither.strength,.5)},scanline:{enabled:Qi(t.scanline&&t.scanline.enabled,!1),strength:Zi(t.scanline&&t.scanline.strength,.5)}};function o(r){let c=r!==void 0?r:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(r){e=r},dispose(){s||(e=null,s=!0)},applyPaletteMap(r,c){return dl(r,c)},applyPaletteMapToBuffer(r,c){return fl(r,c)},lerpPaletteMap(r,c,l){return yl(r,c,l)},shiftHsl(r,c){return ml(r,c)},rgbToHsl(r){return ua(r)},hslToRgb(r){return ha(r)},setPost(r){if(r)for(let c of["vignette","dither","scanline"])r[c]&&(typeof r[c].enabled=="boolean"&&(i[c].enabled=r[c].enabled),typeof r[c].strength=="number"&&(i[c].strength=Ke(r[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(r){o(r)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=Ke(t);if(e<=0)return n;let{data:s,width:i}=n,a=255/(Math.max(2,Math.round(16-e*14))-1);for(let r=0;r+3>2)%i,l=Math.floor((r>>2)/i),u=(bl[l&3][c&3]/16-.5)*a;for(let h=0;h<3;h++){let f=s[r+h]+u,d=Math.round(f/a)*a;s[r+h]=d<0?0:d>255?255:d}}return n}function Qi(n,t){return typeof n=="boolean"?n:t}function Zi(n,t){return typeof n=="number"?Ke(n):t}var eo=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),fa=Object.keys(eo);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let a=i[0]|0;Array.isArray(n.instruments)&&(a<0||a>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${a} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let r=i[1];(r<-1||r>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${r} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function Se(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function pa(n,t){let e=Se(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],a=typeof s.minIntensity=="number"?Se(s.minIntensity):0,r=typeof s.maxIntensity=="number"?Se(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?Se(s.baseVolume):1;if(er)return{id:i,on:!1,volume:0,channelIndices:o};let u=r-a,h=u<=0?1:(e-a)/u,f=Se(Sl(c,h)*l);return{id:i,on:!0,volume:f,channelIndices:o}})}function ga(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,a=Math.max(i.length,o.length);if(a===0)return null;let c=n.createBuffer(2,a,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=Se(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return no("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ya(n){let t=n||{},e=typeof t.masterVolume=="number"?Se(t.masterVolume):1,s=()=>null,i=null,o=null,a={voices:[]},r=1,c=null,l=!1,u=0,h=!1,f=!1;function d(){let S=s();return S==null?(u+=1,h||(to("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return no("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=pa(a,r);if(S.length===0)return 1;let E=0;for(let A of S)A.on&&(E=Math.max(E,A.volume));return E}function v(S,E){typeof E=="number"&&(r=Se(E));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let P=Se(e*x());c=ga(A,T,P,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let E=S.getEngine&&S.getEngine();i=E?E.audio.synth:null},dispose(){f||(w(),f=!0)},loadSong(S){let E=vl(S);return E.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:to("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+E.errors.join("\uFF1B")),E},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){a=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){r=Se(S)},resolveVoices(S){return pa(a,S)},playSfx(S){let E=eo[S];if(!E){to("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(E.params):null;if(!T)return;ga(A,[T,T],e,!1)}catch(T){no("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return eo[S]},listPresets(){return fa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:r,voiceCount:a.voices.length,looping:l,silentNoops:u,presetCount:fa.length}}}}function no(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function to(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function io(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ma(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?io():t.adapter,a=e+":",r=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?a+String(d):a+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(a)===0):[]}catch(d){return Qn("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!so(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return Qn("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return r+=1,l||(Zn("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!so(d))return Zn("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,Zn("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,Zn("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,Zn("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,Qn("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(so(d))try{o.removeItem(u(d))}catch(y){Qn("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){Qn("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:r,rejectedWrites:c}}}}function so(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function Qn(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Zn(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var Cl={w:390,h:844};function xa(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=na({cellSize:96}),s=sa(),i=ca({inputBufferMs:260,inputTypes:["pointerdown"]}),o=la({seed:t,maxParticles:600}),a=da({vignette:{enabled:!0,strength:.22}}),r=ya({masterVolume:.8}),c;try{c=ma()}catch(f){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(f&&f.message)),c=io()}let l=ba({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:a,audioMusic:r,save:l},registerOrder:[e,s,i,o,a,l,r],viewport:Cl,buildFactoryOpts:(f,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ts(n){let t=n||{},e=null,s=null,i=0,o=0,a=[],r=[],c=0,l=0,u="booting",h=null,f=null,d=0,y=0,x=null;function v(L){if(e=L.ctx,s=e.getEngine(),r=E(),A(),A(),u="playing",h=null,c=0,l=0,a.push(e.getInput().on("keydown",w)),a.push(e.getInput().on("pointerdown",_)),s&&s.math&&s.math.lerp(0,1,.5),s&&s.particles)try{s.particles.spawnEmitter({pos:{x:195,y:422},emitRate:5,particleTime:1.2,speed:30,colorStart:{r:.5,g:.8,b:1,a:.3},colorEnd:{r:.2,g:.4,b:.8,a:0}})}catch{}}function w(L){if(u!=="playing")return;let I=L.key;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(I)&&(f=I)}function _(L){u==="gameover"&&S()}function S(){r=E(),A(),A(),u="playing",h=null,c=0,l=0,f=null,d=0}function E(){let L=[];for(let I=0;I<4;I++){L[I]=[];for(let M=0;M<4;M++)L[I][M]={value:0,row:I,col:M,scale:1,merging:!1,newBlock:!1,timeBorn:0}}return L}function A(){let L=[];for(let nt=0;nt<4;nt++)for(let ht=0;ht<4;ht++)r[nt][ht].value===0&&L.push({r:nt,c:ht});if(L.length===0)return!1;let I=L[Math.floor(e.random.next()*L.length)],M=e.random.next()<.9?2:4,B=r[I.r][I.c];return B.value=M,B.newBlock=!0,B.scale=0,B.timeBorn=o,!0}function T(L){if(u!=="playing")return!1;let I=!1,M=r.map(G=>G.map(J=>J.value)),B=[0,1,2,3],nt=[0,1,2,3],ht,xt,dt,vt,Tt,de;L==="up"?(ht=B,xt=nt,dt=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=1,de=0):L==="down"?(ht=B.slice().reverse(),xt=nt,dt=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=-1,de=0):L==="left"?(ht=B,xt=nt,dt=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=0,de=1):L==="right"&&(ht=B,xt=nt.slice().reverse(),dt=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=0,de=-1);function Me(G,J,Rt,Ie){let X=[];for(let Y=0;Y0&&X[X.length-1].value===kt.value){let ie=X[X.length-1];if(ie.value*=2,ie.merged=!0,Rt(G[Y].row,G[Y].col,0),c+=ie.value,I=!0,s&&s.particles){let Vt={x:48.75+ie.col*97.5,y:48.75+ie.row*97.5};try{s.particles.spawnEmitter({pos:Vt,count:15,speed:80,particleTime:.4,sizeStart:6,sizeEnd:12,colorStart:{r:1,g:.9,b:.2,a:1},colorEnd:{r:1,g:.5,b:0,a:0}})}catch{}}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.05,330,,,.18,,1.4])}catch{}}else X.push({row:G[Y].row,col:G[Y].col,value:kt.value,merged:!1})}for(let Y=0;Yr[X][Y],(X,Y,kt)=>r[X][Y].value=kt,L)}else for(let G=0;G<4;G++){let J=[];for(let X=0;X<4;X++){let Y=L==="left"?X:3-X;J.push({row:G,col:Y})}Me(J,(X,Y)=>r[X][Y],(X,Y,kt)=>r[X][Y].value=kt,L)}for(let G=0;G<4;G++){for(let J=0;J<4;J++)if(r[G][J].value!==M[G][J]){I=!0;break}if(I)break}return I}function P(L){if(i=e.time.nowMs(),o=i/1e3,d+=L,y=(y+L*5)%360,u!=="playing"){ct();return}if(f){let I=f;if(f=null,T(I)){l++,A();let B=!1;for(let nt=0;nt<4;nt++){for(let ht=0;ht<4;ht++)if(r[nt][ht].value>=2048){B=!0;break}if(B)break}if(B){if(u="gameover",h="win",s&&s.particles)for(let nt=0;nt<3;nt++)try{s.particles.spawnEmitter({pos:{x:195,y:422},count:30,speed:120,particleTime:1,colorStart:{r:1,g:.8,b:0,a:1},colorEnd:{r:1,g:0,b:.5,a:0}})}catch{}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.05,440,.3,.2,.18,.3,1.4])}catch{}return}if(F()&&!bt()){if(u="gameover",h="lose",s&&s.particles)try{s.particles.spawnEmitter({pos:{x:195,y:422},count:40,speed:100,particleTime:.6,colorStart:{r:.8,g:.2,b:.2,a:1},colorEnd:{r:.3,g:0,b:0,a:0}})}catch{}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.1,110,.3,.2,.5,.5,1.4])}catch{}}}}ct()}function F(){for(let L=0;L<4;L++)for(let I=0;I<4;I++)if(r[L][I].value===0)return!1;return!0}function bt(){for(let L=0;L<4;L++)for(let I=0;I<4;I++){let M=r[L][I].value;if(M===0||I<3&&r[L][I+1].value===M||L<3&&r[L+1][I].value===M)return!0}return!1}function ct(){for(let L=0;L<4;L++)for(let I=0;I<4;I++){let M=r[L][I];if(M.newBlock){let B=o-M.timeBorn;B<.2?M.scale=B/.2:(M.scale=1,M.newBlock=!1)}M.merging&&(M.scale=1.1+.1*Math.sin(o*20))}}function gt(L){let I=y;L.fillStyle=`hsl(${I}, 20%, 10%)`,L.fillRect(0,0,390,844);let M=97.5,B=5,nt=0,ht=200;for(let xt=0;xt<4;xt++)for(let dt=0;dt<4;dt++){let vt=nt+dt*(M+B)+B/2,Tt=ht+xt*(M+B)+B/2;L.fillStyle="rgba(255,255,255,0.05)",L.fillRect(vt,Tt,M,M),L.beginPath(),L.roundRect(vt,Tt,M,M,8),L.fill()}for(let xt=0;xt<4;xt++)for(let dt=0;dt<4;dt++){let vt=r[xt][dt];if(vt.value===0)continue;let Tt=nt+dt*(M+B)+B/2,de=ht+xt*(M+B)+B/2,Me=vt.scale||1,G=M*Me,J=Tt+(M-G)/2,Rt=de+(M-G)/2,X={2:"#eee4da",4:"#ede0c8",8:"#f2b179",16:"#f59563",32:"#f67c5f",64:"#f65e3b",128:"#edcf72",256:"#edcc61",512:"#edc850",1024:"#edc53f",2048:"#edc22e"}[vt.value]||"#3c3a32";L.fillStyle=X,L.beginPath(),L.roundRect(J,Rt,G,G,6),L.fill(),L.fillStyle=vt.value<=4?"#776e65":"#f9f6f2",L.font=`bold ${Math.min(36,60*(G/M))}px monospace`,L.textAlign="center",L.textBaseline="middle";let Y=vt.value.toString(),kt=J+G/2,ie=Rt+G/2;L.fillText(Y,kt,ie)}if(L.fillStyle="#f9f6f2",L.font="bold 28px monospace",L.textAlign="center",L.textBaseline="top",L.fillText("2048",195,30),L.font="18px monospace",L.fillText(`Score: ${c}`,195,70),L.fillText(`Moves: ${l}`,195,100),u==="gameover"){L.fillStyle="rgba(0,0,0,0.6)",L.fillRect(0,0,390,844),L.fillStyle="#fff",L.font="bold 36px monospace",L.textBaseline="middle";let xt=h==="win"?"You Win!":"Game Over";L.fillText(xt,195,160),L.font="20px monospace",L.fillText("Tap to restart",195,200)}}function wt(){for(let L of a)try{L.cancel()}catch{}a=[],r=[],c=0,l=0,u="booting"}function Ut(){return{seed:t.seed||"none",state:()=>{let L=[];for(let I=0;I<4;I++){L[I]=[];for(let M=0;M<4;M++)L[I][M]=r[I][M].value}return{phase:u,result:h,score:c,moves:l,board:L}}}}return{init:v,update:P,render:gt,destroy:wt,_forensicsView:Ut}}var pd=ts,gd=ts;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Dc)),s=(t.seed!=null?t.seed:305441741)>>>0,i=xa({seed:s});return ea({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ts,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Nc(md);})();
+color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?$a:this.disabled?Za:this.interactive?ir:Qa:Ka;C.drawRect(this.nativePos,this.size,xe,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},mi=class extends he{constructor(t,e,s="",i="center",o=C.defaultFont){super(t,e),p(q(s),"ui text must be a string"),p(["left","center","right"].includes(i),"ui text align must be left, center, or right"),p(q(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=xe,this.shadowColor=xe,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();C.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Do=class extends he{constructor(t,e,s=""){super(t,e),p(q(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){C.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0,C.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,a=i-s,r=o-a/2,c=o+a/2,l=C.screenToNative(Ht);this.value=e?Ut(l.x,r,c):Ut(l.y,c,r)}else if(this.isNavigationObject()){let e=C.getNavigationOtherDirection();C.navigationTimer.active()||(this.value=z(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=st(s,this.cornerRadius*2),a=$t(o,e,this.value),r=(a-e)*(t?.5:-.5),c=this.nativePos.add(t?b(r,0):b(0,r)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(a,this.size.y):b(this.size.x,a);C.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=z(t?this.value:1-this.value),a=(e-s)*(o-.5),r=this.nativePos.add(t?b(a,0):b(0,a)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);C.drawRect(r,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();C.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},Go=class extends he{constructor(t,e,s,i=!1,o=!1,a=1){super(t,e||b()),p(q(s),"video src must be a string"),p(R(a),"video volume must be a number"),this.color=at,this.cornerRadius=0,this.volume=a,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=z(a*Sn),this.video.muted=!Qt,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),p(R(s),"ui layout gap must be a number"),p(R(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=xe,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=xe),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=cs(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let f=0;f=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=V(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=H,e=at,s=.1,i,o){this.getFixtureList().forEach(a=>{m.castShapeObject(a.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(a,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(a=>go(a,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(a=>go(a,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){p(R(e),"density must be a number"),p(R(s),"friction must be a number"),p(R(i),"restitution must be a number");let a=new m.instance.b2FixtureDef;return a.set_shape(t),a.set_density(e),a.set_friction(s),a.set_restitution(i),a.set_isSensor(o),this.body.CreateFixture(a)}addBox(t=b(1),e=b(),s=0,i,o,a,r){p(O(t),"size must be a Vector2"),p(t.x>0&&t.y>0,"size must be positive"),p(O(e),"offset must be a Vector2"),p(R(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,a,r)}addPoly(t,e,s,i,o){p(me(t),"points must be an array");function a(c){p(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let f=0,d=0;f>2]=c[f].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[f].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let r=a(t);return this.addShape(r,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,a){p(R(t)&&t>0,"diameter must be a positive number"),p(R(e)&&e>2,"sides must be a positive number greater than 2");let r=[],c=t/2;for(let l=e;l--;)r.push(b(c,0).rotate((l+.5)/e*Q*2));return this.addPoly(r,s,i,o,a)}addRandomPoly(t=1,e,s,i,o){p(R(t)&&t>0,"diameter must be a positive number");let a=sr(3,9),r=[],c=t/2;for(let l=a;l--;)r.push(b(yt(c/2,c*1.5),0).rotate(l/a*Q*2));return this.addPoly(r,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,a){p(R(t)&&t>0,"diameter must be a positive number"),p(O(e),"offset must be a Vector2");let r=new m.instance.b2CircleShape;return r.set_m_p(m.vec2dTo(e)),r.set_m_radius(t/2),this.addShape(r,s,i,o,a)}addEdge(t,e,s,i,o,a){p(O(t),"point1 must be a Vector2"),p(O(e),"point2 must be a Vector2");let r=new m.instance.b2EdgeShape;return r.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(r,s,i,o,a)}addEdgeList(t,e,s,i,o){p(me(t),"points must be an array");let a=[],r=[];for(let c=0;ct[ce(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},bi=class extends Cs{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeStatic;super(t,e,s,i,o,r,a)}},jo=class extends Cs{constructor(t,e,s,i=0,o,a=0){let r=m.bodyTypeKinematic;super(t,e,s,i,o,r,a)}},Bo=class extends bi{constructor(t){p(t instanceof bs,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(a,r)=>a+r*this.size.x,o=(a,r)=>!s[i(a,r)]&&this.tileLayer.getCollisionData(b(a,r))>0;for(let a=0;ai.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ti.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,ee.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Pc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,ee.indexOf(this)<0&&ee.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&ee.indexOf(this)>=0}getPercent(){return Ut(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return Pa(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=ee.indexOf(this);t>=0&&ee.splice(t,1),this.thenCallback=void 0}},Ti={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-ht(n*(Q/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*rt((37-40*n)*Q/6),SPRING:n=>1-(rt(Q*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ti.PIECEWISE(n,Ti.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let a=1-o,r=3*a*a*o,c=3*a*o*o,l=o**3;return[r*n+c*e+l,r*t+c*s+l]};return o=>{let a=0,r=1;for(let c=0;c<128;c++){let l=(a+r)/2,[u,h]=i(l);if(ot(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(Pt(t.x-e),Pt(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&Ct(r.posWorld,ao,V(1,0,0,st(.2,l*.05)),this.debugTime):Ct(r.posWorld,ao,V(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){p(t&&e,"aStarSearch needs both endpoints"),p(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),p(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,a=s[0].f;for(let c=1;cthis.maxLoop)break;r.isOpen=!1,s.splice(o,1),r.isClosed=!0,this.debug&&this.debugTime>0&&Ct(r.posWorld,ao,V(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(r.pos.x+l,r.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(r.pos.x+l,r.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(r.pos.x,r.pos.y+c);if(!w||!w.walkable)continue;h=fd}let f=r.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(f>=u.g)continue;u.parent=r,u.g=f;let d=ot(e.pos.x-u.pos.x),y=ot(e.pos.y-u.pos.y),x=tt(d,y)+(Math.SQRT2-1)*st(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){p(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,a=Pt(t.x-i),r=Pt(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let f=-c;f<=c;++f){if(c>0&&ot(f)!==c&&ot(h)!==c)continue;let d=this.getNode(a+f,r+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Xt(i.posWorld,.3,V(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=tt(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Xt(i.posWorld,.3,V(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=tt(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Xt(i.posWorld,.3,V(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,E=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,P=E*E+A*A,F=T0&&Xt(i.posWorld,.3,V(0,1,0,.5),this.debugTime),l===h&&u===f){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=tt(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&Ee(o.posWorld,t[t.length-1].posWorld,V(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){p(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),p(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=ot(s),a=ot(i),r=ae(s),c=ae(i),l=t.x,u=t.y;if(a===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=r,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ar.posWorld.copy());if(this.debug&&this.debugTime>0&&a.length>0){for(let r=1;rpd,bootGameHost:()=>yd,default:()=>gd});var ks=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ni=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},zi=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let a=e._subs.get(i)||[],r={handler:o,scope:s};return a.push(r),e._subs.set(i,a),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(r);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let a=e._subs.get(i);if(!a)return;let r=a.findIndex(c=>c.handler===o&&c.scope===s);r>=0&&a.splice(r,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let a=o.slice();for(let r of a)try{r.handler(i)}catch(c){Ye("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(a=>a.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Ji.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Ji).join("/")+"\uFF09")}},Ji=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Hr(n){let t=n||{},e=new Ni(t.clock),s=new ks(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new zi(e),a=typeof t.audioFactory=="function"?t.audioFactory:null,r=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,f=new Map,d=0,y=0;function x(){if(r)return r;if(!a)return c||(Vi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{r=a()}catch(E){Ye("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",E),r=null}return r}function v(){if(u)return u;if(!l)return h||(Vi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(E){Ye("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",E),u=null}return u}function w(E,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(P){let F=d++;return f.set(F,P),{cancel(){f.delete(F)}}},getInput(){return o.sourceFor(E)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(E){y+=1;let A=Array.from(f.values());for(let T of A)try{T(E,y)}catch(P){Ye("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,P)}},frameCount(){return y},inputBridge:o,deriveContextFor(E,A){let T=zc(i,E),P=new ks(T);return w(A==null?E:A,P)}};return Object.defineProperty(_,Ui,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Ui=Symbol("zaomeng.coreProtocol.contextBundle"),Gs=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return Vi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),Ye("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let a=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:a}),Ye("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,a)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Ui],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Ui],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let a=this._initOrder[o],r=this._plugins.get(a);if(r&&typeof r.dispose=="function")try{r.dispose(),t.push(a)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:a,error:l}),Ye("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(a)}catch(c){Ye("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+a,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let a=0;a<32;a+=8){let r=i>>>a&255;e^=r,e=Math.imul(e,s)>>>0}let o=String(t);for(let a=0;a>>0,e^=r>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function Ye(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Vi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Ji)),Xr="core-protocol-v0";var Yr=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Wi=Yr.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set(Yr);function qi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var $r=qi("runtime-probe::seed::v1");function Fs(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Fs).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Fs(n[e])).join(",")+"}"}function Kr(n){let t=Fs(n.extra==null?null:n.extra),e=Fs(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=$r,e=-1;for(let s=0;stypeof E=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,a=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",r=()=>0,c=!1,l=0,u=$r,h=[],f=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(E,A){let T=null;if(!Uc.has(E))T="unknown_anchor";else{f.has(E)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let F=Wi[E];FE.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=E.getInput().on(a,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:a})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(E=>({...E}))},toJSONL(){return h.map(E=>JSON.stringify(E)).join(`
+`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Zr(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(r,c,l)=>(i("math.lerp"),o.lerp(r,c,l)),smoothStep:r=>(i("math.smoothStep"),o.smoothStep(r)),easing:Object.fromEntries(Object.keys(o.easing).map(r=>[r,c=>(i("math.easing."+r),o.easing[r](c))]))},particles:{spawnEmitter(r){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(r.pos.x,r.pos.y)),l=t.cameraScale,u=r.emitTime!=null?r.emitTime:r.count!=null?1/60:0,h=r.emitRate!=null?r.emitRate:r.count!=null?r.count*60:100,f=(r.speed!=null?r.speed:0)/l/60,d=r.damping!=null?r.damping:1,y=r.colorStart||{r:1,g:1,b:1,a:1},x=r.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,r.angle!=null?r.angle:0,(r.emitSize!=null?r.emitSize:0)/l,u,h,r.coneAngle!=null?r.coneAngle:Math.PI,void 0,v,v,w,w,r.particleTime!=null?r.particleTime:.5,(r.sizeStart!=null?r.sizeStart:6)/l,(r.sizeEnd!=null?r.sizeEnd:0)/l,f,0,d,1,r.gravityScale!=null?r.gravityScale:0,Math.PI,.1,0,!1,r.additive!=null?r.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:r=>{i("audio.synth.synthSfx");try{return t.zzfxG(...r)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(r,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(r,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function fe(n){return n<0?0:n>1?1:n}function ta(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),a=t.OUT(s),r=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,f)=>n.lerp(u,h,f),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(fe(u)),quadIn:u=>e(fe(u)),quadOut:u=>i(fe(u)),quadInOut:u=>o(fe(u)),cubicIn:u=>s(fe(u)),cubicOut:u=>a(fe(u)),cubicInOut:u=>r(fe(u)),backIn:u=>t.BACK(fe(u)),backOut:u=>c(fe(u)),elasticIn:u=>t.ELASTIC(fe(u)),elasticOut:u=>l(fe(u))}}}var $e=2,js=1/60;async function ea(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",a=n.engineMode||"real",r=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},f=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let E=0,A=null,T=null,P=null,F=null,bt=[],ct={},gt=null;function wt(D,lt){try{P&&P.mark(D,lt)}catch(re){v.push({type:"mark",message:String(re&&re.message||re)})}}function Vt(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(ct)}async function L(D,lt){A=Hr({context2d:D,seed:i,audioFactory:S,clock:()=>E,engineFactory:()=>Zr({LJS:a==="real"?s:null,engineMath:a==="real"?ta(s):null,engineMode:a,recHook:y})});let re=new Gs;for(let ve of f)re.register(ve);re.useContext(A.context),F=re.initAll(),bt=re.list().concat(["runtime-probe"]),P=Qr({pluginSet:bt,inputAnchorType:"pointerdown",autoBoot:!0});let Gt=A.deriveContextFor("runtime-probe","runtime-probe");wt("t_boot",{by:"game-host",stage:"pre-init",engineMode:a}),wt("t_plugins_ready",{initialized:F.initialized.length,ok:F.ok});let ji=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(ji),await T.init({ctx:A.context,mainContext:D,canvas:lt(),seed:i}),gt=T&&typeof T._forensicsView=="function"?T._forensicsView():null,wt("t_game_init",{hasForensics:!!gt}),M(),wt("t_first_paint",{frame:A.frameCount()});try{P.init(Gt)}catch(ve){v.push({type:"probe-init",message:String(ve&&ve.message||ve)})}wt("t_game_start",{mode:o,engineMode:a}),Vt(),d(dt,{bundle:A,game:T,probe:P,checklist:ct,uncaught:v,pluginSet:bt,initRes:F,getGameForensics:()=>gt,mark:wt,stepOneFrame:M})}let I=null;function M(D){let lt=typeof D=="number"?D:js;T&&(E+=lt*1e3,T.update(lt),a==="stub"&&I&&T.render(I),Vt())}function B(D){for(let lt=0;lt{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let dt={seed:i,mode:o,engineMode:a,protocol:Xr,frameCount:()=>A?A.frameCount():0,stepFrames:B,startRaf:()=>Me(),stopRaf:()=>G(),tap(D,lt){et(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:lt}),A.inputBridge._emit("pointerup",{x:D,y:lt}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>gt?gt.state():{phase:"booting"}};function xt(D){let lt=A.inputBridge;function re(Gt,ji){let ve=D.getBoundingClientRect();return{x:(Gt-ve.left)/ve.width*r,y:(ji-ve.top)/ve.height*c}}D.addEventListener("pointerdown",Gt=>{et(),lt._emit("pointerdown",re(Gt.clientX,Gt.clientY))}),D.addEventListener("pointermove",Gt=>{lt._emit("pointermove",re(Gt.clientX,Gt.clientY))}),D.addEventListener("pointerup",Gt=>{lt._emit("pointerup",re(Gt.clientX,Gt.clientY))}),window.addEventListener("keydown",Gt=>{et(),lt._emit("keydown",{key:Gt.key})}),window.addEventListener("keyup",Gt=>lt._emit("keyup",{key:Gt.key}))}let ft=0,vt=!1,Tt=0;function de(D){if(!vt)return;Tt===0&&(Tt=D);let lt=(D-Tt)/1e3;Tt=D,lt>.05&&(lt=.05),M(lt),ft=window.requestAnimationFrame(de)}function Me(){a==="stub"&&(vt||(vt=!0,Tt=0,ft=window.requestAnimationFrame(de)))}function G(){vt=!1,ft&&window.cancelAnimationFrame(ft),ft=0}function J(D){D.width=r*$e,D.height=c*$e,D.style.width=r+"px",D.style.height=c+"px";let lt=D.getContext("2d",{willReadFrequently:!0});return lt.setTransform($e,0,0,$e,0,0),lt}async function Rt(){let D=J(t);return I=D,await L(D,()=>t),xt(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),Me()),dt}let Ie=()=>{},X=()=>{};function Y(){window.__gameHostEngineInitFired=!0}function kt(){Ie()}function oe(){}function Wt(){X()}function Wr(){}async function Ic(D){await L(D,()=>s.mainCanvas),xt(s.mainCanvas),Ie=()=>{T&&(E+=js*1e3,T.update(js))},X=()=>{if(T){D.save(),D.setTransform($e,0,0,$e,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(a!=="real")return await Rt();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(r*$e,c*$e));let Fi=document.createElement("div");return Fi.id="engine-root",document.body.appendChild(Fi),await s.engineInit(Y,kt,oe,Wt,Wr,[],Fi).then(()=>Ic(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),dt}var Hi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),a=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:a}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:a}=this._cellRange(e),r=[];for(let l=i;l<=a;l++)for(let u=s;u<=o;u++){let h=u+","+l,f=this._cells.get(h);f||(f=new Set,this._cells.set(h,f)),f.add(t),r.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:r})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),a=new Set;for(let r=s;r<=o;r++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+r);if(l)for(let u of l)a.add(u)}return this._collect(a)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),a=this._cells.get(i+","+o);return a?this._collect(new Set(a)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function na(n){let t=n||{},e=new Hi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function sa(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function qt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=qt(n),n*n),Yc=n=>(n=qt(n),1-(1-n)*(1-n)),$c=n=>(n=qt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=qt(n),n*n*n),Qc=n=>{n=qt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=qt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),ra=2*Math.PI/3,ia=2*Math.PI/4.5,tl=n=>(n=qt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*ra)),el=n=>(n=qt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*ra)+1),nl=n=>(n=qt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*ia))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*ia)/2+1),Ns=1.70158,Bs=Ns*1.525,aa=Ns+1,sl=n=>(n=qt(n),aa*n*n*n-Ns*n*n),il=n=>{n=qt(n);let t=n-1;return 1+aa*t*t*t+Ns*t*t},ol=n=>(n=qt(n),n<.5?Math.pow(2*n,2)*((Bs+1)*2*n-Bs)/2:(Math.pow(2*n-2,2)*((Bs+1)*(n*2-2)+Bs)+2)/2),rl=n=>qt(n),oa=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return oa;let e=i=>typeof t[i]=="function"?o=>t[i](qt(o)):oa[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var Xi=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let a of o){this._records.set(a,null);let r=t.on(a,c=>{this._records.set(a,c.tMs)});this._subs.push(r)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function ca(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(a){let r=a.getInput();e=new Xi(r,a.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=a.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function zs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Yi(t):null}function Yi(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Yi(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:zs(n.sizeCurve,0),sizeEnd:zs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:zs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:zs(n.alphaCurve,1)},additive:!1}}function la(n){let t=n||{},e=null,s=null,i=null,o=new Map,a=0,r={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,f=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=f+(1-f)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,P=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*P,d.y=Math.cos(d._phase*1.3)*P}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,P=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(P)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let P=T.canvas?T.canvas.width:0,F=T.canvas?T.canvas.height:0;T.fillRect(0,0,P,F),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(P=>{_(P)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,P,F){let bt=typeof A=="string"?ul(A):Yi(A);if(!bt)return-1;F&&(bt=Object.assign(bt,F));let ct=a++;if(!i)return o.set(ct,r),ct;let gt=i.spawnEmitter(hl(bt,T,P));return o.set(ct,gt),ct},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,f=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?f:1},getTimeScale(){return l},shakeScreen(A,T,P){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=P==null?30:P,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,P){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=P==null?4:P,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ua(n){let t=St(n.r)/255,e=St(n.g)/255,s=St(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),a=(i+o)/2,r=0,c=0,l=i-o;return l>1e-12&&(c=a>.5?l/(2-i-o):l/(i+o),i===t?r=(e-s)/l%6:i===e?r=(s-t)/l+2:r=(t-e)/l+4,r*=60,r<0&&(r+=360)),{h:r,s:c,l:a}}function ha(n){let t=(n.h%360+360)%360,e=Ke(n.s),s=Ke(n.l);if(e<1e-12){let r=Math.round(s*255);return{r,g:r,b:r}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,a=t/360;return{r:Math.round($i(o,i,a+1/3)*255),g:Math.round($i(o,i,a)*255),b:Math.round($i(o,i,a-1/3)*255)}}function $i(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function St(n){return n<0?0:n>255?255:n}function Ke(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:St(r.r),g:St(r.g),b:St(r.b)})),to:o}}function Ki(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ua(n),s=e.h+(t.hue||0),i=Ke(e.s*(t.sat==null?1:t.sat)),o=Ke(e.l*(t.light==null?1:t.light));return ha({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function da(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:Qi(t.vignette&&t.vignette.enabled,!1),strength:Zi(t.vignette&&t.vignette.strength,.5)},dither:{enabled:Qi(t.dither&&t.dither.enabled,!1),strength:Zi(t.dither&&t.dither.strength,.5)},scanline:{enabled:Qi(t.scanline&&t.scanline.enabled,!1),strength:Zi(t.scanline&&t.scanline.strength,.5)}};function o(r){let c=r!==void 0?r:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(r){e=r},dispose(){s||(e=null,s=!0)},applyPaletteMap(r,c){return dl(r,c)},applyPaletteMapToBuffer(r,c){return fl(r,c)},lerpPaletteMap(r,c,l){return yl(r,c,l)},shiftHsl(r,c){return ml(r,c)},rgbToHsl(r){return ua(r)},hslToRgb(r){return ha(r)},setPost(r){if(r)for(let c of["vignette","dither","scanline"])r[c]&&(typeof r[c].enabled=="boolean"&&(i[c].enabled=r[c].enabled),typeof r[c].strength=="number"&&(i[c].strength=Ke(r[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(r){o(r)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=Ke(t);if(e<=0)return n;let{data:s,width:i}=n,a=255/(Math.max(2,Math.round(16-e*14))-1);for(let r=0;r+3>2)%i,l=Math.floor((r>>2)/i),u=(bl[l&3][c&3]/16-.5)*a;for(let h=0;h<3;h++){let f=s[r+h]+u,d=Math.round(f/a)*a;s[r+h]=d<0?0:d>255?255:d}}return n}function Qi(n,t){return typeof n=="boolean"?n:t}function Zi(n,t){return typeof n=="number"?Ke(n):t}var eo=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),fa=Object.keys(eo);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let a=i[0]|0;Array.isArray(n.instruments)&&(a<0||a>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${a} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let r=i[1];(r<-1||r>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${r} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function Se(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function pa(n,t){let e=Se(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],a=typeof s.minIntensity=="number"?Se(s.minIntensity):0,r=typeof s.maxIntensity=="number"?Se(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?Se(s.baseVolume):1;if(er)return{id:i,on:!1,volume:0,channelIndices:o};let u=r-a,h=u<=0?1:(e-a)/u,f=Se(Sl(c,h)*l);return{id:i,on:!0,volume:f,channelIndices:o}})}function ga(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,a=Math.max(i.length,o.length);if(a===0)return null;let c=n.createBuffer(2,a,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=Se(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return no("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ya(n){let t=n||{},e=typeof t.masterVolume=="number"?Se(t.masterVolume):1,s=()=>null,i=null,o=null,a={voices:[]},r=1,c=null,l=!1,u=0,h=!1,f=!1;function d(){let S=s();return S==null?(u+=1,h||(to("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return no("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=pa(a,r);if(S.length===0)return 1;let E=0;for(let A of S)A.on&&(E=Math.max(E,A.volume));return E}function v(S,E){typeof E=="number"&&(r=Se(E));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let P=Se(e*x());c=ga(A,T,P,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let E=S.getEngine&&S.getEngine();i=E?E.audio.synth:null},dispose(){f||(w(),f=!0)},loadSong(S){let E=vl(S);return E.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:to("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+E.errors.join("\uFF1B")),E},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){a=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){r=Se(S)},resolveVoices(S){return pa(a,S)},playSfx(S){let E=eo[S];if(!E){to("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(E.params):null;if(!T)return;ga(A,[T,T],e,!1)}catch(T){no("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return eo[S]},listPresets(){return fa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:r,voiceCount:a.voices.length,looping:l,silentNoops:u,presetCount:fa.length}}}}function no(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function to(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function io(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ma(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?io():t.adapter,a=e+":",r=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?a+String(d):a+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(a)===0):[]}catch(d){return Qn("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!so(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return Qn("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return r+=1,l||(Zn("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!so(d))return Zn("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,Zn("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,Zn("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,Zn("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,Qn("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(so(d))try{o.removeItem(u(d))}catch(y){Qn("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){Qn("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:r,rejectedWrites:c}}}}function so(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function Qn(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function Zn(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var Cl={w:390,h:844};function xa(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=na({cellSize:96}),s=sa(),i=ca({inputBufferMs:260,inputTypes:["pointerdown"]}),o=la({seed:t,maxParticles:600}),a=da({vignette:{enabled:!0,strength:.22}}),r=ya({masterVolume:.8}),c;try{c=ma()}catch(f){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(f&&f.message)),c=io()}let l=ba({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:a,audioMusic:r,save:l},registerOrder:[e,s,i,o,a,l,r],viewport:Cl,buildFactoryOpts:(f,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ts(n){let t=n||{},e=null,s=null,i=0,o=0,a=[],r=[],c=0,l=0,u="booting",h=null,f=null,d=0,y=0,x=null;function v(L){if(e=L.ctx,s=e.getEngine(),r=E(),A(),A(),u="playing",h=null,c=0,l=0,a.push(e.getInput().on("keydown",w)),a.push(e.getInput().on("pointerdown",_)),s&&s.math&&s.math.lerp(0,1,.5),s&&s.particles)try{s.particles.spawnEmitter({pos:{x:195,y:422},emitRate:5,particleTime:1.2,speed:30,colorStart:{r:.5,g:.8,b:1,a:.3},colorEnd:{r:.2,g:.4,b:.8,a:0}})}catch{}}function w(L){if(u!=="playing")return;let I=L.key;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(I)&&(f=I)}function _(L){u==="gameover"&&S()}function S(){r=E(),A(),A(),u="playing",h=null,c=0,l=0,f=null,d=0}function E(){let L=[];for(let I=0;I<4;I++){L[I]=[];for(let M=0;M<4;M++)L[I][M]={value:0,row:I,col:M,scale:1,merging:!1,newBlock:!1,timeBorn:0}}return L}function A(){let L=[];for(let et=0;et<4;et++)for(let dt=0;dt<4;dt++)r[et][dt].value===0&&L.push({r:et,c:dt});if(L.length===0)return!1;let I=L[Math.floor(e.random.next()*L.length)],M=e.random.next()<.9?2:4,B=r[I.r][I.c];return B.value=M,B.newBlock=!0,B.scale=0,B.timeBorn=o,!0}function T(L){if(u!=="playing")return!1;let I=!1,M=r.map(G=>G.map(J=>J.value)),B=[0,1,2,3],et=[0,1,2,3],dt,xt,ft,vt,Tt,de;L==="up"?(dt=B,xt=et,ft=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=1,de=0):L==="down"?(dt=B.slice().reverse(),xt=et,ft=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=-1,de=0):L==="left"?(dt=B,xt=et,ft=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=0,de=1):L==="right"&&(dt=B,xt=et.slice().reverse(),ft=(G,J)=>r[G][J],vt=(G,J,Rt)=>r[G][J].value=Rt,Tt=0,de=-1);function Me(G,J,Rt,Ie){let X=[];for(let Y=0;Y0&&X[X.length-1].value===kt.value){let oe=X[X.length-1];if(oe.value*=2,oe.merged=!0,Rt(G[Y].row,G[Y].col,0),c+=oe.value,I=!0,s&&s.particles){let Wt={x:48.75+oe.col*97.5,y:48.75+oe.row*97.5};try{s.particles.spawnEmitter({pos:Wt,count:15,speed:80,particleTime:.4,sizeStart:6,sizeEnd:12,colorStart:{r:1,g:.9,b:.2,a:1},colorEnd:{r:1,g:.5,b:0,a:0}})}catch{}}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.05,330,,,.18,,1.4])}catch{}}else X.push({row:G[Y].row,col:G[Y].col,value:kt.value,merged:!1})}for(let Y=0;Yr[X][Y],(X,Y,kt)=>r[X][Y].value=kt,L)}else for(let G=0;G<4;G++){let J=[];for(let X=0;X<4;X++){let Y=L==="left"?X:3-X;J.push({row:G,col:Y})}Me(J,(X,Y)=>r[X][Y],(X,Y,kt)=>r[X][Y].value=kt,L)}for(let G=0;G<4;G++){for(let J=0;J<4;J++)if(r[G][J].value!==M[G][J]){I=!0;break}if(I)break}return I}function P(L){if(i=e.time.nowMs(),o=i/1e3,d+=L,y=(y+L*5)%360,u!=="playing"){ct();return}if(f){let I=f;if(f=null,T(I)){l++,A();let B=!1;for(let et=0;et<4;et++){for(let dt=0;dt<4;dt++)if(r[et][dt].value>=2048){B=!0;break}if(B)break}if(B){if(u="gameover",h="win",s&&s.particles)for(let et=0;et<3;et++)try{s.particles.spawnEmitter({pos:{x:195,y:422},count:30,speed:120,particleTime:1,colorStart:{r:1,g:.8,b:0,a:1},colorEnd:{r:1,g:0,b:.5,a:0}})}catch{}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.05,440,.3,.2,.18,.3,1.4])}catch{}return}if(F()&&!bt()){if(u="gameover",h="lose",s&&s.particles)try{s.particles.spawnEmitter({pos:{x:195,y:422},count:40,speed:100,particleTime:.6,colorStart:{r:.8,g:.2,b:.2,a:1},colorEnd:{r:.3,g:0,b:0,a:0}})}catch{}if(s&&s.audio&&s.audio.synth)try{s.audio.synth.synthSfx([1,.1,110,.3,.2,.5,.5,1.4])}catch{}}}}ct()}function F(){for(let L=0;L<4;L++)for(let I=0;I<4;I++)if(r[L][I].value===0)return!1;return!0}function bt(){for(let L=0;L<4;L++)for(let I=0;I<4;I++){let M=r[L][I].value;if(M===0||I<3&&r[L][I+1].value===M||L<3&&r[L+1][I].value===M)return!0}return!1}function ct(){for(let L=0;L<4;L++)for(let I=0;I<4;I++){let M=r[L][I];if(M.newBlock){let B=o-M.timeBorn;B<.2?M.scale=B/.2:(M.scale=1,M.newBlock=!1)}M.merging&&(M.scale=1.1+.1*Math.sin(o*20))}}function gt(L){let I=y;L.fillStyle=`hsl(${I}, 20%, 10%)`,L.fillRect(0,0,390,844);let M=97.5,B=5,et=0,dt=200;for(let xt=0;xt<4;xt++)for(let ft=0;ft<4;ft++){let vt=et+ft*(M+B)+B/2,Tt=dt+xt*(M+B)+B/2;L.fillStyle="rgba(255,255,255,0.05)",L.fillRect(vt,Tt,M,M),L.beginPath(),L.roundRect(vt,Tt,M,M,8),L.fill()}for(let xt=0;xt<4;xt++)for(let ft=0;ft<4;ft++){let vt=r[xt][ft];if(vt.value===0)continue;let Tt=et+ft*(M+B)+B/2,de=dt+xt*(M+B)+B/2,Me=vt.scale||1,G=M*Me,J=Tt+(M-G)/2,Rt=de+(M-G)/2,X={2:"#eee4da",4:"#ede0c8",8:"#f2b179",16:"#f59563",32:"#f67c5f",64:"#f65e3b",128:"#edcf72",256:"#edcc61",512:"#edc850",1024:"#edc53f",2048:"#edc22e"}[vt.value]||"#3c3a32";L.fillStyle=X,L.beginPath(),L.roundRect(J,Rt,G,G,6),L.fill(),L.fillStyle=vt.value<=4?"#776e65":"#f9f6f2",L.font=`bold ${Math.min(36,60*(G/M))}px monospace`,L.textAlign="center",L.textBaseline="middle";let Y=vt.value.toString(),kt=J+G/2,oe=Rt+G/2;L.fillText(Y,kt,oe)}if(L.fillStyle="#f9f6f2",L.font="bold 28px monospace",L.textAlign="center",L.textBaseline="top",L.fillText("2048",195,30),L.font="18px monospace",L.fillText(`Score: ${c}`,195,70),L.fillText(`Moves: ${l}`,195,100),u==="gameover"){L.fillStyle="rgba(0,0,0,0.6)",L.fillRect(0,0,390,844),L.fillStyle="#fff",L.font="bold 36px monospace",L.textBaseline="middle";let xt=h==="win"?"You Win!":"Game Over";L.fillText(xt,195,160),L.font="20px monospace",L.fillText("Tap to restart",195,200)}}function wt(){for(let L of a)try{L.cancel()}catch{}a=[],r=[],c=0,l=0,u="booting"}function Vt(){return{seed:t.seed||"none",state:()=>{let L=[];for(let I=0;I<4;I++){L[I]=[];for(let M=0;M<4;M++)L[I][M]=r[I][M].value}return{phase:u,result:h,score:c,moves:l,board:L}}}}return{init:v,update:P,render:gt,destroy:wt,_forensicsView:Vt}}var pd=ts,gd=ts;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Dc)),s=(t.seed!=null?t.seed:305441741)>>>0,i=xa({seed:s});return ea({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ts,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Nc(md);})();
diff --git a/game-runtime/games/_wg1-gen/t2048/bundle.iife.js.meta.json b/game-runtime/games/_wg1-gen/t2048/bundle.iife.js.meta.json
index 496a8d0f..2441ae20 100644
--- a/game-runtime/games/_wg1-gen/t2048/bundle.iife.js.meta.json
+++ b/game-runtime/games/_wg1-gen/t2048/bundle.iife.js.meta.json
@@ -1 +1 @@
-{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":27676,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/t2048/generated-factory.js":{"bytes":15261,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/t2048/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/t2048/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/t2048/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/t2048/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164281},"games/_wg1-gen/t2048/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5350},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4166},"src/plugins/palette-post/impl.js":{"bytesInOutput":4216},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/t2048/generated-factory.js":{"bytesInOutput":5883}},"bytes":213736}}}
\ No newline at end of file
+{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":28239,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/t2048/generated-factory.js":{"bytes":15261,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/t2048/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/t2048/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/t2048/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/t2048/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164281},"games/_wg1-gen/t2048/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5497},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4166},"src/plugins/palette-post/impl.js":{"bytesInOutput":4216},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/t2048/generated-factory.js":{"bytesInOutput":5883}},"bytes":213883}}}
\ No newline at end of file
diff --git a/game-runtime/games/_wg1-gen/t2048/evidence/after-play.png b/game-runtime/games/_wg1-gen/t2048/evidence/after-play.png
index c0317da0b13d72568eb71c8039d264d01bf7a188..a35438be2f135d0c81321f70baeb6d84d87c674c 100644
GIT binary patch
literal 22779
zcmeIacT`hZ+cz95V?jnoMMXdbL`6WPNsY=VAOeCy1PrJ&sgW82gy=ZRs2~E;OHi8B
zD4|G=ih|TYC=mh)NC_c?P(ngW@^18=`?=>?-}k-$y=%Vb9sXctog^pw?6a@y`ju;+
z$5+e@MYkT<3V}dGjg5Y_gg`cIhd?$b{j=ThgNj$BDP?c8+5smWex^!|o*7EcacEkAVZ(5sA1>#~o%sCC=#
zoM4%eEz=g7D@uJdibQz(c6lU+>f_k8u^~j$4NE@rZNk(LZ!!Hm>-D|aVkc>^y
z8zDdcYz%>{`@i_b{Sy7!1hae7x8CO$Y?nO!uC&I#Ay+l_LLL%JHRyFf_N-HYSy{EE
z*~Oh~kB0{`L^bx=#=K}vU9ws4FF&@WV^7?R7oNQABJLm}Du8U`k>ngd-Ia^HaN$Ci
ztDa>lL&eR*0rHNvafR#j%IBMNMSkdK
zJ-$eiUI;f_I*c=(f`I#cUWmH9XujUxO^&}Jdih@Q?d(0UGeh@kk^OEfWxcjC^If%8
zj3^-?3NzDv6|*?o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e*5{YpkuEO+D5TagDY0PKolQp8UCMCI3;K
zKu8QHd`;4RtQcQlQ}@@{1F-M}V^%g{PsM+sXO8evo6p{VWoK)u5deLlx`IfRbxt!2
zlsI@1_SZ9pv;W0)@NbjIznwDwC)tJW1CVdSMWRAEupZz4_Vw%FB=r4%5HwI3IiND4(Vj8&ptrro&$b=VZ1-<;dw*Qw
zRYk>a@2bDT)_+QNWe}tgo({Qm#UwETX!jS5Ml-n=B3}
zQ#l~B0-wR-M97?dblY6;>6sbXH`ZN%do_ID)REN->Z;CVCwpR_M$pEv=I3lT$O#pd
z{MGv(N>CT*ctuqJ&)0HTmVsw&>OS-KOG%Auk|^A&JkQ1F|CzmZtH<*tqWZC&hKp4}
zRp!;?X(ms07-q+Rsy&bkJl_Gh$vD?ZWq*kiu)p>-{}rSNb(oku?cT*1TaBNdT{m%A
zVP$0{u;7kdzKLbilH1cR-~DE4`uSmpYqFajI6yf}*!e$wJ0A=1Sa$}N
zpV9gTPJt{8Jf2Jp5|daM3{*H75>5=t@Zq2gjIsa!
juQe=D1v1z`{b^=~@?9sR^A6>F1I4DNtDnm{r-UW|jN82e

diff --git a/game-runtime/games/_wg1-gen/t2048/evidence/first-paint.png b/game-runtime/games/_wg1-gen/t2048/evidence/first-paint.png
index f1ea49f1885c80a7ba5d0ea0fa76a6085bb56728..73dd069d0587bf276bf870da62ad14e0a14db974 100644
GIT binary patch
literal 24407
zcmeFZXIPW#x-N=k=u`$WEQpH0P*GHxh=9~sK|sI;NC~J2NJk*F0I>{3rGxYmlqOOl
zgc=}G5fBJ12%#krsUabuCXl*c9CNNY&N}P5&N{#5+IvrbVe<9wDR+6^yu4;+D7O8;
zb`cQ~F{3M&Zit9%`c*_^OX}Y?f=}`Zc(RDdZz4vQ&ff~kq?5J=W&XndxS;7uFzq<$
z^tw@J|K;P?&Yg>IO!*pj=;r3lmwY;QNl2V$9lyznYm87#bCPgODtV2_KuQDcWHPfRXrstSVv@Xw$eBY4A|e|PZxi|b_y3Fk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n2PZY169X+7d7d#j
z`PNS$e4X_r^zAuO5t#S3U9C^G^xeC6#l`346it6MB&U%XY9&5@zEwIS{3Fi&4#M^A
zu9FFVl1@&037W3&0*Io@|BU7Pp67(n9dA20WE}GamBW7}Uxa#h5z&f+T|c1yt{(+I
z@P0muQ?%@VfABq;`uu}{z`>7O?+)DJT3HjVv7i<841b4K?zwYz_i&%vv9B=30Rcbs
zvV4>D*Ru|e*9m|9lzWSFjm7^HR&@)U?9}ZiSXioaCQIbb0a^v>YOzBA^0fW9W1X59
z)V@AYerZ7VQAC{pUx9ABFqDe0cbYcAWV=$+a{6O|1e$&6hds6>u2I(?
z^q-dxb^3ctkEp%I!I$8KekNr
zo}`7APs}knxuUc4&7YEceSeJon6}4`KJD>aSt>C|5+5diTPxyCxo5TOi=l}gzY@E0T62SIrZvUzx0PRzY
zsPVr=b@wE@3QLT$F8&iZ{*4B;-7U8_r&yTB{iuci#nZeat0jTTYU3G)4+S7_E5GcD
zOwsjPu=3vf5D4!(Z3_QIJ*mj6R#)N!O|zwQ-?g*wY(!MAda-x%`~-hb+K-3C*s7=Hy4+7=fCZ%OD9Q_=UXG1P=4
zK4^IAlCGu=F%
zObil}SQrdcI2jT=gcuG?0G^4i2pq$92Cmc^RY13Ja05on|Nkj|kEa6}Y@og@Gs8;3
VQ-TK^UQYl;ny0Iu%Q~loCID4&>nZ>M

diff --git a/game-runtime/games/_wg1-gen/t2048/evidence/verdict.json b/game-runtime/games/_wg1-gen/t2048/evidence/verdict.json
index 566714ac..bc79f6b4 100644
--- a/game-runtime/games/_wg1-gen/t2048/evidence/verdict.json
+++ b/game-runtime/games/_wg1-gen/t2048/evidence/verdict.json
@@ -8,8 +8,8 @@
     },
     "C_frame": {
       "pass": true,
-      "f0": 53,
-      "f1": 83,
+      "f0": 47,
+      "f1": 77,
       "delta": 30
     },
     "I_control": {
@@ -18,13 +18,13 @@
     },
     "D_render": {
       "pass": true,
-      "bright": 81981,
+      "bright": 81964,
       "maxCh": 249
     },
     "E_live": {
       "pass": true,
-      "distinctStates": 52,
-      "samples": 52
+      "distinctStates": 122,
+      "samples": 122
     },
     "B_uncaught": {
       "pass": true,
@@ -32,9 +32,11 @@
     },
     "F_wiring": {
       "pass": true,
-      "callCount": 2,
+      "callCount": 4,
       "sample": [
-        "particles.spawnEmitter"
+        "particles.spawnEmitter",
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx"
       ],
       "expected": [
         "particles.",
@@ -43,9 +45,9 @@
     },
     "G_input": {
       "pass": true,
-      "inputHash": "2540a17d",
-      "controlHash": "f6024d63",
-      "atFrame": 1306,
+      "inputHash": "400f8c09",
+      "controlHash": "9c7f4289",
+      "atFrame": 2967,
       "ctrlFrame": -1
     },
     "H_progress": {
@@ -55,8 +57,8 @@
           "path": "score",
           "op": "increased",
           "before": 0,
-          "after": 0,
-          "pass": false,
+          "after": 4,
+          "pass": true,
           "why": "循环四向滑动→合并得分上升;不合并/不响应键则不升"
         }
       ],
@@ -100,13 +102,13 @@
       "state1": {
         "phase": "playing",
         "result": null,
-        "score": 0,
-        "moves": 0,
+        "score": 4,
+        "moves": 1,
         "board": [
           [
             0,
-            2,
-            2,
+            0,
+            0,
             0
           ],
           [
@@ -125,7 +127,7 @@
             0,
             0,
             0,
-            0
+            2
           ]
         ]
       }
diff --git a/game-runtime/games/_wg1-gen/t2048/play-spec.json b/game-runtime/games/_wg1-gen/t2048/play-spec.json
index 3084ae0a..705f8efd 100644
--- a/game-runtime/games/_wg1-gen/t2048/play-spec.json
+++ b/game-runtime/games/_wg1-gen/t2048/play-spec.json
@@ -7,7 +7,7 @@
       "ArrowRight",
       "ArrowDown"
     ],
-    "steps": 50,
+    "steps": 120,
     "stepMs": 220
   },
   "expectedEngineCallPrefixes": [
diff --git a/game-runtime/games/_wg1-gen/tetris/bundle.iife.js b/game-runtime/games/_wg1-gen/tetris/bundle.iife.js
index 76ab9e69..c601de56 100644
--- a/game-runtime/games/_wg1-gen/tetris/bundle.iife.js
+++ b/game-runtime/games/_wg1-gen/tetris/bundle.iife.js
@@ -1,34 +1,34 @@
-"use strict";var __GameBundle=(()=>{var zi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var Hr=(n,t)=>{for(var e in t)zi(n,e,{get:t[e],enumerable:!0})},Nc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&zi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Bc=n=>Nc(zi({},"__esModule",{value:!0}),n);var Ic={};Hr(Ic,{ASSERT:()=>p,BLACK:()=>st,BLUE:()=>Za,Box2dDistanceJoint:()=>Ti,Box2dFrictionJoint:()=>$o,Box2dGearJoint:()=>qo,Box2dJoint:()=>Xt,Box2dKinematicObject:()=>Bo,Box2dMotorJoint:()=>Qo,Box2dObject:()=>Rs,Box2dPinJoint:()=>Uo,Box2dPlugin:()=>Ai,Box2dPrismaticJoint:()=>Ho,Box2dPulleyJoint:()=>Ko,Box2dRaycastResult:()=>wi,Box2dRevoluteJoint:()=>Wo,Box2dRopeJoint:()=>Vo,Box2dStaticObject:()=>Si,Box2dTargetJoint:()=>Jo,Box2dTileLayer:()=>zo,Box2dWeldJoint:()=>Yo,Box2dWheelJoint:()=>Xo,CLEAR_BLACK:()=>ye,CLEAR_WHITE:()=>cn,CYAN:()=>ql,CanvasLayer:()=>ui,Color:()=>wt,Ease:()=>Ei,EngineObject:()=>Ue,GRAY:()=>Vl,GREEN:()=>Qa,ImageFont:()=>ii,LOG:()=>xt,Light:()=>Oo,LightSystemPlugin:()=>Lo,MAGENTA:()=>Hl,Medal:()=>xi,NewgroundsMedal:()=>_o,NewgroundsPlugin:()=>Ro,ORANGE:()=>Wl,PI:()=>X,PURPLE:()=>tc,Particle:()=>hi,ParticleEmitter:()=>vo,PathFinder:()=>Zo,PathFinderNode:()=>_i,PostProcessPlugin:()=>Po,RED:()=>rr,RandomGenerator:()=>go,Sound:()=>xs,SoundInstance:()=>ci,TextureInfo:()=>Ve,TileCollisionLayer:()=>Ss,TileInfo:()=>Pe,TileLayer:()=>vs,TileLayerData:()=>Tn,Timer:()=>Ee,Tween:()=>Ci,UIButton:()=>_s,UICheckbox:()=>Go,UILayout:()=>No,UIObject:()=>ae,UISlider:()=>Fo,UISystemPlugin:()=>Io,UIText:()=>vi,UITextInput:()=>Mo,UITile:()=>ko,UIVideo:()=>jo,Vector2:()=>ot,WHITE:()=>V,YELLOW:()=>Ka,ZzFXMusic:()=>Do,abs:()=>et,atan2:()=>sr,audioContext:()=>pt,audioDefaultSampleRate:()=>Zn,audioIsRunning:()=>bs,audioMasterGain:()=>Je,box2d:()=>m,box2dDebug:()=>qr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>K,cameraFit:()=>rh,cameraPos:()=>Ct,cameraScale:()=>q,canvasClearColor:()=>nn,canvasColorTiles:()=>Pi,canvasFixedSize:()=>Fn,canvasMaxAspect:()=>Gn,canvasMaxSize:()=>kn,canvasMinAspect:()=>rs,canvasPixelRatio:()=>sn,canvasPixelated:()=>lr,ceil:()=>hs,clamp:()=>F,combineCanvases:()=>wr,cos:()=>at,debug:()=>Gt,debugCircle:()=>Ut,debugClear:()=>Ml,debugLine:()=>Te,debugOverlap:()=>fo,debugOverlay:()=>Me,debugPoint:()=>nr,debugPointSize:()=>ka,debugPoly:()=>Il,debugRect:()=>bt,debugScreenshot:()=>Fa,debugShowErrors:()=>kl,debugText:()=>Mn,debugVideoCaptureIsActive:()=>Ae,debugVideoCaptureStart:()=>ja,debugVideoCaptureStop:()=>Na,debugWatermark:()=>Ri,distanceAngle:()=>zl,distanceWrap:()=>ir,drawCanvas2D:()=>Pn,drawCircle:()=>si,drawCircleGradient:()=>sh,drawContext:()=>Tt,drawCount:()=>_e,drawCrescent:()=>ud,drawEllipse:()=>ic,drawEllipseGradient:()=>oc,drawLine:()=>bn,drawLineList:()=>mo,drawNineSlice:()=>_c,drawNineSliceScreen:()=>cd,drawPoly:()=>Vn,drawRect:()=>ni,drawRectGradient:()=>th,drawRegularPoly:()=>sc,drawText:()=>ih,drawTextScreen:()=>on,drawTextureWrapped:()=>eh,drawThreeSlice:()=>Rc,drawThreeSliceScreen:()=>ld,drawTile:()=>Pt,enablePhysicsSolver:()=>Ii,engineAddPlugin:()=>_n,engineImageFont:()=>lc,engineInit:()=>Pl,engineName:()=>Hs,engineObjects:()=>vt,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>er,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Ia,engineVersion:()=>Xs,fetchJSON:()=>Xl,floor:()=>St,fontDefault:()=>Ps,formatTime:()=>ar,frame:()=>Oa,frameRate:()=>El,gamepadConnected:()=>xo,gamepadDirectionEmulateStick:()=>yr,gamepadDpad:()=>bo,gamepadIsDown:()=>Ie,gamepadPrimary:()=>mt,gamepadStick:()=>ys,gamepadStickCount:()=>uc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Rr,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Mi,getCameraSize:()=>ac,getCrescentPoints:()=>Pc,getNoteFrequency:()=>gc,getPaused:()=>_l,glAntialias:()=>Mr,glCanvas:()=>tt,glCircleSides:()=>Ls,glClearCanvas:()=>vc,glClearRect:()=>Cc,glCompileShader:()=>Eo,glContext:()=>g,glCopyToContext:()=>Nr,glCreateProgram:()=>Yn,glCreateTexture:()=>ji,glDeleteTexture:()=>wc,glDraw:()=>As,glDrawColoredPoints:()=>Jr,glDrawOutlineTransform:()=>zr,glDrawPoints:()=>Ac,glDrawPointsTransform:()=>Br,glDrawUntextured:()=>Tc,glEnable:()=>k,glFlush:()=>Et,glSetAntialias:()=>Yh,glSetRenderTarget:()=>os,glSetTexture:()=>Fr,glSetTextureData:()=>jr,glSetTextureWrap:()=>Sc,gravity:()=>Vt,headlessMode:()=>N,hsl:()=>Ge,hypot:()=>Ba,inputClear:()=>Gs,inputClearKey:()=>Er,inputMouseMoveThreshold:()=>Cr,inputPreventDefault:()=>jn,inputWASDEmulateDirection:()=>as,isArray:()=>pe,isColor:()=>J,isFullscreen:()=>cc,isIntersecting:()=>Va,isNumber:()=>P,isOnScreen:()=>ah,isOverlapping:()=>Qs,isPowerOfTwo:()=>ds,isStringLike:()=>U,isTouchDevice:()=>oe,isUsingGamepad:()=>Bn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>Rt,keyWasPressed:()=>Mt,keyWasReleased:()=>_r,lastInputDevice:()=>tn,lerp:()=>Wt,lerpAngle:()=>Jl,lerpWrap:()=>Ua,lightSystem:()=>W,lineTest:()=>qa,log2:()=>za,mainCanvas:()=>G,mainCanvasSize:()=>I,mainContext:()=>ut,max:()=>$,medalDisplaySize:()=>mi,medalDisplaySlideTime:()=>Nn,medalDisplayTime:()=>yi,medals:()=>Cs,medalsForEach:()=>Ni,medalsInit:()=>Zh,medalsPreventUnlock:()=>Ur,medalsReset:()=>td,min:()=>Q,mod:()=>ie,mouseDelta:()=>Tr,mouseDeltaScreen:()=>ve,mouseInWindow:()=>oi,mouseIsDown:()=>ls,mousePos:()=>De,mousePosScreen:()=>Jt,mouseWasPressed:()=>gs,mouseWasReleased:()=>xh,mouseWheel:()=>Ar,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Es,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>fr,objectDefaultDamping:()=>dr,objectDefaultFriction:()=>gr,objectDefaultMass:()=>hr,objectDefaultRestitution:()=>pr,objectMaxSpeed:()=>Fe,oscillate:()=>Wa,particleEmitRateScale:()=>Zs,paused:()=>Ce,percent:()=>Ft,percentLerp:()=>Bl,playSamples:()=>Ir,pointerLockExit:()=>Ch,pointerLockIsActive:()=>hc,pointerLockRequest:()=>Ah,postProcess:()=>It,primitiveCount:()=>Re,rand:()=>ft,randBool:()=>Ha,randColor:()=>po,randInCircle:()=>$a,randInt:()=>or,randSign:()=>Xa,randVec2:()=>Ya,readSaveData:()=>Kl,rgb:()=>z,round:()=>$s,saveCanvas:()=>ec,saveDataURL:()=>fs,saveText:()=>Yl,screenToWorld:()=>Ms,screenToWorldDelta:()=>rc,screenToWorldTransform:()=>ks,setAdditiveBlendMode:()=>ps,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>nc,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Eu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Cu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Mu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Nu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Bu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Iu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>ur,sign:()=>se,sin:()=>nt,smoothStep:()=>Ks,soundDefaultRange:()=>xr,soundDefaultTaper:()=>vr,soundEnable:()=>Ht,soundVolume:()=>wn,speak:()=>Bh,speakStop:()=>zh,tan:()=>Ja,textureInfos:()=>un,tile:()=>Is,tileCollisionGetData:()=>li,tileCollisionLayers:()=>rn,tileCollisionRaycast:()=>yc,tileCollisionTest:()=>Qe,tileDefaultBleed:()=>Di,tileDefaultPadding:()=>Oi,tileDefaultSize:()=>Li,tileLayersLoad:()=>Uh,tilesPixelated:()=>An,time:()=>Kt,timeDelta:()=>tr,timeReal:()=>an,timeScale:()=>cr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>br,touchGamepadAnalog:()=>Os,touchGamepadButtonCount:()=>$n,touchGamepadCenterButtonSize:()=>ge,touchGamepadDisplayTime:()=>cs,touchGamepadEnable:()=>ln,touchGamepadFloating:()=>hn,touchGamepadLeftButtonCount:()=>Kn,touchGamepadLeftStick:()=>Rn,touchGamepadPassthrough:()=>mr,touchGamepadRightStick:()=>Qn,touchGamepadSize:()=>qt,touchGamepadVibration:()=>ti,touchInputEnable:()=>mn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Dc,uiDebug:()=>Wr,uiSetDebug:()=>od,uiSystem:()=>C,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>Pr,vibrateEnable:()=>Ds,vibrateStop:()=>Th,workCanvas:()=>Be,workContext:()=>Ze,workReadCanvas:()=>we,workReadContext:()=>je,worldToScreen:()=>Ln,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Gi,zzfxM:()=>Ec});function _l(){return Ce}function Rl(n=!0){Ce=n}function _n(n,t,e,s){p(!xn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new uo(n,t,e,s);xn.push(i)}async function Pl(n,t,e,s,i,o=[],r){if(Da&&console.log(`${Hs} Engine v${Xs}`),p(!ut,"engine already initialized"),ut)return;p(pe(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),r||(r=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function a(){I=b(G.width,G.height),ut.imageSmoothingEnabled=!An,Co()}function c(y=0){let x=y-ao;ao||(x=0),ao=y,(Gt||Ri)&&(Ys=Wt(Ys,1e3/(x||1),.05));let v=Gt&&Rt("Equal"),w=Gt&&Rt("Minus"),_=v?10:w?.1:1;an+=x*_/1e3;let S=cr*_;x*=S,xe+=Ce?0:x,S<=1&&(xe=Q(xe,50));let E=!1;if(Ce){E=!0,l(),Ca(),xn.forEach(T=>{var R;return(R=T.update)==null?void 0:R.call(T)});for(let T of vt)T.parent||T.updateTransforms();Sa(),e(),Ea(),Ae()&&A()}else{let T=0;for(xe<0&&xe>-9&&(T=xe,xe=0);xe>=0;xe-=1e3/60)Kt=Oa++/60,E=!0,l(),Ca(),t(),xn.forEach(R=>{var M;return(M=R.update)==null?void 0:M.call(R)}),Ia(),Sa(),e(),Ea(),Ae()&&A();xe+=T}Ae()||A(),requestAnimationFrame(c);function A(){if(!N){E||l(),a(),s(),vt.sort((T,R)=>T.renderOrder-R.renderOrder);for(let T of vt)T.destroyed||T.render();i(),xn.forEach(T=>{var R;return(R=T.render)==null?void 0:R.call(T)}),_h(),Fl(),Et(),jl(),_e=0,Re=0}}}function l(){if(!N){if(Fn.x){I=Fn.copy();let y=innerWidth/innerHeight,x=Fn.x/Fn.y,v=yGn){let E=I.y*Gn|0;I.x=Q(E,kn.x)}else if(w0&&!k&&(ut.fillStyle=nn.toString(),ut.fillRect(0,0,I.x,I.y),ut.fillStyle=st.toString()),ut.lineJoin="round",ut.lineCap="round"}}if(N)return d();qh(r);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";r.style.cssText=u,G=r.appendChild(document.createElement("canvas")),Tt=ut=G.getContext("2d"),Eh(),Nh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";G.style.cssText=h,tt&&(tt.style.cssText=h),nc(lr),l(),Co(),Be=new OffscreenCanvas(64,64),Ze=Be.getContext("2d"),we=new OffscreenCanvas(64,64),je=we.getContext("2d",{willReadFrequently:!0});let f=o.map((y,x)=>Ta(x,y));return o.length||f.push(Ta(0)),f.push(dh()),ur&&f.push(new Promise(y=>{let x=0;v();function v(){Gs(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(f),d();async function d(){await n(),c()}}function Ia(){er=vt.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of vt)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}vt=vt.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of vt)t.parent||t.destroy(n);vt=vt.filter(t=>!t.destroyed)}function Ma(n,t,e=vt){let s=[];if(n)if(t instanceof ot)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=vt){let s=[];for(let i of e)i.collideRaycast&&Va(n,t,i.pos,i.size)&&(fe&&bt(i.pos,i.size,"#f00"),s.push(i));return fe&&Te(n,t,s.length?"#f00":"#00f",.02),s}function p(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function xt(...n){console.log(...n)}function bt(n,t=b(),e=V,s=0,i=0,o=!1,r=!1){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),p(P(i),"angle must be a number"),J(e)&&(e=e.toString());let a=new Ee(s);en.push({pos:n.copy(),size:t.copy(),color:e,timer:a,angle:i,fill:o,screenSpace:r})}function Il(n,t,e=V,s=0,i=0,o=!1,r=!1){p(O(n),"pos must be a vec2"),p(pe(t),"points must be an array"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),p(P(i),"angle must be a number"),J(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let a=new Ee(s);en.push({pos:n,points:t,color:e,timer:a,angle:i,fill:o,screenSpace:r})}function Ut(n,t=0,e=V,s=0,i=!1,o=!1){p(O(n),"pos must be a vec2"),p(P(t),"size must be a number"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),J(e)&&(e=e.toString()),n=n.copy();let r=new Ee(s);en.push({pos:n,size:t,color:e,timer:r,angle:0,fill:i,screenSpace:o})}function nr(n,t,e,s,i=!1){bt(n,void 0,t,e,s,!1,i)}function Te(n,t,e,s=.1,i=0,o=!1){p(O(n),"posA must be a vec2"),p(O(t),"posB must be a vec2"),p(P(s),"width must be a number");let r=b((t.x-n.x)/2,(t.y-n.y)/2),a=b(s,r.length()*2);bt(n.add(r),a,e,i,r.angle(),!0,o)}function fo(n,t,e,s,i,o,r=!1){p(O(n),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(O(t),"sizeA must be a vec2"),p(O(s),"sizeB must be a vec2");let a=b(Q(n.x-t.x/2,e.x-s.x/2),Q(n.y-t.y/2,e.y-s.y/2)),c=b($(n.x+t.x/2,e.x+s.x/2),$(n.y+t.y/2,e.y+s.y/2));bt(a.lerp(c,.5),c.subtract(a),i,o,0,!1,r)}function Mn(n,t,e=1,s=V,i=0,o=0,r="monospace",a=!1){p(U(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(P(e),"size must be a number"),p(U(s)||J(s),"color is invalid"),p(P(i),"time must be a number"),p(P(o),"angle must be a number"),p(U(r),"font must be a string"),J(s)&&(s=s.toString()),t=t.copy();let c=new Ee(i);en.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:r,screenSpace:a})}function Ml(){en=[]}function Fa(){ho=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
+"use strict";var __GameBundle=(()=>{var zi=Object.defineProperty;var kc=Object.getOwnPropertyDescriptor;var Gc=Object.getOwnPropertyNames;var Fc=Object.prototype.hasOwnProperty;var jc=(n,t,e)=>()=>{if(e)throw e[0];try{return n&&(t=n(n=0)),t}catch(s){throw e=[s],s}};var Hr=(n,t)=>{for(var e in t)zi(n,e,{get:t[e],enumerable:!0})},Nc=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gc(t))!Fc.call(n,i)&&i!==e&&zi(n,i,{get:()=>t[i],enumerable:!(s=kc(t,i))||s.enumerable});return n};var Bc=n=>Nc(zi({},"__esModule",{value:!0}),n);var Ic={};Hr(Ic,{ASSERT:()=>p,BLACK:()=>st,BLUE:()=>Za,Box2dDistanceJoint:()=>Ti,Box2dFrictionJoint:()=>$o,Box2dGearJoint:()=>qo,Box2dJoint:()=>Yt,Box2dKinematicObject:()=>Bo,Box2dMotorJoint:()=>Qo,Box2dObject:()=>Rs,Box2dPinJoint:()=>Uo,Box2dPlugin:()=>Ai,Box2dPrismaticJoint:()=>Ho,Box2dPulleyJoint:()=>Ko,Box2dRaycastResult:()=>wi,Box2dRevoluteJoint:()=>Wo,Box2dRopeJoint:()=>Vo,Box2dStaticObject:()=>Si,Box2dTargetJoint:()=>Jo,Box2dTileLayer:()=>zo,Box2dWeldJoint:()=>Yo,Box2dWheelJoint:()=>Xo,CLEAR_BLACK:()=>ye,CLEAR_WHITE:()=>cn,CYAN:()=>ql,CanvasLayer:()=>ui,Color:()=>wt,Ease:()=>Ei,EngineObject:()=>Ve,GRAY:()=>Vl,GREEN:()=>Qa,ImageFont:()=>ii,LOG:()=>xt,Light:()=>Oo,LightSystemPlugin:()=>Lo,MAGENTA:()=>Hl,Medal:()=>xi,NewgroundsMedal:()=>_o,NewgroundsPlugin:()=>Ro,ORANGE:()=>Wl,PI:()=>X,PURPLE:()=>tc,Particle:()=>hi,ParticleEmitter:()=>vo,PathFinder:()=>Zo,PathFinderNode:()=>_i,PostProcessPlugin:()=>Po,RED:()=>rr,RandomGenerator:()=>go,Sound:()=>xs,SoundInstance:()=>ci,TextureInfo:()=>We,TileCollisionLayer:()=>Ss,TileInfo:()=>Pe,TileLayer:()=>vs,TileLayerData:()=>Tn,Timer:()=>Ee,Tween:()=>Ci,UIButton:()=>_s,UICheckbox:()=>Go,UILayout:()=>No,UIObject:()=>ae,UISlider:()=>Fo,UISystemPlugin:()=>Io,UIText:()=>vi,UITextInput:()=>Mo,UITile:()=>ko,UIVideo:()=>jo,Vector2:()=>rt,WHITE:()=>V,YELLOW:()=>Ka,ZzFXMusic:()=>Do,abs:()=>et,atan2:()=>sr,audioContext:()=>pt,audioDefaultSampleRate:()=>Zn,audioIsRunning:()=>bs,audioMasterGain:()=>Ue,box2d:()=>m,box2dDebug:()=>qr,box2dInit:()=>ad,box2dSetDebug:()=>rd,cameraAngle:()=>K,cameraFit:()=>rh,cameraPos:()=>Ct,cameraScale:()=>q,canvasClearColor:()=>nn,canvasColorTiles:()=>Pi,canvasFixedSize:()=>Fn,canvasMaxAspect:()=>Gn,canvasMaxSize:()=>kn,canvasMinAspect:()=>rs,canvasPixelRatio:()=>sn,canvasPixelated:()=>lr,ceil:()=>hs,clamp:()=>F,combineCanvases:()=>wr,cos:()=>ct,debug:()=>Ft,debugCircle:()=>Vt,debugClear:()=>Ml,debugLine:()=>Te,debugOverlap:()=>fo,debugOverlay:()=>ke,debugPoint:()=>nr,debugPointSize:()=>ka,debugPoly:()=>Il,debugRect:()=>bt,debugScreenshot:()=>Fa,debugShowErrors:()=>kl,debugText:()=>Mn,debugVideoCaptureIsActive:()=>Ae,debugVideoCaptureStart:()=>ja,debugVideoCaptureStop:()=>Na,debugWatermark:()=>Ri,distanceAngle:()=>zl,distanceWrap:()=>ir,drawCanvas2D:()=>Pn,drawCircle:()=>si,drawCircleGradient:()=>sh,drawContext:()=>Tt,drawCount:()=>_e,drawCrescent:()=>ud,drawEllipse:()=>ic,drawEllipseGradient:()=>oc,drawLine:()=>bn,drawLineList:()=>mo,drawNineSlice:()=>_c,drawNineSliceScreen:()=>cd,drawPoly:()=>Vn,drawRect:()=>ni,drawRectGradient:()=>th,drawRegularPoly:()=>sc,drawText:()=>ih,drawTextScreen:()=>on,drawTextureWrapped:()=>eh,drawThreeSlice:()=>Rc,drawThreeSliceScreen:()=>ld,drawTile:()=>Lt,enablePhysicsSolver:()=>Ii,engineAddPlugin:()=>_n,engineImageFont:()=>lc,engineInit:()=>Pl,engineName:()=>Hs,engineObjects:()=>vt,engineObjectsCallback:()=>Ol,engineObjectsCollect:()=>Ma,engineObjectsCollide:()=>er,engineObjectsDestroy:()=>Ll,engineObjectsRaycast:()=>Dl,engineObjectsUpdate:()=>Ia,engineVersion:()=>Xs,fetchJSON:()=>Xl,floor:()=>St,fontDefault:()=>Ps,formatTime:()=>ar,frame:()=>Oa,frameRate:()=>El,gamepadConnected:()=>xo,gamepadDirectionEmulateStick:()=>yr,gamepadDpad:()=>bo,gamepadIsDown:()=>Me,gamepadPrimary:()=>mt,gamepadStick:()=>ys,gamepadStickCount:()=>uc,gamepadVibrate:()=>Sh,gamepadVibrateStop:()=>wh,gamepadWasPressed:()=>Rr,gamepadWasReleased:()=>vh,gamepadsEnable:()=>Mi,getCameraSize:()=>ac,getCrescentPoints:()=>Pc,getNoteFrequency:()=>gc,getPaused:()=>_l,glAntialias:()=>Mr,glCanvas:()=>tt,glCircleSides:()=>Ls,glClearCanvas:()=>vc,glClearRect:()=>Cc,glCompileShader:()=>Eo,glContext:()=>g,glCopyToContext:()=>Nr,glCreateProgram:()=>Yn,glCreateTexture:()=>ji,glDeleteTexture:()=>wc,glDraw:()=>As,glDrawColoredPoints:()=>Jr,glDrawOutlineTransform:()=>zr,glDrawPoints:()=>Ac,glDrawPointsTransform:()=>Br,glDrawUntextured:()=>Tc,glEnable:()=>k,glFlush:()=>Et,glSetAntialias:()=>Yh,glSetRenderTarget:()=>os,glSetTexture:()=>Fr,glSetTextureData:()=>jr,glSetTextureWrap:()=>Sc,gravity:()=>Wt,headlessMode:()=>N,hsl:()=>Fe,hypot:()=>Ba,inputClear:()=>Gs,inputClearKey:()=>Er,inputMouseMoveThreshold:()=>Cr,inputPreventDefault:()=>jn,inputWASDEmulateDirection:()=>as,isArray:()=>pe,isColor:()=>J,isFullscreen:()=>cc,isIntersecting:()=>Va,isNumber:()=>P,isOnScreen:()=>ah,isOverlapping:()=>Qs,isPowerOfTwo:()=>ds,isStringLike:()=>U,isTouchDevice:()=>oe,isUsingGamepad:()=>Bn,isVector2:()=>O,keyDirection:()=>bh,keyIsDown:()=>Pt,keyWasPressed:()=>kt,keyWasReleased:()=>_r,lastInputDevice:()=>tn,lerp:()=>qt,lerpAngle:()=>Jl,lerpWrap:()=>Ua,lightSystem:()=>W,lineTest:()=>qa,log2:()=>za,mainCanvas:()=>G,mainCanvasSize:()=>I,mainContext:()=>ut,max:()=>$,medalDisplaySize:()=>mi,medalDisplaySlideTime:()=>Nn,medalDisplayTime:()=>yi,medals:()=>Cs,medalsForEach:()=>Ni,medalsInit:()=>Zh,medalsPreventUnlock:()=>Ur,medalsReset:()=>td,min:()=>Q,mod:()=>ie,mouseDelta:()=>Tr,mouseDeltaScreen:()=>ve,mouseInWindow:()=>oi,mouseIsDown:()=>ls,mousePos:()=>Ie,mousePosScreen:()=>Ut,mouseWasPressed:()=>gs,mouseWasReleased:()=>xh,mouseWheel:()=>Ar,nearestPowerOfTwo:()=>Ul,newgrounds:()=>Es,noise1D:()=>Zl,noise2D:()=>tu,objectDefaultAngleDamping:()=>fr,objectDefaultDamping:()=>dr,objectDefaultFriction:()=>gr,objectDefaultMass:()=>hr,objectDefaultRestitution:()=>pr,objectMaxSpeed:()=>je,oscillate:()=>Wa,particleEmitRateScale:()=>Zs,paused:()=>Ce,percent:()=>jt,percentLerp:()=>Bl,playSamples:()=>Ir,pointerLockExit:()=>Ch,pointerLockIsActive:()=>hc,pointerLockRequest:()=>Ah,postProcess:()=>Mt,primitiveCount:()=>Re,rand:()=>ft,randBool:()=>Ha,randColor:()=>po,randInCircle:()=>$a,randInt:()=>or,randSign:()=>Xa,randVec2:()=>Ya,readSaveData:()=>Kl,rgb:()=>z,round:()=>$s,saveCanvas:()=>ec,saveDataURL:()=>fs,saveText:()=>Yl,screenToWorld:()=>Ms,screenToWorldDelta:()=>rc,screenToWorldTransform:()=>ks,setAdditiveBlendMode:()=>ps,setCameraAngle:()=>nu,setCameraPos:()=>eu,setCameraScale:()=>su,setCanvasClearColor:()=>ru,setCanvasColorTiles:()=>ou,setCanvasFixedSize:()=>uu,setCanvasMaxAspect:()=>lu,setCanvasMaxSize:()=>au,setCanvasMinAspect:()=>cu,setCanvasPixelRatio:()=>du,setCanvasPixelated:()=>nc,setCursor:()=>hh,setDebugKey:()=>Zu,setDebugWatermark:()=>Qu,setEnablePhysicsSolver:()=>Su,setFontDefault:()=>fu,setGLCircleSides:()=>mu,setGLEnable:()=>yu,setGamepadDirectionEmulateStick:()=>Ou,setGamepadsEnable:()=>Lu,setGravity:()=>Ru,setHeadlessMode:()=>gu,setInputMouseMoveThreshold:()=>ph,setInputPreventDefault:()=>fh,setInputWASDEmulateDirection:()=>Du,setMedalDisplaySize:()=>sd,setMedalDisplaySlideTime:()=>nd,setMedalDisplayTime:()=>ed,setMedalsPreventUnlock:()=>id,setObjectDefaultAngleDamping:()=>Au,setObjectDefaultDamping:()=>Tu,setObjectDefaultFriction:()=>Eu,setObjectDefaultMass:()=>wu,setObjectDefaultRestitution:()=>Cu,setObjectMaxSpeed:()=>_u,setParticleEmitRateScale:()=>Pu,setPaused:()=>Rl,setShowSplashScreen:()=>pu,setSoundDefaultRange:()=>$u,setSoundDefaultTaper:()=>Ku,setSoundEnable:()=>Xu,setSoundVolume:()=>Yu,setTileDefaultBleed:()=>vu,setTileDefaultPadding:()=>xu,setTileDefaultSize:()=>bu,setTilesPixelated:()=>hu,setTimeScale:()=>iu,setTouchGamepadAlpha:()=>Vu,setTouchGamepadAnalog:()=>zu,setTouchGamepadButtonCount:()=>Fu,setTouchGamepadCenterButtonSize:()=>Gu,setTouchGamepadDisplayTime:()=>Wu,setTouchGamepadEnable:()=>Mu,setTouchGamepadFloating:()=>Ju,setTouchGamepadLeftButtonCount:()=>Nu,setTouchGamepadLeftStick:()=>ju,setTouchGamepadPassthrough:()=>ku,setTouchGamepadRightStick:()=>Bu,setTouchGamepadSize:()=>Uu,setTouchGamepadVibration:()=>qu,setTouchInputEnable:()=>Iu,setVibrateEnable:()=>Hu,shareURL:()=>$l,showSplashScreen:()=>ur,sign:()=>se,sin:()=>nt,smoothStep:()=>Ks,soundDefaultRange:()=>xr,soundDefaultTaper:()=>vr,soundEnable:()=>Xt,soundVolume:()=>wn,speak:()=>Bh,speakStop:()=>zh,tan:()=>Ja,textureInfos:()=>un,tile:()=>Is,tileCollisionGetData:()=>li,tileCollisionLayers:()=>rn,tileCollisionRaycast:()=>yc,tileCollisionTest:()=>Qe,tileDefaultBleed:()=>Di,tileDefaultPadding:()=>Oi,tileDefaultSize:()=>Li,tileLayersLoad:()=>Uh,tilesPixelated:()=>An,time:()=>Qt,timeDelta:()=>tr,timeReal:()=>an,timeScale:()=>cr,toggleFullscreen:()=>uh,touchGamepadAlpha:()=>br,touchGamepadAnalog:()=>Os,touchGamepadButtonCount:()=>$n,touchGamepadCenterButtonSize:()=>ge,touchGamepadDisplayTime:()=>cs,touchGamepadEnable:()=>ln,touchGamepadFloating:()=>hn,touchGamepadLeftButtonCount:()=>Kn,touchGamepadLeftStick:()=>Rn,touchGamepadPassthrough:()=>mr,touchGamepadRightStick:()=>Qn,touchGamepadSize:()=>Ht,touchGamepadVibration:()=>ti,touchInputEnable:()=>mn,tweenProperty:()=>hd,tweenStopAll:()=>dd,tweenUpdate:()=>Dc,uiDebug:()=>Wr,uiSetDebug:()=>od,uiSystem:()=>C,usingGamepadInput:()=>mh,usingKeyboardInput:()=>yh,usingMouseInput:()=>gh,vec2:()=>b,vibrate:()=>Pr,vibrateEnable:()=>Ds,vibrateStop:()=>Th,workCanvas:()=>ze,workContext:()=>Ze,workReadCanvas:()=>we,workReadContext:()=>Ne,worldToScreen:()=>Ln,worldToScreenDelta:()=>oh,writeSaveData:()=>Ql,zzfx:()=>Jh,zzfxG:()=>Gi,zzfxM:()=>Ec});function _l(){return Ce}function Rl(n=!0){Ce=n}function _n(n,t,e,s){p(!xn.find(o=>o.update===n&&o.render===t&&o.glContextLost===e&&o.glContextRestored===s));let i=new uo(n,t,e,s);xn.push(i)}async function Pl(n,t,e,s,i,o=[],r){if(Da&&console.log(`${Hs} Engine v${Xs}`),p(!ut,"engine already initialized"),ut)return;p(pe(o),"pass in images as array"),document.body||document.documentElement.appendChild(document.createElement("body")),r||(r=document.body),n||(n=()=>{}),t||(t=()=>{}),e||(e=()=>{}),s||(s=()=>{}),i||(i=()=>{});function a(){I=b(G.width,G.height),ut.imageSmoothingEnabled=!An,Co()}function c(y=0){let x=y-ao;ao||(x=0),ao=y,(Ft||Ri)&&(Ys=qt(Ys,1e3/(x||1),.05));let v=Ft&&Pt("Equal"),w=Ft&&Pt("Minus"),_=v?10:w?.1:1;an+=x*_/1e3;let S=cr*_;x*=S,xe+=Ce?0:x,S<=1&&(xe=Q(xe,50));let E=!1;if(Ce){E=!0,l(),Ca(),xn.forEach(T=>{var R;return(R=T.update)==null?void 0:R.call(T)});for(let T of vt)T.parent||T.updateTransforms();Sa(),e(),Ea(),Ae()&&A()}else{let T=0;for(xe<0&&xe>-9&&(T=xe,xe=0);xe>=0;xe-=1e3/60)Qt=Oa++/60,E=!0,l(),Ca(),t(),xn.forEach(R=>{var M;return(M=R.update)==null?void 0:M.call(R)}),Ia(),Sa(),e(),Ea(),Ae()&&A();xe+=T}Ae()||A(),requestAnimationFrame(c);function A(){if(!N){E||l(),a(),s(),vt.sort((T,R)=>T.renderOrder-R.renderOrder);for(let T of vt)T.destroyed||T.render();i(),xn.forEach(T=>{var R;return(R=T.render)==null?void 0:R.call(T)}),_h(),Fl(),Et(),jl(),_e=0,Re=0}}}function l(){if(!N){if(Fn.x){I=Fn.copy();let y=innerWidth/innerHeight,x=Fn.x/Fn.y,v=yGn){let E=I.y*Gn|0;I.x=Q(E,kn.x)}else if(w0&&!k&&(ut.fillStyle=nn.toString(),ut.fillRect(0,0,I.x,I.y),ut.fillStyle=st.toString()),ut.lineJoin="round",ut.lineCap="round"}}if(N)return d();qh(r);let u="margin:0;overflow:hidden;background:#000;user-select:none;-webkit-user-select:none;touch-action:none;-webkit-touch-callout:none";r.style.cssText=u,G=r.appendChild(document.createElement("canvas")),Tt=ut=G.getContext("2d"),Eh(),Nh(),Gl();let h="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)";G.style.cssText=h,tt&&(tt.style.cssText=h),nc(lr),l(),Co(),ze=new OffscreenCanvas(64,64),Ze=ze.getContext("2d"),we=new OffscreenCanvas(64,64),Ne=we.getContext("2d",{willReadFrequently:!0});let f=o.map((y,x)=>Ta(x,y));return o.length||f.push(Ta(0)),f.push(dh()),ur&&f.push(new Promise(y=>{let x=0;v();function v(){Gs(),Qh(x+=.01),x>1?y():setTimeout(v,16)}})),await Promise.all(f),d();async function d(){await n(),c()}}function Ia(){er=vt.filter(t=>t.collideSolidObjects);function n(t){if(!t.destroyed){t.update();for(let e of t.children)n(e)}}for(let t of vt)if(!(t.parent||t.destroyed)){t.update(),t.updatePhysics();for(let e of t.children)n(e);t.updateTransforms()}vt=vt.filter(t=>!t.destroyed)}function Ll(n=!0){for(let t of vt)t.parent||t.destroy(n);vt=vt.filter(t=>!t.destroyed)}function Ma(n,t,e=vt){let s=[];if(n)if(t instanceof rt)for(let i of e)i.isOverlapping(n,t)&&s.push(i);else{let i=t*t;for(let o of e)n.distanceSquared(o.pos)e(i))}function Dl(n,t,e=vt){let s=[];for(let i of e)i.collideRaycast&&Va(n,t,i.pos,i.size)&&(fe&&bt(i.pos,i.size,"#f00"),s.push(i));return fe&&Te(n,t,s.length?"#f00":"#00f",.02),s}function p(n,...t){if(!n)throw console.assert(n,...t),new Error("Assert failed!")}function xt(...n){console.log(...n)}function bt(n,t=b(),e=V,s=0,i=0,o=!1,r=!1){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),p(P(i),"angle must be a number"),J(e)&&(e=e.toString());let a=new Ee(s);en.push({pos:n.copy(),size:t.copy(),color:e,timer:a,angle:i,fill:o,screenSpace:r})}function Il(n,t,e=V,s=0,i=0,o=!1,r=!1){p(O(n),"pos must be a vec2"),p(pe(t),"points must be an array"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),p(P(i),"angle must be a number"),J(e)&&(e=e.toString()),n=n.copy(),t=t.map(c=>c.copy());let a=new Ee(s);en.push({pos:n,points:t,color:e,timer:a,angle:i,fill:o,screenSpace:r})}function Vt(n,t=0,e=V,s=0,i=!1,o=!1){p(O(n),"pos must be a vec2"),p(P(t),"size must be a number"),p(U(e)||J(e),"color is invalid"),p(P(s),"time must be a number"),J(e)&&(e=e.toString()),n=n.copy();let r=new Ee(s);en.push({pos:n,size:t,color:e,timer:r,angle:0,fill:i,screenSpace:o})}function nr(n,t,e,s,i=!1){bt(n,void 0,t,e,s,!1,i)}function Te(n,t,e,s=.1,i=0,o=!1){p(O(n),"posA must be a vec2"),p(O(t),"posB must be a vec2"),p(P(s),"width must be a number");let r=b((t.x-n.x)/2,(t.y-n.y)/2),a=b(s,r.length()*2);bt(n.add(r),a,e,i,r.angle(),!0,o)}function fo(n,t,e,s,i,o,r=!1){p(O(n),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(O(t),"sizeA must be a vec2"),p(O(s),"sizeB must be a vec2");let a=b(Q(n.x-t.x/2,e.x-s.x/2),Q(n.y-t.y/2,e.y-s.y/2)),c=b($(n.x+t.x/2,e.x+s.x/2),$(n.y+t.y/2,e.y+s.y/2));bt(a.lerp(c,.5),c.subtract(a),i,o,0,!1,r)}function Mn(n,t,e=1,s=V,i=0,o=0,r="monospace",a=!1){p(U(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(P(e),"size must be a number"),p(U(s)||J(s),"color is invalid"),p(P(i),"time must be a number"),p(P(o),"angle must be a number"),p(U(r),"font must be a string"),J(s)&&(s=s.toString()),t=t.copy();let c=new Ee(i);en.push({text:n,pos:t,size:e,color:s,timer:c,angle:o,font:r,screenSpace:a})}function Ml(){en=[]}function Fa(){ho=1}function kl(){let n=e=>{document.body.style="background-color:#111;margin:8px",document.body.innerHTML="
"+e},t=console.assert;console.assert=(e,...s)=>{if(t(e,...s),!e){let i=s.join(" "),o=new Error().stack;throw`Assertion failed!
 `+i+`
 `+o}},onunhandledrejection=e=>n(e.reason.stack||e.reason),onerror=(e,s,i,o)=>n(`${e}
 ${s}
-Ln ${i}, Col ${o}`)}function Gl(){Da&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function Sa(){Gt&&(Mt(Ga)&&(Me=!Me),Me&&(Mt("Digit1")&&(de=!de,vn=!1),Mt("Digit2")&&(vn=!vn,de=!1),Mt("Digit3")&&(Sn=!Sn),Mt("Digit4")&&(fe=!fe),Mt("Digit5")&&Fa(),Mt("Digit7")&&(Un=!Un)),Ae()?(!Me||Mt("Digit6"))&&Na():Me&&Mt("Digit6")&&ja())}function Fl(){if(Ae())return;Et();let n=_e,t=Re;ho&&(wr(),ec(G),ho=0);let e=ut;if(Sn&&Mi){let o=0;for(let r=0;r<8;r++)xo(r)&&o++;for(let r=0;r<8;r++){if(!xo(r))continue;let a=1,c=.2,l=Ct.add(b(-a*2,((o-1)/2-r)*a*3));Mn(r,l.add(b(-a,a)),1),r===mt&&Mn("Main",l.add(b(-a*2,0)),1,"#0f0");let u=Se[r].length;for(let f=0;f{e.save();let o=i.pos,r=1,a=i.angle;if(i.screenSpace||(o=Ln(i.pos),r=q,a-=K),e.translate(o.x|0,o.y|0),e.rotate(a),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*r+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(r).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=ka*r;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(r).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*r/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),en=en.filter(i=>i.timer<0),s){let i=yc(s.pos,De);i&&ni(i.floor().add(b(.5)),b(1),z(0,1,1,.3),0,!1),bn(De,s.pos,.1,i?z(1,0,0,.5):z(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+De;rn.length&&(o+=`
-mouse collision = `+li(De)),o+=`
+Ln ${i}, Col ${o}`)}function Gl(){Da&&console.warn("LittleJS DEBUG build loaded. Use the release build for production.")}function Sa(){Ft&&(kt(Ga)&&(ke=!ke),ke&&(kt("Digit1")&&(de=!de,vn=!1),kt("Digit2")&&(vn=!vn,de=!1),kt("Digit3")&&(Sn=!Sn),kt("Digit4")&&(fe=!fe),kt("Digit5")&&Fa(),kt("Digit7")&&(Un=!Un)),Ae()?(!ke||kt("Digit6"))&&Na():ke&&kt("Digit6")&&ja())}function Fl(){if(Ae())return;Et();let n=_e,t=Re;ho&&(wr(),ec(G),ho=0);let e=ut;if(Sn&&Mi){let o=0;for(let r=0;r<8;r++)xo(r)&&o++;for(let r=0;r<8;r++){if(!xo(r))continue;let a=1,c=.2,l=Ct.add(b(-a*2,((o-1)/2-r)*a*3));Mn(r,l.add(b(-a,a)),1),r===mt&&Mn("Main",l.add(b(-a*2,0)),1,"#0f0");let u=Se[r].length;for(let f=0;f{e.save();let o=i.pos,r=1,a=i.angle;if(i.screenSpace||(o=Ln(i.pos),r=q,a-=K),e.translate(o.x|0,o.y|0),e.rotate(a),e.scale(1,i.text?1:-1),e.fillStyle=i.color,e.strokeStyle=i.color,i.text!==void 0)e.font=i.size*r+"px "+i.font,e.textAlign="center",e.textBaseline="middle",e.fillText(i.text,0,0);else if(i.points!==void 0){e.beginPath();for(let c of i.points){let l=c.scale(r).floor();e.lineTo(l.x,l.y)}e.closePath(),i.fill&&e.fill(),e.stroke()}else if(i.size===0||i.size.x===0&&i.size.y===0){let c=ka*r;e.fillRect(-c/2,-1,c,3),e.fillRect(-1,-c/2,3,c)}else if(i.size.x!==void 0){let c=i.size.scale(r).floor(),l=c.x,u=c.y;i.fill&&e.fillRect(-l/2|0,-u/2|0,l,u),e.strokeRect(-l/2|0,-u/2|0,l,u)}else e.beginPath(),e.arc(0,0,i.size*r/2,0,9),i.fill&&e.fill(),e.stroke();e.restore()}),en=en.filter(i=>i.timer<0),s){let i=yc(s.pos,Ie);i&&ni(i.floor().add(b(.5)),b(1),z(0,1,1,.3),0,!1),bn(Ie,s.pos,.1,i?z(1,0,0,.5):z(0,1,0,.5),void 0,void 0,!1);let o="mouse pos = "+Ie;rn.length&&(o+=`
+mouse collision = `+li(Ie)),o+=`
 
 --- object info ---
-`,o+=s.toString(),on(o,Jt,24,z(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let r=9,a=0,c=24;if(Me){e.fillText(`${Hs} v${Xs}`,r,a+=c/2),e.fillText("Time: "+ar(Kt),r,a+=c),e.fillText("FPS: "+Ys.toFixed(1)+(k?" WebGL":" Canvas2D"),r,a+=c),e.fillText("Objects: "+vt.length,r,a+=c),e.fillText("Draw Calls: "+_e,r,a+=c),e.fillText("Primitives: "+Re,r,a+=c),e.fillText("---------",r,a+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",r,a+=c),e.fillStyle=de?"#f00":"#fff",e.fillText("1: Debug Physics",r,a+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("2: Debug Particles",r,a+=c),e.fillStyle=Sn?"#f00":"#fff",e.fillText("3: Debug Gamepads",r,a+=c),e.fillStyle=fe?"#f00":"#fff",e.fillText("4: Debug Raycasts",r,a+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",r,a+=c),e.fillText("6: Toggle Video Capture",r,a+=c),e.fillStyle=Un?"#f00":"#fff",e.fillText("7: Debug Sound",r,a+=c);let l="",u="";for(let h in Y[0])Rt(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,r,a+=c),l&&e.fillText("Keys: "+l,r,a+=c);for(let h=1;hs.push(a.data),i.onstop=()=>{let a=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(a);fs(c,"capture.webm",1e3)};let o,r;if(Ht){r=new ConstantSourceNode(pt,{offset:0}),r.connect(Je),r.start(),o=pt.createMediaStreamDestination(),Je.connect(o);for(let a of o.stream.getAudioTracks())n.addTrack(a)}try{i.start()}catch{xt("Video capture not supported in this browser!"),r==null||r.stop();return}xt("Video capture started."),ke={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:r,audioStreamDestination:o}}function Na(){var n,t,e;p(Ae(),"Not capturing video!"),xt(`Video capture ended. ${ke.captureTimer.get().toFixed(2)} seconds recorded.`),he.style.display="none",(n=ke.silentAudioSource)==null||n.stop(),(t=ke.mediaRecorder)==null||t.stop(),(e=ke.videoTrack)==null||e.stop(),ke=void 0}function Nl(){p(Ae(),"Not capturing video!"),wr(),ke.videoTrack.requestFrame(),he.textContent="\u25CF REC "+ar(ke.captureTimer)}function Zt(n){if(Gt){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{p(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function ie(n,t=1){return(n%t+t)%t}function F(n,t=0,e=1){return ne?e:n}function Ft(n,t,e){return(e-=t)?F((n-t)/e):0}function Wt(n,t,e){return n+F(e)*(t-n)}function Bl(n,t,e,s,i){return Wt(s,i,Ft(n,t,e))}function ir(n,t,e=1){p(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ua(n,t,e,s=1){return n+F(e)*ir(t,n,s)}function zl(n,t){return ir(n,t,2*X)}function Jl(n,t,e){return Ua(n,t,e,2*X)}function Ks(n){return n*n*(3-2*n)}function ds(n){return!(n&n-1)}function Ul(n){return 2**hs(za(n))}function Qs(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,r=t.x+s.x,a=t.y+s.y;return et(i)f)return!1;h=$(y,h)}else{if(y0?a.x+1:a.x,x=h>0?a.y+1:a.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,E=w,A=fa.x&&(T.x=a.x+1-R),M.ya.y&&(T.y=a.y+1-R),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;p(U(n),"shareURL requires title string"),p(U(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){p(U(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{xt("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{xt("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){p(U(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{xt("writeSaveData: failed to write",n)}}function yo(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=St(n);return Wt(yo(t),yo(t+1),Ks(n-t))}function tu(n,t){let e=St(n),s=St(t),i=Ks(n-e),o=Ks(t-s),r=(a,c)=>yo(a+c*374761393);return Wt(Wt(r(e,s),r(e+1,s),i),Wt(r(e,s+1),r(e+1,s+1),i),o)}function eu(n){Ct=n.copy()}function nu(n){K=n}function su(n){q=n}function iu(n){cr=n}function ou(n){Pi=n}function ru(n){nn=n.copy()}function au(n){kn=n.copy()}function cu(n){rs=n}function lu(n){Gn=n}function uu(n){Fn=n.copy()}function nc(n){lr=n,G&&(G.style.imageRendering=n?"pixelated":""),tt&&(tt.style.imageRendering=n?"pixelated":"")}function hu(n){An=n}function du(n){sn=n}function fu(n){Ps=n}function pu(n){ur=n}function gu(n){N=n}function yu(n){if(n&&!Ao){console.warn("Can not enable WebGL if it was disabled on start.");return}k=n,tt&&(tt.style.display=n?"":"none")}function mu(n){Ls=n}function bu(n){Li=n.copy()}function xu(n){Oi=n}function vu(n){Di=n}function Su(n){Ii=n}function wu(n){hr=n}function Tu(n){dr=n}function Au(n){fr=n}function Cu(n){pr=n}function Eu(n){gr=n}function _u(n){Fe=n}function Ru(n){Vt=n.copy()}function Pu(n){Zs=n}function Lu(n){Mi=n}function Ou(n){yr=n}function Du(n){as=n}function Iu(n){mn=n}function Mu(n){ln=n}function ku(n){mr=n}function Gu(n){ge=n}function Fu(n){$n=n,n>0&&(Qn=!1)}function ju(n){Rn=n,n&&(Kn=0)}function Nu(n){Kn=n,n>0&&(Rn=!1)}function Bu(n){Qn=n,n&&($n=0)}function zu(n){Os=n}function Ju(n){hn=n}function Uu(n){qt=n}function Vu(n){br=n}function Wu(n){cs=n}function qu(n){ti=n}function Hu(n){Ds=n}function Xu(n){Ht=n}function Yu(n){wn=n,Ht&&!N&&Je&&(Je.gain.value=n)}function $u(n){xr=n}function Ku(n){vr=n}function Qu(n){Ri=n}function Zu(n){Ga=n}function ei(n){return n.r>=1&&n.g>=1&&n.b>=1}function Sr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Is(n=0,t=Li,e=0,s=Oi,i=Di){if(p(O(n)||typeof n=="number","index must be a vec2 or number"),p(O(t)||typeof t=="number","size must be a vec2 or number"),p(P(e)||e instanceof Ve,"texture must be a number or TextureInfo"),p(P(s),"padding must be a number"),N)return new Pe;typeof t=="number"&&(p(t>0),t=new ot(t,t));let o=typeof e=="number"?un[e]:e;p(o instanceof Ve,"tile texture is not loaded"),p(o.size.x>0,"tile texture is not loaded");let r=t.x+s*2,a=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/r|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new ot(c*r+s,l*a+s);return new Pe(u,t,o,s,i)}function Pt(n,t=b(1),e,s=V,i=0,o,r,a=k,c=!1,l){var f;p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!r||J(r),"additiveColor must be a color"),p(!l||!a,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(f=e==null?void 0:e.bleed)!=null?f:0;if(a&&k)if(p(!!g,"WebGL is not enabled!"),c&&([n,t,i]=ks(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(Fr(u.glTexture),h){let _=d.x*h,S=d.y*h;As(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),r&&r.rgbaInt())}else As(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),r&&r.rgbaInt())}else{let d=r?s.add(r):s;Tc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++_e,++Re,Pn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,r,h)}else{let y=r?s.add(r):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function ni(n,t,e,s,i,o,r){Pt(n,t,void 0,e,s,!1,void 0,i,o,r)}function th(n,t,e=V,s=cn,i=0,o=k,r=!1,a){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!a||!o,"context only supported in canvas 2D mode"),o&&k){p(!!g,"WebGL is not enabled!"),r&&(n=Ms(n),t=t.scale(1/q),i+=K);let c=[],l=[],u=t.x/2,h=t.y/2,f=e.rgbaInt(),d=s.rgbaInt(),y=at(-i),x=nt(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,E=w*x+_*y,A=v&2?f:d;c.push(b(n.x+S,n.y+E)),l.push(A)}Jr(c,l)}else++_e,++Re,Pn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},r,a)}function eh(n,t,e,s=0,i=V,o=0,r,a=k,c=!1,l){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(O(e),"wrapCount must be a vec2"),p(J(i),"color is invalid"),p(P(o),"angle must be a number"),p(!r||J(r),"additiveColor must be a color"),p(!l||!a,"context only supported in canvas 2D mode"),p(!(s instanceof Pe),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),N)return;let u=typeof s=="number"?un[s]:s;if(p(u instanceof Ve,"texture not loaded"),p(u.size.x>0,"texture not loaded"),p(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),a&&k){p(!!g,"WebGL is not enabled!"),c&&([n,t,o]=ks(n,t,o)),Fr(u.glTexture),As(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),r&&r.rgbaInt());return}++_e,++Re,c||(n=Ln(n),t=t.scale(q),o-=K);let h=!Pi||(r?ei(i.add(r))&&r.a<=0:ei(i)),f=!h&&r&&!Sr(r),d=h?u.image:ch(u.image,i,r);l=l||Tt,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=f?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function mo(n,t=.1,e=V,s=!1,i=b(),o=0,r=k,a=!1,c){if(p(pe(n),"points must be an array"),p(P(t),"width must be a number"),p(J(e),"color is invalid"),p(O(i),"pos must be a vec2"),p(P(o),"angle must be a number"),p(!c||!r,"context only supported in canvas 2D mode"),r&&k){p(!!g,"WebGL is not enabled!");let l=b(1);a&&([i,l,o]=ks(i,l,o)),zr(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++_e,++Re,Pn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&zr(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Pn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},a,c)}function ic(n,t=b(1),e=V,s=0,i=0,o=st,r=k,a=!1,c){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(o),"color is invalid"),p(P(s),"angle must be a number"),p(P(i),"lineWidth must be a number"),p(i>=0,"lineWidth must be a positive value or 0"),p(!c||!r,"context only supported in canvas 2D mode"),i=F(i,0,Q(t.x,t.y)),r&&k?sc(n,t,Ls,e,i,o,s,r,a,c):Pn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},a,c)}function si(n,t=1,e=V,s=0,i=st,o=k,r=!1,a){p(P(t),"size must be a number"),ic(n,b(t),e,0,s,i,o,r,a)}function oc(n,t=b(1),e=V,s=cn,i=0,o=k,r=!1,a){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!a||!o,"context only supported in canvas 2D mode"),!N)if(o&&k){p(!!g,"WebGL is not enabled!"),r&&(n=Ms(n),t=t.scale(1/q),i+=K);let c=Ls,l=t.x/2,u=t.y/2,h=e.rgbaInt(),f=s.rgbaInt(),d=nh++,y=at(-i),x=nt(-i),v=E=>{let A=nt(E)*l,T=at(E)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*X*2,_=[v(w)],S=[f];for(let E=c;E--;){let A=(E+d)%c/c*X*2;_.push(n),S.push(h),_.push(v(A)),S.push(f)}Jr(_,S)}else++_e,++Re,Pn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},r,a)}function sh(n,t=1,e=V,s=cn,i=k,o=!1,r){p(P(t),"size must be a number"),oc(n,b(t),e,s,0,i,o,r)}function Pn(n,t,e=0,s=!1,i,o=!1,r=Tt){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(P(e),"angle must be a number"),p(typeof i=="function","drawFunction must be a function"),o||(n=Ln(n),t=t.scale(q),e-=K),r.save(),r.translate(n.x+.5,n.y+.5),r.rotate(e),r.scale(s?-t.x:t.x,-t.y),i(r),r.restore()}function ih(n,t,e=1,s=V,i=0,o=st,r="center",a=Ps,c="",l,u=0,h=Tt){t=Ln(t),e*=q,i*=q,u-=K,u*=-1,on(n,t,e,s,i,o,r,a,c,l,u,h)}function on(n,t,e,s=V,i=0,o=st,r="center",a=Ps,c="",l,u=0,h=Tt){p(U(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(P(e),"size must be a number"),p(J(s),"color must be a color"),p(P(i),"lineWidth must be a number"),p(J(o),"lineColor must be a color"),p(["left","center","right"].includes(r),"align must be left, center, or right"),p(U(a),"font must be a string"),p(U(c),"fontStyle must be a string"),p(P(u),"angle must be a number");let f=(n+"").split(`
-`),d=t.y-(f.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=r,h.font=c+" "+e+"px "+a,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;f.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function Ta(n,t){p(P(n),"textureIndex must be a number"),p(!un[n],"textureIndex is already loaded!"),p(!t||U(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),un[n]=new Ve(e)}function Ms(n){p(O(n),"screenPos must be a vec2");let t=(n.x-I.x/2+.5)/q,e=(n.y-I.y/2+.5)/-q;if(K){let s=at(-K),i=nt(-K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new ot(t+Ct.x,e+Ct.y)}function Ln(n){p(O(n),"worldPos must be a vec2");let t=n.x-Ct.x,e=n.y-Ct.y;if(K){let s=at(K),i=nt(K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new ot(t*q+I.x/2-.5,e*-q+I.y/2-.5)}function rc(n){p(O(n),"screenDelta must be a vec2");let t=n.x/q,e=n.y/-q;if(K){let s=at(-K),i=nt(-K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new ot(t,e)}function oh(n){p(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(K){let s=at(K),i=nt(K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new ot(t*q,e*-q)}function ks(n,t,e=0){return p(O(n),"screenPos must be a vec2"),p(O(t),"screenSize must be a vec2"),p(P(e),"screenAngle must be a number"),[Ms(n),t.scale(1/q),e+K]}function ac(){return I.scale(1/q)}function rh(n,t,e,s){p(O(n),"center must be a vec2"),p(O(t),"size must be a vec2");let i=f(e),o=f(s),r=t.x+i.left+i.right,a=t.y+i.top+i.bottom,c=I.x-o.left-o.right,l=I.y-o.top-o.bottom;if(!(r>0&&a>0&&c>0&&l>0))return q;q=Q(c/r,l/a);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/q);return Ct=n.add(u).add(h),q;function f(d){return(d===void 0||P(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(p(O(n),"pos must be a vec2"),p(O(t)||P(t),"size must be a vec2 or number"),!q)return!1;let e=n.x-Ct.x,s=n.y-Ct.y;if(K){let r=at(K),a=nt(K),c=e*r-s*a,l=e*a+s*r;e=c,s=l}e*=q*2,s*=-q*2,t instanceof ot&&(t=t.length()),t*=q;let i=I.x,o=I.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=a,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new Ve(n),r=new Pe(t,e,o,s,i);lc=new ii(r)}function fh(n=!0){jn=n}function ph(n){Cr=n}function gh(){return tn==="mouse"}function yh(){return tn==="keyboard"}function mh(){return tn==="gamepad"}function Er(n,t=0,e=!0,s=!0,i=!0){Y[t]&&(Y[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function Gs(){Y.length=0,Y[0]=[],re.length=0,Cn.length=0,Fs.length=0,Se.length=0,gn.length=0}function Rt(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&1)}function Mt(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&2)}function _r(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){p(U(n),"up key must be a string"),p(U(t),"down key must be a string"),p(U(e),"left key must be a string"),p(U(s),"right key must be a string");let i=o=>Rt(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function ls(n){return p(P(n),"mouse button must be a number"),Rt(n)}function gs(n){return p(P(n),"mouse button must be a number"),Mt(n)}function xh(n){return p(P(n),"mouse button must be a number"),_r(n)}function Ie(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),Rt(n,t+1)}function Rr(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),Mt(n,t+1)}function vh(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),_r(n,t+1)}function ys(n,t=mt){var e,s;return p(P(n),"stick must be a number"),p(P(t),"gamepad must be a number"),(s=(e=Se[t])==null?void 0:e[n])!=null?s:b()}function bo(n=mt){var t;return p(P(n),"gamepad must be a number"),(t=gn[n])!=null?t:b()}function xo(n=mt){return p(P(n),"gamepad must be a number"),!!Y[n+1]}function uc(n=mt){var t,e;return p(P(n),"gamepad must be a number"),(e=(t=Se[n])==null?void 0:t.length)!=null?e:0}function Sh(n=mt,t=200,e=1,s=1,i=0){var r,a,c;if(p(P(n),"gamepad must be a number"),!Ds||N)return;let o=(r=navigator==null?void 0:navigator.getGamepads)==null?void 0:r.call(navigator)[n];(c=(a=o==null?void 0:o.vibrationActuator)==null?void 0:a.playEffect)==null||c.call(a,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=mt){var e,s,i;if(p(P(n),"gamepad must be a number"),!Ds||N)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function Pr(n=100){var t;p(P(n)||pe(n),"pattern must be a number or array"),Ds&&!N&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){Pr(0)}function Ah(){var n;!oe&&((n=G.requestPointerLock)==null||n.call(G))}function Ch(){var n;(n=document.exitPointerLock)==null||n.call(document)}function hc(){return document.pointerLockElement===G}function Eh(){if(N)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",r),document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),oe&&mn&&u();function n(f){if(f.repeat||(Y[0][f.code]=3,as&&(Y[0][e(f.code)]=3)),!jn||!f.cancelable||!document.hasFocus()||f.ctrlKey||f.metaKey||f.altKey||x(f.target)||x(document.activeElement))return;let d=typeof f.key=="string"&&f.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(f.code)||d)&&f.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(f){Y[0][f.code]=Y[0][f.code]&2|4,as&&(Y[0][e(f.code)]=4)}function e(f){return as?f==="KeyW"?"ArrowUp":f==="KeyS"?"ArrowDown":f==="KeyA"?"ArrowLeft":f==="KeyD"?"ArrowRight":f:f}function s(f){if(oe&&mn)return;Ht&&!N&&pt&&!bs()&&pt.resume(),Y[0][f.button]=3;let d=Jt;Jt=h(b(f.x,f.y)),ve=ve.add(Jt.subtract(d)),jn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function i(f){oe&&mn||(Y[0][f.button]=Y[0][f.button]&2|4)}function o(f){oi=!0;let d=Jt;Jt=h(b(f.x,f.y));let y=hc()?b(f.movementX,f.movementY):Jt.subtract(d);ve=ve.add(y)}function r(){oi=!1}function a(f){f.ctrlKey||(Ar+=se(f.deltaY)),jn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function c(f){f.preventDefault()}function l(){Gs(),Ne.clear(),re.length=0,Cn.length=0,Fs.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let f;function d(y){if(mn){if(Ht&&!N&&pt&&!bs()&&pt.resume(),!ln||mr){let x=S=>ms.includes(S.target)||S.target===yn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),E=Jt;Jt=h(S),f?ve=ve.add(Jt.subtract(E)):Y[0][_]=3}else f&&(Y[0][_]=Y[0][_]&2|4);f=w}return jn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(f){let d=G.getBoundingClientRect(),y=Ft(f.x,d.left,d.right),x=Ft(f.y,d.top,d.bottom);return b(y*G.width,x*G.height)}}function Ca(){if(N)return;!(mn&&oe)&&!document.hasFocus()&&Gs(),De=Ms(Jt),Tr=rc(ve),Rh(),t(),n();function n(){let e=ls(0)||ls(1)||ls(2)||ve.length()>Cr,s=!1;for(let o=uc();o--&&!s;)s=ys(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=Ie(o);let i=!1;for(let o in Y[0])if(isNaN(+o)&&Y[0][o]&1){i=!0;break}s?tn="gamepad":e?tn="mouse":i&&(tn="keyboard"),Bn=tn==="gamepad"}function t(){var r,a,c,l,u,h,f;let e=d=>{let v=w=>w>.3?Ft(w,.3,.8):w<-.3?-Ft(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(ln&&oe){if(p(!Rn||!Kn,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),p(!Qn||!$n,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Wn.isSet())return;mt=0;let d=(r=Se[0])!=null?r:Se[0]=[],y=(a=gn[0])!=null?a:gn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!We(v))continue;let w=Dr(v);d[w]=b();let _=(c=Cn[v])!=null?c:b();if(Os)d[w]=e(_);else if(_.lengthSquared()>.3){let S=F($s(_.x),-1,1),E=F($s(_.y),-1,1);d[w]=b(S,-E).clampLength(),w||y.set(S,-E)}}let x=(l=Y[1])!=null?l:Y[1]=[];for(let v=12;v--;){let w=Ie(v,0);x[v]=re[v]?w?1:3:w?4:0,ti&&x[v]===3&&(v===9||Ph(v))&&Pr(ti)}return}try{if(!Mi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!Gt&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=Q(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let E=y.buttons[S],A=Ie(S,d);x[S]=E.pressed?A?1:3:A?4:0,E.pressed&&(!E.value||E.value>.9)&&(_=!0)}_&&(co[d]=!0,co[mt]||(mt=d)),y.mapping==="standard"&&w.set((Ie(15,d)&&1)-(Ie(14,d)&&1),(Ie(12,d)&&1)-(Ie(13,d)&&1)),yr&&(w.x||w.y)&&(v[0]=w.clampLength())}ln&&Bn&&Wn.unset()}}function Ea(){if(!N){for(let n of Y)for(let t in n)n[t]&=1;Ar=0,Tr=b(),ve=b()}}function _h(){Ih()}function Rh(){if(Ke||!ln||!oe||N||!document.body)return;let n=Ke=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=dc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Lr=document.createElementNS(ai,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>_a(o)),i.addEventListener("pointercancel",o=>_a(o)),t.appendChild(i),i};ms[0]=s(),ms[1]=s(),yn=s(),addEventListener("resize",()=>qn=!0),document.body.appendChild(n),qn=!0}function ki(){return dc.getBoundingClientRect()}function We(n){return n?Qn:Rn}function On(n){return n?$n:Kn}function Or(n){return n?0:4}function Dr(n){return n&&Rn?1:0}function Hn(n){return We(n)||On(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Or(t);if(!We(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+r;if(Ce){for(let o of ms)o.style.display="none";ge?(i(yn,"inset:0"),yn.style.display=""):yn.style.display="none"}else{for(let r=0;r<2;r++){let a=ms[r],c=r?"right":"left";if(a.style.display=Hn(r)?"":"none",hn){let l=Hn(r?0:1)?"50%":"100%";i(a,`${c}:0;bottom:0;width:${l};height:60%`)}else i(a,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}yn.style.display=ge?"":"none";let o=ge;i(yn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),qn=!1}function Oh(n,t){let e=Lr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=fc={face:[],thumb:[]},i=qt,o=(a,c,l,u)=>{let h=document.createElementNS(ai,"circle");return h.setAttribute("cx",a),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},r=a=>{let c=i*.18,l=i*.5,u=a.x,h=a.y,f=document.createElementNS(ai,"path");f.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(f)};for(let a=0;a<2;a++){let c=On(a),l=Or(a),u=ze(a,n,t);if(We(a))Os?o(u.x,u.y,i/2):r(u),s.thumb[a]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?f:Q(f,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(f,i/2);c===2&&(y.x*=-1),a||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}Gt&&Sn&&Dh(n,t)}function Dh(n,t){let e=qt,s=Lr,i=(r,a,c)=>{let l=document.createElementNS(ai,r);for(let u in a)l.setAttribute(u,a[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(r,a,c)=>i("circle",{cx:r.x,cy:r.y,r:a},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let r=0;r<2;r++)if(We(r))if(hn){let a=t*.4,c=!Hn(r?0:1),l=c?0:r?n/2:0;i("rect",{x:l,y:a,width:c?n:n/2,height:t-a},"#0ff")}else o(ze(r,n,t),2*e,"#0ff");else On(r)>=1&&o(ze(r,n,t),e,"#0ff");if(ge){o(b(n/2,t/2),ge,"#ff0");for(let r=0;r<2;r++)Hn(r)&&o(ze(r,n,t),2*e,"#f0f")}}function Ih(){var l;if(!Ke||N)return;if(!ln||!oe){Ke.style.display!=="none"&&(Ke.style.display="none",Ne.clear(),re.length=0,Cn.length=0,Fs.length=0);return}Ke.style.display="";let n=Gt&&Sn,t=[$n,Kn,Rn,Qn,Os,qt,hn,ge,Ce,n].join();t!==Aa&&(Aa=t,qn=!0),qn&&Lh();let e=cs?Ft(Wn.get(),cs+1,cs):1,s=n||Wn.isSet()&&e>0&&!Ce;if(Ke.style.opacity=s?n?1:e*br:0,!s)return;let i=ki(),o=i.width,r=i.height,a=qt,c=fc;if(c){for(let u=0;u<2;u++)if(We(u)&&c.thumb[u]){let f=ze(u,o,r).add(((l=Cn[u])!=null?l:b()).scale(a/2));c.thumb[u].setAttribute("cx",f.x),c.thumb[u].setAttribute("cy",f.y)}for(let u=0;u=qt)return-1;if(i===1)return o;let a=r.subtract(t);n||(a.x*=-1);let c=i===2?a.xo:a&&ze(r,t,e).distance(n)<2*s)return{role:"stick",side:r}}else if(On(r)>=1){let c=kh(r,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(ge){for(let r=0;r<2;r++)if(Hn(r)&&ze(r,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),f.buffer=h,f.playbackRate.value=e,f.loop=i,r=r||pt.createGain(),r.gain.value=t,r.connect(Je);let d=new StereoPannerNode(pt,{pan:F(s,-1,1)});f.connect(d).connect(r),f.addEventListener("ended",()=>{r.disconnect(),d.disconnect(),c&&c(f)});let y=a*e;return f.start(0,y),Gt&&Un&&xt("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),f}function Jh(...n){return Ir([Gi(...n)])}function Gi(n=1,t=.05,e=220,s=0,i=0,o=.1,r=0,a=1,c=0,l=0,u=0,h=0,f=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,E=0){let A=Zn,T=X*2,R=c*=500*T/A/A,M=e*=(1+ft(t,-t))*T/A,Z=0,it=0,ht=0,gt=1,jt,qe=[],Lt=0,dt=0,Ot=0,He,dn=2,fn=T*et(E)*2/A,ce=at(fn),Le=nt(fn)/2/dn,te=1+Le,L=-2*ce/te,B=(1-Le)/te,j=(1+se(E)*ce)/2/te,H=-(se(E)+ce)/te,Nt=j,ct=0,le=0,Dt=0,Bt=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,f=f*A|0,jt=s+_+i+o+v|0;dt1?r>2?r>3?r>4?Lt/T%14?Ot:se(Ot)*et(Ot)**a)*(dtdt?0:(dth&&(e+=u,M+=u,gt=0),f&&!(++it%f)&&(e=M,c=R,gt||(gt=1));return qe}function li(n,t=!0){for(let e of rn)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function Qe(n,t=b(),e,s=!0){for(let i of rn)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function yc(n,t,e,s,i=!0){let o,r,a,c=s&&b();for(let l of rn)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{k=!1,tt.style.display="none",e.preventDefault(),xt("WebGL context lost! Switching to Canvas2d rendering.");for(let s of us)s.glTexture=void 0;Qt=void 0,At=0,En=!1,xn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),tt.addEventListener("webglcontextrestored",()=>{k=!0,tt.style.display="",xt("WebGL context restored, reinitializing..."),t();for(let e of us)e.glTexture=ji(e.image,e.wrap);xn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){di=Yn(`#version 300 es
+`,o+=s.toString(),on(o,Ut,24,z(),.05,void 0,"center","monospace")}{e.save(),e.fillStyle="#fff",e.textAlign="left",e.textBaseline="top",e.font="20px monospace",e.shadowColor="#000",e.shadowBlur=9;let r=9,a=0,c=24;if(ke){e.fillText(`${Hs} v${Xs}`,r,a+=c/2),e.fillText("Time: "+ar(Qt),r,a+=c),e.fillText("FPS: "+Ys.toFixed(1)+(k?" WebGL":" Canvas2D"),r,a+=c),e.fillText("Objects: "+vt.length,r,a+=c),e.fillText("Draw Calls: "+_e,r,a+=c),e.fillText("Primitives: "+Re,r,a+=c),e.fillText("---------",r,a+=c),e.fillStyle="#f00",e.fillText("ESC: Debug Overlay",r,a+=c),e.fillStyle=de?"#f00":"#fff",e.fillText("1: Debug Physics",r,a+=c),e.fillStyle=vn?"#f00":"#fff",e.fillText("2: Debug Particles",r,a+=c),e.fillStyle=Sn?"#f00":"#fff",e.fillText("3: Debug Gamepads",r,a+=c),e.fillStyle=fe?"#f00":"#fff",e.fillText("4: Debug Raycasts",r,a+=c),e.fillStyle="#fff",e.fillText("5: Save Screenshot",r,a+=c),e.fillText("6: Toggle Video Capture",r,a+=c),e.fillStyle=Un?"#f00":"#fff",e.fillText("7: Debug Sound",r,a+=c);let l="",u="";for(let h in Y[0])Pt(h,0)&&(parseInt(h)<3?u+=h+" ":l+=h+" ");u&&e.fillText("Mouse: "+u,r,a+=c),l&&e.fillText("Keys: "+l,r,a+=c);for(let h=1;hs.push(a.data),i.onstop=()=>{let a=new Blob(s,{type:"video/webm"}),c=URL.createObjectURL(a);fs(c,"capture.webm",1e3)};let o,r;if(Xt){r=new ConstantSourceNode(pt,{offset:0}),r.connect(Ue),r.start(),o=pt.createMediaStreamDestination(),Ue.connect(o);for(let a of o.stream.getAudioTracks())n.addTrack(a)}try{i.start()}catch{xt("Video capture not supported in this browser!"),r==null||r.stop();return}xt("Video capture started."),Ge={mediaRecorder:i,captureTimer:e,videoTrack:t,silentAudioSource:r,audioStreamDestination:o}}function Na(){var n,t,e;p(Ae(),"Not capturing video!"),xt(`Video capture ended. ${Ge.captureTimer.get().toFixed(2)} seconds recorded.`),he.style.display="none",(n=Ge.silentAudioSource)==null||n.stop(),(t=Ge.mediaRecorder)==null||t.stop(),(e=Ge.videoTrack)==null||e.stop(),Ge=void 0}function Nl(){p(Ae(),"Not capturing video!"),wr(),Ge.videoTrack.requestFrame(),he.textContent="\u25CF REC "+ar(Ge.captureTimer)}function te(n){if(Ft){let t=Object.keys(n),e={};t.forEach(s=>e[s]=n[s]),t.forEach(s=>{Object.defineProperty(n,s,{get:()=>e[s],set:i=>{p(!1,`Cannot modify engine constant. Attempted to set constant (${n}) property '${s}' to '${i}'.`)},enumerable:!0})})}return Object.freeze(n)}function ie(n,t=1){return(n%t+t)%t}function F(n,t=0,e=1){return ne?e:n}function jt(n,t,e){return(e-=t)?F((n-t)/e):0}function qt(n,t,e){return n+F(e)*(t-n)}function Bl(n,t,e,s,i){return qt(s,i,jt(n,t,e))}function ir(n,t,e=1){p(e>0,"distanceWrap wrapSize must be > 0");let s=(n-t)%e;return s*2%e-s}function Ua(n,t,e,s=1){return n+F(e)*ir(t,n,s)}function zl(n,t){return ir(n,t,2*X)}function Jl(n,t,e){return Ua(n,t,e,2*X)}function Ks(n){return n*n*(3-2*n)}function ds(n){return!(n&n-1)}function Ul(n){return 2**hs(za(n))}function Qs(n,t,e,s=b()){let i=(n.x-e.x)*2,o=(n.y-e.y)*2,r=t.x+s.x,a=t.y+s.y;return et(i)f)return!1;h=$(y,h)}else{if(y0?a.x+1:a.x,x=h>0?a.y+1:a.y,v=c?(y-n.x)/c:1/0,w=l?(x-n.y)/l:1/0,_=0,S=v,E=w,A=fa.x&&(T.x=a.x+1-R),M.ya.y&&(T.y=a.y+1-R),s&&(A?s.set(-u,0):s.set(0,-h)),T}(A=SURL.revokeObjectURL(n),e)}function $l(n,t,e){var s;p(U(n),"shareURL requires title string"),p(U(t),"shareURL requires url string"),(s=navigator.share)==null||s.call(navigator,{title:n,url:t}).then(()=>e==null?void 0:e())}function Kl(n,t){p(U(n),"loadData requires saveName string");let e={};try{let s=localStorage[n];if(s)try{e=JSON.parse(s)}catch{xt("readSaveData: corrupt JSON for",n,"\u2014 using defaults")}}catch{xt("readSaveData: localStorage unavailable \u2014 using defaults")}return{...t,...e}}function Ql(n,t){p(U(n),"saveData requires saveName string");try{localStorage[n]=JSON.stringify(t)}catch{xt("writeSaveData: failed to write",n)}}function yo(n){let t=(n|0)^2654435769;return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/2**32}function Zl(n){let t=St(n);return qt(yo(t),yo(t+1),Ks(n-t))}function tu(n,t){let e=St(n),s=St(t),i=Ks(n-e),o=Ks(t-s),r=(a,c)=>yo(a+c*374761393);return qt(qt(r(e,s),r(e+1,s),i),qt(r(e,s+1),r(e+1,s+1),i),o)}function eu(n){Ct=n.copy()}function nu(n){K=n}function su(n){q=n}function iu(n){cr=n}function ou(n){Pi=n}function ru(n){nn=n.copy()}function au(n){kn=n.copy()}function cu(n){rs=n}function lu(n){Gn=n}function uu(n){Fn=n.copy()}function nc(n){lr=n,G&&(G.style.imageRendering=n?"pixelated":""),tt&&(tt.style.imageRendering=n?"pixelated":"")}function hu(n){An=n}function du(n){sn=n}function fu(n){Ps=n}function pu(n){ur=n}function gu(n){N=n}function yu(n){if(n&&!Ao){console.warn("Can not enable WebGL if it was disabled on start.");return}k=n,tt&&(tt.style.display=n?"":"none")}function mu(n){Ls=n}function bu(n){Li=n.copy()}function xu(n){Oi=n}function vu(n){Di=n}function Su(n){Ii=n}function wu(n){hr=n}function Tu(n){dr=n}function Au(n){fr=n}function Cu(n){pr=n}function Eu(n){gr=n}function _u(n){je=n}function Ru(n){Wt=n.copy()}function Pu(n){Zs=n}function Lu(n){Mi=n}function Ou(n){yr=n}function Du(n){as=n}function Iu(n){mn=n}function Mu(n){ln=n}function ku(n){mr=n}function Gu(n){ge=n}function Fu(n){$n=n,n>0&&(Qn=!1)}function ju(n){Rn=n,n&&(Kn=0)}function Nu(n){Kn=n,n>0&&(Rn=!1)}function Bu(n){Qn=n,n&&($n=0)}function zu(n){Os=n}function Ju(n){hn=n}function Uu(n){Ht=n}function Vu(n){br=n}function Wu(n){cs=n}function qu(n){ti=n}function Hu(n){Ds=n}function Xu(n){Xt=n}function Yu(n){wn=n,Xt&&!N&&Ue&&(Ue.gain.value=n)}function $u(n){xr=n}function Ku(n){vr=n}function Qu(n){Ri=n}function Zu(n){Ga=n}function ei(n){return n.r>=1&&n.g>=1&&n.b>=1}function Sr(n){return n.r<=0&&n.g<=0&&n.b<=0&&n.a<=0}function Is(n=0,t=Li,e=0,s=Oi,i=Di){if(p(O(n)||typeof n=="number","index must be a vec2 or number"),p(O(t)||typeof t=="number","size must be a vec2 or number"),p(P(e)||e instanceof We,"texture must be a number or TextureInfo"),p(P(s),"padding must be a number"),N)return new Pe;typeof t=="number"&&(p(t>0),t=new rt(t,t));let o=typeof e=="number"?un[e]:e;p(o instanceof We,"tile texture is not loaded"),p(o.size.x>0,"tile texture is not loaded");let r=t.x+s*2,a=t.y+s*2,c,l;if(typeof n=="number"){let h=o.size.x/r|0;c=n%h,l=n/h|0}else c=n.x,l=n.y;let u=new rt(c*r+s,l*a+s);return new Pe(u,t,o,s,i)}function Lt(n,t=b(1),e,s=V,i=0,o,r,a=k,c=!1,l){var f;p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!r||J(r),"additiveColor must be a color"),p(!l||!a,"context only supported in canvas 2D mode");let u=e==null?void 0:e.textureInfo,h=(f=e==null?void 0:e.bleed)!=null?f:0;if(a&&k)if(p(!!g,"WebGL is not enabled!"),c&&([n,t,i]=ks(n,t,i)),u){let d=u.sizeInverse,y=e.pos.x*d.x,x=e.pos.y*d.y,v=e.size.x*d.x,w=e.size.y*d.y;if(Fr(u.glTexture),h){let _=d.x*h,S=d.y*h;As(n.x,n.y,o?-t.x:t.x,t.y,i,y+_,x+S,y-_+v,x-S+w,s.rgbaInt(),r&&r.rgbaInt())}else As(n.x,n.y,o?-t.x:t.x,t.y,i,y,x,y+v,x+w,s.rgbaInt(),r&&r.rgbaInt())}else{let d=r?s.add(r):s;Tc(n.x,n.y,t.x,t.y,i,d.rgbaInt())}else++_e,++Re,Pn(n,t,i,o,d=>{if(u){d.scale(1,-1);let y=e.pos.x,x=e.pos.y,v=e.size.x,w=e.size.y;lh(d,u.image,y,x,v,w,-.5,-.5,1,1,s,r,h)}else{let y=r?s.add(r):s;d.fillStyle=y.toString(),d.fillRect(-.5,-.5,1,1)}},c,l)}function ni(n,t,e,s,i,o,r){Lt(n,t,void 0,e,s,!1,void 0,i,o,r)}function th(n,t,e=V,s=cn,i=0,o=k,r=!1,a){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!a||!o,"context only supported in canvas 2D mode"),o&&k){p(!!g,"WebGL is not enabled!"),r&&(n=Ms(n),t=t.scale(1/q),i+=K);let c=[],l=[],u=t.x/2,h=t.y/2,f=e.rgbaInt(),d=s.rgbaInt(),y=ct(-i),x=nt(-i);for(let v=4;v--;){let w=v&1?u:-u,_=v&2?h:-h,S=w*y-_*x,E=w*x+_*y,A=v&2?f:d;c.push(b(n.x+S,n.y+E)),l.push(A)}Jr(c,l)}else++_e,++Re,Pn(n,t,i,!1,c=>{let l=c.createLinearGradient(0,.5,0,-.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.fillRect(-.5,-.5,1,1)},r,a)}function eh(n,t,e,s=0,i=V,o=0,r,a=k,c=!1,l){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(O(e),"wrapCount must be a vec2"),p(J(i),"color is invalid"),p(P(o),"angle must be a number"),p(!r||J(r),"additiveColor must be a color"),p(!l||!a,"context only supported in canvas 2D mode"),p(!(s instanceof Pe),"pass a TextureInfo or texture index, not a TileInfo \u2014 use tileInfo.textureInfo"),N)return;let u=typeof s=="number"?un[s]:s;if(p(u instanceof We,"texture not loaded"),p(u.size.x>0,"texture not loaded"),p(u.wrap,"drawTextureWrapped requires a wrap-enabled texture; call textureInfo.setWrap(true) first"),a&&k){p(!!g,"WebGL is not enabled!"),c&&([n,t,o]=ks(n,t,o)),Fr(u.glTexture),As(n.x,n.y,t.x,t.y,o,0,0,e.x,e.y,i.rgbaInt(),r&&r.rgbaInt());return}++_e,++Re,c||(n=Ln(n),t=t.scale(q),o-=K);let h=!Pi||(r?ei(i.add(r))&&r.a<=0:ei(i)),f=!h&&r&&!Sr(r),d=h?u.image:ch(u.image,i,r);l=l||Tt,l.save(),l.translate(n.x+.5,n.y+.5),l.rotate(o),l.globalAlpha=f?1:i.a;let y=l.createPattern(d,"repeat"),x=new DOMMatrix().translate(-t.x/2,-t.y/2).scale(t.x/(e.x*d.width),t.y/(e.y*d.height));y.setTransform(x),l.fillStyle=y,l.fillRect(-t.x/2,-t.y/2,t.x,t.y),l.globalAlpha=1,l.restore()}function mo(n,t=.1,e=V,s=!1,i=b(),o=0,r=k,a=!1,c){if(p(pe(n),"points must be an array"),p(P(t),"width must be a number"),p(J(e),"color is invalid"),p(O(i),"pos must be a vec2"),p(P(o),"angle must be a number"),p(!c||!r,"context only supported in canvas 2D mode"),r&&k){p(!!g,"WebGL is not enabled!");let l=b(1);a&&([i,l,o]=ks(i,l,o)),zr(n,e.rgbaInt(),t,i.x,i.y,l.x,l.y,o,s)}else++_e,++Re,Pn(i,b(1),o,!1,l=>{l.strokeStyle=e.toString(),l.lineWidth=t,l.beginPath();for(let u=0;u0&&zr(n,s.rgbaInt(),e,i.x,i.y,l.x,l.y,o)}else Pn(i,b(1),o,!1,l=>{l.fillStyle=t.toString(),l.beginPath();for(let u of n)l.lineTo(u.x,u.y);l.closePath(),l.fill(),e&&(l.strokeStyle=s.toString(),l.lineWidth=e,l.stroke())},a,c)}function ic(n,t=b(1),e=V,s=0,i=0,o=st,r=k,a=!1,c){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(o),"color is invalid"),p(P(s),"angle must be a number"),p(P(i),"lineWidth must be a number"),p(i>=0,"lineWidth must be a positive value or 0"),p(!c||!r,"context only supported in canvas 2D mode"),i=F(i,0,Q(t.x,t.y)),r&&k?sc(n,t,Ls,e,i,o,s,r,a,c):Pn(n,b(1),s,!1,l=>{l.fillStyle=e.toString(),l.beginPath(),l.ellipse(0,0,t.x/2,t.y/2,0,0,9),l.fill(),i&&(l.strokeStyle=o.toString(),l.lineWidth=i,l.stroke())},a,c)}function si(n,t=1,e=V,s=0,i=st,o=k,r=!1,a){p(P(t),"size must be a number"),ic(n,b(t),e,0,s,i,o,r,a)}function oc(n,t=b(1),e=V,s=cn,i=0,o=k,r=!1,a){if(p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(J(e)&&J(s),"color is invalid"),p(P(i),"angle must be a number"),p(!a||!o,"context only supported in canvas 2D mode"),!N)if(o&&k){p(!!g,"WebGL is not enabled!"),r&&(n=Ms(n),t=t.scale(1/q),i+=K);let c=Ls,l=t.x/2,u=t.y/2,h=e.rgbaInt(),f=s.rgbaInt(),d=nh++,y=ct(-i),x=nt(-i),v=E=>{let A=nt(E)*l,T=ct(E)*u;return b(n.x+A*y-T*x,n.y+A*x+T*y)},w=d%c/c*X*2,_=[v(w)],S=[f];for(let E=c;E--;){let A=(E+d)%c/c*X*2;_.push(n),S.push(h),_.push(v(A)),S.push(f)}Jr(_,S)}else++_e,++Re,Pn(n,t,i,!1,c=>{let l=c.createRadialGradient(0,0,0,0,0,.5);l.addColorStop(0,e.toString()),l.addColorStop(1,s.toString()),c.fillStyle=l,c.beginPath(),c.ellipse(0,0,.5,.5,0,0,9),c.fill()},r,a)}function sh(n,t=1,e=V,s=cn,i=k,o=!1,r){p(P(t),"size must be a number"),oc(n,b(t),e,s,0,i,o,r)}function Pn(n,t,e=0,s=!1,i,o=!1,r=Tt){p(O(n),"pos must be a vec2"),p(O(t),"size must be a vec2"),p(P(e),"angle must be a number"),p(typeof i=="function","drawFunction must be a function"),o||(n=Ln(n),t=t.scale(q),e-=K),r.save(),r.translate(n.x+.5,n.y+.5),r.rotate(e),r.scale(s?-t.x:t.x,-t.y),i(r),r.restore()}function ih(n,t,e=1,s=V,i=0,o=st,r="center",a=Ps,c="",l,u=0,h=Tt){t=Ln(t),e*=q,i*=q,u-=K,u*=-1,on(n,t,e,s,i,o,r,a,c,l,u,h)}function on(n,t,e,s=V,i=0,o=st,r="center",a=Ps,c="",l,u=0,h=Tt){p(U(n),"text must be a string"),p(O(t),"pos must be a vec2"),p(P(e),"size must be a number"),p(J(s),"color must be a color"),p(P(i),"lineWidth must be a number"),p(J(o),"lineColor must be a color"),p(["left","center","right"].includes(r),"align must be left, center, or right"),p(U(a),"font must be a string"),p(U(c),"fontStyle must be a string"),p(P(u),"angle must be a number");let f=(n+"").split(`
+`),d=t.y-(f.length-1)*e/2;h.save(),h.fillStyle=s.toString(),h.strokeStyle=o.toString(),h.lineWidth=i,h.textAlign=r,h.font=c+" "+e+"px "+a,h.textBaseline="middle",h.translate(t.x,d),h.rotate(-u);let y=0;f.forEach(x=>{i&&h.strokeText(x,0,y,l),h.fillText(x,0,y,l),y+=e}),h.restore()}async function Ta(n,t){p(P(n),"textureIndex must be a number"),p(!un[n],"textureIndex is already loaded!"),p(!t||U(t),"image src must be a string");let e=new Image;t&&await new Promise(s=>{e.onerror=e.onload=s,e.crossOrigin="anonymous",e.src=t}),un[n]=new We(e)}function Ms(n){p(O(n),"screenPos must be a vec2");let t=(n.x-I.x/2+.5)/q,e=(n.y-I.y/2+.5)/-q;if(K){let s=ct(-K),i=nt(-K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new rt(t+Ct.x,e+Ct.y)}function Ln(n){p(O(n),"worldPos must be a vec2");let t=n.x-Ct.x,e=n.y-Ct.y;if(K){let s=ct(K),i=nt(K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new rt(t*q+I.x/2-.5,e*-q+I.y/2-.5)}function rc(n){p(O(n),"screenDelta must be a vec2");let t=n.x/q,e=n.y/-q;if(K){let s=ct(-K),i=nt(-K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new rt(t,e)}function oh(n){p(O(n),"worldDelta must be a vec2");let t=n.x,e=n.y;if(K){let s=ct(K),i=nt(K),o=t*s-e*i,r=t*i+e*s;t=o,e=r}return new rt(t*q,e*-q)}function ks(n,t,e=0){return p(O(n),"screenPos must be a vec2"),p(O(t),"screenSize must be a vec2"),p(P(e),"screenAngle must be a number"),[Ms(n),t.scale(1/q),e+K]}function ac(){return I.scale(1/q)}function rh(n,t,e,s){p(O(n),"center must be a vec2"),p(O(t),"size must be a vec2");let i=f(e),o=f(s),r=t.x+i.left+i.right,a=t.y+i.top+i.bottom,c=I.x-o.left-o.right,l=I.y-o.top-o.bottom;if(!(r>0&&a>0&&c>0&&l>0))return q;q=Q(c/r,l/a);let u=b(i.right-i.left,i.top-i.bottom).scale(.5),h=b(o.right-o.left,o.top-o.bottom).scale(.5/q);return Ct=n.add(u).add(h),q;function f(d){return(d===void 0||P(d))&&(d=b(d)),O(d)?{top:d.y,right:d.x,bottom:d.y,left:d.x}:{top:d.top||0,right:d.right||0,bottom:d.bottom||0,left:d.left||0}}}function ah(n,t=0){if(p(O(n),"pos must be a vec2"),p(O(t)||P(t),"size must be a vec2 or number"),!q)return!1;let e=n.x-Ct.x,s=n.y-Ct.y;if(K){let r=ct(K),a=nt(K),c=e*r-s*a,l=e*a+s*r;e=c,s=l}e*=q*2,s*=-q*2,t instanceof rt&&(t=t.length()),t*=q;let i=I.x,o=I.y;return e+t>-i&&e-t-o&&s-t{n.onerror=n.onload=a,n.crossOrigin="anonymous",n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAAAeAQMAAABnrVXaAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAjpJREFUOMu9kzFu2zAUhn+CAROgqrk+B2l0BWYxMjlXeYaAtFtbdA1sGgHqRQfI0CNkSG5AwYB0BQ8d5Bsomwah6CPVeGg6tEPzAxLwyI+P78cP4u9lNO9OoMKnLMOobG5020/yaj/MrRcCGh1gBbyiLTPJEYaIiom5KM9Jq7KgynMGtb6L4GL4MF2H4LQKCXTvDVw2I4MsgZT7QLExdiutH+D08VOP3INXRrWX1/mmpbkNgAPYRVANb4xpcegYvhiNbIXauQICEjBuYLfMakaakWQeXxiZ0VDtuJCKs3ztMV59QtsHJNcRxDzfdL21ty3PrfIcXTN+E+GFAv6T5nbT9jd50/WFxb5ksdAv49qS6ouymG66ji08UMT6moykYLAo+V0j23GN4m829ZySAD5K7QsBfQTvOG8eE+gTeGYRAmnNAubN3hf5Zv9tJWDHp/VTuaSm7SN4fyINQqaNO3RMVxvpSPXnOChnRNvFcGY0gnwiPswYwTKVPE0zVtX3mTEIOoFzaqLrGuJaV+Uqumb71fVk/VoOH3cdLNQP/FHi8hV0CQNoqBZsUPlLPMsdCJro9QAaQQ0woDy9BJm0eTxCFnO9srcYlhNVlfR2EyTrph1uUtbUtAJifwRgrKuYdXVHeb0YI3QpawohQHkloI3J5FuVwI5ORxC9k2Tuz9Ir1IjgeIPGMHYkAZe2RuYkmWFmt3gGbTPOmBUWVTmRmHtGrfpzG/yuQNOKa6gBB/WA9khitPgl6/GP+gl2Af6tCbvaygAAAABJRU5ErkJggg=="});let t=b(),e=b(8),s=1,i=0,o=new We(n),r=new Pe(t,e,o,s,i);lc=new ii(r)}function fh(n=!0){jn=n}function ph(n){Cr=n}function gh(){return tn==="mouse"}function yh(){return tn==="keyboard"}function mh(){return tn==="gamepad"}function Er(n,t=0,e=!0,s=!0,i=!0){Y[t]&&(Y[t][n]&=~((e?1:0)|(s?2:0)|(i?4:0)))}function Gs(){Y.length=0,Y[0]=[],re.length=0,Cn.length=0,Fs.length=0,Se.length=0,gn.length=0}function Pt(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&1)}function kt(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&2)}function _r(n,t=0){var e;return p(U(n),"key must be a number or string"),p(t>0||typeof n!="number"||n<3,"use code string for keyboard"),!!(((e=Y[t])==null?void 0:e[n])&4)}function bh(n="ArrowUp",t="ArrowDown",e="ArrowLeft",s="ArrowRight"){p(U(n),"up key must be a string"),p(U(t),"down key must be a string"),p(U(e),"left key must be a string"),p(U(s),"right key must be a string");let i=o=>Pt(o)?1:0;return b(i(s)-i(e),i(n)-i(t))}function ls(n){return p(P(n),"mouse button must be a number"),Pt(n)}function gs(n){return p(P(n),"mouse button must be a number"),kt(n)}function xh(n){return p(P(n),"mouse button must be a number"),_r(n)}function Me(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),Pt(n,t+1)}function Rr(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),kt(n,t+1)}function vh(n,t=mt){return p(P(n),"button must be a number"),p(P(t),"gamepad must be a number"),_r(n,t+1)}function ys(n,t=mt){var e,s;return p(P(n),"stick must be a number"),p(P(t),"gamepad must be a number"),(s=(e=Se[t])==null?void 0:e[n])!=null?s:b()}function bo(n=mt){var t;return p(P(n),"gamepad must be a number"),(t=gn[n])!=null?t:b()}function xo(n=mt){return p(P(n),"gamepad must be a number"),!!Y[n+1]}function uc(n=mt){var t,e;return p(P(n),"gamepad must be a number"),(e=(t=Se[n])==null?void 0:t.length)!=null?e:0}function Sh(n=mt,t=200,e=1,s=1,i=0){var r,a,c;if(p(P(n),"gamepad must be a number"),!Ds||N)return;let o=(r=navigator==null?void 0:navigator.getGamepads)==null?void 0:r.call(navigator)[n];(c=(a=o==null?void 0:o.vibrationActuator)==null?void 0:a.playEffect)==null||c.call(a,"dual-rumble",{duration:t,strongMagnitude:e,weakMagnitude:s,startDelay:i})}function wh(n=mt){var e,s,i;if(p(P(n),"gamepad must be a number"),!Ds||N)return;let t=(e=navigator==null?void 0:navigator.getGamepads)==null?void 0:e.call(navigator)[n];(i=(s=t==null?void 0:t.vibrationActuator)==null?void 0:s.reset)==null||i.call(s)}function Pr(n=100){var t;p(P(n)||pe(n),"pattern must be a number or array"),Ds&&!N&&((t=navigator==null?void 0:navigator.vibrate)==null||t.call(navigator,n))}function Th(){Pr(0)}function Ah(){var n;!oe&&((n=G.requestPointerLock)==null||n.call(G))}function Ch(){var n;(n=document.exitPointerLock)==null||n.call(document)}function hc(){return document.pointerLockElement===G}function Eh(){if(N)return;document.addEventListener("keydown",n),document.addEventListener("keyup",t),document.addEventListener("mousedown",s),document.addEventListener("mouseup",i),document.addEventListener("mousemove",o),document.addEventListener("mouseleave",r),document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("contextmenu",c),document.addEventListener("blur",l),oe&&mn&&u();function n(f){if(f.repeat||(Y[0][f.code]=3,as&&(Y[0][e(f.code)]=3)),!jn||!f.cancelable||!document.hasFocus()||f.ctrlKey||f.metaKey||f.altKey||x(f.target)||x(document.activeElement))return;let d=typeof f.key=="string"&&f.key.length===1;(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Space","Tab","Backspace"].includes(f.code)||d)&&f.preventDefault();function x(v){let w=v==null?void 0:v.tagName;return(v==null?void 0:v.isContentEditable)||["INPUT","TEXTAREA","SELECT"].includes(w)}}function t(f){Y[0][f.code]=Y[0][f.code]&2|4,as&&(Y[0][e(f.code)]=4)}function e(f){return as?f==="KeyW"?"ArrowUp":f==="KeyS"?"ArrowDown":f==="KeyA"?"ArrowLeft":f==="KeyD"?"ArrowRight":f:f}function s(f){if(oe&&mn)return;Xt&&!N&&pt&&!bs()&&pt.resume(),Y[0][f.button]=3;let d=Ut;Ut=h(b(f.x,f.y)),ve=ve.add(Ut.subtract(d)),jn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function i(f){oe&&mn||(Y[0][f.button]=Y[0][f.button]&2|4)}function o(f){oi=!0;let d=Ut;Ut=h(b(f.x,f.y));let y=hc()?b(f.movementX,f.movementY):Ut.subtract(d);ve=ve.add(y)}function r(){oi=!1}function a(f){f.ctrlKey||(Ar+=se(f.deltaY)),jn&&f.cancelable&&document.hasFocus()&&f.preventDefault()}function c(f){f.preventDefault()}function l(){Gs(),Be.clear(),re.length=0,Cn.length=0,Fs.length=0}function u(){document.addEventListener("touchstart",y=>d(y),{passive:!1}),document.addEventListener("touchmove",y=>d(y),{passive:!1}),document.addEventListener("touchend",y=>d(y),{passive:!1});let f;function d(y){if(mn){if(Xt&&!N&&pt&&!bs()&&pt.resume(),!ln||mr){let x=S=>ms.includes(S.target)||S.target===yn,v=[];for(let S of y.touches)x(S)||v.push(S);let w=v.length,_=0;if(w){let S=b(v[0].clientX,v[0].clientY),E=Ut;Ut=h(S),f?ve=ve.add(Ut.subtract(E)):Y[0][_]=3}else f&&(Y[0][_]=Y[0][_]&2|4);f=w}return jn&&y.cancelable&&document.hasFocus()&&y.preventDefault(),!0}}}function h(f){let d=G.getBoundingClientRect(),y=jt(f.x,d.left,d.right),x=jt(f.y,d.top,d.bottom);return b(y*G.width,x*G.height)}}function Ca(){if(N)return;!(mn&&oe)&&!document.hasFocus()&&Gs(),Ie=Ms(Ut),Tr=rc(ve),Rh(),t(),n();function n(){let e=ls(0)||ls(1)||ls(2)||ve.length()>Cr,s=!1;for(let o=uc();o--&&!s;)s=ys(o).lengthSquared()>.04;for(let o=17;o--&&!s;)s=Me(o);let i=!1;for(let o in Y[0])if(isNaN(+o)&&Y[0][o]&1){i=!0;break}s?tn="gamepad":e?tn="mouse":i&&(tn="keyboard"),Bn=tn==="gamepad"}function t(){var r,a,c,l,u,h,f;let e=d=>{let v=w=>w>.3?jt(w,.3,.8):w<-.3?-jt(-w,.3,.8):0;return b(v(d.x),v(-d.y)).clampLength()};if(ln&&oe){if(p(!Rn||!Kn,"set touchGamepadLeftStick or touchGamepadLeftButtonCount, not both"),p(!Qn||!$n,"set touchGamepadRightStick or touchGamepadButtonCount, not both"),!Wn.isSet())return;mt=0;let d=(r=Se[0])!=null?r:Se[0]=[],y=(a=gn[0])!=null?a:gn[0]=b();d.length=0,y.set();for(let v=0;v<2;v++){if(!qe(v))continue;let w=Dr(v);d[w]=b();let _=(c=Cn[v])!=null?c:b();if(Os)d[w]=e(_);else if(_.lengthSquared()>.3){let S=F($s(_.x),-1,1),E=F($s(_.y),-1,1);d[w]=b(S,-E).clampLength(),w||y.set(S,-E)}}let x=(l=Y[1])!=null?l:Y[1]=[];for(let v=12;v--;){let w=Me(v,0);x[v]=re[v]?w?1:3:w?4:0,ti&&x[v]===3&&(v===9||Ph(v))&&Pr(ti)}return}try{if(!Mi||!(navigator!=null&&navigator.getGamepads))return}catch{return}if(!Ft&&!document.hasFocus())return;let s=8,i=navigator.getGamepads(),o=Q(s,i.length);for(let d=0;d>1]=e(b(y.axes[S],y.axes[S+1]));let _=!1;for(let S=y.buttons.length;S--;){let E=y.buttons[S],A=Me(S,d);x[S]=E.pressed?A?1:3:A?4:0,E.pressed&&(!E.value||E.value>.9)&&(_=!0)}_&&(co[d]=!0,co[mt]||(mt=d)),y.mapping==="standard"&&w.set((Me(15,d)&&1)-(Me(14,d)&&1),(Me(12,d)&&1)-(Me(13,d)&&1)),yr&&(w.x||w.y)&&(v[0]=w.clampLength())}ln&&Bn&&Wn.unset()}}function Ea(){if(!N){for(let n of Y)for(let t in n)n[t]&=1;Ar=0,Tr=b(),ve=b()}}function _h(){Ih()}function Rh(){if(Ke||!ln||!oe||N||!document.body)return;let n=Ke=document.createElement("div");n.style.cssText="position:fixed;inset:0;z-index:50;pointer-events:none;opacity:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:opacity .2s;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)";let t=dc=document.createElement("div");t.style.cssText="position:relative;width:100%;height:100%;pointer-events:none",n.appendChild(t);let e=Lr=document.createElementNS(ai,"svg");e.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:#fff;stroke-width:3",t.appendChild(e);let s=()=>{let i=document.createElement("div");return i.style.cssText="position:absolute;pointer-events:auto;touch-action:none",i.addEventListener("pointerdown",o=>Fh(o,i)),i.addEventListener("pointermove",o=>jh(o)),i.addEventListener("pointerup",o=>_a(o)),i.addEventListener("pointercancel",o=>_a(o)),t.appendChild(i),i};ms[0]=s(),ms[1]=s(),yn=s(),addEventListener("resize",()=>qn=!0),document.body.appendChild(n),qn=!0}function ki(){return dc.getBoundingClientRect()}function qe(n){return n?Qn:Rn}function On(n){return n?$n:Kn}function Or(n){return n?0:4}function Dr(n){return n&&Rn?1:0}function Hn(n){return qe(n)||On(n)>0}function Ph(n){for(let t=0;t<2;t++){let e=Or(t);if(!qe(t)&&n>=e&&no.style.cssText="position:absolute;pointer-events:auto;touch-action:none;"+r;if(Ce){for(let o of ms)o.style.display="none";ge?(i(yn,"inset:0"),yn.style.display=""):yn.style.display="none"}else{for(let r=0;r<2;r++){let a=ms[r],c=r?"right":"left";if(a.style.display=Hn(r)?"":"none",hn){let l=Hn(r?0:1)?"50%":"100%";i(a,`${c}:0;bottom:0;width:${l};height:60%`)}else i(a,`${c}:0;bottom:0;width:${3*s}px;height:${3*s}px`)}yn.style.display=ge?"":"none";let o=ge;i(yn,`left:50%;top:50%;width:${2*o}px;height:${2*o}px;transform:translate(-50%,-50%)`)}Oh(t,e),qn=!1}function Oh(n,t){let e=Lr;for(;e.firstChild;)e.removeChild(e.firstChild);let s=fc={face:[],thumb:[]},i=Ht,o=(a,c,l,u)=>{let h=document.createElementNS(ai,"circle");return h.setAttribute("cx",a),h.setAttribute("cy",c),h.setAttribute("r",l),u&&h.setAttribute("fill",u),e.appendChild(h),h},r=a=>{let c=i*.18,l=i*.5,u=a.x,h=a.y,f=document.createElementNS(ai,"path");f.setAttribute("d",`M ${u-c} ${h-l} H ${u+c} V ${h-c} H ${u+l} V ${h+c} H ${u+c} V ${h+l} H ${u-c} V ${h+c} H ${u-l} V ${h-c} H ${u-c} Z`),e.appendChild(f)};for(let a=0;a<2;a++){let c=On(a),l=Or(a),u=Je(a,n,t);if(qe(a))Os?o(u.x,u.y,i/2):r(u),s.thumb[a]=o(u.x,u.y,i/4,"#fff");else if(c===1)s.face[l]=o(u.x,u.y,i/2,"#000");else for(let h=0;h2?f:Q(f,c-1);d=d===3?2:d===2?3:d;let y=b().setDirection(f,i/2);c===2&&(y.x*=-1),a||(y.x*=-1);let x=u.add(y);s.face[l+d]=o(x.x,x.y,i/4,"#000")}}Ft&&Sn&&Dh(n,t)}function Dh(n,t){let e=Ht,s=Lr,i=(r,a,c)=>{let l=document.createElementNS(ai,r);for(let u in a)l.setAttribute(u,a[u]);l.setAttribute("stroke",c),l.setAttribute("stroke-width",2),l.setAttribute("fill","none"),s.appendChild(l)},o=(r,a,c)=>i("circle",{cx:r.x,cy:r.y,r:a},c);i("line",{x1:n/2,y1:0,x2:n/2,y2:t},"#0f0");for(let r=0;r<2;r++)if(qe(r))if(hn){let a=t*.4,c=!Hn(r?0:1),l=c?0:r?n/2:0;i("rect",{x:l,y:a,width:c?n:n/2,height:t-a},"#0ff")}else o(Je(r,n,t),2*e,"#0ff");else On(r)>=1&&o(Je(r,n,t),e,"#0ff");if(ge){o(b(n/2,t/2),ge,"#ff0");for(let r=0;r<2;r++)Hn(r)&&o(Je(r,n,t),2*e,"#f0f")}}function Ih(){var l;if(!Ke||N)return;if(!ln||!oe){Ke.style.display!=="none"&&(Ke.style.display="none",Be.clear(),re.length=0,Cn.length=0,Fs.length=0);return}Ke.style.display="";let n=Ft&&Sn,t=[$n,Kn,Rn,Qn,Os,Ht,hn,ge,Ce,n].join();t!==Aa&&(Aa=t,qn=!0),qn&&Lh();let e=cs?jt(Wn.get(),cs+1,cs):1,s=n||Wn.isSet()&&e>0&&!Ce;if(Ke.style.opacity=s?n?1:e*br:0,!s)return;let i=ki(),o=i.width,r=i.height,a=Ht,c=fc;if(c){for(let u=0;u<2;u++)if(qe(u)&&c.thumb[u]){let f=Je(u,o,r).add(((l=Cn[u])!=null?l:b()).scale(a/2));c.thumb[u].setAttribute("cx",f.x),c.thumb[u].setAttribute("cy",f.y)}for(let u=0;u=Ht)return-1;if(i===1)return o;let a=r.subtract(t);n||(a.x*=-1);let c=i===2?a.xo:a&&Je(r,t,e).distance(n)<2*s)return{role:"stick",side:r}}else if(On(r)>=1){let c=kh(r,n,t,e);if(c>=0)return{role:"face",btn:c}}}if(ge){for(let r=0;r<2;r++)if(Hn(r)&&Je(r,t,e).distance(n)<2*s)return;if(b(t/2,e/2).distance(n)h.getChannelData(v).set(x)),f.buffer=h,f.playbackRate.value=e,f.loop=i,r=r||pt.createGain(),r.gain.value=t,r.connect(Ue);let d=new StereoPannerNode(pt,{pan:F(s,-1,1)});f.connect(d).connect(r),f.addEventListener("ended",()=>{r.disconnect(),d.disconnect(),c&&c(f)});let y=a*e;return f.start(0,y),Ft&&Un&&xt("sound","vol",t.toFixed(2),"rate",e.toFixed(2),"pan",s.toFixed(2),i?"loop":""),f}function Jh(...n){return Ir([Gi(...n)])}function Gi(n=1,t=.05,e=220,s=0,i=0,o=.1,r=0,a=1,c=0,l=0,u=0,h=0,f=0,d=0,y=0,x=0,v=0,w=1,_=0,S=0,E=0){let A=Zn,T=X*2,R=c*=500*T/A/A,M=e*=(1+ft(t,-t))*T/A,Z=0,it=0,ht=0,gt=1,Nt,He=[],Ot=0,dt=0,Dt=0,Le,dn=2,fn=T*et(E)*2/A,ce=ct(fn),Oe=nt(fn)/2/dn,ee=1+Oe,L=-2*ce/ee,B=(1-Oe)/ee,j=(1+se(E)*ce)/2/ee,H=-(se(E)+ce)/ee,Bt=j,lt=0,le=0,It=0,zt=0;for(s=s*A||9,_*=A,i*=A,o*=A,v*=A,l*=500*T/A**3,y*=T/A,u*=T/A,h*=A,f=f*A|0,Nt=s+_+i+o+v|0;dt1?r>2?r>3?r>4?Ot/T%14?Dt:se(Dt)*et(Dt)**a)*(dtdt?0:(dth&&(e+=u,M+=u,gt=0),f&&!(++it%f)&&(e=M,c=R,gt||(gt=1));return He}function li(n,t=!0){for(let e of rn)if((!t||e.isSolid)&&n.arrayCheck(e.size)){let s=e.getCollisionData(n);if(s)return s}return 0}function Qe(n,t=b(),e,s=!0){for(let i of rn)if((!s||i.isSolid)&&i.collisionTest(n,t,e))return i}function yc(n,t,e,s,i=!0){let o,r,a,c=s&&b();for(let l of rn)if(!i||l.isSolid){let u=l.collisionRaycast(n,t,e,c);if(u){let h=n.distanceSquared(u);(o===void 0||h{k=!1,tt.style.display="none",e.preventDefault(),xt("WebGL context lost! Switching to Canvas2d rendering.");for(let s of us)s.glTexture=void 0;Zt=void 0,At=0,En=!1,xn.forEach(s=>{var i;return(i=s.glContextLost)==null?void 0:i.call(s)})}),tt.addEventListener("webglcontextrestored",()=>{k=!0,tt.style.display="",xt("WebGL context restored, reinitializing..."),t();for(let e of us)e.glTexture=ji(e.image,e.wrap);xn.forEach(e=>{var s;return(s=e.glContextRestored)==null?void 0:s.call(e)})});function t(){di=Yn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 g;in vec4 p,u,c,a;in float r;out vec2 v;out vec4 d,e;void main(){vec2 s=(g-.5)*p.zw;gl_Position=m*vec4(p.xy+s*cos(r)-vec2(-s.y,s)*sin(r),1,1);v=mix(u.xw,u.zy,g);d=c;e=a;}`,`#version 300 es
 precision highp float;uniform sampler2D s;in vec2 v;in vec4 d,e;out vec4 c;void main(){c=texture(s,v)*d+e;}`),fi=Yn(`#version 300 es
 precision highp float;uniform mat4 m;in vec2 p;in vec4 c;out vec4 d;void main(){gl_Position=m*vec4(p,1,1);d=c;}`,`#version 300 es
-precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(gi);kt=new Float32Array(e),ws=new Uint32Array(e),So=g.createBuffer(),zn=g.createBuffer(),kr=g.createFramebuffer(),At=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,zn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,r,a=(c,l,u,h,f=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&r;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,f),i+=h*u};wo=g.createVertexArray(),g.bindVertexArray(wo),i=0,o=di,r=mc,g.bindBuffer(g.ARRAY_BUFFER,zn),a("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,So),g.bufferData(g.ARRAY_BUFFER,gi,g.DYNAMIC_DRAW),a("p",g.FLOAT,4,4,1),a("u",g.FLOAT,4,4,1),a("c",g.UNSIGNED_BYTE,1,4,1),a("a",g.UNSIGNED_BYTE,1,4,1),a("r",g.FLOAT,4,1,1),To=g.createVertexArray(),g.bindVertexArray(To),i=0,o=fi,r=bc,a("p",g.FLOAT,4,2),a("c",g.UNSIGNED_BYTE,1,4)}}function Ts(n=!1){!n&&!En||(Et(),En=!1,g.useProgram(di),g.bindVertexArray(wo))}function xc(){En||(Et(),En=!0,g.useProgram(fi),g.bindVertexArray(To))}function Co(n=!0){if(!k||!g)return;p(!At,"glPreRender called with unflushed batch."),pi||(tt.width=I.x,tt.height=I.y),g.viewport(0,0,I.x,I.y),n&&vc();let t=b(2*q).divide(I);pi&&(t.y=-t.y);let e=Ct.rotate(-K),s=b(-1).subtract(e.multiply(t)),i=at(K),o=nt(K),r=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],a=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};a(fi,"m",r),a(di,"m",r),g.activeTexture(g.TEXTURE0),un[0]&&(Qt=un[0].glTexture,g.bindTexture(g.TEXTURE_2D,Qt)),g.bindBuffer(g.ARRAY_BUFFER,So),Dn=Xn=!1,Ts(!0)}function vc(){if(!g)return;let n=nn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function Fr(n){!g||n===Qt||(Et(),Qt=n,g.bindTexture(g.TEXTURE_2D,Qt))}function Sc(n,t=!0){if(!g||!n)return;let e=n===Qt;e?Et():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&Qt&&g.bindTexture(g.TEXTURE_2D,Qt)}function Eo(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),Gt&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Yn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Eo(n,g.VERTEX_SHADER)),g.attachShader(e,Eo(t,g.FRAGMENT_SHADER)),g.linkProgram(e),Gt&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ji(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)jr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!An&&ds(n.width)&&ds(n.height);else{let a=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,a)}let i=An?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let r=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,r),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,r),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Qt),e}function wc(n){g&&g.deleteTexture(n)}function jr(n,t){g&&(p((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!An&&ds(t.width)&&ds(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Qt))}function Hh(n){N||(us.add(n),g&&(n.glTexture?jr(n.glTexture,n.image):n.glTexture=ji(n.image,n.wrap)))}function Xh(n){if(N)return;us.delete(n);let t=n.glTexture;n.glTexture=void 0,wc(t)}function Et(){if(k&&g&&At){let n=Xn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=At*(En?Fi:Gr);g.bufferSubData(g.ARRAY_BUFFER,0,kt,0,t),En?g.drawArrays(g.TRIANGLE_STRIP,0,At):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,At),++_e,Re+=At,At=0}Xn=Dn}function Nr(n){!k||!g||(Et(),n.drawImage(tt,0,0))}function Yh(n=!0){p(!tt,"must be called before engineInit"),Mr=n}function As(n,t,e,s,i=0,o=0,r=0,a=1,c=1,l=-1,u=0){(At>=Wh||Xn!==Dn)&&Et(),Ts();let h=At++*Gr;kt[h++]=n,kt[h++]=t,kt[h++]=e,kt[h++]=s,kt[h++]=o,kt[h++]=r,kt[h++]=a,kt[h++]=c,ws[h++]=l,ws[h++]=u,kt[h++]=i}function Tc(n,t,e,s,i,o){As(n,t,e,s,i,0,0,0,0,0,o)}function Br(n,t,e,s,i,o,r,a=!0){let c=[],l=nt(-r),u=at(-r);for(let f of n){let d=f.x*i,y=f.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=a?Kh(c):c;Ac(h,t)}function zr(n,t,e,s,i,o,r,a,c=!0){let l=$h(n,e,c);Br(l,t,s,i,o,r,a,!1)}function Ac(n,t){if(!k||n.length<3)return;let e=n.length+2;if((At+e>=Jn||Xn!==Dn)&&Et(),p(e=Jn)return;xc();let s=At*Fi;for(let i=e;i--;){let o=F(i-1,0,e-3),r=n[o];kt[s++]=r.x,kt[s++]=r.y,ws[s++]=t}At+=e}function Jr(n,t){if(!k||n.length<3)return;let e=n.length+2;if((At+e>=Jn||Xn!==Dn)&&Et(),p(e=Jn)return;xc();let s=At*Fi;for(let i=e;i--;){let o=F(i-1,0,e-3),r=n[o],a=t[o];kt[s++]=r.x,kt[s++]=r.y,ws[s++]=a}At+=e}function os(n,t=!1){n?(pi=n,g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),Co(t)):(Et(),pi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y))}function Cc(n,t,e,s){k&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,r=1e-6,a=10;for(let c=0;cr?-d/y:0,S=y>r?f/y:0,E=w>r?-v/w:0,A=w>r?x/w:0,T=_+E,R=S+A,M=(T*T+R*R)**.5;if(Mr){let gt=Q(1/ht,a);T*=gt,R*=gt}}let Z=b(u.x-T*s,u.y-R*s),it=b(u.x+T*s,u.y+R*s);i.push(Z),i.push(it)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),E=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(E&&A)},o=[];for(let d=0;d3&&a++{if(E>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(E,2)),T.addColorStop(1,h(E,1))}else s.fillStyle="#000";E>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,E=2*X,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*E),a(v,w-_,v,w+_,A,T)},l=(v,w,_,S,E)=>{s.beginPath(),s.rect(v,w,_,S*d),a(v,w+S,v+_,w,E)},u=(v,w,_,S)=>{s.beginPath();for(let E of v)s.lineTo(E.x,E.y);s.closePath(),a(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",f=Wa(1,1,n),d=Ft(f,.1,.5),y=Q(6,Q(o,r)/99);s.translate(o/2,r/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[E],R,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*X,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,X/2,X*3/2),c(35,30,10,X/2,X*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*X,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,E=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(E,0,40,14)}s.restore()}function Zh(n){if(bi=n,!pn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Ni(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Vr()}_n(void 0,t);function t(){if(!qs.length)return;let e=qs[0],s=an-Ws;if(!Ws)Ws=an;else if(s>yi)Ws=0,qs.shift();else{let i=yi-Nn,o=si?(s-i)/Nn:0;e.render(o)}}}function Ni(n){Object.values(Cs).forEach(t=>n(t))}function td(){Ni(n=>n.unlocked=!1),Vr()}function Vr(){if(!bi)return;let n={};Ni(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[bi]=JSON.stringify(n)}function ed(n){yi=n}function nd(n){Nn=n}function sd(n){mi=n.copy()}function id(n){Ur=n}function Ec(n,t,e,s=125){let i,o,r,a,c,l,u,h,f,d,y,x,v,w=0,_,S=[],E=[],A=[],T=0,R=0,M=1,Z={},it=Zn/s*60>>2;for(;M;T++)S=[M=h=x=0],e.forEach((ht,gt)=>{for(u=t[ht][T]||[0,0,0],M|=t[ht][T]&&1,_=x+(t[ht][0].length-2-(h?0:1))*it,v=gt===e.length-1,i=2,r=x;iit-99&&f&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,E[r]=(E[r]||0)-l*R+l,A[r]=(A[r++]||0)+l*R+l;c&&(y=c%1,R=u[1]||0,(c|=0)&&(S=Z[[d=u[w=0]||0,c]]=Z[[d,c]]||(a=[...n[d]],a[2]=(a[2]||220)*2**(c/12-1),c>0?Gi(...a):[])))}x=_});return[E,A]}function od(n){Wr=typeof n=="boolean"?n?1:0:n}function rd(n){qr=n}async function ad(){return new Ai(await Box2D()),e(),_n(n,t),m;function n(){if(!Ce){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(qr||de)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new wt(l.get_r(),l.get_g(),l.get_b()),r=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),a=l=>r(l).scale(1,.8),c=(l,u)=>{let h=[];for(let f=u;f--;)h.push(m.vec2FromPointer(l+f*8));return h};i.DrawSegment=function(l,u,h){h=a(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),bn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=a(h);let f=c(l,u);Vn(f,cn,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=a(h);let f=c(l,u);Vn(f,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=a(h),l=m.vec2FromPointer(l),si(l,u*2,cn,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,f){f=a(f),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),si(l,u*2,f,.1,f,!1),bn(b(),h,.1,f,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),f=b(1,0),d=z(.75,0,0,.8),y=b(0,1),x=z(0,.75,0,.8);bn(b(),f,.1,d,u,h,!1),bn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){_c(n,t,e,V,s,st,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,r=.05,a=0,c=k,l,u){let h=e.offset(e.size),f=t.add(b(r-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-a:a;Pt(n,f,h,s,a,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),E=b(_?i:f.x,_?f.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));Pt(n.add(S.rotate(v)),E,A,s,a,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,E=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));Pt(n.add(E.rotate(v)),d,A,s,a,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){Rc(n,t,e,V,s,st,i,o,!1,!0)}function Rc(n,t,e,s,i=1,o,r=.05,a=0,c=k,l,u){let h=e.frame(0),f=e.frame(1),d=e.frame(2),y=t.add(b(r-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-a:a;Pt(n,y,d,s,a,!1,o,c,l,u);for(let S=4;S--;){let E=a+S*X/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),R=b(A?y.y:y.x,i);Pt(n.add(T.rotate(_)),R,f,s,E,!1,o,c,l,u)}for(let S=4;S--;){let E=a+S*X/2,A=!S||S>2,T=S>1,R=v.multiply(b(A?-1:1,T?-w:w));Pt(n.add(R.rotate(_)),x,h,s,E,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=V,i=0,o=!1,r=0,a=st,c=k,l=!1,u){let h=Pc(b(),t,e,0,o);Vn(h,s,r,a,n,i,c,l,u)}function Pc(n,t=1,e=0,s=0,i=!1,o=Ls){p(O(n),"pos must be a vec2"),p(P(t)&&P(e),"size and percent must be numbers");let r=ie(e*4,4);r>=2&&(s+=X),r=r<=2?r-1:3-r,i&&(r=-r,s+=X);let a=[],c=$(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*X;a.push(b(l*at(h),l*nt(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*X;a.push(b(l*at(h),-l*r*nt(h)).rotate(s).add(n))}return a}function La(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){p(n!=null&&typeof n=="object","tweenProperty target must be an object"),p(U(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let r=t.split("."),a=r.pop(),c=l=>{let u=n;for(let h of r)u=u[h];u[a]=l};return new Ci(c,e,s,i,o)}function Lc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Lc(n),$t.push(n),n.callback(n.interp(n.duration)))}function Oc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Oc(n),$t.push(n),n.callback(n.interp(n.duration))}function Dc(n,t){n===void 0?(n=Kt-Ra,t=an-Pa,Ra=Kt,Pa=an):t===void 0&&(t=n);for(let e=$t.length;e--;){let s=$t[e];if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El=60,tr=.016666666666666666,vt=[],er=[],Oa=0,Kt=0,an=0,Ce=!1;ao=0,xe=0,Ys=0,Da=!0,xn=[],uo=class{constructor(t,e,s,i){this.update=t,this.render=e,this.glContextLost=s,this.glContextRestored=i}};Gt=!0,ka=.5,Ri=!0,Ga="Escape",Me=!1,en=[],de=!1,fe=!1,vn=!1,Sn=!1,Un=!1;X=Math.PI,et=Math.abs,St=Math.floor,hs=Math.ceil,$s=Math.round,Q=Math.min,$=Math.max,se=n=>Math.sign(n),Ba=(...n)=>Math.hypot(...n),za=n=>Math.log2(n),nt=Math.sin,at=Math.cos,Ja=Math.tan,sr=Math.atan2;go=class{constructor(t=123456789){p(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return St(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=Q(t,e),o=$(t,e)-s,r=this.float(o*2);return rt?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return sr(this.x,this.y)}setAngle(t=0,e=1){return Yt(t),Yt(e),this.x=e*nt(t),this.y=e*at(t),this}rotate(t){Yt(t);let e=at(-t),s=nt(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return Yt(t),Yt(e),t=ie(t,4),p(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return et(this.x)>et(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(et(this.x),et(this.y))}floor(){return new n(St(this.x),St(this.y))}snap(t){return Yt(t),new n(St(this.x*t)/t,St(this.y*t)/t)}mod(t=1){return new n(ie(this.x,t),ie(this.y,t))}area(){return et(this.x*this.y)}lerp(t,e){wa(t),Yt(e);let s=F(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=ie(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=a(r,o,t+1/3),this.g=a(r,o,t),this.b=a(r,o,t-1/3),this.a=i,is(this),this}HSLA(){let t=F(this.r),e=F(this.g),s=F(this.b),i=F(this.a),o=$(t,e,s),r=Q(t,e,s),a=(o+r)/2,c=0,l=0;if(o!==r){let u=o-r;l=a>.5?u/(2-o-r):u/(o+r),t===o?c=(e-s)/u+(e((s=F(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(p(U(t),"Color hex code must be a string"),p(t[0]==="#","Color hex code must start with #"),p([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>F(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>F(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return is(this),this}rgbaInt(){let t=F(this.r)*255|0,e=F(this.g)*255<<8,s=F(this.b)*255<<16,i=F(this.a)*255<<24;return t+e+s+i}isValid(){return P(this.r)&&P(this.g)&&P(this.b)&&P(this.a)}},V=Zt(z()),cn=Zt(z(1,1,1,0)),st=Zt(z(0,0,0)),ye=Zt(z(0,0,0,0)),Vl=Zt(z(.5,.5,.5)),rr=Zt(z(1,0,0)),Wl=Zt(z(1,.5,0)),Ka=Zt(z(1,1,0)),Qa=Zt(z(0,1,0)),ql=Zt(z(0,1,1)),Za=Zt(z(0,0,1)),tc=Zt(z(.5,0,1)),Hl=Zt(z(1,0,1)),Ee=class{constructor(t,e=!1){p(t===void 0||P(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){p(P(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){p(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-Ft(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?an:Kt}toString(){return this.isSet()?et(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};Ct=b(),K=0,q=32,cr=1,Pi=!0,nn=ye,kn=b(1920,1080),rs=0,Gn=0,Fn=b(),lr=!1,An=!0,sn=1,Ps="arial",ur=!1,N=!1,k=!0,Ls=32,Li=b(16),Oi=0,Di=0,Ii=!0,hr=1,dr=1,fr=1,pr=0,gr=.8,Fe=1,Vt=b(),Zs=1,Mi=!0,yr=!0,as=!0,mn=!0,ln=!1,mr=!1,ge=0,$n=4,Rn=!0,Kn=0,Qn=!1,Os=!0,hn=!1,qt=100,br=.3,cs=3,ti=0,Ds=!0,Ht=!0,wn=.3,xr=40,vr=.7;Ue=class n{constructor(t=b(),e=b(1),s,i=0,o=V,r=0){p(O(t),"object pos must be a vec2"),p(O(e),"object size must be a vec2"),p(!s||s instanceof Pe,"object tileInfo should be a TileInfo or undefined"),p(typeof i=="number"&&isFinite(i),"object angle should be a number"),p(J(o),"object color should be a valid rgba color"),p(typeof r=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=hr,this.damping=dr,this.angleDamping=fr,this.restitution=pr,this.friction=gr,this.gravityScale=1,this.renderOrder=r,this.velocity=b(),this.angleVelocity=0,this.spawnTime=Kt,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,vt.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,r=s.y,a=t.angle;if(a){let c=at(-a),l=nt(-a);this.pos.set(o*c-r*l+i.x,o*l+r*c+i.y)}else this.pos.set(o+i.x,r+i.y);this.angle=e*this.localAngle+a}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(p(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=F(this.velocity.x,-Fe,Fe),this.velocity.y=F(this.velocity.y,-Fe,Fe));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Vt.x*this.gravityScale,this.velocity.y+=Vt.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),!Ii||!this.mass)return;let e=this.velocity.y<0&&Vt.y<0||this.velocity.y>0&&Vt.y>0;if(this.groundObject){let s=$(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of er){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),r=i.collideWithObject(this);if(!o||!r)continue;if(Qs(t,this.size,i.pos,i.size)){let f=t.subtract(i.pos),d=f.length(),x=d<.001?b(0,1):f.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),de&&fo(this.pos,this.size,i.pos,i.size,"#f00");continue}let a=this.size.add(i.size),c=(t.y-i.pos.y)*2>a.y+Vt.y,l=et(t.y-i.pos.y)*20?-1:1)>0?St(t.y-this.size.y/2+1)+this.size.y/2+.001:hs(t.y+this.size.y/2-1)-this.size.y/2-.001;if(et(u-this.pos.y)<.1&&!Qe(b(this.pos.x,u),this.size,this)){this.pos.y=u,de&&bt(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-r}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Vt.y<0?St(t.y-this.size.y/2)+c:hs(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-r}de&&bt(this.pos,this.size,"#f00")}}}update(){}render(){Pt(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+X/2,t)}getAliveTime(){return Kt-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return p(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(p(!t.parent&&!this.children.includes(t)),p(t instanceof n,"child must be an EngineObject"),p(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Qs(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){p(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
+precision highp float;in vec4 d;out vec4 c;void main(){c=d;}`);let e=new ArrayBuffer(gi);Gt=new Float32Array(e),ws=new Uint32Array(e),So=g.createBuffer(),zn=g.createBuffer(),kr=g.createFramebuffer(),At=0;let s=new Float32Array([0,0,1,0,0,1,1,1]);g.bindBuffer(g.ARRAY_BUFFER,zn),g.bufferData(g.ARRAY_BUFFER,s,g.STATIC_DRAW);let i,o,r,a=(c,l,u,h,f=0)=>{let d=g.getAttribLocation(o,c),y=u===1,x=u&&r;g.enableVertexAttribArray(d),g.vertexAttribPointer(d,h,l,y,x,i),g.vertexAttribDivisor(d,f),i+=h*u};wo=g.createVertexArray(),g.bindVertexArray(wo),i=0,o=di,r=mc,g.bindBuffer(g.ARRAY_BUFFER,zn),a("g",g.FLOAT,0,2),g.bindBuffer(g.ARRAY_BUFFER,So),g.bufferData(g.ARRAY_BUFFER,gi,g.DYNAMIC_DRAW),a("p",g.FLOAT,4,4,1),a("u",g.FLOAT,4,4,1),a("c",g.UNSIGNED_BYTE,1,4,1),a("a",g.UNSIGNED_BYTE,1,4,1),a("r",g.FLOAT,4,1,1),To=g.createVertexArray(),g.bindVertexArray(To),i=0,o=fi,r=bc,a("p",g.FLOAT,4,2),a("c",g.UNSIGNED_BYTE,1,4)}}function Ts(n=!1){!n&&!En||(Et(),En=!1,g.useProgram(di),g.bindVertexArray(wo))}function xc(){En||(Et(),En=!0,g.useProgram(fi),g.bindVertexArray(To))}function Co(n=!0){if(!k||!g)return;p(!At,"glPreRender called with unflushed batch."),pi||(tt.width=I.x,tt.height=I.y),g.viewport(0,0,I.x,I.y),n&&vc();let t=b(2*q).divide(I);pi&&(t.y=-t.y);let e=Ct.rotate(-K),s=b(-1).subtract(e.multiply(t)),i=ct(K),o=nt(K),r=[t.x*i,t.y*o,0,0,-t.x*o,t.y*i,0,0,1,1,1,0,s.x,s.y,0,1],a=(c,l,u)=>{g.useProgram(c);let h=g.getUniformLocation(c,l);g.uniformMatrix4fv(h,!1,u)};a(fi,"m",r),a(di,"m",r),g.activeTexture(g.TEXTURE0),un[0]&&(Zt=un[0].glTexture,g.bindTexture(g.TEXTURE_2D,Zt)),g.bindBuffer(g.ARRAY_BUFFER,So),Dn=Xn=!1,Ts(!0)}function vc(){if(!g)return;let n=nn;g.clearColor(n.r,n.g,n.b,n.a),g.clear(g.COLOR_BUFFER_BIT)}function Fr(n){!g||n===Zt||(Et(),Zt=n,g.bindTexture(g.TEXTURE_2D,Zt))}function Sc(n,t=!0){if(!g||!n)return;let e=n===Zt;e?Et():g.bindTexture(g.TEXTURE_2D,n);let s=t?g.REPEAT:g.CLAMP_TO_EDGE;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,s),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,s),!e&&Zt&&g.bindTexture(g.TEXTURE_2D,Zt)}function Eo(n,t){if(!g)return;let e=g.createShader(t);if(g.shaderSource(e,n),g.compileShader(e),Ft&&!g.getShaderParameter(e,g.COMPILE_STATUS))throw g.getShaderInfoLog(e);return e}function Yn(n,t){if(!g)return;let e=g.createProgram();if(g.attachShader(e,Eo(n,g.VERTEX_SHADER)),g.attachShader(e,Eo(t,g.FRAGMENT_SHADER)),g.linkProgram(e),Ft&&!g.getProgramParameter(e,g.LINK_STATUS))throw g.getProgramInfoLog(e);return e}function ji(n,t=!1){if(!g)return;let e=g.createTexture(),s=!1;if(n!=null&&n.width)jr(e,n),g.bindTexture(g.TEXTURE_2D,e),s=!An&&ds(n.width)&&ds(n.height);else{let a=new Uint8Array([255,255,255,255]);g.bindTexture(g.TEXTURE_2D,e),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,1,1,0,g.RGBA,g.UNSIGNED_BYTE,a)}let i=An?g.NEAREST:g.LINEAR,o=s?g.LINEAR_MIPMAP_LINEAR:i;g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,i),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,o);let r=t?g.REPEAT:g.CLAMP_TO_EDGE;return g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,r),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,r),s&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Zt),e}function wc(n){g&&g.deleteTexture(n)}function jr(n,t){g&&(p((t==null?void 0:t.width)>0,"Invalid image data."),g.bindTexture(g.TEXTURE_2D,n),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,t),!An&&ds(t.width)&&ds(t.height)&&g.generateMipmap(g.TEXTURE_2D),g.bindTexture(g.TEXTURE_2D,Zt))}function Hh(n){N||(us.add(n),g&&(n.glTexture?jr(n.glTexture,n.image):n.glTexture=ji(n.image,n.wrap)))}function Xh(n){if(N)return;us.delete(n);let t=n.glTexture;n.glTexture=void 0,wc(t)}function Et(){if(k&&g&&At){let n=Xn?g.ONE:g.ONE_MINUS_SRC_ALPHA;g.blendFuncSeparate(g.SRC_ALPHA,n,g.ONE,n),g.enable(g.BLEND);let t=At*(En?Fi:Gr);g.bufferSubData(g.ARRAY_BUFFER,0,Gt,0,t),En?g.drawArrays(g.TRIANGLE_STRIP,0,At):g.drawArraysInstanced(g.TRIANGLE_STRIP,0,4,At),++_e,Re+=At,At=0}Xn=Dn}function Nr(n){!k||!g||(Et(),n.drawImage(tt,0,0))}function Yh(n=!0){p(!tt,"must be called before engineInit"),Mr=n}function As(n,t,e,s,i=0,o=0,r=0,a=1,c=1,l=-1,u=0){(At>=Wh||Xn!==Dn)&&Et(),Ts();let h=At++*Gr;Gt[h++]=n,Gt[h++]=t,Gt[h++]=e,Gt[h++]=s,Gt[h++]=o,Gt[h++]=r,Gt[h++]=a,Gt[h++]=c,ws[h++]=l,ws[h++]=u,Gt[h++]=i}function Tc(n,t,e,s,i,o){As(n,t,e,s,i,0,0,0,0,0,o)}function Br(n,t,e,s,i,o,r,a=!0){let c=[],l=nt(-r),u=ct(-r);for(let f of n){let d=f.x*i,y=f.y*o;c.push(b(e+u*d-l*y,s+l*d+u*y))}let h=a?Kh(c):c;Ac(h,t)}function zr(n,t,e,s,i,o,r,a,c=!0){let l=$h(n,e,c);Br(l,t,s,i,o,r,a,!1)}function Ac(n,t){if(!k||n.length<3)return;let e=n.length+2;if((At+e>=Jn||Xn!==Dn)&&Et(),p(e=Jn)return;xc();let s=At*Fi;for(let i=e;i--;){let o=F(i-1,0,e-3),r=n[o];Gt[s++]=r.x,Gt[s++]=r.y,ws[s++]=t}At+=e}function Jr(n,t){if(!k||n.length<3)return;let e=n.length+2;if((At+e>=Jn||Xn!==Dn)&&Et(),p(e=Jn)return;xc();let s=At*Fi;for(let i=e;i--;){let o=F(i-1,0,e-3),r=n[o],a=t[o];Gt[s++]=r.x,Gt[s++]=r.y,ws[s++]=a}At+=e}function os(n,t=!1){n?(pi=n,g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,n,0),Co(t)):(Et(),pi=void 0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y))}function Cc(n,t,e,s){k&&(g.enable(g.SCISSOR_TEST),g.scissor(n,t,e,s),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT),g.disable(g.SCISSOR_TEST))}function $h(n,t,e=!0){if(n.length<2)return[];let s=t/2,i=[],o=n.length,r=1e-6,a=10;for(let c=0;cr?-d/y:0,S=y>r?f/y:0,E=w>r?-v/w:0,A=w>r?x/w:0,T=_+E,R=S+A,M=(T*T+R*R)**.5;if(Mr){let gt=Q(1/ht,a);T*=gt,R*=gt}}let Z=b(u.x-T*s,u.y-R*s),it=b(u.x+T*s,u.y+R*s);i.push(Z),i.push(it)}return i.length>1&&e&&(i.push(i[0]),i.push(i[1])),i}function Kh(n){if(n.length<3)return[];let t=(d,y,x)=>(y.x-d.x)*(x.y-d.y)-(y.y-d.y)*(x.x-d.x);(d=>{let y=0;for(let x=d.length;x--;){let v=(x+1)%d.length;y+=d[x].cross(d[v])}return y})(n)<0&&(n=n.slice().reverse());let s=1e-9,i=(d,y,x,v)=>{let w=t(y,x,d),_=t(x,v,d),S=t(v,y,d),E=(w<-s?1:0)+(_<-s?1:0)+(S<-s?1:0),A=(w>s?1:0)+(_>s?1:0)+(S>s?1:0);return!(E&&A)},o=[];for(let d=0;d3&&a++{if(E>=0){let T=s.fillStyle=s.createLinearGradient(v,w,_,S);T.addColorStop(0,h(E,2)),T.addColorStop(1,h(E,1))}else s.fillStyle="#000";E>=-1?(s.fill(),A&&s.stroke()):s.stroke()},c=(v,w,_,S=0,E=2*X,A,T)=>{s.beginPath(),s.arc(v,w,_,d*S,d*E),a(v,w-_,v,w+_,A,T)},l=(v,w,_,S,E)=>{s.beginPath(),s.rect(v,w,_,S*d),a(v,w+S,v+_,w,E)},u=(v,w,_,S)=>{s.beginPath();for(let E of v)s.lineTo(E.x,E.y);s.closePath(),a(0,_,0,_+S,w)},h=(v,w)=>w?`hsl(${[.95,.56,.13][v%3]*360} 99%${[0,50,75][w]}%)`:"#000",f=Wa(1,1,n),d=jt(f,.1,.5),y=Q(6,Q(o,r)/99);s.translate(o/2,r/2),s.scale(y,y),s.translate(-40,-35),d<1&&s.setLineDash([99*d,99]),s.lineJoin=s.lineCap="round",s.lineWidth=.1+d*1.9;{let w="LittleJS";s.font="900 15.5px arial",s.lineWidth=.1+d*3.9,s.textAlign="center",s.textBaseline="top",l(11,55,59,8*d,-1),s.beginPath();let _=0;for(let S=0;S5?1:0),s[S?"strokeText":"fillText"](w[E],R,54+.5,17*d),A+=T}s.lineWidth=.1+d*1.9,l(3,54,73,0)}l(7,15,26,-7,0),l(25,15,8,25,-1),l(10,40,15,-25,1),l(14,21,7,9,2),l(38,20,6,-6,2),l(49,20,10,-6,0);let x=[b(44,8),b(64,8),b(59,8+6*d),b(49,8+6*d)];u(x,2,8,6*d),l(44,8,20,-7,0);for(let v=5;v--;)c(59-v*6*d,30,10,0,2*X,1,0);c(59,30,4,0,7,2),l(35,20,24,0),c(59,30,10),c(47,30,10,X/2,X*3/2),c(35,30,10,X/2,X*3/2),l(7,40,13,7,-1),l(17,40,43,14,-1);for(let v=3;v--;)for(let w=2;w--;)c(17+15*v,47,w?7:1,0,2*X,2);for(let v=2;v--;){let w=6,_=7,S=53+w*d*v,E=[b(S+_,54),b(S,40),b(S+w*d,40),b(S+_+w*d,54)];u(E,0,40,14)}s.restore()}function Zh(n){if(bi=n,!pn){let e={};try{e=JSON.parse(localStorage[n]||"{}")}catch{e={}}Ni(s=>{s.unlocked=!!(e[s.id]&&e[s.id].unlocked)}),Vr()}_n(void 0,t);function t(){if(!qs.length)return;let e=qs[0],s=an-Ws;if(!Ws)Ws=an;else if(s>yi)Ws=0,qs.shift();else{let i=yi-Nn,o=si?(s-i)/Nn:0;e.render(o)}}}function Ni(n){Object.values(Cs).forEach(t=>n(t))}function td(){Ni(n=>n.unlocked=!1),Vr()}function Vr(){if(!bi)return;let n={};Ni(t=>{let e={name:t.name,description:t.description,icon:t.icon,unlocked:t.unlocked};t.image&&(e.src=t.image.src),n[t.id]=e}),localStorage[bi]=JSON.stringify(n)}function ed(n){yi=n}function nd(n){Nn=n}function sd(n){mi=n.copy()}function id(n){Ur=n}function Ec(n,t,e,s=125){let i,o,r,a,c,l,u,h,f,d,y,x,v,w=0,_,S=[],E=[],A=[],T=0,R=0,M=1,Z={},it=Zn/s*60>>2;for(;M;T++)S=[M=h=x=0],e.forEach((ht,gt)=>{for(u=t[ht][T]||[0,0,0],M|=t[ht][T]&&1,_=x+(t[ht][0].length-2-(h?0:1))*it,v=gt===e.length-1,i=2,r=x;iit-99&&f&&y<1?y+=1/99:0)l=(1-y)*S[w++]/2||0,E[r]=(E[r]||0)-l*R+l,A[r]=(A[r++]||0)+l*R+l;c&&(y=c%1,R=u[1]||0,(c|=0)&&(S=Z[[d=u[w=0]||0,c]]=Z[[d,c]]||(a=[...n[d]],a[2]=(a[2]||220)*2**(c/12-1),c>0?Gi(...a):[])))}x=_});return[E,A]}function od(n){Wr=typeof n=="boolean"?n?1:0:n}function rd(n){qr=n}async function ad(){return new Ai(await Box2D()),e(),_n(n,t),m;function n(){if(!Ce){m.step(),m.objects=m.objects.filter(s=>!s.destroyed);for(let s of m.objects)s.body&&(s.pos=m.vec2From(s.body.GetPosition()),s.angle=-s.body.GetAngle())}}function t(){(qr||de)&&m.world.DrawDebugData()}function e(){let i=new m.instance.JSDraw,o=l=>new wt(l.get_r(),l.get_g(),l.get_b()),r=l=>o(m.instance.wrapPointer(l,m.instance.b2Color)),a=l=>r(l).scale(1,.8),c=(l,u)=>{let h=[];for(let f=u;f--;)h.push(m.vec2FromPointer(l+f*8));return h};i.DrawSegment=function(l,u,h){h=a(h),l=m.vec2FromPointer(l),u=m.vec2FromPointer(u),bn(l,u,.1,h,b(),0,!1)},i.DrawPolygon=function(l,u,h){h=a(h);let f=c(l,u);Vn(f,cn,.1,h,b(),0,!1)},i.DrawSolidPolygon=function(l,u,h){h=a(h);let f=c(l,u);Vn(f,h,0,h,b(),0,!1)},i.DrawCircle=function(l,u,h){h=a(h),l=m.vec2FromPointer(l),si(l,u*2,cn,.1,h,!1)},i.DrawSolidCircle=function(l,u,h,f){f=a(f),l=m.vec2FromPointer(l),h=m.vec2FromPointer(h).scale(u),si(l,u*2,f,.1,f,!1),bn(b(),h,.1,f,l,0,!1)},i.DrawTransform=function(l){l=m.instance.wrapPointer(l,m.instance.b2Transform);let u=m.vec2From(l.get_p()),h=-l.get_q().GetAngle(),f=b(1,0),d=z(.75,0,0,.8),y=b(0,1),x=z(0,.75,0,.8);bn(b(),f,.1,d,u,h,!1),bn(b(),y,.1,x,u,h,!1)},i.AppendFlags(m.instance.b2Draw.e_shapeBit),i.AppendFlags(m.instance.b2Draw.e_jointBit),m.world.SetDebugDraw(i)}}function cd(n,t,e,s=32,i=2,o=0){_c(n,t,e,V,s,st,i,o,!1,!0)}function _c(n,t,e,s,i=1,o,r=.05,a=0,c=k,l,u){let h=e.offset(e.size),f=t.add(b(r-i*2)),d=b(i),y=t.scale(.5).subtract(d.scale(.5)),x=l?-1:1,v=l?-a:a;Lt(n,f,h,s,a,!1,o,c,l,u);for(let w=4;w--;){let _=w%2,S=y.multiply(b(_?w===1?1:-1:0,_?0:w?-1:1)),E=b(_?i:f.x,_?f.y:i),A=h.offset(e.size.multiply(b(w===1?1:w===3?-1:0,w===0?-x:w===2?x:0)));Lt(n.add(S.rotate(v)),E,A,s,a,!1,o,c,l,u)}for(let w=4;w--;){let _=w>1,S=w&&w<3,E=y.multiply(b(_?-1:1,S?-1:1)),A=h.offset(e.size.multiply(b(_?-1:1,S?x:-x)));Lt(n.add(E.rotate(v)),d,A,s,a,!1,o,c,l,u)}}function ld(n,t,e,s=32,i=2,o=0){Rc(n,t,e,V,s,st,i,o,!1,!0)}function Rc(n,t,e,s,i=1,o,r=.05,a=0,c=k,l,u){let h=e.frame(0),f=e.frame(1),d=e.frame(2),y=t.add(b(r-i*2)),x=b(i),v=t.scale(.5).subtract(x.scale(.5)),w=l?-1:1,_=l?-a:a;Lt(n,y,d,s,a,!1,o,c,l,u);for(let S=4;S--;){let E=a+S*X/2,A=S%2,T=v.multiply(b(A?S===1?1:-1:0,A?0:S?-w:w)),R=b(A?y.y:y.x,i);Lt(n.add(T.rotate(_)),R,f,s,E,!1,o,c,l,u)}for(let S=4;S--;){let E=a+S*X/2,A=!S||S>2,T=S>1,R=v.multiply(b(A?-1:1,T?-w:w));Lt(n.add(R.rotate(_)),x,h,s,E,!1,o,c,l,u)}}function ud(n,t=1,e=0,s=V,i=0,o=!1,r=0,a=st,c=k,l=!1,u){let h=Pc(b(),t,e,0,o);Vn(h,s,r,a,n,i,c,l,u)}function Pc(n,t=1,e=0,s=0,i=!1,o=Ls){p(O(n),"pos must be a vec2"),p(P(t)&&P(e),"size and percent must be numbers");let r=ie(e*4,4);r>=2&&(s+=X),r=r<=2?r-1:3-r,i&&(r=-r,s+=X);let a=[],c=$(3,o>>1),l=t/2;for(let u=0;u<=c;u++){let h=u/c*X;a.push(b(l*ct(h),l*nt(h)).rotate(s).add(n))}for(let u=c;u>=0;u--){let h=u/c*X;a.push(b(l*ct(h),-l*r*nt(h)).rotate(s).add(n))}return a}function La(n){return n&&typeof n.lerp=="function"}function hd(n,t,e,s,i=1,o={}){p(n!=null&&typeof n=="object","tweenProperty target must be an object"),p(U(t)&&t.length>0,"tweenProperty propertyPath must be a non-empty string");let r=t.split("."),a=r.pop(),c=l=>{let u=n;for(let h of r)u=u[h];u[a]=l};return new Ci(c,e,s,i,o)}function Lc(n){n.loopRemaining!==1/0&&n.loopRemaining<=1||(n.loopRemaining!==1/0&&(n.loopRemaining-=1),n.life=n.duration,n.thenCallback=()=>Lc(n),Kt.push(n),n.callback(n.interp(n.duration)))}function Oc(n){if(n.loopRemaining!==1/0&&n.loopRemaining<=1)return;n.loopRemaining!==1/0&&(n.loopRemaining-=1);let t=n.start;n.start=n.end,n.end=t,n.life=n.duration,n.thenCallback=()=>Oc(n),Kt.push(n),n.callback(n.interp(n.duration))}function Dc(n,t){n===void 0?(n=Qt-Ra,t=an-Pa,Ra=Qt,Pa=an):t===void 0&&(t=n);for(let e=Kt.length;e--;){let s=Kt[e];if(s.paused)continue;let i=s.useRealTime?t:n;if(!(i<=0))if(s.life-=i,s.life>0)s.callback(s.interp(s.life));else{s.callback(s.interp(0)),Kt.splice(e,1);let o=s.thenCallback;s.thenCallback=void 0,o&&o()}}}function dd(){for(let n of Kt)n.thenCallback=void 0;Kt.length=0}var Hs,Xs,El,tr,vt,er,Oa,Qt,an,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1,vn=!1,Sn=!1,Un=!1;X=Math.PI,et=Math.abs,St=Math.floor,hs=Math.ceil,$s=Math.round,Q=Math.min,$=Math.max,se=n=>Math.sign(n),Ba=(...n)=>Math.hypot(...n),za=n=>Math.log2(n),nt=Math.sin,ct=Math.cos,Ja=Math.tan,sr=Math.atan2;go=class{constructor(t=123456789){p(t!==0,"RandomGenerator seed must be non-zero (xorshift is fixed at 0)"),this.seed=t}float(t=1,e=0){return this.seed^=this.seed<<13,this.seed^=this.seed>>>17,this.seed^=this.seed<<5,e+(t-e)*((this.seed>>>0)/2**32)}int(t,e=0){return St(this.float(t,e))}bool(t=.5){return this.float().5?1:-1}floatSign(t=1,e=0){let s=Q(t,e),o=$(t,e)-s,r=this.float(o*2);return rt?this.scale(t/e):this.copy()}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}reflect(t,e=1){return this.subtract(t.scale((1+e)*this.dot(t)))}angle(){return sr(this.x,this.y)}setAngle(t=0,e=1){return $t(t),$t(e),this.x=e*nt(t),this.y=e*ct(t),this}rotate(t){$t(t);let e=ct(-t),s=nt(-t);return new n(this.x*e-this.y*s,this.x*s+this.y*e)}setDirection(t,e=1){return $t(t),$t(e),t=ie(t,4),p(t===0||t===1||t===2||t===3,"Vector2.setDirection() direction must be an integer between 0 and 3."),this.x=t%2?t-1?-e:e:0,this.y=t%2?0:t?-e:e,this}direction(){return et(this.x)>et(this.y)?this.x<0?3:1:this.y<0?2:0}abs(){return new n(et(this.x),et(this.y))}floor(){return new n(St(this.x),St(this.y))}snap(t){return $t(t),new n(St(this.x*t)/t,St(this.y*t)/t)}mod(t=1){return new n(ie(this.x,t),ie(this.y,t))}area(){return et(this.x*this.y)}lerp(t,e){wa(t),$t(e);let s=F(e);return new n(t.x*s+this.x*(1-s),t.y*s+this.y*(1-s))}arrayCheck(t){return this.x>=0&&this.y>=0&&this.x(u=ie(u,1))*6<1?c+(l-c)*6*u:u*2<1?l:u*3<2?c+(l-c)*(4-u*6):c;return this.r=a(r,o,t+1/3),this.g=a(r,o,t),this.b=a(r,o,t-1/3),this.a=i,is(this),this}HSLA(){let t=F(this.r),e=F(this.g),s=F(this.b),i=F(this.a),o=$(t,e,s),r=Q(t,e,s),a=(o+r)/2,c=0,l=0;if(o!==r){let u=o-r;l=a>.5?u/(2-o-r):u/(o+r),t===o?c=(e-s)/u+(e((s=F(s)*255|0)<16?"0":"")+s.toString(16);return"#"+e(this.r)+e(this.g)+e(this.b)+(t?e(this.a):"")}setHex(t){if(p(U(t),"Color hex code must be a string"),p(t[0]==="#","Color hex code must start with #"),p([4,5,7,9].includes(t.length),"Invalid hex"),t.length<6){let e=s=>F(parseInt(t[s],16)/15);this.r=e(1),this.g=e(2),this.b=e(3),this.a=t.length===5?e(4):1}else{let e=s=>F(parseInt(t.slice(s,s+2),16)/255);this.r=e(1),this.g=e(3),this.b=e(5),this.a=t.length===9?e(7):1}return is(this),this}rgbaInt(){let t=F(this.r)*255|0,e=F(this.g)*255<<8,s=F(this.b)*255<<16,i=F(this.a)*255<<24;return t+e+s+i}isValid(){return P(this.r)&&P(this.g)&&P(this.b)&&P(this.a)}},V=te(z()),cn=te(z(1,1,1,0)),st=te(z(0,0,0)),ye=te(z(0,0,0,0)),Vl=te(z(.5,.5,.5)),rr=te(z(1,0,0)),Wl=te(z(1,.5,0)),Ka=te(z(1,1,0)),Qa=te(z(0,1,0)),ql=te(z(0,1,1)),Za=te(z(0,0,1)),tc=te(z(.5,0,1)),Hl=te(z(1,0,1)),Ee=class{constructor(t,e=!1){p(t===void 0||P(t),"Constructed Timer is invalid.",t),this.useRealTime=e;let s=this.getGlobalTime();this.time=t===void 0?void 0:s+t,this.setTime=t}set(t=0){p(P(t),"Timer is invalid.",t);let e=this.getGlobalTime();this.time=e+t,this.setTime=t}setUseRealTime(t=!0){p(!this.isSet(),"Cannot change global time setting while timer is set."),this.useRealTime=t}unset(){this.time=void 0}isSet(){return this.time!==void 0}active(){return this.getGlobalTime()=this.time}get(){return this.isSet()?this.getGlobalTime()-this.time:0}getPercent(){return this.isSet()?this.setTime?1-jt(this.time-this.getGlobalTime(),0,this.setTime):1:0}getSetTime(){return this.isSet()?this.setTime:0}getGlobalTime(){return this.useRealTime?an:Qt}toString(){return this.isSet()?et(this.get())+" seconds "+(this.get()<0?"before":"after"):"unset"}valueOf(){return this.get()}};Ct=b(),K=0,q=32,cr=1,Pi=!0,nn=ye,kn=b(1920,1080),rs=0,Gn=0,Fn=b(),lr=!1,An=!0,sn=1,Ps="arial",ur=!1,N=!1,k=!0,Ls=32,Li=b(16),Oi=0,Di=0,Ii=!0,hr=1,dr=1,fr=1,pr=0,gr=.8,je=1,Wt=b(),Zs=1,Mi=!0,yr=!0,as=!0,mn=!0,ln=!1,mr=!1,ge=0,$n=4,Rn=!0,Kn=0,Qn=!1,Os=!0,hn=!1,Ht=100,br=.3,cs=3,ti=0,Ds=!0,Xt=!0,wn=.3,xr=40,vr=.7;Ve=class n{constructor(t=b(),e=b(1),s,i=0,o=V,r=0){p(O(t),"object pos must be a vec2"),p(O(e),"object size must be a vec2"),p(!s||s instanceof Pe,"object tileInfo should be a TileInfo or undefined"),p(typeof i=="number"&&isFinite(i),"object angle should be a number"),p(J(o),"object color should be a valid rgba color"),p(typeof r=="number","object renderOrder should be a number"),this.pos=t.copy(),this.size=e.copy(),this.drawSize=void 0,this.tileInfo=s,this.angle=i,this.color=o.copy(),this.additiveColor=void 0,this.mirror=!1,this.destroyed=!1,this.mass=hr,this.damping=dr,this.angleDamping=fr,this.restitution=pr,this.friction=gr,this.gravityScale=1,this.renderOrder=r,this.velocity=b(),this.angleVelocity=0,this.spawnTime=Qt,this.children=[],this.clampSpeed=!0,this.groundObject=void 0,this.parent=void 0,this.localPos=b(),this.localAngle=0,this.collideTiles=!1,this.collideSolidObjects=!1,this.isSolid=!1,this.collideRaycast=!1,vt.push(this)}updateTransforms(){let t=this.parent;if(t){let e=t.getMirrorSign(),s=this.localPos,i=t.pos,o=s.x*e,r=s.y,a=t.angle;if(a){let c=ct(-a),l=nt(-a);this.pos.set(o*c-r*l+i.x,o*l+r*c+i.y)}else this.pos.set(o+i.x,r+i.y);this.angle=e*this.localAngle+a}for(let e of this.children)e.updateTransforms()}updatePhysics(){if(p(!this.parent),this.destroyed)return;this.clampSpeed&&(this.velocity.x=F(this.velocity.x,-je,je),this.velocity.y=F(this.velocity.y,-je,je));let t=this.pos.copy();if(this.velocity.x*=this.damping,this.velocity.y*=this.damping,this.mass&&(this.velocity.x+=Wt.x*this.gravityScale,this.velocity.y+=Wt.y*this.gravityScale),this.pos.x+=this.velocity.x,this.pos.y+=this.velocity.y,this.angle+=this.angleVelocity*=this.angleDamping,p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),!Ii||!this.mass)return;let e=this.velocity.y<0&&Wt.y<0||this.velocity.y>0&&Wt.y>0;if(this.groundObject){let s=$(this.friction,this.groundObject.friction),i=this.groundObject.velocity.x;this.velocity.x=i+(this.velocity.x-i)*s,this.groundObject=void 0}if(this.collideSolidObjects)for(let i of er){if(i.destroyed||i.parent||i===this||!this.isSolid&&!i.isSolid||!this.isOverlappingObject(i))continue;let o=this.collideWithObject(i),r=i.collideWithObject(this);if(!o||!r)continue;if(Qs(t,this.size,i.pos,i.size)){let f=t.subtract(i.pos),d=f.length(),x=d<.001?b(0,1):f.scale(.001/d);this.velocity=this.velocity.add(x),i.mass&&(i.velocity=i.velocity.subtract(x)),de&&fo(this.pos,this.size,i.pos,i.size,"#f00");continue}let a=this.size.add(i.size),c=(t.y-i.pos.y)*2>a.y+Wt.y,l=et(t.y-i.pos.y)*20?-1:1)>0?St(t.y-this.size.y/2+1)+this.size.y/2+.001:hs(t.y+this.size.y/2-1)-this.size.y/2-.001;if(et(u-this.pos.y)<.1&&!Qe(b(this.pos.x,u),this.size,this)){this.pos.y=u,de&&bt(this.pos,this.size,"#ff0");return}this.pos.x=t.x,this.velocity.x*=-r}if(o||!i){if(e){let c=this.size.y/2+1e-4;this.pos.y=Wt.y<0?St(t.y-this.size.y/2)+c:hs(t.y+this.size.y/2)-c,this.groundObject=s}else this.pos.y=t.y,this.groundObject=void 0;this.velocity.y*=-r}de&&bt(this.pos,this.size,"#f00")}}}update(){}render(){Lt(this.pos,this.drawSize||this.size,this.tileInfo,this.color,this.angle,this.mirror,this.additiveColor)}renderLight(){}destroy(t=!1){var e;if(!this.destroyed){this.destroyed=!0,(e=this.parent)==null||e.removeChild(this);for(let s of this.children)s.parent=void 0,s.destroy(t)}}localToWorld(t){return this.pos.add(t.rotate(this.angle))}worldToLocal(t){return t.subtract(this.pos).rotate(-this.angle)}localToWorldVector(t){return t.rotate(this.angle)}worldToLocalVector(t){return t.rotate(-this.angle)}collideWithTile(t,e){return t>0}collideWithObject(t){return!0}getUp(t=1){return b().setAngle(this.angle,t)}getRight(t=1){return b().setAngle(this.angle+X/2,t)}getAliveTime(){return Qt-this.spawnTime}getSpeed(){return this.velocity.length()}applyAcceleration(t){this.mass&&(this.velocity=this.velocity.add(t))}applyAngularAcceleration(t){this.mass&&(this.angleVelocity+=t)}applyForce(t){this.mass&&this.applyAcceleration(t.scale(1/this.mass))}getMirrorSign(){return this.mirror?-1:1}addChild(t,e=b(),s=0){return p(!this.destroyed,"cannot add child to destroyed object"),this.destroyed||(p(!t.parent&&!this.children.includes(t)),p(t instanceof n,"child must be an EngineObject"),p(t!==this,"cannot add self as child"),this.children.push(t),t.parent=this,t.localPos=e.copy(),t.localAngle=s,t.updateTransforms()),t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}isOverlappingObject(t){return this.isOverlapping(t.pos,t.size)}isOverlapping(t,e=b()){return Qs(this.pos,this.size,t,e)}setCollision(t=!0,e=!0,s=!0,i=!0){p(t||!e,"solid objects must be set to collide"),this.collideSolidObjects=t,this.isSolid=e,this.collideTiles=s,this.collideRaycast=i}toString(){let t="type = "+this.constructor.name;return(this.pos.x||this.pos.y)&&(t+=`
 pos = `+this.pos),(this.velocity.x||this.velocity.y)&&(t+=`
 velocity = `+this.velocity),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.angle&&(t+=`
 angle = `+this.angle.toFixed(3)),this.color&&(t+=`
-color = `+this.color),t}renderDebugInfo(){if(!Gt)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b($(this.size.x,.2),$(this.size.y,.2)),s=z(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);bt(this.pos,e,s,0,this.angle,t),this.parent&&bt(this.pos,e.scale(.8),z(1,1,1,.5),0,this.angle),this.parent&&Te(this.pos,this.parent.pos,z(1,1,1,.5),.5)}},I=b(),un=[];Pe=class n{constructor(t=b(),e=Li,s=un[0],i=Oi,o=Di){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){p(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return p(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new ot(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new ot,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Is(t,this.size,this.textureInfo,this.padding,this.bleed)}},Ve=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,Sc(this.glTexture,t)}};nh=0;ii=class{constructor(t){p(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,r,a){p(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(p(s>0),s*=q,s=new ot(s,s)):s=s.scale(q),this.drawTextScreen(t,Ln(e),s,i,o,r,a)}drawTextScreen(t,e,s,i=!0,o=V,r=k,a){p(U(t),"text must be a string"),p(O(e),"pos must be a vec2"),p(O(s)||typeof s=="number","size must be a vec2 or number"),p(J(o),"color must be a color"),s=typeof s=="number"?new ot(s,s):s;let c=new ot,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,f=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
-`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,E=S%d,A=S/d|0;l.pos.x=E*h+u,l.pos.y=A*f+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,Pt(c,s,l,o,0,!1,void 0,r,!0,a)}})}};De=b(),Jt=b(),Tr=b(),ve=b(),Ar=0,oi=!0,Bn=!1,tn="mouse",Cr=6,jn=!0,mt=0,oe=!N&&window.ontouchstart!==void 0;Y=[[]],Se=[],gn=[],co=[],Wn=new Ee,re=[],Cn=[],ri=[],Fs=[],Ne=new Map,ms=[],qn=!0;ai="http://www.w3.org/2000/svg";pt=new AudioContext,Zn=44100;xs=class{constructor(t,e,s=xr,i=vr,o){var r;if(!(!Ht||N)){if(p(!t||pe(t)||U(t),"asset must be a file name or zzfx array"),p(e===void 0||P(e),"randomness must be a number"),p(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),p(P(s),"range must be a number"),p(P(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Zn,this.loadedPercent=0,this.onloadCallback=o,pe(t)){let a=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(r=a[l])!=null?r:c,a[l]=0,this.sampleChannels=[Gi(...a)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let a=t;this.loadSound(a)}}}play(t,e=1,s=1,i=1,o=!1,r=!1){if(p(!t||O(t),"pos must be a vec2"),p(P(e),"volume must be a number"),p(P(s),"pitch must be a number"),p(P(i),"randomnessScale must be a number"),!Ht||N||!this.sampleChannels)return;let a;if(t){let u=this.range;if(u){let h=Ct.distanceSquared(t);if(h>u*u)return;e*=Ft(h**.5,u,u*this.taper)}a=Ln(t).x*2/G.width-1}let c=s+s*this.randomness*i*ft(-1,1),l=new ci(this,e,c,a,o,r);return Gt&&Un&&t&&(Ut(t,.5,"#0ff",.5,!0),this.range&&(Ut(t,2*this.range,"#0ff",.5),Ut(t,2*this.range*this.taper,"#0ff",.5)),Mn("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){p(P(t),"semitoneOffset must be a number");let i=gc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await pt.decodeAudioData(s),o=i.numberOfChannels,r=1e5,a=[];for(let l=0;lsetTimeout(v,0));let d=Q(f+r,h);for(;f=0,"Sound volume must be positive or zero"),p(s>=0,"Sound rate must be positive or zero"),p(P(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=a=>{a===this.source&&(this.source=void 0)},r||this.start()}start(t=0){p(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=pt.createGain(),this.source=Ir(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=pt.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){p(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(p(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=pt.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?ie(pt.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};rn=[];Tn=class{constructor(t,e=0,s=!1,i=new wt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new wt}},ui=class extends Ue{constructor(t,e,s=0,i=0,o=b(512),r=!0){var a;p(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,V,i),this.canvas=N?void 0:new OffscreenCanvas(o.x,o.y),this.context=(a=this.canvas)==null?void 0:a.getContext("2d"),this.textureInfo=new Ve(this.canvas,r),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=V,i=0,o=!1,r,a=!1,c){let l=new Pe().setFullImage(this.textureInfo),u=this.hasWebGL();Pt(t,e,l,s,i,o,r,u,a,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return k&&this.textureInfo.hasWebGL()}},vs=class extends ui{constructor(t,e,s=Is(),i=0,o=!0){let r=s?e.multiply(s.size):e;if(super(t,e,0,i,r,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,N){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let a=this.size.area();a--;)this.data.push(new Tn)}setData(t,e,s=!1){if(t=t.floor(),p(O(t),"layerPos must be a Vector2"),p(e instanceof Tn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Tt===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new Tn,e)}getData(t){return p(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!k&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){p(Tt!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&Et(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;p(Tt!==this.context),this.savedRenderSettings=[Tt,I,Ct,q,nn],Tt=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);I=this.size.multiply(e),nn=ye,Ct=this.size.multiply(e).scale(.5),q=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?os(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!An,t&&(this.canvas.width=I.x,this.canvas.height=I.y))}redrawEnd(){this.context&&(p(Tt===this.context),this.isUsingWebGL&&os(),[Tt,I,Ct,q,nn]=this.savedRenderSettings)}drawTileData(t,e=!0){var a,c;if(!this.context)return;p(Tt===this.context,"must call redrawStart() before drawing tiles");let s=(c=(a=this.tileInfo)==null?void 0:a.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let r=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,r,o.color,o.direction*X/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(p(Tt!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=V,o=0,r,a){let c=t.add(e.scale(.5));Pt(c,e,s,i,o,r,a,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new wt,o=0,r=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let a=I;I=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&os(this.textureInfo.glTexture);let l=c?void 0:this.context;Pt(t,e,s,i,o,r,void 0,c,!0,l),c&&os(),I=a}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){p(Tt===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Cc(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},Ss=class extends vs{constructor(t,e,s=Is(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),rn.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=rn.indexOf(this);p(t>=0,"tile collision layer not found in array"),t>=0&&rn.splice(t,1),super.destroy()}initCollision(t){p(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){p(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){p(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new ot,s){p(O(t)&&O(e),"pos and size must be Vector2s"),p(!s||typeof s=="function"||s instanceof Ue,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(f,d)=>s(f,d):(f,d)=>s.collideWithTile(f,d):()=>!0,o=t.x-this.pos.x,r=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||r+e.y/2<0||r-e.y/2>this.size.y)return!1;let a=$(o-e.x/2|0,0),c=$(r-e.y/2|0,0),l=Q($(o+e.x/2,a+1),this.size.x),u=Q($(r+e.y/2,c+1),this.size.y),h=new ot;for(let f=c;fs(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,r=l=>{let u=this.getCollisionData(a.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},a=new ot,c=qa(t,e,r,i);if(fe&&c){let l=c.floor().add(b(.5));bt(l,b(1),"#f008"),Te(t,e,"#00f",.02),Te(t,c,"#f00",.02),nr(c,"#0f0"),i&&Te(c,c.add(i),"#ff0",.02)}return c}},vo=class extends Ue{constructor(t,e,s=0,i=0,o=100,r=X,a,c=V,l=V,u=cn,h=cn,f=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,E=X,A=.1,T=.2,R=!1,M=!1,Z=!0,it=M?1e9:0,ht=!1){super(t,b(),a,e,void 0,it),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=r,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=Z,this.particleTime=f,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=E,this.fadeRate=A,this.randomness=T,this.collideTiles=R,this.additive=M,this.localSpace=ht,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&Zs){let s=1/this.emitRate/Zs;for(this.emitTimeBuffer+=tr;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*ft(s,-s),o=i(this.particleTime),r=i(this.sizeStart),a=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Xa(),u=ft(this.emitConeAngle,-this.emitConeAngle),h=po(this.colorStartA,this.colorStartB,this.randomColorLinear),f=po(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*nt(d),c*at(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new hi(this,t,e,h,f,o,r,a,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new ot,hi=class{constructor(t,e,s,i,o,r,a,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(a),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=r,this.sizeStart=a,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=Kt,this.mirror=Ha(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,r=t.gravityScale,a=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&Kt-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Vt.x*r,this.pos.y+=this.velocity.y+=Vt.y*r,this.angle+=this.angleVelocity*=s,!Ii||!a)return;let u=this.velocity.lengthSquared();if(u>Fe*Fe){let f=Fe/u**.5;this.velocity.x*=f,this.velocity.y*=f}this.groundObject=void 0;let h=c?f=>{let d=li(f);return d&&c(this,d,f)}:f=>li(f)>0;if(h(this.pos)){let f=Qe(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=$(i,f.restitution),v=$(o,f.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Vt.y<0||this.velocity.y>0&&Vt.y>0)&&(this.groundObject=f),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),de&&bt(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,r=this.lifeTime>0?Q((Kt-this.spawnTime)/this.lifeTime,1):1,a=1-r,c=a*this.sizeStart+r*this.sizeEnd,l=b(c),u=r1-o?(1-r)/o:1;this.color.r=a*this.colorStart.r+r*this.colorEnd.r,this.color.g=a*this.colorStart.g+r*this.colorEnd.g,this.color.b=a*this.colorStart.b+r*this.colorEnd.b,this.color.a=(a*this.colorStart.a+r*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),f=this.angle;if(e){let d=t.angle,y=at(-d),x=nt(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),f+=d}if(s&&ps(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=$(l.x,x),f=sr(d.x,d.y),Pt(h,l,this.tileInfo,this.color,f,this.mirror)}}else Pt(h,l,this.tileInfo,this.color,f,this.mirror);s&&ps(!1),vn&&bt(h,l,"#f005",0,f)}},Mr=!0,Ao=!0,gi=5e5,Gr=11,mc=Gr*4,Wh=gi/mc|0,Fi=3,bc=Fi*4,Jn=gi/bc|0;pn=!1,yi=5,Nn=.5,mi=b(640,80),Ur=!1,Cs={},qs=[];xi=class{constructor(t,e,s="",i="\u{1F3C6}",o){p(t>=0&&!Cs[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),Cs[t]=this}unlock(){Ur||this.unlocked||(p(bi,"save name must be set"),this.unlocked=!0,Vr(),qs.push(this))}render(t=0){let e=ut,s=Q(mi.x,G.width),i=mi.y,o=G.width-s,r=-i*t,a=Ge(0,0,.9);e.save(),e.beginPath(),e.fillStyle=a.toString(),e.strokeStyle=st.toString(),e.lineWidth=3,e.rect(o,r,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,r+i/2),l);let u=i*.5,h=i*.3,f=b(o+l+2*c.x,r+c.y*2+u/2),d=s-l-3*c.x;on(this.name,f,u,st,0,void 0,"left",void 0,void 0,d),f.y=r+i-c.y*2-h/2,on(this.description,f,h,st,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?ut.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):on(this.icon,t,e*.7,st)}};_o=class extends xi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Es&&Es.unlockMedal(this.id)}},Ro=class{constructor(t,e,s){var c,l,u;p(!Es,"there can only be one newgrounds object"),p(!e||s,"must provide cryptojs if there is a cipher"),Es=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){pn&&xt("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],pn&&xt(this.medals);for(let h of this.medals){let f=Cs[h.id];f&&(f.image=new Image,f.image.src=h.icon,f.name=h.name,f.description=h.description,f.unlocked=h.unlocked,f.difficulty=h.difficulty,f.value=h.value,f.value&&(f.description=f.description+` (${f.value})`))}let r=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=r==null?void 0:r.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],pn&&xt(this.scoreboards);let a=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),a)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),f=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(f.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},r=new FormData;r.append("input",JSON.stringify(o));let a=new XMLHttpRequest;a.open("POST","https://newgrounds.io/gateway_v3.php",!pn&&s);try{a.send(r)}catch(l){pn&&xt("newgrounds call failed",l);return}return pn&&xt(a.responseText),a.responseText&&JSON.parse(a.responseText)}},Po=class{constructor(t,e=!1,s=!1){p(!It,"Post process already initialized"),p(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),It=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),_n(void 0,a,o,r);function i(){if(N)return;if(!k){console.warn("PostProcessPlugin: WebGL not enabled!");return}It.texture=ji(),It.shader=Yn(`#version 300 es
+color = `+this.color),t}renderDebugInfo(){if(!Ft)return;let t=this.collideTiles||this.collideSolidObjects||this.isSolid;if(!t&&!this.parent)return;let e=b($(this.size.x,.2),$(this.size.y,.2)),s=z(this.collideTiles?1:0,this.collideSolidObjects?1:0,this.isSolid?1:0,.5);bt(this.pos,e,s,0,this.angle,t),this.parent&&bt(this.pos,e.scale(.8),z(1,1,1,.5),0,this.angle),this.parent&&Te(this.pos,this.parent.pos,z(1,1,1,.5),.5)}},I=b(),un=[];Pe=class n{constructor(t=b(),e=Li,s=un[0],i=Oi,o=Di){this.pos=t.copy(),this.size=e.copy(),this.padding=i,this.textureInfo=s,this.bleed=o}offset(t){return new n(this.pos.add(t),this.size,this.textureInfo,this.padding,this.bleed)}frame(t){p(typeof t=="number");let e=this.size.x+this.padding*2,s=t*e;return p(s+this.size.x<=this.textureInfo.size.x,"frame extends beyond texture width!"),this.offset(new rt(s))}setFullImage(t=this.textureInfo){return this.textureInfo=t,this.pos=new rt,this.size=t.size.copy(),this.bleed=this.padding=0,this}tile(t){return Is(t,this.size,this.textureInfo,this.padding,this.bleed)}},We=class{constructor(t,e=!0,s=!1){this.image=t,this.size=t?b(t.width,t.height):b(),this.sizeInverse=t?b(1/t.width,1/t.height):b(),this.glTexture=void 0,this.wrap=s,e&&this.createWebGLTexture()}createWebGLTexture(){Hh(this)}destroyWebGLTexture(){Xh(this)}hasWebGL(){return!!this.glTexture}setWrap(t=!0){this.wrap=t,Sc(this.glTexture,t)}};nh=0;ii=class{constructor(t){p(!!t,"tileInfo is required for ImageFont"),this.tileInfo=t.frame(0)}drawText(t,e,s=1,i,o,r,a){p(O(s)||typeof s=="number","size must be a vec2 or number"),typeof s=="number"?(p(s>0),s*=q,s=new rt(s,s)):s=s.scale(q),this.drawTextScreen(t,Ln(e),s,i,o,r,a)}drawTextScreen(t,e,s,i=!0,o=V,r=k,a){p(U(t),"text must be a string"),p(O(e),"pos must be a vec2"),p(O(s)||typeof s=="number","size must be a vec2 or number"),p(J(o),"color must be a color"),s=typeof s=="number"?new rt(s,s):s;let c=new rt,l=this.tileInfo,u=l.padding,h=l.size.x+u*2,f=l.size.y+u*2,d=l.textureInfo.size.x/h|0;(t+"").split(`
+`).forEach((y,x)=>{let v=i?(y.length-1)*s.x/2:0;for(let w=y.length;w--;){let _=y.charCodeAt(w),S=_<32||_>127?95:_-32,E=S%d,A=S/d|0;l.pos.x=E*h+u,l.pos.y=A*f+u,c.x=e.x+w*s.x-v|0,c.y=e.y+x*s.y|0,Lt(c,s,l,o,0,!1,void 0,r,!0,a)}})}};Ie=b(),Ut=b(),Tr=b(),ve=b(),Ar=0,oi=!0,Bn=!1,tn="mouse",Cr=6,jn=!0,mt=0,oe=!N&&window.ontouchstart!==void 0;Y=[[]],Se=[],gn=[],co=[],Wn=new Ee,re=[],Cn=[],ri=[],Fs=[],Be=new Map,ms=[],qn=!0;ai="http://www.w3.org/2000/svg";pt=new AudioContext,Zn=44100;xs=class{constructor(t,e,s=xr,i=vr,o){var r;if(!(!Xt||N)){if(p(!t||pe(t)||U(t),"asset must be a file name or zzfx array"),p(e===void 0||P(e),"randomness must be a number"),p(e===void 0||e>=0&&e<=1,"randomness must be between 0 and 1"),p(P(s),"range must be a number"),p(P(i),"taper must be a number"),this.range=s,this.taper=i,this.randomness=e!=null?e:0,this.sampleRate=Zn,this.loadedPercent=0,this.onloadCallback=o,pe(t)){let a=t.slice(),c=e!=null?e:.05,l=1;this.randomness=(r=a[l])!=null?r:c,a[l]=0,this.sampleChannels=[Gi(...a)],this.loadedPercent=1,o==null||o(this)}else if(typeof t=="string"){let a=t;this.loadSound(a)}}}play(t,e=1,s=1,i=1,o=!1,r=!1){if(p(!t||O(t),"pos must be a vec2"),p(P(e),"volume must be a number"),p(P(s),"pitch must be a number"),p(P(i),"randomnessScale must be a number"),!Xt||N||!this.sampleChannels)return;let a;if(t){let u=this.range;if(u){let h=Ct.distanceSquared(t);if(h>u*u)return;e*=jt(h**.5,u,u*this.taper)}a=Ln(t).x*2/G.width-1}let c=s+s*this.randomness*i*ft(-1,1),l=new ci(this,e,c,a,o,r);return Ft&&Un&&t&&(Vt(t,.5,"#0ff",.5,!0),this.range&&(Vt(t,2*this.range,"#0ff",.5),Vt(t,2*this.range*this.taper,"#0ff",.5)),Mn("vol "+e.toFixed(2)+" pitch "+c.toFixed(2),t,.5,"#0ff",.5)),l}playMusic(t=1,e=!0,s=!1){return this.play(void 0,t,1,0,e,s)}playNote(t=0,e,s){p(P(t),"semitoneOffset must be a number");let i=gc(t,1);return this.play(e,s,i,0)}getDuration(){var t,e;return((e=(t=this.sampleChannels)==null?void 0:t[0])==null?void 0:e.length)/this.sampleRate||0}isLoaded(){return this.loadedPercent===1}async loadSound(t){var c;let e=await fetch(t);if(!e.ok)throw new Error(`Failed to load sound from ${t}: ${e.status} ${e.statusText}`);let s=await e.arrayBuffer(),i=await pt.decodeAudioData(s),o=i.numberOfChannels,r=1e5,a=[];for(let l=0;lsetTimeout(v,0));let d=Q(f+r,h);for(;f=0,"Sound volume must be positive or zero"),p(s>=0,"Sound rate must be positive or zero"),p(P(i),"Sound pan must be a number"),this.sound=t,this.volume=e,this.rate=s,this.pan=i,this.loop=o,this.pausedTime=0,this.startTime=void 0,this.gainNode=void 0,this.source=void 0,this.onendedCallback=a=>{a===this.source&&(this.source=void 0)},r||this.start()}start(t=0){p(t>=0,"Sound start offset must be positive or zero"),this.isPlaying()&&this.stop(),this.gainNode=pt.createGain(),this.source=Ir(this.sound.sampleChannels,this.volume,this.rate,this.pan,this.loop,this.sound.sampleRate,this.gainNode,t,this.onendedCallback),this.source?(this.startTime=pt.currentTime-t,this.pausedTime=void 0):(this.startTime=void 0,this.pausedTime=0)}setVolume(t){p(t>=0,"Sound volume must be positive or zero"),this.volume=t,this.gainNode&&(this.gainNode.gain.value=t)}stop(t=0){if(p(t>=0,"Sound fade time must be positive or zero"),this.isPlaying())if(t){let e=pt.currentTime,s=e+t;this.gainNode.gain.cancelScheduledValues(e),this.gainNode.gain.setValueAtTime(this.volume,e),this.gainNode.gain.linearRampToValueAtTime(0,s),this.source.stop(s)}else this.source.stop();this.pausedTime=0,this.source=void 0,this.startTime=void 0}pause(){this.isPaused()||(this.pausedTime=this.getCurrentTime(),this.source.stop(),this.source=void 0,this.startTime=void 0)}resume(){this.isPaused()&&this.start(this.pausedTime)}isPlaying(){return!!this.source}isPaused(){return!this.isPlaying()}getCurrentTime(){if(!this.isPlaying())return this.pausedTime;let t=this.getDuration();return t?ie(pt.currentTime-this.startTime,t):0}getDuration(){return this.rate?this.sound.getDuration()/this.rate:0}getSource(){return this.source}};rn=[];Tn=class{constructor(t,e=0,s=!1,i=new wt){this.tile=t,this.direction=e,this.mirror=s,this.color=i.copy()}clear(){this.tile=this.direction=0,this.mirror=!1,this.color=new wt}},ui=class extends Ve{constructor(t,e,s=0,i=0,o=b(512),r=!0){var a;p(O(o),"canvasSize must be a Vector2"),super(t,e,void 0,s,V,i),this.canvas=N?void 0:new OffscreenCanvas(o.x,o.y),this.context=(a=this.canvas)==null?void 0:a.getContext("2d"),this.textureInfo=new We(this.canvas,r),this.mass=0}destroy(){this.destroyed||(this.textureInfo.destroyWebGLTexture(),super.destroy())}render(){this.draw(this.pos,this.size,this.color,this.angle,this.mirror,this.additiveColor)}draw(t,e,s=V,i=0,o=!1,r,a=!1,c){let l=new Pe().setFullImage(this.textureInfo),u=this.hasWebGL();Lt(t,e,l,s,i,o,r,u,a,c)}updateWebGL(){this.textureInfo.createWebGLTexture()}hasWebGL(){return k&&this.textureInfo.hasWebGL()}},vs=class extends ui{constructor(t,e,s=Is(),i=0,o=!0){let r=s?e.multiply(s.size):e;if(super(t,e,0,i,r,o),this.tileInfo=void 0,this.data=[],this.isUsingWebGL=!1,N){this.render=()=>{},this.redraw=()=>{},this.redrawStart=()=>{},this.redrawEnd=()=>{},this.drawTileData=()=>{},this.redrawTileData=()=>{},this.drawLayerTile=()=>{},this.drawLayerRect=()=>{},this.drawTile=()=>{},this.drawRect=()=>{},this.clearLayerRect=()=>{};return}s&&(this.tileInfo=s.frame(0),this.tileInfo.bleed=0);for(let a=this.size.area();a--;)this.data.push(new Tn)}setData(t,e,s=!1){if(t=t.floor(),p(O(t),"layerPos must be a Vector2"),p(e instanceof Tn,"data must be a TileLayerData"),!t.arrayCheck(this.size)||(this.data[(t.y|0)*this.size.x+(t.x|0)]=e,!s))return;Tt===this.context?this.drawTileData(t):this.redrawTileData(t)}clearData(t,e=!1){this.setData(t,new Tn,e)}getData(t){return p(O(t),"layerPos must be a Vector2"),t.arrayCheck(this.size)?this.data[(t.y|0)*this.size.x+(t.x|0)]:void 0}update(){!k&&this.isUsingWebGL&&(this.isUsingWebGL=!1,this.redraw())}render(){p(Tt!==this.context,"must call redrawEnd() after drawing tiles!");let t=this.drawSize||this.size,e=this.pos.add(t.scale(.5));this.draw(e,this.size,this.color,this.angle,this.mirror,this.additiveColor)}onRedraw(){}redraw(){this.redrawStart(!0);for(let t=this.size.x;t--;)for(let e=this.size.y;e--;)this.drawTileData(b(t,e),!1);this.isUsingWebGL&&Et(),this.onRedraw(),this.redrawEnd()}redrawStart(t=!1){var s,i;if(!this.context)return;p(Tt!==this.context),this.savedRenderSettings=[Tt,I,Ct,q,nn],Tt=this.context;let e=(i=(s=this.tileInfo)==null?void 0:s.size)!=null?i:b(1);I=this.size.multiply(e),nn=ye,Ct=this.size.multiply(e).scale(.5),q=1,this.isUsingWebGL=this.hasWebGL(),this.isUsingWebGL?os(this.textureInfo.glTexture,t):(this.context.imageSmoothingEnabled=!An,t&&(this.canvas.width=I.x,this.canvas.height=I.y))}redrawEnd(){this.context&&(p(Tt===this.context),this.isUsingWebGL&&os(),[Tt,I,Ct,q,nn]=this.savedRenderSettings)}drawTileData(t,e=!0){var a,c;if(!this.context)return;p(Tt===this.context,"must call redrawStart() before drawing tiles");let s=(c=(a=this.tileInfo)==null?void 0:a.size)!=null?c:b(1),i=t.multiply(s);e&&this.clearLayerRect(i,s);let o=this.getData(t);if(!o||!o.tile)return;let r=this.tileInfo&&this.tileInfo.tile(o.tile);this.drawLayerTile(i,s,r,o.color,o.direction*X/2,o.mirror)}redrawTileData(t,e=!0){this.context&&(p(Tt!==this.context,"redrawStart() should not be active when calling redrawTileData(), instead use drawTileData()"),this.redrawStart(),this.drawTileData(t,e),this.redrawEnd())}drawLayerTile(t,e=b(1),s,i=V,o=0,r,a){let c=t.add(e.scale(.5));Lt(c,e,s,i,o,r,a,this.isUsingWebGL)}drawLayerRect(t,e,s,i=0){this.drawLayerTile(t,e,void 0,s,i)}drawTile(t,e=b(1),s,i=new wt,o=0,r=!1){t=t.subtract(this.pos).multiply(this.tileInfo.size),e=e.multiply(this.tileInfo.size),t.y=this.canvas.height-t.y;let a=I;I=b(this.canvas.width,this.canvas.height);let c=this.hasWebGL();c&&os(this.textureInfo.glTexture);let l=c?void 0:this.context;Lt(t,e,s,i,o,r,void 0,c,!0,l),c&&os(),I=a}drawRect(t,e,s,i){this.drawTile(t,e,void 0,s,i)}clearLayerRect(t,e){p(Tt===this.context,"must call redrawStart() before clearing tiles");let s=t.x,i=this.canvas.height-t.y-e.y;this.hasWebGL()?Cc(s,i,e.x,e.y):this.context.clearRect(s,i,e.x,e.y)}},Ss=class extends vs{constructor(t,e,s=Is(),i=0,o=!0){super(t,e.floor(),s,i,o),this.collisionData=[],this.initCollision(this.size),rn.push(this),this.isSolid=!0}destroy(){if(this.destroyed)return;let t=rn.indexOf(this);p(t>=0,"tile collision layer not found in array"),t>=0&&rn.splice(t,1),super.destroy()}initCollision(t){p(O(t),"size must be a Vector2"),this.size=t.floor(),this.collisionData=[],this.collisionData.length=t.area(),this.collisionData.fill(0)}setCollisionData(t,e=1){p(O(t),"layerPos must be a Vector2");let s=(t.y|0)*this.size.x+(t.x|0);t.arrayCheck(this.size)&&(this.collisionData[s]=e)}clearCollisionData(t){this.setCollisionData(t,0)}getCollisionData(t){p(O(t),"layerPos must be a Vector2");let e=(t.y|0)*this.size.x+(t.x|0);return t.arrayCheck(this.size)?this.collisionData[e]:0}collisionTest(t,e=new rt,s){p(O(t)&&O(e),"pos and size must be Vector2s"),p(!s||typeof s=="function"||s instanceof Ve,"callbackObject must be a function or EngineObject");let i=s?typeof s=="function"?(f,d)=>s(f,d):(f,d)=>s.collideWithTile(f,d):()=>!0,o=t.x-this.pos.x,r=t.y-this.pos.y;if(o+e.x/2<0||o-e.x/2>this.size.x||r+e.y/2<0||r-e.y/2>this.size.y)return!1;let a=$(o-e.x/2|0,0),c=$(r-e.y/2|0,0),l=Q($(o+e.x/2,a+1),this.size.x),u=Q($(r+e.y/2,c+1),this.size.y),h=new rt;for(let f=c;fs(l,u):(l,u)=>s.collideWithTile(l,u):l=>l>0,r=l=>{let u=this.getCollisionData(a.set(l.x-this.pos.x,l.y-this.pos.y));return u&&o(u,l)},a=new rt,c=qa(t,e,r,i);if(fe&&c){let l=c.floor().add(b(.5));bt(l,b(1),"#f008"),Te(t,e,"#00f",.02),Te(t,c,"#f00",.02),nr(c,"#0f0"),i&&Te(c,c.add(i),"#ff0",.02)}return c}},vo=class extends Ve{constructor(t,e,s=0,i=0,o=100,r=X,a,c=V,l=V,u=cn,h=cn,f=.5,d=.1,y=1,x=.1,v=.05,w=1,_=1,S=0,E=X,A=.1,T=.2,R=!1,M=!1,Z=!0,it=M?1e9:0,ht=!1){super(t,b(),a,e,void 0,it),this.emitCircle=typeof s=="number",this.emitSize=typeof s=="number"?b(s):s.copy(),this.emitTime=i,this.emitRate=o,this.emitConeAngle=r,this.colorStartA=c.copy(),this.colorStartB=l.copy(),this.colorEndA=u.copy(),this.colorEndB=h.copy(),this.randomColorLinear=Z,this.particleTime=f,this.sizeStart=d,this.sizeEnd=y,this.speed=x,this.angleSpeed=v,this.damping=w,this.angleDamping=_,this.gravityScale=S,this.particleConeAngle=E,this.fadeRate=A,this.randomness=T,this.collideTiles=R,this.additive=M,this.localSpace=ht,this.trailScale=0,this.particleCreateCallback=void 0,this.particleDestroyCallback=void 0,this.particleCollideCallback=void 0,this.velocityInheritance=0,this.emitTimeBuffer=0,this.particles=[],this.previousAngle=this.angle,this.previousPos=this.pos.copy()}update(){if(p(this.angleDamping>=0&&this.angleDamping<=1),p(this.damping>=0&&this.damping<=1),this.velocityInheritance){let s=this.velocityInheritance;this.velocity.x=s*(this.pos.x-this.previousPos.x),this.velocity.y=s*(this.pos.y-this.previousPos.y),this.angleVelocity=s*(this.angle-this.previousAngle),this.previousAngle=this.angle,this.previousPos.x=this.pos.x,this.previousPos.y=this.pos.y}if(this.isActive()){if(this.emitRate&&Zs){let s=1/this.emitRate/Zs;for(this.emitTimeBuffer+=tr;this.emitTimeBuffer>0;this.emitTimeBuffer-=s)this.emitParticle()}}else this.particles.length===0&&this.destroy(!0);let t=this.particles,e=0;for(let s=0;s_+_*ft(s,-s),o=i(this.particleTime),r=i(this.sizeStart),a=i(this.sizeEnd),c=i(this.speed),l=i(this.angleSpeed)*Xa(),u=ft(this.emitConeAngle,-this.emitConeAngle),h=po(this.colorStartA,this.colorStartB,this.randomColorLinear),f=po(this.colorEndA,this.colorEndB,this.randomColorLinear),d=this.localSpace?u:this.angle+u,y=b(c*nt(d),c*ct(d)),x=l;!this.localSpace&&this.velocityInheritance>0&&(y.x+=this.velocity.x,y.y+=this.velocity.y,x+=this.angleVelocity);let v=new hi(this,t,e,h,f,o,r,a,y,x);return this.particles.push(v),(w=this.particleCreateCallback)==null||w.call(this,v),v}updatePhysics(){}render(){for(let t of this.particles)t.render()}isActive(){return!this.emitTime||this.getAliveTime()0&&(this.destroyed=!1,this.emitTime=-1))}},Vh=new rt,hi=class{constructor(t,e,s,i,o,r,a,c,l=b(),u=0){this.emitter=t,this.pos=e,this.angle=s,this.size=b(a),this.color=i.copy(),this.colorStart=i,this.colorEnd=o,this.lifeTime=r,this.sizeStart=a,this.sizeEnd=c,this.velocity=l,this.angleVelocity=u,this.spawnTime=Qt,this.mirror=Ha(),this.groundObject=void 0,this.destroyed=!1,this.tileInfo=t.tileInfo}update(){let t=this.emitter,e=t.damping,s=t.angleDamping,i=t.restitution,o=t.friction,r=t.gravityScale,a=t.collideTiles,c=t.particleCollideCallback;if(this.lifeTime>0&&Qt-this.spawnTime>this.lifeTime){this.destroy();return}let l=this.pos.copy();if(this.velocity.x*=e,this.velocity.y*=e,this.pos.x+=this.velocity.x+=Wt.x*r,this.pos.y+=this.velocity.y+=Wt.y*r,this.angle+=this.angleVelocity*=s,!Ii||!a)return;let u=this.velocity.lengthSquared();if(u>je*je){let f=je/u**.5;this.velocity.x*=f,this.velocity.y*=f}this.groundObject=void 0;let h=c?f=>{let d=li(f);return d&&c(this,d,f)}:f=>li(f)>0;if(h(this.pos)){let f=Qe(this.pos);if(!h(l)){let d=h(b(this.pos.x,l.y)),y=h(b(l.x,this.pos.y)),x=$(i,f.restitution),v=$(o,f.friction);d&&(this.pos.x=l.x,this.velocity.x*=-x,this.velocity.y*=v),(y||!d)&&((this.velocity.y<0&&Wt.y<0||this.velocity.y>0&&Wt.y>0)&&(this.groundObject=f),this.pos.y=l.y,this.velocity.y*=-x,this.velocity.x*=v),de&&bt(this.pos,this.size,"#f00")}}}destroy(){let t=this.emitter.particleDestroyCallback,e=this.colorEnd;this.color.set(e.r,e.g,e.b,e.a),this.size.set(this.sizeEnd,this.sizeEnd),this.destroyed=!0,t==null||t(this)}render(){let t=this.emitter,e=t.localSpace,s=t.additive,i=t.trailScale,o=t.fadeRate/2,r=this.lifeTime>0?Q((Qt-this.spawnTime)/this.lifeTime,1):1,a=1-r,c=a*this.sizeStart+r*this.sizeEnd,l=b(c),u=r1-o?(1-r)/o:1;this.color.r=a*this.colorStart.r+r*this.colorEnd.r,this.color.g=a*this.colorStart.g+r*this.colorEnd.g,this.color.b=a*this.colorStart.b+r*this.colorEnd.b,this.color.a=(a*this.colorStart.a+r*this.colorEnd.a)*u;let h=Vh.set(this.pos.x,this.pos.y),f=this.angle;if(e){let d=t.angle,y=ct(-d),x=nt(-d);h.set(t.pos.x+h.x*y-h.y*x,t.pos.y+h.x*x+h.y*y),f+=d}if(s&&ps(),i){let d=e?this.velocity.rotate(t.angle):this.velocity,y=d.length();if(y){let x=y*i;l.y=$(l.x,x),f=sr(d.x,d.y),Lt(h,l,this.tileInfo,this.color,f,this.mirror)}}else Lt(h,l,this.tileInfo,this.color,f,this.mirror);s&&ps(!1),vn&&bt(h,l,"#f005",0,f)}},Mr=!0,Ao=!0,gi=5e5,Gr=11,mc=Gr*4,Wh=gi/mc|0,Fi=3,bc=Fi*4,Jn=gi/bc|0;pn=!1,yi=5,Nn=.5,mi=b(640,80),Ur=!1,Cs={},qs=[];xi=class{constructor(t,e,s="",i="\u{1F3C6}",o){p(t>=0&&!Cs[t]),this.id=t,this.name=e,this.description=s,this.icon=i,this.unlocked=!1,this.image=void 0,o&&((this.image=new Image).src=o),Cs[t]=this}unlock(){Ur||this.unlocked||(p(bi,"save name must be set"),this.unlocked=!0,Vr(),qs.push(this))}render(t=0){let e=ut,s=Q(mi.x,G.width),i=mi.y,o=G.width-s,r=-i*t,a=Fe(0,0,.9);e.save(),e.beginPath(),e.fillStyle=a.toString(),e.strokeStyle=st.toString(),e.lineWidth=3,e.rect(o,r,s,i),e.fill(),e.stroke(),e.clip();let c=b(.1,.05).scale(i),l=i-2*c.x;this.renderIcon(b(o+c.x+l/2,r+i/2),l);let u=i*.5,h=i*.3,f=b(o+l+2*c.x,r+c.y*2+u/2),d=s-l-3*c.x;on(this.name,f,u,st,0,void 0,"left",void 0,void 0,d),f.y=r+i-c.y*2-h/2,on(this.description,f,h,st,0,void 0,"left",void 0,void 0,d),e.restore()}renderIcon(t,e){this.image?ut.drawImage(this.image,t.x-e/2,t.y-e/2,e,e):on(this.icon,t,e*.7,st)}};_o=class extends xi{constructor(t,e,s,i,o){super(t,e,s,i,o)}unlock(){super.unlock(),Es&&Es.unlockMedal(this.id)}},Ro=class{constructor(t,e,s){var c,l,u;p(!Es,"there can only be one newgrounds object"),p(!e||s,"must provide cryptojs if there is a cipher"),Es=this,this.app_id=t,this.cipher=e,this.cryptoJS=s,this.host=location?location.hostname:"";let i=new URL(location.href);if(this.session_id=i.searchParams.get("ngio_session_id"),!this.session_id)return;let o=this.call("Medal.getList");if(!o||!o.result||o.result.error){pn&&xt("Newgrounds session unavailable; skipping plugin init"),this.medals=[],this.scoreboards=[];return}this.medals=((c=o.result.data)==null?void 0:c.medals)||[],pn&&xt(this.medals);for(let h of this.medals){let f=Cs[h.id];f&&(f.image=new Image,f.image.src=h.icon,f.name=h.name,f.description=h.description,f.unlocked=h.unlocked,f.difficulty=h.difficulty,f.value=h.value,f.value&&(f.description=f.description+` (${f.value})`))}let r=this.call("ScoreBoard.getBoards");this.scoreboards=((u=(l=r==null?void 0:r.result)==null?void 0:l.data)==null?void 0:u.scoreboards)||[],pn&&xt(this.scoreboards);let a=60*1e3;setInterval(()=>this.call("Gateway.ping",0,!0),a)}unlockMedal(t){return this.call("Medal.unlock",{id:t},!0)}postScore(t,e){return this.call("ScoreBoard.postScore",{id:t,value:e},!0)}getScores(t,e,s=0,i=0,o=10){return this.call("ScoreBoard.getScores",{id:t,user:e,social:s,skip:i,limit:o})}logView(){return this.call("App.logView",{host:this.host},!0)}call(t,e,s=!1){let i={component:t,parameters:e};if(this.cipher){let l=this.cryptoJS,u=l.enc.Base64.parse(this.cipher),h=l.lib.WordArray.random(16),f=l.AES.encrypt(JSON.stringify(i),u,{iv:h});i.secure=l.enc.Base64.stringify(h.concat(f.ciphertext)),i.parameters=0}let o={app_id:this.app_id,session_id:this.session_id,call:i},r=new FormData;r.append("input",JSON.stringify(o));let a=new XMLHttpRequest;a.open("POST","https://newgrounds.io/gateway_v3.php",!pn&&s);try{a.send(r)}catch(l){pn&&xt("newgrounds call failed",l);return}return pn&&xt(a.responseText),a.responseText&&JSON.parse(a.responseText)}},Po=class{constructor(t,e=!1,s=!1){p(!Mt,"Post process already initialized"),p(!(e&&s),"Post process cannot both include main canvas and use feedback texture"),Mt=this,t||(t="void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}"),this.shader=void 0,this.texture=void 0,this.vao=void 0,i(),_n(void 0,a,o,r);function i(){if(N)return;if(!k){console.warn("PostProcessPlugin: WebGL not enabled!");return}Mt.texture=ji(),Mt.shader=Yn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
 precision highp float;uniform sampler2D iChannel0;uniform vec3 iResolution;uniform float iTime;out vec4 c;
 `+t+`
-void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),It.vao=g.createVertexArray(),g.bindVertexArray(It.vao),g.bindBuffer(g.ARRAY_BUFFER,zn);let c=8,l=g.getAttribLocation(It.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){It.shader=void 0,It.texture=void 0,xt("PostProcessPlugin: WebGL context lost")}function r(){i(),xt("PostProcessPlugin: WebGL context restored")}function a(){if(N||!k)return;Et(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(It.shader),g.bindVertexArray(It.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,It.texture),e?(Be.width=I.x,Be.height=I.y,Nr(Ze),Ze.drawImage(G,0,0),G.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,Be)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,tt);let c=l=>g.getUniformLocation(It.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),Kt),g.uniform3f(c("iResolution"),G.width,G.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,tt),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),Ts(!0)}}},Lo=class{constructor(t,e){p(!W,"LightSystemPlugin already initialized"),p(!It,"LightSystemPlugin must be created before PostProcessPlugin"),W=this,this.enabled=!0,this.ambientColor=(e||st).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),_n(void 0,i,o,r);function s(){if(N)return;if(!k){console.warn("LightSystemPlugin: WebGL not enabled!");return}W.textureSize||(W.textureSize=I.copy()),W.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,W.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,W.textureSize.x,W.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),W.lightShader=Yn(`#version 300 es
+void main(){mainImage(c,gl_FragCoord.xy);c.a=1.;}`),Mt.vao=g.createVertexArray(),g.bindVertexArray(Mt.vao),g.bindBuffer(g.ARRAY_BUFFER,zn);let c=8,l=g.getAttribLocation(Mt.shader,"p");g.enableVertexAttribArray(l),g.vertexAttribPointer(l,2,g.FLOAT,!1,c,0)}function o(){Mt.shader=void 0,Mt.texture=void 0,xt("PostProcessPlugin: WebGL context lost")}function r(){i(),xt("PostProcessPlugin: WebGL context restored")}function a(){if(N||!k)return;Et(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.useProgram(Mt.shader),g.bindVertexArray(Mt.vao),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!0),g.disable(g.BLEND),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,Mt.texture),e?(ze.width=I.x,ze.height=I.y,Nr(Ze),Ze.drawImage(G,0,0),G.width|=0,g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,ze)):s||g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,tt);let c=l=>g.getUniformLocation(Mt.shader,l);g.uniform1i(c("iChannel0"),0),g.uniform1f(c("iTime"),Qt),g.uniform3f(c("iResolution"),G.width,G.height,1),g.drawArrays(g.TRIANGLE_STRIP,0,4),s&&g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,tt),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,!1),Ts(!0)}}},Lo=class{constructor(t,e){p(!W,"LightSystemPlugin already initialized"),p(!Mt,"LightSystemPlugin must be created before PostProcessPlugin"),W=this,this.enabled=!0,this.ambientColor=(e||st).copy(),this.textureSize=t?t.copy():void 0,this.texture=void 0,this.lightShader=void 0,this.compositeShader=void 0,this.lightVAO=void 0,this.compositeVAO=void 0,s(),_n(void 0,i,o,r);function s(){if(N)return;if(!k){console.warn("LightSystemPlugin: WebGL not enabled!");return}W.textureSize||(W.textureSize=I.copy()),W.texture=g.createTexture(),g.bindTexture(g.TEXTURE_2D,W.texture),g.texImage2D(g.TEXTURE_2D,0,g.RGBA,W.textureSize.x,W.textureSize.y,0,g.RGBA,g.UNSIGNED_BYTE,null),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.LINEAR),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),W.lightShader=Yn(`#version 300 es
 precision highp float;uniform mat4 m;uniform vec2 lightPos;uniform float radius;in vec2 g;out vec2 vWorldPos;void main(){vec2 worldP=lightPos+(g-.5)*2.*radius;gl_Position=m*vec4(worldP,1,1);vWorldPos=worldP;}`,`#version 300 es
 precision highp float;uniform vec2 lightPos;uniform float radius;uniform float fadeRange;uniform vec4 color;in vec2 vWorldPos;out vec4 c;void main(){float dist=distance(vWorldPos,lightPos);float t=clamp((radius-dist)/max(fadeRange,1e-6),0.,1.);c=vec4(color.rgb*t*color.a,1.);}`),W.compositeShader=Yn(`#version 300 es
 precision highp float;in vec2 p;void main(){gl_Position=vec4(p+p-1.,1,1);}`,`#version 300 es
-precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),W.lightVAO=g.createVertexArray(),g.bindVertexArray(W.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,zn);let a=g.getAttribLocation(W.lightShader,"g");g.enableVertexAttribArray(a),g.vertexAttribPointer(a,2,g.FLOAT,!1,8,0),W.compositeVAO=g.createVertexArray(),g.bindVertexArray(W.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,zn);let c=g.getAttribLocation(W.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(N||!k||!W.enabled||!W.texture)return;Et();let a=Dn,c=W.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,W.texture,0),g.viewport(0,0,W.textureSize.x,W.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),ps(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of vt)u.destroyed||u.renderLight();Et(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y),g.useProgram(W.compositeShader),g.bindVertexArray(W.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,W.texture);let l=W.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),G.width,G.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),Qt&&g.bindTexture(g.TEXTURE_2D,Qt),ps(a),Ts(!0)}function o(){W.texture=void 0,W.lightShader=void 0,W.compositeShader=void 0,W.lightVAO=void 0,W.compositeVAO=void 0,xt("LightSystemPlugin: WebGL context lost")}function r(){s(),xt("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(N||!k||!this.lightShader)return;Et(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*q).divide(I),s=Ct.rotate(-K),i=b(-1).subtract(s.multiply(e)),o=at(K),r=nt(K),a=[e.x*o,e.y*r,0,0,-e.x*r,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,a),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),Ts(!0)}},Oo=class extends Ue{constructor(t,e,s,i){super(t,b(1),void 0,0,s),p(P(e)&&e>=0,"Light radius must be a non-negative number"),p(i===void 0||P(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){W&&W.drawLight(this)}},Do=class extends xs{constructor(t){super(void 0),!(!Ht||N)&&(this.randomness=0,this.sampleChannels=Ec(...t),this.sampleRate=Zn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Wr=0;Io=class{constructor(t=ut){p(!C,"UI system already initialized"),C=this,this.activateOnPress=!1,this.defaultColor=V,this.defaultLineColor=st,this.defaultTextColor=st,this.defaultButtonColor=Ge(0,0,.7),this.defaultHoverColor=Ge(0,0,.9),this.defaultDisabledColor=Ge(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Ps,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=ye,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Ee(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var r;return(r=this._keyInputObject)==null?void 0:r.onKeyDown(o)},_n(s,i);function e(o){let r,a;o.parent?(r=o.parent.nativePos,a=o.parent.size):(r=C.screenToNative(I.scale(.5)),a=C.nativeHeight?b(I.x*C.nativeHeight/I.y,C.nativeHeight):I);let c=o.anchor;o.nativePos=r.add(a.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){C.activeObject&&!C.activeObject.visible&&(C.activeObject=void 0),C.lastHoverObject=C.hoverObject,C.hoverObject=void 0,gs(0)&&(C.navigationMode=!1,C.navigationObject=void 0),C.keyInputObject&&(C.activeObject=C.keyInputObject,C.hoverObject=C.keyInputObject,C.navigationMode=!1,C.navigationObject=void 0);let o=C.getNavigableObjects();if(!o.length)C.navigationObject=void 0;else if(!C.keyInputObject){if(o.includes(C.navigationObject)||(C.navigationObject=void 0),oe||C.navigationMode&&!C.navigationObject&&(C.navigationObject=o.find(a=>a.navigationAutoSelect)),!C.navigationTimer.active()){let a=se(C.getNavigationDirection());if(a){let c;if(C.navigationObject){let l=o.indexOf(C.navigationObject),u=ie(l+a,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=a>0?0:o.length-1;c=o[l]}C.navigationObject!==c&&(C.navigationMode=!0,C.hoverObject=void 0,C.navigationObject=c,C.navigationTimer.set(C.navigationDelay),c.soundPress&&c.soundPress.play())}}C.navigationObject&&C.getNavigationWasPressed()&&C.navigationObject.navigatePressed()}for(let a=C.uiObjects.length;a--;){let c=C.uiObjects[a];c.parent||r(c)}C.uiObjects=C.uiObjects.filter(a=>!a.destroyed);function r(a){if(!(a.destroyed||!a.visible)){e(a);for(let c=a.children.length;c--;){let l=a.children[c];l&&r(l)}a.destroyed||a.update()}}}function i(){let o=C.uiContext;if(o.save(),C.nativeHeight){let a=I.y/C.nativeHeight;o.translate(-a*I.x/2,0),o.scale(a,a),o.translate(I.x/2/a,0)}function r(a){if(a.visible){e(a),a.render();for(let c of a.children)r(c)}}if(C.uiObjects.forEach(a=>a.parent||r(a)),Wr>0){let a=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)a(u,l)};C.uiObjects.forEach(c=>c.parent||a(c))}o.restore()}}drawRect(t,e,s=V,i=0,o=st,r=0,a,c=st,l=0,u=b()){p(O(t),"pos must be a vec2"),p(O(e),"size must be a vec2"),p(J(s),"color must be a color"),p(P(i),"lineWidth must be a number"),p(J(o),"lineColor must be a color"),p(P(r),"cornerRadius must be a number");let h=C.uiContext;if(a){let f=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();f.addColorStop(0,d),f.addColorStop(.5,a.toString()),f.addColorStop(1,d),h.fillStyle=f}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),r&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,r):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=C.defaultLineWidth,i=C.defaultLineColor){p(O(t),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(P(s),"lineWidth must be a number"),p(J(i),"lineColor must be a color");let o=C.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=C.defaultColor,o=0,r=!1,a=st,c=0,l=b()){let u=C.uiContext;(c||l.x||l.y)&&a.a>0&&(u.shadowColor=a.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),Pt(t,e,s,i,o,r,ye,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=C.defaultColor,o=C.defaultLineWidth,r=C.defaultLineColor,a="center",c=C.defaultFont,l="",u=!0,h=void 0,f=st,d=0,y=b()){let x=C.uiContext;f.a>0&&(h&&on(t,e.add(h),s.y,f,o,r,a,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=f.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),on(t,e,s.y,i,o,r,a,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[r,a]of this._dragListeners)document.removeEventListener(r,a);this._dragListeners=[];let o=(r,a)=>{let c=l=>{l.preventDefault(),r&&r(l)};document.addEventListener(a,c),this._dragListeners.push([a,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!C.nativeHeight)return t;let e=I.y/C.nativeHeight,s=1/e,i=t.copy();return i.x+=e*I.x/2,i.x*=s,i.y*=s,i.x-=s*I.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=C.uiObjects.length;s--;){let i=C.uiObjects[s];C.confirmDialog&&i!==C.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=C.navigationDirection===1,e=C.navigationDirection===2;if(Bn){let l=ys(0,mt),u=bo(mt);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",r="ArrowRight";if(e)return Rt(s)||Rt(o)?-1:Rt(i)||Rt(r)?1:0;let a=t?s:o,c=t?i:r;return Rt(a)?-1:Rt(c)?1:0}getNavigationOtherDirection(){if(C.navigationDirection===2)return 0;let t=C.navigationDirection===1;if(Bn){let i=ys(0,mt),o=bo(mt);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return Rt(e)?-1:Rt(s)?1:0}getNavigationWasPressed(){return Bn?Rr(0,mt):Mt("Space")||Mt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){p(!C.confirmDialog);let r=C.navigationDirection;C.navigationDirection=2;let a=new ae(b(),i);C.confirmDialog=a,a.onRender=()=>{let d=Ge(0,0,0,.7);C.drawRect(b(),b(1e9),d)},a.onUpdate=()=>{Mt(o)&&f()},a.isMouseOverlapping=()=>!0;let c=50,l=new vi(b(0,-50),b(i.x-c,70),t);a.addChild(l);let u=new _s(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=Ge(0,1,.5),u.onClick=()=>{f(),e&&e()},a.addChild(u);let h=new _s(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{f(),s&&s()},a.addChild(h);function f(){p(C.confirmDialog===a),a.destroy(),C.confirmDialog=void 0,C.navigationDirection=r,Gs()}}},ae=class{constructor(t=b(),e=b()){var s,i;p(O(t),"ui object pos must be a vec2"),p(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=C.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=C.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=C.defaultTextColor.copy(),this.hoverColor=C.defaultHoverColor.copy(),this.lineColor=C.defaultLineColor.copy(),this.gradientColor=C.defaultGradientColor?C.defaultGradientColor.copy():void 0,this.lineWidth=C.defaultLineWidth,this.cornerRadius=C.defaultCornerRadius,this.font=C.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=C.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=C.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=C.defaultSoundPress,this.soundRelease=C.defaultSoundRelease,this.soundClick=C.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=C.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=C.defaultShadowBlur,this.shadowOffset=(i=C.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),C.uiObjects.push(this)}addChild(t){return p(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){C.activeObject===this&&(C.activeObject=void 0),C.hoverObject===this&&(C.hoverObject=void 0),C.lastHoverObject===this&&(C.lastHoverObject=void 0),C.navigationObject===this&&(C.navigationObject=void 0),C.keyInputObject===this&&(C.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!oi)return!1;let t=oe?this.size.add(b(this.extraTouchSize||0)):this.size,e=C.screenToNative(Jt);return Qs(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===C.activeObject&&(C.activeObject=void 0),this===C.keyInputObject&&(C.keyInputObject=void 0)),C.keyInputObject)return;let t=C.lastHoverObject===this,e=this.isActiveObject(),s=ls(0),i=this.dragActivate?s:gs(0);this.canBeHover&&(C.navigationMode||(i||e||!s&&!oe)&&!C.hoverObject&&this.isMouseOverlapping()&&(C.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||gs(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),C.activeObject&&!e&&C.activeObject.onRelease(),C.activeObject=this,C.activateOnPress&&this.click(!this.soundPress)),C.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Er(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);C.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return C.hoverObject===this}isActiveObject(){return C.activeObject===this}isNavigationObject(){return C.navigationObject===this}isKeyInputObject(){return C.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
+precision highp float;uniform sampler2D s;uniform vec3 iResolution;out vec4 c;void main(){vec2 uv=gl_FragCoord.xy/iResolution.xy;c=vec4(texture(s,uv).rgb,1.);}`),W.lightVAO=g.createVertexArray(),g.bindVertexArray(W.lightVAO),g.bindBuffer(g.ARRAY_BUFFER,zn);let a=g.getAttribLocation(W.lightShader,"g");g.enableVertexAttribArray(a),g.vertexAttribPointer(a,2,g.FLOAT,!1,8,0),W.compositeVAO=g.createVertexArray(),g.bindVertexArray(W.compositeVAO),g.bindBuffer(g.ARRAY_BUFFER,zn);let c=g.getAttribLocation(W.compositeShader,"p");g.enableVertexAttribArray(c),g.vertexAttribPointer(c,2,g.FLOAT,!1,8,0)}function i(){if(N||!k||!W.enabled||!W.texture)return;Et();let a=Dn,c=W.ambientColor;g.bindFramebuffer(g.FRAMEBUFFER,kr),g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,W.texture,0),g.viewport(0,0,W.textureSize.x,W.textureSize.y),g.clearColor(c.r,c.g,c.b,c.a),g.clear(g.COLOR_BUFFER_BIT),ps(),g.enable(g.BLEND),g.blendFunc(g.ONE,g.ONE);for(let u of vt)u.destroyed||u.renderLight();Et(),g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,I.x,I.y),g.useProgram(W.compositeShader),g.bindVertexArray(W.compositeVAO),g.activeTexture(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,W.texture);let l=W.compositeShader;g.uniform1i(g.getUniformLocation(l,"s"),0),g.uniform3f(g.getUniformLocation(l,"iResolution"),G.width,G.height,1),g.blendFunc(g.DST_COLOR,g.ZERO),g.drawArrays(g.TRIANGLE_STRIP,0,4),Zt&&g.bindTexture(g.TEXTURE_2D,Zt),ps(a),Ts(!0)}function o(){W.texture=void 0,W.lightShader=void 0,W.compositeShader=void 0,W.lightVAO=void 0,W.compositeVAO=void 0,xt("LightSystemPlugin: WebGL context lost")}function r(){s(),xt("LightSystemPlugin: WebGL context restored")}}drawLight(t){if(N||!k||!this.lightShader)return;Et(),g.useProgram(this.lightShader),g.bindVertexArray(this.lightVAO);let e=b(2*q).divide(I),s=Ct.rotate(-K),i=b(-1).subtract(s.multiply(e)),o=ct(K),r=nt(K),a=[e.x*o,e.y*r,0,0,-e.x*r,e.y*o,0,0,1,1,1,0,i.x,i.y,0,1],c=this.lightShader;g.uniformMatrix4fv(g.getUniformLocation(c,"m"),!1,a),g.uniform2f(g.getUniformLocation(c,"lightPos"),t.pos.x,t.pos.y),g.uniform1f(g.getUniformLocation(c,"radius"),t.radius),g.uniform1f(g.getUniformLocation(c,"fadeRange"),t.fadeRange);let l=t.color;g.uniform4f(g.getUniformLocation(c,"color"),l.r,l.g,l.b,l.a),g.drawArrays(g.TRIANGLE_STRIP,0,4),Ts(!0)}},Oo=class extends Ve{constructor(t,e,s,i){super(t,b(1),void 0,0,s),p(P(e)&&e>=0,"Light radius must be a non-negative number"),p(i===void 0||P(i)&&i>=0,"Light fadeRange must be a non-negative number when provided"),this.radius=e,this.fadeRange=i===void 0?e:i}render(){}renderLight(){W&&W.drawLight(this)}},Do=class extends xs{constructor(t){super(void 0),!(!Xt||N)&&(this.randomness=0,this.sampleChannels=Ec(...t),this.sampleRate=Zn)}playMusic(t=1,e=!0){return super.play(void 0,t,1,0,e)}};Wr=0;Io=class{constructor(t=ut){p(!C,"UI system already initialized"),C=this,this.activateOnPress=!1,this.defaultColor=V,this.defaultLineColor=st,this.defaultTextColor=st,this.defaultButtonColor=Fe(0,0,.7),this.defaultHoverColor=Fe(0,0,.9),this.defaultDisabledColor=Fe(0,0,.3),this.defaultGradientColor=void 0,this.defaultLineWidth=4,this.defaultCornerRadius=0,this.defaultTextFitScale=.8,this.defaultFont=Ps,this.defaultSoundPress=void 0,this.defaultSoundRelease=void 0,this.defaultSoundClick=void 0,this.defaultShadowColor=ye,this.defaultShadowBlur=5,this.defaultShadowOffset=b(5),this.nativeHeight=0,this.navigationObject=void 0,this.navigationTimer=new Ee(void 0,!0),this.navigationDelay=.2,this.navigationDirection=1,this.navigationMode=!1,this.uiObjects=[],this.uiContext=t,this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.confirmDialog=void 0,this._keyInputObject=void 0,this._onKeyDown=o=>{var r;return(r=this._keyInputObject)==null?void 0:r.onKeyDown(o)},_n(s,i);function e(o){let r,a;o.parent?(r=o.parent.nativePos,a=o.parent.size):(r=C.screenToNative(I.scale(.5)),a=C.nativeHeight?b(I.x*C.nativeHeight/I.y,C.nativeHeight):I);let c=o.anchor;o.nativePos=r.add(a.multiply(c).scale(.5)).subtract(o.size.multiply(c).scale(.5)).add(o.localPos)}function s(){C.activeObject&&!C.activeObject.visible&&(C.activeObject=void 0),C.lastHoverObject=C.hoverObject,C.hoverObject=void 0,gs(0)&&(C.navigationMode=!1,C.navigationObject=void 0),C.keyInputObject&&(C.activeObject=C.keyInputObject,C.hoverObject=C.keyInputObject,C.navigationMode=!1,C.navigationObject=void 0);let o=C.getNavigableObjects();if(!o.length)C.navigationObject=void 0;else if(!C.keyInputObject){if(o.includes(C.navigationObject)||(C.navigationObject=void 0),oe||C.navigationMode&&!C.navigationObject&&(C.navigationObject=o.find(a=>a.navigationAutoSelect)),!C.navigationTimer.active()){let a=se(C.getNavigationDirection());if(a){let c;if(C.navigationObject){let l=o.indexOf(C.navigationObject),u=ie(l+a,o.length);c=o[u]}else if(c=o.find(l=>l.navigationAutoSelect),!c){let l=a>0?0:o.length-1;c=o[l]}C.navigationObject!==c&&(C.navigationMode=!0,C.hoverObject=void 0,C.navigationObject=c,C.navigationTimer.set(C.navigationDelay),c.soundPress&&c.soundPress.play())}}C.navigationObject&&C.getNavigationWasPressed()&&C.navigationObject.navigatePressed()}for(let a=C.uiObjects.length;a--;){let c=C.uiObjects[a];c.parent||r(c)}C.uiObjects=C.uiObjects.filter(a=>!a.destroyed);function r(a){if(!(a.destroyed||!a.visible)){e(a);for(let c=a.children.length;c--;){let l=a.children[c];l&&r(l)}a.destroyed||a.update()}}}function i(){let o=C.uiContext;if(o.save(),C.nativeHeight){let a=I.y/C.nativeHeight;o.translate(-a*I.x/2,0),o.scale(a,a),o.translate(I.x/2/a,0)}function r(a){if(a.visible){e(a),a.render();for(let c of a.children)r(c)}}if(C.uiObjects.forEach(a=>a.parent||r(a)),Wr>0){let a=function(c,l=!0){l&&(l=!!c.visible),e(c),c.renderDebug(l);for(let u of c.children)a(u,l)};C.uiObjects.forEach(c=>c.parent||a(c))}o.restore()}}drawRect(t,e,s=V,i=0,o=st,r=0,a,c=st,l=0,u=b()){p(O(t),"pos must be a vec2"),p(O(e),"size must be a vec2"),p(J(s),"color must be a color"),p(P(i),"lineWidth must be a number"),p(J(o),"lineColor must be a color"),p(P(r),"cornerRadius must be a number");let h=C.uiContext;if(a){let f=h.createLinearGradient(t.x,t.y-e.y/2,t.x,t.y+e.y/2),d=s.toString();f.addColorStop(0,d),f.addColorStop(.5,a.toString()),f.addColorStop(1,d),h.fillStyle=f}else h.fillStyle=s.toString();(l||u.x||u.y)&&c.a>0&&(h.shadowColor=c.toString(),h.shadowBlur=l,h.shadowOffsetX=u.x,h.shadowOffsetY=u.y),h.beginPath(),r&&h.roundRect?h.roundRect(t.x-e.x/2,t.y-e.y/2,e.x,e.y,r):h.rect(t.x-e.x/2,t.y-e.y/2,e.x,e.y),h.fill(),h.shadowColor="#0000",i&&o.a>0&&(h.strokeStyle=o.toString(),h.lineWidth=i,h.stroke())}drawLine(t,e,s=C.defaultLineWidth,i=C.defaultLineColor){p(O(t),"posA must be a vec2"),p(O(e),"posB must be a vec2"),p(P(s),"lineWidth must be a number"),p(J(i),"lineColor must be a color");let o=C.uiContext;o.strokeStyle=i.toString(),o.lineWidth=s,o.beginPath(),o.lineTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke()}drawTile(t,e,s,i=C.defaultColor,o=0,r=!1,a=st,c=0,l=b()){let u=C.uiContext;(c||l.x||l.y)&&a.a>0&&(u.shadowColor=a.toString(),u.shadowBlur=c,u.shadowOffsetX=l.x,u.shadowOffsetY=l.y),Lt(t,e,s,i,o,r,ye,!1,!0,u),u.shadowColor="#0000"}drawText(t,e,s,i=C.defaultColor,o=C.defaultLineWidth,r=C.defaultLineColor,a="center",c=C.defaultFont,l="",u=!0,h=void 0,f=st,d=0,y=b()){let x=C.uiContext;f.a>0&&(h&&on(t,e.add(h),s.y,f,o,r,a,c,l,u?s.x:void 0,0,x),(d||y.x||y.y)&&(x.shadowColor=f.toString(),x.shadowBlur=d,x.shadowOffsetX=y.x,x.shadowOffsetY=y.y)),on(t,e,s.y,i,o,r,a,c,l,u?s.x:void 0,0,x),x.shadowColor="#0000"}setupDragAndDrop(t,e,s,i){if(this._dragListeners)for(let[r,a]of this._dragListeners)document.removeEventListener(r,a);this._dragListeners=[];let o=(r,a)=>{let c=l=>{l.preventDefault(),r&&r(l)};document.addEventListener(a,c),this._dragListeners.push([a,c])};o(t,"drop"),o(e,"dragenter"),o(s,"dragleave"),o(i,"dragover")}screenToNative(t){if(!C.nativeHeight)return t;let e=I.y/C.nativeHeight,s=1/e,i=t.copy();return i.x+=e*I.x/2,i.x*=s,i.y*=s,i.x-=s*I.x/2,i}get keyInputObject(){return this._keyInputObject}set keyInputObject(t){let e=!!this._keyInputObject;this._keyInputObject=t,!e&&t?document.addEventListener("keydown",this._onKeyDown):e&&!t&&document.removeEventListener("keydown",this._onKeyDown)}destroyObjects(){for(let t of this.uiObjects)t.parent||t.destroy();this.uiObjects=this.uiObjects.filter(t=>!t.destroyed),this.activeObject=void 0,this.hoverObject=void 0,this.lastHoverObject=void 0,this.keyInputObject=void 0}getNavigableObjects(){function t(s){if(!(!s.visible||s.disabled)){s.isInteractive()&&s.navigationIndex!==void 0&&e.push(s);for(let i=s.children.length;i--;)t(s.children[i])}}let e=[];for(let s=C.uiObjects.length;s--;){let i=C.uiObjects[s];C.confirmDialog&&i!==C.confirmDialog||i.parent||t(i)}return e.sort((s,i)=>s.navigationIndex-i.navigationIndex),e}getNavigationDirection(){let t=C.navigationDirection===1,e=C.navigationDirection===2;if(Bn){let l=ys(0,mt),u=bo(mt);return e?-(l.y||u.y)||l.x||u.x:t?-(l.y||u.y):l.x||u.x}let s="ArrowUp",i="ArrowDown",o="ArrowLeft",r="ArrowRight";if(e)return Pt(s)||Pt(o)?-1:Pt(i)||Pt(r)?1:0;let a=t?s:o,c=t?i:r;return Pt(a)?-1:Pt(c)?1:0}getNavigationOtherDirection(){if(C.navigationDirection===2)return 0;let t=C.navigationDirection===1;if(Bn){let i=ys(0,mt),o=bo(mt);return t?i.x||o.x:i.y||o.y}let e=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";return Pt(e)?-1:Pt(s)?1:0}getNavigationWasPressed(){return Bn?Rr(0,mt):kt("Space")||kt("Enter")}showConfirmDialog(t="Are you sure?",e,s,i=b(500,250),o="Escape"){p(!C.confirmDialog);let r=C.navigationDirection;C.navigationDirection=2;let a=new ae(b(),i);C.confirmDialog=a,a.onRender=()=>{let d=Fe(0,0,0,.7);C.drawRect(b(),b(1e9),d)},a.onUpdate=()=>{kt(o)&&f()},a.isMouseOverlapping=()=>!0;let c=50,l=new vi(b(0,-50),b(i.x-c,70),t);a.addChild(l);let u=new _s(b(-80,50),b(120,70),"Yes");u.textHeight=40,u.navigationIndex=1,u.hoverColor=Fe(0,1,.5),u.onClick=()=>{f(),e&&e()},a.addChild(u);let h=new _s(b(80,50),b(120,70),"No");h.textHeight=40,h.navigationIndex=2,h.navigationAutoSelect=!0,h.onClick=()=>{f(),s&&s()},a.addChild(h);function f(){p(C.confirmDialog===a),a.destroy(),C.confirmDialog=void 0,C.navigationDirection=r,Gs()}}},ae=class{constructor(t=b(),e=b()){var s,i;p(O(t),"ui object pos must be a vec2"),p(O(e),"ui object size must be a vec2"),this.localPos=t.copy(),this.nativePos=t.copy(),this.size=e.copy(),this.color=C.defaultColor.copy(),this.activeColor=void 0,this.text=void 0,this.disabledColor=C.defaultDisabledColor.copy(),this.disabled=!1,this.textColor=C.defaultTextColor.copy(),this.hoverColor=C.defaultHoverColor.copy(),this.lineColor=C.defaultLineColor.copy(),this.gradientColor=C.defaultGradientColor?C.defaultGradientColor.copy():void 0,this.lineWidth=C.defaultLineWidth,this.cornerRadius=C.defaultCornerRadius,this.font=C.defaultFont,this.fontStyle=void 0,this.textWidth=void 0,this.textHeight=void 0,this.textFitScale=C.defaultTextFitScale,this.textShadow=void 0,this.textLineColor=C.defaultLineColor.copy(),this.textLineWidth=0,this.visible=!0,this.children=[],this.parent=void 0,this.extraTouchSize=0,this.soundPress=C.defaultSoundPress,this.soundRelease=C.defaultSoundRelease,this.soundClick=C.defaultSoundClick,this.interactive=!1,this.dragActivate=!1,this.canBeHover=!0,this.shadowColor=(s=C.defaultShadowColor)==null?void 0:s.copy(),this.shadowBlur=C.defaultShadowBlur,this.shadowOffset=(i=C.defaultShadowOffset)==null?void 0:i.copy(),this.navigationIndex=void 0,this.navigationAutoSelect=!1,this.anchor=b(),C.uiObjects.push(this)}addChild(t){return p(!t.parent&&!this.children.includes(t)),this.children.push(t),t.parent=this,t}removeChild(t){p(t.parent===this&&this.children.includes(t)),this.children.splice(this.children.indexOf(t),1),t.parent=void 0}destroy(){var t;if(!this.destroyed){C.activeObject===this&&(C.activeObject=void 0),C.hoverObject===this&&(C.hoverObject=void 0),C.lastHoverObject===this&&(C.lastHoverObject=void 0),C.navigationObject===this&&(C.navigationObject=void 0),C.keyInputObject===this&&(C.keyInputObject=void 0),this.destroyed=1,(t=this.parent)==null||t.removeChild(this);for(let e of this.children)e.parent=void 0,e.destroy();this.children.length=0}}isMouseOverlapping(){if(!oi)return!1;let t=oe?this.size.add(b(this.extraTouchSize||0)):this.size,e=C.screenToNative(Ut);return Qs(this.nativePos,t,e)}update(){if(this.onUpdate(),this.disabled&&(this===C.activeObject&&(C.activeObject=void 0),this===C.keyInputObject&&(C.keyInputObject=void 0)),C.keyInputObject)return;let t=C.lastHoverObject===this,e=this.isActiveObject(),s=ls(0),i=this.dragActivate?s:gs(0);this.canBeHover&&(C.navigationMode||(i||e||!s&&!oe)&&!C.hoverObject&&this.isMouseOverlapping()&&(C.hoverObject=this)),this.isHoverObject()&&(this.disabled||(i&&this.interactive&&((!this.dragActivate||!t||gs(0))&&this.onPress(),this.soundPress&&this.soundPress.play(),C.activeObject&&!e&&C.activeObject.onRelease(),C.activeObject=this,C.activateOnPress&&this.click(!this.soundPress)),C.activateOnPress||!s&&this.isActiveObject()&&this.interactive&&this.click()),i&&Er(0,0,0,1,0)),e&&(!s||this.dragActivate&&!this.isHoverObject())&&(this.onRelease(),this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0),this.isHoverObject()!==t&&(this.isHoverObject()?this.onEnter():this.onLeave())}render(){if(this.onRender(),!this.size.x||!this.size.y)return;let t=this.isNavigationObject(),e=t?this.color:this.interactive&&this.isActiveObject()&&!this.disabled?this.color:this.lineColor,s=t?this.hoverColor:this.disabled?this.disabledColor:this.interactive?this.isActiveObject()?this.activeColor||this.hoverColor:this.isHoverObject()?this.hoverColor:this.color:this.color,i=this.lineWidth*(t?1.5:1);C.drawRect(this.nativePos,this.size,s,i,e,this.cornerRadius,this.gradientColor,this.shadowColor,this.shadowBlur,this.shadowOffset)}getTextSize(){return b(this.textWidth||this.textFitScale*this.size.x,this.textHeight||this.textFitScale*this.size.y)}navigatePressed(){this.click()}isHoverObject(){return C.hoverObject===this}isActiveObject(){return C.activeObject===this}isNavigationObject(){return C.navigationObject===this}isKeyInputObject(){return C.keyInputObject===this}isInteractive(){return this.interactive&&this.visible&&!this.disabled}toString(){let t="type = "+this.constructor.name;return this.text&&(t+=`
 text = `+this.text),(this.nativePos.x||this.nativePos.y)&&(t+=`
 nativePos = `+this.nativePos),(this.localPos.x||this.localPos.y)&&(t+=`
 localPos = `+this.localPos),(this.size.x||this.size.y)&&(t+=`
 size = `+this.size),this.color&&(t+=`
-color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?Ka:this.disabled?tc:this.interactive?rr:Za:Qa;C.drawRect(this.nativePos,this.size,ye,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},vi=class extends ae{constructor(t,e,s="",i="center",o=C.defaultFont){super(t,e),p(U(s),"ui text must be a string"),p(["left","center","right"].includes(i),"ui text align must be left, center, or right"),p(U(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=ye,this.shadowColor=ye,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();C.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Mo=class extends ae{constructor(t,e,s=""){super(t,e),p(U(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){C.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0,C.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,r=i-s,a=o-r/2,c=o+r/2,l=C.screenToNative(Jt);this.value=e?Ft(l.x,a,c):Ft(l.y,c,a)}else if(this.isNavigationObject()){let e=C.getNavigationOtherDirection();C.navigationTimer.active()||(this.value=F(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=Q(s,this.cornerRadius*2),r=Wt(o,e,this.value),a=(r-e)*(t?.5:-.5),c=this.nativePos.add(t?b(a,0):b(0,a)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(r,this.size.y):b(this.size.x,r);C.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=F(t?this.value:1-this.value),r=(e-s)*(o-.5),a=this.nativePos.add(t?b(r,0):b(0,r)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);C.drawRect(a,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();C.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},jo=class extends ae{constructor(t,e,s,i=!1,o=!1,r=1){super(t,e||b()),p(U(s),"video src must be a string"),p(P(r),"video volume must be a number"),this.color=st,this.cornerRadius=0,this.volume=r,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=F(r*wn),this.video.muted=!Ht,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),p(P(s),"ui layout gap must be a number"),p(P(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=ye,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=ye),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=hs(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let f=0;f=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=z(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=V,e=st,s=.1,i,o){this.getFixtureList().forEach(r=>{m.castShapeObject(r.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(r,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(r=>mo(r,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(r=>mo(r,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){p(P(e),"density must be a number"),p(P(s),"friction must be a number"),p(P(i),"restitution must be a number");let r=new m.instance.b2FixtureDef;return r.set_shape(t),r.set_density(e),r.set_friction(s),r.set_restitution(i),r.set_isSensor(o),this.body.CreateFixture(r)}addBox(t=b(1),e=b(),s=0,i,o,r,a){p(O(t),"size must be a Vector2"),p(t.x>0&&t.y>0,"size must be positive"),p(O(e),"offset must be a Vector2"),p(P(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,r,a)}addPoly(t,e,s,i,o){p(pe(t),"points must be an array");function r(c){p(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let f=0,d=0;f>2]=c[f].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[f].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let a=r(t);return this.addShape(a,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,r){p(P(t)&&t>0,"diameter must be a positive number"),p(P(e)&&e>2,"sides must be a positive number greater than 2");let a=[],c=t/2;for(let l=e;l--;)a.push(b(c,0).rotate((l+.5)/e*X*2));return this.addPoly(a,s,i,o,r)}addRandomPoly(t=1,e,s,i,o){p(P(t)&&t>0,"diameter must be a positive number");let r=or(3,9),a=[],c=t/2;for(let l=r;l--;)a.push(b(ft(c/2,c*1.5),0).rotate(l/r*X*2));return this.addPoly(a,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,r){p(P(t)&&t>0,"diameter must be a positive number"),p(O(e),"offset must be a Vector2");let a=new m.instance.b2CircleShape;return a.set_m_p(m.vec2dTo(e)),a.set_m_radius(t/2),this.addShape(a,s,i,o,r)}addEdge(t,e,s,i,o,r){p(O(t),"point1 must be a Vector2"),p(O(e),"point2 must be a Vector2");let a=new m.instance.b2EdgeShape;return a.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(a,s,i,o,r)}addEdgeList(t,e,s,i,o){p(pe(t),"points must be an array");let r=[],a=[];for(let c=0;ct[ie(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},Si=class extends Rs{constructor(t,e,s,i=0,o,r=0){let a=m.bodyTypeStatic;super(t,e,s,i,o,a,r)}},Bo=class extends Rs{constructor(t,e,s,i=0,o,r=0){let a=m.bodyTypeKinematic;super(t,e,s,i,o,a,r)}},zo=class extends Si{constructor(t){p(t instanceof Ss,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(r,a)=>r+a*this.size.x,o=(r,a)=>!s[i(r,a)]&&this.tileLayer.getCollisionData(b(r,a))>0;for(let r=0;ri.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ei.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,$t.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Oc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,$t.indexOf(this)<0&&$t.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&$t.indexOf(this)>=0}getPercent(){return Ft(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return La(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=$t.indexOf(this);t>=0&&$t.splice(t,1),this.thenCallback=void 0}},Ei={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-at(n*(X/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*nt((37-40*n)*X/6),SPRING:n=>1-(nt(X*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ei.PIECEWISE(n,Ei.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let r=1-o,a=3*r*r*o,c=3*r*o*o,l=o**3;return[a*n+c*e+l,a*t+c*s+l]};return o=>{let r=0,a=1;for(let c=0;c<128;c++){let l=(r+a)/2,[u,h]=i(l);if(et(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(St(t.x-e),St(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&bt(a.posWorld,lo,z(1,0,0,Q(.2,l*.05)),this.debugTime):bt(a.posWorld,lo,z(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){p(t&&e,"aStarSearch needs both endpoints"),p(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),p(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,r=s[0].f;for(let c=1;cthis.maxLoop)break;a.isOpen=!1,s.splice(o,1),a.isClosed=!0,this.debug&&this.debugTime>0&&bt(a.posWorld,lo,z(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(a.pos.x+l,a.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(a.pos.x+l,a.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(a.pos.x,a.pos.y+c);if(!w||!w.walkable)continue;h=fd}let f=a.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(f>=u.g)continue;u.parent=a,u.g=f;let d=et(e.pos.x-u.pos.x),y=et(e.pos.y-u.pos.y),x=$(d,y)+(Math.SQRT2-1)*Q(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){p(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,r=St(t.x-i),a=St(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let f=-c;f<=c;++f){if(c>0&&et(f)!==c&&et(h)!==c)continue;let d=this.getNode(r+f,a+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Ut(i.posWorld,.3,z(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=$(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Ut(i.posWorld,.3,z(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=$(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Ut(i.posWorld,.3,z(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,E=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,R=E*E+A*A,M=T0&&Ut(i.posWorld,.3,z(0,1,0,.5),this.debugTime),l===h&&u===f){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=$(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&Te(o.posWorld,t[t.length-1].posWorld,z(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){p(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),p(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=et(s),r=et(i),a=se(s),c=se(i),l=t.x,u=t.y;if(r===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=a,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ra.posWorld.copy());if(this.debug&&this.debugTime>0&&r.length>0){for(let a=1;apd,bootGameHost:()=>yd,default:()=>gd});var js=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ji=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},Ui=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let r=e._subs.get(i)||[],a={handler:o,scope:s};return r.push(a),e._subs.set(i,r),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(a);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let r=e._subs.get(i);if(!r)return;let a=r.findIndex(c=>c.handler===o&&c.scope===s);a>=0&&r.splice(a,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let r=o.slice();for(let a of r)try{a.handler(i)}catch(c){Xe("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(r=>r.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Vi.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Vi).join("/")+"\uFF09")}},Vi=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Xr(n){let t=n||{},e=new Ji(t.clock),s=new js(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new Ui(e),r=typeof t.audioFactory=="function"?t.audioFactory:null,a=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,f=new Map,d=0,y=0;function x(){if(a)return a;if(!r)return c||(qi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{a=r()}catch(E){Xe("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",E),a=null}return a}function v(){if(u)return u;if(!l)return h||(qi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(E){Xe("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",E),u=null}return u}function w(E,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(R){let M=d++;return f.set(M,R),{cancel(){f.delete(M)}}},getInput(){return o.sourceFor(E)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(E){y+=1;let A=Array.from(f.values());for(let T of A)try{T(E,y)}catch(R){Xe("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,R)}},frameCount(){return y},inputBridge:o,deriveContextFor(E,A){let T=zc(i,E),R=new js(T);return w(A==null?E:A,R)}};return Object.defineProperty(_,Wi,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Wi=Symbol("zaomeng.coreProtocol.contextBundle"),Ns=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return qi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),Xe("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let r=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:r}),Xe("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,r)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Wi],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Wi],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let r=this._initOrder[o],a=this._plugins.get(r);if(a&&typeof a.dispose=="function")try{a.dispose(),t.push(r)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:r,error:l}),Xe("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+r,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(r)}catch(c){Xe("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+r,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let r=0;r<32;r+=8){let a=i>>>r&255;e^=a,e=Math.imul(e,s)>>>0}let o=String(t);for(let r=0;r>>0,e^=a>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function Xe(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function qi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Vi)),Yr="core-protocol-v0";var $r=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Hi=$r.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set($r);function Xi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var Kr=Xi("runtime-probe::seed::v1");function Bs(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Bs).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Bs(n[e])).join(",")+"}"}function Qr(n){let t=Bs(n.extra==null?null:n.extra),e=Bs(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=Kr,e=-1;for(let s=0;stypeof E=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,r=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",a=()=>0,c=!1,l=0,u=Kr,h=[],f=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(E,A){let T=null;if(!Uc.has(E))T="unknown_anchor";else{f.has(E)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let M=Hi[E];ME.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=E.getInput().on(r,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:r})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(E=>({...E}))},toJSONL(){return h.map(E=>JSON.stringify(E)).join(`
-`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ta(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(a,c,l)=>(i("math.lerp"),o.lerp(a,c,l)),smoothStep:a=>(i("math.smoothStep"),o.smoothStep(a)),easing:Object.fromEntries(Object.keys(o.easing).map(a=>[a,c=>(i("math.easing."+a),o.easing[a](c))]))},particles:{spawnEmitter(a){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(a.pos.x,a.pos.y)),l=t.cameraScale,u=a.emitTime!=null?a.emitTime:a.count!=null?1/60:0,h=a.emitRate!=null?a.emitRate:a.count!=null?a.count*60:100,f=(a.speed!=null?a.speed:0)/l/60,d=a.damping!=null?a.damping:1,y=a.colorStart||{r:1,g:1,b:1,a:1},x=a.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,a.angle!=null?a.angle:0,(a.emitSize!=null?a.emitSize:0)/l,u,h,a.coneAngle!=null?a.coneAngle:Math.PI,void 0,v,v,w,w,a.particleTime!=null?a.particleTime:.5,(a.sizeStart!=null?a.sizeStart:6)/l,(a.sizeEnd!=null?a.sizeEnd:0)/l,f,0,d,1,a.gravityScale!=null?a.gravityScale:0,Math.PI,.1,0,!1,a.additive!=null?a.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:a=>{i("audio.synth.synthSfx");try{return t.zzfxG(...a)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(a,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(a,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function ue(n){return n<0?0:n>1?1:n}function ea(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),r=t.OUT(s),a=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,f)=>n.lerp(u,h,f),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(ue(u)),quadIn:u=>e(ue(u)),quadOut:u=>i(ue(u)),quadInOut:u=>o(ue(u)),cubicIn:u=>s(ue(u)),cubicOut:u=>r(ue(u)),cubicInOut:u=>a(ue(u)),backIn:u=>t.BACK(ue(u)),backOut:u=>c(ue(u)),elasticIn:u=>t.ELASTIC(ue(u)),elasticOut:u=>l(ue(u))}}}var Ye=2,zs=1/60;async function na(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",r=n.engineMode||"real",a=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},f=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let E=0,A=null,T=null,R=null,M=null,Z=[],it={},ht=null;function gt(D,lt){try{R&&R.mark(D,lt)}catch(ee){v.push({type:"mark",message:String(ee&&ee.message||ee)})}}function jt(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(it)}async function qe(D,lt){A=Xr({context2d:D,seed:i,audioFactory:S,clock:()=>E,engineFactory:()=>ta({LJS:r==="real"?s:null,engineMath:r==="real"?ea(s):null,engineMode:r,recHook:y})});let ee=new Ns;for(let me of f)ee.register(me);ee.useContext(A.context),M=ee.initAll(),Z=ee.list().concat(["runtime-probe"]),R=Zr({pluginSet:Z,inputAnchorType:"pointerdown",autoBoot:!0});let ne=A.deriveContextFor("runtime-probe","runtime-probe");gt("t_boot",{by:"game-host",stage:"pre-init",engineMode:r}),gt("t_plugins_ready",{initialized:M.initialized.length,ok:M.ok});let Bi=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(Bi),await T.init({ctx:A.context,mainContext:D,canvas:lt(),seed:i}),ht=T&&typeof T._forensicsView=="function"?T._forensicsView():null,gt("t_game_init",{hasForensics:!!ht}),dt(),gt("t_first_paint",{frame:A.frameCount()});try{R.init(ne)}catch(me){v.push({type:"probe-init",message:String(me&&me.message||me)})}gt("t_game_start",{mode:o,engineMode:r}),jt(),d(dn,{bundle:A,game:T,probe:R,checklist:it,uncaught:v,pluginSet:Z,initRes:M,getGameForensics:()=>ht,mark:gt,stepOneFrame:dt})}let Lt=null;function dt(D){let lt=typeof D=="number"?D:zs;T&&(E+=lt*1e3,T.update(lt),r==="stub"&&Lt&&T.render(Lt),jt())}function Ot(D){for(let lt=0;lt{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let dn={seed:i,mode:o,engineMode:r,protocol:Yr,frameCount:()=>A?A.frameCount():0,stepFrames:Ot,startRaf:()=>B(),stopRaf:()=>j(),tap(D,lt){He(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:lt}),A.inputBridge._emit("pointerup",{x:D,y:lt}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>ht?ht.state():{phase:"booting"}};function fn(D){let lt=A.inputBridge;function ee(ne,Bi){let me=D.getBoundingClientRect();return{x:(ne-me.left)/me.width*a,y:(Bi-me.top)/me.height*c}}D.addEventListener("pointerdown",ne=>{He(),lt._emit("pointerdown",ee(ne.clientX,ne.clientY))}),D.addEventListener("pointermove",ne=>{lt._emit("pointermove",ee(ne.clientX,ne.clientY))}),D.addEventListener("pointerup",ne=>{lt._emit("pointerup",ee(ne.clientX,ne.clientY))})}let ce=0,Le=!1,te=0;function L(D){if(!Le)return;te===0&&(te=D);let lt=(D-te)/1e3;te=D,lt>.05&&(lt=.05),dt(lt),ce=window.requestAnimationFrame(L)}function B(){r==="stub"&&(Le||(Le=!0,te=0,ce=window.requestAnimationFrame(L)))}function j(){Le=!1,ce&&window.cancelAnimationFrame(ce),ce=0}function H(D){D.width=a*Ye,D.height=c*Ye,D.style.width=a+"px",D.style.height=c+"px";let lt=D.getContext("2d",{willReadFrequently:!0});return lt.setTransform(Ye,0,0,Ye,0,0),lt}async function Nt(){let D=H(t);return Lt=D,await qe(D,()=>t),fn(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),B()),dn}let ct=()=>{},le=()=>{};function Dt(){window.__gameHostEngineInitFired=!0}function Bt(){ct()}function rt(){}function _t(){le()}function Oe(){}async function In(D){await qe(D,()=>s.mainCanvas),fn(s.mainCanvas),ct=()=>{T&&(E+=zs*1e3,T.update(zs))},le=()=>{if(T){D.save(),D.setTransform(Ye,0,0,Ye,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(r!=="real")return await Nt();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(a*Ye,c*Ye));let ts=document.createElement("div");return ts.id="engine-root",document.body.appendChild(ts),await s.engineInit(Dt,Bt,rt,_t,Oe,[],ts).then(()=>In(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),dn}var Yi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),r=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:r}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:r}=this._cellRange(e),a=[];for(let l=i;l<=r;l++)for(let u=s;u<=o;u++){let h=u+","+l,f=this._cells.get(h);f||(f=new Set,this._cells.set(h,f)),f.add(t),a.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:a})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),r=new Set;for(let a=s;a<=o;a++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+a);if(l)for(let u of l)r.add(u)}return this._collect(r)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),r=this._cells.get(i+","+o);return r?this._collect(new Set(r)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function sa(n){let t=n||{},e=new Yi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function ia(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function zt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=zt(n),n*n),Yc=n=>(n=zt(n),1-(1-n)*(1-n)),$c=n=>(n=zt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=zt(n),n*n*n),Qc=n=>{n=zt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=zt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),aa=2*Math.PI/3,oa=2*Math.PI/4.5,tl=n=>(n=zt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*aa)),el=n=>(n=zt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*aa)+1),nl=n=>(n=zt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*oa))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*oa)/2+1),Us=1.70158,Js=Us*1.525,ca=Us+1,sl=n=>(n=zt(n),ca*n*n*n-Us*n*n),il=n=>{n=zt(n);let t=n-1;return 1+ca*t*t*t+Us*t*t},ol=n=>(n=zt(n),n<.5?Math.pow(2*n,2)*((Js+1)*2*n-Js)/2:(Math.pow(2*n-2,2)*((Js+1)*(n*2-2)+Js)+2)/2),rl=n=>zt(n),ra=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return ra;let e=i=>typeof t[i]=="function"?o=>t[i](zt(o)):ra[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var $i=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let r of o){this._records.set(r,null);let a=t.on(r,c=>{this._records.set(r,c.tMs)});this._subs.push(a)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function la(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(r){let a=r.getInput();e=new $i(a,r.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=r.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function Vs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Ki(t):null}function Ki(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Ki(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:Vs(n.sizeCurve,0),sizeEnd:Vs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:Vs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:Vs(n.alphaCurve,1)},additive:!1}}function ua(n){let t=n||{},e=null,s=null,i=null,o=new Map,r=0,a={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,f=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=f+(1-f)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,R=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*R,d.y=Math.cos(d._phase*1.3)*R}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,R=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(R)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let R=T.canvas?T.canvas.width:0,M=T.canvas?T.canvas.height:0;T.fillRect(0,0,R,M),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(R=>{_(R)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,R,M){let Z=typeof A=="string"?ul(A):Ki(A);if(!Z)return-1;M&&(Z=Object.assign(Z,M));let it=r++;if(!i)return o.set(it,a),it;let ht=i.spawnEmitter(hl(Z,T,R));return o.set(it,ht),it},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,f=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?f:1},getTimeScale(){return l},shakeScreen(A,T,R){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=R==null?30:R,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,R){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=R==null?4:R,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ha(n){let t=yt(n.r)/255,e=yt(n.g)/255,s=yt(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),r=(i+o)/2,a=0,c=0,l=i-o;return l>1e-12&&(c=r>.5?l/(2-i-o):l/(i+o),i===t?a=(e-s)/l%6:i===e?a=(s-t)/l+2:a=(t-e)/l+4,a*=60,a<0&&(a+=360)),{h:a,s:c,l:r}}function da(n){let t=(n.h%360+360)%360,e=$e(n.s),s=$e(n.l);if(e<1e-12){let a=Math.round(s*255);return{r:a,g:a,b:a}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,r=t/360;return{r:Math.round(Qi(o,i,r+1/3)*255),g:Math.round(Qi(o,i,r)*255),b:Math.round(Qi(o,i,r-1/3)*255)}}function Qi(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function yt(n){return n<0?0:n>255?255:n}function $e(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:yt(a.r),g:yt(a.g),b:yt(a.b)})),to:o}}function Zi(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ha(n),s=e.h+(t.hue||0),i=$e(e.s*(t.sat==null?1:t.sat)),o=$e(e.l*(t.light==null?1:t.light));return da({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function fa(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:to(t.vignette&&t.vignette.enabled,!1),strength:eo(t.vignette&&t.vignette.strength,.5)},dither:{enabled:to(t.dither&&t.dither.enabled,!1),strength:eo(t.dither&&t.dither.strength,.5)},scanline:{enabled:to(t.scanline&&t.scanline.enabled,!1),strength:eo(t.scanline&&t.scanline.strength,.5)}};function o(a){let c=a!==void 0?a:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(a){e=a},dispose(){s||(e=null,s=!0)},applyPaletteMap(a,c){return dl(a,c)},applyPaletteMapToBuffer(a,c){return fl(a,c)},lerpPaletteMap(a,c,l){return yl(a,c,l)},shiftHsl(a,c){return ml(a,c)},rgbToHsl(a){return ha(a)},hslToRgb(a){return da(a)},setPost(a){if(a)for(let c of["vignette","dither","scanline"])a[c]&&(typeof a[c].enabled=="boolean"&&(i[c].enabled=a[c].enabled),typeof a[c].strength=="number"&&(i[c].strength=$e(a[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(a){o(a)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=$e(t);if(e<=0)return n;let{data:s,width:i}=n,r=255/(Math.max(2,Math.round(16-e*14))-1);for(let a=0;a+3>2)%i,l=Math.floor((a>>2)/i),u=(bl[l&3][c&3]/16-.5)*r;for(let h=0;h<3;h++){let f=s[a+h]+u,d=Math.round(f/r)*r;s[a+h]=d<0?0:d>255?255:d}}return n}function to(n,t){return typeof n=="boolean"?n:t}function eo(n,t){return typeof n=="number"?$e(n):t}var so=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),pa=Object.keys(so);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let r=i[0]|0;Array.isArray(n.instruments)&&(r<0||r>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${r} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let a=i[1];(a<-1||a>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${a} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function be(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function ga(n,t){let e=be(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],r=typeof s.minIntensity=="number"?be(s.minIntensity):0,a=typeof s.maxIntensity=="number"?be(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?be(s.baseVolume):1;if(ea)return{id:i,on:!1,volume:0,channelIndices:o};let u=a-r,h=u<=0?1:(e-r)/u,f=be(Sl(c,h)*l);return{id:i,on:!0,volume:f,channelIndices:o}})}function ya(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,r=Math.max(i.length,o.length);if(r===0)return null;let c=n.createBuffer(2,r,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=be(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return io("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ma(n){let t=n||{},e=typeof t.masterVolume=="number"?be(t.masterVolume):1,s=()=>null,i=null,o=null,r={voices:[]},a=1,c=null,l=!1,u=0,h=!1,f=!1;function d(){let S=s();return S==null?(u+=1,h||(no("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return io("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=ga(r,a);if(S.length===0)return 1;let E=0;for(let A of S)A.on&&(E=Math.max(E,A.volume));return E}function v(S,E){typeof E=="number"&&(a=be(E));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let R=be(e*x());c=ya(A,T,R,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let E=S.getEngine&&S.getEngine();i=E?E.audio.synth:null},dispose(){f||(w(),f=!0)},loadSong(S){let E=vl(S);return E.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:no("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+E.errors.join("\uFF1B")),E},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){r=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){a=be(S)},resolveVoices(S){return ga(r,S)},playSfx(S){let E=so[S];if(!E){no("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(E.params):null;if(!T)return;ya(A,[T,T],e,!1)}catch(T){io("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return so[S]},listPresets(){return pa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:a,voiceCount:r.voices.length,looping:l,silentNoops:u,presetCount:pa.length}}}}function io(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function no(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function ro(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ba(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?ro():t.adapter,r=e+":",a=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?r+String(d):r+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(r)===0):[]}catch(d){return es("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!oo(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return es("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return a+=1,l||(ns("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!oo(d))return ns("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,ns("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,ns("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,ns("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,es("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(oo(d))try{o.removeItem(u(d))}catch(y){es("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){es("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:a,rejectedWrites:c}}}}function oo(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function es(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ns(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var Cl={w:390,h:844};function va(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=sa({cellSize:96}),s=ia(),i=la({inputBufferMs:260,inputTypes:["pointerdown"]}),o=ua({seed:t,maxParticles:600}),r=fa({vignette:{enabled:!0,strength:.22}}),a=ma({masterVolume:.8}),c;try{c=ba()}catch(f){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(f&&f.message)),c=ro()}let l=xa({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:r,audioMusic:a,save:l},registerOrder:[e,s,i,o,r,l,a],viewport:Cl,buildFactoryOpts:(f,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ss(n){let t=n||{},e=null,s=null,i=null,o=t.seed||42,r="booting",a=0,c=0,l=0,u="",h=[],f=null,d=null,y=0,x=.8,v=1,w=.5,_=null,S=[{shape:[[1,1,1,1]],color:1},{shape:[[1,1],[1,1]],color:2},{shape:[[0,1,0],[1,1,1]],color:3},{shape:[[0,1,1],[1,1,0]],color:4},{shape:[[1,1,0],[0,1,1]],color:5},{shape:[[1,0,0],[1,1,1]],color:6},{shape:[[0,0,1],[1,1,1]],color:7}],E=[null,"#00f0f0","#f0f000","#a000f0","#00f000","#f00000","#0000f0","#f0a000"];function A(){return e.random.next()}function T(L,B){return Math.floor(A()*(B-L+1))+L}function R(L){let B=S[L],j=B.shape.map(H=>H.slice());return{type:L,shape:j,x:Math.floor((10-j[0].length)/2),y:0,color:B.color}}function M(L){let B=L.length,j=L[0].length,H=[];for(let Nt=0;Nt=0;ct--)H[Nt].push(L[ct][Nt])}return H}function Z(L,B,j,H,Nt){let ct=Nt||L.shape;for(let le=0;le=10||rt>=18||rt>=0&&B[rt][Bt]!==0)return!0}return!1}function it(){let L=f;if(!L)return;let B=L.shape;for(let j=0;j=0&&ct<18&&(h[ct][Nt]=L.color)}if(l++,ht(),gt(),r!=="gameover"){let j=e.getEngine();if(j){if(j.particles)try{j.particles.spawnEmitter({pos:{x:L.x*39+19.5,y:L.y*46.9+23.45},count:10,speed:60,particleTime:.3,colorStart:{r:1,g:1,b:1,a:1},colorEnd:{r:1,g:1,b:1,a:0}})}catch{}if(j.audio&&j.audio.synth)try{j.audio.synth.synthSfx([1,.05,300,,,.15,,1.2])}catch{}}}}function ht(){let L=0;for(let B=17;B>=0;){let j=!0;for(let H=0;H<10;H++)if(h[B][H]===0){j=!1;break}if(j){for(let H=B;H>0;H--)h[H]=h[H-1].slice();h[0]=new Array(10).fill(0),L++}else B--}if(L>0){c+=L,L===1?a+=100:L===2?a+=300:L===3?a+=500:L===4&&(a+=800);let B=e.getEngine();if(B&&B.particles)try{B.particles.spawnEmitter({pos:{x:195,y:422},count:30,speed:120,particleTime:.6,colorStart:{r:.2,g:1,b:.2,a:1},colorEnd:{r:0,g:.8,b:0,a:0}})}catch{}if(B&&B.audio&&B.audio.synth)try{B.audio.synth.synthSfx([1,.1,500,,,.2,,1.5])}catch{}}}function gt(){if(!d){let B=T(0,6);d=R(B)}f=d;let L=T(0,6);if(d=R(L),Z(f,h,0,0,f.shape)){r="gameover",u="stack_to_top";return}f.x=Math.floor((10-f.shape[0].length)/2),f.y=0}function jt(){if(!(!f||r==="gameover")){if(!Z(f,h,0,1,f.shape)){f.y++;return}it()}}function qe(){if(!(!f||r==="gameover")){for(;!Z(f,h,0,1,f.shape);)f.y++;it()}}function Lt(L){!f||r==="gameover"||Z(f,h,L,0,f.shape)||(f.x+=L)}function dt(){if(!f||r==="gameover")return;let L=M(f.shape);Z(f,h,0,0,L)?Z(f,h,-1,0,L)?Z(f,h,1,0,L)||(f.shape=L,f.x+=1):(f.shape=L,f.x-=1):f.shape=L}function Ot(L){if(r!=="gameover")switch(L.key){case"ArrowLeft":Lt(-1);break;case"ArrowRight":Lt(1);break;case"ArrowUp":dt();break;case"ArrowDown":v=.05;break;case" ":qe();break}}function He(L){L.key==="ArrowDown"&&(v=1)}function dn(L){e=L.ctx,s=L.canvas,i=L.mainContext,h=new Array(18);for(let H=0;H<18;H++)h[H]=new Array(10).fill(0);e.random.reseed(o);let B=T(0,6);d=R(B),gt(),_=e.getInput().on("keydown",Ot),e.getInput().on("keyup",He),a=0,c=0,l=0,y=0,r="playing",u="";let j=e.getEngine();if(j&&j.math)try{j.math.lerp(0,1,.5)}catch{}}function fn(L){let B=e.time.nowMs();if(r==="gameover")return;y+=L;let j=x*v;y>=j&&(y-=j,jt())}function ce(L){L.fillStyle="#0a0a1a",L.fillRect(0,0,390,844);let B=39,j=46.8888,H=40,Nt=18*j,ct=40,Dt=(844-ct-20)/18,Bt=390/10;L.strokeStyle="#1a1a3a",L.lineWidth=1;for(let rt=0;rt<=18;rt++){let _t=ct+rt*Dt;L.beginPath(),L.moveTo(0,_t),L.lineTo(390,_t),L.stroke()}for(let rt=0;rt<=10;rt++){let _t=rt*Bt;L.beginPath(),L.moveTo(_t,ct),L.lineTo(_t,844),L.stroke()}for(let rt=0;rt<18;rt++)for(let _t=0;_t<10;_t++){let Oe=h[rt][_t];Oe>0&&(L.fillStyle=E[Oe],L.fillRect(_t*Bt,ct+rt*Dt,Bt-1,Dt-1))}if(f&&r!=="gameover"){let rt=f;L.fillStyle=E[rt.color];let _t=rt.shape;for(let Oe=0;Oe<_t.length;Oe++)for(let In=0;In<_t[0].length;In++)if(_t[Oe][In]!==0){let ts=(rt.x+In)*Bt,D=ct+(rt.y+Oe)*Dt;L.fillRect(ts,D,Bt-1,Dt-1)}}L.fillStyle="#ffffff",L.font="bold 16px monospace",L.fillText("Score: "+a,10,20),L.fillText("Lines: "+c,160,20),L.fillText("Pieces: "+l,290,20),r==="gameover"&&(L.fillStyle="rgba(0,0,0,0.7)",L.fillRect(0,200,390,200),L.fillStyle="#ff4444",L.font="bold 28px monospace",L.textAlign="center",L.fillText("GAME OVER",195,300),L.font="14px monospace",L.fillStyle="#aaaaaa",L.fillText("Tap to restart",195,340),L.textAlign="left")}function Le(){try{_&&_.cancel()}catch{}_=null}function te(){return{seed:o,state:()=>({phase:r,result:r==="gameover"?"lose":null,score:a,lines:c,piecesLocked:l,board:h.map(L=>L.slice())})}}return{init:dn,update:fn,render:ce,destroy:Le,_forensicsView:te}}var pd=ss,gd=ss;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Ic)),s=(t.seed!=null?t.seed:305441741)>>>0,i=va({seed:s});return na({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ss,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Bc(md);})();
+color = `+this.color),t}renderDebug(t=!0){let e=t?this.isHoverObject()?Ka:this.disabled?tc:this.interactive?rr:Za:Qa;C.drawRect(this.nativePos,this.size,ye,4,e)}click(t=!0){this.onClick(),t&&this.soundClick&&this.soundClick.play()}onUpdate(){}onRender(){}onEnter(){}onLeave(){}onPress(){}onRelease(){}onClick(){}onChange(){}},vi=class extends ae{constructor(t,e,s="",i="center",o=C.defaultFont){super(t,e),p(U(s),"ui text must be a string"),p(["left","center","right"].includes(i),"ui text align must be left, center, or right"),p(U(o),"ui text font must be a string"),this.text=s,this.align=i,this.font=o,this.canBeHover=!1,this.color=ye,this.shadowColor=ye,this.gradientColor=void 0,this.lineWidth=0,this.textFitScale=1}render(){super.render();let t=this.getTextSize();C.drawText(this.text,this.nativePos,t,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow,this.shadowColor,this.shadowBlur,this.shadowOffset)}},Mo=class extends ae{constructor(t,e,s=""){super(t,e),p(U(s),"ui text must be a string"),this.maxLength=0,this.text=s,this.interactive=!0,this.canBeHover=!0}click(){C.keyInputObject=this,this.onClick()}stopEditing(){this.isKeyInputObject()&&(this.soundRelease&&this.soundRelease.play(),C.activeObject=void 0,C.keyInputObject=void 0,this.onChange())}onKeyDown(t){let e=t.code,s=t.key;e==="Backspace"?this.text=this.text.slice(0,-1):e==="Enter"||e==="Escape"?this.stopEditing():s.length===1&&(!this.maxLength||this.text.lengththis.size.y,s=e?this.size.y:this.size.x,i=e?this.size.x:this.size.y,o=e?this.nativePos.x:this.nativePos.y,r=i-s,a=o-r/2,c=o+r/2,l=C.screenToNative(Ut);this.value=e?jt(l.x,a,c):jt(l.y,c,a)}else if(this.isNavigationObject()){let e=C.getNavigationOtherDirection();C.navigationTimer.active()||(this.value=F(this.value+e*.01))}this.value===t||this.onChange()}render(){super.render();let t=this.size.x>this.size.y,e=t?this.size.x:this.size.y,s=t?this.size.y:this.size.x;if(this.fillMode){let o=Q(s,this.cornerRadius*2),r=qt(o,e,this.value),a=(r-e)*(t?.5:-.5),c=this.nativePos.add(t?b(a,0):b(0,a)),l=this.disabled?this.disabledColor:this.handleColor,u=t?b(r,this.size.y):b(this.size.x,r);C.drawRect(c,u,l,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}else{let o=F(t?this.value:1-this.value),r=(e-s)*(o-.5),a=this.nativePos.add(t?b(r,0):b(0,r)),c=this.disabled?this.disabledColor:this.handleColor,l=b(s);C.drawRect(a,l,c,this.lineWidth,this.lineColor,this.cornerRadius,this.gradientColor)}let i=this.getTextSize();C.drawText(this.text,this.nativePos,i,this.textColor,this.textLineWidth,this.textLineColor,this.align,this.font,this.fontStyle,!0,this.textShadow)}navigatePressed(){this.value=this.value?0:1,this.onChange(),this.onRelease(),super.navigatePressed()}},jo=class extends ae{constructor(t,e,s,i=!1,o=!1,r=1){super(t,e||b()),p(U(s),"video src must be a string"),p(P(r),"video volume must be a number"),this.color=st,this.cornerRadius=0,this.volume=r,this.video=document.createElement("video"),this.video.loop=o,this.video.volume=F(r*wn),this.video.muted=!Xt,this.video.style.display="none",this.video.src=s,document.body.appendChild(this.video),i&&this.play()}async play(){try{await this.video.play()}catch{}}pause(){this.video.pause()}stop(){this.video.pause(),this.video.currentTime=0}isLoading(){return this.video.readyState=1,"ui layout columns must be a number >= 1"),p(P(s),"ui layout gap must be a number"),p(P(i),"ui layout padding must be a number"),this.columns=e,this.gap=s,this.padding=i,o&&(this.color=ye,this.gradientColor=void 0,this.lineWidth=0,this.shadowColor=ye),this.relayout()}addChild(t){return super.addChild(t),this.relayout(),t}removeChild(t){super.removeChild(t),this.relayout()}relayout(){let t=this.children.length;if(!t){this.size=b(this.padding*2);return}let e=this.columns,s=hs(t/e),i=new Array(e).fill(0),o=new Array(s).fill(0);for(let f=0;f=0&&m.objects.splice(t,1),super.destroy()}updatePhysics(){}render(){this.tileInfo?super.render():this.drawFixtures(this.color,this.lineColor,this.lineWidth)}renderDebugInfo(){let t=!this.getIsAwake(),e=this.getBodyType()===m.bodyTypeStatic,s=z(t?1:0,t?1:0,e?1:0,.5);this.drawFixtures(s)}drawFixtures(t=V,e=st,s=.1,i,o){this.getFixtureList().forEach(r=>{m.castShapeObject(r.GetShape()).GetType()!==m.instance.b2Shape.e_edge&&m.drawFixture(r,this.pos,this.angle,t,e,s,i,o)}),this.edgeLists.forEach(r=>mo(r,s,e,!1,this.pos,this.angle)),this.edgeLoops.forEach(r=>mo(r,s,e,!0,this.pos,this.angle))}beginContact(t){}endContact(t){}addShape(t,e=1,s=.2,i=0,o=!1){p(P(e),"density must be a number"),p(P(s),"friction must be a number"),p(P(i),"restitution must be a number");let r=new m.instance.b2FixtureDef;return r.set_shape(t),r.set_density(e),r.set_friction(s),r.set_restitution(i),r.set_isSensor(o),this.body.CreateFixture(r)}addBox(t=b(1),e=b(),s=0,i,o,r,a){p(O(t),"size must be a Vector2"),p(t.x>0&&t.y>0,"size must be positive"),p(O(e),"offset must be a Vector2"),p(P(s),"angle must be a number");let c=new m.instance.b2PolygonShape;return c.SetAsBox(t.x/2,t.y/2,m.vec2dTo(e),-s),this.addShape(c,i,o,r,a)}addPoly(t,e,s,i,o){p(pe(t),"points must be an array");function r(c){p(3<=c.length&&c.length<=8);let l=m.instance._malloc(c.length*8);for(let f=0,d=0;f>2]=c[f].x,d+=4,m.instance.HEAPF32[l+d>>2]=c[f].y,d+=4;let u=m.instance.wrapPointer(l,m.instance.b2Vec2),h=new m.instance.b2PolygonShape;return h.Set(u,c.length),m.instance._free(l),h}let a=r(t);return this.addShape(a,e,s,i,o)}addRegularPoly(t=1,e=8,s,i,o,r){p(P(t)&&t>0,"diameter must be a positive number"),p(P(e)&&e>2,"sides must be a positive number greater than 2");let a=[],c=t/2;for(let l=e;l--;)a.push(b(c,0).rotate((l+.5)/e*X*2));return this.addPoly(a,s,i,o,r)}addRandomPoly(t=1,e,s,i,o){p(P(t)&&t>0,"diameter must be a positive number");let r=or(3,9),a=[],c=t/2;for(let l=r;l--;)a.push(b(ft(c/2,c*1.5),0).rotate(l/r*X*2));return this.addPoly(a,e,s,i,o)}addCircle(t=1,e=b(),s,i,o,r){p(P(t)&&t>0,"diameter must be a positive number"),p(O(e),"offset must be a Vector2");let a=new m.instance.b2CircleShape;return a.set_m_p(m.vec2dTo(e)),a.set_m_radius(t/2),this.addShape(a,s,i,o,r)}addEdge(t,e,s,i,o,r){p(O(t),"point1 must be a Vector2"),p(O(e),"point2 must be a Vector2");let a=new m.instance.b2EdgeShape;return a.Set(m.vec2dTo(t),m.vec2dTo(e)),this.addShape(a,s,i,o,r)}addEdgeList(t,e,s,i,o){p(pe(t),"points must be an array");let r=[],a=[];for(let c=0;ct[ie(l,t.length)];for(let l=0;lthis.destroyFixture(t))}getCenterOfMass(){return m.vec2From(this.body.GetWorldCenter())}getLinearVelocity(){return m.vec2From(this.body.GetLinearVelocity())}getAngularVelocity(){return this.body.GetAngularVelocity()}getMass(){return this.body.GetMass()}getInertia(){return this.body.GetInertia()}getIsAwake(){return this.body.IsAwake()}getBodyType(){return this.body.GetType()}getSpeed(){return this.getLinearVelocity().length()}setTransform(t,e){this.pos=t,this.angle=e,this.body.SetTransform(m.vec2dTo(t),-e)}setPosition(t){this.setTransform(t,this.body.GetAngle())}setAngle(t){this.setTransform(m.vec2From(this.body.GetPosition()),t)}setLinearVelocity(t){this.body.SetLinearVelocity(m.vec2dTo(t))}setAngularVelocity(t){this.body.SetAngularVelocity(t)}setLinearDamping(t){this.body.SetLinearDamping(t)}setAngularDamping(t){this.body.SetAngularDamping(t)}setGravityScale(t=1){this.body.SetGravityScale(this.gravityScale=t)}setBullet(t=!0){this.body.SetBullet(t)}setAwake(t=!0){this.body.SetAwake(t)}setBodyType(t){this.body.SetType(t)}setSleepingAllowed(t=!0){this.body.SetSleepingAllowed(t)}setFixedRotation(t=!0){this.body.SetFixedRotation(t)}setCenterOfMass(t){this.setMassData(t)}setMass(t){this.setMassData(void 0,t)}setMomentOfInertia(t){this.setMassData(void 0,void 0,t)}resetMassData(){this.body.ResetMassData()}setMassData(t,e,s){let i=new m.instance.b2MassData;this.body.GetMassData(i),t!==void 0&&i.set_center(m.vec2dTo(t)),e!==void 0&&i.set_mass(e),s!==void 0&&i.set_I(s),this.body.SetMassData(i)}setFilterData(t=0,e=0,s=0){this.getFixtureList().forEach(i=>{let o=i.GetFilterData();o.set_categoryBits(t),o.set_maskBits(65535&~e),o.set_groupIndex(s)})}setSensor(t=!0){this.getFixtureList().forEach(e=>e.SetSensor(t))}applyForce(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyForce(m.vec2dTo(t),m.vec2dTo(e))}applyAcceleration(t,e){e||(e=this.getCenterOfMass()),this.setAwake();let s=t.scale(this.getMass());this.body.ApplyLinearImpulse(m.vec2dTo(s),m.vec2dTo(e))}applyImpulse(t,e){e||(e=this.getCenterOfMass()),this.setAwake(),this.body.ApplyLinearImpulse(m.vec2dTo(t),m.vec2dTo(e))}applyTorque(t){this.setAwake(),this.body.ApplyTorque(t)}applyAngularAcceleration(t){this.setAwake(),this.body.ApplyAngularImpulse(t*this.getInertia())}applyAngularImpulse(t){this.setAwake(),this.body.ApplyAngularImpulse(t)}hasFixtures(){return!m.isNull(this.body.GetFixtureList())}getFixtureList(){let t=[];for(let e=this.body.GetFixtureList();!m.isNull(e);)t.push(e),e=e.GetNext();return t}hasJoints(){return!m.isNull(this.body.GetJointList())}getJointList(){let t=[];for(let e=this.body.GetJointList();!m.isNull(e);)t.push(e),e=e.get_next();return t}},Si=class extends Rs{constructor(t,e,s,i=0,o,r=0){let a=m.bodyTypeStatic;super(t,e,s,i,o,a,r)}},Bo=class extends Rs{constructor(t,e,s,i=0,o,r=0){let a=m.bodyTypeKinematic;super(t,e,s,i,o,a,r)}},zo=class extends Si{constructor(t){p(t instanceof Ss,"tileLayer must be a TileCollisionLayer"),super(t.pos,t.size),this.tileLayer=t,this.addChild(t)}render(){}buildCollision(t=.2,e=0){this.destroyAllFixtures(),this.pos=this.tileLayer.pos.copy(),this.size=this.tileLayer.size.copy();let s=[],i=(r,a)=>r+a*this.size.x,o=(r,a)=>!s[i(r,a)]&&this.tileLayer.getCollisionData(b(r,a))>0;for(let r=0;ri.fractiono.pos.distanceSquared(t)0,"Tween duration must be > 0"),this.callback=t,this.start=e,this.end=s,this.duration=i,this.life=i,this.ease=o.ease||Ei.LINEAR,this.useRealTime=!!o.useRealTime,this.paused=!!o.paused,this.thenCallback=void 0,this.loopRemaining=0,Kt.push(this),t(this.interp(i))}setEase(t){return this.ease=t,this}then(t){return this.thenCallback=t,this.loopRemaining=0,this}loop(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Lc(this),this}pingPong(t=1/0){return this.loopRemaining=t,this.thenCallback=()=>Oc(this),this}pause(){this.paused=!0}resume(){this.paused=!1}restart(){this.life=this.duration,this.paused=!1,Kt.indexOf(this)<0&&Kt.push(this),this.callback(this.interp(this.duration))}isActive(){return!this.paused&&Kt.indexOf(this)>=0}getPercent(){return jt(this.duration-this.life,0,this.duration)}getValue(){return this.interp(this.life)}interp(t){let e=this.ease((this.duration-t)/this.duration);return La(this.start)?this.start.lerp(this.end,e):this.start+(this.end-this.start)*e}stop(){let t=Kt.indexOf(this);t>=0&&Kt.splice(t,1),this.thenCallback=void 0}},Ei={LINEAR:n=>n,POWER:n=>t=>t**n,SINE:n=>1-ct(n*(X/2)),CIRC:n=>1-(1-n*n)**.5,EXPO:n=>n===0?0:2**(10*n-10),BACK:n=>n*n*(2.70158*n-1.70158),ELASTIC:n=>n===0?0:n===1?1:-(2**(10*n-10))*nt((37-40*n)*X/6),SPRING:n=>1-(nt(X*(1-n)*(.2+2.5*(1-n)**3))*n**2.2+(1-n))*(1+1.2*n),BOUNCE:n=>{let t=1-n,e;return t<4/11?e=7.5625*t*t:t<8/11?e=7.5625*(t-=6/11)*t+.75:t<10/11?e=7.5625*(t-=9/11)*t+.9375:e=7.5625*(t-=10.5/11)*t+.984375,1-e},IN:n=>n,OUT:n=>t=>1-n(1-t),IN_OUT:n=>Ei.PIECEWISE(n,Ei.OUT(n)),PIECEWISE:(...n)=>{let t=n.length;return e=>{let s=e*t-1e-9>>0;return(n[s]((e-s/t)*t)+s)/t}},BEZIER:(n,t,e,s)=>{let i=o=>{let r=1-o,a=3*r*r*o,c=3*r*o*o,l=o**3;return[a*n+c*e+l,a*t+c*s+l]};return o=>{let r=0,a=1;for(let c=0;c<128;c++){let l=(r+a)/2,[u,h]=i(l);if(et(u-o)<1e-5)return h;u=this.size.x||e>=this.size.y?null:this.nodes[t+e*this.size.x]}worldToTile(t){let e=this.tileLayer?this.tileLayer.pos.x:0,s=this.tileLayer?this.tileLayer.pos.y:0;return b(St(t.x-e),St(t.y-s))}tileToWorld(t,e){let s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;return b(t+.5+s,e+.5+i)}buildNodeData(){let t=this.size.x,e=this.size.y,s=this.tileLayer?this.tileLayer.pos.x:0,i=this.tileLayer?this.tileLayer.pos.y:0;for(let o=0;o0&&(c?l>0&&bt(a.posWorld,lo,z(1,0,0,Q(.2,l*.05)),this.debugTime):bt(a.posWorld,lo,z(1,0,0,.25),this.debugTime))}}aStarSearch(t,e){p(t&&e,"aStarSearch needs both endpoints"),p(t!==e,"aStarSearch: start and end must differ \u2014 caller should handle trivial case"),p(t.walkable&&e.walkable,"aStarSearch: endpoints must be walkable");let s=[t];t.isOpen=!0;let i=0;for(;s.length>0;){let o=0,r=s[0].f;for(let c=1;cthis.maxLoop)break;a.isOpen=!1,s.splice(o,1),a.isClosed=!0,this.debug&&this.debugTime>0&&bt(a.posWorld,lo,z(1,1,1,.05),this.debugTime);for(let c=-1;c<=1;++c)for(let l=-1;l<=1;++l){if(l===0&&c===0)continue;let u=this.getNode(a.pos.x+l,a.pos.y+c);if(!u||!u.walkable||u.isClosed)continue;let h=1;if(l!==0&&c!==0){let v=this.getNode(a.pos.x+l,a.pos.y);if(!v||!v.walkable)continue;let w=this.getNode(a.pos.x,a.pos.y+c);if(!w||!w.walkable)continue;h=fd}let f=a.g+h+u.cost;if(!u.isOpen)u.isOpen=!0,s.push(u);else if(f>=u.g)continue;u.parent=a,u.g=f;let d=et(e.pos.x-u.pos.x),y=et(e.pos.y-u.pos.y),x=$(d,y)+(Math.SQRT2-1)*Q(d,y);u.f=u.g+x*this.heuristicWeight}}return e.parent!==null}getNearestClearNode(t,e=10,s=!0){p(O(t),"worldPos must be a Vector2"),s&&this.buildNodeData();let i=this.tileLayer?this.tileLayer.pos.x:0,o=this.tileLayer?this.tileLayer.pos.y:0,r=St(t.x-i),a=St(t.y-o);for(let c=0;c<=e;++c){let l=null,u=0;for(let h=-c;h<=c;++h)for(let f=-c;f<=c;++f){if(c>0&&et(f)!==c&&et(h)!==c)continue;let d=this.getNode(r+f,a+h);if(!d||!d.isClear())continue;let y=d.posWorld.x-t.x,x=d.posWorld.y-t.y,v=y*y+x*x;(!l||v0&&Vt(i.posWorld,.3,z(.5,0,.5,.5),this.debugTime),t.splice(e,1),e=$(1,e-1);continue}else if(c===2){this.debug&&this.debugTime>0&&Vt(i.posWorld,.3,z(1,0,0,.5),this.debugTime);let d,y;s.pos.y===i.pos.y&&o.pos.x===i.pos.x?(d=s.pos.x,y=o.pos.y):(d=o.pos.x,y=s.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t.splice(e,1),e=$(1,e-1);continue}}else if(c===5){this.debug&&this.debugTime>0&&Vt(i.posWorld,.3,z(1,1,0,.5),this.debugTime);let d=e>=2?t[e-2]:s,y,x,v,w;l===0||h===0?(y=o.pos.x,x=i.pos.y,v=s.pos.x,w=i.pos.y):(y=i.pos.x,x=o.pos.y,v=i.pos.x,w=s.pos.y);let _=y-d.pos.x,S=x-d.pos.y,E=v-d.pos.x,A=w-d.pos.y,T=_*_+S*S,R=E*E+A*A,M=T0&&Vt(i.posWorld,.3,z(0,1,0,.5),this.debugTime),l===h&&u===f){++e;continue}else{let d,y;s.pos.y===o.pos.y?(d=i.pos.x,y=s.pos.y):(d=s.pos.x,y=i.pos.y);let x=this.getNode(d,y);if(x&&x.isClear()){t[e]=x,e=$(1,e-1);continue}}++e}}smoothPathStringPull(t){if(t.length<=2)return;for(let i of t)if(!i.isClear())return;let e=t.slice();t.length=0,t.push(e[0]);let s=0;for(let i=1;i0&&Te(o.posWorld,t[t.length-1].posWorld,z(0,0,1,.3),.02,this.debugTime);continue}for(;s=1;--e){let s=t[e-1],i=t[e],o=t[e+1];(i.pos.x-s.pos.x)*(o.pos.y-s.pos.y)===(i.pos.y-s.pos.y)*(o.pos.x-s.pos.x)&&t.splice(e,1)}}isNodeClear(t,e){let s=this.getNode(t,e);return s!==null&&s.isClear()}isLineClear(t,e){p(O(t)&&O(e),"isLineClear needs Vector2 endpoints"),p(this.isNodeClear(t.x,t.y)&&this.isNodeClear(e.x,e.y),"isLineClear endpoints must be in-bounds and clear");let s=e.x-t.x,i=e.y-t.y,o=et(s),r=et(i),a=se(s),c=se(i),l=t.x,u=t.y;if(r===o){for(;l!==e.x;){if(l!==t.x&&(!this.isNodeClear(l,u)||!this.isNodeClear(l,u-c))||!this.isNodeClear(l,u+c))return!1;l+=a,u+=c}if(!this.isNodeClear(e.x,e.y-c))return!1}else if(ra.posWorld.copy());if(this.debug&&this.debugTime>0&&r.length>0){for(let a=1;apd,bootGameHost:()=>yd,default:()=>gd});var js=class{constructor(t){this._state=(t==null?2654435769:t)>>>0}next(){this._state=this._state+1831565813>>>0;let t=this._state;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}range(t,e){return t+this.next()*(e-t)}reseed(t){this._state=(t==null?2654435769:t)>>>0}},Ji=class{constructor(t){this._clock=t||Jc(),this._origin=this._clock()}nowMs(){return this._clock()}elapsedMs(){return this._clock()-this._origin}},Ui=class{constructor(t){this._time=t,this._subs=new Map}sourceFor(t){let e=this,s=t==null?null:t;return{on(i,o){if(e._assertType(i),typeof o!="function")throw new Error("[HostDevInputBridge] on \u7684 handler \u5FC5\u987B\u662F\u51FD\u6570");let r=e._subs.get(i)||[],a={handler:o,scope:s};return r.push(a),e._subs.set(i,r),{cancel(){let c=e._subs.get(i);if(!c)return;let l=c.indexOf(a);l>=0&&c.splice(l,1)}}},off(i,o){e._assertType(i);let r=e._subs.get(i);if(!r)return;let a=r.findIndex(c=>c.handler===o&&c.scope===s);a>=0&&r.splice(a,1)}}}_emit(t,e){this._assertType(t);let s=e||{},i={type:t,x:typeof s.x=="number"?s.x:0,y:typeof s.y=="number"?s.y:0,key:typeof s.key=="string"?s.key:"",tMs:this._time.nowMs()},o=this._subs.get(t);if(!o||o.length===0)return;let r=o.slice();for(let a of r)try{a.handler(i)}catch(c){Xe("[host-dev input] \u8F93\u5165 handler \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09type="+t,c)}}disposeScope(t){if(t==null)return 0;let e=0;for(let[s,i]of this._subs){let o=i.filter(r=>r.scope!==t);e+=i.length-o.length,o.length===0?this._subs.delete(s):this._subs.set(s,o)}return e}_subscriptionCount(){let t=0;for(let e of this._subs.values())t+=e.length;return t}_assertType(t){if(!Vi.has(t))throw new Error("[HostDevInputBridge] \u975E\u6CD5\u8F93\u5165\u4E8B\u4EF6\u7C7B\u578B\uFF1A"+String(t)+"\uFF08\u4EC5\u652F\u6301 "+Array.from(Vi).join("/")+"\uFF09")}},Vi=new Set(["pointerdown","pointermove","pointerup","keydown","keyup"]);function Xr(n){let t=n||{},e=new Ji(t.clock),s=new js(t.seed),i=t.seed==null?2654435769:t.seed>>>0,o=new Ui(e),r=typeof t.audioFactory=="function"?t.audioFactory:null,a=null,c=!1,l=typeof t.engineFactory=="function"?t.engineFactory:null,u=null,h=!1,f=new Map,d=0,y=0;function x(){if(a)return a;if(!r)return c||(qi("[host-dev audio] \u672A\u6CE8\u5165 audioFactory\uFF0CgetAudioContext \u8FD4\u56DE null\uFF08P6 \u987B\u5BB9\u9519\u964D\u7EA7\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u5DE5\u5382\uFF09"),c=!0),null;try{a=r()}catch(E){Xe("[host-dev audio] audioFactory \u629B\u9519\uFF0CgetAudioContext \u964D\u7EA7\u8FD4\u56DE null",E),a=null}return a}function v(){if(u)return u;if(!l)return h||(qi("[host-dev engine] \u672A\u6CE8\u5165 engineFactory\uFF0CgetEngine \u8FD4\u56DE null\uFF08\u63D2\u4EF6\u987B\u5BB9\u9519\u964D\u7EA7\uFF1A\u7C92\u5B50\u9000\u53D7\u63A7\u9762\u81EA\u7BA1/\u5408\u6210\u6838\u9000 vendored/\u6570\u5B66\u9000\u5185\u7F6E\uFF1B\u96C6\u6210\u6BB5\u6CE8\u5165\u771F\u5B9E\u80CC\u4E66\uFF09"),h=!0),null;try{u=l()}catch(E){Xe("[host-dev engine] engineFactory \u629B\u9519\uFF0CgetEngine \u964D\u7EA7\u8FD4\u56DE null",E),u=null}return u}function w(E,A){return{getContext2d(){return t.context2d==null?null:t.context2d},onFrame(R){let M=d++;return f.set(M,R),{cancel(){f.delete(M)}}},getInput(){return o.sourceFor(E)},getAudioContext(){return x()},getEngine(){return v()},time:e,random:A}}let _=w(null,s),S={context:_,tick(E){y+=1;let A=Array.from(f.values());for(let T of A)try{T(E,y)}catch(R){Xe("[host-dev tick] \u5E27\u56DE\u8C03\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09frame="+y,R)}},frameCount(){return y},inputBridge:o,deriveContextFor(E,A){let T=zc(i,E),R=new js(T);return w(A==null?E:A,R)}};return Object.defineProperty(_,Wi,{value:S,enumerable:!1,writable:!1,configurable:!1}),S}var Wi=Symbol("zaomeng.coreProtocol.contextBundle"),Ns=class{constructor(){this._plugins=new Map,this._initOrder=[],this._initErrors=[],this._phase="idle",this._disposed=!1,this._context=void 0,this._pluginContexts=new Map}register(t){if(!t||typeof t!="object")throw new Error("[PluginRegistry] register \u9700\u8981\u4E00\u4E2A\u63D2\u4EF6\u5BF9\u8C61");if(typeof t.name!="string"||t.name.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6\u7F3A\u5C11\u5408\u6CD5 name");if(typeof t.version!="string"||t.version.length===0)throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11\u5408\u6CD5 version");if(typeof t.init!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7F3A\u5C11 init \u51FD\u6570");if(t.dispose!=null&&typeof t.dispose!="function")throw new Error("[PluginRegistry] \u63D2\u4EF6 "+t.name+" \u7684 dispose \u5FC5\u987B\u662F\u51FD\u6570\u6216\u7701\u7565");if(this._plugins.has(t.name))throw new Error("[PluginRegistry] \u63D2\u4EF6\u91CD\u540D\u62D2\u7EDD\uFF1A"+t.name+" \u5DF2\u6CE8\u518C");return this._plugins.set(t.name,t),this}has(t){return this._plugins.has(t)}get(t){return this._plugins.get(t)}list(){return Array.from(this._plugins.keys())}initAll(){if(this._phase==="initialized")return qi("[PluginRegistry] initAll \u91CD\u590D\u8C03\u7528\uFF0C\u5DF2\u5FFD\u7565\uFF08\u5DF2\u5904\u4E8E initialized\uFF09"),this._initResult();if(this._phase==="disposed")throw new Error("[PluginRegistry] \u5DF2 dispose \u7684\u6CE8\u518C\u5668\u4E0D\u53EF\u518D initAll");if(this._context==null)throw new Error("[PluginRegistry] \u672A\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\uFF1A\u8BF7\u5728 initAll() \u4E4B\u524D\u8C03\u7528 useContext(context)\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context); reg.initAll();\uFF09");for(let[t,e]of this._plugins){let s=this._missingDeps(e);if(s.length>0){let o=new Error("[PluginRegistry] \u63D2\u4EF6 "+t+" \u4F9D\u8D56\u7F3A\u5931\uFF1A"+s.join(", ")+"\uFF08\u672A\u6CE8\u518C\uFF09");this._initErrors.push({name:t,error:o}),Xe("[PluginRegistry] \u8DF3\u8FC7 init\uFF08\u4F9D\u8D56\u7F3A\u5931\uFF0C\u5DF2\u9694\u79BB\uFF09\uFF1A"+t,o);continue}let i=this._contextFor(t);try{e.init(i),this._initOrder.push(t)}catch(o){let r=o instanceof Error?o:new Error(String(o));this._initErrors.push({name:t,error:r}),Xe("[PluginRegistry] \u63D2\u4EF6 init \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF0C\u4E0D\u8FDE\u5750\uFF09\uFF1A"+t,r)}}return this._phase="initialized",this._initResult()}_contextFor(t){let e=this._pluginContexts.get(t);if(e)return e;let s=this._context&&this._context[Wi],i;return s&&typeof s.deriveContextFor=="function"?i=s.deriveContextFor(t,t):i=this._context,this._pluginContexts.set(t,i),i}disposeAll(){if(this._disposed)return{disposed:[],errors:[]};let t=[],e=[],s=this._context&&this._context[Wi],i=s&&s.inputBridge;for(let o=this._initOrder.length-1;o>=0;o--){let r=this._initOrder[o],a=this._plugins.get(r);if(a&&typeof a.dispose=="function")try{a.dispose(),t.push(r)}catch(c){let l=c instanceof Error?c:new Error(String(c));e.push({name:r,error:l}),Xe("[PluginRegistry] \u63D2\u4EF6 dispose \u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+r,l)}if(i&&typeof i.disposeScope=="function")try{i.disposeScope(r)}catch(c){Xe("[PluginRegistry] \u56DE\u6536\u63D2\u4EF6\u8F93\u5165\u8BA2\u9605\u629B\u9519\uFF08\u5DF2\u9694\u79BB\uFF09\uFF1A"+r,c)}}return this._disposed=!0,this._phase="disposed",{disposed:t,errors:e}}useContext(t){if(this._phase!=="idle")throw new Error("[PluginRegistry] useContext \u5FC5\u987B\u5728 initAll() \u4E4B\u524D\u8C03\u7528\uFF08\u5F53\u524D\u9636\u6BB5\uFF1A"+this._phase+"\uFF09\u3002\u8BF7\u5728\u4EFB\u4F55 initAll/disposeAll \u4E4B\u524D\u6CE8\u5165\u53D7\u63A7\u4E0A\u4E0B\u6587\u3002");if(t==null||typeof t!="object")throw new Error("[PluginRegistry] useContext \u9700\u8981\u4E00\u4E2A\u53D7\u63A7\u4E0A\u4E0B\u6587\u5BF9\u8C61\u3002\uFF08host-dev \u7528\u6CD5\uFF1Aconst { context } = createHostDevContext(); reg.useContext(context);\uFF09");return this._context=t,this}_missingDeps(t){return!Array.isArray(t.dependencies)||t.dependencies.length===0?[]:t.dependencies.filter(e=>!this._plugins.has(e))}_initResult(){return{ok:this._initErrors.length===0,initialized:this._initOrder.slice(),errors:this._initErrors.slice()}}};function zc(n,t){let e=2166136261,s=16777619,i=n>>>0;for(let r=0;r<32;r+=8){let a=i>>>r&255;e^=a,e=Math.imul(e,s)>>>0}let o=String(t);for(let r=0;r>>0,e^=a>>>8&255,e=Math.imul(e,s)>>>0}return e>>>0}function Jc(){if(typeof globalThis!="undefined"&&globalThis.performance&&typeof globalThis.performance.now=="function")return()=>globalThis.performance.now();if(typeof process!="undefined"&&process.hrtime&&typeof process.hrtime.bigint=="function"){let n=process.hrtime.bigint();return()=>Number(process.hrtime.bigint()-n)/1e6}return()=>Date.now()}function Xe(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function qi(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var xd=Object.freeze(Array.from(Vi)),Yr="core-protocol-v0";var $r=Object.freeze(["t_boot","t_plugins_ready","t_game_init","t_first_paint","t_input_bound","t_game_start"]),Hi=$r.reduce((n,t,e)=>(n[t]=e,n),Object.create(null)),Uc=new Set($r);function Xi(n){let t=2166136261;for(let e=0;e>>0).toString(16).padStart(8,"0")}var Kr=Xi("runtime-probe::seed::v1");function Bs(n){return n===null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?"["+n.map(Bs).join(",")+"]":"{"+Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+Bs(n[e])).join(",")+"}"}function Qr(n){let t=Bs(n.extra==null?null:n.extra),e=Bs(Array.isArray(n.pluginSet)?n.pluginSet:[]);return["seq="+n.seq,"anchor="+n.anchor,"tMono="+n.tMono,"buildSha="+(n.buildSha||""),"pluginSet="+e,"extra="+t].join("|")}function Vc(n){return Math.round(n*1e3)/1e3}function Wc(n){if(!Array.isArray(n))return{ok:!1,reason:"records_not_array"};let t=Kr,e=-1;for(let s=0;stypeof E=="string").slice().sort():[],i=typeof t.sink=="function"?t.sink:null,o=t.autoBoot!==!1,r=typeof t.inputAnchorType=="string"?t.inputAnchorType:"pointerdown",a=()=>0,c=!1,l=0,u=Kr,h=[],f=new Set,d=-1,y=null,x=!1,v=!1,w=!1;function _(E,A){let T=null;if(!Uc.has(E))T="unknown_anchor";else{f.has(E)&&(T=T?T+";duplicate_anchor":"duplicate_anchor");let M=Hi[E];ME.time.nowMs(),c=!0,o&&!v&&_("t_boot",{auto:!0}),y=E.getInput().on(r,A=>{x||(x=!0,_("t_input_bound",{firstInput:!0,type:A.type}))}),_("t_input_bound",{stage:"registered",type:r})},dispose(){w||(y&&(y.cancel(),y=null),w=!0)},mark:_,getRecords(){return h.map(E=>({...E}))},toJSONL(){return h.map(E=>JSON.stringify(E)).join(`
+`)},verify(){return Wc(h)}}}function qc(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ta(n){let t=n.LJS,e=n.engineMath,s=n.engineMode,i=n.recHook||(()=>{});if(s!=="real")return null;let o=e;return{math:{lerp:(a,c,l)=>(i("math.lerp"),o.lerp(a,c,l)),smoothStep:a=>(i("math.smoothStep"),o.smoothStep(a)),easing:Object.fromEntries(Object.keys(o.easing).map(a=>[a,c=>(i("math.easing."+a),o.easing[a](c))]))},particles:{spawnEmitter(a){i("particles.spawnEmitter");let c=t.screenToWorld(t.vec2(a.pos.x,a.pos.y)),l=t.cameraScale,u=a.emitTime!=null?a.emitTime:a.count!=null?1/60:0,h=a.emitRate!=null?a.emitRate:a.count!=null?a.count*60:100,f=(a.speed!=null?a.speed:0)/l/60,d=a.damping!=null?a.damping:1,y=a.colorStart||{r:1,g:1,b:1,a:1},x=a.colorEnd||{r:1,g:1,b:1,a:0},v=t.rgb(y.r,y.g,y.b,y.a),w=t.rgb(x.r,x.g,x.b,x.a),_=new t.ParticleEmitter(c,a.angle!=null?a.angle:0,(a.emitSize!=null?a.emitSize:0)/l,u,h,a.coneAngle!=null?a.coneAngle:Math.PI,void 0,v,v,w,w,a.particleTime!=null?a.particleTime:.5,(a.sizeStart!=null?a.sizeStart:6)/l,(a.sizeEnd!=null?a.sizeEnd:0)/l,f,0,d,1,a.gravityScale!=null?a.gravityScale:0,Math.PI,.1,0,!1,a.additive!=null?a.additive:!1,!0);return{isActive(){return _.isActive()},stop(){_.destroyed||_.destroy(!0)}}}},audio:{synth:{synthSfx:a=>{i("audio.synth.synthSfx");try{return t.zzfxG(...a)}catch(c){return console.error("[host][engine-audio] zzfxG \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(c&&c.message?c.message:c)),null}},synthSong:(a,c,l,u)=>{i("audio.synth.synthSong");try{return t.zzfxM(a,c,l,u)}catch(h){return console.error("[host][engine-audio] zzfxM \u5408\u6210\u5F02\u5E38\uFF0C\u8FD4 null\uFF1A"+(h&&h.message?h.message:h)),null}}}}}}function ue(n){return n<0?0:n>1?1:n}function ea(n){let t=n.Ease,e=t.POWER(2),s=t.POWER(3),i=t.OUT(e),o=t.IN_OUT(e),r=t.OUT(s),a=t.IN_OUT(s),c=t.OUT(t.BACK),l=t.OUT(t.ELASTIC);return{lerp:(u,h,f)=>n.lerp(u,h,f),smoothStep:u=>n.smoothStep(u),easing:{linear:u=>t.LINEAR(ue(u)),quadIn:u=>e(ue(u)),quadOut:u=>i(ue(u)),quadInOut:u=>o(ue(u)),cubicIn:u=>s(ue(u)),cubicOut:u=>r(ue(u)),cubicInOut:u=>a(ue(u)),backIn:u=>t.BACK(ue(u)),backOut:u=>c(ue(u)),elasticIn:u=>t.ELASTIC(ue(u)),elasticOut:u=>l(ue(u))}}}var Ye=2,zs=1/60;async function na(n){let t=n.canvas,e=n.statusEl||null,s=n.engine,i=n.seed>>>0,o=n.mode||"play",r=n.engineMode||"real",a=n.viewport.w,c=n.viewport.h,l=n.factory,u=n.buildFactoryOpts||(()=>{}),h=n.plugins||{},f=n.registerOrder||Object.values(h),d=n.onReady||(()=>{}),y=n.recHook||(()=>{});function x(D){e&&(e.textContent=D)}let v=[];window.addEventListener("error",D=>v.push({type:"error",message:String(D&&D.message||D)})),window.addEventListener("unhandledrejection",D=>v.push({type:"unhandledrejection",message:String(D&&D.reason&&D.reason.message||D&&D.reason||D)}));let w=null,_=!1;function S(){if(!_)return null;if(w)return w;let D=window.AudioContext||window.webkitAudioContext;return D?(w=new D,w):null}let E=0,A=null,T=null,R=null,M=null,Z=[],it={},ht=null;function gt(D,ot){try{R&&R.mark(D,ot)}catch(ne){v.push({type:"mark",message:String(ne&&ne.message||ne)})}}function Nt(){T&&typeof T._refreshChecklist=="function"&&T._refreshChecklist(it)}async function He(D,ot){A=Xr({context2d:D,seed:i,audioFactory:S,clock:()=>E,engineFactory:()=>ta({LJS:r==="real"?s:null,engineMath:r==="real"?ea(s):null,engineMode:r,recHook:y})});let ne=new Ns;for(let me of f)ne.register(me);ne.useContext(A.context),M=ne.initAll(),Z=ne.list().concat(["runtime-probe"]),R=Zr({pluginSet:Z,inputAnchorType:"pointerdown",autoBoot:!0});let Rt=A.deriveContextFor("runtime-probe","runtime-probe");gt("t_boot",{by:"game-host",stage:"pre-init",engineMode:r}),gt("t_plugins_ready",{initialized:M.initialized.length,ok:M.ok});let Bi=u(A.context,{bundle:A,plugins:h,getRealAudioCtx:()=>w});T=l(Bi),await T.init({ctx:A.context,mainContext:D,canvas:ot(),seed:i}),ht=T&&typeof T._forensicsView=="function"?T._forensicsView():null,gt("t_game_init",{hasForensics:!!ht}),dt(),gt("t_first_paint",{frame:A.frameCount()});try{R.init(Rt)}catch(me){v.push({type:"probe-init",message:String(me&&me.message||me)})}gt("t_game_start",{mode:o,engineMode:r}),Nt(),d(dn,{bundle:A,game:T,probe:R,checklist:it,uncaught:v,pluginSet:Z,initRes:M,getGameForensics:()=>ht,mark:gt,stepOneFrame:dt})}let Ot=null;function dt(D){let ot=typeof D=="number"?D:zs;T&&(E+=ot*1e3,T.update(ot),r==="stub"&&Ot&&T.render(Ot),Nt())}function Dt(D){for(let ot=0;ot{}),T&&typeof T._onAudioUnlock=="function"&&T._onAudioUnlock()}let dn={seed:i,mode:o,engineMode:r,protocol:Yr,frameCount:()=>A?A.frameCount():0,stepFrames:Dt,startRaf:()=>B(),stopRaf:()=>j(),tap(D,ot){Le(),A&&(A.inputBridge._emit("pointerdown",{x:D,y:ot}),A.inputBridge._emit("pointerup",{x:D,y:ot}))},do(D){T&&typeof T._handleAction=="function"&&T._handleAction(D)},state:()=>ht?ht.state():{phase:"booting"}};function fn(D){let ot=A.inputBridge;function ne(Rt,Bi){let me=D.getBoundingClientRect();return{x:(Rt-me.left)/me.width*a,y:(Bi-me.top)/me.height*c}}D.addEventListener("pointerdown",Rt=>{Le(),ot._emit("pointerdown",ne(Rt.clientX,Rt.clientY))}),D.addEventListener("pointermove",Rt=>{ot._emit("pointermove",ne(Rt.clientX,Rt.clientY))}),D.addEventListener("pointerup",Rt=>{ot._emit("pointerup",ne(Rt.clientX,Rt.clientY))}),window.addEventListener("keydown",Rt=>{Le(),ot._emit("keydown",{key:Rt.key})}),window.addEventListener("keyup",Rt=>ot._emit("keyup",{key:Rt.key}))}let ce=0,Oe=!1,ee=0;function L(D){if(!Oe)return;ee===0&&(ee=D);let ot=(D-ee)/1e3;ee=D,ot>.05&&(ot=.05),dt(ot),ce=window.requestAnimationFrame(L)}function B(){r==="stub"&&(Oe||(Oe=!0,ee=0,ce=window.requestAnimationFrame(L)))}function j(){Oe=!1,ce&&window.cancelAnimationFrame(ce),ce=0}function H(D){D.width=a*Ye,D.height=c*Ye,D.style.width=a+"px",D.style.height=c+"px";let ot=D.getContext("2d",{willReadFrequently:!0});return ot.setTransform(Ye,0,0,Ye,0,0),ot}async function Bt(){let D=H(t);return Ot=D,await He(D,()=>t),fn(t),o==="evidence"?x(`evidence \u5C31\u7EEA seed=${i} \xB7 \u7528 host \u9A71\u52A8\uFF08stepFrames/tap\uFF09`):(x(`seed=${i} \xB7 \u70B9\u5F00\u59CB\uFF08\u9996\u6B21\u70B9\u51FB\u5F00\u58F0\uFF09`),B()),dn}let lt=()=>{},le=()=>{};function It(){window.__gameHostEngineInitFired=!0}function zt(){lt()}function at(){}function _t(){le()}function De(){}async function In(D){await He(D,()=>s.mainCanvas),fn(s.mainCanvas),lt=()=>{T&&(E+=zs*1e3,T.update(zs))},le=()=>{if(T){D.save(),D.setTransform(Ye,0,0,Ye,0,0);try{D.imageSmoothingEnabled=!1}catch{}T.render(D),D.restore()}},s.mainCanvas&&(s.mainCanvas.id="game-engine"),window.__engine={frame(){return s.frame},time(){return s.time},timeReal(){return s.timeReal},paused(){return s.paused},timeScale(){return s.timeScale},snapshot(){return{frame:s.frame,time:s.time,timeReal:s.timeReal,paused:s.paused,timeScale:s.timeScale}}},x(`engine RAF running \xB7 seed=${i} engine=real`)}if(r!=="real")return await Bt();if(!s){let D="real \u901A\u9053\u672A\u6CE8\u5165\u5F15\u64CE\uFF08opts.engine \u7F3A\u5931\uFF09\uFF1A\u8BF7\u7ECF entry \u5305\u88C5\u5C42\u542F\u52A8\uFF08host \u4E0D\u76F4\u63A5 import \u5F15\u64CE\uFF0CQ4/Option C\uFF09";throw x("ENGINE INJECT MISSING: "+D),new Error(D)}s.setGLEnable(!1),s.setShowSplashScreen(!1),s.setDebugWatermark(!1),s.setCanvasClearColor(s.BLACK),s.setCanvasFixedSize(s.vec2(a*Ye,c*Ye));let ts=document.createElement("div");return ts.id="engine-root",document.body.appendChild(ts),await s.engineInit(It,zt,at,_t,De,[],ts).then(()=>In(s.mainContext)).catch(D=>{throw window.__gameHostBootError=String(D&&D.message||D),x("ENGINE INIT FAILED: "+window.__gameHostBootError),D}),dn}var Yi=class{constructor(t){let e=t||{},s=typeof e.cellSize=="number"&&e.cellSize>0?e.cellSize:64;this._cellSize=s,this._cells=new Map,this._entries=new Map,this._seq=0}get size(){return this._entries.size}_cellRange(t){let e=this._cellSize,s=Math.floor((t.x-t.hw)/e),i=Math.floor((t.x+t.hw)/e),o=Math.floor((t.y-t.hh)/e),r=Math.floor((t.y+t.hh)/e);return{cx0:s,cy0:o,cx1:i,cy1:r}}insert(t,e){this._entries.has(t)&&this.remove(t);let{cx0:s,cy0:i,cx1:o,cy1:r}=this._cellRange(e),a=[];for(let l=i;l<=r;l++)for(let u=s;u<=o;u++){let h=u+","+l,f=this._cells.get(h);f||(f=new Set,this._cells.set(h,f)),f.add(t),a.push(h)}let c={x:e.x,y:e.y,hw:e.hw,hh:e.hh};this._entries.set(t,{id:t,box:c,seq:this._seq++,cells:a})}remove(t){let e=this._entries.get(t);if(!e)return!1;for(let s of e.cells){let i=this._cells.get(s);i&&(i.delete(t),i.size===0&&this._cells.delete(s))}return this._entries.delete(t),!0}query(t){let{cx0:e,cy0:s,cx1:i,cy1:o}=this._cellRange(t),r=new Set;for(let a=s;a<=o;a++)for(let c=e;c<=i;c++){let l=this._cells.get(c+","+a);if(l)for(let u of l)r.add(u)}return this._collect(r)}queryPoint(t,e){let s=this._cellSize,i=Math.floor(t/s),o=Math.floor(e/s),r=this._cells.get(i+","+o);return r?this._collect(new Set(r)):[]}clear(){this._cells.clear(),this._entries.clear(),this._seq=0}_collect(t){let e=[];for(let s of t){let i=this._entries.get(s);i&&e.push(i)}return e.sort((s,i)=>s.seq-i.seq),e.map(s=>({id:s.id,box:s.box}))}};function sa(n){let t=n||{},e=new Yi({cellSize:t.cellSize}),s=!1;return{name:"collision",version:"1.0.0",dependencies:[],spatial:e,init(o){},dispose(){s||(e.clear(),s=!0)}}}function ia(n){let t=!1;return{name:"physics-lite",version:"1.0.0",dependencies:[],init(s){},dispose(){t||(t=!0)}}}var Hc=["pointerdown","pointermove","pointerup","keydown","keyup"];function Jt(n){return n<0?0:n>1?1:n}var Xc=n=>(n=Jt(n),n*n),Yc=n=>(n=Jt(n),1-(1-n)*(1-n)),$c=n=>(n=Jt(n),n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2),Kc=n=>(n=Jt(n),n*n*n),Qc=n=>{n=Jt(n);let t=1-n;return 1-t*t*t},Zc=n=>(n=Jt(n),n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2),aa=2*Math.PI/3,oa=2*Math.PI/4.5,tl=n=>(n=Jt(n),n===0?0:n===1?1:-Math.pow(2,10*n-10)*Math.sin((n*10-10.75)*aa)),el=n=>(n=Jt(n),n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n*10-.75)*aa)+1),nl=n=>(n=Jt(n),n===0?0:n===1?1:n<.5?-(Math.pow(2,20*n-10)*Math.sin((20*n-11.125)*oa))/2:Math.pow(2,-20*n+10)*Math.sin((20*n-11.125)*oa)/2+1),Us=1.70158,Js=Us*1.525,ca=Us+1,sl=n=>(n=Jt(n),ca*n*n*n-Us*n*n),il=n=>{n=Jt(n);let t=n-1;return 1+ca*t*t*t+Us*t*t},ol=n=>(n=Jt(n),n<.5?Math.pow(2*n,2)*((Js+1)*2*n-Js)/2:(Math.pow(2*n-2,2)*((Js+1)*(n*2-2)+Js)+2)/2),rl=n=>Jt(n),ra=Object.freeze({linear:rl,quadIn:Xc,quadOut:Yc,quadInOut:$c,cubicIn:Kc,cubicOut:Qc,cubicInOut:Zc,elasticIn:tl,elasticOut:el,elasticInOut:nl,backIn:sl,backOut:il,backInOut:ol});var al=["linear","quadIn","quadOut","quadInOut","cubicIn","cubicOut","cubicInOut","elasticIn","elasticOut","elasticInOut","backIn","backOut","backInOut"];function cl(n){let t=n&&n.easing;if(!t)return ra;let e=i=>typeof t[i]=="function"?o=>t[i](Jt(o)):ra[i],s={};for(let i of al)s[i]=e(i);return Object.freeze(s)}var $i=class{constructor(t,e,s){let i=s||{};this._time=e,this._windowMs=typeof i.windowMs=="number"&&i.windowMs>0?i.windowMs:120;let o=Array.isArray(i.types)&&i.types.length>0?i.types:Hc;this._records=new Map,this._subs=[],this._disposed=!1;for(let r of o){this._records.set(r,null);let a=t.on(r,c=>{this._records.set(r,c.tMs)});this._subs.push(a)}}consume(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs?(this._records.set(t,null),!0):(this._records.set(t,null),!1)}peek(t,e){let s=typeof e=="number"?e:this._time.nowMs(),i=this._records.get(t);return i==null?!1:s-i<=this._windowMs}clear(){for(let t of this._records.keys())this._records.set(t,null)}dispose(){if(!this._disposed){for(let t of this._subs)try{t.cancel()}catch(e){}this._subs=[],this._disposed=!0}}};function la(n){let t=n||{},e=null,s=null,i=!1;return{name:"gamefeel",version:"1.0.0",dependencies:[],get inputBuffer(){return e},get easing(){return cl(s)},init(r){let a=r.getInput();e=new $i(a,r.time,{windowMs:t.inputBufferMs,types:t.inputTypes});let c=r.getEngine();s=c?c.math:null},dispose(){i||(e&&(e.dispose(),e=null),s=null,i=!0)}}}function Vs(n,t){let e=t<0?0:t>1?1:t;switch(n&&n.kind){case"constant":return n.value;case"linear":return n.from+(n.to-n.from)*e;case"easeInOut":{let s=e*e*(3-2*e);return n.from+(n.to-n.from)*s}case"decay":{let s=n.power==null?2:n.power,i=Math.pow(1-e,s);return n.to+(n.from-n.to)*i}default:return 0}}var ll=Object.freeze({burst:Object.freeze({mode:"burst",count:24,angle:0,spread:Math.PI,speedMin:80,speedMax:160,lifeMin:.4,lifeMax:.8,gravity:0,drag:0,sizeCurve:{kind:"decay",from:6,to:0,power:1.5},alphaCurve:{kind:"linear",from:1,to:0}}),trail:Object.freeze({mode:"continuous",rate:60,angle:Math.PI,spread:.25,speedMin:20,speedMax:50,lifeMin:.2,lifeMax:.5,gravity:0,drag:1.5,sizeCurve:{kind:"easeInOut",from:4,to:0},alphaCurve:{kind:"decay",from:.8,to:0,power:2}}),drift:Object.freeze({mode:"continuous",rate:12,angle:Math.PI/2,spread:.6,speedMin:10,speedMax:30,lifeMin:1.5,lifeMax:3,gravity:8,drag:.5,sizeCurve:{kind:"constant",value:3},alphaCurve:{kind:"decay",from:.7,to:0,power:1}})});function ul(n){let t=ll[n];return t?Ki(t):null}function Ki(n){let t={};for(let e of Object.keys(n)){let s=n[e];t[e]=s&&typeof s=="object"?Ki(s):s}return t}function hl(n,t,e){let s=n.mode==="continuous";return{pos:{x:t,y:e},angle:n.angle,coneAngle:n.spread,emitSize:0,emitTime:s?0:1/60,emitRate:s?n.rate||0:void 0,count:s?void 0:n.count||0,particleTime:(n.lifeMin+n.lifeMax)/2,speed:(n.speedMin+n.speedMax)/2,gravityScale:n.gravity||0,damping:n.drag!=null?1-n.drag/60:1,sizeStart:Vs(n.sizeCurve,0),sizeEnd:Vs(n.sizeCurve,1),colorStart:{r:1,g:1,b:1,a:Vs(n.alphaCurve,0)},colorEnd:{r:1,g:1,b:1,a:Vs(n.alphaCurve,1)},additive:!1}}function ua(n){let t=n||{},e=null,s=null,i=null,o=new Map,r=0,a={isActive(){return!1},stop(){}},c=0,l=1,u=0,h=0,f=0,d={x:0,y:0,remain:0,dur:0,amplitude:0,frequency:0,_phase:0},y={alpha:0,remain:0,dur:0,peak:0},x={scale:1,remain:0,dur:0,amplitude:0,frequency:0},v=!1;function w(A){if(u>0)if(u-=A,u<=0)u=0,l=1;else{let T=h>0?1-u/h:1;l=f+(1-f)*T}if(d.remain>0)if(d.remain-=A,d.remain<=0)d.remain=0,d.x=0,d.y=0;else{let T=d.remain/d.dur,R=d.amplitude*T;d._phase+=d.frequency*A*Math.PI*2,d.x=Math.sin(d._phase)*R,d.y=Math.cos(d._phase*1.3)*R}if(y.remain>0&&(y.remain-=A,y.remain<=0?(y.remain=0,y.alpha=0):y.alpha=y.peak*(y.remain/y.dur)),x.remain>0)if(x.remain-=A,x.remain<=0)x.remain=0,x.scale=1;else{let T=x.remain/x.dur,R=(1-T)*x.frequency*Math.PI*2;x.scale=1+Math.sin(R)*x.amplitude*T}}function _(A){c+=1,w(A)}function S(A){let T=A!==void 0?A:e?e.getContext2d():null;if(T&&y.alpha>0){T.globalAlpha=y.alpha,T.fillStyle="#ffffff";let R=T.canvas?T.canvas.width:0,M=T.canvas?T.canvas.height:0;T.fillRect(0,0,R,M),T.globalAlpha=1}}return{name:"particles-juice",version:"1.0.0",dependencies:[],init(A){var T;e=A,i=((T=A.getEngine())==null?void 0:T.particles)||null,typeof t.seed=="number"&&A.random.reseed(t.seed),t.autoStep!==!1&&(s=A.onFrame(R=>{_(R)}))},dispose(){v||(s&&(s.cancel(),s=null),o.forEach(A=>{try{A.stop()}catch{}}),o.clear(),l=1,u=0,d.remain=0,d.x=0,d.y=0,y.remain=0,y.alpha=0,x.remain=0,x.scale=1,v=!0)},spawnEmitter(A,T,R,M){let Z=typeof A=="string"?ul(A):Ki(A);if(!Z)return-1;M&&(Z=Object.assign(Z,M));let it=r++;if(!i)return o.set(it,a),it;let ht=i.spawnEmitter(hl(Z,T,R));return o.set(it,ht),it},stopEmitter(A){let T=o.get(A);if(T)try{T.stop()}catch{}},step(A){_(A)},render(A){S(A)},particleCount(){return 0},emitterCount(){let A=0;for(let T of o.values())T.isActive()&&(A+=1);return A},hitStop(A,T){h=Math.max(0,A),u=h,f=T==null?0:Math.max(0,Math.min(1,T)),l=h>0?f:1},getTimeScale(){return l},shakeScreen(A,T,R){d.dur=Math.max(0,A),d.remain=d.dur,d.amplitude=Math.max(0,T),d.frequency=R==null?30:R,d._phase=0,d.x=0,d.y=0},getShakeOffset(){return{x:d.x,y:d.y}},flashScreen(A,T){y.dur=Math.max(0,A),y.remain=y.dur,y.peak=T==null?.8:Math.max(0,Math.min(1,T)),y.alpha=y.dur>0?y.peak:0},getFlashAlpha(){return y.alpha},pulseScale(A,T,R){x.dur=Math.max(0,A),x.remain=x.dur,x.amplitude=T==null?.2:T,x.frequency=R==null?4:R,x.scale=1},getPulseScale(){return x.scale},juiceSnapshot(){return{timeScale:l,shake:{x:d.x,y:d.y},flashAlpha:y.alpha,pulseScale:x.scale}},probe(){return{particles:0,emitters:o.size,dropped:0,steps:c,disposed:v}}}}function ha(n){let t=yt(n.r)/255,e=yt(n.g)/255,s=yt(n.b)/255,i=Math.max(t,e,s),o=Math.min(t,e,s),r=(i+o)/2,a=0,c=0,l=i-o;return l>1e-12&&(c=r>.5?l/(2-i-o):l/(i+o),i===t?a=(e-s)/l%6:i===e?a=(s-t)/l+2:a=(t-e)/l+4,a*=60,a<0&&(a+=360)),{h:a,s:c,l:r}}function da(n){let t=(n.h%360+360)%360,e=$e(n.s),s=$e(n.l);if(e<1e-12){let a=Math.round(s*255);return{r:a,g:a,b:a}}let i=s<.5?s*(1+e):s+e-s*e,o=2*s-i,r=t/360;return{r:Math.round(Qi(o,i,r+1/3)*255),g:Math.round(Qi(o,i,r)*255),b:Math.round(Qi(o,i,r-1/3)*255)}}function Qi(n,t,e){let s=e;return s<0&&(s+=1),s>1&&(s-=1),s<1/6?n+(t-n)*6*s:s<1/2?t:s<2/3?n+(t-n)*(2/3-s)*6:n}function yt(n){return n<0?0:n>255?255:n}function $e(n){return n<0?0:n>1?1:n}function dl(n,t){let e=pl(n.from,t);if(e>=0&&e({r:yt(a.r),g:yt(a.g),b:yt(a.b)})),to:o}}function Zi(n,t,e){return n+(t-n)*e}function ml(n,t){let e=ha(n),s=e.h+(t.hue||0),i=$e(e.s*(t.sat==null?1:t.sat)),o=$e(e.l*(t.light==null?1:t.light));return da({h:s,s:i,l:o})}var bl=Object.freeze([Object.freeze([0,8,2,10]),Object.freeze([12,4,14,6]),Object.freeze([3,11,1,9]),Object.freeze([15,7,13,5])]);function fa(n){let t=n||{},e=null,s=!1,i={vignette:{enabled:to(t.vignette&&t.vignette.enabled,!1),strength:eo(t.vignette&&t.vignette.strength,.5)},dither:{enabled:to(t.dither&&t.dither.enabled,!1),strength:eo(t.dither&&t.dither.strength,.5)},scanline:{enabled:to(t.scanline&&t.scanline.enabled,!1),strength:eo(t.scanline&&t.scanline.strength,.5)}};function o(a){let c=a!==void 0?a:e?e.getContext2d():null;if(!c)return;let l=c.canvas?c.canvas.width:0,u=c.canvas?c.canvas.height:0;if(i.vignette.enabled&&i.vignette.strength>0&&l>0&&u>0){let h=c.createRadialGradient(l/2,u/2,Math.min(l,u)*.25,l/2,u/2,Math.max(l,u)*.75);h.addColorStop(0,"rgba(0,0,0,0)"),h.addColorStop(1,"rgba(0,0,0,"+i.vignette.strength.toFixed(3)+")"),c.fillStyle=h,c.fillRect(0,0,l,u)}if(i.scanline.enabled&&i.scanline.strength>0&&l>0&&u>0){c.fillStyle="rgba(0,0,0,"+(i.scanline.strength*.5).toFixed(3)+")";for(let h=0;h0&&l>0&&u>0&&typeof c.getImageData=="function"&&typeof c.putImageData=="function"){let h=c.getImageData(0,0,l,u);xl(h,i.dither.strength),c.putImageData(h,0,0)}}return{name:"palette-post",version:"1.0.0",dependencies:[],init(a){e=a},dispose(){s||(e=null,s=!0)},applyPaletteMap(a,c){return dl(a,c)},applyPaletteMapToBuffer(a,c){return fl(a,c)},lerpPaletteMap(a,c,l){return yl(a,c,l)},shiftHsl(a,c){return ml(a,c)},rgbToHsl(a){return ha(a)},hslToRgb(a){return da(a)},setPost(a){if(a)for(let c of["vignette","dither","scanline"])a[c]&&(typeof a[c].enabled=="boolean"&&(i[c].enabled=a[c].enabled),typeof a[c].strength=="number"&&(i[c].strength=$e(a[c].strength)))},getPost(){return{vignette:{enabled:i.vignette.enabled,strength:i.vignette.strength},dither:{enabled:i.dither.enabled,strength:i.dither.strength},scanline:{enabled:i.scanline.enabled,strength:i.scanline.strength}}},renderPost(a){o(a)},probe(){return{disposed:s,post:this.getPost()}}}}function xl(n,t){let e=$e(t);if(e<=0)return n;let{data:s,width:i}=n,r=255/(Math.max(2,Math.round(16-e*14))-1);for(let a=0;a+3>2)%i,l=Math.floor((a>>2)/i),u=(bl[l&3][c&3]/16-.5)*r;for(let h=0;h<3;h++){let f=s[a+h]+u,d=Math.round(f/r)*r;s[a+h]=d<0?0:d>255?255:d}}return n}function to(n,t){return typeof n=="boolean"?n:t}function eo(n,t){return typeof n=="number"?$e(n):t}var so=Object.freeze({blip:Object.freeze({name:"blip",params:Object.freeze([.6,0,880,0,.03,.06,1,1.5])}),thud:Object.freeze({name:"thud",params:Object.freeze([.8,0,90,0,.04,.18,0,1,0,0,0,0,0,4])}),chime:Object.freeze({name:"chime",params:Object.freeze([.5,0,660,.02,.12,.3,1,2])})}),pa=Object.keys(so);function vl(n){let t=[];return n==null||typeof n!="object"?{ok:!1,errors:["song \u5FC5\u987B\u662F\u5BF9\u8C61"]}:(!Array.isArray(n.instruments)||n.instruments.length===0?t.push("instruments \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.instruments.forEach((e,s)=>{(!Array.isArray(e)||e.some(i=>typeof i!="number"||!Number.isFinite(i)))&&t.push(`instruments[${s}] \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\u6570\u7EC4\uFF08ZzFX \u53C2\u6570\u5305\uFF09`)}),!Array.isArray(n.patterns)||n.patterns.length===0?t.push("patterns \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.patterns.forEach((e,s)=>{if(!Array.isArray(e)||e.length===0){t.push(`patterns[${s}] \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF08\u81F3\u5C11\u4E00\u4E2A\u58F0\u90E8\u901A\u9053\uFF09`);return}e.forEach((i,o)=>{if(!Array.isArray(i)||i.length<2){t.push(`patterns[${s}][${o}] \u901A\u9053\u81F3\u5C11\u542B [\u4E50\u5668\u7D22\u5F15, \u58F0\u50CF]`);return}if(i.some(c=>typeof c!="number"||!Number.isFinite(c))){t.push(`patterns[${s}][${o}] \u901A\u9053\u5FC5\u987B\u5168\u4E3A\u6709\u9650\u6570\u5B57`);return}let r=i[0]|0;Array.isArray(n.instruments)&&(r<0||r>=n.instruments.length)&&t.push(`patterns[${s}][${o}] \u4E50\u5668\u7D22\u5F15 ${r} \u8D8A\u754C\uFF08instruments \u957F\u5EA6 ${n.instruments.length}\uFF09`);let a=i[1];(a<-1||a>1)&&t.push(`patterns[${s}][${o}] \u58F0\u50CF ${a} \u8D8A\u754C\uFF08\u5E94 -1..+1\uFF09`)})}),!Array.isArray(n.sequence)||n.sequence.length===0?t.push("sequence \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4"):n.sequence.forEach((e,s)=>{if(typeof e!="number"||!Number.isInteger(e)){t.push(`sequence[${s}] \u5FC5\u987B\u662F\u6574\u6570 pattern \u7D22\u5F15`);return}Array.isArray(n.patterns)&&(e<0||e>=n.patterns.length)&&t.push(`sequence[${s}] \u7D22\u5F15 ${e} \u8D8A\u754C\uFF08patterns \u957F\u5EA6 ${n.patterns.length}\uFF09`)}),n.bpm!=null&&(typeof n.bpm!="number"||!(n.bpm>0))&&t.push("bpm \u5FC5\u987B\u662F\u6B63\u6570"),{ok:t.length===0,errors:t})}function be(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}function Sl(n,t){switch(n){case"ease-in":return t*t;case"ease-out":return Math.sqrt(t);case"constant":return 1;default:return t}}function ga(n,t){let e=be(t);return n==null||!Array.isArray(n.voices)?[]:n.voices.map(s=>{let i=String(s&&s.id!=null?s.id:""),o=Array.isArray(s&&s.channelIndices)?s.channelIndices.slice():[],r=typeof s.minIntensity=="number"?be(s.minIntensity):0,a=typeof s.maxIntensity=="number"?be(s.maxIntensity):1,c=typeof s.volumeCurve=="string"?s.volumeCurve:"linear",l=typeof s.baseVolume=="number"?be(s.baseVolume):1;if(ea)return{id:i,on:!1,volume:0,channelIndices:o};let u=a-r,h=u<=0?1:(e-r)/u,f=be(Sl(c,h)*l);return{id:i,on:!0,volume:f,channelIndices:o}})}function ya(n,t,e,s){try{let i=t[0]||[],o=t[1]||i,r=Math.max(i.length,o.length);if(r===0)return null;let c=n.createBuffer(2,r,44100);c.getChannelData(0).set(i),c.getChannelData(1).set(o.length?o:i);let l=n.createBufferSource();l.buffer=c,l.loop=!!s;let u=n.createGain();return u.gain.value=be(e*.3),l.connect(u),u.connect(n.destination),l.start(),{stop(){try{l.stop()}catch(h){}try{l.disconnect(),u.disconnect()}catch(h){}}}}catch(i){return io("[audio-music] \u53D7\u63A7\u97F3\u9891\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",i),null}}function ma(n){let t=n||{},e=typeof t.masterVolume=="number"?be(t.masterVolume):1,s=()=>null,i=null,o=null,r={voices:[]},a=1,c=null,l=!1,u=0,h=!1,f=!1;function d(){let S=s();return S==null?(u+=1,h||(no("[audio-music] \u65E0\u53D7\u63A7\u97F3\u9891\u4E0A\u4E0B\u6587\uFF08getAudioContext \u8FD4\u56DE null\uFF09\uFF0C\u5168\u90E8\u53D1\u58F0\u9759\u9ED8 no-op\uFF08\u8BC4\u4F30\u73AF\u5883\u65E0\u58F0\u5361\u65F6\u7684\u5BB9\u9519\u964D\u7EA7\uFF09"),h=!0),null):S}function y(){if(!o||!i)return null;try{let S=typeof o.bpm=="number"&&o.bpm>0?o.bpm:125;return i.synthSong(o.instruments,o.patterns,o.sequence,S)}catch(S){return io("[audio-music] \u66F2\u8C31\u6E32\u67D3\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8",S),null}}function x(){let S=ga(r,a);if(S.length===0)return 1;let E=0;for(let A of S)A.on&&(E=Math.max(E,A.volume));return E}function v(S,E){typeof E=="number"&&(a=be(E));let A=d();if(A==null||!o)return;w();let T=y();if(!T)return;let R=be(e*x());c=ya(A,T,R,S),l=!!S&&c!=null}function w(){c&&(c.stop(),c=null),l=!1}return{name:"audio-music",version:"1.0.0",dependencies:[],init(S){s=()=>S.getAudioContext();let E=S.getEngine&&S.getEngine();i=E?E.audio.synth:null},dispose(){f||(w(),f=!0)},loadSong(S){let E=vl(S);return E.ok?o={instruments:S.instruments,patterns:S.patterns,sequence:S.sequence,bpm:typeof S.bpm=="number"?S.bpm:125}:no("[audio-music] \u66F2\u8C31\u6821\u9A8C\u5931\u8D25\uFF0C\u672A\u8F7D\u5165\uFF1A"+E.errors.join("\uFF1B")),E},play(S){v(!1,S)},stop(){w()},loop(S){v(!0,S)},setIntensityLayering(S){r=S&&Array.isArray(S.voices)?{voices:S.voices}:{voices:[]}},setIntensity(S){a=be(S)},resolveVoices(S){return ga(r,S)},playSfx(S){let E=so[S];if(!E){no("[audio-music] \u672A\u77E5\u97F3\u6548\u9884\u8BBE\uFF1A"+String(S));return}let A=d();if(A!=null)try{let T=i?i.synthSfx(E.params):null;if(!T)return;ya(A,[T,T],e,!1)}catch(T){io("[audio-music] \u97F3\u6548\u64AD\u653E\u5F02\u5E38\uFF0C\u964D\u7EA7\u4E3A\u9759\u9ED8 name="+S,T)}},getPreset(S){return so[S]},listPresets(){return pa.slice()},probe(){return{hasAudio:s()!=null,hasSong:o!=null,intensity:a,voiceCount:r.voices.length,looping:l,silentNoops:u,presetCount:pa.length}}}}function io(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function no(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var wl="zaomeng.save";function Tl(n){if(typeof TextEncoder!="undefined")return new TextEncoder().encode(n).length;if(typeof Buffer!="undefined"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(n,"utf8");let t=0;for(let e=0;e=55296&&s<=56319?(t+=4,e++):t+=3}return t}function ro(){let n=new Map;return{getItem(t){return n.has(t)?n.get(t):null},setItem(t,e){n.set(t,e)},removeItem(t){n.delete(t)},keys(){return Array.from(n.keys())}}}function ba(){if(typeof localStorage=="undefined")throw new Error("[save-progress] createLocalStorageAdapter \u9700\u8981\u5168\u5C40 localStorage\uFF08\u4EC5\u6D4F\u89C8\u5668\u96C6\u6210\u6BB5\u53EF\u7528\uFF09\u3002node/host-dev \u8BF7\u7528\u7F3A\u7701\u5185\u5B58 adapter \u6216 createMemoryAdapter()\u3002");return{getItem(n){return localStorage.getItem(n)},setItem(n,t){localStorage.setItem(n,t)},removeItem(n){localStorage.removeItem(n)},keys(){let n=[];for(let t=0;t0?t.namespace:wl;if(e.indexOf(":")>=0)throw new Error('[save-progress] namespace \u4E0D\u5F97\u542B\u5206\u9694\u7B26 ":"\uFF08\u5F53\u524D="'+e+'"\uFF09');let s=typeof t.maxValueBytes=="number"&&t.maxValueBytes>0?Math.floor(t.maxValueBytes):32768,i=!Al(t.adapter),o=i?ro():t.adapter,r=e+":",a=0,c=0,l=!1;function u(d){return typeof d!="string"||d.length===0?r+String(d):r+d}function h(){try{let d=o.keys();return Array.isArray(d)?d.filter(y=>typeof y=="string"&&y.indexOf(r)===0):[]}catch(d){return es("[save-progress] adapter.keys() \u5F02\u5E38\uFF0C\u964D\u7EA7\u8FD4\u56DE\u7A7A\u96C6",d),[]}}return{name:"save-progress",version:"1.0.0",dependencies:[],init(d){h()},dispose(){},get(d,y){if(!oo(d))return y;let x;try{x=o.getItem(u(d))}catch(v){return es("[save-progress] adapter.getItem \u5F02\u5E38\uFF0C\u8FD4\u56DE\u9ED8\u8BA4\u503C key="+d,v),y}if(x==null)return y;try{return JSON.parse(x)}catch{return a+=1,l||(ns("[save-progress] \u68C0\u6D4B\u5230\u635F\u574F\u5B58\u6863\uFF08\u975E\u6CD5 JSON\uFF09\uFF0C\u5DF2\u5BB9\u9519\u56DE\u9000\u9ED8\u8BA4\u503C key="+d),l=!0),y}},set(d,y){if(!oo(d))return ns("[save-progress] set \u6536\u5230\u975E\u6CD5 key\uFF0C\u62D2\u7EDD\u5199\u5165\uFF1A"+String(d)),!1;let x;try{x=JSON.stringify(y)}catch{return c+=1,ns("[save-progress] \u503C\u4E0D\u53EF JSON \u5E8F\u5217\u5316\uFF08\u5FAA\u73AF\u5F15\u7528?\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1}if(x===void 0)return c+=1,ns("[save-progress] \u503C\u5E8F\u5217\u5316\u4E3A undefined\uFF08\u5982\u7EAF undefined/\u51FD\u6570\uFF09\uFF0C\u62D2\u7EDD\u5199\u5165 key="+d),!1;let v=Tl(x);if(v>s)return c+=1,ns("[save-progress] \u503C\u8D85\u5B57\u8282\u4E0A\u9650\u62D2\u7EDD\u5199\u5165 key="+d+"\uFF08"+v+" > "+s+" bytes\uFF09"),!1;try{return o.setItem(u(d),x),!0}catch(w){return c+=1,es("[save-progress] adapter.setItem \u5F02\u5E38\uFF0C\u5199\u5165\u5931\u8D25 key="+d,w),!1}},remove(d){if(oo(d))try{o.removeItem(u(d))}catch(y){es("[save-progress] adapter.removeItem \u5F02\u5E38\uFF08\u5DF2\u5FFD\u7565\uFF09key="+d,y)}},clear(){let d=h(),y=0;for(let x of d)try{o.removeItem(x),y+=1}catch(v){es("[save-progress] clear \u65F6 removeItem \u5F02\u5E38\uFF08\u5DF2\u8DF3\u8FC7\uFF09fullKey="+x,v)}return y},probe(){return{namespace:e,maxValueBytes:s,usingMemoryAdapter:i,size:h().length,corruptRecoveries:a,rejectedWrites:c}}}}function oo(n){return typeof n=="string"&&n.length>0}function Al(n){return!!n&&typeof n.getItem=="function"&&typeof n.setItem=="function"&&typeof n.removeItem=="function"&&typeof n.keys=="function"}function es(n,t){let e=t&&t.stack?t.stack:t&&t.message?t.message:t;typeof console!="undefined"&&typeof console.error=="function"&&console.error(n+(e?"\uFF1A"+e:""))}function ns(n){typeof console!="undefined"&&typeof console.warn=="function"&&console.warn(n)}var Cl={w:390,h:844};function va(n){let t=((n&&n.seed)!=null?n.seed:0)>>>0,e=sa({cellSize:96}),s=ia(),i=la({inputBufferMs:260,inputTypes:["pointerdown"]}),o=ua({seed:t,maxParticles:600}),r=fa({vignette:{enabled:!0,strength:.22}}),a=ma({masterVolume:.8}),c;try{c=ba()}catch(f){console.warn("[generic] localStorage \u4E0D\u53EF\u7528\uFF0C\u5B58\u6863\u9000\u5185\u5B58 adapter\uFF1A"+(f&&f.message)),c=ro()}let l=xa({namespace:"zaomeng-generic",adapter:c});return{plugins:{collision:e,physics:s,gamefeel:i,juice:o,palettePost:r,audioMusic:a,save:l},registerOrder:[e,s,i,o,r,l,a],viewport:Cl,buildFactoryOpts:(f,d)=>({runtime:{plugins:d.plugins,bundle:d.bundle,getRealAudioCtx:d.getRealAudioCtx}})}}function ss(n){let t=n||{},e=null,s=null,i=null,o=t.seed||42,r="booting",a=0,c=0,l=0,u="",h=[],f=null,d=null,y=0,x=.8,v=1,w=.5,_=null,S=[{shape:[[1,1,1,1]],color:1},{shape:[[1,1],[1,1]],color:2},{shape:[[0,1,0],[1,1,1]],color:3},{shape:[[0,1,1],[1,1,0]],color:4},{shape:[[1,1,0],[0,1,1]],color:5},{shape:[[1,0,0],[1,1,1]],color:6},{shape:[[0,0,1],[1,1,1]],color:7}],E=[null,"#00f0f0","#f0f000","#a000f0","#00f000","#f00000","#0000f0","#f0a000"];function A(){return e.random.next()}function T(L,B){return Math.floor(A()*(B-L+1))+L}function R(L){let B=S[L],j=B.shape.map(H=>H.slice());return{type:L,shape:j,x:Math.floor((10-j[0].length)/2),y:0,color:B.color}}function M(L){let B=L.length,j=L[0].length,H=[];for(let Bt=0;Bt=0;lt--)H[Bt].push(L[lt][Bt])}return H}function Z(L,B,j,H,Bt){let lt=Bt||L.shape;for(let le=0;le=10||at>=18||at>=0&&B[at][zt]!==0)return!0}return!1}function it(){let L=f;if(!L)return;let B=L.shape;for(let j=0;j=0&<<18&&(h[lt][Bt]=L.color)}if(l++,ht(),gt(),r!=="gameover"){let j=e.getEngine();if(j){if(j.particles)try{j.particles.spawnEmitter({pos:{x:L.x*39+19.5,y:L.y*46.9+23.45},count:10,speed:60,particleTime:.3,colorStart:{r:1,g:1,b:1,a:1},colorEnd:{r:1,g:1,b:1,a:0}})}catch{}if(j.audio&&j.audio.synth)try{j.audio.synth.synthSfx([1,.05,300,,,.15,,1.2])}catch{}}}}function ht(){let L=0;for(let B=17;B>=0;){let j=!0;for(let H=0;H<10;H++)if(h[B][H]===0){j=!1;break}if(j){for(let H=B;H>0;H--)h[H]=h[H-1].slice();h[0]=new Array(10).fill(0),L++}else B--}if(L>0){c+=L,L===1?a+=100:L===2?a+=300:L===3?a+=500:L===4&&(a+=800);let B=e.getEngine();if(B&&B.particles)try{B.particles.spawnEmitter({pos:{x:195,y:422},count:30,speed:120,particleTime:.6,colorStart:{r:.2,g:1,b:.2,a:1},colorEnd:{r:0,g:.8,b:0,a:0}})}catch{}if(B&&B.audio&&B.audio.synth)try{B.audio.synth.synthSfx([1,.1,500,,,.2,,1.5])}catch{}}}function gt(){if(!d){let B=T(0,6);d=R(B)}f=d;let L=T(0,6);if(d=R(L),Z(f,h,0,0,f.shape)){r="gameover",u="stack_to_top";return}f.x=Math.floor((10-f.shape[0].length)/2),f.y=0}function Nt(){if(!(!f||r==="gameover")){if(!Z(f,h,0,1,f.shape)){f.y++;return}it()}}function He(){if(!(!f||r==="gameover")){for(;!Z(f,h,0,1,f.shape);)f.y++;it()}}function Ot(L){!f||r==="gameover"||Z(f,h,L,0,f.shape)||(f.x+=L)}function dt(){if(!f||r==="gameover")return;let L=M(f.shape);Z(f,h,0,0,L)?Z(f,h,-1,0,L)?Z(f,h,1,0,L)||(f.shape=L,f.x+=1):(f.shape=L,f.x-=1):f.shape=L}function Dt(L){if(r!=="gameover")switch(L.key){case"ArrowLeft":Ot(-1);break;case"ArrowRight":Ot(1);break;case"ArrowUp":dt();break;case"ArrowDown":v=.05;break;case" ":He();break}}function Le(L){L.key==="ArrowDown"&&(v=1)}function dn(L){e=L.ctx,s=L.canvas,i=L.mainContext,h=new Array(18);for(let H=0;H<18;H++)h[H]=new Array(10).fill(0);e.random.reseed(o);let B=T(0,6);d=R(B),gt(),_=e.getInput().on("keydown",Dt),e.getInput().on("keyup",Le),a=0,c=0,l=0,y=0,r="playing",u="";let j=e.getEngine();if(j&&j.math)try{j.math.lerp(0,1,.5)}catch{}}function fn(L){let B=e.time.nowMs();if(r==="gameover")return;y+=L;let j=x*v;y>=j&&(y-=j,Nt())}function ce(L){L.fillStyle="#0a0a1a",L.fillRect(0,0,390,844);let B=39,j=46.8888,H=40,Bt=18*j,lt=40,It=(844-lt-20)/18,zt=390/10;L.strokeStyle="#1a1a3a",L.lineWidth=1;for(let at=0;at<=18;at++){let _t=lt+at*It;L.beginPath(),L.moveTo(0,_t),L.lineTo(390,_t),L.stroke()}for(let at=0;at<=10;at++){let _t=at*zt;L.beginPath(),L.moveTo(_t,lt),L.lineTo(_t,844),L.stroke()}for(let at=0;at<18;at++)for(let _t=0;_t<10;_t++){let De=h[at][_t];De>0&&(L.fillStyle=E[De],L.fillRect(_t*zt,lt+at*It,zt-1,It-1))}if(f&&r!=="gameover"){let at=f;L.fillStyle=E[at.color];let _t=at.shape;for(let De=0;De<_t.length;De++)for(let In=0;In<_t[0].length;In++)if(_t[De][In]!==0){let ts=(at.x+In)*zt,D=lt+(at.y+De)*It;L.fillRect(ts,D,zt-1,It-1)}}L.fillStyle="#ffffff",L.font="bold 16px monospace",L.fillText("Score: "+a,10,20),L.fillText("Lines: "+c,160,20),L.fillText("Pieces: "+l,290,20),r==="gameover"&&(L.fillStyle="rgba(0,0,0,0.7)",L.fillRect(0,200,390,200),L.fillStyle="#ff4444",L.font="bold 28px monospace",L.textAlign="center",L.fillText("GAME OVER",195,300),L.font="14px monospace",L.fillStyle="#aaaaaa",L.fillText("Tap to restart",195,340),L.textAlign="left")}function Oe(){try{_&&_.cancel()}catch{}_=null}function ee(){return{seed:o,state:()=>({phase:r,result:r==="gameover"?"lose":null,score:a,lines:c,piecesLocked:l,board:h.map(L=>L.slice())})}}return{init:dn,update:fn,render:ce,destroy:Oe,_forensicsView:ee}}var pd=ss,gd=ss;async function yd(n){let t=n||{},e=t.engine||await Promise.resolve().then(()=>(Mc(),Ic)),s=(t.seed!=null?t.seed:305441741)>>>0,i=va({seed:s});return na({canvas:t.canvas,statusEl:t.statusEl||null,engine:e,seed:s,mode:t.mode||"play",engineMode:"real",viewport:i.viewport,factory:ss,plugins:i.plugins,registerOrder:i.registerOrder,buildFactoryOpts:i.buildFactoryOpts,recHook:t.recHook||null,onReady:t.onReady||null})}return Bc(md);})();
diff --git a/game-runtime/games/_wg1-gen/tetris/bundle.iife.js.meta.json b/game-runtime/games/_wg1-gen/tetris/bundle.iife.js.meta.json
index e71e7751..081a76ea 100644
--- a/game-runtime/games/_wg1-gen/tetris/bundle.iife.js.meta.json
+++ b/game-runtime/games/_wg1-gen/tetris/bundle.iife.js.meta.json
@@ -1 +1 @@
-{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":27676,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/tetris/generated-factory.js":{"bytes":12500,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/tetris/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/tetris/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/tetris/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/tetris/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164219},"games/_wg1-gen/tetris/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5359},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4161},"src/plugins/palette-post/impl.js":{"bytesInOutput":4218},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/tetris/generated-factory.js":{"bytesInOutput":4621}},"bytes":212418}}}
\ No newline at end of file
+{"inputs":{"src/core/plugin.js":{"bytes":44317,"imports":[],"format":"esm"},"src/plugins/runtime-probe/impl.js":{"bytes":16639,"imports":[],"format":"esm"},"host-dev/engine-caps.js":{"bytes":13897,"imports":[],"format":"esm"},"host-dev/engine-math.js":{"bytes":6155,"imports":[],"format":"esm"},"src/host/boot-game-host.js":{"bytes":28239,"imports":[{"path":"src/core/plugin.js","kind":"import-statement","original":"../core/plugin.js"},{"path":"src/plugins/runtime-probe/impl.js","kind":"import-statement","original":"../plugins/runtime-probe/impl.js"},{"path":"host-dev/engine-caps.js","kind":"import-statement","original":"../../host-dev/engine-caps.js"},{"path":"host-dev/engine-math.js","kind":"import-statement","original":"../../host-dev/engine-math.js"}],"format":"esm"},"src/plugins/collision/impl.js":{"bytes":24812,"imports":[],"format":"esm"},"src/plugins/physics-lite/impl.js":{"bytes":14507,"imports":[],"format":"esm"},"src/plugins/gamefeel/impl.js":{"bytes":21715,"imports":[],"format":"esm"},"src/plugins/particles-juice/impl.js":{"bytes":31830,"imports":[],"format":"esm"},"src/plugins/palette-post/impl.js":{"bytes":20240,"imports":[],"format":"esm"},"src/plugins/audio-music/impl.js":{"bytes":24659,"imports":[],"format":"esm"},"src/plugins/save-progress/impl.js":{"bytes":14608,"imports":[],"format":"esm"},"src/host/generic-host-config.js":{"bytes":7803,"imports":[{"path":"src/plugins/collision/impl.js","kind":"import-statement","original":"../plugins/collision/impl.js"},{"path":"src/plugins/physics-lite/impl.js","kind":"import-statement","original":"../plugins/physics-lite/impl.js"},{"path":"src/plugins/gamefeel/impl.js","kind":"import-statement","original":"../plugins/gamefeel/impl.js"},{"path":"src/plugins/particles-juice/impl.js","kind":"import-statement","original":"../plugins/particles-juice/impl.js"},{"path":"src/plugins/palette-post/impl.js","kind":"import-statement","original":"../plugins/palette-post/impl.js"},{"path":"src/plugins/audio-music/impl.js","kind":"import-statement","original":"../plugins/audio-music/impl.js"},{"path":"src/plugins/save-progress/impl.js","kind":"import-statement","original":"../plugins/save-progress/impl.js"}],"format":"esm"},"games/_wg1-gen/tetris/generated-factory.js":{"bytes":12500,"imports":[],"format":"esm"},"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytes":640153,"imports":[],"format":"esm"},"games/_wg1-gen/tetris/entry-bundle.js":{"bytes":6230,"imports":[{"path":"src/host/boot-game-host.js","kind":"import-statement","original":"../../../src/host/boot-game-host.js"},{"path":"src/host/generic-host-config.js","kind":"import-statement","original":"../../../src/host/generic-host-config.js"},{"path":"games/_wg1-gen/tetris/generated-factory.js","kind":"import-statement","original":"./generated-factory.js"},{"path":"node_modules/littlejsengine/dist/littlejs.esm.js","kind":"dynamic-import","original":"littlejsengine"}],"format":"esm"}},"outputs":{"games/_wg1-gen/tetris/bundle.iife.js":{"imports":[],"exports":[],"entryPoint":"games/_wg1-gen/tetris/entry-bundle.js","inputs":{"node_modules/littlejsengine/dist/littlejs.esm.js":{"bytesInOutput":164219},"games/_wg1-gen/tetris/entry-bundle.js":{"bytesInOutput":507},"src/core/plugin.js":{"bytesInOutput":8989},"src/plugins/runtime-probe/impl.js":{"bytesInOutput":2794},"host-dev/engine-caps.js":{"bytesInOutput":1597},"host-dev/engine-math.js":{"bytesInOutput":498},"src/host/boot-game-host.js":{"bytesInOutput":5506},"src/plugins/collision/impl.js":{"bytesInOutput":1605},"src/plugins/physics-lite/impl.js":{"bytesInOutput":115},"src/plugins/gamefeel/impl.js":{"bytesInOutput":2533},"src/plugins/particles-juice/impl.js":{"bytesInOutput":4161},"src/plugins/palette-post/impl.js":{"bytesInOutput":4218},"src/plugins/audio-music/impl.js":{"bytesInOutput":6001},"src/plugins/save-progress/impl.js":{"bytesInOutput":3933},"src/host/generic-host-config.js":{"bytesInOutput":697},"games/_wg1-gen/tetris/generated-factory.js":{"bytesInOutput":4621}},"bytes":212565}}}
\ No newline at end of file
diff --git a/game-runtime/games/_wg1-gen/tetris/evidence/after-play.png b/game-runtime/games/_wg1-gen/tetris/evidence/after-play.png
index ae0ed46bb454342914f82dc829a133ad02c269a1..9d409abeb3f1a3cad057b0bf7957e45660a4ce05 100644
GIT binary patch
literal 26044
zcmd?RcT`i`w>GTDqx`HK3vv_z6;Y9<(xe|NO+ZCJYDAj!PJocaa+D*eNS7Lw5+OjS
z0TPl33P_jGNs~^15J&!aqo>Uh(@Uk;_W-fzpK5d`BGk~hMetk|6uqfi2>62hB2wr!i-V*2)NKc1QYw(Vd4
zoZ0r|$^X|EL*CmoH{134n51GtXx!RV@q7W~>Mr|E&!d}%ZOJX_43d?m!Pe@U
zvTvn3-e42tv9&4DmK6`6Mh|O;aUp0-nKa{3Bh|z@+dd#Xubz^Zz^BOB-Z)s@tsq4FZ164|K
zlGTLnR^Ry|M|1&?4!3i@kh5KLe{#!P75tQVHGytE2stKCn@mu=SNTqN@ti3?xapc@
zG&yKqO0l_uKp?R7{1V!NvRv6;>;6$Me9m7>CZ^48sJea#7_H254IlWJK+t$DTcq;2
zFW*qs2B}9mmfPZ4r6g>X?b{qgRKmCe=epd!czU2PqK!hjXa#(qa65;>r_9?(79ELh
zlb4x)SomG?SVN*5DzJh=>k(
zFw#4p6+iEiIO<9cKvPNNacw4|B`z29?ro;gF2iR|wLYdIt`;7`JANhf%a4z8YF*}{
zI7YFl!OXkDF1Jx&G|?+f2z9Zx`bE*SBHG3&wX1aVDWAqG*d*P$M<+l@W^1glFWb>D
zb|-Q#Ld-#o7Q?0XE%0g)ZkyOqJXVK((Yn02ZUV}4E3t+|Pkpmc;keXd!EyVV7wyfs
zD^!lDq$yUwJvLr4;hmMgLD4eyU60$GG-DBj;v?}g8hLY_(#DZn5&gYQ{5i6$hHHA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!=Kl77664=S6@^)p1f|}Y;@B
zPmyGVt1OjM?y;!vf2rNmlC1*p01pZ}MfJ=2?7{qoJnx&+4eC7yL((TW
zX|TdS(w&=InDtDX!*L@tJwQK~kd=VQj%Y*u6xVRel1t6n=aL=G-w=}5NA6A7y
zyBT8!6D1Yx&-N>fH{W;hG)DeESFOuGrN=|!SUK~GkHS?;)>LX2H_
z_){R~DW94UVL)f^yN97wMQbC2i4`jNpL?Sfi=ExS^Wx}#0K!PYz#F#;#rGW!4Zw%x
di+p-1C@6X7lagvh;sa-|{ujq7RZIW?

diff --git a/game-runtime/games/_wg1-gen/tetris/evidence/verdict.json b/game-runtime/games/_wg1-gen/tetris/evidence/verdict.json
index 39a3e82b..8ddd4ded 100644
--- a/game-runtime/games/_wg1-gen/tetris/evidence/verdict.json
+++ b/game-runtime/games/_wg1-gen/tetris/evidence/verdict.json
@@ -18,13 +18,13 @@
     },
     "D_render": {
       "pass": true,
-      "bright": 56257,
+      "bright": 202394,
       "maxCh": 255
     },
     "E_live": {
       "pass": true,
-      "distinctStates": 28,
-      "samples": 52
+      "distinctStates": 31,
+      "samples": 31
     },
     "B_uncaught": {
       "pass": true,
@@ -32,8 +32,18 @@
     },
     "F_wiring": {
       "pass": true,
-      "callCount": 3,
+      "callCount": 19,
       "sample": [
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx",
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx",
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx",
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx",
+        "particles.spawnEmitter",
+        "audio.synth.synthSfx",
         "particles.spawnEmitter",
         "audio.synth.synthSfx"
       ],
@@ -44,27 +54,28 @@
     },
     "G_input": {
       "pass": true,
-      "inputHash": "afbf31e7",
-      "controlHash": "5f498477",
-      "atFrame": 1311,
-      "ctrlFrame": -1
+      "inputHash": "e0e36b65",
+      "controlHash": "5e30ba3e",
+      "atFrame": 806,
+      "ctrlFrame": 811
     },
     "H_progress": {
-      "pass": false,
+      "pass": true,
       "checks": [
         {
           "path": "piecesLocked",
           "op": "increased",
           "before": 0,
-          "after": 1,
+          "after": 10,
           "pass": true,
           "why": "循环按键下落+硬降→锁定方块数上升;不下落/不锁定则不升"
         }
       ],
       "latch": {
-        "pass": false,
-        "reason": "真玩未到达 gameover 终态(终态不可达/无失败态/play-spec 未驱动到结束)",
-        "phaseNow": "playing"
+        "pass": true,
+        "dwelledMs": 600,
+        "after": "gameover",
+        "reason": ""
       },
       "state0": {
         "phase": "playing",
@@ -292,11 +303,11 @@
         ]
       },
       "state1": {
-        "phase": "playing",
-        "result": null,
+        "phase": "gameover",
+        "result": "lose",
         "score": 0,
         "lines": 0,
-        "piecesLocked": 1,
+        "piecesLocked": 10,
         "board": [
           [
             0,
@@ -315,7 +326,7 @@
             0,
             0,
             0,
-            0,
+            4,
             0,
             0,
             0,
@@ -327,8 +338,8 @@
             0,
             0,
             0,
-            0,
-            0,
+            4,
+            4,
             0,
             0,
             0,
@@ -340,7 +351,7 @@
             0,
             0,
             0,
-            0,
+            4,
             0,
             0,
             0,
@@ -349,152 +360,32 @@
           [
             0,
             0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0,
-            0
-          ],
-          [
-            0,
+            7,
             0,
             0,
             5,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            7,
+            0,
+            5,
+            5,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            7,
+            7,
             5,
             0,
             0,
@@ -505,10 +396,130 @@
           [
             0,
             0,
+            0,
+            2,
+            2,
+            0,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            0,
+            2,
+            2,
+            0,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            0,
+            0,
+            4,
+            0,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            0,
+            0,
+            4,
+            4,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            0,
+            2,
+            2,
+            4,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            0,
+            2,
+            2,
+            5,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            6,
+            6,
+            5,
+            5,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            6,
+            0,
+            5,
+            0,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            6,
+            5,
+            4,
+            0,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
             0,
             0,
             5,
             5,
+            4,
+            4,
+            0,
+            0,
+            0,
+            0
+          ],
+          [
+            0,
+            0,
+            5,
+            0,
+            0,
+            4,
             0,
             0,
             0,
@@ -518,6 +529,6 @@
       }
     }
   },
-  "pass": false,
+  "pass": true,
   "notes": []
 }
\ No newline at end of file