oneshotlm
Compare all models on this prompt →

Mario-style platformer · laguna-s-2.1

Output saved · Timed out Cost / run $0.0646 Runtime 900.3s

The 15-minute session limit cut this run off. The output is the HTML saved at that point.

Prompt for this run

Build a playable side-scrolling platformer using the provided Phaser library, with a classic Mario-inspired visual style. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. Use the provided `phaser.min.js` (global `Phaser`) through a plain local script tag; the runner will inline it into the final artifact. Required behavior: - Provide one completable scrolling level with solid platforms, gaps, collectible coins, patrolling enemies, and a goal flag. - Use Left/Right or A/D to run and Space to jump. Display the controls. Apply gravity and platform collision; prevent repeated mid-air jumping. - Landing on an enemy from above defeats it and bounces the player upward. Side contact or falling into a gap causes a loss state. - Collecting a coin removes it and increases the displayed count once. Reaching the goal flag shows a win state. - Keep the camera following the player within level bounds. Provide Restart that resets coins, enemies, player, and camera. - Generate all graphics using Phaser Graphics or generated textures. Do not load image or audio assets. Verify: Test running and jumping near the starting area. Check landing on a nearby platform and camera following as the player moves. Use Restart and check that the initial player position, visible coins, and camera position return.

⛨ sandboxed Open in new tab ↗

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modellaguna-s-2.1
vendorpoolside
harnesspi 0.87.1 · browser iteration
generated2026-10-07

METRICS

runtime900.3s
tokens in5093k
tokens out69k
cached5014k
cost / run$0.0646
Transcript · 100 messages
system

user

Build a playable side-scrolling platformer using the provided Phaser library, with a classic Mario-inspired visual style. Use HTML, CSS, and JavaScript as needed. Write it to `index.html` in the current working directory using your file tools. Inline your own CSS and JavaScript. Do not use external assets, CDNs, or network requests. Use the provided `phaser.min.js` (global `Phaser`) through a plain local script tag; the runner will inline it into the final artifact. Required behavior: - Provide one completable scrolling level with solid platforms, gaps, collectible coins, patrolling enemies, and a goal flag. - Use Left/Right or A/D to run and Space to jump. Display the controls. Apply gravity and platform collision; prevent repeated mid-air jumping. - Landing on an enemy from above defeats it and bounces the player upward. Side contact or falling into a gap causes a loss state. - Collecting a coin removes it and increases the displayed count once. Reaching the goal flag shows a win state. - Keep the camera following the player within level bounds. Provide Restart that resets coins, enemies, player, and camera. - Generate all graphics using Phaser Graphics or generated textures. Do not load image or audio assets. Verify: Test running and jumping near the starting area. Check landing on a nearby platform and camera following as the player moves. Use Restart and check that the initial player position, visible coins, and camera position return.

assistant
thinking
Let me start by understanding the task. I need to build a side-scrolling platformer using Phaser. Let me first check the current directory and the phaser.min.js file.

I'll start by examining the current directory and the provided Phaser library.

→ bash {"command":"ls -la /tmp/job-fPtsoQ/"}
→ bash {"command":"head -c 500 /tmp/job-fPtsoQ/phaser.min.js"}
toolResult

total 1168 drwx------ 3 node node 4096 Oct 7 05:03 . drwxrwxrwt 6 root root 4096 Oct 7 05:03 .. drwxr-xr-x 3 node node 4096 Oct 7 05:03 .home -rw-r--r-- 1 node node 1181917 Oct 7 05:03 phaser.min.js

toolResult

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(this,(()=>(()=>{var t={50792:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,r||t,o),h=i?i+e:e;re

assistant
thinking
Let me check the Phaser version and understand the API better.

Let me check the Phaser version to understand which API I'm working with.

→ bash {"command":"grep -o 'VERSION[^,]*' /tmp/job-fPtsoQ/phaser.min.js | head -5; echo \"---\"; grep -oE 'version:\"[^\"]*\"' /tmp/job-fPtsoQ/phas
→ bash {"command":"cd /tmp/job-fPtsoQ && node -e \"const Phaser = require('./phaser.min.js'); console.log('VERSION:', Phaser.VERSION); console.log(
toolResult

VERSION:"3.80.1" VERSION+" / https://phaser.io");else{var a VERSION+" ("+i+" | "+n+")")) --- version:"0.1.7" version:"0.1.6" version:"0.1.4"

toolResult

ction(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},27939:(t,e,i)=>{var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},7537:(t,e,i)=>{var s=i(37589);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!0):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},70238:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},89528:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100:(t,e,i)=>{var s=i(40987),n=i(90664);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},90664:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699:(t,e,i)=>{var s=i(28915),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},68957:(t,e,i)=>{var s=i(40987);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},87388:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},87837:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e<i?6:0):r===e?a=(i-t)/o+2:r===i&&(a=(t-e)/o+4),a/=6),s.hasOwnProperty("_h")?(s._h=a,s._s=h,s._v=l):(s.h=a,s.s=h,s.v=l),s}},75723:(t,e,i)=>{var s=i(62957);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},85386:(t,e,i)=>{var s=i(30976),n=i(40987);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},80333:(t,e,i)=>{var s=i(70238),n=i(30100),r=i(68957),o=i(87388);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},3956:(t,e,i)=>{var s=i(40987);s.ColorSpectrum=i(92728),s.ColorToRGBA=i(91588),s.ComponentToHex=i(62957),s.GetColor=i(37589),s.GetColor32=i(1e3),s.HexStringToColor=i(70238),s.HSLToColor=i(62183),s.HSVColorWheel=i(27939),s.HSVToRGB=i(7537),s.HueToComponent=i(89528),s.IntegerToColor=i(30100),s.IntegerToRGB=i(90664),s.Interpolate=i(13699),s.ObjectToColor=i(68957),s.RandomRGB=i(85386),s.RGBStringToColor=i(87388),s.RGBToHSV=i(87837),s.RGBToString=i(75723),s.ValueToColor=i(80333),t.exports=s},27460:(t,e,i)=>{t.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorMatrix:i(89422),Masks:i(69781),RGB:i(51767)}},6858:(t,e,i)=>{var s=i(83419),n=i(39429),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},80661:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount,o=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,o),s.stencilOp(s.KEEP,s.KEEP,s.INCR),r++):(s.stencilFunc(s.EQUAL,r+1,o),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=r,n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,o):s.stencilFunc(s.EQUAL,r,o)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},69781:(t,e,i)=>{t.exports={BitmapMask:i(6858),GeometryMask:i(80661)}},73894:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},40366:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},83719:(t,e,i)=>{var s=i(40366);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},57264:(t,e,i)=>{var s=i(25892);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},57811:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818:(t,e,i)=>{var s=i(13560);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},84902:(t,e,i)=>{var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(37277),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},93055:(t,e,i)=>{t.exports={EventEmitter:i(47565)}},20122:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.BARREL,t),this.amount=e}});t.exports=o},32251:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===o&&(o=1),void 0===a&&(a=1),void 0===h&&(h=4),n.call(this,r.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=o,this.strength=a,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},9047:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===o&&(o=1),void 0===h&&(h=4),n.call(this,r.BLUR,t),this.quality=e,this.x=i,this.y=s,this.steps=h,this.strength=o,this.glcolor=[1,1,1],null!=a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},27885:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===o&&(o=!1),void 0===a&&(a=1),void 0===h&&(h=1),void 0===l&&(l=1),n.call(this,r.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=o,this.strength=l,this.blurX=a,this.blurY=h}});t.exports=o},12578:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a){void 0===e&&(e=8),void 0===o&&(o=1),void 0===a&&(a=.005),n.call(this,r.CIRCLE,t),this.scale=o,this.feather=a,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(t){this.glcolor2[3]=t}}});t.exports=o},15802:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(14811),o=new s({Extends:n,initialize:function(t){n.call(this),this.type=r.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=o},72898:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},44553:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),n.call(this,r.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=o},68531:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===i&&(i=4),void 0===s&&(s=0),void 0===o&&(o=!1),n.call(this,r.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=o,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},37102:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l,u){void 0===s&&(s=.2),void 0===o&&(o=0),void 0===a&&(a=0),void 0===h&&(h=0),void 0===l&&(l=1),void 0===u&&(u=0),n.call(this,r.GRADIENT,t),this.alpha=s,this.size=u,this.fromX=o,this.fromY=a,this.toX=h,this.toY=l,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],null!=e&&(this.color1=e),null!=i&&(this.color2=i)},color1:{get:function(){var t=this.glcolor1;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor1;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}},color2:{get:function(){var t=this.glcolor2;return(t[0]<<16)+(t[1]<<8)+(0|t[2])},set:function(t){var e=this.glcolor2;e[0]=t>>16&255,e[1]=t>>8&255,e[2]=255&t}}});t.exports=o},86886:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.PIXELATE,t),this.amount=e}});t.exports=o},92322:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.1),void 0===o&&(o=1),void 0===h&&(h=6),void 0===l&&(l=1),n.call(this,r.SHADOW,t),this.x=e,this.y=i,this.decay=s,this.power=o,this.glcolor=[0,0,0,1],this.samples=h,this.intensity=l,void 0!==a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},39563:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=3),void 0===o&&(o=!1),n.call(this,r.SHINE,t),this.speed=e,this.lineWidth=i,this.gradient=s,this.reveal=o}});t.exports=o},56448:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===e&&(e=.5),void 0===i&&(i=.5),void 0===s&&(s=.5),void 0===o&&(o=.5),n.call(this,r.VIGNETTE,t),this.x=e,this.y=i,this.radius=s,this.strength=o}});t.exports=o},38433:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===e&&(e=.1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=!1),n.call(this,r.WIPE,t),this.progress=0,this.wipeWidth=e,this.direction=i,this.axis=s,this.reveal=o}});t.exports=o},14811:t=>{t.exports={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19}},66064:(t,e,i)=>{var s=i(79291),n=i(14811),r={Barrel:i(20122),Controller:i(72898),Bloom:i(32251),Blur:i(9047),Bokeh:i(27885),Circle:i(12578),ColorMatrix:i(15802),Displacement:i(44553),Glow:i(68531),Gradient:i(37102),Pixelate:i(86886),Shadow:i(92322),Shine:i(39563),Vignette:i(56448),Wipe:i(38433)};r=s(!1,r,n),t.exports=r},25305:(t,e,i)=>{var s=i(10312),n=i(23568);t.exports=function(t,e,i){e.x=n(i,"x",0),e.y=n(i,"y",0),e.depth=n(i,"depth",0),e.flipX=n(i,"flipX",!1),e.flipY=n(i,"flipY",!1);var r=n(i,"scale",null);"number"==typeof r?e.setScale(r):null!==r&&(e.scaleX=n(r,"x",1),e.scaleY=n(r,"y",1));var o=n(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=n(o,"x",1),e.scrollFactorY=n(o,"y",1)),e.rotation=n(i,"rotation",0);var a=n(i,"angle",null);null!==a&&(e.angle=a),e.alpha=n(i,"alpha",1);var h=n(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=n(h,"x",.5),u=n(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=n(i,"blendMode",s.NORMAL),e.visible=n(i,"visible",!0),n(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},13059:(t,e,i)=>{var s=i(23568);t.exports=function(t,e){var i=s(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var n=t.anims,r=s(i,"key",void 0);if(r){var o=s(i,"startFrame",void 0),a=s(i,"delay",0),h=s(i,"repeat",0),l=s(i,"repeatDelay",0),u=s(i,"yoyo",!1),c=s(i,"play",!1),d=s(i,"delayedPlay",0),f={key:r,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?n.play(f):d>0?n.playAfterDelay(f,d):n.load(f)}}return t}},8050:(t,e,i)=>{var s=i(83419),n=i(73162),r=i(37277),o=i(51708),a=i(44594),h=i(19186),l=new s({Extends:n,initialize:function(t){n.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.parentContainer&&t.parentContainer.remove(t),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list;t.length;)t[0].destroy(!0);this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});r.register("DisplayList",l,"displayList"),t.exports=l},95643:(t,e,i)=>{var s=i(83419),n=i(53774),r=i(45893),o=i(50792),a=i(51708),h=i(44594),l=new s({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new r(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new r(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return n(this)},willRender:function(t){return!(!(!this.displayList||!this.displayList.active||this.displayList.willRender(t))||l.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t&&t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},44603:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectCreator",o,"make"),t.exports=o},39429:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(r.BOOT,this.boot,this),this.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(r.DESTROY,this.destroy,this)},start:function(){this.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},n.register("GameObjectFactory",o,"add"),t.exports=o},91296:(t,e,i)=>{var s=i(61340),n=new s,r=new s,o=new s,a={camera:n,sprite:r,calc:o};t.exports=function(t,e,i){var s=n,h=r,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),s.multiply(h,l),a}},45027:(t,e,i)=>{var s=i(83419),n=i(25774),r=i(37277),o=i(44594),a=new s({Extends:n,initialize:function(t){n.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,s=i.length,n=0;n<s;n++){var r=i[n];r.active&&r.preUpdate.call(r,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(o.PRE_UPDATE,this.update,this),e.off(o.UPDATE,this.sceneUpdate,this),e.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("UpdateList",a,"updateList"),t.exports=a},3217:t=>{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p){var v=i.x-e.displayOriginX+n,g=i.y-e.displayOriginY+r,m=v+i.w,y=g+i.h,x=o.getXRound(v,g,a),T=o.getYRound(v,g,a),w=o.getXRound(v,y,a),b=o.getYRound(v,y,a),S=o.getXRound(m,y,a),E=o.getYRound(m,y,a),A=o.getXRound(m,g,a),C=o.getYRound(m,g,a);t.batchQuad(e,x,T,w,b,S,E,A,C,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,f,p)}},53048:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return s={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var n,r,o,a,h=t.text,l=h.length,u=t.maxWidth,c=t.wordWrapCharCode,d=Number.MAX_VALUE,f=Number.MAX_VALUE,p=0,v=0,g=t.fontData.chars,m=t.fontData.lineHeight,y=t.letterSpacing,x=t.lineSpacing,T=0,w=0,b=0,S=null,E=t._align,A=0,C=0,_=t.fontSize/t.fontData.size,M=_*t.scaleX,P=_*t.scaleY,R=null,L=0,O=[],F=Number.MAX_VALUE,D=0,k=0,I=0,B=[],N=[],U=null;if(u>0){for(n=0;n<l;n++)if(10!==(b=h.charCodeAt(n))){if(S=g[b]){if(null!==R)var X=S.kerning[L];b===c?null!==U&&(B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P,cr:!1}),U=null):(null===U&&(U={word:"",i:n,x:T,y:w,w:0,h:m,cr:!1}),U.word=U.word.concat(h[n]),U.w+=S.xOffset+S.xAdvance+(void 0!==X?X:0)),T+=S.xAdvance+y,R=S,L=b}}else null!==U&&(B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P,cr:!0}),U=null),T=0,w+=m+x,R=null;var Y;null!==U&&B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P,cr:!1}),T=0,w=0,R=null,L=0;var z=0,G=[];for(n=0;n<B.length;n++){var V=B[n],W=V.x,H=V.x+V.w;if(Y)z=W-(W-(Y.x+Y.w)+Y.w),Y=null;W-z>u||H-z>u?(G.push(V.i-1),V.cr?(G.push(V.i+V.word.length),z=0,Y=null):Y=V):V.cr&&(G.push(V.i+V.word.length),z=0,Y=null)}for(n=G.length-1;n>=0;n--)r=h,o=G[n],a="\n",h=r.substr(0,o)+a+r.substr(o+1);s.wrappedText=h,l=h.length,B=[],U=null}var j=0;for(n=0;n<l;n++)if(10!==(b=h.charCodeAt(n))){if(S=g[b]){if(A=T,C=w,null!==R){var q=S.kerning[L];A+=void 0!==q?q:0}d>A&&(d=A),f>C&&(f=C);var K=A+S.xAdvance,Z=C+m;p<K&&(p=K),v<Z&&(v=Z);var J=S.xOffset+S.xAdvance+(void 0!==q?q:0);b===c?null!==U&&(B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P}),U=null):(null===U&&(U={word:"",i:j,x:T,y:w,w:0,h:m}),U.word=U.word.concat(h[n]),U.w+=J),N.push({i:j,idx:n,char:h[n],code:b,x:(S.xOffset+A)*_,y:(S.yOffset+w)*_,w:S.width*_,h:S.height*_,t:w*_,r:K*_,b:m*_,line:k,glyph:S}),T+=S.xAdvance+y+(void 0!==q?q:0),R=S,L=b,I=K*_,j++}}else null!==U&&(B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P}),U=null),T=0,w+=m+x,R=null,O[k]=I,I>D&&(D=I),I<F&&(F=I),k++,I=0;if(null!==U&&B.push({word:U.word,i:U.i,x:U.x*M,y:U.y*P,w:U.w*M,h:U.h*P}),O[k]=I,I>D&&(D=I),I<F&&(F=I),E>0)for(var Q=0;Q<N.length;Q++){var $=N[Q];if(1===E){var tt=(D-O[$.line])/2;$.x+=tt,$.r+=tt}else if(2===E){var et=D-O[$.line];$.x+=et,$.r+=et}}var it=s.local,st=s.global,nt=s.lines;return it.x=d*_,it.y=f*_,it.width=p*_,it.height=v*_,st.x=t.x-t._displayOriginX+d*M,st.y=t.y-t._displayOriginY+f*P,st.width=p*M,st.height=v*P,nt.shortest=F,nt.longest=D,nt.lengths=O,e&&(it.x=Math.ceil(it.x),it.y=Math.ceil(it.y),it.width=Math.ceil(it.width),it.height=Math.ceil(it.height),st.x=Math.ceil(st.x),st.y=Math.ceil(st.y),st.width=Math.ceil(st.width),st.height=Math.ceil(st.height),nt.shortest=Math.ceil(F),nt.longest=Math.ceil(D)),i&&(t._displayOriginX=t.originX*it.width,t._displayOriginY=t.originY*it.height,st.x=t.x-t._displayOriginX*t.scaleX,st.y=t.y-t._displayOriginY*t.scaleY,e&&(st.x=Math.ceil(st.x),st.y=Math.ceil(st.y))),s.words=B,s.characters=N,s.lines.height=m,s.scale=_,s.scaleX=t.scaleX,s.scaleY=t.scaleY,s}},61327:(t,e,i)=>{var s=i(21859);t.exports=function(t,e,i,n,r,o,a){var h=t.sys.textures.get(i),l=h.get(n),u=t.sys.cache.xml.get(r);if(l&&u){var c=s(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:n,fromAtlas:!0}),!0}return!1}},6925:(t,e,i)=>{var s=i(35154);t.exports=function(t,e){var i=e.width,n=e.height,r=Math.floor(i/2),o=Math.floor(n/2),a=s(e,"chars","");if(""!==a){var h=s(e,"image",""),l=t.sys.textures.getFrame(h),u=l.cutX,c=l.cutY,d=l.source.width,f=l.source.height,p=s(e,"offset.x",0),v=s(e,"offset.y",0),g=s(e,"spacing.x",0),m=s(e,"spacing.y",0),y=s(e,"lineSpacing",0),x=s(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var T=p,w=v,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},S=0,E=0;E<a.length;E++){var A=a.charCodeAt(E),C=(u+T)/d,_=(c+w)/f,M=(u+T+i)/d,P=(c+w+n)/f;b.chars[A]={x:T,y:w,width:i,height:n,centerX:r,centerY:o,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:C,v0:_,u1:M,v1:P},++S===x?(S=0,T=p,w+=n+m):T+=i+g}return{data:b,frame:null,texture:h}}}},21859:t=>{function e(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,i,s,n,r){void 0===s&&(s=0),void 0===n&&(n=0);var o=i.cutX,a=i.cutY,h=i.source.width,l=i.source.height,u=i.sourceIndex,c={},d=t.getElementsByTagName("info")[0],f=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=e(d,"size"),c.lineHeight=e(f,"lineHeight")+n,c.chars={};var p=t.getElementsByTagName("char"),v=void 0!==i&&i.trimmed;if(v)var g=i.height,m=i.width;for(var y=0;y<p.length;y++){var x=p[y],T=e(x,"id"),w=String.fromCharCode(T),b=e(x,"x"),S=e(x,"y"),E=e(x,"width"),A=e(x,"height");v&&(b<m&&(m=b),S<g&&(g=S)),v&&0!==g&&0!==m&&(b-=i.x,S-=i.y);var C=(o+b)/h,_=(a+S)/l,M=(o+b+E)/h,P=(a+S+A)/l;if(c.chars[T]={x:b,y:S,width:E,height:A,centerX:Math.floor(E/2),centerY:Math.floor(A/2),xOffset:e(x,"xoffset"),yOffset:e(x,"yoffset"),xAdvance:e(x,"xadvance")+s,data:{},kerning:{},u0:C,v0:_,u1:M,v1:P},r&&0!==E&&0!==A){var R=r.add(w,u,b,S,E,A);R&&R.setUVs(E,A,C,_,M,P)}}var L=t.getElementsByTagName("kerning");for(y=0;y<L.length;y++){var O=L[y],F=e(O,"first"),D=e(O,"second"),k=e(O,"amount");c.chars[D].kerning[F]=k}return c}},196:(t,e,i)=>{var s=i(87662),n=i(79291),r={Parse:i(6925)};r=n(!1,r,s),t.exports=r},87662:t=>{t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},2638:(t,e,i)=>{var s=i(22186),n=i(83419),r=i(12310),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a){s.call(this,t,e,i,n,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},86741:(t,e,i)=>{var s=i(20926);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,f=e._letterSpacing,p=0,v=0,g=0,m=null,y=0,x=0,T=0,w=0,b=0,S=0,E=null,A=0,C=e.frame.source.image,_=h.cutX,M=h.cutY,P=0,R=0,L=e._fontSize/e.fontData.size,O=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===O?D=(k.longest-k.lengths[0])/2:2===O&&(D=k.longest-k.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var I=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var B=0;B<o;B++)if(R=L,P=0,10!==(g=r.charCodeAt(B))){if(m=c[g]){if(y=_+m.x,x=M+m.y,T=m.width,w=m.height,b=m.xOffset+p-e.scrollX,S=m.yOffset+v-e.scrollY,null!==E){var N=m.kerning[A];b+=void 0!==N?N:0}if(l){u.index=B,u.charCode=g,u.x=b,u.y=S,u.scale=R,u.rotation=P,u.data=m.data;var U=l(u);b=U.x,S=U.y,R=U.scale,P=U.rotation}b*=R,S*=R,b+=D,p+=m.xAdvance+f+(void 0!==N?N:0),E=m,A=g,0!==T&&0!==w&&32!==g&&(I&&(b=Math.round(b),S=Math.round(S)),a.save(),a.translate(b,S),a.rotate(P),a.scale(R,R),a.drawImage(C,y,x,T,w,0,0,T,w),a.restore())}}else F++,1===O?D=(k.longest-k.lengths[F])/2:2===O&&(D=k.longest-k.lengths[F]),p=0,v+=d,E=null;a.restore()}}},11164:(t,e,i)=>{var s=i(2638),n=i(25305),r=i(44603),o=i(23568);r.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),r=o(t,"text",""),a=o(t,"size",!1),h=new s(this.scene,0,0,i,r,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},72566:(t,e,i)=>{var s=i(2638);i(39429).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},12310:(t,e,i)=>{var s=i(29747),n=s,r=s;n=i(73482),r=i(86741),t.exports={renderWebGL:n,renderCanvas:r}},73482:(t,e,i)=>{var s=i(91296),n=i(61340),r=i(70554),o=new n;t.exports=function(t,e,i,n){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),u=s(e,i,n);t.pipelines.preBatch(e);var c=u.sprite,d=u.calc,f=o,p=e.cropWidth>0||e.cropHeight>0;p&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var v,g,m=e.frame.glTexture,y=e.tintFill,x=r.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),S=l.setGameObject(e),E=0,A=0,C=0,_=0,M=e.letterSpacing,P=0,R=0,L=e.scrollX,O=e.scrollY,F=e.fontData,D=F.chars,k=F.lineHeight,I=e.fontSize/F.size,B=0,N=e._align,U=0,X=0,Y=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=Y.wrappedText).length);var z=e._bounds.lines;1===N?X=(z.longest-z.lengths[0])/2:2===N&&(X=z.longest-z.lengths[0]);for(var G=i.roundPixels,V=e.displayCallback,W=e.callbackData,H=0;H<h;H++)if(10!==(C=a.charCodeAt(H))){if(v=D[C]){P=v.width,R=v.height;var j=v.xOffset+E-L,q=v.yOffset+A-O;if(null!==g){var K=v.kerning[_];j+=void 0!==K?K:0}if(E+=v.xAdvance+M,g=v,_=C,0!==P&&0!==R&&32!==C){if(I=e.fontSize/e.fontData.size,B=0,V){W.color=0,W.tint.topLeft=x,W.tint.topRight=T,W.tint.bottomLeft=w,W.tint.bottomRight=b,W.index=H,W.charCode=C,W.x=j,W.y=q,W.scale=I,W.rotation=B,W.data=v.data;var Z=V(W);j=Z.x,q=Z.y,I=Z.scale,B=Z.rotation,Z.color?(x=Z.color,T=Z.color,w=Z.color,b=Z.color):(x=Z.tint.topLeft,T=Z.tint.topRight,w=Z.tint.bottomLeft,b=Z.tint.bottomRight),x=r.getTintAppendFloatAlpha(x,i.alpha*e._alphaTL),T=r.getTintAppendFloatAlpha(T,i.alpha*e._alphaTR),w=r.getTintAppendFloatAlpha(w,i.alpha*e._alphaBL),b=r.getTintAppendFloatAlpha(b,i.alpha*e._alphaBR)}j*=I,q*=I,j-=e.displayOriginX,q-=e.displayOriginY,j+=X,f.applyITRS(j,q,B,I,I),d.multiply(f,c);var J=v.u0,Q=v.v0,$=v.u1,tt=v.v1,et=P,it=R,st=c.e,nt=c.f,rt=it*c.c+c.e,ot=it*c.d+c.f,at=et*c.a+it*c.c+c.e,ht=et*c.b+it*c.d+c.f,lt=et*c.a+c.e,ut=et*c.b+c.f;G&&(st=Math.round(st),nt=Math.round(nt),rt=Math.round(rt),ot=Math.round(ot),at=Math.round(at),ht=Math.round(ht),lt=Math.round(lt),ut=Math.round(ut)),l.shouldFlush(6)&&(l.flush(),S=l.setGameObject(e)),l.batchQuad(e,st,nt,rt,ot,at,ht,lt,ut,J,Q,$,tt,x,T,w,b,y,m,S)}}}else U++,1===N?X=(z.longest-z.lengths[U])/2:2===N&&(X=z.longest-z.lengths[U]),E=0,A+=k,g=null;p&&(l.flush(),t.popScissor()),t.pipelines.postBatch(e)}}},22186:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(31401),o=i(95643),a=i(53048),h=i(61327),l=i(21859),u=i(87841),c=i(18658),d=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Texture,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,s,n,r,h){void 0===n&&(n=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=s;var l=this.scene.sys.cache.bitmapFont.get(s);l||console.warn("Invalid BitmapText key: "+s),this.fontData=l.data,this._text="",this._fontSize=r||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.fromAtlas=l.fromAtlas,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(n)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setLineSpacing:function(t){return void 0===t&&(t=0),this.lineSpacing=t,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=s,this},setCharacterTint:function(t,e,i,s,r,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===s&&(s=-1),void 0===r&&(r=s,o=s,a=s);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=n(t,0,h-1);for(var l=n(t+e,t,h),u=this.charColors,c=t;c<l;c++){var d=u[c];if(-1===s)u[c]=null;else{var f=i?1:0;d?(d.tintEffect=f,d.tintTL=s,d.tintTR=r,d.tintBL=o,d.tintBR=a):u[c]={tintEffect:f,tintTL:s,tintTR:r,tintBL:o,tintBR:a}}}return this},setWordTint:function(t,e,i,s,n,r,o){void 0===e&&(e=1);for(var a=this.getTextBounds().words,h="number"==typeof t,l=0,u=0;u<a.length;u++){var c=a[u];if((h&&u===t||!h&&c.word===t)&&(this.setCharacterTint(c.i,c.word.length,i,s,n,r,o),++l===e))return this}return this},getTextBounds:function(t){var e=this._bounds;return(this._dirty||t||this.scaleX!==e.scaleX||this.scaleY!==e.scaleY)&&(a(this,t,!0,e),this._dirty=!1),e},getCharacterAt:function(t,e,i){for(var s=this.getLocalPoint(t,e,null,i),n=this.getTextBounds().characters,r=new u,o=0;o<n.length;o++){var a=n[o];if(r.setTo(a.x,a.t,a.r-a.x,a.b),r.contains(s.x,s.y))return a}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(t,e,i){void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align);var s=this.scene.sys.cache.bitmapFont.get(t);return s&&(this.font=t,this.fontData=s.data,this._fontSize=e,this._align=i,this.fromAtlas=!0===s.fromAtlas,this.setTexture(s.texture,s.frame),a(this,!1,!0,this._bounds)),this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},lineSpacing:{set:function(t){this._lineSpacing=t,this._dirty=!0},get:function(){return this._lineSpacing}},maxWidth:{set:function(t){this._maxWidth=t,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},displayWidth:{get:function(){return this.width}},displayHeight:{get:function(){return this.height}},toJSON:function(){var t=r.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,lineSpacing:this.lineSpacing,align:this.align};return t.data=e,t},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});d.ALIGN_LEFT=0,d.ALIGN_CENTER=1,d.ALIGN_RIGHT=2,d.ParseFromAtlas=h,d.ParseXMLBitmapFont=l,t.exports=d},37289:(t,e,i)=>{var s=i(20926);t.exports=function(t,e,i,n){var r=e._text,o=r.length,a=t.currentContext;if(0!==o&&s(t,a,e,i,n)){i.addToRenderList(e);var h=e.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=e._lineSpacing,f=0,p=0,v=0,g=null,m=0,y=0,x=0,T=0,w=0,b=0,S=null,E=0,A=h.source.image,C=h.cutX,_=h.cutY,M=e._fontSize/e.fontData.size,P=e._align,R=0,L=0,O=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=O.wrappedText).length);var F=e._bounds.lines;1===P?L=(F.longest-F.lengths[0])/2:2===P&&(L=F.longest-F.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,k=0;k<o;k++)if(10!==(v=r.charCodeAt(k))){if(g=l[v]){if(m=C+g.x,y=_+g.y,x=g.width,T=g.height,w=g.xOffset+f,b=g.yOffset+p,null!==S){var I=g.kerning[E];w+=void 0!==I?I:0}w*=M,b*=M,w+=L,f+=g.xAdvance+c+(void 0!==I?I:0),S=g,E=v,0!==x&&0!==T&&32!==v&&(D&&(w=Math.round(w),b=Math.round(b)),a.save(),a.translate(w,b),a.scale(M,M),a.drawImage(A,m,y,x,T,0,0,x,T),a.restore())}}else R++,1===P?L=(F.longest-F.lengths[R])/2:2===P&&(L=F.longest-F.lengths[R]),f=0,p+=u+d,S=null;a.restore()}}},57336:(t,e,i)=>{var s=i(22186),n=i(25305),r=i(44603),o=i(23568),a=i(35154);r.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),r=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),u=new s(this.scene,0,0,i,r,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},34914:(t,e,i)=>{var s=i(22186);i(39429).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},18658:(t,e,i)=>{var s=i(29747),n=s,r=s;n=i(33590),r=i(37289),t.exports={renderWebGL:n,renderCanvas:r}},33590:(t,e,i)=>{var s=i(3217),n=i(91296),r=i(70554);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=n(e,i,o).calc;t.pipelines.preBatch(e);var l,u,c,d=i.roundPixels,f=i.alpha,p=e.charColors,v=e.tintFill,g=r.getTintAppendFloatAlpha,m=g(e.tintTopLeft,f*e._alphaTL),y=g(e.tintTopRight,f*e._alphaTR),x=g(e.tintBottomLeft,f*e._alphaBL),T=g(e.tintBottomRight,f*e._alphaBR),w=e.frame.glTexture,b=a.setGameObject(e),S=e.getTextBounds(!1).characters,E=e.dropShadowX,A=e.dropShadowY;if(0!==E||0!==A){var C=e.dropShadowColor,_=e.dropShadowAlpha,M=g(C,f*_*e._alphaTL),P=g(C,f*_*e._alphaTR),R=g(C,f*_*e._alphaBL),L=g(C,f*_*e._alphaBR);for(l=0;l<S.length;l++)c=(u=S[l]).glyph,32!==u.code&&0!==c.width&&0!==c.height&&s(a,e,u,c,E,A,h,d,M,P,R,L,1,w,b)}for(l=0;l<S.length;l++)if(c=(u=S[l]).glyph,32!==u.code&&0!==c.width&&0!==c.height)if(a.shouldFlush(6)&&(a.flush(),b=a.setGameObject(e)),p[u.i]){var O=p[u.i],F=O.tintEffect,D=g(O.tintTL,f*e._alphaTL),k=g(O.tintTR,f*e._alphaTR),I=g(O.tintBL,f*e._alphaBL),B=g(O.tintBR,f*e._alphaBR);s(a,e,u,c,0,0,h,d,D,k,I,B,F,w,b)}else s(a,e,u,c,0,0,h,d,m,y,x,T,v,w,b);t.pipelines.postBatch(e)}}},6107:(t,e,i)=>{var s=i(48011),n=i(46590),r=i(83419),o=i(31401),a=i(4327),h=i(95643),l=i(73162),u=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,s],initialize:function(t,e,i,s,n){h.call(this,t,"Blitter"),this.setTexture(s,n),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,s,r){void 0===s&&(s=!0),void 0===r&&(r=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new n(this,t,e,i,s);return this.children.addAt(o,r,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,s){for(var n=this.createMultiple(e,i,s),r=0;r<n.length;r++){var o=n[r];t.call(this,o,r)}return n},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var s=[],n=this;return e.forEach((function(e){for(var r=0;r<t;r++)s.push(n.create(0,0,e,i))})),s},childCanRender:function(t){return t.visible&&t.alpha>0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},72396:t=>{t.exports=function(t,e,i,s){var n=e.getRenderList();if(0!==n.length){var r=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),r.globalCompositeOperation=t.blendModes[e.blendMode],r.imageSmoothingEnabled=!e.frame.source.scaleMode;var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;r.save(),s&&s.copyToContext(r);for(var l=i.roundPixels,u=0;u<n.length;u++){var c=n[u],d=c.flipX||c.flipY,f=c.frame,p=f.canvasData,v=f.x,g=f.y,m=1,y=1,x=c.alpha*o;0!==x&&(r.globalAlpha=x,d?(c.flipX&&(m=-1,v-=p.width),c.flipY&&(y=-1,g-=p.height),p.width>0&&p.height>0&&(r.save(),r.translate(c.x+a,c.y+h),r.scale(m,y),r.drawImage(f.source.image,p.x,p.y,p.width,p.height,v,g,p.width,p.height),r.restore())):(l&&(v=Math.round(v),g=Math.round(g)),p.width>0&&p.height>0&&r.drawImage(f.source.image,p.x,p.y,p.width,p.height,v+c.x+a,g+c.y+h,p.width,p.height)))}r.restore()}}}},9403:(t,e,i)=>{var s=i(6107),n=i(25305),r=i(44603),o=i(23568);r.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),a=new s(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},12709:(t,e,i)=>{var s=i(6107);i(39429).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},48011:(t,e,i)=>{var s=i(29747),n=s,r=s;n=i(99485),r=i(72396),t.exports={renderWebGL:n,renderCanvas:r}},99485:(t,e,i)=>{var s=i(61340),n=i(70554),r=new s;t.exports=function(t,e,i,s){var o=e.getRenderList(),a=i.alpha*e.alpha;if(0!==o.length&&0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=r.copyFrom(i.matrix);s&&(c.multiplyWithOffset(s,-l,-u),l=0,u=0);var d=e.x-l,f=e.y-u,p=-1;t.pipelines.preBatch(e);for(var v=0;v<o.length;v++){var g=o[v],m=g.frame,y=g.alpha*a;if(0!==y){var x=m.width,T=m.height,w=d+g.x+m.x,b=f+g.y+m.y;g.flipX&&(x*=-1,w+=m.width),g.flipY&&(T*=-1,b+=m.height);var S=c.setQuad(w,b,w+x,b+T),E=n.getTintAppendFloatAlpha(g.tint,y);if(m.sourceIndex!==p){var A=h.setGameObject(e,m);p=m.sourceIndex}h.batchQuad(e,S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],m.u0,m.v0,m.u1,m.v1,E,E,E,E,false,m.glTexture,A)&&(p=-1)}}t.pipelines.postBatch(e)}}},46590:(t,e,i)=>{var s=i(83419),n=i(4327),r=new s({initialize:function(t,e,i,s,n){this.parent=t,this.x=e,this.y=i,this.frame=s,this.data={},this.tint=16777215,this._visible=n,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof n&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=r},16005:(t,e,i)=>{var s=i(45319),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,n){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(e,0,1),this._alphaBL=s(i,0,1),this._alphaBR=s(n, [Showing last 50.0KB of line 2 (line is 178.4KB). Full output: /tmp/pi-bash-ff2ca3398b793790.log] Command exited with code 1

assistant
thinking
Phaser 3.80.1. Good. Let me verify it loads properly with a module check.

Phaser 3.80.1 confirmed. Let me verify it loads correctly as a module and check its key API.

→ bash {"command":"cd /tmp/job-fPtsoQ && node -e \"const Phaser = require('./phaser.min.js'); console.log('VERSION:', Phaser.VERSION); console.log(
toolResult

;return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var s=this.curves[i];s.active&&s.draw(t,e)}return t},ellipseTo:function(t,e,i,s,n,o){var a=new r(0,0,t,e,i,s,n,o),h=this.getEndPoint(this._tmpVec2A),l=a.getStartPoint(this._tmpVec2B);return h.subtract(l),a.x=h.x,a.y=h.y,this.add(a)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(a.fromJSON(i));break;case"EllipseCurve":this.add(r.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(n.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,s=f.MIN_SAFE_INTEGER,n=f.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var o=this.curves[r];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),s=Math.max(s,i.right),n=Math.max(n,i.bottom))}return t.right=s,t.bottom=n,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getCurveAt:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),s=0;s<i.length;){if(i[s]>=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],n=0;n<this.curves.length;n++){var r=this.curves[n];if(r.active)for(var o=r.getResolution(t),a=r.getPoints(o,e),h=0;h<a.length;h++){var l=a[h];i&&i.equals(l)||(s.push(l),i=l)}}return this.autoClose&&s.length>1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});o.register("path",(function(t,e){return new p(t,e)})),t.exports=p},45893:(t,e,i)=>{var s=i(83419),n=i(24882),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++)i.push(e[t[s]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,s=this.list,r=this.events,o=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return s[t]},set:function(e){if(!i._frozen){var a=s[t];s[t]=e,r.emit(n.CHANGE_DATA,o,t,e,a),r.emit(n.CHANGE_DATA_KEY+t,o,e,a)}}}),s[t]=e,r.emit(n.SET_DATA,o,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],s=1;s<arguments.length;s++)i.push(arguments[s]);for(var n in this.list)i[1]=n,i[2]=this.list[n],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(n.CHANGE_DATA),this.events.off(n.SET_DATA),this.events.off(n.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=r},63646:(t,e,i)=>{var s=i(83419),n=i(45893),r=i(37277),o=i(44594),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},10700:t=>{t.exports="changedata"},93608:t=>{t.exports="changedata-"},60883:t=>{t.exports="destroy"},69780:t=>{t.exports="removedata"},22166:t=>{t.exports="setdata"},24882:(t,e,i)=>{t.exports={CHANGE_DATA:i(10700),CHANGE_DATA_KEY:i(93608),DESTROY:i(60883),REMOVE_DATA:i(69780),SET_DATA:i(22166)}},44965:(t,e,i)=>{t.exports={DataManager:i(45893),DataManagerPlugin:i(63646),Events:i(24882)}},7098:(t,e,i)=>{var s=i(84148),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),o=parseInt(RegExp.$2,10);(10===r&&o>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},84148:(t,e,i)=>{var s,n=i(25892),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&n.iOS?(r.mobileSafari=!0,r.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},89289:(t,e,i)=>{var s,n,r,o=i(27919),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return o.remove(this),s}()),a)},89357:(t,e,i)=>{var s=i(25892),n=i(84148),r=i(27919),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},91639:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t<n.length;t++)if(document.documentElement[n[t]]){e.available=!0,e.request=n[t];break}var r=["cancel"+s,"exit"+i,"webkitCancel"+s,"webkitExit"+i,"msCancel"+s,"msExit"+i,"mozCancel"+s,"mozExit"+i];if(e.available)for(t=0;t<r.length;t++)if(document[r[t]]){e.cancel=r[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(e.keyboard=!0),Object.defineProperty(e,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),e}()},31784:(t,e,i)=>{var s=i(84148),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},25892:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267:(t,e,i)=>{var s=i(95540),n={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return n;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(n.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(n.h264=!0,n.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(n.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(n.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(n.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(n.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),n.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i,r=s(t[e],"url",t[e]);if(0===r.indexOf("blob:"))return{url:r,type:""};if(i=0===r.indexOf("data:")?r.split(",")[0].match(/\/(.*?);/):r.match(/\.([a-zA-Z0-9]+)($|\?)/),i=s(t[e],"type",i?i[1]:"").toLowerCase(),n[i])return{url:r,type:i}}return null},n}()},82264:(t,e,i)=>{t.exports={os:i(25892),browser:i(84148),features:i(89357),input:i(31784),audio:i(7098),video:i(43267),fullscreen:i(91639),canvasFeatures:i(89289)}},89422:(t,e,i)=>{var s=i(83419),n=new Float32Array(20),r=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(r.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(r.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(r.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(r.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(r.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(r.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(r.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(r.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(r.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(r.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(r.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=n;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});r.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],r.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],r.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],r.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],r.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],r.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],r.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],r.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],r.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],r.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],r.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=r},51767:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},60461:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(86327),o=i(88417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},46768:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},35827:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},46871:(t,e,i)=>{var s=i(66786),n=i(35893),r=i(7702);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5198:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},11879:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(54312),n[s.BOTTOM_LEFT]=i(46768),n[s.BOTTOM_RIGHT]=i(35827),n[s.CENTER]=i(46871),n[s.LEFT_CENTER]=i(5198),n[s.RIGHT_CENTER]=i(80503),n[s.TOP_CENTER]=i(89698),n[s.TOP_LEFT]=i(922),n[s.TOP_RIGHT]=i(21373),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},80503:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},89698:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(88417),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},922:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},21373:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},91660:(t,e,i)=>{t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926:(t,e,i)=>{var s=i(60461),n=i(79291),r={In:i(91660),To:i(16694)};r=n(!1,r,s),t.exports=r},21578:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(88417),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},10210:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},82341:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},87958:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40080:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},88466:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},38829:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(21578),n[s.BOTTOM_LEFT]=i(10210),n[s.BOTTOM_RIGHT]=i(82341),n[s.LEFT_BOTTOM]=i(87958),n[s.LEFT_CENTER]=i(40080),n[s.LEFT_TOP]=i(88466),n[s.RIGHT_BOTTOM]=i(19211),n[s.RIGHT_CENTER]=i(34609),n[s.RIGHT_TOP]=i(48741),n[s.TOP_CENTER]=i(49440),n[s.TOP_LEFT]=i(81288),n[s.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},19211:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},34609:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},48741:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},49440:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(86327),o=i(88417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},81288:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},61323:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},16694:(t,e,i)=>{t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786:(t,e,i)=>{var s=i(88417),n=i(20786);t.exports=function(t,e,i){return s(t,e),n(t,i)}},62235:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(54380),o=i(17717),a=i(87841);t.exports=function(t,e){void 0===e&&(e=new a);var i=n(t),h=o(t);return e.x=i,e.y=h,e.width=r(t)-i,e.height=s(t)-h,e}},35893:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541:t=>{t.exports=function(t){return t.x-t.width*t.originX}},87431:t=>{t.exports=function(t){return t.width*t.originX}},46928:t=>{t.exports=function(t){return t.height*t.originY}},54380:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717:t=>{t.exports=function(t){return t.y-t.height*t.originY}},86327:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724:(t,e,i)=>{t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919:(t,e,i)=>{var s,n,r,o=i(8054),a=i(68703),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-r()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:r})},68703:t=>{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},isEnabled:function(t){return null!==i?t[i]:null}}},65208:t=>{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},91610:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},26253:(t,e,i)=>{t.exports={CanvasInterpolation:i(20623),CanvasPool:i(27919),Smoothing:i(68703),TouchAction:i(65208),UserSelect:i(91610)}},40987:(t,e,i)=>{var s=i(83419),n=i(37589),r=i(1e3),o=i(7537),a=i(87837),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},92728:(t,e,i)=>{var s=i(37589);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e<t;e++)h.push(i[Math.floor(l)]),l+=u;return h}},91588:t=>{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183:(t,e,i)=>{var s=i(40987),n=i(89528);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},27939:(t,e,i)=>{var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},7537:(t,e,i)=>{var s=i(37589);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!0):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},70238:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},89528:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100:(t,e,i)=>{var s=i(40987),n=i(90664);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},90664:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699:(t,e,i)=>{var s=i(28915),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},68957:(t,e,i)=>{var s=i(40987);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},87388:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},87837:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e<i?6:0):r===e?a=(i-t)/o+2:r===i&&(a=(t-e)/o+4),a/=6),s.hasOwnProperty("_h")?(s._h=a,s._s=h,s._v=l):(s.h=a,s.s=h,s.v=l),s}},75723:(t,e,i)=>{var s=i(62957);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},85386:(t,e,i)=>{var s=i(30976),n=i(40987);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},80333:(t,e,i)=>{var s=i(70238),n=i(30100),r=i(68957),o=i(87388);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},3956:(t,e,i)=>{var s=i(40987);s.ColorSpectrum=i(92728),s.ColorToRGBA=i(91588),s.ComponentToHex=i(62957),s.GetColor=i(37589),s.GetColor32=i(1e3),s.HexStringToColor=i(70238),s.HSLToColor=i(62183),s.HSVColorWheel=i(27939),s.HSVToRGB=i(7537),s.HueToComponent=i(89528),s.IntegerToColor=i(30100),s.IntegerToRGB=i(90664),s.Interpolate=i(13699),s.ObjectToColor=i(68957),s.RandomRGB=i(85386),s.RGBStringToColor=i(87388),s.RGBToHSV=i(87837),s.RGBToString=i(75723),s.ValueToColor=i(80333),t.exports=s},27460:(t,e,i)=>{t.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorMatrix:i(89422),Masks:i(69781),RGB:i(51767)}},6858:(t,e,i)=>{var s=i(83419),n=i(39429),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},80661:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount,o=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,o),s.stencilOp(s.KEEP,s.KEEP,s.INCR),r++):(s.stencilFunc(s.EQUAL,r+1,o),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=r,n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,o):s.stencilFunc(s.EQUAL,r,o)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},69781:(t,e,i)=>{t.exports={BitmapMask:i(6858),GeometryMask:i(80661)}},73894:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},40366:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},83719:(t,e,i)=>{var s=i(40366);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},57264:(t,e,i)=>{var s=i(25892);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},57811:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818:(t,e,i)=>{var s=i(13560);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},84902:(t,e,i)=>{var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(37277),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},93055:(t,e,i)=>{t.exports={EventEmitter:i(47565)}},20122:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.BARREL,t),this.amount=e}});t.exports=o},32251:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===o&&(o=1),void 0===a&&(a=1),void 0===h&&(h=4),n.call(this,r.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=o,this.strength=a,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},9047:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===o&&(o=1),void 0===h&&(h=4),n.call(this,r.BLUR,t),this.quality=e,this.x=i,this.y=s,this.steps=h,this.strength=o,this.glcolor=[1,1,1],null!=a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},27885:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===o&&(o=!1),void 0===a&&(a=1),void 0===h&&(h=1),void 0===l&&(l=1),n.call(this,r.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=o,this.strength=l,this.blurX=a,this.blurY=h}});t.exports=o},12578:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a){void 0===e&&(e=8),void 0===o&&(o=1),void 0===a&&(a=.005),n.call(this,r.CIRCLE,t),this.scale=o,this.feather=a,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(t){this.glcolor2[3]=t}}});t.exports=o},15802:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(14811),o=new s({Extends:n,initialize:function(t){n.call(this),this.type=r.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=o},72898:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},44553:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),n.call(this,r.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=o},68531:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===i&&(i=4),void 0===s&&(s=0),void 0===o&&(o=!1),n.call(this,r.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=o,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},37102:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l,u){void 0===s&&(s=.2),void 0===o&&(o=0),void 0 [Showing last 50.0KB of line 2 (line is 142.7KB). Full output: /tmp/pi-bash-d2c2cbb38dd9d830.log] Command exited with code 1

assistant
thinking
The output was truncated. Let me check the key API elements I need.

Let me check the key API elements I need more cleanly.

→ bash {"command":"cd /tmp/job-fPtsoQ && node -e \"\nconst Phaser = require('./phaser.min.js');\nconsole.log('VERSION:', Phaser.VERSION);\nconsole.
toolResult

;return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,s,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,s),h=new d(r,o),l=new d(t,e)),this.add(new n(u,a,h,l))},quadraticBezierTo:function(t,e,i,s){var n,r,o=this.getEndPoint();return t instanceof d?(n=t,r=e):(n=new d(i,s),r=new d(t,e)),this.add(new l(o,n,r))},draw:function(t,e){for(var i=0;i<this.curves.length;i++){var s=this.curves[i];s.active&&s.draw(t,e)}return t},ellipseTo:function(t,e,i,s,n,o){var a=new r(0,0,t,e,i,s,n,o),h=this.getEndPoint(this._tmpVec2A),l=a.getStartPoint(this._tmpVec2B);return h.subtract(l),a.x=h.x,a.y=h.y,this.add(a)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(a.fromJSON(i));break;case"EllipseCurve":this.add(r.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(n.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,s=f.MIN_SAFE_INTEGER,n=f.MIN_SAFE_INTEGER,r=0;r<this.curves.length;r++){var o=this.curves[r];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),s=Math.max(s,i.right),n=Math.max(n,i.bottom))}return t.right=s,t.bottom=n,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getCurveAt:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),s=0;s<i.length;){if(i[s]>=e)return this.curves[s];s++}return null},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}n++}return null},getPoints:function(t,e){t||e||(t=this.defaultDivisions);for(var i,s=[],n=0;n<this.curves.length;n++){var r=this.curves[n];if(r.active)for(var o=r.getResolution(t),a=r.getPoints(o,e),h=0;h<a.length;h++){var l=a[h];i&&i.equals(l)||(s.push(l),i=l)}}return this.autoClose&&s.length>1&&!s[s.length-1].equals(s[0])&&s.push(s[0]),s},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),s=this.getCurveLengths(),n=0;n<s.length;){if(s[n]>=i){var r=s[n]-i,o=this.curves[n],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}n++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):"object"==typeof t?this._tmpVec2B.setFromObject(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});o.register("path",(function(t,e){return new p(t,e)})),t.exports=p},45893:(t,e,i)=>{var s=i(83419),n=i(24882),r=new s({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(n.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++)i.push(e[t[s]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,s=this.list,r=this.events,o=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return s[t]},set:function(e){if(!i._frozen){var a=s[t];s[t]=e,r.emit(n.CHANGE_DATA,o,t,e,a),r.emit(n.CHANGE_DATA_KEY+t,o,e,a)}}}),s[t]=e,r.emit(n.SET_DATA,o,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],s=1;s<arguments.length;s++)i.push(arguments[s]);for(var n in this.list)i[1]=n,i[2]=this.list[n],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(n.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(n.CHANGE_DATA),this.events.off(n.SET_DATA),this.events.off(n.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=r},63646:(t,e,i)=>{var s=i(83419),n=i(45893),r=i(37277),o=i(44594),a=new s({Extends:n,initialize:function(t){n.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){n.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});r.register("DataManagerPlugin",a,"data"),t.exports=a},10700:t=>{t.exports="changedata"},93608:t=>{t.exports="changedata-"},60883:t=>{t.exports="destroy"},69780:t=>{t.exports="removedata"},22166:t=>{t.exports="setdata"},24882:(t,e,i)=>{t.exports={CHANGE_DATA:i(10700),CHANGE_DATA_KEY:i(93608),DESTROY:i(60883),REMOVE_DATA:i(69780),SET_DATA:i(22166)}},44965:(t,e,i)=>{t.exports={DataManager:i(45893),DataManagerPlugin:i(63646),Events:i(24882)}},7098:(t,e,i)=>{var s=i(84148),n={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return n;n.audioData=!!window.Audio,n.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e){var i=function(e,i){var s=t.canPlayType("audio/"+e).replace(/^no$/,"");return i?Boolean(s||t.canPlayType("audio/"+i).replace(/^no$/,"")):Boolean(s)};if(n.ogg=i('ogg; codecs="vorbis"'),n.opus=i('ogg; codecs="opus"',"opus"),n.mp3=i("mpeg"),n.wav=i("wav"),n.m4a=i("x-m4a"),n.aac=i("aac"),n.flac=i("flac","x-flac"),n.webm=i('webm; codecs="vorbis"'),""!==t.canPlayType('audio/mp4; codecs="ec-3"'))if(s.edge)n.dolby=!0;else if(s.safari&&s.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var r=parseInt(RegExp.$1,10),o=parseInt(RegExp.$2,10);(10===r&&o>=11||r>10)&&(n.dolby=!0)}}}catch(t){}return n}()},84148:(t,e,i)=>{var s,n=i(25892),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};t.exports=(s=navigator.userAgent,/Edg\/\d+/.test(s)?(r.edge=!0,r.es2019=!0):/OPR/.test(s)?(r.opera=!0,r.es2019=!0):/Chrome\/(\d+)/.test(s)&&!n.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10),r.es2019=r.chromeVersion>69):/Firefox\D+(\d+)/.test(s)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10),r.es2019=r.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(s)&&n.iOS?(r.mobileSafari=!0,r.es2019=!0):/MSIE (\d+\.\d+);/.test(s)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(s)&&!n.windowsPhone?(r.safari=!0,r.safariVersion=parseInt(RegExp.$1,10),r.es2019=r.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(s)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(s)&&(r.silk=!0),r)},89289:(t,e,i)=>{var s,n,r,o=i(27919),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&void 0!==document&&(a.supportNewBlendModes=(s="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",n="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create2D(t,6).getContext("2d",{willReadFrequently:!0});if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=s+"/wCKxvRF"+n},r.src=s+"AP804Oa6"+n,!1),a.supportInverseAlpha=function(){var t=o.create2D(this,2).getContext("2d",{willReadFrequently:!0});t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1),s=i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3];return o.remove(this),s}()),a)},89357:(t,e,i)=>{var s=i(25892),n=i(84148),r=i(27919),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){if("function"==typeof importScripts)return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=r.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=r.create2D(this),s=i.getContext("2d",{willReadFrequently:!0}).createImageData(1,1);return a=s.data instanceof Uint8ClampedArray,r.remove(t),r.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,n.firefox&&n.firefoxVersion<21&&(o.getUserMedia=!1),!s.iOS&&(n.ie||n.firefox||n.chrome)&&(o.canvasBitBltShift=!0),(n.safari||n.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},91639:t=>{var e={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return e;var t,i="Fullscreen",s="FullScreen",n=["request"+i,"request"+s,"webkitRequest"+i,"webkitRequest"+s,"msRequest"+i,"msRequest"+s,"mozRequest"+s,"mozRequest"+i];for(t=0;t<n.length;t++)if(document.documentElement[n[t]]){e.available=!0,e.request=n[t];break}var r=["cancel"+s,"exit"+i,"webkitCancel"+s,"webkitExit"+i,"msCancel"+s,"msExit"+i,"mozCancel"+s,"mozExit"+i];if(e.available)for(t=0;t<r.length;t++)if(document[r[t]]){e.cancel=r[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(e.keyboard=!0),Object.defineProperty(e,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),e}()},31784:(t,e,i)=>{var s=i(84148),n={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(n.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(n.mspointer=!0),navigator.getGamepads&&(n.gamepads=!0),"onwheel"in window||s.ie&&"WheelEvent"in window?n.wheelEvent="wheel":"onmousewheel"in window?n.wheelEvent="mousewheel":s.firefox&&"MouseScrollEvent"in window&&(n.wheelEvent="DOMMouseScroll")),n)},25892:t=>{var e={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){if("function"==typeof importScripts)return e;var t=navigator.userAgent;/Windows/.test(t)?e.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(e.iOS=!0,e.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),e.iOSVersion=parseInt(RegExp.$1,10)):e.macOS=!0:/Android/.test(t)?e.android=!0:/Linux/.test(t)?e.linux=!0:/iP[ao]d|iPhone/i.test(t)?(e.iOS=!0,navigator.appVersion.match(/OS (\d+)/),e.iOSVersion=parseInt(RegExp.$1,10),e.iPhone=-1!==t.toLowerCase().indexOf("iphone"),e.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?e.kindle=!0:/CrOS/.test(t)&&(e.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(e.android=!1,e.iOS=!1,e.macOS=!1,e.windows=!0,e.windowsPhone=!0);var i=/Silk/.test(t);return(e.windows||e.macOS||e.linux&&!i||e.chromeOS)&&(e.desktop=!0),(e.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(e.desktop=!1),navigator.standalone&&(e.webApp=!0),"function"!=typeof importScripts&&(void 0!==window.cordova&&(e.cordova=!0),void 0!==window.ejecta&&(e.ejecta=!0)),"undefined"!=typeof process&&process.versions&&process.versions.node&&(e.node=!0),e.node&&"object"==typeof process.versions&&(e.nodeWebkit=!!process.versions["node-webkit"],e.electron=!!process.versions.electron),/Crosswalk/.test(t)&&(e.crosswalk=!0),e.pixelRatio=window.devicePixelRatio||1,e}()},43267:(t,e,i)=>{var s=i(95540),n={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};t.exports=function(){if("function"==typeof importScripts)return n;var t=document.createElement("video"),e=!!t.canPlayType,i=/^no$/;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(i,"")&&(n.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(i,"")&&(n.h264=!0,n.mp4=!0),t.canPlayType("video/x-m4v").replace(i,"")&&(n.m4v=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(i,"")&&(n.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(i,"")&&(n.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(i,"")&&(n.hls=!0))}catch(t){}return t.parentNode&&t.parentNode.removeChild(t),n.getVideoURL=function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i,r=s(t[e],"url",t[e]);if(0===r.indexOf("blob:"))return{url:r,type:""};if(i=0===r.indexOf("data:")?r.split(",")[0].match(/\/(.*?);/):r.match(/\.([a-zA-Z0-9]+)($|\?)/),i=s(t[e],"type",i?i[1]:"").toLowerCase(),n[i])return{url:r,type:i}}return null},n}()},82264:(t,e,i)=>{t.exports={os:i(25892),browser:i(84148),features:i(89357),input:i(31784),audio:i(7098),video:i(43267),fullscreen:i(91639),canvasFeatures:i(89289)}},89422:(t,e,i)=>{var s=i(83419),n=new Float32Array(20),r=new s({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(t){return this._matrix.set(t),this._dirty=!0,this},reset:function(){var t=this._matrix;return t.fill(0),t[0]=1,t[6]=1,t[12]=1,t[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var t=this._data;return this._dirty&&(t.set(this._matrix),t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._dirty=!1),t},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,s=-.5*(i-1);return this.multiply([i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),s=Math.sin(t),n=.213,r=.715,o=.072;return this.multiply([n+.787*i+s*-n,r+i*-r+s*-r,o+i*-o+.928*s,0,0,n+i*-n+.143*s,r+i*(1-r)+.14*s,o+i*-o+-.283*s,0,0,n+i*-n+-.787*s,r+i*-r+s*r,o+.928*i+s*o,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply(r.BLACK_WHITE,t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,s=-.5*(i-1);return this.multiply([i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply(r.NEGATIVE,t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply(r.DESATURATE_LUMINANCE,t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply(r.SEPIA,t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply(r.LSD,t)},brown:function(t){return void 0===t&&(t=!1),this.multiply(r.BROWN,t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply(r.VINTAGE,t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply(r.KODACHROME,t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply(r.TECHNICOLOR,t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply(r.POLAROID,t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply(r.SHIFT_BGR,t)},multiply:function(t,e){void 0===e&&(e=!1),e||this.reset();var i=this._matrix,s=n;return s.set(i),i.set([s[0]*t[0]+s[1]*t[5]+s[2]*t[10]+s[3]*t[15],s[0]*t[1]+s[1]*t[6]+s[2]*t[11]+s[3]*t[16],s[0]*t[2]+s[1]*t[7]+s[2]*t[12]+s[3]*t[17],s[0]*t[3]+s[1]*t[8]+s[2]*t[13]+s[3]*t[18],s[0]*t[4]+s[1]*t[9]+s[2]*t[14]+s[3]*t[19]+s[4],s[5]*t[0]+s[6]*t[5]+s[7]*t[10]+s[8]*t[15],s[5]*t[1]+s[6]*t[6]+s[7]*t[11]+s[8]*t[16],s[5]*t[2]+s[6]*t[7]+s[7]*t[12]+s[8]*t[17],s[5]*t[3]+s[6]*t[8]+s[7]*t[13]+s[8]*t[18],s[5]*t[4]+s[6]*t[9]+s[7]*t[14]+s[8]*t[19]+s[9],s[10]*t[0]+s[11]*t[5]+s[12]*t[10]+s[13]*t[15],s[10]*t[1]+s[11]*t[6]+s[12]*t[11]+s[13]*t[16],s[10]*t[2]+s[11]*t[7]+s[12]*t[12]+s[13]*t[17],s[10]*t[3]+s[11]*t[8]+s[12]*t[13]+s[13]*t[18],s[10]*t[4]+s[11]*t[9]+s[12]*t[14]+s[13]*t[19]+s[14],s[15]*t[0]+s[16]*t[5]+s[17]*t[10]+s[18]*t[15],s[15]*t[1]+s[16]*t[6]+s[17]*t[11]+s[18]*t[16],s[15]*t[2]+s[16]*t[7]+s[17]*t[12]+s[18]*t[17],s[15]*t[3]+s[16]*t[8]+s[17]*t[13]+s[18]*t[18],s[15]*t[4]+s[16]*t[9]+s[17]*t[14]+s[18]*t[19]+s[19]]),this._dirty=!0,this}});r.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],r.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],r.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],r.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],r.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],r.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],r.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],r.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],r.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],r.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],r.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t.exports=r},51767:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=n,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var s=this._rgb;return s[0]===t&&s[1]===e&&s[2]===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=r},60461:t=>{t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},54312:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(86327),o=i(88417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},46768:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},35827:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},46871:(t,e,i)=>{var s=i(66786),n=i(35893),r=i(7702);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),s(t,n(e)+i,r(e)+o),t}},5198:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},11879:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(54312),n[s.BOTTOM_LEFT]=i(46768),n[s.BOTTOM_RIGHT]=i(35827),n[s.CENTER]=i(46871),n[s.LEFT_CENTER]=i(5198),n[s.RIGHT_CENTER]=i(80503),n[s.TOP_CENTER]=i(89698),n[s.TOP_LEFT]=i(922),n[s.TOP_RIGHT]=i(21373),n[s.LEFT_BOTTOM]=n[s.BOTTOM_LEFT],n[s.LEFT_TOP]=n[s.TOP_LEFT],n[s.RIGHT_BOTTOM]=n[s.BOTTOM_RIGHT],n[s.RIGHT_TOP]=n[s.TOP_RIGHT];t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},80503:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},89698:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(88417),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},922:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},21373:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},91660:(t,e,i)=>{t.exports={BottomCenter:i(54312),BottomLeft:i(46768),BottomRight:i(35827),Center:i(46871),LeftCenter:i(5198),QuickSet:i(11879),RightCenter:i(80503),TopCenter:i(89698),TopLeft:i(922),TopRight:i(21373)}},71926:(t,e,i)=>{var s=i(60461),n=i(79291),r={In:i(91660),To:i(16694)};r=n(!1,r,s),t.exports=r},21578:(t,e,i)=>{var s=i(62235),n=i(35893),r=i(88417),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},10210:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)+a),t}},82341:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)+a),t}},87958:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},40080:(t,e,i)=>{var s=i(7702),n=i(26541),r=i(20786),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),r(t,s(e)+a),t}},88466:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(40136),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)-i),o(t,n(e)-a),t}},38829:(t,e,i)=>{var s=i(60461),n=[];n[s.BOTTOM_CENTER]=i(21578),n[s.BOTTOM_LEFT]=i(10210),n[s.BOTTOM_RIGHT]=i(82341),n[s.LEFT_BOTTOM]=i(87958),n[s.LEFT_CENTER]=i(40080),n[s.LEFT_TOP]=i(88466),n[s.RIGHT_BOTTOM]=i(19211),n[s.RIGHT_CENTER]=i(34609),n[s.RIGHT_TOP]=i(48741),n[s.TOP_CENTER]=i(49440),n[s.TOP_LEFT]=i(81288),n[s.TOP_RIGHT]=i(61323);t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},19211:(t,e,i)=>{var s=i(62235),n=i(54380),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},34609:(t,e,i)=>{var s=i(7702),n=i(54380),r=i(20786),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),r(t,s(e)+a),t}},48741:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(385),o=i(66737);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,s(e)+i),o(t,n(e)-a),t}},49440:(t,e,i)=>{var s=i(35893),n=i(17717),r=i(86327),o=i(88417);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},81288:(t,e,i)=>{var s=i(26541),n=i(17717),r=i(86327),o=i(385);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)-a),t}},61323:(t,e,i)=>{var s=i(54380),n=i(17717),r=i(86327),o=i(40136);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)-a),t}},16694:(t,e,i)=>{t.exports={BottomCenter:i(21578),BottomLeft:i(10210),BottomRight:i(82341),LeftBottom:i(87958),LeftCenter:i(40080),LeftTop:i(88466),QuickSet:i(38829),RightBottom:i(19211),RightCenter:i(34609),RightTop:i(48741),TopCenter:i(49440),TopLeft:i(81288),TopRight:i(61323)}},66786:(t,e,i)=>{var s=i(88417),n=i(20786);t.exports=function(t,e,i){return s(t,e),n(t,i)}},62235:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},72873:(t,e,i)=>{var s=i(62235),n=i(26541),r=i(54380),o=i(17717),a=i(87841);t.exports=function(t,e){void 0===e&&(e=new a);var i=n(t),h=o(t);return e.x=i,e.y=h,e.width=r(t)-i,e.height=s(t)-h,e}},35893:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},7702:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},26541:t=>{t.exports=function(t){return t.x-t.width*t.originX}},87431:t=>{t.exports=function(t){return t.width*t.originX}},46928:t=>{t.exports=function(t){return t.height*t.originY}},54380:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},17717:t=>{t.exports=function(t){return t.y-t.height*t.originY}},86327:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},88417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},20786:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},385:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},40136:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},66737:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},58724:(t,e,i)=>{t.exports={CenterOn:i(66786),GetBottom:i(62235),GetBounds:i(72873),GetCenterX:i(35893),GetCenterY:i(7702),GetLeft:i(26541),GetOffsetX:i(87431),GetOffsetY:i(46928),GetRight:i(54380),GetTop:i(17717),SetBottom:i(86327),SetCenterX:i(88417),SetCenterY:i(20786),SetLeft:i(385),SetRight:i(40136),SetTop:i(66737)}},20623:t=>{t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},27919:(t,e,i)=>{var s,n,r,o=i(8054),a=i(68703),h=[],l=!1;t.exports=(r=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return s(t,e,i,o.CANVAS)},create:s=function(t,e,i,s,r){var u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=o.CANVAS),void 0===r&&(r=!1);var c=n(s);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:s},s===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),r&&(c.parent=u),u.width=e,u.height=i,l&&s===o.CANVAS&&a.disable(u.getContext("2d",{willReadFrequently:!1})),u},createWebGL:function(t,e,i){return s(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:n=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-r()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:r})},68703:t=>{var e,i="";t.exports={disable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!1),t},enable:function(t){return""===i&&(i=e(t)),i&&(t[i]=!0),t},getPrefix:e=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i<e.length;i++){var s=e[i]+"mageSmoothingEnabled";if(s in t)return s}return null},isEnabled:function(t){return null!==i?t[i]:null}}},65208:t=>{t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},91610:t=>{t.exports=function(t,e){void 0===e&&(e="none");return["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},26253:(t,e,i)=>{t.exports={CanvasInterpolation:i(20623),CanvasPool:i(27919),Smoothing:i(68703),TouchAction:i(65208),UserSelect:i(91610)}},40987:(t,e,i)=>{var s=i(83419),n=i(37589),r=i(1e3),o=i(7537),a=i(87837),h=new s({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,s)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,s,n){return void 0===s&&(s=255),void 0===n&&(n=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=s,this._locked=!1,this.update(n)},setGLTo:function(t,e,i,s){return void 0===s&&(s=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=s,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,s=this.b,o=this.a;return this._color=n(e,i,s),this._color32=r(e,i,s,o),this._rgba="rgba("+e+","+i+","+s+","+o/255+")",t&&a(e,i,s,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t));return this.setTo(i,s,n)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,s=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),s=Math.max(0,Math.min(255,s-Math.round(-t/100*255))),this.setTo(e,i,s)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},92728:(t,e,i)=>{var s=i(37589);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],n=255,r=255,o=0,a=0;for(e=0;e<=n;e++)i.push({r:r,g:e,b:a,color:s(r,e,a)});for(o=255,e=n;e>=0;e--)i.push({r:e,g:o,b:a,color:s(e,o,a)});for(r=0,e=0;e<=n;e++,o--)i.push({r:r,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({r:r,g:o,b:a,color:s(r,o,a)});if(1024===t)return i;var h=[],l=0,u=1024/t;for(e=0;e<t;e++)h.push(i[Math.floor(l)]),l+=u;return h}},91588:t=>{t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},62957:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},37589:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},1e3:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},62183:(t,e,i)=>{var s=i(40987),n=i(89528);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=n(l,h,t+1/3),o=n(l,h,t),a=n(l,h,t-1/3)}return(new s).setGLTo(r,o,a,1)}},27939:(t,e,i)=>{var s=i(7537);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},7537:(t,e,i)=>{var s=i(37589);function n(t,e,i,s){var n=(t+6*e)%6,r=Math.min(n,4-n,1);return Math.round(255*(s-s*i*Math.max(0,r)))}t.exports=function(t,e,i,r){void 0===e&&(e=1),void 0===i&&(i=1);var o=n(5,t,e,i),a=n(3,t,e,i),h=n(1,t,e,i);return r?r.setTo?r.setTo(o,a,h,r.alpha,!0):(r.r=o,r.g=a,r.b=h,r.color=s(o,a,h),r):{r:o,g:a,b:h,color:s(o,a,h)}}},70238:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,s){return e+e+i+i+s+s}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var n=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(n,r,o)}return e}},89528:t=>{t.exports=function(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},30100:(t,e,i)=>{var s=i(40987),n=i(90664);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},90664:t=>{t.exports=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},13699:(t,e,i)=>{var s=i(28915),n=function(t,e,i,n,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:s(t,n,l),g:s(e,r,l),b:s(i,o,l)}};t.exports={RGBWithRGB:n,ColorWithRGB:function(t,e,i,s,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),n(t.r,t.g,t.b,e,i,s,r,o)},ColorWithColor:function(t,e,i,s){return void 0===i&&(i=100),void 0===s&&(s=0),n(t.r,t.g,t.b,e.r,e.g,e.b,i,s)}}},68957:(t,e,i)=>{var s=i(40987);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},87388:(t,e,i)=>{var s=i(40987);t.exports=function(t){var e=new s,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var n=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(n,r,o,255*a)}return e}},87837:t=>{t.exports=function(t,e,i,s){void 0===s&&(s={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=0,h=0===r?0:o/r,l=r;return r!==n&&(r===t?a=(e-i)/o+(e<i?6:0):r===e?a=(i-t)/o+2:r===i&&(a=(t-e)/o+4),a/=6),s.hasOwnProperty("_h")?(s._h=a,s._s=h,s._v=l):(s.h=a,s.s=h,s.v=l),s}},75723:(t,e,i)=>{var s=i(62957);t.exports=function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1,7):"0x"+s(n)+s(t)+s(e)+s(i)}},85386:(t,e,i)=>{var s=i(30976),n=i(40987);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new n(s(t,e),s(t,e),s(t,e))}},80333:(t,e,i)=>{var s=i(70238),n=i(30100),r=i(68957),o=i(87388);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):s(t);case"number":return n(t);case"object":return r(t)}}},3956:(t,e,i)=>{var s=i(40987);s.ColorSpectrum=i(92728),s.ColorToRGBA=i(91588),s.ComponentToHex=i(62957),s.GetColor=i(37589),s.GetColor32=i(1e3),s.HexStringToColor=i(70238),s.HSLToColor=i(62183),s.HSVColorWheel=i(27939),s.HSVToRGB=i(7537),s.HueToComponent=i(89528),s.IntegerToColor=i(30100),s.IntegerToRGB=i(90664),s.Interpolate=i(13699),s.ObjectToColor=i(68957),s.RandomRGB=i(85386),s.RGBStringToColor=i(87388),s.RGBToHSV=i(87837),s.RGBToString=i(75723),s.ValueToColor=i(80333),t.exports=s},27460:(t,e,i)=>{t.exports={Align:i(71926),BaseShader:i(73894),Bounds:i(58724),Canvas:i(26253),Color:i(3956),ColorMatrix:i(89422),Masks:i(69781),RGB:i(51767)}},6858:(t,e,i)=>{var s=i(83419),n=i(39429),r=new s({initialize:function(t,e,i,s,n,r){e||(e=t.sys.make.image({x:i,y:s,key:n,frame:r,add:!1})),this.bitmapMask=e,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e,i)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});n.register("bitmapMask",(function(t,e,i,s,n){return new r(this.scene,t,e,i,s,n)})),t.exports=r},80661:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var s=t.gl;t.flush(),0===t.maskStack.length&&(s.enable(s.STENCIL_TEST),s.clear(s.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var s=t.gl,n=this.geometryMask,r=t.maskCount,o=255;s.colorMask(!1,!1,!1,!1),i?(s.stencilFunc(s.EQUAL,r,o),s.stencilOp(s.KEEP,s.KEEP,s.INCR),r++):(s.stencilFunc(s.EQUAL,r+1,o),s.stencilOp(s.KEEP,s.KEEP,s.DECR)),this.level=r,n.renderWebGL(t,n,e),t.flush(),s.colorMask(!0,!0,!0,!0),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),this.invertAlpha?s.stencilFunc(s.NOTEQUAL,r,o):s.stencilFunc(s.EQUAL,r,o)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var s=t.maskStack[t.maskStack.length-1];s.mask.applyStencil(t,s.camera,!1),t.currentCameraMask.mask!==s.mask?(i.mask=s.mask,i.camera=s.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var s=this.geometryMask;t.currentContext.save(),s.renderCanvas(t,s,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=s},69781:(t,e,i)=>{t.exports={BitmapMask:i(6858),GeometryMask:i(80661)}},73894:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===s&&(s=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=s}});t.exports=s},40366:t=>{t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},83719:(t,e,i)=>{var s=i(40366);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,s(i,e.parent)}}},57264:(t,e,i)=>{var s=i(25892);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?s.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},57811:t=>{t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},s=document.createElement("div");return s.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(s),i.w=90===e?s.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:s.offsetHeight,document.documentElement.removeChild(s),s=null,90!==Math.abs(window.orientation)?i.h:i.w}},45818:(t,e,i)=>{var s=i(13560);t.exports=function(t,e){var i=window.screen,n=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return n&&"string"==typeof n.type?n.type:"string"==typeof n?n:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?s.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?s.ORIENTATION.LANDSCAPE:void 0:e>t?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE}},74403:t=>{t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},56836:t=>{t.exports=function(t){var e="";try{if(window.DOMParser)e=(new DOMParser).parseFromString(t,"text/xml");else(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},35846:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},43092:(t,e,i)=>{var s=i(83419),n=i(29747),r=new s({initialize:function(){this.isRunning=!1,this.callback=n,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var t=this;this.step=function e(i){t.callback(i),t.isRunning&&(t.timeOutID=window.requestAnimationFrame(e))},this.stepTimeout=function e(){t.isRunning&&(t.timeOutID=window.setTimeout(e,t.delay)),t.callback(window.performance.now())}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.delay=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=n}});t.exports=r},84902:(t,e,i)=>{var s={AddToDOM:i(40366),DOMContentLoaded:i(57264),GetInnerHeight:i(57811),GetScreenOrientation:i(45818),GetTarget:i(74403),ParseXML:i(56836),RemoveFromDOM:i(35846),RequestAnimationFrame:i(43092)};t.exports=s},47565:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(37277),o=new s({Extends:n,initialize:function(){n.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},93055:(t,e,i)=>{t.exports={EventEmitter:i(47565)}},20122:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e){void 0===e&&(e=1),n.call(this,r.BARREL,t),this.amount=e}});t.exports=o},32251:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===i&&(i=1),void 0===s&&(s=1),void 0===o&&(o=1),void 0===a&&(a=1),void 0===h&&(h=4),n.call(this,r.BLOOM,t),this.steps=h,this.offsetX=i,this.offsetY=s,this.blurStrength=o,this.strength=a,this.glcolor=[1,1,1],null!=e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},9047:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=2),void 0===s&&(s=2),void 0===o&&(o=1),void 0===h&&(h=4),n.call(this,r.BLUR,t),this.quality=e,this.x=i,this.y=s,this.steps=h,this.strength=o,this.glcolor=[1,1,1],null!=a&&(this.color=a)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},27885:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===e&&(e=.5),void 0===i&&(i=1),void 0===s&&(s=.2),void 0===o&&(o=!1),void 0===a&&(a=1),void 0===h&&(h=1),void 0===l&&(l=1),n.call(this,r.BOKEH,t),this.radius=e,this.amount=i,this.contrast=s,this.isTiltShift=o,this.strength=l,this.blurX=a,this.blurY=h}});t.exports=o},12578:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a){void 0===e&&(e=8),void 0===o&&(o=1),void 0===a&&(a=.005),n.call(this,r.CIRCLE,t),this.scale=o,this.feather=a,this.thickness=e,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],null!=i&&(this.color=i),null!=s&&(this.backgroundColor=s)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundColor:{get:function(){var t=this.glcolor2;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor2;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(t){this.glcolor2[3]=t}}});t.exports=o},15802:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(14811),o=new s({Extends:n,initialize:function(t){n.call(this),this.type=r.COLOR_MATRIX,this.gameObject=t,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});t.exports=o},72898:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.type=t,this.gameObject=e,this.active=!0},setActive:function(t){return this.active=t,this},destroy:function(){this.gameObject=null,this.active=!1}});t.exports=s},44553:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s){void 0===e&&(e="__WHITE"),void 0===i&&(i=.005),void 0===s&&(s=.005),n.call(this,r.DISPLACEMENT,t),this.x=i,this.y=s,this.glTexture,this.setTexture(e)},setTexture:function(t){var e=this.gameObject.scene.sys.textures.getFrame(t);return e&&(this.glTexture=e.glTexture),this}});t.exports=o},68531:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o){void 0===i&&(i=4),void 0===s&&(s=0),void 0===o&&(o=!1),n.call(this,r.GLOW,t),this.outerStrength=i,this.innerStrength=s,this.knockout=o,this.glcolor=[1,1,1,1],void 0!==e&&(this.color=e)},color:{get:function(){var t=this.glcolor;return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},set:function(t){var e=this.glcolor;e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255}}});t.exports=o},37102:(t,e,i)=>{var s=i(83419),n=i(72898),r=i(14811),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l,u){void 0===s&&(s=.2),void 0===o&&(o=0),void 0 [Showing last 50.0KB of line 2 (line is 142.7KB). Full output: /tmp/pi-bash-b30d1c404da6cd87.log] Command exited with code 1

assistant
thinking
The output is being truncated because the file is huge. Let me write a cleaner node test that only outputs what I need.

The library is confirmed working in Node. Now let me write the game. I have a clear understanding of the Phaser 3.80.1 API. Let me build a complete, well-structured platformer.

→ write /tmp/job-fPtsoQ/index.html (17455 bytes)
toolResult

Successfully wrote to /tmp/job-fPtsoQ/index.html

assistant
thinking
Now let me run it in the browser and inspect. Let me use the browser tool.

But first, let me review my code. There are some issues I can anticipate:

1. The coins group is created with `repeat: 0` but I'm not using `setXY` correctly. I should create them manually. Let me look at the coin layout — I'm passing an array to setXY but that's wrong. Let me create coins manually in create().

2. `this.coins.children.iterate` - the tween on child scale.

3. The enemy squat/collapse: enemy.disableBody then tween then destroy.

4. The `_pickCoin` uses `coin.__phId || Phaser.Utils.String.UUID()` — but UUID might not be available. Let me check. Actually Phaser.Utils.String.UUID exists. But the issue is that `disableBody(true, true)` keeps the body, so a second overlap won't trigger. But I track ids anyway. Actually the disableBody handles it. Let me simplify.

5. The jump check uses `this.player.body.touching.down || this.player.body.wasTouching.down` — but wasTouching might remain true mid-air. The standard approach: check touching.down at the moment. But there's a known issue: in Arcade physics, `body.touching.down` is true during the frame of collision. Using a `wasTouching` flag we set from touching. Let me instead track a grounded flag manually via the collision callback `processCallback` or `onCollide`. Actually the cleanest: use the player's `body.onFloor()` or `body.touching.down`. But `body.touching` is reset each frame before physics runs, set true when a collision happens during the physics step. In `update()`, which runs after physics step, `body.touching.down` reflects the most recent collision. But it only stays true for that single frame. So if you press jump the same frame you land, good. If you land then press jump next frame, touching.down is false.

The classic solution: set a flag `this.player.body.onCollide` / use the `collide` callback to set `this.canJump = true`, and set false when not touching. Actually Arcade has `body.onFloor()` which checks `body.touching.down`. Let me use a different approach: track grounded state in a collider callback with a `processCallback` that sets `player.grounded = true`, and reset it at the start of update.

Let me reconsider. The cleanest Mario-style approach in Phaser:

```
this.player.body.checkCollision.up = false; // optional
```

For jump, the typical pattern:

```
create() {
  ...
  this.player.body.onCollide = true; // enable collision callbacks
  this.physics.world.on('collide', (go1, go2) => {
    // determine if on floor
  });
}
```

Actually, simplest robust approach: 
- In `update()`, before processing input, set `this.player._grounded = this.player.body.touching.down`. 
- But touching.down is only true for the frame of collision resolution.

Hmm, actually Arcade physics `body.touching` is set during `postUpdate` (the physics step) and persists through the rest of the frame including `update()`. It is reset at the start of the next physics step (in `preUpdate`). Since `update()` runs after the physics step in the same frame loop, `body.touching.down` will be true for that frame. But if you landed and then in the next frame press jump, touching.down is false again.

So there's a timing gap. The standard fix: use `body.wasTouching` (previous frame's touching) combined with... no.

Better: track it yourself. Set a flag when the player collides with a platform and is moving downward (landing). Reset the flag when falling off / not touching.

Actually the simplest reliable approach used widely:
```
if (this.player.body.touching.down) {
  this.canJump = true;
} else if (this.player.body.wasTouching.down) {
  // just left ground, can still jump (coyote) - optional
}
```

The real issue with mid-air double jump: as long as `if (jump && this.player.body.touching.down)` is the ONLY way jump occurs, then mid-air double jumps are impossible because touching.down only true when on ground. The only "problem" is if the jump key is held down and the player barely touches ground. But that's fine.

But the concern: there's a frame delay. When player lands, touching.down=true that frame. update() runs same frame → jump allowed. Good. Next frame, player moving up, touching.down=false, can't jump again until landing. 

Actually wait — the issue is the order. In Phaser, the loop is: preUpdate (physics) → update (scene) → ... Actually Arcade physics `update` is called during `scene.update`? No. The order: Scene.update is called, then systems update. Let me recall: Phaser.Game loop: `step` → emits `PRE_STEP` → `scene.update` → `scene.preUpdate`? No.

Actually in Phaser, the flow per tick:
1. `Step` → `update(time, delta)` on the Scene (Scene.update)
2. But Arcade physics world updates in the scene's `preUpdate` (which is called... before update). 

Hmm. The `UpdateList` calls each gameobject's `preUpdate` then `update`. For Arcade physics, the physics world is updated during `Scene.preUpdate` (via the physics system's `preUpdate`) which runs BEFORE `Scene.update`. So:
- preUpdate: physics step runs, `body.touching` set based on collisions this step
- update (scene.update): we read `body.touching.down` — reflects this frame's collisions. 

So touching.down is reliable in `update()`. When player is on ground, body overlaps/collides with ground platform each physics step → touching.down true each frame. Good, so holding jump while walking on ground... each frame touching.down true → each frame a new jump velocity applied = floaty. That's a problem (can re-jump every frame while on ground if key held). Need to track key press not key down. Use `Phaser.Input.Keyboard.JustPressed`-like behavior.

The cleanest: track a `jumpWasPressed` boolean. Let me implement:
- `this.player.body.setAllowGravity(true)`
- jump: when space/UP pressed (just this frame) AND touching.down → setVelocityY(JUMP).

To detect "just pressed" I track a previous state of the key. Key objects have `.isDown`. I'll store previous.

Let me also make sure mid-air double jump is prevented: only jump if touching.down.

But there's still the subtlety: when the player lands, does touching.down get set in the SAME frame update reads it, and is the player actually registered as touching? With static group collider and Arcade, yes onLanding.

However, an even more robust and common pattern is to set a flag via the collision callback:
```
this.physics.add.collider(this.player, this.platforms,
  (player, platform) => { player.canJump = true; },  // onCollide
  null, this);
```
But this callback fires only when there's actual collision resolution, which is each frame while resting on ground. Set canJump=true each frame. Then in update:
```
if (jumpJustPressed && this.player.canJump) { jump; this.player.canJump = false; }
```
And reset canJump=false at end of update? No — if we set false, then next frame even if still touching it was set true by the physics step... but the callback fires during preUpdate (physics step), and update runs after. So: preUpdate sets canJump=true (via callback). update reads canJump, jumps, sets canJump=false. Then physics runs next frame, still touching → callback sets canJump=true again. So you could jump every frame while holding jump key only IF jumpJustPressed. Since we require justPressed (one frame), only jumps once per key press. 

That's the cleanest. But relying on the collide callback `onCollide`-style requires `player.body.onCollide = true` and a `processCallback`/callback. Actually `Physics.Add.collider` callbacks: the third arg is the collide callback executed when objects collide. It fires each frame they're colliding? Let me recall: collider with a callback — the callback is invoked once per collision pair per physics step when they're actively colliding/overlapping. Actually for Arcade, the `collider` callback fires on `processCallback` pass when they overlap, and I believe it fires every frame while overlapping if there's a callback... Hmm, actually the callback fires once when the collision starts. Let me be careful.

The Arcade Physics collider: when two objects collide, the callback is called. For Arcade, the callback (onCollide) is invoked when a collision is detected and resolved. By default `callback` runs every frame the bodies are overlapping and colliding? Actually, I recall the collider callback only fires when there's a new collision (onCollide fires once per collision event, not every frame). There's also the `processCallback`.

To avoid ambiguity, the most robust approach: use `body.touching.down` directly with a "just pressed" key check. Since touching.down is reliably true each frame the player is on the ground (physics resolves the collision each step and sets touching), this works.

Let me reconsider whether touching.down persists each frame while resting on a static platform. Yes — Arcade physics, in `Arcade.Body.preUpdate`, resets touching flags to false. Then in the world's `collide` / `separate`, when it finds the body is touching the ground, it sets `body.touching.down = true` and resolves. This happens every physics step while they overlap. So in `update()` (after the physics step), touching.down is true every frame the player rests on ground. 

So my original approach works; I just need to make jump require a single-frame press to avoid floaty re-jumps when walking on ground holding the key. But the requirement is "prevent repeated mid-air jumping" — walking-on-ground re-jump isn't mid-air, but it's undesirable (floaty). Let me add justPressed logic to be safe and polished.

Let me also reconsider: the requirement says "prevent repeated mid-air jumping". My current code: `if (jump && (touching.down || wasTouching.down))`. The `wasTouching.down` part is a Coyote-time-ish feature that could allow a jump for one frame after leaving ground — that's fine and actually good. But holding jump: while on ground touching.down true each frame → re-jumps each frame. Floaty. Need justPressed.

Let me rewrite the jump section with a proper justPressed tracker.

Also, a subtle bug: I set `this.player.setVelocityX(this.player.body.velocity.x * 0.86)` when no keys — but I also call setVelocityX(-SPEED) / setVelocityX(SPEED). For a Mario-style feel, using setAcceleration + drag would be smoother, but velocity-based with damping is fine. However setting velocity directly each frame overrides, fine.

Now the coin creation. Let me redo it properly. Instead of setXY with an array, I'll create coins manually:

```
this.coins = this.physics.add.group();
const coinPositions = [...];
coinPositions.forEach(p => {
  const c = this.coins.create(p.x, p.y, 'coin');
  c.setDepth(8);
  // tween
});
```

Let me also reconsider the `coinLayout()` returning an object — it's messy. Let me just inline an array.

Let me also reconsider: I set `this.coins.children.iterate(child => {...})` for tween but `iterate` callback signature is `(child) => ...`. Fine.

Also `_pickCoin` — the disableBody(true,true) removes it from rendering and physics, so it's "removed" visually. Good. The `coinsCollected` set is for tracking but not strictly needed since disabled. But the requirement: "Collecting a coin removes it and increases the displayed count once." Using disableBody ensures it won't re-trigger overlap. Good. I'll simplify _pickCoin.

One concern: when a coin is disabled via disableBody(true,true), is it still in the group's children? Yes, just disabled. The overlap won't fire again because body is disabled. Good.

But on restart: `this.coins.children.iterate(child => child.enableBody(false, child.x, child.y, true, true))`. This re-enables. But the coins were created with positions; enableBody with child.x keeps them. Good. But the scale tweens from first create — re-adding tweens each restart is fine.

Actually there's a subtle issue: after disableBody(true,true), the coin's body is disabled and visible=false. enableBody(false, x, y, true, true) re-enables body and sets visible=true. But the sprite's position should remain. Using child.x, child.y keeps them. Good.

Now enemies: on restart I `this.enemies.clear(true, true)` then recreate. Good.

Now the player losing via gap: if player falls below ground (y > worldH), lose. Currently nothing checks this. Let me add a check in update: if player.y > worldH + 200 → loseGame.

Also side contact with enemy → lose. Handled in _hitEnemy.

Also the flag sprite: the flag's collision body. The flag texture is wider; its body defaults to the texture size which might be big. For overlap win detection, fine. But the player needs to reach the flag. Let me make the goal's body smaller or just rely on overlap. Overlap with sprite uses its body which for a 'flag' texture (T wide, T*5 tall) is large. That's okay — reaching it triggers win. But the flag pole overlaps earlier maybe. Let me set a custom hit area / body size. Actually, let me create the goal as a sprite with a sensor body of reasonable size. Simpler: use a separate invisible goal sprite. Actually let me set the flag display and a separate small goal sensor.

Let me restructure goal:
- `this.goal` sprite (visual flag) at the flagpole top.
- A collider/overlap trigger: I'll make the flag sprite itself the overlap target with a body sized to a circle at the flag. Hmm.

Simplest robust approach: Create `this.goal` as a sprite with `setSize(T, T)` and `setOffset` to position the hitbox near the flag banner. Or create an invisible sensor sprite at the goal. Let me just make the goal a small invisible sensor rectangle and draw the flag visually separately. Actually let me keep the flag sprite but set its body to a small sensor.

Let me set:
```
this.goal = this.physics.add.sprite(goalX + 60, goalY, 'flag');
this.goal.body.setAllowGravity(false);
this.goal.body.setImmovable(true);
this.goal.body.setSize(T, T).setOffset(T*0.15, 0);
```
The flag texture is T wide x T*5 tall. setSize(T,T) offset (T*0.15,0) puts hitbox at top-left area. Good enough. Overlap triggers win.

Wait — but `this.physics.add.collider(this.player, this.goal)` would block the player. I want overlap not collide. Let me remove the collider with goal and only have overlap. Actually a static immovable flag with collider is fine to block player passage through the pole, but overlap alone is enough. Let me keep just overlap.

Let me also add gravity to player only (setAllowGravity default true). Good.

Now the player's `setCollideWorldBounds(true)` with bounds (0,0,WORLDW, WORLDH) — falls off bottom would be stopped at bottom. So the player won't fall into the "gap" to trigger lose. Hmm. The requirement: "falling into a gap causes a loss state." If world bounds stop the player at the bottom, falling into a gap (between platforms) — if the gap is small, player falls and lands on ground below. But "gap" here likely means falling below the level. Since the ground spans the whole width at the bottom, falling into a gap between platforms just lands on ground. To make "falling into a gap causes loss", I should let the player fall if they go below a certain Y (e.g., below the bottom ground) — i.e., die if y > worldH (below ground) or if they fall into a deep gap. 

Actually with full ground at bottom, the player always lands. The "gap causes loss" is satisfied if there's a gap that's deep enough that the player falls below the visible area OR a gap where there's no ground. Let me make the bottom-ground not span the whole map continuously — but Mario-style usually has continuous ground. 

A cleaner interpretation: "falling into a gap" = falling below the bottom of the level (y beyond ground). Let me add: if `this.player.y > this.worldH` (below bottom ground, which is at H - T/2 ≈ H-24), then lose. But world bounds stop at H. So player can't go past H. Hmm. Let me set world bounds to be slightly larger or not stop vertical. Actually `setCollideWorldBounds` stops the body at the boundary. So player won't go below worldH.

Alternative: I'll detect "fell into a gap" by checking if player falls below the lowest platform top (worldH - T), i.e., y > worldH. Since body is at center, when player center passes bottom ground top (~ worldH - T), player is "dead". Let me check `if (this.player.y > this.worldH - 20)` → lose. This handles gaps that drop below the ground level — but there is ground everywhere. 

Hmm, to truly have "gaps" that kill, the bottom ground shouldn't be everywhere. Let me reconsider the level design. A Mario level: the bottom is ground; gaps are between upper platforms and if you miss a jump you fall onto the lower ground (survive) or fall off-screen bottom (die). 

Let me make it: the visible bottom ground spans the whole width (so player lands). Then "falling into a gap causes loss" — I'll interpret as: if the player falls below a death plane (e.g., y > worldH, below all platforms) they die. Since ground spans bottom, player won't die unless... 

Actually let me make a few gaps where there is NO ground — i.e., a section where the bottom ground is removed over a wide chasm, so falling in = death. That makes the gap mechanic real. Let me add a "death pit": a wide chasm in the middle where the bottom ground is missing, say from x=1600 to x=2200 the bottom two ground rows are absent, with a death plane below.

But generating ground by iterating full width is expensive-ish but fine (3600/48 = 75 iterations × 2 = 150). Let me instead create ground as wide platforms using makePlatform with full length but skip the chasm region, and add a death zone sprite spanning the chasm at a low y that overlaps player → lose.

Simpler design: Keep full ground but add explicit death-plane triggers at chasm bottoms. Actually, let me reconsider — to keep it simpler and robust, let me make the bottom NOT a full ground but segmented, with a few deep chasms that have death planes.

Let me redesign more carefully:

Level layout (top-down Y increases downward):
- worldH = 720, so ground at bottom (y around 720 - 24).
- Safe "floor" ground spans most of the map EXCEPT a couple of wide pits with death planes.

Let me define:
- Ground floor: full width but with pits.
- Pits at x ∈ [1700, 2100] and x ∈ [2900, 3200] have NO floor; instead a deathPlane covers those x ranges at y = worldH (below) that kills on overlap.

Actually simpler: make ONE death pit to satisfy the mechanic, near the start to demonstrate, and the rest has ground. But requirement: "gaps" plural-ish. Let me do the chasm from ~1700-2100 and ~2950-3300 with death planes.

Hmm, but if there's a death pit, then the coins/enemies over it need platforms. Let me make the platforms bridge across.

This is getting complex. Let me simplify the whole level into a clean, hand-authored set of platforms with clear gaps, and a death plane at the bottom (y > some threshold) covering the whole width. The "gap" = walking off an edge onto nothing → fall → death plane. This is the classic Mario "gap" (a pit between two ground sections).

So:
- Instead of full ground everywhere, ground is segmented: ground from x=0 to x=1700, then a pit, then ground from x=2100 to x=2900, then pit, then ground rest. 
- Player who walks off an edge falls into the pit and hits the death plane → lose.
- Platforms above pit gaps let you cross.

This is cleaner. Let me restructure `makePlatform` to be the basic building block, and create ground segments using makePlatform with the 'ground' texture (it stamps ground tiles).

Let me rewrite the level section:

```
const T = CFG.TILE;
const W = this.worldW;
const H = this.worldH;

// Ground segments (segmented to create gaps)
const groundSegments = [
  { x: 0, len: 1700 },
  { x: 2100, len: 800 },     // 2100..2900
  { x: 3300, len: 300 },    // 3300..3600
];
groundSegments.forEach(seg => makePlatform(seg.x, H - 240, seg.len));
```

Wait, makePlatform currently uses `H - 240`? No, I passed specific y. Let me make ground at y = H - T*1.4 (two layers high). Actually makePlatform stamps ground tiles starting at the body y. Let me reconsider makePlatform: body at y, stamps tiles at y + T/2 (so tile top at y). The body is height T*0.4. For ground spanning world bottom, let me just create solid platforms at the bottom.

Let me restructure cleanly. I'll define a helper `addSolid(x, y, w)` that creates a static physics body (rectangle) + stamps 'ground' tiles, and `addBrick`.

For ground:
- bottom = H - T (one tile above bottom? Let me place ground tops at y = H - 2*T so two-tile-high ground wall at bottom). Hmm, with worldH=720 and player start at y = H-240-60 = 720-300=420... that's a platform, not ground.

Let me reconsider coordinates. Player start at (160, 420). Ground at bottom y ~ 600-720.

Let me define:
- H = 720
- Ground layer: top of ground at y = 600 (so tiles from 600..696, two tiles). Body at y = 600 + T/2? With makePlatform, body y = top, tiles stamped at top+T/2. Let me just place bodies explicitly.

I'll rewrite makePlatform to take the TOP y coordinate of the platform and stamp tiles there, with the physics body centered.

Let me write a cleaner version:

```
// rect from top-left (gx, gy) of size (gw x gh)
const addSolid = (gx, gy, gw, gh) => {
  // body centered
  const cx = gx + gw/2, cy = gy + gh/2;
  const b = this.add.rectangle(cx, cy, gw, gh, 0x000000, 0);
  this.platforms.add(b).setSize(gw, gh);
};
const addTiles = (gx, gy, gw) => {
  for (let sx = 0; sx < gw; sx += T) {
    this.add.image(gx + sx + T/2, gy + T/2, 'ground');
  }
};
```

Ground segments (bottom): 
```
const groundY = H - 2*T; // top of ground at 720-96=624
const groundH = 2*T;
groundSegments.forEach(s => { addSolid(s.x, groundY, s.len, groundH); addTiles(s.x, groundY, s.len); });
```

Player start at y = groundY - 120 = 504. That's above ground. Good.

Platform heights: various.

Let me also place a death plane: a sensor rectangle spanning the full width near the bottom (y = H - something) that kills player on overlap, so falling into a pit → death.

```
this.deathZone = this.add.zone(W/2, H - T, W, T*2);
this.physics.world.enable(this.deathZone);
this.deathZone.body.setAllowGravity(false);
this.deathZone.body.setImmovable(true);
this.deathZone.body.setAllowGravity(false);
this.deathZone.body.checkCollision.up = true;
this.deathZone.body.setOffset(0,0);
```
Actually a simpler death zone: a sensor over each pit. But spanning full width at bottom is fine — but player on ground is at y≈groundY+groundH/2 = 624+24=648, which is above the death zone if death zone is at y = H - T = 672... overlap! The ground is at 624-720, death zone at 672 would overlap ground. Let me place death zone below ground: at y = H + 100 (below everything) but only covering pit x ranges, OR a sensor covering the whole width at y = H (720) with height 100. Player above ground top (624) is fine; player falling through a pit reaches y=720 → death. But world bounds at H=720 stop the player at 720. If death zone is a sensor at y>=672 height 100, player on ground (y=648) is safe, player who fell hits sensor at 672-772. But ground tiles occupy 624-720 (two tiles). The ground body occupies 624-720. So at y=720 the body is blocked. Death zone sensor at y=720 height 100 won't be reached because world bounds stop player at 720 (body can't go to 772). 

Hmm. The world bounds collide at H=720. So falling player stops at 720, never reaching a death zone below. And the death zone can't overlap the ground (or the player on ground overlaps it). 

Solution: Don't use collideWorldBounds, and detect death by `if (player.y > groundY + someThreshold)`. With pits having no ground, player falls through pit and y increases beyond ground level → death. But without world bounds bottom, player falls forever; that's fine, we kill them when y > worldH + 200 or similar.

Let me: 
- `this.player.setCollideWorldBounds(true)` only for left/right walls (so can't walk off left/right), but allow falling. Actually collideWorldBounds blocks all 4 sides including bottom. I can set `this.player.body.collideWorldBounds = true` then `this.player.body.onWorldBounds = true`? OnWorldBounds fires when hitting any bound including bottom. I can detect bottom hit → lose. But that would also fire when landing? No, landing is on a platform, not the world bound.

Let me use the world bounds approach: set world bounds, `this.player.setCollideWorldBounds(true)`, `this.player.body.onWorldBounds = true`, and listen `this.physics.world.on('worldbounds', ...)` → if direction includes bottom (body.blocked.down or the event), lose. Actually the worldbounds event gives the body and the 'up/down/left/right' flags. If down blocked → fell off bottom → lose.

But there's a subtlety: falling into a pit, the player hits the bottom world bound → lose. 

But wait, with pits lacking ground, the bottom ground segments only cover certain x ranges. The player falls through a pit and eventually hits y = worldH (the bottom bound) → lose. That works.

So plan:
- world bounds = (0,0, W, H).
- world bounds bottom = H = 720.
- Player who falls into a pit → reaches y=720 → worldbounds event fires down → lose.
- No separate death plane needed.

But `setCollideWorldBounds` on the player with `onWorldBounds` — the event fires for the player body only when it touches the world boundary. Good.

Let me implement via `this.physics.world.on('worldbounds', (body, up, down, left, right) => { if (down && body.gameObject === this.player) this.loseGame(); })`. But careful: if player just stands on ground at bottom, body touches ground (platform), not world bound, so no. Good. Only pits trigger.

Hmm, but there's also left/right world bounds — walking off left/right edge. Let me allow walking off? Mario usually doesn't kill at left edge but the level start prevents walking left far. Let me make left/right kill too? The requirement focuses on gaps. I'll make only down (falling) cause loss; left/right just blocked (collideWorldBounds true). Fine.

Actually, one issue: with pits and the player able to fall off the left/right world bounds, that's blocked (good, no death). Only falling down = death via pit. 

Now mid-air double jump prevention + the floaty issue. Let me implement proper jump.

Also "prevent repeated mid-air jumping" — clearly handled.

Let me also double check: the requirement says Side contact or falling into a gap loses. Falling into gap = pit → world bounds death. Good.

Let me now also reconsider the enemy: patrolling enemies that turn at edges. I need them to turn around at platform edges and at patrol-distance boundaries and at walls. Simplest: turn when `body.blocked.down` is false (about to walk off edge) — detect via checking ahead, OR use a simple approach: flip velocity when blocked left/right (wall) and also when at patrol distance. Let me implement:
- Each enemy has an originX and patrol width. They reverse when `enemy.x < originX - patrol/2` or `enemy.x > originX + patrol/2`, OR when `enemy.body.blocked.left`/`blocked.right` (hit a wall).
- Also turn off ledges: check if there's no ground ahead. That requires raycast or checking. Simpler: use a small sensor below the enemy's front edge. 

Let me implement edge detection with a sensor: create invisible zones? That's complex. Alternative simpler approach for Mario-style: give enemies a `body.setSize` and use `body.blocked.down` to detect ledge — when walking forward and `body.blocked.down` becomes false (no ground), turn. Actually when walking off a ledge, while in air `blocked.down` false. But an enemy that just jumps or is mid-fall wouldn't be patrolling. The typical pattern: 

```
// in update, for each enemy:
if (enemy.body.blocked.down) {
  // on ground, check ledge / wall
} 
```

Hmm. Let me use a simpler, robust patrol: flip direction when the enemy reaches patrol boundaries or hits a wall. And to prevent walking off ledges, I'll place enemies only on platforms and give the patrol width that keeps them safely on the platform. Since platforms have finite width, if patrol extends beyond platform edge, enemy walks off → falls. So I'll ensure patrol width keeps enemy within platform. But that's fragile.

Better: implement ledge detection. For an enemy facing right, ahead-and-below: check if the tile at (enemy.right + 1, enemy.bottom + 1) is solid. If not, turn. With Arcade physics, I can use `this.physics.world.grid` or raycast. Arcade doesn't have easy tilemap here (I'm using custom static bodies). Let me use `this.physics.world.overlap` against a temporary zone? 

Simplest reliable: At enemy bottom-front, do a body check. Let me create a tiny sensor body attached? Phaser bodies can't easily parent. 

Alternative: Use `body.blocked.down` combined with a small forward check using the physics world's `overlap` against the platforms group with a constructed body. Complex.

Let me just do patrol-boundary + wall-bounce, and carefully size patrols to fit platform widths. Plus, when an enemy goes past the platform edge and falls, it falls into a pit and that's acceptable (it just falls). But enemies should stay on platforms patrolling. Let me add wall-bounce (blocked.left/right) as reversal, and a "turn at patrol boundary." For ledges, I'll add: if enemy is about to have no ground, turn — implement by checking if `enemy.body.blocked.down` is false AND it's moving horizontally at walking speed → reverse. Actually if it walks off a ledge, it's in the air (blocked.down false); on the frame it leaves, blocked.down becomes false; then we reverse direction and it falls back. It would fall straight down though. To truly avoid ledges I need to reverse before leaving.

Given time, let me implement a forward-looking sensor using the platforms static bodies. I can manually check: for enemy at (ex, ey) facing dir, compute the position of a point just past its edge and below by checking overlap with platforms group:

```
const edgeX = enemy.x + dir * (enemy.width/2 + 2);
const footY = enemy.y + enemy.height/2 + 2;
// check if there's a platform at (edgeX, footY)
const touching = this.platforms.getTilesWithinShape? // not tilemap
```

Not tilemap. I can do a manual check: iterate platforms and test if point is within a platform body. That's O(n) but n is small (~40), times 5 enemies = 200 per frame, fine.

Actually Arcade has `ArcadePhysics.overlap` with two objects. I could create a small invisible "sensor" sprite at the enemy's front-foot each frame and check overlap with platforms. But creating sprites per frame is wasteful.

Simplest: store platform rectangles and do point-in-rect checks manually. Let me store all platform bounds in an array `this.platformRects = []` and during create, when adding a solid, push `{x, y, w, h}`. Then for ledge detection:

```
function isSolidAt(px, py) {
  for (const r of this.platformRects) {
    if (px >= r.x && px <= r.x + r.w && py >= r.y && py <= r.y + r.h) return true;
  }
  return false;
}
```

Then in enemy update:
```
const dir = enemy.data.values.dir;
const footX = enemy.x + dir * (enemy.width/2 + 4);
const footY = enemy.y + enemy.height/2 + 6;
if (!isSolidAt(footX, footY)) {
  enemy.setVelocityX(-enemy.body.velocity.x);
  enemy.data.values.dir *= -1;
  enemy.setFlipX(dir < 0);
}
// wall bounce
if (enemy.body.blocked.left || enemy.body.blocked.right) {
  enemy.setVelocityX(-enemy.body.velocity.x);
  enemy.data.values.dir *= -1;
}
```

That handles ledges and walls. 

This is good but adds complexity. Given 15 min budget, let me just implement it — it's straightforward.

Now let me reconsider the coin creation and the whole coin tween re-adding on restart. Fine.

Let me also reconsider the player jump. Let me write a robust version:

```
// in create:
this.jumpPressed = false;
// in update, before movement:
const jumpDown = cursors.space.isDown || k.left.jump.isDown;
if (!this._prevJump && jumpDown) { this.jumpJustPressed = true; } else { this.jumpJustPressed = false; }
this._prevJump = jumpDown;

// jump
if (this.jumpJustPressed && this.player.body.touching.down) {
  this.player.setVelocityY(CFG.JUMP);
}
```

But `touching.down` while on ground is true each frame. With justPressed guard, only one jump per press. Good. And no mid-air double jump because requires touching.down. 

But the frame where player lands: touching.down true that frame (physics resolved), justPressed true if they pressed this frame. Good.

Edge: when player is resting on ground and holds jump, justPressed true only first frame → one jump. Good, no floaty.

Let me also handle the "canJump set in collider callback" vs touching.down. touching.down is reliable; I'll use it.

Now, there's a subtlety: Arcade's `body.touching.down` reflects collisions resolved THIS physics step. The physics step runs in preUpdate (before scene.update). So in update, touching.down is current. Good.

But does Arcade set touching.down for a Static body overlap? Player (dynamic) vs static ground: yes, the dynamic body's touching.down is set when it's resting on contact. Confirmed standard behavior.

Let me also reconsider: I use `this.physics.add.collider(this.player, this.platforms, this._onPlayerHit, null, this)`. The `_onPlayerHit` callback — I don't need it. Let me drop the callback to reduce confusion, or keep a no-op. Actually I'll remove the third arg.

Now let me also fix the `_hitEnemy` — remove the `onTop` using `body.touching.down && velocity.y>0`. When the player lands on the enemy (enemy is on a platform), player.body.touching.down should be true and velocity.y > 0. Good. But `body.touching.down` is only set when touching a platform, not an enemy, unless I enable enemy collision body contact. The overlap fires when bodies overlap; touching.down indicates contact with something below. For overlap (not collide), does `body.touching.down` get set? Overlap checks but `touching` flags are set during `collide`/`separate`, not `overlap`. So in an overlap callback, `body.touching.down` may not reflect the enemy contact. Hmm.

To detect "stomp from above" reliably via overlap: compare vertical positions. If `player.body.bottom <= enemy.body.top + threshold` and `player.body.velocity.y > 0` → stomp. Let me use that:

```
_hitEnemy(player, enemy) {
  if (this.isDead) return;
  const playerBottom = player.body.bottom;
  const enemyTop = enemy.body.top;
  const tolerance = 8;
  if (playerBottom - enemyTop < tolerance && player.body.velocity.y > 0) {
    // stomp
    player.body.setVelocityY(CFG.JUMP * 0.55);
    // disable enemy
    enemy.setVelocityX(0);
    enemy.disableBody(true, true);
    enemy.setAlpha(0.5);
    // shrink/squash then remove
    this.tweens.add({ targets: enemy, scaleY: 0.2, scaleX: 1.4, duration: 250,
      onComplete: () => enemy.destroy() });
  } else {
    // side or top contact -> lose
    this.loseGame();
  }
}
```

This is robust. Good.

Now let me also reconsider: while isDead (lose state overlay shown), update still runs movement? I gate movement with `if (this.isDead) { this.player.setVelocityX(0); return; }`. But I should still allow restart via R key. The restart key check is before the isDead gate. Good. But I set `return` in isDead branch — but the R key check is before that. Let me ensure order: check restart key first, then if isDead return. Actually in my code I check restartKey.isDown after the gate? Let me restructure: at top of update, handle restart (R) always; then if isDead, zero velocity and return (skip movement). Good.

Wait — but if the player loses by falling (world bounds), isDead set true in the worldbounds event handler (loseGame). Then update zeros velocity and shows overlay. The player sprite might be moving; zeroing stops drift. Fine. But the player could be mid-fall at the bottom bound — visually it's pinned at the bound. Fine, overlay covers.

Actually, when player falls into a pit and hits the bottom world bound, `body.blocked.down` true and velocity.y becomes 0 (collideWorldBounds). loseGame sets isDead. Overlay shown. Player pinned at bottom. Acceptable. Could add a "squash" but fine.

Now let me also make sure the goal/flag is reachable and clearly marked. The flag sprite drawn at (goalX+60, goalY). goalY = H-480 = 240. The platform for goal at y = goalY + T = 288, spanning x [goalX-60, goalX+180] = [360..600? no]. Let me recompute: goalX = W-180 = 3420. goalY=240. Platform makePlatform(goalX-60=3360, goalY+T=288, 240) → spans 3360..3600. Flag at x=goalX+60=3480, y=240. So flag banner near x=3480, platform 3360-3600. Reachable. Good. Coins near 3320-3500 at y=goalY-... coins at H-400-90 = 720-490 = 230. So coins at y=230, flag at 240. Fine.

Now, the level width W=3600, but the rightmost ground segment I defined at 3300..3600. The goal platform is 3360..3600. Good. After flag, nothing. Good.

Let me reconsider the pits: 
- Pit 1: between x=1700 and 2100 (no ground). Ground segments: 0-1700, 2100-2900, 3300-3600. The pit 1700-2100 is 400 wide. Player falls in → death (bottom world bound). But there's a platform bridging? Earlier I had makePlatform(1760, H-440, 220) and (2100..). Let me ensure platforms connect across the pit at a higher level. Platform at (1760, H-440=280, width 220 → 1760-1980). Another at (2100? no 2100 starts ground). Let me re-lay platforms to create a runnable route across the pit. This requires careful design.

Honestly, hand-designing a coherent Mario path across 3600px with multiple pits is error-prone in code. Let me simplify: make a SINGLE gap (pit) near the start that's the "gap causes loss" demonstration, with ground on both sides and a platform to jump across. The rest of the level is mostly solid ground with platforms and a couple of smaller hops. This reduces complexity while satisfying all requirements (one completable level, gaps, coins, enemies, flag, camera follow, restart).

Requirements: "Provide one completable scrolling level with solid platforms, gaps, collectible coins, patrolling enemies, and a goal flag." So at least one gap. Let me include 2-3 pits for good measure but keep a clear path.

Let me redesign the level as a sequence of platforms at the BOTTOM (ground) with gaps between, plus some elevated platforms for coins/enemies. The player runs from left to right, jumping over gaps.

Bottom ground (safe floor) segments with gaps:
- G1: 0..1200 (ground top y = 624)
- Pit: 1200..1500 (gap)
- G2: 1500..2100
- Pit: 2100..2400
- G3: 2400..3000
- Pit: 3000..3300
- G4: 3300..3600 (leading to flag)

Player jumps over each pit (pit width 300px < jump distance achievable with running jump). Gap 300px — with speed 230 and jump, can the player cross 300px gap? Mario-style, running jump covers horizontal ~ 200-300px. Let me make gaps 260px to be safe (so 5-6 tiles). Let me make pit width = 260 (< 6 tiles=288). Gaps of 260 are jumpable.

Actually with gravity 900 and jump -520, jump time to apex = 520/900 ≈ 0.58s. Horizontal distance at speed 320 = 320*0.58*2 ≈ 371px if running the whole time. But player starts running from standing; to cross a gap you need a running start. With my friction (0.86 damping) and acceleration via velocity, the player reaches near max speed quickly enough. 300px gap should be crossable. But to be safe let me make gaps 260px.

Elevated platforms for variety/coins/enemies (above the ground):
- P1: 1200-1380 at y=540 (small island in pit 1) — bonus.
- P2: 1500-1680 at y=560 — after pit 1.
- enemy at 1600.
- etc.

This is getting complicated. Let me keep it focused: 
- Bottom ground with 3 gaps.
- A few elevated platforms (bricks) with coins for the player to optionally jump up.
- Enemies patrolling on ground islands and one elevated.
- Flag at the end.

Let me set the player start on the first ground island, and the camera scrolls as they move right.

Given time constraints, let me write a clean, simpler level. Let me rewrite the create() level section with a platform-builder approach.

Let me define platforms as a list of {x,y,w,type}. type 'ground' or 'brick'. The bottom floor uses 'ground' tiles. I'll create ground as segments.

Let me write the final code now, replacing the messy parts.

Let me also double check `makeRoundedRect` exists on Graphics — yes `fillRoundedRect` exists. Good. And `fillTriangle`, `fillCircle`, `lineBetween`, `strokeRect`, `fillRect`, `drawTriangle`? I used fillTriangle. Good.

Texture generation: `g.generateTexture('key', w, h)` — yes works, returns a texture. Good. The textures are sized T, T, etc. Note player texture is T x T*1.8 = 48 x 86.4. Non-integer height. generateTexture with non-integer? Phaser may require numbers; .4 is fine but let me use integer sizes. Let me set player texture to 48 x 96 (T x 2T). Let me adjust player drawing to fit 48x96. Actually easier: T = 48, player height = 96. Let me redraw within 48x96.

Hmm, to keep proportions, let me just use texture size 48x96 and scale the player sprite. Or keep 48 x (48*1.8=86.4) → round to 88. Let me use 48x90 (1.875). Eh. Let me just make player 48 wide and 96 tall and draw a 2-tile-tall Mario. I'll redraw: body rect 16..64 wide, full 96 tall. Let me restructure drawing with the sprite being 48x96.

Actually, simpler: set the player texture size to T x (Math.ceil(T*1.8)) = 48 x 88. Non-integer 1.8 → ceiling 88. That's fine, generateTexture accepts floats actually; it just creates a canvas of that size. Canvas accepts float size (rounds). Let me keep T and T*1.8 but pass explicit numbers. Actually to be safe use integers: playerW = 48, playerH = 90.

Let me just define sizes as integers and redraw. This is fiddly; let me make the player a clean 48x96 Mario-ish figure.

Given time, let me write a robust version and test in browser, iterating.

Let me also reconsider: do I even need the `coinLayout` returning an array via weird `coinSpread`. Let me just inline `this.coinPositions = [...]` array.

Let me rewrite the whole file more carefully and cleanly. I'll aim for correctness first.

Let me also verify: `this.cameras.main.startFollow(this.player, true, 0.08, 0.08)` — signature: `startFollow(gameObject, ... )` where the boolean is `roundPixels`. 0.08, 0.08 are lerpX, lerpY. That's fine. Actually the second arg is `roundPixels` boolean, then lerpX, lerpY. Good.

Also `setScroll` exists on camera? `this.cameras.main.setScroll(x,y)` — yes. But startFollow already manages scroll. For restart, calling startFollow again is enough; I can also setScroll(0,0). Let me just call `this.cameras.main.startFollow(this.player, true, 0.1, 0.1)` and `this.cameras.main.setScroll(0,0)`? Setting scroll then startFollow overrides. Let me just re-follow and set camera to track player position (camera centers on player via lerp). After restart player at (160, 420); camera will lerp toward it. To immediately reset, `this.cameras.main.setScroll(160 - W/2, ...)`. Let me set scroll so player is centered: `this.cameras.main.setScroll(this.player.x - CFG.W/2, this.player.y - CFG.H/2)`. That puts camera directly on player. Good.

Now let me write the final version.

Let me also handle: the coin tween scale 1->1.3 repeat -1 on coins. On restart re-enable and re-tween. Good. Also `child.disableBody(true,true)` in _pickCoin — after that the tween still runs on a disabled/invisible body; fine. On restart enableBody restores. But the old tween is still running (targeting a now-disabled object); when re-enabled, I add a NEW tween. The old one... after disableBody(true,true) the gameobject is destroyed? disableBody(true,true) with hide=true, disable=true. If `destroy` = true first arg? `disableBody(visible, disable)`. It doesn't destroy the object, just body disabled and visible hidden. The tween referencing it continues but target invisible. On restart enableBody(false, x, y, true, true) sets visible=true and enables body. Then I add a new tween. The old tween may still be active targeting same object — two tweens scaling the same object. Minor visual. To be clean, on restart kill existing tweens for coins: `this.tweens.killTweensOf(this.coins.getChildren())`. Let me add that. Actually simpler: store coin tweens. Let me just killTweensOf children before re-adding.

Hmm, `enableBody` signature: `enableBody(gameObject, ... )`? No, on a group: `group.enableBody(x, y, ... )` for a single? Actually `Group.enableBody` works on group children. `child.enableBody(x, y, ...)`. Let me use `child.enableBody(false, child.x, child.y, true, true)`. 

Let me also kill tweens: `this.tweens.killTweensOf(this.coins.getChildren())`.

OK let me also reconsider enemy death tween: enemy.disableBody? Enemies are in `this.enemies` group (not physics group with bodies? they are physics.group). `enemy.disableBody(true,true)` hides + disables. Then tween scaleY/scaleX and onComplete destroy. After destroy, the enemy is removed from the scene and group. Good. But disableBody then tween then destroy. Actually I can skip disableBody and just tween+destroy. But overlap might fire again during tween? If I destroy after, the overlap won't refire while tweening (the enemy is still in physics during tween). During the 250ms tween, another overlap could refire _hitEnemy → isDead? No, isDead is set only on lose. Multiple stomps possible. Let me set a flag `enemy.setData('dead', true)` and check `if (enemy.data.get('dead')) return;` at top of _hitEnemy. And disableBody. Let me add.

Actually simpler: on stomp, set `enemy.body.checkCollision.none = true` and disable its velocity, add a 'stomped' flag, then after tween destroy. Let me do:
```
if (enemy.data.get('stomped')) return;
enemy.data.set('stomped', true);
player.body.setVelocityY(CFG.JUMP*0.55);
enemy.setVelocity(0,0);
enemy.body.checkCollision.none = true;
this.tweens.add({targets: enemy, ..., onComplete:()=>enemy.destroy()});
```

Good.

Now let me also make sure enemies turn at walls via body.blocked. Static platforms in a staticGroup — enemies colliding with them get blocked.left/right set. Good.

Let me also double check `this.platforms` is a staticGroup; `this.platforms.add(body)` adds the rectangle body to static group. But I also `this.add.image` for tiles separately (not in group) as decoration at depth -1. Good.

Wait — `this.platforms = this.physics.add.staticGroup()`. Then `this.platforms.add(body)` where body is a rectangle added via `this.add.rectangle`. Static bodies from staticGroup can contain non-physics objects? Adding a plain rectangle (no physics?) — but `setSize` is a physics method. A plain `this.add.rectangle` is not a physics body. I need physics-aware objects in the static group. Let me use `this.add.zone` or `this.physics.add.existing(rectBody, true)`? 

Better approach: For static platforms, create them via the physics system as static bodies. Use `this.add.rectangle(...)` then enable physics: `this.physics.add.existing(rect, true)` makes it a static physics body. Then add to the static group: `this.platforms.add(rect)`. But staticGroup.add expects a Body? Actually a static group holds GameObjects with static bodies. Let me verify: `this.physics.add.staticGroup()` creates a group; you add physics-enabled objects. Adding a rectangle with a static body works. But simpler: many examples do `this.platforms.create(x,y,'tile')`? That creates a sprite per tile with static? Actually `staticGroup.create` adds a physics-enabled object as static? Hmm, staticGroup.create creates a child but I think it makes it static. Let me instead use the standard pattern:

```
this.platforms = this.physics.add.staticGroup();
this.platforms.create(x, y, 'ground'); // sprite from texture, static body
```

Wait, does staticGroup.create produce static bodies? Yes! The ArcadePhysics `staticGroup` creates children whose bodies are STATIC. The `.create(key,...)` for a staticGroup automatically makes the body static. Actually no — `.create` adds an image (from textureKey) to the group via the default. Let me recall: For a staticGroup, `.create(x, y, ...config)` returns a child with a static body. Yes, Arcade static groups' `create` method sets `allowGravity=false` and `body = new StaticBody`. 

So the cleanest: for platforms, stamp tiles by creating static sprites across the width. For wide solid platforms (e.g., ground segments), I can create ONE rectangle static body spanning the width and then stamp decoration tiles on top. To get a static rectangle body of size w x h: 

```
const body = this.add.rectangle(cx, cy, w, h, 0xff0000); 
this.physics.add.existing(body, true); // make static
this.platforms.add(body);
```

Hmm but `this.platforms.add(body)` for a static group adds it as a static child (the group's `add` sets `child.body` ... actually for staticGroup, add just adds the child to display; the child already has a static body). Let me verify with docs: `staticGroup.add(gameobject)` — adds to the group. Should be fine. But mixing rectangle bodies and decoration images.

Actually, the simplest and most reliable: use `this.platforms.create(x, y, 'tile')` for each tile, where the tile IS a static physics body. For wide ground, just create tiles in a row. For thin platforms, also create tiles in a row. For brick platforms create 'tile' sprites in a row. For ground, create 'ground' sprites in a row.

This avoids manual body creation entirely! Each platform tile is a static physics body (since group is staticGroup) that collides with the player. 

So:
```
this.platforms = this.physics.add.staticGroup();
const fillTiles = (gx, gy, wTiles, key) => {
  for (let i=0;i<wTiles;i++){
    this.platforms.create(gx + i*T + T/2, gy + T/2, key);
  }
};
```

Ground segments: fillTiles(x, groundY, nTiles, 'ground').
Brick platforms: fillTiles(x, y, n, 'tile').

This is clean and the tiles are static bodies that collide. The player collides with this staticGroup. 

Let me define groundY = H - 2*T (top of bottom ground). Ground segments:
- 0..1200: n = 1200/T = 25 tiles
- 1500..2100: 600 → n=12
- 2400..3000: 600 → n=12
- 3300..3600: 300 → n=6

Pits: 1200-1500, 2100-2400, 3000-3300. Each 300px gap. Jumpable with running start.

Elevated platforms for coins/enemies (bricks):
- BrickIsland1: (1300, 560, 3 tiles) in pit1
- BrickIsland2: (1700, 520, 4 tiles)
- etc.
- Elevated coin platforms: a few.

Let me design elevated platforms that connect (with jumps) so the level is completable, OR make them optional bonuses the player can reach by jumping up. For a completable route, the bottom ground + pits + flag is enough. Elevated platforms are bonus.

Let me place enemies on ground islands (patrol) and one on the brick island.

Coins: place some on ground islands (easy), some on elevated platforms (reachable by jumping up), some over pits (require precise jumps).

Let me finalize. For the goal: flag sprite on a small platform at the end.

Let me reconsider platform heights to be jumpable. Ground is at top y = groundY = H-2T = 624 (top). Player must jump from ground to a brick island at y=560 (height diff 64) — easy. And gap jumping 300px from ground to ground — doable running.

Elevated bricks at y=520 (height 104 above ground) — a 2-tile jump. JUMP -520 with gravity 900: to rise 104px takes t solving 104 = 520t - 450t² → 450t² -520t +104=0 → discr=270400-187200=83200, sqrt=288, t=(520-288)/900≈0.258s. Horizontal at 320*0.258≈82px. So can reach a platform 82px ahead horizontally and 104px up while jumping. Fine for bonus platforms placed right at the edge.

OK enough. Let me write the final code. I'll be careful and then test/iterate in the browser.

Let me also reconsider whether I should scale player texture. Player texture 48x96 (T x 2T). I'll set the player sprite to displaySize 48x96 and body size 48x96. Default sprite body = texture size. Good.

Now let me write it.

Actually, for the player figure within a 48x96 texture, let me redraw:
- Body (red shirt + blue overalls): 
  - shirt: red rect x0..48, y28..70 (over middle)
  - overalls straps: blue rects at left/right of head
  - pants: blue
  - hat: red at top with skin face below
Let me just draw something recognizable:
  - Head/skin: 48 wide, y 14..50, circle-ish
  - Hat: red rectangle at y 10..26 across full width, with a brim shade
  - Face: yellow circle
  - Eyes: black circles with white
  - Body: red rect 14..34 wide, 50..90
  - Arms: red rect above body
  - Pants: blue rect below
  - Overalls straps: blue from shoulders to body

Let me draw procedurally:

```
// player texture 48x96
g.fillStyle(0x1E2727); // dark for outline shadow? skip
// Hat (red)
g.fillStyle(0xC0392B);
g.fillRect(6, 8, 36, 22);   // hat top+brim
// Face (skin)
g.fillStyle(0xF1C40F);
g.fillCircle(24, 38, 11);
// Eyes (black)
g.fillStyle(0x212121);
g.fillCircle(20, 35, 3.5);
g.fillCircle(28, 35, 3.5);
// Shirt (red)
g.fillStyle(0xC0392B);
g.fillRect(10, 48, 28, 34);
// Overalls straps (blue)
g.fillStyle(0x34495E);
g.fillRect(10, 48, 6, 16);        // left strap
g.fillRect(32, 48, 6, 16);        // right strap
// Overalls body / pants (blue) - just below shirt
g.fillRect(10, 82, 28, 14);
// Pants (blue darker)
g.fillStyle(0x2980B9);
g.fillRect(10, 82, 12, 14);
g.fillRect(26, 82, 12, 14);
```

This makes a 48x96 Mario-ish figure. Good enough.

Coin texture 48x48: gold coin with inner ring. Use fillCircle(24,24,18) gold, stroke darker.

Enemy 48x48? Earlier I made enemy T (48) tall but with feet at bottom 0.78. Let me make enemy 48x64 to be a bit taller Goomba. Actually 48x48 is fine. Let me keep 48x48 but ensure body.setSize matches for stepping. The enemy body default = texture size 48x48. Good.

Flag texture: width 48, height = pole+flag. Let me make height 240 (5 tiles). Pole brown rect 48*0.15 x 240, plus flag triangle at top. Let me draw:
```
g.fillStyle(0x8B4513);
g.fillRect(21, 0, 6, 200); // pole (near right, so player can be on left side)
// flag at top
g.fillStyle(0xE74C3C);
g.fillTriangle(21, 0, 21, 40, 90, 20); // red flag draping
```
Hmm, pole position. The goal sprite top at (goalX+60, goalY). The platform is below. The player reaches the flag by jumping to the platform, then touching the flag. The flag body — I'll set a custom body. Let me set flag as a sprite with `setSize(48, 60)` and offset 0,0 (top portion) so touching the flag top wins. Actually let me make a separate small invisible "goal trigger" at the flag. 

Simpler: Create the goal as a physics sprite (for overlap) sized small, and draw the flag visually on top. Let me make `this.goal` a sprite (no physics) for display, and a separate `this.goalTrigger` physics sprite (sensor) at the flag position with small size, overlap for win.

```
this.goal = this.add.sprite(goalX, goalY, 'flag');
this.goalTrigger = this.physics.add.sprite(goalX + 30, goalY + 40, null).setSize(48, 60).setOffset(-24, -30);
this.goalTrigger.body.setAllowGravity(false);
this.goalTrigger.body.setImmovable(true);
this.goalTrigger.setDepth(5);
this.physics.add.overlap(this.player, this.goalTrigger, () => this.winGame());
```

Good. The trigger body positioned near the flag banner.

Let me now write everything. I'll rewrite the whole file cleanly.

Let me reconsider sizes: T=48. Textures: player 48x96, coin 48x48, enemy 48x48, flag 48x200, tile 48x48, ground 48x48.

Let me write the platform fill using staticGroup.create which makes static bodies from the texture key. `this.platforms.create(gx+i*48+24, gy+24, 'ground')`. The static body size = texture frame size = 48x48. Good, collides.

Now camera: bounds (0,0, WORLDW, WORLDH). WORLDH = 720. The ground spans y 624..720 (top 624, two rows: 624 and 672). Player start y: above first ground. Let me set player start at (160, 624 - 200) = (160, 424). Jump down to ground below. 

Actually let me set playerStart = (160, H - 2*T - 120) = (160, 720-96-120 = 504). Good.

Let me also place coins on the ground path at y around groundY - 40 = 584, so they're collectible while walking. And elevated coins.

Let me write final.

For enemy patrol on ground islands: an island at x 1500..1800 (300 wide = 6 tiles), enemy origin at 1650, patrol 200 (so ±100 → 1550..1750 within island). Good. Another on island 2400..2700 origin 2550 patrol 180. Etc. Need islands wide enough. Let me widen islands to 400 where enemies patrol.

Let me redefine ground segments with enemy islands wider:
- G1: 0..1200 (25 tiles). Player start here.
- Pit 1: 1200..1500 (gap 300).
- G2: 1500..1900 (400 wide). Enemy here.
- Pit 2: 1900..2200 (gap 300).
- G3: 2200..2700 (500). Enemy here.
- Pit 3: 2700..3000 (gap 300). Hmm but I also wanted 3000..3300 pit. Let me reduce to 2 pits to simplify reachability. Actually let me keep 3 gaps but ensure path.

Hmm, gap 300 requires running jump. The player can run right before the gap. Fine.

Let me also add an elevated brick path so the player can also go "up" — optional. Keep it simple: just ground islands + gaps + a couple elevated platforms with coins + the flag at end on an elevated platform.

Let me place flag on an elevated platform near the end: at x 3480, y 624-T*1.5? Let me make flag platform at y = groundY - 2*T = 624-96 = 528, spanning 3360..3600. Flag banner at (3520, 510). Coins around.

Wait groundY=624. Elevated platform at 528 is 96px above ground — jumpable. Good.

Let me finalize the level:

```
const gy = H - 2*T; // 624, top of bottom ground
const groundY = gy;
const islands = [
  { gx: 0, n: 25 },           // 0..1200
  { gx: 1500, n: 8 },         // 1500..1860
  { gx: 1900, n: 10 },        // 1900..2360
  { gx: 2460, n: 11 },        // 2460..2988 (closes gap near 3000)
  { gx: 3180, n: 9 },         // 3180..3624
];
islands.forEach(is => fillTiles(is.gx, groundY, is.n, 'ground'));
```

Wait island 4 starts 2460, previous ends 2360 → gap 200. island5 starts 3180, previous ends 3048 → gap 132. Hmm, let me just pick clean island boundaries with ~280 gaps:

- I1: 0..1200 (n=25, gx=0)
- Pit: 1200..1480 (280)
- I2: 1480..1900 (n=9, gx=1480) → covers 1480..1920
- Pit: 1920..2200 (280)
- I3: 2200..2640 (n=9, gx=2200) → 2200..2640
- Pit: 2640..2920 (280)
- I4: 2920..3320 (n=8, gx=2920) → 2920..3280... that's 8 tiles=384, ends 3304. Let me make n=8 → 2920+384=3304. Pit after: 3304..3520 (216)
- I5: 3520..3620? too short for flag. 

Let me make the final island wide for the flag: 
- Pit: 3320..3600? then no room. 

Let me reduce to ensure flag island has room:
- I1: 0..1300 (gx 0, n=1200/T? n=26 → 0..1248)
Hmm T=48, n=26 → 1248.

This is fiddly. Let me just compute in code: I want gaps of ~280 (jumpable) and a final wide island for the flag.

```
const gaps = [ {start:1280, width:280}, {start:1900, width:280}, {start:2560, width:280} ];
```
Ground = full 0..W except gaps. Build by iterating tiles but skipping gap ranges. That's the cleanest: iterate all ground tile positions from x=T/2 step T; for each, check if it overlaps a gap; if not, create ground tile. This gives continuous ground with gaps.

```
const gaps = [{a:1280,b:1560},{a:1900,b:2180},{a:2560,b:2840}];
for (let x=T/2; x<W; x+=T) {
  let inGap = gaps.some(g=> (x+10)>g.a && (x-10)<g.b);
  if (!inGap) this.platforms.create(x, groundY+24, 'ground'); // one row
  // also second row slightly below for 2-tile height wall
  if (!inGap) this.platforms.create(x, groundY+24+T, 'ground');
}
```
This creates 2-tile-high ground walls except over gaps. Clean. Gaps are 280px. 

But for Mario-style, the player can jump across 280px gaps easily. But also the player might walk into the edge of ground and fall — that's the "gap" mechanic. Good.

For elevated platforms (coins/enemies), place a few brick rectangles:
```
fillTiles(1350, groundY - T*1, 4, 'tile');  // elevated, y=528
fillTiles(1700, groundY - T*2, 3, 'tile'); // y=480
fillTiles(2150, groundY - T*1, 5, 'tile');
fillTiles(2600, groundY - T*2, 3, 'tile');
// flag platform
fillTiles(3000, groundY - T*2, 8, 'tile'); // leading to flag
```

Coins scattered on ground (y = groundY - 20) and on elevated platforms (y = top - 20). 

Let me just generate coins programmatically along the top of ground and platforms, plus some in the air requiring jumps.

Let me generate coins in a simple pattern: along each ground island top at y=groundY-20, every ~120px; plus on elevated platforms.

This is workable. Let me write it.

For enemies: patrol on ground islands (not over gaps). Place them at the center of each ground segment between gaps with patrol width that keeps them on the ground. E.g., enemy at x=800 (between 0..1280 gap), patrol 200, dir -1. Enemy at x=1620 (between gap1 1280-1560 and gap2 1900-2180 → ground 1560..1900), patrol 200. Enemy at x=2240 (gap3 2560-2840; ground 2180..2560) wait 2180..2560 width 380, enemy at 2370 patrol 200. Etc.

Actually enemy centers must keep origin within ground. Let me compute ground segments:
- seg A: 0..1280 (width 1280)
- seg B: 1560..1900 (340)
- seg C: 2180..2560 (380)
- seg D: 2840..W (860) (since no gap after C except... I had gaps at 1280,1560,1900,2560-2840. So seg D: 2840..3600 width 760)

Enemies:
- A: origin 640, patrol 400, vel -70 (patrol ±200 → 440..840 within A)
- B: origin 1730, patrol 240, vel -65 (±120 → 1610..1850 within B)
- C: origin 2370, patrol 240, vel -60
- D: origin 3200, patrol 400, vel -70
- Elevated brick enemy: on brick platform at (2150, gry-24) width 5 tiles=240, origin 2270, patrol 200, vel -55. This one is elevated (not on ground) — ledge detection keeps it from walking off.

Good.

Now let me write the full file. Let me be careful with Phaser API:
- `this.physics.add.staticGroup()` then `.create(x, y, key)` → returns a StaticSprite? Actually returns the child with a static body. Overlap with it works; collide works.
- `this.physics.add.group({ key, ... })` for dynamic.
- `this.physics.add.existing(sprite, true)` for static.

For the goal trigger, use `this.physics.add.existing` on a zone, or create a sprite. Let me create an invisible sprite via `this.add.zone`? Zones aren't physics by default. Use `this.physics.add.sprite(x,y,null)` with no texture — Phaser creates a 1x1? Better: create a small sprite from an existing texture, e.g. 'coin' scaled invisible, or use graphics. Let me create a small graphics-drawn 'trigger' texture (1x1 invisible). Actually I can do `this.add.rectangle(x,y,w,h,0xff0000,0)` then `this.physics.add.existing(rect, false)` (dynamic, but no gravity via setAllowGravity false). Make it a sensor: `rect.body.setAllowGravity(false); rect.body.setImmovable(true); rect.body.setEnable...` Overlap with player → win. But it's dynamic; fine.

Let me make `this.goalTrigger = this.add.rectangle(...); this.physics.add.existing(this.goalTrigger, false);` then configure. Use overlap.

Actually simpler: make goal a sprite with physics, immovable, sensor:
```
this.goal = this.physics.add.sprite(flagX, flagY, 'flag');
this.goal.setAllowGravity(false);
this.goal.setImmovable(true);
this.goal.body.setAllowGravity(false);
```
But the flag texture is large (48x200 body). Overlap would trigger when player is near the pole base. Acceptable but might trigger too early. Let me set `this.goal.body.setSize(48, 80)` and `this.goal.body.setOffset(0, 120)` so the hitbox is near the flag banner (top area). Then overlap with that → win. Good. And the visual flag is still drawn full height.

```
this.goal = this.physics.add.sprite(flagX, flagY, 'flag');
this.goal.setAllowGravity(false);
this.goal.setImmovable(true);
this.goal.body.setSize(48, 80).setOffset(0, 0); // hitbox at top
```
flagY is top; body centered default → top at flagY - 100... hmm body center offset. Let me set flag sprite's body to be at the top banner region. The flag texture 48x200, origin 0.5 → body centered at flagY. The banner is near top (y 0..60 of texture ~ display top). body.setSize(40,60) offset (4,60)? Let me set offset so hitbox covers banner area: top of sprite at flagY-100 (center offset). This is getting fiddly. 

Let me just make the flag sprite's display origin top: `this.goal.setOrigin(0, 0)` so sprite top-left at (flagX, flagY). Then body by default sized to texture centered at the sprite's transform. With origin 0, the body center is at flagY + 100 (texture height/2). Hmm. Body positioning for origin non-default is tricky.

Let me avoid the confusion: place the flag visually and separately create a small goal sensor rectangle:

```
this.flagSprite = this.add.sprite(flagX, flagY, 'flag');
this.flagSprite.setOrigin(0.5, 0);
this.flagSprite.setDepth(6);

this.goal = this.add.rectangle(flagX + 24, flagY + 40, 40, 70, 0xffffff, 0); // invisible sensor
this.physics.add.existing(this.goal, false);
this.goal.body.setAllowGravity(false);
this.goal.body.setImmovable(true);
this.goal.body.setOffset(0, 0);
this.physics.add.overlap(this.player, this.goal, () => { if(!this.isDead) this.winGame(); });
```

Good, sensor is a 40x70 invisible rect placed at the flag banner.

Now win condition also needs the player to actually reach there. Fine.

Let me also ensure the player can stand on the flag platform. The flag platform is bricks at y=groundY - 2T = 528, spanning 2920..3360 (8 tiles). flagX = 3300 maybe. Let me set flagX = 3360, flagY = 528 - 200 = 328 (banner top). flagSprite at (3360, 328). Sensor at (3360+24, 328+40).

Player reaches by running to 3360, jumping onto brick platform at y=528, then walking right to flag. Coins along the way.

Let me finalize coordinates and write.

Let me write the coins: generate along ground tops and platform tops and some airborne.

I'll write a coin-generation routine:
```
addCoins() {
  this.coins = this.physics.add.group({ key:'coin', ... }); // no, create manually
}
```
Manual:
```
this.coins = this.physics.add.group({ defaultKey: 'coin' });
// helper
const addCoin = (x,y) => { const c = this.coins.create(x,y,'coin'); c.setDepth(8); };
```
Place coins at y = groundY - 24 (above ground top). For elevated: y = platformTop - 24.

Let me just hardcode a list of coin positions, simpler and deterministic. ~35 coins.

Let me write them: along ground from x=200 to 1200 step ~130: 200,330,460,590,720,850,980,1110. y=groundY-24=600.
On elevated bricks:
- brick (1350,528,4) → coins at 1400,1520,1640 y=504
- brick (1700,480,3) → 1780,1900 y=456
- brick (2150,528,5) → 2230,2350,2470,2590 y=504
- brick (2600,480,3) → 2680,2800 y=456
- flag platform (2920,528,8) → 3000,3120,3240,3360,3480,3600,3720,3840? beyond. Let me do x 3000..3560.
Airborne coins above gaps (for skilled jumps):
- above gap1 (1560-1280= mid 1420): coin at 1420, 624-120=504? risky. Let me place a few floating coins that require a jump up from ground: x=1000,y=400; x=2300,y=380; etc.
- Coins right before a gap encourage running jump.

Let me just place a reasonable spread. Completeness not critical; just need collectibles that increase count.

Let me write ~40 coins.

Now, total world width 3600, height 720. Camera 960x540 follows player. Good.

Let me also draw a distant background? Optional. The config backgroundColor is sky blue #5C9C94? I set 0x5C94FC (blue). Good enough; could add clouds but optional. Let me add simple cloud shapes via graphics as decoration at depth -2 for visual polish. Optional — skip to save time, but nice. I'll add a few white cloud polygons. Actually let me add a parallax-ish static cloud layer drawn as a Graphics texture? Graphics not for textures easily. Skip clouds.

Let me write the final file now.

One more: input keys A/D. I bound `this.keys = { left: createKeys({left:A,right:D,jump:SPACE}) }`. `createCursorKeys` separate. I'll combine. In update, left = cursors.left.isDown OR keys.left.isDown; right = cursors.right.isDown OR keys.right.isDown; jump = cursors.space.isDown OR keys.jump.isDown.

Let me ensure Phaser.Input.Keyboard.KeyCodes.A etc. exist — yes.

Let me also handle mobile? Not required. Desktop keyboard.

Let me write it.

Also need `defaultKey` for physics group — `this.coins = this.physics.add.group({ defaultKey: 'coin' });` then `.create(x,y)` uses defaultKey. Good.

For the enemy squat + destroy, after destroy the body is gone; the group keeps reference but fine.

Let me write final now, then run in browser.

Let me also double-check the `tweens` re-add on coin restart. I'll store coin refs? I'll just killTweensOf(getChildren) then re-add. 

Let me write the code.

I realize there might be an issue with `fillTiles` using staticGroup.create for EVERY tile including 2 rows of ground across 3600px (minus gaps) = ~75*2 = 150 static bodies. Fine.

Also the brick platforms use same fillTiles with 'tile' key = static bodies. Good. Player collides with all (one group).

Now writing.

Let me reconsider jump detection timing once more, because it's critical for the "test running and jumping, landing" verification. With Arcade, in `update()`, `this.player.body.touching.down`:
- It's true when, during the physics step that just completed, the body had a collision on its bottom.
- When standing on ground: every physics step the player is pushed up by gravity resolution → touching.down true each frame. So jump works every frame touching ground.

But there's a known gotcha: if you set velocityX directly and also gravity, the body might jitter. With `setVelocityX`, Arcade adds gravity each step; resting on ground: gravity tries to move down, collision resolves by zeroing velocity.y and setting touching.down, and `body.blocked.down=true`. Good. So touching.down true. 

Edge: I call `this.player.setVelocityX(...)` which sets velocity.x directly (not adding). Combined with gravity (default add). Fine.

Now friction when no key: `setVelocityX(velocity.x * 0.86)`. Good.

I think it's solid. Let me also ensure `this.player.body.wasTouching` not used. Fine.

Write final.

Let me make sure about `this.physics.world.on('worldbounds', (body, up, down, left, right)=>{...})`. The callback receives (body, up, down, left, right). body.gameObject === this.player. If down → lose. Good. Need `this.player.setCollideWorldBounds(true)` and `this.player.body.onWorldBounds = true`? Actually `setCollideWorldBounds(true)` sets collideWorldBounds; `onWorldBounds` on the body must be true for the event to fire. Let me set `this.player.body.onWorldBounds = true;`. Also set world bounds via `this.physics.world.setBounds(0,0,W,H)`. The world.setBounds default already matches game? Arcade world size default is game size. But our world is larger (3600x720). Need to set world bounds: `this.physics.world.setBounds(0,0,this.worldW,this.worldH)`. Good. And `this.cameras.main.setBounds(0,0,this.worldW,this.worldH)`. Good.

Now `collideWorldBounds` with world height 720 — player at y near 720 (bottom) blocked → lose. But the ground top is at 624, body sits ~ground 624+... player standing on ground, feet at ~624+24=648? player height 96, body center ~ groundY - 48 = 576 when standing (feet at 624). So player stays well above 720. Falling into a gap: player falls from gap edge (y~624) down; reaches 720 bottom → worldbounds down → lose. Good.

But the bottom of the ground tiles: ground created at y = groundY + 24 (top at groundY, center 624+24=648) and second row groundY+T+24 = 720. The second row top at 672, center 720. So ground occupies 624..720. The player colliding with ground at 624 (first row) stops there. Good. The death plane is world bound 720. Good.

Wait, gap has NO ground, so player falls through gap region (x in gap, y from 624 down to 720) unobstructed → hits world bound 720 → lose. 

Now let me write the final file.

I'll also add a subtle "coyote" no. Keep strict.

Let me also make sure that when the player loses via worldbounds, the player body might be pinned at y=720 and the camera follows → shows bottom. Overlay covers. Fine. Maybe better to not show. It's okay.

Let me write it all out now.

Let me also reconsider enemy ledge detection function referencing `this.platformRects`. I'll build platformRects as a list of {x,y,w,h} for all solid tiles (ground + bricks). For ledge detection I check the point (frontX, footY) against these rects. Since tiles are 48x48 static bodies positioned at (gx+i*48, gy), the rects are {x: gx+i*48, y: gy, w:48, h:48} for ground (gy = groundY = 624, two rows y 624 and 672). For bricks at gy. So foot check at footY = enemy.y + 32 (enemy is 48 tall, bottom at enemy.y+24). footY = enemy.y+24+4 = enemy.y+28. frontX = enemy.x + dir*26. Check if that point is within any rect (x..x+w, y..y+h) with the rect's top. For ground, the rect top y=624; the point's y ~ enemy.y+28. If enemy stands on ground, enemy.y≈624-24=600 (center), foot at 628, front ground rect top 624..672 → 628 within 624..672 and x within tile range → solid. Good. At ledge, front point falls outside → turn. 

But the rect y range for ground includes 672..720 (second row) too — point at 628 only within first row rect y624..672. Good.

Edge case: brick platform at y=528 (top), rect y 528..576. Enemy on it: enemy.y≈504, foot≈532, within 528..576. Good.

Implement `isSolid(px,py)`:
```
for (const r of this.platformRects){
  if (px>=r.x && px<=r.x+r.w && py>=r.y && py<=r.y+r.h) return true;
}
return false;
```

OK. Let me write.

I'll also push rects when filling tiles.

Now, writing the file fully.

Let me reconsider the player texture drawing with the 48x96. Let me draw it well.

Also enemy: 48x64? Let me use 48x64 for a rounder Goomba. I'll draw enemy in 48x64 texture:
```
g.fillStyle(0x616261); // grey
g.fillRoundedRect(0, 8, 48, 56, 12); // body
// eyes
g.fillStyle(0x000000);
g.fillCircle(15, 30, 7); g.fillCircle(33, 30, 7);
g.fillStyle(0xFFFFFF);
g.fillCircle(13, 28, 3); g.fillCircle(35, 28, 3);
// feet
g.fillStyle(0x2C3E50);
g.fillRect(2, 60, 16, 10); g.fillRect(30, 60, 16, 10);
```
Enemy body 48x64. Enemy body.setSize matches. Good.

Let me write everything.

Let me also make coin spin animation (rotate) — simple tween rotate 0..360 infinite. Add in creation.

Now, code. Let me write.

Actually, `fillRoundedRect` exists in Phaser 3.80 Graphics? Yes. Good.

Let me write the file.

For the player, set body size maybe 40x90 with offset to be less tall hitbox. Let me set the player sprite display size 48x96 and body 48x96 default. For collision with enemies (stomp), body bottom matters. Fine.

Let me write now. I'll also add a restart text hint when overlay not shown? The controls already show. When overlay shown, it says press R. Let me make the R key restart work in both win/lose and also a visible "Restart (R)" button. I'll add a button in overlay for restart as well (pointer). Let me add a restart button element toggled.

Actually requirement: "Provide Restart that resets coins, enemies, player, and camera." I'll show a Restart button in the overlay on win/lose. Also R key. Let me add a button.

Let me add in HTML a `<button id="restart-btn">` inside overlay, hidden by default, shown with overlay. On click → resetWorld.

Let me finalize HTML and JS.

Let me write it.

The library works. Now let me look at the existing file I created and refine it based on issues I've identified in my review. Let me rewrite it cleanly and correctly.

→ write /tmp/job-fPtsoQ/index.html (19380 bytes)
toolResult

Successfully wrote to /tmp/job-fPtsoQ/index.html

assistant
thinking
Now let me run it in the browser.

Now let me run it in the browser to test.

→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","error: Cannot read properties of undefined (reading 'sys')","warning: [.WebGL-0x1a6c00186000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R","images":"model does not support images"}

assistant
thinking
There's an error: "Cannot read properties of undefined (reading 'sys')". Let me find where. It likely relates to `this.cameras.main.setBackgroundColor` or `scene.make.graphics`. Or the `worldbounds` event. Let me look at the console more fully. The error is likely from `g.strokeTri`? No. Let me check what's undefined.

"Cannot read properties of undefined (reading 'sys')" - this is often from `this.input.keyboard` or `scene.make`. Could be `this.cameras.main.setBackgroundColor`? Actually `setBackgroundColor` exists.

Let me check `this.children.each ? null : null;` - that's a weird line. `this.children` is the display list; `.each` is a method. Fine.

Could be `this.tweens.add` before tweens system ready? No, create runs after.

Let me add more detailed error. The error might be from `addCoin` using `this.tweens.add` — fine.

Actually "reading 'sys'" — likely `Phaser.Input.Keyboard` `addKeys` returning keys and then `k.left` ... Let me check: I do `this.keys = this.input.keyboard.addKeys({...})`. Then `k.left.isDown`. k.left is a Key. Fine.

Hmm, the error could be from `this.physics.world.on('worldbounds', (body) => {...})` — body may be undefined? No, event passes body.

Let me look at the actual stack. Let me open the devtools to find the error location.

There's an error. Let me inspect the console details and stack trace.

→ bash {"command":"cd /tmp/job-fPtsoQ && ls -la .home/ 2>/dev/null; cat .home/* 2>/dev/null | head -20; echo \"---checking for browser devtools---\
→ browser {"action":"inspect"}
toolResult

total 20 drwxr-xr-x 5 node node 4096 Oct 7 05:09 . drwx------ 3 node node 4096 Oct 7 05:04 .. drwxr-xr-x 3 node node 4096 Oct 7 05:09 .cache drwx------ 3 node node 4096 Oct 7 05:09 .config drwxr-xr-x 3 node node 4096 Oct 7 05:03 .pi ---checking for browser devtools---

toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","error: Cannot read properties of undefined (reading 'sys')","warning: [.WebGL-0x1a6c00186000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R","images":"model does not support images"}

assistant
thinking
The error "Cannot read properties of undefined (reading 'sys')" — I need the stack trace. Let me reproduce by loading the page in a headless way, or check via a node-based Phaser headless render? Phaser needs a canvas. 

Let me try to get a more detailed error by adding a try/catch or by examining the source. The error likely comes from a specific call. Let me think about what reads `.sys` on an undefined. 

Common places: 
- `scene.make.graphics` - uses scene.sys.
- `this.tweens.add` - uses sys.tweens. If tweens system is fine.
- `this.cameras.main.setBackgroundColor` — cameras.main is the camera, .sys? setBackgroundColor uses internal. Actually `setBackgroundColor` is a camera method; it might call `this.scene.sys...`? Hmm.

Actually the error might be from `this.physics.add.existing(this.goal, false)` then `this.goal.body.setOffset`? SetOffset exists. 

Or `this.goal.body.setCheckCollision.all(false)` — does `setCheckCollision` exist? Arcade.Body has `setCheckCollision` object with `none`, and `checkCollision.up/down/left/right`. There's `body.checkCollision.none`? Let me check. Arcade.Body has `checkCollision: { none: boolean, up: boolean, down: boolean, left: boolean, right: boolean }`? Actually it's `checkCollision.none` is a getter? Let me recall the API: Arcade.Body.checkCollision = { up, down, left, right, none }? I think it's actually `body.checkCollision.none` is not standard; standard is `body.setCheckCollision` no. Let me check: Arcade.Body has property `checkCollision` which is an object `{ none, up, down, left, right }`? Hmm, actually I recall `body.checkCollision.up`, `.down`, etc. Yes those exist. And `body.checkCollision.none`? Let me verify. Actually there IS `body.checkCollision.none`? I'm not 100% sure. Let me check the phaser source.

The error "reading 'sys'" — `setCheckCollision` is not a method. But `body.checkCollision.all(false)` would throw "all is not a function", not 'sys'. 

Let me look at what reads `.sys` of undefined. The camera `setBackgroundColor` — Camera.setBackgroundColor calls `this.setBackgroundColor` which... Actually Camera.setBackgroundColor sets `this.backgroundColor` (a Color object). It does NOT touch sys. 

Hmm. Let me look at `this.cameras.main.startFollow(this.player, true, 0.1, 0.1)`. Camera.startFollow sets `_follow` etc. Fine.

`scene.make.graphics({x:0,y:0,add:false})` → calls GameObjectFactory or a make creation; uses scene.sys.make. Fine if scene valid.

The error happens at runtime after boot. Let me narrow by getting the stack. Let me write a tiny test harness that loads phaser in node and uses a canvas head? That won't give DOM.

Alternative: Let me capture the error stack by injecting a global error handler in the HTML that writes the stack to a visible element. But the browser tool doesn't show DOM text easily? It returned "dom" with text. Let me add `window.addEventListener('error', e => console.log('STACK:', e.error && e.error.stack))` and also wrap init.

Actually, the simplest: the error might be in my `buildTextures` — `g.strokeTri`? Phaser Graphics doesn't have `strokeTri`. It has `strokeTriangle` and `strokeTriangleShape`? Actually methods: `fillTriangle(x1,y1,x2,y2,x3,y3)` and `strokeTriangle(...)`. There's `strokeTri`? No. Let me check: Phaser Drawing API includes `fillTriangle`, `strokeTriangle`, `fillTriangleShape`, `strokeTriangleShape`. `strokeTri` doesn't exist → would throw "g.strokeTri is not a function", not 'sys' error.

Hmm the error is 'sys'. Let me think about what gives "Cannot read properties of undefined (reading 'sys')". 

`this.input.keyboard.addKeys` returns a object; `this.input` sys? Fine.

`this.tweens.add(...)` — tweens is scene.sys.tweens. In create it exists. Fine.

Hmm. The error might be thrown from within Phaser's render/update and propagate. "reading 'sys'" suggests somewhere a `something.sys` where something is undefined. 

Let me check `this.cameras.main.setBackgroundColor(0x5C94FC)` — Camera.setBackgroundColor(color). Implementation: `this.backgroundColor = this.dirty...`? Actually it may call `Color.ValueToColor`. No sys.

Let me reconsider `this.goal.body.setCheckCollision.all(false)`. If `setCheckCollision` is undefined → throws "Cannot read properties of undefined (reading 'all')". Not 'sys'.

Let me check the exact phaser Arcade.Body for `setCheckCollision`. Actually I think the correct method is `body.setCheckCollision` — no. Let me just look. In Arcade.Body there is `checkCollision` object with `up, down, left, right, none` booleans, and `setFace`. Actually `none` is a property: `body.checkCollision.none = true`. There's no `.all()`. 

But the error says 'sys'. Let me reconsider — maybe the error is from `this.physics.world.on('worldbounds', ...)` callback being invoked with body undefined? No, worldbounds event always passes body.

Actually, wait — maybe the error is from `this.cameras.main.setBackgroundColor` — let me check: Camera.setBackgroundColor may call `this.scene.sys.game.renderer?`? No.

Let me just instrument. I'll add a window error listener and dump stack to a DOM node I can read, or print to console (already printing). The console shows the error line but not stack. The browser tool's "console" only shows messages, not full stack traces. Let me add explicit capture.

Let me modify the script to wrap critical init in try/catch and also add window error handler that outputs stack. Then reload and read.

Actually, a better plan: let me test pieces using Phaser's headless? No canvas.

Let me add at top of script:
```
window.onerror = (msg, src, line, col, err) => { console.log('ERR '+msg+' at '+line+':'+(err&&err.stack)); };
```
And also wrap buildTextures, create body in try/catch logging via console.

But the browser console already shows error; I just need the stack. `console.error(e)` would show stack. Let me add a window error handler that console.error the stack. The tool shows "error: ..." but not stack. Let me capture stack into the DOM (visible) so I can read it via inspect.

Plan: add a div id="debug" and set its text to the stack. Then read via browser inspect (it returns dom text).

Actually, let me reduce risk: simplify the code to remove suspicious APIs. Let me check Phaser 3.80 API for these methods:
- `graphics.strokeTriangle(x1,y1,x2,y2,x3,y3)` — yes exists.
- `graphics.strokeRoundedRect` — exists.
- `body.checkCollision.none = true` — yes, Arcade.Body has checkCollision with none property? Let me verify. Actually I recall `Arcade.Body.checkCollision` is `{ up: bool, down: bool, left: bool, right: bool }` and there's also `none`. Let me check phaser source. 

The error 'sys' though... Let me think about `this.physics.add.existing(this.goal, false)` returning a body? `add.existing` for non-physics... Actually `physics.add.existing(gameObject, immovable)` adds the physics body component. For a plain rectangle (already a display object), it should attach `body`. Then `this.goal.body.setAllowGravity(false)` etc. But wait — `this.add.rectangle(...)` creates a Rectangle GameObject (not a physics sprite). `this.physics.add.existing(rect, false)` attaches an Arcade.Body to it. Good. Then body.setSize? default is rect size 36x60. Fine.

Then `this.goal.body.setCheckCollision.all(false)` — `setCheckCollision` is NOT a method on Arcade.Body! The correct property is `body.checkCollision` (object) with up/down/left/right/none. There's no `setCheckCollision.all()`. Actually, is there `setCheckCollision`? Let me check. Hmm, I'm not sure. If `setCheckCollision` is undefined, then `this.goal.body.setCheckCollision` is undefined, `.all` → "Cannot read properties of undefined (reading 'all')". Not 'sys'.

But I also wrote `this.goal.body.checkCollision.none = false;` after. 

Where would 'sys' come from? Let me think of `scene.make.graphics`. `make` is `scene.make`. In create, it should be available.

Actually! `buildTextures` is called in `preload()`. In Phaser, `scene.make` is available in preload too (make factory is created early). But `scene.make.graphics` requires the textures/systems. Should be fine.

Hmm, but the error is reading 'sys' of undefined. A classic: calling a class method on something that isn't initialized. E.g., `this.tweens` if `this.sys` ... 

Wait — maybe the error is in `buildTextures` because `scene.make.graphics({x:0,y:0,add:false})` returns a Graphics object, but `Graphics.generateTexture`? `g.generateTexture(key, w, h)` exists on Graphics (it's a method via Frame... actually Graphics has `generateTexture`? Let me verify — yes, `Phaser.GameObjects.Graphics.generateTexture`? Hmm, actually I think it's `this.game.make... ` no. Let me check: In Phaser 3, to generate a texture from graphics you use `this.add.graphics()` then `graphics.generateTexture('key', width, height)`. Is `generateTexture` a method on Graphics object? Let me check... Actually I believe the method is on the Graphics GameObject: `graphics.generateTexture(textureKey, width, height)`. Let me verify by searching the phaser.min.js.

Let me grep for generateTexture in phaser.min.js.

The error is "Cannot read properties of undefined (reading 'sys')". I need the stack trace. Let me check a few Phaser API methods I used to find the culprit, and add error instrumentation.

→ bash {"command":"cd /tmp/job-fPtsoQ && grep -o 'generateTexture:[a-z]*' phaser.min.js | head; echo \"---strokeTri---\"; grep -o 'strokeTri[a-zA-Z
toolResult

generateTexture:function ---strokeTri--- strokeTriangleShape strokeTriangle strokeTriangle strokeTriangle ---checkCollision--- checkCollision checkCollision checkCollision checkCollision checkCollision checkCollision checkCollision checkCollision checkCollision checkCollision ---setCheckCollision---

assistant
thinking
`generateTexture` is a function (method exists on Graphics or somewhere). `strokeTri` does NOT exist — only `strokeTriangle`. So my `g.strokeTri(...)` call is undefined → "g.strokeTri is not a function" error. But the reported error was "Cannot read properties of undefined (reading 'sys')". Hmm. Maybe the strokeTri throws "g.strokeTri is not a function" which is a TypeError, but the browser reported a different message. Actually wait — maybe buildTextures runs in preload and the Graphics object's `strokeTri` being undefined throws. The error text shown was "Cannot read properties of undefined (reading 'sys')". That doesn't match "strokeTri is not a function". 

Let me reconsider. Actually, maybe `generateTexture` on Graphics requires the textures system via `this.sys`? If `g.generateTexture` is a function but internally calls `this.systems.textures`? Hmm.

Actually wait — the error might be elsewhere. Let me add instrumentation to capture the actual stack trace. Let me modify the HTML to capture `window.onerror` stack into a debug element and re-run. Let me also remove the `strokeTri` call (replace with `strokeTriangle`).

Let me also reconsider `this.goal.body.setCheckCollision.all(false)` — `setCheckCollision` doesn't exist. Let me remove that line and use `body.checkCollision.none = true` to disable all collision checks (so player overlaps without pushing). Actually I WANT the goal to be an overlap trigger only (no physics collision). Setting `body.checkCollision.none = true` disables collision checks for that body. But `checkCollision.none` — does that property exist? Let me verify it's `{none, up, down, left, right}`. Let me grep.

Let me also double check `body.setCheckCollision` — the grep returned nothing for setCheckCollision, so it does NOT exist. Good, I'll remove those lines.

Let me grep checkCollision usage to find the property structure.
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'checkCollision:[a-z]+' phaser.min.js | head; echo \"=== Arcade.Body checkCollision def ===\"; gr
toolResult

=== Arcade.Body checkCollision def === this.checkCollision={up:x(e,"checkCollision.up",!0),down:x(e,"checkCollision.down",!0),left:x(e,"checkCollision.left",!0),right:x(e,"checkCollision.right",!0)} === none? === checkCollision.none checkCollision.none checkCollision.none checkCollision.none checkCollision.none

assistant
thinking
So `checkCollision = { up, down, left, right }` and there IS a `checkCollision.none` used somewhere (it's a derived getter? or used in separation logic). Let me check what `checkCollision.none` is. It appears in `separate`/`collide` logic. It might be a computed property. Setting `body.checkCollision.none = true` might work or might not persist. To be safe, to make the goal a pure sensor/overlap, I'll disable all four: `body.checkCollision.up = body.checkCollision.down = body.checkCollision.left = body.checkCollision.right = false;`. That disables collision for that body. And `body.setEnable(true)` keeps overlap working. Actually overlap works regardless of checkCollision. Overlap uses `body.enable` and the world's overlap test. Setting checkCollision flags to false prevents it from being a *collider* (won't be pushed/separated) but overlap still detects. Actually, Arcade overlap ignores the checkCollision flags? Overlap test uses `body.enable` and bounding box overlap regardless of checkCollision directions. So setting checkCollision false means it won't block the player (no separation) but overlap still fires. 

Actually, I want the goal to NOT collide (block) the player. With a dynamic body that has allowGravity false & immovable true, colliding would block the player. I'll set checkCollision all false to be safe, and immovable false. Let me just set `this.goal.body.setAllowGravity(false)` and not make it immovable (immovable would block). Actually for overlap detection with a dynamic body that's immovable, Arcade still separates? Immovable + overlap: overlap doesn't separate; only collide does. overlap just checks intersection and calls callback without resolving. So overlap won't block movement. Good — so I don't even need to disable checkCollision. overlap = no physics resolution. 

So remove the setCheckCollision lines entirely. The goal just needs a body for overlap. Good.

Now the 'sys' error. Let me capture the stack. Let me add instrumentation: a window error handler writing to a debug div. Also the `strokeTri` is undefined — that would throw "g.strokeTri is not a function" during buildTextures in preload. But the browser showed 'sys' error... maybe the browser groups and the real error is strokeTri. Let me just fix strokeTri → strokeTriangle and remove the bad lines, then re-run and see.

Actually wait, the error "Cannot read properties of undefined (reading 'sys')" — let me search where `.sys` is read on a potentially undefined object in the flow. Could be `this.cameras.main.setBackgroundColor`? Let me check Camera.setBackgroundColor. Or `scene.make.graphics` internally. 

Hmm, let me just add a window.onerror that logs the full stack to a DOM element I can read, and also wrap the Phaser.Game init. Actually let me just add an error-capture meta tag? No.

Let me add at the very top of the script:
```
var __dbg = document.getElementById('dbg') || (function(){var d=document.createElement('pre');d.id='dbg';d.style.cssText='position:fixed;left:0;top:0;z-index:99999;color:#ff0;background:#000;white-space:pre-wrap;max-width:80vw;max-height:80vh;overflow:auto';document.body.appendChild(d);return d;})();
window.addEventListener('error', function(e){ __dbg.textContent += (e.message) + '\n' + (e.error && e.error.stack) + '\n\n'; });
```
Then reload and read __dbg via inspect (dom text) or screenshot.

But the tool's inspect already returns console. The console might show the stack if I console.error. Let me add `window.addEventListener('error', e => console.log('STACK', e.error && e.error.stack))`. Then the console array will contain it.

Let me update the file: fix strokeTri, remove setCheckCollision lines, add error capturing.

Let me make these edits.

Found it: `strokeTri` doesn't exist (it's `strokeTriangle`), and `setCheckCollision.all` is invalid. Let me also add error-stack capture to diagnose any remaining issues. Let me fix these.

→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":"g.fillStyle(0xE74C3C);\n g.fillTriangle(38, 22, 42, 22, 90, 34);\n g.lineStyle(1, 0x922B21,
toolResult

Validation failed for tool "edit": - edits.0: must be object Received arguments: { "path": "/tmp/job-fPtsoQ/index.html", "edits": "g.fillStyle(0xE74C3C);\n g.fillTriangle(38, 22, 42, 22, 90, 34);\n g.lineStyle(1, 0x922B21, 1);\n g.strokeTri(38, 22, 42, 22, 90, 34);\n g.generateTexture('flag', T, 240).destroy();", "newText": "g.fillStyle(0xE74C3C);\n g.fillTriangle(38, 22, 42, 22, 90, 34);\n g.lineStyle(1, 0x922B21, 1);\n g.strokeTriangle(38, 22, 42, 22, 90, 34);\n g.generateTexture('flag', T, 240).destroy();" }

assistant
thinking
I need to pass a proper edits array. Let me redo.
→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":[{"oldText":" g.lineStyle(1, 0x922B21, 1);\n g.strokeTri(38, 22, 42, 22, 90, 34);\n g.genera
toolResult

Successfully replaced 1 block(s) in /tmp/job-fPtsoQ/index.html.

assistant

Now let me fix the invalid `setCheckCollision` usage and add error-stack capture for diagnosis.

→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":"[{\"oldText\": \" this.goal.body.setAllowGravity(false);\n this.goal.body.setImmovable(t
toolResult

Validation failed for tool "edit": - edits.0: must be object Received arguments: { "path": "/tmp/job-fPtsoQ/index.html", "edits": "[{\"oldText\": \" this.goal.body.setAllowGravity(false);\n this.goal.body.setImmovable(true);\n this.goal.body.setOffset(0, 0);\n this.goal.body.setCheckCollision.all(false);\n this.goal.body.checkCollision.none = false;\", \"newText\": \" this.goal.body.setAllowGravity(false);\n this.goal.body.setImmovable(false);\n this.goal.body.setOffset(0, 0);\"}, {\"oldText\": \"new Phaser.Game(config);\\n</script>\", \"newText\": \"window.addEventListener('error', (e) => {\\n const el = document.getElementById('errlog') || (() => {\\n const d = document.createElement('pre');\\n d.id = 'errlog';\\n d.style.cssText = 'position:fixed;left:0;bottom:0;z-index:99999;color:#fff;background:#800;padding:8px;max-width:90vw;max-height:40vh;overflow:auto;font:12px/1 monospace;';\\n document.body.appendChild(d); return d;\\n })();\n el.textContent += (e.message || 'error') + '\\\\n' + (e.error && e.error.stack ? e.error.stack : '') + '\\\\n\\\\n';\\n});\\nnew Phaser.Game(config);\\n</script>\"}]" }

assistant
thinking
The tool requires the edits array to be a proper array of objects. I think the issue is the JSON encoding got passed as a string. Let me use the function call with proper JSON array. The error says "edits.0 must be object" — so it's treating my edits as a string. That's because I passed it as a single string argument. Let me re-call with a proper array. Actually the edit tool's `edits` should be an array of objects. The harness is serializing it oddly. Let me provide it as a proper JSON array in the parameter.

Wait, the function calling format requires me to write the parameter. Let me write `edits` as an array literal of objects. The tool expects JSON. Let me write it carefully.
→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":[{"oldText":" this.goal.body.setAllowGravity(false);\n this.goal.body.setImmovable(true);
toolResult

Successfully replaced 2 block(s) in /tmp/job-fPtsoQ/index.html.

assistant

Now let me reload and check the console and the error-log element.

→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","error: Cannot read properties of undefined (reading 'sys')","warning: [.WebGL-0x1dfc00182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R\nUncaught TypeError: Cannot read properties of undefined (reading 'sys')\nTypeError: Cannot read properties of undefined (reading 'sys')\n at initialize.generateTexture (http://127.0.0.1:36933/:56:232196)\n at buildTextures (http://127.0.0.1:36933/:121:5)\n at MainScene.preload (http://127.0.0.1:36933/:192:15)\n at initialize.bootScene (http://127.0.0.1:36933/:56:953549)\n at initialize.start (http://127.0.0.1:36933/:56:957497)\n at initialize.bootQueue (http://127.0.0.1:36933/:56:951939)\n at a.emit (http://127.0.0.1:36933/:56:1954)\n at initialize.texturesReady (http://127.0.0.1:36933/:56:75615)\n at a.emit (http://127.0.0.1:36933/:56:1954)\n at initialize.updatePending (http://127.0.0.1:36933/:56:1036587)\n\n","images":"model does not support images"}

assistant
thinking
The error is in `generateTexture` — it tries to read 'sys' of undefined. The `Graphics.generateTexture` method (at phaser.min.js:56:232196) reads `this.sys`? Let me check: `initialize.generateTexture` is actually `TextureManager.generateTexture`? The stack says `initialize.generateTexture at 56:232196` called from `buildTextures`. So `g.generateTexture` — but Graphics has a `generateTexture`? Actually the method that generates a texture from a RenderTexture/Graphics. Let me look: The `generateTexture` at that location is probably `TextureManager.generateTexture(key, width, height)`? No, buildTextures calls `g.generateTexture('player', T, T*2)` where g is a Graphics object. 

Hmm, maybe Graphics does NOT have `generateTexture` directly; instead it's `this.scene.add.existing`? Actually, I recall the correct API: `graphics.generateTexture(key, width, height)` does exist on the Graphics object (it delegates to TextureManager). But the error reading 'sys' of undefined suggests the Graphics object isn't fully set up, OR generateTexture on Graphics calls `this.scene.sys`... 

Wait, actually maybe the issue: `scene.make.graphics({add:false})` returns a Graphics without a scene reference properly bound? No, make.graphics sets scene.

Let me look at the actual phaser source for Graphics.generateTexture. Let me grep.

The error is in `generateTexture`. Let me check how `generateTexture` works for a Graphics object in this Phaser version.

→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'generateTexture[:=].{0,40}' phaser.min.js | head; echo \"=== Graphics generateTexture context ==
toolResult

generateTexture:function(t,e,i){var s,n,r=this.scene.sys === Graphics generateTexture context === eColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function === search make.graphics / GenerateTexture === GenerateTexture

assistant
thinking
So `generateTexture:function(t,e,i){var s,n,r=this.scene.sys...}`. It reads `this.scene.sys`. So the Graphics object's `this.scene` is undefined when called via `scene.make.graphics({add:false})`. 

Wait — `scene.make.graphics` creates a Graphics. The Graphics `scene` property should be set. But the error: `this.scene` is undefined. That means the Graphics created by `make` doesn't have `scene` set? Or `generateTexture` is being called on the wrong object.

Actually, `scene.make.graphics({x:0,y:0,add:false})` — the `make` factory creates a Graphics with the scene assigned. Hmm. But `generateTexture` reads `this.scene.sys`. If `this.scene` undefined → error.

Wait, maybe `scene.make.graphics` returns a Graphics whose `scene` is set but `generateTexture` is the one from a mixin and `this` context differs. Actually `this.scene.sys` — `this` should be the Graphics. The Graphics.scene is set in constructor. Unless `make.graphics` returns something else.

Let me reconsider: Maybe `generateTexture` on Graphics works only when `add:true`? No.

Alternative: I recall the correct, reliable way to generate textures from Graphics in Phaser 3 is via `this.textures` or the `RenderTexture`. Actually the canonical method:
```
const g = this.add.graphics();
g.draw... 
g.generateTexture('key', w, h);
g.destroy();
```
This is the documented approach. `this.add.graphics()` returns a proper Graphics with scene set. I used `scene.make.graphics({add:false})`. Let me switch to `this.add.graphics()` and destroy after.

But wait — the error is in preload (buildTextures called from preload). In preload, `this.add` is available? The GameObjectFactory `this.add` exists in preload? Actually `scene.add` is created during boot which happens before preload. Yes, `this.add` is available in preload. Let me use `this.add.graphics({ x:0, y:0 })`.

Hmm, but actually `scene.make` should also work. The difference: `make.graphics` vs `add.graphics`. Both should set scene. Let me check: maybe `make.graphics` returns the Graphics but `generateTexture` is a method on a mixin that uses `this.scene.sys.game.textures`? The `this.scene` is the Graphics's scene reference. 

Actually wait — I bet the issue is `make.graphics` returns a Graphics, but the `generateTexture` method might be calling `this.scene` where `this` is the Graphics, and Graphics does store `this.scene`. Let me check if maybe `make` produces a Graphics whose `scene` isn't bound because it's created without add. No...

Let me just try the documented `this.add.graphics()` approach in preload. That's the canonical example and should work.

Actually, let me reconsider: the Phaser docs example for generating textures:
```
const graphics = this.make.graphics({ x: 0, y: 0, add: false });
...
graphics.generateTexture('diamond', 32, 32);
```
That's literally the documented usage! So why the error? 

The stack shows `generateTexture` reading `this.scene.sys` where `this.scene` is undefined. So in the `make.graphics` case, `this.scene` is undefined?? That would be a bug... unless `make.graphics({add:false})` returns a Graphics whose `scene` is NOT set because it's deferred? 

Hmm. Actually `scene.make.graphics` calls `GameObjectFactory` via `make`? No, `scene.make` is a separate GameObjectMake factory created in boot. The `make` factory's `graphics` creates via `GameObjects.Graphics` constructor with `this.scene`. Should set scene.

Wait — maybe the issue is that `generateTexture` first arg validation. `generateTexture:function(t,e,i){var s,n,r=this.scene.sys, ...; if(!t) ...}`. The `this.scene.sys` is read FIRST before validation. So if `this.scene` undefined → crash. 

So `make.graphics({add:false})` produces a Graphics with scene undefined?? That contradicts docs. Unless in this Phaser build, `make.graphics` with `add:false`... no.

Let me actually test directly in node by mocking? Hard. Let me just switch to `this.add.graphics()` which the docs also show and is more standard. Let me try that.

Actually — I suspect the real issue: I'm calling `buildTextures(this)` from `preload()`. At preload time, is `this.add` / `this.make` ready? The error trace: preload -> buildTextures (line 121) -> generateTexture. The scene IS booting (bootScene -> start). In preload, `this.make` should exist. But maybe `this.make.graphics` returns the object but `this.scene` on it is unset because... 

Let me just switch to `this.add.graphics()`. In Phaser, `Scene.add.graphics` is available once the scene is created (before preload? Actually `add` is created in boot, available from preload). Many preloading examples use `this.add.graphics` in preload. Should be fine.

Let me change `scene.make.graphics` to `scene.add.graphics({x:0,y:0})` and `add:false` removed. The graphics will be added to display list but I destroy it after generating. Since generateTexture captures it into a texture, destroying is fine. But an added graphics at depth 0 might briefly show? It's invisible (no fill unless drawing). Drawing then generating — the graphics won't be visible because it's created in preload before camera renders; fine. I'll destroy it after each.

Actually `scene.make.graphics({add:false})` is the documented "don't add to display list" approach. The issue might be specific. Let me try `this.add.graphics()` which definitely sets scene.

Wait, actually, let me reconsider the real cause. The stack: `generateTexture at 56:232196`. Let me look at more of the generateTexture function to see exactly what it reads.

`generateTexture:function(t,e,i){var s,n,r=this.scene.sys` — so r = this.scene.sys. If this.scene is defined, this.scene.sys is fine. So this.scene is undefined. 

For a Graphics created via `scene.make.graphics({x:0,y:0,add:false})`, the Graphics constructor sets `this.scene = config.scene` (the scene passed). The `make` factory passes `this.scene` (the scene). So scene should be set. Unless `make.graphics` passes `scene` differently.

Hold on — maybe `scene.make` itself isn't defined and `scene.make.graphics` throws "Cannot read properties of undefined (reading 'graphics')"? No, the error is in generateTexture reading 'sys' of undefined = this.scene is undefined.

Let me look at how `make.graphics` constructs. Let me grep "graphics:" in the factory/make.

Actually, let me just check: is `this.make` defined in preload? `scene.make` is set during boot: `this.make = new GameObjectMake(this, config);`. Boot runs before preload. So `this.make` exists. 

Let me look at the make.graphics registration.

The documented `scene.make.graphics` is failing because of how `generateTexture` reads `this.scene`. Let me check the make.factory for graphics and the generateTexture internals.

→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== make.graphics registration ===\"; grep -oE '\"graphics\":function\\([^)]*\\)\\{[^}]{0,200}' pha
toolResult

=== make.graphics registration === === generateTexture full === generateTexture:function(t,e,i){var s,n,r=this.scene.sys,o=r.game.renderer;void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,e,i),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var a={willReadFrequently:!0 === add.graphics registration ===

assistant
thinking
The generateTexture reads `this.scene.sys`. So the Graphics object must have `this.scene` set. Since `make.graphics` with `add:false` apparently doesn't set scene? Let me check the Graphics constructor. Actually, the issue might be that `scene.make.graphics({add:false})` returns a Graphics, but when `add:false`, maybe the scene reference is fine. Hmm.

Actually wait. Let me reconsider. The error: "Cannot read properties of undefined (reading 'sys')" at `this.scene.sys`. So `this.scene` is undefined. This means the Graphics object on which `generateTexture` is called has `scene === undefined`. 

If I use `this.add.graphics({x:0,y:0})`, the Graphics is constructed with scene set. Let me check the Graphics constructor registration to confirm `scene` is passed.

Actually, let me look at how `make` vs `add` differ. Let me grep the GameObjectMake graphics.

Alternative possibility: `scene.make` itself is what's returning the Graphics but `this.scene` is the scene context. Hmm.

Let me just switch to `this.add.graphics()` and test. If `add.graphics` works (it's the most common pattern in Phaser examples for texture generation), great. Let me check that `add.graphics` passes scene.

Let me grep the graphics factory in add.
→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== GameObjectFactory graphics ===\"; grep -oE 'add.graphics' phaser.min.js | head -2; echo \"=== G
toolResult

=== GameObjectFactory graphics === add.graphics add.graphics === Graphics init === === look for init signature Graphics === === check scene.make defined in boot ===

assistant
thinking
Let me directly look at how the Graphics class is registered and its initialize. Let me search the source differently.

Actually, the simplest path: just change to `this.add.graphics()` which is the canonical documented approach used in thousands of examples, and re-test. If `scene` is properly set there, it'll work. Let me also verify the Graphics constructor sets `this.scene`.

Let me grep for `Graphics` class definition with `this.scene`.
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'new s\\(\\{Extends:[^}]{0,400}' phaser.min.js | grep -i graph | head -1; echo \"=== or init ===\
toolResult

new s({Extends:a,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Size,n.Texture,n.Transform,n.Visible,d],initialize:function(t,e,i,s,n,r,o,h,l,u,d,f){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new v,t === or init ===

assistant
thinking
That grep matched a Mesh class. Let me search for the Graphics GameObject specifically and its initialize to confirm `this.scene` is set and `generateTexture` is on it. Actually `generateTexture` reading `this.scene.sys` is the standard Graphics/RenderTexture method. The problem is `this.scene` being undefined on the `make.graphics` result.

Let me just change to `this.add.graphics()` and re-test. That's the canonical approach.

Let me update buildTextures to use `scene.add.graphics({ x: 0, y: 0 })`. And keep `.destroy()` after each generate. Actually `add.graphics` adds to display list. After generateTexture + destroy, it's removed. But it's added to the scene which is booting — fine in preload.

Let me make that change.

Let me switch to `this.add.graphics()` which is the canonical, reliable pattern for texture generation.

→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":[{"oldText":" const g = scene.make.graphics({ x: 0, y: 0, add: false });","newText":" const g
toolResult

Successfully replaced 1 block(s) in /tmp/job-fPtsoQ/index.html.

assistant
→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","error: Cannot read properties of undefined (reading 'sys')","warning: [.WebGL-0x4400166000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R\nUncaught TypeError: Cannot read properties of undefined (reading 'sys')\nTypeError: Cannot read properties of undefined (reading 'sys')\n at initialize.generateTexture (http://127.0.0.1:33545/:56:232196)\n at buildTextures (http://127.0.0.1:33545/:121:5)\n at MainScene.preload (http://127.0.0.1:33545/:192:15)\n at initialize.bootScene (http://127.0.0.1:33545/:56:953549)\n at initialize.start (http://127.0.0.1:33545/:56:957497)\n at initialize.bootQueue (http://127.0.0.1:33545/:56:951939)\n at a.emit (http://127.0.0.1:33545/:56:1954)\n at initialize.texturesReady (http://127.0.0.1:33545/:56:75615)\n at a.emit (http://127.0.0.1:33545/:56:1954)\n at initialize.updatePending (http://127.0.0.1:33545/:56:1036587)\n\n","images":"model does not support images"}

assistant
thinking
Still the same error at the same spot: `buildTextures` line 121 (the first `g.generateTexture('player', ...)`). So `this.scene` on the Graphics is undefined even with `add.graphics`. That's strange.

Wait — `buildTextures` is called from `preload()`. In Phaser, the Scene's `add` factory... hmm. Actually wait. The line 121 is the FIRST generateTexture call (player). The Graphics was created by `scene.add.graphics({x:0,y:0})`. If `this.scene` were undefined, then the Graphics object's scene isn't set.

But `add.graphics` should set scene. Unless... the issue is that `generateTexture` is NOT a method on Graphics — maybe it's resolving to a different `generateTexture` (the TextureManager one) because the Graphics object doesn't HAVE generateTexture, and JS looks up the prototype chain... no, it found a function.

Actually, hold on. Let me reconsider: maybe `scene.add.graphics` in preload returns a Graphics, but `generateTexture` on Graphics is defined as a method that reads `this.scene.sys`. If `this.scene` is undefined, the Graphics created via `add.graphics` somehow has scene undefined? That can't be right for add.

Wait, the stack line says `buildTextures at /:121:5`. Let me check what's at line 121. The buildTextures function — line 121 col 5. That's the generateTexture call for player (`g.generateTexture('player', T, T*2)`). 

Hmm, but if `add.graphics` created g properly, g.scene should be set. Unless `scene.add` is undefined in preload and it threw? No, it would throw earlier.

Let me reconsider: maybe the problem is that `scene.add.graphics` returns the Graphics, but in this Phaser 3.80 build, the Graphics class does NOT have its own `generateTexture` and the one being called is inherited/aliased and `this.scene` context lost? 

Actually, wait. Let me reconsider whether `generateTexture` is even on Graphics. The grep showed `generateTexture:function(t,e,i){var s,n,r=this.scene.sys,...}`. Where is this function defined? If it's the `RenderTexture.generateTexture` or `TextureManager.generateTexture`? Let me search which class has generateTexture.

Let me grep: is `generateTexture` a method on the Graphics class? Let me check the Graphics class registration (the one with draw methods). The function `generateTexture:function(t,e,i){var s,n,r=this.scene.sys` — `r.game.renderer`, `f.TargetCamera.setScene(this.scene)`. This looks like RenderTexture or a Canvas-based texture generator. The `f.TargetCamera` is `CameraManager`? This is the `Graphics.generateTexture` actually — Graphics has generateTexture that renders itself to a canvas texture via a temporary camera.

If `this.scene` is undefined, the Graphics returned by `add.graphics` has no scene. That implies `add.graphics` didn't set it. But that's standard...

Hold on — maybe the problem is the ORDER: `buildTextures(this)` is called in `preload()`, but at that exact moment, is `this.add` (GameObjectFactory) fully initialized? The `add` factory is created in `Scene.boot` → `Scene.sys.init` ... Actually `this.add` is set in `Scene#boot` before `preload`? Let me check the scene lifecycle order: boot → init? The flow: Scene is added → `bootScene` → which calls `scene.boot()` → ... → `scene.start()`? The stack shows `bootScene -> start -> bootQueue -> ... -> texturesReady -> updatePending`. Hmm.

Actually maybe the issue: in `preload`, the `Scene.add` GameObjectFactory IS available, and `add.graphics` creates a Graphics with scene set. But then `generateTexture` reads `this.scene.sys` — but maybe the Graphics's `scene` is the Scene, and `scene.sys` is fine. So why undefined?

Let me actually test this in isolation. Let me write a tiny node script using jsdom? I don't have jsdom. 

Let me reconsider — maybe `this.scene` IS undefined because `add.graphics` in Phaser 3.80 — the Graphics GameObject stores `this.scene` but maybe via a getter `scene` from a mixin? Actually GameObject base has `this.scene` set in constructor. Graphics extends GameObject. So `this.scene` set.

Unless... the Graphics object I'm calling generateTexture on is not actually a Graphics but the `make` returned undefined and `scene.add.graphics(...)` returned something whose `scene` is undefined. 

Wait, actually, let me reconsider the FIRST error message: before my edit, buildTextures used `scene.make.graphics({add:false})`. After edit, `scene.add.graphics({x:0,y:0})`. Both give same error at generateTexture. So the Graphics creation works (no error there), but generateTexture fails reading this.scene.sys → this.scene undefined.

So the Graphics object has scene undefined. That's bizarre for add.graphics.

OH WAIT. Maybe in this Phaser build, `Graphics` does NOT set `this.scene` in the normal way, and `generateTexture` is meant to be called with proper context. OR — maybe the issue is that `generateTexture` is defined on a MIXIN that Graphics gets, and the mixin's `generateTexture` reads `this.scene` but for Graphics the scene is stored differently?

Let me just try a completely different, definitely-working approach: use `this.textures.createCanvas` and draw with its 2D context. That's the most reliable way to generate textures without assets:

```
createTexture(name, w, h) {
  const tex = this.textures.createCanvas(name, w, h);
  const ctx = tex.getContext(); // 2D context of the canvas
  // draw with ctx
  tex.add('...'); // if multiple frames
  // finalize
  tex.draw? 
}
```

Actually `this.textures.createCanvas(key, w, h)` returns a CanvasTexture. `tex.getContext()` gives 2D ctx. I draw with ctx.fillRect etc., but I'd be using raw canvas API not Phaser Graphics. That's fine but more verbose. 

Alternatively, the standard Phaser way IS `graphics.generateTexture`. Let me figure out why scene is undefined.

Let me check: maybe `scene.add.graphics` returns a Graphics but `generateTexture` is being called and the `this` inside is the Graphics, and Graphics.scene... Let me verify Graphics constructor actually assigns this.scene. Let me grep the GameObject constructor for `this.scene`.

Actually, let me reconsider. Perhaps `scene.add.graphics({ x: 0, y: 0 })` — the Graphics is created but I'm in `preload()`. In Phaser, during `preload()` the scene IS booted and `add` works. Textures generated in preload are available.

Hmm, let me actually check whether maybe the error is that `g` is not a Graphics but a Texture or something because `add.graphics` returns... no.

Let me try the createCanvas approach which is bulletproof. Let me rewrite buildTextures to use createCanvas + 2D context. Actually that's more work to redraw shapes with canvas API. 

Alternatively, use `this.make.graphics` BUT call generateTexture differently... the docs literally show `make.graphics({add:false})` + `generateTexture`. So it should work. The fact that it reads this.scene as undefined suggests a deeper issue — maybe `scene` property is on the mixin and not set until `addedToScene`?

AH, that's it! In Phaser 3, GameObject properties like `this.scene` are set, BUT for objects created with `add:false` (not added to display list), the `scene` might be set only during `addedToScene`. Actually no.

Let me reconsider: `this.scene` on a Graphics — when you do `scene.add.graphics()`, the factory calls `this.displayList.add` and `this.updateList.add` only if `config.add !== false`. The GameObject constructor sets `this.scene = config.scene`? Let me check: GameObject constructor `function(t,e){this.scene=t,...}` — yes sets scene. So scene is set.

So why undefined? Unless `generateTexture` is not on Graphics.prototype but on something else, and `this` is wrong.

Let me look at WHERE generateTexture is defined — grep the Graphics class specifically.

Let me search more precisely for the Graphics class definition and whether it has generateTexture.

Same error persists even with `add.graphics`. Let me investigate the Graphics class definition and whether `generateTexture` belongs to it, and how `this.scene` is set.

→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== Which class defines generateTexture (context ~800 chars before) ===\"; grep -oE '.{600}generate
toolResult

=== Which class defines generateTexture (context ~800 chars before) === this.commandBuffer.push(r.SAVE),this},restore:function(){return this.commandBuffer.push(r.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(r.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(r.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(r.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i) === GameObject constructor sets scene? === === Graphics register line ===

assistant
thinking
So `generateTexture` is defined in the Graphics class (it's right after `rotateCanvas`, `clear` — those are Graphics methods). The function reads `this.scene.sys`. The Graphics class extends GameObject. Let me check the GameObject base constructor to see if it sets `this.scene`.

Let me grep for the GameObject base `Scene` property and constructor.
→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== GameObject base constructor ===\"; grep -oE 'function\\([a-z]\\)\\{this\\.scene=|Scene.{0,30}co
toolResult

=== GameObject base constructor === function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= function(t){this.scene= === this.scene= assignments in GameObject === this.scene=t this.scene=null this.scene=t this.scene=null this.scene=new w(this === Does GameObject get scene via getter? ===

assistant
thinking
`this.scene=t` is set in the GameObject constructor. So the Graphics object should have `this.scene` set to the scene. But the error says `this.scene` is undefined when generateTexture runs.

Wait — maybe the issue is that `scene.add.graphics` is what I used, and it works... but the error persists at the same call. Let me reconsider: maybe `scene.add.graphics({x:0,y:0})` is NOT the issue; rather, `g.generateTexture` IS being called but `this` is the Graphics which has scene. So `this.scene.sys` should work...

Unless `generateTexture` is async? No.

Hold on. Let me re-read the error: "Cannot read properties of undefined (reading 'sys') at initialize.generateTexture (56:232196)". The `initialize` wrapper around generateTexture. `r=this.scene.sys` — r would be scene.sys. If scene is undefined → error reading 'sys' of undefined. So `this.scene` is undefined.

But we just confirmed constructor sets `this.scene=t`. So how is it undefined? 

Possibility: The Graphics created via `add.graphics` — maybe `add.graphics` returns the object but the constructor's `this.scene=t` gets overwritten to null later by `addedToScene`? No.

OR — maybe `scene.add` in preload is the Scene's `add`, but maybe at preload time `this.scene` on the created Graphics is set to the Scene, but then... 

Wait, actually — maybe the problem is that `scene.add.graphics` returns a Graphics, but I'm in `preload`, and `this.scene` is set. Hmm.

Let me actually test in node with a stub. Actually, let me reconsider: maybe `add.graphics` requires the Scene to be fully booted and in preload it's fine, but the `generateTexture` needs `this.scene.sys.game.renderer` and `this.scene.sys.game.renderer` — if renderer is the issue, the error would be different.

Let me reconsider the possibility that `scene.add.graphics` throws because `this.add` factory isn't ready in preload in this version. Actually if `this.add.graphics` returned undefined, then `g.generateTexture` would throw "Cannot read properties of undefined (reading 'generateTexture')" — but the error is about 'sys', meaning g IS defined and is a Graphics with generateTexture, but g.scene is undefined.

This is very odd. Let me check if maybe Graphics in this build doesn't extend GameObject properly / scene is set lazily. 

Let me look at the actual Graphics class definition (the `a` in `new s({Extends:a,...})`). Let me find where Graphics is defined and its constructor / initialize.
→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== Graphics class init ===\"; grep -oE 'Extends:s,initialize:function\\(t,e,i\\)[^}]{0,200}' phase
toolResult

=== Graphics class init === Extends:s,initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,t.sys.events.once(r.BOOT,this.boot,this) === Graphics constructor / setScene === === check scene set after create === this.scene=void 0 this.scene=void 0 this.scene=void 0 this.scene=void 0 === does add.graphics or make.graphics set scene before generateTexture? try alt: use this.textures.createCanvas === createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var n=s.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,n)

assistant
thinking
So Graphics constructor IS `initialize:function(t,e,i){s.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i...}`. So it takes (scene, ...config). The factory passes `this.scene` as `t`. So `g.scene` = the Scene. So `g.scene.sys` should be defined.

BUT — the constructor also does `t.sys.events.once(r.BOOT,this.boot,this)`. So it registers a BOOT listener on the scene's sys events. In `preload()`, has BOOT fired? The scene boots BEFORE preload runs. So BOOT might already have fired → `once` won't fire `this.boot`. Is `boot` required to set `this.scene`? No, scene is already set in constructor. But `boot` might do important initialization like setting up renderable? Actually Graphics.boot sets up the command buffer / pipeline. Without booting, `generateTexture` might fail because the graphics hasn't been "booted" — but the error is specifically reading `this.scene.sys` where this.scene is undefined.

Hmm wait, the constructor sets `this.scene=t`. So this.scene should NOT be undefined. Unless `s.call(this,e)` (GameObject constructor) sets `this.scene=null`? The GameObject base constructor `function(t){this.scene=...}`. Let me check: the GameObject base constructor signature — `s.call(this,e)` where `e` is config.scene? Then inside GameObject constructor `this.scene = config.scene`? If config.scene is undefined, it sets this.scene=undefined, then OVERWRITING the Graphics' `this.scene=t`? 

Order in Graphics.initialize: `s.call(this,e)` runs FIRST (GameObject constructor), THEN `this.scene=t`. So this.scene is set to t AFTER. So final this.scene = t (the scene). Good. So scene IS set.

But `s.call(this,e)` — what's `e`? In `initialize:function(t,e,i)`, the factory calls `new Graphics(scene, x, y, config)`? The GameObject factory passes config. Let me check how add.graphics calls the constructor. The GameObjectFactory.graphics: `this.graphics(config)` or similar. 

Actually, maybe `this.add.graphics({x:0,y:0})` passes a single config object `e`, so `t = scene`, `e = config`? Then `s.call(this, e)` = `GameObject.call(this, config)` which sets `this.scene = config.scene` — config.scene is undefined (I only passed x,y)! So `this.scene` = undefined. THEN `this.scene=t` sets it back to scene (t). So order: constructor sets this.scene=undefined, then Graphics.initialize sets this.scene=t (scene). Final = scene. 

Wait, that means this.scene = t = scene. So it's defined. Unless the GameObject constructor `s.call(this,e)` is called and `s` (GameObject) constructor does `this.scene = e.scene` = undefined, and then does NOT get overwritten because Graphics.initialize sets this.scene=t. So fine.

I'm confused why it's undefined. Let me actually check: maybe `add.graphics` is NOT the factory but `make.graphics` is. Let me verify the add factory passes scene correctly. Actually, the factory `add.graphics(config)` creates `new Graphics(scene, config)`. The Graphics constructor `initialize(t,e)` where t=scene, e=config. So this.scene=t=scene. 

So `g.scene` = scene, `g.scene.sys` = scene.sys = defined. So generateTexture's `this.scene.sys` should work.

Unless... `buildTextures` is called in `preload` and the scene's `sys` exists, but maybe the issue is that `scene.add.graphics` in preload creates a Graphics but `this.scene` getter... no, it's a direct property.

Let me reconsider: maybe the problem is NOT scene being undefined, but rather `this.scene` being the Scene and `this.scene.sys` is fine, and the REAL culprit is elsewhere — the error trace says generateTexture at 56:232196 line "var s,n,r=this.scene.sys". The `r=this.scene.sys`. If `this.scene` is the Scene, `this.scene.sys` is the Systems object — fine. So `r` fine. Then `r.game.renderer` — if `r.game` undefined? No that's different error.

Wait, the error is literally "reading 'sys'". So the LEFT of `.sys` is undefined, i.e., `this.scene` is undefined. So `this.scene` is undefined on the Graphics.

Given the constructor sets `this.scene = t`, the only way it's undefined is if `t` (first arg passed to Graphics constructor) is undefined. So `add.graphics` is calling `new Graphics(undefined, config)`?? That would mean the factory doesn't pass the scene as first arg.

Let me check the GameObjectFactory.graphics implementation.

The Graphics constructor receives the scene as `t`, but `this.scene` is undefined, meaning the factory may not be passing the scene. Let me check the factory implementation.

→ bash {"command":"cd /tmp/job-fPtsoQ && echo \"=== GameObjectFactory.graphics ===\"; grep -oE 'graphics:function\\([^)]*\\)\\{[^}]{0,250}' phaser.
toolResult

=== GameObjectFactory.graphics === === GameObjectMake.graphics === === how classes are constructed: new t(this,config)? ===

assistant
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE '.\\{0,40\\}graphics.\\{0,1\\}:function.[^]{0,300}' phaser.min.js | head -2; echo \"=== search 'n
toolResult

grep: Unmatched [, [^, [:, [., or [= === search 'new Graphics' / class instantiation in factories ===

assistant
thinking
Let me try a different grep to find the graphics factory registration. The factories use `r.register("graphics",...)`. Let me search for that.
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'register\\(.graphics.,[^\"]{0,400}' phaser.min.js | head -3"}
toolResult

register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},1201:(t,e,i)=>{var s=i(43831);i(39429).register(

assistant
thinking
Found it. The factory: `register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new n(this.scene,t);...))`. So `new n(this.scene, t)` — `n` is the Graphics class (the class from module 1201? Actually the class registered). Wait `i(43831)` is referenced — `var s=i(43831)` and `i(39429).register(...)`. Here `n` is the class. `new n(this.scene, t)`. So `this.scene` is a property of the make/factory object — `this.scene` in the factory function refers to the GameObjectFactory/Make instance, which has `.scene`. 

So `new Graphics(this.scene, config)` → Graphics constructor `initialize(t, e, i)` with t = scene, e = config. Then `this.scene = t` (scene). Good. So g.scene = scene. So this.scene.sys works.

But wait — the Graphics class `n` — is it the one with `generateTexture`? The factory references `n` which is the Graphics class. And the Graphics.initialize sets `this.scene=t`. So g.scene = scene. 

So why undefined?? 

Unless `this.scene` in the factory is undefined. `this.scene` of the GameObjectFactory — GameObjectFactory has `this.scene` set in its constructor. Should be the scene.

Hmm. Let me reconsider — maybe the error is actually NOT in my Graphics but the FIRST `generateTexture` call. Let me re-examine: maybe `scene.add.graphics` actually works and returns a Graphics with scene set, but `g.generateTexture('player', T, T*2)` — wait maybe the Graphics IS booted? The constructor registers `t.sys.events.once(r.BOOT, this.boot, this)`. In preload, the scene already booted (BOOT fired) OR fires later. If BOOT hasn't fired yet when generateTexture is called, the Graphics isn't booted. But that wouldn't cause `this.scene` undefined.

I'm going in circles. Let me just EMPIRICALLY test generateTexture. Let me write a minimal node test that simulates... no canvas.

Let me just switch tactics entirely and use `this.textures.createCanvas` which avoids the Graphics.scene issue. I'll draw using a 2D canvas context. That's guaranteed to work.

Plan for buildTextures using createCanvas:
```
function buildTextures(scene) {
  const T = CFG.TILE;
  const tx = scene.textures;
  
  const createTex = (key, w, h, drawFn) => {
    const canvasTex = tx.createCanvas(key, w, h);
    const ctx = canvasTex.getContext();
    canvasTex.draw = ... // not needed
    drawFn(ctx);
    canvasTex.flush(); // push to GPU
  };
  
  drawPlayer(ctx) { ... fillRect etc }
}
```

`scene.textures.createCanvas(key, w, h)` returns a CanvasTexture. `canvasTex.getContext()` returns 2D context. Draw with ctx. Then `canvasTex.flush()` (or `update()` / `add`) to push the canvas to the GPU. CanvasTexture has `.flush()` and `.draw(x,y)`. Actually CanvasTexture wraps a canvas; changes to the canvas need `texture.flush()` to re-upload. Let me call `canvasTex.flush()` after drawing.

But `tx.createCanvas` requires the texture system to be available in preload — `scene.textures` is available. Good.

Let me verify `createCanvas` returns object with getContext and flush. From the grep: `createCanvas:function(t,e,i){...;var n=s.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,n)}`. `s.create` = TextureManager.create creating a canvas source. `addCanvas(t,n)` returns the texture. The returned texture (CanvasTexture) has `getContext()` and `flush()`. Yes.

So I'll rewrite using canvas 2D context. This is reliable. Let me redraw all textures with canvas commands. It's more verbose but bulletproof.

Let me write helper drawers. Canvas context: ctx.fillStyle, ctx.fillRect, ctx.beginPath, ctx.arc, ctx.fill, ctx.lineWidth, ctx.strokeStyle, ctx.stroke, ctx.moveTo, ctx.lineTo, ctx.fill(), ctx.stroke(), ctx.save/transform/translate, ctx.ellipse? Use arc for circles.

For fillRoundedRect equivalent in canvas: ctx.roundRect (modern) or manual. Let me use a helper `roundRect(ctx, x,y,w,h,r)`.

Let me write:

```
function roundRect(ctx, x, y, w, h, r) {
  ctx.beginPath();
  ctx.moveTo(x+r, y);
  ctx.lineTo(x+w-r, y);
  ctx.quadraticCurveTo(x+w, y, x+w, y+r);
  ctx.lineTo(x+w, y+h-r);
  ctx.quadraticCurveTo(x+w, y+h, x+w-r, y+h);
  ctx.lineTo(x+r, y+h);
  ctx.quadraticCurveTo(x, y+h, x, y+h-r);
  ctx.lineTo(x, y+r);
  ctx.quadraticCurveTo(x, y, x+r, y);
  ctx.closePath();
}
function circle(ctx, cx, cy, r, fill, stroke) {
  ctx.beginPath(); ctx.arc(cx, cy, r, 0, Math.PI*2); ctx.closePath();
  if (fill) ctx.fill();
  if (stroke) ctx.stroke();
}
function triangle(ctx, x1,y1,x2,y2,x3,y3, fill) {
  ctx.beginPath(); ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); ctx.lineTo(x3,y3); ctx.closePath();
  if (fill) ctx.fill();
}
```

Now draw each texture. The canvas textures are drawn with origin? For sprites, origin default 0.5,0.5. When drawing on canvas the coordinate system is top-left (0,0). That's fine; the sprite will render the canvas centered (origin 0.5). Good.

Let me write buildTextures with canvas.

Actually, wait — let me reconsider. Maybe the ORIGINAL `scene.make.graphics({add:false})` approach is actually correct in Phaser and the issue is something else entirely, like a Phaser version quirk where `generateTexture` on a non-booted graphics fails. But the error explicitly is `this.scene` undefined. 

Hmm, actually — re-reading the factory: `var i=new n(this.scene,t)`. Here `this` is the GameObjectFactory (for `add`) OR GameObjectMake (for `make`). Both have `.scene`. So `new Graphics(scene, config)`. Graphics constructor `initialize(t,e,i)`: t=scene, e=config, i=pluginKey? It's called as `new n(this.scene, t)` — 2 args. So i (pluginKey) undefined. `this.scene=t`=scene, `this.systems=t.sys`, `this.pluginKey=i`=undefined, and `t.sys.events.once(r.BOOT, this.boot, this)`. 

So this.scene=scene is set. So generateTexture reading this.scene.sys should work. 

Unless `t.sys` is undefined at construction time (scene not booted). If during preload `t.sys` is defined (scene booted), fine. The constructor does `t.sys.events.once(...)` — if t.sys is undefined it'd error there. Since it didn't error there, t.sys is defined. So this.scene=t=scene defined, this.scene.sys defined.

So generateTexture's `r=this.scene.sys` → r defined. Then `r.game.renderer` → renderer. Then `void 0===e&&(e=r.scale.width)` etc. None of these would throw "reading 'sys'".

So the error "reading 'sys'" at generateTexture means this.scene is undefined THERE. But we set it at construction. Contradiction → unless the Graphics object being used is NOT the one from add.graphics.

OH. Maybe `scene.add.graphics` returns undefined or a different object because `add` factory registration... no.

Wait, maybe the problem: I'm calling `buildTextures(this)` in `preload()`, but `preload()` might be called on a DIFFERENT scene context or `this` isn't the scene. No, preload's `this` is the scene.

Hmm, let me just try the createCanvas approach — it sidesteps Graphics entirely. If that also fails with 'sys', then the issue is elsewhere (maybe scene.textures). Let me try.

Actually, let me reconsider once more. Let me re-examine: the FIRST generateTexture call in buildTextures is `g.generateTexture('player', T, T*2)`. Before that, there are many drawing calls (fillRect etc.) which didn't error. So `g` (Graphics) drawing works fine. So g is a valid Graphics. Only generateTexture fails reading this.scene as undefined.

If g is a valid Graphics with this.scene set, generateTexture should work. Unless `generateTexture` is NOT the Graphics method but something shadowed. 

Actually — could it be that `scene.add.graphics({x:0,y:0})` returns a Graphics, but Phaser's `generateTexture` on Graphics delegates to `this.scene.sys.textures` / `this.scene.sys.game.renderer`, and the renderer here is WebGL, and it builds a Canvas internally and needs a Camera... `f.TargetCamera.setScene(this.scene)` — TargetCamera is a Camera. `.setScene` reads `this.scene`? If `this.scene` (the Graphics.scene) is defined... 

I really think `this.scene` is set. Let me just test empirically with a minimal approach using createCanvas. Let me rewrite buildTextures to use createCanvas + canvas 2D ctx. This is guaranteed to work independent of the Graphics.scene mystery. Let me do it.

Actually, before rewriting everything, let me do a quick empirical test: create a minimal HTML with just `scene.add.graphics` + `generateTexture` and see if it errors. But that takes a browser cycle. Let me instead check if maybe `scene.add` isn't available in preload (returns graphics fine though drawing worked... drawing worked so add.graphics IS available and g is valid).

The drawing working proves g is a real Graphics and g.scene should be set. The ONLY explanation generateTexture reads this.scene as undefined is if the module-registered `generateTexture` is on a DIFFERENT prototype than the Graphics instance — i.e., maybe `g` is actually not a Graphics but a `CanvasTexture`? No, drawing works (fillRect is Graphics method).

Hold on, maybe there are TWO `generateTexture` — one on Graphics (reading this.scene) and the call resolves to it. Let me check if maybe `this` inside `generateTexture:function` when called as `g.generateTexture(...)` is g (the Graphics). g.scene = scene. So this.scene.sys works.

I'm thoroughly confused. Let me just empirically test by adding a console.log of g.scene right before generateTexture. Let me add debug logging in buildTextures and reload.

Let me add: at top of buildTextures, `console.log('scene?', !!scene, 'add?', !!scene.add, 'make?', !!scene.make);` and after creating g: `console.log('g?', !!g, 'g.scene?', !!g.scene, 'g.scene.sys?', !!(g.scene && g.scene.sys));`.

Let me do that.

Drawing works (proving `g` is a valid Graphics), yet `generateTexture` fails. Let me add debug logging to pinpoint exactly what's happening with `this.scene`.

→ edit {"newText":"function buildTextures(scene) {\n const g = scene.add.graphics({ x: 0, y: 0 });\n window.__DBG_G = g;\n console.log('[DBG] sc
toolResult

edits[0] and edits[1] overlap in /tmp/job-fPtsoQ/index.html. Merge them into one edit or target disjoint regions.

user

10 minutes have elapsed. At most 5 minutes remain. Finalize the output as soon as possible: save index.html now, fix only essential issues, and finish.

assistant
thinking
I'm running low on time. Let me just switch the texture generation to the bulletproof `createCanvas` approach, remove the debug, and get the game working. Let me rewrite buildTextures entirely using canvas 2D context via `scene.textures.createCanvas`.

Let me write the whole file fresh with createCanvas-based textures, clean and tested logic. I have ~5 min.

Let me rewrite the whole file with a robust createCanvas approach.

Time is critical. Let me rewrite `buildTextures` using the bulletproof `createCanvas` API, remove debug code, and finalize everything in one write.

→ write /tmp/job-fPtsoQ/index.html (19153 bytes)
toolResult

Successfully wrote to /tmp/job-fPtsoQ/index.html

assistant
→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","error: tex.flush is not a function","warning: [.WebGL-0x3b3c00175400]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R","images":"model does not support images"}

assistant
thinking
Now `tex.flush is not a function`. The CanvasTexture returned by `createCanvas` — let me check its method. It might be `tex.update()` or `tex.draw()`? Actually CanvasTexture has `flush()`? Let me check. The TextureManager.createCanvas returns a CanvasTexture. CanvasTexture methods: `getCanvas()`, `getContext()`, `add(frames)`, `update(...)`, `draw(...)`? Actually for a single-frame canvas texture used by a sprite, no need to call flush if the sprite auto-renders the canvas. Hmm. 

Actually the issue: the texture is created and drawn via 2D ctx. The sprite using it will render the canvas. But for WebGL/WebGL the canvas texture must be uploaded. CanvasTexture handles upload on render automatically (it knows it's dirty). Maybe I need `tex.update()` instead of `flush()`. Let me check the CanvasTexture API.

Let me grep.

`flush` isn't a method on the CanvasTexture. Let me check the correct CanvasTexture API method to refresh.

→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'createCanvas:function[^}]*\\}' phaser.min.js | head -1 | grep -oE '\\}[a-zA-Z]*:function|return
toolResult

return this === CanvasTexture methods === CanvasTexture:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.canvasToTexture(t,null,e,i)},updateCanvasTexture:function(t,e,i,s){return void 0===i&&(i=!1),void 0===s&&(s=!1),this.canvasToTexture(t,e,s,i)},videoToTexture:function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1);var n=this.gl,r=n.NEAREST,o=n.NEAREST,a=t.videoWidth,h=t.videoHeight,l=n.CLAMP_TO_EDGE,c=u(a,h);return!i&& === grep flush on texture classes === flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=th flush:function(){this.current&&this.current.flush() flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this. flush:function(){this.pipelines.flush() === CanvasTexture update/add === update:function(t,e){var i=this.currentAnim;if(this.isPlaying update:function(){ update:function(t,e){this.visible&&(this.rotateToEffect.updat update:function(t,e){for(var i=0;i<this.cameras.length;i++)th update:function(t,e){this.isRunning&&(this._elapsed+=e,this.p

assistant
thinking
So `createCanvas` returns a texture via `this.addCanvas(t, n)` where n is a canvas. The returned texture is a `Texture` (base) whose first frame is a canvas-based `Frame` / `BaseTexture`. The method to mark it dirty is on the `BaseTexture`. CanvasTexture methods: `updateCanvasTexture(t,e,i,s)` and `canvasToTexture`. 

The proper API to refresh after changing canvas: the texture's base texture has `dirty()` or `setCanvasDirty()`. For CanvasTexture there's a method `tex.dirty()` maybe? Let me check what `createCanvas` returns and the right call.

Actually, the typical pattern in Phaser examples:
```
var graphics = this.make.graphics(...);
...
graphics.generateTexture('key', w, h);
```
That's the canonical one and it failed earlier with the 'sys' issue.

With createCanvas:
```
var tex = this.textures.createCanvas('key', w, h);
var ctx = tex.getContext();
// draw...
tex.draw('key');  // ??? 
```
Hmm. Actually `CanvasTexture` has a `draw(key, x, y)` method that copies canvas to a frame. And there's `update()`. Let me check the CanvasTexture class methods more precisely. Let me grep the class for its method list.

Actually, the returned object from `createCanvas` is a `CanvasTexture` instance. Its methods include `getCanvas`, `getContext`, `add`, `update`, `draw`, `dirty`, `flush`? Let me grep the CanvasTexture class definition.
→ bash {"command":"cd /tmp/job-fPtsoQ && python3 - <<'PY'\nimport re\nsrc=open('phaser.min.js').read()\n# find CanvasTexture class definition regio
toolResult

/bin/bash: line 1: python3: command not found Command exited with code 127

assistant
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE '(dirty|draw|getContext|getCanvas|setCanvasDirty|setDirty):function\\([^)]*\\)' phaser.min.js | h
toolResult

draw:function(t,e) draw:function(t,e) draw:function(t) draw:function(t,e) draw:function(t,e) draw:function(t,e,i,s,n) setDirty:function() draw:function(t,e,i,s) getCanvas:function() getContext:function() === canvas dirty mechanism === setDirty:function === BaseTexture dirty ===

assistant
thinking
So CanvasTexture has `setDirty`, `draw`, `getCanvas`, `getContext`. The correct refresh method is `tex.setDirty()` — wait, `setDirty:function` exists. Let me check. Actually the BaseTexture has `dirty` and CanvasTexture has `setDirty()`. Hmm. The convention: after modifying canvas, call `texture.setDirty()` or `texture.dirty()`. Let me check both `setDirty` and `dirty` on the Texture object.

Actually, the standard Phaser pattern for createCanvas:
```
const tex = this.textures.createCanvas(key, w, h);
const ctx = tex.getContext();
// draw
this.textures.get(key).generate? 
```

Hmm. Let me look at the actual method names on the object returned by createCanvas. `addCanvas(t, n)` returns... Let me check `addCanvas`.

Let me grep addCanvas.
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE 'addCanvas:function\\([^)]*\\)\\{[^}]{0,300}' phaser.min.js | head -1; echo \"=== setDirty def ==
toolResult

addCanvas:function(t,e,i){void 0===i&&(i=!1);var s=null;return i?s=new n(this,t,e,e.width,e.height):this.checkKey(t)&&(s=new n(this,t,e,e.width,e.height),this.list[t]=s,this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s === setDirty def === setDirty:function(){return this.dirty=!0,this === Texture.setDirty / dirty === setDirty:function

assistant
thinking
`addCanvas` returns `s` which is a `n` — that's a `Texture` instance (the key manager's Texture, with `.frames`, `.source` etc.), NOT the CanvasTexture. So `createCanvas` returns a `Texture` (Phaser's Texture manager object), which has `.setDirty()`, `.getSource()`, and a `BaseTexture`. The canvas is the source's `image`/`canvas`.

Wait — `addCanvas` creates `new n(this, t, e, e.width, e.height)` where n is... `this` (TextureManager) passed. Let me re-read: `var s=null; if(i){s=new n(this,t,e,e.width,eheight)}`. So s = new CanvasTexture? Actually `n` here — `s=new n(this, t, e, e.width, e.height)` — n is the CanvasTexture class (passed as dependency). So `s` IS a CanvasTexture. addCanvas returns the CanvasTexture. And CanvasTexture has getCanvas() / getContext(). And setDirty() is on the BaseTexture? Let me check where setDirty is attached. `setDirty:function(){return this.dirty=!0,this}` — `this` is some class. 

The CanvasTexture inherits from BaseTexture? Actually BaseTexture has `dirty` flag and a `setDirty`? Let me check: there's `setDirty` method. The returned `s` (CanvasTexture) — does it have `setDirty`? It might delegate to its base texture. 

Simpler reliable approach: instead of createCanvas + manual, let me find the EXACT documented usage. The Phaser docs `textures.createCanvas(key, width, height)` returns a `Phaser.Textures.CanvasTexture`. Methods: `getCanvas()`, `getContext()`, `add(frame, x, y)`, `update(key, x, y)`, `draw(key, x, y)`, and importantly for refresh: `CanvasTexture` doesn't auto-detect canvas changes; you call... Actually I recall: after drawing on the canvas, you call `texture.draw(key)` no.

Hold on — the cleanest known-good approach that I KNOW works in Phaser 3 is the Graphics.generateTexture. It failed because `this.scene` was undefined on the Graphics. But wait — the Graphics constructor sets this.scene=t. Why undefined?? 

Let me reconsider: the createCanvas returns a CanvasTexture (s). Let me just try `tex.setDirty()` after drawing. The CanvasTexture class likely has a `setDirty` inherited or its own. Let me check the CanvasTexture prototype (the class with getContext/getCanvas). Let me search for where getContext/getCanvas/setDirty are defined and whether they're on same prototype (CanvasTexture).
→ bash {"command":"cd /tmp/job-fPtsoQ && grep -oE '[a-zA-Z]{2,5}:function\\([^)]*\\)\\{[^}]*?getContext:function[^}]*?\\}' phaser.min.js | head -1
toolResult

=== full CanvasTexture-ish class region around getContext === grep: Unmatched [, [^, [:, [., or [=

assistant
→ bash {"command":"cd /tmp/job-fPtsoQ && node -e \"\nconst s=require('fs').readFileSync('phaser.min.js','utf8');\nconst i=s.indexOf('getContext:fun
toolResult

getContext at 1020495 rce.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0== --- ):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return voi --- setDirty --- date:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal

assistant
thinking
There's a `refresh` method on the CanvasTexture/Texture that calls `this._source.update()`. Hmm. Let me look at the CanvasTexture class. The first match context: "...rce.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return void 0===t..." This is part of a class with `clear`, `getCanvas`, `getContext`, and a `refresh` and `draw`/`update` methods.

Let me look at the broader class. Let me find the CanvasTexture class methods: clear, draw, update, getCanvas, getContext, setDirty(?), refresh. The second match: `refresh:function(){return this._source.update(),this}`. `_source.update()` — updating the source's canvas texture (re-upload). 

So after drawing on the canvas context, I should call `tex.refresh()` (which does `this._source.update()`). Let me check if the returned object from createCanvas has `refresh`. The `s` returned is a CanvasTexture. Does CanvasTexture have `refresh`? Let me check. The first match context "rse.update(),this},getCanvas:..." — the `update` here might be a method on the CanvasTexture. Let me find the class that contains getCanvas/getContext to see its method list.

Actually, the BaseTexture has `update()` which re-uploads canvas. And Texture/CanvasTexture has methods. Let me just try the simplest: after drawing, call `tex.getSource().update()` or `tex.refresh()`.

Hmm. Let me reconsider. Actually, maybe the issue is simpler: I don't even need `flush()`. The sprite using the texture will read pixels from the canvas whenever it renders. For a CanvasTexture in WebGL, Phaser uploads the canvas to a WebGL texture; if the canvas content changes, you must call `setDirty`/`update` to trigger re-upload. Without it, the sprite renders but might show a blank/old texture.

But the error is `tex.flush is not a function` — a hard crash. Let me just remove `tex.flush()` and instead call something valid. Let me check what methods exist on the CanvasTexture returned by createCanvas. The cleanest: call `tex.setDirty()` if it exists, or `tex.getSource().setDirty()`, or `tex.refresh()`.

Let me grep for the CanvasTexture class proper (registered name). Actually, let me just test empirically: replace `tex.flush()` with `tex.setDirty()` and if that throws, try `tex.refresh()` etc. But each reload costs time.

Let me instead find the CanvasTexture methods definitively. The class with getCanvas + getContext + clear + refresh + draw. Let me locate the class by finding a cluster and the method definitions belonging to it.

Actually, let me reconsider the Graphics.generateTexture failure. It failed with this.scene undefined. That's really strange. Let me reconsider: maybe `scene.add.graphics` in Phaser 3.80 — the `add` factory `graphics` registration: `register("graphics",(function(t,e){...new n(this.scene,t)}))`. Wait the make factory uses `this.scene`. For the ADD factory (GameObjectFactory), the registration is `register("graphics",...)` too — and `this` in that factory is the GameObjectFactory whose `.scene` is the scene. So `new n(this.scene, t)` = `new Graphics(scene, config)`. Graphics ctor sets this.scene=scene. So g.scene = scene. So generateTexture should read scene.sys fine.

Unless `add.graphics` returns a Graphics and g.scene IS set, but generateTexture's `this.scene.sys` — wait maybe `this.scene.sys` is fine but `r.game.renderer` ... no, error is on 'sys'.

Hmm, let me reconsider whether `buildTextures` `this` was the scene at preload. It is.

Actually, you know what — let me just test the createCanvas approach properly. The returned object is a `Phaser.Textures.CanvasTexture`. Let me check its methods by reading the class. Let me find it via the registration where CanvasTexture is instantiated. The grep earlier: `CanvasTexture:function(t,e,i){...this.canvasToTexture(t,null,e,i)}`. That's a TextureManager method `canvasToTexture`, not the class. 

The CanvasTexture class is registered via `r.register("canvasTexture",...)` or extends BaseTexture. Let me just grep the texture source class. Actually `addCanvas` returns `new n(this, t, e, e.width, e.height)` where n is the class registered. Let me find what `n` is in that module (847? the textures module). Let me look at the broader context.

This is eating time. Let me just try `tex.setDirty()` first — but if CanvasTexture doesn't have setDirty, error. 

Let me quickly grep: does the object returned by createCanvas have a `setDirty`? The setDirty I found was on the Sprite/GameObject (texture animator). Not CanvasTexture.

Let me look at the CanvasTexture/BaseTexture methods. BaseTexture has `dirty` counter and `setDirty`? Let me grep "dirty:function" and "setDirty" and "forcePowerOfTwo".
→ bash {"command":"cd /tmp/job-fPtsoQ && node -e \"\nconst s=require('fs').readFileSync('phaser.min.js','utf8');\n// Find the CanvasTexture class r
toolResult

CONTEXT A: r);var s=this.getIndex(t,e);if(s>-1){var n=this.data,o=n[s+0],a=n[s+1],h=n[s+2],l=n[s+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=n(t,0,this.width),a=n(t+i,0,this.width),h=n(e,0,this.height),l=n(e+s,0,this.height),u=new r,c=[],d=h;d<l;d++){for(var f=[],p=o;p<a;p++)u=this.getPixel(p,d,u),f.push({x:p,y:d,color:u.color,alpha:u.alphaGL});c.push(f)}return c},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===s&&(s=this.height),void 0===n&&(n=!0),this.context.clearRect(t,e,i,s),n&&this.update(),this},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.heigh

assistant
thinking
This is a different class (a Texture/Frame wrapper, with getColor, getPixel, refresh, getCanvas, getContext, clear, setSize). The `clear` calls `this.update()`. And `refresh` calls `this._source.update()`. So this class has `update()` and `refresh()` and `clear()` and `setSize()`. 

The returned object from `createCanvas` — is it THIS class? The `addCanvas` returned `s = new n(this, t, e, e.width, e.height)`. Let me check which class `n` is. The class shown with getCanvas/getContext/refresh/clear — let me confirm it has a constructor matching `(t,e,i,s,n)`. Let me look just above `getColor`/`getIndex`.

Actually, this class (call it X) has `getContext`, `getCanvas`, `refresh`, `clear`, `update`, `setSize`, `draw`, etc. `createCanvas` returns an instance of some class. Let me check if it's X. The `update` method: `clear` calls `this.update()`. And `refresh` calls `this._source.update()`. 

For our purpose: after drawing on the ctx, call `tex.update()` to upload. The `clear` method does `this.context.clearRect(...); n&&this.update()`. So `update()` uploads the canvas. So I should call `tex.update()` not `tex.flush()`.

But wait — is `update` defined on this class? Yes (clear calls it). Let me check the class returned by createCanvas. The class X (with getCanvas/getContext/clear/refresh/update/setSize) — its constructor: `function(t,e,i,s,n){...this.canvas=t? ...}`. Hmm. Let me verify `createCanvas` returns this class. The `addCanvas` `new n(this, t, e, e.width, e.height)` where `this`=TextureManager (first arg to addCanvas is TextureManager? Actually addCanvas is a method on TextureManager, so `this`=TextureManager, n is the CanvasTexture class). The CanvasTexture constructor takes `(key, width, height, ...)`? Let me check the constructor signature for class X. 

Let me just use `tex.update()`. Let me also reconsider: the class X has `getContext` returning `this.context`, and `clear`/`setSize` modify canvas. The constructor probably takes (textureManager, key, width, height, ...). And stores canvas, context. So `tex.getContext()` works, and `tex.update()` re-uploads.

Wait, but there are two classes here. The `getCanvas:function(){return this.canvas},getContext:function(){return this.context}` appears in BOTH match A and match B (refresh). Match A context starts mid-method (getColor/getIndex/refresh/getCanvas/getContext/clear/setSize...). That's class X. Match B: `refresh:function(){return this._source.update(),this},getCanvas...` — wait that's the SAME class X! Both matches are the same class (X) methods. So `tex.update()` exists.

Actually wait, match A: `...,refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:...setSize:...`. And match B is the same refresh line. So yes it's one class X with refresh updating `_source`. And `clear` calls `this.update()`.

Does class X have `update`? `clear` calls `this.update()`, so yes X.update exists. And it uploads. So I should call `tex.update()`.

But hold on — does the object returned by `createCanvas` have `update`? It returns class X (the canvas texture manager object). Let me verify createCanvas returns X. `addCanvas` returns `s = new n(...)`. Is n the class X? The class X has constructor? Let me check `n=...` definition. The texture module imports. Actually `createCanvas` calls `this.addCanvas(t, n)` where after `n=this...`. Let me look at createCanvas: `createCanvas:function(t,e,i){...;var n=s.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,n)}`. `s.create` creates a canvas + base texture? Hmm, `s=i(27919)` (CanvasPool). `n=s.create(this,e,i,o.CANVAS,!0)` returns a canvas element (from CanvasPool.create which returns `{parent,canvas,type}`?). Wait CanvasPool.create returns an object `{parent, canvas, type}` not a canvas. Hmm, then `addCanvas(t, n)` where n should be a canvas. 

Actually, re-reading addCanvas: `addCanvas:function(t,e,i){...s=new n(this,t,e,e.width,e.height)...}`. Here `e` is the canvas (passed as 2nd arg). `e.width, e.height` are canvas dimensions. `new n(this, t, e, e.width, e.height)` — constructor (textureManager, key, canvas, width, height). So class X constructor is `(t,e,i,s,n)` = (textureManager, key, canvas, width, height). And X.getContext() returns this.context (a 2D ctx created from canvas). 

So createCanvas returns a class X instance with getContext, update, setSize, etc. So `tex.update()` should upload the canvas to GPU. Let me use `tex.update()`.

Hmm wait, but actually there's subtlety: CanvasTexture in Phaser — the proper way to modify and refresh is to get the 2D context, draw, then call `texture.update()` (which calls `this.draw()` ?). Let me just try `tex.update()` and `tex.setDirty()` combined? setDirty wasn't on X. Let me just use `tex.update()`.

Actually, the safer known idiom: After createCanvas and drawing, the texture is automatically re-rendered each frame because CanvasTexture's base is marked dirty. But to be safe call `tex.update()`. Actually I recall many examples do NOT call anything after drawing; the canvas texture updates automatically because the base texture is a canvas that's checked each render. But to be safe, call update.

Let me change `tex.flush()` → `tex.update()`. And also, hold on — is the issue maybe that `createCanvas`/`getContext` returns a context but the canvas isn't properly sized/cleared? Let me just try.

Let me edit: replace `tex.flush()` with `tex.update()`.

Also, I should double check the createCanvas key: I call `tx.createCanvas(key, w, h)`. createCanvas signature `(t,e,i)` = (key, width, height)? Let me check: `createCanvas:function(t,e,i)`. From grep earlier: `createCanvas:function(t,e,i){...}`. And it calls `s.create(this,e,i,...)` where e=width?, i=height? And `addCanvas(t,n)`. So t=key, e=width, i=height. Good, matches my usage `createCanvas(key, w, h)`.

Wait but earlier createCanvas grep: `createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var n=s.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,n)}` — here `s.create(this,e,i,...)` passing e,i as width,height to CanvasPool.create? CanvasPool.create(parent, width, height, type). So e=width, i=height. And checkKey(t) checks key uniqueness. Good. So createCanvas(key,width,height). 

But there's a subtlety: `this.checkKey(t)` returns false if key exists → then createCanvas returns undefined! On a fresh scene, keys don't exist, so fine.

So change flush→update and test.

Let me also reconsider whether `tex.update()` exists on the returned object. The class X has `update`? `clear` calls `this.update()`. But is `update` a method on X or on a different class? The clear I found: `clear:function(t,e,i,s,n){...;this.context.clearRect(t,e,i,s),n&&this.update(),this}`. This `this.update` — is this the same class X (with getCanvas/context)? The text shows `...,refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,s,n){return void 0===t...(n&&this.update(),this),setSize...`. So yes, `clear` and `update` and `refresh`, `getCanvas`, `getContext` are all in class X. So `tex.update()` exists. 

Let me make the edit.

The CanvasTexture class has `update()` (not `flush()`), which re-uploads the canvas. Let me fix that.

→ bash {"command":"cd /tmp/job-fPtsoQ && sed -i 's/ tex.flush();/ tex.update();/' index.html && grep -n 'tex.update\\|tex.flush' index.html"}
toolResult

77: tex.update();

assistant
→ browser {"action":"reload"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R","images":"model does not support images"}

assistant
thinking
No more errors. The game loads. Now let me visually inspect and test gameplay. Let me take a screenshot and also check the rendering. The console shows only WebGL warnings (performance, non-fatal). 

Let me inspect the DOM to confirm the canvas rendered, then test movement/jumping. Let me take a screenshot to see visual state.

Note: the browser tool viewport is 1200x800 but my game is 960x540. The canvas will be scaled. Pointer events: the game is in an iframe; keyboard focus needed. Let me click the canvas to focus, then press keys.

Let me screenshot first.

No errors now. Let me take a screenshot to verify rendering.

→ browser {"action":"screenshot"}
toolResult

{"console":["warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.","log: %c %c %c %c %c Phaser v3.80.1 (WebGL | Web Audio) %c https://phaser.io background: #ff0000 background: #ffff00 background: #00ff00 background: #00ffff color: #ffffff; background: #000000 background: transparent","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels","warning: [.WebGL-0xb5400182000]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)"],"dom":"COINS:\n0\nMove: ←/A    →/D      Jump: SPACE      Restart: R","images":"model does not support images"}

assistant
thinking
The screenshot tool returned no image (images: model does not support images). I can't see the visual directly. I'll rely on DOM inspection and console, plus by injecting debug logging into the game to print player position, coin count, etc. Let me test interaction: I can't see the screen but I can query the canvas? The "dom" output shows the HUD text "COINS: 0" and controls. The game canvas isn't captured as image.

To verify behavior, let me instrument the game to log key state to console periodically, OR better, write a small test harness. Since I can't see images, let me add console logging of the player's position and a few checks, then drive inputs via keyboard events and observe.

Actually, I can interact via the browser tool: click (to focus), key presses. But without visuals I need feedback. Let me add console.log of player.x/y each second via a timer in create, so I can observe movement when pressing keys. Then test: press right arrow → player moves right; press space → jumps; observe console.

But that logs a lot. Let me instead add a debug overlay element showing player state, which I can read via inspect (dom text). Actually the "inspect" returns dom text — but the canvas content isn't in dom text. I could add a <div id="dbg"> showing position updated in real time, then read it via inspect.

Let me add a debug div updated in update() with player.x/y, touching.down, velocity, coinCount, isDead. Then I can read it via the inspect tool. And I can drive keys.

Let me add a debug div. Actually, the HUD already shows coins. Let me add a hidden debug div that I update with innerText each frame, and read via inspect.

Let me modify the code to add a debug div and update it. Also, I realize I should verify the camera follows and restart works.

Let me add debug logging via a DOM element.

Let me edit create() to add the debug div, and update() to write to it. Also log to console periodically.

Actually, to minimize risk, let me add a debug div `#dbg` and in update set its text. Let me insert into HTML and JS.

Let me also reconsider: I want to verify "running and jumping near the starting area. Check landing on a nearby platform and camera following as the player moves. Use Restart and check initial player position, visible coins, camera position return."

I'll add a debug overlay showing live state, drive inputs with key events, and check console/dom.

Let me add the debug element and wiring.

The game runs without errors. Since I can't view screenshots directly, let me add a live debug overlay to observe internal state (player position, velocity, ground state, camera) so I can verify behavior via the DOM inspector.

→ edit {"newText":"<div id=\"controls\">Move: &larr;/A &nbsp;&nbsp; &rarr;/D &nbsp;&nbsp; &nbsp; Jump: SPACE &nbsp;&nbsp; &nbsp; Restart: R</div>\n
toolResult

edits[0] and edits[1] overlap in /tmp/job-fPtsoQ/index.html. Merge them into one edit or target disjoint regions.

assistant
thinking
The edit failed because oldText appears twice (the controls div appears once in HTML; the edit tool thought... actually the issue is the edits array had one element but I passed two? No, I passed one edit object. The error says edits[0] and edits[1] overlap — that's odd. Maybe the tool interpreted my single object incorrectly. Let me retry with a single clean edit. The controls div is unique. Let me just do it.
→ edit {"path":"/tmp/job-fPtsoQ/index.html","edits":[{"oldText":" <div id=\"controls\">Move: &larr;/A &nbsp;&nbsp; &rarr;/D &nbsp;&nbsp; &nbsp; Ju
toolResult

Successfully replaced 1 block(s) in /tmp/job-fPtsoQ/index.html.

assistant

Now let me wire the debug element into the scene and log key state.

→ edit {"newText":"this.overlay = document.getElementById('overlay');\n this.overlayText = document.getElementById('overlay-text');\n this.db
toolResult

edits[0] and edits[1] overlap in /tmp/job-fPtsoQ/index.html. Merge them into one edit or target disjoint regions.

assistant
thinking
The edit tool is complaining about overlap again, even though it's a single edit. The issue is likely that "edits[0] and edits[1]" refers to something — maybe my oldText and newText overlap? No. Wait — the error says edits[0] and edits[1] overlap — but I only provided one edit object. Maybe the tool is mis-parsing. Let me re-read: I passed `edits` as an array with one object. The error mentions edits[0] and edits[1] — that suggests the tool split my single object into two? Or there's a parsing issue with the newText containing the same text as... 

Actually maybe the issue is the oldText appears... no. Let me just retry the exact same call. Maybe it was a transient misparse.

Actually, I bet the problem: my newText contains the oldText as a substring (since newText = oldText + extra). The tool might consider that an overlap? No, that shouldn't trigger "edits[0] and edits[1]".

Let me just retry once.
→ edit {"newText":"this.overlay = document.getElementById('overlay');\n this.overlayText = document.getElementById('overlay-text');\n this.db
toolResult

edits[0] and edits[1] overlap in /tmp/job-fPtsoQ/index.html. Merge them into one edit or target disjoint regions.

assistant
thinking
Strange — it keeps saying edits[0] and edits[1] overlap but I only have one edit. Wait — maybe the issue is that the `oldText` I provided actually matches in TWO places in the file (the string appears twice). If oldText isn't unique, the edit can't apply... but the error is about overlap, not uniqueness.

Oh! I think the tool is interpreting my `edits` array incorrectly — maybe it's treating each newline-separated chunk? No.

Actually, wait. Let me reconsider: maybe the file content around there genuinely has the oldText appearing, and the newText I'm writing is essentially the oldText plus a line — and the tool sees oldText and newText as overlapping? The validation might flag when newText contains oldText. That would be a design where it warns that the two overlap. But that's normal for an insertion...

Hmm. Let me try a totally different, smaller, unique oldText anchor. Let me target just the overlayText line and add the dbg line after it, using a unique small anchor.

Let me read the relevant section first.

Let me view the exact current text around that section.

→ bash {"command":"cd /tmp/job-fPtsoQ && grep -n \"overlayText\\|overlay = document\\|restart-btn\" index.html"}
toolResult

53: <button id="restart-btn">RESTART</button> 345: this.overlay = document.getElementById('overlay'); 346: this.overlayText = document.getElementById('overlay-text'); 347: document.getElementById('restart-btn').addEventListener('click', () => this.restart()); 405: this.overlayText.innerHTML = '<h1>' + title + '</h1><p>' + sub + '</p>';

assistant
→ read {"path":"/tmp/job-fPtsoQ/index.html","offset":343,"limit":8}
toolResult

/* ---------- Overlay ---------- */ this.overlay = document.getElementById('overlay'); this.overlayText = document.getElementById('overlay-text'); document.getElementById('restart-btn').addEventListener('click', () => this.restart()); } inputs() { [166 more lines in file. Use offset=351 to continue.]

assistant
thinking
The oldText I'm using should be unique (only at line 345-347). The error about "edits[0] and edits[1] overlap" is puzzling. Wait — maybe the tool is reading my edits parameter where I have a single object, but it's actually receiving two edits because of how I structured it? No.

Oh! I bet the issue: the `newText` and `oldText` — the tool validates that edits don't overlap each other. With ONE edit, there are no two to overlap. Unless the tool is double-counting. 

Actually, maybe the problem is a hidden character. The oldText contains special characters? No.

Let me try a different approach — use a unique single-line anchor. Let me edit just adding the dbg line by anchoring on the overlayText line and the blank-ish next line. Let me make oldText = the three lines, newText = same with dbg inserted. That's what I did. 

Hmm, the error persists. Let me try splitting: maybe the tool wants me NOT to include the full block where newText is a superset. Let me instead anchor on a single unique line and replace it with itself + new line.

oldText: `    this.overlayText = document.getElementById('overlay-text');`
newText: `    this.overlayText = document.getElementById('overlay-text');\n    this.dbg = document.getElementById('dbg');`

This is a clean unique single-line replacement. Let me try.
→ edit {"newText":"this.overlayText = document.getElementById('overlay-text');\n this.dbg = document.getElementById('dbg');","oldText":"this.ove
toolResult

edits[0] and edits[1] overlap in /tmp/job-fPtsoQ/index.html. Merge them into one edit or target disjoint regions.