diff --git a/data/config.json b/data/config.json index 40c5450..4e40cd8 100644 --- a/data/config.json +++ b/data/config.json @@ -1,6 +1,6 @@ { - "targetSize": 1, - "fingerSize": 1, + "targetSize": 1.0, + "fingerSize": 1.0, "enableSkipButton": false, "skipLoopThreshold": 1, "enableAutoSkip": false, @@ -8,13 +8,13 @@ "disableSonification": false, "disableLayerProgression": false, "indexFingerOnly": false, - "sonificationLevel": 1, - "backgroundMusicLevel": 1, + "sonificationLevel": 1.0, + "backgroundMusicLevel": 1.0, "onTimeDuration": 500, "lateTimeDuration": 500, "enableCameraVisibility": false, "cameraOpacity": 0.2, "fancyEffectsDisabled": false, "disableVisualMetronome": false, - "autoSaveCSV": true + "autoSaveCSV": false } diff --git a/data/default_config.json b/data/default_config.json index 24def22..4e40cd8 100644 --- a/data/default_config.json +++ b/data/default_config.json @@ -16,5 +16,5 @@ "cameraOpacity": 0.2, "fancyEffectsDisabled": false, "disableVisualMetronome": false, - "autoSaveCSV": true + "autoSaveCSV": false } diff --git a/icons/icon.ico b/icons/icon.ico new file mode 100644 index 0000000..98d4807 Binary files /dev/null and b/icons/icon.ico differ diff --git a/icons/icons-192.png b/icons/icons-192.png deleted file mode 100644 index 16bebab..0000000 Binary files a/icons/icons-192.png and /dev/null differ diff --git a/icons/icons-512.png b/icons/icons-512.png deleted file mode 100644 index 0e53609..0000000 Binary files a/icons/icons-512.png and /dev/null differ diff --git a/index.html b/index.html index e737f12..f2e8a7f 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - \ No newline at end of file + } \ No newline at end of file diff --git a/levels/list.json b/levels/list.json new file mode 100644 index 0000000..0c5c9e1 --- /dev/null +++ b/levels/list.json @@ -0,0 +1 @@ +["Birthday Vibes", "Cheerful Bliss", "Slow Elegance"] diff --git a/main.131f5081d4ac12d25c3e.bundle.js b/main.131f5081d4ac12d25c3e.bundle.js new file mode 100644 index 0000000..36c96fd --- /dev/null +++ b/main.131f5081d4ac12d25c3e.bundle.js @@ -0,0 +1 @@ +(()=>{"use strict";var t,e={852:(t,e,s)=>{var i=s(440),n=s.n(i);function a(t){let e="layerID,noteID,loopNumber,playerTime,correctTime,classification\n";for(const s of t.layersStats){const i=t.layersStats.indexOf(s);for(const t of s.hits)e+=`${i},${t.noteID},${t.loopNumber},${o(t.playerTime)},${o(t.correctTime)},${t.classification}\n`}return e}function o(t,e=3){return parseFloat((t/1e3).toFixed(e))}const r=Phaser.Math.Vector2,h=Phaser.GameObjects.Group,l=Phaser.GameObjects.Graphics,c=Phaser.Time.TimerEvent,d=Phaser.GameObjects.GameObject,u=Phaser.Geom.Rectangle,g=(Phaser.Geom.Circle,Phaser.Input.Pointer,Phaser.GameObjects.Text),p=(Phaser.GameObjects.Sprite,Phaser.GameObjects.Video,Phaser.GameObjects.RenderTexture,Phaser.Events.EventEmitter,Phaser.GameObjects.Image,Phaser.Scene),v=(Phaser.Tilemaps.Tile,Phaser.Tweens.Tween,Phaser.GameObjects.Particles.ParticleEmitter,Phaser.Physics.Matter.Sprite),m=(Phaser.Physics.Arcade.Sprite,!0),y="finger",f="previewVideoBackground",b="songNameBackground",w="layerScoreBackground",T="scoreboardBackground",x="menuCalibrateButton",k="menuSelectButton",S="optionsButton",P="targetInner",L="background1",C="mainBackground",B="playButton",D="easyButton",O="mediumButton",H="hardButton",_="backButton",M="buttonDing",V="calibrationBackground",I="menuLogo",A="resetButton",E="muteButton",F="unmuteButton",K="leftArrow",j="rightArrow",N="saveCSVButton",W="defaultLevelbackground",z="defaultPreviewbackground",R="assets/sprites/defaultTargetInner.png",G="assets/ui/back_button.png",q="assets/sounds/ui/menu_ding.wav",$="assets/ui/mute_button.png",J="assets/ui/unmute_button.png",U="levels/",X=U+"list.json",Q=".ogg",Y="data/config.json",Z="data/default_config.json",tt={thumb:16777215,index:14948892,middle:9981603,ring:3636920,pinky:16220607},et={lineWidth:5,color:11393254,alpha:.5},st={lineWidth:5,color:11393254,alpha:1,radius:.1},it="thumb",nt="index",at=nt,ot=16777215,rt=14948892,ht=P,lt="targetOuter",ct=R,dt={scale:1.03,color:16777215,ease:"linear"},ut={scale:.78,color:5091146,ease:"linear"},gt={scale:.3,color:16744192,ease:"linear"},pt={scale:0,color:8421504,ease:"cubic.in"},vt="keydown-ESC",mt={font:"32px Courier",color:"#00ff00"},yt={position:ne(new r(.05,.05)),color:"white",scale:1,font:"30px Arial",depth:40,strokeThickness:0,shadowOffset:new r(2,2),shadowColor:"black",shadowBlurRadius:2},ft={color:[16436258,16291840,16266752,10421252],colorEase:"quad.out",lifespan:500,scale:{start:.7,end:0,ease:"sine.out"},speed:200,advance:500,frequency:50,blendMode:"ADD",duration:0},bt="flare",wt={position:ne(new r(.5,0)),size:ne(new r(.4,.04)),requiredTint:524543,completedRequiredTint:2840741,completedTint:ut.color,extraTint:ut.color,path:"assets/ui/progress_bar_segment.png",key:"segment",tintByNode:!1},Tt="metronome/high",xt="metronome/low",kt="countdown",St={position:ne(new r(.5,.5)),color:"white",scale:1,ease:"Power0",font:"240px Arial",depth:30},Pt={position:ne(new r(.835,0)),size:new r(.16*window.innerWidth,.2684*window.innerHeight),textureKey:"infoBackground",opacity:.3,path:"assets/ui/info_background.png"},Lt={position:ne(new r(.93,.9)),scale:new r(.3,.3),soundKey:M,textureKey:"skipButton",path:"assets/ui/skip_button.png"},Ct={position:ne(new r(.85,.02)),color:"white",font:"20px Arial",scale:1,depth:40},Bt={position:ne(new r(.85,.07)),color:"white",font:"20px Arial",scale:1,depth:40},Dt={position:ne(new r(.85,.12)),color:"white",font:"20px Arial",scale:1,depth:40},Ot={position:ne(new r(.85,.17)),color:"white",font:"20px Arial",scale:1,depth:40},Ht={position:ne(new r(.85,.22)),color:"white",font:"20px Arial",scale:1,depth:40},_t=new r(.5,.5),Mt=new r(.6,.6),Vt=new r(1.5,1.5),It=new r(-32,-32),At=new r(32,-32),Et=.07,Ft=.71,Kt=.75,jt="loading",Nt="level",Wt="scoreboard",zt="mainMenu",Rt="levelSelect",Gt="calibration",qt="options",$t=zt,Jt={visible:!1,flip:!0,opacity:0,width:window.innerWidth,height:window.innerHeight,objectFit:"fill"},Ut={video:{width:{ideal:640},height:{ideal:360}},audio:!1},Xt={baseOptions:{delegate:"GPU"},runningMode:"VIDEO",numHands:1,minHandDetectionConfidence:.5,minHandPresenceConfidence:.5,minTrackingConfidence:.5},Qt="UNDEFINED";var Yt=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};function Zt(t){return new Promise(((e,s)=>Yt(this,void 0,void 0,(function*(){var i;yield("GET",i=t,new Promise((function(t,e){let s=new XMLHttpRequest;s.open("GET",i),s.onload=function(){this.status>=200&&this.status<300?t(s):e({status:this.status,statusText:s.statusText})},s.onerror=function(){e({status:this.status,statusText:s.statusText})},s.send()}))).then((t=>{e(JSON.parse(t.responseText.toString("utf8")))})).catch((()=>{s()}))}))))}function te(t,e="no error message provided"){if(m&&!t)throw new Error("Assertion failed: "+e)}function ee(t,e=""){const s="".replace(/\\/g,"/")+e;return t=t.replace(/\\/g,"/"),"/"==Array.from(t)[0]?s+t:s+"/"+t}function se(t){return ee(t,"")}function ie(t){return se(t),!0}function ne(t){return t instanceof r?new r(t.x*window.innerWidth,t.y*window.innerHeight):new r(t[0]*window.innerWidth,t[1]*window.innerHeight)}const ae=s(213);let oe;function re(t){oe=t}function he(t){return new Promise(((e,s)=>{return i=this,n=void 0,o=function*(){yield Zt(se(t)).then((t=>{const s=t;re(s),e(s)})).catch((()=>{s()}))},new((a=void 0)||(a=Promise))((function(t,e){function s(t){try{h(o.next(t))}catch(t){e(t)}}function r(t){try{h(o.throw(t))}catch(t){e(t)}}function h(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(s,r)}h((o=o.apply(i,n||[])).next())}));var i,n,a,o}))}var le=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const ce=new class{init(t,e){return le(this,void 0,void 0,(function*(){return new Promise(((s,i)=>le(this,void 0,void 0,(function*(){e("Loading webcam..."),this.setupVideoElement(t),yield navigator.mediaDevices.getUserMedia(Ut).then((t=>{"srcObject"in this.video?(this.video.srcObject=t,this.video.addEventListener("loadeddata",(()=>{s(!0)}))):i("srcObject does not exist on older browsers")})).catch((t=>{i(t)}))}))))}))}found(){return null!=this.video.srcObject}setVisibility(t){this.video.style.visibility="",this.video.style.visibility=t?"shown":"hidden"}setWidth(t){this.video.width=t}setHeight(t){this.video.height=t}setupVideoElement(t){this.video=document.body.appendChild(document.createElement("video")),this.video.autoplay=!0,this.video.muted=!0,this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.top="0",this.video.style.left="0",this.video.style.bottom="0",this.video.style.zIndex="-1",this.video.style.pointerEvents="none",this.video.style.objectFit=t.objectFit,this.setWidth(t.width),this.setHeight(t.height),t.flip&&(this.video.style.cssText+="-moz-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); transform: scale(-1, 1); filter: FlipH;"),this.setVisibility(!1)}get video(){return te(null!=this.video_),this.video_}set video(t){this.video_=t}};var de=s(260),ue=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const ge=new class{constructor(){this.lastVideoTime=-1}init(t){return ue(this,void 0,void 0,(function*(){return new Promise(((e,s)=>ue(this,void 0,void 0,(function*(){let i;yield de.Ps.forVisionTasks(ee("models/wasm")).then((t=>i=t)).catch((t=>{s(t)})),t("Loading hand landmarker..."),Xt.baseOptions.modelAssetPath=se("models/hand_landmarker.task"),yield de.Vb.createFromOptions(i,Xt).then((t=>this.handLandmarker_=t)).catch((t=>{t instanceof Event&&"error"==t.type&&s("Failed to fetch vision_wasm_internal.js in specified wasm directory"),t instanceof TypeError&&s("Failed to fetch hand_landmark.task file"),s(t)})),e(!0)}))))}))}precache(t){t("Pre-caching landmarks..."),this.update()}found(){return null!=this.handLandmarker_}update(){this.lastVideoTime!=ce.video.currentTime&&(this.lastVideoTime=ce.video.currentTime,this.results_=this.handLandmarker.detectForVideo(ce.video,performance.now()))}get results(){return te(null!=this.results_),this.results_}get handLandmarker(){return te(null!=this.handLandmarker_),this.handLandmarker_}landmarksFound(t=0){return null!=this.results&&t=0&&s.x<=1&&s.y>=0&&s.y<=1}getLandmarkPosition(t,e=0){if(!this.landmarksFound(e))return;const s=this.results.landmarks[e][t],i=ne(new r(s.x,s.y));return new r(window.innerWidth-i.x,i.y)}forEachLandmarkPosition(t,e=0){for(let s=0;s<21;++s){const i=this.getLandmarkPosition(s,e);void 0!==i&&t(i)}}};var pe=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};let ve;function me(t,e){null!=t&&(t.setVisible(e),e?t.setInteractive():t.disableInteractive())}class ye extends v{constructor(t,e,s,i,n){super(t.matter.world,0,0,e,void 0,{render:{visible:!0}}),this.name=s,this.landmarkIndex=i,this.scene.add.existing(this),this.setScale(n),this.setTint(tt[this.name]),this.setDepth(100),this.setCircle(this.displayWidth/2,{label:this.name}),this.setSensor(!0),me(this,!1)}}var fe,be;!function(t){t[t.hover=0]="hover",t[t.pinch=1]="pinch"}(fe||(fe={})),function(t){t[t.start=0]="start",t[t.continue=1]="continue",t[t.end=2]="end"}(be||(be={}));class we extends d{getFinger(t){const e=this.fingers.findIndex((e=>e.name==t));if(-1!==e)return this.fingers[e]}get observers(){return this.observers_}isObserver(t){return void 0!==this.observers_.find((e=>e.fingerName===t.fingerName&&e.object==t.object))}wasObserverHovering(t){return te(this.isObserver(t)),this.observers_.find((e=>e.fingerName===t.fingerName&&e.object==t.object)).wasHovering}setObserverHover(t,e){const s=this.observers_.findIndex((e=>e.fingerName===t.fingerName&&e.object==t.object));te(-1!==s,"Cannot set observer hover before observer is pushed"),this.observers_[s].wasHovering=e}pushNewObserversOnly(t){this.isObserver(t)||(this.observers.push(t),this.setObserverHover(t,!1))}removeObserver(t){const e=this.observers_.findIndex((e=>e.fingerName===t.fingerName&&e.object==t.object));e>-1&&this.observers_.splice(e,1)}constructor(t){super(t,"hand"),this.fingers=[],this.observers_=[],this.fingers=[],this.observers_=[];const e=(t,e)=>{const s=new ye(this.scene,y,t,e,.3*oe.fingerSize);return this.fingers.push(s),s},s=e(it,4),i=(e(nt,8),e("middle",12),e("ring",16),e("pinky",20),(t,e)=>{t((t=>{const i=this.getFinger(t.bodyB.label);if(void 0!==i)for(const t of this.observers)t.fingerName==i.name&&null!=t.object&&t.object.input&&t.object.input.enabled&&t.object.emit(i.name+fe.pinch+e);else if(t.bodyB.gameObject){const i=t.bodyB.gameObject;for(const n of this.fingers){if(n==s)continue;const a={object:i,fingerName:n.name};if(!this.isObserver(a))continue;const o=this.scene.matter.overlap(t.bodyB,[n]);if(e===be.start&&o)i.emit(n.name+fe.hover+be.start),this.setObserverHover(a,!0);else if(e===be.continue){const t=this.wasObserverHovering(a);o&&t?(i.emit(n.name+fe.hover+be.continue),this.setObserverHover(a,!0)):o&&!t?(i.emit(n.name+fe.hover+be.start),this.setObserverHover(a,!0)):!o&&t&&(i.emit(n.name+fe.hover+be.end),this.setObserverHover(a,!1))}else e===be.end&&this.wasObserverHovering(a)&&(i.emit(n.name+fe.hover+be.end),this.setObserverHover(a,!1))}}}))});i(s.setOnCollide.bind(s),be.start),i(s.setOnCollideActive.bind(s),be.continue),i(s.setOnCollideEnd.bind(s),be.end)}setFingerScale(t){for(const e of this.fingers)e.setScale(.3*t)}addPinchCheck(t,e,s){this.pushNewObserversOnly({object:e,fingerName:t});const i=t=>{const s=this.getFinger(it),i=this.getFinger(t);if(void 0===s)return!1;if(void 0===i)return!1;const n=this.scene.matter.overlap(e,[s]),a=this.scene.matter.overlap(e,[i]);return n&&a};null!=s.startPinch&&e.on(t+fe.pinch+be.start,(()=>{var e;i(t)&&(null===(e=s.startPinch)||void 0===e||e.call(s))})),null!=s.pinched&&e.on(t+fe.pinch+be.continue,(()=>{var e;i(t)&&(null===(e=s.pinched)||void 0===e||e.call(s))})),null!=s.endPinch&&e.on(t+fe.pinch+be.end,(()=>{var e;i(t)&&(null===(e=s.endPinch)||void 0===e||e.call(s))})),null!=s.startHover&&e.on(t+fe.hover+be.start,(()=>{var t;null===(t=s.startHover)||void 0===t||t.call(s)})),null!=s.hovering&&e.on(t+fe.hover+be.continue,(()=>{var t;null===(t=s.hovering)||void 0===t||t.call(s)})),null!=s.endHover&&e.on(t+fe.hover+be.end,(()=>{var t;null===(t=s.endHover)||void 0===t||t.call(s)}))}removePinchCheck(t,e){this.removeObserver({fingerName:t,object:e}),e.off(t+fe.pinch+be.start),e.off(t+fe.pinch+be.continue),e.off(t+fe.pinch+be.end),e.off(t+fe.hover+be.start),e.off(t+fe.hover+be.continue),e.off(t+fe.hover+be.end)}update(){this.observers_=this.observers_.filter((t=>null!=t)),ge.update();const t=this.scene.matter.add.circle(this.scene.input.mousePointer.x,this.scene.input.mousePointer.y,1,{circleRadius:1,isSensor:!0,render:{visible:!1}});for(const e of this.fingers){const s=ge.getLandmarkPosition(e.landmarkIndex),i=void 0!==s;if(i&&e.setPosition(s.x,s.y),me(e,i),!i&&null!=t)for(const s of this.observers)null!=t&&null!=s.object&&s.object.active&&null!=this.scene&&(s.object.emit(e.name+fe.pinch+be.end),this.scene.matter.overlap(t,[s.object])||s.object.emit(e.name+fe.hover+be.end))}this.scene.matter.world.remove(t)}calculateHandDistance(t=0){const e=ge.getLandmarkPosition(5,t),s=ge.getLandmarkPosition(17,t),i=ge.getLandmarkPosition(0,t);let n=0,a=0;const o=innerWidth*innerHeight;if(void 0!==e&&void 0!==s){const t=new r((e.x+s.x)/2,(e.y+s.y)/2);n=Math.sqrt(Math.pow((s.x-e.x)/o,2)+Math.pow((s.y-e.y)/o,2)),void 0!==i&&(a=Math.sqrt(Math.pow((i.x-t.x)/o,2)+Math.pow((i.y-t.y)/o,2)))}return 0==n||0==a?0:8.2*.7/Math.max(n/8.2,a/10)/o*100}}const Te=new Set([[0,1],[0,5],[9,13],[13,17],[5,9],[0,17],[1,2],[2,3],[3,4],[5,6],[6,7],[7,8],[9,10],[10,11],[11,12],[13,14],[14,15],[15,16],[17,18],[18,19],[19,20]]);class xe extends p{constructor(t){super(t)}preload(){}create(t=oe.enableCameraVisibility,e=oe.cameraOpacity){ce.setVisibility(t),ve.setVisible(!0),this.clearBackgroundTint(),this.setBackgroundTexture(C),this.setOpacity(e),this.sound.pauseOnBlur=!1,this.graphics=this.add.graphics(),this.graphics.setDepth(99),this.hand=new we(this)}update(t,e){this.graphics.clear(),this.hand.update(),function(t,e,s=0){t.setDepth(99),ge.forEachLandmarkPosition((s=>{t.lineStyle(e.lineWidth,e.color,e.alpha),t.strokeCircle(s.x,s.y,e.radius)}),s)}(this.graphics,st,0),function(t,e,s=0){t.setDepth(98),Te.forEach((i=>{const n=ge.getLandmarkPosition(i[0],s);if(void 0!==n){const a=ge.getLandmarkPosition(i[1],s);void 0!==a&&(t.lineStyle(e.lineWidth,e.color,e.alpha),t.lineBetween(n.x,n.y,a.x,a.y))}}))}(this.graphics,et,0),ve.setDisplaySize(document.body.clientWidth,document.body.clientHeight+1)}setOpacity(t){null!=t&&(te(t>=0&&t<=1),ve.setAlpha(1-t))}setBackgroundTexture(t){ve.setTexture(t)}setBackgroundTint(t){ve.setTint(t)}clearBackgroundTint(){ve.clearTint()}}class ke extends v{constructor(t,e,s,i,n,a){super(t.matter.world,e.x,e.y,i,void 0,{render:{visible:!0},label:"button-"+i}),this.scene=t,this.scene.add.existing(this),this.sound=this.scene.sound.add(n,{volume:oe.sonificationLevel}),this.setSensor(!0),this.setOrigin(.5,.5),this.setScale(s.x,s.y),this.setDepth(93),me(this,a),this.on("destroy",(()=>{this.scene.hand.removePinchCheck(at,this)}))}removePinchCallbacks(){this.scene.hand.removePinchCheck(at,this)}addPinchCallbacks(t){const e={startPinch:()=>{var e;null===(e=t.startPinch)||void 0===e||e.call(t),this.sound.play({volume:oe.sonificationLevel})},pinched:t.pinched,endPinch:t.endPinch,startHover:t.startHover,endHover:t.endHover};this.scene.hand.addPinchCheck(at,this,e),this.on("pointerdown",e.startPinch),e.startHover&&this.on("pointermove",e.startHover),e.endHover&&this.on("pointerout",e.endHover)}}class Se{constructor(t){this.trackKey=Qt,this.bpm=0,this.beatLength_=1,this.trackKey=t}get beatLength(){return this.beatLength_}setBPM(t){te(null!=this.data,"preload JSON before setting BPM"),te(t{e.nodes.forEach(((s,i)=>{const n=this.getSoundKey(e,s.soundKey),a=this.trackDir+e.id+"/"+s.soundKey+Q;t.cache.audio.exists(n)||""===s.soundKey||t.load.audio(n,se(a))}))}))}unloadNotes(t){this.forEachLayer(void 0,(e=>{e.nodes.forEach(((s,i)=>{t.cache.audio.remove(this.getSoundKey(e,s.soundKey))}))}))}preloadLoops(t){this.forEachLayer((e=>{te(void 0!==e.soundLoopKeys),te(e.soundLoopKeys.length>0),e.soundLoopKeys.forEach((s=>{const i=this.getSoundKey(e,s),n=this.trackDir+e.id+"/"+s+Q;t.cache.audio.exists(i)||""===s||t.load.audio(i,se(n))}))}))}unloadLoops(t){this.forEachLayer((e=>{e.soundLoopKeys.forEach((s=>{t.cache.audio.remove(this.getSoundKey(e,s))}))}))}getSoundKey(t,e){return te(void 0!==e),this.trackKey+"/"+t.id+"/"+e}forEachLayer(t,e){te(null!=this.data,"JSON has not finished preloading");let s=0;this.data.layers.forEach(((i,n)=>{i.playable||s++,null==t||t(i,n),i.playable&&(null==e||e(i,n-s))}))}addBackgroundAudioTracks(t,e,s,i){const n=[];return this.forEachLayer(((a,o)=>{(null==i||i(a,o))&&(te(void 0!==a.soundLoopKeys),te(s{this.data=i,this.parseJson(),this.preloadLoops(t)};t.cache.json.exists(this.trackKey)?s(0,0,t.cache.json.get(this.trackKey)):(t.load.json(this.trackKey,se(e+"info.json")),t.load.on("filecomplete-json-"+this.trackKey,s,this))}unloadJson(t){this.unloadLoops(t),t.cache.json.remove(this.trackKey)}parseJson(){this.setTimePositionDefaults(),this.sortNodes()}setTimePositionDefaults(){this.forEachLayer(void 0,(t=>{const e=(t,e,s,i)=>{t.bar||(t.bar=e),t.step||(t.step=s),t.tick||(t.tick=i)};te(t.progressCount<=t.nodes.length,"Progress count threshold for layer '"+t.id+"' of track '"+this.trackKey+"' cannot be higher than the node count."),e(t.previewTime,0,0,0),t.nodes.forEach((t=>{e(t.timePosition,1,1,0)}))}))}sortNodes(){this.forEachLayer(void 0,(t=>{t.nodes.sort(((t,e)=>t.timePosition.bar!==e.timePosition.bar?t.timePosition.bar-e.timePosition.bar:t.timePosition.step!==e.timePosition.step?t.timePosition.step-e.timePosition.step:t.timePosition.tick-e.timePosition.tick))}))}}class Pe extends v{static preload(t){t.load.image(ht,se(ct)),t.load.image(lt,se("assets/sprites/defaultTargetOuter.png"))}static unload(t){t.textures.remove(ht),t.textures.remove(lt)}constructor(t,e,s,i,n,a,o,r){super(t.matter.world,s.x,s.y,a.data.spriteKeyInner,void 0,{render:{visible:!0}}),this.scene=t,this.lifetime=i,this.fingerId=o,this.nodeIndex=r,this.spriteScale=oe.targetSize,this.scene.add.existing(this),this.songTime=this.lifetime+e,this.lateDuration=oe.lateTimeDuration,this.onTimeDuration=oe.onTimeDuration,this.earlyDuration=this.lifetime-this.onTimeDuration/2,this.sound=this.scene.sound.add(n,{volume:oe.sonificationLevel}),this.setScale(this.spriteScale),this.setTint(tt[this.fingerId]),this.setDepth(95),me(this,!0),this.setCircle(this.displayWidth/2,{label:a.level.trackKey+"-"+a.data.id+"-node-"+r.toString()}),this.setSensor(!0),oe.fancyEffectsDisabled||(this.glow=this.postFX.addGlow(16777215,0,0,!1,.05,24)),this.outerRing=this.scene.add.sprite(s.x,s.y,a.data.spriteKeyOuter),this.outerRing.setScale(.5*this.spriteScale),this.outerRing.setDepth(96),this.targetText=new g(this.scene,0,0,Qt,{}),this.addTargetText(),this.setupTweens()}setOnTargetMiss(t){this.onTargetMiss=t}setOnTargetHit(t){this.scene.hand.addPinchCheck(this.fingerId,this,{startPinch:t}),this.once("pointerdown",t)}addTargetText(){this.targetText=this.scene.add.text(this.x,this.y,(this.nodeIndex+1).toString(),{font:"20px Arial",color:"white"}),this.targetText.setOrigin(.5,.5),this.targetText.setDepth(97)}createTween(t,e,s){for(const s of t)s.tint=e.color;return this.scene.tweens.add({targets:t,displayWidth:this.displayWidth*e.scale,displayHeight:this.displayHeight*e.scale,ease:e.ease,duration:s,repeat:0})}setupTweens(){oe.fancyEffectsDisabled||(this.rotateTween=this.scene.tweens.add({targets:[this],rotation:2*Math.PI,ease:"linear",duration:1e3,repeat:-1})),this.earlyTween=this.createTween([this.outerRing],dt,this.earlyDuration),this.earlyTween.on("complete",(()=>{this.onTimeTween=this.createTween([this],Object.assign(Object.assign({},ut),{scale:1}),this.onTimeDuration),oe.fancyEffectsDisabled||null==this.glow||(this.glowTween=this.scene.tweens.add({targets:this.glow,outerStrength:4,yoyo:!0,duration:this.onTimeDuration/2,ease:"linear"})),this.onTimeTween.on("complete",(()=>{null!=this.glow&&this.glow.destroy(),this.lateTween=this.createTween([this,this.outerRing],Object.assign(Object.assign({},gt),{scale:1}),this.lateDuration),this.lateTween.on("complete",(()=>{me(this,!1),this.deathTween=this.createTween([this,this.outerRing,this.targetText],pt,400),null!=this.onTargetMiss&&this.deathTween.on("complete",this.onTargetMiss)}))}))}))}destroyTarget(){this.scene.hand.removePinchCheck(this.fingerId,this),this.off("pointerdown"),null!=this.rotateTween&&this.scene.tweens.remove(this.rotateTween),null!=this.earlyTween&&this.scene.tweens.remove(this.earlyTween),null!=this.onTimeTween&&this.scene.tweens.remove(this.onTimeTween),null!=this.lateTween&&this.scene.tweens.remove(this.lateTween),null!=this.deathTween&&this.scene.tweens.remove(this.deathTween),null!=this.glowTween&&this.scene.tweens.remove(this.glowTween),null!=this.glow&&this.glow.destroy(),null!=this.targetText&&this.targetText.destroy(),this.outerRing.destroy(),this.destroy()}}class Le extends d{constructor(t){super(t,"metronome"),this.beat=0,this.timer=new c({}),this.countdownText=this.scene.add.text(St.position.x,St.position.y,Qt,{font:St.font,color:St.color}).setOrigin(.5,.5).setScale(St.scale).setDepth(St.depth),this.setVisible(!1)}preload(){this.scene.load.image(kt,se("assets/sprites/countdown.png")),this.scene.load.audio(Tt,se("assets/sounds/metronome/high.ogg")),this.scene.load.audio(xt,se("assets/sounds/metronome/low.ogg"))}unload(){this.scene.cache.audio.remove(Tt),this.scene.cache.audio.remove(xt)}setup(){this.countdownTexture=this.scene.add.sprite(St.position.x,St.position.y,kt).setScale(1).setVisible(!1).setOrigin(.5,.5).setAlpha(.3).setDepth(30)}setVisible(t){null!=this.countdownText&&this.countdownText.setVisible(t),null!=this.countdownTexture&&this.countdownTexture.setVisible(t)}stop(){this.setVisible(!1),null!=this.scene&&(this.scene.time.removeEvent(this.timer),this.scene.sound.stopByKey(Tt),this.scene.sound.stopByKey(xt),null!=this.shrinkTween&&this.scene.tweens.remove(this.shrinkTween))}play(t,e,s){this.beat=0,this.stop(),this.timer=this.scene.time.addEvent({callback:this.tick.bind(this,t,e,s),delay:e,loop:!0,startAt:e})}tick(t,e,s){te(s>=1,"Cannot display metronome for less than minimum bar count");const i=t*s,n=this.beat%t,a=0==n?Tt:xt;this.beat>=i?this.setVisible(!1):(this.countdownText.active&&this.scene.sound.play(a,{volume:oe.backgroundMusicLevel}),te(i-t>=0),this.beat>=i-t&&this.countdownText.active&&!oe.disableVisualMetronome&&this.display(n+1,e),this.beat++)}display(t,e){this.countdownText.setText(t.toString()),this.countdownText.setScale(St.scale),this.countdownTexture.setScale(1),this.setVisible(!0),this.shrinkTween=this.scene.tweens.add({targets:[this.countdownText,this.countdownTexture],ease:St.ease,duration:.9*e,scale:0,repeat:0})}}class Ce extends h{constructor(t){super(t),this.current_=0,this.requiredProgress=-1,this.nodeCount=1,this.tints=[],te(this.current_>=0),this.tints=[],this.scene.add.existing(this),this.setVisible(!1)}preload(){this.scene.load.image(wt.key,se(wt.path))}setup(t,e,s,i){te(s<=e),te(i.length===e,"Must pass tints equal in number to nodes"),te(e>0),te(s>0),te(t>=0),this.current_=t,this.nodeCount=e,this.tints=i,this.requiredProgress=s;const n=wt.size.x/this.nodeCount;this.clear(),this.createMultiple({quantity:this.nodeCount,key:wt.key,visible:!0,setXY:{x:wt.position.x-wt.size.x/2+n/2,y:wt.position.y+wt.size.y/2,stepX:n}}),this.propertyValueSet("displayWidth",n),this.propertyValueSet("displayHeight",wt.size.y),this.setDepth(61),this.redraw()}setToStarting(){this.current_=0,te(this.current_>=0),this.redraw()}redraw(){if(this.current<=this.nodeCount){this.getChildren().forEach(((t,e)=>{t.clearTint()}));const t=-1===this.requiredProgress?this.nodeCount:this.requiredProgress-1,e=this.current;this.getChildren().forEach(((s,i)=>{const n=s;wt.tintByNode&&n.setTint(this.tints[i]),it?n.setTint(wt.completedRequiredTint):n.setTint(wt.requiredTint))}),this)}}canProgress(){const t=-1===this.requiredProgress;return t&&this.current>=this.nodeCount||!t&&this.current>=this.requiredProgress}changeBy(t){this.current_=Math.max(0,Math.min(this.current+t,this.nodeCount))}get current(){return this.current_}}class Be extends d{constructor(t,e){super(t,"infoHUD"),this.scene=t,this.level=e}setup(){this.addTexts(),this.addSkipButton(),this.setVisible(!1)}addSkipButton(){this.skipButton=new ke(this.scene,Lt.position,Lt.scale,Lt.textureKey,Lt.soundKey,!1),this.skipButton.addPinchCallbacks({startPinch:()=>{me(this.skipButton,!1),this.level.transitionLayers()},startHover:()=>{this.skipButton.setTintFill(ot)},endHover:()=>{this.skipButton.clearTint()}}),this.updateSkipButtonAvailability(!1)}preload(){this.scene.load.image(Lt.textureKey,se(Lt.path)),this.scene.load.image(Pt.textureKey,se(Pt.path))}setVisible(t){null!=this.trackText&&this.trackText.setVisible(t),null!=this.difficultyText&&this.difficultyText.setVisible(t),null!=this.bpmText&&this.bpmText.setVisible(t),null!=this.layerText&&this.layerText.setVisible(t),null!=this.loopText&&this.loopText.setVisible(t),null!=this.infoBackground&&this.infoBackground.setVisible(t),this.updateSkipButtonAvailability(t)}addText(t,e){return this.scene.add.text(t.position.x,t.position.y,e,{font:t.font,color:t.color}).setScale(t.scale).setDepth(t.depth)}getLoopText(){return"Loop: "+this.level.score.getLoopCount().toString()}addTexts(){this.loopText=this.addText(Ht,this.getLoopText());const t="Track: "+this.level.track.data.displayName;this.trackText=this.addText(Ct,t);const e="Layer: "+(this.level.activeLayerIndex+1).toString()+"/"+this.level.playableLayers.length.toString();let s=Qt;switch(this.level.bpmIndex){case 0:s="Easy";break;case 1:s="Medium";break;case 2:s="Hard"}te(s!=Qt,"Extend the switch statement to have a difficulty text for the given track bpmIndex"),this.difficultyText=this.addText(Bt,"Difficulty: "+s),this.bpmText=this.addText(Dt,"BPM: "+this.level.track.getBPM()),this.layerText=this.addText(Ot,e),this.infoBackground=this.scene.add.sprite(Pt.position.x,Pt.position.y,Pt.textureKey).setAlpha(Pt.opacity).setOrigin(0,0).setDisplaySize(Pt.size.x,Pt.size.y)}updateLoopText(){this.loopText.setText(this.getLoopText()),this.updateSkipButtonAvailability(!0)}updateSkipButtonAvailability(t){const e=oe.enableSkipButton&&this.level.score.getLoopCount()>=oe.skipLoopThreshold&&t;null!=this.skipButton&&me(this.skipButton,e)}}class De{constructor(){this.targets=[]}start(){this.destroyTargets()}destroyTarget(t){t.destroyTarget();const e=this.targets.indexOf(t,0);e>-1&&this.targets.splice(e,1)}destroyTargets(){const t=[...this.targets];for(const e of t)this.destroyTarget(e)}addTarget(t){this.targets.push(t)}getPreviousTargets(t){return this.targets.filter((e=>e.songTime{const i=oe.indexFingerOnly?nt:t.finger;s.push(tt[i])})),this.progress.setup(0,this.data.nodes.length,this.data.progressCount,s),this.metronome.setup(),this.infoHud.setup(),this.progress.setVisible(!0),this.infoHud.setVisible(!0),this.metronome.play(this.level.track.data.timeSignatureNumerator,this.level.track.beatLength,e)}createTarget(t,e,s){const i=oe.indexFingerOnly?nt:t.finger,n=new Pe(this.scene,this.songTime_,ne(t.normalizedPosition),this.getPreviewTime(),this.level.track.getSoundKey(this.data,t.soundKey),this,i,s);n.setOnTargetMiss((()=>{this.level.score.missedPinch(n),this.progress.changeBy(-1),this.progress.redraw(),this.level.streak.stop(),this.targetManager.destroyTarget(n),this.checkForTransition(e,s)})),n.setOnTargetHit((()=>{const t=this.targetManager.getPreviousTargets(n);for(const e of t)te(e!=n),this.progress.changeBy(-1),this.level.score.skippedPinch(e),this.targetManager.destroyTarget(e);t.length>0&&this.level.streak.stop();const i=this.songTime-n.songTime,a=n.onTimeDuration/2,o=i>a;i<-a?(this.level.streak.stop(),this.progress.changeBy(0),this.level.score.earlyPinch(n,this.songTime)):o?(this.level.streak.stop(),this.progress.changeBy(0),this.level.score.latePinch(n,this.songTime)):(this.level.streak.changeBy(1),this.progress.changeBy(1),this.level.score.onTimePinch(n,this.songTime,this.level.streak.current)),this.progress.redraw(),this.level.streak.check(),oe.disableSonification||n.sound.play({volume:oe.sonificationLevel}),this.targetManager.destroyTarget(n),this.checkForTransition(e,s)})),this.targetManager.addTarget(n)}checkForTransition(t,e){e==this.data.nodes.length-1&&this.level.activeLayerIndex==t&&(oe.enableAutoSkip&&this.level.score.getLoopCount()>=oe.autoSkipThreshold||this.progress.canProgress()&&!oe.disableLayerProgression?this.level.transitionLayers():(this.level.score.incrementLoopCount(),this.progress.setToStarting(),this.infoHud.updateLoopText(),oe.autoSaveCSV&&this.level.score.levelStats))}handleTargetCreation(){if(!this.ready)return;const t=this.getDuration();let e=this.songTime_+this.getPreviewTime();if(this.songTime_>0&&(e%=t),this.data.nodes.length<=this.nextNodeIndex){if(!(e1?this.continue():this.stop()}updateStreakText(){this.streakText.setText("Streak: "+this.current_.toString())}start(){this.updateStreakText(),this.streakText.setVisible(!0)}stop(){this.current_=0,this.onFire=!1,null!=this.onFireTween&&this.scene.tweens.remove(this.onFireTween),null!=this.streakText&&this.streakText.clearTint(),null!=this.streakText&&this.streakText.setVisible(!1),null!=this.flame&&this.flame.destroy()}continue(){this.updateStreakText();const t=this.onFire;this.onFire=this.current_>=2,!t&&this.onFire&&(te(!0,"Streak color wheel extent must be from 1 to 255"),this.onFireTween=this.scene.tweens.addCounter({from:0,to:30,duration:1e3,yoyo:!0,onUpdate:t=>{if(null!=this&&null!=this.hsv){const e=Math.floor(t.getValue()),s=this.hsv[e].color,i=this.hsv[30-e].color;null!=this.streakText&&this.streakText.setTint(s,s,i,i)}},onStop:()=>{null!=this.onFireTween&&this.scene.tweens.remove(this.onFireTween)}}),oe.fancyEffectsDisabled||(null!=this.flame&&this.flame.destroy(),null!=this.streakText&&(this.flame=this.scene.add.particles(this.streakText.x,this.streakText.y,bt,ft),te(0!=yt.depth),this.flame.setDepth(yt.depth-1))))}}class Me{constructor(){this.total=1,this.required=1,this.correct=0,this.early=0,this.late=0,this.miss=0,this.loop=1,this.hits=[]}}class Ve{constructor(t){this.maxStreak=0,this.layersStats=[],this.id=`${t.data.displayName.replace(/\s/g,"")}@${t.getBPM()}bpm_${(new Date).toLocaleString("en-GB").replace(/\s/g,"").replace(/,/g,"_").replace(/[:/]/g,"-")}`}}class Ie{constructor(t){this.levelStats=new Ve(t),this.layerStats=new Me}getLoopCount(){return this.layerStats.loop}incrementLoopCount(){this.layerStats.correct=0,this.layerStats.early=0,this.layerStats.late=0,this.layerStats.miss=0,this.layerStats.loop++}saveLayerScores(){this.levelStats.layersStats.push(this.layerStats)}resetLayerScores(t,e){this.layerStats=new Me,this.layerStats.total=t,this.layerStats.required=e}addHit(t,e,s){this.layerStats.hits.push({loopNumber:this.getLoopCount(),noteID:t.nodeIndex+1,correctTime:t.songTime+this.delay,playerTime:e,classification:s})}onTimePinch(t,e,s){this.addHit(t,e+this.delay,"correct"),this.layerStats.correct++,this.levelStats.maxStreak=Math.max(s,this.levelStats.maxStreak)}earlyPinch(t,e){this.addHit(t,e+this.delay,"early"),this.layerStats.early++}latePinch(t,e){this.addHit(t,e+this.delay,"late"),this.layerStats.late++}skippedPinch(t){this.addHit(t,-1e3,"skipped"),this.layerStats.miss++}missedPinch(t){this.addHit(t,-1e3,"missed"),this.layerStats.miss++}}class Ae{constructor(t){this.trackKey_=Qt,this.finishCallback=()=>{},this.abortCallback=()=>{},this.activeLayerIndex=0,this.playableLayers=[],this.activeAudioTracks=[],this.bpmIndex_=-1,this.trackKey_=t,this.track=new Se(this.trackKey_)}setBPM(t){te(-1!=t,"BPM must be set before starting the level"),this.track.setBPM(t),this.bpmIndex_=t}get bpmIndex(){return this.bpmIndex_}get trackKey(){return this.trackKey_}init(t){this.scene=t,this.streak=new _e(this.scene),this.score=new Ie(this.track),this.preloadLayers()}hasCustomBackground(){return ie(U+this.getBackgroundTextureKey())}hasPreviewVideo(){return ie(U+this.getPreviewVideoKey())}getBackgroundTextureKey(){return this.trackKey+"/background.png"}getPreviewVideoKey(){return this.trackKey+"/preview.mp4"}preloadTrack(t){const e=U+this.getPreviewVideoKey(),s=U+this.getBackgroundTextureKey();ie(e)&&t.load.video(this.getPreviewVideoKey(),se(e),!0),ie(s)&&t.load.image(this.getBackgroundTextureKey(),se(s)),this.track.preload(t)}unloadTrack(t){this.track.unload(t)}preloadLayers(){this.track.preloadNotes(this.scene),Pe.preload(this.scene),this.streak.preload(),this.playableLayers=[],this.track.forEachLayer(void 0,((t,e)=>{const s=new He(this.scene,this,t);s.preload(),this.playableLayers.push(s)}))}unloadLayers(){this.playableLayers.forEach((t=>{t.unload()})),this.track.unloadNotes(this.scene),Pe.unload(this.scene),this.streak.unload()}start(t,e){this.activeLayerIndex=0,this.removeBackgroundAudio(this.scene),this.playableLayers.forEach((t=>{t.stop()})),this.streak.stop(),this.setBPM(this.bpmIndex_),this.finishCallback=t,this.abortCallback=e,this.scene.time.delayedCall(1e3,(()=>{this.startLayer()}))}addBackgroundAudio(t,e,s){te(-1!=this.bpmIndex_,"Set BPM before adding background audio to level"),this.removeBackgroundAudio(t),this.activeAudioTracks=this.track.addBackgroundAudioTracks(t,e,this.bpmIndex_,s)}removeBackgroundAudio(t){this.activeAudioTracks.forEach((e=>{e.stop(),t.sound.remove(e)})),this.activeAudioTracks=[]}playBackgroundAudio(){this.activeAudioTracks.forEach((t=>{t.setMute(!1),t.play()}))}setBackgroundAudioMute(t){this.activeAudioTracks.forEach((e=>{e.setMute(t)}))}startLayer(){const t=this.getActiveLayer(),e=this.activeLayerIndex;this.score.resetLayerScores(t.data.nodes.length,t.data.progressCount);const s=this.track.songTimePositionToTime({bar:2,step:1,tick:0}),i=Math.max(s,t.getPreviewTime());t.start(i);const n=[...t.data.backgroundLayers];oe.disableSonification&&n.push(t.data.id),this.addBackgroundAudio(this.scene,{loop:!0,volume:oe.backgroundMusicLevel},((t,e)=>n.includes(t.id))),this.scene.time.delayedCall(i,(()=>{this.activeLayerIndex==e&&this.playBackgroundAudio()}))}getActiveLayer(){return te(this.activeLayerIndex=this.playableLayers.length)return this.score.saveLayerScores(),t.postDelayStop(),void this.end();this.scene.time.delayedCall(1e3,(()=>{this.activeLayerIndex==e&&(this.score.saveLayerScores(),t.postDelayStop(),this.startLayer())}))}}stop(){this.removeBackgroundAudio(this.scene),this.streak.stop(),this.unloadLayers()}end(){this.stop(),this.finishCallback()}abort(){this.stop(),this.abortCallback()}update(t){this.activeLayerIndex{this.bpmText.destroy()}))}updateTint(){this.toggleState?(this.bpmText.setTintFill(rt),this.setTintFill(rt)):(this.bpmText.setTintFill(this.bpmTextOptions.color),this.clearTint())}get bpmIndex(){return this.bpmIndex_}}var Ke=n().Math.Vector2,je=n().Math.RoundTo;class Ne extends l{constructor(t,e,s,i,n,a,o,r){super(t),this.isDragging=!1,this.range=new Ke(0,1),this.isInteger=!1,this.x=e.x,this.y=e.y,this.width=s.x,this.height=s.y,this.key=a,this.updateSliderCallback=r,this.range=o,this.value=.5,this.box=new u(0,0,s.x,s.y),this.handle=new u(0,0,s.y,s.y),this.updateHandle(),null!=i&&(this.label=this.scene.add.text(this.x+i.x,this.y+i.y,Qt,{color:"#ffffff",fontSize:"24px"})),this.setInteractive(this.box,u.Contains),this.on("pointerdown",this.startDrag,this),this.scene.input.on("pointerup",this.stopDrag,this),this.scene.input.on("pointermove",this.doDrag,this),te("number"==typeof n[this.key]),this.setValue(n[this.key]),this.draw()}reset(t){te("number"==typeof t[this.key]),this.setValue(t[this.key]),this.draw()}startDrag(){this.isDragging=!0}doDrag(t){this.isDragging&&(this.value=n().Math.Clamp((t.x-this.x-this.handle.width/2)/(this.width-this.handle.width),0,1),this.updateHandle(),this.draw())}stopDrag(){this.isDragging=!1}updateHandle(){this.handle.x=this.value*(this.width-this.handle.width)}draw(){this.clear(),null!=this.input&&(this.input.enabled||this.setInteractive(this.box,u.Contains),this.updateSliderCallback(this)),this.fillStyle(11184810),this.fillRectShape(this.box),this.fillStyle(16777215),this.fillRectShape(this.handle)}getStringValue(){const t=this.getValue();return this.isInteger?t.toFixed(0):t.toFixed(2)}getValue(){const t=this.value*(this.range.y-this.range.x)+this.range.x;return this.isInteger?je(t,0):t}setIsInteger(t){return this.isInteger=t,this.draw(),this}setValue(t){this.value=(t-this.range.x)/(this.range.y-this.range.x),this.updateHandle(),this.draw()}hide(t){return this.clear(),null!=this.input&&this.disableInteractive(),null!=this.label&&null!=this.label&&this.label.active&&(null!=t?this.label.setText(t):this.label.setText("")),this}}class We extends l{constructor(t,e,s,i,n,a,o,r){super(t),this.labelText=Qt,this.x=e.x,this.y=e.y,this.key=o,null!=i&&(this.labelText=n,this.label=this.scene.add.text(e.x+i.x,e.y+i.y,this.labelText,{color:"#ffffff",fontSize:"24px"})),this.toggleCallback=r,te("boolean"==typeof a[this.key]),this.isChecked_=a[this.key],this.box=new u(0,0,s,s),this.check=new u(.25*s,.25*s,.5*s,.5*s),this.setInteractive(this.box,u.Contains),this.toggleCallback(this),this.on("pointerdown",this.toggleCheck,this),this.draw()}reset(t){te("boolean"==typeof t[this.key]),this.isChecked_=t[this.key],this.toggleCallback(this),this.draw()}resetLabel(){null!=this.label&&this.label.setText(this.labelText)}setLabel(t){null!=this.label&&this.label.setText(t),this.draw()}toggleCheck(){this.isChecked_=!this.isChecked_,this.toggleCallback(this),this.draw()}draw(){this.clear(),null==this.input||this.input.enabled||this.setInteractive(this.box,u.Contains),this.lineStyle(2,16777215),this.strokeRectShape(this.box),this.isChecked_&&(this.fillStyle(16777215),this.fillRectShape(this.check))}setToggled(t){"boolean"==typeof t&&(this.isChecked_=t,this.toggleCallback(this),this.draw())}hide(){return this.clear(),this.disableInteractive(),null!=this.label&&this.label.setText(""),this}get isChecked(){return this.isChecked_}}var ze=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const Re=window.innerWidth,Ge=window.innerHeight,qe=.5*Re,$e=.1*Re,Je=.64*Re,Ue=.1*Ge,Xe=.08*Ge,Qe=.32*Ge,Ye=.08*Ge,Ze=.57*Ge,ts=.08*Ge,es=new r(.26*Re,.03*Ge),ss={type:n().WEBGL,scale:{mode:n().Scale.RESIZE},transparent:!0,physics:{default:"matter",matter:{debug:!1,gravity:{x:0,y:0}}},scene:[class extends p{constructor(){super("electron")}create(){return pe(this,void 0,void 0,(function*(){yield new Promise(((t,e)=>{t()})).then((()=>{this.scene.start(jt)}))}))}},class extends p{constructor(){super(jt)}preload(){this.load.image(y,se("assets/sprites/finger.png")),this.load.image(C,se("assets/ui/menu_background.png"))}create(){return pe(this,void 0,void 0,(function*(){ve=this.add.sprite(0,0,C).setOrigin(0,0).setAlpha(.9).setDisplaySize(window.innerWidth,window.innerHeight);const t=this.add.text(this.cameras.main.worldView.x+this.cameras.main.width/2,this.cameras.main.worldView.y+this.cameras.main.height/2,"",mt).setShadow(1,1).setDepth(1e3).setOrigin(.5);yield ce.init(Jt,this.updateText.bind(this,t)).catch((e=>{this.updateText(t,e)})),ce.found()&&(this.updateText(t,"Loading config data..."),yield he(Y),yield ge.init(this.updateText.bind(this,t)).catch((e=>this.updateText(t,e))),ge.found()&&(ce.setVisibility(Jt.visible),this.scene.launch($t),ge.precache(this.updateText.bind(this,t)),this.updateText(t,"Loading game..."),this.scene.get($t).load.on("complete",(()=>{t.destroy()}))))}))}updateText(t,e){console.info("INFO: "+e);let s=e;e instanceof DOMException&&(s="NotFoundError"==e.name?"Webcam not found":"PermissionError"==e.name?"Permission denied":"NotADirectoryError"==e.name?e.message:e.name+": "+e.message),t.setText(s)}},class extends xe{constructor(){super(zt),this.levels=[]}preload(){const t=Object.create(null,{preload:{get:()=>super.preload}});return e=this,s=void 0,n=function*(){t.preload.call(this),this.load.audio(M,se(q)),this.load.image(I,se("assets/ui/menu_logo.png")),this.load.image(S,se("assets/ui/menu_options.png")),this.load.image(k,se("assets/ui/menu_select_level.png")),this.load.image(x,se("assets/ui/menu_setup_camera.png")),yield function(t){return new Promise(((e,s)=>Yt(this,void 0,void 0,(function*(){yield Zt(se(t)).then((t=>{e(t)})).catch((()=>{s([])}))}))))}(se(X)).then((t=>{t.forEach(((t,e)=>{this.levels.push(new Ae(t))})),this.levels.forEach((t=>{t.preloadTrack(this)}))}))},new((i=void 0)||(i=Promise))((function(t,a){function o(t){try{h(n.next(t))}catch(t){a(t)}}function r(t){try{h(n.throw(t))}catch(t){a(t)}}function h(e){var s;e.done?t(e.value):(s=e.value,s instanceof i?s:new i((function(t){t(s)}))).then(o,r)}h((n=n.apply(e,s||[])).next())}));var e,s,i,n}create(){super.create(),this.levels.forEach((t=>{t.setBPM(0)}));const t=window.innerWidth,e=window.innerHeight,s=.5*t;this.menuCalibrate=new ke(this,new r(s-.25*t,Kt*e),Mt,x,M,!0),this.levels.length>0&&(this.menuSelectLevel=new ke(this,new r(s,Kt*e),Mt,k,M,!0),this.menuSelectLevel.addPinchCallbacks({startPinch:()=>{this.scene.start(Rt,this.levels)},startHover:()=>{this.menuSelectLevel.setTintFill(ot)},endHover:()=>{this.menuSelectLevel.clearTint()}})),this.menuOptions=new ke(this,new r(s+.25*t,Kt*e),Mt,S,M,!0),this.menuLogo=this.add.sprite(0,0,I).setOrigin(0,0).setScale(.7,.7),this.menuLogo.setPosition(s-this.menuLogo.displayWidth/2,.25*e),this.menuCalibrate.addPinchCallbacks({startPinch:()=>{this.scene.start(Gt)},startHover:()=>{this.menuCalibrate.setTintFill(ot)},endHover:()=>{this.menuCalibrate.clearTint()}}),this.menuOptions.addPinchCallbacks({startPinch:()=>{this.scene.start(qt)},startHover:()=>{this.menuOptions.setTintFill(ot)},endHover:()=>{this.menuOptions.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(qt),this.options=[],he(Y).then((t=>ze(this,void 0,void 0,(function*(){this.configData=t,yield he(Z).then((t=>{this.defaultData=t}))}))))}saveAndExit(){var t;t=this.configData,se(Y),JSON.stringify(t),re(t),ce.setVisibility(this.configData.enableCameraVisibility),null!=this.rotateTween&&this.rotateTween.destroy(),this.scene.start(zt)}preload(){return ze(this,void 0,void 0,(function*(){this.load.audio(M,se(q)),this.load.image(L,se("assets/ui/options_background.png")),this.load.image(_,se(G)),this.load.image(A,se("assets/ui/reset_button.png")),this.load.image(P,se(R))}))}create(){const t=Object.create(null,{create:{get:()=>super.create}});return ze(this,void 0,void 0,(function*(){t.create.call(this),this.createOptions()}))}createOptions(){this.backToMenu=new ke(this,new r(qe-.1*Re,.9*Ge),Mt,_,M,!0),this.resetConfig=new ke(this,new r(qe+.1*Re,.9*Ge),Mt,A,M,!0),this.input.keyboard.on(vt,(()=>{this.saveAndExit()})),this.add.sprite(.09*Re,.05*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.185*Ge),this.add.sprite(.09*Re,.26*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.27*Ge),this.add.sprite(.09*Re,.55*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.23*Ge),this.add.sprite(.63*Re,.05*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.185*Ge),this.add.sprite(.63*Re,.26*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.27*Ge),this.add.sprite(.63*Re,.55*Ge,L).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.23*Ge);const t=this.add.sprite(.5*Re,Ue+0*Xe+.15*Ge,P).setTint(tt[it]).setScale(this.configData.targetSize);this.rotateTween=this.tweens.add({targets:[t],rotation:2*Math.PI,ease:"Power0",duration:1e3,repeat:-1}),this.configData.fancyEffectsDisabled&&null!=this.rotateTween&&this.rotateTween.pause();const e=new Ne(this,new r($e,Ue+0*Xe),es,new r(0,At.y),this.configData,"targetSize",new r(.5,3),(e=>{e.label.setText("Target Scale: "+e.getStringValue());const s=e.getValue();this.configData[e.key]=s,t.setScale(s)}));this.options.push(e),this.add.existing(e);const s=new Ne(this,new r($e,Ue+1*Xe),es,new r(0,At.y),this.configData,"fingerSize",new r(.5,3),(t=>{null!=t.label&&t.label.setText("Finger Scale: "+t.getStringValue());const e=t.getValue();this.configData[t.key]=e,this.hand.setFingerScale(e)}));this.options.push(s),this.add.existing(s);const i=t=>{null!=t&&t.active&&(null!=t.label&&t.label.active&&t.label.setText("Camera Opacity: "+t.getStringValue()),this.configData[t.key]=t.getValue(),this.setOpacity(this.configData[t.key]))},n=new Ne(this,new r($e,Qe+0*Ye),es,At,this.configData,"cameraOpacity",new r(.01,1),i),a=new We(this,new r($e,Qe+0*Ye+It.y),25,void 0,Qt,this.configData,"enableCameraVisibility",(t=>{this.configData[t.key]=t.isChecked,ce.setVisibility(t.isChecked),t.isChecked?n.draw():(n.setValue(this.defaultData.cameraOpacity),i(n),this.setOpacity(0),n.hide("Show Camera"))}));this.options.push(n),this.options.push(a),this.add.existing(n),this.add.existing(a);const o=new Ne(this,new r($e,Qe+1*Ye),es,At,this.configData,"skipLoopThreshold",new r(1,16),(t=>{t.label.setText("Skip Button After Loop: "+t.getStringValue()),this.configData[t.key]=t.getValue()})).setIsInteger(!0),h=new We(this,new r($e,Qe+1*Ye+It.y),25,void 0,Qt,this.configData,"enableSkipButton",(t=>{this.configData[t.key]=t.isChecked,t.isChecked?o.draw():o.hide("Show Layer Skip Button")}));this.options.push(o),this.options.push(h),this.add.existing(o),this.add.existing(h);const l=new Ne(this,new r($e,Qe+2*Ye),es,At,this.configData,"autoSkipThreshold",new r(1,16),(t=>{t.label.setText("Skip Layers After Loop: "+t.getStringValue()),this.configData[t.key]=t.getValue()})).setIsInteger(!0),c=new We(this,new r($e,Qe+2*Ye+It.y),25,void 0,Qt,this.configData,"enableAutoSkip",(t=>{this.configData[t.key]=t.isChecked,t.isChecked?l.draw():l.hide("Skip Layers Automatically")}));this.options.push(l),this.options.push(c),this.add.existing(l),this.add.existing(c);const d=new We(this,new r($e,Ze+0*ts),25,new r(-It.x,0),"Disable Layer Progression",this.configData,"disableLayerProgression",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(d),this.add.existing(d);const u=new We(this,new r($e,Ze+1*ts),25,new r(-It.x,0),"Index Finger Pinches Only",this.configData,"indexFingerOnly",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(u),this.add.existing(u);const g=new We(this,new r($e,Ze+2*ts),25,new r(-It.x,0),"Disable Fancy Effects",this.configData,"fancyEffectsDisabled",(e=>{this.configData[e.key]=e.isChecked,e.isChecked?null!=this.rotateTween&&this.rotateTween.pause():e.isChecked||null!=this.rotateTween&&null!=t&&this.rotateTween.resume()}));this.options.push(g),this.add.existing(g);const p=new Ne(this,new r(Je,Ue+0*Xe),es,new r(0,At.y),this.configData,"onTimeDuration",new r(50,1e3),(t=>{t.label.setText("On Time Duration: "+t.getStringValue()+" ms"),this.configData[t.key]=t.getValue()})).setIsInteger(!0);this.options.push(p),this.add.existing(p);const v=new Ne(this,new r(Je,Ue+1*Xe),es,new r(0,At.y),this.configData,"lateTimeDuration",new r(50,1e3),(t=>{t.label.setText("Late Time Duration: "+t.getStringValue()+" ms"),this.configData[t.key]=t.getValue()})).setIsInteger(!0);this.options.push(v),this.add.existing(v);const m=new Ne(this,new r(Je,Qe+0*Ye),es,new r(0,At.y),this.configData,"sonificationLevel",new r(0,1),(t=>{t.label.setText("Pinch Volume: "+t.getStringValue()),this.configData[t.key]=t.getValue()}));this.options.push(m),this.add.existing(m);const y=new Ne(this,new r(Je,Qe+1*Ye),es,new r(0,At.y),this.configData,"backgroundMusicLevel",new r(0,1),(t=>{t.label.setText("Track Volume: "+t.getStringValue()),this.configData[t.key]=t.getValue()}));this.options.push(y),this.add.existing(y);const f=new We(this,new r(Je,Ze+0*ts),25,new r(-It.x,0),"Disable Visual Metronome",this.configData,"disableVisualMetronome",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(f),this.add.existing(f);const b=new We(this,new r(Je,Ze+1*ts),25,new r(-It.x,0),"Disable Sonification",this.configData,"disableSonification",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(b),this.add.existing(b),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.saveAndExit()},startHover:()=>{this.backToMenu.setTintFill(ot)},endHover:()=>{this.backToMenu.clearTint()}}),this.resetConfig.addPinchCallbacks({startPinch:()=>ze(this,void 0,void 0,(function*(){this.configData=yield he(Z);for(const t of this.options)t.reset(this.configData)})),startHover:()=>{this.resetConfig.setTintFill(ot)},endHover:()=>{this.resetConfig.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(Rt),this.currentLevelIndex=0,this.difficultyButtons=[],this.levels=[],te(this.currentLevelIndex>=0,"Level select default level must be >= 0")}preload(){this.levels=this.scene.settings.data,te(this.currentLevelIndex{this.scene.start(zt),this.exit()})),this.add.sprite(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,f).setScale(_t.x,_t.y).setOrigin(.5,.5),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.scene.start(zt),this.exit()},startHover:()=>{this.backToMenu.setTintFill(ot)},endHover:()=>{this.backToMenu.clearTint()}}),this.play.addPinchCallbacks({startPinch:()=>{this.startLevel(this.getCurrentLevel())},startHover:()=>{this.play.setTintFill(ot)},endHover:()=>{this.play.clearTint()}}),this.add.sprite(s,e*Et,b).setTintFill(0).setScale(.4,.4).setOrigin(.5,.5),this.songName=this.add.text(s,e*Et,Qt,{font:"50px Courier New"}).setColor("white").setOrigin(.5,.5),this.updateLevel(0),this.previousLevel.addPinchCallbacks({startPinch:()=>{this.updateLevel(-1)},startHover:()=>{this.previousLevel.setTintFill(ot)},endHover:()=>{this.previousLevel.clearTint()}}),this.nextLevel.addPinchCallbacks({startPinch:()=>{this.updateLevel(1)},startHover:()=>{this.nextLevel.setTintFill(ot)},endHover:()=>{this.nextLevel.clearTint()}}),this.muteButton.addToggleCallback((t=>{this.setBackgroundAudioMute(!t)})),this.muteButton.addPinchCallbacks({startPinch:()=>{this.muteButton.toggle()},startHover:()=>{this.muteButton.setTintFill(ot)},endHover:()=>{this.muteButton.clearTint()}})}exit(){this.stopAudio()}startLevel(t){this.exit(),this.scene.start(Nt,t)}createDifficultyButtons(t){const e=window.innerWidth,s=window.innerHeight,i=.5*e;for(const t of this.difficultyButtons)t.destroy();this.difficultyButtons=[];const n=t.track.data.bpm,a=[D,O,H],o=[new r(i-.2*e,Ft*s),new r(i,Ft*s),new r(i+.2*e,Ft*s)];te(a.length>=n.length,"buttonKeys array length must at least match the number of track bpms"),te(o.length>=n.length,"positions array length must at least match the number of track bpms");for(let e=0;e{c.updateTint(),e&&(t.setBPM(c.bpmIndex),this.startPreview(t))})),c.addPinchCallbacks({startPinch:()=>{for(const t of this.getDifficultyButtons())t!=c&&t.setToggleState(!1);c.setToggleState(!0)},startHover:()=>{c.setTintFill(ot)},endHover:()=>{c.updateTint()}}),this.difficultyButtons.push(c)}}getDifficultyButtons(){return this.difficultyButtons}setBackgroundAudioMute(t){for(const e of this.levels)e.setBackgroundAudioMute(t)}startVideo(t){if(null!=this.videoPreview&&this.videoPreview.destroy(),t.hasPreviewVideo()){this.videoPreview=this.add.video(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,t.getPreviewVideoKey()).setScale(_t.x,_t.y).setOrigin(.5,.5);const e=t.track.data.bpm[t.bpmIndex]/t.track.data.bpm[0];this.videoPreview.video&&(this.videoPreview.video.playbackRate=e),this.videoPreview.play(!0)}else this.videoPreview=this.add.sprite(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,z).setScale(_t.x,_t.y).setOrigin(.5,.5)}startPreview(t){this.stopAudio(),t.addBackgroundAudio(this,{loop:!0,volume:.5*oe.backgroundMusicLevel}),t.playBackgroundAudio(),t.setBackgroundAudioMute(!this.muteButton.getToggleState());const e=1e3*t.getAudioLoopTime();this.videoRefreshEvent=this.time.addEvent({delay:e,callback:()=>{this.startVideo(t)},callbackScope:this,loop:!0,startAt:e})}stopAudio(){this.videoRefreshEvent&&this.videoRefreshEvent.destroy();for(const t of this.levels)t.removeBackgroundAudio(this)}updateLevel(t){this.cycleLevel(t);const e=this.getCurrentLevel();this.songName.setText(e.track.data.displayName),this.startPreview(e),this.createDifficultyButtons(e)}cycleLevel(t){const e=this.levels.length;this.currentLevelIndex=((this.currentLevelIndex+t)%e+e)%e}getCurrentLevel(){return te(this.currentLevelIndex{this.level.abort()})),this.level.start((()=>{this.scene.start(Wt,this.level)}),(()=>{this.scene.start(zt)}))}update(t,e){super.update(t,e),this.level.update(t)}},class extends xe{constructor(){super(Wt)}exit(){this.level.removeBackgroundAudio(this),this.scene.start(zt)}preload(){this.load.audio(M,se(q)),this.load.image(_,se(G)),this.load.image(E,se($)),this.load.image(F,se(J)),this.load.image(N,se("assets/ui/save_csv_button.png")),this.load.image(w,se("assets/ui/layer_score_background.png")),this.load.image(T,se("assets/ui/scoreboard_background.png")),this.level=this.scene.settings.data,this.levelStats=this.level.score.levelStats,oe.autoSaveCSV&&this.level.score.levelStats}create(){super.create();const t=window.innerWidth,e=window.innerHeight,s=.5*t,i=Math.min(t/1920,e/1080);this.backToMenu=new ke(this,new r(s,.9*e),Mt,_,M,!0),this.muteButton=new Ee(this,new r(s+.45*t,.9*e),Vt,E,F,M,!0,!0),this.level.addBackgroundAudio(this,{loop:!0,volume:.5*oe.backgroundMusicLevel}),this.level.playBackgroundAudio(),this.muteButton.addToggleCallback((t=>{this.level.setBackgroundAudioMute(!t)})),this.muteButton.addPinchCallbacks({startPinch:()=>{this.muteButton.toggle()},startHover:()=>{this.muteButton.setTintFill(ot)},endHover:()=>{this.muteButton.clearTint()}}),this.input.keyboard.on(vt,(()=>{this.exit()})),oe.autoSaveCSV||(this.saveButton=new ke(this,new r(s-.4*t,.9*e),new r(.6,.6),N,M,!0),this.saveButton.addPinchCallbacks({startPinch:()=>{var t,e;t=this.levelStats,e=new Blob([a(t)],{type:"text/plain;charset=utf-8"}),ae.saveAs(e,t.id+".csv")},startHover:()=>{this.saveButton.setTintFill(ot)},endHover:()=>{this.saveButton.clearTint()}})),this.add.sprite(0,0,T).setOrigin(.5,.5).setScale(1.35*i,1.25*i).setAlpha(.6).setPosition(s,.25*e);const n=this.add.text(s,0,"Scoreboard",{color:"#01c303",font:96*i+"px Arial"});n.setStroke("#000",6*i),n.setPosition(s-n.width/2,.07*e);const o=this.levelStats.layersStats.reduce(((t,e)=>t+e.total),0),h=this.levelStats.layersStats.reduce(((t,e)=>t+e.correct),0),l=this.levelStats.layersStats.reduce(((t,e)=>t+e.miss),0),c=this.levelStats.layersStats.reduce(((t,e)=>t+e.early),0),d=this.levelStats.layersStats.reduce(((t,e)=>t+e.late),0),u=this.add.text(s,0,`Total Correct: ${h.toString()}/${o.toString()}\nLongest Streak: ${this.levelStats.maxStreak}\nMissed: ${l}\nEarly: ${c}\nLate: ${d}`,{color:"#ffffff",align:"center",font:48*i+"px Arial"});u.setPosition(s-u.width/2,.19*e);const g=[.25,.5,.75],p=g;this.level.track.forEachLayer(void 0,((s,n)=>{this.add.sprite(0,0,w).setOrigin(.5,.5).setScale(1.35*i,1.15*i).setAlpha(.6).setPosition(t*g[n],.63*e);const a=this.add.text(0,0,`${o=s.id,o&&o[0].toUpperCase()+o.slice(1)||""}`,{color:"#01c303",align:"center",font:72*i+"px Arial",fontStyle:"bold"});var o;a.setStroke("#000",4*i),a.setPosition(t*p[n]-a.width/2,.53*e);const r=this.levelStats.layersStats[n];let h=0,l=0,c=0;null!=r&&(h=r.correct,l=r.total,c=r.loop);const d=this.add.text(0,0,`\nCorrect: ${h.toString()}/${l.toString()}\nLoops: ${c.toString()}`,{color:"#ffffff",align:"center",font:48*i+"px Arial"});d.setPosition(t*p[n]-d.width/2,.575*e+.01)})),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.exit()},startHover:()=>{this.backToMenu.setTintFill(ot)},endHover:()=>{this.backToMenu.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(Gt)}exit(){this.scene.start(zt)}preload(){this.load.image(_,se(G)),this.load.audio(M,se(q)),this.load.image(V,se("assets/ui/calibration_background.png"))}create(){super.create(!0,.8);const t=window.innerWidth,e=window.innerHeight,s=.5*t;this.backToMenu=new ke(this,new r(s,.9*e),Mt,_,M,!0),this.setBackgroundTexture(V),this.input.keyboard.on(vt,(()=>{this.exit()})),this.distanceText=this.add.text(s,.1*e,Qt,{color:"white",font:"60px Arial"}).setShadow(5,5,"rgba(0,0,0,0.5)",15).setOrigin(.5,.5),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.exit()},startHover:()=>{this.backToMenu.setTintFill(ot)},endHover:()=>{this.backToMenu.clearTint()}})}update(t,e){super.update(t,e);const s=this.hand.calculateHandDistance();let i="Hand Not Recognized";if(s>0){let t=65280;s>40?(i="Too Far - Estimated Distance: ",t=16711680):s<20?(i="Too Close - Estimated Distance: ",t=255):i="Just Right - Estimated Distance: ",this.setBackgroundTint(t),i+=s.toFixed(0)+" cm"}else this.clearBackgroundTint();null!=this.distanceText&&this.distanceText.active&&this.distanceText.setText(i)}}]};new(n().Game)(ss)}},s={};function i(t){var n=s[t];if(void 0!==n)return n.exports;var a=s[t]={exports:{}};return e[t].call(a.exports,a,a.exports,i),a.exports}i.m=e,t=[],i.O=(e,s,n,a)=>{if(!s){var o=1/0;for(c=0;c=a)&&Object.keys(i.O).every((t=>i.O[t](s[h])))?s.splice(h--,1):(r=!1,a0&&t[c-1][2]>a;c--)t[c]=t[c-1];t[c]=[s,n,a]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={792:0};i.O.j=e=>0===t[e];var e=(e,s)=>{var n,a,[o,r,h]=s,l=0;if(o.some((e=>0!==t[e]))){for(n in r)i.o(r,n)&&(i.m[n]=r[n]);if(h)var c=h(i)}for(e&&e(s);li(852)));n=i.O(n)})(); \ No newline at end of file diff --git a/main.674ec38ac0d5ea71c60f.bundle.js b/main.674ec38ac0d5ea71c60f.bundle.js deleted file mode 100644 index cd13115..0000000 --- a/main.674ec38ac0d5ea71c60f.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var t,e={852:(t,e,s)=>{var i=s(440),n=s.n(i);function a(t,e=3){return parseFloat((t/1e3).toFixed(e))}const o=Phaser.Math.Vector2,r=Phaser.GameObjects.Group,h=Phaser.GameObjects.Graphics,l=Phaser.Time.TimerEvent,d=Phaser.GameObjects.GameObject,c=Phaser.Geom.Rectangle,u=(Phaser.Geom.Circle,Phaser.Input.Pointer,Phaser.GameObjects.Text),g=(Phaser.GameObjects.Sprite,Phaser.GameObjects.Video,Phaser.GameObjects.RenderTexture,Phaser.Events.EventEmitter,Phaser.GameObjects.Image,Phaser.Scene),p=(Phaser.Tilemaps.Tile,Phaser.Tweens.Tween,Phaser.GameObjects.Particles.ParticleEmitter,Phaser.Physics.Matter.Sprite),v=(Phaser.Physics.Arcade.Sprite,!0),m="finger",y="previewVideoBackground",f="songNameBackground",b="layerScoreBackground",w="scoreboardBackground",T="menuCalibrateButton",x="menuSelectButton",k="optionsButton",S="targetInner",P="background1",L="mainBackground",C="playButton",B="easyButton",D="mediumButton",O="hardButton",H="backButton",_="buttonDing",M="calibrationBackground",V="menuLogo",I="resetButton",A="muteButton",E="unmuteButton",K="leftArrow",F="rightArrow",j="saveCSVButton",N="defaultLevelbackground",W="defaultPreviewbackground",z="assets/sprites/defaultTargetInner.png",R="assets/ui/back_button.png",q="assets/sounds/ui/menu_ding.wav",G="assets/ui/mute_button.png",$="assets/ui/unmute_button.png",J="levels/",U=".ogg",X="data/config.json",Q="data/default_config.json",Y={thumb:16777215,index:14948892,middle:9981603,ring:3636920,pinky:16220607},Z={lineWidth:5,color:11393254,alpha:.5},tt={lineWidth:5,color:11393254,alpha:1,radius:.1},et="thumb",st="index",it=st,nt=16777215,at=14948892,ot=S,rt="targetOuter",ht=z,lt={scale:1.03,color:16777215,ease:"linear"},dt={scale:.78,color:5091146,ease:"linear"},ct={scale:.3,color:16744192,ease:"linear"},ut={scale:0,color:8421504,ease:"cubic.in"},gt="keydown-ESC",pt={font:"32px Courier",color:"#00ff00"},vt={position:ee(new o(.05,.05)),color:"white",scale:1,font:"30px Arial",depth:40,strokeThickness:0,shadowOffset:new o(2,2),shadowColor:"black",shadowBlurRadius:2},mt={color:[16436258,16291840,16266752,10421252],colorEase:"quad.out",lifespan:500,scale:{start:.7,end:0,ease:"sine.out"},speed:200,advance:500,frequency:50,blendMode:"ADD",duration:0},yt="flare",ft={position:ee(new o(.5,0)),size:ee(new o(.4,.04)),requiredTint:524543,completedRequiredTint:2840741,completedTint:dt.color,extraTint:dt.color,path:"assets/ui/progress_bar_segment.png",key:"segment",tintByNode:!1},bt="metronome/high",wt="metronome/low",Tt="countdown",xt={position:ee(new o(.5,.5)),color:"white",scale:1,ease:"Power0",font:"240px Arial",depth:30},kt={position:ee(new o(.835,0)),size:new o(.16*window.innerWidth,.2684*window.innerHeight),textureKey:"infoBackground",opacity:.3,path:"assets/ui/info_background.png"},St={position:ee(new o(.93,.9)),scale:new o(.3,.3),soundKey:_,textureKey:"skipButton",path:"assets/ui/skip_button.png"},Pt={position:ee(new o(.85,.02)),color:"white",font:"20px Arial",scale:1,depth:40},Lt={position:ee(new o(.85,.07)),color:"white",font:"20px Arial",scale:1,depth:40},Ct={position:ee(new o(.85,.12)),color:"white",font:"20px Arial",scale:1,depth:40},Bt={position:ee(new o(.85,.17)),color:"white",font:"20px Arial",scale:1,depth:40},Dt={position:ee(new o(.85,.22)),color:"white",font:"20px Arial",scale:1,depth:40},Ot=new o(.5,.5),Ht=new o(.6,.6),_t=new o(1.5,1.5),Mt=new o(-32,-32),Vt=new o(32,-32),It=.07,At=.71,Et=.75,Kt="loading",Ft="level",jt="scoreboard",Nt="mainMenu",Wt="levelSelect",zt="calibration",Rt="options",qt=Nt,Gt={visible:!1,flip:!0,opacity:0,width:window.innerWidth,height:window.innerHeight,objectFit:"fill"},$t={video:{width:{ideal:640},height:{ideal:360}},audio:!1},Jt={baseOptions:{delegate:"GPU"},runningMode:"VIDEO",numHands:1,minHandDetectionConfidence:.5,minHandPresenceConfidence:.5,minTrackingConfidence:.5},Ut="UNDEFINED";var Xt=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};function Qt(t,e="no error message provided"){if(v&&!t)throw new Error("Assertion failed: "+e)}function Yt(t,e=""){const s="".replace(/\\/g,"/")+e;return t=t.replace(/\\/g,"/"),"/"==Array.from(t)[0]?s+t:s+"/"+t}function Zt(t){return Yt(t,"")}function te(t){return Zt(t),!0}function ee(t){return t instanceof o?new o(t.x*window.innerWidth,t.y*window.innerHeight):new o(t[0]*window.innerWidth,t[1]*window.innerHeight)}var se=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};let ie;function ne(t){ie=t}function ae(t){return new Promise(((e,s)=>se(this,void 0,void 0,(function*(){yield function(t){return new Promise(((e,s)=>Xt(this,void 0,void 0,(function*(){var i;yield(i=t,new Promise((function(t,e){let s=new XMLHttpRequest;s.open("GET",i),s.onload=function(){this.status>=200&&this.status<300?t(s):e({status:this.status,statusText:s.statusText})},s.onerror=function(){e({status:this.status,statusText:s.statusText})},s.send()}))).then((t=>{e(JSON.parse(t.responseText.toString("utf8")))})).catch((()=>{s()}))}))))}(Zt(t)).then((t=>{const s=t;ne(s),e(s)})).catch((()=>{s()}))}))))}function oe(){return ae(Q)}function re(){try{return ae(X)}catch(t){return oe()}}function he(t){t.id,function(t){let e="layerID,noteID,loopNumber,playerTime,correctTime,classification\n";for(const s of t.layersStats){const i=t.layersStats.indexOf(s);for(const t of s.hits)e+=`${i},${t.noteID},${t.loopNumber},${a(t.playerTime)},${a(t.correctTime)},${t.classification}\n`}}(t),Yt("/csv/")}var le=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const de=new class{init(t,e){return le(this,void 0,void 0,(function*(){return new Promise(((s,i)=>le(this,void 0,void 0,(function*(){e("Loading webcam..."),this.setupVideoElement(t),yield navigator.mediaDevices.getUserMedia($t).then((t=>{"srcObject"in this.video?(this.video.srcObject=t,this.video.addEventListener("loadeddata",(()=>{s(!0)}))):i("srcObject does not exist on older browsers")})).catch((t=>{i(t)}))}))))}))}found(){return null!=this.video.srcObject}setVisibility(t){this.video.style.visibility="",this.video.style.visibility=t?"shown":"hidden"}setWidth(t){this.video.width=t}setHeight(t){this.video.height=t}setupVideoElement(t){this.video=document.body.appendChild(document.createElement("video")),this.video.autoplay=!0,this.video.muted=!0,this.video.playsInline=!0,this.video.style.position="absolute",this.video.style.top="0",this.video.style.left="0",this.video.style.bottom="0",this.video.style.zIndex="-1",this.video.style.pointerEvents="none",this.video.style.objectFit=t.objectFit,this.setWidth(t.width),this.setHeight(t.height),t.flip&&(this.video.style.cssText+="-moz-transform: scale(-1, 1); -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); transform: scale(-1, 1); filter: FlipH;"),this.setVisibility(!1)}get video(){return Qt(null!=this.video_),this.video_}set video(t){this.video_=t}};var ce=s(260),ue=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const ge=new class{constructor(){this.lastVideoTime=-1}init(t){return ue(this,void 0,void 0,(function*(){return new Promise(((e,s)=>ue(this,void 0,void 0,(function*(){let i;yield ce.Ps.forVisionTasks(Yt("models/wasm")).then((t=>i=t)).catch((t=>{s(t)})),t("Loading hand landmarker..."),Jt.baseOptions.modelAssetPath=Zt("models/hand_landmarker.task"),yield ce.Vb.createFromOptions(i,Jt).then((t=>this.handLandmarker_=t)).catch((t=>{t instanceof Event&&"error"==t.type&&s("Failed to fetch vision_wasm_internal.js in specified wasm directory"),t instanceof TypeError&&s("Failed to fetch hand_landmark.task file"),s(t)})),e(!0)}))))}))}precache(t){t("Pre-caching landmarks..."),this.update()}found(){return null!=this.handLandmarker_}update(){this.lastVideoTime!=de.video.currentTime&&(this.lastVideoTime=de.video.currentTime,this.results_=this.handLandmarker.detectForVideo(de.video,performance.now()))}get results(){return Qt(null!=this.results_),this.results_}get handLandmarker(){return Qt(null!=this.handLandmarker_),this.handLandmarker_}landmarksFound(t=0){return null!=this.results&&t=0&&s.x<=1&&s.y>=0&&s.y<=1}getLandmarkPosition(t,e=0){if(!this.landmarksFound(e))return;const s=this.results.landmarks[e][t],i=ee(new o(s.x,s.y));return new o(window.innerWidth-i.x,i.y)}forEachLandmarkPosition(t,e=0){for(let s=0;s<21;++s){const i=this.getLandmarkPosition(s,e);void 0!==i&&t(i)}}};var pe=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};let ve;function me(t,e){null!=t&&(t.setVisible(e),e?t.setInteractive():t.disableInteractive())}class ye extends p{constructor(t,e,s,i,n){super(t.matter.world,0,0,e,void 0,{render:{visible:!0}}),this.name=s,this.landmarkIndex=i,this.scene.add.existing(this),this.setScale(n),this.setTint(Y[this.name]),this.setDepth(100),this.setCircle(this.displayWidth/2,{label:this.name}),this.setSensor(!0),me(this,!1)}}var fe,be;!function(t){t[t.hover=0]="hover",t[t.pinch=1]="pinch"}(fe||(fe={})),function(t){t[t.start=0]="start",t[t.continue=1]="continue",t[t.end=2]="end"}(be||(be={}));class we extends d{getFinger(t){const e=this.fingers.findIndex((e=>e.name==t));if(-1!==e)return this.fingers[e]}get observers(){return this.observers_}isObserver(t){return void 0!==this.observers_.find((e=>e.fingerName===t.fingerName&&e.object==t.object))}wasObserverHovering(t){return Qt(this.isObserver(t)),this.observers_.find((e=>e.fingerName===t.fingerName&&e.object==t.object)).wasHovering}setObserverHover(t,e){const s=this.observers_.findIndex((e=>e.fingerName===t.fingerName&&e.object==t.object));Qt(-1!==s,"Cannot set observer hover before observer is pushed"),this.observers_[s].wasHovering=e}pushNewObserversOnly(t){this.isObserver(t)||(this.observers.push(t),this.setObserverHover(t,!1))}removeObserver(t){const e=this.observers_.findIndex((e=>e.fingerName===t.fingerName&&e.object==t.object));e>-1&&this.observers_.splice(e,1)}constructor(t){super(t,"hand"),this.fingers=[],this.observers_=[],this.fingers=[],this.observers_=[];const e=(t,e)=>{const s=new ye(this.scene,m,t,e,.3*ie.fingerSize);return this.fingers.push(s),s},s=e(et,4),i=(e(st,8),e("middle",12),e("ring",16),e("pinky",20),(t,e)=>{t((t=>{const i=this.getFinger(t.bodyB.label);if(void 0!==i)for(const t of this.observers)t.fingerName==i.name&&null!=t.object&&t.object.input&&t.object.input.enabled&&t.object.emit(i.name+fe.pinch+e);else if(t.bodyB.gameObject){const i=t.bodyB.gameObject;for(const n of this.fingers){if(n==s)continue;const a={object:i,fingerName:n.name};if(!this.isObserver(a))continue;const o=this.scene.matter.overlap(t.bodyB,[n]);if(e===be.start&&o)i.emit(n.name+fe.hover+be.start),this.setObserverHover(a,!0);else if(e===be.continue){const t=this.wasObserverHovering(a);o&&t?(i.emit(n.name+fe.hover+be.continue),this.setObserverHover(a,!0)):o&&!t?(i.emit(n.name+fe.hover+be.start),this.setObserverHover(a,!0)):!o&&t&&(i.emit(n.name+fe.hover+be.end),this.setObserverHover(a,!1))}else e===be.end&&this.wasObserverHovering(a)&&(i.emit(n.name+fe.hover+be.end),this.setObserverHover(a,!1))}}}))});i(s.setOnCollide.bind(s),be.start),i(s.setOnCollideActive.bind(s),be.continue),i(s.setOnCollideEnd.bind(s),be.end)}setFingerScale(t){for(const e of this.fingers)e.setScale(.3*t)}addPinchCheck(t,e,s){this.pushNewObserversOnly({object:e,fingerName:t});const i=t=>{const s=this.getFinger(et),i=this.getFinger(t);if(void 0===s)return!1;if(void 0===i)return!1;const n=this.scene.matter.overlap(e,[s]),a=this.scene.matter.overlap(e,[i]);return n&&a};null!=s.startPinch&&e.on(t+fe.pinch+be.start,(()=>{var e;i(t)&&(null===(e=s.startPinch)||void 0===e||e.call(s))})),null!=s.pinched&&e.on(t+fe.pinch+be.continue,(()=>{var e;i(t)&&(null===(e=s.pinched)||void 0===e||e.call(s))})),null!=s.endPinch&&e.on(t+fe.pinch+be.end,(()=>{var e;i(t)&&(null===(e=s.endPinch)||void 0===e||e.call(s))})),null!=s.startHover&&e.on(t+fe.hover+be.start,(()=>{var t;null===(t=s.startHover)||void 0===t||t.call(s)})),null!=s.hovering&&e.on(t+fe.hover+be.continue,(()=>{var t;null===(t=s.hovering)||void 0===t||t.call(s)})),null!=s.endHover&&e.on(t+fe.hover+be.end,(()=>{var t;null===(t=s.endHover)||void 0===t||t.call(s)}))}removePinchCheck(t,e){this.removeObserver({fingerName:t,object:e}),e.off(t+fe.pinch+be.start),e.off(t+fe.pinch+be.continue),e.off(t+fe.pinch+be.end),e.off(t+fe.hover+be.start),e.off(t+fe.hover+be.continue),e.off(t+fe.hover+be.end)}update(){this.observers_=this.observers_.filter((t=>null!=t)),ge.update();const t=this.scene.matter.add.circle(this.scene.input.mousePointer.x,this.scene.input.mousePointer.y,1,{circleRadius:1,isSensor:!0,render:{visible:!1}});for(const e of this.fingers){const s=ge.getLandmarkPosition(e.landmarkIndex),i=void 0!==s;if(i&&e.setPosition(s.x,s.y),me(e,i),!i&&null!=t)for(const s of this.observers)null!=t&&null!=s.object&&s.object.active&&null!=this.scene&&(s.object.emit(e.name+fe.pinch+be.end),this.scene.matter.overlap(t,[s.object])||s.object.emit(e.name+fe.hover+be.end))}this.scene.matter.world.remove(t)}calculateHandDistance(t=0){const e=ge.getLandmarkPosition(5,t),s=ge.getLandmarkPosition(17,t),i=ge.getLandmarkPosition(0,t);let n=0,a=0;const r=innerWidth*innerHeight;if(void 0!==e&&void 0!==s){const t=new o((e.x+s.x)/2,(e.y+s.y)/2);n=Math.sqrt(Math.pow((s.x-e.x)/r,2)+Math.pow((s.y-e.y)/r,2)),void 0!==i&&(a=Math.sqrt(Math.pow((i.x-t.x)/r,2)+Math.pow((i.y-t.y)/r,2)))}return 0==n||0==a?0:8.2*.7/Math.max(n/8.2,a/10)/r*100}}const Te=new Set([[0,1],[0,5],[9,13],[13,17],[5,9],[0,17],[1,2],[2,3],[3,4],[5,6],[6,7],[7,8],[9,10],[10,11],[11,12],[13,14],[14,15],[15,16],[17,18],[18,19],[19,20]]);class xe extends g{constructor(t){super(t)}preload(){}create(t=ie.enableCameraVisibility,e=ie.cameraOpacity){de.setVisibility(t),ve.setVisible(!0),this.clearBackgroundTint(),this.setBackgroundTexture(L),this.setOpacity(e),this.sound.pauseOnBlur=!1,this.graphics=this.add.graphics(),this.graphics.setDepth(99),this.hand=new we(this)}update(t,e){this.graphics.clear(),this.hand.update(),function(t,e,s=0){t.setDepth(99),ge.forEachLandmarkPosition((s=>{t.lineStyle(e.lineWidth,e.color,e.alpha),t.strokeCircle(s.x,s.y,e.radius)}),s)}(this.graphics,tt,0),function(t,e,s=0){t.setDepth(98),Te.forEach((i=>{const n=ge.getLandmarkPosition(i[0],s);if(void 0!==n){const a=ge.getLandmarkPosition(i[1],s);void 0!==a&&(t.lineStyle(e.lineWidth,e.color,e.alpha),t.lineBetween(n.x,n.y,a.x,a.y))}}))}(this.graphics,Z,0),ve.setDisplaySize(document.body.clientWidth,document.body.clientHeight+1)}setOpacity(t){Qt(t>=0&&t<=1),console.log("setting background alpha to "+(1-t).toString()),ve.setAlpha(1-t)}setBackgroundTexture(t){ve.setTexture(t)}setBackgroundTint(t){ve.setTint(t)}clearBackgroundTint(){ve.clearTint()}}class ke extends p{constructor(t,e,s,i,n,a){super(t.matter.world,e.x,e.y,i,void 0,{render:{visible:!0},label:"button-"+i}),this.scene=t,this.scene.add.existing(this),this.sound=this.scene.sound.add(n,{volume:ie.sonificationLevel}),this.setSensor(!0),this.setOrigin(.5,.5),this.setScale(s.x,s.y),this.setDepth(93),me(this,a),this.on("destroy",(()=>{this.scene.hand.removePinchCheck(it,this)}))}removePinchCallbacks(){this.scene.hand.removePinchCheck(it,this)}addPinchCallbacks(t){const e={startPinch:()=>{var e;null===(e=t.startPinch)||void 0===e||e.call(t),this.sound.play({volume:ie.sonificationLevel})},pinched:t.pinched,endPinch:t.endPinch,startHover:t.startHover,endHover:t.endHover};this.scene.hand.addPinchCheck(it,this,e),this.on("pointerdown",e.startPinch),e.startHover&&this.on("pointermove",e.startHover),e.endHover&&this.on("pointerout",e.endHover)}}class Se{constructor(t){this.trackKey=Ut,this.bpm=0,this.beatLength_=1,this.trackKey=t}get beatLength(){return this.beatLength_}setBPM(t){Qt(null!=this.data,"preload JSON before setting BPM"),Qt(t{e.nodes.forEach(((s,i)=>{const n=this.getSoundKey(e,s.soundKey),a=this.trackDir+e.id+"/"+s.soundKey+U;t.cache.audio.exists(n)||""===s.soundKey||t.load.audio(n,Zt(a))}))}))}unloadNotes(t){this.forEachLayer(void 0,(e=>{e.nodes.forEach(((s,i)=>{t.cache.audio.remove(this.getSoundKey(e,s.soundKey))}))}))}preloadLoops(t){this.forEachLayer((e=>{Qt(void 0!==e.soundLoopKeys),Qt(e.soundLoopKeys.length>0),e.soundLoopKeys.forEach((s=>{const i=this.getSoundKey(e,s),n=this.trackDir+e.id+"/"+s+U;t.cache.audio.exists(i)||""===s||t.load.audio(i,Zt(n))}))}))}unloadLoops(t){this.forEachLayer((e=>{e.soundLoopKeys.forEach((s=>{t.cache.audio.remove(this.getSoundKey(e,s))}))}))}getSoundKey(t,e){return Qt(void 0!==e),this.trackKey+"/"+t.id+"/"+e}forEachLayer(t,e){Qt(null!=this.data,"JSON has not finished preloading");let s=0;this.data.layers.forEach(((i,n)=>{i.playable||s++,null==t||t(i,n),i.playable&&(null==e||e(i,n-s))}))}addBackgroundAudioTracks(t,e,s,i){const n=[];return this.forEachLayer(((a,o)=>{(null==i||i(a,o))&&(Qt(void 0!==a.soundLoopKeys),Qt(s{this.data=i,this.parseJson(),this.preloadLoops(t)};t.cache.json.exists(this.trackKey)?s(0,0,t.cache.json.get(this.trackKey)):(t.load.json(this.trackKey,Zt(e+"info.json")),t.load.on("filecomplete-json-"+this.trackKey,s,this))}unloadJson(t){this.unloadLoops(t),t.cache.json.remove(this.trackKey)}parseJson(){this.setTimePositionDefaults(),this.sortNodes()}setTimePositionDefaults(){this.forEachLayer(void 0,(t=>{const e=(t,e,s,i)=>{t.bar||(t.bar=e),t.step||(t.step=s),t.tick||(t.tick=i)};Qt(t.progressCount<=t.nodes.length,"Progress count threshold for layer '"+t.id+"' of track '"+this.trackKey+"' cannot be higher than the node count."),e(t.previewTime,0,0,0),t.nodes.forEach((t=>{e(t.timePosition,1,1,0)}))}))}sortNodes(){this.forEachLayer(void 0,(t=>{t.nodes.sort(((t,e)=>t.timePosition.bar!==e.timePosition.bar?t.timePosition.bar-e.timePosition.bar:t.timePosition.step!==e.timePosition.step?t.timePosition.step-e.timePosition.step:t.timePosition.tick-e.timePosition.tick))}))}}class Pe extends p{static preload(t){t.load.image(ot,Zt(ht)),t.load.image(rt,Zt("assets/sprites/defaultTargetOuter.png"))}static unload(t){t.textures.remove(ot),t.textures.remove(rt)}constructor(t,e,s,i,n,a,o,r){super(t.matter.world,s.x,s.y,a.data.spriteKeyInner,void 0,{render:{visible:!0}}),this.scene=t,this.lifetime=i,this.fingerId=o,this.nodeIndex=r,this.spriteScale=ie.targetSize,this.scene.add.existing(this),this.songTime=this.lifetime+e,this.lateDuration=ie.lateTimeDuration,this.onTimeDuration=ie.onTimeDuration,this.earlyDuration=this.lifetime-this.onTimeDuration/2,this.sound=this.scene.sound.add(n,{volume:ie.sonificationLevel}),this.setScale(this.spriteScale),this.setTint(Y[this.fingerId]),this.setDepth(95),me(this,!0),this.setCircle(this.displayWidth/2,{label:a.level.trackKey+"-"+a.data.id+"-node-"+r.toString()}),this.setSensor(!0),ie.fancyEffectsDisabled||(this.glow=this.postFX.addGlow(16777215,0,0,!1,.05,24)),this.outerRing=this.scene.add.sprite(s.x,s.y,a.data.spriteKeyOuter),this.outerRing.setScale(.5*this.spriteScale),this.outerRing.setDepth(96),this.targetText=new u(this.scene,0,0,Ut,{}),this.addTargetText(),this.setupTweens()}setOnTargetMiss(t){this.onTargetMiss=t}setOnTargetHit(t){this.scene.hand.addPinchCheck(this.fingerId,this,{startPinch:t}),this.once("pointerdown",t)}addTargetText(){this.targetText=this.scene.add.text(this.x,this.y,(this.nodeIndex+1).toString(),{font:"20px Arial",color:"white"}),this.targetText.setOrigin(.5,.5),this.targetText.setDepth(97)}createTween(t,e,s){for(const s of t)s.tint=e.color;return this.scene.tweens.add({targets:t,displayWidth:this.displayWidth*e.scale,displayHeight:this.displayHeight*e.scale,ease:e.ease,duration:s,repeat:0})}setupTweens(){ie.fancyEffectsDisabled||(this.rotateTween=this.scene.tweens.add({targets:[this],rotation:2*Math.PI,ease:"linear",duration:1e3,repeat:-1})),this.earlyTween=this.createTween([this.outerRing],lt,this.earlyDuration),this.earlyTween.on("complete",(()=>{this.onTimeTween=this.createTween([this],Object.assign(Object.assign({},dt),{scale:1}),this.onTimeDuration),ie.fancyEffectsDisabled||null==this.glow||(this.glowTween=this.scene.tweens.add({targets:this.glow,outerStrength:4,yoyo:!0,duration:this.onTimeDuration/2,ease:"linear"})),this.onTimeTween.on("complete",(()=>{null!=this.glow&&this.glow.destroy(),this.lateTween=this.createTween([this,this.outerRing],Object.assign(Object.assign({},ct),{scale:1}),this.lateDuration),this.lateTween.on("complete",(()=>{me(this,!1),this.deathTween=this.createTween([this,this.outerRing,this.targetText],ut,400),null!=this.onTargetMiss&&this.deathTween.on("complete",this.onTargetMiss)}))}))}))}destroyTarget(){this.scene.hand.removePinchCheck(this.fingerId,this),this.off("pointerdown"),null!=this.rotateTween&&this.scene.tweens.remove(this.rotateTween),null!=this.earlyTween&&this.scene.tweens.remove(this.earlyTween),null!=this.onTimeTween&&this.scene.tweens.remove(this.onTimeTween),null!=this.lateTween&&this.scene.tweens.remove(this.lateTween),null!=this.deathTween&&this.scene.tweens.remove(this.deathTween),null!=this.glowTween&&this.scene.tweens.remove(this.glowTween),null!=this.glow&&this.glow.destroy(),null!=this.targetText&&this.targetText.destroy(),this.outerRing.destroy(),this.destroy()}}class Le extends d{constructor(t){super(t,"metronome"),this.beat=0,this.timer=new l({}),this.countdownText=this.scene.add.text(xt.position.x,xt.position.y,Ut,{font:xt.font,color:xt.color}).setOrigin(.5,.5).setScale(xt.scale).setDepth(xt.depth),this.setVisible(!1)}preload(){this.scene.load.image(Tt,Zt("assets/sprites/countdown.png")),this.scene.load.audio(bt,Zt("assets/sounds/metronome/high.ogg")),this.scene.load.audio(wt,Zt("assets/sounds/metronome/low.ogg"))}unload(){this.scene.cache.audio.remove(bt),this.scene.cache.audio.remove(wt)}setup(){this.countdownTexture=this.scene.add.sprite(xt.position.x,xt.position.y,Tt).setScale(1).setVisible(!1).setOrigin(.5,.5).setAlpha(.3).setDepth(30)}setVisible(t){null!=this.countdownText&&this.countdownText.setVisible(t),null!=this.countdownTexture&&this.countdownTexture.setVisible(t)}stop(){this.setVisible(!1),null!=this.scene&&(this.scene.time.removeEvent(this.timer),this.scene.sound.stopByKey(bt),this.scene.sound.stopByKey(wt),null!=this.shrinkTween&&this.scene.tweens.remove(this.shrinkTween))}play(t,e,s){this.beat=0,this.stop(),this.timer=this.scene.time.addEvent({callback:this.tick.bind(this,t,e,s),delay:e,loop:!0,startAt:e})}tick(t,e,s){Qt(s>=1,"Cannot display metronome for less than minimum bar count");const i=t*s,n=this.beat%t,a=0==n?bt:wt;this.beat>=i?this.setVisible(!1):(this.countdownText.active&&this.scene.sound.play(a,{volume:ie.backgroundMusicLevel}),Qt(i-t>=0),this.beat>=i-t&&this.countdownText.active&&!ie.disableVisualMetronome&&this.display(n+1,e),this.beat++)}display(t,e){this.countdownText.setText(t.toString()),this.countdownText.setScale(xt.scale),this.countdownTexture.setScale(1),this.setVisible(!0),this.shrinkTween=this.scene.tweens.add({targets:[this.countdownText,this.countdownTexture],ease:xt.ease,duration:.9*e,scale:0,repeat:0})}}class Ce extends r{constructor(t){super(t),this.current_=0,this.requiredProgress=-1,this.nodeCount=1,this.tints=[],Qt(this.current_>=0),this.tints=[],this.scene.add.existing(this),this.setVisible(!1)}preload(){this.scene.load.image(ft.key,Zt(ft.path))}setup(t,e,s,i){Qt(s<=e),Qt(i.length===e,"Must pass tints equal in number to nodes"),Qt(e>0),Qt(s>0),Qt(t>=0),this.current_=t,this.nodeCount=e,this.tints=i,this.requiredProgress=s;const n=ft.size.x/this.nodeCount;this.clear(),this.createMultiple({quantity:this.nodeCount,key:ft.key,visible:!0,setXY:{x:ft.position.x-ft.size.x/2+n/2,y:ft.position.y+ft.size.y/2,stepX:n}}),this.propertyValueSet("displayWidth",n),this.propertyValueSet("displayHeight",ft.size.y),this.setDepth(61),this.redraw()}setToStarting(){this.current_=0,Qt(this.current_>=0),this.redraw()}redraw(){if(this.current<=this.nodeCount){this.getChildren().forEach(((t,e)=>{t.clearTint()}));const t=-1===this.requiredProgress?this.nodeCount:this.requiredProgress-1,e=this.current;this.getChildren().forEach(((s,i)=>{const n=s;ft.tintByNode&&n.setTint(this.tints[i]),it?n.setTint(ft.completedRequiredTint):n.setTint(ft.requiredTint))}),this)}}canProgress(){const t=-1===this.requiredProgress;return t&&this.current>=this.nodeCount||!t&&this.current>=this.requiredProgress}changeBy(t){this.current_=Math.max(0,Math.min(this.current+t,this.nodeCount))}get current(){return this.current_}}class Be extends d{constructor(t,e){super(t,"infoHUD"),this.scene=t,this.level=e}setup(){this.addTexts(),this.addSkipButton(),this.setVisible(!1)}addSkipButton(){this.skipButton=new ke(this.scene,St.position,St.scale,St.textureKey,St.soundKey,!1),this.skipButton.addPinchCallbacks({startPinch:()=>{me(this.skipButton,!1),this.level.transitionLayers()},startHover:()=>{this.skipButton.setTintFill(nt)},endHover:()=>{this.skipButton.clearTint()}}),this.updateSkipButtonAvailability(!1)}preload(){this.scene.load.image(St.textureKey,Zt(St.path)),this.scene.load.image(kt.textureKey,Zt(kt.path))}setVisible(t){null!=this.trackText&&this.trackText.setVisible(t),null!=this.difficultyText&&this.difficultyText.setVisible(t),null!=this.bpmText&&this.bpmText.setVisible(t),null!=this.layerText&&this.layerText.setVisible(t),null!=this.loopText&&this.loopText.setVisible(t),null!=this.infoBackground&&this.infoBackground.setVisible(t),this.updateSkipButtonAvailability(t)}addText(t,e){return this.scene.add.text(t.position.x,t.position.y,e,{font:t.font,color:t.color}).setScale(t.scale).setDepth(t.depth)}getLoopText(){return"Loop: "+this.level.score.getLoopCount().toString()}addTexts(){this.loopText=this.addText(Dt,this.getLoopText());const t="Track: "+this.level.track.data.displayName;this.trackText=this.addText(Pt,t);const e="Layer: "+(this.level.activeLayerIndex+1).toString()+"/"+this.level.playableLayers.length.toString();let s=Ut;switch(this.level.bpmIndex){case 0:s="Easy";break;case 1:s="Medium";break;case 2:s="Hard"}Qt(s!=Ut,"Extend the switch statement to have a difficulty text for the given track bpmIndex"),this.difficultyText=this.addText(Lt,"Difficulty: "+s),this.bpmText=this.addText(Ct,"BPM: "+this.level.track.getBPM()),this.layerText=this.addText(Bt,e),this.infoBackground=this.scene.add.sprite(kt.position.x,kt.position.y,kt.textureKey).setAlpha(kt.opacity).setOrigin(0,0).setDisplaySize(kt.size.x,kt.size.y)}updateLoopText(){this.loopText.setText(this.getLoopText()),this.updateSkipButtonAvailability(!0)}updateSkipButtonAvailability(t){const e=ie.enableSkipButton&&this.level.score.getLoopCount()>=ie.skipLoopThreshold&&t;null!=this.skipButton&&me(this.skipButton,e)}}class De{constructor(){this.targets=[]}start(){this.destroyTargets()}destroyTarget(t){t.destroyTarget();const e=this.targets.indexOf(t,0);e>-1&&this.targets.splice(e,1)}destroyTargets(){const t=[...this.targets];for(const e of t)this.destroyTarget(e)}addTarget(t){this.targets.push(t)}getPreviousTargets(t){return this.targets.filter((e=>e.songTime{const i=ie.indexFingerOnly?st:t.finger;s.push(Y[i])})),this.progress.setup(0,this.data.nodes.length,this.data.progressCount,s),this.metronome.setup(),this.infoHud.setup(),this.progress.setVisible(!0),this.infoHud.setVisible(!0),this.metronome.play(this.level.track.data.timeSignatureNumerator,this.level.track.beatLength,e)}createTarget(t,e,s){const i=ie.indexFingerOnly?st:t.finger,n=new Pe(this.scene,this.songTime_,ee(t.normalizedPosition),this.getPreviewTime(),this.level.track.getSoundKey(this.data,t.soundKey),this,i,s);n.setOnTargetMiss((()=>{this.level.score.missedPinch(n),this.progress.changeBy(-1),this.progress.redraw(),this.level.streak.stop(),this.targetManager.destroyTarget(n),this.checkForTransition(e,s)})),n.setOnTargetHit((()=>{const t=this.targetManager.getPreviousTargets(n);for(const e of t)Qt(e!=n),this.progress.changeBy(-1),this.level.score.skippedPinch(e),this.targetManager.destroyTarget(e);t.length>0&&this.level.streak.stop();const i=this.songTime-n.songTime,a=n.onTimeDuration/2,o=i>a;i<-a?(this.level.streak.stop(),this.progress.changeBy(0),this.level.score.earlyPinch(n,this.songTime)):o?(this.level.streak.stop(),this.progress.changeBy(0),this.level.score.latePinch(n,this.songTime)):(this.level.streak.changeBy(1),this.progress.changeBy(1),this.level.score.onTimePinch(n,this.songTime,this.level.streak.current)),this.progress.redraw(),this.level.streak.check(),ie.disableSonification||n.sound.play({volume:ie.sonificationLevel}),this.targetManager.destroyTarget(n),this.checkForTransition(e,s)})),this.targetManager.addTarget(n)}checkForTransition(t,e){e==this.data.nodes.length-1&&this.level.activeLayerIndex==t&&(ie.enableAutoSkip&&this.level.score.getLoopCount()>=ie.autoSkipThreshold||this.progress.canProgress()&&!ie.disableLayerProgression?this.level.transitionLayers():(this.level.score.incrementLoopCount(),this.progress.setToStarting(),this.infoHud.updateLoopText(),ie.autoSaveCSV&&he(this.level.score.levelStats)))}handleTargetCreation(){if(!this.ready)return;const t=this.getDuration();let e=this.songTime_+this.getPreviewTime();if(this.songTime_>0&&(e%=t),this.data.nodes.length<=this.nextNodeIndex){if(!(e1?this.continue():this.stop()}updateStreakText(){this.streakText.setText("Streak: "+this.current_.toString())}start(){this.updateStreakText(),this.streakText.setVisible(!0)}stop(){this.current_=0,this.onFire=!1,null!=this.onFireTween&&this.scene.tweens.remove(this.onFireTween),null!=this.streakText&&this.streakText.clearTint(),null!=this.streakText&&this.streakText.setVisible(!1),null!=this.flame&&this.flame.destroy()}continue(){this.updateStreakText();const t=this.onFire;this.onFire=this.current_>=2,!t&&this.onFire&&(Qt(!0,"Streak color wheel extent must be from 1 to 255"),this.onFireTween=this.scene.tweens.addCounter({from:0,to:30,duration:1e3,yoyo:!0,onUpdate:t=>{if(null!=this&&null!=this.hsv){const e=Math.floor(t.getValue()),s=this.hsv[e].color,i=this.hsv[30-e].color;null!=this.streakText&&this.streakText.setTint(s,s,i,i)}},onStop:()=>{null!=this.onFireTween&&this.scene.tweens.remove(this.onFireTween)}}),ie.fancyEffectsDisabled||(null!=this.flame&&this.flame.destroy(),null!=this.streakText&&(this.flame=this.scene.add.particles(this.streakText.x,this.streakText.y,yt,mt),Qt(0!=vt.depth),this.flame.setDepth(vt.depth-1))))}}class Me{constructor(){this.total=1,this.required=1,this.correct=0,this.early=0,this.late=0,this.miss=0,this.loop=1,this.hits=[]}}class Ve{constructor(t){this.maxStreak=0,this.layersStats=[],this.id=`${t.data.displayName.replace(/\s/g,"")}@${t.getBPM()}bpm_${(new Date).toLocaleString("en-GB").replace(/\s/g,"").replace(/,/g,"_").replace(/[:/]/g,"-")}`}}class Ie{constructor(t){this.levelStats=new Ve(t),this.layerStats=new Me}getLoopCount(){return this.layerStats.loop}incrementLoopCount(){this.layerStats.correct=0,this.layerStats.early=0,this.layerStats.late=0,this.layerStats.miss=0,this.layerStats.loop++}saveLayerScores(){this.levelStats.layersStats.push(this.layerStats)}resetLayerScores(t,e){this.layerStats=new Me,this.layerStats.total=t,this.layerStats.required=e}addHit(t,e,s){this.layerStats.hits.push({loopNumber:this.getLoopCount(),noteID:t.nodeIndex+1,correctTime:t.songTime+this.delay,playerTime:e,classification:s})}onTimePinch(t,e,s){this.addHit(t,e+this.delay,"correct"),this.layerStats.correct++,this.levelStats.maxStreak=Math.max(s,this.levelStats.maxStreak)}earlyPinch(t,e){this.addHit(t,e+this.delay,"early"),this.layerStats.early++}latePinch(t,e){this.addHit(t,e+this.delay,"late"),this.layerStats.late++}skippedPinch(t){this.addHit(t,-1e3,"skipped"),this.layerStats.miss++}missedPinch(t){this.addHit(t,-1e3,"missed"),this.layerStats.miss++}}class Ae{constructor(t){this.trackKey_=Ut,this.finishCallback=()=>{},this.abortCallback=()=>{},this.activeLayerIndex=0,this.playableLayers=[],this.activeAudioTracks=[],this.bpmIndex_=-1,this.trackKey_=t,this.track=new Se(this.trackKey_)}setBPM(t){Qt(-1!=t,"BPM must be set before starting the level"),this.track.setBPM(t),this.bpmIndex_=t}get bpmIndex(){return this.bpmIndex_}get trackKey(){return this.trackKey_}init(t){this.scene=t,this.streak=new _e(this.scene),this.score=new Ie(this.track),this.preloadLayers()}hasCustomBackground(){return te(J+this.getBackgroundTextureKey())}hasPreviewVideo(){return te(J+this.getPreviewVideoKey())}getBackgroundTextureKey(){return this.trackKey+"/background.png"}getPreviewVideoKey(){return this.trackKey+"/preview.mp4"}preloadTrack(t){const e=J+this.getPreviewVideoKey(),s=J+this.getBackgroundTextureKey();te(e)&&t.load.video(this.getPreviewVideoKey(),Zt(e),!0),te(s)&&t.load.image(this.getBackgroundTextureKey(),Zt(s)),this.track.preload(t)}unloadTrack(t){this.track.unload(t)}preloadLayers(){this.track.preloadNotes(this.scene),Pe.preload(this.scene),this.streak.preload(),this.playableLayers=[],this.track.forEachLayer(void 0,((t,e)=>{const s=new He(this.scene,this,t);s.preload(),this.playableLayers.push(s)}))}unloadLayers(){this.playableLayers.forEach((t=>{t.unload()})),this.track.unloadNotes(this.scene),Pe.unload(this.scene),this.streak.unload()}start(t,e){this.activeLayerIndex=0,this.removeBackgroundAudio(this.scene),this.playableLayers.forEach((t=>{t.stop()})),this.streak.stop(),this.setBPM(this.bpmIndex_),this.finishCallback=t,this.abortCallback=e,this.scene.time.delayedCall(1e3,(()=>{this.startLayer()}))}addBackgroundAudio(t,e,s){Qt(-1!=this.bpmIndex_,"Set BPM before adding background audio to level"),this.removeBackgroundAudio(t),this.activeAudioTracks=this.track.addBackgroundAudioTracks(t,e,this.bpmIndex_,s)}removeBackgroundAudio(t){this.activeAudioTracks.forEach((e=>{e.stop(),t.sound.remove(e)})),this.activeAudioTracks=[]}playBackgroundAudio(){this.activeAudioTracks.forEach((t=>{t.setMute(!1),t.play()}))}setBackgroundAudioMute(t){this.activeAudioTracks.forEach((e=>{e.setMute(t)}))}startLayer(){const t=this.getActiveLayer(),e=this.activeLayerIndex;this.score.resetLayerScores(t.data.nodes.length,t.data.progressCount);const s=this.track.songTimePositionToTime({bar:2,step:1,tick:0}),i=Math.max(s,t.getPreviewTime());t.start(i);const n=[...t.data.backgroundLayers];ie.disableSonification&&n.push(t.data.id),this.addBackgroundAudio(this.scene,{loop:!0,volume:ie.backgroundMusicLevel},((t,e)=>n.includes(t.id))),this.scene.time.delayedCall(i,(()=>{this.activeLayerIndex==e&&this.playBackgroundAudio()}))}getActiveLayer(){return Qt(this.activeLayerIndex=this.playableLayers.length)return this.score.saveLayerScores(),t.postDelayStop(),void this.end();this.scene.time.delayedCall(1e3,(()=>{this.activeLayerIndex==e&&(this.score.saveLayerScores(),t.postDelayStop(),this.startLayer())}))}}stop(){this.removeBackgroundAudio(this.scene),this.streak.stop(),this.unloadLayers()}end(){this.stop(),this.finishCallback()}abort(){this.stop(),this.abortCallback()}update(t){this.activeLayerIndex{this.bpmText.destroy()}))}updateTint(){this.toggleState?(this.bpmText.setTintFill(at),this.setTintFill(at)):(this.bpmText.setTintFill(this.bpmTextOptions.color),this.clearTint())}get bpmIndex(){return this.bpmIndex_}}var Fe=n().Math.Vector2,je=n().Math.RoundTo;class Ne extends h{constructor(t,e,s,i,n,a,o,r){super(t),this.isDragging=!1,this.range=new Fe(0,1),this.isInteger=!1,this.x=e.x,this.y=e.y,this.width=s.x,this.height=s.y,this.key=a,this.updateSliderCallback=r,this.range=o,this.value=.5,this.box=new c(0,0,s.x,s.y),this.handle=new c(0,0,s.y,s.y),this.updateHandle(),null!=i&&(this.label=this.scene.add.text(this.x+i.x,this.y+i.y,Ut,{color:"#ffffff",fontSize:"24px"})),this.setInteractive(this.box,c.Contains),this.on("pointerdown",this.startDrag,this),this.scene.input.on("pointerup",this.stopDrag,this),this.scene.input.on("pointermove",this.doDrag,this),Qt("number"==typeof n[this.key]),this.setValue(n[this.key]),this.draw()}reset(t){Qt("number"==typeof t[this.key]),this.setValue(t[this.key]),this.draw()}startDrag(){this.isDragging=!0}doDrag(t){this.isDragging&&(this.value=n().Math.Clamp((t.x-this.x-this.handle.width/2)/(this.width-this.handle.width),0,1),this.updateHandle(),this.draw())}stopDrag(){this.isDragging=!1}updateHandle(){this.handle.x=this.value*(this.width-this.handle.width)}draw(){this.clear(),null!=this.input&&(this.input.enabled||this.setInteractive(this.box,c.Contains),this.updateSliderCallback(this)),this.fillStyle(11184810),this.fillRectShape(this.box),this.fillStyle(16777215),this.fillRectShape(this.handle)}getStringValue(){const t=this.getValue();return this.isInteger?t.toFixed(0):t.toFixed(2)}getValue(){const t=this.value*(this.range.y-this.range.x)+this.range.x;return this.isInteger?je(t,0):t}setIsInteger(t){return this.isInteger=t,this.draw(),this}setValue(t){this.value=(t-this.range.x)/(this.range.y-this.range.x),this.updateHandle(),this.draw()}hide(t){return this.clear(),null!=this.input&&this.disableInteractive(),null!=this.label&&null!=this.label&&this.label.active&&(null!=t?this.label.setText(t):this.label.setText("")),this}}class We extends h{constructor(t,e,s,i,n,a,o,r){super(t),this.labelText=Ut,this.x=e.x,this.y=e.y,this.key=o,null!=i&&(this.labelText=n,this.label=this.scene.add.text(e.x+i.x,e.y+i.y,this.labelText,{color:"#ffffff",fontSize:"24px"})),this.toggleCallback=r,Qt("boolean"==typeof a[this.key]),this.isChecked_=a[this.key],this.box=new c(0,0,s,s),this.check=new c(.25*s,.25*s,.5*s,.5*s),this.setInteractive(this.box,c.Contains),this.toggleCallback(this),this.on("pointerdown",this.toggleCheck,this),this.draw()}reset(t){Qt("boolean"==typeof t[this.key]),this.isChecked_=t[this.key],this.toggleCallback(this),this.draw()}resetLabel(){null!=this.label&&this.label.setText(this.labelText)}setLabel(t){null!=this.label&&this.label.setText(t),this.draw()}toggleCheck(){this.isChecked_=!this.isChecked_,this.toggleCallback(this),this.draw()}draw(){this.clear(),null==this.input||this.input.enabled||this.setInteractive(this.box,c.Contains),this.lineStyle(2,16777215),this.strokeRectShape(this.box),this.isChecked_&&(this.fillStyle(16777215),this.fillRectShape(this.check))}setToggled(t){"boolean"==typeof t&&(this.isChecked_=t,this.toggleCallback(this),this.draw())}hide(){return this.clear(),this.disableInteractive(),null!=this.label&&this.label.setText(""),this}get isChecked(){return this.isChecked_}}var ze=function(t,e,s,i){return new(s||(s=Promise))((function(n,a){function o(t){try{h(i.next(t))}catch(t){a(t)}}function r(t){try{h(i.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,r)}h((i=i.apply(t,e||[])).next())}))};const Re=window.innerWidth,qe=window.innerHeight,Ge=.5*Re,$e=.1*Re,Je=.64*Re,Ue=.1*qe,Xe=.08*qe,Qe=.32*qe,Ye=.08*qe,Ze=.57*qe,ts=.08*qe,es=new o(.26*Re,.03*qe),ss={type:n().WEBGL,scale:{mode:n().Scale.RESIZE},transparent:!0,physics:{default:"matter",matter:{debug:!1,gravity:{x:0,y:0}}},scene:[class extends g{constructor(){super("electron")}create(){return pe(this,void 0,void 0,(function*(){yield new Promise(((t,e)=>{t()})).then((()=>{this.scene.start(Kt)}))}))}},class extends g{constructor(){super(Kt)}preload(){this.load.image(m,Zt("assets/sprites/finger.png")),this.load.image(L,Zt("assets/ui/menu_background.png"))}create(){return pe(this,void 0,void 0,(function*(){ve=this.add.sprite(0,0,L).setOrigin(0,0).setAlpha(.9).setDisplaySize(window.innerWidth,window.innerHeight);const t=this.add.text(this.cameras.main.worldView.x+this.cameras.main.width/2,this.cameras.main.worldView.y+this.cameras.main.height/2,"",pt).setShadow(1,1).setDepth(1e3).setOrigin(.5);yield de.init(Gt,this.updateText.bind(this,t)).catch((e=>{this.updateText(t,e)})),de.found()&&(this.updateText(t,"Loading config data..."),yield re(),yield ge.init(this.updateText.bind(this,t)).catch((e=>this.updateText(t,e))),ge.found()&&(de.setVisibility(Gt.visible),this.scene.launch(qt),ge.precache(this.updateText.bind(this,t)),this.updateText(t,"Loading game..."),this.scene.get(qt).load.on("complete",(()=>{t.destroy()}))))}))}updateText(t,e){console.info("INFO: "+e);let s=e;e instanceof DOMException&&(s="NotFoundError"==e.name?"Webcam not found":"PermissionError"==e.name?"Permission denied":"NotADirectoryError"==e.name?e.message:e.name+": "+e.message),t.setText(s)}},class extends xe{constructor(){super(Nt),this.levels=[]}preload(){super.preload(),this.load.audio(_,Zt(q)),this.load.image(V,Zt("assets/ui/menu_logo.png")),this.load.image(k,Zt("assets/ui/menu_options.png")),this.load.image(x,Zt("assets/ui/menu_select_level.png")),this.load.image(T,Zt("assets/ui/menu_setup_camera.png")),function(t){let e=new XMLHttpRequest;return e.open("POST",t),e.send(),e.onreadystatechange=function(){e.readyState},[]}(Zt(J)).forEach(((t,e)=>{this.levels.push(new Ae(t))})),this.levels.forEach((t=>{t.preloadTrack(this)}))}create(){super.create(),this.levels.forEach((t=>{t.setBPM(0)}));const t=window.innerWidth,e=window.innerHeight,s=.5*t;this.menuCalibrate=new ke(this,new o(s-.25*t,Et*e),Ht,T,_,!0),this.menuSelectLevel=new ke(this,new o(s,Et*e),Ht,x,_,!0),this.menuOptions=new ke(this,new o(s+.25*t,Et*e),Ht,k,_,!0),this.menuLogo=this.add.sprite(0,0,V).setOrigin(0,0).setScale(.7,.7),this.menuLogo.setPosition(s-this.menuLogo.displayWidth/2,.25*e),this.menuCalibrate.addPinchCallbacks({startPinch:()=>{this.scene.start(zt)},startHover:()=>{this.menuCalibrate.setTintFill(nt)},endHover:()=>{this.menuCalibrate.clearTint()}}),this.menuSelectLevel.addPinchCallbacks({startPinch:()=>{this.scene.start(Wt,this.levels)},startHover:()=>{this.menuSelectLevel.setTintFill(nt)},endHover:()=>{this.menuSelectLevel.clearTint()}}),this.menuOptions.addPinchCallbacks({startPinch:()=>{this.scene.start(Rt)},startHover:()=>{this.menuOptions.setTintFill(nt)},endHover:()=>{this.menuOptions.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(Rt),this.options=[]}saveAndExit(){var t;t=this.configData,Zt(X),JSON.stringify(t),ne(t),de.setVisibility(this.configData.enableCameraVisibility),null!=this.rotateTween&&this.rotateTween.destroy(),this.scene.start(Nt)}preload(){return ze(this,void 0,void 0,(function*(){this.load.audio(_,Zt(q)),this.load.image(P,Zt("assets/ui/options_background.png")),this.load.image(H,Zt(R)),this.load.image(I,Zt("assets/ui/reset_button.png")),this.load.image(S,Zt(z)),yield re().then((t=>{this.configData=t})),yield oe().then((t=>{this.defaultData=t}))}))}create(){super.create(),this.backToMenu=new ke(this,new o(Ge-.1*Re,.9*qe),Ht,H,_,!0),this.resetConfig=new ke(this,new o(Ge+.1*Re,.9*qe),Ht,I,_,!0),this.input.keyboard.on(gt,(()=>{this.saveAndExit()})),this.add.sprite(.09*Re,.05*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.185*qe),this.add.sprite(.09*Re,.26*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.27*qe),this.add.sprite(.09*Re,.55*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.23*qe),this.add.sprite(.63*Re,.05*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.185*qe),this.add.sprite(.63*Re,.26*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.27*qe),this.add.sprite(.63*Re,.55*qe,P).setOrigin(0,0).setAlpha(.8).setDisplaySize(.28*Re,.23*qe);const t=this.add.sprite(.5*Re,Ue+0*Xe+.15*qe,S).setTint(Y[et]).setScale(this.configData.targetSize);this.rotateTween=this.tweens.add({targets:[t],rotation:2*Math.PI,ease:"Power0",duration:1e3,repeat:-1}),this.configData.fancyEffectsDisabled&&null!=this.rotateTween&&this.rotateTween.pause();const e=new Ne(this,new o($e,Ue+0*Xe),es,new o(0,Vt.y),this.configData,"targetSize",new o(.5,3),(e=>{e.label.setText("Target Scale: "+e.getStringValue());const s=e.getValue();this.configData[e.key]=s,t.setScale(s)}));this.options.push(e),this.add.existing(e);const s=new Ne(this,new o($e,Ue+1*Xe),es,new o(0,Vt.y),this.configData,"fingerSize",new o(.5,3),(t=>{null!=t.label&&t.label.setText("Finger Scale: "+t.getStringValue());const e=t.getValue();this.configData[t.key]=e,this.hand.setFingerScale(e)}));this.options.push(s),this.add.existing(s);const i=t=>{null!=t&&t.active&&(null!=t.label&&t.label.active&&t.label.setText("Camera Opacity: "+t.getStringValue()),this.configData[t.key]=t.getValue(),this.setOpacity(this.configData[t.key]))},n=new Ne(this,new o($e,Qe+0*Ye),es,Vt,this.configData,"cameraOpacity",new o(.01,1),i),a=new We(this,new o($e,Qe+0*Ye+Mt.y),25,void 0,Ut,this.configData,"enableCameraVisibility",(t=>{this.configData[t.key]=t.isChecked,de.setVisibility(t.isChecked),t.isChecked?n.draw():(n.setValue(this.defaultData.cameraOpacity),i(n),this.setOpacity(0),n.hide("Show Camera"))}));this.options.push(n),this.options.push(a),this.add.existing(n),this.add.existing(a);const r=new Ne(this,new o($e,Qe+1*Ye),es,Vt,this.configData,"skipLoopThreshold",new o(1,16),(t=>{t.label.setText("Skip Button After Loop: "+t.getStringValue()),this.configData[t.key]=t.getValue()})).setIsInteger(!0),h=new We(this,new o($e,Qe+1*Ye+Mt.y),25,void 0,Ut,this.configData,"enableSkipButton",(t=>{this.configData[t.key]=t.isChecked,t.isChecked?r.draw():r.hide("Show Layer Skip Button")}));this.options.push(r),this.options.push(h),this.add.existing(r),this.add.existing(h);const l=new Ne(this,new o($e,Qe+2*Ye),es,Vt,this.configData,"autoSkipThreshold",new o(1,16),(t=>{t.label.setText("Skip Layers After Loop: "+t.getStringValue()),this.configData[t.key]=t.getValue()})).setIsInteger(!0),d=new We(this,new o($e,Qe+2*Ye+Mt.y),25,void 0,Ut,this.configData,"enableAutoSkip",(t=>{this.configData[t.key]=t.isChecked,t.isChecked?l.draw():l.hide("Skip Layers Automatically")}));this.options.push(l),this.options.push(d),this.add.existing(l),this.add.existing(d);const c=new We(this,new o($e,Ze+0*ts),25,new o(-Mt.x,0),"Disable Layer Progression",this.configData,"disableLayerProgression",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(c),this.add.existing(c);const u=new We(this,new o($e,Ze+1*ts),25,new o(-Mt.x,0),"Index Finger Pinches Only",this.configData,"indexFingerOnly",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(u),this.add.existing(u);const g=new We(this,new o($e,Ze+2*ts),25,new o(-Mt.x,0),"Disable Fancy Effects",this.configData,"fancyEffectsDisabled",(e=>{this.configData[e.key]=e.isChecked,e.isChecked?null!=this.rotateTween&&this.rotateTween.pause():e.isChecked||null!=this.rotateTween&&null!=t&&this.rotateTween.resume()}));this.options.push(g),this.add.existing(g);const p=new Ne(this,new o(Je,Ue+0*Xe),es,new o(0,Vt.y),this.configData,"onTimeDuration",new o(50,1e3),(t=>{t.label.setText("On Time Duration: "+t.getStringValue()+" ms"),this.configData[t.key]=t.getValue()})).setIsInteger(!0);this.options.push(p),this.add.existing(p);const v=new Ne(this,new o(Je,Ue+1*Xe),es,new o(0,Vt.y),this.configData,"lateTimeDuration",new o(50,1e3),(t=>{t.label.setText("Late Time Duration: "+t.getStringValue()+" ms"),this.configData[t.key]=t.getValue()})).setIsInteger(!0);this.options.push(v),this.add.existing(v);const m=new Ne(this,new o(Je,Qe+0*Ye),es,new o(0,Vt.y),this.configData,"sonificationLevel",new o(0,1),(t=>{t.label.setText("Pinch Volume: "+t.getStringValue()),this.configData[t.key]=t.getValue()}));this.options.push(m),this.add.existing(m);const y=new Ne(this,new o(Je,Qe+1*Ye),es,new o(0,Vt.y),this.configData,"backgroundMusicLevel",new o(0,1),(t=>{t.label.setText("Track Volume: "+t.getStringValue()),this.configData[t.key]=t.getValue()}));this.options.push(y),this.add.existing(y);const f=new We(this,new o(Je,Ze+0*ts),25,new o(-Mt.x,0),"Disable Visual Metronome",this.configData,"disableVisualMetronome",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(f),this.add.existing(f);const b=new We(this,new o(Je,Ze+1*ts),25,new o(-Mt.x,0),"Disable Sonification",this.configData,"disableSonification",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(b),this.add.existing(b);const w=new We(this,new o(Je,Ze+2*ts),25,new o(-Mt.x,0),"Automatically Save CSV",this.configData,"autoSaveCSV",(t=>{this.configData[t.key]=t.isChecked}));this.options.push(w),this.add.existing(w),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.saveAndExit()},startHover:()=>{this.backToMenu.setTintFill(nt)},endHover:()=>{this.backToMenu.clearTint()}}),this.resetConfig.addPinchCallbacks({startPinch:()=>ze(this,void 0,void 0,(function*(){this.configData=yield oe();for(const t of this.options)t.reset(this.configData)})),startHover:()=>{this.resetConfig.setTintFill(nt)},endHover:()=>{this.resetConfig.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(Wt),this.currentLevelIndex=0,this.difficultyButtons=[],this.levels=[],Qt(this.currentLevelIndex>=0,"Level select default level must be >= 0")}preload(){this.levels=this.scene.settings.data,Qt(this.currentLevelIndex{this.scene.start(Nt),this.exit()})),this.add.sprite(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,y).setScale(Ot.x,Ot.y).setOrigin(.5,.5),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.scene.start(Nt),this.exit()},startHover:()=>{this.backToMenu.setTintFill(nt)},endHover:()=>{this.backToMenu.clearTint()}}),this.play.addPinchCallbacks({startPinch:()=>{this.startLevel(this.getCurrentLevel())},startHover:()=>{this.play.setTintFill(nt)},endHover:()=>{this.play.clearTint()}}),this.add.sprite(s,e*It,f).setTintFill(0).setScale(.4,.4).setOrigin(.5,.5),this.songName=this.add.text(s,e*It,Ut,{font:"50px Courier New"}).setColor("white").setOrigin(.5,.5),this.updateLevel(0),this.previousLevel.addPinchCallbacks({startPinch:()=>{this.updateLevel(-1)},startHover:()=>{this.previousLevel.setTintFill(nt)},endHover:()=>{this.previousLevel.clearTint()}}),this.nextLevel.addPinchCallbacks({startPinch:()=>{this.updateLevel(1)},startHover:()=>{this.nextLevel.setTintFill(nt)},endHover:()=>{this.nextLevel.clearTint()}}),this.muteButton.addToggleCallback((t=>{this.setBackgroundAudioMute(!t)})),this.muteButton.addPinchCallbacks({startPinch:()=>{this.muteButton.toggle()},startHover:()=>{this.muteButton.setTintFill(nt)},endHover:()=>{this.muteButton.clearTint()}})}exit(){this.stopAudio()}startLevel(t){this.exit(),this.scene.start(Ft,t)}createDifficultyButtons(t){const e=window.innerWidth,s=window.innerHeight,i=.5*e;for(const t of this.difficultyButtons)t.destroy();this.difficultyButtons=[];const n=t.track.data.bpm,a=[B,D,O],r=[new o(i-.2*e,At*s),new o(i,At*s),new o(i+.2*e,At*s)];Qt(a.length>=n.length,"buttonKeys array length must at least match the number of track bpms"),Qt(r.length>=n.length,"positions array length must at least match the number of track bpms");for(let e=0;e{d.updateTint(),e&&(t.setBPM(d.bpmIndex),this.startPreview(t))})),d.addPinchCallbacks({startPinch:()=>{for(const t of this.getDifficultyButtons())t!=d&&t.setToggleState(!1);d.setToggleState(!0)},startHover:()=>{d.setTintFill(nt)},endHover:()=>{d.updateTint()}}),this.difficultyButtons.push(d)}}getDifficultyButtons(){return this.difficultyButtons}setBackgroundAudioMute(t){for(const e of this.levels)e.setBackgroundAudioMute(t)}startVideo(t){if(null!=this.videoPreview&&this.videoPreview.destroy(),t.hasPreviewVideo()){this.videoPreview=this.add.video(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,t.getPreviewVideoKey()).setScale(Ot.x,Ot.y).setOrigin(.5,.5);const e=t.track.data.bpm[t.bpmIndex]/t.track.data.bpm[0];this.videoPreview.video&&(this.videoPreview.video.playbackRate=e),this.videoPreview.play(!0)}else this.videoPreview=this.add.sprite(.5*window.innerWidth,.5*window.innerHeight-.1*window.innerHeight,W).setScale(Ot.x,Ot.y).setOrigin(.5,.5)}startPreview(t){this.stopAudio(),t.addBackgroundAudio(this,{loop:!0,volume:.5*ie.backgroundMusicLevel}),t.playBackgroundAudio(),t.setBackgroundAudioMute(!this.muteButton.getToggleState());const e=1e3*t.getAudioLoopTime();this.videoRefreshEvent=this.time.addEvent({delay:e,callback:()=>{this.startVideo(t)},callbackScope:this,loop:!0,startAt:e})}stopAudio(){this.videoRefreshEvent&&this.videoRefreshEvent.destroy();for(const t of this.levels)t.removeBackgroundAudio(this)}updateLevel(t){this.cycleLevel(t);const e=this.getCurrentLevel();this.songName.setText(e.track.data.displayName),this.startPreview(e),this.createDifficultyButtons(e)}cycleLevel(t){const e=this.levels.length;this.currentLevelIndex=((this.currentLevelIndex+t)%e+e)%e}getCurrentLevel(){return Qt(this.currentLevelIndex{this.level.abort()})),this.level.start((()=>{this.scene.start(jt,this.level)}),(()=>{this.scene.start(Nt)}))}update(t,e){super.update(t,e),this.level.update(t)}},class extends xe{constructor(){super(jt)}exit(){this.level.removeBackgroundAudio(this),this.scene.start(Nt)}preload(){this.load.audio(_,Zt(q)),this.load.image(H,Zt(R)),this.load.image(A,Zt(G)),this.load.image(E,Zt($)),this.load.image(j,Zt("assets/ui/save_csv_button.png")),this.load.image(b,Zt("assets/ui/layer_score_background.png")),this.load.image(w,Zt("assets/ui/scoreboard_background.png")),this.level=this.scene.settings.data,this.levelStats=this.level.score.levelStats,ie.autoSaveCSV&&he(this.level.score.levelStats)}create(){super.create();const t=window.innerWidth,e=window.innerHeight,s=.5*t,i=Math.min(t/1920,e/1080);this.backToMenu=new ke(this,new o(s,.9*e),Ht,H,_,!0),this.muteButton=new Ee(this,new o(s+.45*t,.9*e),_t,A,E,_,!0,!0),this.level.addBackgroundAudio(this,{loop:!0,volume:.5*ie.backgroundMusicLevel}),this.level.playBackgroundAudio(),this.muteButton.addToggleCallback((t=>{this.level.setBackgroundAudioMute(!t)})),this.muteButton.addPinchCallbacks({startPinch:()=>{this.muteButton.toggle()},startHover:()=>{this.muteButton.setTintFill(nt)},endHover:()=>{this.muteButton.clearTint()}}),this.input.keyboard.on(gt,(()=>{this.exit()})),ie.autoSaveCSV||(this.saveButton=new ke(this,new o(s-.4*t,.9*e),new o(.6,.6),j,_,!0),this.saveButton.addPinchCallbacks({startPinch:()=>{he(this.levelStats),me(this.saveButton,!1)},startHover:()=>{this.saveButton.setTintFill(nt)},endHover:()=>{this.saveButton.clearTint()}})),this.add.sprite(0,0,w).setOrigin(.5,.5).setScale(1.35*i,1.25*i).setAlpha(.6).setPosition(s,.25*e);const n=this.add.text(s,0,"Scoreboard",{color:"#01c303",font:96*i+"px Arial"});n.setStroke("#000",6*i),n.setPosition(s-n.width/2,.07*e);const a=this.levelStats.layersStats.reduce(((t,e)=>t+e.total),0),r=this.levelStats.layersStats.reduce(((t,e)=>t+e.correct),0),h=this.levelStats.layersStats.reduce(((t,e)=>t+e.miss),0),l=this.levelStats.layersStats.reduce(((t,e)=>t+e.early),0),d=this.levelStats.layersStats.reduce(((t,e)=>t+e.late),0),c=this.add.text(s,0,`Total Correct: ${r.toString()}/${a.toString()}\nLongest Streak: ${this.levelStats.maxStreak}\nMissed: ${h}\nEarly: ${l}\nLate: ${d}`,{color:"#ffffff",align:"center",font:48*i+"px Arial"});c.setPosition(s-c.width/2,.19*e);const u=[.25,.5,.75],g=u;this.level.track.forEachLayer(void 0,((s,n)=>{this.add.sprite(0,0,b).setOrigin(.5,.5).setScale(1.35*i,1.15*i).setAlpha(.6).setPosition(t*u[n],.63*e);const a=this.add.text(0,0,`${o=s.id,o&&o[0].toUpperCase()+o.slice(1)||""}`,{color:"#01c303",align:"center",font:72*i+"px Arial",fontStyle:"bold"});var o;a.setStroke("#000",4*i),a.setPosition(t*g[n]-a.width/2,.53*e);const r=this.levelStats.layersStats[n];let h=0,l=0,d=0;null!=r&&(h=r.correct,l=r.total,d=r.loop);const c=this.add.text(0,0,`\nCorrect: ${h.toString()}/${l.toString()}\nLoops: ${d.toString()}`,{color:"#ffffff",align:"center",font:48*i+"px Arial"});c.setPosition(t*g[n]-c.width/2,.575*e+.01)})),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.exit()},startHover:()=>{this.backToMenu.setTintFill(nt)},endHover:()=>{this.backToMenu.clearTint()}})}update(t,e){super.update(t,e)}},class extends xe{constructor(){super(zt)}exit(){this.scene.start(Nt)}preload(){this.load.image(H,Zt(R)),this.load.audio(_,Zt(q)),this.load.image(M,Zt("assets/ui/calibration_background.png"))}create(){super.create(!0,.8);const t=window.innerWidth,e=window.innerHeight,s=.5*t;this.backToMenu=new ke(this,new o(s,.9*e),Ht,H,_,!0),this.setBackgroundTexture(M),this.input.keyboard.on(gt,(()=>{this.exit()})),this.distanceText=this.add.text(s,.1*e,Ut,{color:"white",font:"60px Arial"}).setShadow(5,5,"rgba(0,0,0,0.5)",15).setOrigin(.5,.5),this.backToMenu.addPinchCallbacks({startPinch:()=>{this.exit()},startHover:()=>{this.backToMenu.setTintFill(nt)},endHover:()=>{this.backToMenu.clearTint()}})}update(t,e){super.update(t,e);const s=this.hand.calculateHandDistance();let i="Hand Not Recognized";if(s>0){let t=65280;s>40?(i="Too Far - Estimated Distance: ",t=16711680):s<20?(i="Too Close - Estimated Distance: ",t=255):i="Just Right - Estimated Distance: ",this.setBackgroundTint(t),i+=s.toFixed(0)+" cm"}else this.clearBackgroundTint();null!=this.distanceText&&this.distanceText.active&&this.distanceText.setText(i)}}]};new(n().Game)(ss)}},s={};function i(t){var n=s[t];if(void 0!==n)return n.exports;var a=s[t]={exports:{}};return e[t].call(a.exports,a,a.exports,i),a.exports}i.m=e,t=[],i.O=(e,s,n,a)=>{if(!s){var o=1/0;for(d=0;d=a)&&Object.keys(i.O).every((t=>i.O[t](s[h])))?s.splice(h--,1):(r=!1,a0&&t[d-1][2]>a;d--)t[d]=t[d-1];t[d]=[s,n,a]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={792:0};i.O.j=e=>0===t[e];var e=(e,s)=>{var n,a,[o,r,h]=s,l=0;if(o.some((e=>0!==t[e]))){for(n in r)i.o(r,n)&&(i.m[n]=r[n]);if(h)var d=h(i)}for(e&&e(s);li(852)));n=i.O(n)})(); \ No newline at end of file diff --git a/manifest.json b/manifest.json index c762013..3e2612e 100644 --- a/manifest.json +++ b/manifest.json @@ -1,20 +1,15 @@ { - "short_name": "Phaser Game", - "name": "My Cool Phaser 3 Game", + "short_name": "Pizzicato", + "name": "Pizzicato", "icons": [ { - "src": "./icons/icons-192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "./icons/icons-512.png", - "type": "image/png", - "sizes": "512x512" + "src": "./icons/icon.ico", + "type": "image/x-icon", + "sizes": "256x256" } ], "start_url": "./index.html", - "background_color": "#e6e6e6", + "background_color": "#000000", "display": "fullscreen", "orientation": "landscape", "scope": "./", diff --git a/models/wasm/vision_wasm_internal.js b/models/wasm/vision_wasm_internal.js index 441d704..9312bb1 100644 --- a/models/wasm/vision_wasm_internal.js +++ b/models/wasm/vision_wasm_internal.js @@ -1 +1 @@ -var ModuleFactory=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){var t,n,o=r;o.ready=new Promise(((e,r)=>{t=e,n=r}));var a,i,s,u=Object.assign({},o),c="./this.program",l=(e,r)=>{throw r},d="object"==typeof window,m="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(f){var g=require("fs"),v=require("path");p=m?v.dirname(p)+"/":__dirname+"/",a=(e,r)=>(e=Y(e)?new URL(e):v.normalize(e),g.readFileSync(e,r?void 0:"utf8")),s=e=>{var r=a(e,!0);return r.buffer||(r=new Uint8Array(r)),r},i=(e,r,t,n=!0)=>{e=Y(e)?new URL(e):v.normalize(e),g.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!o.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,r)=>{throw process.exitCode=e,r},o.inspect=()=>"[Emscripten Module object]"}else(d||m)&&(m?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},m&&(s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)});var h,y,w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit),o.wasmBinary&&(h=o.wasmBinary),"object"!=typeof WebAssembly&&j("no native wasm support detected");var _,E,x,S,k,L,C,P,F,B=!1;function T(e,r){e||j(r)}function D(){var e=y.buffer;o.HEAP8=E=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=x=new Uint8Array(e),o.HEAPU16=k=new Uint16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU32=C=new Uint32Array(e),o.HEAPF32=P=new Float32Array(e),o.HEAPF64=F=new Float64Array(e)}var A=[],M=[],I=[],V=[],R=0,O=null,z=null;function U(e){R++,o.monitorRunDependencies&&o.monitorRunDependencies(R)}function N(e){if(R--,o.monitorRunDependencies&&o.monitorRunDependencies(R),0==R&&(null!==O&&(clearInterval(O),O=null),z)){var r=z;z=null,r()}}function j(e){o.onAbort&&o.onAbort(e),b(e="Aborted("+e+")"),B=!0,_=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var G,H,$,q,W=e=>e.startsWith("data:application/octet-stream;base64,"),Y=e=>e.startsWith("file://");function X(e){if(e==G&&h)return new Uint8Array(h);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function Q(e,r,t){return function(e){if(!h&&(d||m)){if("function"==typeof fetch&&!Y(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>X(e)));if(i)return new Promise(((r,t)=>{i(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>X(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{b(`failed to asynchronously prepare wasm: ${e}`),j(e)}))}W(G="vision_wasm_internal.wasm")||(H=G,G=o.locateFile?o.locateFile(H,p):p+H);var K,Z={1250538:e=>{const r=Ue.toValue(e).getContext("webgpu");return Sr.add(r.getCurrentTexture())},1250673:(e,r,t,n,o)=>{const a=Ue.toValue(e),i=Sr.get(r),s=Sr.get(t),u=n,c=o;i.queue.copyExternalImageToTexture({source:a},{texture:s},[u,c])},1250924:(e,r,t,n)=>{const o=Ue.toValue(e),a=Sr.get(r),i=Sr.get(t),s=Sr.get(n),u=a.createBindGroup({layout:s,entries:[{binding:0,resource:i},{binding:1,resource:o}]});return Sr.add(u)},1251272:(e,r)=>{const t=Ue.toValue(e),n=Ue.toValue(r),o=n.getContext("2d"),a=new ImageData(t,n.width,n.height);o.putImageData(a,0,0)},1251496:(e,r)=>{const t=Ue.toValue(e),n=Ue.toValue(r),o=t.getContext("2d").getImageData(0,0,t.width,t.height);n.set(o.data)},1251700:(e,r)=>{const t=Ue.toValue(e);Ue.toValue(r).getContext("2d").drawImage(t,0,0)},1251836:()=>"undefined"!=typeof HTMLCanvasElement,1251891:()=>!!o.preinitializedWebGPUDevice,1251942:()=>{wr["#canvas"]=o.canvas},1251993:()=>"undefined"!=typeof wasmOffsetConverter},J=(e,r)=>{if(ke.mainLoop.timingMode=e,ke.mainLoop.timingValue=r,!ke.mainLoop.func)return 1;if(ke.mainLoop.running||(ke.mainLoop.running=!0),0==e)ke.mainLoop.scheduler=function(){var e=0|Math.max(0,ke.mainLoop.tickStartTime+r-K());setTimeout(ke.mainLoop.runner,e)},ke.mainLoop.method="timeout";else if(1==e)ke.mainLoop.scheduler=function(){ke.requestAnimationFrame(ke.mainLoop.runner)},ke.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),setImmediate=function(e){t.push(e),m?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}ke.mainLoop.scheduler=function(){setImmediate(ke.mainLoop.runner)},ke.mainLoop.method="immediate"}return 0};K=()=>performance.now();var ee=e=>{if(e instanceof re||"unwind"==e)return _;l(1,e)};function re(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var te=()=>Ce||!1,ne={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=ne.isAbs(e),t="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=ne.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return ne.normalize(e.join("/"))},join2:(e,r)=>ne.normalize(e+"/"+r)},oe=e=>(oe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(f)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}j("initRandomDevice")})())(e),ae={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:he.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=ne.isAbs(n)}return(r?"/":"")+(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ae.resolve(e).substr(1),r=ae.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ie)return ie.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ue=[],ce=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},le=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function de(e,r,t){var n=t>0?t:ce(e)+1,o=new Array(n),a=le(e,o,0,o.length);return r&&(o.length=a),o}var me={ttys:[],init(){},shutdown(){},register(e,r){me.ttys[e]={input:[],output:[],ops:r},he.registerDevice(e,me.stream_ops)},stream_ops:{open(e){var r=me.ttys[e.node.rdev];if(!r)throw new he.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var a=0,i=0;i(()=>{if(!ue.length){var e=null;if(f){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ue=de(e,!0)}return ue.shift()})(),put_char(e,r){null===r||10===r?(w(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(w(se(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(b(se(e.output,0)),e.output=[])}}},fe=e=>{e=((e,r)=>65536*Math.ceil(e/65536))(e);var r=et(65536,e);return r?((e,r)=>(x.fill(0,e,e+r),e))(r,e):0},pe={ops_table:null,mount:e=>pe.createNode(null,"/",16895,0),createNode(e,r,t,n){if(he.isBlkdev(t)||he.isFIFO(t))throw new he.ErrnoError(63);pe.ops_table||(pe.ops_table={dir:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,lookup:pe.node_ops.lookup,mknod:pe.node_ops.mknod,rename:pe.node_ops.rename,unlink:pe.node_ops.unlink,rmdir:pe.node_ops.rmdir,readdir:pe.node_ops.readdir,symlink:pe.node_ops.symlink},stream:{llseek:pe.stream_ops.llseek}},file:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:{llseek:pe.stream_ops.llseek,read:pe.stream_ops.read,write:pe.stream_ops.write,allocate:pe.stream_ops.allocate,mmap:pe.stream_ops.mmap,msync:pe.stream_ops.msync}},link:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,readlink:pe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:he.chrdev_stream_ops}});var o=he.createNode(e,r,t,n);return he.isDir(o.mode)?(o.node_ops=pe.ops_table.dir.node,o.stream_ops=pe.ops_table.dir.stream,o.contents={}):he.isFile(o.mode)?(o.node_ops=pe.ops_table.file.node,o.stream_ops=pe.ops_table.file.stream,o.usedBytes=0,o.contents=null):he.isLink(o.mode)?(o.node_ops=pe.ops_table.link.node,o.stream_ops=pe.ops_table.link.stream):he.isChrdev(o.mode)&&(o.node_ops=pe.ops_table.chrdev.node,o.stream_ops=pe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=he.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,he.isDir(e.mode)?r.size=4096:he.isFile(e.mode)?r.size=e.usedBytes:he.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&pe.resizeFileStorage(e,r.size)},lookup(e,r){throw he.genericErrors[44]},mknod:(e,r,t,n)=>pe.createNode(e,r,t,n),rename(e,r,t){if(he.isDir(e.mode)){var n;try{n=he.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new he.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=he.lookupNode(e,r);for(var n in t.contents)throw new he.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=pe.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r(pe.stream_ops.write(e,r,0,n,t,!1),0)}},ge=o.preloadPlugins||[],ve=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=ae.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new he.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=he.root,o="/",a=0;a40)throw new he.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(he.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n>>0)%he.nameTable.length},hashAddNode(e){var r=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[r],he.nameTable[r]=e},hashRemoveNode(e){var r=he.hashName(e.parent.id,e.name);if(he.nameTable[r]===e)he.nameTable[r]=e.name_next;else for(var t=he.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=he.mayLookup(e);if(t)throw new he.ErrnoError(t,e);for(var n=he.hashName(e.id,r),o=he.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return he.lookup(e,r)},createNode(e,r,t,n){var o=new he.FSNode(e,r,t,n);return he.hashAddNode(o),o},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>he.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>he.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return he.lookupNode(e,r),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=he.lookupNode(e,r)}catch(e){return e.errno}var o=he.nodePermissions(e,"wx");if(o)return o;if(t){if(!he.isDir(n.mode))return 54;if(he.isRoot(n)||he.getPath(n)===he.cwd())return 10}else if(he.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(r)||512&r)?31:he.nodePermissions(e,he.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);return r},getStream:e=>he.streams[e],createStream:(e,r=-1)=>(he.FSStream||(he.FSStream=function(){this.shared={}},he.FSStream.prototype={},Object.defineProperties(he.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new he.FSStream,e),-1==r&&(r=he.nextfd()),e.fd=r,he.streams[r]=e,e),closeStream(e){he.streams[e]=null},chrdev_stream_ops:{open(e){var r=he.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){he.devices[e]={stream_ops:r}},getDevice:e=>he.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&b(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=he.getMounts(he.root.mount),n=0;function o(e){return he.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&he.root)throw new he.ErrnoError(10);if(!o&&!a){var i=he.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,he.isMountpoint(n))throw new he.ErrnoError(10);if(!he.isDir(n.mode))throw new he.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?he.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(r.node))throw new he.ErrnoError(28);var t=r.node,n=t.mounted,o=he.getMounts(n);Object.keys(he.nameTable).forEach((e=>{for(var r=he.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&he.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=he.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new he.ErrnoError(28);var a=he.mayCreate(n,o);if(a)throw new he.ErrnoError(a);if(!n.node_ops.mknod)throw new he.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,he.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,he.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,he.mknod(e,r,t)),symlink(e,r){if(!ae.resolve(e))throw new he.ErrnoError(44);var t=he.lookupPath(r,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=ne.basename(r),o=he.mayCreate(t,n);if(o)throw new he.ErrnoError(o);if(!t.node_ops.symlink)throw new he.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=ne.dirname(e),a=ne.dirname(r),i=ne.basename(e),s=ne.basename(r);if(t=he.lookupPath(e,{parent:!0}).node,n=he.lookupPath(r,{parent:!0}).node,!t||!n)throw new he.ErrnoError(44);if(t.mount!==n.mount)throw new he.ErrnoError(75);var u,c=he.lookupNode(t,i),l=ae.relative(e,a);if("."!==l.charAt(0))throw new he.ErrnoError(28);if("."!==(l=ae.relative(r,o)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(n,s)}catch(e){}if(c!==u){var d=he.isDir(c.mode),m=he.mayDelete(t,i,d);if(m)throw new he.ErrnoError(m);if(m=u?he.mayDelete(n,s,d):he.mayCreate(n,s))throw new he.ErrnoError(m);if(!t.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(c)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(n!==t&&(m=he.nodePermissions(t,"w")))throw new he.ErrnoError(m);he.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{he.hashAddNode(c)}}},rmdir(e){var r=he.lookupPath(e,{parent:!0}).node,t=ne.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!0);if(o)throw new he.ErrnoError(o);if(!r.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.rmdir(r,t),he.destroyNode(n)},readdir(e){var r=he.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new he.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=he.lookupPath(e,{parent:!0}).node;if(!r)throw new he.ErrnoError(44);var t=ne.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!1);if(o)throw new he.ErrnoError(o);if(!r.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.unlink(r,t),he.destroyNode(n)},readlink(e){var r=he.lookupPath(e).node;if(!r)throw new he.ErrnoError(44);if(!r.node_ops.readlink)throw new he.ErrnoError(28);return ae.resolve(he.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=he.lookupPath(e,{follow:!r}).node;if(!t)throw new he.ErrnoError(44);if(!t.node_ops.getattr)throw new he.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>he.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?he.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new he.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){he.chmod(e,r,!0)},fchmod(e,r){var t=he.getStreamChecked(e);he.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new he.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){he.chown(e,r,t,!0)},fchown(e,r,t){var n=he.getStreamChecked(e);he.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new he.ErrnoError(28);var t;if(!(t="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new he.ErrnoError(63);if(he.isDir(t.mode))throw new he.ErrnoError(31);if(!he.isFile(t.mode))throw new he.ErrnoError(28);var n=he.nodePermissions(t,"w");if(n)throw new he.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=he.getStreamChecked(e);if(0==(2097155&t.flags))throw new he.ErrnoError(28);he.truncate(t.node,r)},utime(e,r,t){var n=he.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new he.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=he.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new he.ErrnoError(20)}else n=he.mknod(e,t,0),a=!0;if(!n)throw new he.ErrnoError(44);if(he.isChrdev(n.mode)&&(r&=-513),65536&r&&!he.isDir(n.mode))throw new he.ErrnoError(54);if(!a){var i=he.mayOpen(n,r);if(i)throw new he.ErrnoError(i)}512&r&&!a&&he.truncate(n,0),r&=-131713;var s=he.createStream({node:n,path:he.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(he.readFiles||(he.readFiles={}),e in he.readFiles||(he.readFiles[e]=1)),s},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(r<0||t<=0)throw new he.ErrnoError(28);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(!he.isFile(e.node.mode)&&!he.isDir(e.node.mode))throw new he.ErrnoError(43);if(!e.stream_ops.allocate)throw new he.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=he.open(e,r.flags),o=he.stat(e).size,a=new Uint8Array(o);return he.read(n,a,0,o,0),"utf8"===r.encoding?t=se(a,0):"binary"===r.encoding&&(t=a),he.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=he.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ce(r)+1),a=le(r,o,0,o.length);he.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");he.write(n,r,0,r.byteLength,void 0,t.canOwn)}he.close(n)},cwd:()=>he.currentPath,chdir(e){var r=he.lookupPath(e,{follow:!0});if(null===r.node)throw new he.ErrnoError(44);if(!he.isDir(r.node.mode))throw new he.ErrnoError(54);var t=he.nodePermissions(r.node,"x");if(t)throw new he.ErrnoError(t);he.currentPath=r.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),he.mkdev("/dev/null",he.makedev(1,3)),me.register(he.makedev(5,0),me.default_tty_ops),me.register(he.makedev(6,0),me.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=oe(e).byteLength),e[--r]);he.createDevice("/dev","random",t),he.createDevice("/dev","urandom",t),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var r=he.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=he.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?he.createDevice("/dev","stdin",o.stdin):he.symlink("/dev/tty","/dev/stdin"),o.stdout?he.createDevice("/dev","stdout",null,o.stdout):he.symlink("/dev/tty","/dev/stdout"),o.stderr?he.createDevice("/dev","stderr",null,o.stderr):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},ensureErrnoError(){he.ErrnoError||(he.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},he.ErrnoError.prototype=new Error,he.ErrnoError.prototype.constructor=he.ErrnoError,[44].forEach((e=>{he.genericErrors[e]=new he.ErrnoError(e),he.genericErrors[e].stack=""})))},staticInit(){he.ensureErrnoError(),he.nameTable=new Array(4096),he.mount(pe,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:pe}},init(e,r,t){he.init.initialized=!0,he.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,he.createStandardStreams()},quit(){he.init.initialized=!1;for(var e=0;ethis.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):de(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=he.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=u.stream_ops[e];c[e]=function(){return he.forceLoadFile(u),r.apply(null,arguments)}})),c.read=(e,r,t,n,o)=>(he.forceLoadFile(u),l(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{he.forceLoadFile(u);var a=fe(r);if(!a)throw new he.ErrnoError(48);return l(e,E,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u}},ye=(e,r)=>e?se(x,e,r):"",we={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(ne.isAbs(r))return r;var n;if(n=-100===e?he.cwd():we.getStreamFromFD(e).path,0==r.length){if(!t)throw new he.ErrnoError(44);return n}return ne.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&ne.normalize(r)!==ne.normalize(he.getPath(e.node)))return-54;throw e}L[t>>2]=n.dev,L[t+4>>2]=n.mode,C[t+8>>2]=n.nlink,L[t+12>>2]=n.uid,L[t+16>>2]=n.gid,L[t+20>>2]=n.rdev,q=[n.size>>>0,($=n.size,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+24>>2]=q[0],L[t+28>>2]=q[1],L[t+32>>2]=4096,L[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return q=[Math.floor(o/1e3)>>>0,($=Math.floor(o/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+40>>2]=q[0],L[t+44>>2]=q[1],C[t+48>>2]=o%1e3*1e3,q=[Math.floor(a/1e3)>>>0,($=Math.floor(a/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+56>>2]=q[0],L[t+60>>2]=q[1],C[t+64>>2]=a%1e3*1e3,q=[Math.floor(i/1e3)>>>0,($=Math.floor(i/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+72>>2]=q[0],L[t+76>>2]=q[1],C[t+80>>2]=i%1e3*1e3,q=[n.ino>>>0,($=n.ino,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+88>>2]=q[0],L[t+92>>2]=q[1],0},doMsync(e,r,t,n,o){if(!he.isFile(r.node.mode))throw new he.ErrnoError(43);if(2&n)return 0;var a=x.slice(e,e+t);he.msync(r,a,o,t,n)},varargs:void 0,get(){var e=L[+we.varargs>>2];return we.varargs+=4,e},getp:()=>we.get(),getStr:e=>ye(e),getStreamFromFD:e=>he.getStreamChecked(e)},be=e=>{_=e,te()||(o.onExit&&o.onExit(e),B=!0),l(e,new re(e))},_e=(e,r)=>{_=e,be(e)},Ee=e=>{if(!B)try{e(),(()=>{if(!te())try{_e(_)}catch(e){ee(e)}})()}catch(e){ee(e)}},xe=(e,r)=>setTimeout((()=>{Ee(e)}),r),Se=e=>{Se.shown||(Se.shown={}),Se.shown[e]||(Se.shown[e]=1,f&&(e="warning: "+e),b(e))},ke={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){ke.mainLoop.scheduler=null,ke.mainLoop.currentlyRunningMainloop++},resume(){ke.mainLoop.currentlyRunningMainloop++;var e=ke.mainLoop.timingMode,r=ke.mainLoop.timingValue,t=ke.mainLoop.func;ke.mainLoop.func=null,((e,r,t,n,o)=>{T(!ke.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ke.mainLoop.func=e,ke.mainLoop.arg=n;var a=ke.mainLoop.currentlyRunningMainloop;function i(){return!(a0){Date.now();var r=ke.mainLoop.queue.shift();if(r.func(r.arg),ke.mainLoop.remainingBlockers){var t=ke.mainLoop.remainingBlockers,n=t%1==0?t-1:Math.floor(t);r.counted?ke.mainLoop.remainingBlockers=n:(n+=.5,ke.mainLoop.remainingBlockers=(8*t+n)/9)}if(ke.mainLoop.updateStatus(),!i())return;setTimeout(ke.mainLoop.runner,0)}else i()&&(ke.mainLoop.currentFrameNumber=ke.mainLoop.currentFrameNumber+1|0,1==ke.mainLoop.timingMode&&ke.mainLoop.timingValue>1&&ke.mainLoop.currentFrameNumber%ke.mainLoop.timingValue!=0?ke.mainLoop.scheduler():(0==ke.mainLoop.timingMode&&(ke.mainLoop.tickStartTime=K()),vr.newRenderingFrameStarted(),ke.mainLoop.runIter(e),i()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),ke.mainLoop.scheduler())))}})(t,0,0,ke.mainLoop.arg),J(e,r),ke.mainLoop.scheduler()},updateStatus(){if(o.setStatus){var e=o.statusMessage||"Please wait...",r=ke.mainLoop.remainingBlockers,t=ke.mainLoop.expectedBlockers;r?r{T(i.complete,`Image ${r} could not be decoded`);var n=document.createElement("canvas");n.width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0),Nr[r]=n,URL.revokeObjectURL(a),t&&t(e)},i.onerror=e=>{b(`Image ${a} could not be decoded`),n&&n()},i.src=a}};ge.push(e);var r={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var o=!1;function a(n){o||(o=!0,jr[r]=n,t&&t(e))}var i=new Blob([e],{type:ke.getMimetype(r)}),s=URL.createObjectURL(i),u=new Audio;u.addEventListener("canplaythrough",(()=>a(u)),!1),u.onerror=function(t){o||(b(`warning: browser could not fully decode audio ${r}, trying slower base64 approach`),u.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,o=0,a=0;a=6;){var i=n>>o-6&63;o-=6,t+=r[i]}return 2==o?(t+=r[(3&n)<<4],t+="=="):4==o&&(t+=r[(15&n)<<2],t+="="),t}(e),a(u))},u.src=s,xe((()=>{a(u)}),1e4)}};ge.push(r);var t=o.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&t.addEventListener("click",(e=>{!ke.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ke.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext(e,r,t,n){if(r&&o.ctx&&e==o.canvas)return o.ctx;var a,i;if(r){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==vr&&(i=vr.createContext(e,s))&&(a=vr.getContext(i).GLctx)}else a=e.getContext("2d");return a?(t&&(r||T(void 0===Ur,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=a,r&&vr.makeContextCurrent(i),o.useWebGL=r,ke.moduleContextCreatedCallbacks.forEach((e=>e())),ke.init()),a):null},destroyContext(e,r,t){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,r){ke.lockPointer=e,ke.resizeCanvas=r,void 0===ke.lockPointer&&(ke.lockPointer=!0),void 0===ke.resizeCanvas&&(ke.resizeCanvas=!1);var t=o.canvas;function n(){ke.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=ke.exitFullscreen,ke.lockPointer&&t.requestPointerLock(),ke.isFullscreen=!0,ke.resizeCanvas?ke.setFullscreenCanvasSize():ke.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),ke.resizeCanvas?ke.setWindowedCanvasSize():ke.updateCanvasDimensions(t)),o.onFullScreen&&o.onFullScreen(ke.isFullscreen),o.onFullscreen&&o.onFullscreen(ke.isFullscreen)}ke.fullscreenHandlersInstalled||(ke.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen:()=>!!ke.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var r=Date.now();if(0===ke.nextRAF)ke.nextRAF=r+1e3/60;else for(;r+2>=ke.nextRAF;)ke.nextRAF+=1e3/60;var t=Math.max(ke.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,ke.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,r)=>xe(e,r),safeRequestAnimationFrame:e=>ke.requestAnimationFrame((()=>{Ee(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent(e){if(ke.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ke.mouseMovementX=ke.mouseMovementY=0:(ke.mouseMovementX=ke.getMovementX(e),ke.mouseMovementY=ke.getMovementY(e)),"undefined"!=typeof SDL?(ke.mouseX=SDL.mouseX+ke.mouseMovementX,ke.mouseY=SDL.mouseY+ke.mouseMovementY):(ke.mouseX+=ke.mouseMovementX,ke.mouseY+=ke.mouseMovementY);else{var r=o.canvas.getBoundingClientRect(),t=o.canvas.width,n=o.canvas.height,a=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(a+r.left),c=s.pageY-(i+r.top),l={x:u*=t/r.width,y:c*=n/r.height};if("touchstart"===e.type)ke.lastTouches[s.identifier]=l,ke.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=ke.touches[s.identifier];d||(d=l),ke.lastTouches[s.identifier]=d,ke.touches[s.identifier]=l}return}var m=e.pageX-(a+r.left),f=e.pageY-(i+r.top);m*=t/r.width,f*=n/r.height,ke.mouseMovementX=m-ke.mouseX,ke.mouseMovementY=f-ke.mouseY,ke.mouseX=m,ke.mouseY=f}},resizeListeners:[],updateResizeListeners(){var e=o.canvas;ke.resizeListeners.forEach((r=>r(e.width,e.height)))},setCanvasSize(e,r,t){var n=o.canvas;ke.updateCanvasDimensions(n,e,r),t||ke.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e|=8388608,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e&=-8388609,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},updateCanvasDimensions(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/a{for(;e.length>0;)e.shift()(o)},Ce=o.noExitRuntime||!0;function Pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,E[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=E[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,E[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=E[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){if(it(this.get_type()))return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Fe,Be,Te=e=>{for(var r="",t=e;x[t];)r+=Fe[x[t++]];return r},De={},Ae={},Me={},Ie=e=>{throw new Be(e)};function Ve(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ie(`type "${n}" must have a positive integer typeid pointer`),Ae.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ie(`Cannot register type '${n}' twice`)}if(Ae[e]=r,delete Me[e],De.hasOwnProperty(e)){var o=De[e];delete De[e],o.forEach((e=>e()))}}(e,r,t)}function Re(){this.allocated=[void 0],this.freelist=[]}var Oe=new Re,ze=e=>{e>=Oe.reserved&&0==--Oe.get(e).refcount&&Oe.free(e)},Ue={toValue:e=>(e||Ie("Cannot use deleted val. handle = "+e),Oe.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Oe.allocate({refcount:1,value:e})}}};function Ne(e){return this.fromWireType(L[e>>2])}var je=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(P[e>>2])};case 8:return function(e){return this.fromWireType(F[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Ge=(e,r,t)=>{switch(r){case 1:return t?e=>E[e>>0]:e=>x[e>>0];case 2:return t?e=>S[e>>1]:e=>k[e>>1];case 4:return t?e=>L[e>>2]:e=>C[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function He(e){return this.fromWireType(C[e>>2])}var $e=(e,r,t)=>le(e,x,r,t),qe="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,We=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&k[n];)++n;if((t=n<<1)-e>32&&qe)return qe.decode(x.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Ye=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=i,r+=2}return S[r>>1]=0,r-n},Xe=e=>2*e.length,Qe=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=L[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ke=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),L[r>>2]=i,(r+=4)+4>o)break}return L[r>>2]=0,r-n},Ze=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},Je=(e,r)=>{var t,n,o=Ae[e];return void 0===o&&Ie(r+" has unknown type "+(t=Jr(e),n=Te(t),Qr(t),n)),o},er={},rr=e=>{var r=er[e];return void 0===r?Te(e):r},tr=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&e(global)?$$$embind_global$$$=global:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},nr=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,or=e=>e%4==0&&(e%100!=0||e%400==0),ar=[0,31,60,91,121,152,182,213,244,274,305,335],ir=[0,31,59,90,120,151,181,212,243,273,304,334],sr=e=>(or(e.getFullYear())?ar:ir)[e.getMonth()]+e.getDate()-1,ur=e=>{var r=ce(e)+1,t=Kr(r);return t&&$e(e,t,r),t},cr=[],lr=e=>{var r=(e-y.buffer.byteLength+65535)/65536;try{return y.grow(r),D(),1}catch(e){}},dr=e=>(j("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),mr={},fr=e=>{e.forEach((e=>{var r=dr();r&&(mr[r]=e)}))};function pr(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var gr,vr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){vr.lastError||(vr.lastError=e)},getNewId:e=>{for(var r=vr.counter++,t=e.length;t32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=vr.log2ceilLookup(vr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=vr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s>1,c=new Uint16Array(u),l=(n=0,0);c[n++]=l,!(n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var r=vr.log2ceilLookup(e),t=vr.currentContext.tempVertexBuffers1[r],n=vr.currentContext.tempVertexBufferCounters1[r];vr.currentContext.tempVertexBufferCounters1[r]=vr.currentContext.tempVertexBufferCounters1[r]+1&vr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=Ur.getParameter(34964);return t[n]=Ur.createBuffer(),Ur.bindBuffer(34962,t[n]),Ur.bufferData(34962,1<{for(var o="",a=0;a>2]:-1;o+=ye(L[t+4*a>>2],i<0?void 0:i)}return o},calcBufLength:function(e,r,t,n){return t>0?n*t:e*vr.byteSizeByType[r-vr.byteSizeByTypeRoot]*n},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){vr.resetBufferBinding=!1;for(var r=0;r{e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);return t?vr.registerContext(t,r):0},registerContext:(e,r)=>{var t=vr.getNewId(vr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),vr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&vr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o(vr.currentContext=vr.contexts[e],o.ctx=Ur=vr.currentContext&&vr.currentContext.GLctx,!(e&&!Ur)),getContext:e=>vr.contexts[e],deleteContext:e=>{vr.currentContext===vr.contexts[e]&&(vr.currentContext=null),"object"==typeof hr&&hr.removeAllHandlersOnTarget(vr.contexts[e].GLctx.canvas),vr.contexts[e]&&vr.contexts[e].GLctx.canvas&&(vr.contexts[e].GLctx.canvas.GLctxObject=void 0),vr.contexts[e]=null},initExtensions:e=>{if(e||(e=vr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),(e=>{e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")})(t),(t.getSupportedExtensions()||[]).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},hr={inEventHandler:0,removeAllEventListeners(){for(var e=hr.eventHandlers.length-1;e>=0;--e)hr._removeHandler(e);hr.eventHandlers=[],hr.deferredCalls=[]},registerRemoveEventListeners(){hr.removeEventListenersRegistered||(I.push(hr.removeAllEventListeners),hr.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var o in hr.deferredCalls){var a=hr.deferredCalls[o];if(a.targetFunction==e&&n(a.argsList,t))return}hr.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),hr.deferredCalls.sort(((e,r)=>e.precedencenavigator.userActivation?navigator.userActivation.isActive:hr.inEventHandler&&hr.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(hr.canPerformEventHandlerRequests())for(var e=0;e{for(var t=0;te?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},yr=["default","low-power","high-performance"],wr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],br=e=>("number"==typeof e&&(e=ye(e)),e&&"#canvas"!==e?void 0!==vr&&vr.offscreenCanvases[e]?vr.offscreenCanvases[e]:(e=>{try{return e?("number"==typeof e&&(e=wr[e]||ye(e)),"#window"===e?window:"#document"===e?document:"#screen"===e?screen:"#canvas"===e?o.canvas:"string"==typeof e?document.getElementById(e):e):window}catch(e){return null}})(e):void 0!==vr&&vr.offscreenCanvases.canvas?vr.offscreenCanvases.canvas:o.canvas),_r=e=>{var r=ce(e)+1,t=at(r);return $e(e,t,r),t},Er=[],xr={errorCallback:(e,r,t,n)=>{var o,a;o=()=>{var o,a,i=_r(t);((a=Er[o=e])||(o>=Er.length&&(Er.length=o+1),Er[o]=a=gr.get(o)),a)(r,i,n)},a=nt(),o(),ot(a)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}xr.mgrDevice||(xr.mgrSurface=xr.mgrSurface||new e,xr.mgrSwapChain=xr.mgrSwapChain||new e,xr.mgrAdapter=xr.mgrAdapter||new e,xr.mgrDevice=xr.mgrDevice||new e,xr.mgrQueue=xr.mgrQueue||new e,xr.mgrCommandBuffer=xr.mgrCommandBuffer||new e,xr.mgrCommandEncoder=xr.mgrCommandEncoder||new e,xr.mgrRenderPassEncoder=xr.mgrRenderPassEncoder||new e,xr.mgrComputePassEncoder=xr.mgrComputePassEncoder||new e,xr.mgrBindGroup=xr.mgrBindGroup||new e,xr.mgrBuffer=xr.mgrBuffer||new e,xr.mgrSampler=xr.mgrSampler||new e,xr.mgrTexture=xr.mgrTexture||new e,xr.mgrTextureView=xr.mgrTextureView||new e,xr.mgrQuerySet=xr.mgrQuerySet||new e,xr.mgrBindGroupLayout=xr.mgrBindGroupLayout||new e,xr.mgrPipelineLayout=xr.mgrPipelineLayout||new e,xr.mgrRenderPipeline=xr.mgrRenderPipeline||new e,xr.mgrComputePipeline=xr.mgrComputePipeline||new e,xr.mgrShaderModule=xr.mgrShaderModule||new e,xr.mgrRenderBundleEncoder=xr.mgrRenderBundleEncoder||new e,xr.mgrRenderBundle=xr.mgrRenderBundle||new e)},makeColor:e=>({r:F[e>>3],g:F[e+8>>3],b:F[e+16>>3],a:F[e+24>>3]}),makeExtent3D:e=>({width:C[e>>2],height:C[e+4>>2],depthOrArrayLayers:C[e+8>>2]}),makeOrigin3D:e=>({x:C[e>>2],y:C[e+4>>2],z:C[e+8>>2]}),makeImageCopyTexture:e=>({texture:xr.mgrTexture.get(C[e+4>>2]),mipLevel:C[e+8>>2],origin:xr.makeOrigin3D(e+12),aspect:xr.TextureAspect[C[e+24>>2]]}),makeTextureDataLayout:e=>{var r=C[e+16>>2],t=C[e+20>>2];return{offset:4294967296*C[e+4+8>>2]+C[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=e+8,t=xr.makeTextureDataLayout(r);return t.buffer=xr.mgrBuffer.get(C[e+32>>2]),t},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n>2])]=F[o+8>>3]}return t}},makePipelineLayout:e=>e?xr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2])}},DeviceLostReason:{undefined:0,destroyed:1},PreferredFormat:{rgba8unorm:18,bgra8unorm:23},BufferMapState:["unmapped","pending","mapped"],AddressMode:["repeat","mirror-repeat","clamp-to-edge"],BlendFactor:["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:["add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],CompareFunction:[,"never","less","less-equal","greater","greater-equal","equal","not-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:["none","front","back"],ErrorFilter:["validation","out-of-memory","internal"],FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","pipeline-statistics-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32filterable"],FilterMode:["nearest","linear"],FrontFace:["ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:["nearest","linear"],PipelineStatisticName:["vertex-shader-invocations","clipper-invocations","clipper-primitives-out","fragment-shader-invocations","compute-shader-invocations"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:["point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:["occlusion","pipeline-statistics","timestamp"],SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only"],StoreOp:[,"store","discard"],TextureAspect:["all","stencil-only","depth-only"],TextureDimension:["1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4"],VertexStepMode:["vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","pipeline-statistics-query":"4","texture-compression-bc":"5","texture-compression-etc2":"6","texture-compression-astc":"7","indirect-first-instance":"8","shader-f16":"9","rg11b10ufloat-renderable":"10","bgra8unorm-storage":"11",float32filterable:"12"}},Sr={values:{},next_id:1,add(e){var r;do{r=Sr.next_id++,Sr.next_id>2147483647&&(Sr.next_id=1)}while(r in Sr.values);return Sr.values[r]=e,r},remove(e){delete Sr.values[e]},get:e=>Sr.values[e]},kr={},Lr=()=>{if(!Lr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var r in kr)void 0===kr[r]?delete e[r]:e[r]=kr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Lr.strings=t}return Lr.strings},Cr=[],Pr=(e,r,t,n)=>{for(var o=0;o>2]=i}},Fr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Br=e=>0==(e-=5120)?E:1==e?x:2==e?S:4==e?L:6==e?P:5==e||28922==e||28520==e||30779==e||30782==e?C:k,Tr=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),Dr=(e,r,t,n,o,a)=>{var i=Br(e),s=Tr(i),u=1<({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*u,l=((e,r,t,n)=>{var o;return r*(e*t+(o=n)-1&-o)})(t,n,c,vr.unpackAlignment);return i.subarray(o>>s,o+l>>s)},Ar=e=>{var r=Ur.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=Ur.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?"["+t+"]":""))),t}vr.recordError(1282)},Mr=[],Ir=[],Vr=[31,29,31,30,31,30,31,31,30,31,30,31],Rr=[31,28,31,30,31,30,31,31,30,31,30,31],Or=(e,r)=>{E.set(e,r)},zr=(e,r,t,n)=>{var o=C[n+40>>2],a={tm_sec:L[n>>2],tm_min:L[n+4>>2],tm_hour:L[n+8>>2],tm_mday:L[n+12>>2],tm_mon:L[n+16>>2],tm_year:L[n+20>>2],tm_wday:L[n+24>>2],tm_yday:L[n+28>>2],tm_isdst:L[n+32>>2],tm_gmtoff:L[n+36>>2],tm_zone:o?ye(o):""},i=ye(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=or(t.getFullYear()),o=t.getMonth(),a=(n?Vr:Rr)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(t),a=p(n);return f(o,r)<=0?f(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var v={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(or(e.tm_year+1900)?Vr:Rr,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&or(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&or(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),v)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),v[u](a)));var h=de(i=i.replace(/\0\0/g,"%"),!1);return h.length>r?0:(Or(h,e),h.length-1)};o.requestFullscreen=(e,r)=>ke.requestFullscreen(e,r),o.requestAnimationFrame=e=>ke.requestAnimationFrame(e),o.setCanvasSize=(e,r,t)=>ke.setCanvasSize(e,r,t),o.pauseMainLoop=()=>ke.mainLoop.pause(),o.resumeMainLoop=()=>ke.mainLoop.resume(),o.getUserMedia=()=>ke.getUserMedia(),o.createContext=(e,r,t,n)=>ke.createContext(e,r,t,n);var Ur,Nr={},jr={},Gr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=he.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Gr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return he.isDir(this.mode)}},isDevice:{get:function(){return he.isChrdev(this.mode)}}}),he.FSNode=Gr,he.createPreloadedFile=(e,r,t,n,o,a,s,u,c,l)=>{var d=r?ae.resolve(ne.join2(e,r)):e;function m(t){function i(t){l&&l(),u||((e,r,t,n,o,a)=>{he.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,c),a&&a(),N()}((e,r,t,n)=>{void 0!==ke&&ke.init();var o=!1;return ge.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,i,(()=>{s&&s(),N()}))||i(t)}U(),"string"==typeof t?((e,r,t,n)=>{var o=`al ${e}`;i(e,(r=>{T(r,`Loading data file "${e}" failed (no arrayBuffer).`),m(new Uint8Array(r)),o&&N()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&U()})(t,0,s):m(t)},he.staticInit(),o.FS_createPath=he.createPath,o.FS_createDataFile=he.createDataFile,o.FS_createPreloadedFile=he.createPreloadedFile,o.FS_unlink=he.unlink,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Fe=e})(),Be=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Re.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Oe.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Oe.reserved=Oe.allocated.length,o.count_emval_handles=()=>{for(var e=0,r=Oe.reserved;r({data:new s(i?o.HEAPU8.slice(e,e+r).buffer:o.HEAPU8.buffer,e,t*n*a),width:t,height:n}))},r:function(){o._wrapSimpleListenerOutput||(o._wrapSimpleListenerOutput=(e,...r)=>{if(o.simpleListeners){const t=ye(e);o.simpleListeners[t]&&o.simpleListeners[t](...r)}}),o._wrapEmptyPacketListenerOutput||(o._wrapEmptyPacketListenerOutput=(e,r)=>{if(o.emptyPacketListeners){const t=ye(e);o.emptyPacketListeners[t]&&o.emptyPacketListeners[t](r)}})},La:function(){return o&&o.gpuOriginForWebTexturesIsBottomLeft},i:(e,r,t)=>{throw new Pe(e).init(r,t),e},Ka:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 0:if((o=we.get())<0)return-28;for(;he.streams[o];)o++;return he.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=we.get();return n.flags|=o,0;case 5:return o=we.getp(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,L[Zr()>>2]=28,-1}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Tc:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=we.getp();L[a>>2]=o.c_iflag||0,L[a+4>>2]=o.c_oflag||0,L[a+8>>2]=o.c_cflag||0,L[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)E[a+i+17>>0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=we.getp();var s=L[a>>2],u=L[a+4>>2],c=L[a+8>>2],l=L[a+12>>2],d=[];for(i=0;i<32;i++)d.push(E[a+i+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(a=we.getp(),L[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=we.getp(),he.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=we.getp(),S[a>>1]=m[0],S[a+2>>1]=m[1]}return 0;default:return-28}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ja:function(e,r,t,n){we.varargs=n;try{r=we.getStr(r),r=we.calculateAt(e,r);var o=n?we.get():0;return he.open(r,t,o).fd}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Sc:function(e,r){try{return e=we.getStr(e),we.doStat(he.stat,e,r)}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Zb:(e,r,t,n,o)=>{},Nc:(e,r,t,n)=>{Ve(e,{name:r=Te(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(x[e])},destructorFunction:null})},Mc:(e,r)=>{Ve(e,{name:r=Te(r),fromWireType:e=>{var r=Ue.toValue(e);return ze(e),r},toWireType:(e,r)=>Ue.toHandle(r),argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},Ha:(e,r,t)=>{Ve(e,{name:r=Te(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:je(r,t),destructorFunction:null})},F:(e,r,t,n,o)=>{r=Te(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<>>i}var s=r.includes("unsigned");Ve(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:Ge(r,t,0!==n),destructorFunction:null})},n:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=C[e>>2],t=C[e+4>>2];return new n(E.buffer,t,r)}Ve(e,{name:t=Te(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ga:(e,r)=>{var t="std::string"===(r=Te(r));Ve(e,{name:r,fromWireType(e){var r,n=C[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==x[s]){var u=ye(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var c=new Array(n);for(i=0;i>2]=n,t&&o)$e(r,i,n+1);else if(o)for(var s=0;s255&&(Qr(i),Ie("String has UTF-16 code units that do not fit in 8 bits")),x[i+s]=u}else for(s=0;s{var n,o,a,i,s;t=Te(t),2===r?(n=We,o=Ye,i=Xe,a=()=>k,s=1):4===r&&(n=Qe,o=Ke,i=Ze,a=()=>C,s=2),Ve(e,{name:t,fromWireType:e=>{for(var t,o=C[e>>2],i=a(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==i[l>>s]){var d=n(u,l-u);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),u=l+r}}return Qr(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Ie(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=Kr(4+a+r);return C[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push(Qr,u),u},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction(e){Qr(e)}})},Lc:(e,r)=>{Ve(e,{isVoid:!0,name:r=Te(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},Kc:()=>!0,ja:(e,r,t)=>{e=Ue.toValue(e),r=Je(r,"emval::as");var n=[],o=Ue.toHandle(n);return C[t>>2]=o,r.toWireType(n,e)},m:ze,ia:e=>0===e?Ue.toHandle(tr()):(e=rr(e),Ue.toHandle(tr()[e])),Fa:(e,r)=>(e=Ue.toValue(e),r=Ue.toValue(r),Ue.toHandle(e[r])),Ea:e=>{e>4&&(Oe.get(e).refcount+=1)},ha:(e,r)=>(e=Ue.toValue(e))instanceof Ue.toValue(r),ca:e=>Ue.toHandle(rr(e)),ga:e=>{(e=>{for(;e.length;){var r=e.pop();e.pop()(r)}})(Ue.toValue(e)),ze(e)},Da:(e,r,t)=>{e=Ue.toValue(e),r=Ue.toValue(r),t=Ue.toValue(t),e[r]=t},ba:(e,r)=>{var t=(e=Je(e,"_emval_take_value")).readValueFromPointer(r);return Ue.toHandle(t)},Jc:e=>(e=Ue.toValue(e),Ue.toHandle(typeof e)),Yb:function(e,r,t){var n=nr(e,r),o=new Date(1e3*n);L[t>>2]=o.getUTCSeconds(),L[t+4>>2]=o.getUTCMinutes(),L[t+8>>2]=o.getUTCHours(),L[t+12>>2]=o.getUTCDate(),L[t+16>>2]=o.getUTCMonth(),L[t+20>>2]=o.getUTCFullYear()-1900,L[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;L[t+28>>2]=i},Xb:function(e,r,t){var n=nr(e,r),o=new Date(1e3*n);L[t>>2]=o.getSeconds(),L[t+4>>2]=o.getMinutes(),L[t+8>>2]=o.getHours(),L[t+12>>2]=o.getDate(),L[t+16>>2]=o.getMonth(),L[t+20>>2]=o.getFullYear()-1900,L[t+24>>2]=o.getDay();var a=0|sr(o);L[t+28>>2]=a,L[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));L[t+32>>2]=c},Wb:function(e){var r=(()=>{var r=new Date(L[e+20>>2]+1900,L[e+16>>2],L[e+12>>2],L[e+8>>2],L[e+4>>2],L[e>>2],0),t=L[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)L[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=Math.max(i,a),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}L[e+24>>2]=r.getDay();var l=0|sr(r);return L[e+28>>2]=l,L[e>>2]=r.getSeconds(),L[e+4>>2]=r.getMinutes(),L[e+8>>2]=r.getHours(),L[e+12>>2]=r.getDate(),L[e+16>>2]=r.getMonth(),L[e+20>>2]=r.getYear(),r.getTime()/1e3})();return tt(($=r,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)),r>>>0},Vb:function(e,r,t,n,o,a,i,s){var u=nr(o,a);try{if(isNaN(u))return 61;var c=we.getStreamFromFD(n),l=he.mmap(c,e,u,r,t),d=l.ptr;return L[i>>2]=l.allocated,C[s>>2]=d,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ub:function(e,r,t,n,o,a,i){var s=nr(a,i);try{if(isNaN(s))return 61;var u=we.getStreamFromFD(o);2&t&&we.doMsync(e,u,r,n,s),he.munmap(u)}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ic:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}C[e>>2]=60*u,L[r>>2]=Number(i!=s);var l=c(o),d=c(a),m=ur(l),f=ur(d);s>2]=m,C[t+4>>2]=f):(C[t>>2]=f,C[t+4>>2]=m)},a:()=>{j("")},Hc:function(e,r){if("undefined"!=typeof dbg)dbg(ye(e,r));else{if(void 0===t)function t(e){console.warn.apply(console,arguments)}t(ye(e,r))}},E:(e,r,t)=>((e,r,t)=>{var n=((e,r)=>{var t;for(cr.length=0;t=x[e++];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,cr.push(112==t?C[r>>2]:105==t?L[r>>2]:F[r>>3]),r+=n?8:4}return cr})(r,t);return Z[e].apply(null,n)})(e,r,t),Gc:()=>Date.now(),fa:(e,r)=>b(ye(e,r)),Fc:()=>2147483648,u:K,Ec:(e,r,t)=>x.copyWithin(e,r,r+t),Dc:(e,r)=>w(ye(e,r)),Cc:e=>(j("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),Bc:e=>{var r=x.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,(n=Math.max(e,a))+(65536-n%65536)%65536);if(lr(i))return!0}return!1},Ac:function(){var e=pr().split("\n");return"Error"==e[0]&&e.shift(),fr(e),mr.last_addr=dr(e[3]),mr.last_stack=e,mr.last_addr},zc:(e,r,t)=>{var n;mr.last_addr==e?n=mr.last_stack:("Error"==(n=pr().split("\n"))[0]&&n.shift(),fr(n));for(var o=3;n[o]&&dr(n[o])!=e;)++o;for(var a=0;a>2]=dr(n[a+o]);return a},yc:(e,r)=>{var t=r>>2,n=L[t+6],o={alpha:!!L[t+0],depth:!!L[t+1],stencil:!!L[t+2],antialias:!!L[t+3],premultipliedAlpha:!!L[t+4],preserveDrawingBuffer:!!L[t+5],powerPreference:yr[n],failIfMajorPerformanceCaveat:!!L[t+7],majorVersion:L[t+8],minorVersion:L[t+9],enableExtensionsByDefault:L[t+10],explicitSwapControl:L[t+11],proxyContextToMainThread:L[t+12],renderViaOffscreenBackBuffer:L[t+13]},a=br(e);return a?o.explicitSwapControl?0:vr.createContext(a,o):0},xc:e=>{vr.currentContext==e&&(vr.currentContext=0),vr.deleteContext(e)},wc:(e,r)=>{if(!r)return-5;if(!(e=vr.contexts[e]))return-3;var t=e.GLctx;if(!t)return-3;t=t.getContextAttributes(),L[r>>2]=t.alpha,L[r+4>>2]=t.depth,L[r+8>>2]=t.stencil,L[r+12>>2]=t.antialias,L[r+16>>2]=t.premultipliedAlpha,L[r+20>>2]=t.preserveDrawingBuffer;var n=t.powerPreference&&yr.indexOf(t.powerPreference);return L[r+24>>2]=n,L[r+28>>2]=t.failIfMajorPerformanceCaveat,L[r+32>>2]=e.version,L[r+36>>2]=0,L[r+40>>2]=e.attributes.enableExtensionsByDefault,0},Ca:()=>vr.currentContext?vr.currentContext.handle:0,vc:e=>{for(var r=e>>2,t=0;t<14;++t)L[r+t]=0;L[r+0]=L[r+1]=L[r+3]=L[r+4]=L[r+8]=L[r+10]=1},uc:e=>vr.makeContextCurrent(e)?0:-5,tc:e=>Sr.add(xr.mgrBindGroupLayout.get(e)),Ba:e=>Sr.add(xr.mgrDevice.get(e)),sc:e=>Sr.add(xr.mgrSampler.get(e)),rc:e=>Sr.add(xr.mgrTexture.get(e)),J:()=>{if(void 0===xr.preinitializedDeviceId){var e=o.preinitializedWebGPUDevice,r={queueId:xr.mgrQueue.create(e.queue)};xr.preinitializedDeviceId=xr.mgrDevice.create(e,r)}return xr.mgrDevice.reference(xr.preinitializedDeviceId),xr.preinitializedDeviceId},qc:e=>xr.mgrBindGroup.create(Sr.get(e)),pc:e=>xr.mgrTexture.create(Sr.get(e)),U:e=>Sr.remove(e),Rc:(e,r)=>{var t=0;return Lr().forEach(((n,o)=>{var a=r+t;C[e+4*o>>2]=a,((e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);E[r>>0]=0})(n,a),t+=n.length+1})),0},Qc:(e,r)=>{var t=Lr();C[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),C[r>>2]=n,0},Aa:_e,la:function(e){try{var r=we.getStreamFromFD(e);return he.close(r),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Pc:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=he.read(e,E,i,s,n);if(u<0)return-1;if(o+=u,u>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},_b:function(e,r,t,n,o){var a=nr(r,t);try{if(isNaN(a))return 61;var i=we.getStreamFromFD(e);return he.llseek(i,a,n),q=[i.position>>>0,($=i.position,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[o>>2]=q[0],L[o+4>>2]=q[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Ia:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=he.write(e,E,i,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(we.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},oc:(e,r)=>(oe(x.subarray(e,e+r)),0),d:function(e){Ur.activeTexture(e)},aa:(e,r)=>{Ur.attachShader(vr.programs[e],vr.shaders[r])},nc:(e,r,t)=>{Ur.bindAttribLocation(vr.programs[e],r,ye(t))},e:(e,r)=>{34962==e?Ur.currentArrayBufferBinding=r:34963==e&&(Ur.currentElementArrayBufferBinding=r),35051==e?Ur.currentPixelPackBufferBinding=r:35052==e&&(Ur.currentPixelUnpackBufferBinding=r),Ur.bindBuffer(e,vr.buffers[r])},mc:(e,r,t)=>{Ur.bindBufferBase(e,r,vr.buffers[t])},v:(e,r)=>{Ur.bindFramebuffer(e,vr.framebuffers[r])},b:(e,r)=>{Ur.bindTexture(e,vr.textures[r])},t:e=>{Ur.bindVertexArray(vr.vaos[e]);var r=Ur.getParameter(34965);Ur.currentElementArrayBufferBinding=r?0|r.name:0},za:function(e){Ur.blendEquation(e)},lc:function(e,r){Ur.blendFunc(e,r)},p:(e,r,t,n)=>{vr.currentContext.version>=2?t&&r?Ur.bufferData(e,x,n,t,r):Ur.bufferData(e,r,n):Ur.bufferData(e,t?x.subarray(t,t+r):r,n)},z:function(e){Ur.clear(e)},ea:function(e,r,t,n){Ur.clearColor(e,r,t,n)},Tb:(e,r,t,n)=>{var o=(t>>>0)+4294967296*n;return Ur.clientWaitSync(vr.syncs[e],r,o)},ya:e=>{Ur.compileShader(vr.shaders[e])},xa:()=>{var e=vr.getNewId(vr.programs),r=Ur.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,vr.programs[e]=r,e},wa:e=>{var r=vr.getNewId(vr.shaders);return vr.shaders[r]=Ur.createShader(e),r},D:(e,r)=>{for(var t=0;t>2],o=vr.buffers[n];o&&(Ur.deleteBuffer(o),o.name=0,vr.buffers[n]=null,n==Ur.currentArrayBufferBinding&&(Ur.currentArrayBufferBinding=0),n==Ur.currentElementArrayBufferBinding&&(Ur.currentElementArrayBufferBinding=0),n==Ur.currentPixelPackBufferBinding&&(Ur.currentPixelPackBufferBinding=0),n==Ur.currentPixelUnpackBufferBinding&&(Ur.currentPixelUnpackBufferBinding=0))}},P:(e,r)=>{for(var t=0;t>2],o=vr.framebuffers[n];o&&(Ur.deleteFramebuffer(o),o.name=0,vr.framebuffers[n]=null)}},j:e=>{if(e){var r=vr.programs[e];r?(Ur.deleteProgram(r),r.name=0,vr.programs[e]=null):vr.recordError(1281)}},T:e=>{if(e){var r=vr.shaders[e];r?(Ur.deleteShader(r),vr.shaders[e]=null):vr.recordError(1281)}},S:e=>{if(e){var r=vr.syncs[e];r?(Ur.deleteSync(r),r.name=0,vr.syncs[e]=null):vr.recordError(1281)}},y:(e,r)=>{for(var t=0;t>2],o=vr.textures[n];o&&(Ur.deleteTexture(o),o.name=0,vr.textures[n]=null)}},O:(e,r)=>{for(var t=0;t>2];Ur.deleteVertexArray(vr.vaos[n]),vr.vaos[n]=null}},va:(e,r)=>{Ur.detachShader(vr.programs[e],vr.shaders[r])},I:function(e){Ur.disable(e)},s:e=>{vr.currentContext.clientBuffers[e].enabled=!1,Ur.disableVertexAttribArray(e)},o:(e,r,t)=>{vr.preDrawHandleClientVertexAttribBindings(r+t),Ur.drawArrays(e,r,t),vr.postDrawHandleClientVertexAttribBindings()},R:(e,r)=>{for(var t=Cr[e],n=0;n>2];Ur.drawBuffers(t)},kc:function(e){Ur.enable(e)},l:e=>{vr.currentContext.clientBuffers[e].enabled=!0,Ur.enableVertexAttribArray(e)},ua:(e,r)=>{var t=Ur.fenceSync(e,r);if(t){var n=vr.getNewId(vr.syncs);return t.name=n,vr.syncs[n]=t,n}return 0},$:function(){Ur.finish()},A:function(){Ur.flush()},x:(e,r,t,n,o)=>{Ur.framebufferTexture2D(e,r,t,vr.textures[n],o)},ta:(e,r,t,n,o)=>{Ur.framebufferTextureLayer(e,r,vr.textures[t],n,o)},w:(e,r)=>{Pr(e,r,"createBuffer",vr.buffers)},N:(e,r)=>{Pr(e,r,"createFramebuffer",vr.framebuffers)},C:(e,r)=>{Pr(e,r,"createTexture",vr.textures)},M:function(e,r){Pr(e,r,"createVertexArray",vr.vaos)},sa:(e,r)=>Ur.getAttribLocation(vr.programs[e],ye(r)),_:()=>{var e=Ur.getError()||vr.lastError;return vr.lastError=0,e},q:(e,r)=>{((e,r,t)=>{if(r){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=t&&1!=t&&vr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Ur.getParameter(34467);n=o?o.length:0;break;case 33309:if(vr.currentContext.version<2)return void vr.recordError(1282);n=2*(Ur.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(vr.currentContext.version<2)return void vr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=Ur.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void vr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void vr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i>2]=a[i];break;case 2:P[r+4*i>>2]=a[i];break;case 4:E[r+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(r){return vr.recordError(1280),void b("GL_INVALID_ENUM in glGet"+t+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+r+")")}}break;default:return vr.recordError(1280),void b("GL_INVALID_ENUM in glGet"+t+"v: Native code calling glGet"+t+"v("+e+") and it returns "+a+" of type "+typeof a+"!")}}switch(t){case 1:((e,r)=>{C[e>>2]=r;var t=C[e>>2];C[e+4>>2]=(r-t)/4294967296})(r,n);break;case 0:L[r>>2]=n;break;case 2:P[r>>2]=n;break;case 4:E[r>>0]=n?1:0}}else vr.recordError(1281)})(e,r,0)},jc:(e,r,t)=>{if(t)if(e>=vr.counter)vr.recordError(1281);else if(e=vr.programs[e],35716==r){var n=Ur.getProgramInfoLog(e);null===n&&(n="(unknown error)"),L[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=0;o>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(o=0;o>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(o=0;o>2]=e.maxUniformBlockNameLength}else L[t>>2]=Ur.getProgramParameter(e,r);else vr.recordError(1281)},ic:(e,r,t,n)=>{var o=Ur.getShaderInfoLog(vr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?$e(o,n,r):0;t&&(L[t>>2]=a)},hc:(e,r,t)=>{if(t)if(35716==r){var n=Ur.getShaderInfoLog(vr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;L[t>>2]=o}else if(35720==r){var a=Ur.getShaderSource(vr.shaders[e]),i=a?a.length+1:0;L[t>>2]=i}else L[t>>2]=Ur.getShaderParameter(vr.shaders[e],r);else vr.recordError(1281)},G:e=>{var r=vr.stringCache[e];if(!r){switch(e){case 7939:var t=Ur.getSupportedExtensions()||[];t=t.concat(t.map((e=>"GL_"+e))),r=ur(t.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Ur.getParameter(e);n||vr.recordError(1280),r=n&&ur(n);break;case 7938:var o=Ur.getParameter(7938);o=vr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",r=ur(o);break;case 35724:var a=Ur.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),r=ur(a);break;default:vr.recordError(1280)}vr.stringCache[e]=r}return r},gc:(e,r)=>Ur.getUniformBlockIndex(vr.programs[e],ye(r)),g:(e,r)=>{if(r=ye(r),e=vr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r0?i.slice(0,u):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],t=0;t0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n{e=vr.programs[e],Ur.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},Z:(e,r)=>{3317==e&&(vr.unpackAlignment=r),Ur.pixelStorei(e,r)},da:(e,r,t,n,o,a,i)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelPackBufferBinding)Ur.readPixels(e,r,t,n,o,a,i);else{var s=Br(a);Ur.readPixels(e,r,t,n,o,a,s,i>>Tr(s))}else{var u=Dr(a,o,t,n,i);u?Ur.readPixels(e,r,t,n,o,a,u):vr.recordError(1280)}},qa:(e,r,t,n)=>{var o=vr.getSource(e,r,t,n);Ur.shaderSource(vr.shaders[e],o)},B:(e,r,t,n,o,a,i,s,u)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelUnpackBufferBinding)Ur.texImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Br(s);Ur.texImage2D(e,r,t,n,o,a,i,s,c,u>>Tr(c))}else Ur.texImage2D(e,r,t,n,o,a,i,s,null);else Ur.texImage2D(e,r,t,n,o,a,i,s,u?Dr(s,i,n,o,u):null)},Y:function(e,r,t){Ur.texParameterf(e,r,t)},pa:(e,r,t)=>{var n=P[t>>2];Ur.texParameterf(e,r,n)},c:function(e,r,t){Ur.texParameteri(e,r,t)},X:function(e,r,t,n,o){Ur.texStorage2D(e,r,t,n,o)},fc:function(e,r,t,n,o,a){Ur.texStorage3D(e,r,t,n,o,a)},Q:(e,r,t,n,o,a,i,s,u)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelUnpackBufferBinding)Ur.texSubImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Br(s);Ur.texSubImage2D(e,r,t,n,o,a,i,s,c,u>>Tr(c))}else Ur.texSubImage2D(e,r,t,n,o,a,i,s,null);else{var l=null;u&&(l=Dr(s,i,o,a,u)),Ur.texSubImage2D(e,r,t,n,o,a,i,s,l)}},ec:(e,r,t,n,o,a,i,s,u,c,l)=>{if(Ur.currentPixelUnpackBufferBinding)Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,l);else if(l){var d=Br(c);Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,d,l>>Tr(d))}else Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,null)},W:(e,r)=>{Ur.uniform1f(Ar(e),r)},f:(e,r)=>{Ur.uniform1i(Ar(e),r)},dc:(e,r,t)=>{Ur.uniform2f(Ar(e),r,t)},cc:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform2fv(Ar(e),P,t>>2,2*r);else{if(r<=144)for(var n=Mr[2*r-1],o=0;o<2*r;o+=2)n[o]=P[t+4*o>>2],n[o+1]=P[t+(4*o+4)>>2];else n=P.subarray(t>>2,t+8*r>>2);Ur.uniform2fv(Ar(e),n)}},oa:(e,r,t,n)=>{Ur.uniform3f(Ar(e),r,t,n)},na:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform4fv(Ar(e),P,t>>2,4*r);else{if(r<=72){var n=Mr[4*r-1],o=P;t>>=2;for(var a=0;a<4*r;a+=4){var i=t+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=P.subarray(t>>2,t+16*r>>2);Ur.uniform4fv(Ar(e),n)}},bc:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform4iv(Ar(e),L,t>>2,4*r);else{if(r<=72)for(var n=Ir[4*r-1],o=0;o<4*r;o+=4)n[o]=L[t+4*o>>2],n[o+1]=L[t+(4*o+4)>>2],n[o+2]=L[t+(4*o+8)>>2],n[o+3]=L[t+(4*o+12)>>2];else n=L.subarray(t>>2,t+16*r>>2);Ur.uniform4iv(Ar(e),n)}},ac:(e,r,t)=>{e=vr.programs[e],Ur.uniformBlockBinding(e,r,t)},ma:(e,r,t,n)=>{if(vr.currentContext.version>=2)r&&Ur.uniformMatrix4fv(Ar(e),!!t,P,n>>2,16*r);else{if(r<=18){var o=Mr[16*r-1],a=P;n>>=2;for(var i=0;i<16*r;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=P.subarray(n>>2,n+64*r>>2);Ur.uniformMatrix4fv(Ar(e),!!t,o)}},h:e=>{e=vr.programs[e],Ur.useProgram(e),Ur.currentProgram=e},k:(e,r,t,n,o,a)=>{var i=vr.currentContext.clientBuffers[e];if(!Ur.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,Ur.vertexAttribPointer(e,r,t,!!n,o,a)},L:function(e,r,t,n){Ur.viewport(e,r,t,n)},$b:function(){return self.navigator.hardwareConcurrency},Rb:function(){let e;return"undefined"!=typeof HTMLCanvasElement?(e=document.createElement("canvas"),e.style.display="none"):e=new OffscreenCanvas(0,0),Ue.toHandle(e)},Qb:function(e){let r=br(e);return o&&!r&&(r=o.canvasWebGpu),Ue.toHandle(r)},Pb:function(e,r){const t=xr.mgrDevice.get(e),n=Ue.toValue(r),o=t.importExternalTexture({source:n});return Ue.toHandle(o)},Ob:function(e){const r=Ue.toValue(e);Ur.texImage2D(Ur.TEXTURE_2D,0,Ur.RGBA,Ur.RGBA,Ur.UNSIGNED_BYTE,r)},Oc:be,V:zr,Nb:(e,r,t,n,o)=>zr(e,r,t,n),Mb:e=>xr.mgrBindGroupLayout.release(e),Lb:e=>xr.mgrBindGroup.release(e),Kb:(e,r,t)=>{var n,o=xr.mgrBuffer.objects[e];if(0===t&&Se("getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE"),-1==t&&(t=void 0),2!==o.mapMode)return 0;try{n=o.object.getMappedRange(r,t)}catch(e){return 0}var a=rt(16,n.byteLength);return x.fill(0,a,n.byteLength),o.onUnmap.push((()=>{new Uint8Array(n).set(x.subarray(a,a+n.byteLength)),Qr(a)})),a},Jb:e=>xr.mgrBuffer.reference(e),Ib:e=>xr.mgrBuffer.release(e),Hb:e=>{var r=xr.mgrBuffer.objects[e];if(r.onUnmap){for(var t=0;txr.mgrCommandBuffer.release(e),Fb:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:xr.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}(C[r+8>>2])};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=xr.mgrCommandEncoder.get(e);return xr.mgrComputePassEncoder.create(o.beginComputePass(t))},Eb:(e,r)=>{function t(e){var r=C[e+4>>2];if(0!==r){var t=C[e+12>>2],n=C[e+16>>2],o=xr.makeColor(e+24);return{view:xr.mgrTextureView.get(r),resolveTarget:xr.mgrTextureView.get(C[e+8>>2]),clearValue:o,loadOp:xr.LoadOp[t],storeOp:xr.StoreOp[n]}}}function n(e,r){for(var n=[],o=0;o>2]),depthClearValue:P[e+12>>2],depthLoadOp:xr.LoadOp[C[e+4>>2]],depthStoreOp:xr.StoreOp[C[e+8>>2]],depthReadOnly:0!==E[e+16>>0],stencilClearValue:C[e+28>>2],stencilLoadOp:xr.LoadOp[C[e+20>>2]],stencilStoreOp:xr.StoreOp[C[e+24>>2]],stencilReadOnly:0!==E[e+32>>0]}}function a(e){if(0!==e)return{querySet:xr.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}var i=function(e){var r=C[e>>2],t=void 0;if(0!==r){C[r+4>>2];var i=r;t=4294967296*C[i+4+8>>2]+C[i+8>>2]}var s={label:void 0,colorAttachments:n(C[e+8>>2],C[e+12>>2]),depthStencilAttachment:o(C[e+16>>2]),occlusionQuerySet:xr.mgrQuerySet.get(C[e+20>>2]),timestampWrites:a(C[e+24>>2]),maxDrawCount:t},u=C[e+4>>2];return u&&(s.label=ye(u)),s}(r),s=xr.mgrCommandEncoder.get(e);return xr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},Db:(e,r,t,n)=>{var o=xr.mgrCommandEncoder.get(e),a=xr.makeExtent3D(n);o.copyBufferToTexture(xr.makeImageCopyBuffer(r),xr.makeImageCopyTexture(t),a)},Cb:(e,r,t,n)=>{var o=xr.mgrCommandEncoder.get(e),a=xr.makeExtent3D(n);o.copyTextureToTexture(xr.makeImageCopyTexture(r),xr.makeImageCopyTexture(t),a)},Bb:(e,r)=>{var t=xr.mgrCommandEncoder.get(e);return xr.mgrCommandBuffer.create(t.finish())},Ab:e=>xr.mgrCommandEncoder.release(e),zb:(e,r,t,n)=>{xr.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},yb:e=>{xr.mgrComputePassEncoder.get(e).end()},xb:e=>xr.mgrComputePassEncoder.release(e),wb:(e,r,t,n,o)=>{var a=xr.mgrComputePassEncoder.get(e),i=xr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},vb:(e,r)=>{var t=xr.mgrComputePassEncoder.get(e),n=xr.mgrComputePipeline.get(r);t.setPipeline(n)},ub:(e,r)=>{var t=xr.mgrComputePipeline.get(e);return xr.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},tb:e=>xr.mgrComputePipeline.release(e),sb:(e,r)=>{function t(e){var r,t=C[e+8>>2],n=C[e+32>>2],o=C[e+36>>2],a=C[e+4>>2];if(t){var i=C[(r=e+24)>>2]+4294967296*L[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:xr.mgrBuffer.get(t),offset:4294967296*C[e+4+16>>2]+C[e+16>>2],size:i}}}return n?{binding:a,resource:xr.mgrSampler.get(n)}:{binding:a,resource:xr.mgrTextureView.get(o)}}var n={label:void 0,layout:xr.mgrBindGroupLayout.get(C[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o>2],C[r+16>>2])},o=C[r+4>>2];o&&(n.label=ye(o));var a=xr.mgrDevice.get(e);return xr.mgrBindGroup.create(a.createBindGroup(n))},rb:(e,r)=>{var t=0!==E[r+24>>0],n={label:void 0,usage:C[r+8>>2],size:4294967296*C[r+4+16>>2]+C[r+16>>2],mappedAtCreation:t},o=C[r+4>>2];o&&(n.label=ye(o));var a=xr.mgrDevice.get(e),i={},s=xr.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},qb:(e,r)=>{var t;if(r){t={label:void 0};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=xr.mgrDevice.get(e);return xr.mgrCommandEncoder.create(o.createCommandEncoder(t))},pb:(e,r)=>{var t={label:void 0,layout:xr.makePipelineLayout(C[r+8>>2]),compute:xr.makeProgrammableStageDescriptor(r+12)},n=C[r+4>>2];n&&(t.label=ye(n));var o=xr.mgrDevice.get(e);return xr.mgrComputePipeline.create(o.createComputePipeline(t))},ob:(e,r)=>{function t(e){if(e)return{operation:xr.BlendOperation[C[e>>2]],srcFactor:xr.BlendFactor[C[e+4>>2]],dstFactor:xr.BlendFactor[C[e+8>>2]]}}function n(e){if(e)return{alpha:t(e+12),color:t(e+0)}}function o(e,r){for(var t,o,a=[],i=0;i>2])?void 0:{format:xr.TextureFormat[o],blend:n(C[t+8>>2]),writeMask:C[t+12>>2]}));return a}function a(e){return{compare:xr.CompareFunction[C[e>>2]],failOp:xr.StencilOperation[C[e+4>>2]],depthFailOp:xr.StencilOperation[C[e+8>>2]],passOp:xr.StencilOperation[C[e+12>>2]]}}function i(e,r){for(var t,n=[],o=0;o>2]],offset:4294967296*C[t+4+8>>2]+C[t+8>>2],shaderLocation:C[t+16>>2]}));return n}function s(e){if(e){var r=C[e+8>>2];return 2===r?null:{arrayStride:4294967296*C[e+4>>2]+C[e>>2],stepMode:xr.VertexStepMode[r],attributes:i(C[e+12>>2],C[e+16>>2])}}}function u(e,r){if(e){for(var t=[],n=0;n>2]),vertex:function(e){if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2]),buffers:u(C[e+20>>2],C[e+24>>2])}}(r+12),primitive:function(e){if(e)return{topology:xr.PrimitiveTopology[C[e+4>>2]],stripIndexFormat:xr.IndexFormat[C[e+8>>2]],frontFace:xr.FrontFace[C[e+12>>2]],cullMode:xr.CullMode[C[e+16>>2]]}}(r+40),depthStencil:function(e){if(e)return{format:xr.TextureFormat[C[e+4>>2]],depthWriteEnabled:0!==E[e+8>>0],depthCompare:xr.CompareFunction[C[e+12>>2]],stencilFront:a(e+16),stencilBack:a(e+32),stencilReadMask:C[e+48>>2],stencilWriteMask:C[e+52>>2],depthBias:L[e+56>>2],depthBiasSlopeScale:P[e+60>>2],depthBiasClamp:P[e+64>>2]}}(C[r+60>>2]),multisample:function(e){if(e)return{count:C[e+4>>2],mask:C[e+8>>2],alphaToCoverageEnabled:0!==E[e+12>>0]}}(r+64),fragment:function(e){if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2]),targets:o(C[e+20>>2],C[e+24>>2])}}(C[r+80>>2])},l=C[r+4>>2];l&&(c.label=ye(l));var d=xr.mgrDevice.get(e);return xr.mgrRenderPipeline.create(d.createRenderPipeline(c))},nb:(e,r)=>{var t={label:void 0,addressModeU:xr.AddressMode[C[r+8>>2]],addressModeV:xr.AddressMode[C[r+12>>2]],addressModeW:xr.AddressMode[C[r+16>>2]],magFilter:xr.FilterMode[C[r+20>>2]],minFilter:xr.FilterMode[C[r+24>>2]],mipmapFilter:xr.MipmapFilterMode[C[r+28>>2]],lodMinClamp:P[r+32>>2],lodMaxClamp:P[r+36>>2],compare:xr.CompareFunction[C[r+40>>2]]},n=C[r+4>>2];n&&(t.label=ye(n));var o=xr.mgrDevice.get(e);return xr.mgrSampler.create(o.createSampler(t))},mb:(e,r)=>{var t=C[r>>2],n=C[t+4>>2],o={label:void 0,code:""},a=C[r+4>>2];switch(a&&(o.label=ye(a)),n){case 5:var i=C[t+8>>2],s=C[t+12>>2]>>2;o.code=C.subarray(s,s+i);break;case 6:var u=C[t+8>>2];u&&(o.code=ye(u))}var c=xr.mgrDevice.get(e);return xr.mgrShaderModule.create(c.createShaderModule(o))},lb:(e,r)=>{var t={label:void 0,size:xr.makeExtent3D(r+16),mipLevelCount:C[r+32>>2],sampleCount:C[r+36>>2],dimension:xr.TextureDimension[C[r+12>>2]],format:xr.TextureFormat[C[r+28>>2]],usage:C[r+8>>2]},n=C[r+4>>2];n&&(t.label=ye(n));var o=C[r+40>>2];if(o){var a=C[r+44>>2];t.viewFormats=Array.from(L.subarray(a>>2,a+4*o>>2),(function(e){return xr.TextureFormat[e]}))}var i=xr.mgrDevice.get(e);return xr.mgrTexture.create(i.createTexture(t))},kb:e=>{var r=xr.mgrDevice.objects[e].queueId;return xr.mgrQueue.reference(r),r},jb:e=>xr.mgrDevice.reference(e),ib:e=>xr.mgrDevice.release(e),hb:e=>xr.mgrPipelineLayout.release(e),gb:e=>xr.mgrQuerySet.release(e),fb:e=>xr.mgrQueue.release(e),eb:(e,r,t)=>{var n=xr.mgrQueue.get(e),o=Array.from(L.subarray(t>>2,t+4*r>>2),(function(e){return xr.mgrCommandBuffer.get(e)}));n.submit(o)},Sb:function(e,r,t,n,o,a){var i=nr(t,n),s=xr.mgrQueue.get(e),u=xr.mgrBuffer.get(r),c=x.subarray(o,o+a);s.writeBuffer(u,i,c,0,a)},db:(e,r,t,n,o)=>{xr.mgrRenderPassEncoder.get(e).draw(r,t,n,o)},cb:e=>{xr.mgrRenderPassEncoder.get(e).end()},bb:e=>xr.mgrRenderPassEncoder.release(e),ab:(e,r,t,n,o)=>{var a=xr.mgrRenderPassEncoder.get(e),i=xr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},$a:(e,r)=>{var t=xr.mgrRenderPassEncoder.get(e),n=xr.mgrRenderPipeline.get(r);t.setPipeline(n)},_a:(e,r)=>{var t=xr.mgrRenderPipeline.get(e);return xr.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},Za:e=>xr.mgrRenderPipeline.release(e),Ya:e=>xr.mgrSampler.reference(e),Xa:e=>xr.mgrSampler.release(e),Wa:e=>xr.mgrShaderModule.reference(e),Va:e=>xr.mgrShaderModule.release(e),Ua:(e,r)=>{var t;if(r){var n=C[r+20>>2],o=C[r+28>>2];t={format:xr.TextureFormat[C[r+8>>2]],dimension:xr.TextureViewDimension[C[r+12>>2]],baseMipLevel:C[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:C[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:xr.TextureAspect[C[r+32>>2]]};var a=C[r+4>>2];a&&(t.label=ye(a))}var i=xr.mgrTexture.get(e);return xr.mgrTextureView.create(i.createView(t))},Ta:e=>xr.mgrTexture.get(e).destroy(),Sa:e=>xr.mgrTexture.reference(e),Ra:e=>xr.mgrTexture.release(e),Qa:e=>xr.mgrTextureView.reference(e),Pa:e=>xr.mgrTextureView.release(e),Oa:function(e,r,t,n){const o=gr.length,a=new Uint8Array(x.slice(e+r,e+t));try{var i=new WebAssembly.Module(a),s=new WebAssembly.Instance(i,{env:{memory:y}});for(var u in s.exports){var c=s.exports[u];addFunction(c)}return oWebAssembly.instantiateStreaming(e,t).then(a,(function(e){return b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation"),Q(r,t,a)}))))).catch(n),{}}(),Qr=o._free=e=>(Qr=o._free=Xr.od)(e),Kr=o._malloc=e=>(Kr=o._malloc=Xr.pd)(e),Zr=(o._addBoundTextureAsImageToStream=(e,r,t,n)=>(o._addBoundTextureAsImageToStream=Xr.qd)(e,r,t,n),o._attachImageListener=(e,r)=>(o._attachImageListener=Xr.rd)(e,r),o._attachImageVectorListener=(e,r)=>(o._attachImageVectorListener=Xr.sd)(e,r),o._registerModelResourcesGraphService=()=>(o._registerModelResourcesGraphService=Xr.td)(),()=>(Zr=Xr.ud)()),Jr=(o._bindTextureToStream=e=>(o._bindTextureToStream=Xr.vd)(e),o._addBoundTextureToStream=(e,r,t,n)=>(o._addBoundTextureToStream=Xr.wd)(e,r,t,n),o._addDoubleToInputStream=(e,r,t)=>(o._addDoubleToInputStream=Xr.xd)(e,r,t),o._addFloatToInputStream=(e,r,t)=>(o._addFloatToInputStream=Xr.yd)(e,r,t),o._addBoolToInputStream=(e,r,t)=>(o._addBoolToInputStream=Xr.zd)(e,r,t),o._addIntToInputStream=(e,r,t)=>(o._addIntToInputStream=Xr.Ad)(e,r,t),o._addStringToInputStream=(e,r,t)=>(o._addStringToInputStream=Xr.Bd)(e,r,t),o._allocateBoolVector=e=>(o._allocateBoolVector=Xr.Cd)(e),o._allocateFloatVector=e=>(o._allocateFloatVector=Xr.Dd)(e),o._allocateDoubleVector=e=>(o._allocateDoubleVector=Xr.Ed)(e),o._allocateIntVector=e=>(o._allocateIntVector=Xr.Fd)(e),o._allocateStringVector=e=>(o._allocateStringVector=Xr.Gd)(e),o._addBoolVectorEntry=(e,r)=>(o._addBoolVectorEntry=Xr.Hd)(e,r),o._addFloatVectorEntry=(e,r)=>(o._addFloatVectorEntry=Xr.Id)(e,r),o._addDoubleVectorEntry=(e,r)=>(o._addDoubleVectorEntry=Xr.Jd)(e,r),o._addIntVectorEntry=(e,r)=>(o._addIntVectorEntry=Xr.Kd)(e,r),o._addStringVectorEntry=(e,r)=>(o._addStringVectorEntry=Xr.Ld)(e,r),o._addBoolVectorToInputStream=(e,r,t)=>(o._addBoolVectorToInputStream=Xr.Md)(e,r,t),o._addFloatVectorToInputStream=(e,r,t)=>(o._addFloatVectorToInputStream=Xr.Nd)(e,r,t),o._addDoubleVectorToInputStream=(e,r,t)=>(o._addDoubleVectorToInputStream=Xr.Od)(e,r,t),o._addIntVectorToInputStream=(e,r,t)=>(o._addIntVectorToInputStream=Xr.Pd)(e,r,t),o._addStringVectorToInputStream=(e,r,t)=>(o._addStringVectorToInputStream=Xr.Qd)(e,r,t),o._addFlatHashMapToInputStream=(e,r,t,n,a)=>(o._addFlatHashMapToInputStream=Xr.Rd)(e,r,t,n,a),o._addProtoToInputStream=(e,r,t,n,a)=>(o._addProtoToInputStream=Xr.Sd)(e,r,t,n,a),o._addEmptyPacketToInputStream=(e,r)=>(o._addEmptyPacketToInputStream=Xr.Td)(e,r),o._addBoolToInputSidePacket=(e,r)=>(o._addBoolToInputSidePacket=Xr.Ud)(e,r),o._addDoubleToInputSidePacket=(e,r)=>(o._addDoubleToInputSidePacket=Xr.Vd)(e,r),o._addFloatToInputSidePacket=(e,r)=>(o._addFloatToInputSidePacket=Xr.Wd)(e,r),o._addIntToInputSidePacket=(e,r)=>(o._addIntToInputSidePacket=Xr.Xd)(e,r),o._addStringToInputSidePacket=(e,r)=>(o._addStringToInputSidePacket=Xr.Yd)(e,r),o._addProtoToInputSidePacket=(e,r,t,n)=>(o._addProtoToInputSidePacket=Xr.Zd)(e,r,t,n),o._addBoolVectorToInputSidePacket=(e,r)=>(o._addBoolVectorToInputSidePacket=Xr._d)(e,r),o._addDoubleVectorToInputSidePacket=(e,r)=>(o._addDoubleVectorToInputSidePacket=Xr.$d)(e,r),o._addFloatVectorToInputSidePacket=(e,r)=>(o._addFloatVectorToInputSidePacket=Xr.ae)(e,r),o._addIntVectorToInputSidePacket=(e,r)=>(o._addIntVectorToInputSidePacket=Xr.be)(e,r),o._addStringVectorToInputSidePacket=(e,r)=>(o._addStringVectorToInputSidePacket=Xr.ce)(e,r),o._attachBoolListener=e=>(o._attachBoolListener=Xr.de)(e),o._attachBoolVectorListener=e=>(o._attachBoolVectorListener=Xr.ee)(e),o._attachDoubleListener=e=>(o._attachDoubleListener=Xr.fe)(e),o._attachDoubleVectorListener=e=>(o._attachDoubleVectorListener=Xr.ge)(e),o._attachFloatListener=e=>(o._attachFloatListener=Xr.he)(e),o._attachFloatVectorListener=e=>(o._attachFloatVectorListener=Xr.ie)(e),o._attachIntListener=e=>(o._attachIntListener=Xr.je)(e),o._attachIntVectorListener=e=>(o._attachIntVectorListener=Xr.ke)(e),o._attachStringListener=e=>(o._attachStringListener=Xr.le)(e),o._attachStringVectorListener=e=>(o._attachStringVectorListener=Xr.me)(e),o._attachProtoListener=(e,r)=>(o._attachProtoListener=Xr.ne)(e,r),o._attachProtoVectorListener=(e,r)=>(o._attachProtoVectorListener=Xr.oe)(e,r),o._getGraphConfig=(e,r)=>(o._getGraphConfig=Xr.pe)(e,r),o._clearSubgraphs=()=>(o._clearSubgraphs=Xr.qe)(),o._pushBinarySubgraph=(e,r)=>(o._pushBinarySubgraph=Xr.re)(e,r),o._pushTextSubgraph=(e,r)=>(o._pushTextSubgraph=Xr.se)(e,r),o._changeBinaryGraph=(e,r)=>(o._changeBinaryGraph=Xr.te)(e,r),o._changeTextGraph=(e,r)=>(o._changeTextGraph=Xr.ue)(e,r),o._processGl=e=>(o._processGl=Xr.ve)(e),o._process=e=>(o._process=Xr.we)(e),o._bindTextureToCanvas=()=>(o._bindTextureToCanvas=Xr.xe)(),o._requestShaderRefreshOnGraphChange=()=>(o._requestShaderRefreshOnGraphChange=Xr.ye)(),o._waitUntilIdle=()=>(o._waitUntilIdle=Xr.ze)(),o._closeGraph=()=>(o._closeGraph=Xr.Ae)(),o._setAutoRenderToScreen=e=>(o._setAutoRenderToScreen=Xr.Be)(e),e=>(Jr=Xr.Ce)(e)),et=(o.__embind_initialize_bindings=()=>(o.__embind_initialize_bindings=Xr.De)(),(e,r)=>(et=Xr.Ee)(e,r)),rt=(e,r)=>(rt=Xr.Fe)(e,r),tt=e=>(tt=Xr.Ge)(e),nt=()=>(nt=Xr.He)(),ot=e=>(ot=Xr.Ie)(e),at=e=>(at=Xr.Je)(e),it=e=>(it=Xr.Ke)(e);function st(){function e(){Wr||(Wr=!0,o.calledRun=!0,B||(o.noFSInit||he.init.initialized||he.init(),he.ignorePermissions=!1,me.init(),Le(M),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),V.unshift(e);var e;Le(V)}()))}R>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),A.unshift(e);var e;Le(A)}(),R>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o.___start_em_js=1243044,o.___stop_em_js=1250538,o.addRunDependency=U,o.removeRunDependency=N,o.FS_createPath=he.createPath,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,o.ccall=(e,r,t,n,a)=>{var i={string:e=>{var r=0;return null!=e&&0!==e&&(r=_r(e)),r},array:e=>{var r=at(e.length);return Or(e,r),r}},s=(e=>o["_"+e])(e),u=[],c=0;if(n)for(var l=0;l0;)o.preInit.pop()();return st(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=ModuleFactory:"function"==typeof define&&define.amd&&define([],(()=>ModuleFactory)); \ No newline at end of file +var ModuleFactory=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){var t,n,o=r;o.ready=new Promise(((e,r)=>{t=e,n=r}));var a,i,s,u=Object.assign({},o),c="./this.program",l=(e,r)=>{throw r},d="object"==typeof window,m="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(f){var g=require("fs"),h=require("path");p=m?h.dirname(p)+"/":__dirname+"/",a=(e,r)=>(e=X(e)?new URL(e):h.normalize(e),g.readFileSync(e,r?void 0:"utf8")),s=e=>{var r=a(e,!0);return r.buffer||(r=new Uint8Array(r)),r},i=(e,r,t,n=!0)=>{e=X(e)?new URL(e):h.normalize(e),g.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!o.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,r)=>{throw process.exitCode=e,r},o.inspect=()=>"[Emscripten Module object]"}else(d||m)&&(m?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},m&&(s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)});var v,y,w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit),o.wasmBinary&&(v=o.wasmBinary),"object"!=typeof WebAssembly&&N("no native wasm support detected");var _,E,x,S,k,L,C,B,P,F=!1;function T(e,r){e||N(r)}function D(){var e=y.buffer;o.HEAP8=E=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=x=new Uint8Array(e),o.HEAPU16=k=new Uint16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU32=C=new Uint32Array(e),o.HEAPF32=B=new Float32Array(e),o.HEAPF64=P=new Float64Array(e)}var A=[],M=[],I=[],V=[],R=0,O=null,z=null;function U(e){R++,o.monitorRunDependencies?.(R)}function G(e){if(R--,o.monitorRunDependencies?.(R),0==R&&(null!==O&&(clearInterval(O),O=null),z)){var r=z;z=null,r()}}function N(e){o.onAbort?.(e),b(e="Aborted("+e+")"),F=!0,_=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var j,H,W,q,Y=e=>e.startsWith("data:application/octet-stream;base64,"),X=e=>e.startsWith("file://");function $(e){if(e==j&&v)return new Uint8Array(v);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function Q(e,r,t){return function(e){if(!v&&(d||m)){if("function"==typeof fetch&&!X(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>$(e)));if(i)return new Promise(((r,t)=>{i(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>$(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{b(`failed to asynchronously prepare wasm: ${e}`),N(e)}))}Y(j="vision_wasm_internal.wasm")||(H=j,j=o.locateFile?o.locateFile(H,p):p+H);var K,Z={1298356:e=>{const r=Ge.toValue(e).getContext("webgpu");return xr.add(r.getCurrentTexture())},1298491:(e,r,t,n,o)=>{const a=Ge.toValue(e),i=xr.get(r),s=xr.get(t),u=n,c=o;i.queue.copyExternalImageToTexture({source:a},{texture:s},[u,c])},1298742:(e,r)=>{const t=Ge.toValue(e),n=Ge.toValue(r),o=n.getContext("2d"),a=new ImageData(t,n.width,n.height);o.putImageData(a,0,0)},1298966:(e,r)=>{const t=Ge.toValue(e),n=Ge.toValue(r),o=t.getContext("2d").getImageData(0,0,t.width,t.height);n.set(o.data)},1299170:(e,r)=>{const t=Ge.toValue(e);Ge.toValue(r).getContext("2d").drawImage(t,0,0)},1299306:()=>!!o.preinitializedWebGPUDevice,1299357:()=>{yr["#canvas"]=o.canvas},1299408:()=>"undefined"!=typeof wasmOffsetConverter},J=(e,r)=>{if(ke.mainLoop.timingMode=e,ke.mainLoop.timingValue=r,!ke.mainLoop.func)return 1;if(ke.mainLoop.running||(ke.mainLoop.running=!0),0==e)ke.mainLoop.scheduler=function(){var e=0|Math.max(0,ke.mainLoop.tickStartTime+r-K());setTimeout(ke.mainLoop.runner,e)},ke.mainLoop.method="timeout";else if(1==e)ke.mainLoop.scheduler=function(){ke.requestAnimationFrame(ke.mainLoop.runner)},ke.mainLoop.method="rAF";else if(2==e){if(void 0===ke.setImmediate)if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),ke.setImmediate=function(e){t.push(e),m?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}else ke.setImmediate=setImmediate;ke.mainLoop.scheduler=function(){ke.setImmediate(ke.mainLoop.runner)},ke.mainLoop.method="immediate"}return 0};K=()=>performance.now();var ee=e=>{if(e instanceof re||"unwind"==e)return _;l(1,e)};function re(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var te=()=>Ce||!1,ne={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=ne.isAbs(e),t="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=ne.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return ne.normalize(e.join("/"))},join2:(e,r)=>ne.normalize(e+"/"+r)},oe=e=>(oe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(f)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}N("initRandomDevice")})())(e),ae={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ve.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=ne.isAbs(n)}return(r?"/":"")+(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ae.resolve(e).substr(1),r=ae.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ie)return ie.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ue=[],ce=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},le=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function de(e,r,t){var n=t>0?t:ce(e)+1,o=new Array(n),a=le(e,o,0,o.length);return r&&(o.length=a),o}var me={ttys:[],init(){},shutdown(){},register(e,r){me.ttys[e]={input:[],output:[],ops:r},ve.registerDevice(e,me.stream_ops)},stream_ops:{open(e){var r=me.ttys[e.node.rdev];if(!r)throw new ve.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ve.ErrnoError(60);for(var a=0,i=0;i(()=>{if(!ue.length){var e=null;if(f){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ue=de(e,!0)}return ue.shift()})(),put_char(e,r){null===r||10===r?(w(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(w(se(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(b(se(e.output,0)),e.output=[])}}},fe=e=>{e=((e,r)=>65536*Math.ceil(e/65536))(e);var r=Jr(65536,e);return r?((e,r)=>(x.fill(0,e,e+r),e))(r,e):0},pe={ops_table:null,mount:e=>pe.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ve.isBlkdev(t)||ve.isFIFO(t))throw new ve.ErrnoError(63);pe.ops_table||={dir:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,lookup:pe.node_ops.lookup,mknod:pe.node_ops.mknod,rename:pe.node_ops.rename,unlink:pe.node_ops.unlink,rmdir:pe.node_ops.rmdir,readdir:pe.node_ops.readdir,symlink:pe.node_ops.symlink},stream:{llseek:pe.stream_ops.llseek}},file:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:{llseek:pe.stream_ops.llseek,read:pe.stream_ops.read,write:pe.stream_ops.write,allocate:pe.stream_ops.allocate,mmap:pe.stream_ops.mmap,msync:pe.stream_ops.msync}},link:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,readlink:pe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:ve.chrdev_stream_ops}};var o=ve.createNode(e,r,t,n);return ve.isDir(o.mode)?(o.node_ops=pe.ops_table.dir.node,o.stream_ops=pe.ops_table.dir.stream,o.contents={}):ve.isFile(o.mode)?(o.node_ops=pe.ops_table.file.node,o.stream_ops=pe.ops_table.file.stream,o.usedBytes=0,o.contents=null):ve.isLink(o.mode)?(o.node_ops=pe.ops_table.link.node,o.stream_ops=pe.ops_table.link.stream):ve.isChrdev(o.mode)&&(o.node_ops=pe.ops_table.chrdev.node,o.stream_ops=pe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ve.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ve.isDir(e.mode)?r.size=4096:ve.isFile(e.mode)?r.size=e.usedBytes:ve.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&pe.resizeFileStorage(e,r.size)},lookup(e,r){throw ve.genericErrors[44]},mknod:(e,r,t,n)=>pe.createNode(e,r,t,n),rename(e,r,t){if(ve.isDir(e.mode)){var n;try{n=ve.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ve.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ve.lookupNode(e,r);for(var n in t.contents)throw new ve.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=pe.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ve.isLink(e.mode))throw new ve.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r(pe.stream_ops.write(e,r,0,n,t,!1),0)}},ge=o.preloadPlugins||[],he=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ve={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=ae.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ve.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ve.root,o="/",a=0;a40)throw new ve.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ve.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n>>0)%ve.nameTable.length},hashAddNode(e){var r=ve.hashName(e.parent.id,e.name);e.name_next=ve.nameTable[r],ve.nameTable[r]=e},hashRemoveNode(e){var r=ve.hashName(e.parent.id,e.name);if(ve.nameTable[r]===e)ve.nameTable[r]=e.name_next;else for(var t=ve.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ve.mayLookup(e);if(t)throw new ve.ErrnoError(t,e);for(var n=ve.hashName(e.id,r),o=ve.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ve.lookup(e,r)},createNode(e,r,t,n){var o=new ve.FSNode(e,r,t,n);return ve.hashAddNode(o),o},destroyNode(e){ve.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ve.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ve.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ve.lookupNode(e,r),20}catch(e){}return ve.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ve.lookupNode(e,r)}catch(e){return e.errno}var o=ve.nodePermissions(e,"wx");if(o)return o;if(t){if(!ve.isDir(n.mode))return 54;if(ve.isRoot(n)||ve.getPath(n)===ve.cwd())return 10}else if(ve.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ve.isLink(e.mode)?32:ve.isDir(e.mode)&&("r"!==ve.flagsToPermissionString(r)||512&r)?31:ve.nodePermissions(e,ve.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ve.MAX_OPEN_FDS;e++)if(!ve.streams[e])return e;throw new ve.ErrnoError(33)},getStreamChecked(e){var r=ve.getStream(e);if(!r)throw new ve.ErrnoError(8);return r},getStream:e=>ve.streams[e],createStream:(e,r=-1)=>(ve.FSStream||(ve.FSStream=function(){this.shared={}},ve.FSStream.prototype={},Object.defineProperties(ve.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ve.FSStream,e),-1==r&&(r=ve.nextfd()),e.fd=r,ve.streams[r]=e,e),closeStream(e){ve.streams[e]=null},chrdev_stream_ops:{open(e){var r=ve.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ve.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ve.devices[e]={stream_ops:r}},getDevice:e=>ve.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ve.syncFSRequests++,ve.syncFSRequests>1&&b(`warning: ${ve.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ve.getMounts(ve.root.mount),n=0;function o(e){return ve.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&ve.root)throw new ve.ErrnoError(10);if(!o&&!a){var i=ve.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ve.isMountpoint(n))throw new ve.ErrnoError(10);if(!ve.isDir(n.mode))throw new ve.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ve.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=ve.lookupPath(e,{follow_mount:!1});if(!ve.isMountpoint(r.node))throw new ve.ErrnoError(28);var t=r.node,n=t.mounted,o=ve.getMounts(n);Object.keys(ve.nameTable).forEach((e=>{for(var r=ve.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ve.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ve.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new ve.ErrnoError(28);var a=ve.mayCreate(n,o);if(a)throw new ve.ErrnoError(a);if(!n.node_ops.mknod)throw new ve.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ve.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ve.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,ve.mknod(e,r,t)),symlink(e,r){if(!ae.resolve(e))throw new ve.ErrnoError(44);var t=ve.lookupPath(r,{parent:!0}).node;if(!t)throw new ve.ErrnoError(44);var n=ne.basename(r),o=ve.mayCreate(t,n);if(o)throw new ve.ErrnoError(o);if(!t.node_ops.symlink)throw new ve.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=ne.dirname(e),a=ne.dirname(r),i=ne.basename(e),s=ne.basename(r);if(t=ve.lookupPath(e,{parent:!0}).node,n=ve.lookupPath(r,{parent:!0}).node,!t||!n)throw new ve.ErrnoError(44);if(t.mount!==n.mount)throw new ve.ErrnoError(75);var u,c=ve.lookupNode(t,i),l=ae.relative(e,a);if("."!==l.charAt(0))throw new ve.ErrnoError(28);if("."!==(l=ae.relative(r,o)).charAt(0))throw new ve.ErrnoError(55);try{u=ve.lookupNode(n,s)}catch(e){}if(c!==u){var d=ve.isDir(c.mode),m=ve.mayDelete(t,i,d);if(m)throw new ve.ErrnoError(m);if(m=u?ve.mayDelete(n,s,d):ve.mayCreate(n,s))throw new ve.ErrnoError(m);if(!t.node_ops.rename)throw new ve.ErrnoError(63);if(ve.isMountpoint(c)||u&&ve.isMountpoint(u))throw new ve.ErrnoError(10);if(n!==t&&(m=ve.nodePermissions(t,"w")))throw new ve.ErrnoError(m);ve.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{ve.hashAddNode(c)}}},rmdir(e){var r=ve.lookupPath(e,{parent:!0}).node,t=ne.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!0);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.rmdir)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.rmdir(r,t),ve.destroyNode(n)},readdir(e){var r=ve.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ve.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ve.lookupPath(e,{parent:!0}).node;if(!r)throw new ve.ErrnoError(44);var t=ne.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!1);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.unlink)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.unlink(r,t),ve.destroyNode(n)},readlink(e){var r=ve.lookupPath(e).node;if(!r)throw new ve.ErrnoError(44);if(!r.node_ops.readlink)throw new ve.ErrnoError(28);return ae.resolve(ve.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ve.lookupPath(e,{follow:!r}).node;if(!t)throw new ve.ErrnoError(44);if(!t.node_ops.getattr)throw new ve.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ve.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ve.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ve.chmod(e,r,!0)},fchmod(e,r){var t=ve.getStreamChecked(e);ve.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ve.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ve.chown(e,r,t,!0)},fchown(e,r,t){var n=ve.getStreamChecked(e);ve.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ve.ErrnoError(28);var t;if(!(t="string"==typeof e?ve.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);if(ve.isDir(t.mode))throw new ve.ErrnoError(31);if(!ve.isFile(t.mode))throw new ve.ErrnoError(28);var n=ve.nodePermissions(t,"w");if(n)throw new ve.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ve.getStreamChecked(e);if(0==(2097155&t.flags))throw new ve.ErrnoError(28);ve.truncate(t.node,r)},utime(e,r,t){var n=ve.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ve.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=ve.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new ve.ErrnoError(20)}else n=ve.mknod(e,t,0),a=!0;if(!n)throw new ve.ErrnoError(44);if(ve.isChrdev(n.mode)&&(r&=-513),65536&r&&!ve.isDir(n.mode))throw new ve.ErrnoError(54);if(!a){var i=ve.mayOpen(n,r);if(i)throw new ve.ErrnoError(i)}512&r&&!a&&ve.truncate(n,0),r&=-131713;var s=ve.createStream({node:n,path:ve.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(ve.readFiles||(ve.readFiles={}),e in ve.readFiles||(ve.readFiles[e]=1)),s},close(e){if(ve.isClosed(e))throw new ve.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ve.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ve.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ve.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(1==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.read)throw new ve.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.write)throw new ve.ErrnoError(28);e.seekable&&1024&e.flags&&ve.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(r<0||t<=0)throw new ve.ErrnoError(28);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(!ve.isFile(e.node.mode)&&!ve.isDir(e.node.mode))throw new ve.ErrnoError(43);if(!e.stream_ops.allocate)throw new ve.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ve.ErrnoError(2);if(1==(2097155&e.flags))throw new ve.ErrnoError(2);if(!e.stream_ops.mmap)throw new ve.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ve.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ve.open(e,r.flags),o=ve.stat(e).size,a=new Uint8Array(o);return ve.read(n,a,0,o,0),"utf8"===r.encoding?t=se(a,0):"binary"===r.encoding&&(t=a),ve.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ve.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ce(r)+1),a=le(r,o,0,o.length);ve.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ve.write(n,r,0,r.byteLength,void 0,t.canOwn)}ve.close(n)},cwd:()=>ve.currentPath,chdir(e){var r=ve.lookupPath(e,{follow:!0});if(null===r.node)throw new ve.ErrnoError(44);if(!ve.isDir(r.node.mode))throw new ve.ErrnoError(54);var t=ve.nodePermissions(r.node,"x");if(t)throw new ve.ErrnoError(t);ve.currentPath=r.path},createDefaultDirectories(){ve.mkdir("/tmp"),ve.mkdir("/home"),ve.mkdir("/home/web_user")},createDefaultDevices(){ve.mkdir("/dev"),ve.registerDevice(ve.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ve.mkdev("/dev/null",ve.makedev(1,3)),me.register(ve.makedev(5,0),me.default_tty_ops),me.register(ve.makedev(6,0),me.default_tty1_ops),ve.mkdev("/dev/tty",ve.makedev(5,0)),ve.mkdev("/dev/tty1",ve.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=oe(e).byteLength),e[--r]);ve.createDevice("/dev","random",t),ve.createDevice("/dev","urandom",t),ve.mkdir("/dev/shm"),ve.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ve.mkdir("/proc");var e=ve.mkdir("/proc/self");ve.mkdir("/proc/self/fd"),ve.mount({mount(){var r=ve.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ve.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?ve.createDevice("/dev","stdin",o.stdin):ve.symlink("/dev/tty","/dev/stdin"),o.stdout?ve.createDevice("/dev","stdout",null,o.stdout):ve.symlink("/dev/tty","/dev/stdout"),o.stderr?ve.createDevice("/dev","stderr",null,o.stderr):ve.symlink("/dev/tty1","/dev/stderr"),ve.open("/dev/stdin",0),ve.open("/dev/stdout",1),ve.open("/dev/stderr",1)},ensureErrnoError(){ve.ErrnoError||(ve.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ve.ErrnoError.prototype=new Error,ve.ErrnoError.prototype.constructor=ve.ErrnoError,[44].forEach((e=>{ve.genericErrors[e]=new ve.ErrnoError(e),ve.genericErrors[e].stack=""})))},staticInit(){ve.ensureErrnoError(),ve.nameTable=new Array(4096),ve.mount(pe,{},"/"),ve.createDefaultDirectories(),ve.createDefaultDevices(),ve.createSpecialDirectories(),ve.filesystems={MEMFS:pe}},init(e,r,t){ve.init.initialized=!0,ve.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,ve.createStandardStreams()},quit(){ve.init.initialized=!1;for(var e=0;ethis.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):de(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=ve.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=u.stream_ops[e];c[e]=function(){return ve.forceLoadFile(u),r.apply(null,arguments)}})),c.read=(e,r,t,n,o)=>(ve.forceLoadFile(u),l(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{ve.forceLoadFile(u);var a=fe(r);if(!a)throw new ve.ErrnoError(48);return l(e,E,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u}},ye=(e,r)=>e?se(x,e,r):"",we={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(ne.isAbs(r))return r;var n;if(n=-100===e?ve.cwd():we.getStreamFromFD(e).path,0==r.length){if(!t)throw new ve.ErrnoError(44);return n}return ne.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&ne.normalize(r)!==ne.normalize(ve.getPath(e.node)))return-54;throw e}L[t>>2]=n.dev,L[t+4>>2]=n.mode,C[t+8>>2]=n.nlink,L[t+12>>2]=n.uid,L[t+16>>2]=n.gid,L[t+20>>2]=n.rdev,q=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+24>>2]=q[0],L[t+28>>2]=q[1],L[t+32>>2]=4096,L[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return q=[Math.floor(o/1e3)>>>0,(W=Math.floor(o/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+40>>2]=q[0],L[t+44>>2]=q[1],C[t+48>>2]=o%1e3*1e3,q=[Math.floor(a/1e3)>>>0,(W=Math.floor(a/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+56>>2]=q[0],L[t+60>>2]=q[1],C[t+64>>2]=a%1e3*1e3,q=[Math.floor(i/1e3)>>>0,(W=Math.floor(i/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+72>>2]=q[0],L[t+76>>2]=q[1],C[t+80>>2]=i%1e3*1e3,q=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+88>>2]=q[0],L[t+92>>2]=q[1],0},doMsync(e,r,t,n,o){if(!ve.isFile(r.node.mode))throw new ve.ErrnoError(43);if(2&n)return 0;var a=x.slice(e,e+t);ve.msync(r,a,o,t,n)},varargs:void 0,get(){var e=L[+we.varargs>>2];return we.varargs+=4,e},getp:()=>we.get(),getStr:e=>ye(e),getStreamFromFD:e=>ve.getStreamChecked(e)},be=e=>{_=e,te()||(o.onExit?.(e),F=!0),l(e,new re(e))},_e=(e,r)=>{_=e,be(e)},Ee=e=>{if(!F)try{e(),(()=>{if(!te())try{_e(_)}catch(e){ee(e)}})()}catch(e){ee(e)}},xe=(e,r)=>setTimeout((()=>{Ee(e)}),r),Se=e=>{Se.shown||={},Se.shown[e]||(Se.shown[e]=1,f&&(e="warning: "+e),b(e))},ke={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){ke.mainLoop.scheduler=null,ke.mainLoop.currentlyRunningMainloop++},resume(){ke.mainLoop.currentlyRunningMainloop++;var e=ke.mainLoop.timingMode,r=ke.mainLoop.timingValue,t=ke.mainLoop.func;ke.mainLoop.func=null,((e,r,t,n,o)=>{T(!ke.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ke.mainLoop.func=e,ke.mainLoop.arg=n;var a=ke.mainLoop.currentlyRunningMainloop;function i(){return!(a0){Date.now();var r=ke.mainLoop.queue.shift();if(r.func(r.arg),ke.mainLoop.remainingBlockers){var t=ke.mainLoop.remainingBlockers,n=t%1==0?t-1:Math.floor(t);r.counted?ke.mainLoop.remainingBlockers=n:(n+=.5,ke.mainLoop.remainingBlockers=(8*t+n)/9)}if(ke.mainLoop.updateStatus(),!i())return;setTimeout(ke.mainLoop.runner,0)}else i()&&(ke.mainLoop.currentFrameNumber=ke.mainLoop.currentFrameNumber+1|0,1==ke.mainLoop.timingMode&&ke.mainLoop.timingValue>1&&ke.mainLoop.currentFrameNumber%ke.mainLoop.timingValue!=0?ke.mainLoop.scheduler():(0==ke.mainLoop.timingMode&&(ke.mainLoop.tickStartTime=K()),gr.newRenderingFrameStarted(),ke.mainLoop.runIter(e),i()&&("object"==typeof SDL&&SDL.audio?.queueNewAudioData?.(),ke.mainLoop.scheduler())))}})(t,0,0,ke.mainLoop.arg),J(e,r),ke.mainLoop.scheduler()},updateStatus(){if(o.setStatus){var e=o.statusMessage||"Please wait...",r=ke.mainLoop.remainingBlockers,t=ke.mainLoop.expectedBlockers;r?r{T(i.complete,`Image ${r} could not be decoded`);var n=document.createElement("canvas");n.width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0),Ur[r]=n,URL.revokeObjectURL(a),t?.(e)},i.onerror=e=>{b(`Image ${a} could not be decoded`),n?.()},i.src=a}};ge.push(e);var r={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var o=!1;function a(n){o||(o=!0,Gr[r]=n,t?.(e))}var i=new Blob([e],{type:ke.getMimetype(r)}),s=URL.createObjectURL(i),u=new Audio;u.addEventListener("canplaythrough",(()=>a(u)),!1),u.onerror=function(t){o||(b(`warning: browser could not fully decode audio ${r}, trying slower base64 approach`),u.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,o=0,a=0;a=6;){var i=n>>o-6&63;o-=6,t+=r[i]}return 2==o?(t+=r[(3&n)<<4],t+="=="):4==o&&(t+=r[(15&n)<<2],t+="="),t}(e),a(u))},u.src=s,xe((()=>{a(u)}),1e4)}};ge.push(r);var t=o.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&t.addEventListener("click",(e=>{!ke.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ke.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext(e,r,t,n){if(r&&o.ctx&&e==o.canvas)return o.ctx;var a,i;if(r){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==gr&&(i=gr.createContext(e,s))&&(a=gr.getContext(i).GLctx)}else a=e.getContext("2d");return a?(t&&(r||T(void 0===zr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=a,r&&gr.makeContextCurrent(i),o.useWebGL=r,ke.moduleContextCreatedCallbacks.forEach((e=>e())),ke.init()),a):null},destroyContext(e,r,t){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,r){ke.lockPointer=e,ke.resizeCanvas=r,void 0===ke.lockPointer&&(ke.lockPointer=!0),void 0===ke.resizeCanvas&&(ke.resizeCanvas=!1);var t=o.canvas;function n(){ke.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=ke.exitFullscreen,ke.lockPointer&&t.requestPointerLock(),ke.isFullscreen=!0,ke.resizeCanvas?ke.setFullscreenCanvasSize():ke.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),ke.resizeCanvas?ke.setWindowedCanvasSize():ke.updateCanvasDimensions(t)),o.onFullScreen?.(ke.isFullscreen),o.onFullscreen?.(ke.isFullscreen)}ke.fullscreenHandlersInstalled||(ke.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen:()=>!!ke.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var r=Date.now();if(0===ke.nextRAF)ke.nextRAF=r+1e3/60;else for(;r+2>=ke.nextRAF;)ke.nextRAF+=1e3/60;var t=Math.max(ke.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,ke.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,r)=>xe(e,r),safeRequestAnimationFrame:e=>ke.requestAnimationFrame((()=>{Ee(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(e,r){var t=o.canvas.getBoundingClientRect(),n=o.canvas.width,a=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,s=void 0!==window.scrollY?window.scrollY:window.pageYOffset,u=e-(i+t.left),c=r-(s+t.top);return{x:u*=n/t.width,y:c*=a/t.height}},setMouseCoords(e,r){const{x:t,y:n}=ke.calculateMouseCoords(e,r);ke.mouseMovementX=t-ke.mouseX,ke.mouseMovementY=n-ke.mouseY,ke.mouseX=t,ke.mouseY=n},calculateMouseEvent(e){if(ke.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ke.mouseMovementX=ke.mouseMovementY=0:(ke.mouseMovementX=ke.getMovementX(e),ke.mouseMovementY=ke.getMovementY(e)),"undefined"!=typeof SDL?(ke.mouseX=SDL.mouseX+ke.mouseMovementX,ke.mouseY=SDL.mouseY+ke.mouseMovementY):(ke.mouseX+=ke.mouseMovementX,ke.mouseY+=ke.mouseMovementY);else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var r=e.touch;if(void 0===r)return;var t=ke.calculateMouseCoords(r.pageX,r.pageY);if("touchstart"===e.type)ke.lastTouches[r.identifier]=t,ke.touches[r.identifier]=t;else if("touchend"===e.type||"touchmove"===e.type){var n=ke.touches[r.identifier];n||=t,ke.lastTouches[r.identifier]=n,ke.touches[r.identifier]=t}return}ke.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=o.canvas;ke.resizeListeners.forEach((r=>r(e.width,e.height)))},setCanvasSize(e,r,t){var n=o.canvas;ke.updateCanvasDimensions(n,e,r),t||ke.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e|=8388608,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e&=-8388609,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},updateCanvasDimensions(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/a{for(;e.length>0;)e.shift()(o)},Ce=o.noExitRuntime||!0;function Be(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,E[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=E[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,E[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=E[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){if(at(this.get_type()))return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Pe,Fe,Te=e=>(L[Kr()>>2]=e,e),De=e=>{for(var r="",t=e;x[t];)r+=Pe[x[t++]];return r},Ae={},Me={},Ie={},Ve=e=>{throw new Fe(e)};function Re(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ve(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ve(`Cannot register type '${n}' twice`)}if(Me[e]=r,delete Ie[e],Ae.hasOwnProperty(e)){var o=Ae[e];delete Ae[e],o.forEach((e=>e()))}}(e,r,t)}function Oe(){this.allocated=[void 0],this.freelist=[]}var ze=new Oe,Ue=e=>{e>=ze.reserved&&0==--ze.get(e).refcount&&ze.free(e)},Ge={toValue:e=>(e||Ve("Cannot use deleted val. handle = "+e),ze.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ze.allocate({refcount:1,value:e})}}};function Ne(e){return this.fromWireType(L[e>>2])}var je=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(B[e>>2])};case 8:return function(e){return this.fromWireType(P[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},He=(e,r,t)=>{switch(r){case 1:return t?e=>E[e>>0]:e=>x[e>>0];case 2:return t?e=>S[e>>1]:e=>k[e>>1];case 4:return t?e=>L[e>>2]:e=>C[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function We(e){return this.fromWireType(C[e>>2])}var qe=(e,r,t)=>le(e,x,r,t),Ye="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Xe=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&k[n];)++n;if((t=n<<1)-e>32&&Ye)return Ye.decode(x.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},$e=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=i,r+=2}return S[r>>1]=0,r-n},Qe=e=>2*e.length,Ke=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=L[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ze=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),L[r>>2]=i,(r+=4)+4>o)break}return L[r>>2]=0,r-n},Je=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},er=(e,r)=>{var t,n,o=Me[e];return void 0===o&&Ve(r+" has unknown type "+(t=Zr(e),n=De(t),$r(t),n)),o},rr={},tr=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,nr=e=>e%4==0&&(e%100!=0||e%400==0),or=[0,31,60,91,121,152,182,213,244,274,305,335],ar=[0,31,59,90,120,151,181,212,243,273,304,334],ir=e=>(nr(e.getFullYear())?or:ar)[e.getMonth()]+e.getDate()-1,sr=e=>{var r=ce(e)+1,t=Qr(r);return t&&qe(e,t,r),t},ur=[],cr=e=>{var r=(e-y.buffer.byteLength+65535)/65536;try{return y.grow(r),D(),1}catch(e){}},lr=e=>(N("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),dr={},mr=e=>{e.forEach((e=>{var r=lr();r&&(dr[r]=e)}))};function fr(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var pr,gr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:e=>{for(var r=gr.counter++,t=e.length;t32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=gr.log2ceilLookup(gr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=gr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s>1,c=new Uint16Array(u),l=(n=0,0);c[n++]=l,!(n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var r=gr.log2ceilLookup(e),t=gr.currentContext.tempVertexBuffers1[r],n=gr.currentContext.tempVertexBufferCounters1[r];gr.currentContext.tempVertexBufferCounters1[r]=gr.currentContext.tempVertexBufferCounters1[r]+1&gr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=zr.getParameter(34964);return t[n]=zr.createBuffer(),zr.bindBuffer(34962,t[n]),zr.bufferData(34962,1<{for(var o="",a=0;a>2]:-1;o+=ye(L[t+4*a>>2],i<0?void 0:i)}return o},calcBufLength:function(e,r,t,n){return t>0?n*t:e*gr.byteSizeByType[r-gr.byteSizeByTypeRoot]*n},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){gr.resetBufferBinding=!1;for(var r=0;r{e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);if(!t)return 0;var n=gr.registerContext(t,r),o=t.getSupportedExtensions,a=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"];return t.getSupportedExtensions=function(){return(o.apply(this)||[]).filter((e=>a.includes(e)))},n},registerContext:(e,r)=>{var t=gr.getNewId(gr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),gr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&gr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o(gr.currentContext=gr.contexts[e],o.ctx=zr=gr.currentContext?.GLctx,!(e&&!zr)),getContext:e=>gr.contexts[e],deleteContext:e=>{gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof hr&&hr.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null},initExtensions:e=>{if(e||=gr.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),(e=>{e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")})(t),(t.getSupportedExtensions()||[]).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}},getExtensions(){var e=zr.getSupportedExtensions()||[];return e.concat(e.map((e=>"GL_"+e)))}},hr={inEventHandler:0,removeAllEventListeners(){for(var e=hr.eventHandlers.length-1;e>=0;--e)hr._removeHandler(e);hr.eventHandlers=[],hr.deferredCalls=[]},registerRemoveEventListeners(){hr.removeEventListenersRegistered||(I.push(hr.removeAllEventListeners),hr.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var o in hr.deferredCalls){var a=hr.deferredCalls[o];if(a.targetFunction==e&&n(a.argsList,t))return}hr.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),hr.deferredCalls.sort(((e,r)=>e.precedencenavigator.userActivation?navigator.userActivation.isActive:hr.inEventHandler&&hr.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(hr.canPerformEventHandlerRequests())for(var e=0;e{for(var t=0;te?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},vr=["default","low-power","high-performance"],yr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],wr=e=>("number"==typeof e&&(e=ye(e)),e&&"#canvas"!==e?void 0!==gr&&gr.offscreenCanvases[e]?gr.offscreenCanvases[e]:(e=>{try{return e?("number"==typeof e&&(e=yr[e]||ye(e)),"#window"===e?window:"#document"===e?document:"#screen"===e?screen:"#canvas"===e?o.canvas:"string"==typeof e?document.getElementById(e):e):window}catch(e){return null}})(e):void 0!==gr&&gr.offscreenCanvases.canvas?gr.offscreenCanvases.canvas:o.canvas),br=e=>{var r=ce(e)+1,t=ot(r);return qe(e,t,r),t},_r=[],Er={errorCallback:(e,r,t,n)=>{var o,a;o=()=>{var o,a,i=br(t);((a=_r[o=e])||(o>=_r.length&&(_r.length=o+1),_r[o]=a=pr.get(o)),a)(r,i,n)},a=tt(),o(),nt(a)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}Er.mgrDevice||(Er.mgrSurface=Er.mgrSurface||new e,Er.mgrSwapChain=Er.mgrSwapChain||new e,Er.mgrAdapter=Er.mgrAdapter||new e,Er.mgrDevice=Er.mgrDevice||new e,Er.mgrQueue=Er.mgrQueue||new e,Er.mgrCommandBuffer=Er.mgrCommandBuffer||new e,Er.mgrCommandEncoder=Er.mgrCommandEncoder||new e,Er.mgrRenderPassEncoder=Er.mgrRenderPassEncoder||new e,Er.mgrComputePassEncoder=Er.mgrComputePassEncoder||new e,Er.mgrBindGroup=Er.mgrBindGroup||new e,Er.mgrBuffer=Er.mgrBuffer||new e,Er.mgrSampler=Er.mgrSampler||new e,Er.mgrTexture=Er.mgrTexture||new e,Er.mgrTextureView=Er.mgrTextureView||new e,Er.mgrQuerySet=Er.mgrQuerySet||new e,Er.mgrBindGroupLayout=Er.mgrBindGroupLayout||new e,Er.mgrPipelineLayout=Er.mgrPipelineLayout||new e,Er.mgrRenderPipeline=Er.mgrRenderPipeline||new e,Er.mgrComputePipeline=Er.mgrComputePipeline||new e,Er.mgrShaderModule=Er.mgrShaderModule||new e,Er.mgrRenderBundleEncoder=Er.mgrRenderBundleEncoder||new e,Er.mgrRenderBundle=Er.mgrRenderBundle||new e)},makeColor:e=>({r:P[e>>3],g:P[e+8>>3],b:P[e+16>>3],a:P[e+24>>3]}),makeExtent3D:e=>({width:C[e>>2],height:C[e+4>>2],depthOrArrayLayers:C[e+8>>2]}),makeOrigin3D:e=>({x:C[e>>2],y:C[e+4>>2],z:C[e+8>>2]}),makeImageCopyTexture:e=>({texture:Er.mgrTexture.get(C[e+4>>2]),mipLevel:C[e+8>>2],origin:Er.makeOrigin3D(e+12),aspect:Er.TextureAspect[C[e+24>>2]]}),makeTextureDataLayout:e=>{var r=C[e+16>>2],t=C[e+20>>2];return{offset:4294967296*C[e+4+8>>2]+C[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=e+8,t=Er.makeTextureDataLayout(r);return t.buffer=Er.mgrBuffer.get(C[e+32>>2]),t},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n>2])]=P[o+8>>3]}return t}},makePipelineLayout:e=>e?Er.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}},BufferMapState:["unmapped","pending","mapped"],CompilationMessageType:["error","warning","info"],DeviceLostReason:{undefined:0,destroyed:1},PreferredFormat:{rgba8unorm:18,bgra8unorm:23},AddressMode:["repeat","mirror-repeat","clamp-to-edge"],BlendFactor:["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:["add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],CompareFunction:[,"never","less","less-equal","greater","greater-equal","equal","not-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:["none","front","back"],ErrorFilter:["validation","out-of-memory","internal"],FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32filterable"],FilterMode:["nearest","linear"],FrontFace:["ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:["nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:["point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:["occlusion","timestamp"],SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only"],StoreOp:[,"store","discard"],TextureAspect:["all","stencil-only","depth-only"],TextureDimension:["1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4"],VertexStepMode:["vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10",float32filterable:"11"}},xr={values:{},next_id:1,add(e){var r;do{r=xr.next_id++,xr.next_id>2147483647&&(xr.next_id=1)}while(r in xr.values);return xr.values[r]=e,r},remove(e){delete xr.values[e]},get:e=>xr.values[e]},Sr={},kr=()=>{if(!kr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var r in Sr)void 0===Sr[r]?delete e[r]:e[r]=Sr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);kr.strings=t}return kr.strings},Lr=[],Cr=(e,r,t,n)=>{for(var o=0;o>2]=i}},Br=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Pr=e=>0==(e-=5120)?E:1==e?x:2==e?S:4==e?L:6==e?B:5==e||28922==e||28520==e||30779==e||30782==e?C:k,Fr=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),Tr=(e,r,t,n,o,a)=>{var i=Pr(e),s=Fr(i),u=1<({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*u,l=((e,r,t,n)=>{var o;return r*(e*t+(o=n)-1&-o)})(t,n,c,gr.unpackAlignment);return i.subarray(o>>s,o+l>>s)},Dr=e=>{var r=zr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=zr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}gr.recordError(1282)},Ar=[],Mr=[],Ir=[31,29,31,30,31,30,31,31,30,31,30,31],Vr=[31,28,31,30,31,30,31,31,30,31,30,31],Rr=(e,r)=>{E.set(e,r)},Or=(e,r,t,n)=>{var o=C[n+40>>2],a={tm_sec:L[n>>2],tm_min:L[n+4>>2],tm_hour:L[n+8>>2],tm_mday:L[n+12>>2],tm_mon:L[n+16>>2],tm_year:L[n+20>>2],tm_wday:L[n+24>>2],tm_yday:L[n+28>>2],tm_isdst:L[n+32>>2],tm_gmtoff:L[n+36>>2],tm_zone:o?ye(o):""},i=ye(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=nr(t.getFullYear()),o=t.getMonth(),a=(n?Ir:Vr)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(t),a=p(n);return f(o,r)<=0?f(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var h={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(nr(e.tm_year+1900)?Ir:Vr,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&nr(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&nr(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),h)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),h[u](a)));var v=de(i=i.replace(/\0\0/g,"%"),!1);return v.length>r?0:(Rr(v,e),v.length-1)};o.requestFullscreen=ke.requestFullscreen,o.requestAnimationFrame=ke.requestAnimationFrame,o.setCanvasSize=ke.setCanvasSize,o.pauseMainLoop=ke.mainLoop.pause,o.resumeMainLoop=ke.mainLoop.resume,o.getUserMedia=ke.getUserMedia,o.createContext=ke.createContext;var zr,Ur={},Gr={},Nr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ve.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Nr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ve.isDir(this.mode)}},isDevice:{get:function(){return ve.isChrdev(this.mode)}}}),ve.FSNode=Nr,ve.createPreloadedFile=(e,r,t,n,o,a,s,u,c,l)=>{var d=r?ae.resolve(ne.join2(e,r)):e;function m(t){function i(t){l?.(),u||((e,r,t,n,o,a)=>{ve.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,c),a?.(),G()}((e,r,t,n)=>{void 0!==ke&&ke.init();var o=!1;return ge.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,i,(()=>{s?.(),G()}))||i(t)}U(),"string"==typeof t?((e,r,t,n)=>{var o=`al ${e}`;i(e,(r=>{T(r,`Loading data file "${e}" failed (no arrayBuffer).`),m(new Uint8Array(r)),o&&G()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&U()})(t,0,s):m(t)},ve.staticInit(),o.FS_createPath=ve.createPath,o.FS_createDataFile=ve.createDataFile,o.FS_createPreloadedFile=ve.createPreloadedFile,o.FS_unlink=ve.unlink,o.FS_createLazyFile=ve.createLazyFile,o.FS_createDevice=ve.createDevice,(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Pe=e})(),Fe=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Oe.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),ze.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),ze.reserved=ze.allocated.length,o.count_emval_handles=()=>{for(var e=0,r=ze.reserved;r({data:new s(i?o.HEAPU8.slice(e,e+r).buffer:o.HEAPU8.buffer,e,t*n*a),width:t,height:n}))},t:function(){o._wrapSimpleListenerOutput||(o._wrapSimpleListenerOutput=(e,...r)=>{if(o.simpleListeners){const t=ye(e);o.simpleListeners[t]&&o.simpleListeners[t](...r)}}),o._wrapEmptyPacketListenerOutput||(o._wrapEmptyPacketListenerOutput=(e,r)=>{if(o.emptyPacketListeners){const t=ye(e);o.emptyPacketListeners[t]&&o.emptyPacketListeners[t](r)}})},Ha:function(){return o&&o.gpuOriginForWebTexturesIsBottomLeft},j:(e,r,t)=>{throw new Be(e).init(r,t),e},Ga:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 0:if((o=we.get())<0)return-28;for(;ve.streams[o];)o++;return ve.createStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=we.get();return n.flags|=o,0;case 12:return o=we.getp(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return Te(28),-1}}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Nc:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=we.getp();L[a>>2]=o.c_iflag||0,L[a+4>>2]=o.c_oflag||0,L[a+8>>2]=o.c_cflag||0,L[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)E[a+i+17>>0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=we.getp();var s=L[a>>2],u=L[a+4>>2],c=L[a+8>>2],l=L[a+12>>2],d=[];for(i=0;i<32;i++)d.push(E[a+i+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(a=we.getp(),L[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=we.getp(),ve.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=we.getp(),S[a>>1]=m[0],S[a+2>>1]=m[1]}return 0;default:return-28}}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Fa:function(e,r,t,n){we.varargs=n;try{r=we.getStr(r),r=we.calculateAt(e,r);var o=n?we.get():0;return ve.open(r,t,o).fd}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Mc:function(e,r){try{return e=we.getStr(e),we.doStat(ve.stat,e,r)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Tb:(e,r,t,n,o)=>{},Hc:(e,r,t,n)=>{Re(e,{name:r=De(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(x[e])},destructorFunction:null})},Gc:(e,r)=>{Re(e,{name:r=De(r),fromWireType:e=>{var r=Ge.toValue(e);return Ue(e),r},toWireType:(e,r)=>Ge.toHandle(r),argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},Da:(e,r,t)=>{Re(e,{name:r=De(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:je(r,t),destructorFunction:null})},E:(e,r,t,n,o)=>{r=De(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<>>i}var s=r.includes("unsigned");Re(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:He(r,t,0!==n),destructorFunction:null})},o:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=C[e>>2],t=C[e+4>>2];return new n(E.buffer,t,r)}Re(e,{name:t=De(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ca:(e,r)=>{var t="std::string"===(r=De(r));Re(e,{name:r,fromWireType(e){var r,n=C[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==x[s]){var u=ye(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var c=new Array(n);for(i=0;i>2]=n,t&&o)qe(r,i,n+1);else if(o)for(var s=0;s255&&($r(i),Ve("String has UTF-16 code units that do not fit in 8 bits")),x[i+s]=u}else for(s=0;s{var n,o,a,i,s;t=De(t),2===r?(n=Xe,o=$e,i=Qe,a=()=>k,s=1):4===r&&(n=Ke,o=Ze,i=Je,a=()=>C,s=2),Re(e,{name:t,fromWireType:e=>{for(var t,o=C[e>>2],i=a(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==i[l>>s]){var d=n(u,l-u);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),u=l+r}}return $r(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Ve(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=Qr(4+a+r);return C[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push($r,u),u},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction(e){$r(e)}})},Fc:(e,r)=>{Re(e,{isVoid:!0,name:r=De(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},Ec:()=>1,ga:(e,r,t)=>(e=Ge.toValue(e),((e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(C[r>>2]=Ge.toHandle(n)),o})(r=er(r,"emval::as"),t,e)),u:Ue,Ba:(e,r)=>(e=Ge.toValue(e),r=Ge.toValue(r),Ge.toHandle(e[r])),Dc:e=>{e>4&&(ze.get(e).refcount+=1)},ca:e=>{return Ge.toHandle(void 0===(t=rr[r=e])?De(r):t);var r,t},fa:e=>{(e=>{for(;e.length;){var r=e.pop();e.pop()(r)}})(Ge.toValue(e)),Ue(e)},Aa:(e,r,t)=>{e=Ge.toValue(e),r=Ge.toValue(r),t=Ge.toValue(t),e[r]=t},ba:(e,r)=>{var t=(e=er(e,"_emval_take_value")).readValueFromPointer(r);return Ge.toHandle(t)},Cc:e=>(e=Ge.toValue(e),Ge.toHandle(typeof e)),Sb:function(e,r,t){var n=tr(e,r),o=new Date(1e3*n);L[t>>2]=o.getUTCSeconds(),L[t+4>>2]=o.getUTCMinutes(),L[t+8>>2]=o.getUTCHours(),L[t+12>>2]=o.getUTCDate(),L[t+16>>2]=o.getUTCMonth(),L[t+20>>2]=o.getUTCFullYear()-1900,L[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;L[t+28>>2]=i},Rb:function(e,r,t){var n=tr(e,r),o=new Date(1e3*n);L[t>>2]=o.getSeconds(),L[t+4>>2]=o.getMinutes(),L[t+8>>2]=o.getHours(),L[t+12>>2]=o.getDate(),L[t+16>>2]=o.getMonth(),L[t+20>>2]=o.getFullYear()-1900,L[t+24>>2]=o.getDay();var a=0|ir(o);L[t+28>>2]=a,L[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));L[t+32>>2]=c},Qb:function(e){var r=(()=>{var r=new Date(L[e+20>>2]+1900,L[e+16>>2],L[e+12>>2],L[e+8>>2],L[e+4>>2],L[e>>2],0),t=L[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)L[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=Math.max(i,a),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}L[e+24>>2]=r.getDay();var l=0|ir(r);L[e+28>>2]=l,L[e>>2]=r.getSeconds(),L[e+4>>2]=r.getMinutes(),L[e+8>>2]=r.getHours(),L[e+12>>2]=r.getDate(),L[e+16>>2]=r.getMonth(),L[e+20>>2]=r.getYear();var d=r.getTime();return isNaN(d)?(Te(61),-1):d/1e3})();return rt((W=r,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)),r>>>0},Pb:function(e,r,t,n,o,a,i,s){var u=tr(o,a);try{if(isNaN(u))return 61;var c=we.getStreamFromFD(n),l=ve.mmap(c,e,u,r,t),d=l.ptr;return L[i>>2]=l.allocated,C[s>>2]=d,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Ob:function(e,r,t,n,o,a,i){var s=tr(a,i);try{if(isNaN(s))return 61;var u=we.getStreamFromFD(o);2&t&&we.doMsync(e,u,r,n,s),ve.munmap(u)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Bc:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}C[e>>2]=60*u,L[r>>2]=Number(i!=s);var l=c(o),d=c(a),m=sr(l),f=sr(d);s>2]=m,C[t+4>>2]=f):(C[t>>2]=f,C[t+4>>2]=m)},a:()=>{N("")},Ac:function(e,r){if("undefined"!=typeof dbg)dbg(ye(e,r));else{if(void 0===t)function t(e){console.warn.apply(console,arguments)}t(ye(e,r))}},K:(e,r,t)=>((e,r,t)=>{var n=((e,r)=>{var t;for(ur.length=0;t=x[e++];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,ur.push(112==t?C[r>>2]:105==t?L[r>>2]:P[r>>3]),r+=n?8:4}return ur})(r,t);return Z[e].apply(null,n)})(e,r,t),zc:()=>Date.now(),ea:(e,r)=>b(ye(e,r)),yc:()=>2147483648,s:K,xc:(e,r,t)=>x.copyWithin(e,r,r+t),wc:(e,r)=>w(ye(e,r)),vc:e=>(N("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),uc:e=>{var r=x.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,(n=Math.max(e,a))+(65536-n%65536)%65536);if(cr(i))return!0}return!1},tc:function(){var e=fr().split("\n");return"Error"==e[0]&&e.shift(),mr(e),dr.last_addr=lr(e[3]),dr.last_stack=e,dr.last_addr},sc:(e,r,t)=>{var n;dr.last_addr==e?n=dr.last_stack:("Error"==(n=fr().split("\n"))[0]&&n.shift(),mr(n));for(var o=3;n[o]&&lr(n[o])!=e;)++o;for(var a=0;a>2]=lr(n[a+o]);return a},rc:(e,r)=>{var t=r>>2,n=L[t+6],o={alpha:!!L[t+0],depth:!!L[t+1],stencil:!!L[t+2],antialias:!!L[t+3],premultipliedAlpha:!!L[t+4],preserveDrawingBuffer:!!L[t+5],powerPreference:vr[n],failIfMajorPerformanceCaveat:!!L[t+7],majorVersion:L[t+8],minorVersion:L[t+9],enableExtensionsByDefault:L[t+10],explicitSwapControl:L[t+11],proxyContextToMainThread:L[t+12],renderViaOffscreenBackBuffer:L[t+13]},a=wr(e);return a?o.explicitSwapControl?0:gr.createContext(a,o):0},qc:e=>{gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},pc:(e,r)=>{if(!r)return-5;if(!(e=gr.contexts[e]))return-3;var t=e.GLctx;if(!t)return-3;t=t.getContextAttributes(),L[r>>2]=t.alpha,L[r+4>>2]=t.depth,L[r+8>>2]=t.stencil,L[r+12>>2]=t.antialias,L[r+16>>2]=t.premultipliedAlpha,L[r+20>>2]=t.preserveDrawingBuffer;var n=t.powerPreference&&vr.indexOf(t.powerPreference);return L[r+24>>2]=n,L[r+28>>2]=t.failIfMajorPerformanceCaveat,L[r+32>>2]=e.version,L[r+36>>2]=0,L[r+40>>2]=e.attributes.enableExtensionsByDefault,0},za:()=>gr.currentContext?gr.currentContext.handle:0,oc:e=>{for(var r=e>>2,t=0;t<14;++t)L[r+t]=0;L[r+0]=L[r+1]=L[r+3]=L[r+4]=L[r+8]=L[r+10]=1},nc:e=>gr.makeContextCurrent(e)?0:-5,mc:e=>xr.add(Er.mgrDevice.get(e)),lc:e=>xr.add(Er.mgrTexture.get(e)),O:()=>{if(void 0===Er.preinitializedDeviceId){var e=o.preinitializedWebGPUDevice,r={queueId:Er.mgrQueue.create(e.queue)};Er.preinitializedDeviceId=Er.mgrDevice.create(e,r)}return Er.mgrDevice.reference(Er.preinitializedDeviceId),Er.preinitializedDeviceId},kc:e=>Er.mgrTexture.create(xr.get(e)),jc:e=>xr.remove(e),Lc:(e,r)=>{var t=0;return kr().forEach(((n,o)=>{var a=r+t;C[e+4*o>>2]=a,((e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);E[r>>0]=0})(n,a),t+=n.length+1})),0},Kc:(e,r)=>{var t=kr();C[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),C[r>>2]=n,0},ya:_e,ia:function(e){try{var r=we.getStreamFromFD(e);return ve.close(r),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Jc:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=ve.read(e,E,i,s,n);if(u<0)return-1;if(o+=u,u>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Ub:function(e,r,t,n,o){var a=tr(r,t);try{if(isNaN(a))return 61;var i=we.getStreamFromFD(e);return ve.llseek(i,a,n),q=[i.position>>>0,(W=i.position,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[o>>2]=q[0],L[o+4>>2]=q[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Ea:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=ve.write(e,E,i,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(we.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},ic:(e,r)=>(oe(x.subarray(e,e+r)),0),c:function(e){zr.activeTexture(e)},aa:(e,r)=>{zr.attachShader(gr.programs[e],gr.shaders[r])},hc:(e,r,t)=>{zr.bindAttribLocation(gr.programs[e],r,ye(t))},e:(e,r)=>{34962==e?zr.currentArrayBufferBinding=r:34963==e&&(zr.currentElementArrayBufferBinding=r),35051==e?zr.currentPixelPackBufferBinding=r:35052==e&&(zr.currentPixelUnpackBufferBinding=r),zr.bindBuffer(e,gr.buffers[r])},gc:(e,r,t)=>{zr.bindBufferBase(e,r,gr.buffers[t])},v:(e,r)=>{zr.bindFramebuffer(e,gr.framebuffers[r])},b:(e,r)=>{zr.bindTexture(e,gr.textures[r])},q:e=>{zr.bindVertexArray(gr.vaos[e]);var r=zr.getParameter(34965);zr.currentElementArrayBufferBinding=r?0|r.name:0},xa:function(e){zr.blendEquation(e)},fc:function(e,r){zr.blendFunc(e,r)},m:(e,r,t,n)=>{gr.currentContext.version>=2?t&&r?zr.bufferData(e,x,n,t,r):zr.bufferData(e,r,n):zr.bufferData(e,t?x.subarray(t,t+r):r,n)},x:function(e){zr.clear(e)},$:function(e,r,t,n){zr.clearColor(e,r,t,n)},P:(e,r,t,n)=>{var o=(t>>>0)+4294967296*n;return zr.clientWaitSync(gr.syncs[e],r,o)},wa:e=>{zr.compileShader(gr.shaders[e])},va:()=>{var e=gr.getNewId(gr.programs),r=zr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,gr.programs[e]=r,e},ua:e=>{var r=gr.getNewId(gr.shaders);return gr.shaders[r]=zr.createShader(e),r},B:(e,r)=>{for(var t=0;t>2],o=gr.buffers[n];o&&(zr.deleteBuffer(o),o.name=0,gr.buffers[n]=null,n==zr.currentArrayBufferBinding&&(zr.currentArrayBufferBinding=0),n==zr.currentElementArrayBufferBinding&&(zr.currentElementArrayBufferBinding=0),n==zr.currentPixelPackBufferBinding&&(zr.currentPixelPackBufferBinding=0),n==zr.currentPixelUnpackBufferBinding&&(zr.currentPixelUnpackBufferBinding=0))}},J:(e,r)=>{for(var t=0;t>2],o=gr.framebuffers[n];o&&(zr.deleteFramebuffer(o),o.name=0,gr.framebuffers[n]=null)}},i:e=>{if(e){var r=gr.programs[e];r?(zr.deleteProgram(r),r.name=0,gr.programs[e]=null):gr.recordError(1281)}},T:e=>{if(e){var r=gr.shaders[e];r?(zr.deleteShader(r),gr.shaders[e]=null):gr.recordError(1281)}},_:e=>{if(e){var r=gr.syncs[e];r?(zr.deleteSync(r),r.name=0,gr.syncs[e]=null):gr.recordError(1281)}},z:(e,r)=>{for(var t=0;t>2],o=gr.textures[n];o&&(zr.deleteTexture(o),o.name=0,gr.textures[n]=null)}},I:(e,r)=>{for(var t=0;t>2];zr.deleteVertexArray(gr.vaos[n]),gr.vaos[n]=null}},ta:(e,r)=>{zr.detachShader(gr.programs[e],gr.shaders[r])},H:function(e){zr.disable(e)},p:e=>{gr.currentContext.clientBuffers[e].enabled=!1,zr.disableVertexAttribArray(e)},n:(e,r,t)=>{gr.preDrawHandleClientVertexAttribBindings(r+t),zr.drawArrays(e,r,t),gr.postDrawHandleClientVertexAttribBindings()},S:(e,r)=>{for(var t=Lr[e],n=0;n>2];zr.drawBuffers(t)},ec:function(e){zr.enable(e)},l:e=>{gr.currentContext.clientBuffers[e].enabled=!0,zr.enableVertexAttribArray(e)},sa:(e,r)=>{var t=zr.fenceSync(e,r);if(t){var n=gr.getNewId(gr.syncs);return t.name=n,gr.syncs[n]=t,n}return 0},Z:function(){zr.finish()},A:function(){zr.flush()},y:(e,r,t,n,o)=>{zr.framebufferTexture2D(e,r,t,gr.textures[n],o)},ra:(e,r,t,n,o)=>{zr.framebufferTextureLayer(e,r,gr.textures[t],n,o)},w:(e,r)=>{Cr(e,r,"createBuffer",gr.buffers)},N:(e,r)=>{Cr(e,r,"createFramebuffer",gr.framebuffers)},D:(e,r)=>{Cr(e,r,"createTexture",gr.textures)},G:function(e,r){Cr(e,r,"createVertexArray",gr.vaos)},qa:(e,r)=>zr.getAttribLocation(gr.programs[e],ye(r)),Y:()=>{var e=zr.getError()||gr.lastError;return gr.lastError=0,e},r:(e,r)=>((e,r,t)=>{if(r){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=t&&1!=t&&gr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=zr.getParameter(34467);n=o?o.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);n=2*(zr.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=zr.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void gr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void gr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i>2]=a[i];break;case 2:B[r+4*i>>2]=a[i];break;case 4:E[r+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(r){return gr.recordError(1280),void b(`GL_INVALID_ENUM in glGet${t}v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return gr.recordError(1280),void b(`GL_INVALID_ENUM in glGet${t}v: Native code calling glGet${t}v(${e}) and it returns ${a} of type ${typeof a}!`)}}switch(t){case 1:((e,r)=>{C[e>>2]=r;var t=C[e>>2];C[e+4>>2]=(r-t)/4294967296})(r,n);break;case 0:L[r>>2]=n;break;case 2:B[r>>2]=n;break;case 4:E[r>>0]=n?1:0}}else gr.recordError(1281)})(e,r,0),dc:(e,r,t)=>{if(t)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==r){var n=zr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),L[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=0;o>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(o=0;o>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(o=0;o>2]=e.maxUniformBlockNameLength}else L[t>>2]=zr.getProgramParameter(e,r);else gr.recordError(1281)},cc:(e,r,t,n)=>{var o=zr.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?qe(o,n,r):0;t&&(L[t>>2]=a)},bc:(e,r,t)=>{if(t)if(35716==r){var n=zr.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;L[t>>2]=o}else if(35720==r){var a=zr.getShaderSource(gr.shaders[e]),i=a?a.length+1:0;L[t>>2]=i}else L[t>>2]=zr.getShaderParameter(gr.shaders[e],r);else gr.recordError(1281)},F:e=>{var r=gr.stringCache[e];if(!r){switch(e){case 7939:r=sr(gr.getExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var t=zr.getParameter(e);t||gr.recordError(1280),r=t?sr(t):0;break;case 7938:var n=zr.getParameter(7938);n=gr.currentContext.version>=2?`OpenGL ES 3.0 (${n})`:`OpenGL ES 2.0 (${n})`,r=sr(n);break;case 35724:var o=zr.getParameter(35724),a=o.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),o=`OpenGL ES GLSL ES ${a[1]} (${o})`),r=sr(o);break;default:gr.recordError(1280)}gr.stringCache[e]=r}return r},ac:(e,r)=>zr.getUniformBlockIndex(gr.programs[e],ye(r)),g:(e,r)=>{if(r=ye(r),e=gr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r0?i.slice(0,u):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],t=0;t0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n{e=gr.programs[e],zr.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},X:(e,r)=>{3317==e&&(gr.unpackAlignment=r),zr.pixelStorei(e,r)},da:(e,r,t,n,o,a,i)=>{if(gr.currentContext.version>=2)if(zr.currentPixelPackBufferBinding)zr.readPixels(e,r,t,n,o,a,i);else{var s=Pr(a);zr.readPixels(e,r,t,n,o,a,s,i>>Fr(s))}else{var u=Tr(a,o,t,n,i);u?zr.readPixels(e,r,t,n,o,a,u):gr.recordError(1280)}},oa:(e,r,t,n)=>{var o=gr.getSource(e,r,t,n);zr.shaderSource(gr.shaders[e],o)},C:(e,r,t,n,o,a,i,s,u)=>{if(gr.currentContext.version>=2)if(zr.currentPixelUnpackBufferBinding)zr.texImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Pr(s);zr.texImage2D(e,r,t,n,o,a,i,s,c,u>>Fr(c))}else zr.texImage2D(e,r,t,n,o,a,i,s,null);else zr.texImage2D(e,r,t,n,o,a,i,s,u?Tr(s,i,n,o,u):null)},W:function(e,r,t){zr.texParameterf(e,r,t)},na:(e,r,t)=>{var n=B[t>>2];zr.texParameterf(e,r,n)},d:function(e,r,t){zr.texParameteri(e,r,t)},V:function(e,r,t,n,o){zr.texStorage2D(e,r,t,n,o)},$b:function(e,r,t,n,o,a){zr.texStorage3D(e,r,t,n,o,a)},R:(e,r,t,n,o,a,i,s,u)=>{if(gr.currentContext.version>=2)if(zr.currentPixelUnpackBufferBinding)zr.texSubImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Pr(s);zr.texSubImage2D(e,r,t,n,o,a,i,s,c,u>>Fr(c))}else zr.texSubImage2D(e,r,t,n,o,a,i,s,null);else{var l=null;u&&(l=Tr(s,i,o,a,u)),zr.texSubImage2D(e,r,t,n,o,a,i,s,l)}},_b:(e,r,t,n,o,a,i,s,u,c,l)=>{if(zr.currentPixelUnpackBufferBinding)zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,l);else if(l){var d=Pr(c);zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,d,l>>Fr(d))}else zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,null)},Q:(e,r)=>{zr.uniform1f(Dr(e),r)},f:(e,r)=>{zr.uniform1i(Dr(e),r)},Zb:(e,r,t)=>{zr.uniform2f(Dr(e),r,t)},Yb:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform2fv(Dr(e),B,t>>2,2*r);else{if(r<=144)for(var n=Ar[2*r-1],o=0;o<2*r;o+=2)n[o]=B[t+4*o>>2],n[o+1]=B[t+(4*o+4)>>2];else n=B.subarray(t>>2,t+8*r>>2);zr.uniform2fv(Dr(e),n)}},ma:(e,r,t,n)=>{zr.uniform3f(Dr(e),r,t,n)},la:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform4fv(Dr(e),B,t>>2,4*r);else{if(r<=72){var n=Ar[4*r-1],o=B;t>>=2;for(var a=0;a<4*r;a+=4){var i=t+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=B.subarray(t>>2,t+16*r>>2);zr.uniform4fv(Dr(e),n)}},Xb:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform4iv(Dr(e),L,t>>2,4*r);else{if(r<=72)for(var n=Mr[4*r-1],o=0;o<4*r;o+=4)n[o]=L[t+4*o>>2],n[o+1]=L[t+(4*o+4)>>2],n[o+2]=L[t+(4*o+8)>>2],n[o+3]=L[t+(4*o+12)>>2];else n=L.subarray(t>>2,t+16*r>>2);zr.uniform4iv(Dr(e),n)}},Wb:(e,r,t)=>{e=gr.programs[e],zr.uniformBlockBinding(e,r,t)},ka:(e,r,t,n)=>{if(gr.currentContext.version>=2)r&&zr.uniformMatrix4fv(Dr(e),!!t,B,n>>2,16*r);else{if(r<=18){var o=Ar[16*r-1],a=B;n>>=2;for(var i=0;i<16*r;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=B.subarray(n>>2,n+64*r>>2);zr.uniformMatrix4fv(Dr(e),!!t,o)}},h:e=>{e=gr.programs[e],zr.useProgram(e),zr.currentProgram=e},k:(e,r,t,n,o,a)=>{var i=gr.currentContext.clientBuffers[e];if(!zr.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,zr.vertexAttribPointer(e,r,t,!!n,o,a)},M:function(e,r,t,n){zr.viewport(e,r,t,n)},Vb:function(){return self.navigator.hardwareConcurrency},Mb:function(){let e;return"undefined"!=typeof HTMLCanvasElement?(e=document.createElement("canvas"),e.style.display="none"):e=new OffscreenCanvas(0,0),Ge.toHandle(e)},Lb:function(e){let r=wr(e);return o&&!r&&(r=o.canvasWebGpu),Ge.toHandle(r)},Kb:function(e){const r=Ge.toValue(e);zr.texImage2D(zr.TEXTURE_2D,0,zr.RGBA,zr.RGBA,zr.UNSIGNED_BYTE,r)},Ic:be,U:Or,Jb:(e,r,t,n,o)=>Or(e,r,t,n),Ib:e=>Er.mgrBindGroupLayout.release(e),Hb:e=>Er.mgrBindGroup.release(e),Gb:(e,r,t)=>{var n,o=Er.mgrBuffer.objects[e];if(0===t&&Se("getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE"),-1==t&&(t=void 0),2!==o.mapMode)return 0;try{n=o.object.getMappedRange(r,t)}catch(e){return 0}var a=et(16,n.byteLength);return x.fill(0,a,n.byteLength),o.onUnmap.push((()=>{new Uint8Array(n).set(x.subarray(a,a+n.byteLength)),$r(a)})),a},Fb:e=>Er.mgrBuffer.reference(e),Eb:e=>Er.mgrBuffer.release(e),Db:e=>{var r=Er.mgrBuffer.objects[e];if(r.onUnmap){for(var t=0;tEr.mgrCommandBuffer.release(e),Bb:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:Er.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}(C[r+8>>2])};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrCommandEncoder.get(e);return Er.mgrComputePassEncoder.create(o.beginComputePass(t))},Ab:(e,r)=>{function t(e){var r=C[e+4>>2];if(0!==r){var t=C[e+12>>2],n=C[e+16>>2],o=Er.makeColor(e+24);return{view:Er.mgrTextureView.get(r),resolveTarget:Er.mgrTextureView.get(C[e+8>>2]),clearValue:o,loadOp:Er.LoadOp[t],storeOp:Er.StoreOp[n]}}}function n(e,r){for(var n=[],o=0;o>2]),depthClearValue:B[e+12>>2],depthLoadOp:Er.LoadOp[C[e+4>>2]],depthStoreOp:Er.StoreOp[C[e+8>>2]],depthReadOnly:0!==E[e+16>>0],stencilClearValue:C[e+28>>2],stencilLoadOp:Er.LoadOp[C[e+20>>2]],stencilStoreOp:Er.StoreOp[C[e+24>>2]],stencilReadOnly:0!==E[e+32>>0]}}function a(e){if(0!==e)return{querySet:Er.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}var i=function(e){var r=C[e>>2],t=void 0;if(0!==r){C[r+4>>2];var i=r;t=4294967296*C[i+4+8>>2]+C[i+8>>2]}var s={label:void 0,colorAttachments:n(C[e+8>>2],C[e+12>>2]),depthStencilAttachment:o(C[e+16>>2]),occlusionQuerySet:Er.mgrQuerySet.get(C[e+20>>2]),timestampWrites:a(C[e+24>>2]),maxDrawCount:t},u=C[e+4>>2];return u&&(s.label=ye(u)),s}(r),s=Er.mgrCommandEncoder.get(e);return Er.mgrRenderPassEncoder.create(s.beginRenderPass(i))},zb:(e,r,t,n)=>{var o=Er.mgrCommandEncoder.get(e),a=Er.makeExtent3D(n);o.copyBufferToTexture(Er.makeImageCopyBuffer(r),Er.makeImageCopyTexture(t),a)},yb:(e,r,t,n)=>{var o=Er.mgrCommandEncoder.get(e),a=Er.makeExtent3D(n);o.copyTextureToTexture(Er.makeImageCopyTexture(r),Er.makeImageCopyTexture(t),a)},xb:(e,r)=>{var t=Er.mgrCommandEncoder.get(e);return Er.mgrCommandBuffer.create(t.finish())},wb:e=>Er.mgrCommandEncoder.release(e),vb:(e,r,t,n)=>{Er.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},ub:e=>{Er.mgrComputePassEncoder.get(e).end()},tb:e=>Er.mgrComputePassEncoder.release(e),sb:(e,r,t,n,o)=>{var a=Er.mgrComputePassEncoder.get(e),i=Er.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},rb:(e,r)=>{var t=Er.mgrComputePassEncoder.get(e),n=Er.mgrComputePipeline.get(r);t.setPipeline(n)},qb:(e,r)=>{var t=Er.mgrComputePipeline.get(e);return Er.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},pb:e=>Er.mgrComputePipeline.release(e),ob:(e,r)=>{function t(e){var r,t=C[e+8>>2],n=C[e+32>>2],o=C[e+36>>2],a=C[e+4>>2];if(t){var i=C[(r=e+24)>>2]+4294967296*L[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:Er.mgrBuffer.get(t),offset:4294967296*C[e+4+16>>2]+C[e+16>>2],size:i}}}return n?{binding:a,resource:Er.mgrSampler.get(n)}:{binding:a,resource:Er.mgrTextureView.get(o)}}var n={label:void 0,layout:Er.mgrBindGroupLayout.get(C[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o>2],C[r+16>>2])},o=C[r+4>>2];o&&(n.label=ye(o));var a=Er.mgrDevice.get(e);return Er.mgrBindGroup.create(a.createBindGroup(n))},nb:(e,r)=>{var t=0!==E[r+24>>0],n={label:void 0,usage:C[r+8>>2],size:4294967296*C[r+4+16>>2]+C[r+16>>2],mappedAtCreation:t},o=C[r+4>>2];o&&(n.label=ye(o));var a=Er.mgrDevice.get(e),i={},s=Er.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},mb:(e,r)=>{var t;if(r){t={label:void 0};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrDevice.get(e);return Er.mgrCommandEncoder.create(o.createCommandEncoder(t))},lb:(e,r)=>{var t={label:void 0,layout:Er.makePipelineLayout(C[r+8>>2]),compute:Er.makeProgrammableStageDescriptor(r+12)},n=C[r+4>>2];n&&(t.label=ye(n));var o=Er.mgrDevice.get(e);return Er.mgrComputePipeline.create(o.createComputePipeline(t))},kb:(e,r)=>{var t=(e=>{function r(e){if(e)return{operation:Er.BlendOperation[C[e>>2]],srcFactor:Er.BlendFactor[C[e+4>>2]],dstFactor:Er.BlendFactor[C[e+8>>2]]}}function t(e){if(e)return{alpha:r(e+12),color:r(e+0)}}function n(e,r){for(var n,o,a=[],i=0;i>2])?void 0:{format:Er.TextureFormat[o],blend:t(C[n+8>>2]),writeMask:C[n+12>>2]}));return a}function o(e){return{compare:Er.CompareFunction[C[e>>2]],failOp:Er.StencilOperation[C[e+4>>2]],depthFailOp:Er.StencilOperation[C[e+8>>2]],passOp:Er.StencilOperation[C[e+12>>2]]}}function a(e,r){for(var t,n=[],o=0;o>2]],offset:4294967296*C[t+4+8>>2]+C[t+8>>2],shaderLocation:C[t+16>>2]}));return n}function i(e){if(e){var r=C[e+8>>2];return 2===r?null:{arrayStride:4294967296*C[e+4>>2]+C[e>>2],stepMode:Er.VertexStepMode[r],attributes:a(C[e+12>>2],C[e+16>>2])}}}function s(e,r){if(e){for(var t=[],n=0;n>2]),vertex:function(e){if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2]),buffers:s(C[e+20>>2],C[e+24>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}}(e+12),primitive:function(e){if(e)return{topology:Er.PrimitiveTopology[C[e+4>>2]],stripIndexFormat:Er.IndexFormat[C[e+8>>2]],frontFace:Er.FrontFace[C[e+12>>2]],cullMode:Er.CullMode[C[e+16>>2]]}}(e+40),depthStencil:function(e){if(e)return{format:Er.TextureFormat[C[e+4>>2]],depthWriteEnabled:0!==E[e+8>>0],depthCompare:Er.CompareFunction[C[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:C[e+48>>2],stencilWriteMask:C[e+52>>2],depthBias:L[e+56>>2],depthBiasSlopeScale:B[e+60>>2],depthBiasClamp:B[e+64>>2]}}(C[e+60>>2]),multisample:function(e){if(e)return{count:C[e+4>>2],mask:C[e+8>>2],alphaToCoverageEnabled:0!==E[e+12>>0]}}(e+64),fragment:function(e){if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2]),targets:n(C[e+20>>2],C[e+24>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}}(C[e+80>>2])},c=C[e+4>>2];return c&&(u.label=ye(c)),u})(r),n=Er.mgrDevice.get(e);return Er.mgrRenderPipeline.create(n.createRenderPipeline(t))},jb:(e,r)=>{var t;if(r){t={label:void 0,addressModeU:Er.AddressMode[C[r+8>>2]],addressModeV:Er.AddressMode[C[r+12>>2]],addressModeW:Er.AddressMode[C[r+16>>2]],magFilter:Er.FilterMode[C[r+20>>2]],minFilter:Er.FilterMode[C[r+24>>2]],mipmapFilter:Er.MipmapFilterMode[C[r+28>>2]],lodMinClamp:B[r+32>>2],lodMaxClamp:B[r+36>>2],compare:Er.CompareFunction[C[r+40>>2]]};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrDevice.get(e);return Er.mgrSampler.create(o.createSampler(t))},ib:(e,r)=>{var t=C[r>>2],n=C[t+4>>2],o={label:void 0,code:""},a=C[r+4>>2];switch(a&&(o.label=ye(a)),n){case 5:var i=C[t+8>>2],s=C[t+12>>2]>>2;o.code=C.subarray(s,s+i);break;case 6:var u=C[t+8>>2];u&&(o.code=ye(u))}var c=Er.mgrDevice.get(e);return Er.mgrShaderModule.create(c.createShaderModule(o))},hb:(e,r)=>{var t={label:void 0,size:Er.makeExtent3D(r+16),mipLevelCount:C[r+32>>2],sampleCount:C[r+36>>2],dimension:Er.TextureDimension[C[r+12>>2]],format:Er.TextureFormat[C[r+28>>2]],usage:C[r+8>>2]},n=C[r+4>>2];n&&(t.label=ye(n));var o=C[r+40>>2];if(o){var a=C[r+44>>2];t.viewFormats=Array.from(L.subarray(a>>2,a+4*o>>2),(function(e){return Er.TextureFormat[e]}))}var i=Er.mgrDevice.get(e);return Er.mgrTexture.create(i.createTexture(t))},gb:e=>{var r=Er.mgrDevice.objects[e].queueId;return Er.mgrQueue.reference(r),r},fb:e=>Er.mgrDevice.reference(e),eb:e=>Er.mgrDevice.release(e),db:e=>Er.mgrPipelineLayout.release(e),cb:e=>Er.mgrQuerySet.release(e),bb:e=>Er.mgrQueue.release(e),ab:(e,r,t)=>{var n=Er.mgrQueue.get(e),o=Array.from(L.subarray(t>>2,t+4*r>>2),(function(e){return Er.mgrCommandBuffer.get(e)}));n.submit(o)},Nb:function(e,r,t,n,o,a){var i=tr(t,n),s=Er.mgrQueue.get(e),u=Er.mgrBuffer.get(r),c=x.subarray(o,o+a);s.writeBuffer(u,i,c,0,a)},$a:(e,r,t,n,o)=>{Er.mgrRenderPassEncoder.get(e).draw(r,t,n,o)},_a:e=>{Er.mgrRenderPassEncoder.get(e).end()},Za:e=>Er.mgrRenderPassEncoder.release(e),Ya:(e,r,t,n,o)=>{var a=Er.mgrRenderPassEncoder.get(e),i=Er.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},Xa:(e,r)=>{var t=Er.mgrRenderPassEncoder.get(e),n=Er.mgrRenderPipeline.get(r);t.setPipeline(n)},Wa:(e,r)=>{var t=Er.mgrRenderPipeline.get(e);return Er.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},Va:e=>Er.mgrRenderPipeline.release(e),Ua:e=>Er.mgrSampler.reference(e),Ta:e=>Er.mgrSampler.release(e),Sa:e=>Er.mgrShaderModule.reference(e),Ra:e=>Er.mgrShaderModule.release(e),Qa:(e,r)=>{var t;if(r){var n=C[r+20>>2],o=C[r+28>>2];t={format:Er.TextureFormat[C[r+8>>2]],dimension:Er.TextureViewDimension[C[r+12>>2]],baseMipLevel:C[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:C[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:Er.TextureAspect[C[r+32>>2]]};var a=C[r+4>>2];a&&(t.label=ye(a))}var i=Er.mgrTexture.get(e);return Er.mgrTextureView.create(i.createView(t))},Pa:e=>Er.mgrTexture.get(e).destroy(),Oa:e=>Er.mgrTexture.reference(e),Na:e=>Er.mgrTexture.release(e),Ma:e=>Er.mgrTextureView.reference(e),La:e=>Er.mgrTextureView.release(e),Ka:function(e,r,t,n){const o=pr.length,a=new Uint8Array(x.slice(e+r,e+t));try{var i=new WebAssembly.Module(a),s=new WebAssembly.Instance(i,{env:{memory:y}});for(var u in s.exports){var c=s.exports[u];addFunction(c)}return oWebAssembly.instantiateStreaming(e,t).then(a,(function(e){return b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation"),Q(r,t,a)}))))).catch(n),{}}(),$r=o._free=e=>($r=o._free=Xr.hd)(e),Qr=o._malloc=e=>(Qr=o._malloc=Xr.jd)(e),Kr=(o._addBoundTextureAsImageToStream=(e,r,t,n)=>(o._addBoundTextureAsImageToStream=Xr.kd)(e,r,t,n),o._attachImageListener=(e,r)=>(o._attachImageListener=Xr.ld)(e,r),o._attachImageVectorListener=(e,r)=>(o._attachImageVectorListener=Xr.md)(e,r),o._registerModelResourcesGraphService=()=>(o._registerModelResourcesGraphService=Xr.nd)(),()=>(Kr=Xr.od)()),Zr=(o._bindTextureToStream=e=>(o._bindTextureToStream=Xr.pd)(e),o._addBoundTextureToStream=(e,r,t,n)=>(o._addBoundTextureToStream=Xr.qd)(e,r,t,n),o._addDoubleToInputStream=(e,r,t)=>(o._addDoubleToInputStream=Xr.rd)(e,r,t),o._addFloatToInputStream=(e,r,t)=>(o._addFloatToInputStream=Xr.sd)(e,r,t),o._addBoolToInputStream=(e,r,t)=>(o._addBoolToInputStream=Xr.td)(e,r,t),o._addIntToInputStream=(e,r,t)=>(o._addIntToInputStream=Xr.ud)(e,r,t),o._addStringToInputStream=(e,r,t)=>(o._addStringToInputStream=Xr.vd)(e,r,t),o._allocateBoolVector=e=>(o._allocateBoolVector=Xr.wd)(e),o._allocateFloatVector=e=>(o._allocateFloatVector=Xr.xd)(e),o._allocateDoubleVector=e=>(o._allocateDoubleVector=Xr.yd)(e),o._allocateIntVector=e=>(o._allocateIntVector=Xr.zd)(e),o._allocateStringVector=e=>(o._allocateStringVector=Xr.Ad)(e),o._addBoolVectorEntry=(e,r)=>(o._addBoolVectorEntry=Xr.Bd)(e,r),o._addFloatVectorEntry=(e,r)=>(o._addFloatVectorEntry=Xr.Cd)(e,r),o._addDoubleVectorEntry=(e,r)=>(o._addDoubleVectorEntry=Xr.Dd)(e,r),o._addIntVectorEntry=(e,r)=>(o._addIntVectorEntry=Xr.Ed)(e,r),o._addStringVectorEntry=(e,r)=>(o._addStringVectorEntry=Xr.Fd)(e,r),o._addBoolVectorToInputStream=(e,r,t)=>(o._addBoolVectorToInputStream=Xr.Gd)(e,r,t),o._addFloatVectorToInputStream=(e,r,t)=>(o._addFloatVectorToInputStream=Xr.Hd)(e,r,t),o._addDoubleVectorToInputStream=(e,r,t)=>(o._addDoubleVectorToInputStream=Xr.Id)(e,r,t),o._addIntVectorToInputStream=(e,r,t)=>(o._addIntVectorToInputStream=Xr.Jd)(e,r,t),o._addStringVectorToInputStream=(e,r,t)=>(o._addStringVectorToInputStream=Xr.Kd)(e,r,t),o._addFlatHashMapToInputStream=(e,r,t,n,a)=>(o._addFlatHashMapToInputStream=Xr.Ld)(e,r,t,n,a),o._addProtoToInputStream=(e,r,t,n,a)=>(o._addProtoToInputStream=Xr.Md)(e,r,t,n,a),o._addEmptyPacketToInputStream=(e,r)=>(o._addEmptyPacketToInputStream=Xr.Nd)(e,r),o._addBoolToInputSidePacket=(e,r)=>(o._addBoolToInputSidePacket=Xr.Od)(e,r),o._addDoubleToInputSidePacket=(e,r)=>(o._addDoubleToInputSidePacket=Xr.Pd)(e,r),o._addFloatToInputSidePacket=(e,r)=>(o._addFloatToInputSidePacket=Xr.Qd)(e,r),o._addIntToInputSidePacket=(e,r)=>(o._addIntToInputSidePacket=Xr.Rd)(e,r),o._addStringToInputSidePacket=(e,r)=>(o._addStringToInputSidePacket=Xr.Sd)(e,r),o._addProtoToInputSidePacket=(e,r,t,n)=>(o._addProtoToInputSidePacket=Xr.Td)(e,r,t,n),o._addBoolVectorToInputSidePacket=(e,r)=>(o._addBoolVectorToInputSidePacket=Xr.Ud)(e,r),o._addDoubleVectorToInputSidePacket=(e,r)=>(o._addDoubleVectorToInputSidePacket=Xr.Vd)(e,r),o._addFloatVectorToInputSidePacket=(e,r)=>(o._addFloatVectorToInputSidePacket=Xr.Wd)(e,r),o._addIntVectorToInputSidePacket=(e,r)=>(o._addIntVectorToInputSidePacket=Xr.Xd)(e,r),o._addStringVectorToInputSidePacket=(e,r)=>(o._addStringVectorToInputSidePacket=Xr.Yd)(e,r),o._attachBoolListener=e=>(o._attachBoolListener=Xr.Zd)(e),o._attachBoolVectorListener=e=>(o._attachBoolVectorListener=Xr._d)(e),o._attachDoubleListener=e=>(o._attachDoubleListener=Xr.$d)(e),o._attachDoubleVectorListener=e=>(o._attachDoubleVectorListener=Xr.ae)(e),o._attachFloatListener=e=>(o._attachFloatListener=Xr.be)(e),o._attachFloatVectorListener=e=>(o._attachFloatVectorListener=Xr.ce)(e),o._attachIntListener=e=>(o._attachIntListener=Xr.de)(e),o._attachIntVectorListener=e=>(o._attachIntVectorListener=Xr.ee)(e),o._attachStringListener=e=>(o._attachStringListener=Xr.fe)(e),o._attachStringVectorListener=e=>(o._attachStringVectorListener=Xr.ge)(e),o._attachProtoListener=(e,r)=>(o._attachProtoListener=Xr.he)(e,r),o._attachProtoVectorListener=(e,r)=>(o._attachProtoVectorListener=Xr.ie)(e,r),o._getGraphConfig=(e,r)=>(o._getGraphConfig=Xr.je)(e,r),o._clearSubgraphs=()=>(o._clearSubgraphs=Xr.ke)(),o._pushBinarySubgraph=(e,r)=>(o._pushBinarySubgraph=Xr.le)(e,r),o._pushTextSubgraph=(e,r)=>(o._pushTextSubgraph=Xr.me)(e,r),o._changeBinaryGraph=(e,r)=>(o._changeBinaryGraph=Xr.ne)(e,r),o._changeTextGraph=(e,r)=>(o._changeTextGraph=Xr.oe)(e,r),o._processGl=e=>(o._processGl=Xr.pe)(e),o._process=e=>(o._process=Xr.qe)(e),o._bindTextureToCanvas=()=>(o._bindTextureToCanvas=Xr.re)(),o._requestShaderRefreshOnGraphChange=()=>(o._requestShaderRefreshOnGraphChange=Xr.se)(),o._waitUntilIdle=()=>(o._waitUntilIdle=Xr.te)(),o._closeGraph=()=>(o._closeGraph=Xr.ue)(),o._setAutoRenderToScreen=e=>(o._setAutoRenderToScreen=Xr.ve)(e),e=>(Zr=Xr.we)(e)),Jr=(e,r)=>(Jr=Xr.xe)(e,r),et=(e,r)=>(et=Xr.ye)(e,r),rt=e=>(rt=Xr.ze)(e),tt=()=>(tt=Xr.Ae)(),nt=e=>(nt=Xr.Be)(e),ot=e=>(ot=Xr.Ce)(e),at=e=>(at=Xr.De)(e);function it(){function e(){qr||(qr=!0,o.calledRun=!0,F||(o.noFSInit||ve.init.initialized||ve.init(),ve.ignorePermissions=!1,me.init(),Le(M),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),V.unshift(e);var e;Le(V)}()))}R>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),A.unshift(e);var e;Le(A)}(),R>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o._kVersionStampBuildChangelistStr=1024,o._kVersionStampCitcSnapshotStr=1056,o._kVersionStampCitcWorkspaceIdStr=1088,o._kVersionStampSourceUriStr=1600,o._kVersionStampBuildClientStr=2112,o._kVersionStampBuildClientMintStatusStr=2624,o._kVersionStampBuildCompilerStr=2656,o._kVersionStampBuildDateTimePstStr=3168,o._kVersionStampBuildDepotPathStr=3200,o._kVersionStampBuildIdStr=3712,o._kVersionStampBuildInfoStr=4224,o._kVersionStampBuildLabelStr=4736,o._kVersionStampBuildTargetStr=5248,o._kVersionStampBuildTimestampStr=5760,o._kVersionStampBuildToolStr=5792,o._kVersionStampG3BuildTargetStr=6304,o._kVersionStampVerifiableStr=6816,o._kVersionStampBuildFdoTypeStr=6848,o._kVersionStampBuildBaselineChangelistStr=6880,o._kVersionStampBuildLtoTypeStr=6912,o._kVersionStampBuildPropellerTypeStr=6944,o._kVersionStampBuildUsernameStr=6976,o._kVersionStampBuildHostnameStr=7488,o._kVersionStampBuildDirectoryStr=8e3,o._kVersionStampBuildChangelistInt=8512,o._kVersionStampCitcSnapshotInt=8520,o._kVersionStampBuildClientMintStatusInt=8524,o._kVersionStampBuildTimestampInt=8528,o._kVersionStampVerifiableInt=8536,o._kVersionStampBuildCoverageEnabledInt=8540,o._kVersionStampBuildBaselineChangelistInt=8544,o._kVersionStampPrecookedTimestampStr=8560,o._kVersionStampPrecookedClientInfoStr=9072,o.___start_em_js=1291140,o.___stop_em_js=1298356,o.addRunDependency=U,o.removeRunDependency=G,o.FS_createPath=ve.createPath,o.FS_createLazyFile=ve.createLazyFile,o.FS_createDevice=ve.createDevice,o.ccall=(e,r,t,n,a)=>{var i={string:e=>{var r=0;return null!=e&&0!==e&&(r=br(e)),r},array:e=>{var r=ot(e.length);return Rr(e,r),r}},s=(e=>o["_"+e])(e),u=[],c=0;if(n)for(var l=0;l0;)o.preInit.pop()();return it(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=ModuleFactory:"function"==typeof define&&define.amd&&define([],(()=>ModuleFactory)); \ No newline at end of file diff --git a/models/wasm/vision_wasm_internal.wasm b/models/wasm/vision_wasm_internal.wasm index 629fda5..0796acd 100644 Binary files a/models/wasm/vision_wasm_internal.wasm and b/models/wasm/vision_wasm_internal.wasm differ diff --git a/models/wasm/vision_wasm_nosimd_internal.js b/models/wasm/vision_wasm_nosimd_internal.js index ac0c3c1..75a92f3 100644 --- a/models/wasm/vision_wasm_nosimd_internal.js +++ b/models/wasm/vision_wasm_nosimd_internal.js @@ -1 +1 @@ -var ModuleFactory=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){var t,n,o=r;o.ready=new Promise(((e,r)=>{t=e,n=r}));var a,i,s,u=Object.assign({},o),c="./this.program",l=(e,r)=>{throw r},d="object"==typeof window,m="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(f){var g=require("fs"),v=require("path");p=m?v.dirname(p)+"/":__dirname+"/",a=(e,r)=>(e=Y(e)?new URL(e):v.normalize(e),g.readFileSync(e,r?void 0:"utf8")),s=e=>{var r=a(e,!0);return r.buffer||(r=new Uint8Array(r)),r},i=(e,r,t,n=!0)=>{e=Y(e)?new URL(e):v.normalize(e),g.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!o.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,r)=>{throw process.exitCode=e,r},o.inspect=()=>"[Emscripten Module object]"}else(d||m)&&(m?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},m&&(s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)});var h,y,w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit),o.wasmBinary&&(h=o.wasmBinary),"object"!=typeof WebAssembly&&j("no native wasm support detected");var _,E,x,S,k,L,C,P,F,B=!1;function T(e,r){e||j(r)}function D(){var e=y.buffer;o.HEAP8=E=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=x=new Uint8Array(e),o.HEAPU16=k=new Uint16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU32=C=new Uint32Array(e),o.HEAPF32=P=new Float32Array(e),o.HEAPF64=F=new Float64Array(e)}var A=[],M=[],I=[],V=[],R=0,O=null,z=null;function U(e){R++,o.monitorRunDependencies&&o.monitorRunDependencies(R)}function N(e){if(R--,o.monitorRunDependencies&&o.monitorRunDependencies(R),0==R&&(null!==O&&(clearInterval(O),O=null),z)){var r=z;z=null,r()}}function j(e){o.onAbort&&o.onAbort(e),b(e="Aborted("+e+")"),B=!0,_=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var G,H,$,q,W=e=>e.startsWith("data:application/octet-stream;base64,"),Y=e=>e.startsWith("file://");function X(e){if(e==G&&h)return new Uint8Array(h);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function Q(e,r,t){return function(e){if(!h&&(d||m)){if("function"==typeof fetch&&!Y(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>X(e)));if(i)return new Promise(((r,t)=>{i(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>X(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{b(`failed to asynchronously prepare wasm: ${e}`),j(e)}))}W(G="vision_wasm_nosimd_internal.wasm")||(H=G,G=o.locateFile?o.locateFile(H,p):p+H);var K,Z={1250865:e=>{const r=Ue.toValue(e).getContext("webgpu");return Sr.add(r.getCurrentTexture())},1251e3:(e,r,t,n,o)=>{const a=Ue.toValue(e),i=Sr.get(r),s=Sr.get(t),u=n,c=o;i.queue.copyExternalImageToTexture({source:a},{texture:s},[u,c])},1251251:(e,r,t,n)=>{const o=Ue.toValue(e),a=Sr.get(r),i=Sr.get(t),s=Sr.get(n),u=a.createBindGroup({layout:s,entries:[{binding:0,resource:i},{binding:1,resource:o}]});return Sr.add(u)},1251599:(e,r)=>{const t=Ue.toValue(e),n=Ue.toValue(r),o=n.getContext("2d"),a=new ImageData(t,n.width,n.height);o.putImageData(a,0,0)},1251823:(e,r)=>{const t=Ue.toValue(e),n=Ue.toValue(r),o=t.getContext("2d").getImageData(0,0,t.width,t.height);n.set(o.data)},1252027:(e,r)=>{const t=Ue.toValue(e);Ue.toValue(r).getContext("2d").drawImage(t,0,0)},1252163:()=>"undefined"!=typeof HTMLCanvasElement,1252218:()=>!!o.preinitializedWebGPUDevice,1252269:()=>{wr["#canvas"]=o.canvas},1252320:()=>"undefined"!=typeof wasmOffsetConverter},J=(e,r)=>{if(ke.mainLoop.timingMode=e,ke.mainLoop.timingValue=r,!ke.mainLoop.func)return 1;if(ke.mainLoop.running||(ke.mainLoop.running=!0),0==e)ke.mainLoop.scheduler=function(){var e=0|Math.max(0,ke.mainLoop.tickStartTime+r-K());setTimeout(ke.mainLoop.runner,e)},ke.mainLoop.method="timeout";else if(1==e)ke.mainLoop.scheduler=function(){ke.requestAnimationFrame(ke.mainLoop.runner)},ke.mainLoop.method="rAF";else if(2==e){if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),setImmediate=function(e){t.push(e),m?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}ke.mainLoop.scheduler=function(){setImmediate(ke.mainLoop.runner)},ke.mainLoop.method="immediate"}return 0};K=()=>performance.now();var ee=e=>{if(e instanceof re||"unwind"==e)return _;l(1,e)};function re(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var te=()=>Ce||!1,ne={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=ne.isAbs(e),t="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=ne.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return ne.normalize(e.join("/"))},join2:(e,r)=>ne.normalize(e+"/"+r)},oe=e=>(oe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(f)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}j("initRandomDevice")})())(e),ae={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:he.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=ne.isAbs(n)}return(r?"/":"")+(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ae.resolve(e).substr(1),r=ae.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ie)return ie.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ue=[],ce=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},le=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function de(e,r,t){var n=t>0?t:ce(e)+1,o=new Array(n),a=le(e,o,0,o.length);return r&&(o.length=a),o}var me={ttys:[],init(){},shutdown(){},register(e,r){me.ttys[e]={input:[],output:[],ops:r},he.registerDevice(e,me.stream_ops)},stream_ops:{open(e){var r=me.ttys[e.node.rdev];if(!r)throw new he.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new he.ErrnoError(60);for(var a=0,i=0;i(()=>{if(!ue.length){var e=null;if(f){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ue=de(e,!0)}return ue.shift()})(),put_char(e,r){null===r||10===r?(w(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(w(se(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(b(se(e.output,0)),e.output=[])}}},fe=e=>{e=((e,r)=>65536*Math.ceil(e/65536))(e);var r=et(65536,e);return r?((e,r)=>(x.fill(0,e,e+r),e))(r,e):0},pe={ops_table:null,mount:e=>pe.createNode(null,"/",16895,0),createNode(e,r,t,n){if(he.isBlkdev(t)||he.isFIFO(t))throw new he.ErrnoError(63);pe.ops_table||(pe.ops_table={dir:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,lookup:pe.node_ops.lookup,mknod:pe.node_ops.mknod,rename:pe.node_ops.rename,unlink:pe.node_ops.unlink,rmdir:pe.node_ops.rmdir,readdir:pe.node_ops.readdir,symlink:pe.node_ops.symlink},stream:{llseek:pe.stream_ops.llseek}},file:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:{llseek:pe.stream_ops.llseek,read:pe.stream_ops.read,write:pe.stream_ops.write,allocate:pe.stream_ops.allocate,mmap:pe.stream_ops.mmap,msync:pe.stream_ops.msync}},link:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,readlink:pe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:he.chrdev_stream_ops}});var o=he.createNode(e,r,t,n);return he.isDir(o.mode)?(o.node_ops=pe.ops_table.dir.node,o.stream_ops=pe.ops_table.dir.stream,o.contents={}):he.isFile(o.mode)?(o.node_ops=pe.ops_table.file.node,o.stream_ops=pe.ops_table.file.stream,o.usedBytes=0,o.contents=null):he.isLink(o.mode)?(o.node_ops=pe.ops_table.link.node,o.stream_ops=pe.ops_table.link.stream):he.isChrdev(o.mode)&&(o.node_ops=pe.ops_table.chrdev.node,o.stream_ops=pe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=he.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,he.isDir(e.mode)?r.size=4096:he.isFile(e.mode)?r.size=e.usedBytes:he.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&pe.resizeFileStorage(e,r.size)},lookup(e,r){throw he.genericErrors[44]},mknod:(e,r,t,n)=>pe.createNode(e,r,t,n),rename(e,r,t){if(he.isDir(e.mode)){var n;try{n=he.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new he.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=he.lookupNode(e,r);for(var n in t.contents)throw new he.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink(e,r,t){var n=pe.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!he.isLink(e.mode))throw new he.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r(pe.stream_ops.write(e,r,0,n,t,!1),0)}},ge=o.preloadPlugins||[],ve=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},he={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=ae.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new he.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=he.root,o="/",a=0;a40)throw new he.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(he.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n>>0)%he.nameTable.length},hashAddNode(e){var r=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[r],he.nameTable[r]=e},hashRemoveNode(e){var r=he.hashName(e.parent.id,e.name);if(he.nameTable[r]===e)he.nameTable[r]=e.name_next;else for(var t=he.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=he.mayLookup(e);if(t)throw new he.ErrnoError(t,e);for(var n=he.hashName(e.id,r),o=he.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return he.lookup(e,r)},createNode(e,r,t,n){var o=new he.FSNode(e,r,t,n);return he.hashAddNode(o),o},destroyNode(e){he.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>he.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>he.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return he.lookupNode(e,r),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=he.lookupNode(e,r)}catch(e){return e.errno}var o=he.nodePermissions(e,"wx");if(o)return o;if(t){if(!he.isDir(n.mode))return 54;if(he.isRoot(n)||he.getPath(n)===he.cwd())return 10}else if(he.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(r)||512&r)?31:he.nodePermissions(e,he.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=he.MAX_OPEN_FDS;e++)if(!he.streams[e])return e;throw new he.ErrnoError(33)},getStreamChecked(e){var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);return r},getStream:e=>he.streams[e],createStream:(e,r=-1)=>(he.FSStream||(he.FSStream=function(){this.shared={}},he.FSStream.prototype={},Object.defineProperties(he.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new he.FSStream,e),-1==r&&(r=he.nextfd()),e.fd=r,he.streams[r]=e,e),closeStream(e){he.streams[e]=null},chrdev_stream_ops:{open(e){var r=he.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){he.devices[e]={stream_ops:r}},getDevice:e=>he.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),he.syncFSRequests++,he.syncFSRequests>1&&b(`warning: ${he.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=he.getMounts(he.root.mount),n=0;function o(e){return he.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&he.root)throw new he.ErrnoError(10);if(!o&&!a){var i=he.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,he.isMountpoint(n))throw new he.ErrnoError(10);if(!he.isDir(n.mode))throw new he.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?he.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(r.node))throw new he.ErrnoError(28);var t=r.node,n=t.mounted,o=he.getMounts(n);Object.keys(he.nameTable).forEach((e=>{for(var r=he.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&he.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=he.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new he.ErrnoError(28);var a=he.mayCreate(n,o);if(a)throw new he.ErrnoError(a);if(!n.node_ops.mknod)throw new he.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,he.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,he.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,he.mknod(e,r,t)),symlink(e,r){if(!ae.resolve(e))throw new he.ErrnoError(44);var t=he.lookupPath(r,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var n=ne.basename(r),o=he.mayCreate(t,n);if(o)throw new he.ErrnoError(o);if(!t.node_ops.symlink)throw new he.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=ne.dirname(e),a=ne.dirname(r),i=ne.basename(e),s=ne.basename(r);if(t=he.lookupPath(e,{parent:!0}).node,n=he.lookupPath(r,{parent:!0}).node,!t||!n)throw new he.ErrnoError(44);if(t.mount!==n.mount)throw new he.ErrnoError(75);var u,c=he.lookupNode(t,i),l=ae.relative(e,a);if("."!==l.charAt(0))throw new he.ErrnoError(28);if("."!==(l=ae.relative(r,o)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(n,s)}catch(e){}if(c!==u){var d=he.isDir(c.mode),m=he.mayDelete(t,i,d);if(m)throw new he.ErrnoError(m);if(m=u?he.mayDelete(n,s,d):he.mayCreate(n,s))throw new he.ErrnoError(m);if(!t.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(c)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(n!==t&&(m=he.nodePermissions(t,"w")))throw new he.ErrnoError(m);he.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{he.hashAddNode(c)}}},rmdir(e){var r=he.lookupPath(e,{parent:!0}).node,t=ne.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!0);if(o)throw new he.ErrnoError(o);if(!r.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.rmdir(r,t),he.destroyNode(n)},readdir(e){var r=he.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new he.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=he.lookupPath(e,{parent:!0}).node;if(!r)throw new he.ErrnoError(44);var t=ne.basename(e),n=he.lookupNode(r,t),o=he.mayDelete(r,t,!1);if(o)throw new he.ErrnoError(o);if(!r.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);r.node_ops.unlink(r,t),he.destroyNode(n)},readlink(e){var r=he.lookupPath(e).node;if(!r)throw new he.ErrnoError(44);if(!r.node_ops.readlink)throw new he.ErrnoError(28);return ae.resolve(he.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=he.lookupPath(e,{follow:!r}).node;if(!t)throw new he.ErrnoError(44);if(!t.node_ops.getattr)throw new he.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>he.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?he.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new he.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){he.chmod(e,r,!0)},fchmod(e,r){var t=he.getStreamChecked(e);he.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new he.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){he.chown(e,r,t,!0)},fchown(e,r,t){var n=he.getStreamChecked(e);he.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new he.ErrnoError(28);var t;if(!(t="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new he.ErrnoError(63);if(he.isDir(t.mode))throw new he.ErrnoError(31);if(!he.isFile(t.mode))throw new he.ErrnoError(28);var n=he.nodePermissions(t,"w");if(n)throw new he.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=he.getStreamChecked(e);if(0==(2097155&t.flags))throw new he.ErrnoError(28);he.truncate(t.node,r)},utime(e,r,t){var n=he.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new he.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=he.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new he.ErrnoError(20)}else n=he.mknod(e,t,0),a=!0;if(!n)throw new he.ErrnoError(44);if(he.isChrdev(n.mode)&&(r&=-513),65536&r&&!he.isDir(n.mode))throw new he.ErrnoError(54);if(!a){var i=he.mayOpen(n,r);if(i)throw new he.ErrnoError(i)}512&r&&!a&&he.truncate(n,0),r&=-131713;var s=he.createStream({node:n,path:he.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(he.readFiles||(he.readFiles={}),e in he.readFiles||(he.readFiles[e]=1)),s},close(e){if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new he.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(he.isClosed(e))throw new he.ErrnoError(8);if(r<0||t<=0)throw new he.ErrnoError(28);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(!he.isFile(e.node.mode)&&!he.isDir(e.node.mode))throw new he.ErrnoError(43);if(!e.stream_ops.allocate)throw new he.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new he.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=he.open(e,r.flags),o=he.stat(e).size,a=new Uint8Array(o);return he.read(n,a,0,o,0),"utf8"===r.encoding?t=se(a,0):"binary"===r.encoding&&(t=a),he.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=he.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ce(r)+1),a=le(r,o,0,o.length);he.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");he.write(n,r,0,r.byteLength,void 0,t.canOwn)}he.close(n)},cwd:()=>he.currentPath,chdir(e){var r=he.lookupPath(e,{follow:!0});if(null===r.node)throw new he.ErrnoError(44);if(!he.isDir(r.node.mode))throw new he.ErrnoError(54);var t=he.nodePermissions(r.node,"x");if(t)throw new he.ErrnoError(t);he.currentPath=r.path},createDefaultDirectories(){he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices(){he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),he.mkdev("/dev/null",he.makedev(1,3)),me.register(he.makedev(5,0),me.default_tty_ops),me.register(he.makedev(6,0),me.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=oe(e).byteLength),e[--r]);he.createDevice("/dev","random",t),he.createDevice("/dev","urandom",t),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories(){he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount(){var r=he.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=he.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?he.createDevice("/dev","stdin",o.stdin):he.symlink("/dev/tty","/dev/stdin"),o.stdout?he.createDevice("/dev","stdout",null,o.stdout):he.symlink("/dev/tty","/dev/stdout"),o.stderr?he.createDevice("/dev","stderr",null,o.stderr):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},ensureErrnoError(){he.ErrnoError||(he.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},he.ErrnoError.prototype=new Error,he.ErrnoError.prototype.constructor=he.ErrnoError,[44].forEach((e=>{he.genericErrors[e]=new he.ErrnoError(e),he.genericErrors[e].stack=""})))},staticInit(){he.ensureErrnoError(),he.nameTable=new Array(4096),he.mount(pe,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:pe}},init(e,r,t){he.init.initialized=!0,he.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,he.createStandardStreams()},quit(){he.init.initialized=!1;for(var e=0;ethis.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):de(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=he.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=u.stream_ops[e];c[e]=function(){return he.forceLoadFile(u),r.apply(null,arguments)}})),c.read=(e,r,t,n,o)=>(he.forceLoadFile(u),l(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{he.forceLoadFile(u);var a=fe(r);if(!a)throw new he.ErrnoError(48);return l(e,E,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u}},ye=(e,r)=>e?se(x,e,r):"",we={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(ne.isAbs(r))return r;var n;if(n=-100===e?he.cwd():we.getStreamFromFD(e).path,0==r.length){if(!t)throw new he.ErrnoError(44);return n}return ne.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&ne.normalize(r)!==ne.normalize(he.getPath(e.node)))return-54;throw e}L[t>>2]=n.dev,L[t+4>>2]=n.mode,C[t+8>>2]=n.nlink,L[t+12>>2]=n.uid,L[t+16>>2]=n.gid,L[t+20>>2]=n.rdev,q=[n.size>>>0,($=n.size,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+24>>2]=q[0],L[t+28>>2]=q[1],L[t+32>>2]=4096,L[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return q=[Math.floor(o/1e3)>>>0,($=Math.floor(o/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+40>>2]=q[0],L[t+44>>2]=q[1],C[t+48>>2]=o%1e3*1e3,q=[Math.floor(a/1e3)>>>0,($=Math.floor(a/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+56>>2]=q[0],L[t+60>>2]=q[1],C[t+64>>2]=a%1e3*1e3,q=[Math.floor(i/1e3)>>>0,($=Math.floor(i/1e3),+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+72>>2]=q[0],L[t+76>>2]=q[1],C[t+80>>2]=i%1e3*1e3,q=[n.ino>>>0,($=n.ino,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[t+88>>2]=q[0],L[t+92>>2]=q[1],0},doMsync(e,r,t,n,o){if(!he.isFile(r.node.mode))throw new he.ErrnoError(43);if(2&n)return 0;var a=x.slice(e,e+t);he.msync(r,a,o,t,n)},varargs:void 0,get(){var e=L[+we.varargs>>2];return we.varargs+=4,e},getp:()=>we.get(),getStr:e=>ye(e),getStreamFromFD:e=>he.getStreamChecked(e)},be=e=>{_=e,te()||(o.onExit&&o.onExit(e),B=!0),l(e,new re(e))},_e=(e,r)=>{_=e,be(e)},Ee=e=>{if(!B)try{e(),(()=>{if(!te())try{_e(_)}catch(e){ee(e)}})()}catch(e){ee(e)}},xe=(e,r)=>setTimeout((()=>{Ee(e)}),r),Se=e=>{Se.shown||(Se.shown={}),Se.shown[e]||(Se.shown[e]=1,f&&(e="warning: "+e),b(e))},ke={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){ke.mainLoop.scheduler=null,ke.mainLoop.currentlyRunningMainloop++},resume(){ke.mainLoop.currentlyRunningMainloop++;var e=ke.mainLoop.timingMode,r=ke.mainLoop.timingValue,t=ke.mainLoop.func;ke.mainLoop.func=null,((e,r,t,n,o)=>{T(!ke.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ke.mainLoop.func=e,ke.mainLoop.arg=n;var a=ke.mainLoop.currentlyRunningMainloop;function i(){return!(a0){Date.now();var r=ke.mainLoop.queue.shift();if(r.func(r.arg),ke.mainLoop.remainingBlockers){var t=ke.mainLoop.remainingBlockers,n=t%1==0?t-1:Math.floor(t);r.counted?ke.mainLoop.remainingBlockers=n:(n+=.5,ke.mainLoop.remainingBlockers=(8*t+n)/9)}if(ke.mainLoop.updateStatus(),!i())return;setTimeout(ke.mainLoop.runner,0)}else i()&&(ke.mainLoop.currentFrameNumber=ke.mainLoop.currentFrameNumber+1|0,1==ke.mainLoop.timingMode&&ke.mainLoop.timingValue>1&&ke.mainLoop.currentFrameNumber%ke.mainLoop.timingValue!=0?ke.mainLoop.scheduler():(0==ke.mainLoop.timingMode&&(ke.mainLoop.tickStartTime=K()),vr.newRenderingFrameStarted(),ke.mainLoop.runIter(e),i()&&("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),ke.mainLoop.scheduler())))}})(t,0,0,ke.mainLoop.arg),J(e,r),ke.mainLoop.scheduler()},updateStatus(){if(o.setStatus){var e=o.statusMessage||"Please wait...",r=ke.mainLoop.remainingBlockers,t=ke.mainLoop.expectedBlockers;r?r{T(i.complete,`Image ${r} could not be decoded`);var n=document.createElement("canvas");n.width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0),Nr[r]=n,URL.revokeObjectURL(a),t&&t(e)},i.onerror=e=>{b(`Image ${a} could not be decoded`),n&&n()},i.src=a}};ge.push(e);var r={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var o=!1;function a(n){o||(o=!0,jr[r]=n,t&&t(e))}var i=new Blob([e],{type:ke.getMimetype(r)}),s=URL.createObjectURL(i),u=new Audio;u.addEventListener("canplaythrough",(()=>a(u)),!1),u.onerror=function(t){o||(b(`warning: browser could not fully decode audio ${r}, trying slower base64 approach`),u.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,o=0,a=0;a=6;){var i=n>>o-6&63;o-=6,t+=r[i]}return 2==o?(t+=r[(3&n)<<4],t+="=="):4==o&&(t+=r[(15&n)<<2],t+="="),t}(e),a(u))},u.src=s,xe((()=>{a(u)}),1e4)}};ge.push(r);var t=o.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&t.addEventListener("click",(e=>{!ke.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ke.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext(e,r,t,n){if(r&&o.ctx&&e==o.canvas)return o.ctx;var a,i;if(r){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==vr&&(i=vr.createContext(e,s))&&(a=vr.getContext(i).GLctx)}else a=e.getContext("2d");return a?(t&&(r||T(void 0===Ur,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=a,r&&vr.makeContextCurrent(i),o.useWebGL=r,ke.moduleContextCreatedCallbacks.forEach((e=>e())),ke.init()),a):null},destroyContext(e,r,t){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,r){ke.lockPointer=e,ke.resizeCanvas=r,void 0===ke.lockPointer&&(ke.lockPointer=!0),void 0===ke.resizeCanvas&&(ke.resizeCanvas=!1);var t=o.canvas;function n(){ke.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=ke.exitFullscreen,ke.lockPointer&&t.requestPointerLock(),ke.isFullscreen=!0,ke.resizeCanvas?ke.setFullscreenCanvasSize():ke.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),ke.resizeCanvas?ke.setWindowedCanvasSize():ke.updateCanvasDimensions(t)),o.onFullScreen&&o.onFullScreen(ke.isFullscreen),o.onFullscreen&&o.onFullscreen(ke.isFullscreen)}ke.fullscreenHandlersInstalled||(ke.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen:()=>!!ke.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var r=Date.now();if(0===ke.nextRAF)ke.nextRAF=r+1e3/60;else for(;r+2>=ke.nextRAF;)ke.nextRAF+=1e3/60;var t=Math.max(ke.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,ke.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,r)=>xe(e,r),safeRequestAnimationFrame:e=>ke.requestAnimationFrame((()=>{Ee(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent(e){if(ke.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ke.mouseMovementX=ke.mouseMovementY=0:(ke.mouseMovementX=ke.getMovementX(e),ke.mouseMovementY=ke.getMovementY(e)),"undefined"!=typeof SDL?(ke.mouseX=SDL.mouseX+ke.mouseMovementX,ke.mouseY=SDL.mouseY+ke.mouseMovementY):(ke.mouseX+=ke.mouseMovementX,ke.mouseY+=ke.mouseMovementY);else{var r=o.canvas.getBoundingClientRect(),t=o.canvas.width,n=o.canvas.height,a=void 0!==window.scrollX?window.scrollX:window.pageXOffset,i=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var s=e.touch;if(void 0===s)return;var u=s.pageX-(a+r.left),c=s.pageY-(i+r.top),l={x:u*=t/r.width,y:c*=n/r.height};if("touchstart"===e.type)ke.lastTouches[s.identifier]=l,ke.touches[s.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var d=ke.touches[s.identifier];d||(d=l),ke.lastTouches[s.identifier]=d,ke.touches[s.identifier]=l}return}var m=e.pageX-(a+r.left),f=e.pageY-(i+r.top);m*=t/r.width,f*=n/r.height,ke.mouseMovementX=m-ke.mouseX,ke.mouseMovementY=f-ke.mouseY,ke.mouseX=m,ke.mouseY=f}},resizeListeners:[],updateResizeListeners(){var e=o.canvas;ke.resizeListeners.forEach((r=>r(e.width,e.height)))},setCanvasSize(e,r,t){var n=o.canvas;ke.updateCanvasDimensions(n,e,r),t||ke.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e|=8388608,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e&=-8388609,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},updateCanvasDimensions(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/a{for(;e.length>0;)e.shift()(o)},Ce=o.noExitRuntime||!0;function Pe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,E[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=E[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,E[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=E[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){if(it(this.get_type()))return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Fe,Be,Te=e=>{for(var r="",t=e;x[t];)r+=Fe[x[t++]];return r},De={},Ae={},Me={},Ie=e=>{throw new Be(e)};function Ve(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ie(`type "${n}" must have a positive integer typeid pointer`),Ae.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ie(`Cannot register type '${n}' twice`)}if(Ae[e]=r,delete Me[e],De.hasOwnProperty(e)){var o=De[e];delete De[e],o.forEach((e=>e()))}}(e,r,t)}function Re(){this.allocated=[void 0],this.freelist=[]}var Oe=new Re,ze=e=>{e>=Oe.reserved&&0==--Oe.get(e).refcount&&Oe.free(e)},Ue={toValue:e=>(e||Ie("Cannot use deleted val. handle = "+e),Oe.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Oe.allocate({refcount:1,value:e})}}};function Ne(e){return this.fromWireType(L[e>>2])}var je=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(P[e>>2])};case 8:return function(e){return this.fromWireType(F[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Ge=(e,r,t)=>{switch(r){case 1:return t?e=>E[e>>0]:e=>x[e>>0];case 2:return t?e=>S[e>>1]:e=>k[e>>1];case 4:return t?e=>L[e>>2]:e=>C[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function He(e){return this.fromWireType(C[e>>2])}var $e=(e,r,t)=>le(e,x,r,t),qe="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,We=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&k[n];)++n;if((t=n<<1)-e>32&&qe)return qe.decode(x.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Ye=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=i,r+=2}return S[r>>1]=0,r-n},Xe=e=>2*e.length,Qe=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=L[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ke=(e,r,t)=>{if(void 0===t&&(t=2147483647),t<4)return 0;for(var n=r,o=n+t-4,a=0;a=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),L[r>>2]=i,(r+=4)+4>o)break}return L[r>>2]=0,r-n},Ze=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},Je=(e,r)=>{var t,n,o=Ae[e];return void 0===o&&Ie(r+" has unknown type "+(t=Jr(e),n=Te(t),Qr(t),n)),o},er={},rr=e=>{var r=er[e];return void 0===r?Te(e):r},tr=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&e(global)?$$$embind_global$$$=global:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},nr=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,or=e=>e%4==0&&(e%100!=0||e%400==0),ar=[0,31,60,91,121,152,182,213,244,274,305,335],ir=[0,31,59,90,120,151,181,212,243,273,304,334],sr=e=>(or(e.getFullYear())?ar:ir)[e.getMonth()]+e.getDate()-1,ur=e=>{var r=ce(e)+1,t=Kr(r);return t&&$e(e,t,r),t},cr=[],lr=e=>{var r=(e-y.buffer.byteLength+65535)/65536;try{return y.grow(r),D(),1}catch(e){}},dr=e=>(j("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),mr={},fr=e=>{e.forEach((e=>{var r=dr();r&&(mr[r]=e)}))};function pr(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var gr,vr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){vr.lastError||(vr.lastError=e)},getNewId:e=>{for(var r=vr.counter++,t=e.length;t32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=vr.log2ceilLookup(vr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=vr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s>1,c=new Uint16Array(u),l=(n=0,0);c[n++]=l,!(n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var r=vr.log2ceilLookup(e),t=vr.currentContext.tempVertexBuffers1[r],n=vr.currentContext.tempVertexBufferCounters1[r];vr.currentContext.tempVertexBufferCounters1[r]=vr.currentContext.tempVertexBufferCounters1[r]+1&vr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=Ur.getParameter(34964);return t[n]=Ur.createBuffer(),Ur.bindBuffer(34962,t[n]),Ur.bufferData(34962,1<{for(var o="",a=0;a>2]:-1;o+=ye(L[t+4*a>>2],i<0?void 0:i)}return o},calcBufLength:function(e,r,t,n){return t>0?n*t:e*vr.byteSizeByType[r-vr.byteSizeByTypeRoot]*n},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){vr.resetBufferBinding=!1;for(var r=0;r{e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);return t?vr.registerContext(t,r):0},registerContext:(e,r)=>{var t=vr.getNewId(vr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),vr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&vr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o(vr.currentContext=vr.contexts[e],o.ctx=Ur=vr.currentContext&&vr.currentContext.GLctx,!(e&&!Ur)),getContext:e=>vr.contexts[e],deleteContext:e=>{vr.currentContext===vr.contexts[e]&&(vr.currentContext=null),"object"==typeof hr&&hr.removeAllHandlersOnTarget(vr.contexts[e].GLctx.canvas),vr.contexts[e]&&vr.contexts[e].GLctx.canvas&&(vr.contexts[e].GLctx.canvas.GLctxObject=void 0),vr.contexts[e]=null},initExtensions:e=>{if(e||(e=vr.currentContext),!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),(e=>{e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")})(t),(t.getSupportedExtensions()||[]).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}}},hr={inEventHandler:0,removeAllEventListeners(){for(var e=hr.eventHandlers.length-1;e>=0;--e)hr._removeHandler(e);hr.eventHandlers=[],hr.deferredCalls=[]},registerRemoveEventListeners(){hr.removeEventListenersRegistered||(I.push(hr.removeAllEventListeners),hr.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var o in hr.deferredCalls){var a=hr.deferredCalls[o];if(a.targetFunction==e&&n(a.argsList,t))return}hr.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),hr.deferredCalls.sort(((e,r)=>e.precedencenavigator.userActivation?navigator.userActivation.isActive:hr.inEventHandler&&hr.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(hr.canPerformEventHandlerRequests())for(var e=0;e{for(var t=0;te?e==window?"#window":e==screen?"#screen":e&&e.nodeName?e.nodeName:"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},yr=["default","low-power","high-performance"],wr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],br=e=>("number"==typeof e&&(e=ye(e)),e&&"#canvas"!==e?void 0!==vr&&vr.offscreenCanvases[e]?vr.offscreenCanvases[e]:(e=>{try{return e?("number"==typeof e&&(e=wr[e]||ye(e)),"#window"===e?window:"#document"===e?document:"#screen"===e?screen:"#canvas"===e?o.canvas:"string"==typeof e?document.getElementById(e):e):window}catch(e){return null}})(e):void 0!==vr&&vr.offscreenCanvases.canvas?vr.offscreenCanvases.canvas:o.canvas),_r=e=>{var r=ce(e)+1,t=at(r);return $e(e,t,r),t},Er=[],xr={errorCallback:(e,r,t,n)=>{var o,a;o=()=>{var o,a,i=_r(t);((a=Er[o=e])||(o>=Er.length&&(Er.length=o+1),Er[o]=a=gr.get(o)),a)(r,i,n)},a=nt(),o(),ot(a)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}xr.mgrDevice||(xr.mgrSurface=xr.mgrSurface||new e,xr.mgrSwapChain=xr.mgrSwapChain||new e,xr.mgrAdapter=xr.mgrAdapter||new e,xr.mgrDevice=xr.mgrDevice||new e,xr.mgrQueue=xr.mgrQueue||new e,xr.mgrCommandBuffer=xr.mgrCommandBuffer||new e,xr.mgrCommandEncoder=xr.mgrCommandEncoder||new e,xr.mgrRenderPassEncoder=xr.mgrRenderPassEncoder||new e,xr.mgrComputePassEncoder=xr.mgrComputePassEncoder||new e,xr.mgrBindGroup=xr.mgrBindGroup||new e,xr.mgrBuffer=xr.mgrBuffer||new e,xr.mgrSampler=xr.mgrSampler||new e,xr.mgrTexture=xr.mgrTexture||new e,xr.mgrTextureView=xr.mgrTextureView||new e,xr.mgrQuerySet=xr.mgrQuerySet||new e,xr.mgrBindGroupLayout=xr.mgrBindGroupLayout||new e,xr.mgrPipelineLayout=xr.mgrPipelineLayout||new e,xr.mgrRenderPipeline=xr.mgrRenderPipeline||new e,xr.mgrComputePipeline=xr.mgrComputePipeline||new e,xr.mgrShaderModule=xr.mgrShaderModule||new e,xr.mgrRenderBundleEncoder=xr.mgrRenderBundleEncoder||new e,xr.mgrRenderBundle=xr.mgrRenderBundle||new e)},makeColor:e=>({r:F[e>>3],g:F[e+8>>3],b:F[e+16>>3],a:F[e+24>>3]}),makeExtent3D:e=>({width:C[e>>2],height:C[e+4>>2],depthOrArrayLayers:C[e+8>>2]}),makeOrigin3D:e=>({x:C[e>>2],y:C[e+4>>2],z:C[e+8>>2]}),makeImageCopyTexture:e=>({texture:xr.mgrTexture.get(C[e+4>>2]),mipLevel:C[e+8>>2],origin:xr.makeOrigin3D(e+12),aspect:xr.TextureAspect[C[e+24>>2]]}),makeTextureDataLayout:e=>{var r=C[e+16>>2],t=C[e+20>>2];return{offset:4294967296*C[e+4+8>>2]+C[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=e+8,t=xr.makeTextureDataLayout(r);return t.buffer=xr.mgrBuffer.get(C[e+32>>2]),t},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n>2])]=F[o+8>>3]}return t}},makePipelineLayout:e=>e?xr.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2])}},DeviceLostReason:{undefined:0,destroyed:1},PreferredFormat:{rgba8unorm:18,bgra8unorm:23},BufferMapState:["unmapped","pending","mapped"],AddressMode:["repeat","mirror-repeat","clamp-to-edge"],BlendFactor:["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:["add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],CompareFunction:[,"never","less","less-equal","greater","greater-equal","equal","not-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:["none","front","back"],ErrorFilter:["validation","out-of-memory","internal"],FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","pipeline-statistics-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32filterable"],FilterMode:["nearest","linear"],FrontFace:["ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:["nearest","linear"],PipelineStatisticName:["vertex-shader-invocations","clipper-invocations","clipper-primitives-out","fragment-shader-invocations","compute-shader-invocations"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:["point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:["occlusion","pipeline-statistics","timestamp"],SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only"],StoreOp:[,"store","discard"],TextureAspect:["all","stencil-only","depth-only"],TextureDimension:["1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4"],VertexStepMode:["vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","pipeline-statistics-query":"4","texture-compression-bc":"5","texture-compression-etc2":"6","texture-compression-astc":"7","indirect-first-instance":"8","shader-f16":"9","rg11b10ufloat-renderable":"10","bgra8unorm-storage":"11",float32filterable:"12"}},Sr={values:{},next_id:1,add(e){var r;do{r=Sr.next_id++,Sr.next_id>2147483647&&(Sr.next_id=1)}while(r in Sr.values);return Sr.values[r]=e,r},remove(e){delete Sr.values[e]},get:e=>Sr.values[e]},kr={},Lr=()=>{if(!Lr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var r in kr)void 0===kr[r]?delete e[r]:e[r]=kr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);Lr.strings=t}return Lr.strings},Cr=[],Pr=(e,r,t,n)=>{for(var o=0;o>2]=i}},Fr=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Br=e=>0==(e-=5120)?E:1==e?x:2==e?S:4==e?L:6==e?P:5==e||28922==e||28520==e||30779==e||30782==e?C:k,Tr=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),Dr=(e,r,t,n,o,a)=>{var i=Br(e),s=Tr(i),u=1<({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*u,l=((e,r,t,n)=>{var o;return r*(e*t+(o=n)-1&-o)})(t,n,c,vr.unpackAlignment);return i.subarray(o>>s,o+l>>s)},Ar=e=>{var r=Ur.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=Ur.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?"["+t+"]":""))),t}vr.recordError(1282)},Mr=[],Ir=[],Vr=[31,29,31,30,31,30,31,31,30,31,30,31],Rr=[31,28,31,30,31,30,31,31,30,31,30,31],Or=(e,r)=>{E.set(e,r)},zr=(e,r,t,n)=>{var o=C[n+40>>2],a={tm_sec:L[n>>2],tm_min:L[n+4>>2],tm_hour:L[n+8>>2],tm_mday:L[n+12>>2],tm_mon:L[n+16>>2],tm_year:L[n+20>>2],tm_wday:L[n+24>>2],tm_yday:L[n+28>>2],tm_isdst:L[n+32>>2],tm_gmtoff:L[n+36>>2],tm_zone:o?ye(o):""},i=ye(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=or(t.getFullYear()),o=t.getMonth(),a=(n?Vr:Rr)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(t),a=p(n);return f(o,r)<=0?f(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var v={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(or(e.tm_year+1900)?Vr:Rr,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&or(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&or(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),v)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),v[u](a)));var h=de(i=i.replace(/\0\0/g,"%"),!1);return h.length>r?0:(Or(h,e),h.length-1)};o.requestFullscreen=(e,r)=>ke.requestFullscreen(e,r),o.requestAnimationFrame=e=>ke.requestAnimationFrame(e),o.setCanvasSize=(e,r,t)=>ke.setCanvasSize(e,r,t),o.pauseMainLoop=()=>ke.mainLoop.pause(),o.resumeMainLoop=()=>ke.mainLoop.resume(),o.getUserMedia=()=>ke.getUserMedia(),o.createContext=(e,r,t,n)=>ke.createContext(e,r,t,n);var Ur,Nr={},jr={},Gr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=he.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Gr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return he.isDir(this.mode)}},isDevice:{get:function(){return he.isChrdev(this.mode)}}}),he.FSNode=Gr,he.createPreloadedFile=(e,r,t,n,o,a,s,u,c,l)=>{var d=r?ae.resolve(ne.join2(e,r)):e;function m(t){function i(t){l&&l(),u||((e,r,t,n,o,a)=>{he.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,c),a&&a(),N()}((e,r,t,n)=>{void 0!==ke&&ke.init();var o=!1;return ge.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,i,(()=>{s&&s(),N()}))||i(t)}U(),"string"==typeof t?((e,r,t,n)=>{var o=`al ${e}`;i(e,(r=>{T(r,`Loading data file "${e}" failed (no arrayBuffer).`),m(new Uint8Array(r)),o&&N()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&U()})(t,0,s):m(t)},he.staticInit(),o.FS_createPath=he.createPath,o.FS_createDataFile=he.createDataFile,o.FS_createPreloadedFile=he.createPreloadedFile,o.FS_unlink=he.unlink,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Fe=e})(),Be=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Re.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),Oe.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Oe.reserved=Oe.allocated.length,o.count_emval_handles=()=>{for(var e=0,r=Oe.reserved;r({data:new s(i?o.HEAPU8.slice(e,e+r).buffer:o.HEAPU8.buffer,e,t*n*a),width:t,height:n}))},r:function(){o._wrapSimpleListenerOutput||(o._wrapSimpleListenerOutput=(e,...r)=>{if(o.simpleListeners){const t=ye(e);o.simpleListeners[t]&&o.simpleListeners[t](...r)}}),o._wrapEmptyPacketListenerOutput||(o._wrapEmptyPacketListenerOutput=(e,r)=>{if(o.emptyPacketListeners){const t=ye(e);o.emptyPacketListeners[t]&&o.emptyPacketListeners[t](r)}})},La:function(){return o&&o.gpuOriginForWebTexturesIsBottomLeft},i:(e,r,t)=>{throw new Pe(e).init(r,t),e},Ka:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 0:if((o=we.get())<0)return-28;for(;he.streams[o];)o++;return he.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=we.get();return n.flags|=o,0;case 5:return o=we.getp(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return 28,L[Zr()>>2]=28,-1}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Sc:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=we.getp();L[a>>2]=o.c_iflag||0,L[a+4>>2]=o.c_oflag||0,L[a+8>>2]=o.c_cflag||0,L[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)E[a+i+17>>0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=we.getp();var s=L[a>>2],u=L[a+4>>2],c=L[a+8>>2],l=L[a+12>>2],d=[];for(i=0;i<32;i++)d.push(E[a+i+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(a=we.getp(),L[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=we.getp(),he.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=we.getp(),S[a>>1]=m[0],S[a+2>>1]=m[1]}return 0;default:return-28}}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ja:function(e,r,t,n){we.varargs=n;try{r=we.getStr(r),r=we.calculateAt(e,r);var o=n?we.get():0;return he.open(r,t,o).fd}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Rc:function(e,r){try{return e=we.getStr(e),we.doStat(he.stat,e,r)}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Zb:(e,r,t,n,o)=>{},Mc:(e,r,t,n)=>{Ve(e,{name:r=Te(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(x[e])},destructorFunction:null})},Lc:(e,r)=>{Ve(e,{name:r=Te(r),fromWireType:e=>{var r=Ue.toValue(e);return ze(e),r},toWireType:(e,r)=>Ue.toHandle(r),argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},Ha:(e,r,t)=>{Ve(e,{name:r=Te(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:je(r,t),destructorFunction:null})},F:(e,r,t,n,o)=>{r=Te(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<>>i}var s=r.includes("unsigned");Ve(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:Ge(r,t,0!==n),destructorFunction:null})},n:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=C[e>>2],t=C[e+4>>2];return new n(E.buffer,t,r)}Ve(e,{name:t=Te(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ga:(e,r)=>{var t="std::string"===(r=Te(r));Ve(e,{name:r,fromWireType(e){var r,n=C[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==x[s]){var u=ye(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var c=new Array(n);for(i=0;i>2]=n,t&&o)$e(r,i,n+1);else if(o)for(var s=0;s255&&(Qr(i),Ie("String has UTF-16 code units that do not fit in 8 bits")),x[i+s]=u}else for(s=0;s{var n,o,a,i,s;t=Te(t),2===r?(n=We,o=Ye,i=Xe,a=()=>k,s=1):4===r&&(n=Qe,o=Ke,i=Ze,a=()=>C,s=2),Ve(e,{name:t,fromWireType:e=>{for(var t,o=C[e>>2],i=a(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==i[l>>s]){var d=n(u,l-u);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),u=l+r}}return Qr(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Ie(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=Kr(4+a+r);return C[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push(Qr,u),u},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction(e){Qr(e)}})},Kc:(e,r)=>{Ve(e,{isVoid:!0,name:r=Te(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},Jc:()=>!0,ja:(e,r,t)=>{e=Ue.toValue(e),r=Je(r,"emval::as");var n=[],o=Ue.toHandle(n);return C[t>>2]=o,r.toWireType(n,e)},m:ze,ia:e=>0===e?Ue.toHandle(tr()):(e=rr(e),Ue.toHandle(tr()[e])),Fa:(e,r)=>(e=Ue.toValue(e),r=Ue.toValue(r),Ue.toHandle(e[r])),Ea:e=>{e>4&&(Oe.get(e).refcount+=1)},ha:(e,r)=>(e=Ue.toValue(e))instanceof Ue.toValue(r),ca:e=>Ue.toHandle(rr(e)),ga:e=>{(e=>{for(;e.length;){var r=e.pop();e.pop()(r)}})(Ue.toValue(e)),ze(e)},Da:(e,r,t)=>{e=Ue.toValue(e),r=Ue.toValue(r),t=Ue.toValue(t),e[r]=t},ba:(e,r)=>{var t=(e=Je(e,"_emval_take_value")).readValueFromPointer(r);return Ue.toHandle(t)},Ic:e=>(e=Ue.toValue(e),Ue.toHandle(typeof e)),Yb:function(e,r,t){var n=nr(e,r),o=new Date(1e3*n);L[t>>2]=o.getUTCSeconds(),L[t+4>>2]=o.getUTCMinutes(),L[t+8>>2]=o.getUTCHours(),L[t+12>>2]=o.getUTCDate(),L[t+16>>2]=o.getUTCMonth(),L[t+20>>2]=o.getUTCFullYear()-1900,L[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;L[t+28>>2]=i},Xb:function(e,r,t){var n=nr(e,r),o=new Date(1e3*n);L[t>>2]=o.getSeconds(),L[t+4>>2]=o.getMinutes(),L[t+8>>2]=o.getHours(),L[t+12>>2]=o.getDate(),L[t+16>>2]=o.getMonth(),L[t+20>>2]=o.getFullYear()-1900,L[t+24>>2]=o.getDay();var a=0|sr(o);L[t+28>>2]=a,L[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));L[t+32>>2]=c},Wb:function(e){var r=(()=>{var r=new Date(L[e+20>>2]+1900,L[e+16>>2],L[e+12>>2],L[e+8>>2],L[e+4>>2],L[e>>2],0),t=L[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)L[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=Math.max(i,a),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}L[e+24>>2]=r.getDay();var l=0|sr(r);return L[e+28>>2]=l,L[e>>2]=r.getSeconds(),L[e+4>>2]=r.getMinutes(),L[e+8>>2]=r.getHours(),L[e+12>>2]=r.getDate(),L[e+16>>2]=r.getMonth(),L[e+20>>2]=r.getYear(),r.getTime()/1e3})();return tt(($=r,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)),r>>>0},Vb:function(e,r,t,n,o,a,i,s){var u=nr(o,a);try{if(isNaN(u))return 61;var c=we.getStreamFromFD(n),l=he.mmap(c,e,u,r,t),d=l.ptr;return L[i>>2]=l.allocated,C[s>>2]=d,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Ub:function(e,r,t,n,o,a,i){var s=nr(a,i);try{if(isNaN(s))return 61;var u=we.getStreamFromFD(o);2&t&&we.doMsync(e,u,r,n,s),he.munmap(u)}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return-e.errno}},Hc:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}C[e>>2]=60*u,L[r>>2]=Number(i!=s);var l=c(o),d=c(a),m=ur(l),f=ur(d);s>2]=m,C[t+4>>2]=f):(C[t>>2]=f,C[t+4>>2]=m)},a:()=>{j("")},Gc:function(e,r){if("undefined"!=typeof dbg)dbg(ye(e,r));else{if(void 0===t)function t(e){console.warn.apply(console,arguments)}t(ye(e,r))}},E:(e,r,t)=>((e,r,t)=>{var n=((e,r)=>{var t;for(cr.length=0;t=x[e++];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,cr.push(112==t?C[r>>2]:105==t?L[r>>2]:F[r>>3]),r+=n?8:4}return cr})(r,t);return Z[e].apply(null,n)})(e,r,t),Fc:()=>Date.now(),fa:(e,r)=>b(ye(e,r)),Ec:()=>2147483648,u:K,Dc:(e,r,t)=>x.copyWithin(e,r,r+t),Cc:(e,r)=>w(ye(e,r)),Bc:e=>(j("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),Ac:e=>{var r=x.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,(n=Math.max(e,a))+(65536-n%65536)%65536);if(lr(i))return!0}return!1},zc:function(){var e=pr().split("\n");return"Error"==e[0]&&e.shift(),fr(e),mr.last_addr=dr(e[3]),mr.last_stack=e,mr.last_addr},yc:(e,r,t)=>{var n;mr.last_addr==e?n=mr.last_stack:("Error"==(n=pr().split("\n"))[0]&&n.shift(),fr(n));for(var o=3;n[o]&&dr(n[o])!=e;)++o;for(var a=0;a>2]=dr(n[a+o]);return a},xc:(e,r)=>{var t=r>>2,n=L[t+6],o={alpha:!!L[t+0],depth:!!L[t+1],stencil:!!L[t+2],antialias:!!L[t+3],premultipliedAlpha:!!L[t+4],preserveDrawingBuffer:!!L[t+5],powerPreference:yr[n],failIfMajorPerformanceCaveat:!!L[t+7],majorVersion:L[t+8],minorVersion:L[t+9],enableExtensionsByDefault:L[t+10],explicitSwapControl:L[t+11],proxyContextToMainThread:L[t+12],renderViaOffscreenBackBuffer:L[t+13]},a=br(e);return a?o.explicitSwapControl?0:vr.createContext(a,o):0},wc:e=>{vr.currentContext==e&&(vr.currentContext=0),vr.deleteContext(e)},vc:(e,r)=>{if(!r)return-5;if(!(e=vr.contexts[e]))return-3;var t=e.GLctx;if(!t)return-3;t=t.getContextAttributes(),L[r>>2]=t.alpha,L[r+4>>2]=t.depth,L[r+8>>2]=t.stencil,L[r+12>>2]=t.antialias,L[r+16>>2]=t.premultipliedAlpha,L[r+20>>2]=t.preserveDrawingBuffer;var n=t.powerPreference&&yr.indexOf(t.powerPreference);return L[r+24>>2]=n,L[r+28>>2]=t.failIfMajorPerformanceCaveat,L[r+32>>2]=e.version,L[r+36>>2]=0,L[r+40>>2]=e.attributes.enableExtensionsByDefault,0},Ca:()=>vr.currentContext?vr.currentContext.handle:0,uc:e=>{for(var r=e>>2,t=0;t<14;++t)L[r+t]=0;L[r+0]=L[r+1]=L[r+3]=L[r+4]=L[r+8]=L[r+10]=1},tc:e=>vr.makeContextCurrent(e)?0:-5,sc:e=>Sr.add(xr.mgrBindGroupLayout.get(e)),Ba:e=>Sr.add(xr.mgrDevice.get(e)),rc:e=>Sr.add(xr.mgrSampler.get(e)),qc:e=>Sr.add(xr.mgrTexture.get(e)),J:()=>{if(void 0===xr.preinitializedDeviceId){var e=o.preinitializedWebGPUDevice,r={queueId:xr.mgrQueue.create(e.queue)};xr.preinitializedDeviceId=xr.mgrDevice.create(e,r)}return xr.mgrDevice.reference(xr.preinitializedDeviceId),xr.preinitializedDeviceId},pc:e=>xr.mgrBindGroup.create(Sr.get(e)),oc:e=>xr.mgrTexture.create(Sr.get(e)),U:e=>Sr.remove(e),Qc:(e,r)=>{var t=0;return Lr().forEach(((n,o)=>{var a=r+t;C[e+4*o>>2]=a,((e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);E[r>>0]=0})(n,a),t+=n.length+1})),0},Pc:(e,r)=>{var t=Lr();C[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),C[r>>2]=n,0},Aa:_e,la:function(e){try{var r=we.getStreamFromFD(e);return he.close(r),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Oc:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=he.read(e,E,i,s,n);if(u<0)return-1;if(o+=u,u>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},_b:function(e,r,t,n,o){var a=nr(r,t);try{if(isNaN(a))return 61;var i=we.getStreamFromFD(e);return he.llseek(i,a,n),q=[i.position>>>0,($=i.position,+Math.abs($)>=1?$>0?+Math.floor($/4294967296)>>>0:~~+Math.ceil(($-+(~~$>>>0))/4294967296)>>>0:0)],L[o>>2]=q[0],L[o+4>>2]=q[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},Ia:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=he.write(e,E,i,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(we.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===he||"ErrnoError"!==e.name)throw e;return e.errno}},nc:(e,r)=>(oe(x.subarray(e,e+r)),0),d:function(e){Ur.activeTexture(e)},aa:(e,r)=>{Ur.attachShader(vr.programs[e],vr.shaders[r])},mc:(e,r,t)=>{Ur.bindAttribLocation(vr.programs[e],r,ye(t))},e:(e,r)=>{34962==e?Ur.currentArrayBufferBinding=r:34963==e&&(Ur.currentElementArrayBufferBinding=r),35051==e?Ur.currentPixelPackBufferBinding=r:35052==e&&(Ur.currentPixelUnpackBufferBinding=r),Ur.bindBuffer(e,vr.buffers[r])},lc:(e,r,t)=>{Ur.bindBufferBase(e,r,vr.buffers[t])},v:(e,r)=>{Ur.bindFramebuffer(e,vr.framebuffers[r])},b:(e,r)=>{Ur.bindTexture(e,vr.textures[r])},t:e=>{Ur.bindVertexArray(vr.vaos[e]);var r=Ur.getParameter(34965);Ur.currentElementArrayBufferBinding=r?0|r.name:0},za:function(e){Ur.blendEquation(e)},kc:function(e,r){Ur.blendFunc(e,r)},p:(e,r,t,n)=>{vr.currentContext.version>=2?t&&r?Ur.bufferData(e,x,n,t,r):Ur.bufferData(e,r,n):Ur.bufferData(e,t?x.subarray(t,t+r):r,n)},z:function(e){Ur.clear(e)},ea:function(e,r,t,n){Ur.clearColor(e,r,t,n)},Tb:(e,r,t,n)=>{var o=(t>>>0)+4294967296*n;return Ur.clientWaitSync(vr.syncs[e],r,o)},ya:e=>{Ur.compileShader(vr.shaders[e])},xa:()=>{var e=vr.getNewId(vr.programs),r=Ur.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,vr.programs[e]=r,e},wa:e=>{var r=vr.getNewId(vr.shaders);return vr.shaders[r]=Ur.createShader(e),r},D:(e,r)=>{for(var t=0;t>2],o=vr.buffers[n];o&&(Ur.deleteBuffer(o),o.name=0,vr.buffers[n]=null,n==Ur.currentArrayBufferBinding&&(Ur.currentArrayBufferBinding=0),n==Ur.currentElementArrayBufferBinding&&(Ur.currentElementArrayBufferBinding=0),n==Ur.currentPixelPackBufferBinding&&(Ur.currentPixelPackBufferBinding=0),n==Ur.currentPixelUnpackBufferBinding&&(Ur.currentPixelUnpackBufferBinding=0))}},P:(e,r)=>{for(var t=0;t>2],o=vr.framebuffers[n];o&&(Ur.deleteFramebuffer(o),o.name=0,vr.framebuffers[n]=null)}},j:e=>{if(e){var r=vr.programs[e];r?(Ur.deleteProgram(r),r.name=0,vr.programs[e]=null):vr.recordError(1281)}},T:e=>{if(e){var r=vr.shaders[e];r?(Ur.deleteShader(r),vr.shaders[e]=null):vr.recordError(1281)}},S:e=>{if(e){var r=vr.syncs[e];r?(Ur.deleteSync(r),r.name=0,vr.syncs[e]=null):vr.recordError(1281)}},y:(e,r)=>{for(var t=0;t>2],o=vr.textures[n];o&&(Ur.deleteTexture(o),o.name=0,vr.textures[n]=null)}},O:(e,r)=>{for(var t=0;t>2];Ur.deleteVertexArray(vr.vaos[n]),vr.vaos[n]=null}},va:(e,r)=>{Ur.detachShader(vr.programs[e],vr.shaders[r])},I:function(e){Ur.disable(e)},s:e=>{vr.currentContext.clientBuffers[e].enabled=!1,Ur.disableVertexAttribArray(e)},o:(e,r,t)=>{vr.preDrawHandleClientVertexAttribBindings(r+t),Ur.drawArrays(e,r,t),vr.postDrawHandleClientVertexAttribBindings()},R:(e,r)=>{for(var t=Cr[e],n=0;n>2];Ur.drawBuffers(t)},jc:function(e){Ur.enable(e)},l:e=>{vr.currentContext.clientBuffers[e].enabled=!0,Ur.enableVertexAttribArray(e)},ua:(e,r)=>{var t=Ur.fenceSync(e,r);if(t){var n=vr.getNewId(vr.syncs);return t.name=n,vr.syncs[n]=t,n}return 0},$:function(){Ur.finish()},A:function(){Ur.flush()},x:(e,r,t,n,o)=>{Ur.framebufferTexture2D(e,r,t,vr.textures[n],o)},ta:(e,r,t,n,o)=>{Ur.framebufferTextureLayer(e,r,vr.textures[t],n,o)},w:(e,r)=>{Pr(e,r,"createBuffer",vr.buffers)},N:(e,r)=>{Pr(e,r,"createFramebuffer",vr.framebuffers)},C:(e,r)=>{Pr(e,r,"createTexture",vr.textures)},M:function(e,r){Pr(e,r,"createVertexArray",vr.vaos)},sa:(e,r)=>Ur.getAttribLocation(vr.programs[e],ye(r)),_:()=>{var e=Ur.getError()||vr.lastError;return vr.lastError=0,e},q:(e,r)=>{((e,r,t)=>{if(r){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=t&&1!=t&&vr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=Ur.getParameter(34467);n=o?o.length:0;break;case 33309:if(vr.currentContext.version<2)return void vr.recordError(1282);n=2*(Ur.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(vr.currentContext.version<2)return void vr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=Ur.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void vr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void vr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i>2]=a[i];break;case 2:P[r+4*i>>2]=a[i];break;case 4:E[r+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(r){return vr.recordError(1280),void b("GL_INVALID_ENUM in glGet"+t+"v: Unknown object returned from WebGL getParameter("+e+")! (error: "+r+")")}}break;default:return vr.recordError(1280),void b("GL_INVALID_ENUM in glGet"+t+"v: Native code calling glGet"+t+"v("+e+") and it returns "+a+" of type "+typeof a+"!")}}switch(t){case 1:((e,r)=>{C[e>>2]=r;var t=C[e>>2];C[e+4>>2]=(r-t)/4294967296})(r,n);break;case 0:L[r>>2]=n;break;case 2:P[r>>2]=n;break;case 4:E[r>>0]=n?1:0}}else vr.recordError(1281)})(e,r,0)},ic:(e,r,t)=>{if(t)if(e>=vr.counter)vr.recordError(1281);else if(e=vr.programs[e],35716==r){var n=Ur.getProgramInfoLog(e);null===n&&(n="(unknown error)"),L[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=0;o>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(o=0;o>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(o=0;o>2]=e.maxUniformBlockNameLength}else L[t>>2]=Ur.getProgramParameter(e,r);else vr.recordError(1281)},hc:(e,r,t,n)=>{var o=Ur.getShaderInfoLog(vr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?$e(o,n,r):0;t&&(L[t>>2]=a)},gc:(e,r,t)=>{if(t)if(35716==r){var n=Ur.getShaderInfoLog(vr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;L[t>>2]=o}else if(35720==r){var a=Ur.getShaderSource(vr.shaders[e]),i=a?a.length+1:0;L[t>>2]=i}else L[t>>2]=Ur.getShaderParameter(vr.shaders[e],r);else vr.recordError(1281)},G:e=>{var r=vr.stringCache[e];if(!r){switch(e){case 7939:var t=Ur.getSupportedExtensions()||[];t=t.concat(t.map((e=>"GL_"+e))),r=ur(t.join(" "));break;case 7936:case 7937:case 37445:case 37446:var n=Ur.getParameter(e);n||vr.recordError(1280),r=n&&ur(n);break;case 7938:var o=Ur.getParameter(7938);o=vr.currentContext.version>=2?"OpenGL ES 3.0 ("+o+")":"OpenGL ES 2.0 ("+o+")",r=ur(o);break;case 35724:var a=Ur.getParameter(35724),i=a.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==i&&(3==i[1].length&&(i[1]=i[1]+"0"),a="OpenGL ES GLSL ES "+i[1]+" ("+a+")"),r=ur(a);break;default:vr.recordError(1280)}vr.stringCache[e]=r}return r},fc:(e,r)=>Ur.getUniformBlockIndex(vr.programs[e],ye(r)),g:(e,r)=>{if(r=ye(r),e=vr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r0?i.slice(0,u):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],t=0;t0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n{e=vr.programs[e],Ur.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},Z:(e,r)=>{3317==e&&(vr.unpackAlignment=r),Ur.pixelStorei(e,r)},da:(e,r,t,n,o,a,i)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelPackBufferBinding)Ur.readPixels(e,r,t,n,o,a,i);else{var s=Br(a);Ur.readPixels(e,r,t,n,o,a,s,i>>Tr(s))}else{var u=Dr(a,o,t,n,i);u?Ur.readPixels(e,r,t,n,o,a,u):vr.recordError(1280)}},qa:(e,r,t,n)=>{var o=vr.getSource(e,r,t,n);Ur.shaderSource(vr.shaders[e],o)},B:(e,r,t,n,o,a,i,s,u)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelUnpackBufferBinding)Ur.texImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Br(s);Ur.texImage2D(e,r,t,n,o,a,i,s,c,u>>Tr(c))}else Ur.texImage2D(e,r,t,n,o,a,i,s,null);else Ur.texImage2D(e,r,t,n,o,a,i,s,u?Dr(s,i,n,o,u):null)},Y:function(e,r,t){Ur.texParameterf(e,r,t)},pa:(e,r,t)=>{var n=P[t>>2];Ur.texParameterf(e,r,n)},c:function(e,r,t){Ur.texParameteri(e,r,t)},X:function(e,r,t,n,o){Ur.texStorage2D(e,r,t,n,o)},ec:function(e,r,t,n,o,a){Ur.texStorage3D(e,r,t,n,o,a)},Q:(e,r,t,n,o,a,i,s,u)=>{if(vr.currentContext.version>=2)if(Ur.currentPixelUnpackBufferBinding)Ur.texSubImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Br(s);Ur.texSubImage2D(e,r,t,n,o,a,i,s,c,u>>Tr(c))}else Ur.texSubImage2D(e,r,t,n,o,a,i,s,null);else{var l=null;u&&(l=Dr(s,i,o,a,u)),Ur.texSubImage2D(e,r,t,n,o,a,i,s,l)}},dc:(e,r,t,n,o,a,i,s,u,c,l)=>{if(Ur.currentPixelUnpackBufferBinding)Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,l);else if(l){var d=Br(c);Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,d,l>>Tr(d))}else Ur.texSubImage3D(e,r,t,n,o,a,i,s,u,c,null)},W:(e,r)=>{Ur.uniform1f(Ar(e),r)},f:(e,r)=>{Ur.uniform1i(Ar(e),r)},cc:(e,r,t)=>{Ur.uniform2f(Ar(e),r,t)},bc:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform2fv(Ar(e),P,t>>2,2*r);else{if(r<=144)for(var n=Mr[2*r-1],o=0;o<2*r;o+=2)n[o]=P[t+4*o>>2],n[o+1]=P[t+(4*o+4)>>2];else n=P.subarray(t>>2,t+8*r>>2);Ur.uniform2fv(Ar(e),n)}},oa:(e,r,t,n)=>{Ur.uniform3f(Ar(e),r,t,n)},na:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform4fv(Ar(e),P,t>>2,4*r);else{if(r<=72){var n=Mr[4*r-1],o=P;t>>=2;for(var a=0;a<4*r;a+=4){var i=t+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=P.subarray(t>>2,t+16*r>>2);Ur.uniform4fv(Ar(e),n)}},ac:(e,r,t)=>{if(vr.currentContext.version>=2)r&&Ur.uniform4iv(Ar(e),L,t>>2,4*r);else{if(r<=72)for(var n=Ir[4*r-1],o=0;o<4*r;o+=4)n[o]=L[t+4*o>>2],n[o+1]=L[t+(4*o+4)>>2],n[o+2]=L[t+(4*o+8)>>2],n[o+3]=L[t+(4*o+12)>>2];else n=L.subarray(t>>2,t+16*r>>2);Ur.uniform4iv(Ar(e),n)}},$b:(e,r,t)=>{e=vr.programs[e],Ur.uniformBlockBinding(e,r,t)},ma:(e,r,t,n)=>{if(vr.currentContext.version>=2)r&&Ur.uniformMatrix4fv(Ar(e),!!t,P,n>>2,16*r);else{if(r<=18){var o=Mr[16*r-1],a=P;n>>=2;for(var i=0;i<16*r;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=P.subarray(n>>2,n+64*r>>2);Ur.uniformMatrix4fv(Ar(e),!!t,o)}},h:e=>{e=vr.programs[e],Ur.useProgram(e),Ur.currentProgram=e},k:(e,r,t,n,o,a)=>{var i=vr.currentContext.clientBuffers[e];if(!Ur.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,Ur.vertexAttribPointer(e,r,t,!!n,o,a)},L:function(e,r,t,n){Ur.viewport(e,r,t,n)},Rb:function(){let e;return"undefined"!=typeof HTMLCanvasElement?(e=document.createElement("canvas"),e.style.display="none"):e=new OffscreenCanvas(0,0),Ue.toHandle(e)},Qb:function(e){let r=br(e);return o&&!r&&(r=o.canvasWebGpu),Ue.toHandle(r)},Pb:function(e,r){const t=xr.mgrDevice.get(e),n=Ue.toValue(r),o=t.importExternalTexture({source:n});return Ue.toHandle(o)},Ob:function(e){const r=Ue.toValue(e);Ur.texImage2D(Ur.TEXTURE_2D,0,Ur.RGBA,Ur.RGBA,Ur.UNSIGNED_BYTE,r)},Nc:be,V:zr,Nb:(e,r,t,n,o)=>zr(e,r,t,n),Mb:e=>xr.mgrBindGroupLayout.release(e),Lb:e=>xr.mgrBindGroup.release(e),Kb:(e,r,t)=>{var n,o=xr.mgrBuffer.objects[e];if(0===t&&Se("getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE"),-1==t&&(t=void 0),2!==o.mapMode)return 0;try{n=o.object.getMappedRange(r,t)}catch(e){return 0}var a=rt(16,n.byteLength);return x.fill(0,a,n.byteLength),o.onUnmap.push((()=>{new Uint8Array(n).set(x.subarray(a,a+n.byteLength)),Qr(a)})),a},Jb:e=>xr.mgrBuffer.reference(e),Ib:e=>xr.mgrBuffer.release(e),Hb:e=>{var r=xr.mgrBuffer.objects[e];if(r.onUnmap){for(var t=0;txr.mgrCommandBuffer.release(e),Fb:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:xr.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}(C[r+8>>2])};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=xr.mgrCommandEncoder.get(e);return xr.mgrComputePassEncoder.create(o.beginComputePass(t))},Eb:(e,r)=>{function t(e){var r=C[e+4>>2];if(0!==r){var t=C[e+12>>2],n=C[e+16>>2],o=xr.makeColor(e+24);return{view:xr.mgrTextureView.get(r),resolveTarget:xr.mgrTextureView.get(C[e+8>>2]),clearValue:o,loadOp:xr.LoadOp[t],storeOp:xr.StoreOp[n]}}}function n(e,r){for(var n=[],o=0;o>2]),depthClearValue:P[e+12>>2],depthLoadOp:xr.LoadOp[C[e+4>>2]],depthStoreOp:xr.StoreOp[C[e+8>>2]],depthReadOnly:0!==E[e+16>>0],stencilClearValue:C[e+28>>2],stencilLoadOp:xr.LoadOp[C[e+20>>2]],stencilStoreOp:xr.StoreOp[C[e+24>>2]],stencilReadOnly:0!==E[e+32>>0]}}function a(e){if(0!==e)return{querySet:xr.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}var i=function(e){var r=C[e>>2],t=void 0;if(0!==r){C[r+4>>2];var i=r;t=4294967296*C[i+4+8>>2]+C[i+8>>2]}var s={label:void 0,colorAttachments:n(C[e+8>>2],C[e+12>>2]),depthStencilAttachment:o(C[e+16>>2]),occlusionQuerySet:xr.mgrQuerySet.get(C[e+20>>2]),timestampWrites:a(C[e+24>>2]),maxDrawCount:t},u=C[e+4>>2];return u&&(s.label=ye(u)),s}(r),s=xr.mgrCommandEncoder.get(e);return xr.mgrRenderPassEncoder.create(s.beginRenderPass(i))},Db:(e,r,t,n)=>{var o=xr.mgrCommandEncoder.get(e),a=xr.makeExtent3D(n);o.copyBufferToTexture(xr.makeImageCopyBuffer(r),xr.makeImageCopyTexture(t),a)},Cb:(e,r,t,n)=>{var o=xr.mgrCommandEncoder.get(e),a=xr.makeExtent3D(n);o.copyTextureToTexture(xr.makeImageCopyTexture(r),xr.makeImageCopyTexture(t),a)},Bb:(e,r)=>{var t=xr.mgrCommandEncoder.get(e);return xr.mgrCommandBuffer.create(t.finish())},Ab:e=>xr.mgrCommandEncoder.release(e),zb:(e,r,t,n)=>{xr.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},yb:e=>{xr.mgrComputePassEncoder.get(e).end()},xb:e=>xr.mgrComputePassEncoder.release(e),wb:(e,r,t,n,o)=>{var a=xr.mgrComputePassEncoder.get(e),i=xr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},vb:(e,r)=>{var t=xr.mgrComputePassEncoder.get(e),n=xr.mgrComputePipeline.get(r);t.setPipeline(n)},ub:(e,r)=>{var t=xr.mgrComputePipeline.get(e);return xr.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},tb:e=>xr.mgrComputePipeline.release(e),sb:(e,r)=>{function t(e){var r,t=C[e+8>>2],n=C[e+32>>2],o=C[e+36>>2],a=C[e+4>>2];if(t){var i=C[(r=e+24)>>2]+4294967296*L[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:xr.mgrBuffer.get(t),offset:4294967296*C[e+4+16>>2]+C[e+16>>2],size:i}}}return n?{binding:a,resource:xr.mgrSampler.get(n)}:{binding:a,resource:xr.mgrTextureView.get(o)}}var n={label:void 0,layout:xr.mgrBindGroupLayout.get(C[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o>2],C[r+16>>2])},o=C[r+4>>2];o&&(n.label=ye(o));var a=xr.mgrDevice.get(e);return xr.mgrBindGroup.create(a.createBindGroup(n))},rb:(e,r)=>{var t=0!==E[r+24>>0],n={label:void 0,usage:C[r+8>>2],size:4294967296*C[r+4+16>>2]+C[r+16>>2],mappedAtCreation:t},o=C[r+4>>2];o&&(n.label=ye(o));var a=xr.mgrDevice.get(e),i={},s=xr.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},qb:(e,r)=>{var t;if(r){t={label:void 0};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=xr.mgrDevice.get(e);return xr.mgrCommandEncoder.create(o.createCommandEncoder(t))},pb:(e,r)=>{var t={label:void 0,layout:xr.makePipelineLayout(C[r+8>>2]),compute:xr.makeProgrammableStageDescriptor(r+12)},n=C[r+4>>2];n&&(t.label=ye(n));var o=xr.mgrDevice.get(e);return xr.mgrComputePipeline.create(o.createComputePipeline(t))},ob:(e,r)=>{function t(e){if(e)return{operation:xr.BlendOperation[C[e>>2]],srcFactor:xr.BlendFactor[C[e+4>>2]],dstFactor:xr.BlendFactor[C[e+8>>2]]}}function n(e){if(e)return{alpha:t(e+12),color:t(e+0)}}function o(e,r){for(var t,o,a=[],i=0;i>2])?void 0:{format:xr.TextureFormat[o],blend:n(C[t+8>>2]),writeMask:C[t+12>>2]}));return a}function a(e){return{compare:xr.CompareFunction[C[e>>2]],failOp:xr.StencilOperation[C[e+4>>2]],depthFailOp:xr.StencilOperation[C[e+8>>2]],passOp:xr.StencilOperation[C[e+12>>2]]}}function i(e,r){for(var t,n=[],o=0;o>2]],offset:4294967296*C[t+4+8>>2]+C[t+8>>2],shaderLocation:C[t+16>>2]}));return n}function s(e){if(e){var r=C[e+8>>2];return 2===r?null:{arrayStride:4294967296*C[e+4>>2]+C[e>>2],stepMode:xr.VertexStepMode[r],attributes:i(C[e+12>>2],C[e+16>>2])}}}function u(e,r){if(e){for(var t=[],n=0;n>2]),vertex:function(e){if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2]),buffers:u(C[e+20>>2],C[e+24>>2])}}(r+12),primitive:function(e){if(e)return{topology:xr.PrimitiveTopology[C[e+4>>2]],stripIndexFormat:xr.IndexFormat[C[e+8>>2]],frontFace:xr.FrontFace[C[e+12>>2]],cullMode:xr.CullMode[C[e+16>>2]]}}(r+40),depthStencil:function(e){if(e)return{format:xr.TextureFormat[C[e+4>>2]],depthWriteEnabled:0!==E[e+8>>0],depthCompare:xr.CompareFunction[C[e+12>>2]],stencilFront:a(e+16),stencilBack:a(e+32),stencilReadMask:C[e+48>>2],stencilWriteMask:C[e+52>>2],depthBias:L[e+56>>2],depthBiasSlopeScale:P[e+60>>2],depthBiasClamp:P[e+64>>2]}}(C[r+60>>2]),multisample:function(e){if(e)return{count:C[e+4>>2],mask:C[e+8>>2],alphaToCoverageEnabled:0!==E[e+12>>0]}}(r+64),fragment:function(e){if(e)return{module:xr.mgrShaderModule.get(C[e+4>>2]),entryPoint:ye(C[e+8>>2]),constants:xr.makePipelineConstants(C[e+12>>2],C[e+16>>2]),targets:o(C[e+20>>2],C[e+24>>2])}}(C[r+80>>2])},l=C[r+4>>2];l&&(c.label=ye(l));var d=xr.mgrDevice.get(e);return xr.mgrRenderPipeline.create(d.createRenderPipeline(c))},nb:(e,r)=>{var t={label:void 0,addressModeU:xr.AddressMode[C[r+8>>2]],addressModeV:xr.AddressMode[C[r+12>>2]],addressModeW:xr.AddressMode[C[r+16>>2]],magFilter:xr.FilterMode[C[r+20>>2]],minFilter:xr.FilterMode[C[r+24>>2]],mipmapFilter:xr.MipmapFilterMode[C[r+28>>2]],lodMinClamp:P[r+32>>2],lodMaxClamp:P[r+36>>2],compare:xr.CompareFunction[C[r+40>>2]]},n=C[r+4>>2];n&&(t.label=ye(n));var o=xr.mgrDevice.get(e);return xr.mgrSampler.create(o.createSampler(t))},mb:(e,r)=>{var t=C[r>>2],n=C[t+4>>2],o={label:void 0,code:""},a=C[r+4>>2];switch(a&&(o.label=ye(a)),n){case 5:var i=C[t+8>>2],s=C[t+12>>2]>>2;o.code=C.subarray(s,s+i);break;case 6:var u=C[t+8>>2];u&&(o.code=ye(u))}var c=xr.mgrDevice.get(e);return xr.mgrShaderModule.create(c.createShaderModule(o))},lb:(e,r)=>{var t={label:void 0,size:xr.makeExtent3D(r+16),mipLevelCount:C[r+32>>2],sampleCount:C[r+36>>2],dimension:xr.TextureDimension[C[r+12>>2]],format:xr.TextureFormat[C[r+28>>2]],usage:C[r+8>>2]},n=C[r+4>>2];n&&(t.label=ye(n));var o=C[r+40>>2];if(o){var a=C[r+44>>2];t.viewFormats=Array.from(L.subarray(a>>2,a+4*o>>2),(function(e){return xr.TextureFormat[e]}))}var i=xr.mgrDevice.get(e);return xr.mgrTexture.create(i.createTexture(t))},kb:e=>{var r=xr.mgrDevice.objects[e].queueId;return xr.mgrQueue.reference(r),r},jb:e=>xr.mgrDevice.reference(e),ib:e=>xr.mgrDevice.release(e),hb:e=>xr.mgrPipelineLayout.release(e),gb:e=>xr.mgrQuerySet.release(e),fb:e=>xr.mgrQueue.release(e),eb:(e,r,t)=>{var n=xr.mgrQueue.get(e),o=Array.from(L.subarray(t>>2,t+4*r>>2),(function(e){return xr.mgrCommandBuffer.get(e)}));n.submit(o)},Sb:function(e,r,t,n,o,a){var i=nr(t,n),s=xr.mgrQueue.get(e),u=xr.mgrBuffer.get(r),c=x.subarray(o,o+a);s.writeBuffer(u,i,c,0,a)},db:(e,r,t,n,o)=>{xr.mgrRenderPassEncoder.get(e).draw(r,t,n,o)},cb:e=>{xr.mgrRenderPassEncoder.get(e).end()},bb:e=>xr.mgrRenderPassEncoder.release(e),ab:(e,r,t,n,o)=>{var a=xr.mgrRenderPassEncoder.get(e),i=xr.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},$a:(e,r)=>{var t=xr.mgrRenderPassEncoder.get(e),n=xr.mgrRenderPipeline.get(r);t.setPipeline(n)},_a:(e,r)=>{var t=xr.mgrRenderPipeline.get(e);return xr.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},Za:e=>xr.mgrRenderPipeline.release(e),Ya:e=>xr.mgrSampler.reference(e),Xa:e=>xr.mgrSampler.release(e),Wa:e=>xr.mgrShaderModule.reference(e),Va:e=>xr.mgrShaderModule.release(e),Ua:(e,r)=>{var t;if(r){var n=C[r+20>>2],o=C[r+28>>2];t={format:xr.TextureFormat[C[r+8>>2]],dimension:xr.TextureViewDimension[C[r+12>>2]],baseMipLevel:C[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:C[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:xr.TextureAspect[C[r+32>>2]]};var a=C[r+4>>2];a&&(t.label=ye(a))}var i=xr.mgrTexture.get(e);return xr.mgrTextureView.create(i.createView(t))},Ta:e=>xr.mgrTexture.get(e).destroy(),Sa:e=>xr.mgrTexture.reference(e),Ra:e=>xr.mgrTexture.release(e),Qa:e=>xr.mgrTextureView.reference(e),Pa:e=>xr.mgrTextureView.release(e),Oa:function(e,r,t,n){const o=gr.length,a=new Uint8Array(x.slice(e+r,e+t));try{var i=new WebAssembly.Module(a),s=new WebAssembly.Instance(i,{env:{memory:y}});for(var u in s.exports){var c=s.exports[u];addFunction(c)}return oWebAssembly.instantiateStreaming(e,t).then(a,(function(e){return b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation"),Q(r,t,a)}))))).catch(n),{}}(),Qr=o._free=e=>(Qr=o._free=Xr.nd)(e),Kr=o._malloc=e=>(Kr=o._malloc=Xr.od)(e),Zr=(o._addBoundTextureAsImageToStream=(e,r,t,n)=>(o._addBoundTextureAsImageToStream=Xr.pd)(e,r,t,n),o._attachImageListener=(e,r)=>(o._attachImageListener=Xr.qd)(e,r),o._attachImageVectorListener=(e,r)=>(o._attachImageVectorListener=Xr.rd)(e,r),o._registerModelResourcesGraphService=()=>(o._registerModelResourcesGraphService=Xr.sd)(),()=>(Zr=Xr.td)()),Jr=(o._bindTextureToStream=e=>(o._bindTextureToStream=Xr.ud)(e),o._addBoundTextureToStream=(e,r,t,n)=>(o._addBoundTextureToStream=Xr.vd)(e,r,t,n),o._addDoubleToInputStream=(e,r,t)=>(o._addDoubleToInputStream=Xr.wd)(e,r,t),o._addFloatToInputStream=(e,r,t)=>(o._addFloatToInputStream=Xr.xd)(e,r,t),o._addBoolToInputStream=(e,r,t)=>(o._addBoolToInputStream=Xr.yd)(e,r,t),o._addIntToInputStream=(e,r,t)=>(o._addIntToInputStream=Xr.zd)(e,r,t),o._addStringToInputStream=(e,r,t)=>(o._addStringToInputStream=Xr.Ad)(e,r,t),o._allocateBoolVector=e=>(o._allocateBoolVector=Xr.Bd)(e),o._allocateFloatVector=e=>(o._allocateFloatVector=Xr.Cd)(e),o._allocateDoubleVector=e=>(o._allocateDoubleVector=Xr.Dd)(e),o._allocateIntVector=e=>(o._allocateIntVector=Xr.Ed)(e),o._allocateStringVector=e=>(o._allocateStringVector=Xr.Fd)(e),o._addBoolVectorEntry=(e,r)=>(o._addBoolVectorEntry=Xr.Gd)(e,r),o._addFloatVectorEntry=(e,r)=>(o._addFloatVectorEntry=Xr.Hd)(e,r),o._addDoubleVectorEntry=(e,r)=>(o._addDoubleVectorEntry=Xr.Id)(e,r),o._addIntVectorEntry=(e,r)=>(o._addIntVectorEntry=Xr.Jd)(e,r),o._addStringVectorEntry=(e,r)=>(o._addStringVectorEntry=Xr.Kd)(e,r),o._addBoolVectorToInputStream=(e,r,t)=>(o._addBoolVectorToInputStream=Xr.Ld)(e,r,t),o._addFloatVectorToInputStream=(e,r,t)=>(o._addFloatVectorToInputStream=Xr.Md)(e,r,t),o._addDoubleVectorToInputStream=(e,r,t)=>(o._addDoubleVectorToInputStream=Xr.Nd)(e,r,t),o._addIntVectorToInputStream=(e,r,t)=>(o._addIntVectorToInputStream=Xr.Od)(e,r,t),o._addStringVectorToInputStream=(e,r,t)=>(o._addStringVectorToInputStream=Xr.Pd)(e,r,t),o._addFlatHashMapToInputStream=(e,r,t,n,a)=>(o._addFlatHashMapToInputStream=Xr.Qd)(e,r,t,n,a),o._addProtoToInputStream=(e,r,t,n,a)=>(o._addProtoToInputStream=Xr.Rd)(e,r,t,n,a),o._addEmptyPacketToInputStream=(e,r)=>(o._addEmptyPacketToInputStream=Xr.Sd)(e,r),o._addBoolToInputSidePacket=(e,r)=>(o._addBoolToInputSidePacket=Xr.Td)(e,r),o._addDoubleToInputSidePacket=(e,r)=>(o._addDoubleToInputSidePacket=Xr.Ud)(e,r),o._addFloatToInputSidePacket=(e,r)=>(o._addFloatToInputSidePacket=Xr.Vd)(e,r),o._addIntToInputSidePacket=(e,r)=>(o._addIntToInputSidePacket=Xr.Wd)(e,r),o._addStringToInputSidePacket=(e,r)=>(o._addStringToInputSidePacket=Xr.Xd)(e,r),o._addProtoToInputSidePacket=(e,r,t,n)=>(o._addProtoToInputSidePacket=Xr.Yd)(e,r,t,n),o._addBoolVectorToInputSidePacket=(e,r)=>(o._addBoolVectorToInputSidePacket=Xr.Zd)(e,r),o._addDoubleVectorToInputSidePacket=(e,r)=>(o._addDoubleVectorToInputSidePacket=Xr._d)(e,r),o._addFloatVectorToInputSidePacket=(e,r)=>(o._addFloatVectorToInputSidePacket=Xr.$d)(e,r),o._addIntVectorToInputSidePacket=(e,r)=>(o._addIntVectorToInputSidePacket=Xr.ae)(e,r),o._addStringVectorToInputSidePacket=(e,r)=>(o._addStringVectorToInputSidePacket=Xr.be)(e,r),o._attachBoolListener=e=>(o._attachBoolListener=Xr.ce)(e),o._attachBoolVectorListener=e=>(o._attachBoolVectorListener=Xr.de)(e),o._attachDoubleListener=e=>(o._attachDoubleListener=Xr.ee)(e),o._attachDoubleVectorListener=e=>(o._attachDoubleVectorListener=Xr.fe)(e),o._attachFloatListener=e=>(o._attachFloatListener=Xr.ge)(e),o._attachFloatVectorListener=e=>(o._attachFloatVectorListener=Xr.he)(e),o._attachIntListener=e=>(o._attachIntListener=Xr.ie)(e),o._attachIntVectorListener=e=>(o._attachIntVectorListener=Xr.je)(e),o._attachStringListener=e=>(o._attachStringListener=Xr.ke)(e),o._attachStringVectorListener=e=>(o._attachStringVectorListener=Xr.le)(e),o._attachProtoListener=(e,r)=>(o._attachProtoListener=Xr.me)(e,r),o._attachProtoVectorListener=(e,r)=>(o._attachProtoVectorListener=Xr.ne)(e,r),o._getGraphConfig=(e,r)=>(o._getGraphConfig=Xr.oe)(e,r),o._clearSubgraphs=()=>(o._clearSubgraphs=Xr.pe)(),o._pushBinarySubgraph=(e,r)=>(o._pushBinarySubgraph=Xr.qe)(e,r),o._pushTextSubgraph=(e,r)=>(o._pushTextSubgraph=Xr.re)(e,r),o._changeBinaryGraph=(e,r)=>(o._changeBinaryGraph=Xr.se)(e,r),o._changeTextGraph=(e,r)=>(o._changeTextGraph=Xr.te)(e,r),o._processGl=e=>(o._processGl=Xr.ue)(e),o._process=e=>(o._process=Xr.ve)(e),o._bindTextureToCanvas=()=>(o._bindTextureToCanvas=Xr.we)(),o._requestShaderRefreshOnGraphChange=()=>(o._requestShaderRefreshOnGraphChange=Xr.xe)(),o._waitUntilIdle=()=>(o._waitUntilIdle=Xr.ye)(),o._closeGraph=()=>(o._closeGraph=Xr.ze)(),o._setAutoRenderToScreen=e=>(o._setAutoRenderToScreen=Xr.Ae)(e),e=>(Jr=Xr.Be)(e)),et=(o.__embind_initialize_bindings=()=>(o.__embind_initialize_bindings=Xr.Ce)(),(e,r)=>(et=Xr.De)(e,r)),rt=(e,r)=>(rt=Xr.Ee)(e,r),tt=e=>(tt=Xr.Fe)(e),nt=()=>(nt=Xr.Ge)(),ot=e=>(ot=Xr.He)(e),at=e=>(at=Xr.Ie)(e),it=e=>(it=Xr.Je)(e);function st(){function e(){Wr||(Wr=!0,o.calledRun=!0,B||(o.noFSInit||he.init.initialized||he.init(),he.ignorePermissions=!1,me.init(),Le(M),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),V.unshift(e);var e;Le(V)}()))}R>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),A.unshift(e);var e;Le(A)}(),R>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o.___start_em_js=1243428,o.___stop_em_js=1250865,o.addRunDependency=U,o.removeRunDependency=N,o.FS_createPath=he.createPath,o.FS_createLazyFile=he.createLazyFile,o.FS_createDevice=he.createDevice,o.ccall=(e,r,t,n,a)=>{var i={string:e=>{var r=0;return null!=e&&0!==e&&(r=_r(e)),r},array:e=>{var r=at(e.length);return Or(e,r),r}},s=(e=>o["_"+e])(e),u=[],c=0;if(n)for(var l=0;l0;)o.preInit.pop()();return st(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=ModuleFactory:"function"==typeof define&&define.amd&&define([],(()=>ModuleFactory)); \ No newline at end of file +var ModuleFactory=(()=>{var e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){var t,n,o=r;o.ready=new Promise(((e,r)=>{t=e,n=r}));var a,i,s,u=Object.assign({},o),c="./this.program",l=(e,r)=>{throw r},d="object"==typeof window,m="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";if(f){var g=require("fs"),h=require("path");p=m?h.dirname(p)+"/":__dirname+"/",a=(e,r)=>(e=X(e)?new URL(e):h.normalize(e),g.readFileSync(e,r?void 0:"utf8")),s=e=>{var r=a(e,!0);return r.buffer||(r=new Uint8Array(r)),r},i=(e,r,t,n=!0)=>{e=X(e)?new URL(e):h.normalize(e),g.readFile(e,n?void 0:"utf8",((e,o)=>{e?t(e):r(n?o.buffer:o)}))},!o.thisProgram&&process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,r)=>{throw process.exitCode=e,r},o.inspect=()=>"[Emscripten Module object]"}else(d||m)&&(m?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},m&&(s=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),i=(e,r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t()},n.onerror=t,n.send(null)});var v,y,w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,u),u=null,o.arguments&&o.arguments,o.thisProgram&&(c=o.thisProgram),o.quit&&(l=o.quit),o.wasmBinary&&(v=o.wasmBinary),"object"!=typeof WebAssembly&&N("no native wasm support detected");var _,E,x,S,k,L,C,B,P,F=!1;function T(e,r){e||N(r)}function A(){var e=y.buffer;o.HEAP8=E=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAPU8=x=new Uint8Array(e),o.HEAPU16=k=new Uint16Array(e),o.HEAP32=L=new Int32Array(e),o.HEAPU32=C=new Uint32Array(e),o.HEAPF32=B=new Float32Array(e),o.HEAPF64=P=new Float64Array(e)}var D=[],M=[],I=[],V=[],R=0,O=null,z=null;function U(e){R++,o.monitorRunDependencies?.(R)}function G(e){if(R--,o.monitorRunDependencies?.(R),0==R&&(null!==O&&(clearInterval(O),O=null),z)){var r=z;z=null,r()}}function N(e){o.onAbort?.(e),b(e="Aborted("+e+")"),F=!0,_=1,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw n(r),r}var j,H,W,q,Y=e=>e.startsWith("data:application/octet-stream;base64,"),X=e=>e.startsWith("file://");function $(e){if(e==j&&v)return new Uint8Array(v);if(s)return s(e);throw"both async and sync fetching of the wasm failed"}function Q(e,r,t){return function(e){if(!v&&(d||m)){if("function"==typeof fetch&&!X(e))return fetch(e,{credentials:"same-origin"}).then((r=>{if(!r.ok)throw"failed to load wasm binary file at '"+e+"'";return r.arrayBuffer()})).catch((()=>$(e)));if(i)return new Promise(((r,t)=>{i(e,(e=>r(new Uint8Array(e))),t)}))}return Promise.resolve().then((()=>$(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then((e=>e)).then(t,(e=>{b(`failed to asynchronously prepare wasm: ${e}`),N(e)}))}Y(j="vision_wasm_nosimd_internal.wasm")||(H=j,j=o.locateFile?o.locateFile(H,p):p+H);var K,Z={1298619:e=>{const r=Ge.toValue(e).getContext("webgpu");return xr.add(r.getCurrentTexture())},1298754:(e,r,t,n,o)=>{const a=Ge.toValue(e),i=xr.get(r),s=xr.get(t),u=n,c=o;i.queue.copyExternalImageToTexture({source:a},{texture:s},[u,c])},1299005:(e,r)=>{const t=Ge.toValue(e),n=Ge.toValue(r),o=n.getContext("2d"),a=new ImageData(t,n.width,n.height);o.putImageData(a,0,0)},1299229:(e,r)=>{const t=Ge.toValue(e),n=Ge.toValue(r),o=t.getContext("2d").getImageData(0,0,t.width,t.height);n.set(o.data)},1299433:(e,r)=>{const t=Ge.toValue(e);Ge.toValue(r).getContext("2d").drawImage(t,0,0)},1299569:()=>!!o.preinitializedWebGPUDevice,1299620:()=>{yr["#canvas"]=o.canvas},1299671:()=>"undefined"!=typeof wasmOffsetConverter},J=(e,r)=>{if(ke.mainLoop.timingMode=e,ke.mainLoop.timingValue=r,!ke.mainLoop.func)return 1;if(ke.mainLoop.running||(ke.mainLoop.running=!0),0==e)ke.mainLoop.scheduler=function(){var e=0|Math.max(0,ke.mainLoop.tickStartTime+r-K());setTimeout(ke.mainLoop.runner,e)},ke.mainLoop.method="timeout";else if(1==e)ke.mainLoop.scheduler=function(){ke.requestAnimationFrame(ke.mainLoop.runner)},ke.mainLoop.method="rAF";else if(2==e){if(void 0===ke.setImmediate)if("undefined"==typeof setImmediate){var t=[],n="setimmediate";addEventListener("message",(e=>{e.data!==n&&e.data.target!==n||(e.stopPropagation(),t.shift()())}),!0),ke.setImmediate=function(e){t.push(e),m?(void 0===o.setImmediates&&(o.setImmediates=[]),o.setImmediates.push(e),postMessage({target:n})):postMessage(n,"*")}}else ke.setImmediate=setImmediate;ke.mainLoop.scheduler=function(){ke.setImmediate(ke.mainLoop.runner)},ke.mainLoop.method="immediate"}return 0};K=()=>performance.now();var ee=e=>{if(e instanceof re||"unwind"==e)return _;l(1,e)};function re(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var te=()=>Ce||!1,ne={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=ne.isAbs(e),t="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=ne.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:function(){var e=Array.prototype.slice.call(arguments);return ne.normalize(e.join("/"))},join2:(e,r)=>ne.normalize(e+"/"+r)},oe=e=>(oe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(f)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}N("initRandomDevice")})())(e),ae={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:ve.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r=ne.isAbs(n)}return(r?"/":"")+(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ae.resolve(e).substr(1),r=ae.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ie)return ie.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ue=[],ce=e=>{for(var r=0,t=0;t=55296&&n<=57343?(r+=4,++t):r+=3}return r},le=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function de(e,r,t){var n=t>0?t:ce(e)+1,o=new Array(n),a=le(e,o,0,o.length);return r&&(o.length=a),o}var me={ttys:[],init(){},shutdown(){},register(e,r){me.ttys[e]={input:[],output:[],ops:r},ve.registerDevice(e,me.stream_ops)},stream_ops:{open(e){var r=me.ttys[e.node.rdev];if(!r)throw new ve.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new ve.ErrnoError(60);for(var a=0,i=0;i(()=>{if(!ue.length){var e=null;if(f){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=g.readSync(n,r)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}e=t>0?r.slice(0,t).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;ue=de(e,!0)}return ue.shift()})(),put_char(e,r){null===r||10===r?(w(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(w(se(e.output,0)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(b(se(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(b(se(e.output,0)),e.output=[])}}},fe=e=>{e=((e,r)=>65536*Math.ceil(e/65536))(e);var r=Jr(65536,e);return r?((e,r)=>(x.fill(0,e,e+r),e))(r,e):0},pe={ops_table:null,mount:e=>pe.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ve.isBlkdev(t)||ve.isFIFO(t))throw new ve.ErrnoError(63);pe.ops_table||={dir:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,lookup:pe.node_ops.lookup,mknod:pe.node_ops.mknod,rename:pe.node_ops.rename,unlink:pe.node_ops.unlink,rmdir:pe.node_ops.rmdir,readdir:pe.node_ops.readdir,symlink:pe.node_ops.symlink},stream:{llseek:pe.stream_ops.llseek}},file:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:{llseek:pe.stream_ops.llseek,read:pe.stream_ops.read,write:pe.stream_ops.write,allocate:pe.stream_ops.allocate,mmap:pe.stream_ops.mmap,msync:pe.stream_ops.msync}},link:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr,readlink:pe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pe.node_ops.getattr,setattr:pe.node_ops.setattr},stream:ve.chrdev_stream_ops}};var o=ve.createNode(e,r,t,n);return ve.isDir(o.mode)?(o.node_ops=pe.ops_table.dir.node,o.stream_ops=pe.ops_table.dir.stream,o.contents={}):ve.isFile(o.mode)?(o.node_ops=pe.ops_table.file.node,o.stream_ops=pe.ops_table.file.stream,o.usedBytes=0,o.contents=null):ve.isLink(o.mode)?(o.node_ops=pe.ops_table.link.node,o.stream_ops=pe.ops_table.link.stream):ve.isChrdev(o.mode)&&(o.node_ops=pe.ops_table.chrdev.node,o.stream_ops=pe.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=ve.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,ve.isDir(e.mode)?r.size=4096:ve.isFile(e.mode)?r.size=e.usedBytes:ve.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&pe.resizeFileStorage(e,r.size)},lookup(e,r){throw ve.genericErrors[44]},mknod:(e,r,t,n)=>pe.createNode(e,r,t,n),rename(e,r,t){if(ve.isDir(e.mode)){var n;try{n=ve.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ve.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp,e.parent=r},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ve.lookupNode(e,r);for(var n in t.contents)throw new ve.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=pe.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ve.isLink(e.mode))throw new ve.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s0||t+r(pe.stream_ops.write(e,r,0,n,t,!1),0)}},ge=o.preloadPlugins||[],he=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ve={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,r={}){if(!(e=ae.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ve.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ve.root,o="/",a=0;a40)throw new ve.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ve.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n>>0)%ve.nameTable.length},hashAddNode(e){var r=ve.hashName(e.parent.id,e.name);e.name_next=ve.nameTable[r],ve.nameTable[r]=e},hashRemoveNode(e){var r=ve.hashName(e.parent.id,e.name);if(ve.nameTable[r]===e)ve.nameTable[r]=e.name_next;else for(var t=ve.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ve.mayLookup(e);if(t)throw new ve.ErrnoError(t,e);for(var n=ve.hashName(e.id,r),o=ve.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ve.lookup(e,r)},createNode(e,r,t,n){var o=new ve.FSNode(e,r,t,n);return ve.hashAddNode(o),o},destroyNode(e){ve.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ve.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup:e=>ve.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate(e,r){try{return ve.lookupNode(e,r),20}catch(e){}return ve.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ve.lookupNode(e,r)}catch(e){return e.errno}var o=ve.nodePermissions(e,"wx");if(o)return o;if(t){if(!ve.isDir(n.mode))return 54;if(ve.isRoot(n)||ve.getPath(n)===ve.cwd())return 10}else if(ve.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ve.isLink(e.mode)?32:ve.isDir(e.mode)&&("r"!==ve.flagsToPermissionString(r)||512&r)?31:ve.nodePermissions(e,ve.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ve.MAX_OPEN_FDS;e++)if(!ve.streams[e])return e;throw new ve.ErrnoError(33)},getStreamChecked(e){var r=ve.getStream(e);if(!r)throw new ve.ErrnoError(8);return r},getStream:e=>ve.streams[e],createStream:(e,r=-1)=>(ve.FSStream||(ve.FSStream=function(){this.shared={}},ve.FSStream.prototype={},Object.defineProperties(ve.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new ve.FSStream,e),-1==r&&(r=ve.nextfd()),e.fd=r,ve.streams[r]=e,e),closeStream(e){ve.streams[e]=null},chrdev_stream_ops:{open(e){var r=ve.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ve.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ve.devices[e]={stream_ops:r}},getDevice:e=>ve.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),ve.syncFSRequests++,ve.syncFSRequests>1&&b(`warning: ${ve.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ve.getMounts(ve.root.mount),n=0;function o(e){return ve.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach((r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)}))},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&ve.root)throw new ve.ErrnoError(10);if(!o&&!a){var i=ve.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ve.isMountpoint(n))throw new ve.ErrnoError(10);if(!ve.isDir(n.mode))throw new ve.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ve.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var r=ve.lookupPath(e,{follow_mount:!1});if(!ve.isMountpoint(r.node))throw new ve.ErrnoError(28);var t=r.node,n=t.mounted,o=ve.getMounts(n);Object.keys(ve.nameTable).forEach((e=>{for(var r=ve.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ve.destroyNode(r),r=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=ve.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new ve.ErrnoError(28);var a=ve.mayCreate(n,o);if(a)throw new ve.ErrnoError(a);if(!n.node_ops.mknod)throw new ve.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ve.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ve.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o(void 0===t&&(t=r,r=438),r|=8192,ve.mknod(e,r,t)),symlink(e,r){if(!ae.resolve(e))throw new ve.ErrnoError(44);var t=ve.lookupPath(r,{parent:!0}).node;if(!t)throw new ve.ErrnoError(44);var n=ne.basename(r),o=ve.mayCreate(t,n);if(o)throw new ve.ErrnoError(o);if(!t.node_ops.symlink)throw new ve.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=ne.dirname(e),a=ne.dirname(r),i=ne.basename(e),s=ne.basename(r);if(t=ve.lookupPath(e,{parent:!0}).node,n=ve.lookupPath(r,{parent:!0}).node,!t||!n)throw new ve.ErrnoError(44);if(t.mount!==n.mount)throw new ve.ErrnoError(75);var u,c=ve.lookupNode(t,i),l=ae.relative(e,a);if("."!==l.charAt(0))throw new ve.ErrnoError(28);if("."!==(l=ae.relative(r,o)).charAt(0))throw new ve.ErrnoError(55);try{u=ve.lookupNode(n,s)}catch(e){}if(c!==u){var d=ve.isDir(c.mode),m=ve.mayDelete(t,i,d);if(m)throw new ve.ErrnoError(m);if(m=u?ve.mayDelete(n,s,d):ve.mayCreate(n,s))throw new ve.ErrnoError(m);if(!t.node_ops.rename)throw new ve.ErrnoError(63);if(ve.isMountpoint(c)||u&&ve.isMountpoint(u))throw new ve.ErrnoError(10);if(n!==t&&(m=ve.nodePermissions(t,"w")))throw new ve.ErrnoError(m);ve.hashRemoveNode(c);try{t.node_ops.rename(c,n,s)}catch(e){throw e}finally{ve.hashAddNode(c)}}},rmdir(e){var r=ve.lookupPath(e,{parent:!0}).node,t=ne.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!0);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.rmdir)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.rmdir(r,t),ve.destroyNode(n)},readdir(e){var r=ve.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ve.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ve.lookupPath(e,{parent:!0}).node;if(!r)throw new ve.ErrnoError(44);var t=ne.basename(e),n=ve.lookupNode(r,t),o=ve.mayDelete(r,t,!1);if(o)throw new ve.ErrnoError(o);if(!r.node_ops.unlink)throw new ve.ErrnoError(63);if(ve.isMountpoint(n))throw new ve.ErrnoError(10);r.node_ops.unlink(r,t),ve.destroyNode(n)},readlink(e){var r=ve.lookupPath(e).node;if(!r)throw new ve.ErrnoError(44);if(!r.node_ops.readlink)throw new ve.ErrnoError(28);return ae.resolve(ve.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ve.lookupPath(e,{follow:!r}).node;if(!t)throw new ve.ErrnoError(44);if(!t.node_ops.getattr)throw new ve.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ve.stat(e,!0),chmod(e,r,t){var n;if(!(n="string"==typeof e?ve.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ve.chmod(e,r,!0)},fchmod(e,r){var t=ve.getStreamChecked(e);ve.chmod(t.node,r)},chown(e,r,t,n){var o;if(!(o="string"==typeof e?ve.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ve.chown(e,r,t,!0)},fchown(e,r,t){var n=ve.getStreamChecked(e);ve.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ve.ErrnoError(28);var t;if(!(t="string"==typeof e?ve.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ve.ErrnoError(63);if(ve.isDir(t.mode))throw new ve.ErrnoError(31);if(!ve.isFile(t.mode))throw new ve.ErrnoError(28);var n=ve.nodePermissions(t,"w");if(n)throw new ve.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ve.getStreamChecked(e);if(0==(2097155&t.flags))throw new ve.ErrnoError(28);ve.truncate(t.node,r)},utime(e,r,t){var n=ve.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ve.ErrnoError(44);var n;if(t=void 0===t?438:t,t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=ve.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var a=!1;if(64&r)if(n){if(128&r)throw new ve.ErrnoError(20)}else n=ve.mknod(e,t,0),a=!0;if(!n)throw new ve.ErrnoError(44);if(ve.isChrdev(n.mode)&&(r&=-513),65536&r&&!ve.isDir(n.mode))throw new ve.ErrnoError(54);if(!a){var i=ve.mayOpen(n,r);if(i)throw new ve.ErrnoError(i)}512&r&&!a&&ve.truncate(n,0),r&=-131713;var s=ve.createStream({node:n,path:ve.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!o.logReadFiles||1&r||(ve.readFiles||(ve.readFiles={}),e in ve.readFiles||(ve.readFiles[e]=1)),s},close(e){if(ve.isClosed(e))throw new ve.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ve.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ve.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ve.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(1==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.read)throw new ve.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new ve.ErrnoError(28);if(ve.isClosed(e))throw new ve.ErrnoError(8);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(ve.isDir(e.node.mode))throw new ve.ErrnoError(31);if(!e.stream_ops.write)throw new ve.ErrnoError(28);e.seekable&&1024&e.flags&&ve.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ve.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(ve.isClosed(e))throw new ve.ErrnoError(8);if(r<0||t<=0)throw new ve.ErrnoError(28);if(0==(2097155&e.flags))throw new ve.ErrnoError(8);if(!ve.isFile(e.node.mode)&&!ve.isDir(e.node.mode))throw new ve.ErrnoError(43);if(!e.stream_ops.allocate)throw new ve.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ve.ErrnoError(2);if(1==(2097155&e.flags))throw new ve.ErrnoError(2);if(!e.stream_ops.mmap)throw new ve.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,munmap:e=>0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new ve.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=ve.open(e,r.flags),o=ve.stat(e).size,a=new Uint8Array(o);return ve.read(n,a,0,o,0),"utf8"===r.encoding?t=se(a,0):"binary"===r.encoding&&(t=a),ve.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ve.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ce(r)+1),a=le(r,o,0,o.length);ve.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ve.write(n,r,0,r.byteLength,void 0,t.canOwn)}ve.close(n)},cwd:()=>ve.currentPath,chdir(e){var r=ve.lookupPath(e,{follow:!0});if(null===r.node)throw new ve.ErrnoError(44);if(!ve.isDir(r.node.mode))throw new ve.ErrnoError(54);var t=ve.nodePermissions(r.node,"x");if(t)throw new ve.ErrnoError(t);ve.currentPath=r.path},createDefaultDirectories(){ve.mkdir("/tmp"),ve.mkdir("/home"),ve.mkdir("/home/web_user")},createDefaultDevices(){ve.mkdir("/dev"),ve.registerDevice(ve.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ve.mkdev("/dev/null",ve.makedev(1,3)),me.register(ve.makedev(5,0),me.default_tty_ops),me.register(ve.makedev(6,0),me.default_tty1_ops),ve.mkdev("/dev/tty",ve.makedev(5,0)),ve.mkdev("/dev/tty1",ve.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=oe(e).byteLength),e[--r]);ve.createDevice("/dev","random",t),ve.createDevice("/dev","urandom",t),ve.mkdir("/dev/shm"),ve.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ve.mkdir("/proc");var e=ve.mkdir("/proc/self");ve.mkdir("/proc/self/fd"),ve.mount({mount(){var r=ve.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ve.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){o.stdin?ve.createDevice("/dev","stdin",o.stdin):ve.symlink("/dev/tty","/dev/stdin"),o.stdout?ve.createDevice("/dev","stdout",null,o.stdout):ve.symlink("/dev/tty","/dev/stdout"),o.stderr?ve.createDevice("/dev","stderr",null,o.stderr):ve.symlink("/dev/tty1","/dev/stderr"),ve.open("/dev/stdin",0),ve.open("/dev/stdout",1),ve.open("/dev/stderr",1)},ensureErrnoError(){ve.ErrnoError||(ve.ErrnoError=function(e,r){this.name="ErrnoError",this.node=r,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ve.ErrnoError.prototype=new Error,ve.ErrnoError.prototype.constructor=ve.ErrnoError,[44].forEach((e=>{ve.genericErrors[e]=new ve.ErrnoError(e),ve.genericErrors[e].stack=""})))},staticInit(){ve.ensureErrnoError(),ve.nameTable=new Array(4096),ve.mount(pe,{},"/"),ve.createDefaultDirectories(),ve.createDefaultDevices(),ve.createSpecialDirectories(),ve.filesystems={MEMFS:pe}},init(e,r,t){ve.init.initialized=!0,ve.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=r||o.stdout,o.stderr=t||o.stderr,ve.createStandardStreams()},quit(){ve.init.initialized=!1;for(var e=0;ethis.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter((e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):de(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&n||(i=n=1,n=this.getter(0).length,i=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:t};var u=ve.createFile(e,r,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s{var r=u.stream_ops[e];c[e]=function(){return ve.forceLoadFile(u),r.apply(null,arguments)}})),c.read=(e,r,t,n,o)=>(ve.forceLoadFile(u),l(e,r,t,n,o)),c.mmap=(e,r,t,n,o)=>{ve.forceLoadFile(u);var a=fe(r);if(!a)throw new ve.ErrnoError(48);return l(e,E,a,r,t),{ptr:a,allocated:!0}},u.stream_ops=c,u}},ye=(e,r)=>e?se(x,e,r):"",we={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(ne.isAbs(r))return r;var n;if(n=-100===e?ve.cwd():we.getStreamFromFD(e).path,0==r.length){if(!t)throw new ve.ErrnoError(44);return n}return ne.join2(n,r)},doStat(e,r,t){try{var n=e(r)}catch(e){if(e&&e.node&&ne.normalize(r)!==ne.normalize(ve.getPath(e.node)))return-54;throw e}L[t>>2]=n.dev,L[t+4>>2]=n.mode,C[t+8>>2]=n.nlink,L[t+12>>2]=n.uid,L[t+16>>2]=n.gid,L[t+20>>2]=n.rdev,q=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+24>>2]=q[0],L[t+28>>2]=q[1],L[t+32>>2]=4096,L[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return q=[Math.floor(o/1e3)>>>0,(W=Math.floor(o/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+40>>2]=q[0],L[t+44>>2]=q[1],C[t+48>>2]=o%1e3*1e3,q=[Math.floor(a/1e3)>>>0,(W=Math.floor(a/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+56>>2]=q[0],L[t+60>>2]=q[1],C[t+64>>2]=a%1e3*1e3,q=[Math.floor(i/1e3)>>>0,(W=Math.floor(i/1e3),+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+72>>2]=q[0],L[t+76>>2]=q[1],C[t+80>>2]=i%1e3*1e3,q=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[t+88>>2]=q[0],L[t+92>>2]=q[1],0},doMsync(e,r,t,n,o){if(!ve.isFile(r.node.mode))throw new ve.ErrnoError(43);if(2&n)return 0;var a=x.slice(e,e+t);ve.msync(r,a,o,t,n)},varargs:void 0,get(){var e=L[+we.varargs>>2];return we.varargs+=4,e},getp:()=>we.get(),getStr:e=>ye(e),getStreamFromFD:e=>ve.getStreamChecked(e)},be=e=>{_=e,te()||(o.onExit?.(e),F=!0),l(e,new re(e))},_e=(e,r)=>{_=e,be(e)},Ee=e=>{if(!F)try{e(),(()=>{if(!te())try{_e(_)}catch(e){ee(e)}})()}catch(e){ee(e)}},xe=(e,r)=>setTimeout((()=>{Ee(e)}),r),Se=e=>{Se.shown||={},Se.shown[e]||(Se.shown[e]=1,f&&(e="warning: "+e),b(e))},ke={mainLoop:{running:!1,scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause(){ke.mainLoop.scheduler=null,ke.mainLoop.currentlyRunningMainloop++},resume(){ke.mainLoop.currentlyRunningMainloop++;var e=ke.mainLoop.timingMode,r=ke.mainLoop.timingValue,t=ke.mainLoop.func;ke.mainLoop.func=null,((e,r,t,n,o)=>{T(!ke.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),ke.mainLoop.func=e,ke.mainLoop.arg=n;var a=ke.mainLoop.currentlyRunningMainloop;function i(){return!(a0){Date.now();var r=ke.mainLoop.queue.shift();if(r.func(r.arg),ke.mainLoop.remainingBlockers){var t=ke.mainLoop.remainingBlockers,n=t%1==0?t-1:Math.floor(t);r.counted?ke.mainLoop.remainingBlockers=n:(n+=.5,ke.mainLoop.remainingBlockers=(8*t+n)/9)}if(ke.mainLoop.updateStatus(),!i())return;setTimeout(ke.mainLoop.runner,0)}else i()&&(ke.mainLoop.currentFrameNumber=ke.mainLoop.currentFrameNumber+1|0,1==ke.mainLoop.timingMode&&ke.mainLoop.timingValue>1&&ke.mainLoop.currentFrameNumber%ke.mainLoop.timingValue!=0?ke.mainLoop.scheduler():(0==ke.mainLoop.timingMode&&(ke.mainLoop.tickStartTime=K()),gr.newRenderingFrameStarted(),ke.mainLoop.runIter(e),i()&&("object"==typeof SDL&&SDL.audio?.queueNewAudioData?.(),ke.mainLoop.scheduler())))}})(t,0,0,ke.mainLoop.arg),J(e,r),ke.mainLoop.scheduler()},updateStatus(){if(o.setStatus){var e=o.statusMessage||"Please wait...",r=ke.mainLoop.remainingBlockers,t=ke.mainLoop.expectedBlockers;r?r{T(i.complete,`Image ${r} could not be decoded`);var n=document.createElement("canvas");n.width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0),Ur[r]=n,URL.revokeObjectURL(a),t?.(e)},i.onerror=e=>{b(`Image ${a} could not be decoded`),n?.()},i.src=a}};ge.push(e);var r={canHandle:function(e){return!o.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,r,t,n){var o=!1;function a(n){o||(o=!0,Gr[r]=n,t?.(e))}var i=new Blob([e],{type:ke.getMimetype(r)}),s=URL.createObjectURL(i),u=new Audio;u.addEventListener("canplaythrough",(()=>a(u)),!1),u.onerror=function(t){o||(b(`warning: browser could not fully decode audio ${r}, trying slower base64 approach`),u.src="data:audio/x-"+r.substr(-3)+";base64,"+function(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="",n=0,o=0,a=0;a=6;){var i=n>>o-6&63;o-=6,t+=r[i]}return 2==o?(t+=r[(3&n)<<4],t+="=="):4==o&&(t+=r[(15&n)<<2],t+="="),t}(e),a(u))},u.src=s,xe((()=>{a(u)}),1e4)}};ge.push(r);var t=o.canvas;t&&(t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock||t.msRequestPointerLock||(()=>{}),t.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||(()=>{}),t.exitPointerLock=t.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),document.addEventListener("mspointerlockchange",n,!1),o.elementPointerLock&&t.addEventListener("click",(e=>{!ke.pointerLock&&o.canvas.requestPointerLock&&(o.canvas.requestPointerLock(),e.preventDefault())}),!1))}function n(){ke.pointerLock=document.pointerLockElement===o.canvas||document.mozPointerLockElement===o.canvas||document.webkitPointerLockElement===o.canvas||document.msPointerLockElement===o.canvas}},createContext(e,r,t,n){if(r&&o.ctx&&e==o.canvas)return o.ctx;var a,i;if(r){var s={antialias:!1,alpha:!1,majorVersion:"undefined"!=typeof WebGL2RenderingContext?2:1};if(n)for(var u in n)s[u]=n[u];void 0!==gr&&(i=gr.createContext(e,s))&&(a=gr.getContext(i).GLctx)}else a=e.getContext("2d");return a?(t&&(r||T(void 0===zr,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),o.ctx=a,r&&gr.makeContextCurrent(i),o.useWebGL=r,ke.moduleContextCreatedCallbacks.forEach((e=>e())),ke.init()),a):null},destroyContext(e,r,t){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen(e,r){ke.lockPointer=e,ke.resizeCanvas=r,void 0===ke.lockPointer&&(ke.lockPointer=!0),void 0===ke.resizeCanvas&&(ke.resizeCanvas=!1);var t=o.canvas;function n(){ke.isFullscreen=!1;var e=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.exitFullscreen=ke.exitFullscreen,ke.lockPointer&&t.requestPointerLock(),ke.isFullscreen=!0,ke.resizeCanvas?ke.setFullscreenCanvasSize():ke.updateCanvasDimensions(t)):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),ke.resizeCanvas?ke.setWindowedCanvasSize():ke.updateCanvasDimensions(t)),o.onFullScreen?.(ke.isFullscreen),o.onFullscreen?.(ke.isFullscreen)}ke.fullscreenHandlersInstalled||(ke.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");t.parentNode.insertBefore(a,t),a.appendChild(t),a.requestFullscreen=a.requestFullscreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullscreen?()=>a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):null)||(a.webkitRequestFullScreen?()=>a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT):null),a.requestFullscreen()},exitFullscreen:()=>!!ke.isFullscreen&&((document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||(()=>{})).apply(document,[]),!0),nextRAF:0,fakeRequestAnimationFrame(e){var r=Date.now();if(0===ke.nextRAF)ke.nextRAF=r+1e3/60;else for(;r+2>=ke.nextRAF;)ke.nextRAF+=1e3/60;var t=Math.max(ke.nextRAF-r,0);setTimeout(e,t)},requestAnimationFrame(e){"function"!=typeof requestAnimationFrame?(0,ke.fakeRequestAnimationFrame)(e):requestAnimationFrame(e)},safeSetTimeout:(e,r)=>xe(e,r),safeRequestAnimationFrame:e=>ke.requestAnimationFrame((()=>{Ee(e)})),getMimetype:e=>({jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]),getUserMedia(e){window.getUserMedia||=navigator.getUserMedia||navigator.mozGetUserMedia,window.getUserMedia(e)},getMovementX:e=>e.movementX||e.mozMovementX||e.webkitMovementX||0,getMovementY:e=>e.movementY||e.mozMovementY||e.webkitMovementY||0,getMouseWheelDelta(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail/3;break;case"mousewheel":r=e.wheelDelta/120;break;case"wheel":switch(r=e.deltaY,e.deltaMode){case 0:r/=100;break;case 1:r/=3;break;case 2:r*=80;break;default:throw"unrecognized mouse wheel delta mode: "+e.deltaMode}break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseCoords(e,r){var t=o.canvas.getBoundingClientRect(),n=o.canvas.width,a=o.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,s=void 0!==window.scrollY?window.scrollY:window.pageYOffset,u=e-(i+t.left),c=r-(s+t.top);return{x:u*=n/t.width,y:c*=a/t.height}},setMouseCoords(e,r){const{x:t,y:n}=ke.calculateMouseCoords(e,r);ke.mouseMovementX=t-ke.mouseX,ke.mouseMovementY=n-ke.mouseY,ke.mouseX=t,ke.mouseY=n},calculateMouseEvent(e){if(ke.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?ke.mouseMovementX=ke.mouseMovementY=0:(ke.mouseMovementX=ke.getMovementX(e),ke.mouseMovementY=ke.getMovementY(e)),"undefined"!=typeof SDL?(ke.mouseX=SDL.mouseX+ke.mouseMovementX,ke.mouseY=SDL.mouseY+ke.mouseMovementY):(ke.mouseX+=ke.mouseMovementX,ke.mouseY+=ke.mouseMovementY);else{if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var r=e.touch;if(void 0===r)return;var t=ke.calculateMouseCoords(r.pageX,r.pageY);if("touchstart"===e.type)ke.lastTouches[r.identifier]=t,ke.touches[r.identifier]=t;else if("touchend"===e.type||"touchmove"===e.type){var n=ke.touches[r.identifier];n||=t,ke.lastTouches[r.identifier]=n,ke.touches[r.identifier]=t}return}ke.setMouseCoords(e.pageX,e.pageY)}},resizeListeners:[],updateResizeListeners(){var e=o.canvas;ke.resizeListeners.forEach((r=>r(e.width,e.height)))},setCanvasSize(e,r,t){var n=o.canvas;ke.updateCanvasDimensions(n,e,r),t||ke.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e|=8388608,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},setWindowedCanvasSize(){if("undefined"!=typeof SDL){var e=C[SDL.screen>>2];e&=-8388609,L[SDL.screen>>2]=e}ke.updateCanvasDimensions(o.canvas),ke.updateResizeListeners()},updateCanvasDimensions(e,r,t){r&&t?(e.widthNative=r,e.heightNative=t):(r=e.widthNative,t=e.heightNative);var n=r,a=t;if(o.forcedAspectRatio&&o.forcedAspectRatio>0&&(n/a{for(;e.length>0;)e.shift()(o)},Ce=o.noExitRuntime||!0;function Be(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){C[this.ptr+4>>2]=e},this.get_type=function(){return C[this.ptr+4>>2]},this.set_destructor=function(e){C[this.ptr+8>>2]=e},this.get_destructor=function(){return C[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,E[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=E[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,E[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=E[this.ptr+13>>0]},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){C[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return C[this.ptr+16>>2]},this.get_exception_ptr=function(){if(at(this.get_type()))return C[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Pe,Fe,Te=e=>(L[Kr()>>2]=e,e),Ae=e=>{for(var r="",t=e;x[t];)r+=Pe[x[t++]];return r},De={},Me={},Ie={},Ve=e=>{throw new Fe(e)};function Re(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ve(`type "${n}" must have a positive integer typeid pointer`),Me.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ve(`Cannot register type '${n}' twice`)}if(Me[e]=r,delete Ie[e],De.hasOwnProperty(e)){var o=De[e];delete De[e],o.forEach((e=>e()))}}(e,r,t)}function Oe(){this.allocated=[void 0],this.freelist=[]}var ze=new Oe,Ue=e=>{e>=ze.reserved&&0==--ze.get(e).refcount&&ze.free(e)},Ge={toValue:e=>(e||Ve("Cannot use deleted val. handle = "+e),ze.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ze.allocate({refcount:1,value:e})}}};function Ne(e){return this.fromWireType(L[e>>2])}var je=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(B[e>>2])};case 8:return function(e){return this.fromWireType(P[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},He=(e,r,t)=>{switch(r){case 1:return t?e=>E[e>>0]:e=>x[e>>0];case 2:return t?e=>S[e>>1]:e=>k[e>>1];case 4:return t?e=>L[e>>2]:e=>C[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function We(e){return this.fromWireType(C[e>>2])}var qe=(e,r,t)=>le(e,x,r,t),Ye="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Xe=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&k[n];)++n;if((t=n<<1)-e>32&&Ye)return Ye.decode(x.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=S[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},$e=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=i,r+=2}return S[r>>1]=0,r-n},Qe=e=>2*e.length,Ke=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=L[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Ze=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),L[r>>2]=i,(r+=4)+4>o)break}return L[r>>2]=0,r-n},Je=e=>{for(var r=0,t=0;t=55296&&n<=57343&&++t,r+=4}return r},er=(e,r)=>{var t,n,o=Me[e];return void 0===o&&Ve(r+" has unknown type "+(t=Zr(e),n=Ae(t),$r(t),n)),o},rr={},tr=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN,nr=e=>e%4==0&&(e%100!=0||e%400==0),or=[0,31,60,91,121,152,182,213,244,274,305,335],ar=[0,31,59,90,120,151,181,212,243,273,304,334],ir=e=>(nr(e.getFullYear())?or:ar)[e.getMonth()]+e.getDate()-1,sr=e=>{var r=ce(e)+1,t=Qr(r);return t&&qe(e,t,r),t},ur=[],cr=e=>{var r=(e-y.buffer.byteLength+65535)/65536;try{return y.grow(r),A(),1}catch(e){}},lr=e=>(N("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),dr={},mr=e=>{e.forEach((e=>{var r=lr();r&&(dr[r]=e)}))};function fr(){var e=new Error;if(!e.stack){try{throw new Error}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}var pr,gr={counter:1,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],byteSizeByTypeRoot:5120,byteSizeByType:[1,1,2,2,4,4,4,2,3,4,8],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(e){gr.lastError||(gr.lastError=e)},getNewId:e=>{for(var r=gr.counter++,t=e.length;t32-Math.clz32(0===e?0:e-1),generateTempBuffers:(e,r)=>{var t=gr.log2ceilLookup(gr.MAX_TEMP_BUFFER_SIZE);r.tempVertexBufferCounters1=[],r.tempVertexBufferCounters2=[],r.tempVertexBufferCounters1.length=r.tempVertexBufferCounters2.length=t+1,r.tempVertexBuffers1=[],r.tempVertexBuffers2=[],r.tempVertexBuffers1.length=r.tempVertexBuffers2.length=t+1,r.tempIndexBuffers=[],r.tempIndexBuffers.length=t+1;for(var n=0;n<=t;++n){r.tempIndexBuffers[n]=null,r.tempVertexBufferCounters1[n]=r.tempVertexBufferCounters2[n]=0;var o=gr.numTempVertexBuffersPerSize;r.tempVertexBuffers1[n]=[],r.tempVertexBuffers2[n]=[];var a=r.tempVertexBuffers1[n],i=r.tempVertexBuffers2[n];a.length=i.length=o;for(var s=0;s>1,c=new Uint16Array(u),l=(n=0,0);c[n++]=l,!(n>=u||(c[n++]=l+1,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l,n>=u)||(c[n++]=l+2,n>=u)||(c[n++]=l+3,n>=u));)l+=4;r.GLctx.bufferData(34963,c,35044),r.GLctx.bindBuffer(34963,null)}},getTempVertexBuffer:function(e){var r=gr.log2ceilLookup(e),t=gr.currentContext.tempVertexBuffers1[r],n=gr.currentContext.tempVertexBufferCounters1[r];gr.currentContext.tempVertexBufferCounters1[r]=gr.currentContext.tempVertexBufferCounters1[r]+1&gr.numTempVertexBuffersPerSize-1;var o=t[n];if(o)return o;var a=zr.getParameter(34964);return t[n]=zr.createBuffer(),zr.bindBuffer(34962,t[n]),zr.bufferData(34962,1<{for(var o="",a=0;a>2]:-1;o+=ye(L[t+4*a>>2],i<0?void 0:i)}return o},calcBufLength:function(e,r,t,n){return t>0?n*t:e*gr.byteSizeByType[r-gr.byteSizeByTypeRoot]*n},usedTempBuffers:[],preDrawHandleClientVertexAttribBindings:function(e){gr.resetBufferBinding=!1;for(var r=0;r{e.getContextSafariWebGL2Fixed||(e.getContextSafariWebGL2Fixed=e.getContext,e.getContext=function(r,t){var n=e.getContextSafariWebGL2Fixed(r,t);return"webgl"==r==n instanceof WebGLRenderingContext?n:null});var t=r.majorVersion>1?e.getContext("webgl2",r):e.getContext("webgl",r);if(!t)return 0;var n=gr.registerContext(t,r),o=t.getSupportedExtensions,a=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_disjoint_timer_query","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_depth_texture","WEBGL_draw_buffers","EXT_color_buffer_float","EXT_disjoint_timer_query_webgl2","EXT_texture_norm16","WEBGL_clip_cull_distance","EXT_color_buffer_half_float","EXT_float_blend","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","KHR_parallel_shader_compile","OES_texture_float_linear","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_lose_context","WEBGL_multi_draw"];return t.getSupportedExtensions=function(){return(o.apply(this)||[]).filter((e=>a.includes(e)))},n},registerContext:(e,r)=>{var t=gr.getNewId(gr.contexts),n={handle:t,attributes:r,version:r.majorVersion,GLctx:e};e.canvas&&(e.canvas.GLctxObject=n),gr.contexts[t]=n,(void 0===r.enableExtensionsByDefault||r.enableExtensionsByDefault)&&gr.initExtensions(n),n.maxVertexAttribs=n.GLctx.getParameter(34921),n.clientBuffers=[];for(var o=0;o(gr.currentContext=gr.contexts[e],o.ctx=zr=gr.currentContext?.GLctx,!(e&&!zr)),getContext:e=>gr.contexts[e],deleteContext:e=>{gr.currentContext===gr.contexts[e]&&(gr.currentContext=null),"object"==typeof hr&&hr.removeAllHandlersOnTarget(gr.contexts[e].GLctx.canvas),gr.contexts[e]&&gr.contexts[e].GLctx.canvas&&(gr.contexts[e].GLctx.canvas.GLctxObject=void 0),gr.contexts[e]=null},initExtensions:e=>{if(e||=gr.currentContext,!e.initExtensionsDone){e.initExtensionsDone=!0;var r,t=e.GLctx;(e=>{var r=e.getExtension("ANGLE_instanced_arrays");r&&(e.vertexAttribDivisor=(e,t)=>r.vertexAttribDivisorANGLE(e,t),e.drawArraysInstanced=(e,t,n,o)=>r.drawArraysInstancedANGLE(e,t,n,o),e.drawElementsInstanced=(e,t,n,o,a)=>r.drawElementsInstancedANGLE(e,t,n,o,a))})(t),(e=>{var r=e.getExtension("OES_vertex_array_object");r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.deleteVertexArray=e=>r.deleteVertexArrayOES(e),e.bindVertexArray=e=>r.bindVertexArrayOES(e),e.isVertexArray=e=>r.isVertexArrayOES(e))})(t),(e=>{var r=e.getExtension("WEBGL_draw_buffers");r&&(e.drawBuffers=(e,t)=>r.drawBuffersWEBGL(e,t))})(t),(r=t).dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"),(e=>{e.mdibvbi=e.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance")})(t),e.version>=2&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query_webgl2")),(e.version<2||!t.disjointTimerQueryExt)&&(t.disjointTimerQueryExt=t.getExtension("EXT_disjoint_timer_query")),(e=>{e.multiDrawWebgl=e.getExtension("WEBGL_multi_draw")})(t),(t.getSupportedExtensions()||[]).forEach((e=>{e.includes("lose_context")||e.includes("debug")||t.getExtension(e)}))}},getExtensions(){var e=zr.getSupportedExtensions()||[];return e.concat(e.map((e=>"GL_"+e)))}},hr={inEventHandler:0,removeAllEventListeners(){for(var e=hr.eventHandlers.length-1;e>=0;--e)hr._removeHandler(e);hr.eventHandlers=[],hr.deferredCalls=[]},registerRemoveEventListeners(){hr.removeEventListenersRegistered||(I.push(hr.removeAllEventListeners),hr.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall(e,r,t){function n(e,r){if(e.length!=r.length)return!1;for(var t in e)if(e[t]!=r[t])return!1;return!0}for(var o in hr.deferredCalls){var a=hr.deferredCalls[o];if(a.targetFunction==e&&n(a.argsList,t))return}hr.deferredCalls.push({targetFunction:e,precedence:r,argsList:t}),hr.deferredCalls.sort(((e,r)=>e.precedencenavigator.userActivation?navigator.userActivation.isActive:hr.inEventHandler&&hr.currentEventHandler.allowsDeferredCalls,runDeferredCalls(){if(hr.canPerformEventHandlerRequests())for(var e=0;e{for(var t=0;te?e==window?"#window":e==screen?"#screen":e?.nodeName||"":"",fullscreenEnabled:()=>document.fullscreenEnabled||document.webkitFullscreenEnabled},vr=["default","low-power","high-performance"],yr=[0,"undefined"!=typeof document?document:0,"undefined"!=typeof window?window:0],wr=e=>("number"==typeof e&&(e=ye(e)),e&&"#canvas"!==e?void 0!==gr&&gr.offscreenCanvases[e]?gr.offscreenCanvases[e]:(e=>{try{return e?("number"==typeof e&&(e=yr[e]||ye(e)),"#window"===e?window:"#document"===e?document:"#screen"===e?screen:"#canvas"===e?o.canvas:"string"==typeof e?document.getElementById(e):e):window}catch(e){return null}})(e):void 0!==gr&&gr.offscreenCanvases.canvas?gr.offscreenCanvases.canvas:o.canvas),br=e=>{var r=ce(e)+1,t=ot(r);return qe(e,t,r),t},_r=[],Er={errorCallback:(e,r,t,n)=>{var o,a;o=()=>{var o,a,i=br(t);((a=_r[o=e])||(o>=_r.length&&(_r.length=o+1),_r[o]=a=pr.get(o)),a)(r,i,n)},a=tt(),o(),nt(a)},initManagers:()=>{function e(){this.objects={},this.nextId=1,this.create=function(e,r={}){var t=this.nextId++;return r.refcount=1,r.object=e,this.objects[t]=r,t},this.get=function(e){if(e)return this.objects[e].object},this.reference=function(e){this.objects[e].refcount++},this.release=function(e){var r=this.objects[e];r.refcount--,r.refcount<=0&&delete this.objects[e]}}Er.mgrDevice||(Er.mgrSurface=Er.mgrSurface||new e,Er.mgrSwapChain=Er.mgrSwapChain||new e,Er.mgrAdapter=Er.mgrAdapter||new e,Er.mgrDevice=Er.mgrDevice||new e,Er.mgrQueue=Er.mgrQueue||new e,Er.mgrCommandBuffer=Er.mgrCommandBuffer||new e,Er.mgrCommandEncoder=Er.mgrCommandEncoder||new e,Er.mgrRenderPassEncoder=Er.mgrRenderPassEncoder||new e,Er.mgrComputePassEncoder=Er.mgrComputePassEncoder||new e,Er.mgrBindGroup=Er.mgrBindGroup||new e,Er.mgrBuffer=Er.mgrBuffer||new e,Er.mgrSampler=Er.mgrSampler||new e,Er.mgrTexture=Er.mgrTexture||new e,Er.mgrTextureView=Er.mgrTextureView||new e,Er.mgrQuerySet=Er.mgrQuerySet||new e,Er.mgrBindGroupLayout=Er.mgrBindGroupLayout||new e,Er.mgrPipelineLayout=Er.mgrPipelineLayout||new e,Er.mgrRenderPipeline=Er.mgrRenderPipeline||new e,Er.mgrComputePipeline=Er.mgrComputePipeline||new e,Er.mgrShaderModule=Er.mgrShaderModule||new e,Er.mgrRenderBundleEncoder=Er.mgrRenderBundleEncoder||new e,Er.mgrRenderBundle=Er.mgrRenderBundle||new e)},makeColor:e=>({r:P[e>>3],g:P[e+8>>3],b:P[e+16>>3],a:P[e+24>>3]}),makeExtent3D:e=>({width:C[e>>2],height:C[e+4>>2],depthOrArrayLayers:C[e+8>>2]}),makeOrigin3D:e=>({x:C[e>>2],y:C[e+4>>2],z:C[e+8>>2]}),makeImageCopyTexture:e=>({texture:Er.mgrTexture.get(C[e+4>>2]),mipLevel:C[e+8>>2],origin:Er.makeOrigin3D(e+12),aspect:Er.TextureAspect[C[e+24>>2]]}),makeTextureDataLayout:e=>{var r=C[e+16>>2],t=C[e+20>>2];return{offset:4294967296*C[e+4+8>>2]+C[e+8>>2],bytesPerRow:4294967295===r?void 0:r,rowsPerImage:4294967295===t?void 0:t}},makeImageCopyBuffer:e=>{var r=e+8,t=Er.makeTextureDataLayout(r);return t.buffer=Er.mgrBuffer.get(C[e+32>>2]),t},makePipelineConstants:(e,r)=>{if(e){for(var t={},n=0;n>2])]=P[o+8>>3]}return t}},makePipelineLayout:e=>e?Er.mgrPipelineLayout.get(e):"auto",makeProgrammableStageDescriptor:e=>{if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}},BufferMapState:["unmapped","pending","mapped"],CompilationMessageType:["error","warning","info"],DeviceLostReason:{undefined:0,destroyed:1},PreferredFormat:{rgba8unorm:18,bgra8unorm:23},AddressMode:["repeat","mirror-repeat","clamp-to-edge"],BlendFactor:["zero","one","src","one-minus-src","src-alpha","one-minus-src-alpha","dst","one-minus-dst","dst-alpha","one-minus-dst-alpha","src-alpha-saturated","constant","one-minus-constant"],BlendOperation:["add","subtract","reverse-subtract","min","max"],BufferBindingType:[,"uniform","storage","read-only-storage"],CompareFunction:[,"never","less","less-equal","greater","greater-equal","equal","not-equal","always"],CompilationInfoRequestStatus:["success","error","device-lost","unknown"],CullMode:["none","front","back"],ErrorFilter:["validation","out-of-memory","internal"],FeatureName:[,"depth-clip-control","depth32float-stencil8","timestamp-query","texture-compression-bc","texture-compression-etc2","texture-compression-astc","indirect-first-instance","shader-f16","rg11b10ufloat-renderable","bgra8unorm-storage","float32filterable"],FilterMode:["nearest","linear"],FrontFace:["ccw","cw"],IndexFormat:[,"uint16","uint32"],LoadOp:[,"clear","load"],MipmapFilterMode:["nearest","linear"],PowerPreference:[,"low-power","high-performance"],PrimitiveTopology:["point-list","line-list","line-strip","triangle-list","triangle-strip"],QueryType:["occlusion","timestamp"],SamplerBindingType:[,"filtering","non-filtering","comparison"],StencilOperation:["keep","zero","replace","invert","increment-clamp","decrement-clamp","increment-wrap","decrement-wrap"],StorageTextureAccess:[,"write-only"],StoreOp:[,"store","discard"],TextureAspect:["all","stencil-only","depth-only"],TextureDimension:["1d","2d","3d"],TextureFormat:[,"r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32float","r32uint","r32sint","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb10a2unorm","rg11b10ufloat","rgb9e5ufloat","rg32float","rg32uint","rg32sint","rgba16uint","rgba16sint","rgba16float","rgba32float","rgba32uint","rgba32sint","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb","etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm","astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"],TextureSampleType:[,"float","unfilterable-float","depth","sint","uint"],TextureViewDimension:[,"1d","2d","2d-array","cube","cube-array","3d"],VertexFormat:[,"uint8x2","uint8x4","sint8x2","sint8x4","unorm8x2","unorm8x4","snorm8x2","snorm8x4","uint16x2","uint16x4","sint16x2","sint16x4","unorm16x2","unorm16x4","snorm16x2","snorm16x4","float16x2","float16x4","float32","float32x2","float32x3","float32x4","uint32","uint32x2","uint32x3","uint32x4","sint32","sint32x2","sint32x3","sint32x4"],VertexStepMode:["vertex","instance"],FeatureNameString2Enum:{undefined:"0","depth-clip-control":"1","depth32float-stencil8":"2","timestamp-query":"3","texture-compression-bc":"4","texture-compression-etc2":"5","texture-compression-astc":"6","indirect-first-instance":"7","shader-f16":"8","rg11b10ufloat-renderable":"9","bgra8unorm-storage":"10",float32filterable:"11"}},xr={values:{},next_id:1,add(e){var r;do{r=xr.next_id++,xr.next_id>2147483647&&(xr.next_id=1)}while(r in xr.values);return xr.values[r]=e,r},remove(e){delete xr.values[e]},get:e=>xr.values[e]},Sr={},kr=()=>{if(!kr.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:c||"./this.program"};for(var r in Sr)void 0===Sr[r]?delete e[r]:e[r]=Sr[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);kr.strings=t}return kr.strings},Lr=[],Cr=(e,r,t,n)=>{for(var o=0;o>2]=i}},Br=e=>"]"==e.slice(-1)&&e.lastIndexOf("["),Pr=e=>0==(e-=5120)?E:1==e?x:2==e?S:4==e?L:6==e?B:5==e||28922==e||28520==e||30779==e||30782==e?C:k,Fr=e=>31-Math.clz32(e.BYTES_PER_ELEMENT),Tr=(e,r,t,n,o,a)=>{var i=Pr(e),s=Fr(i),u=1<({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[e-6402]||1))(r)*u,l=((e,r,t,n)=>{var o;return r*(e*t+(o=n)-1&-o)})(t,n,c,gr.unpackAlignment);return i.subarray(o>>s,o+l>>s)},Ar=e=>{var r=zr.currentProgram;if(r){var t=r.uniformLocsById[e];return"number"==typeof t&&(r.uniformLocsById[e]=t=zr.getUniformLocation(r,r.uniformArrayNamesById[e]+(t>0?`[${t}]`:""))),t}gr.recordError(1282)},Dr=[],Mr=[],Ir=[31,29,31,30,31,30,31,31,30,31,30,31],Vr=[31,28,31,30,31,30,31,31,30,31,30,31],Rr=(e,r)=>{E.set(e,r)},Or=(e,r,t,n)=>{var o=C[n+40>>2],a={tm_sec:L[n>>2],tm_min:L[n+4>>2],tm_hour:L[n+8>>2],tm_mday:L[n+12>>2],tm_mon:L[n+16>>2],tm_year:L[n+20>>2],tm_wday:L[n+24>>2],tm_yday:L[n+28>>2],tm_isdst:L[n+32>>2],tm_gmtoff:L[n+36>>2],tm_zone:o?ye(o):""},i=ye(t),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)i=i.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(e,r,t){for(var n="number"==typeof e?e.toString():e||"";n.length0?1:0}var n;return 0===(n=t(e.getFullYear()-r.getFullYear()))&&0===(n=t(e.getMonth()-r.getMonth()))&&(n=t(e.getDate()-r.getDate())),n}function p(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var r=((e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=nr(t.getFullYear()),o=t.getMonth(),a=(n?Ir:Vr)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t})(new Date(e.tm_year+1900,0,1),e.tm_yday),t=new Date(r.getFullYear(),0,4),n=new Date(r.getFullYear()+1,0,4),o=p(t),a=p(n);return f(o,r)<=0?f(a,r)<=0?r.getFullYear()+1:r.getFullYear():r.getFullYear()-1}var h={"%a":e=>c[e.tm_wday].substring(0,3),"%A":e=>c[e.tm_wday],"%b":e=>l[e.tm_mon].substring(0,3),"%B":e=>l[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>d(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var r=e.tm_hour;return 0==r?r=12:r>12&&(r-=12),m(r,2)},"%j":e=>m(e.tm_mday+((e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t})(nr(e.tm_year+1900)?Ir:Vr,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var r=e.tm_yday+7-e.tm_wday;return m(Math.floor(r/7),2)},"%V":e=>{var r=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&r++,r){if(53==r){var t=(e.tm_wday+371-e.tm_yday)%7;4==t||3==t&&nr(e.tm_year)||(r=1)}}else{r=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&nr(e.tm_year%400-1))&&r++}return m(r,2)},"%w":e=>e.tm_wday,"%W":e=>{var r=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(r/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var r=e.tm_gmtoff,t=r>=0;return r=(r=Math.abs(r)/60)/60*100+r%60,(t?"+":"-")+String("0000"+r).slice(-4)},"%Z":e=>e.tm_zone,"%%":()=>"%"};for(var u in i=i.replace(/%%/g,"\0\0"),h)i.includes(u)&&(i=i.replace(new RegExp(u,"g"),h[u](a)));var v=de(i=i.replace(/\0\0/g,"%"),!1);return v.length>r?0:(Rr(v,e),v.length-1)};o.requestFullscreen=ke.requestFullscreen,o.requestAnimationFrame=ke.requestAnimationFrame,o.setCanvasSize=ke.setCanvasSize,o.pauseMainLoop=ke.mainLoop.pause,o.resumeMainLoop=ke.mainLoop.resume,o.getUserMedia=ke.getUserMedia,o.createContext=ke.createContext;var zr,Ur={},Gr={},Nr=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ve.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n};Object.defineProperties(Nr.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return ve.isDir(this.mode)}},isDevice:{get:function(){return ve.isChrdev(this.mode)}}}),ve.FSNode=Nr,ve.createPreloadedFile=(e,r,t,n,o,a,s,u,c,l)=>{var d=r?ae.resolve(ne.join2(e,r)):e;function m(t){function i(t){l?.(),u||((e,r,t,n,o,a)=>{ve.createDataFile(e,r,t,n,o,a)})(e,r,t,n,o,c),a?.(),G()}((e,r,t,n)=>{void 0!==ke&&ke.init();var o=!1;return ge.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,d,i,(()=>{s?.(),G()}))||i(t)}U(),"string"==typeof t?((e,r,t,n)=>{var o=`al ${e}`;i(e,(r=>{T(r,`Loading data file "${e}" failed (no arrayBuffer).`),m(new Uint8Array(r)),o&&G()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),o&&U()})(t,0,s):m(t)},ve.staticInit(),o.FS_createPath=ve.createPath,o.FS_createDataFile=ve.createDataFile,o.FS_createPreloadedFile=ve.createPreloadedFile,o.FS_unlink=ve.unlink,o.FS_createLazyFile=ve.createLazyFile,o.FS_createDevice=ve.createDevice,(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Pe=e})(),Fe=o.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},o.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(Oe.prototype,{get(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var r=this.freelist.pop()||this.allocated.length;return this.allocated[r]=e,r},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),ze.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),ze.reserved=ze.allocated.length,o.count_emval_handles=()=>{for(var e=0,r=ze.reserved;r({data:new s(i?o.HEAPU8.slice(e,e+r).buffer:o.HEAPU8.buffer,e,t*n*a),width:t,height:n}))},t:function(){o._wrapSimpleListenerOutput||(o._wrapSimpleListenerOutput=(e,...r)=>{if(o.simpleListeners){const t=ye(e);o.simpleListeners[t]&&o.simpleListeners[t](...r)}}),o._wrapEmptyPacketListenerOutput||(o._wrapEmptyPacketListenerOutput=(e,r)=>{if(o.emptyPacketListeners){const t=ye(e);o.emptyPacketListeners[t]&&o.emptyPacketListeners[t](r)}})},Ha:function(){return o&&o.gpuOriginForWebTexturesIsBottomLeft},j:(e,r,t)=>{throw new Be(e).init(r,t),e},Ga:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 0:if((o=we.get())<0)return-28;for(;ve.streams[o];)o++;return ve.createStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=we.get();return n.flags|=o,0;case 12:return o=we.getp(),S[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return Te(28),-1}}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Mc:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=we.getp();L[a>>2]=o.c_iflag||0,L[a+4>>2]=o.c_oflag||0,L[a+8>>2]=o.c_cflag||0,L[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)E[a+i+17>>0]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=we.getp();var s=L[a>>2],u=L[a+4>>2],c=L[a+8>>2],l=L[a+12>>2],d=[];for(i=0;i<32;i++)d.push(E[a+i+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(a=we.getp(),L[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=we.getp(),ve.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var m=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=we.getp(),S[a>>1]=m[0],S[a+2>>1]=m[1]}return 0;default:return-28}}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Fa:function(e,r,t,n){we.varargs=n;try{r=we.getStr(r),r=we.calculateAt(e,r);var o=n?we.get():0;return ve.open(r,t,o).fd}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Lc:function(e,r){try{return e=we.getStr(e),we.doStat(ve.stat,e,r)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Tb:(e,r,t,n,o)=>{},Gc:(e,r,t,n)=>{Re(e,{name:r=Ae(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(x[e])},destructorFunction:null})},Fc:(e,r)=>{Re(e,{name:r=Ae(r),fromWireType:e=>{var r=Ge.toValue(e);return Ue(e),r},toWireType:(e,r)=>Ge.toHandle(r),argPackAdvance:8,readValueFromPointer:Ne,destructorFunction:null})},Da:(e,r,t)=>{Re(e,{name:r=Ae(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:8,readValueFromPointer:je(r,t),destructorFunction:null})},E:(e,r,t,n,o)=>{r=Ae(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<>>i}var s=r.includes("unsigned");Re(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:8,readValueFromPointer:He(r,t,0!==n),destructorFunction:null})},o:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=C[e>>2],t=C[e+4>>2];return new n(E.buffer,t,r)}Re(e,{name:t=Ae(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ca:(e,r)=>{var t="std::string"===(r=Ae(r));Re(e,{name:r,fromWireType(e){var r,n=C[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==x[s]){var u=ye(a,s-a);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),a=s+1}}else{var c=new Array(n);for(i=0;i>2]=n,t&&o)qe(r,i,n+1);else if(o)for(var s=0;s255&&($r(i),Ve("String has UTF-16 code units that do not fit in 8 bits")),x[i+s]=u}else for(s=0;s{var n,o,a,i,s;t=Ae(t),2===r?(n=Xe,o=$e,i=Qe,a=()=>k,s=1):4===r&&(n=Ke,o=Ze,i=Je,a=()=>C,s=2),Re(e,{name:t,fromWireType:e=>{for(var t,o=C[e>>2],i=a(),u=e+4,c=0;c<=o;++c){var l=e+4+c*r;if(c==o||0==i[l>>s]){var d=n(u,l-u);void 0===t?t=d:(t+=String.fromCharCode(0),t+=d),u=l+r}}return $r(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Ve(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),u=Qr(4+a+r);return C[u>>2]=a>>s,o(n,u+4,a+r),null!==e&&e.push($r,u),u},argPackAdvance:8,readValueFromPointer:Ne,destructorFunction(e){$r(e)}})},Ec:(e,r)=>{Re(e,{isVoid:!0,name:r=Ae(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},Dc:()=>1,ga:(e,r,t)=>(e=Ge.toValue(e),((e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(C[r>>2]=Ge.toHandle(n)),o})(r=er(r,"emval::as"),t,e)),u:Ue,Ba:(e,r)=>(e=Ge.toValue(e),r=Ge.toValue(r),Ge.toHandle(e[r])),Cc:e=>{e>4&&(ze.get(e).refcount+=1)},ca:e=>{return Ge.toHandle(void 0===(t=rr[r=e])?Ae(r):t);var r,t},fa:e=>{(e=>{for(;e.length;){var r=e.pop();e.pop()(r)}})(Ge.toValue(e)),Ue(e)},Aa:(e,r,t)=>{e=Ge.toValue(e),r=Ge.toValue(r),t=Ge.toValue(t),e[r]=t},ba:(e,r)=>{var t=(e=er(e,"_emval_take_value")).readValueFromPointer(r);return Ge.toHandle(t)},Bc:e=>(e=Ge.toValue(e),Ge.toHandle(typeof e)),Sb:function(e,r,t){var n=tr(e,r),o=new Date(1e3*n);L[t>>2]=o.getUTCSeconds(),L[t+4>>2]=o.getUTCMinutes(),L[t+8>>2]=o.getUTCHours(),L[t+12>>2]=o.getUTCDate(),L[t+16>>2]=o.getUTCMonth(),L[t+20>>2]=o.getUTCFullYear()-1900,L[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;L[t+28>>2]=i},Rb:function(e,r,t){var n=tr(e,r),o=new Date(1e3*n);L[t>>2]=o.getSeconds(),L[t+4>>2]=o.getMinutes(),L[t+8>>2]=o.getHours(),L[t+12>>2]=o.getDate(),L[t+16>>2]=o.getMonth(),L[t+20>>2]=o.getFullYear()-1900,L[t+24>>2]=o.getDay();var a=0|ir(o);L[t+28>>2]=a,L[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));L[t+32>>2]=c},Qb:function(e){var r=(()=>{var r=new Date(L[e+20>>2]+1900,L[e+16>>2],L[e+12>>2],L[e+8>>2],L[e+4>>2],L[e>>2],0),t=L[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)L[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var u=Math.max(i,a),c=t>0?s:u;r.setTime(r.getTime()+6e4*(c-n))}L[e+24>>2]=r.getDay();var l=0|ir(r);L[e+28>>2]=l,L[e>>2]=r.getSeconds(),L[e+4>>2]=r.getMinutes(),L[e+8>>2]=r.getHours(),L[e+12>>2]=r.getDate(),L[e+16>>2]=r.getMonth(),L[e+20>>2]=r.getYear();var d=r.getTime();return isNaN(d)?(Te(61),-1):d/1e3})();return rt((W=r,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)),r>>>0},Pb:function(e,r,t,n,o,a,i,s){var u=tr(o,a);try{if(isNaN(u))return 61;var c=we.getStreamFromFD(n),l=ve.mmap(c,e,u,r,t),d=l.ptr;return L[i>>2]=l.allocated,C[s>>2]=d,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Ob:function(e,r,t,n,o,a,i){var s=tr(a,i);try{if(isNaN(s))return 61;var u=we.getStreamFromFD(o);2&t&&we.doMsync(e,u,r,n,s),ve.munmap(u)}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return-e.errno}},Ac:(e,r,t)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),s=a.getTimezoneOffset(),u=Math.max(i,s);function c(e){var r=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return r?r[1]:"GMT"}C[e>>2]=60*u,L[r>>2]=Number(i!=s);var l=c(o),d=c(a),m=sr(l),f=sr(d);s>2]=m,C[t+4>>2]=f):(C[t>>2]=f,C[t+4>>2]=m)},a:()=>{N("")},zc:function(e,r){if("undefined"!=typeof dbg)dbg(ye(e,r));else{if(void 0===t)function t(e){console.warn.apply(console,arguments)}t(ye(e,r))}},K:(e,r,t)=>((e,r,t)=>{var n=((e,r)=>{var t;for(ur.length=0;t=x[e++];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,ur.push(112==t?C[r>>2]:105==t?L[r>>2]:P[r>>3]),r+=n?8:4}return ur})(r,t);return Z[e].apply(null,n)})(e,r,t),yc:()=>Date.now(),ea:(e,r)=>b(ye(e,r)),xc:()=>2147483648,s:K,wc:(e,r,t)=>x.copyWithin(e,r,r+t),vc:(e,r)=>w(ye(e,r)),uc:e=>(N("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),tc:e=>{var r=x.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,(n=Math.max(e,a))+(65536-n%65536)%65536);if(cr(i))return!0}return!1},sc:function(){var e=fr().split("\n");return"Error"==e[0]&&e.shift(),mr(e),dr.last_addr=lr(e[3]),dr.last_stack=e,dr.last_addr},rc:(e,r,t)=>{var n;dr.last_addr==e?n=dr.last_stack:("Error"==(n=fr().split("\n"))[0]&&n.shift(),mr(n));for(var o=3;n[o]&&lr(n[o])!=e;)++o;for(var a=0;a>2]=lr(n[a+o]);return a},qc:(e,r)=>{var t=r>>2,n=L[t+6],o={alpha:!!L[t+0],depth:!!L[t+1],stencil:!!L[t+2],antialias:!!L[t+3],premultipliedAlpha:!!L[t+4],preserveDrawingBuffer:!!L[t+5],powerPreference:vr[n],failIfMajorPerformanceCaveat:!!L[t+7],majorVersion:L[t+8],minorVersion:L[t+9],enableExtensionsByDefault:L[t+10],explicitSwapControl:L[t+11],proxyContextToMainThread:L[t+12],renderViaOffscreenBackBuffer:L[t+13]},a=wr(e);return a?o.explicitSwapControl?0:gr.createContext(a,o):0},pc:e=>{gr.currentContext==e&&(gr.currentContext=0),gr.deleteContext(e)},oc:(e,r)=>{if(!r)return-5;if(!(e=gr.contexts[e]))return-3;var t=e.GLctx;if(!t)return-3;t=t.getContextAttributes(),L[r>>2]=t.alpha,L[r+4>>2]=t.depth,L[r+8>>2]=t.stencil,L[r+12>>2]=t.antialias,L[r+16>>2]=t.premultipliedAlpha,L[r+20>>2]=t.preserveDrawingBuffer;var n=t.powerPreference&&vr.indexOf(t.powerPreference);return L[r+24>>2]=n,L[r+28>>2]=t.failIfMajorPerformanceCaveat,L[r+32>>2]=e.version,L[r+36>>2]=0,L[r+40>>2]=e.attributes.enableExtensionsByDefault,0},za:()=>gr.currentContext?gr.currentContext.handle:0,nc:e=>{for(var r=e>>2,t=0;t<14;++t)L[r+t]=0;L[r+0]=L[r+1]=L[r+3]=L[r+4]=L[r+8]=L[r+10]=1},mc:e=>gr.makeContextCurrent(e)?0:-5,lc:e=>xr.add(Er.mgrDevice.get(e)),kc:e=>xr.add(Er.mgrTexture.get(e)),O:()=>{if(void 0===Er.preinitializedDeviceId){var e=o.preinitializedWebGPUDevice,r={queueId:Er.mgrQueue.create(e.queue)};Er.preinitializedDeviceId=Er.mgrDevice.create(e,r)}return Er.mgrDevice.reference(Er.preinitializedDeviceId),Er.preinitializedDeviceId},jc:e=>Er.mgrTexture.create(xr.get(e)),ic:e=>xr.remove(e),Kc:(e,r)=>{var t=0;return kr().forEach(((n,o)=>{var a=r+t;C[e+4*o>>2]=a,((e,r)=>{for(var t=0;t>0]=e.charCodeAt(t);E[r>>0]=0})(n,a),t+=n.length+1})),0},Jc:(e,r)=>{var t=kr();C[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),C[r>>2]=n,0},ya:_e,ia:function(e){try{var r=we.getStreamFromFD(e);return ve.close(r),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Ic:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=ve.read(e,E,i,s,n);if(u<0)return-1;if(o+=u,u>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Ub:function(e,r,t,n,o){var a=tr(r,t);try{if(isNaN(a))return 61;var i=we.getStreamFromFD(e);return ve.llseek(i,a,n),q=[i.position>>>0,(W=i.position,+Math.abs(W)>=1?W>0?+Math.floor(W/4294967296)>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],L[o>>2]=q[0],L[o+4>>2]=q[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},Ea:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a>2],s=C[r+4>>2];r+=8;var u=ve.write(e,E,i,s,n);if(u<0)return-1;o+=u,void 0!==n&&(n+=u)}return o})(we.getStreamFromFD(e),r,t);return C[n>>2]=o,0}catch(e){if(void 0===ve||"ErrnoError"!==e.name)throw e;return e.errno}},hc:(e,r)=>(oe(x.subarray(e,e+r)),0),c:function(e){zr.activeTexture(e)},aa:(e,r)=>{zr.attachShader(gr.programs[e],gr.shaders[r])},gc:(e,r,t)=>{zr.bindAttribLocation(gr.programs[e],r,ye(t))},e:(e,r)=>{34962==e?zr.currentArrayBufferBinding=r:34963==e&&(zr.currentElementArrayBufferBinding=r),35051==e?zr.currentPixelPackBufferBinding=r:35052==e&&(zr.currentPixelUnpackBufferBinding=r),zr.bindBuffer(e,gr.buffers[r])},fc:(e,r,t)=>{zr.bindBufferBase(e,r,gr.buffers[t])},v:(e,r)=>{zr.bindFramebuffer(e,gr.framebuffers[r])},b:(e,r)=>{zr.bindTexture(e,gr.textures[r])},q:e=>{zr.bindVertexArray(gr.vaos[e]);var r=zr.getParameter(34965);zr.currentElementArrayBufferBinding=r?0|r.name:0},xa:function(e){zr.blendEquation(e)},ec:function(e,r){zr.blendFunc(e,r)},m:(e,r,t,n)=>{gr.currentContext.version>=2?t&&r?zr.bufferData(e,x,n,t,r):zr.bufferData(e,r,n):zr.bufferData(e,t?x.subarray(t,t+r):r,n)},x:function(e){zr.clear(e)},$:function(e,r,t,n){zr.clearColor(e,r,t,n)},P:(e,r,t,n)=>{var o=(t>>>0)+4294967296*n;return zr.clientWaitSync(gr.syncs[e],r,o)},wa:e=>{zr.compileShader(gr.shaders[e])},va:()=>{var e=gr.getNewId(gr.programs),r=zr.createProgram();return r.name=e,r.maxUniformLength=r.maxAttributeLength=r.maxUniformBlockNameLength=0,r.uniformIdCounter=1,gr.programs[e]=r,e},ua:e=>{var r=gr.getNewId(gr.shaders);return gr.shaders[r]=zr.createShader(e),r},B:(e,r)=>{for(var t=0;t>2],o=gr.buffers[n];o&&(zr.deleteBuffer(o),o.name=0,gr.buffers[n]=null,n==zr.currentArrayBufferBinding&&(zr.currentArrayBufferBinding=0),n==zr.currentElementArrayBufferBinding&&(zr.currentElementArrayBufferBinding=0),n==zr.currentPixelPackBufferBinding&&(zr.currentPixelPackBufferBinding=0),n==zr.currentPixelUnpackBufferBinding&&(zr.currentPixelUnpackBufferBinding=0))}},J:(e,r)=>{for(var t=0;t>2],o=gr.framebuffers[n];o&&(zr.deleteFramebuffer(o),o.name=0,gr.framebuffers[n]=null)}},i:e=>{if(e){var r=gr.programs[e];r?(zr.deleteProgram(r),r.name=0,gr.programs[e]=null):gr.recordError(1281)}},T:e=>{if(e){var r=gr.shaders[e];r?(zr.deleteShader(r),gr.shaders[e]=null):gr.recordError(1281)}},_:e=>{if(e){var r=gr.syncs[e];r?(zr.deleteSync(r),r.name=0,gr.syncs[e]=null):gr.recordError(1281)}},z:(e,r)=>{for(var t=0;t>2],o=gr.textures[n];o&&(zr.deleteTexture(o),o.name=0,gr.textures[n]=null)}},I:(e,r)=>{for(var t=0;t>2];zr.deleteVertexArray(gr.vaos[n]),gr.vaos[n]=null}},ta:(e,r)=>{zr.detachShader(gr.programs[e],gr.shaders[r])},H:function(e){zr.disable(e)},p:e=>{gr.currentContext.clientBuffers[e].enabled=!1,zr.disableVertexAttribArray(e)},n:(e,r,t)=>{gr.preDrawHandleClientVertexAttribBindings(r+t),zr.drawArrays(e,r,t),gr.postDrawHandleClientVertexAttribBindings()},S:(e,r)=>{for(var t=Lr[e],n=0;n>2];zr.drawBuffers(t)},dc:function(e){zr.enable(e)},l:e=>{gr.currentContext.clientBuffers[e].enabled=!0,zr.enableVertexAttribArray(e)},sa:(e,r)=>{var t=zr.fenceSync(e,r);if(t){var n=gr.getNewId(gr.syncs);return t.name=n,gr.syncs[n]=t,n}return 0},Z:function(){zr.finish()},A:function(){zr.flush()},y:(e,r,t,n,o)=>{zr.framebufferTexture2D(e,r,t,gr.textures[n],o)},ra:(e,r,t,n,o)=>{zr.framebufferTextureLayer(e,r,gr.textures[t],n,o)},w:(e,r)=>{Cr(e,r,"createBuffer",gr.buffers)},N:(e,r)=>{Cr(e,r,"createFramebuffer",gr.framebuffers)},D:(e,r)=>{Cr(e,r,"createTexture",gr.textures)},G:function(e,r){Cr(e,r,"createVertexArray",gr.vaos)},qa:(e,r)=>zr.getAttribLocation(gr.programs[e],ye(r)),Y:()=>{var e=zr.getError()||gr.lastError;return gr.lastError=0,e},r:(e,r)=>((e,r,t)=>{if(r){var n=void 0;switch(e){case 36346:n=1;break;case 36344:return void(0!=t&&1!=t&&gr.recordError(1280));case 34814:case 36345:n=0;break;case 34466:var o=zr.getParameter(34467);n=o?o.length:0;break;case 33309:if(gr.currentContext.version<2)return void gr.recordError(1282);n=2*(zr.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(gr.currentContext.version<2)return void gr.recordError(1280);n=33307==e?3:0}if(void 0===n){var a=zr.getParameter(e);switch(typeof a){case"number":n=a;break;case"boolean":n=a?1:0;break;case"string":return void gr.recordError(1280);case"object":if(null===a)switch(e){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:n=0;break;default:return void gr.recordError(1280)}else{if(a instanceof Float32Array||a instanceof Uint32Array||a instanceof Int32Array||a instanceof Array){for(var i=0;i>2]=a[i];break;case 2:B[r+4*i>>2]=a[i];break;case 4:E[r+i>>0]=a[i]?1:0}return}try{n=0|a.name}catch(r){return gr.recordError(1280),void b(`GL_INVALID_ENUM in glGet${t}v: Unknown object returned from WebGL getParameter(${e})! (error: ${r})`)}}break;default:return gr.recordError(1280),void b(`GL_INVALID_ENUM in glGet${t}v: Native code calling glGet${t}v(${e}) and it returns ${a} of type ${typeof a}!`)}}switch(t){case 1:((e,r)=>{C[e>>2]=r;var t=C[e>>2];C[e+4>>2]=(r-t)/4294967296})(r,n);break;case 0:L[r>>2]=n;break;case 2:B[r>>2]=n;break;case 4:E[r>>0]=n?1:0}}else gr.recordError(1281)})(e,r,0),cc:(e,r,t)=>{if(t)if(e>=gr.counter)gr.recordError(1281);else if(e=gr.programs[e],35716==r){var n=zr.getProgramInfoLog(e);null===n&&(n="(unknown error)"),L[t>>2]=n.length+1}else if(35719==r){if(!e.maxUniformLength)for(var o=0;o>2]=e.maxUniformLength}else if(35722==r){if(!e.maxAttributeLength)for(o=0;o>2]=e.maxAttributeLength}else if(35381==r){if(!e.maxUniformBlockNameLength)for(o=0;o>2]=e.maxUniformBlockNameLength}else L[t>>2]=zr.getProgramParameter(e,r);else gr.recordError(1281)},bc:(e,r,t,n)=>{var o=zr.getShaderInfoLog(gr.shaders[e]);null===o&&(o="(unknown error)");var a=r>0&&n?qe(o,n,r):0;t&&(L[t>>2]=a)},ac:(e,r,t)=>{if(t)if(35716==r){var n=zr.getShaderInfoLog(gr.shaders[e]);null===n&&(n="(unknown error)");var o=n?n.length+1:0;L[t>>2]=o}else if(35720==r){var a=zr.getShaderSource(gr.shaders[e]),i=a?a.length+1:0;L[t>>2]=i}else L[t>>2]=zr.getShaderParameter(gr.shaders[e],r);else gr.recordError(1281)},F:e=>{var r=gr.stringCache[e];if(!r){switch(e){case 7939:r=sr(gr.getExtensions().join(" "));break;case 7936:case 7937:case 37445:case 37446:var t=zr.getParameter(e);t||gr.recordError(1280),r=t?sr(t):0;break;case 7938:var n=zr.getParameter(7938);n=gr.currentContext.version>=2?`OpenGL ES 3.0 (${n})`:`OpenGL ES 2.0 (${n})`,r=sr(n);break;case 35724:var o=zr.getParameter(35724),a=o.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);null!==a&&(3==a[1].length&&(a[1]=a[1]+"0"),o=`OpenGL ES GLSL ES ${a[1]} (${o})`),r=sr(o);break;default:gr.recordError(1280)}gr.stringCache[e]=r}return r},$b:(e,r)=>zr.getUniformBlockIndex(gr.programs[e],ye(r)),g:(e,r)=>{if(r=ye(r),e=gr.programs[e]){(e=>{var r,t,n=e.uniformLocsById,o=e.uniformSizeAndIdsByName;if(!n)for(e.uniformLocsById=n={},e.uniformArrayNamesById={},r=0;r0?i.slice(0,u):i,l=e.uniformIdCounter;for(e.uniformIdCounter+=s,o[c]=[s,l],t=0;t0&&(s=r.slice(a+1),n=parseInt(s)>>>0,o=r.slice(0,a));var i=e.uniformSizeAndIdsByName[o];if(i&&n{e=gr.programs[e],zr.linkProgram(e),e.uniformLocsById=0,e.uniformSizeAndIdsByName={}},X:(e,r)=>{3317==e&&(gr.unpackAlignment=r),zr.pixelStorei(e,r)},da:(e,r,t,n,o,a,i)=>{if(gr.currentContext.version>=2)if(zr.currentPixelPackBufferBinding)zr.readPixels(e,r,t,n,o,a,i);else{var s=Pr(a);zr.readPixels(e,r,t,n,o,a,s,i>>Fr(s))}else{var u=Tr(a,o,t,n,i);u?zr.readPixels(e,r,t,n,o,a,u):gr.recordError(1280)}},oa:(e,r,t,n)=>{var o=gr.getSource(e,r,t,n);zr.shaderSource(gr.shaders[e],o)},C:(e,r,t,n,o,a,i,s,u)=>{if(gr.currentContext.version>=2)if(zr.currentPixelUnpackBufferBinding)zr.texImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Pr(s);zr.texImage2D(e,r,t,n,o,a,i,s,c,u>>Fr(c))}else zr.texImage2D(e,r,t,n,o,a,i,s,null);else zr.texImage2D(e,r,t,n,o,a,i,s,u?Tr(s,i,n,o,u):null)},W:function(e,r,t){zr.texParameterf(e,r,t)},na:(e,r,t)=>{var n=B[t>>2];zr.texParameterf(e,r,n)},d:function(e,r,t){zr.texParameteri(e,r,t)},V:function(e,r,t,n,o){zr.texStorage2D(e,r,t,n,o)},_b:function(e,r,t,n,o,a){zr.texStorage3D(e,r,t,n,o,a)},R:(e,r,t,n,o,a,i,s,u)=>{if(gr.currentContext.version>=2)if(zr.currentPixelUnpackBufferBinding)zr.texSubImage2D(e,r,t,n,o,a,i,s,u);else if(u){var c=Pr(s);zr.texSubImage2D(e,r,t,n,o,a,i,s,c,u>>Fr(c))}else zr.texSubImage2D(e,r,t,n,o,a,i,s,null);else{var l=null;u&&(l=Tr(s,i,o,a,u)),zr.texSubImage2D(e,r,t,n,o,a,i,s,l)}},Zb:(e,r,t,n,o,a,i,s,u,c,l)=>{if(zr.currentPixelUnpackBufferBinding)zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,l);else if(l){var d=Pr(c);zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,d,l>>Fr(d))}else zr.texSubImage3D(e,r,t,n,o,a,i,s,u,c,null)},Q:(e,r)=>{zr.uniform1f(Ar(e),r)},f:(e,r)=>{zr.uniform1i(Ar(e),r)},Yb:(e,r,t)=>{zr.uniform2f(Ar(e),r,t)},Xb:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform2fv(Ar(e),B,t>>2,2*r);else{if(r<=144)for(var n=Dr[2*r-1],o=0;o<2*r;o+=2)n[o]=B[t+4*o>>2],n[o+1]=B[t+(4*o+4)>>2];else n=B.subarray(t>>2,t+8*r>>2);zr.uniform2fv(Ar(e),n)}},ma:(e,r,t,n)=>{zr.uniform3f(Ar(e),r,t,n)},la:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform4fv(Ar(e),B,t>>2,4*r);else{if(r<=72){var n=Dr[4*r-1],o=B;t>>=2;for(var a=0;a<4*r;a+=4){var i=t+a;n[a]=o[i],n[a+1]=o[i+1],n[a+2]=o[i+2],n[a+3]=o[i+3]}}else n=B.subarray(t>>2,t+16*r>>2);zr.uniform4fv(Ar(e),n)}},Wb:(e,r,t)=>{if(gr.currentContext.version>=2)r&&zr.uniform4iv(Ar(e),L,t>>2,4*r);else{if(r<=72)for(var n=Mr[4*r-1],o=0;o<4*r;o+=4)n[o]=L[t+4*o>>2],n[o+1]=L[t+(4*o+4)>>2],n[o+2]=L[t+(4*o+8)>>2],n[o+3]=L[t+(4*o+12)>>2];else n=L.subarray(t>>2,t+16*r>>2);zr.uniform4iv(Ar(e),n)}},Vb:(e,r,t)=>{e=gr.programs[e],zr.uniformBlockBinding(e,r,t)},ka:(e,r,t,n)=>{if(gr.currentContext.version>=2)r&&zr.uniformMatrix4fv(Ar(e),!!t,B,n>>2,16*r);else{if(r<=18){var o=Dr[16*r-1],a=B;n>>=2;for(var i=0;i<16*r;i+=16){var s=n+i;o[i]=a[s],o[i+1]=a[s+1],o[i+2]=a[s+2],o[i+3]=a[s+3],o[i+4]=a[s+4],o[i+5]=a[s+5],o[i+6]=a[s+6],o[i+7]=a[s+7],o[i+8]=a[s+8],o[i+9]=a[s+9],o[i+10]=a[s+10],o[i+11]=a[s+11],o[i+12]=a[s+12],o[i+13]=a[s+13],o[i+14]=a[s+14],o[i+15]=a[s+15]}}else o=B.subarray(n>>2,n+64*r>>2);zr.uniformMatrix4fv(Ar(e),!!t,o)}},h:e=>{e=gr.programs[e],zr.useProgram(e),zr.currentProgram=e},k:(e,r,t,n,o,a)=>{var i=gr.currentContext.clientBuffers[e];if(!zr.currentArrayBufferBinding)return i.size=r,i.type=t,i.normalized=n,i.stride=o,i.ptr=a,i.clientside=!0,void(i.vertexAttribPointerAdaptor=function(e,r,t,n,o,a){this.vertexAttribPointer(e,r,t,n,o,a)});i.clientside=!1,zr.vertexAttribPointer(e,r,t,!!n,o,a)},M:function(e,r,t,n){zr.viewport(e,r,t,n)},Mb:function(){let e;return"undefined"!=typeof HTMLCanvasElement?(e=document.createElement("canvas"),e.style.display="none"):e=new OffscreenCanvas(0,0),Ge.toHandle(e)},Lb:function(e){let r=wr(e);return o&&!r&&(r=o.canvasWebGpu),Ge.toHandle(r)},Kb:function(e){const r=Ge.toValue(e);zr.texImage2D(zr.TEXTURE_2D,0,zr.RGBA,zr.RGBA,zr.UNSIGNED_BYTE,r)},Hc:be,U:Or,Jb:(e,r,t,n,o)=>Or(e,r,t,n),Ib:e=>Er.mgrBindGroupLayout.release(e),Hb:e=>Er.mgrBindGroup.release(e),Gb:(e,r,t)=>{var n,o=Er.mgrBuffer.objects[e];if(0===t&&Se("getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE"),-1==t&&(t=void 0),2!==o.mapMode)return 0;try{n=o.object.getMappedRange(r,t)}catch(e){return 0}var a=et(16,n.byteLength);return x.fill(0,a,n.byteLength),o.onUnmap.push((()=>{new Uint8Array(n).set(x.subarray(a,a+n.byteLength)),$r(a)})),a},Fb:e=>Er.mgrBuffer.reference(e),Eb:e=>Er.mgrBuffer.release(e),Db:e=>{var r=Er.mgrBuffer.objects[e];if(r.onUnmap){for(var t=0;tEr.mgrCommandBuffer.release(e),Bb:(e,r)=>{var t;if(r){t={label:void 0,timestampWrites:function(e){if(0!==e)return{querySet:Er.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}(C[r+8>>2])};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrCommandEncoder.get(e);return Er.mgrComputePassEncoder.create(o.beginComputePass(t))},Ab:(e,r)=>{function t(e){var r=C[e+4>>2];if(0!==r){var t=C[e+12>>2],n=C[e+16>>2],o=Er.makeColor(e+24);return{view:Er.mgrTextureView.get(r),resolveTarget:Er.mgrTextureView.get(C[e+8>>2]),clearValue:o,loadOp:Er.LoadOp[t],storeOp:Er.StoreOp[n]}}}function n(e,r){for(var n=[],o=0;o>2]),depthClearValue:B[e+12>>2],depthLoadOp:Er.LoadOp[C[e+4>>2]],depthStoreOp:Er.StoreOp[C[e+8>>2]],depthReadOnly:0!==E[e+16>>0],stencilClearValue:C[e+28>>2],stencilLoadOp:Er.LoadOp[C[e+20>>2]],stencilStoreOp:Er.StoreOp[C[e+24>>2]],stencilReadOnly:0!==E[e+32>>0]}}function a(e){if(0!==e)return{querySet:Er.mgrQuerySet.get(C[e>>2]),beginningOfPassWriteIndex:C[e+4>>2],endOfPassWriteIndex:C[e+8>>2]}}var i=function(e){var r=C[e>>2],t=void 0;if(0!==r){C[r+4>>2];var i=r;t=4294967296*C[i+4+8>>2]+C[i+8>>2]}var s={label:void 0,colorAttachments:n(C[e+8>>2],C[e+12>>2]),depthStencilAttachment:o(C[e+16>>2]),occlusionQuerySet:Er.mgrQuerySet.get(C[e+20>>2]),timestampWrites:a(C[e+24>>2]),maxDrawCount:t},u=C[e+4>>2];return u&&(s.label=ye(u)),s}(r),s=Er.mgrCommandEncoder.get(e);return Er.mgrRenderPassEncoder.create(s.beginRenderPass(i))},zb:(e,r,t,n)=>{var o=Er.mgrCommandEncoder.get(e),a=Er.makeExtent3D(n);o.copyBufferToTexture(Er.makeImageCopyBuffer(r),Er.makeImageCopyTexture(t),a)},yb:(e,r,t,n)=>{var o=Er.mgrCommandEncoder.get(e),a=Er.makeExtent3D(n);o.copyTextureToTexture(Er.makeImageCopyTexture(r),Er.makeImageCopyTexture(t),a)},xb:(e,r)=>{var t=Er.mgrCommandEncoder.get(e);return Er.mgrCommandBuffer.create(t.finish())},wb:e=>Er.mgrCommandEncoder.release(e),vb:(e,r,t,n)=>{Er.mgrComputePassEncoder.get(e).dispatchWorkgroups(r,t,n)},ub:e=>{Er.mgrComputePassEncoder.get(e).end()},tb:e=>Er.mgrComputePassEncoder.release(e),sb:(e,r,t,n,o)=>{var a=Er.mgrComputePassEncoder.get(e),i=Er.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},rb:(e,r)=>{var t=Er.mgrComputePassEncoder.get(e),n=Er.mgrComputePipeline.get(r);t.setPipeline(n)},qb:(e,r)=>{var t=Er.mgrComputePipeline.get(e);return Er.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},pb:e=>Er.mgrComputePipeline.release(e),ob:(e,r)=>{function t(e){var r,t=C[e+8>>2],n=C[e+32>>2],o=C[e+36>>2],a=C[e+4>>2];if(t){var i=C[(r=e+24)>>2]+4294967296*L[r+4>>2];return-1==i&&(i=void 0),{binding:a,resource:{buffer:Er.mgrBuffer.get(t),offset:4294967296*C[e+4+16>>2]+C[e+16>>2],size:i}}}return n?{binding:a,resource:Er.mgrSampler.get(n)}:{binding:a,resource:Er.mgrTextureView.get(o)}}var n={label:void 0,layout:Er.mgrBindGroupLayout.get(C[r+8>>2]),entries:function(e,r){for(var n=[],o=0;o>2],C[r+16>>2])},o=C[r+4>>2];o&&(n.label=ye(o));var a=Er.mgrDevice.get(e);return Er.mgrBindGroup.create(a.createBindGroup(n))},nb:(e,r)=>{var t=0!==E[r+24>>0],n={label:void 0,usage:C[r+8>>2],size:4294967296*C[r+4+16>>2]+C[r+16>>2],mappedAtCreation:t},o=C[r+4>>2];o&&(n.label=ye(o));var a=Er.mgrDevice.get(e),i={},s=Er.mgrBuffer.create(a.createBuffer(n),i);return t&&(i.mapMode=2,i.onUnmap=[]),s},mb:(e,r)=>{var t;if(r){t={label:void 0};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrDevice.get(e);return Er.mgrCommandEncoder.create(o.createCommandEncoder(t))},lb:(e,r)=>{var t={label:void 0,layout:Er.makePipelineLayout(C[r+8>>2]),compute:Er.makeProgrammableStageDescriptor(r+12)},n=C[r+4>>2];n&&(t.label=ye(n));var o=Er.mgrDevice.get(e);return Er.mgrComputePipeline.create(o.createComputePipeline(t))},kb:(e,r)=>{var t=(e=>{function r(e){if(e)return{operation:Er.BlendOperation[C[e>>2]],srcFactor:Er.BlendFactor[C[e+4>>2]],dstFactor:Er.BlendFactor[C[e+8>>2]]}}function t(e){if(e)return{alpha:r(e+12),color:r(e+0)}}function n(e,r){for(var n,o,a=[],i=0;i>2])?void 0:{format:Er.TextureFormat[o],blend:t(C[n+8>>2]),writeMask:C[n+12>>2]}));return a}function o(e){return{compare:Er.CompareFunction[C[e>>2]],failOp:Er.StencilOperation[C[e+4>>2]],depthFailOp:Er.StencilOperation[C[e+8>>2]],passOp:Er.StencilOperation[C[e+12>>2]]}}function a(e,r){for(var t,n=[],o=0;o>2]],offset:4294967296*C[t+4+8>>2]+C[t+8>>2],shaderLocation:C[t+16>>2]}));return n}function i(e){if(e){var r=C[e+8>>2];return 2===r?null:{arrayStride:4294967296*C[e+4>>2]+C[e>>2],stepMode:Er.VertexStepMode[r],attributes:a(C[e+12>>2],C[e+16>>2])}}}function s(e,r){if(e){for(var t=[],n=0;n>2]),vertex:function(e){if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2]),buffers:s(C[e+20>>2],C[e+24>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}}(e+12),primitive:function(e){if(e)return{topology:Er.PrimitiveTopology[C[e+4>>2]],stripIndexFormat:Er.IndexFormat[C[e+8>>2]],frontFace:Er.FrontFace[C[e+12>>2]],cullMode:Er.CullMode[C[e+16>>2]]}}(e+40),depthStencil:function(e){if(e)return{format:Er.TextureFormat[C[e+4>>2]],depthWriteEnabled:0!==E[e+8>>0],depthCompare:Er.CompareFunction[C[e+12>>2]],stencilFront:o(e+16),stencilBack:o(e+32),stencilReadMask:C[e+48>>2],stencilWriteMask:C[e+52>>2],depthBias:L[e+56>>2],depthBiasSlopeScale:B[e+60>>2],depthBiasClamp:B[e+64>>2]}}(C[e+60>>2]),multisample:function(e){if(e)return{count:C[e+4>>2],mask:C[e+8>>2],alphaToCoverageEnabled:0!==E[e+12>>0]}}(e+64),fragment:function(e){if(e){var r={module:Er.mgrShaderModule.get(C[e+4>>2]),constants:Er.makePipelineConstants(C[e+12>>2],C[e+16>>2]),targets:n(C[e+20>>2],C[e+24>>2])},t=C[e+8>>2];return t&&(r.entryPoint=ye(t)),r}}(C[e+80>>2])},c=C[e+4>>2];return c&&(u.label=ye(c)),u})(r),n=Er.mgrDevice.get(e);return Er.mgrRenderPipeline.create(n.createRenderPipeline(t))},jb:(e,r)=>{var t;if(r){t={label:void 0,addressModeU:Er.AddressMode[C[r+8>>2]],addressModeV:Er.AddressMode[C[r+12>>2]],addressModeW:Er.AddressMode[C[r+16>>2]],magFilter:Er.FilterMode[C[r+20>>2]],minFilter:Er.FilterMode[C[r+24>>2]],mipmapFilter:Er.MipmapFilterMode[C[r+28>>2]],lodMinClamp:B[r+32>>2],lodMaxClamp:B[r+36>>2],compare:Er.CompareFunction[C[r+40>>2]]};var n=C[r+4>>2];n&&(t.label=ye(n))}var o=Er.mgrDevice.get(e);return Er.mgrSampler.create(o.createSampler(t))},ib:(e,r)=>{var t=C[r>>2],n=C[t+4>>2],o={label:void 0,code:""},a=C[r+4>>2];switch(a&&(o.label=ye(a)),n){case 5:var i=C[t+8>>2],s=C[t+12>>2]>>2;o.code=C.subarray(s,s+i);break;case 6:var u=C[t+8>>2];u&&(o.code=ye(u))}var c=Er.mgrDevice.get(e);return Er.mgrShaderModule.create(c.createShaderModule(o))},hb:(e,r)=>{var t={label:void 0,size:Er.makeExtent3D(r+16),mipLevelCount:C[r+32>>2],sampleCount:C[r+36>>2],dimension:Er.TextureDimension[C[r+12>>2]],format:Er.TextureFormat[C[r+28>>2]],usage:C[r+8>>2]},n=C[r+4>>2];n&&(t.label=ye(n));var o=C[r+40>>2];if(o){var a=C[r+44>>2];t.viewFormats=Array.from(L.subarray(a>>2,a+4*o>>2),(function(e){return Er.TextureFormat[e]}))}var i=Er.mgrDevice.get(e);return Er.mgrTexture.create(i.createTexture(t))},gb:e=>{var r=Er.mgrDevice.objects[e].queueId;return Er.mgrQueue.reference(r),r},fb:e=>Er.mgrDevice.reference(e),eb:e=>Er.mgrDevice.release(e),db:e=>Er.mgrPipelineLayout.release(e),cb:e=>Er.mgrQuerySet.release(e),bb:e=>Er.mgrQueue.release(e),ab:(e,r,t)=>{var n=Er.mgrQueue.get(e),o=Array.from(L.subarray(t>>2,t+4*r>>2),(function(e){return Er.mgrCommandBuffer.get(e)}));n.submit(o)},Nb:function(e,r,t,n,o,a){var i=tr(t,n),s=Er.mgrQueue.get(e),u=Er.mgrBuffer.get(r),c=x.subarray(o,o+a);s.writeBuffer(u,i,c,0,a)},$a:(e,r,t,n,o)=>{Er.mgrRenderPassEncoder.get(e).draw(r,t,n,o)},_a:e=>{Er.mgrRenderPassEncoder.get(e).end()},Za:e=>Er.mgrRenderPassEncoder.release(e),Ya:(e,r,t,n,o)=>{var a=Er.mgrRenderPassEncoder.get(e),i=Er.mgrBindGroup.get(t);if(0==n)a.setBindGroup(r,i);else{for(var s=[],u=0;u>2]);a.setBindGroup(r,i,s)}},Xa:(e,r)=>{var t=Er.mgrRenderPassEncoder.get(e),n=Er.mgrRenderPipeline.get(r);t.setPipeline(n)},Wa:(e,r)=>{var t=Er.mgrRenderPipeline.get(e);return Er.mgrBindGroupLayout.create(t.getBindGroupLayout(r))},Va:e=>Er.mgrRenderPipeline.release(e),Ua:e=>Er.mgrSampler.reference(e),Ta:e=>Er.mgrSampler.release(e),Sa:e=>Er.mgrShaderModule.reference(e),Ra:e=>Er.mgrShaderModule.release(e),Qa:(e,r)=>{var t;if(r){var n=C[r+20>>2],o=C[r+28>>2];t={format:Er.TextureFormat[C[r+8>>2]],dimension:Er.TextureViewDimension[C[r+12>>2]],baseMipLevel:C[r+16>>2],mipLevelCount:4294967295===n?void 0:n,baseArrayLayer:C[r+24>>2],arrayLayerCount:4294967295===o?void 0:o,aspect:Er.TextureAspect[C[r+32>>2]]};var a=C[r+4>>2];a&&(t.label=ye(a))}var i=Er.mgrTexture.get(e);return Er.mgrTextureView.create(i.createView(t))},Pa:e=>Er.mgrTexture.get(e).destroy(),Oa:e=>Er.mgrTexture.reference(e),Na:e=>Er.mgrTexture.release(e),Ma:e=>Er.mgrTextureView.reference(e),La:e=>Er.mgrTextureView.release(e),Ka:function(e,r,t,n){const o=pr.length,a=new Uint8Array(x.slice(e+r,e+t));try{var i=new WebAssembly.Module(a),s=new WebAssembly.Instance(i,{env:{memory:y}});for(var u in s.exports){var c=s.exports[u];addFunction(c)}return oWebAssembly.instantiateStreaming(e,t).then(a,(function(e){return b(`wasm streaming compile failed: ${e}`),b("falling back to ArrayBuffer instantiation"),Q(r,t,a)}))))).catch(n),{}}(),$r=o._free=e=>($r=o._free=Xr.gd)(e),Qr=o._malloc=e=>(Qr=o._malloc=Xr.id)(e),Kr=(o._addBoundTextureAsImageToStream=(e,r,t,n)=>(o._addBoundTextureAsImageToStream=Xr.jd)(e,r,t,n),o._attachImageListener=(e,r)=>(o._attachImageListener=Xr.kd)(e,r),o._attachImageVectorListener=(e,r)=>(o._attachImageVectorListener=Xr.ld)(e,r),o._registerModelResourcesGraphService=()=>(o._registerModelResourcesGraphService=Xr.md)(),()=>(Kr=Xr.nd)()),Zr=(o._bindTextureToStream=e=>(o._bindTextureToStream=Xr.od)(e),o._addBoundTextureToStream=(e,r,t,n)=>(o._addBoundTextureToStream=Xr.pd)(e,r,t,n),o._addDoubleToInputStream=(e,r,t)=>(o._addDoubleToInputStream=Xr.qd)(e,r,t),o._addFloatToInputStream=(e,r,t)=>(o._addFloatToInputStream=Xr.rd)(e,r,t),o._addBoolToInputStream=(e,r,t)=>(o._addBoolToInputStream=Xr.sd)(e,r,t),o._addIntToInputStream=(e,r,t)=>(o._addIntToInputStream=Xr.td)(e,r,t),o._addStringToInputStream=(e,r,t)=>(o._addStringToInputStream=Xr.ud)(e,r,t),o._allocateBoolVector=e=>(o._allocateBoolVector=Xr.vd)(e),o._allocateFloatVector=e=>(o._allocateFloatVector=Xr.wd)(e),o._allocateDoubleVector=e=>(o._allocateDoubleVector=Xr.xd)(e),o._allocateIntVector=e=>(o._allocateIntVector=Xr.yd)(e),o._allocateStringVector=e=>(o._allocateStringVector=Xr.zd)(e),o._addBoolVectorEntry=(e,r)=>(o._addBoolVectorEntry=Xr.Ad)(e,r),o._addFloatVectorEntry=(e,r)=>(o._addFloatVectorEntry=Xr.Bd)(e,r),o._addDoubleVectorEntry=(e,r)=>(o._addDoubleVectorEntry=Xr.Cd)(e,r),o._addIntVectorEntry=(e,r)=>(o._addIntVectorEntry=Xr.Dd)(e,r),o._addStringVectorEntry=(e,r)=>(o._addStringVectorEntry=Xr.Ed)(e,r),o._addBoolVectorToInputStream=(e,r,t)=>(o._addBoolVectorToInputStream=Xr.Fd)(e,r,t),o._addFloatVectorToInputStream=(e,r,t)=>(o._addFloatVectorToInputStream=Xr.Gd)(e,r,t),o._addDoubleVectorToInputStream=(e,r,t)=>(o._addDoubleVectorToInputStream=Xr.Hd)(e,r,t),o._addIntVectorToInputStream=(e,r,t)=>(o._addIntVectorToInputStream=Xr.Id)(e,r,t),o._addStringVectorToInputStream=(e,r,t)=>(o._addStringVectorToInputStream=Xr.Jd)(e,r,t),o._addFlatHashMapToInputStream=(e,r,t,n,a)=>(o._addFlatHashMapToInputStream=Xr.Kd)(e,r,t,n,a),o._addProtoToInputStream=(e,r,t,n,a)=>(o._addProtoToInputStream=Xr.Ld)(e,r,t,n,a),o._addEmptyPacketToInputStream=(e,r)=>(o._addEmptyPacketToInputStream=Xr.Md)(e,r),o._addBoolToInputSidePacket=(e,r)=>(o._addBoolToInputSidePacket=Xr.Nd)(e,r),o._addDoubleToInputSidePacket=(e,r)=>(o._addDoubleToInputSidePacket=Xr.Od)(e,r),o._addFloatToInputSidePacket=(e,r)=>(o._addFloatToInputSidePacket=Xr.Pd)(e,r),o._addIntToInputSidePacket=(e,r)=>(o._addIntToInputSidePacket=Xr.Qd)(e,r),o._addStringToInputSidePacket=(e,r)=>(o._addStringToInputSidePacket=Xr.Rd)(e,r),o._addProtoToInputSidePacket=(e,r,t,n)=>(o._addProtoToInputSidePacket=Xr.Sd)(e,r,t,n),o._addBoolVectorToInputSidePacket=(e,r)=>(o._addBoolVectorToInputSidePacket=Xr.Td)(e,r),o._addDoubleVectorToInputSidePacket=(e,r)=>(o._addDoubleVectorToInputSidePacket=Xr.Ud)(e,r),o._addFloatVectorToInputSidePacket=(e,r)=>(o._addFloatVectorToInputSidePacket=Xr.Vd)(e,r),o._addIntVectorToInputSidePacket=(e,r)=>(o._addIntVectorToInputSidePacket=Xr.Wd)(e,r),o._addStringVectorToInputSidePacket=(e,r)=>(o._addStringVectorToInputSidePacket=Xr.Xd)(e,r),o._attachBoolListener=e=>(o._attachBoolListener=Xr.Yd)(e),o._attachBoolVectorListener=e=>(o._attachBoolVectorListener=Xr.Zd)(e),o._attachDoubleListener=e=>(o._attachDoubleListener=Xr._d)(e),o._attachDoubleVectorListener=e=>(o._attachDoubleVectorListener=Xr.$d)(e),o._attachFloatListener=e=>(o._attachFloatListener=Xr.ae)(e),o._attachFloatVectorListener=e=>(o._attachFloatVectorListener=Xr.be)(e),o._attachIntListener=e=>(o._attachIntListener=Xr.ce)(e),o._attachIntVectorListener=e=>(o._attachIntVectorListener=Xr.de)(e),o._attachStringListener=e=>(o._attachStringListener=Xr.ee)(e),o._attachStringVectorListener=e=>(o._attachStringVectorListener=Xr.fe)(e),o._attachProtoListener=(e,r)=>(o._attachProtoListener=Xr.ge)(e,r),o._attachProtoVectorListener=(e,r)=>(o._attachProtoVectorListener=Xr.he)(e,r),o._getGraphConfig=(e,r)=>(o._getGraphConfig=Xr.ie)(e,r),o._clearSubgraphs=()=>(o._clearSubgraphs=Xr.je)(),o._pushBinarySubgraph=(e,r)=>(o._pushBinarySubgraph=Xr.ke)(e,r),o._pushTextSubgraph=(e,r)=>(o._pushTextSubgraph=Xr.le)(e,r),o._changeBinaryGraph=(e,r)=>(o._changeBinaryGraph=Xr.me)(e,r),o._changeTextGraph=(e,r)=>(o._changeTextGraph=Xr.ne)(e,r),o._processGl=e=>(o._processGl=Xr.oe)(e),o._process=e=>(o._process=Xr.pe)(e),o._bindTextureToCanvas=()=>(o._bindTextureToCanvas=Xr.qe)(),o._requestShaderRefreshOnGraphChange=()=>(o._requestShaderRefreshOnGraphChange=Xr.re)(),o._waitUntilIdle=()=>(o._waitUntilIdle=Xr.se)(),o._closeGraph=()=>(o._closeGraph=Xr.te)(),o._setAutoRenderToScreen=e=>(o._setAutoRenderToScreen=Xr.ue)(e),e=>(Zr=Xr.ve)(e)),Jr=(e,r)=>(Jr=Xr.we)(e,r),et=(e,r)=>(et=Xr.xe)(e,r),rt=e=>(rt=Xr.ye)(e),tt=()=>(tt=Xr.ze)(),nt=e=>(nt=Xr.Ae)(e),ot=e=>(ot=Xr.Be)(e),at=e=>(at=Xr.Ce)(e);function it(){function e(){qr||(qr=!0,o.calledRun=!0,F||(o.noFSInit||ve.init.initialized||ve.init(),ve.ignorePermissions=!1,me.init(),Le(M),t(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)e=o.postRun.shift(),V.unshift(e);var e;Le(V)}()))}R>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)e=o.preRun.shift(),D.unshift(e);var e;Le(D)}(),R>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),e()}),1)):e()))}if(o._kVersionStampBuildChangelistStr=1024,o._kVersionStampCitcSnapshotStr=1056,o._kVersionStampCitcWorkspaceIdStr=1088,o._kVersionStampSourceUriStr=1600,o._kVersionStampBuildClientStr=2112,o._kVersionStampBuildClientMintStatusStr=2624,o._kVersionStampBuildCompilerStr=2656,o._kVersionStampBuildDateTimePstStr=3168,o._kVersionStampBuildDepotPathStr=3200,o._kVersionStampBuildIdStr=3712,o._kVersionStampBuildInfoStr=4224,o._kVersionStampBuildLabelStr=4736,o._kVersionStampBuildTargetStr=5248,o._kVersionStampBuildTimestampStr=5760,o._kVersionStampBuildToolStr=5792,o._kVersionStampG3BuildTargetStr=6304,o._kVersionStampVerifiableStr=6816,o._kVersionStampBuildFdoTypeStr=6848,o._kVersionStampBuildBaselineChangelistStr=6880,o._kVersionStampBuildLtoTypeStr=6912,o._kVersionStampBuildPropellerTypeStr=6944,o._kVersionStampBuildUsernameStr=6976,o._kVersionStampBuildHostnameStr=7488,o._kVersionStampBuildDirectoryStr=8e3,o._kVersionStampBuildChangelistInt=8512,o._kVersionStampCitcSnapshotInt=8520,o._kVersionStampBuildClientMintStatusInt=8524,o._kVersionStampBuildTimestampInt=8528,o._kVersionStampVerifiableInt=8536,o._kVersionStampBuildCoverageEnabledInt=8540,o._kVersionStampBuildBaselineChangelistInt=8544,o._kVersionStampPrecookedTimestampStr=8560,o._kVersionStampPrecookedClientInfoStr=9072,o.___start_em_js=1291460,o.___stop_em_js=1298619,o.addRunDependency=U,o.removeRunDependency=G,o.FS_createPath=ve.createPath,o.FS_createLazyFile=ve.createLazyFile,o.FS_createDevice=ve.createDevice,o.ccall=(e,r,t,n,a)=>{var i={string:e=>{var r=0;return null!=e&&0!==e&&(r=br(e)),r},array:e=>{var r=ot(e.length);return Rr(e,r),r}},s=(e=>o["_"+e])(e),u=[],c=0;if(n)for(var l=0;l0;)o.preInit.pop()();return it(),r.ready}})();"object"==typeof exports&&"object"==typeof module?module.exports=ModuleFactory:"function"==typeof define&&define.amd&&define([],(()=>ModuleFactory)); \ No newline at end of file diff --git a/models/wasm/vision_wasm_nosimd_internal.wasm b/models/wasm/vision_wasm_nosimd_internal.wasm index 7f9d947..ae291aa 100644 Binary files a/models/wasm/vision_wasm_nosimd_internal.wasm and b/models/wasm/vision_wasm_nosimd_internal.wasm differ diff --git a/sw.js b/sw.js index 608681e..88ba60f 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -(()=>{"use strict";var e={136:()=>{try{self["workbox:core:6.5.3"]&&_()}catch(e){}},447:()=>{try{self["workbox:precaching:6.5.3"]&&_()}catch(e){}},227:()=>{try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},390:()=>{try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,s),r.exports}(()=>{s(136);class e extends Error{constructor(e,t){super(((e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s})(e,t)),this.name=e,this.details=t}}const t={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},a=e=>[t.prefix,e,t.suffix].filter((e=>e&&e.length>0)).join("-"),n=e=>e||a(t.precache);function r(e,t){const s=t();return e.waitUntil(s),s}function i(t){if(!t)throw new e("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:s,url:a}=t;if(!a)throw new e("add-to-cache-list-unexpected-type",{entry:t});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),r=new URL(a,location.href);return n.searchParams.set("__WB_REVISION__",s),{cacheKey:n.href,url:r.href}}s(447);class c{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class o{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let h;function l(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=new Set;function f(e){return"string"==typeof e?new Request(e):e}s(390);class p{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:s}=this;let a=f(t);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:r.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=f(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(r,i);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,s){const a=f(t);await(0,new Promise((e=>setTimeout(e,0))));const n=await this.getCacheKey(a,"write");if(!s)throw new e("cache-put-with-no-response",{url:(r=n.url,new URL(String(r),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var r;const i=await this._ensureResponseSafeToCache(s);if(!i)return!1;const{cacheName:c,matchOptions:o}=this._strategy,h=await self.caches.open(c),u=this.hasCallback("cacheDidUpdate"),p=u?await async function(e,t,s,a){const n=l(t.url,s);if(t.url===n)return e.match(t,a);const r=Object.assign(Object.assign({},a),{ignoreSearch:!0}),i=await e.keys(t,r);for(const t of i)if(n===l(t.url,s))return e.match(t,a)}(h,n.clone(),["__WB_REVISION__"],o):null;try{await h.put(n,u?i.clone():i)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of d)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:c,oldResponse:p,newResponse:i.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=f(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class g{constructor(e={}){this.cacheName=e.cacheName||a(t.runtime),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new p(this,{event:t,request:s,params:a}),r=this._getResponse(n,s,t);return[r,this._awaitComplete(r,n,s,t)]}async _getResponse(t,s,a){let n;await t.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,t),!n||"error"===n.type)throw new e("no-response",{url:s.url})}catch(e){if(e instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(n=await r({error:e,event:a,request:s}),n)break;if(!n)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))n=await e({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,r;try{n=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(r=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:r}),t.destroy(),r)throw r}}class y extends g{constructor(e={}){e.cacheName=n(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(y.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(t,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new e("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const e=n.integrity,r=t.integrity,i=!r||r===e;a=await s.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||e:void 0})),e&&i&&"no-cors"!==t.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await s.cachePut(t,a.clone()))}return a}async _handleInstall(t,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(t);if(!await s.cachePut(t,a.clone()))throw new e("bad-precaching-response",{url:t.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==y.copyRedirectedCacheableResponsesPlugin&&(a===y.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(y.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}y.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},y.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await async function(t,s){let a=null;if(t.url&&(a=new URL(t.url).origin),a!==self.location.origin)throw new e("cross-origin-copy-response",{origin:a});const n=t.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=s?s(r):r,c=function(){if(void 0===h){const e=new Response("");if("body"in e)try{new Response(e.body),h=!0}catch(e){h=!1}h=!1}return h}()?n.body:await n.blob();return new Response(c,i)}(t):t};class w{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new y({cacheName:n(e),plugins:[...t,new o({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(t){const s=[];for(const a of t){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:t,url:n}=i(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==t)throw new e("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:t});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(t)&&this._cacheKeysToIntegrities.get(t)!==a.integrity)throw new e("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(t,a.integrity)}if(this._urlsToCacheKeys.set(n,t),this._urlsToCacheModes.set(n,r),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return r(e,(async()=>{const t=new c;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),r=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return r(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(t){const s=this.getCacheKeyForURL(t);if(!s)throw new e("non-precached-url",{url:t});return e=>(e.request=new Request(t),e.params=Object.assign({cacheKey:s},e.params),this.strategy.handle(e))}}let m;const _=()=>(m||(m=new w),m);s(227);const R=e=>e&&"object"==typeof e?e:{handle:e};class v{constructor(e,t,s="GET"){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class C extends v{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class b{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const a=s.origin===location.origin,{params:n,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return;let o;try{o=i.handle({url:s,request:e,event:t,params:n})}catch(e){o=Promise.reject(e)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async a=>{if(h)try{return await h.handle({url:s,request:e,event:t,params:n})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:a}){const n=this._routes.get(s.method)||[];for(const r of n){let n;const i=r.match({url:e,sameOrigin:t,request:s,event:a});if(i)return n=i,(Array.isArray(n)&&0===n.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"==typeof i)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const s=this._routes.get(t.method).indexOf(t);if(!(s>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(s,1)}}let q;class U extends v{constructor(e,t){super((({request:s})=>{const a=e.getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:a=!0,urlManipulation:n}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(a){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(n){const e=n({url:r});for(const t of e)yield t.href}}(s.url,t)){const t=a.get(n);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}),e.strategy)}}var L;L=[{'revision':'c681780dee3654fd502c3cb1ed0bc958','url':'assets/icon.ico'},{'revision':'04baf0bd96c51061ade72019b276fa19','url':'assets/sounds/metronome/high.ogg'},{'revision':'82865f2b16a02de26df27adfaf024c55','url':'assets/sounds/metronome/low.ogg'},{'revision':'bab1bdb2f931d06af797b70faa356929','url':'assets/sounds/ui/menu_ding.wav'},{'revision':'cb8affb1812fc1591726a1740df2077f','url':'assets/sprites/countdown.png'},{'revision':'d204b9ac18869eb2dc5ade226678cb66','url':'assets/sprites/defaultTargetInner.png'},{'revision':'729fdd6f562ede8ae64b974c1b016d32','url':'assets/sprites/defaultTargetOuter.png'},{'revision':'2a7efd9cf2addb4d8c7b95267fcf2657','url':'assets/sprites/finger.png'},{'revision':'b0f665df8751c5a2aa39e7c535153d17','url':'assets/sprites/flare.png'},{'revision':'51e0571fbe4415db8dac79283fa20d85','url':'assets/ui/back_button.png'},{'revision':'2bb7a1584e2953224f6a7fe0dd79dddf','url':'assets/ui/calibration_background.png'},{'revision':'8c382d7ff3e652d67252ea30e7494b52','url':'assets/ui/default_level_background.png'},{'revision':'a60af6fc7fffb6a40650837a3e24d8dd','url':'assets/ui/default_preview_background.png'},{'revision':'e8f3412d336637cdfc9a48e213a09684','url':'assets/ui/easy_button.png'},{'revision':'ac839e30a9d4d642193d46ed54b4b97a','url':'assets/ui/empty_button.png'},{'revision':'a85231dbe5674905de23fccc44fad923','url':'assets/ui/hard_button.png'},{'revision':'c32ec8851cf5d8f66c547da52bcd0918','url':'assets/ui/info_background.png'},{'revision':'1989d155533325e4fcb4d08819b06e6b','url':'assets/ui/layer_score_background.png'},{'revision':'86d1a3566f11f28474ddb11f45bbf3ad','url':'assets/ui/left_arrow.png'},{'revision':'9081f9850823341d67211edf61330bfe','url':'assets/ui/medium_button.png'},{'revision':'4da8a2009798f052d5d49fc8446adef8','url':'assets/ui/menu_background.png'},{'revision':'52725945a4a6359f7a6a714be0ed5802','url':'assets/ui/menu_background_old.png'},{'revision':'c78af9c46a95daadbc8b4bb9d979ed13','url':'assets/ui/menu_logo.png'},{'revision':'3106244610ace2a29d54a78eac220c8c','url':'assets/ui/menu_options.png'},{'revision':'050f45e70e72aa8f724b7f7d35af230c','url':'assets/ui/menu_select_level.png'},{'revision':'47bb01c1e6ac1f4e0ba7275a3b21abb1','url':'assets/ui/menu_setup_camera.png'},{'revision':'d4278df95f99e0b68ca5598290f309af','url':'assets/ui/mute_button.png'},{'revision':'015692ea211877dfc12d305d3221b973','url':'assets/ui/options_background.png'},{'revision':'f8c919718c9f65591314d888f655e29f','url':'assets/ui/play_button.png'},{'revision':'de37ef4d2dfedc82df26a3bec80cabc1','url':'assets/ui/progress_bar_segment.png'},{'revision':'89c18f572e2170101d889e80f89f826c','url':'assets/ui/reset_button.png'},{'revision':'dda36e38b015753c42ae6e5ada19ab22','url':'assets/ui/right_arrow.png'},{'revision':'d5f4614987321c5380c6137f301e9667','url':'assets/ui/save_csv_button.png'},{'revision':'53feaa7ade2b2d35b5b9f7f0e5985aa5','url':'assets/ui/scoreboard_background.png'},{'revision':'30946fd16b96c40d948d064a35af235f','url':'assets/ui/skip_button.png'},{'revision':'21bc625a9d475c384f820ca1d3d535d4','url':'assets/ui/song_name_background.png'},{'revision':'d956352eef1e98efd783e2c57f33c783','url':'assets/ui/unmute_button.png'},{'revision':'761afc4b84de59f7c9207964ceecc5e6','url':'assets/ui/video_background.png'},{'revision':'949d704388a952da524f8852e7c71659','url':'data/config.json'},{'revision':'055e1d8cef57d9cc9489dbe3e8bcf340','url':'data/default_config.json'},{'revision':'c681780dee3654fd502c3cb1ed0bc958','url':'icon.ico'},{'revision':'2ffbc23293ee8a797bc61e9c02534206','url':'icons/icons-192.png'},{'revision':'8bdcc486cda9b423f50e886f2ddb6604','url':'icons/icons-512.png'},{'revision':'d5623c7ff6f026581e54a1a0dec6ac01','url':'index.html'},{'revision':'91cc0ea23ae645329b44bb99aee8219c','url':'levels/Birthday Vibes/background.png'},{'revision':'e36bb98c4966db215c2b8622f2a7ca9d','url':'levels/Birthday Vibes/bass/aSharp.ogg'},{'revision':'f03f404bc5d0565a517d18efb5c78c88','url':'levels/Birthday Vibes/bass/c.ogg'},{'revision':'9c97fc36c5b3cc1bca9eb6307520517d','url':'levels/Birthday Vibes/bass/d.ogg'},{'revision':'6e3e4de57f241cd0125161aa86be6cf5','url':'levels/Birthday Vibes/bass/dSharp.ogg'},{'revision':'769965b9d363e53297934d9b58b7d971','url':'levels/Birthday Vibes/bass/f.ogg'},{'revision':'6cfbeb319c80227a526e7fcd4d0986bf','url':'levels/Birthday Vibes/bass/g.ogg'},{'revision':'2954faf816f19648eb9d07c4c7d001c4','url':'levels/Birthday Vibes/bass/loop115.ogg'},{'revision':'e9cc89da6644958763f45b41591a252e','url':'levels/Birthday Vibes/bass/loop130.ogg'},{'revision':'56639388804acd365cde79f391dcebe3','url':'levels/Birthday Vibes/bass/loop90.ogg'},{'revision':'2d3b6bf55c61e4f848ec2f4429e6ccd7','url':'levels/Birthday Vibes/chords/chord1.ogg'},{'revision':'87818dab244c453c227ccdc8b69e9070','url':'levels/Birthday Vibes/chords/chord2.ogg'},{'revision':'9029f41da89a503862edbfced0782a23','url':'levels/Birthday Vibes/chords/chord3.ogg'},{'revision':'1eeb4f4b10f7c7ab2c1de496b06eb343','url':'levels/Birthday Vibes/chords/chord4.ogg'},{'revision':'9b76a5999ef6c41aa7e86df0a145a45c','url':'levels/Birthday Vibes/chords/loop115.ogg'},{'revision':'ebedb61cc4c7c33fb8aa542bfef09e73','url':'levels/Birthday Vibes/chords/loop130.ogg'},{'revision':'496c339b2ee8b40b7633d546b67cfae0','url':'levels/Birthday Vibes/chords/loop90.ogg'},{'revision':'18ef50099354c264a0bd7393bfa78d72','url':'levels/Birthday Vibes/drums/loop115.ogg'},{'revision':'0505ea764e9cc3447d7b1449a9b22abe','url':'levels/Birthday Vibes/drums/loop130.ogg'},{'revision':'fd0cb60d0ec7ae1c14fbfff81b457e6e','url':'levels/Birthday Vibes/drums/loop90.ogg'},{'revision':'668b12c7c58b56b79930a98af41c5142','url':'levels/Birthday Vibes/info.json'},{'revision':'09461d99ddcfe8ab90cac446cc885f41','url':'levels/Birthday Vibes/lead/aSharp.ogg'},{'revision':'808ae6c59ed3b2921a92d30138b11ff3','url':'levels/Birthday Vibes/lead/c.ogg'},{'revision':'39b00f2242535dccf96f6d08e43f2193','url':'levels/Birthday Vibes/lead/d.ogg'},{'revision':'e490eb41abf5f2732f21cd2447df8e7b','url':'levels/Birthday Vibes/lead/f.ogg'},{'revision':'bed79fa63308fd0cc2a3900ce7ed3fd0','url':'levels/Birthday Vibes/lead/g.ogg'},{'revision':'d36071dec9c01a558570656269df91c5','url':'levels/Birthday Vibes/lead/loop115.ogg'},{'revision':'5ab47584d43dd93738a18b4d50d04ffb','url':'levels/Birthday Vibes/lead/loop130.ogg'},{'revision':'a4d69d7140d3cf720c25cbcb2f0f484e','url':'levels/Birthday Vibes/lead/loop90.ogg'},{'revision':'14c27cd558ae8bd762c8b2e9e6a9f9ad','url':'levels/Cheerful Bliss/background.png'},{'revision':'07a973a9d19d92ccf89da72f79c88fa5','url':'levels/Cheerful Bliss/bass/a_2.ogg'},{'revision':'89a012c062ef57ba204de0f41a2a06be','url':'levels/Cheerful Bliss/bass/c_4.ogg'},{'revision':'37bd9234c3754f928596915c1d933b6d','url':'levels/Cheerful Bliss/bass/c_6.ogg'},{'revision':'60b1c56a677e6e5ec2c3d367b0489580','url':'levels/Cheerful Bliss/bass/d_2.ogg'},{'revision':'fad311d497c8162db1768f2fc1142cd2','url':'levels/Cheerful Bliss/bass/d_4.ogg'},{'revision':'631f24ff453b1dfce2526af63f836de3','url':'levels/Cheerful Bliss/bass/d_6.ogg'},{'revision':'7e7393c367c1db6d83e8de7bc38a0925','url':'levels/Cheerful Bliss/bass/e_4.ogg'},{'revision':'17e7a8bdced7502659c4c1c9bebacf01','url':'levels/Cheerful Bliss/bass/e_6.ogg'},{'revision':'2e99bcadf6971cbc860200b9978bc272','url':'levels/Cheerful Bliss/bass/e_8.ogg'},{'revision':'fe6c5e3a7649d11f6a94c055157b05ca','url':'levels/Cheerful Bliss/bass/f_4.ogg'},{'revision':'71e6f11d0a6f647276db5bc0018ae47f','url':'levels/Cheerful Bliss/bass/f_6.ogg'},{'revision':'22aaa8b34a46ec4e06c3b20c054aa476','url':'levels/Cheerful Bliss/bass/f_8.ogg'},{'revision':'4fec011463a2f6712860a3158f73376d','url':'levels/Cheerful Bliss/bass/g_2.ogg'},{'revision':'ef0bc7b422872c057df5c8156e866f1f','url':'levels/Cheerful Bliss/bass/g_4.ogg'},{'revision':'5dc54227e051e6bc248c78b94be6afc0','url':'levels/Cheerful Bliss/bass/loop115.ogg'},{'revision':'548357122c5acb58e60d2c752ee2ab65','url':'levels/Cheerful Bliss/bass/loop130.ogg'},{'revision':'946c0140b302fe7a464ff0b6cd44e3b1','url':'levels/Cheerful Bliss/bass/loop90.ogg'},{'revision':'7c26650ba4def7fc6f44dad6c10d32d3','url':'levels/Cheerful Bliss/chords/chord1.ogg'},{'revision':'cf0d0d6c90c964a16fa25711faf80059','url':'levels/Cheerful Bliss/chords/chord25.ogg'},{'revision':'93681c88742fb5709ccc25c7d4b1243f','url':'levels/Cheerful Bliss/chords/chord3.ogg'},{'revision':'e53f2c311483be153f046f66647945ab','url':'levels/Cheerful Bliss/chords/chord4.ogg'},{'revision':'dd6d02a162f588a03e501702eb538dd7','url':'levels/Cheerful Bliss/chords/chord6.ogg'},{'revision':'596c8b04f33e07ab548916e296efb07e','url':'levels/Cheerful Bliss/chords/chord7.ogg'},{'revision':'ae71669a0e61c7a49d2e4eb5db2b3670','url':'levels/Cheerful Bliss/chords/chord8.ogg'},{'revision':'9b877e271ed4f1ec1477f0c19a9a57a9','url':'levels/Cheerful Bliss/chords/loop115.ogg'},{'revision':'ec45003ffa95e1ea3da31c29ea58bb56','url':'levels/Cheerful Bliss/chords/loop130.ogg'},{'revision':'7867203adb517bcea0a08d4e498161f0','url':'levels/Cheerful Bliss/chords/loop90.ogg'},{'revision':'12458982bc1b46f76a51318891ea3633','url':'levels/Cheerful Bliss/drums/loop115.ogg'},{'revision':'0171ad237e329ac55b73bfd746c3e8e7','url':'levels/Cheerful Bliss/drums/loop130.ogg'},{'revision':'2dac94a241b368764775f633d44de613','url':'levels/Cheerful Bliss/drums/loop90.ogg'},{'revision':'d27b799933952354f26573be55a0cd72','url':'levels/Cheerful Bliss/info.json'},{'revision':'849f32a41d7c859b68879919b46d292b','url':'levels/Cheerful Bliss/lead/a5_4.ogg'},{'revision':'1059d3b8462ab4a89bbe1dade63717b2','url':'levels/Cheerful Bliss/lead/a6_4.ogg'},{'revision':'97f04b22450c4f1e4bc7628f83a71d68','url':'levels/Cheerful Bliss/lead/a6_6.ogg'},{'revision':'ee88d3a026315e20a4e97aeb6794f29c','url':'levels/Cheerful Bliss/lead/a6_8.ogg'},{'revision':'ff804e1146bc8257655d9ff684f19bd6','url':'levels/Cheerful Bliss/lead/b5_4.ogg'},{'revision':'05ebce42dc8eb8a4aa11ee552134e12b','url':'levels/Cheerful Bliss/lead/b5_6.ogg'},{'revision':'54a5e4073c64ddb5a53f18eaf7cff616','url':'levels/Cheerful Bliss/lead/b6_4.ogg'},{'revision':'a0d8c4cf886b2fed74259c32853bfe62','url':'levels/Cheerful Bliss/lead/b6_6.ogg'},{'revision':'7dfed1d9764492a5f71439d67ba22c24','url':'levels/Cheerful Bliss/lead/c_2.ogg'},{'revision':'a1b93f86f6682154f081af23f98d33a5','url':'levels/Cheerful Bliss/lead/c_4.ogg'},{'revision':'dcab39c62537f34bc4282b4e8a238eeb','url':'levels/Cheerful Bliss/lead/c_6.ogg'},{'revision':'2a51ae64766eaa1e43a2e9a05b20b923','url':'levels/Cheerful Bliss/lead/d_2.ogg'},{'revision':'4975d6a7b1ae3a4d3a33412ec0815ff9','url':'levels/Cheerful Bliss/lead/d_4.ogg'},{'revision':'58bcd985eddc7fa0ed9ce6775b40a983','url':'levels/Cheerful Bliss/lead/e_12.ogg'},{'revision':'67d2884e9b196bc12e086cb1a5721c74','url':'levels/Cheerful Bliss/lead/e_2.ogg'},{'revision':'b49c04c46c92dbf9f2974123f9a71fc8','url':'levels/Cheerful Bliss/lead/e_4.ogg'},{'revision':'e5817ae87828e55f1daf478df329f5dd','url':'levels/Cheerful Bliss/lead/f_6.ogg'},{'revision':'f4b374b721a3d74a77ddb2d57b823d69','url':'levels/Cheerful Bliss/lead/g_6.ogg'},{'revision':'eca66f02ad758df9a5f2594227956424','url':'levels/Cheerful Bliss/lead/loop115.ogg'},{'revision':'5a3a87524351a8016154631fc59467c0','url':'levels/Cheerful Bliss/lead/loop130.ogg'},{'revision':'3b8cb9f03ce82ec6b6974b076f3cb4fa','url':'levels/Cheerful Bliss/lead/loop90.ogg'},{'revision':'8c382d7ff3e652d67252ea30e7494b52','url':'levels/Slow Elegance/background.png'},{'revision':'056c74631114c05f31a873d4716b8333','url':'levels/Slow Elegance/bass/dSharp_2.ogg'},{'revision':'665c119a6ba5012b710a4b52d2cfc433','url':'levels/Slow Elegance/bass/dSharp_6.ogg'},{'revision':'4a90c6f02c3d01d6327680544cfdf3b5','url':'levels/Slow Elegance/bass/f_2.ogg'},{'revision':'f52e75cd172c482e85f97eb4d20b4c3d','url':'levels/Slow Elegance/bass/f_6.ogg'},{'revision':'f9597565917ec75a91e4f7e7fe108b2b','url':'levels/Slow Elegance/bass/gSharp_2.ogg'},{'revision':'f75905f2127540f69d66976fb8759f03','url':'levels/Slow Elegance/bass/gSharp_6.ogg'},{'revision':'c63620e89c687f3e7bf63a125c550cd5','url':'levels/Slow Elegance/bass/loop115.ogg'},{'revision':'7ab5e763e4728a99a87fa82f4badedea','url':'levels/Slow Elegance/bass/loop130.ogg'},{'revision':'e6e80a470e78fe57858f952b4ff7b253','url':'levels/Slow Elegance/bass/loop90.ogg'},{'revision':'a8c517a8030e657c7fabdd9767a53223','url':'levels/Slow Elegance/chords/chord1.ogg'},{'revision':'7b9bfd7dd90baeb491dfb5cadb3fc53b','url':'levels/Slow Elegance/chords/chord278.ogg'},{'revision':'0e05b1d77a7f74bb6f0edfbfe0ffa6c2','url':'levels/Slow Elegance/chords/chord3.ogg'},{'revision':'be2262ae377c935d4a9ccc6afe323e66','url':'levels/Slow Elegance/chords/chord4.ogg'},{'revision':'05830c1990ebbd467a135ce603621503','url':'levels/Slow Elegance/chords/chord5.ogg'},{'revision':'499a575af7a1227d3d35dede48d26591','url':'levels/Slow Elegance/chords/chord6.ogg'},{'revision':'3b6df5720bfaa4b41a6fdfeff971aad7','url':'levels/Slow Elegance/chords/loop115.ogg'},{'revision':'25c215e8b2fc4e54e071f26b61f2932e','url':'levels/Slow Elegance/chords/loop130.ogg'},{'revision':'38b3bbfbebaf9fa2dd9d6b5035fa3dfb','url':'levels/Slow Elegance/chords/loop90.ogg'},{'revision':'39bcea003867cebf677e07ea42965d1f','url':'levels/Slow Elegance/drums/loop115.ogg'},{'revision':'7043d3c3409a1cdaf58346e41854156e','url':'levels/Slow Elegance/drums/loop130.ogg'},{'revision':'810d6336f63471aa63aa9e774cf16393','url':'levels/Slow Elegance/drums/loop90.ogg'},{'revision':'8507c62fa3071335f15501d1530d2fb2','url':'levels/Slow Elegance/info.json'},{'revision':'6c943b72c3132a9ea2b7511b5a37244f','url':'levels/Slow Elegance/lead/dSharp.ogg'},{'revision':'505fa45b1cd9a78f466c163ec827213c','url':'levels/Slow Elegance/lead/f.ogg'},{'revision':'bd4d127d96d4b5ac0f8ed53e7e1edbb8','url':'levels/Slow Elegance/lead/gSharp.ogg'},{'revision':'4a9850fa003d9b9421f85c441f103003','url':'levels/Slow Elegance/lead/loop115.ogg'},{'revision':'8fd04ba9b3754b56e0ff82bad227fa8e','url':'levels/Slow Elegance/lead/loop130.ogg'},{'revision':'397dcccb47b07ee0f8951c52f72ba75b','url':'levels/Slow Elegance/lead/loop90.ogg'},{'revision':null,'url':'main.674ec38ac0d5ea71c60f.bundle.js'},{'revision':'ff0d08eca92dee1c2fc3a94297f58aeb','url':'manifest.json'},{'revision':'1c82a62b1efab53d88dc30fbca1ebf35','url':'models/wasm/vision_wasm_internal.js'},{'revision':'9e17f59784cc3e9f46b7b4cb8c1aab05','url':'models/wasm/vision_wasm_nosimd_internal.js'},{'revision':null,'url':'vendors.8f84529342dee7f75523.bundle.js'},{'revision':'abe37cad993b76215dcf09b2f6518e80','url':'vendors.8f84529342dee7f75523.bundle.js.LICENSE.txt'}],_().precache(L),function(t){const s=_();!function(t,s,a){let n;if("string"==typeof t){const e=new URL(t,location.href);n=new v((({url:t})=>t.href===e.href),s,a)}else if(t instanceof RegExp)n=new C(t,s,a);else if("function"==typeof t)n=new v(t,s,a);else{if(!(t instanceof v))throw new e("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=t}(q||(q=new b,q.addFetchListener(),q.addCacheListener()),q).registerRoute(n)}(new U(s,t))}(undefined)})()})(); \ No newline at end of file +(()=>{"use strict";var e={136:()=>{try{self["workbox:core:7.0.0"]&&_()}catch(e){}},447:()=>{try{self["workbox:precaching:7.0.0"]&&_()}catch(e){}},227:()=>{try{self["workbox:routing:7.0.0"]&&_()}catch(e){}},390:()=>{try{self["workbox:strategies:7.0.0"]&&_()}catch(e){}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,s),r.exports}(()=>{s(136);class e extends Error{constructor(e,t){super(((e,...t)=>{let s=e;return t.length>0&&(s+=` :: ${JSON.stringify(t)}`),s})(e,t)),this.name=e,this.details=t}}const t={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},a=e=>[t.prefix,e,t.suffix].filter((e=>e&&e.length>0)).join("-"),n=e=>e||a(t.precache);function r(e,t){const s=t();return e.waitUntil(s),s}function i(t){if(!t)throw new e("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:s,url:a}=t;if(!a)throw new e("add-to-cache-list-unexpected-type",{entry:t});if(!s){const e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}const n=new URL(a,location.href),r=new URL(a,location.href);return n.searchParams.set("__WB_REVISION__",s),{cacheKey:n.href,url:r.href}}s(447);class c{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if("install"===e.type&&t&&t.originalRequest&&t.originalRequest instanceof Request){const e=t.originalRequest.url;s?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return s}}}class o{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:e,params:t})=>{const s=(null==t?void 0:t.cacheKey)||this._precacheController.getCacheKeyForURL(e.url);return s?new Request(s,{headers:e.headers}):e},this._precacheController=e}}let h;function l(e,t){const s=new URL(e);for(const e of t)s.searchParams.delete(e);return s.href}class u{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}const d=new Set;function f(e){return"string"==typeof e?new Request(e):e}s(390);class p{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new u,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:s}=this;let a=f(t);if("navigate"===a.mode&&s instanceof FetchEvent&&s.preloadResponse){const e=await s.preloadResponse;if(e)return e}const n=this.hasCallback("fetchDidFail")?a.clone():null;try{for(const e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:s})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=a.clone();try{let e;e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions);for(const t of this.iterateCallbacks("fetchDidSucceed"))e=await t({event:s,request:r,response:e});return e}catch(e){throw n&&await this.runCallbacks("fetchDidFail",{error:e,event:s,originalRequest:n.clone(),request:r.clone()}),e}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=f(e);let s;const{cacheName:a,matchOptions:n}=this._strategy,r=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},n),{cacheName:a});s=await caches.match(r,i);for(const e of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await e({cacheName:a,matchOptions:n,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,s){const a=f(t);await(0,new Promise((e=>setTimeout(e,0))));const n=await this.getCacheKey(a,"write");if(!s)throw new e("cache-put-with-no-response",{url:(r=n.url,new URL(String(r),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var r;const i=await this._ensureResponseSafeToCache(s);if(!i)return!1;const{cacheName:c,matchOptions:o}=this._strategy,h=await self.caches.open(c),u=this.hasCallback("cacheDidUpdate"),p=u?await async function(e,t,s,a){const n=l(t.url,s);if(t.url===n)return e.match(t,a);const r=Object.assign(Object.assign({},a),{ignoreSearch:!0}),i=await e.keys(t,r);for(const t of i)if(n===l(t.url,s))return e.match(t,a)}(h,n.clone(),["__WB_REVISION__"],o):null;try{await h.put(n,u?i.clone():i)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await async function(){for(const e of d)await e()}(),e}for(const e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:c,oldResponse:p,newResponse:i.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let a=e;for(const e of this.iterateCallbacks("cacheKeyWillBeUsed"))a=f(await e({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[s]=a}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const s=this._pluginStateMap.get(t),a=a=>{const n=Object.assign(Object.assign({},a),{state:s});return t[e](n)};yield a}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&200!==t.status&&(t=void 0),t}}class g{constructor(e={}){this.cacheName=e.cacheName||a(t.runtime),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s="string"==typeof e.request?new Request(e.request):e.request,a="params"in e?e.params:void 0,n=new p(this,{event:t,request:s,params:a}),r=this._getResponse(n,s,t);return[r,this._awaitComplete(r,n,s,t)]}async _getResponse(t,s,a){let n;await t.runCallbacks("handlerWillStart",{event:a,request:s});try{if(n=await this._handle(s,t),!n||"error"===n.type)throw new e("no-response",{url:s.url})}catch(e){if(e instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(n=await r({error:e,event:a,request:s}),n)break;if(!n)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))n=await e({event:a,request:s,response:n});return n}async _awaitComplete(e,t,s,a){let n,r;try{n=await e}catch(r){}try{await t.runCallbacks("handlerDidRespond",{event:a,request:s,response:n}),await t.doneWaiting()}catch(e){e instanceof Error&&(r=e)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:s,response:n,error:r}),t.destroy(),r)throw r}}class y extends g{constructor(e={}){e.cacheName=n(e.cacheName),super(e),this._fallbackToNetwork=!1!==e.fallbackToNetwork,this.plugins.push(y.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){return await t.cacheMatch(e)||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(t,s){let a;const n=s.params||{};if(!this._fallbackToNetwork)throw new e("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const e=n.integrity,r=t.integrity,i=!r||r===e;a=await s.fetch(new Request(t,{integrity:"no-cors"!==t.mode?r||e:void 0})),e&&i&&"no-cors"!==t.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await s.cachePut(t,a.clone()))}return a}async _handleInstall(t,s){this._useDefaultCacheabilityPluginIfNeeded();const a=await s.fetch(t);if(!await s.cachePut(t,a.clone()))throw new e("bad-precaching-response",{url:t.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,a]of this.plugins.entries())a!==y.copyRedirectedCacheableResponsesPlugin&&(a===y.defaultPrecacheCacheabilityPlugin&&(e=s),a.cacheWillUpdate&&t++);0===t?this.plugins.push(y.defaultPrecacheCacheabilityPlugin):t>1&&null!==e&&this.plugins.splice(e,1)}}y.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e},y.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await async function(t,s){let a=null;if(t.url&&(a=new URL(t.url).origin),a!==self.location.origin)throw new e("cross-origin-copy-response",{origin:a});const n=t.clone(),r={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},i=s?s(r):r,c=function(){if(void 0===h){const e=new Response("");if("body"in e)try{new Response(e.body),h=!0}catch(e){h=!1}h=!1}return h}()?n.body:await n.blob();return new Response(c,i)}(t):t};class w{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new y({cacheName:n(e),plugins:[...t,new o({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(t){const s=[];for(const a of t){"string"==typeof a?s.push(a):a&&void 0===a.revision&&s.push(a.url);const{cacheKey:t,url:n}=i(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(n)&&this._urlsToCacheKeys.get(n)!==t)throw new e("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(n),secondEntry:t});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(t)&&this._cacheKeysToIntegrities.get(t)!==a.integrity)throw new e("add-to-cache-list-conflicting-integrities",{url:n});this._cacheKeysToIntegrities.set(t,a.integrity)}if(this._urlsToCacheKeys.set(n,t),this._urlsToCacheModes.set(n,r),s.length>0){const e=`Workbox is precaching URLs without revision info: ${s.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(e)}}}install(e){return r(e,(async()=>{const t=new c;this.strategy.plugins.push(t);for(const[t,s]of this._urlsToCacheKeys){const a=this._cacheKeysToIntegrities.get(s),n=this._urlsToCacheModes.get(t),r=new Request(t,{integrity:a,cache:n,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:e}))}const{updatedURLs:s,notUpdatedURLs:a}=t;return{updatedURLs:s,notUpdatedURLs:a}}))}activate(e){return r(e,(async()=>{const e=await self.caches.open(this.strategy.cacheName),t=await e.keys(),s=new Set(this._urlsToCacheKeys.values()),a=[];for(const n of t)s.has(n.url)||(await e.delete(n),a.push(n.url));return{deletedURLs:a}}))}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(t){const s=this.getCacheKeyForURL(t);if(!s)throw new e("non-precached-url",{url:t});return e=>(e.request=new Request(t),e.params=Object.assign({cacheKey:s},e.params),this.strategy.handle(e))}}let m;const _=()=>(m||(m=new w),m);s(227);const R=e=>e&&"object"==typeof e?e:{handle:e};class v{constructor(e,t,s="GET"){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class C extends v{constructor(e,t,s){super((({url:t})=>{const s=e.exec(t.href);if(s&&(t.origin===location.origin||0===s.index))return s.slice(1)}),t,s)}}class b{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const s=new Request(...t);return this.handleRequest({request:s,event:e})})));e.waitUntil(s),e.ports&&e.ports[0]&&s.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const a=s.origin===location.origin,{params:n,route:r}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:s});let i=r&&r.handler;const c=e.method;if(!i&&this._defaultHandlerMap.has(c)&&(i=this._defaultHandlerMap.get(c)),!i)return;let o;try{o=i.handle({url:s,request:e,event:t,params:n})}catch(e){o=Promise.reject(e)}const h=r&&r.catchHandler;return o instanceof Promise&&(this._catchHandler||h)&&(o=o.catch((async a=>{if(h)try{return await h.handle({url:s,request:e,event:t,params:n})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a}))),o}findMatchingRoute({url:e,sameOrigin:t,request:s,event:a}){const n=this._routes.get(s.method)||[];for(const r of n){let n;const i=r.match({url:e,sameOrigin:t,request:s,event:a});if(i)return n=i,(Array.isArray(n)&&0===n.length||i.constructor===Object&&0===Object.keys(i).length||"boolean"==typeof i)&&(n=void 0),{route:r,params:n}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const s=this._routes.get(t.method).indexOf(t);if(!(s>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(s,1)}}let q;class U extends v{constructor(e,t){super((({request:s})=>{const a=e.getURLsToCacheKeys();for(const n of function*(e,{ignoreURLParametersMatching:t=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:a=!0,urlManipulation:n}={}){const r=new URL(e,location.href);r.hash="",yield r.href;const i=function(e,t=[]){for(const s of[...e.searchParams.keys()])t.some((e=>e.test(s)))&&e.searchParams.delete(s);return e}(r,t);if(yield i.href,s&&i.pathname.endsWith("/")){const e=new URL(i.href);e.pathname+=s,yield e.href}if(a){const e=new URL(i.href);e.pathname+=".html",yield e.href}if(n){const e=n({url:r});for(const t of e)yield t.href}}(s.url,t)){const t=a.get(n);if(t)return{cacheKey:t,integrity:e.getIntegrityForCacheKey(t)}}}),e.strategy)}}var L;L=[{'revision':'c681780dee3654fd502c3cb1ed0bc958','url':'assets/icon.ico'},{'revision':'04baf0bd96c51061ade72019b276fa19','url':'assets/sounds/metronome/high.ogg'},{'revision':'82865f2b16a02de26df27adfaf024c55','url':'assets/sounds/metronome/low.ogg'},{'revision':'bab1bdb2f931d06af797b70faa356929','url':'assets/sounds/ui/menu_ding.wav'},{'revision':'cb8affb1812fc1591726a1740df2077f','url':'assets/sprites/countdown.png'},{'revision':'d204b9ac18869eb2dc5ade226678cb66','url':'assets/sprites/defaultTargetInner.png'},{'revision':'729fdd6f562ede8ae64b974c1b016d32','url':'assets/sprites/defaultTargetOuter.png'},{'revision':'2a7efd9cf2addb4d8c7b95267fcf2657','url':'assets/sprites/finger.png'},{'revision':'b0f665df8751c5a2aa39e7c535153d17','url':'assets/sprites/flare.png'},{'revision':'51e0571fbe4415db8dac79283fa20d85','url':'assets/ui/back_button.png'},{'revision':'2bb7a1584e2953224f6a7fe0dd79dddf','url':'assets/ui/calibration_background.png'},{'revision':'8c382d7ff3e652d67252ea30e7494b52','url':'assets/ui/default_level_background.png'},{'revision':'a60af6fc7fffb6a40650837a3e24d8dd','url':'assets/ui/default_preview_background.png'},{'revision':'e8f3412d336637cdfc9a48e213a09684','url':'assets/ui/easy_button.png'},{'revision':'ac839e30a9d4d642193d46ed54b4b97a','url':'assets/ui/empty_button.png'},{'revision':'a85231dbe5674905de23fccc44fad923','url':'assets/ui/hard_button.png'},{'revision':'c32ec8851cf5d8f66c547da52bcd0918','url':'assets/ui/info_background.png'},{'revision':'1989d155533325e4fcb4d08819b06e6b','url':'assets/ui/layer_score_background.png'},{'revision':'86d1a3566f11f28474ddb11f45bbf3ad','url':'assets/ui/left_arrow.png'},{'revision':'9081f9850823341d67211edf61330bfe','url':'assets/ui/medium_button.png'},{'revision':'4da8a2009798f052d5d49fc8446adef8','url':'assets/ui/menu_background.png'},{'revision':'52725945a4a6359f7a6a714be0ed5802','url':'assets/ui/menu_background_old.png'},{'revision':'c78af9c46a95daadbc8b4bb9d979ed13','url':'assets/ui/menu_logo.png'},{'revision':'3106244610ace2a29d54a78eac220c8c','url':'assets/ui/menu_options.png'},{'revision':'050f45e70e72aa8f724b7f7d35af230c','url':'assets/ui/menu_select_level.png'},{'revision':'47bb01c1e6ac1f4e0ba7275a3b21abb1','url':'assets/ui/menu_setup_camera.png'},{'revision':'d4278df95f99e0b68ca5598290f309af','url':'assets/ui/mute_button.png'},{'revision':'015692ea211877dfc12d305d3221b973','url':'assets/ui/options_background.png'},{'revision':'f8c919718c9f65591314d888f655e29f','url':'assets/ui/play_button.png'},{'revision':'de37ef4d2dfedc82df26a3bec80cabc1','url':'assets/ui/progress_bar_segment.png'},{'revision':'89c18f572e2170101d889e80f89f826c','url':'assets/ui/reset_button.png'},{'revision':'dda36e38b015753c42ae6e5ada19ab22','url':'assets/ui/right_arrow.png'},{'revision':'d5f4614987321c5380c6137f301e9667','url':'assets/ui/save_csv_button.png'},{'revision':'53feaa7ade2b2d35b5b9f7f0e5985aa5','url':'assets/ui/scoreboard_background.png'},{'revision':'30946fd16b96c40d948d064a35af235f','url':'assets/ui/skip_button.png'},{'revision':'21bc625a9d475c384f820ca1d3d535d4','url':'assets/ui/song_name_background.png'},{'revision':'d956352eef1e98efd783e2c57f33c783','url':'assets/ui/unmute_button.png'},{'revision':'761afc4b84de59f7c9207964ceecc5e6','url':'assets/ui/video_background.png'},{'revision':'ac7c0657751250603e4469977db9c283','url':'data/config.json'},{'revision':'ac7c0657751250603e4469977db9c283','url':'data/default_config.json'},{'revision':'c681780dee3654fd502c3cb1ed0bc958','url':'icon.ico'},{'revision':'c681780dee3654fd502c3cb1ed0bc958','url':'icons/icon.ico'},{'revision':'5506e7d2dc3e0cb57cfc9f7cea715948','url':'index.html'},{'revision':'91cc0ea23ae645329b44bb99aee8219c','url':'levels/Birthday Vibes/background.png'},{'revision':'e36bb98c4966db215c2b8622f2a7ca9d','url':'levels/Birthday Vibes/bass/aSharp.ogg'},{'revision':'f03f404bc5d0565a517d18efb5c78c88','url':'levels/Birthday Vibes/bass/c.ogg'},{'revision':'9c97fc36c5b3cc1bca9eb6307520517d','url':'levels/Birthday Vibes/bass/d.ogg'},{'revision':'6e3e4de57f241cd0125161aa86be6cf5','url':'levels/Birthday Vibes/bass/dSharp.ogg'},{'revision':'769965b9d363e53297934d9b58b7d971','url':'levels/Birthday Vibes/bass/f.ogg'},{'revision':'6cfbeb319c80227a526e7fcd4d0986bf','url':'levels/Birthday Vibes/bass/g.ogg'},{'revision':'2954faf816f19648eb9d07c4c7d001c4','url':'levels/Birthday Vibes/bass/loop115.ogg'},{'revision':'e9cc89da6644958763f45b41591a252e','url':'levels/Birthday Vibes/bass/loop130.ogg'},{'revision':'56639388804acd365cde79f391dcebe3','url':'levels/Birthday Vibes/bass/loop90.ogg'},{'revision':'2d3b6bf55c61e4f848ec2f4429e6ccd7','url':'levels/Birthday Vibes/chords/chord1.ogg'},{'revision':'87818dab244c453c227ccdc8b69e9070','url':'levels/Birthday Vibes/chords/chord2.ogg'},{'revision':'9029f41da89a503862edbfced0782a23','url':'levels/Birthday Vibes/chords/chord3.ogg'},{'revision':'1eeb4f4b10f7c7ab2c1de496b06eb343','url':'levels/Birthday Vibes/chords/chord4.ogg'},{'revision':'9b76a5999ef6c41aa7e86df0a145a45c','url':'levels/Birthday Vibes/chords/loop115.ogg'},{'revision':'ebedb61cc4c7c33fb8aa542bfef09e73','url':'levels/Birthday Vibes/chords/loop130.ogg'},{'revision':'496c339b2ee8b40b7633d546b67cfae0','url':'levels/Birthday Vibes/chords/loop90.ogg'},{'revision':'18ef50099354c264a0bd7393bfa78d72','url':'levels/Birthday Vibes/drums/loop115.ogg'},{'revision':'0505ea764e9cc3447d7b1449a9b22abe','url':'levels/Birthday Vibes/drums/loop130.ogg'},{'revision':'fd0cb60d0ec7ae1c14fbfff81b457e6e','url':'levels/Birthday Vibes/drums/loop90.ogg'},{'revision':'668b12c7c58b56b79930a98af41c5142','url':'levels/Birthday Vibes/info.json'},{'revision':'09461d99ddcfe8ab90cac446cc885f41','url':'levels/Birthday Vibes/lead/aSharp.ogg'},{'revision':'808ae6c59ed3b2921a92d30138b11ff3','url':'levels/Birthday Vibes/lead/c.ogg'},{'revision':'39b00f2242535dccf96f6d08e43f2193','url':'levels/Birthday Vibes/lead/d.ogg'},{'revision':'e490eb41abf5f2732f21cd2447df8e7b','url':'levels/Birthday Vibes/lead/f.ogg'},{'revision':'bed79fa63308fd0cc2a3900ce7ed3fd0','url':'levels/Birthday Vibes/lead/g.ogg'},{'revision':'d36071dec9c01a558570656269df91c5','url':'levels/Birthday Vibes/lead/loop115.ogg'},{'revision':'5ab47584d43dd93738a18b4d50d04ffb','url':'levels/Birthday Vibes/lead/loop130.ogg'},{'revision':'a4d69d7140d3cf720c25cbcb2f0f484e','url':'levels/Birthday Vibes/lead/loop90.ogg'},{'revision':'14c27cd558ae8bd762c8b2e9e6a9f9ad','url':'levels/Cheerful Bliss/background.png'},{'revision':'07a973a9d19d92ccf89da72f79c88fa5','url':'levels/Cheerful Bliss/bass/a_2.ogg'},{'revision':'89a012c062ef57ba204de0f41a2a06be','url':'levels/Cheerful Bliss/bass/c_4.ogg'},{'revision':'37bd9234c3754f928596915c1d933b6d','url':'levels/Cheerful Bliss/bass/c_6.ogg'},{'revision':'60b1c56a677e6e5ec2c3d367b0489580','url':'levels/Cheerful Bliss/bass/d_2.ogg'},{'revision':'fad311d497c8162db1768f2fc1142cd2','url':'levels/Cheerful Bliss/bass/d_4.ogg'},{'revision':'631f24ff453b1dfce2526af63f836de3','url':'levels/Cheerful Bliss/bass/d_6.ogg'},{'revision':'7e7393c367c1db6d83e8de7bc38a0925','url':'levels/Cheerful Bliss/bass/e_4.ogg'},{'revision':'17e7a8bdced7502659c4c1c9bebacf01','url':'levels/Cheerful Bliss/bass/e_6.ogg'},{'revision':'2e99bcadf6971cbc860200b9978bc272','url':'levels/Cheerful Bliss/bass/e_8.ogg'},{'revision':'fe6c5e3a7649d11f6a94c055157b05ca','url':'levels/Cheerful Bliss/bass/f_4.ogg'},{'revision':'71e6f11d0a6f647276db5bc0018ae47f','url':'levels/Cheerful Bliss/bass/f_6.ogg'},{'revision':'22aaa8b34a46ec4e06c3b20c054aa476','url':'levels/Cheerful Bliss/bass/f_8.ogg'},{'revision':'4fec011463a2f6712860a3158f73376d','url':'levels/Cheerful Bliss/bass/g_2.ogg'},{'revision':'ef0bc7b422872c057df5c8156e866f1f','url':'levels/Cheerful Bliss/bass/g_4.ogg'},{'revision':'5dc54227e051e6bc248c78b94be6afc0','url':'levels/Cheerful Bliss/bass/loop115.ogg'},{'revision':'548357122c5acb58e60d2c752ee2ab65','url':'levels/Cheerful Bliss/bass/loop130.ogg'},{'revision':'946c0140b302fe7a464ff0b6cd44e3b1','url':'levels/Cheerful Bliss/bass/loop90.ogg'},{'revision':'7c26650ba4def7fc6f44dad6c10d32d3','url':'levels/Cheerful Bliss/chords/chord1.ogg'},{'revision':'cf0d0d6c90c964a16fa25711faf80059','url':'levels/Cheerful Bliss/chords/chord25.ogg'},{'revision':'93681c88742fb5709ccc25c7d4b1243f','url':'levels/Cheerful Bliss/chords/chord3.ogg'},{'revision':'e53f2c311483be153f046f66647945ab','url':'levels/Cheerful Bliss/chords/chord4.ogg'},{'revision':'dd6d02a162f588a03e501702eb538dd7','url':'levels/Cheerful Bliss/chords/chord6.ogg'},{'revision':'596c8b04f33e07ab548916e296efb07e','url':'levels/Cheerful Bliss/chords/chord7.ogg'},{'revision':'ae71669a0e61c7a49d2e4eb5db2b3670','url':'levels/Cheerful Bliss/chords/chord8.ogg'},{'revision':'9b877e271ed4f1ec1477f0c19a9a57a9','url':'levels/Cheerful Bliss/chords/loop115.ogg'},{'revision':'ec45003ffa95e1ea3da31c29ea58bb56','url':'levels/Cheerful Bliss/chords/loop130.ogg'},{'revision':'7867203adb517bcea0a08d4e498161f0','url':'levels/Cheerful Bliss/chords/loop90.ogg'},{'revision':'12458982bc1b46f76a51318891ea3633','url':'levels/Cheerful Bliss/drums/loop115.ogg'},{'revision':'0171ad237e329ac55b73bfd746c3e8e7','url':'levels/Cheerful Bliss/drums/loop130.ogg'},{'revision':'2dac94a241b368764775f633d44de613','url':'levels/Cheerful Bliss/drums/loop90.ogg'},{'revision':'d27b799933952354f26573be55a0cd72','url':'levels/Cheerful Bliss/info.json'},{'revision':'849f32a41d7c859b68879919b46d292b','url':'levels/Cheerful Bliss/lead/a5_4.ogg'},{'revision':'1059d3b8462ab4a89bbe1dade63717b2','url':'levels/Cheerful Bliss/lead/a6_4.ogg'},{'revision':'97f04b22450c4f1e4bc7628f83a71d68','url':'levels/Cheerful Bliss/lead/a6_6.ogg'},{'revision':'ee88d3a026315e20a4e97aeb6794f29c','url':'levels/Cheerful Bliss/lead/a6_8.ogg'},{'revision':'ff804e1146bc8257655d9ff684f19bd6','url':'levels/Cheerful Bliss/lead/b5_4.ogg'},{'revision':'05ebce42dc8eb8a4aa11ee552134e12b','url':'levels/Cheerful Bliss/lead/b5_6.ogg'},{'revision':'54a5e4073c64ddb5a53f18eaf7cff616','url':'levels/Cheerful Bliss/lead/b6_4.ogg'},{'revision':'a0d8c4cf886b2fed74259c32853bfe62','url':'levels/Cheerful Bliss/lead/b6_6.ogg'},{'revision':'7dfed1d9764492a5f71439d67ba22c24','url':'levels/Cheerful Bliss/lead/c_2.ogg'},{'revision':'a1b93f86f6682154f081af23f98d33a5','url':'levels/Cheerful Bliss/lead/c_4.ogg'},{'revision':'dcab39c62537f34bc4282b4e8a238eeb','url':'levels/Cheerful Bliss/lead/c_6.ogg'},{'revision':'2a51ae64766eaa1e43a2e9a05b20b923','url':'levels/Cheerful Bliss/lead/d_2.ogg'},{'revision':'4975d6a7b1ae3a4d3a33412ec0815ff9','url':'levels/Cheerful Bliss/lead/d_4.ogg'},{'revision':'58bcd985eddc7fa0ed9ce6775b40a983','url':'levels/Cheerful Bliss/lead/e_12.ogg'},{'revision':'67d2884e9b196bc12e086cb1a5721c74','url':'levels/Cheerful Bliss/lead/e_2.ogg'},{'revision':'b49c04c46c92dbf9f2974123f9a71fc8','url':'levels/Cheerful Bliss/lead/e_4.ogg'},{'revision':'e5817ae87828e55f1daf478df329f5dd','url':'levels/Cheerful Bliss/lead/f_6.ogg'},{'revision':'f4b374b721a3d74a77ddb2d57b823d69','url':'levels/Cheerful Bliss/lead/g_6.ogg'},{'revision':'eca66f02ad758df9a5f2594227956424','url':'levels/Cheerful Bliss/lead/loop115.ogg'},{'revision':'5a3a87524351a8016154631fc59467c0','url':'levels/Cheerful Bliss/lead/loop130.ogg'},{'revision':'3b8cb9f03ce82ec6b6974b076f3cb4fa','url':'levels/Cheerful Bliss/lead/loop90.ogg'},{'revision':'8c382d7ff3e652d67252ea30e7494b52','url':'levels/Slow Elegance/background.png'},{'revision':'056c74631114c05f31a873d4716b8333','url':'levels/Slow Elegance/bass/dSharp_2.ogg'},{'revision':'665c119a6ba5012b710a4b52d2cfc433','url':'levels/Slow Elegance/bass/dSharp_6.ogg'},{'revision':'4a90c6f02c3d01d6327680544cfdf3b5','url':'levels/Slow Elegance/bass/f_2.ogg'},{'revision':'f52e75cd172c482e85f97eb4d20b4c3d','url':'levels/Slow Elegance/bass/f_6.ogg'},{'revision':'f9597565917ec75a91e4f7e7fe108b2b','url':'levels/Slow Elegance/bass/gSharp_2.ogg'},{'revision':'f75905f2127540f69d66976fb8759f03','url':'levels/Slow Elegance/bass/gSharp_6.ogg'},{'revision':'c63620e89c687f3e7bf63a125c550cd5','url':'levels/Slow Elegance/bass/loop115.ogg'},{'revision':'7ab5e763e4728a99a87fa82f4badedea','url':'levels/Slow Elegance/bass/loop130.ogg'},{'revision':'e6e80a470e78fe57858f952b4ff7b253','url':'levels/Slow Elegance/bass/loop90.ogg'},{'revision':'a8c517a8030e657c7fabdd9767a53223','url':'levels/Slow Elegance/chords/chord1.ogg'},{'revision':'7b9bfd7dd90baeb491dfb5cadb3fc53b','url':'levels/Slow Elegance/chords/chord278.ogg'},{'revision':'0e05b1d77a7f74bb6f0edfbfe0ffa6c2','url':'levels/Slow Elegance/chords/chord3.ogg'},{'revision':'be2262ae377c935d4a9ccc6afe323e66','url':'levels/Slow Elegance/chords/chord4.ogg'},{'revision':'05830c1990ebbd467a135ce603621503','url':'levels/Slow Elegance/chords/chord5.ogg'},{'revision':'499a575af7a1227d3d35dede48d26591','url':'levels/Slow Elegance/chords/chord6.ogg'},{'revision':'3b6df5720bfaa4b41a6fdfeff971aad7','url':'levels/Slow Elegance/chords/loop115.ogg'},{'revision':'25c215e8b2fc4e54e071f26b61f2932e','url':'levels/Slow Elegance/chords/loop130.ogg'},{'revision':'38b3bbfbebaf9fa2dd9d6b5035fa3dfb','url':'levels/Slow Elegance/chords/loop90.ogg'},{'revision':'39bcea003867cebf677e07ea42965d1f','url':'levels/Slow Elegance/drums/loop115.ogg'},{'revision':'7043d3c3409a1cdaf58346e41854156e','url':'levels/Slow Elegance/drums/loop130.ogg'},{'revision':'810d6336f63471aa63aa9e774cf16393','url':'levels/Slow Elegance/drums/loop90.ogg'},{'revision':'8507c62fa3071335f15501d1530d2fb2','url':'levels/Slow Elegance/info.json'},{'revision':'6c943b72c3132a9ea2b7511b5a37244f','url':'levels/Slow Elegance/lead/dSharp.ogg'},{'revision':'505fa45b1cd9a78f466c163ec827213c','url':'levels/Slow Elegance/lead/f.ogg'},{'revision':'bd4d127d96d4b5ac0f8ed53e7e1edbb8','url':'levels/Slow Elegance/lead/gSharp.ogg'},{'revision':'4a9850fa003d9b9421f85c441f103003','url':'levels/Slow Elegance/lead/loop115.ogg'},{'revision':'8fd04ba9b3754b56e0ff82bad227fa8e','url':'levels/Slow Elegance/lead/loop130.ogg'},{'revision':'397dcccb47b07ee0f8951c52f72ba75b','url':'levels/Slow Elegance/lead/loop90.ogg'},{'revision':'869fd552b0e41b4d94851e6d1e319a8a','url':'levels/list.json'},{'revision':null,'url':'main.131f5081d4ac12d25c3e.bundle.js'},{'revision':'eefa45f41147cedadc0700b2322d241d','url':'manifest.json'},{'revision':'caecf0a6f4811ca5d516b869077f0348','url':'models/wasm/vision_wasm_internal.js'},{'revision':'f6d409524b3f0fcfbb23c525af4d8b9e','url':'models/wasm/vision_wasm_nosimd_internal.js'},{'revision':null,'url':'vendors.10ca8e881e09faa4d661.bundle.js'},{'revision':'bd5b234274f46d53c26c6a2587d17163','url':'vendors.10ca8e881e09faa4d661.bundle.js.LICENSE.txt'}],_().precache(L),function(t){const s=_();!function(t,s,a){let n;if("string"==typeof t){const e=new URL(t,location.href);n=new v((({url:t})=>t.href===e.href),s,a)}else if(t instanceof RegExp)n=new C(t,s,a);else if("function"==typeof t)n=new v(t,s,a);else{if(!(t instanceof v))throw new e("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});n=t}(q||(q=new b,q.addFetchListener(),q.addCacheListener()),q).registerRoute(n)}(new U(s,t))}(undefined)})()})(); \ No newline at end of file diff --git a/vendors.10ca8e881e09faa4d661.bundle.js b/vendors.10ca8e881e09faa4d661.bundle.js new file mode 100644 index 0000000..f259ddb --- /dev/null +++ b/vendors.10ca8e881e09faa4d661.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendors.10ca8e881e09faa4d661.bundle.js.LICENSE.txt */ +(self.webpackChunkPizzicato=self.webpackChunkPizzicato||[]).push([[96],{213:function(t,e,i){var s,n;void 0===(n="function"==typeof(s=function(){"use strict";function e(t,e,i){var s=new XMLHttpRequest;s.open("GET",t),s.responseType="blob",s.onload=function(){a(s.response,e,i)},s.onerror=function(){console.error("could not download file")},s.send()}function s(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function n(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(i){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof i.g&&i.g.global===i.g?i.g:void 0,o=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(t,i,o){var a=r.URL||r.webkitURL,h=document.createElement("a");i=i||t.name||"download",h.download=i,h.rel="noopener","string"==typeof t?(h.href=t,h.origin===location.origin?n(h):s(h.href)?e(t,i,o):n(h,h.target="_blank")):(h.href=a.createObjectURL(t),setTimeout((function(){a.revokeObjectURL(h.href)}),4e4),setTimeout((function(){n(h)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,i,r){if(i=i||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!=typeof e&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,r),i);else if(s(t))e(t,i,r);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout((function(){n(o)}))}}:function(t,i,s,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),"string"==typeof t)return e(t,i,s);var a="application/octet-stream"===t.type,h=/constructor/i.test(r.HTMLElement)||r.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&h||o)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=t:location=t,n=null},u.readAsDataURL(t)}else{var c=r.URL||r.webkitURL,d=c.createObjectURL(t);n?n.location=d:location.href=d,n=null,setTimeout((function(){c.revokeObjectURL(d)}),4e4)}});r.saveAs=a.saveAs=a,t.exports=a})?s.apply(e,[]):s)||(t.exports=n)},440:function(t){var e;e=()=>(()=>{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;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(38829);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},60757:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=t.length-1;s>=i;s--){var n=t[s],r=!0;for(var o in e)n[o]!==e[o]&&(r=!1);if(r)return n}return null}},94420:(t,e,i)=>{var s=i(11879),n=i(60461),r=i(95540),o=i(29747),a=new(i(41481))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),f=r(e,"x",0),p=r(e,"y",0),g=0,v=0,m=h*u,y=l*c;a.setPosition(f,p),a.setSize(u,c);for(var x=0;x{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},67285:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},9074:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},75222:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},22983:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.x,a=e.y,h=e.radius,l=0;l{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(15258),n=i(26708);t.exports=function(t,e,i){var r;r=i?n(e,i,t.length):s(e,t.length);for(var o=0;o{var s=i(14649),n=i(86003),r=i(49498);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(84993);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},43967:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},88926:(t,e,i)=>{var s=i(28176);t.exports=function(t,e){for(var i=0;i{var s=i(24820);t.exports=function(t,e){for(var i=0;i{var s=i(65822);t.exports=function(t,e){for(var i=0;i{var s=i(26597);t.exports=function(t,e){for(var i=0;i{var s=i(90260);t.exports=function(t,e){for(var i=0;i{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},91051:(t,e,i)=>{var s=i(1163),n=i(20339);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(1163);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},94868:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},95532:(t,e,i)=>{var s=i(66979);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},8689:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},2645:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},32372:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},85373:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(43967);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},79939:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},2699:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},98739:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},98476:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},6207:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},6607:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},72248:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},14036:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(43967);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},77597:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},83194:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},67678:(t,e,i)=>{var s=i(43967);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},35850:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){var o,a;void 0===n&&(n=0),void 0===r&&(r=new s);var h=t.length;if(1===h)o=t[0].x,a=t[0].y,t[0].x=e,t[0].y=i;else{var l=1,u=0;0===n&&(u=h-1,l=h-2),o=t[u].x,a=t[u].y,t[u].x=e,t[u].y=i;for(var c=0;c=h||-1===l)){var d=t[l],f=d.x,p=d.y;d.x=o,d.y=a,o=f,a=p,0===n?l--:l++}}return r.x=o,r.y=a,r}},8628:(t,e,i)=>{var s=i(33680);t.exports=function(t){return s(t)}},21837:(t,e,i)=>{var s=i(7602);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(54261);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=!1),0===t.length)return t;if(1===t.length)return n?t[0][e]+=(s+i)/2:t[0][e]=(s+i)/2,t;var r,o=Math.abs(s-i)/(t.length-1);if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(15994);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(11517),Angle:i(80318),Call:i(60757),GetFirst:i(69927),GetLast:i(32265),GridAlign:i(94420),IncAlpha:i(41721),IncX:i(67285),IncXY:i(9074),IncY:i(75222),PlaceOnCircle:i(22983),PlaceOnEllipse:i(95253),PlaceOnLine:i(88505),PlaceOnRectangle:i(41346),PlaceOnTriangle:i(11575),PlayAnimation:i(29953),PropertyValueInc:i(66979),PropertyValueSet:i(43967),RandomCircle:i(88926),RandomEllipse:i(33286),RandomLine:i(96e3),RandomRectangle:i(28789),RandomTriangle:i(97154),Rotate:i(20510),RotateAround:i(91051),RotateAroundDistance:i(76332),ScaleX:i(61619),ScaleXY:i(94868),ScaleY:i(95532),SetAlpha:i(8689),SetBlendMode:i(2645),SetDepth:i(32372),SetHitArea:i(85373),SetOrigin:i(81583),SetRotation:i(79939),SetScale:i(2699),SetScaleX:i(98739),SetScaleY:i(98476),SetScrollFactor:i(6207),SetScrollFactorX:i(6607),SetScrollFactorY:i(72248),SetTint:i(14036),SetVisible:i(50159),SetX:i(77597),SetXY:i(83194),SetY:i(67678),ShiftPosition:i(35850),Shuffle:i(8628),SmootherStep:i(21910),SmoothStep:i(21837),Spread:i(62054),ToggleVisible:i(79815),WrapInRectangle:i(39665)}},42099:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(74943),o=i(81957),a=i(41138),h=i(35154),l=i(90126),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showBeforeDelay=h(i,"showBeforeDelay",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.randomFrame=h(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(83419))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},60848:(t,e,i)=>{var s=i(42099),n=i(83419),r=i(90330),o=i(50792),a=i(74943),h=i(8443),l=i(95540),u=i(35154),c=i(36383),d=i(20283),f=i(41836),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return console.warn("No Aseprite data found for: "+t),s;var r=this,o=u(n,"meta",null),a=u(n,"frames",null);return o&&a&&u(o,"frameTags",[]).forEach((function(n){var o=[],h=l(n,"name",null),u=l(n,"from",0),d=l(n,"to",0),f=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,g=u;g<=d;g++){var v=g.toString(),m=a[v];if(m){var y=l(m,"duration",c.MAX_SAFE_INTEGER);o.push({key:t,frame:v,duration:y}),p+=y}}"reverse"===f&&(o=o.reverse());var x,T={key:h,frames:o,duration:p,yoyo:"pingpong"===f};i?i.anims&&(x=i.anims.create(T)):x=r.create(T),x&&s.push(x)}})),s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s{var s=i(42099),n=i(30976),r=i(83419),o=i(90330),a=i(74943),h=i(95540),l=new r({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(a.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;ir&&(l=0),this.randomFrame&&(l=n(0,r-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(a.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(a.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(a.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(a.ANIMATION_COMPLETE,a.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(a.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(a.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new o),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(a.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},57090:t=>{t.exports="add"},25312:t=>{t.exports="animationcomplete"},89580:t=>{t.exports="animationcomplete-"},52860:t=>{t.exports="animationrepeat"},63850:t=>{t.exports="animationrestart"},99085:t=>{t.exports="animationstart"},28087:t=>{t.exports="animationstop"},1794:t=>{t.exports="animationupdate"},52562:t=>{t.exports="pauseall"},57953:t=>{t.exports="remove"},68339:t=>{t.exports="resumeall"},74943:(t,e,i)=>{t.exports={ADD_ANIMATION:i(57090),ANIMATION_COMPLETE:i(25312),ANIMATION_COMPLETE_KEY:i(89580),ANIMATION_REPEAT:i(52860),ANIMATION_RESTART:i(63850),ANIMATION_START:i(99085),ANIMATION_STOP:i(28087),ANIMATION_UPDATE:i(1794),PAUSE_ALL:i(52562),REMOVE_ANIMATION:i(57953),RESUME_ALL:i(68339)}},60421:(t,e,i)=>{t.exports={Animation:i(42099),AnimationFrame:i(41138),AnimationManager:i(60848),AnimationState:i(9674),Events:i(74943)}},2161:(t,e,i)=>{var s=i(83419),n=i(90330),r=i(50792),o=i(24736),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},24047:(t,e,i)=>{var s=i(2161),n=i(83419),r=i(8443),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},59261:t=>{t.exports="remove"},24736:(t,e,i)=>{t.exports={ADD:i(51464),REMOVE:i(59261)}},83388:(t,e,i)=>{t.exports={BaseCache:i(2161),CacheManager:i(24047),Events:i(24736)}},71911:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(39506),o=i(50792),a=i(19715),h=i(87841),l=i(61340),u=i(80333),c=i(26099),d=new s({Extends:o,Mixins:[n.AlphaSingle,n.Visible],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=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.y,p=f+d,g=this.x,v=g+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xg&&E*i+S*n+af&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},38058:(t,e,i)=>{var s=i(71911),n=i(67502),r=i(45319),o=i(83419),a=i(31401),h=i(20052),l=i(19715),u=i(28915),c=i(87841),d=i(26099),f=new o({Extends:s,Mixins:[a.PostPipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,f=this.scrollX,p=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var g=!1;if(c&&!this.panEffect.isRunning){var v=this.lerp,m=c.x-this.followOffset.x,y=c.y-this.followOffset.y;d?(md.right&&(f=u(f,f+(m-d.right),v.x)),yd.bottom&&(p=u(p,p+(y-d.bottom),v.y))):(f=u(f,m-a,v.x),p=u(p,y-h,v.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+s;this.midPoint.set(x,T);var w=t/r,b=e/r,E=Math.floor(x-w/2),S=Math.floor(T-b/2);this.worldView.setTo(E,S,w,b),o.applyITRS(Math.floor(this.x+a),Math.floor(this.y+h),this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),g&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},32743:(t,e,i)=>{var s=i(38058),n=i(83419),r=i(95540),o=i(37277),a=i(37303),h=i(97480),l=i(44594),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){return t.filter((function(t){return t.willRender(e)}))},resetAll:function(){for(var t=0;t{var s=i(45319),n=i(83419),r=i(19715),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(45319),n=i(83419),r=i(19715),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(45319),n=i(83419),r=i(62640),o=i(19715),a=i(26099),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(45319),n=i(83419),r=i(19715),o=i(62640),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d,f;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(f=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>f&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},30330:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(19715),o=i(26099),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(45319),n=i(83419),r=i(62640),o=i(19715),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(5020),Flash:i(10662),Pan:i(20359),Shake:i(30330),RotateTo:i(34208),Zoom:i(45641)}},16438:t=>{t.exports="cameradestroy"},32726:t=>{t.exports="camerafadeincomplete"},87807:t=>{t.exports="camerafadeinstart"},45917:t=>{t.exports="camerafadeoutcomplete"},95666:t=>{t.exports="camerafadeoutstart"},47056:t=>{t.exports="cameraflashcomplete"},91261:t=>{t.exports="cameraflashstart"},45047:t=>{t.exports="followupdate"},81927:t=>{t.exports="camerapancomplete"},74264:t=>{t.exports="camerapanstart"},54419:t=>{t.exports="postrender"},79330:t=>{t.exports="prerender"},93183:t=>{t.exports="camerarotatecomplete"},80112:t=>{t.exports="camerarotatestart"},62252:t=>{t.exports="camerashakecomplete"},86017:t=>{t.exports="camerashakestart"},539:t=>{t.exports="camerazoomcomplete"},51892:t=>{t.exports="camerazoomstart"},19715:(t,e,i)=>{t.exports={DESTROY:i(16438),FADE_IN_COMPLETE:i(32726),FADE_IN_START:i(87807),FADE_OUT_COMPLETE:i(45917),FADE_OUT_START:i(95666),FLASH_COMPLETE:i(47056),FLASH_START:i(91261),FOLLOW_UPDATE:i(45047),PAN_COMPLETE:i(81927),PAN_START:i(74264),POST_RENDER:i(54419),PRE_RENDER:i(79330),ROTATE_COMPLETE:i(93183),ROTATE_START:i(80112),SHAKE_COMPLETE:i(62252),SHAKE_START:i(86017),ZOOM_COMPLETE:i(539),ZOOM_START:i(51892)}},87969:(t,e,i)=>{t.exports={Camera:i(38058),BaseCamera:i(71911),CameraManager:i(32743),Effects:i(20052),Events:i(19715)}},63091:(t,e,i)=>{var s=i(83419),n=i(35154),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},58818:(t,e,i)=>{var s=i(83419),n=i(35154),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},38865:(t,e,i)=>{t.exports={FixedKeyControl:i(63091),SmoothedKeyControl:i(58818)}},26638:(t,e,i)=>{t.exports={Controls:i(38865),Scene2D:i(87969)}},8054:(t,e,i)=>{var s={VERSION:"3.80.0",BlendModes:i(10312),ScaleModes:i(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},69547:(t,e,i)=>{var s=i(83419),n=i(8054),r=i(42363),o=i(82264),a=i(95540),h=i(35154),l=i(41212),u=i(29747),c=i(75508),d=i(36060),f=i(80333),p=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.snapWidth=h(e,"snap.width",0,t),this.snapHeight=h(e,"snap.height",0,t),this.renderType=h(t,"type",n.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),c.RND=new c.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io"),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=o.browser.es2019?1:0),o.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",o.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null),this.disablePreFX=h(t,"disablePreFX",!1),this.disablePostFX=h(t,"disablePostFX",!1);var i=h(t,"render",null);this.pipeline=h(i,"pipeline",null,t),this.autoMobilePipeline=h(i,"autoMobilePipeline",!0,t),this.defaultPipeline=h(i,"defaultPipeline",d.MULTI_PIPELINE,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!0,t),this.pixelArt=h(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",4096,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t);var s=h(t,"backgroundColor",0);this.backgroundColor=f(s),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",o.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=h(t,"fx.glow.quality",.1),this.glowFXDistance=h(t,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=h(t,"plugins",null),g=r.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:l(p)&&(this.installGlobalPlugins=a(p,"global",[]),this.installScenePlugins=a(p,"scene",[]),Array.isArray(p.default)?g=p.default:Array.isArray(p.defaultMerge)&&(g=g.concat(p.defaultMerge)))),this.defaultPlugins=g;var v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",v+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",v+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},86054:(t,e,i)=>{var s=i(20623),n=i(27919),r=i(8054),o=i(89357);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(68627),h=i(74797),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},96391:(t,e,i)=>{var s=i(8054);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},50127:(t,e,i)=>{var s=i(40366),n=i(60848),r=i(24047),o=i(27919),a=i(83419),h=i(69547),l=i(83719),u=i(86054),c=i(45893),d=i(96391),f=i(82264),p=i(57264),g=i(50792),v=i(8443),m=i(7003),y=i(37277),x=i(77332),T=i(76531),w=i(60903),b=i(69442),E=i(17130),S=i(65898),A=i(51085),_=i(14747),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this,new g),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(v.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(v.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(v.PRE_RENDER,null,t,e),i.emit(v.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},65898:(t,e,i)=>{var s=i(83419),n=i(35154),r=i(29747),o=i(43092),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=a},51085:(t,e,i)=>{var s=i(8443);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},97217:t=>{t.exports="blur"},47548:t=>{t.exports="boot"},19814:t=>{t.exports="contextlost"},68446:t=>{t.exports="destroy"},41700:t=>{t.exports="focus"},25432:t=>{t.exports="hidden"},65942:t=>{t.exports="pause"},59211:t=>{t.exports="postrender"},47789:t=>{t.exports="poststep"},39066:t=>{t.exports="prerender"},460:t=>{t.exports="prestep"},16175:t=>{t.exports="ready"},42331:t=>{t.exports="resume"},11966:t=>{t.exports="step"},32969:t=>{t.exports="systemready"},94830:t=>{t.exports="visible"},8443:(t,e,i)=>{t.exports={BLUR:i(97217),BOOT:i(47548),CONTEXT_LOST:i(19814),DESTROY:i(68446),FOCUS:i(41700),HIDDEN:i(25432),PAUSE:i(65942),POST_RENDER:i(59211),POST_STEP:i(47789),PRE_RENDER:i(39066),PRE_STEP:i(460),READY:i(16175),RESUME:i(42331),STEP:i(11966),SYSTEM_READY:i(32969),VISIBLE:i(94830)}},42857:(t,e,i)=>{t.exports={Config:i(69547),CreateRenderer:i(86054),DebugHeader:i(96391),Events:i(8443),TimeStep:i(65898),VisibilityHandler:i(51085)}},99584:(t,e,i)=>{var s=i(5290),n=i(27919),r=i(35154);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d",{willReadFrequently:!0});u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;v{t.exports={GenerateTexture:i(99584),Palettes:i(57763)}},5290:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},23816:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},9866:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},77552:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},92259:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},57763:(t,e,i)=>{t.exports={ARNE16:i(5290),C64:i(23816),CGA:i(9866),JMP:i(77552),MSX:i(92259)}},46728:(t,e,i)=>{var s=i(83419),n=i(36316),r=i(80021),o=i(26099),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(83419),n=i(19217),r=i(87841),o=i(26099),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},73825:(t,e,i)=>{var s=i(83419),n=i(80021),r=i(39506),o=i(35154),a=i(43396),h=i(26099),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(83419),n=i(80021),r=i(19217),o=i(87841),a=i(26099),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},14744:(t,e,i)=>{var s=i(83419),n=i(80021),r=i(32112),o=i(26099),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(87842),n=i(83419),r=i(80021),o=i(26099),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(46669),MoveTo:i(68618),CubicBezier:i(46728),Curve:i(80021),Ellipse:i(73825),Line:i(33951),QuadraticBezier:i(14744),Spline:i(42534)}},68618:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},46669:(t,e,i)=>{var s=i(83419),n=i(46728),r=i(73825),o=i(39429),a=i(33951),h=i(68618),l=i(14744),u=i(87841),c=i(42534),d=i(26099),f=i(36383),p=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);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=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=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;n1&&!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=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{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{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{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.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{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{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){return void 0===e&&(e="none"),["-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,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,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({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.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{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{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(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{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p){var g=i.x-e.displayOriginX+n,v=i.y-e.displayOriginY+r,m=g+i.w,y=v+i.h,x=o.getXRound(g,v,a),T=o.getYRound(g,v,a),w=o.getXRound(g,y,a),b=o.getYRound(g,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,v,a),_=o.getYRound(m,v,a);t.batchQuad(e,x,T,w,b,E,S,A,_,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{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=t.text,h=a.length,l=t.maxWidth,u=t.wordWrapCharCode,c=Number.MAX_VALUE,d=Number.MAX_VALUE,f=0,p=0,g=t.fontData.chars,v=t.fontData.lineHeight,m=t.letterSpacing,y=t.lineSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,M=_*t.scaleY,P=null,R=0,L=[],O=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(l>0){for(n=0;nl||W-Y>l?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),Y=0,X=null):X=G):G.cr&&(z.push(G.i+G.word.length),Y=0,X=null)}for(n=z.length-1;n>=0;n--)r=a,o=z[n],"\n",a=r.substr(0,o)+"\n"+r.substr(o+1);s.wrappedText=a,h=a.length,I=[],N=null}var H=0;for(n=0;nS&&(c=S),d>A&&(d=A);var K=S+b.xAdvance,q=A+v;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{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),g=s(e,"offset.y",0),v=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=g,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{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"),g=void 0!==i&&i.trimmed;if(g)var v=i.height,m=i.width;for(var y=0;y{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,g=0,v=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=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{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,n,r=i(29747);s=i(73482),n=i(86741),t.exports={renderWebGL:s,renderCanvas:n}},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 g,v,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),E=l.setGameObject(e),S=0,A=0,_=0,C=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{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{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,g=0,v=null,m=0,y=0,x=0,T=0,w=0,b=0,E=null,S=0,A=h.source.image,_=h.cutX,C=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{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,n,r=i(29747);s=i(33590),n=i(37289),t.exports={renderWebGL:s,renderCanvas:n}},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,g=e.tintFill,v=r.getTintAppendFloatAlpha,m=v(e.tintTopLeft,f*e._alphaTL),y=v(e.tintTopRight,f*e._alphaTR),x=v(e.tintBottomLeft,f*e._alphaBL),T=v(e.tintBottomRight,f*e._alphaBR),w=e.frame.glTexture,b=a.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY;if(0!==S||0!==A){var _=e.dropShadowColor,C=e.dropShadowAlpha,M=v(_,f*C*e._alphaTL),P=v(_,f*C*e._alphaTR),R=v(_,f*C*e._alphaBL),L=v(_,f*C*e._alphaBR);for(l=0;l{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;r0},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;u0&&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,g,v,p.width,p.height),r.restore())):(l&&(g=Math.round(g),v=Math.round(v)),p.width>0&&p.height>0&&r.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+c.x+a,v+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,n,r=i(29747);s=i(99485),n=i(72396),t.exports={renderWebGL:s,renderCanvas:n}},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 g=0;g{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,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},88509:(t,e,i)=>{var s=i(45319),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},90065:(t,e,i)=>{var s=i(10312),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},94215:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},61683:t=>{t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},89272:t=>{t.exports={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}}},47059:(t,e,i)=>{var s=i(83419),n=i(66064),r=i(19133),o=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,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},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},8004:(t,e,i)=>{var s=i(87841),n=i(11520),r=i(26099),o={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t,e){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},8573:(t,e,i)=>{var s=i(6858),n=i(80661),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},27387:t=>{t.exports={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}}},37640:(t,e,i)=>{var s=i(39506),n=i(57355),r=i(35154),o=i(86353),a=i(26099),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t&&t.data){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},72699:(t,e,i)=>{var s=i(62644),n={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=n},17581:(t,e,i)=>{var s=i(62644),n=i(47059),r=i(19133),o={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new n(this,!0),t&&(this.preFX=new n(this,!1))},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n=0;s--){var n=i[s];(e&&n.name===t||!e&&n===t)&&(n.destroy(),r(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=o},80227:t=>{t.exports={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}}},16736:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},37726:(t,e,i)=>{var s=i(4327),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e,i,s){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e,i,s)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},79812:(t,e,i)=>{var s=i(4327),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},27472:t=>{t.exports={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}}},53774:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},16901:(t,e,i)=>{var s=i(36383),n=i(61340),r=i(85955),o=i(86554),a=i(30954),h=i(26099),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},61340:(t,e,i)=>{var s=i(83419),n=i(36383),r=i(26099),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5],v=void 0===e?i:e.matrix;return v[0]=u*n+c*o,v[1]=u*r+c*a,v[2]=d*n+f*o,v[3]=d*r+f*a,v[4]=p*n+g*o+h,v[5]=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],f=n[2],p=n[3],g=n[4],v=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=f*r+p*a,s[3]=f*o+p*h,s[4]=g*r+v*a+l,s[5]=g*o+v*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},setQuad:function(t,e,i,s,n,r){void 0===n&&(n=!1),void 0===r&&(r=this.quad);var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return n?(r[0]=Math.round(t*a+e*l+c),r[1]=Math.round(t*h+e*u+d),r[2]=Math.round(t*a+s*l+c),r[3]=Math.round(t*h+s*u+d),r[4]=Math.round(i*a+s*l+c),r[5]=Math.round(i*h+s*u+d),r[6]=Math.round(i*a+e*l+c),r[7]=Math.round(i*h+e*u+d)):(r[0]=t*a+e*l+c,r[1]=t*h+e*u+d,r[2]=t*a+s*l+c,r[3]=t*h+s*u+d,r[4]=i*a+s*l+c,r[5]=i*h+s*u+d,r[6]=i*a+e*l+c,r[7]=i*h+e*u+d),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=o},59715:t=>{t.exports={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}}},31401:(t,e,i)=>{t.exports={Alpha:i(16005),AlphaSingle:i(88509),BlendMode:i(90065),ComputedSize:i(94215),Crop:i(61683),Depth:i(89272),Flip:i(54434),FX:i(47059),GetBounds:i(8004),Mask:i(8573),Origin:i(27387),PathFollower:i(37640),Pipeline:i(72699),PostPipeline:i(17581),ScrollFactor:i(80227),Size:i(16736),Texture:i(37726),TextureCrop:i(79812),Tint:i(27472),ToJSON:i(53774),Transform:i(16901),TransformMatrix:i(61340),Visible:i(59715)}},31559:(t,e,i)=>{var s=i(37105),n=i(10312),r=i(83419),o=i(31401),a=i(51708),h=i(95643),l=i(87841),u=i(29959),c=i(36899),d=i(26099),f=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.PostPipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]},onChildDestroyed:function(t){s.Remove(this.list,t),this.exclusive&&(t.parentContainer=null,t.removedFromScene())}});t.exports=f},53584:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(25305),n=i(31559),r=i(44603),o=i(23568),a=i(95540);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),h=a(t,"children",null),l=new n(this.scene,i,r,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},24961:(t,e,i)=>{var s=i(31559);i(39429).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},29959:(t,e,i)=>{var s,n,r=i(29747);s=i(72249),n=i(53584),t.exports={renderWebGL:s,renderCanvas:n}},72249:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(441),o=i(95643),a=i(41212),h=i(35846),l=i(44594),u=i(61369),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(47407),n=i(95643),r=i(61340),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var f=o,p=a,g=h,v=0,m=0,y="0%",x="0%";r?(v=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,p.applyITRS(e.x-v,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),p.e=e.x-v,p.f=e.y-m,f.multiply(p,g)):(v=e.width*e.originX,m=e.height*e.originY,p.applyITRS(e.x-v,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",p.e-=i.scrollX*e.scrollFactorX,p.f-=i.scrollY*e.scrollFactorY,f.multiply(p,g)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},2611:(t,e,i)=>{var s=i(3069);i(39429).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},441:(t,e,i)=>{var s,n,r=i(29747);s=i(49381),n=i(49381),t.exports={renderWebGL:s,renderCanvas:n}},62980:t=>{t.exports="addedtoscene"},41337:t=>{t.exports="destroy"},44947:t=>{t.exports="removedfromscene"},49358:t=>{t.exports="complete"},35163:t=>{t.exports="created"},97249:t=>{t.exports="error"},19483:t=>{t.exports="locked"},56059:t=>{t.exports="loop"},26772:t=>{t.exports="metadata"},64437:t=>{t.exports="playing"},83411:t=>{t.exports="play"},75780:t=>{t.exports="seeked"},67799:t=>{t.exports="seeking"},63500:t=>{t.exports="stalled"},55541:t=>{t.exports="stop"},53208:t=>{t.exports="textureready"},4992:t=>{t.exports="unlocked"},12:t=>{t.exports="unsupported"},51708:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(62980),DESTROY:i(41337),REMOVED_FROM_SCENE:i(44947),VIDEO_COMPLETE:i(49358),VIDEO_CREATED:i(35163),VIDEO_ERROR:i(97249),VIDEO_LOCKED:i(19483),VIDEO_LOOP:i(56059),VIDEO_METADATA:i(26772),VIDEO_PLAY:i(83411),VIDEO_PLAYING:i(64437),VIDEO_SEEKED:i(75780),VIDEO_SEEKING:i(67799),VIDEO_STALLED:i(63500),VIDEO_STOP:i(55541),VIDEO_TEXTURE:i(53208),VIDEO_UNLOCKED:i(4992),VIDEO_UNSUPPORTED:i(12)}},42421:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),o=i(64993),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},70217:()=>{},56315:(t,e,i)=>{var s=i(42421);i(39429).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},64993:(t,e,i)=>{var s,n,r=i(29747);s=i(80287),n=i(70217),t.exports={renderWebGL:s,renderCanvas:n}},80287:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},85592:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},43831:(t,e,i)=>{var s=i(71911),n=i(83419),r=i(85592),o=i(31401),a=i(8497),h=i(95643),l=i(95540),u=i(35154),c=i(36383),d=i(84503),f=new n({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.PostPipeline,o.Transform,o.Visible,o.ScrollFactor,d],initialize:function(t,e){var i=u(e,"x",0),s=u(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.initPostPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(e)},setDefaultStyles:function(t){return u(t,"lineStyle",null)&&(this.defaultStrokeWidth=u(t,"lineStyle.width",1),this.defaultStrokeColor=u(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=u(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),u(t,"fillStyle",null)&&(this.defaultFillColor=u(t,"fillStyle.color",16777215),this.defaultFillAlpha=u(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;"number"!=typeof n&&(r=l(n,"tl",20),o=l(n,"tr",20),a=l(n,"bl",20),h=l(n,"br",20));var u=r>=0,d=o>=0,f=a>=0,p=h>=0;return r=Math.abs(r),o=Math.abs(o),a=Math.abs(a),h=Math.abs(h),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),d?this.arc(t+i-o,e+o,o,-c.TAU,0):this.arc(t+i,e,o,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+a,e+s),f?this.arc(t+a,e+s-a,a,c.TAU,Math.PI):this.arc(t,e+s,a,0,-c.TAU,!0),this.lineTo(t,e+r),u?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n,u=Math.min(i,s)/2;"number"!=typeof n&&(r=l(n,"tl",20),o=l(n,"tr",20),a=l(n,"bl",20),h=l(n,"br",20));var d=r>=0,f=o>=0,p=a>=0,g=h>=0;return r=Math.min(Math.abs(r),u),o=Math.min(Math.abs(o),u),a=Math.min(Math.abs(a),u),h=Math.min(Math.abs(h),u),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),f?this.arc(t+i-o,e+o,o,-c.TAU,0):this.arc(t+i,e,o,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),g?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),p?this.arc(t+a,e+s-a,a,c.TAU,Math.PI):this.arc(t,e+s,a,0,-c.TAU,!0),this.lineTo(t,e+r),this.moveTo(t,e+r),d?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},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};if("string"==typeof t)if(r.textures.exists(t)){var h=(s=r.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(n=h.getContext("2d",a))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",a);else t instanceof HTMLCanvasElement&&(n=t.getContext("2d",a));return n&&(this.renderCanvas(o,this,f.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new s,t.exports=f},32768:(t,e,i)=>{var s=i(85592),n=i(20926);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,f=0,p=0,g=1,v=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+v+","+m+","+y+","+c+")",u.lineWidth=g,x+=3;break;case s.FILL_STYLE:p=h[x+1],d=h[x+2],v=(16711680&p)>>>16,m=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+v+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}u.restore()}}},87079:(t,e,i)=>{var s=i(44603),n=i(43831);s.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("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},84503:(t,e,i)=>{var s,n,r=i(29747);s=i(77545),i(32768),n=i(32768),t.exports={renderWebGL:s,renderCanvas:n}},77545:(t,e,i)=>{var s=i(85592),n=i(91296),r=i(61340),o=i(70554),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,f=u.loadIdentity(),p=e.commandBuffer,g=i.alpha*e.alpha,v=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,M=0;M0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===_&&(_=new h(B+Math.cos(X)*U,N+Math.sin(X)*U,v),E.push(_),I+=.01);I<1+G;)w=Y*I+X,x=B+Math.cos(w)*U,T=N+Math.sin(w)*U,_.points.push(new a(x,T,v)),I+=.01;w=Y+X,x=B+Math.cos(w)*U,T=N+Math.sin(w)*U,_.points.push(new a(x,T,v));break;case s.FILL_RECT:c.batchFillRect(p[++M],p[++M],p[++M],p[++M],f,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(p[++M],p[++M],p[++M],p[++M],p[++M],p[++M],f,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(p[++M],p[++M],p[++M],p[++M],p[++M],p[++M],v,f,d);break;case s.LINE_TO:null!==_?_.points.push(new a(p[++M],p[++M],v)):(_=new h(p[++M],p[++M],v),E.push(_));break;case s.MOVE_TO:_=new h(p[++M],p[++M],v),E.push(_);break;case s.SAVE:l.push(f.copyToArray());break;case s.RESTORE:f.copyFromArray(l.pop());break;case s.TRANSLATE:B=p[++M],N=p[++M],f.translate(B,N);break;case s.SCALE:B=p[++M],N=p[++M],f.scale(B,N);break;case s.ROTATE:f.rotate(p[++M])}t.pipelines.postBatch(e)}}},26479:(t,e,i)=>{var s=i(61061),n=i(83419),r=i(51708),o=i(50792),a=i(46710),h=i(95540),l=i(35154),u=i(97022),c=i(41212),d=i(88492),f=i(35072),p=i(68287),g=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?c(e[0])&&(i=e,e=null):c(e)&&(i=e,e=null),this.scene=t,this.children=new f,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(44603),n=i(26479);s.register("group",(function(t){return new n(this.scene,null,t)}))},3385:(t,e,i)=>{var s=i(26479);i(39429).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},88571:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),o=i(59819),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=a},40652:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},82459:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(88571);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},2117:(t,e,i)=>{var s=i(88571);i(39429).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},59819:(t,e,i)=>{var s,n,r=i(29747);s=i(99517),n=i(40652),t.exports={renderWebGL:s,renderCanvas:n}},99517:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},77856:(t,e,i)=>{var s={Events:i(51708),DisplayList:i(8050),GameObjectCreator:i(44603),GameObjectFactory:i(39429),UpdateList:i(45027),Components:i(31401),GetCalcMatrix:i(91296),BuildGameObject:i(25305),BuildGameObjectAnimation:i(13059),GameObject:i(95643),BitmapText:i(22186),Blitter:i(6107),Bob:i(46590),Container:i(31559),DOMElement:i(3069),DynamicBitmapText:i(2638),Extern:i(42421),Graphics:i(43831),Group:i(26479),Image:i(88571),Layer:i(93595),Particles:i(18404),PathFollower:i(1159),RenderTexture:i(591),RetroFont:i(196),Rope:i(77757),Sprite:i(68287),Text:i(50171),GetTextSize:i(14220),MeasureText:i(79557),TextStyle:i(35762),TileSprite:i(20839),Zone:i(41481),Video:i(18471),Shape:i(17803),Arc:i(23629),Curve:i(89),Ellipse:i(19921),Grid:i(30479),IsoBox:i(61475),IsoTriangle:i(16933),Line:i(57847),Polygon:i(24949),Rectangle:i(74561),Star:i(55911),Triangle:i(36931),Factories:{Blitter:i(12709),Container:i(24961),DOMElement:i(2611),DynamicBitmapText:i(72566),Extern:i(56315),Graphics:i(1201),Group:i(3385),Image:i(2117),Layer:i(20005),Particles:i(676),PathFollower:i(90145),RenderTexture:i(60505),Rope:i(96819),Sprite:i(46409),StaticBitmapText:i(34914),Text:i(68005),TileSprite:i(91681),Zone:i(84175),Video:i(89025),Arc:i(42563),Curve:i(40511),Ellipse:i(1543),Grid:i(34137),IsoBox:i(3933),IsoTriangle:i(49803),Line:i(2481),Polygon:i(64827),Rectangle:i(87959),Star:i(93697),Triangle:i(45245)},Creators:{Blitter:i(9403),Container:i(77143),DynamicBitmapText:i(11164),Graphics:i(87079),Group:i(94975),Image:i(82459),Layer:i(25179),Particles:i(92730),RenderTexture:i(34495),Rope:i(26209),Sprite:i(15567),StaticBitmapText:i(57336),Text:i(71259),TileSprite:i(14167),Zone:i(95261),Video:i(11511)}};s.Shader=i(20071),s.Mesh=i(4703),s.NineSlice=i(28103),s.PointLight=i(80321),s.Plane=i(33663),s.Factories.Shader=i(74177),s.Factories.Mesh=i(9225),s.Factories.NineSlice=i(47521),s.Factories.PointLight=i(71255),s.Factories.Plane=i(30985),s.Creators.Shader=i(54935),s.Creators.Mesh=i(20527),s.Creators.NineSlice=i(28279),s.Creators.PointLight=i(39829),s.Creators.Plane=i(56015),s.Light=i(41432),s.LightsManager=i(61356),s.LightsPlugin=i(88992),t.exports=s},93595:(t,e,i)=>{var s=i(10312),n=i(83419),r=i(31401),o=i(53774),a=i(45893),h=i(50792),l=i(51708),u=i(73162),c=i(33963),d=i(44594),f=i(19186),p=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.PostPipeline,r.Visible,h,c],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",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.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),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 a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||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 i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){var e=t.displayList;e&&e!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(f(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},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(l.ADDED_TO_SCENE,this,this.scene),t.events.emit(d.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(d.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(t){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var e=this.list;e.length;)e[0].destroy(t);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0,!1),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=p},2956:t=>{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(25305),n=i(93595),r=i(44603),o=i(23568);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},20005:(t,e,i)=>{var s=i(93595);i(39429).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},33963:(t,e,i)=>{var s,n,r=i(29747);s=i(15869),n=i(2956),t.exports={renderWebGL:s,renderCanvas:n}},15869:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(96503),n=i(83419),r=i(31401),o=i(51767),a=i(70554),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},61356:(t,e,i)=>{var s=i(81491),n=i(83419),r=i(20339),o=i(41432),a=i(80321),h=i(51767),l=i(19133),u=i(19186),c=i(70554),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},88992:(t,e,i)=>{var s=i(83419),n=i(61356),r=i(37277),o=i(44594),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},4703:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(39506),o=i(83997),a=i(95643),h=i(34684),l=i(92515),u=i(91296),c=i(37867),d=i(29807),f=i(43396),p=i(19186),g=i(25836),v=i(39318),m=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 g,this.modelScale=new g(1,1,1),this.modelRotation=new g,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new g,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var p=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(p.width,p.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(p.width,p.height),r&&this.addVertices(r,o,h,l,u,d,f)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(g.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=g.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.fov=i,this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.fov=0,this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,l){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=h(c,this,e,i,s,n,r,o,a,l)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=l(t,e,i,s,n,r,o);return a?(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},hasFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=0;r{t.exports=function(){}},20527:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(35154),a=i(4703);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),f=o(t,"colors",16777215),p=o(t,"alphas",1),g=new a(this.scene,0,0,i,n,h,l,u,c,d,f,p);return void 0!==e&&(t.add=e),s(this.scene,g,t),g}))},9225:(t,e,i)=>{var s=i(4703);i(39429).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},29807:(t,e,i)=>{var s,n,r=i(29747);s=i(48833),n=i(36488),t.exports={renderWebGL:s,renderCanvas:n}},48833:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc;t.pipelines.preBatch(e);for(var l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,f=e.tintFill,p=[],g=e.debugCallback,v=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0,C=0;C{var s=i(83419),n=i(31401),r=i(95643),o=i(78023),a=i(39318),h=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n,o,h,l,u,c,d){r.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tint=16777215,this.tintFill=!1;var f=t.textures.getFrame(s,n);this.is3Slice=!c&&!d,f.scale9&&(this.is3Slice=f.is3Slice);for(var p=this.is3Slice?18:54,g=0;g{var s=i(25305),n=i(44603),r=i(23568),o=i(35154),a=i(28103);n.register("nineslice",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"width",256),l=o(t,"height",256),u=o(t,"leftWidth",10),c=o(t,"rightWidth",10),d=o(t,"topHeight",0),f=o(t,"bottomHeight",0),p=new a(this.scene,0,0,i,n,h,l,u,c,d,f);return void 0!==e&&(t.add=e),s(this.scene,p,t),p}))},47521:(t,e,i)=>{var s=i(28103);i(39429).register("nineslice",(function(t,e,i,n,r,o,a,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u))}))},78023:(t,e,i)=>{var s,n=i(29747),r=n;s=i(52230),t.exports={renderWebGL:s,renderCanvas:r}},52230:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){var o=e.vertices,a=o.length;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(e.pipeline,e),l=s(e,i,r,!1).calc;t.pipelines.preBatch(e);var u=h.setGameObject(e),c=h.vertexViewF32,d=h.vertexViewU32,f=h.vertexCount*h.currentShader.vertexComponentCount-1,p=i.roundPixels,g=e.tintFill,v=i.alpha*e.alpha,m=n.getTintAppendFloatAlpha(e.tint,v),y=h.vertexAvailable(),x=-1;y{var s=i(83419),n=i(44777),r=i(37589),o=i(6113),a=i(91389),h=i(90664),l=new s({Extends:n,initialize:function(t){n.call(this,t,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return null===this.propertyValue?0:9},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;if(9===this.method){this.start=t[0],this.ease=o("Linear"),this.interpolation=a("linear"),i=this.easedValueEmit,s=this.easeValueUpdate,e=t[0],this.active=!0;for(var n=0;n{var s=i(30976),n=i(45319),r=i(83419),o=i(99472),a=i(6113),h=i(95540),l=i(91389),u=i(77720),c=i(15994),d=new r({initialize:function(t,e,i){void 0===i&&(i=!1),this.propertyKey=t,this.propertyValue=e,this.defaultValue=e,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=i,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=h(t,this.propertyKey,this.defaultValue),this.method=this.getMethod(),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return JSON.stringify(this.propertyValue)},onChange:function(t){var e;switch(this.method){case 1:case 3:case 8:e=t;break;case 2:this.propertyValue.indexOf(t)>=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=n(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var n=this.has(t,"ease")?t.ease:"Linear";this.ease=a(n,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate;break;case 9:this.start=t.values;var o=this.has(t,"ease")?t.ease:"Linear";this.ease=a(o,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var n=this._onUpdate(t,e,i,s);return this.current=n,n},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=o(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;return this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=c(i+s,this.start,this.end),this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,n=t.data[e],r=this.ease(i);return s=this.interpolation?this.interpolation(this.start,r):(n.max-n.min)*r+n.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=d},24502:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(20286),o=new s({Extends:r,initialize:function(t,e,i,s,o){if("object"==typeof t){var a=t;t=n(a,"x",0),e=n(a,"y",0),i=n(a,"power",0),s=n(a,"epsilon",100),o=n(a,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===o&&(o=50);r.call(this,t,e,!0),this._gravity=o,this._power=i*o,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(9674),n=i(45319),r=i(83419),o=i(39506),a=i(87841),h=i(11520),l=i(26099),u=new r({initialize:function(t){this.emitter=t,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new l,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.holdCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1},x:{min:0,max:0},y:{min:0,max:0},accelerationX:{min:0,max:0},accelerationY:{min:0,max:0},maxVelocityX:{min:0,max:0},maxVelocityY:{min:0,max:0},moveToX:{min:0,max:0},moveToY:{min:0,max:0},bounce:{min:0,max:0}},this.isCropped=!1,this.scene=t.scene,this.anims=new s(this),this.bounds=new a},emit:function(t,e,i,s,n,r){return this.emitter.emit(t,e,i,s,n,r)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,n=i.getAnim();if(n?this.anims.play(n):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=o(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var r=s.speedX.onEmit(this,"speedX"),a=s.speedY.active?s.speedY.onEmit(this,"speedY"):r;if(i.radial){var h=o(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(r),this.velocityY=Math.sin(h)*Math.abs(a)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),c=this.life/1e3;this.velocityX=(l-this.x)/c,this.velocityY=(u-this.y)/c}else this.velocityX=r,this.velocityY=a;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims.update(0,t);var s=this.emitter,r=s.ops,a=1-this.lifeCurrent/this.life;if(this.lifeT=a,this.x=r.x.onUpdate(this,"x",a,this.x),this.y=r.y.onUpdate(this,"y",a,this.y),s.moveTo){var h=r.moveToX.onUpdate(this,"moveToX",a,s.moveToX),l=r.moveToY.onUpdate(this,"moveToY",a,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,a),this.scaleX=r.scaleX.onUpdate(this,"scaleX",a,this.scaleX),r.scaleY.active?this.scaleY=r.scaleY.onUpdate(this,"scaleY",a,this.scaleY):this.scaleY=this.scaleX,this.angle=r.rotate.onUpdate(this,"rotate",a,this.angle),this.rotation=o(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=n(r.alpha.onUpdate(this,"alpha",a,this.alpha),0,1),r.color.active?this.tint=r.color.onUpdate(this,"color",a,this.tint):this.tint=r.tint.onUpdate(this,"tint",a,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,r){var o=t.ops,a=this.velocityX,h=this.velocityY,l=o.accelerationX.onUpdate(this,"accelerationX",r,this.accelerationX),u=o.accelerationY.onUpdate(this,"accelerationY",r,this.accelerationY),c=o.maxVelocityX.onUpdate(this,"maxVelocityX",r,this.maxVelocityX),d=o.maxVelocityY.onUpdate(this,"maxVelocityY",r,this.maxVelocityY);this.bounce=o.bounce.onUpdate(this,"bounce",r,this.bounce),a+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,a=n(a,-c,c),h=n(h,-d,d),this.velocityX=a,this.velocityY=h,this.x+=a*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;f{var s=i(83419),n=i(20286),r=i(87841),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),void 0===l&&(l=!0),n.call(this,t,e,!0),this.bounds=new r(t,e,i,s),this.collideLeft=o,this.collideRight=a,this.collideTop=h,this.collideBottom=l},update:function(t){var e=this.bounds,i=-t.bounce,s=t.worldPosition;s.xe.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.ye.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=o},31600:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(53774),o=i(43459),a=i(26388),h=i(19909),l=i(76472),u=i(44777),c=i(20696),d=i(95643),f=i(95540),p=i(26546),g=i(24502),v=i(1985),m=i(97022),y=i(86091),x=i(73162),T=i(20074),w=i(56480),b=i(68875),E=i(87841),S=i(59996),A=i(72905),_=i(90668),C=i(19186),M=i(61340),P=i(26099),R=i(15994),L=i(69601),O=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintFill","timeScale","trackVisible","visible"],F=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],D=new s({Extends:d,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,_],initialize:function(t,e,i,s,n){d.call(this,t,"ParticleEmitter"),this.particleClass=w,this.ops={accelerationX:new u("accelerationX",0),accelerationY:new u("accelerationY",0),alpha:new u("alpha",1),angle:new u("angle",{min:0,max:360},!0),bounce:new u("bounce",0),color:new l("color"),delay:new u("delay",0,!0),hold:new u("hold",0,!0),lifespan:new u("lifespan",1e3,!0),maxVelocityX:new u("maxVelocityX",1e4),maxVelocityY:new u("maxVelocityY",1e4),moveToX:new u("moveToX",0),moveToY:new u("moveToY",0),quantity:new u("quantity",1,!0),rotate:new u("rotate",0),scaleX:new u("scaleX",1),scaleY:new u("scaleY",1),speedX:new u("speedX",0,!0),speedY:new u("speedY",0,!0),tint:new u("tint",16777215),x:new u("x",0),y:new u("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new P,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new M,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new x(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(e,i),this.setTexture(s),n&&this.setConfig(n)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;var e=0,i="",s=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=R(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var n=t;(t=f(n,"anims",null))&&(this.anims=this.anims.concat(t));var r=f(n,"cycle",!1);this.randomAnim=!r,this.animQuantity=f(n,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,n,r,o,a){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=m(h,"w")?h.w:h.width,s=m(h,"h")?h.h:h.height}return this.addParticleProcessor(new L(t,e,i,s,n,r,o,a))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new g(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return C(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,n=this.stopAfter,r=this.follow?this.follow.x+this.followOffset.x:e,o=this.follow?this.follow.y+this.followOffset.y:i,a=0;a0&&(this.stopCounter++,this.stopCounter>=n))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(o=h-1;o>=0;o--){var f=a[o];n.splice(f.index,1),r.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===n.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,n=[],r=0;r0){var u=0;for(this.skipping=!0;u0&&y(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t{var s=i(59996),n=i(61340),r=new n,o=new n,a=new n,h=new n;t.exports=function(t,e,i,n){var l=r,u=o,c=a,d=h;n?(d.loadIdentity(),d.multiply(n),d.translate(e.x,e.y),d.rotate(e.rotation),d.scale(e.scaleX,e.scaleY)):d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var f=t.currentContext,p=i.roundPixels,g=i.alpha,v=e.alpha,m=e.alive,y=m.length,x=e.viewBounds;if(e.visible&&0!==y&&(!x||s(x,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e);var T=e.scrollFactorX,w=e.scrollFactorY;f.save(),f.globalCompositeOperation=t.blendModes[e.blendMode];for(var b=0;b0&&_.height>0){var C=-A.halfWidth,M=-A.halfHeight;f.globalAlpha=S,f.save(),u.setToContext(f),p&&(C=Math.round(C),M=Math.round(M)),f.imageSmoothingEnabled=!A.source.scaleMode,f.drawImage(A.source.image,_.x,_.y,_.width,_.height,C,M,_.width,_.height),f.restore()}}}f.restore()}}},92730:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(95540),a=i(31600);n.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=o(t,"config",null),h=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),n&&h.setConfig(n),h}))},676:(t,e,i)=>{var s=i(39429),n=i(31600);s.register("particles",(function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new n(this.scene,t,e,i,s))}))},90668:(t,e,i)=>{var s,n,r=i(29747);s=i(21188),n=i(9871),t.exports={renderWebGL:s,renderCanvas:n}},21188:(t,e,i)=>{var s=i(59996),n=i(61340),r=i(70554),o=new n,a=new n,h=new n,l=new n;t.exports=function(t,e,i,n){var u=t.pipelines.set(e.pipeline),c=o,d=a,f=h,p=l;n?(p.loadIdentity(),p.multiply(n),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=r.getTintAppendFloatAlpha,v=i.alpha,m=e.alpha;t.pipelines.preBatch(e);var y=e.alive,x=y.length,T=e.viewBounds;if(0!==x&&(!T||s(T,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e),c.copyFrom(i.matrix),c.multiplyWithOffset(p,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),t.setBlendMode(e.blendMode),e.mask&&(e.mask.preRenderWebGL(t,e,i),t.pipelines.set(e.pipeline));for(var w,b,E=e.tintFill,S=0;S{var s=new(i(83419))({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!0),this.emitter,this.x=t,this.y=e,this.active=i},update:function(){},destroy:function(){this.emitter=null}});t.exports=s},9774:t=>{t.exports="complete"},812:t=>{t.exports="deathzone"},30522:t=>{t.exports="explode"},96695:t=>{t.exports="start"},18677:t=>{t.exports="stop"},20696:(t,e,i)=>{t.exports={COMPLETE:i(9774),DEATH_ZONE:i(812),EXPLODE:i(30522),START:i(96695),STOP:i(18677)}},18404:(t,e,i)=>{t.exports={EmitterColorOp:i(76472),EmitterOp:i(44777),Events:i(20696),GravityWell:i(24502),Particle:i(56480),ParticleBounds:i(69601),ParticleEmitter:i(31600),ParticleProcessor:i(20286),Zones:i(21024)}},26388:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=t.worldPosition,i=this.source.contains(e.x,e.y);return i&&this.killOnEnter||!i&&!this.killOnEnter}});t.exports=s},19909:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r){void 0===s&&(s=!1),void 0===n&&(n=!0),void 0===r&&(r=-1),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.total=r,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68875:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(t){this.source=t,this._tempVec=new n,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},21024:(t,e,i)=>{t.exports={DeathZone:i(26388),EdgeZone:i(19909),RandomZone:i(68875)}},1159:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(68287),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},90145:(t,e,i)=>{var s=i(39429),n=i(1159);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},33663:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(48803),o=i(90664),a=i(4703),h=i(45650),l=new n({Extends:a,initialize:function(t,e,i,n,r,o,h,l){n||(n="__DEFAULT"),a.call(this,t,e,i,n,r),this.type="Plane",this.anims=new s(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(o,h,l),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return.5}},originY:{get:function(){return.5}},setGridSize:function(t,e,i){void 0===t&&(t=8),void 0===e&&(e=8),void 0===i&&(i=!1);var s=!1;return i&&(s=!0),this.gridWidth=t,this.gridHeight=e,this.isTiled=i,this.clear(),r({mesh:this,widthSegments:t,heightSegments:e,isOrtho:!1,tile:i,flipY:s}),this},setSizeToFrame:function(t){void 0===t&&(t=!0);var e=this.frame;if(this.setPerspective(this.width/e.width,this.height/e.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!t)return this;var i,s,n=this.gridWidth,r=this.gridHeight,o=this.vertices,a=e.u0,h=e.u1,l=e.v0,u=e.v1,c=0;if(this.isTiled)for(l=e.v1,u=e.v0,s=0;s7&&c>7?l.push(r.r,r.g,r.b,i):l.push(a.r,a.g,a.b,s);var d=this.scene.sys.textures.addUint8Array(h(),new Uint8Array(l),16,16);return this.removeCheckerboard(),this.setTexture(d),this.setSizeToFrame(),this.setViewHeight(n),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},preUpdate:function(t,e){a.prototype.preUpdate.call(this,t,e),this.anims.update(t,e)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});t.exports=l},56015:(t,e,i)=>{var s=i(25305),n=i(13059),r=i(44603),o=i(23568),a=i(35154),h=i(33663);r.register("plane",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),l=a(t,"width",8),u=a(t,"height",8),c=a(t,"tile",!1),d=new h(this.scene,0,0,i,r,l,u,c);void 0!==e&&(t.add=e);var f=a(t,"checkerboard",null);if(f){var p=a(f,"color1",16777215),g=a(f,"color2",255),v=a(f,"alpha1",255),m=a(f,"alpha2",255),y=a(f,"height",128);d.createCheckerboard(p,g,v,m,y)}return s(this.scene,d,t),n(d,t),d}))},30985:(t,e,i)=>{var s=i(33663);i(39429).register("plane",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},80321:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),o=i(30100),a=i(36060),h=i(67277),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},39829:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(80321);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},71255:(t,e,i)=>{var s=i(39429),n=i(80321);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},67277:(t,e,i)=>{var s,n=i(29747),r=n;s=i(57787),t.exports={renderWebGL:s,renderCanvas:r}},57787:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,f=o.getX(0,0),p=o.getY(0,0),g=o.getX(l,u),v=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,g,v,m,y,x,T,w,b,f,p),t.pipelines.postBatch(e)}},591:(t,e,i)=>{var s=i(83419),n=i(81320),r=i(88571),o=new s({Extends:r,initialize:function(t,e,i,s,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32);var a=new n(t.sys.textures,"",s,o);r.call(this,t,e,i,a),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(t,e){this.width=t,this.height=e,this.texture.setSize(t,e),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e){return this.setSize(t,e),this},saveTexture:function(t){var e=this.texture;return e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0),e},fill:function(t,e,i,s,n,r){return this.texture.fill(t,e,i,s,n,r),this},clear:function(){return this.texture.clear(),this},stamp:function(t,e,i,s,n){return this.texture.stamp(t,e,i,s,n),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,n){return this.texture.draw(t,e,i,s,n),this},drawFrame:function(t,e,i,s,n,r){return this.texture.drawFrame(t,e,i,s,n,r),this},repeat:function(t,e,i,s,n,r,o,a,h){return this.texture.repeat(t,e,i,s,n,r,o,a,h),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(t,e,i,s,n){return this.texture.batchDraw(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){return this.texture.batchDrawFrame(t,e,i,s,n,r),this},endDraw:function(t){return this.texture.endDraw(t),this},snapshotArea:function(t,e,i,s,n,r,o){return this.texture.snapshotArea(t,e,i,s,n,r,o),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=o},34495:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(591);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=new o(this.scene,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},60505:(t,e,i)=>{var s=i(39429),n=i(591);s.register("renderTexture",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},77757:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(31401),o=i(95643),a=i(36060),h=i(38745),l=i(26099),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.PostPipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate: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:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},26209:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(35154),a=i(77757);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},96819:(t,e,i)=>{var s=i(77757);i(39429).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},38745:(t,e,i)=>{var s,n,r=i(29747);s=i(20439),n=i(95262),t.exports={renderWebGL:s,renderCanvas:n}},20439:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,f=n.getTintAppendFloatAlpha,p=i.roundPixels,g=h.length,v=Math.floor(.5*g);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(83419),n=i(31401),r=i(95643),o=i(95540),a=i(79291),h=i(61622),l=i(25479),u=i(61340),c=i(95428),d=i(92503),f=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this._deferSetShader=null,this._deferProjOrtho=null,this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h),this.renderer.on(d.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(this.renderer.contextLost)return this._deferSetShader={key:t,textures:e,textureData:i},this;if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&r.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o.webGLProgram,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){if(this.renderer.contextLost)this._deferProjOrtho={left:t,right:e,bottom:i,top:s};else{var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i}},initUniforms:function(){var t=this.renderer.glFuncMap,e=this.program;for(var i in this._textureCount=0,this.uniforms){var s=this.uniforms[i],n=s.type,r=t[n];s.uniformLocation=this.renderer.createUniformLocation(e,i),"sampler2D"!==n&&(s.glMatrix=r.matrix,s.glValueLength=r.length,s.glFunc=r.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value.webGLTexture);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=t.value,n=e[o(i,"magFilter","linear").toUpperCase()],r=e[o(i,"minFilter","linear").toUpperCase()],a=e[o(i,"wrapS","repeat").toUpperCase()],h=e[o(i,"wrapT","repeat").toUpperCase()],l=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(a=e.REPEAT,h=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var u=o(i,"width",512),c=o(i,"height",2),d=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,l,u,c,d,l,e.UNSIGNED_BYTE,null),s.width=u,s.height=c}else e.texImage2D(e.TEXTURE_2D,0,l,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,h),s.magFilter=n,s.minFilter=r,s.wrapS=a,s.wrapT=h,s.format=l,s.flipY=!!i.flipY,s.pixels=t.source}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s.webGLUniformLocation,t.transpose,n):i.call(r,s.webGLUniformLocation,n):2===e?i.call(r,s.webGLUniformLocation,n.x,n.y):3===e?i.call(r,s.webGLUniformLocation,n.x,n.y,n.z):4===e?i.call(r,s.webGLUniformLocation,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n.webGLTexture),r.uniform1i(s.webGLUniformLocation,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r.webGLProgram),e.uniformMatrix4fv(e.getUniformLocation(r.webGLProgram,"uViewMatrix"),!1,o),e.uniformMatrix4fv(e.getUniformLocation(r.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),e.uniform2f(e.getUniformLocation(r.webGLProgram,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,f=c.x/i,p=1-c.y/s;d.value.x=f.toFixed(2),d.value.y=p.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n.webGLBuffer);var a=s.getAttribLocation(i.webGLProgram,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t,s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(null!==this._deferSetShader){var t=this._deferSetShader.key,e=this._deferSetShader.textures,i=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(t,e,i)}if(null!==this._deferProjOrtho){var s=this._deferProjOrtho.left,n=this._deferProjOrtho.right,r=this._deferProjOrtho.bottom,o=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(s,n,r,o)}},preDestroy:function(){var t=this.renderer;t.off(d.RESTORE_WEBGL,this.onContextRestored,this),t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(t.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),c(this.uniforms,(function(e){t.deleteUniformLocation(e.uniformLocation),e.uniformLocation=null}))}});t.exports=f},80464:t=>{t.exports=function(){}},54935:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(20071);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},74177:(t,e,i)=>{var s=i(20071);i(39429).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},25479:(t,e,i)=>{var s,n,r=i(29747);s=i(19257),n=i(80464),t.exports={renderWebGL:s,renderCanvas:n}},19257:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},10441:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},75177:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},17803:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(95643),o=i(23031),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},34682:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p{var s=i(13609),n=i(83419),r=i(39506),o=i(94811),a=i(96503),h=i(36383),l=i(17803),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},42542:(t,e,i)=>{var s=i(39506),n=i(65960),r=i(75177),o=i(20926);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},42563:(t,e,i)=>{var s=i(23629),n=i(39429);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},13609:(t,e,i)=>{var s,n,r=i(29747);s=i(41447),n=i(42542),t.exports={renderWebGL:s,renderCanvas:n}},41447:(t,e,i)=>{var s=i(91296),n=i(10441),r=i(34682);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},89:(t,e,i)=>{var s=i(83419),n=i(33141),r=i(94811),o=i(87841),a=i(17803),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(39429),n=i(89);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},33141:(t,e,i)=>{var s,n,r=i(29747);s=i(53987),n=i(3170),t.exports={renderWebGL:s,renderCanvas:n}},53987:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},19921:(t,e,i)=>{var s=i(83419),n=i(94811),r=i(54205),o=i(8497),a=i(17803),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(19921);i(39429).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},54205:(t,e,i)=>{var s,n,r=i(29747);s=i(19467),n=i(7930),t.exports={renderWebGL:s,renderCanvas:n}},19467:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},30479:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(26015),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},49912:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),v=Math.ceil(d/p),m=f,y=p,x=f-(g*f-c),T=p-(v*p-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===f&&x--,T===p&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(39429),n=i(30479);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},26015:(t,e,i)=>{var s,n,r=i(29747);s=i(46161),n=i(49912),t.exports={renderWebGL:s,renderCanvas:n}},46161:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),v=Math.ceil(d/p),m=f,y=p,x=f-(g*f-c),T=p-(v*p-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===f&&x--,T===p&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var P=o.strokeTint,R=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(P.TL=R,P.TR=R,P.BL=R,P.BR=R,S=1;S{var s=i(99651),n=i(83419),r=i(17803),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},11508:(t,e,i)=>{var s=i(65960),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},3933:(t,e,i)=>{var s=i(39429),n=i(61475);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},99651:(t,e,i)=>{var s,n,r=i(29747);s=i(68149),n=i(11508),t.exports={renderWebGL:s,renderCanvas:n}},68149:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,f,p,g=t.pipelines.set(e.pipeline),v=s(e,i,r),m=g.calcMatrix.copyFrom(v.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),f=m.getX(0,w-x),p=m.getY(0,w-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(-T,-x),p=m.getY(-T,-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(T,-x),p=m.getY(T,-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},16933:(t,e,i)=>{var s=i(83419),n=i(60561),r=i(17803),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},79590:(t,e,i)=>{var s=i(65960),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},49803:(t,e,i)=>{var s=i(39429),n=i(16933);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},60561:(t,e,i)=>{var s,n,r=i(29747);s=i(51503),n=i(79590),t.exports={renderWebGL:s,renderCanvas:n}},51503:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=i.alpha*e.alpha;if(e.isFilled){var g,v,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&f){g=n.getTintAppendFloatAlpha(e.fillTop,p),v=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,v,m,y,x,T,w,b,E,0,0,1,1,g,g,g,g,2)}e.showLeft&&(g=n.getTintAppendFloatAlpha(e.fillLeft,p),f?(v=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(v=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,v,m,y,x,T,w,0,0,1,1,g,g,g,2)),e.showRight&&(g=n.getTintAppendFloatAlpha(e.fillRight,p),f?(v=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(v=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,v,m,y,x,T,w,0,0,1,1,g,g,g,2)),t.pipelines.postBatch(e)}}},57847:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(23031),o=i(36823),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},17440:(t,e,i)=>{var s=i(75177),n=i(20926);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},2481:(t,e,i)=>{var s=i(39429),n=i(57847);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},36823:(t,e,i)=>{var s,n,r=i(29747);s=i(77385),n=i(17440),t.exports={renderWebGL:s,renderCanvas:n}},77385:(t,e,i)=>{var s=i(91296),n=i(70554);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d,o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,e._startWidth/2,e._endWidth/2,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},24949:(t,e,i)=>{var s=i(90273),n=i(83419),r=i(94811),o=i(13829),a=i(25717),h=i(17803),l=i(5469),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(39429),n=i(24949);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},90273:(t,e,i)=>{var s,n,r=i(29747);s=i(73695),n=i(38710),t.exports={renderWebGL:s,renderCanvas:n}},73695:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},74561:(t,e,i)=>{var s=i(83419),n=i(87841),r=i(17803),o=i(95597),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},48682:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},87959:(t,e,i)=>{var s=i(39429),n=i(74561);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},95597:(t,e,i)=>{var s,n,r=i(29747);s=i(52059),n=i(48682),t.exports={renderWebGL:s,renderCanvas:n}},52059:(t,e,i)=>{var s=i(91296),n=i(34682),r=i(70554);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},55911:(t,e,i)=>{var s=i(81991),n=i(83419),r=i(94811),o=i(17803),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(55911);i(39429).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},81991:(t,e,i)=>{var s,n,r=i(29747);s=i(57017),n=i(64272),t.exports={renderWebGL:s,renderCanvas:n}},57017:(t,e,i)=>{var s=i(10441),n=i(91296),r=i(34682);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},36931:(t,e,i)=>{var s=i(83419),n=i(17803),r=i(16483),o=i(96195),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},85172:(t,e,i)=>{var s=i(65960),n=i(75177),r=i(20926);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,g=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,f),a.lineTo(p,g),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},45245:(t,e,i)=>{var s=i(39429),n=i(36931);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},96195:(t,e,i)=>{var s,n,r=i(29747);s=i(83253),n=i(85172),t.exports={renderWebGL:s,renderCanvas:n}},83253:(t,e,i)=>{var s=i(91296),n=i(34682),r=i(70554);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,g=e.geom.y1-u,v=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(p,g,v,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},68287:(t,e,i)=>{var s=i(9674),n=i(83419),r=i(31401),o=i(95643),a=i(92751),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},76552:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},15567:(t,e,i)=>{var s=i(25305),n=i(13059),r=i(44603),o=i(23568),a=i(68287);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},46409:(t,e,i)=>{var s=i(39429),n=i(68287);s.register("sprite",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},92751:(t,e,i)=>{var s,n,r=i(29747);s=i(9409),n=i(76552),t.exports={renderWebGL:s,renderCanvas:n}},9409:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},14220:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(u+=t.letterSpacing*(i[l].length-1)),r.wordWrap&&(u-=n.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+r.strokeThickness,d=c*h,f=t.lineSpacing;return h>1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},79557:(t,e,i)=>{var s=i(27919);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,f,p=c.data,g=p.length,v=4*a,m=0,y=!1;for(d=0;dh;d--){for(f=0;f{var s=i(40366),n=i(27919),r=i(83419),o=i(31401),a=i(95643),h=i(14220),l=i(35154),u=i(35846),c=i(61771),d=i(35762),f=i(45650),p=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,c],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=n.create(this),this.context,this.style=new d(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.letterSpacing=0,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=t.sys.textures.addCanvas(this._textureKey,this.canvas),this.context=this.texture.context,this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("wordWrapWidth < a single character");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n.splice(o+1,0,y),r=n.length;break}h+=f,l-=p}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],f=e.measureText(d).width,p=f;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=l.lineSpacing*g),i.rtl)c=f-c-u.left-u.right;else if("right"===i.align)c+=o-l.lineWidths[g];else if("center"===i.align)c+=(o-l.lineWidths[g])/2;else if("justify"===i.align&&l.lineWidths[g]/l.width>=.85){var v=l.width-l.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}if(this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(i.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color){i.syncShadow(e,i.shadowFill);var b=this.letterSpacing;if(0!==b)for(var E=0,S=a[g].split(""),A=0;A{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},71259:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(50171);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},68005:(t,e,i)=>{var s=i(50171);i(39429).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},61771:(t,e,i)=>{var s,n,r=i(29747);s=i(34397),n=i(79724),t.exports={renderWebGL:s,renderCanvas:n}},35762:(t,e,i)=>{var s=i(83419),n=i(23568),r=i(35154),o=i(79557),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var h=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],h):n(t,a[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=o(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},34397:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},20839:(t,e,i)=>{var s=i(27919),n=i(83419),r=i(31401),o=i(95643),a=i(98439),h=i(68703),l=i(56295),u=i(45650),c=i(26099),d=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,l],initialize:function(t,e,i,n,r,h,l){var d=t.sys.renderer;o.call(this,t,"TileSprite");var f=t.sys.textures.get(h),p=f.get(l);p.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),p=(f=t.sys.textures.get("__MISSING")).get()),"DynamicTexture"===f.type&&(console.warn("TileSprite cannot use Dynamic Texture"),p=(f=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this._textureKey=u(),this.texture=t.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=a(p.width),this.potHeight=a(p.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(l),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=a(e.width),this.potHeight=a(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||h.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var t=this.texture;t&&t.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},46992:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},14167:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(20839);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},91681:(t,e,i)=>{var s=i(20839);i(39429).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},56295:(t,e,i)=>{var s,n,r=i(29747);s=i(18553),n=i(46992),t.exports={renderWebGL:s,renderCanvas:n}},18553:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},18471:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(31401),o=i(51708),a=i(8443),h=i(95643),l=i(36383),u=i(14463),c=i(45650),d=i(10247),f=new n({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){h.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._metadataCallbackHandler=this.metadataHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._rfvCallbackId=0;var n=t.sys.game;this._device=n.device.video,this.setPosition(e,i),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),n.events.on(a.PAUSE,this.globalPause,this),n.events.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,n))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var n=this.video;if(n?(this.removeLoadEventHandlers(),this.stop()):((n=document.createElement("video")).controls=!1,n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.setAttribute("disablePictureInPicture","true")),e?(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")):(n.muted=!1,n.defaultMuted=!1,n.removeAttribute("autoplay")),i?n.setAttribute("crossorigin",i):n.removeAttribute("crossorigin"),s)if("srcObject"in n)try{n.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;n.src=URL.createObjectURL(s)}else n.src=URL.createObjectURL(s);else n.src=t;this.retry=0,this.video=n,this._playCalled=!1,n.load(),this.addLoadEventHandlers();var r=this.scene.sys.textures.get(this._key);return this.setTexture(r),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,n=e.height,r=this.videoTexture,a=this.videoTextureSource,h=!r||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,r?(a.source=i,a.width=s,a.height=n,r.get().setSize(s,n)):((r=this.scene.sys.textures.create(this._key,i,s,n)).add("__BASE",0,0,0,s,n),this.setTexture(r),this.videoTexture=r,this.videoTextureSource=r.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(o.VIDEO_TEXTURE,this,r)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,s,n),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){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=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},metadataHandler:function(t){this.emit(o.VIDEO_METADATA,this,t)},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,1!==this.scaleX&&(this.scaleX=this.displayWidth/this.width),1!==this.scaleY&&(this.scaleY=this.displayHeight/this.height);var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.flipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this)}});t.exports=f},58352:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},11511:(t,e,i)=>{var s=i(25305),n=i(44603),r=i(23568),o=i(18471);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},89025:(t,e,i)=>{var s=i(18471);i(39429).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},10247:(t,e,i)=>{var s,n,r=i(29747);s=i(29849),n=i(58352),t.exports={renderWebGL:s,renderCanvas:n}},29849:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},41481:(t,e,i)=>{var s=i(10312),n=i(96503),r=i(87902),o=i(83419),a=i(31401),h=i(95643),l=i(87841),u=i(37303),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},95261:(t,e,i)=>{var s=i(44603),n=i(23568),r=i(41481);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},84175:(t,e,i)=>{var s=i(41481);i(39429).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95166:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},96503:(t,e,i)=>{var s=i(83419),n=i(87902),r=i(26241),o=i(79124),a=i(23777),h=i(28176),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},71562:t=>{t.exports=function(t){return Math.PI*t.radius*2}},92110:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},42250:(t,e,i)=>{var s=i(96503);t.exports=function(t){return new s(t.x,t.y,t.radius)}},87902:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},5698:(t,e,i)=>{var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)}},70588:(t,e,i)=>{var s=i(87902);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},26394:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},76278:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},2074:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},26241:(t,e,i)=>{var s=i(92110),n=i(62945),r=i(36383),o=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},79124:(t,e,i)=>{var s=i(71562),n=i(92110),r=i(62945),o=i(36383);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},39212:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},28176:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},88911:(t,e,i)=>{var s=i(96503);s.Area=i(95166),s.Circumference=i(71562),s.CircumferencePoint=i(92110),s.Clone=i(42250),s.Contains=i(87902),s.ContainsPoint=i(5698),s.ContainsRect=i(70588),s.CopyFrom=i(26394),s.Equals=i(76278),s.GetBounds=i(2074),s.GetPoint=i(26241),s.GetPoints=i(79124),s.Offset=i(50884),s.OffsetPoint=i(39212),s.Random=i(28176),t.exports=s},23777:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},78874:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},92990:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},79522:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},58102:(t,e,i)=>{var s=i(8497);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},81154:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},46662:(t,e,i)=>{var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)}},1632:(t,e,i)=>{var s=i(81154);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},65534:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},8497:(t,e,i)=>{var s=i(83419),n=i(81154),r=i(90549),o=i(48320),a=i(23777),h=i(24820),l=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=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},36146:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},23694:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},90549:(t,e,i)=>{var s=i(79522),n=i(62945),r=i(36383),o=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},48320:(t,e,i)=>{var s=i(92990),n=i(79522),r=i(62945),o=i(36383);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},44808:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},24820:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},49203:(t,e,i)=>{var s=i(8497);s.Area=i(78874),s.Circumference=i(92990),s.CircumferencePoint=i(79522),s.Clone=i(58102),s.Contains=i(81154),s.ContainsPoint=i(46662),s.ContainsRect=i(1632),s.CopyFrom=i(65534),s.Equals=i(36146),s.GetBounds=i(23694),s.GetPoint=i(90549),s.GetPoints=i(48320),s.Offset=i(73424),s.OffsetPoint=i(44808),s.Random=i(24820),t.exports=s},55738:(t,e,i)=>{var s=i(23777),n=i(79291),r={Circle:i(88911),Ellipse:i(49203),Intersects:i(91865),Line:i(2529),Mesh:i(73090),Point:i(43711),Polygon:i(58423),Rectangle:i(93232),Triangle:i(84435)};r=n(!1,r,s),t.exports=r},2044:(t,e,i)=>{var s=i(20339);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},81491:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},63376:(t,e,i)=>{var s=i(2141),n=i(2044);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new s(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,v-h*g)))}}return i}},97439:(t,e,i)=>{var s=i(4042),n=i(81491);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},4042:(t,e,i)=>{var s=i(2141),n=i(80462);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,f=e.radius,p=l-a,g=u-h,v=a-c,m=h-d,y=p*p+g*g,x=2*(p*v+g*m),T=x*x-4*y*(v*v+m*m-f*f);if(0===T){var w=-x/(2*y);r=a+w*p,o=h+w*g,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*p,o=h+E*g,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},36100:(t,e,i)=>{var s=i(25836);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,o,a,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,f=e.y1,p=u-h,g=c-l,v=e.x2-d,m=e.y2-f,y=p*m-g*v;if(0===y)return null;if(i){if((o=(d+v*(r=(p*(f-l)+g*(h-d))/(v*g-m*p))-h)/p)<0||r<0||r>1)return null;a=o}else{if(o=((l-f)*p-(h-d)*g)/y,(r=((d-h)*m-(f-l)*v)/y)<0||r>1||o<0||o>1)return null;a=r}return void 0===n&&(n=new s),n.set(h+p*a,l+g*a,a)}},3073:(t,e,i)=>{var s=i(36100),n=i(23031),r=i(25836),o=new n,a=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),a.set();for(var l=e[e.length-1],u=0;u{var s=i(25836),n=i(61369),r=i(3073),o=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var a=!1;s.set(),o.set();for(var h=0;h{var s=i(2141),n=i(76112),r=i(92773);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},71147:(t,e,i)=>{var s=i(61369),n=i(56362),r=new(i(23031));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o,!0);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(87841),n=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},52784:(t,e,i)=>{var s=i(60646),n=i(59996);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},26341:(t,e,i)=>{var s=i(89265),n=i(60646);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},38720:(t,e,i)=>{var s=i(4042),n=i(67636);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},13882:(t,e,i)=>{var s=i(2141),n=i(2822),r=i(76112);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},75636:(t,e,i)=>{var s=i(82944),n=i(13882);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},80462:(t,e,i)=>{var s=i(87902),n=new(i(2141));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},76112:t=>{t.exports=function(t,e,i){var s=t.x1,n=t.y1,r=t.x2,o=t.y2,a=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===r&&n===o||a===l&&h===u)return!1;var c=(u-h)*(r-s)-(l-a)*(o-n);if(0===c)return!1;var d=((l-a)*(n-h)-(u-h)*(s-a))/c,f=((r-s)*(n-h)-(o-n)*(s-a))/c;return!(d<0||d>1||f<0||f>1||(i&&(i.x=s+d*(r-s),i.y=n+d*(o-n)),0))}},92773:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},16204:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},14199:(t,e,i)=>{var s=i(16204);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},59996:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},89265:(t,e,i)=>{var s=i(76112),n=i(37303),r=i(48653),o=i(77493);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},84411:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(80462),n=i(10690);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(76112);t.exports=function(t,e){return!!(t.contains(e.x1,e.y1)||t.contains(e.x2,e.y2)||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},82944:(t,e,i)=>{var s=i(48653),n=i(71694),r=i(76112);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},91865:(t,e,i)=>{t.exports={CircleToCircle:i(2044),CircleToRectangle:i(81491),GetCircleToCircle:i(63376),GetCircleToRectangle:i(97439),GetLineToCircle:i(4042),GetLineToLine:i(36100),GetLineToPoints:i(3073),GetLineToPolygon:i(56362),GetLineToRectangle:i(60646),GetRaysFromPointToPolygon:i(71147),GetRectangleIntersection:i(68389),GetRectangleToRectangle:i(52784),GetRectangleToTriangle:i(26341),GetTriangleToCircle:i(38720),GetTriangleToLine:i(13882),GetTriangleToTriangle:i(75636),LineToCircle:i(80462),LineToLine:i(76112),LineToRectangle:i(92773),PointToLine:i(16204),PointToLineSegment:i(14199),RectangleToRectangle:i(59996),RectangleToTriangle:i(89265),RectangleToValues:i(84411),TriangleToCircle:i(67636),TriangleToLine:i(2822),TriangleToTriangle:i(82944)}},91938:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},84993:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),f{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},31116:(t,e,i)=>{var s=i(23031);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},59944:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},59220:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},78177:(t,e,i)=>{var s=i(35001);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},26708:(t,e,i)=>{var s=i(52816),n=i(6113),r=i(2141);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,f=t.x2-c,p=t.y2-d,g=n(e,a),v=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},99569:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},34638:(t,e,i)=>{var s=i(36383),n=i(91938),r=i(2141);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},13151:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},15258:(t,e,i)=>{var s=i(35001),n=i(2141);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},98770:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},35001:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},23031:(t,e,i)=>{var s=i(83419),n=i(13151),r=i(15258),o=i(23777),a=i(65822),h=i(26099),l=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=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo: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=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},setFromObjects:function(t,e){return this.x1=t.x,this.y1=t.y,this.x2=e.x,this.y2=e.y,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},64795:(t,e,i)=>{var s=i(36383),n=i(15994),r=i(91938);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},52616:(t,e,i)=>{var s=i(36383),n=i(91938);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},87231:(t,e,i)=>{var s=i(36383),n=i(91938);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},89662:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},71165:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},65822:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},69777:(t,e,i)=>{var s=i(91938),n=i(64795);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},39706:(t,e,i)=>{var s=i(64400);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},82585:(t,e,i)=>{var s=i(64400);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},64400:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},62377:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},71366:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},10809:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},2529:(t,e,i)=>{var s=i(23031);s.Angle=i(91938),s.BresenhamPoints=i(84993),s.CenterOn=i(36469),s.Clone=i(31116),s.CopyFrom=i(59944),s.Equals=i(59220),s.Extend=i(78177),s.GetEasedPoints=i(26708),s.GetMidPoint=i(32125),s.GetNearestPoint=i(99569),s.GetNormal=i(34638),s.GetPoint=i(13151),s.GetPoints=i(15258),s.GetShortestDistance=i(26408),s.Height=i(98770),s.Length=i(35001),s.NormalAngle=i(64795),s.NormalX=i(52616),s.NormalY=i(87231),s.Offset=i(89662),s.PerpSlope=i(71165),s.Random=i(65822),s.ReflectAngle=i(69777),s.Rotate=i(39706),s.RotateAroundPoint=i(82585),s.RotateAroundXY=i(64400),s.SetToAngle=i(62377),s.Slope=i(71366),s.Width=i(10809),t.exports=s},83997:(t,e,i)=>{var s=i(83419),n=i(87841),r=i(26099);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),f=o(s,n,e,i),p=c+d+f;return this._inCenter.set((e*c+s*d+r*f)/p,(i*c+n*d+a*f)/p)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,f=i.b,p=i.c,g=i.d,v=i.e,m=i.f;o=s.vx*d+s.vy*p+v,a=s.vx*f+s.vy*g+m,h=n.vx*d+n.vy*p+v,l=n.vx*f+n.vy*g+m,u=r.vx*d+r.vy*p+v,c=r.vx*f+r.vy*g+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,M=T*b+w*E,P=S*C-A*A,R=0===P?0:1/P,L=(C*_-A*M)*R,O=(S*M-A*_)*R;return L>=0&&O>=0&&L+O<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){this.update(s,n,r,o,a,h,l,u);var c=this.vertex1,d=this.vertex2,f=this.vertex3;if(c.ta<=0&&d.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var p=this.bounds;p.x=Math.min(c.tx,d.tx,f.tx),p.y=Math.min(c.ty,d.ty,f.ty),p.width=Math.max(c.tx,d.tx,f.tx)-p.x,p.height=Math.max(c.ty,d.ty,f.ty)-p.y;var g=t.x+t.width,v=t.y+t.height;return!(p.width<=0||p.height<=0||t.width<=0||t.height<=0||p.rightg||p.y>v)},scrollUV:function(t,e){return this.vertex1.scrollUV(t,e),this.vertex2.scrollUV(t,e),this.vertex3.scrollUV(t,e),this},scaleUV:function(t,e){return this.vertex1.scaleUV(t,e),this.vertex2.scaleUV(t,e),this.vertex3.scaleUV(t,e),this},setColor:function(t){return this.vertex1.color=t,this.vertex2.color=t,this.vertex3.color=t,this},update:function(t,e,i,s,n,r,o,a){return this.vertex1.update(e,i,s,n,r,o,a,t),this.vertex2.update(e,i,s,n,r,o,a,t),this.vertex3.update(e,i,s,n,r,o,a,t),this},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},48803:(t,e,i)=>{var s=i(83997),n=i(95540),r=i(37867),o=i(25836),a=i(39318),h=new o,l=new o,u=new r;t.exports=function(t){var e,i=n(t,"mesh"),r=n(t,"texture",null),o=n(t,"frame"),c=n(t,"width",1),d=n(t,"height",c),f=n(t,"widthSegments",1),p=n(t,"heightSegments",f),g=n(t,"x",0),v=n(t,"y",0),m=n(t,"z",0),y=n(t,"rotateX",0),x=n(t,"rotateY",0),T=n(t,"rotateZ",0),w=n(t,"zIsUp",!0),b=n(t,"isOrtho",!!i&&i.dirtyCache[11]),E=n(t,"colors",[16777215]),S=n(t,"alphas",[1]),A=n(t,"tile",!1),_=n(t,"flipY",!1),C=n(t,"width",null),M={faces:[],verts:[]};if(h.set(g,v,m),l.set(y,x,T),u.fromRotationXYTranslation(l,h,w),!r&&i)r=i.texture,o||(e=i.frame);else if(i&&"string"==typeof r)r=i.scene.sys.textures.get(r);else if(!r)return M;e||(e=r.get(o)),!C&&b&&r&&i&&(c=e.width/i.height,d=e.height/i.height);var P,R,L=c/2,O=d/2,F=Math.floor(f),D=Math.floor(p),k=F+1,I=D+1,B=c/F,N=d/D,U=[],X=[],Y=0,z=1,G=0,V=1;e&&(Y=e.u0,z=e.u1,_?(G=e.v1,V=e.v0):(G=e.v0,V=e.v1));var W=z-Y,H=V-G;for(R=0;R{var s=i(83997),n=i(37867),r=i(25836),o=i(39318),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,f,p){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=!0);var g={faces:[],verts:[]},v=t.materials;a.set(n,r,u),h.set(c,d,f),l.fromRotationXYTranslation(h,a,p);for(var m=0;m{var s=i(83997),n=i(39318);t.exports=function(t,e,i,r,o,a,h,l){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),void 0===l&&(l=!1),t.length===e.length||r){var u,c,d,f,p,g,v,m,y,x,T,w={faces:[],vertices:[]},b=r?3:2,E=Array.isArray(a),S=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(u=0;u{var e=!0,i="untitled",s="",n="";function r(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function o(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function a(t){2===t.length&&(s=t[1])}function h(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,o=i>=4?parseFloat(t[3]):0;r(e).vertices.push({x:s,y:n,z:o})}function l(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,o=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(o)&&(o=0),isNaN(a)&&(a=0),e&&(o=1-o),r(i).textureCoords.push({u:n,v:o,w:a})}function u(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,o=i>=4?parseFloat(t[3]):0;r(e).vertexNormals.push({x:s,y:n,z:o})}function c(t,e){var i=t.length-1;if(!(i<3)){for(var o={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=r(e).vertices.length+1+u),c-=1,u-=1,d-=1,o.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}r(e).faces.push(o)}}function d(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var r,p,g={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),m=0;m-1?r.substring(0,p):r).replace(/\s\s+/g," ").trim().split(" ");switch(y[0].toLowerCase()){case"o":o(y,g);break;case"g":a(y);break;case"v":h(y,g);break;case"vt":l(y,g);break;case"vn":u(y,g);break;case"f":c(y,g);break;case"mtllib":d(y,g);break;case"usemtl":f(y)}}return g}},61485:(t,e,i)=>{var s=i(37589);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},92570:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,f=l.y-r;l.set(d*a-f*h+n,d*h+f*a+r),d=u.x-n,f=u.y-r,u.set(d*a-f*h+n,d*h+f*a+r),d=c.x-n,f=c.y-r,c.set(d*a-f*h+n,d*h+f*a+r)}},39318:(t,e,i)=>{var s=i(83419),n=i(70554),r=i(25836),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=n},setUVs:function(t,e){return this.u=t,this.v=e,this.tu=t,this.tv=e,this},scrollUV:function(t,e){return this.tu+=t,this.tv+=e,this},scaleUV:function(t,e){return this.tu=this.u*t,this.tv=this.v*e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},resize:function(t,e,i,s,n,r){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*s,this.vz=0,n<.5?this.vx+=i*(.5-n):n>.5&&(this.vx-=i*(n-.5)),r<.5?this.vy+=s*(.5-r):r>.5&&(this.vy-=s*(r-.5)),this},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.tu,t[++i]=this.tv,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},73090:(t,e,i)=>{var s={Face:i(83997),GenerateGridVerts:i(48803),GenerateObjVerts:i(34684),GenerateVerts:i(92515),ParseObj:i(85048),ParseObjMaterial:i(61485),RotateFace:i(92570),Vertex:i(39318)};t.exports=s},96550:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},99706:(t,e,i)=>{var s=i(2141);t.exports=function(t){return new s(t.x,t.y)}},68010:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},27814:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},73565:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},87555:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},44405:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20873:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(2141);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},55767:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},79432:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},2141:(t,e,i)=>{var s=i(83419),n=i(23777),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},72930:(t,e,i)=>{var s=i(2141),n=i(44405);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},62880:(t,e,i)=>{var s=i(2141);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},15093:(t,e,i)=>{var s=i(28793);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},43711:(t,e,i)=>{var s=i(2141);s.Ceil=i(96550),s.Clone=i(99706),s.CopyFrom=i(68010),s.Equals=i(27814),s.Floor=i(73565),s.GetCentroid=i(87555),s.GetMagnitude=i(28793),s.GetMagnitudeSq=i(44405),s.GetRectangleFromPoints=i(20873),s.Interpolate=i(26152),s.Invert=i(55767),s.Negative=i(79432),s.Project=i(72930),s.ProjectUnit=i(62880),s.SetMagnitude=i(15093),t.exports=s},12306:(t,e,i)=>{var s=i(25717);t.exports=function(t){return new s(t.points)}},63814:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(63814);t.exports=function(t,e){return s(t,e.x,e.y)}},94811:t=>{"use strict";function e(t,e,s){s=s||2;var r,o,a,h,c,d,p,g=e&&e.length,v=g?e[0]*s:t.length,m=i(t,0,v,s,!0),y=[];if(!m||m.next===m.prev)return y;if(g&&(m=function(t,e,s,n){var r,o,a,h=[];for(r=0,o=e.length;r80*s){r=a=t[0],o=h=t[1];for(var x=s;xa&&(a=c),d>h&&(h=d);p=0!==(p=Math.max(a-r,h-o))?32767/p:0}return n(m,y,s,r,o,p,0),y}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==v(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{0===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?o(t,l,u,c):r(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),S(t),t=g.next,v=g.next;else if((t=g)===v){f?1===f?n(t=a(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(v(e,i,s)>=0)return!1;for(var n=e.x,r=i.x,o=s.x,a=e.y,h=i.y,l=s.y,u=nr?n>o?n:o:r>o?r:o,f=a>h?a>l?a:l:h>l?h:l,g=s.next;g!==e;){if(g.x>=u&&g.x<=d&&g.y>=c&&g.y<=f&&p(n,a,r,h,o,l,g.x,g.y)&&v(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(v(n,r,o)>=0)return!1;for(var a=n.x,h=r.x,l=o.x,u=n.y,c=r.y,f=o.y,g=ah?a>l?a:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,T=d(g,m,e,i,s),w=d(y,x,e,i,s),b=t.prevZ,E=t.nextZ;b&&b.z>=T&&E&&E.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=m&&b.y<=x&&b!==n&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&v(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=x&&E!==n&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&v(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=m&&b.y<=x&&b!==n&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&v(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=w;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=x&&E!==n&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&v(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a,0),void n(u,e,i,r,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o&&(o=a,i=s.x=s.x&&s.x>=u&&n!==s.x&&p(ri.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var n=b(i,t);return s(n,n.next),s(i,i.next)}function c(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(r-a)&&(t-o)*(s-a)>=(i-o)*(e-a)&&(i-o)*(r-a)>=(n-o)*(s-a)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||m(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(v(t,e,i)),r=T(v(t,e,s)),o=T(v(i,s,t)),a=T(v(i,s,e));return n!==r&&o!==a||!(0!==n||!x(t,i,e))||!(0!==r||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},13829:(t,e,i)=>{var s=i(87841);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(35001),n=i(23031),r=i(30052);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},30052:(t,e,i)=>{var s=i(35001),n=i(23031);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(83419),n=i(63814),r=i(9564),o=i(23777),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=0;i{t.exports=function(t){return t.points.reverse(),t}},29524:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},5469:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},24709:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(25717);s.Clone=i(12306),s.Contains=i(63814),s.ContainsPoint=i(99338),s.Earcut=i(94811),s.GetAABB=i(13829),s.GetNumberArray=i(26173),s.GetPoints=i(9564),s.Perimeter=i(30052),s.Reverse=i(8133),s.Simplify=i(29524),s.Smooth=i(5469),s.Translate=i(24709),t.exports=s},62224:t=>{t.exports=function(t){return t.width*t.height}},98615:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},31688:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},67502:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},65085:(t,e,i)=>{var s=i(87841);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},37303:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},96553:(t,e,i)=>{var s=i(37303);t.exports=function(t,e){return s(t,e.x,e.y)}},70273:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},77493:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},9219:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},53751:(t,e,i)=>{var s=i(8249);t.exports=function(t,e){var i=s(t);return i{var s=i(8249);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},80774:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},83859:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},19217:(t,e,i)=>{var s=i(87841),n=i(36383);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(87841);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},8249:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},27165:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},20812:(t,e,i)=>{var s=i(13019),n=i(2141);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},34819:(t,e,i)=>{var s=i(20812),n=i(13019);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},86091:(t,e,i)=>{var s=i(67502);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},53951:(t,e,i)=>{var s=i(87841),n=i(59996);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},14649:(t,e,i)=>{var s=i(13019),n=i(2141);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},33595:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},92171:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},42981:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},46907:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},60170:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},13019:t=>{t.exports=function(t){return 2*(t.width+t.height)}},85133:(t,e,i)=>{var s=i(2141),n=i(39506);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},86470:(t,e,i)=>{var s=i(30976),n=i(70273),r=i(2141);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},87841:(t,e,i)=>{var s=i(83419),n=i(37303),r=i(20812),o=i(34819),a=i(23777),h=i(23031),l=i(26597),u=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=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},94845:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},31730:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},36899:(t,e,i)=>{var s=i(87841);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},93232:(t,e,i)=>{var s=i(87841);s.Area=i(62224),s.Ceil=i(98615),s.CeilAll=i(31688),s.CenterOn=i(67502),s.Clone=i(65085),s.Contains=i(37303),s.ContainsPoint=i(96553),s.ContainsRect=i(70273),s.CopyFrom=i(43459),s.Decompose=i(77493),s.Equals=i(9219),s.FitInside=i(53751),s.FitOutside=i(16088),s.Floor=i(80774),s.FloorAll=i(83859),s.FromPoints=i(19217),s.FromXY=i(9477),s.GetAspectRatio=i(8249),s.GetCenter=i(27165),s.GetPoint=i(20812),s.GetPoints=i(34819),s.GetSize=i(51313),s.Inflate=i(86091),s.Intersection=i(53951),s.MarchingAnts=i(14649),s.MergePoints=i(33595),s.MergeRect=i(20074),s.MergeXY=i(92171),s.Offset=i(42981),s.OffsetPoint=i(46907),s.Overlaps=i(60170),s.Perimeter=i(13019),s.PerimeterPoint=i(85133),s.Random=i(26597),s.RandomOutside=i(86470),s.SameDimensions=i(94845),s.Scale=i(31730),s.Union=i(36899),t.exports=s},41658:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},39208:(t,e,i)=>{var s=i(16483);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},39545:(t,e,i)=>{var s=i(94811),n=i(16483);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,f,p,g,v=s(t,e),m=0;m{var s=i(16483);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},23707:(t,e,i)=>{var s=i(97523),n=i(13584);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},97523:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},24951:(t,e,i)=>{var s=i(26099);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},85614:(t,e,i)=>{var s=i(96503);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,f=l-r,p=u-o,g=c*(r+a)+d*(o+h),v=f*(r+l)+p*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(p*g-d*v)/m,e.y=(c*v-f*g)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},74422:(t,e,i)=>{var s=i(16483);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},10690:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},48653:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},96006:(t,e,i)=>{var s=i(10690);t.exports=function(t,e){return s(t,e.x,e.y)}},71326:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},71694:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},33522:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},20437:(t,e,i)=>{var s=i(2141),n=i(35001);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},80672:(t,e,i)=>{var s=i(35001),n=i(2141);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},39757:(t,e,i)=>{var s=i(2141);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),f=u+c+d;return e.x=(i*u+o*c+h*d)/f,e.y=(r*u+a*c+l*d)/f,e}},13584:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},1376:(t,e,i)=>{var s=i(35001);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},90260:(t,e,i)=>{var s=i(2141);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},52172:(t,e,i)=>{var s=i(99614),n=i(39757);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},49907:(t,e,i)=>{var s=i(99614);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},99614:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},16483:(t,e,i)=>{var s=i(83419),n=i(10690),r=i(20437),o=i(80672),a=i(23777),h=i(23031),l=i(90260),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},84435:(t,e,i)=>{var s=i(16483);s.Area=i(41658),s.BuildEquilateral=i(39208),s.BuildFromPolygon=i(39545),s.BuildRight=i(90301),s.CenterOn=i(23707),s.Centroid=i(97523),s.CircumCenter=i(24951),s.CircumCircle=i(85614),s.Clone=i(74422),s.Contains=i(10690),s.ContainsArray=i(48653),s.ContainsPoint=i(96006),s.CopyFrom=i(71326),s.Decompose=i(71694),s.Equals=i(33522),s.GetPoint=i(20437),s.GetPoints=i(80672),s.InCenter=i(39757),s.Perimeter=i(1376),s.Offset=i(13584),s.Random=i(90260),s.Rotate=i(52172),s.RotateAroundPoint=i(49907),s.RotateAroundXY=i(99614),t.exports=s},74457:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},84409:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},7003:(t,e,i)=>{var s=i(83419),n=i(93301),r=i(50792),o=i(8214),a=i(8443),h=i(78970),l=i(85098),u=i(42515),c=i(36210),d=i(61340),f=i(85955),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(o.MANAGER_BOOT),e.on(a.PRE_RENDER,this.preRender,this),e.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(96503),n=i(87902),r=i(83419),o=i(93301),a=i(74457),h=i(84409),l=i(20339),u=i(8497),c=i(81154),d=i(8214),f=i(50792),p=i(95540),g=i(23777),v=i(89639),m=i(41212),y=i(37277),x=i(87841),T=i(37303),w=i(44594),b=i(16483),E=i(10690),S=new r({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,v.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),this.manager.resetCursor(i),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t){var e=t.input;e&&(e.enabled=!1,e.dragState=0);for(var i,s=this._drag,n=this._over,r=this.manager,o=0;o-1&&s[o].splice(i,1),(i=n[o].indexOf(t))>-1&&n[o].splice(i,1);return this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);p*=1/o.parentContainer.scaleX,g*=1/o.parentContainer.scaleY,n=p+a.dragStartX,r=g+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)&&Object.keys(e).length){var u=e,c=t.some((function(t){return t.hasOwnProperty("faces")}));if(!c){e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),h=p(u,"pixelPerfect",!1);var d=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(d))}s=p(u,"draggable",!1),n=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var f=0;f{var s=i(35154),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},42515:(t,e,i)=>{var s=i(31040),n=i(83419),r=i(20339),o=i(43855),a=i(47235),h=i(26099),l=i(25892),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},7179:t=>{t.exports="boot"},85375:t=>{t.exports="destroy"},39843:t=>{t.exports="dragend"},23388:t=>{t.exports="dragenter"},16133:t=>{t.exports="drag"},27829:t=>{t.exports="dragleave"},53904:t=>{t.exports="dragover"},56058:t=>{t.exports="dragstart"},2642:t=>{t.exports="drop"},88171:t=>{t.exports="gameobjectdown"},36147:t=>{t.exports="dragend"},71692:t=>{t.exports="dragenter"},96149:t=>{t.exports="drag"},81285:t=>{t.exports="dragleave"},74048:t=>{t.exports="dragover"},21322:t=>{t.exports="dragstart"},49378:t=>{t.exports="drop"},86754:t=>{t.exports="gameobjectmove"},86433:t=>{t.exports="gameobjectout"},60709:t=>{t.exports="gameobjectover"},24081:t=>{t.exports="pointerdown"},11172:t=>{t.exports="pointermove"},18907:t=>{t.exports="pointerout"},95579:t=>{t.exports="pointerover"},35368:t=>{t.exports="pointerup"},26972:t=>{t.exports="wheel"},47078:t=>{t.exports="gameobjectup"},73802:t=>{t.exports="gameobjectwheel"},56718:t=>{t.exports="gameout"},25936:t=>{t.exports="gameover"},27503:t=>{t.exports="boot"},50852:t=>{t.exports="process"},96438:t=>{t.exports="update"},59152:t=>{t.exports="pointerlockchange"},47777:t=>{t.exports="pointerdown"},27957:t=>{t.exports="pointerdownoutside"},19444:t=>{t.exports="pointermove"},54251:t=>{t.exports="pointerout"},18667:t=>{t.exports="pointerover"},27192:t=>{t.exports="pointerup"},24652:t=>{t.exports="pointerupoutside"},45132:t=>{t.exports="wheel"},44512:t=>{t.exports="preupdate"},15757:t=>{t.exports="shutdown"},41637:t=>{t.exports="start"},93802:t=>{t.exports="update"},8214:(t,e,i)=>{t.exports={BOOT:i(7179),DESTROY:i(85375),DRAG_END:i(39843),DRAG_ENTER:i(23388),DRAG:i(16133),DRAG_LEAVE:i(27829),DRAG_OVER:i(53904),DRAG_START:i(56058),DROP:i(2642),GAME_OUT:i(56718),GAME_OVER:i(25936),GAMEOBJECT_DOWN:i(88171),GAMEOBJECT_DRAG_END:i(36147),GAMEOBJECT_DRAG_ENTER:i(71692),GAMEOBJECT_DRAG:i(96149),GAMEOBJECT_DRAG_LEAVE:i(81285),GAMEOBJECT_DRAG_OVER:i(74048),GAMEOBJECT_DRAG_START:i(21322),GAMEOBJECT_DROP:i(49378),GAMEOBJECT_MOVE:i(86754),GAMEOBJECT_OUT:i(86433),GAMEOBJECT_OVER:i(60709),GAMEOBJECT_POINTER_DOWN:i(24081),GAMEOBJECT_POINTER_MOVE:i(11172),GAMEOBJECT_POINTER_OUT:i(18907),GAMEOBJECT_POINTER_OVER:i(95579),GAMEOBJECT_POINTER_UP:i(35368),GAMEOBJECT_POINTER_WHEEL:i(26972),GAMEOBJECT_UP:i(47078),GAMEOBJECT_WHEEL:i(73802),MANAGER_BOOT:i(27503),MANAGER_PROCESS:i(50852),MANAGER_UPDATE:i(96438),POINTER_DOWN:i(47777),POINTER_DOWN_OUTSIDE:i(27957),POINTER_MOVE:i(19444),POINTER_OUT:i(54251),POINTER_OVER:i(18667),POINTER_UP:i(27192),POINTER_UP_OUTSIDE:i(24652),POINTER_WHEEL:i(45132),POINTERLOCK_CHANGE:i(59152),PRE_UPDATE:i(44512),SHUTDOWN:i(15757),START:i(41637),UPDATE:i(93802)}},97421:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(83419),n=i(92734),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},99125:(t,e,i)=>{var s=i(97421),n=i(28884),r=i(83419),o=i(50792),a=i(26099),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(83419),n=i(50792),r=i(92734),o=i(99125),a=i(35154),h=i(89639),l=i(8214),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},65294:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},90089:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},64894:(t,e,i)=>{t.exports={DUALSHOCK_4:i(65294),SNES_USB:i(89651),XBOX_360:i(90089)}},46008:t=>{t.exports="down"},7629:t=>{t.exports="up"},42206:t=>{t.exports="connected"},86544:t=>{t.exports="disconnected"},94784:t=>{t.exports="down"},14325:t=>{t.exports="up"},92734:(t,e,i)=>{t.exports={BUTTON_DOWN:i(46008),BUTTON_UP:i(7629),CONNECTED:i(42206),DISCONNECTED:i(86544),GAMEPAD_BUTTON_DOWN:i(94784),GAMEPAD_BUTTON_UP:i(14325)}},48646:(t,e,i)=>{t.exports={Axis:i(97421),Button:i(28884),Events:i(92734),Gamepad:i(99125),GamepadPlugin:i(56654),Configs:i(64894)}},14350:(t,e,i)=>{var s=i(93301),n=i(79291),r={CreatePixelPerfectHandler:i(84409),CreateInteractiveObject:i(74457),Events:i(8214),Gamepad:i(48646),InputManager:i(7003),InputPlugin:i(48205),InputPluginCache:i(89639),Keyboard:i(51442),Mouse:i(87078),Pointer:i(42515),Touch:i(95618)};r=n(!1,r,s),t.exports=r},78970:(t,e,i)=>{var s=i(72905),n=i(83419),r=i(8443),o=i(8214),a=i(46032),h=i(29747),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},28846:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(95922),o=i(8443),a=i(35154),h=i(8214),l=i(89639),u=i(30472),c=i(46032),d=i(87960),f=i(74600),p=i(44594),g=i(56583),v=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},87960:(t,e,i)=>{var s=i(83419),n=i(95922),r=i(95540),o=i(68769),a=i(92803),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(66970);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},92803:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},92612:t=>{t.exports="keydown"},23345:t=>{t.exports="keyup"},21957:t=>{t.exports="keycombomatch"},44743:t=>{t.exports="down"},3771:t=>{t.exports="keydown-"},46358:t=>{t.exports="keyup-"},75674:t=>{t.exports="up"},95922:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(92612),ANY_KEY_UP:i(23345),COMBO_MATCH:i(21957),DOWN:i(44743),KEY_DOWN:i(3771),KEY_UP:i(46358),UP:i(75674)}},51442:(t,e,i)=>{t.exports={Events:i(95922),KeyboardManager:i(78970),KeyboardPlugin:i(28846),Key:i(30472),KeyCodes:i(46032),KeyCombo:i(87960),AdvanceKeyCombo:i(66970),ProcessKeyCombo:i(68769),ResetKeyCombo:i(92803),JustDown:i(90229),JustUp:i(38796),DownDuration:i(37015),UpDuration:i(41170)}},37015:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},38796:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},30472:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(95922),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},46032:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},74600:(t,e,i)=>{var s=i(46032),n={};for(var r in s)n[s[r]]=r;t.exports=n},41170:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(83419),n=i(89357),r=i(8214),o=i(29747),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},87078:(t,e,i)=>{t.exports={MouseManager:i(85098)}},36210:(t,e,i)=>{var s=i(83419),n=i(8214),r=i(29747),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,o={passive:!0},a={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?a:o),t.addEventListener("touchmove",this.onTouchMove,r?a:o),t.addEventListener("touchend",this.onTouchEnd,r?a:o),t.addEventListener("touchcancel",this.onTouchCancel,r?a:o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,a),window.top.addEventListener("touchend",this.onTouchEndWindow,a),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,a)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,a),window.addEventListener("touchend",this.onTouchEndWindow,a),window.addEventListener("touchcancel",this.onTouchCancelWindow,a),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},95618:(t,e,i)=>{t.exports={TouchManager:i(36210)}},41299:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(54899),o=i(95540),a=i(98356),h=i(3374),l=i(84376),u=i(92638),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile,this.base64="string"==typeof s&&0===s.indexOf("data:")},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")&&(this.base64=!0),this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onBase64Load:function(t){this.xhrLoader=t,this.state=n.FILE_LOADED,this.percentComplete=1,this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},74099:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},98356:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},74261:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(35072),o=i(50792),a=i(54899),h=i(74099),l=i(95540),u=i(35154),c=i(37277),d=i(44594),f=i(92638),p=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(d.BOOT,this.boot,this),t.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(79291),n=i(92638);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},26430:(t,e,i)=>{var s=i(83419),n=i(23906),r=i(54899),o=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i;var o=this.key;t.prefix&&""!==t.prefix&&(this.key=t.prefix+o),this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(3374);t.exports=function(t,e){var i=s(e,t.xhrSettings);if(!t.base64){var n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.ontimeout=t.onError.bind(t,n),n.send(),n}var o=t.url.split(";base64,").pop()||t.url.split(",").pop(),a={responseText:atob(o)};t.onBase64Load(a)}},92638:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},23906:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},42155:t=>{t.exports="addfile"},38991:t=>{t.exports="complete"},27540:t=>{t.exports="filecomplete"},87464:t=>{t.exports="filecomplete-"},94486:t=>{t.exports="loaderror"},13035:t=>{t.exports="load"},38144:t=>{t.exports="fileprogress"},97520:t=>{t.exports="postprocess"},85595:t=>{t.exports="progress"},55680:t=>{t.exports="start"},54899:(t,e,i)=>{t.exports={ADD:i(42155),COMPLETE:i(38991),FILE_COMPLETE:i(27540),FILE_KEY_COMPLETE:i(87464),FILE_LOAD_ERROR:i(94486),FILE_LOAD:i(13035),FILE_PROGRESS:i(38144),POST_PROCESS:i(97520),PROGRESS:i(85595),START:i(55680)}},14135:(t,e,i)=>{var s=i(83419),n=i(74099),r=i(518),o=i(54899),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(26430),l=i(57318),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","xml"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(89749),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):(console.warn('No audio URLs for "%s" matched this device',e),null)},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(21097),n=i(83419),r=i(74099),o=i(95540),a=i(41212),h=i(518),l=i(26430),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var f;if(n){var p=s.create(t,e,n,r,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(26430),l=i(21859),u=i(57318),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new u(t,{key:e,url:r(f,"fontDataURL"),extension:r(f,"fontDataExtension","xml"),xhrSettings:r(f,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(38734),n=i(85722),r=i(83419),o=i(74099),a=i(95540),h=i(19550),l=i(41212),u=i(518),c=i(31403),d=i(46975),f=i(59327),p=i(26430),g=i(82038),v=i(55222),m=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[a,h])}else p.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var f=0;f{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=i(73894),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e{var s=i(83419),n=i(54899),r=i(41299),o=i(95540),a=i(98356),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=i(98356),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,o);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(35154),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(518),l=i(26430),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var f=0;f{var s=i(83419),n=i(74099),r=i(95540),o=i(41212),a=i(26430),h=i(34328),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(83419),n=i(74099),r=i(95540),o=i(41212),a=i(26430),h=i(85048),l=i(61485),u=i(78776),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var f=e;e=r(f,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(f,"url"),extension:r(f,"extension","obj"),xhrSettings:r(f,"xhrSettings"),config:{flipUV:r(f,"flipUV",n)}}),(s=r(f,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(f,"matExtension","mat"),xhrSettings:r(f,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(23906),r=i(74099),o=i(518),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){if(this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var t={};t[this.config]=this.data,this.data=t}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||r.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,r.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="js";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"type","script"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(23906),r=i(74099),o=i(19550),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});r.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=i(80341),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(74099),r=i(518),o=i(80341),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(74099),r=i(518),o=i(80341),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(74099),r=i(95540),o=i(19550),a=i(41212),h=i(26430),l=i(78776),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","txt"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(98356),h=i(95540),l=i(41212),u=new s({Extends:r,initialize:function(t,e,i,s){if(void 0===s&&(s=!1),l(e)){var n=e;e=h(n,"key"),i=h(n,"url",[]),s=h(n,"noAudio",!1)}var o=t.systems.game.device.video.getVideoURL(i);o||console.warn("VideoFile: No supported format for "+e);var a={type:"video",cache:t.cacheManager.video,extension:o.type,key:e,url:o.url,config:{noAudio:s}};r.call(this,t,a)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=a(this,this.loader.baseURL),this.state=n.FILE_LOADED,this.loader.nextFile(this,!0)}});o.register("video",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(83419),n=i(23906),r=i(41299),o=i(74099),a=i(95540),h=i(41212),l=i(56836),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(14135),AsepriteFile:i(76272),AtlasJSONFile:i(38734),AtlasXMLFile:i(74599),AudioFile:i(21097),AudioSpriteFile:i(89524),BinaryFile:i(85722),BitmapFontFile:i(97025),CompressedTextureFile:i(69559),CSSFile:i(16024),GLSLFile:i(47931),HTML5AudioFile:i(89749),HTMLFile:i(88470),HTMLTextureFile:i(14643),ImageFile:i(19550),JSONFile:i(518),MultiAtlasFile:i(59327),MultiScriptFile:i(99297),OBJFile:i(41846),PackFile:i(58610),PluginFile:i(48988),SceneFile:i(88423),ScenePluginFile:i(56812),ScriptFile:i(34328),SpriteSheetFile:i(85035),SVGFile:i(67397),TextFile:i(78776),TilemapCSVFile:i(49477),TilemapImpactFile:i(40807),TilemapJSONFile:i(56775),UnityAtlasFile:i(25771),VideoFile:i(33720),XMLFile:i(57318)}},57777:(t,e,i)=>{var s=i(23906),n=i(79291),r={Events:i(54899),FileTypes:i(64589),File:i(41299),FileTypesManager:i(74099),GetURL:i(98356),LoaderPlugin:i(74261),MergeXHRSettings:i(3374),MultiFile:i(26430),XHRLoader:i(84376),XHRSettings:i(92638)};r=n(!1,r,s),t.exports=r},53307:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(6411);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},30976:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},87842:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},26302:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},45319:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},39506:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t*s.DEG_TO_RAD}},61241:t=>{t.exports=function(t,e){return Math.abs(t-e)}},38857:(t,e,i)=>{var s=i(45319),n=i(83419),r=i(37867),o=i(29747),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],f=n[10],p=0,g=0,v=0,m=.99999;switch(e){case"XYZ":g=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},99472:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},77623:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},62945:(t,e,i)=>{var s=i(45319);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},38265:t=>{t.exports=function(t,e){return t/e/1e3}},78702:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},94883:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},28915:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},94908:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},94434:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(o*i-s*r)*f,t[3]=c*f,t[4]=(l*e-s*a)*f,t[5]=(-o*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*o+p*l,e[2]=d*n+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*s+v*o+m*l,e[5]=g*n+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=s*a,p=n*r,g=n*o,v=n*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*v-d*g,_=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,R=f*y-p*m,L=x*R-T*P+w*M+b*C-E*_+S*A;return L?(L=1/L,i[0]=(h*R-l*P+u*M)*L,i[1]=(l*C-a*R-u*_)*L,i[2]=(a*P-h*C+u*A)*L,i[3]=(r*P-n*R-o*M)*L,i[4]=(s*R-r*C+o*_)*L,i[5]=(n*C-s*P-o*A)*L,i[6]=(v*S-m*E+y*b)*L,i[7]=(m*w-g*S-y*T)*L,i[8]=(g*E-v*w+y*x)*L,this):null}});t.exports=s},37867:(t,e,i)=>{var s=i(83419),n=i(25836),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p,g){var v=this.val;return v[0]=t,v[1]=e,v[2]=i,v[3]=s,v[4]=n,v[5]=r,v[6]=o,v[7]=a,v[8]=h,v[9]=l,v[10]=u,v[11]=c,v[12]=d,v[13]=f,v[14]=p,v[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*p-u*f,S=l*g-c*f,A=l*v-d*f,_=u*g-c*p,C=u*v-d*p,M=c*v-d*g,P=m*M-y*C+x*_+T*A-w*S+b*E;return P?(P=1/P,this.setValues((o*M-a*C+h*_)*P,(s*C-i*M-n*_)*P,(p*b-g*w+v*T)*P,(c*w-u*b-d*T)*P,(a*A-r*M-h*S)*P,(e*M-s*A+n*S)*P,(g*x-f*b-v*y)*P,(l*b-c*x+d*y)*P,(r*C-o*A+h*E)*P,(i*A-e*C-n*E)*P,(f*w-p*x+v*m)*P,(u*x-l*w-d*m)*P,(o*S-r*_-a*E)*P,(e*_-i*S+s*E)*P,(p*y-f*T-g*m)*P,(l*T-u*y+c*m)*P)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return this.setValues(o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),-(i*(c*v-d*g)-u*(s*v-n*g)+p*(s*d-n*c)),i*(a*v-h*g)-o*(s*v-n*g)+p*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),e*(c*v-d*g)-l*(s*v-n*g)+f*(s*d-n*c),-(e*(a*v-h*g)-r*(s*v-n*g)+f*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),-(e*(u*v-d*p)-l*(i*v-n*p)+f*(i*d-n*u)),e*(o*v-h*p)-r*(i*v-n*p)+f*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),e*(u*g-c*p)-l*(i*g-s*p)+f*(i*c-s*u),-(e*(o*g-a*p)-r*(i*g-s*p)+f*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-s*r)*(u*v-d*p)+(e*h-n*r)*(u*g-c*p)+(i*a-s*o)*(l*v-d*f)-(i*h-n*o)*(l*g-c*f)+(s*h-n*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*s+T*a+w*c+b*g,e[2]=x*n+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*s+T*a+w*c+b*g,e[6]=x*n+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*s+T*a+w*c+b*g,e[10]=x*n+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*s+T*a+w*c+b*g,e[14]=x*n+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],g=i[14],v=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],M=s[2],P=s[6],R=s[10],L=s[14],O=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*M+a*O,h*T+l*S+u*M+c*O,d*T+f*S+p*M+g*O,v*T+m*S+y*M+x*O,n*w+r*A+o*P+a*F,h*w+l*A+u*P+c*F,d*w+f*A+p*P+g*F,v*w+m*A+y*P+x*F,n*b+r*_+o*R+a*D,h*b+l*_+u*R+c*D,d*b+f*_+p*R+g*D,v*b+m*_+y*R+x*D,n*E+r*C+o*L+a*k,h*E+l*C+u*L+c*k,d*E+f*C+p*L+g*k,v*E+m*C+y*L+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},50040:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},37204:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},65201:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},15746:(t,e,i)=>{var s=i(83419),n=i(94434),r=i(29747),o=i(25836),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,f=new n,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>a){var p=Math.acos(c),g=Math.sin(p);d=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(d*i+f*o,d*s+f*h,d*n+f*l,d*r+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=p},43396:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t*s.RAD_TO_DEG}},74362:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},60706:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},67421:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},36305:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},11520:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},1163:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},70336:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},72678:(t,e,i)=>{var s=i(25836),n=i(37867),r=i(15746),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},2284:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},41013:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},16922:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},54261:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},44408:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},85955:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(n*f-i*p)*g,h.y=c*g*e+-d*g*t+(-n*c+i*d)*g,h}},26099:(t,e,i)=>{var s=i(83419),n=i(43855),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},25836:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],p=n[9],g=n[10],v=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*v+n[15]);return this.x=(e*r+i*l+s*f+m)*T,this.y=(e*o+i*u+s*p+y)*T,this.z=(e*a+i*c+s*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},61369:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},60417:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},15994:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},31040:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},55495:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},128:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},41273:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},1432:(t,e,i)=>{var s=i(36383);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},12407:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},53993:(t,e,i)=>{var s=i(99472);t.exports=function(){return s(-Math.PI,Math.PI)}},86564:(t,e,i)=>{var s=i(99472);t.exports=function(){return s(-180,180)}},90154:(t,e,i)=>{var s=i(12407);t.exports=function(t){return s(t+Math.PI)}},48736:(t,e,i)=>{var s=i(36383);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},86554:(t,e,i)=>{var s=i(15994);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},30954:(t,e,i)=>{var s=i(15994);t.exports=function(t){return s(t,-180,180)}},25588:(t,e,i)=>{t.exports={Between:i(31040),BetweenPoints:i(55495),BetweenPointsY:i(128),BetweenY:i(41273),CounterClockwise:i(1432),Normalize:i(12407),Random:i(53993),RandomDegrees:i(86564),Reverse:i(90154),RotateTo:i(48736),ShortestBetween:i(61430),Wrap:i(86554),WrapDegrees:i(30954)}},36383:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},20339:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},52816:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},64559:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},82340:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},14390:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},2243:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},89774:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},50994:(t,e,i)=>{t.exports={Between:i(20339),BetweenPoints:i(52816),BetweenPointsSquared:i(64559),Chebyshev:i(82340),Power:i(14390),Snake:i(2243),Squared:i(89774)}},62640:(t,e,i)=>{var s=i(54178),n=i(41521),r=i(79980),o=i(85433),a=i(99140),h=i(48857),l=i(81596),u=i(59133),c=i(98516),d=i(35248),f=i(82500),p=i(49752);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},1639:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},50099:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},41286:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},54178:(t,e,i)=>{t.exports={In:i(1639),Out:i(41286),InOut:i(50099)}},59590:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},41788:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},69905:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},41521:(t,e,i)=>{t.exports={In:i(59590),Out:i(69905),InOut:i(41788)}},91861:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},4177:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},57512:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},79980:(t,e,i)=>{t.exports={In:i(91861),Out:i(57512),InOut:i(4177)}},51150:t=>{t.exports=function(t){return t*t*t}},82820:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},35033:t=>{t.exports=function(t){return--t*t*t+1}},85433:(t,e,i)=>{t.exports={In:i(51150),Out:i(35033),InOut:i(82820)}},69965:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50665:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},7744:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},99140:(t,e,i)=>{t.exports={In:i(69965),Out:i(7744),InOut:i(50665)}},24590:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},87844:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},89433:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},48857:(t,e,i)=>{t.exports={In:i(24590),Out:i(89433),InOut:i(87844)}},48820:(t,e,i)=>{t.exports={Back:i(54178),Bounce:i(41521),Circular:i(79980),Cubic:i(85433),Elastic:i(99140),Expo:i(48857),Linear:i(81596),Quadratic:i(59133),Quartic:i(98516),Quintic:i(35248),Sine:i(82500),Stepped:i(49752)}},7147:t=>{t.exports=function(t){return t}},81596:(t,e,i)=>{t.exports=i(7147)},34826:t=>{t.exports=function(t){return t*t}},20544:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},92029:t=>{t.exports=function(t){return t*(2-t)}},59133:(t,e,i)=>{t.exports={In:i(34826),Out:i(92029),InOut:i(20544)}},64413:t=>{t.exports=function(t){return t*t*t*t}},78137:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},45840:t=>{t.exports=function(t){return 1- --t*t*t*t}},98516:(t,e,i)=>{t.exports={In:i(64413),Out:i(45840),InOut:i(78137)}},87745:t=>{t.exports=function(t){return t*t*t*t*t}},16509:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},17868:t=>{t.exports=function(t){return--t*t*t*t*t+1}},35248:(t,e,i)=>{t.exports={In:i(87745),Out:i(17868),InOut:i(16509)}},80461:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},34025:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},52768:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},82500:(t,e,i)=>{t.exports={In:i(80461),Out:i(52768),InOut:i(34025)}},72251:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},49752:(t,e,i)=>{t.exports=i(72251)},75698:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},43855:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},5470:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},94977:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(75698),Equal:i(43855),Floor:i(25777),GreaterThan:i(5470),LessThan:i(94977)}},75508:(t,e,i)=>{var s=i(36383),n=i(79291),r={Angle:i(25588),Distance:i(50994),Easing:i(48820),Fuzzy:i(48379),Interpolation:i(38289),Pow2:i(49001),Snap:i(73697),RandomDataGenerator:i(28453),Average:i(53307),Bernstein:i(85710),Between:i(30976),CatmullRom:i(87842),CeilTo:i(26302),Clamp:i(45319),DegToRad:i(39506),Difference:i(61241),Euler:i(38857),Factorial:i(6411),FloatBetween:i(99472),FloorTo:i(77623),FromPercent:i(62945),GetSpeed:i(38265),IsEven:i(78702),IsEvenStrict:i(94883),Linear:i(28915),LinearXY:i(94908),MaxAdd:i(86883),Median:i(50040),MinSub:i(37204),Percent:i(65201),RadToDeg:i(43396),RandomXY:i(74362),RandomXYZ:i(60706),RandomXYZW:i(67421),Rotate:i(36305),RotateAround:i(11520),RotateAroundDistance:i(1163),RotateTo:i(70336),RoundAwayFromZero:i(2284),RoundTo:i(41013),SinCosTableGenerator:i(16922),SmootherStep:i(54261),SmoothStep:i(7602),ToXY:i(44408),TransformXY:i(85955),Within:i(60417),Wrap:i(15994),Vector2:i(26099),Vector3:i(25836),Vector4:i(61369),Matrix3:i(94434),Matrix4:i(37867),Quaternion:i(15746),RotateVec3:i(72678)};r=n(!1,r,s),t.exports=r},89318:(t,e,i)=>{var s=i(85710);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},77259:(t,e,i)=>{var s=i(87842);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},28392:(t,e,i)=>{var s=i(28915);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},32112:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},47235:(t,e,i)=>{var s=i(7602);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},50178:(t,e,i)=>{var s=i(54261);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},38289:(t,e,i)=>{t.exports={Bezier:i(89318),CatmullRom:i(77259),CubicBezier:i(36316),Linear:i(28392),QuadraticBezier:i(32112),SmoothStep:i(47235),SmootherStep:i(50178)}},98439:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},81230:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},49001:(t,e,i)=>{t.exports={GetNext:i(98439),IsSize:i(50030),IsValue:i(81230)}},28453:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},63448:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},56583:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},77720:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},73697:(t,e,i)=>{t.exports={Ceil:i(63448),Floor:i(56583),To:i(77720)}},85454:(t,e,i)=>{i(63595);var s=i(8054),n=i(79291),r={Actions:i(61061),Animations:i(60421),BlendModes:i(10312),Cache:i(83388),Cameras:i(26638),Core:i(42857),Class:i(83419),Create:i(15822),Curves:i(25410),Data:i(44965),Display:i(27460),DOM:i(84902),Events:i(93055),FX:i(66064),Game:i(50127),GameObjects:i(77856),Geom:i(55738),Input:i(14350),Loader:i(57777),Math:i(75508),Physics:i(44563),Plugins:i(18922),Renderer:i(36909),Scale:i(93364),ScaleModes:i(29795),Scene:i(97482),Scenes:i(62194),Structs:i(41392),Textures:i(27458),Tilemaps:i(62501),Time:i(90291),Tweens:i(43066),Utils:i(91799)};r.Sound=i(23717),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},71289:(t,e,i)=>{var s=i(83419),n=i(92209),r=i(88571),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},86689:(t,e,i)=>{var s=i(83419),n=i(39506),r=i(20339),o=i(89774),a=i(66022),h=i(95540),l=i(46975),u=i(72441),c=i(47956),d=i(37277),f=i(44594),p=i(26099),g=i(82248),v=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",v,"arcadePhysics"),t.exports=v},13759:(t,e,i)=>{var s=i(83419),n=i(92209),r=i(68287),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},37742:(t,e,i)=>{var s=i(83419),n=i(78389),r=i(37747),o=i(63012),a=i(43396),h=i(87841),l=i(37303),u=i(95829),c=i(26099),d=new s({Mixins:[n],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new c,this.position=new c(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new c(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new c,this.newVelocity=new c,this.deltaMax=new c,this.acceleration=new c,this.allowDrag=!0,this.drag=new c,this.allowGravity=!0,this.gravity=new c,this.bounce=new c,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new c(1e4,1e4),this.maxSpeed=-1,this.friction=new c(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new c(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===r&&this._sy===o||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*o,this._sx=r,this._sy=o,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var n=this.autoFrame;s.set((i.x-n.x)/t,(i.y-n.y)/t),this.world.updateMotion(this,t),this._dx=i.x-n.x,this._dy=i.y-n.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var r=s.x,a=s.y;if(this.updateCenter(),this.angle=Math.atan2(a,r),this.speed=Math.sqrt(r*r+a*a),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(o.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var n=this.deltaMax.x,o=this.deltaMax.y;0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),0!==o&&0!==i&&(i<0&&i<-o?i=-o:i>0&&i>o&&(i=o)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=r.FACING_LEFT:e>0&&(this.facing=r.FACING_RIGHT),i<0?this.facing=r.FACING_UP:i>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,n=this.world.checkCollision,r=this.worldBounce?-this.worldBounce.x:-this.bounce.x,o=this.worldBounce?-this.worldBounce.y:-this.bounce.y,a=!1;return t.xs.right&&n.right&&(t.x=s.right-this.width,e.x*=r,i.right=!0,a=!0),t.ys.bottom&&n.down&&(t.y=s.bottom-this.height,e.y*=o,i.down=!0,a=!0),a&&(this.blocked.none=!1,this.updateCenter()),a},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){return void 0===e&&(e=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=t,t.body&&(t.body=this),this.setSize(),this.world.add(this),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new c),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var n=this.blocked;i&&(n.left=!0,n.none=!1),s&&(n.right=!0,n.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var n=this.blocked;i&&(n.up=!0,n.none=!1),s&&(n.down=!0,n.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=d},79342:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},66022:(t,e,i)=>{var s=i(71289),n=i(13759),r=i(37742),o=i(83419),a=i(37747),h=i(60758),l=i(72624),u=i(71464),c=new o({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},79599:t=>{t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(37747);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},45170:(t,e,i)=>{var s=i(37747);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},60758:(t,e,i)=>{var s=i(13759),n=i(83419),r=i(78389),o=i(37747),a=i(95540),h=i(26479),l=i(41212),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){if(i||n)if(l(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var r=this;i.forEach((function(t){t.internalCreateCallback=r.createCallbackHandler,t.internalRemoveCallback=r.removeCallbackHandler,t.classType=a(t,"classType",s)})),n=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n&&(n.classType=a(n,"classType",s)),this.physicsType=o.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:a(n,"collideWorldBounds",!1),setBoundsRectangle:a(n,"customBoundsRectangle",null),setAccelerationX:a(n,"accelerationX",0),setAccelerationY:a(n,"accelerationY",0),setAllowDrag:a(n,"allowDrag",!0),setAllowGravity:a(n,"allowGravity",!0),setAllowRotation:a(n,"allowRotation",!0),setDamping:a(n,"useDamping",!1),setBounceX:a(n,"bounceX",0),setBounceY:a(n,"bounceY",0),setDragX:a(n,"dragX",0),setDragY:a(n,"dragY",0),setEnable:a(n,"enable",!0),setGravityX:a(n,"gravityX",0),setGravityY:a(n,"gravityY",0),setFrictionX:a(n,"frictionX",0),setFrictionY:a(n,"frictionY",0),setMaxSpeed:a(n,"maxSpeed",-1),setMaxVelocityX:a(n,"maxVelocityX",1e4),setMaxVelocityY:a(n,"maxVelocityY",1e4),setVelocityX:a(n,"velocityX",0),setVelocityY:a(n,"velocityY",0),setAngularVelocity:a(n,"angularVelocity",0),setAngularAcceleration:a(n,"angularAcceleration",0),setAngularDrag:a(n,"angularDrag",0),setMass:a(n,"mass",1),setImmovable:a(n,"immovable",!1)},h.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,o.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y=function(){return u&&g&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&v&&i.blocked.left?(e.processX(m,a,!0),1):f&&v&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&g&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var g=.5*m;0===t?p?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.x,!0),i.processX(-g,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,null,!1,!0),i.processX(g,e.velocity.x,!0)):2===t?p?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,i.velocity.x,!1,!0),i.processX(g,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.y,!0),i.processX(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&v?x(0):d&&g?x(1):u&&g?x(2):!(!f||!v)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,v=!g,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:g?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:v?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},47962:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y=function(){return u&&g&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&v&&i.blocked.up?(e.processY(m,a,!0),1):f&&v&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&g&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var g=.5*m;0===t?p?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&v?x(0):d&&g?x(1):u&&g?x(2):!(!f||!v)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,v=!g,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:g?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:v?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},14087:(t,e,i)=>{var s=i(64897),n=i(3017);t.exports=function(t,e,i,r,o){void 0===o&&(o=s(t,e,i,r));var a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},89936:(t,e,i)=>{var s=i(45170),n=i(47962);t.exports=function(t,e,i,r,o){void 0===o&&(o=s(t,e,i,r));var a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},95829:t=>{t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},72624:(t,e,i)=>{var s=i(87902),n=i(83419),r=i(78389),o=i(37747),a=i(37303),h=i(95829),l=i(26099),u=new n({Mixins:[r],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):a(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},71464:(t,e,i)=>{var s=i(13759),n=i(83419),r=i(78389),o=i(37747),a=i(95540),h=i(26479),l=i(41212),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){i||n?l(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=a(n,"classType",s)):Array.isArray(i)&&l(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=a(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,o.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(55495),n=i(37742),r=i(45319),o=i(83419),a=i(79342),h=i(37747),l=i(20339),u=i(52816),c=i(50792),d=i(63012),f=i(43855),p=i(5470),g=i(94977),v=i(64897),m=i(45170),y=i(96523),x=i(35154),T=i(36383),w=i(25774),b=i(96602),E=i(87841),S=i(59542),A=i(40012),_=i(14087),C=i(89936),M=i(35072),P=i(72624),R=i(2483),L=i(61340),O=i(26099),F=i(15994),D=new o({Extends:c,initialize:function(t,e){c.call(this),this.scene=t,this.bodies=new M,this.staticBodies=new M,this.pendingDestroy=new M,this.colliders=new w,this.gravity=new O(x(e,"gravity.x",0),x(e,"gravity.y",0)),this.bounds=new E(x(e,"x",0),x(e,"y",0),x(e,"width",t.sys.scale.width),x(e,"height",t.sys.scale.height)),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)},this.fps=x(e,"fps",60),this.fixedStep=x(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(e,"timeScale",1),this.OVERLAP_BIAS=x(e,"overlapBias",4),this.TILE_BIAS=x(e,"tileBias",16),this.forceX=x(e,"forceX",!1),this.isPaused=x(e,"isPaused",!1),this._total=0,this.drawDebug=x(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(e,"debugShowBody",!0),debugShowStaticBody:x(e,"debugShowStaticBody",!0),debugShowVelocity:x(e,"debugShowVelocity",!0),bodyDebugColor:x(e,"debugBodyColor",16711935),staticBodyDebugColor:x(e,"debugStaticBodyColor",255),velocityDebugColor:x(e,"debugVelocityColor",65280)},this.maxEntries=x(e,"maxEntries",16),this.useTree=x(e,"useTree",!0),this.tree=new S(this.maxEntries),this.staticTree=new S(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new L,this._tempMatrix2=new L,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&t.velocity.length()>d&&(t.velocity.normalize().scale(d),c=d),t.speed=c},separate:function(t,e,i,s,n){var r,o,a=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return a;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return a;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,n);l.result?(a=!0,h=!1):(r=l.x,o=l.y,h=!0)}if(h){var u=!1,c=!1,f=this.OVERLAP_BIAS;n?(u=_(t,e,n,f,r),c=C(t,e,n,f,o)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)S&&(p=l(y,x,S,E)-w):x>A&&(yS&&(p=l(y,x,S,A)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(o,a);t.overlapR=p,e.overlapR=p;var _=s(o,a),C=(p+T.EPSILON)*Math.cos(_),M=(p+T.EPSILON)*Math.sin(_),P={overlap:p,result:!1,x:C,y:M};if(i&&(!g||g&&0!==p))return P.result=!0,P;if(!g&&0===p||h&&c||t.customSeparateX||e.customSeparateX)return P.x=void 0,P.y=void 0,P;var R=!t.pushable&&!e.pushable;if(g){var L=o.x-a.x,O=o.y-a.y,F=Math.sqrt(Math.pow(L,2)+Math.pow(O,2)),D=(a.x-o.x)/F||0,k=(a.y-o.y)/F||0,I=2*(d.x*D+d.y*k-f.x*D-f.y*k)/(t.mass+e.mass);(h||c)&&(I*=2),h||(d.x=d.x-I/t.mass*D,d.y=d.y-I/t.mass*k,d.multiply(t.bounce)),c||(f.x=f.x+I/e.mass*D,f.y=f.y+I/e.mass*k,f.multiply(e.bounce)),h||c||(C*=.5,M*=.5),h||(t.x-=C,t.y-=M,t.updateCenter()),c||(e.x+=C,e.y+=M,e.updateCenter()),P.result=!0}else!h||t.pushable||R?(t.x-=C,t.y-=M,t.updateCenter()):(!c||e.pushable||R)&&(e.x+=C,e.y+=M,e.updateCenter()),P.x=void 0,P.y=void 0;return P},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},canCollide:function(t,e){return t&&e&&0!=(t.collisionMask&e.collisionCategory)&&0!=(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,n,r){var o=t.isBody?t:t.body,a=e.isBody?e:e.body;return!!this.canCollide(o,a)&&(this.separate(o,a,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.isBody?t:t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;o{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},59023:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62069:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},78389:(t,e,i)=>{var s=i(79599),n={setCollisionCategory:function(t){return(this.body?this.body:this).collisionCategory=t,this},willCollideWith:function(t){return 0!=((this.body?this.body:this).collisionMask&t)},addCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask|t,this},removeCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask&~t,this},setCollidesWith:function(t){return(this.body?this.body:this).collisionMask=s(t),this},resetCollisionCategory:function(){var t=this.body?this.body:this;return t.collisionCategory=1,t.collisionMask=1,this}};t.exports=n},87118:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},52819:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},4074:t=>{t.exports={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}}},40831:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},26775:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},9437:t=>{t.exports={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}}},30621:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},72441:(t,e,i)=>{var s=i(47956),n=i(96503),r=i(2044),o=i(81491);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,f=[],p=0;p{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},62121:t=>{t.exports={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}}},29384:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},15098:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},92209:(t,e,i)=>{t.exports={Acceleration:i(1093),Angular:i(59023),Bounce:i(62069),Collision:i(78389),Debug:i(87118),Drag:i(52819),Enable:i(4074),Friction:i(40831),Gravity:i(26775),Immovable:i(9437),Mass:i(30621),OverlapCirc:i(72441),OverlapRect:i(47956),Pushable:i(62121),Size:i(29384),Velocity:i(15098)}},37747:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},20009:t=>{t.exports="collide"},36768:t=>{t.exports="overlap"},60473:t=>{t.exports="pause"},89954:t=>{t.exports="resume"},61804:t=>{t.exports="tilecollide"},7161:t=>{t.exports="tileoverlap"},34689:t=>{t.exports="worldbounds"},16006:t=>{t.exports="worldstep"},63012:(t,e,i)=>{t.exports={COLLIDE:i(20009),OVERLAP:i(36768),PAUSE:i(60473),RESUME:i(89954),TILE_COLLIDE:i(61804),TILE_OVERLAP:i(7161),WORLD_BOUNDS:i(34689),WORLD_STEP:i(16006)}},27064:(t,e,i)=>{var s=i(37747),n=i(79291),r={ArcadePhysics:i(86689),Body:i(37742),Collider:i(79342),Components:i(92209),Events:i(63012),Factory:i(66022),GetCollidesWith:i(79599),GetOverlapX:i(64897),GetOverlapY:i(45170),SeparateX:i(14087),SeparateY:i(89936),Group:i(60758),Image:i(71289),Sprite:i(13759),StaticBody:i(72624),StaticGroup:i(71464),Tilemap:i(55173),World:i(82248)};r=n(!1,r,s),t.exports=r},96602:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},36294:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},67013:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},40012:(t,e,i)=>{var s=i(21329),n=i(53442),r=i(2483);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(36294);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},53442:(t,e,i)=>{var s=i(67013);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},2483:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},55173:(t,e,i)=>{var s={ProcessTileCallbacks:i(96602),ProcessTileSeparationX:i(36294),ProcessTileSeparationY:i(67013),SeparateTile:i(40012),TileCheckX:i(21329),TileCheckY:i(53442),TileIntersectsBody:i(2483)};t.exports=s},44563:(t,e,i)=>{t.exports={Arcade:i(27064),Matter:i(3875)}},68174:(t,e,i)=>{var s=i(83419),n=i(26099),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},19933:(t,e,i)=>{var s=i(6790);s.Body=i(22562),s.Composite=i(69351),s.World=i(4372),s.Collision=i(52284),s.Detector=i(81388),s.Pairs=i(99561),s.Pair=i(4506),s.Query=i(73296),s.Resolver=i(66272),s.Constraint=i(48140),s.Common=i(53402),s.Engine=i(48413),s.Events=i(35810),s.Sleeping=i(53614),s.Plugin=i(73832),s.Bodies=i(66280),s.Composites=i(74116),s.Axes=i(66615),s.Bounds=i(15647),s.Svg=i(74058),s.Vector=i(31725),s.Vertices=i(41598),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},28137:(t,e,i)=>{var s=i(66280),n=i(83419),r=i(74116),o=i(48140),a=i(74058),h=i(75803),l=i(23181),u=i(34803),c=i(73834),d=i(19496),f=i(85791),p=i(98713),g=i(41598),v=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=g.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(31884),n=i(95540),r=i(26099);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},23181:(t,e,i)=>{var s=i(83419),n=i(31884),r=i(95643),o=i(95540),a=i(88571),h=i(72699),l=i(26099),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=u},42045:(t,e,i)=>{var s=i(60461),n=i(66615),r=i(66280),o=i(22562),a=i(68174),h=i(15647),l=i(83419),u=i(52284),c=i(53402),d=i(69351),f=i(74116),p=i(48140),g=i(81388),v=i(20339),m=i(28137),y=i(95540),x=i(35154),T=i(18210),w=i(40178),b=i(6790),E=i(74507),S=i(46975),A=i(4506),_=i(99561),C=i(73832),M=i(37277),P=i(73296),R=i(66272),L=i(44594),O=i(74058),F=i(31725),D=i(41598),k=i(68243);c.setDecomp(i(55973));var I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=d,this.collision=u,this.detector=g,this.pair=A,this.pairs=_,this.query=P,this.resolver=R,this.constraint=p,this.bodies=r,this.composites=f,this.axes=n,this.bounds=h,this.svg=O,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),x(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),x(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),x(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),R._restingThresh=x(this.config,"restingThresh",4),R._restingThreshTangent=x(this.config,"restingThreshTangent",6),R._positionDampen=x(this.config,"positionDampen",.9),R._positionWarming=x(this.config,"positionWarming",.8),R._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(L.BOOT,this.boot,this),t.sys.events.on(L.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(L.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(L.UPDATE,this.world.update,this.world),t.on(L.POST_UPDATE,this.world.postUpdate,this.world),t.once(L.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return S(y(e,"matter",{}),y(t,"matter",{}))},enableAttractorPlugin:function(){return C.register(T),C.use(b,T),this},enableWrapPlugin:function(){return C.register(E),C.use(b,E),this},enableCollisionEventsPlugin:function(){return C.register(w),C.use(b,w),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return P.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return P.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return P.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=P.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(9674),n=i(83419),r=i(31884),o=i(95643),a=i(95540),h=i(72699),l=i(68287),u=i(26099),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=c},73834:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(83419),o=i(31884),a=i(62644),h=i(50792),l=i(95540),u=i(97022),c=i(41598),d=new r({Extends:h,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){h.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=l(i,"body",null),r=l(i,"addToWorld",!0);if(s)this.setBody(s,r);else{var o=e.getCollisionGroup();l(o,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}if(e.flipX||e.flipY){var a={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,c=e.flipY?-1:1;n.scale(s,u,c,a)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),h=this.tile.getCollisionGroup(),d=l(h,"objects",[]),f=[],p=0;p1){var S=a(t);S.parts=f,this.setBody(n.create(S),S.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=d},19496:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(53402),o=i(95540),a=i(41598),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(66280),n=i(22562),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(15647),n=i(83419),r=i(69351),o=i(48140),a=i(81388),h=i(1121),l=i(8214),u=i(46975),c=i(53614),d=i(26099),f=i(41598),p=new n({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(66280),n=i(22562),r=i(83419),o=i(53402),a=i(69351),h=i(48413),l=i(50792),u=i(1121),c=i(95540),d=i(35154),f=i(22562),p=i(35810),g=i(73834),v=i(4372),m=i(31725),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var f=d(e,"debug",!1);if(this.drawDebug="object"==typeof f||f,this.debugGraphic,this.debugConfig={showAxes:c(f,"showAxes",!1),showAngleIndicator:c(f,"showAngleIndicator",!1),angleColor:c(f,"angleColor",15208787),showBroadphase:c(f,"showBroadphase",!1),broadphaseColor:c(f,"broadphaseColor",16757760),showBounds:c(f,"showBounds",!1),boundsColor:c(f,"boundsColor",16777215),showVelocity:c(f,"showVelocity",!1),velocityColor:c(f,"velocityColor",44783),showCollisions:c(f,"showCollisions",!1),collisionColor:c(f,"collisionColor",16094476),showSeparations:c(f,"showSeparations",!1),separationColor:c(f,"separationColor",16753920),showBody:c(f,"showBody",!0),showStaticBody:c(f,"showStaticBody",!0),showInternalEdges:c(f,"showInternalEdges",!1),renderFill:c(f,"renderFill",!1),renderLine:c(f,"renderLine",!0),fillColor:c(f,"fillColor",1075465),fillOpacity:c(f,"fillOpacity",1),lineColor:c(f,"lineColor",2678297),lineOpacity:c(f,"lineOpacity",1),lineThickness:c(f,"lineThickness",1),staticFillColor:c(f,"staticFillColor",857979),staticLineColor:c(f,"staticLineColor",1255396),showSleeping:c(f,"showSleeping",!1),staticBodySleepOpacity:c(f,"staticBodySleepOpacity",.7),sleepFillColor:c(f,"sleepFillColor",4605510),sleepLineColor:c(f,"sleepLineColor",10066585),showSensors:c(f,"showSensors",!0),sensorFillColor:c(f,"sensorFillColor",857979),sensorLineColor:c(f,"sensorLineColor",1255396),showPositions:c(f,"showPositions",!0),positionSize:c(f,"positionSize",4),positionColor:c(f,"positionColor",14697178),showJoint:c(f,"showJoint",!0),jointColor:c(f,"jointColor",14737474),jointLineOpacity:c(f,"jointLineOpacity",1),jointLineThickness:c(f,"jointLineThickness",2),pinSize:c(f,"pinSize",4),pinColor:c(f,"pinColor",4382944),springColor:c(f,"springColor",14697184),anchorColor:c(f,"anchorColor",15724527),anchorSize:c(f,"anchorSize",4),showConvexHulls:c(f,"showConvexHulls",!1),hullColor:c(f,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var p=e.setBounds;if("boolean"==typeof p)this.setBounds();else{var g=c(p,"x",0),v=c(p,"y",0),m=c(p,"width",t.sys.scale.width),y=c(p,"height",t.sys.scale.height),x=c(p,"thickness",64),T=c(p,"left",!0),w=c(p,"right",!0),b=c(p,"top",!0),E=c(p,"bottom",!0);this.setBounds(g,v,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),p.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),p.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e,s.delta=e),s.timeScalePrev=n.timeScale,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e)}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,f=d>1?1:0;f1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),v.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},70410:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},66968:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(22562),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},5436:t=>{t.exports={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}}},39858:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},37302:(t,e,i)=>{var s=i(22562),n=i(26099),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},39132:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},57772:(t,e,i)=>{var s=i(66280),n=i(22562),r=i(43855),o=i(95540),a=i(19496),h=i(85791),l=i(41598),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(1121),n=i(53614),r=i(35810),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},90556:(t,e,i)=>{var s=i(22562),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},85436:(t,e,i)=>{var s=i(22562),n=i(36383),r=i(86554),o=i(30954),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},42081:(t,e,i)=>{var s=i(22562),n={setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return s.getVelocity(this.body)},setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},getAngularVelocity:function(){return s.getAngularVelocity(this.body)},setAngularSpeed:function(t){return s.setAngularSpeed(this.body,t),this},getAngularSpeed:function(){return s.getAngularSpeed(this.body)}};t.exports=n},31884:(t,e,i)=>{t.exports={Bounce:i(70410),Collision:i(66968),Force:i(51607),Friction:i(5436),Gravity:i(39858),Mass:i(37302),Sensor:i(39132),SetBody:i(57772),Sleep:i(38083),Static:i(90556),Transform:i(85436),Velocity:i(42081)}},85608:t=>{t.exports="afteradd"},1213:t=>{t.exports="afterremove"},25968:t=>{t.exports="afterupdate"},67205:t=>{t.exports="beforeadd"},39438:t=>{t.exports="beforeremove"},44823:t=>{t.exports="beforeupdate"},92593:t=>{t.exports="collisionactive"},60128:t=>{t.exports="collisionend"},76861:t=>{t.exports="collisionstart"},92362:t=>{t.exports="dragend"},76408:t=>{t.exports="drag"},93971:t=>{t.exports="dragstart"},5656:t=>{t.exports="pause"},47861:t=>{t.exports="resume"},79099:t=>{t.exports="sleepend"},35906:t=>{t.exports="sleepstart"},1121:(t,e,i)=>{t.exports={AFTER_ADD:i(85608),AFTER_REMOVE:i(1213),AFTER_UPDATE:i(25968),BEFORE_ADD:i(67205),BEFORE_REMOVE:i(39438),BEFORE_UPDATE:i(44823),COLLISION_ACTIVE:i(92593),COLLISION_END:i(60128),COLLISION_START:i(76861),DRAG_END:i(92362),DRAG:i(76408),DRAG_START:i(93971),PAUSE:i(5656),RESUME:i(47861),SLEEP_END:i(79099),SLEEP_START:i(35906)}},3875:(t,e,i)=>{t.exports={BodyBounds:i(68174),Components:i(31884),Events:i(1121),Factory:i(28137),MatterGameObject:i(75803),Image:i(23181),Matter:i(19933),MatterPhysics:i(42045),PolyDecomp:i(55973),Sprite:i(34803),TileBody:i(73834),PhysicsEditorParser:i(19496),PhysicsJSONParser:i(85791),PointerConstraint:i(98713),World:i(68243)}},22562:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(31725),o=i(53614),a=i(53402),h=i(15647),l=i(66615);!function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,deltaTime:1e3/60,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){if(e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var i=t.bounds,o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"speed":s.setSpeed(t,i);break;case"angularSpeed":s.setAngularSpeed(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(a.position,s,t.position,a.position)}},s.setVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=r.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return r.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,r.mult(r.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,a.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,i){s.setPosition(t,r.add(t.position,e),i)},s.rotate=function(t,e,i,n){if(i){var r=Math.cos(e),o=Math.sin(e),a=t.position.x-i.x,h=t.position.y-i.y;s.setPosition(t,{x:i.x+(a*r-h*o),y:i.y+(a*o+h*r)},n),s.setAngle(t,t.angle+e,n)}else s.setAngle(t,t.angle+e,n)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=t.inertia===1/0,c=0;c0&&(o+=d.area,a+=d.inertia),d.position.x=r.x+(d.position.x-r.x)*e,d.position.y=r.y+(d.position.y-r.y)*i,h.update(d.bounds,d.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null),u&&s.setInertia(t,1/0)},s.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,o=s._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/a._baseDelta),c=(t.position.x-t.positionPrev.x)*o,d=(t.position.y-t.positionPrev.y)*o;t.velocity.x=c*u+t.force.x/t.mass*i,t.velocity.y=d*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*o+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,i){var s=e.x-t.position.x,n=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(35810),r=i(53402),o=i(15647),a=i(22562);s.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},s.setModified=function(t,e,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(69351);s.create=n.create,s.add=n.add,s.remove=n.remove,s.clear=n.clear,s.addComposite=n.addComposite,s.addBody=n.addBody,s.addConstraint=n.addConstraint},52284:(t,e,i)=>{var s={};t.exports=s;var n,r,o,a=i(41598),h=i(4506);n=[],r={overlap:0,axis:null},o={overlap:0,axis:null},s.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},s.collides=function(t,e,i){if(s._overlapAxes(r,t.vertices,e.vertices,t.axes),r.overlap<=0)return null;if(s._overlapAxes(o,e.vertices,t.vertices,e.axes),o.overlap<=0)return null;var n,l,u=i&&i.table[h.id(t,e)];u?n=u.collision:((n=s.create(t,e)).collided=!0,n.bodyA=t.idS?S=a:aA?A=a:an?n=o:o{var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},81388:(t,e,i)=>{var s={};t.exports=s;var n=i(53402),r=i(52284);s.create=function(t){return n.extend({bodies:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[]},s.collisions=function(t){var e,i,n=[],o=t.pairs,a=t.bodies,h=a.length,l=s.canCollide,u=r.collides;for(a.sort(s._compareBoundsX),e=0;ef)break;if(!(pC.max.y)&&(!v||!x.isStatic&&!x.isSleeping)&&l(c.collisionFilter,x.collisionFilter)){var T=x.parts.length;if(y&&1===T)(A=u(c,x,o))&&n.push(A);else for(var w=T>1?1:0,b=m>1?1:0;bC.max.x||d.max.xC.max.y||(A=u(E,_,o))&&n.push(A)}}}}return n},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},4506:(t,e,i)=>{var s={};t.exports=s;var n=i(43424);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,r={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(r,t,e),r},s.update=function(t,e,i){var s=t.contacts,r=e.supports,o=t.activeContacts,a=e.parentA,h=e.parentB,l=a.vertices.length;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+h.inverseMass,t.friction=a.frictionh.frictionStatic?a.frictionStatic:h.frictionStatic,t.restitution=a.restitution>h.restitution?a.restitution:h.restitution,t.slop=a.slop>h.slop?a.slop:h.slop,e.pair=t,o.length=0;for(var u=0;u{var s={};t.exports=s;var n=i(4506),r=i(53402);s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=h.length,u=t.table,c=e.length,d=t.collisionStart,f=t.collisionEnd,p=t.collisionActive;for(d.length=0,f.length=0,p.length=0,a=0;a{var s={};t.exports=s;var n=i(31725),r=i(52284),o=i(15647),a=i(66280),h=i(41598);s.collides=function(t,e){for(var i=[],s=e.length,n=t.bounds,a=r.collides,h=o.overlaps,l=0;l{var s={};t.exports=s;var n=i(41598),r=i(53402),o=i(15647);s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(t){var e,i,s,n=t.length;for(e=0;eV?(n=Y>0?Y:-Y,(i=g.friction*(Y>0?1:-1)*l)<-n?i=-n:i>n&&(i=n)):(i=Y,n=f);var W=O*b-F*w,H=D*b-k*w,j=C/(M+m.inverseInertia*W*W+y.inverseInertia*H*H),K=(1+g.restitution)*X*j;if(i*=j,X0&&(R.normalImpulse=0),K=R.normalImpulse-q}if(Y<-c||Y>c)R.tangentImpulse=0;else{var Z=R.tangentImpulse;R.tangentImpulse+=i,R.tangentImpulse<-n&&(R.tangentImpulse=-n),R.tangentImpulse>n&&(R.tangentImpulse=n),i=R.tangentImpulse-Z}var J=w*K+E*i,Q=b*K+S*i;m.isStatic||m.isSleeping||(m.positionPrev.x+=J*m.inverseMass,m.positionPrev.y+=Q*m.inverseMass,m.anglePrev+=(O*Q-F*J)*m.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=J*y.inverseMass,y.positionPrev.y-=Q*y.inverseMass,y.anglePrev-=(D*Q-k*J)*y.inverseInertia)}}}}},48140:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(31725),o=i(53614),a=i(15647),h=i(66615),l=i(53402);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=r.mult(u,m*y),w=(i?i.inverseMass:0)+(n?n.inverseMass:0),b=w+((i?i.inverseInertia:0)+(n?n.inverseInertia:0));if(x>0){var E=r.create();p=r.div(u,c),v=r.sub(n&&r.sub(n.position,n.positionPrev)||E,i&&r.sub(i.position,i.positionPrev)||E),g=r.dot(p,v)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),d=r.cross(o,T)/b*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),n&&!n.isStatic&&(f=n.inverseMass/w,n.constraintImpulse.x+=T.x*f,n.constraintImpulse.y+=T.y*f,n.position.x+=T.x*f,n.position.y+=T.y*f,x>0&&(n.positionPrev.x+=x*p.x*g*f,n.positionPrev.y+=x*p.y*g*f),d=r.cross(a,T)/b*s._torqueDampen*n.inverseInertia*(1-t.angularStiffness),n.constraintImpulse.angle+=d,n.angle+=d)}}},s.postSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),n=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+n*n)}},53402:(t,e,i)=>{var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var r=i;r0;e--){var i=Math.floor(s.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain((function(){s.warnOnce("🔅 deprecated 🔅",i)}),t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(53614),r=i(66272),o=i(81388),a=i(99561),h=i(35810),l=i(69351),u=i(48140),c=i(53402),d=i(22562);s.create=function(t){t=t||{};var e=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||a.create(),e.detector=t.detector||o.create(),e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e){var i,d=c.now(),f=t.world,p=t.detector,g=t.pairs,v=t.timing,m=v.timestamp;e=void 0!==e?e:c._baseDelta,e*=v.timeScale,v.timestamp+=e,v.lastDelta=e;var y={timestamp:v.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f);for(f.isModified&&(o.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&n.update(x,e),s._bodiesApplyGravity(x,t.gravity),e>0&&s._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:v.timestamp,delta:e});var b=c.clamp(20/t.positionIterations,0,1);for(r.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:v.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:v.timestamp,delta:e}),s._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=c.now()-d,t},s.merge=function(t,e){if(c.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),r=0;r{var s={};t.exports=s;var n=i(53402);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(73832),r=i(53402);s.name="matter-js",s.version="0.19.0",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},73832:(t,e,i)=>{var s={};t.exports=s;var n=i(53402);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||n.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),r=Number(i[5]),o=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:r,patch:o,parts:[s,r,o],prerelease:i[7],number:1e8*s+1e4*r+o}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),n=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return n.number>i.number;if(">="===i.operator)return n.number>=i.number;if("~"===i.operator)return n.major===i.major&&n.minor===i.minor&&n.patch>=i.patch;if("^"===i.operator)return i.major>0?n.major===i.major&&n.number>=i.number:i.minor>0?n.minor===i.minor&&n.patch>=i.patch:n.patch===i.patch}return t===e||"*"===t}},53614:(t,e,i)=>{var s={};t.exports=s;var n=i(22562),r=i(35810),o=i(53402);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e/o._baseDelta,r=s._motionSleepThreshold,a=0;a0&&h.motion=h.sleepThreshold/i&&s.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else s.set(h,!1)}},s.afterCollisions=function(t){for(var e=s._motionSleepThreshold,i=0;ie&&s.set(h,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||r.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&r.trigger(t,"sleepEnd"))}},66280:(t,e,i)=>{var s={};t.exports=s;var n=i(41598),r=i(53402),o=i(22562),a=i(15647),h=i(31725);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=n.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(_)1?(p=o.create(r.extend({parts:g.slice(0)},s)),o.setPosition(p,{x:t,y:e}),p):g[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(69351),r=i(48140),o=i(53402),a=i(22562),h=i(66280);s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(31725),r=i(53402);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},74058:(t,e,i)=>{var s={};t.exports=s,i(15647);var n=i(53402);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,f,p,g=[],v=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(f=d.x,p=d.y):(f=0,p=0);var n={x:f+t,y:p+e};!s&&d||(d=n),g.push(n),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},41598:(t,e,i)=>{var s={};t.exports=s;var n=i(31725),r=i(53402);s.create=function(t,e){for(var i=[],s=0;s0)return!1;o=i}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},18210:(t,e,i)=>{var s=i(19933),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},74507:(t,e,i)=>{var s=i(19933),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var v=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,M=[],P=[],R=e,L=e;if(L.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var O=0;OA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(R,O-1),d(R,O),d(R,F))&&a(d(R,O+1),d(R,O),d(R,F))&&(E=c(d(R,O),d(R,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(83419))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},42363:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},37277:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},77332:(t,e,i)=>{var s=i(83419),n=i(8443),r=i(50792),o=i(74099),a=i(44603),h=i(39429),l=i(95540),u=i(37277),c=i(72905),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(52018),n=i(83419),r=i(44594),o=new n({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)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},18922:(t,e,i)=>{t.exports={BasePlugin:i(52018),DefaultPlugins:i(42363),PluginCache:i(37277),PluginManager:i(77332),ScenePlugin:i(45145)}},63595:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),i=this.getVideoPlaybackQuality(),s=this.mozPresentedFrames||this.mozPaintedFrames||i.totalVideoFrames-i.droppedVideoFrames,n=(r,o)=>{const a=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||a.totalVideoFrames-a.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||a.totalFrameDelay-i.totalFrameDelay||0,n=o-r;t(o,{presentationTime:o+1e3*s,expectedDisplayTime:o+n,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+n/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(o,t)))};return this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(e,t))),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},10312:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},68627:(t,e,i)=>{var s=i(19715),n=i(32880),r=i(83419),o=i(8054),a=i(50792),h=i(92503),l=i(56373),u=i(97480),c=i(69442),d=i(61340),f=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(f||(m+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*v),w=-1);var b=t.x,E=t.y;a.applyITRS(b,E,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=b,a.f=E):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0&&(i.roundPixels?r.drawImage(e.source.image,l,u,c,d,Math.round(m),Math.round(y),Math.round(c/p),Math.round(d/p)):r.drawImage(e.source.image,l,u,c,d,m,y,c/p,d/p)),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=f},55830:(t,e,i)=>{t.exports={CanvasRenderer:i(68627),GetBlendModes:i(56373),SetTransform:i(20926)}},56373:(t,e,i)=>{var s=i(10312),n=i(89289);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},20926:(t,e,i)=>{var s=i(91296);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},63899:t=>{t.exports="losewebgl"},6119:t=>{t.exports="postrender"},48070:t=>{t.exports="prerender"},15640:t=>{t.exports="render"},8912:t=>{t.exports="resize"},87124:t=>{t.exports="restorewebgl"},92503:(t,e,i)=>{t.exports={LOSE_WEBGL:i(63899),POST_RENDER:i(6119),PRE_RENDER:i(48070),RENDER:i(15640),RESIZE:i(8912),RESTORE_WEBGL:i(87124)}},36909:(t,e,i)=>{t.exports={Events:i(92503),Snapshot:i(89966)},t.exports.Canvas=i(55830),t.exports.WebGL=i(4159)},32880:(t,e,i)=>{var s=i(27919),n=i(40987),r=i(95540);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=s.createWebGL(this,u,c),p=f.getContext("2d",{willReadFrequently:!0});u>0&&c>0&&p.drawImage(t,h,l,u,c,0,0,u,c);var g=new Image;g.onerror=function(){i.call(null),s.remove(f)},g.onload=function(){i.call(null,g),s.remove(f)},g.src=f.toDataURL(o,a)}else{var v=new Image;v.onerror=function(){i.call(null)},v.onload=function(){i.call(null,v)},v.src=t.toDataURL(o,a)}}},88815:(t,e,i)=>{var s=i(27919),n=i(40987),r=i(95540);t.exports=function(t,e){var i=t,o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),f=d?r(e,"bufferWidth",1):i.drawingBufferWidth,p=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var g=new Uint8Array(4),v=d?u:p-u;i.readPixels(l,v,1,1,i.RGBA,i.UNSIGNED_BYTE,g),o.call(null,new n(g[0],g[1],g[2],g[3]))}else{var m=Math.floor(r(e,"width",f)),y=Math.floor(r(e,"height",p)),x=m*y*4,T=new Uint8Array(x);i.readPixels(l,p-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,T);for(var w=s.createWebGL(this,m,y),b=w.getContext("2d",{willReadFrequently:!0}),E=b.getImageData(0,0,m,y),S=E.data,A=0;A{t.exports={Canvas:i(32880),WebGL:i(88815)}},7530:(t,e,i)=>{var s=i(83419),n=i(36060),r=i(90330),o=i(82264),a=i(95540),h=i(32302),l=i(63448),u=i(31302),c=i(58918),d=i(14811),f=i(92651),p=i(96569),g=i(56527),v=i(57516),m=i(43439),y=i(81041),x=i(12385),T=i(7589),w=i(95428),b=i(72905),E=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,T],[n.MULTI_PIPELINE,v],[n.BITMAPMASK_PIPELINE,u],[n.SINGLE_PIPELINE,x],[n.ROPE_PIPELINE,y],[n.LIGHT_PIPELINE,p],[n.POINTLIGHT_PIPELINE,m],[n.MOBILE_PIPELINE,g]]),this.postPipelineClasses=new r,this.pipelines=new r,this.postPipelineInstances=[],this.default=null,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.MOBILE_PIPELINE=null,this.FX_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t,e,i){var s=this.renderer,r=this.renderTargets;this.frameInc=Math.floor(a(t,"frameInc",32));var l,u,p=s.width,g=s.height,v=this.game.config.disablePreFX;if(this.game.config.disablePostFX||this.postPipelineClasses.setAll([[String(d.BARREL),c.Barrel],[String(d.BLOOM),c.Bloom],[String(d.BLUR),c.Blur],[String(d.BOKEH),c.Bokeh],[String(d.CIRCLE),c.Circle],[String(d.COLOR_MATRIX),c.ColorMatrix],[String(d.DISPLACEMENT),c.Displacement],[String(d.GLOW),c.Glow],[String(d.GRADIENT),c.Gradient],[String(d.PIXELATE),c.Pixelate],[String(d.SHADOW),c.Shadow],[String(d.SHINE),c.Shine],[String(d.VIGNETTE),c.Vignette],[String(d.WIPE),c.Wipe]]),!v){this.classes.set(n.FX_PIPELINE,f);for(var m=Math.min(p,g),y=Math.ceil(m/this.frameInc),x=1;x=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(l(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.default=null,this.current=null,this.previous=null}});t.exports=E},32302:(t,e,i)=>{var s=i(83419),n=i(92503),r=new s({initialize:function(t,e,i,s,n,r,o,a,h){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!0),void 0===h&&(h=!0),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!0,this.hasDepthBuffer=a,this.forceClamp=h,this.resize(e,i),o?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){if((t=Math.round(t*this.scale))<=0&&(t=1),(e=Math.round(e*this.scale))<=0&&(e=1),this.autoResize&&(t!==this.width||e!==this.height)){var i=this.renderer;i.deleteFramebuffer(this.framebuffer),i.deleteTexture(this.texture),this.texture=i.createTextureFromSource(null,t,e,this.minFilter,this.forceClamp),this.framebuffer=i.createFramebuffer(t,e,this.texture,this.hasDepthBuffer),this.width=t,this.height=e}return this},willResize:function(t,e){return(t=Math.round(t*this.scale))<=0&&(t=1),(e=Math.round(e*this.scale))<=0&&(e=1),t!==this.width||e!==this.height},bind:function(t,e,i){void 0===t&&(t=!1);var s=this.renderer;if(t&&s.flush(),e&&i&&this.resize(e,i),s.pushFramebuffer(this.framebuffer,!1,!1),t&&this.adjustViewport(),this.autoClear){var n=this.renderer.gl;n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)}s.clearStencilMask()},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.off(n.RESIZE,this.resize,this),t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},70554:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="",s=0;s0&&(i+="\n\telse "),s{var s=i(83419),n=i(62644),r=i(50792),o=i(77085),a=i(95540),h=i(37867),l=i(92503),u=i(32302),c=i(70554),d=i(38683),f=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isPreFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=a(t,"resizeUniform","")},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tT&&(T=x[t].vertexSize);var w=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*w;var b=new ArrayBuffer(this.vertexCapacity*T);this.vertexData=b,this.bytes=new Uint8Array(b),this.vertexViewF32=new Float32Array(b),this.vertexViewU32=new Uint32Array(b);var E=a(i,"vertices",null);for(E?(this.vertexViewF32.set(E),this.vertexBuffer=s.createVertexBuffer(b,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(b.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=x.length-1;t>=0;t--)x[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;return t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t),this},getShaderByName:function(t){for(var e=this.shaders,i=0;i-1&&(m=b.substring(20))}y&&x&&v.push(new d(this,m,y,x,n(T)))}this.shaders=v}return 0===this.shaders.length?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(t){return this.currentBatch={start:this.vertexCount,count:0,texture:[t],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=t,this.batch.push(this.currentBatch),0},addTextureToBatch:function(t){var e=this.currentBatch;e&&(e.texture.push(t),e.unit++,e.maxUnit++)},pushBatch:function(t){if(!this.currentBatch||this.forceZero&&t!==this.currentTexture)return this.createBatch(t);if(t===this.currentTexture)return this.currentUnit;var e=this.currentBatch,i=e.texture.indexOf(t);return-1===i?e.texture.length===this.renderer.maxTextures?this.createBatch(t):(e.unit++,e.maxUnit++,e.texture.push(t),this.currentUnit=e.unit,this.currentTexture=t,e.unit):(this.currentUnit=i,this.currentTexture=t,i)},setGameObject:function(t,e){return void 0===e&&(e=t.frame),this.pushBatch(e.source.glTexture)},shouldFlush:function(t){return void 0===t&&(t=0),this.vertexCount+t>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.activeTextures.length=0,this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var t=this.shaders,e=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,e&&this.setVertexBuffer();for(var i=0;i0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize,n=this.topology;if(this.active){var r,a,h;this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s));var l=this.batch,u=this.activeTextures;if(this.forceZero)for(u[0]||e.activeTexture(e.TEXTURE0),r=0;r{var s=i(95428),n=i(72905),r=i(19715),o=i(83419),a=i(8054),h=i(50792),l=i(92503),u=i(50030),c=i(37867),d=i(29747),f=i(7530),p=i(32302),g=i(97480),v=i(69442),m=i(70554),y=i(88815),x=i(26128),T=i(1482),w=i(82751),b=i(84387),E=i(93567),S=i(57183),A=new o({Extends:h,initialize:function(t){h.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!0,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=a.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.maxTextures=0,this.textureIndexes,this.glBufferWrappers=[],this.glProgramWrappers=[],this.glTextureWrappers=[],this.glFramebufferWrappers=[],this.glAttribLocationWrappers=[],this.glUniformLocationWrappers=[],this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.normalTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.maskSource=null,this.maskTarget=null,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,r=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var o=this,h=function(){var t=e.getSupportedExtensions();o.supportedExtensions=t;var i="ANGLE_instanced_arrays";o.instancedArraysExtension=t.indexOf(i)>-1?e.getExtension(i):null;var s="OES_vertex_array_object";o.vaoExtension=t.indexOf(s)>-1?e.getExtension(s):null};h(),this.contextLostHandler=function(t){o.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),o.emit(l.LOSE_WEBGL,o),t.preventDefault()},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(t){if(e.isContextLost())console&&console.log("WebGL Context restored, but context is still lost");else{o.currentProgram=null,o.currentFramebuffer=null,o.setBlendMode(a.BlendModes.NORMAL),e.disable(e.BLEND),e.disable(e.DEPTH_TEST),e.enable(e.CULL_FACE);var i=function(t){t.createResource()};s(o.glTextureWrappers,i),s(o.glBufferWrappers,i),s(o.glFramebufferWrappers,i),s(o.glProgramWrappers,i),s(o.glAttribLocationWrappers,i),s(o.glUniformLocationWrappers,i),o.createTemporaryTextures(),o.pipelines.restoreContext(),o.resize(o.game.scale.baseSize.width,o.game.scale.baseSize.height),h(),o.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),o.emit(l.RESTORE_WEBGL,o),t.preventDefault()}},n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var u=0;u<=27;u++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});return this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats=[e.BYTE,e.SHORT,e.UNSIGNED_BYTE,e.UNSIGNED_SHORT,e.FLOAT],this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}},t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(r.redGL,r.greenGL,r.blueGL,r.alphaGL),-1!==["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"].indexOf(t.mipmapFilter)&&(this.mipmapFilter=e[t.mipmapFilter]),this.maxTextures=m.checkShaderMax(e,t.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(a.BlendModes.NORMAL),this.projectionMatrix=(new c).identity(),i.textures.once(v.READY,this.boot,this),this},boot:function(){var t=this.game,e=this.pipelines,i=t.scale.baseSize,s=i.width,n=i.height;this.width=s,this.height=n,this.isBooted=!0,this.renderTarget=new p(this,s,n,1,0,!0,!0),this.maskTarget=new p(this,s,n,1,0,!0,!0),this.maskSource=new p(this,s,n,1,0,!0,!0);var r=t.config;e.boot(r.pipeline,r.defaultPipeline,r.autoMobilePipeline),this.blankTexture=t.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=t.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=t.textures.getFrame("__WHITE").glTexture;var o=this.gl;o.bindFramebuffer(o.FRAMEBUFFER,null),o.enable(o.SCISSOR_TEST),t.scale.on(g.RESIZE,this.onResize,this),this.resize(s,n)},createTemporaryTextures:function(){for(var t=this.gl,e=0;e0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==a.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},pushFramebuffer:function(t,e,i,s,n){return t===this.currentFramebuffer?this:(this.fboStack.push(t),this.setFramebuffer(t,e,i,s,n))},setFramebuffer:function(t,e,i,s,n){if(void 0===e&&(e=!1),void 0===i&&(i=!0),void 0===s&&(s=null),void 0===n&&(n=!1),t===this.currentFramebuffer)return this;var r=this.gl,o=this.width,a=this.height;return t&&t.renderTexture&&i?(o=t.renderTexture.width,a=t.renderTexture.height):this.flush(),t?r.bindFramebuffer(r.FRAMEBUFFER,t.webGLFramebuffer):r.bindFramebuffer(r.FRAMEBUFFER,null),i&&r.viewport(0,0,o,a),s&&r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s.webGLTexture,0),n&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT)),e&&(t?(this.drawingBufferHeight=a,this.pushScissor(0,0,o,a)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t,this},popFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack;i.pop();var s=i[i.length-1];return s||(s=null),this.setFramebuffer(s,t,e),s},restoreFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack,s=i[i.length-1];s||(s=null),this.currentFramebuffer=null,this.setFramebuffer(s,t,e)},setProgram:function(t){return t!==this.currentProgram&&(this.flush(),this.gl.useProgram(t.webGLProgram),this.currentProgram=t,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(t,e,i,s,n){void 0===n&&(n=!1);var r=this.gl,o=r.NEAREST,h=r.NEAREST,l=r.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=u(e,i);if(c&&!n&&(l=r.REPEAT),s===a.ScaleModes.LINEAR&&this.config.antialias){var d=t&&t.compressed,f=!d&&c||d&&t.mipmaps.length>1;o=this.mipmapFilter&&f?this.mipmapFilter:r.LINEAR,h=r.LINEAR}return t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,o,h,l,l,r.RGBA,t):this.createTexture2D(0,o,h,l,l,r.RGBA,null,e,i)},createTexture2D:function(t,e,i,s,n,r,o,a,h,l,u,c){"number"!=typeof a&&(a=o?o.width:1),"number"!=typeof h&&(h=o?o.height:1);var d=new w(this.gl,t,e,i,s,n,r,o,a,h,l,u,c);return this.glTextureWrappers.push(d),d},createFramebuffer:function(t,e,i,s){this.currentFramebuffer=null;var n=new b(this.gl,t,e,i,s);return this.glFramebufferWrappers.push(n),n},beginBitmapMask:function(t,e){this.gl&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==t&&(this.currentMask.mask=t,this.currentMask.camera=e))},drawBitmapMask:function(t,e,i){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),t.renderWebGL(this,t,e),this.maskSource.unbind(!0),this.maskTarget.unbind();var s=this.gl,n=this.getCurrentStencilMask();n?(s.enable(s.STENCIL_TEST),n.mask.applyStencil(this,n.camera,!0)):this.currentMask.mask=null,this.pipelines.set(i),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this.maskTarget.texture.webGLTexture),s.activeTexture(s.TEXTURE1),s.bindTexture(s.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(t,e){var i=new T(this.gl,t,e);return this.glProgramWrappers.push(i),i},createVertexBuffer:function(t,e){var i=this.gl,s=new x(i,t,i.ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},createAttribLocation:function(t,e){var i=new E(this.gl,t,e);return this.glAttribLocationWrappers.push(i),i},createUniformLocation:function(t,e){var i=new S(this.gl,t,e);return this.glUniformLocationWrappers.push(i),i},createIndexBuffer:function(t,e){var i=this.gl,s=new x(i,t,i.ELEMENT_ARRAY_BUFFER,e);return this.glBufferWrappers.push(s),s},deleteTexture:function(t){if(t)return n(this.glTextureWrappers,t),t.destroy(),this},deleteFramebuffer:function(t){return t?(n(this.fboStack,t),n(this.glFramebufferWrappers,t),t.destroy(),this):this},deleteProgram:function(t){return t&&(n(this.glProgramWrappers,t),t.destroy()),this},deleteAttribLocation:function(t){return t&&(n(this.glAttribLocationWrappers,t),t.destroy()),this},deleteUniformLocation:function(t){return t&&(n(this.glUniformLocationWrappers,t),t.destroy()),this},deleteBuffer:function(t){return t?(n(this.glBufferWrappers,t),t.destroy(),this):this},preRenderCamera:function(t){var e=t.x,i=t.y,s=t.width,n=t.height,o=t.backgroundColor;t.emit(r.PRE_RENDER,t),this.pipelines.preBatchCamera(t),this.pushScissor(e,i,s,n),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),o.alphaGL>0&&this.pipelines.setMulti().drawFillRect(e,i,s,n,m.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,m.getTintFromFloats),i.postRenderWebGL(s,m.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(r.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(l.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(l.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(a.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r{var s=i(83419),n=i(95428),r=i(95540),o=i(14500),a=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var n=0;n=0?(e.enableVertexAttribArray(p.webGLAttribLocation),e.vertexAttribPointer(p.webGLAttribLocation,h,l,f,s,u),a.enabled=!0,a.location=p):-1!==p.webGLAttribLocation&&e.disableVertexAttribArray(p.webGLAttribLocation)}else c?e.vertexAttribPointer(d.webGLAttribLocation,h,l,f,s,u):!c&&-1!==d&&d.webGLAttribLocation>-1&&(e.disableVertexAttribArray(d.webGLAttribLocation),a.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n.webGLProgram,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=this.renderer.createUniformLocation(n,e))&&(r[e]={name:e,location:i,setter:null,value1:null,value2:null,value3:null,value4:null}))}}return this},syncUniforms:function(){var t=this.gl;for(var e in this.renderer.setProgram(this.program),this.uniforms){var i=this.uniforms[e];i.setter&&i.setter.call(t,i.location.webGLUniformLocation,i.value1,i.value2,i.value3,i.value4)}},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.setter||(n.setter=t),n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location.webGLUniformLocation,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.setter||(r.setter=t),r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location.webGLUniformLocation,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.setter||(o.setter=t),o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location.webGLUniformLocation,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.setter||(a.setter=t),a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location.webGLUniformLocation,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){return void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){var t=this.renderer;n(this.uniforms,(function(e){t.deleteUniformLocation(e.location)})),this.uniforms=null,n(this.attributes,(function(e){t.deleteAttribLocation(e.location)})),this.attributes=null,t.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});t.exports=a},14500:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},4159:(t,e,i)=>{var s=i(14500),n=i(79291),r={PipelineManager:i(7530),Pipelines:i(96615),RenderTarget:i(32302),Utils:i(70554),WebGLPipeline:i(29100),WebGLRenderer:i(74797),WebGLShader:i(38683),Wrappers:i(9503)};r=n(!1,r,s),t.exports=r},31302:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(78908),o=i(85191),a=i(14500),h=i(29100),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){this.renderer.beginBitmapMask(t,i)},endMask:function(t,e,i){var s=this.gl,n=this.renderer,r=t.bitmapMask;r&&s&&(n.drawBitmapMask(r,e,this),i&&this.set2f("uResolution",i.width,i.height),this.set1i("uInvertMaskAlpha",t.invertAlpha),s.drawArrays(this.topology,0,3),i&&this.set2f("uResolution",this.width,this.height),s.bindTexture(s.TEXTURE_2D,null))}});t.exports=l},92651:(t,e,i)=>{var s=i(83419),n=i(58918),r=i(14811),o=i(95540),a=i(43558),h=i(89350),l=i(70554),u=new s({Extends:a,initialize:function(t){t.shaders=[l.setGlowQuality(h.FXGlowFrag,t.game),h.FXShadowFrag,h.FXPixelateFrag,h.FXVignetteFrag,h.FXShineFrag,h.FXBlurLowFrag,h.FXBlurMedFrag,h.FXBlurHighFrag,h.FXGradientFrag,h.FXBloomFrag,h.ColorMatrixFrag,h.FXCircleFrag,h.FXBarrelFrag,h.FXDisplacementFrag,h.FXWipeFrag,h.FXBokehFrag],a.call(this,t);var e=this.game;this.glow=new n.Glow(e),this.shadow=new n.Shadow(e),this.pixelate=new n.Pixelate(e),this.vignette=new n.Vignette(e),this.shine=new n.Shine(e),this.gradient=new n.Gradient(e),this.circle=new n.Circle(e),this.barrel=new n.Barrel(e),this.wipe=new n.Wipe(e),this.bokeh=new n.Bokeh(e);var i=[];i[r.GLOW]=this.onGlow,i[r.SHADOW]=this.onShadow,i[r.PIXELATE]=this.onPixelate,i[r.VIGNETTE]=this.onVignette,i[r.SHINE]=this.onShine,i[r.BLUR]=this.onBlur,i[r.GRADIENT]=this.onGradient,i[r.BLOOM]=this.onBloom,i[r.COLOR_MATRIX]=this.onColorMatrix,i[r.CIRCLE]=this.onCircle,i[r.BARREL]=this.onBarrel,i[r.DISPLACEMENT]=this.onDisplacement,i[r.WIPE]=this.onWipe,i[r.BOKEH]=this.onBokeh,this.fxHandlers=i,this.source,this.target,this.swap},onDraw:function(t,e,i){this.source=t,this.target=e,this.swap=i;var s=t.width,n=t.height,r=this.tempSprite,o=this.fxHandlers;if(r&&r.preFX)for(var a=r.preFX.list,h=0;h{var s=i(83419),n=i(95540),r=i(31063),o=i(57516),a=i(61340),h=i(26099),l=i(29100),u=new s({Extends:o,initialize:function(t){var e=n(t,"fragShader",r);t.fragShader=e.replace("%LIGHT_COUNT%",t.game.renderer.config.maxLights),o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new h,this._tempMatrix=new a,this._tempMatrix2=new a},boot:function(){l.prototype.boot.call(this)},onRender:function(t,e){var i=t.sys.lights;if(this.lightsActive=!1,i&&i.active){var s,n=i.getLights(e),r=n.length;this.lightsActive=!0;var o=this.renderer.height,a=e.matrix,h=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",e.x,e.y,e.rotation,e.zoom),this.set3f("uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),this.set1i("uLightCount",r),s=0;s0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.whiteTexture);var s=this.getNormalMap(e);this.isNewNormalMap(t,s)&&(this.flush(),this.createBatch(t),this.addTextureToBatch(s),this.currentNormalMap=s);var n=0;return e&&e.parentContainer?n=e.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2).rotationNormalized:e&&(n=e.rotation),this.setNormalMapRotation(n),0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=e.glTexture,s=this.getNormalMap(t);if(this.isNewNormalMap(i,s)&&(this.flush(),this.createBatch(i),this.addTextureToBatch(s),this.currentNormalMap=s),t.parentContainer){var n=t.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(n.rotationNormalized)}else this.setNormalMapRotation(t.rotation);return 0},isNewNormalMap:function(t,e){return this.currentTexture!==t||this.currentNormalMap!==e},getNormalMap:function(t){var e;return t?(t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]),e?e.glTexture:this.renderer.normalMap):this.renderer.normalMap},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,P,R,L,O){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,P,R,L,O)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});t.exports=u},56527:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),o=i(45561),a=i(60722),h=i(14500),l=i(29100),u=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),t.forceZero=!0,t.resizeUniform="uResolution",r.call(this,t)},boot:function(){l.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)}});t.exports=u},57516:(t,e,i)=>{var s=i(83419),n=i(94811),r=i(95540),o=i(98840),a=i(44667),h=i(61340),l=i(70554),u=i(14500),c=i(29100),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),t.resizeUniform="uResolution",c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this);var t=this.renderer;this.set1iv("uMainSampler",t.textureIndexes),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,g=b.width,v=b.height,T=-y+(f=b.x),w=-x+(p=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&o.source.isRenderTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1);var A=t.x,_=t.y;n.applyITRS(A,_,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=A,n.f=_):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var C=r.setQuad(T,w,T+g,w+v),M=l.getTintAppendFloatAlpha,P=e.alpha,R=M(t.tintTopLeft,P*t._alphaTL),L=M(t.tintTopRight,P*t._alphaTR),O=M(t.tintBottomLeft,P*t._alphaBL),F=M(t.tintBottomRight,P*t._alphaBR);this.shouldFlush(6)&&this.flush();var D=this.setGameObject(t,o);this.manager.preBatch(t),this.currentShader.set1i("uRoundPixels",e.roundPixels),this.batchQuad(t,C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],h,u,c,d,R,L,O,F,t.tintFill,a,D),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,P,R,L,O){void 0===O&&(O=!1),this.manager.set(this,t);var F=this._tempMatrix1,D=this._tempMatrix2,k=this._tempMatrix3,I=m/i+_,B=y/s+C,N=(m+x)/i+_,U=(y+T)/s+C,X=o,Y=a,z=-g,G=-v;if(t.isCropped){var V=t._crop,W=V.width,H=V.height;X=W,Y=H,o=W,a=H;var j=m=V.x,K=y=V.y;c&&(j=x-V.x-W),d&&(K=T-V.y-H),I=j/i+_,B=K/s+C,N=(j+W)/i+_,U=(K+H)/s+C,z=-g+m,G=-v+y}c&&(X*=-1,z+=o),(d^=!R&&e.isRenderTexture?1:0)&&(Y*=-1,G+=a),D.applyITRS(n,r,u,h,l),F.copyFrom(M.matrix),P?(F.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),D.e=n,D.f=r):(D.e-=M.scrollX*f,D.f-=M.scrollY*p),F.multiply(D,k);var q=k.setQuad(z,G,z+X,G+Y);null==L&&(L=this.setTexture2D(e)),t&&!O&&this.manager.preBatch(t),this.currentShader.set1i("uRoundPixels",M.roundPixels),this.batchQuad(t,q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],I,B,N,U,w,b,E,S,A,e,L),t&&!O&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2;o?a.multiply(o,h):h=a;var u=h.setQuad(e,i,e+t.width,i+t.height),c=this.setTexture2D(t.source.glTexture);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,c)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=o.setQuad(t,e,t+i,e+s),h=this.fillTint;this.batchQuad(null,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],0,0,1,1,h.TL,h.TR,h.BL,h.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(n,r),p=h.getY(n,r),g=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,l,u,c,d,f,p,0,0,1,1,g.TL,g.TR,g.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&X[4]?this.batchQuad(null,F,D,P,R,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,U,2):(Y[0]=F,Y[1]=D,Y[2]=P,Y[3]=R,Y[4]=1),h&&Y[4]?this.batchQuad(null,C,M,L,O,Y[0],Y[1],Y[2],Y[3],0,0,1,1,I,B,N,U,2):(X[0]=C,X[1]=M,X[2]=L,X[3]=O,X[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,c.prototype.destroy.call(this),this}});t.exports=d},43439:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(4127),o=i(89924),a=i(29100),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,f=t.intensity,p=t.radius,g=t.attenuation,v=d.r*f,m=d.g*f,y=d.b*f,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(i,s,u,c,p,g,v,m,y,x),this.batchLightVert(n,r,u,c,p,g,v,m,y,x),this.batchLightVert(o,a,u,c,p,g,v,m,y,x),this.batchLightVert(i,s,u,c,p,g,v,m,y,x),this.batchLightVert(o,a,u,c,p,g,v,m,y,x),this.batchLightVert(h,l,u,c,p,g,v,m,y,x),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},84057:(t,e,i)=>{var s=i(83419),n=i(89422),r=i(95540),o=i(27681),a=i(49627),h=i(29100),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2;var e=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",e.width,e.height),this.set1i("uRoundPixels",e.config.roundPixels);for(var i=this.renderTargets,s=0;s{var s=i(10312),n=i(67502),r=i(83419),o=i(96293),a=i(95540),h=i(57516),l=i(27681),u=i(87841),c=i(32302),d=i(45561),f=i(60722),p=i(29100),g=new r({Extends:h,initialize:function(t){var e=a(t,"fragShader",l),i=a(t,"vertShader",f),s=a(t,"drawShader",l),n=[{name:"DrawSprite",fragShader:d,vertShader:f},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:f},{name:"ColorMatrix",fragShader:o}],r=a(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,h.call(this,t),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new u,this.targetBounds=new u,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){p.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.colorMatrixShader=t[3],this.fsTarget=new c(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader,this.set2f("uResolution",e.width,e.height),this.set1i("uRoundPixels",e.config.roundPixels)},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t?t.preFX.padding:0,_=b+2*A,C=E+2*A,M=Math.abs(Math.max(_,C)),P=this.manager.getRenderTarget(M),R=this.targetBounds.setTo(0,0,P.width,P.height);n(R,S.centerX,S.centerY),this.tempSprite=t;var L=this.gl,O=this.renderer;O.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",O.width,O.height),this.set1i("uRoundPixels",O.config.roundPixels),this.flipProjectionMatrix(!0),t&&(this.onDrawSprite(t,P),t.preFX.onFX(this));var F=this.fsTarget;return this.flush(),L.viewport(0,0,O.width,O.height),L.bindFramebuffer(L.FRAMEBUFFER,F.framebuffer.webGLFramebuffer),L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,F.texture.webGLTexture,0),L.clearColor(0,0,0,0),L.clear(L.COLOR_BUFFER_BIT),this.setTexture2D(x),this.batchVert(e,i,u,c,0,y,p),this.batchVert(s,r,u,f,0,y,v),this.batchVert(o,a,d,f,0,y,m),this.batchVert(e,i,u,c,0,y,p),this.batchVert(o,a,d,f,0,y,m),this.batchVert(h,l,d,c,0,y,g),this.flush(),this.flipProjectionMatrix(!1),L.activeTexture(L.TEXTURE0),L.bindTexture(L.TEXTURE_2D,P.texture.webGLTexture),L.copyTexSubImage2D(L.TEXTURE_2D,0,0,0,R.x,R.y,R.width,R.height),L.bindFramebuffer(L.FRAMEBUFFER,null),L.bindTexture(L.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(P,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o,a){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===a&&(a=this.copyShader);var h=this.gl,l=this.tempSprite;o&&(a=this.colorMatrixShader),this.currentShader=a;var u=this.setVertexBuffer(this.quadVertexBuffer);a.bind(u,!1);var c=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",c.width,c.height),this.set1i("uRoundPixels",c.config.roundPixels),l.preFX.onFXCopy(this),this.onCopySprite(t,e,l),o&&(this.set1fv("uColorMatrix",o.getData()),this.set1f("uAlpha",o.alpha)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture.webGLTexture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var d=e.height-t.height;h.viewport(0,d,t.width,t.height),this.resetUVs()}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture.webGLTexture,0),i&&(h.clearColor(0,0,0,Number(!n)),h.clear(h.COLOR_BUFFER_BIT)),r){var f=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}h.bufferData(h.ARRAY_BUFFER,this.quadVertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),r&&this.renderer.setBlendMode(f),h.bindFramebuffer(h.FRAMEBUFFER,null)},copy:function(t,e){var i=this.gl;this.set1i("uMainSampler",0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture.webGLTexture),i.viewport(0,0,t.width,t.height),this.setUVs(0,0,0,1,1,1,1,0),i.bindFramebuffer(i.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.texture.webGLTexture,0),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.bufferData(i.ARRAY_BUFFER,this.quadVertexData,i.STATIC_DRAW),i.drawArrays(i.TRIANGLES,0,6),i.bindFramebuffer(i.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),f=s.getY(n,a),p=s.getY(o,a),g=s.getY(o,r),v=16777215;this.batchVert(h,d,0,0,0,0,v),this.batchVert(l,f,0,1,0,0,v),this.batchVert(u,p,1,1,0,0,v),this.batchVert(h,d,0,0,0,0,v),this.batchVert(u,p,1,1,0,0,v),this.batchVert(c,g,1,0,0,0,v),i.restoreFramebuffer(!1,!0),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),i.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){return this.renderer.deleteBuffer(this.quadVertexBuffer),this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.colorMatrixShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,h.prototype.destroy.call(this),this}});t.exports=g},81041:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},12385:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(57516),o=i(45561),a=i(60722),h=i(29100),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)}});t.exports=l},7589:(t,e,i)=>{var s=i(35407),n=i(10312),r=i(83419),o=i(89422),a=i(96293),h=i(36682),l=i(95540),u=i(48247),c=i(49627),d=i(29100),f=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture.webGLTexture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture.webGLTexture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o,a){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture.webGLTexture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture.webGLTexture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),o){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),o&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer.webGLFramebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture.webGLTexture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture.webGLTexture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture.webGLTexture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6)},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture.webGLTexture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer.webGLFramebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture.webGLTexture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture.webGLTexture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture.webGLTexture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer.webGLFramebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture.webGLTexture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer.webGLFramebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s.webGLFramebuffer)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=f},36060:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"}},84817:t=>{t.exports="pipelineafterflush"},36712:t=>{t.exports="pipelinebeforeflush"},40285:t=>{t.exports="pipelinebind"},65918:t=>{t.exports="pipelineboot"},92852:t=>{t.exports="pipelinedestroy"},56072:t=>{t.exports="pipelinerebind"},57566:t=>{t.exports="pipelineresize"},77085:(t,e,i)=>{t.exports={AFTER_FLUSH:i(84817),BEFORE_FLUSH:i(36712),BIND:i(40285),BOOT:i(65918),DESTROY:i(92852),REBIND:i(56072),RESIZE:i(57566)}},54812:(t,e,i)=>{var s=i(83419),n=i(99155),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e){t=this.getController(t),this.set1f("amount",t.amount,e)}});t.exports=o},67329:(t,e,i)=>{var s=i(83419),n=i(24400),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(t){t=this.getController(t),this.set1f("strength",t.blurStrength),this.set3fv("color",t.glcolor)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1,s=this.fullFrame2;this.copyFrame(t,s);for(var n=2/t.width*e.offsetX,r=2/t.height*e.offsetY,o=0;o{var s=i(83419),n=i(41514),r=i(51078),o=i(94328),a=i(84057),h=new s({Extends:a,initialize:function(t){a.call(this,{game:t,shaders:[{name:"Gaussian5",fragShader:n},{name:"Gaussian9",fragShader:r},{name:"Gaussian13",fragShader:o}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(t){var e=this.getController(),i=this.gl,s=this.fullFrame1,n=i.getParameter(i.FRAMEBUFFER_BINDING);this.bind(this.shaders[e.quality]),i.activeTexture(i.TEXTURE0),i.viewport(0,0,t.width,t.height),this.set1i("uMainSampler",0),this.set2f("resolution",t.width,t.height),this.set1f("strength",e.strength),this.set3fv("color",e.glcolor);for(var r=0;r{var s=i(83419),n=i(90610),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("amount",t.amount,e),this.set1f("contrast",t.contrast,e),this.set1f("strength",t.strength,e),this.set2f("blur",t.blurX,t.blurY,e),this.setBoolean("isTiltShift",t.isTiltShift,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},89428:(t,e,i)=>{var s=i(83419),n=i(91899),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("scale",t.scale,e),this.set1f("feather",t.feather,e),this.set1f("thickness",t.thickness,e),this.set3fv("color",t.glcolor,e),this.set4fv("backgroundColor",t.glcolor2,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},88904:(t,e,i)=>{var s=i(83419),n=i(84057),r=new s({Extends:n,initialize:function(t){n.call(this,{game:t})},onDraw:function(t){var e=this.fullFrame1;this.controller?this.manager.drawFrame(t,e,!0,this.controller):this.drawFrame(t,e),this.copyToGame(e)}});t.exports=r},63563:(t,e,i)=>{var s=i(83419),n=i(47838),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(t){var e=this.game.textures.getFrame(t);e&&(this.glTexture=e.glTexture)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",e.x,e.y),this.bindTexture(e.glTexture,1),this.copySprite(t,i),this.copyToGame(i)}});t.exports=o},94045:(t,e,i)=>{var s=i(83419),n=i(95540),r=i(98656),o=i(84057),a=i(70554),h=new s({Extends:o,initialize:function(t,e){var i=n(e,"quality",.1),s=n(e,"distance",10);o.call(this,{game:t,fragShader:a.setGlowQuality(r,t,i,s)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("outerStrength",t.outerStrength,e),this.set1f("innerStrength",t.innerStrength,e),this.set4fv("glowColor",t.glcolor,e),this.setBoolean("knockout",t.knockout,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=h},74088:(t,e,i)=>{var s=i(83419),n=i(70463),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(t,e){t=this.getController(t),this.set1f("alpha",t.alpha,e),this.set1i("size",t.size,e),this.set3fv("color1",t.glcolor1,e),this.set3fv("color2",t.glcolor2,e),this.set2f("positionFrom",t.fromX,t.fromY,e),this.set2f("positionTo",t.toX,t.toY,e)}});t.exports=o},99636:(t,e,i)=>{var s=i(83419),n=i(50831),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("amount",t.amount,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},34700:(t,e,i)=>{var s=i(83419),n=i(92595),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(t,e){var i=(t=this.getController(t)).samples;this.set1i("samples",i,e),this.set1f("intensity",t.intensity,e),this.set1f("decay",t.decay,e),this.set1f("power",t.power/i,e),this.set2f("lightPosition",t.x,t.y,e),this.set4fv("color",t.glcolor,e)}});t.exports=o},91157:(t,e,i)=>{var s=i(83419),n=i(72464),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(t,e,i,s){t=this.getController(t),this.setTime("time",e),this.set1f("speed",t.speed,e),this.set1f("lineWidth",t.lineWidth,e),this.set1f("gradient",t.gradient,e),this.setBoolean("reveal",t.reveal,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},27797:(t,e,i)=>{var s=i(83419),n=i(39249),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(t,e){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("strength",t.strength,e),this.set2f("position",t.x,t.y,e)}});t.exports=o},67603:(t,e,i)=>{var s=i(83419),n=i(2878),r=i(84057),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(t,e){var i=(t=this.getController(t)).progress,s=t.wipeWidth,n=t.direction,r=t.axis;this.set4f("config",i,s,n,r,e),this.setBoolean("reveal",t.reveal,e)}});t.exports=o},58918:(t,e,i)=>{var s={Barrel:i(54812),Bloom:i(67329),Blur:i(8861),Bokeh:i(51051),Circle:i(89428),ColorMatrix:i(88904),Displacement:i(63563),Glow:i(94045),Gradient:i(74088),Pixelate:i(99636),Shadow:i(34700),Shine:i(91157),Vignette:i(27797),Wipe:i(67603)};t.exports=s},96615:(t,e,i)=>{var s=i(36060),n=i(79291),r={FX:i(58918),BitmapMaskPipeline:i(31302),Events:i(77085),FXPipeline:i(92651),LightPipeline:i(96569),MobilePipeline:i(56527),MultiPipeline:i(57516),PointLightPipeline:i(43439),PostFXPipeline:i(84057),PreFXPipeline:i(43558),RopePipeline:i(81041),SinglePipeline:i(12385),UtilityPipeline:i(7589)};r=n(!1,r,s),t.exports=r},35407:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = frame1 + frame2 * uStrength;","}"].join("\n")},78908:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","precision mediump float;","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join("\n")},85191:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","precision mediump float;","attribute vec2 inPosition;","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}"].join("\n")},96293:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},36682:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uBrightness;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}"].join("\n")},99155:t=>{t.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},24400:t=>{t.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join("\n")},94328:t=>{t.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},41514:t=>{t.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},51078:t=>{t.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},90610:t=>{t.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},91899:t=>{t.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join("\n")},47838:t=>{t.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},98656:t=>{t.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},70463:t=>{t.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join("\n")},50831:t=>{t.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},92595:t=>{t.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join("\n")},72464:t=>{t.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{","\tvec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join("\n")},39249:t=>{t.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," \tcol = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join("\n")},2878:t=>{t.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},31063:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","precision mediump float;","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = %LIGHT_COUNT%;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}"].join("\n")},48247:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}"].join("\n")},41214:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join("\n")},39653:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join("\n")},62143:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},47940:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},98840:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler[%count%];","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture;"," %forloop%"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},44667:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},4127:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","precision mediump float;","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},89924:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}"].join("\n")},27681:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join("\n")},49627:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},45561:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},60722:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},89350:(t,e,i)=>{t.exports={AddBlendFrag:i(35407),BitmapMaskFrag:i(78908),BitmapMaskVert:i(85191),ColorMatrixFrag:i(96293),CopyFrag:i(36682),FXBarrelFrag:i(99155),FXBloomFrag:i(24400),FXBlurHighFrag:i(94328),FXBlurLowFrag:i(41514),FXBlurMedFrag:i(51078),FXBokehFrag:i(90610),FXCircleFrag:i(91899),FXDisplacementFrag:i(47838),FXGlowFrag:i(98656),FXGradientFrag:i(70463),FXPixelateFrag:i(50831),FXShadowFrag:i(92595),FXShineFrag:i(72464),FXVignetteFrag:i(39249),FXWipeFrag:i(2878),LightFrag:i(31063),LinearBlendFrag:i(48247),MeshFrag:i(41214),MeshVert:i(39653),MobileFrag:i(62143),MobileVert:i(47940),MultiFrag:i(98840),MultiVert:i(44667),PointLightFrag:i(4127),PointLightVert:i(89924),PostFXFrag:i(27681),QuadVert:i(49627),SingleFrag:i(45561),SingleVert:i(60722)}},93567:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.webGLAttribLocation=-1,this.gl=t,this.program=e,this.name=i,this.createResource()},createResource:function(){if(null!==this.program.webGLProgram){var t=this.gl;t.isContextLost()||(this.webGLAttribLocation=t.getAttribLocation(this.program.webGLProgram,this.name))}else this.webGLAttribLocation=-1},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});t.exports=s},26128:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s){this.webGLBuffer=null,this.gl=t,this.initialDataOrSize=e,this.bufferType=i,this.bufferUsage=s,this.createResource()},createResource:function(){if(null!==this.initialDataOrSize){var t=this.gl;if(!t.isContextLost()){var e=this.bufferType,i=t.createBuffer();this.webGLBuffer=i,t.bindBuffer(e,this.webGLBuffer),t.bufferData(e,this.initialDataOrSize,this.bufferUsage),t.bindBuffer(e,null)}}},destroy:function(){var t=this.gl;t.isContextLost()||t.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});t.exports=s},84387:(t,e,i)=>{var s=i(83419),n={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},r=new s({initialize:function(t,e,i,s,n){this.webGLFramebuffer=null,this.gl=t,this.width=e,this.height=i,this.renderTexture=s,this.addDepthStencilBuffer=!!n,this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost()){var e,i=this.renderTexture,s=t.createFramebuffer();if(this.webGLFramebuffer=s,t.bindFramebuffer(t.FRAMEBUFFER,s),i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i.webGLTexture,0),(e=t.checkFramebufferStatus(t.FRAMEBUFFER))!==t.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(n[e]||e));if(this.addDepthStencilBuffer){var r=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,r),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,r)}t.bindFramebuffer(t.FRAMEBUFFER,null)}},destroy:function(){if(null!==this.webGLFramebuffer){var t=this.gl;if(!t.isContextLost()){t.bindFramebuffer(t.FRAMEBUFFER,this.webGLFramebuffer);var e=t.getFramebufferAttachmentParameter(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);null!==e&&(t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,null,0),t.deleteTexture(e));var i=t.getFramebufferAttachmentParameter(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);null!==i&&t.deleteRenderbuffer(i),t.bindFramebuffer(t.FRAMEBUFFER,null),t.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});t.exports=r},1482:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i){this.webGLProgram=null,this.gl=t,this.vertexSource=e,this.fragmentSource=i,this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost()){var e=t.createProgram(),i=t.createShader(t.VERTEX_SHADER),s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(i,this.vertexSource),t.shaderSource(s,this.fragmentSource),t.compileShader(i),t.compileShader(s);var n="Shader failed:\n";if(!t.getShaderParameter(i,t.COMPILE_STATUS))throw new Error("Vertex "+n+t.getShaderInfoLog(i));if(!t.getShaderParameter(s,t.COMPILE_STATUS))throw new Error("Fragment "+n+t.getShaderInfoLog(s));if(t.attachShader(e,i),t.attachShader(e,s),t.linkProgram(e),!t.getProgramParameter(e,t.LINK_STATUS))throw new Error("Link "+n+t.getProgramInfoLog(e));t.useProgram(e),this.webGLProgram=e}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});t.exports=s},82751:(t,e,i)=>{var s=i(83419),n=i(50030),r=new s({initialize:function(t,e,i,s,n,r,o,a,h,l,u,c,d){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=t,this.mipLevel=e,this.minFilter=i,this.magFilter=s,this.wrapT=n,this.wrapS=r,this.format=o,this.pixels=a,this.width=h,this.height=l,this.pma=null==u||u,this.forceSize=!!c,this.flipY=!!d,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var t=this.gl;if(!t.isContextLost())if(this.pixels instanceof r)this.webGLTexture=this.pixels.webGLTexture;else{var e=t.createTexture();t.activeTexture(t.TEXTURE0);var i=t.getParameter(t.TEXTURE_BINDING_2D);t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.minFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.magFilter),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.wrapS),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.wrapT),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),this.flipY&&t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0);var s=this.pixels,o=this.mipLevel,a=this.width,h=this.height,l=this.format,u=!1;if(null==s)t.texImage2D(t.TEXTURE_2D,o,l,a,h,0,l,t.UNSIGNED_BYTE,null),u=n(a,h);else if(s.compressed){a=s.width,h=s.height,u=s.generateMipmap;for(var c=0;c{var s=new(i(83419))({initialize:function(t,e,i){this.webGLUniformLocation=null,this.gl=t,this.program=e,this.name=i,this.createResource()},createResource:function(){if(null!==this.program.webGLProgram){var t=this.gl;t.isContextLost()||(this.webGLUniformLocation=t.getUniformLocation(this.program.webGLProgram,this.name))}else this.webGLUniformLocation=null},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});t.exports=s},9503:(t,e,i)=>{var s={WebGLAttribLocationWrapper:i(93567),WebGLBufferWrapper:i(26128),WebGLProgramWrapper:i(1482),WebGLTextureWrapper:i(82751),WebGLFramebufferWrapper:i(84387),WebGLUniformLocationWrapper:i(57183)};t.exports=s},76531:(t,e,i)=>{var s=i(13560),n=i(83419),r=i(50792),o=i(97480),a=i(8443),h=i(57811),l=i(74403),u=i(45818),c=i(29747),d=i(87841),f=i(86555),p=i(56583),g=i(26099),v=i(38058),m=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new g(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.domlisteners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.scaleMode!==s.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),(t.snapWidth>0||t.snapHeight>0)&&this.displaySize.setSnap(t.snapWidth,t.snapHeight),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displaySize.setSnap(t,e),this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;if(this.scaleMode===s.SCALE_MODE.NONE)this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1);else if(this.scaleMode===s.SCALE_MODE.RESIZE)this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e;else if(this.scaleMode===s.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px";var h=this.parentSize.width/this.gameSize.width,l=this.parentSize.height/this.gameSize.height;h=0?0:-o.x*a.x,l=o.y>=0?0:-o.y*a.y;return i=r.width>=o.width?n.width:n.width-(o.width-r.width)*a.x,s=r.height>=o.height?n.height:n.height-(o.height-r.height)*a.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=m},64743:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(t,e,i)=>{var s={CENTER:i(64743),ORIENTATION:i(39218),SCALE_MODE:i(81050),ZOOM:i(80805)};t.exports=s},56139:t=>{t.exports="enterfullscreen"},2336:t=>{t.exports="fullscreenfailed"},47412:t=>{t.exports="fullscreenunsupported"},51452:t=>{t.exports="leavefullscreen"},20666:t=>{t.exports="orientationchange"},47945:t=>{t.exports="resize"},97480:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(56139),FULLSCREEN_FAILED:i(2336),FULLSCREEN_UNSUPPORTED:i(47412),LEAVE_FULLSCREEN:i(51452),ORIENTATION_CHANGE:i(20666),RESIZE:i(47945)}},93364:(t,e,i)=>{var s=i(79291),n=i(13560),r={Center:i(64743),Events:i(97480),Orientation:i(39218),ScaleManager:i(76531),ScaleModes:i(81050),Zoom:i(80805)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},27397:(t,e,i)=>{var s=i(95540),n=i(35355);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},52106:(t,e,i)=>{var s=i(95540);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},87033:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},97482:(t,e,i)=>{var s=i(83419),n=i(2368),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},60903:(t,e,i)=>{var s=i(83419),n=i(89993),r=i(44594),o=i(8443),a=i(35154),h=i(54899),l=i(29747),u=i(97482),c=i(2368),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e),s.scenePlugin&&s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status=n.START&&o<=n.CREATING)return this;if(o>=n.RUNNING&&o<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e){var i=this.getScene(t),s=this.getScene(e);return i&&s&&i!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(ei),0,n)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s{var s=i(45319),n=i(83419),r=i(44594),o=i(95540),a=i(37277),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data"));var l=o(t,"onStart",null),u=o(t,"onStartScope",this.scene);return l&&l.call(u,this.scene,i,s),this.systems.events.emit(r.TRANSITION_OUT,i,s),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},55681:(t,e,i)=>{var s=i(89993),n=i(35154),r=i(46975),o=i(87033),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},2368:(t,e,i)=>{var s=i(83419),n=i(89993),r=i(42363),o=i(44594),a=i(27397),h=i(52106),l=i(29747),u=i(55681),c=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(o.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>n.PENDING&&t<=n.RUNNING},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},69830:t=>{t.exports="addedtoscene"},7919:t=>{t.exports="boot"},46763:t=>{t.exports="create"},11763:t=>{t.exports="destroy"},71555:t=>{t.exports="pause"},36735:t=>{t.exports="postupdate"},3809:t=>{t.exports="prerender"},90716:t=>{t.exports="preupdate"},58262:t=>{t.exports="ready"},91633:t=>{t.exports="removedfromscene"},10319:t=>{t.exports="render"},87132:t=>{t.exports="resume"},81961:t=>{t.exports="shutdown"},90194:t=>{t.exports="sleep"},6265:t=>{t.exports="start"},33178:t=>{t.exports="transitioncomplete"},43063:t=>{t.exports="transitioninit"},11259:t=>{t.exports="transitionout"},61611:t=>{t.exports="transitionstart"},45209:t=>{t.exports="transitionwake"},22966:t=>{t.exports="update"},21747:t=>{t.exports="wake"},44594:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(69830),BOOT:i(7919),CREATE:i(46763),DESTROY:i(11763),PAUSE:i(71555),POST_UPDATE:i(36735),PRE_RENDER:i(3809),PRE_UPDATE:i(90716),READY:i(58262),REMOVED_FROM_SCENE:i(91633),RENDER:i(10319),RESUME:i(87132),SHUTDOWN:i(81961),SLEEP:i(90194),START:i(6265),TRANSITION_COMPLETE:i(33178),TRANSITION_INIT:i(43063),TRANSITION_OUT:i(11259),TRANSITION_START:i(61611),TRANSITION_WAKE:i(45209),UPDATE:i(22966),WAKE:i(21747)}},62194:(t,e,i)=>{var s=i(89993),n=i(79291),r={Events:i(44594),GetPhysicsPlugins:i(27397),GetScenePlugins:i(52106),SceneManager:i(60903),ScenePlugin:i(52209),Settings:i(55681),Systems:i(2368)};r=n(!1,r,s),t.exports=r},30341:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(14463),o=i(79291),a=i(29747),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying||(this.isPlaying=!1,this.isPaused=!0,0))},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1,0))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.stop(),this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},85034:(t,e,i)=>{var s=i(83419),n=i(41786),r=i(50792),o=i(14463),a=i(8443),h=i(46710),l=i(58731),u=i(29747),c=i(26099),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,this.gameLostFocus=!1,this.listenerPosition=new c,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:u,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return l(this.sounds,"key",t)},getAll:function(t){return t?h(this.sounds,"key",t):h(this.sounds)},getAllPlaying:function(){return h(this.sounds,"isPlaying",!0)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=d},14747:(t,e,i)=>{var s=i(33684),n=i(25960),r=i(57490),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},19723:t=>{t.exports="complete"},98882:t=>{t.exports="decodedall"},57506:t=>{t.exports="decoded"},73146:t=>{t.exports="destroy"},11305:t=>{t.exports="detune"},40577:t=>{t.exports="detune"},30333:t=>{t.exports="mute"},20394:t=>{t.exports="rate"},21802:t=>{t.exports="volume"},1299:t=>{t.exports="looped"},99190:t=>{t.exports="loop"},97125:t=>{t.exports="mute"},89259:t=>{t.exports="pan"},79986:t=>{t.exports="pauseall"},17586:t=>{t.exports="pause"},19618:t=>{t.exports="play"},42306:t=>{t.exports="rate"},10387:t=>{t.exports="resumeall"},48959:t=>{t.exports="resume"},9960:t=>{t.exports="seek"},19180:t=>{t.exports="stopall"},98328:t=>{t.exports="stop"},50401:t=>{t.exports="unlocked"},52498:t=>{t.exports="volume"},14463:(t,e,i)=>{t.exports={COMPLETE:i(19723),DECODED:i(57506),DECODED_ALL:i(98882),DESTROY:i(73146),DETUNE:i(11305),GLOBAL_DETUNE:i(40577),GLOBAL_MUTE:i(30333),GLOBAL_RATE:i(20394),GLOBAL_VOLUME:i(21802),LOOP:i(99190),LOOPED:i(1299),MUTE:i(97125),PAN:i(89259),PAUSE_ALL:i(79986),PAUSE:i(17586),PLAY:i(19618),RATE:i(42306),RESUME_ALL:i(10387),RESUME:i(48959),SEEK:i(9960),STOP_ALL:i(19180),STOP:i(98328),UNLOCKED:i(50401),VOLUME:i(52498)}},64895:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(14463),o=i(45319),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!s.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(r.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||this.startTime>0||!s.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||this.startTime>0||!s.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(r.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},33684:(t,e,i)=>{var s=i(85034),n=i(83419),r=i(14463),o=i(64895),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(14747),Events:i(14463),BaseSound:i(30341),BaseSoundManager:i(85034),WebAudioSound:i(71741),WebAudioSoundManager:i(57490),HTML5AudioSound:i(64895),HTML5AudioSoundManager:i(33684),NoAudioSound:i(4603),NoAudioSoundManager:i(25960)}},4603:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(50792),o=i(79291),a=i(29747),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:a,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},25960:(t,e,i)=>{var s=i(85034),n=i(83419),r=i(50792),o=i(4603),a=i(29747),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:a,onFocus:a,onGameBlur:a,onGameFocus:a,pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,unlock:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},71741:(t,e,i)=>{var s=i(30341),n=i(83419),r=i(14463),o=i(95540),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createPanner&&(this.spatialNode=t.context.createPanner(),this.volumeNode.connect(this.spatialNode)),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),t.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):t.context.createPanner?this.spatialNode.connect(t.destination):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(53134),n=i(85034),r=i(83419),o=i(14463),a=i(8443),h=i(71741),l=i(95540),u=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(37105),n=i(83419),r=i(29747),o=i(19186),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},90330:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e{var s=i(83419),n=i(50792),r=i(82348),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(43886);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,s=e;s<=i-e;s++)f=n=a(t,0,s,this.toBBox),p=r=a(t,s,i,this.toBBox),void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},35072:(t,e,i)=>{var s=new(i(83419))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(45319),n=i(83419),r=i(56583),o=i(26099),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},15238:t=>{t.exports="add"},56187:t=>{t.exports="remove"},82348:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(15238),PROCESS_QUEUE_REMOVE:i(56187)}},41392:(t,e,i)=>{t.exports={Events:i(82348),List:i(73162),Map:i(90330),ProcessQueue:i(25774),RTree:i(59542),Set:i(35072),Size:i(86555)}},57382:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(40987),o=i(8054),a=i(50030),h=i(79237),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=!0);var r=this.manager.getFrame(t,e);if(r){var o=r.canvasData,a=r.cutWidth,h=r.cutHeight,l=r.source.resolution;this.context.drawImage(r.source.image,o.x,o.y,a,h,i,s,a/l,h/l),n&&this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new 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{var s=i(10312),n=i(71911),r=i(27919),o=i(83419),a=i(8054),h=i(4327),l=i(95540),u=i(36060),c=i(32302),d=i(79237),f=i(70554),p=new o({Extends:d,initialize:function(t,e,i,s){void 0===i&&(i=256),void 0===s&&(s=256),this.type="DynamicTexture";var o=t.game.renderer,h=o&&o.type===a.CANVAS,l=h?r.create2D(this,i,s):[this];d.call(this,t,e,l,i,s),this.add("__BASE",0,0,0,i,s),this.renderer=o,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=h?l:null,this.context=h?l.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new n(0,0,i,s).setScene(t.game.scene.systemScene,!1),this.renderTarget=h?null:new c(o,i,s,1,0,!1,!0,!0,!1),this.pipeline=h?null:o.pipelines.get(u.SINGLE_PIPELINE),this.setSize(i,s)},setSize:function(t,e){void 0===e&&(e=t);var i=this.get(),s=i.source;if(t!==this.width||e!==this.height){this.canvas&&(this.canvas.width=t,this.canvas.height=e);var n=this.renderTarget;n&&(n.willResize(t,e)&&n.resize(t,e),n.texture!==s.glTexture&&this.renderer.deleteTexture(s.glTexture),this.setFromRenderTarget()),this.camera.setSize(t,e),s.width=t,s.height=e,i.setSize(t,e),this.width=t,this.height=e}else{var r=this.getSourceImage();i.cutX+t>r.width&&(t=r.width-i.cutX),i.cutY+e>r.height&&(e=r.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}return this},setFromRenderTarget:function(){var t=this.get().source,e=this.renderTarget;return t.isRenderTexture=!0,t.isGLTexture=!0,t.glTexture=e.texture,t.glTexture.flipY=!0,this},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this},fill:function(t,e,i,s,n,r){var o=this.camera,a=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height);var h=t>>16&255,l=t>>8&255,u=255&t,c=this.renderTarget;if(o.preRender(),c){c.bind(!0);var d=this.pipeline.manager.set(this.pipeline),p=a.width/c.width,g=a.height/c.height,v=c.height-(s+r);d.drawFillRect(i*p,v*g,n*p,r*g,f.getTintFromFloats(u/255,l/255,h/255,1),e),c.unbind(!0)}else{var m=this.context;a.setContext(m),m.globalCompositeOperation="source-over",m.fillStyle="rgba("+h+","+l+","+u+","+e+")",m.fillRect(i,s,n,r),a.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.context,e=this.renderTarget;e?e.clear():t&&(t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.width,this.height),t.restore()),this.dirty=!1}return this},stamp:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0);var r=l(n,"alpha",1),o=l(n,"tint",16777215),a=l(n,"angle",0),h=l(n,"rotation",0),u=l(n,"scale",1),c=l(n,"scaleX",u),d=l(n,"scaleY",u),f=l(n,"originX",.5),p=l(n,"originY",.5),g=l(n,"blendMode",0),v=l(n,"erase",!1),m=l(n,"skipBatch",!1),y=this.manager.resetStamp(r,o);return y.setAngle(0),0!==a?y.setAngle(a):0!==h&&y.setRotation(h),y.setScale(c,d),y.setTexture(t,e),y.setOrigin(f,p),y.setBlendMode(g),v&&(this._eraseMode=!0),m?this.batchGameObject(y,i,s):this.draw(y,i,s),v&&(this._eraseMode=!1),this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},repeat:function(t,e,i,s,n,r,o,a,l){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=1),void 0===a&&(a=16777215),void 0===l&&(l=!1),!(e=t instanceof h?t:this.manager.getFrame(t,e)))return this;var u=this.manager.resetStamp(o,a);u.setFrame(e),u.setOrigin(0);var c=e.width,d=e.height;n=Math.floor(n),r=Math.floor(r);var f=Math.ceil(n/c),p=Math.ceil(r/d),g=f*c-n,v=p*d-r;g>0&&(g=c-g),v>0&&(v=d-v),i<0&&(f+=Math.ceil(Math.abs(i)/c)),s<0&&(p+=Math.ceil(Math.abs(s)/d));var m=i,y=s,x=!1,T=this.manager.stampCrop.setTo(0,0,c,d);l||this.beginDraw();for(var w=0;w0&&b===f-1&&(x=!0,T.width=g),v>0&&w===p-1&&(x=!0,T.height=v),x&&u.setCrop(T),this.batchGameObject(u,m,y),u.isCropped=!1,T.setTo(0,0,c,d)),m+=c;m=i,y+=d}return l||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var t=this.camera,e=this.renderer,i=this.renderTarget;t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(t,e,i,s,n){return Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=1),void 0===r&&(r=16777215);var o=this.manager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i,s,n,r)),this},endDraw:function(t){if(void 0===t&&(t=this._eraseMode),this.isDrawing){var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(t,e,i,s,n){var r=t.length;if(0!==r)for(var o=0;o0&&a.height>0&&o.drawImage(h,a.x,a.y,a.width,a.height,e,i,a.width,a.height),o.restore()}},snapshotArea:function(t,e,i,s,n,r,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,o):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,o),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(t,e,i,s){var n=this.manager.resetStamp();n.setTexture(this),n.setOrigin(0),n.renderWebGL(t,n,i,s)},renderCanvas:function(){},destroy:function(){var t=this.manager.stamp;t&&t.texture===this&&this.manager.resetStamp(),d.prototype.destroy.call(this),r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});t.exports=p},4327:(t,e,i)=>{var s=i(83419),n=i(45319),r=i(79291),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setScale9:function(t,e,i,s){var n=this.data;return n.scale9=!0,n.is3Slice=0===e&&s===this.height,n.scale9Borders.x=t,n.scale9Borders.y=e,n.scale9Borders.w=i,n.scale9Borders.h=s,this},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),g=l+(i=n(i,0,f)),v=s=n(s,0,d-e),m=r=n(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(x.rT||x.y>w)p=0,g=0,v=0,m=0;else{var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;v=S,m=A,p=o?h+(u-(b-x.x)-S):h+(b-x.x),g=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}}else o&&(p=h+(u-e-s)),a&&(g=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/_),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.customData=null,this.data=null},glTexture:{get:function(){return this.source.glTexture}},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},79237:(t,e,i)=>{var s=i(83419),n=i(4327),r=i(11876),o='Texture "%s" has no frame "%s"',a=new s({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var o=0;on&&(n=a.cutX+a.cutWidth),a.cutY+a.cutHeight>r&&(r=a.cutY+a.cutHeight)}return{x:i,y:s,width:n-i,height:r-s}},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:(console.warn(o,this.key,t),this.frames.__BASE.source.image)},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return i?e=i.sourceIndex:(console.warn(o,this.key,t),e=this.frames.__BASE.sourceIndex),this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e{var s=i(27919),n=i(57382),r=i(83419),o=i(40987),a=i(8054),h=i(81320),l=i(50792),u=i(69442),c=i(4327),d=i(8443),f=i(99584),p=i(35154),g=i(88571),v=i(41212),m=i(61309),y=i(87841),x=i(79237),T=new r({Extends:l,initialize:function(t){l.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.silentWarnings=!1,t.events.once(d.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(d.DESTROY,this.destroy,this),this.game.events.once(d.SYSTEM_READY,(function(t){this.stamp=new g(t).setOrigin(0)}),this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(t){return!this.exists(t)||(this.silentWarnings||console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return this.silentWarnings||console.warn("No texture found matching key: "+t),this;t=this.get(t)}var e=t.key;return this.list.hasOwnProperty(e)&&(t.destroy(),this.emit(u.REMOVE,e),this.emit(u.REMOVE_KEY+e)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(u.ERROR,t)},s.onload=function(){var e=i.create(t,s);m.Image(e,0),i.emit(u.ADD,t,e),i.emit(u.ADD_KEY+t,e),i.emit(u.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height),l=h.getContext("2d",{willReadFrequently:!0});a.width>0&&a.height>0&&l.drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),m.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e){var i=null;if(this.checkKey(t)){var s=e.width,n=e.height;(i=this.create(t,e,s,n)).add("__BASE",0,0,0,s,n),this.emit(u.ADD,t,i),this.emit(u.ADD_KEY+t,i)}return i},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i){var n=function(t,e,i){Array.isArray(i.textures)||Array.isArray(i.frames)?m.JSONArray(t,e,i):m.JSONHash(t,e,i)};if(Array.isArray(i))for(var r=0;r=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(27919),n=i(83419),r=i(50030),o=i(29795),a=i(82751),h=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var h=t.manager.game;this.renderer=h.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type||"DynamicTexture"===e.type,this.isGLTexture=e instanceof a,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.flipY=n,this.init(h)},init:function(t){var e=this.renderer;if(e){var i=this.source;if(e.gl){var s=this.image,n=this.flipY,r=this.width,o=this.height,a=this.scaleMode;this.isCanvas?this.glTexture=e.createCanvasTexture(s,!1,n):this.isVideo?this.glTexture=e.createVideoTexture(s,!1,n):this.isRenderTexture?this.glTexture=e.createTextureFromSource(null,r,o,a):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(i,void 0,void 0,a):i instanceof Uint8Array?this.glTexture=e.createUint8ArrayTexture(i,r,o,a):this.glTexture=e.createTextureFromSource(s,r,o,a)}else this.isRenderTexture&&(this.image=i.canvas)}t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer,e=this.image,i=this.flipY,s=t.gl;s&&this.isCanvas?t.updateCanvasTexture(e,this.glTexture,i):s&&this.isVideo&&t.updateVideoTexture(e,this.glTexture,i)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=h},19673:t=>{t.exports={LINEAR:0,NEAREST:1}},44538:t=>{t.exports="addtexture"},63486:t=>{t.exports="addtexture-"},94851:t=>{t.exports="onerror"},29099:t=>{t.exports="onload"},8678:t=>{t.exports="ready"},86415:t=>{t.exports="removetexture"},30879:t=>{t.exports="removetexture-"},69442:(t,e,i)=>{t.exports={ADD:i(44538),ADD_KEY:i(63486),ERROR:i(94851),LOAD:i(29099),READY:i(8678),REMOVE:i(86415),REMOVE_KEY:i(30879)}},27458:(t,e,i)=>{var s=i(79291),n=i(19673),r={CanvasTexture:i(57382),DynamicTexture:i(81320),Events:i(69442),FilterMode:n,Frame:i(4327),Parsers:i(61309),Texture:i(79237),TextureManager:i(17130),TextureSource:i(11876)};r=s(!1,r,n),t.exports=r},89905:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},4832:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},78566:(t,e,i)=>{var s=i(41786);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(41786);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];if(r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),h.scale9Borders&&r.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+a)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},31403:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},82038:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,e){return Math.ceil(t/4)*Math.ceil(e/4)*16}function r(t,i){return e(t,i,3,3,4,4,8)}function o(t,i){return e(t,i,3,3,4,4)}var a={0:{sizeFunc:i,glFormat:[35841]},1:{sizeFunc:i,glFormat:[35843]},2:{sizeFunc:s,glFormat:[35840]},3:{sizeFunc:s,glFormat:[35842]},6:{sizeFunc:r,glFormat:[36196]},7:{sizeFunc:r,glFormat:[33776,35916]},8:{sizeFunc:o,glFormat:[33777,35917]},9:{sizeFunc:o,glFormat:[33778,35918]},11:{sizeFunc:o,glFormat:[33779,35919]},14:{sizeFunc:n,glFormat:[36494,36495]},15:{sizeFunc:n,glFormat:[36492,36493]},22:{sizeFunc:r,glFormat:[37492,37493]},23:{sizeFunc:o,glFormat:[37496,37497]},24:{sizeFunc:r,glFormat:[37494,37495]},25:{sizeFunc:r,glFormat:[37488]},26:{sizeFunc:o,glFormat:[37490]},27:{sizeFunc:o,glFormat:[37808,37840]},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:[37809,37841]},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:[37810,37842]},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:[37811,37843]},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:[37812,37844]},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:[37813,37845]},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:[37814,37846]},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:[37815,37847]},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:[37816,37848]},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:[37817,37849]},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:[37818,37850]},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:[37819,37851]},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:[37820,37852]},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:[37821,37853]}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=55727696===e[0]?e[2]:e[3],s=e[4],n=a[i].glFormat[s],r=a[i].sizeFunc,o=e[11],h=e[7],l=e[6],u=52+e[12],c=new Uint8Array(t,u),d=new Array(o),f=0,p=h,g=l,v=0;v>1),g=Math.max(1,g>>1),f+=m}return{mipmaps:d,width:h,height:l,internalFormat:n,compressed:!0,generateMipmap:!1}}},75549:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),f=s(a,"margin",0),p=s(a,"spacing",0),g=Math.floor((r-f+p)/(h+p))*Math.floor((o-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>g||c<-g)&&(c=0),c<0&&(c=g+c),(-1===d||d>g||dr&&(y=b-r),E>o&&(x=E-o),w>=c&&w<=d&&(t.add(T,e,i+v,n+m,h-y,l-x),T++),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},47534:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(v-p-w),S=e.y,A=r-S,_=r-(m-g-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,R=0;R{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{var s=i(50030);function n(t){for(var e=t.mipmaps,i=0;i{t.exports={AtlasXML:i(89905),Canvas:i(72893),Image:i(4832),JSONArray:i(78566),JSONHash:i(39711),KTXParser:i(31403),PVRParser:i(82038),SpriteSheet:i(75549),SpriteSheetFromAtlas:i(47534),UnityYAML:i(86147)}},80341:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(t,e,i)=>{var s=new(i(83419))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(83419))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(80341),n=i(87010),r=i(46177),o=i(49075);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},23029:(t,e,i)=>{var s=i(83419),n=i(31401),r=i(91907),o=i(62644),a=i(93232),h=new s({Mixins:[n.AlphaSingle,n.Flip,n.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.tintFill=!1,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=o(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new a),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===r.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===r.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===r.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===r.HEXAGONAL){var e,i,s=this.layer.staggerAxis,n=this.layer.staggerIndex,o=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-o)/2+o,this.pixelX="odd"===n?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-o)/2+o,this.pixelX=this.x*e,this.pixelY="odd"===n?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=h},49075:(t,e,i)=>{var s=i(84101),n=i(83419),r=i(39506),o=i(80341),a=i(95540),h=i(14977),l=i(27462),u=i(91907),c=i(36305),d=i(19133),f=i(68287),p=i(23029),g=i(81086),v=i(20442),m=i(33629),y=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,r,a,h,l){if(void 0===t)return null;null==e&&(e=t);var u=this.scene.sys.textures;if(!u.exists(e))return console.warn('Texture key "%s" not found',e),null;var c=u.get(e),d=this.getTilesetIndex(t);if(null===d&&this.format===o.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',t,this.tilesets),null;var f=this.tilesets[d];return f?(f.setTileSize(i,n),f.setSpacing(r,a),f.setImage(c),f):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===a&&(a=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(f=new m(t,h,i,n,r,a,void 0,void 0,l)).setImage(c),this.tilesets.push(f),this.tiles=s(this),f)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(g.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,a){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===a&&(a=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:o,tileHeight:a,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:g.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(44603),n=i(31989);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},46029:(t,e,i)=>{var s=i(39429),n=i(31989);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},20442:(t,e,i)=>{var s=i(83419),n=i(78389),r=i(31401),o=i(95643),a=i(81086),h=i(19218),l=i(26099),u=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,n,h],initialize:function(t,e,i,s,n,r){o.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,r),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return a.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return a.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,o){return a.Copy(t,e,i,s,n,r,o,this.layer),this},fill:function(t,e,i,s,n,r){return a.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,o){return a.FilterTiles(t,e,i,s,n,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,o){return a.FindTile(t,e,i,s,n,r,o,this.layer)},forEachTile:function(t,e,i,s,n,r,o){return a.ForEachTile(t,e,i,s,n,r,o,this.layer),this},setTint:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!1}),this,e,i,s,n,r)},setTintFill:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!0}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return a.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,n){void 0===i&&(i=!0);var r=this.tempVec;return a.IsometricWorldToTileXY(t,e,!0,r,n,this.layer,i),this.getTileAt(r.x,r.y,s)},getTilesWithin:function(t,e,i,s,n){return a.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return a.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return a.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return a.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return a.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return a.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return a.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return a.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return a.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return a.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return a.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return a.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return a.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return a.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,n){return a.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}});t.exports=u},16153:(t,e,i)=>{var s=i(61340),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var f=t.currentContext,p=e.gidMap;f.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(f)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(f)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(f.imageSmoothingEnabled=!1);for(var g=0;g{var s,n,r=i(29747);s=i(99558),n=i(16153),t.exports={renderWebGL:s,renderCanvas:n}},99558:(t,e,i)=>{var s=i(70554);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,g=e.scaleY;t.pipelines.preBatch(e);for(var v=0;v{var s=i(83419),n=i(26099),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&ti.width||e.height>i.height?this.updateTileData(e.width,e.height):this.updateTileData(i.width,i.height,i.x,i.y),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0);var n=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),r=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);n%1==0&&r%1==0||console.warn("Image tile area not tile size multiple in: "+this.name),n=Math.floor(n),r=Math.floor(r),this.rows=n,this.columns=r,this.total=n*r,this.texCoordinates.length=0;for(var o=this.tileMargin+i,a=this.tileMargin+s,h=0;h{var s=i(7423);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},42573:(t,e,i)=>{var s=i(7423),n=i(7386);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(26099));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(42573),n=i(7386),r=i(62991),o=i(23029);t.exports=function(t,e,i,a,h,l,u,c){void 0===u&&(u=!0);var d=n(t,e,i,a,null,c),f=[];d.forEach((function(t){var e=new o(t.layer,t.index,t.x,t.y,t.width,t.height,t.baseWidth,t.baseHeight);e.copy(t),f.push(e)}));for(var p=h-t,g=l-e,v=0;v{var s=i(62644),n=i(7386),r=i(27987);t.exports=function(t,e,i,o,a,h){i||(i={}),Array.isArray(t)||(t=[t]);var l=h.tilemapLayer;o||(o=l.scene),a||(a=o.cameras.main);var u,c=h.width,d=h.height,f=n(0,0,c,d,null,h),p=[],g=function(t,e,i){for(var s=0;s{var s=i(87841),n=i(63448),r=i(56583),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},30003:(t,e,i)=>{var s=i(19545),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},35137:(t,e,i)=>{var s=i(7386),n=i(42573),r=i(20576);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(7386);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},52692:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(7386);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},97560:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},43305:(t,e,i)=>{var s=i(91907),n=i(30003),r=i(9474),o=i(14018),a=i(29747),h=i(54503);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},7423:(t,e,i)=>{var s=i(62991);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},60540:(t,e,i)=>{var s=i(7423),n=new(i(26099));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},55826:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n){var r=n.baseTileWidth,o=n.baseTileHeight,a=n.tilemapLayer,h=0,l=0;a&&(i||(i=a.scene.cameras.main),h=a.x+i.scrollX*(1-a.scrollFactorX),l=a.y+i.scrollY*(1-a.scrollFactorY),r*=a.scaleX,o*=a.scaleY);var u=h+t*r,c=l+e*o;return[new s(u,c),new s(u+r,c),new s(u+r,c+o),new s(u,c+o)]}},11758:(t,e,i)=>{var s=i(91907),n=i(27229),r=i(29747),o=i(55826);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:(s.STAGGERED,r)}},39167:(t,e,i)=>{var s=i(91907),n=i(29747),r=i(97281);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},62e3:(t,e,i)=>{var s=i(91907),n=i(19951),r=i(14127),o=i(29747),a=i(97202),h=i(70326);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},5984:(t,e,i)=>{var s=i(91907),n=i(29747),r=i(28054),o=i(29650);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.STAGGERED?r:n}},7386:(t,e,i)=>{var s=i(95540);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(55738),n=i(7386),r=i(91865),o=i(29747),a=i(26099),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var f=u.x,p=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var g=Math.ceil(c.x),v=Math.ceil(c.y),m=Math.max(g-f,1),y=Math.max(v-p,1),x=n(f,p,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(7386),n=i(26099),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var f=Math.ceil(o.x),p=Math.ceil(o.y);return s(c,d,f-c,p-d,a,l)}},96113:(t,e,i)=>{var s=i(91907),n=i(20242),r=i(10095);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},16926:(t,e,i)=>{var s=i(91907),n=i(86625),r=i(96897),o=i(29747),a=i(15108),h=i(85896);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},55762:(t,e,i)=>{var s=i(91907),n=i(20242),r=i(51900),o=i(63288);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.STAGGERED?r:n}},45091:(t,e,i)=>{var s=i(62991);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},24152:(t,e,i)=>{var s=i(45091),n=new(i(26099));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},90454:(t,e,i)=>{var s=i(63448),n=i(56583);t.exports=function(t,e){var i,r,o,a,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),c=Math.floor(h.tileHeight*l.scaleY),d=t.hexSideLength;if("y"===t.staggerAxis){var f=(c-d)/2+d;i=n(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,o=n(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,a=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-d)/2+d;i=n(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,o=n(e.worldView.y-l.y,c,0,!0)-l.cullPaddingY,a=s(e.worldView.bottom-l.y,c,0,!0)+l.cullPaddingY}return{left:i,right:r,top:o,bottom:a}}},9474:(t,e,i)=>{var s=i(90454),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},27229:(t,e,i)=>{var s=i(19951),n=i(26099),r=new n;t.exports=function(t,e,i,o){var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(a*=l.scaleX,h*=l.scaleY);var u,c,d=s(t,e,r,i,o),f=[],p=.5773502691896257;"y"===o.staggerAxis?(u=p*a,c=h/2):(u=a/2,c=p*h);for(var g=0;g<6;g++){var v=2*Math.PI*(.5-g)/6;f.push(new n(d.x+u*Math.cos(v),d.y+c*Math.sin(v)))}return f}},19951:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleX,a*=h.scaleY);var c,d,f=o/2,p=a/2;return"y"===r.staggerAxis?(c=l+o*t+o,d=u+1.5*e*p+p,e%2==0&&("odd"===this.staggerIndex?c-=f:c+=f)):"x"===this.staggerAxis&&"odd"===this.staggerIndex&&(c=l+1.5*t*f+f,d=u+a*t+a,t%2==0&&("odd"===this.staggerIndex?d-=p:d+=p)),i.set(c,d)}},86625:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),a*=l.scaleX,h*=l.scaleY);var u,c,d,f,p,g=.5773502691896257,v=-.3333333333333333,m=.6666666666666666,y=a/2,x=h/2;"y"===o.staggerAxis?(d=g*(u=(t-y)/(g*a))+v*(c=(e-x)/x),f=0*u+m*c):(d=v*(u=(t-y)/y)+g*(c=(e-x)/(g*h)),f=m*u+0*c),p=-d-f;var T,w=Math.round(d),b=Math.round(f),E=Math.round(p),S=Math.abs(w-d),A=Math.abs(b-f),_=Math.abs(E-p);S>A&&S>_?w=-b-E:A>_&&(b=-w-E);var C=b;return T="odd"===o.staggerIndex?C%2==0?b/2+w:b/2+w-.5:C%2==0?b/2+w:b/2+w+.5,n.set(T,C)}},62991:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(33528);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=h.skipCull,f=u,p=c;if(0===n)for(o=0;o=0;r--)(a=l[o][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&(d||s(r,o,t,e))&&i.push(a);else if(2===n)for(o=p;o>=0;o--)for(r=0;r=0;o--)for(r=f;r>=0;r--)(a=l[o][r])&&-1!==a.index&&a.visible&&0!==a.alpha&&(d||s(r,o,t,e))&&i.push(a);return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},14127:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},96897:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,o,a){n||(n=new s);var h=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(r||(r=u.scene.cameras.main),e-=u.y+r.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+r.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var c=h/2,d=l/2;a||(e-=l);var f=.5*((t-=c)/c+e/d),p=.5*(-t/c+e/d);return i&&(f=Math.floor(f),p=Math.floor(p)),n.set(f,p)}},71558:(t,e,i)=>{var s=i(23029),n=i(62991),r=i(72023),o=i(20576);t.exports=function(t,e,i,a,h){if(void 0===a&&(a=!0),!n(e,i,h))return null;var l,u=h.data[i][e],c=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);if(-1===(l=t instanceof s?t.index:t))d.width=h.tileWidth,d.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],v=p.tilesets[g];d.width=v.tileWidth,d.height=v.tileHeight}return o(d,f),a&&c!==d.collides&&r(e,i,h),d}},26303:(t,e,i)=>{var s=i(71558),n=new(i(26099));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},14051:(t,e,i)=>{var s=i(42573),n=i(71558);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(7386),n=i(26546);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(23029),n=i(62991),r=i(72023);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},94178:(t,e,i)=>{var s=i(63557),n=new(i(26099));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},15533:(t,e,i)=>{var s=i(7386),n=i(3956),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(7386);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(r=f;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=p;r>=f;r--)for(n=c;a[r]&&n=f;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},57068:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},75661:(t,e,i)=>{var s=i(20576),n=i(42573),r=i(9589);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(20576),n=i(42573),r=i(97022);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(20576),n=i(42573);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},9589:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},20576:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},79583:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(7386);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(7386),n=i(33680);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(63448),n=i(56583);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},54503:(t,e,i)=>{var s=i(61325),n=i(32483);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97202:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},28054:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},15108:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},51900:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},86560:(t,e,i)=>{var s=i(7386);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},70326:(t,e,i)=>{var s=i(97281),n=i(29650),r=i(26099);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},29650:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},77366:(t,e,i)=>{var s=i(7386),n=i(75508);t.exports=function(t,e,i,r,o,a){if(o){var h,l=s(t,e,i,r,null,a),u=0;for(h=0;h{var s=i(85896),n=new(i(26099));t.exports=function(t,e,i,r){return s(t,0,e,n,i,r),n.x}},85896:(t,e,i)=>{var s=i(26099);t.exports=function(t,e,i,n,r,o){void 0===i&&(i=!0),n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),a*=l.scaleX,h*=l.scaleY);var u=t/a,c=e/h;return i&&(u=Math.floor(u),c=Math.floor(c)),n.set(u,c)}},63288:(t,e,i)=>{var s=i(85896),n=new(i(26099));t.exports=function(t,e,i,r){return s(0,t,e,n,i,r),n.y}},81086:(t,e,i)=>{t.exports={CalculateFacesAt:i(72023),CalculateFacesWithin:i(42573),CheckIsoBounds:i(33528),Copy:i(1785),CreateFromTiles:i(78419),CullBounds:i(19545),CullTiles:i(30003),Fill:i(35137),FilterTiles:i(40253),FindByIndex:i(52692),FindTile:i(66151),ForEachTile:i(97560),GetCullTilesFunction:i(43305),GetTileAt:i(7423),GetTileAtWorldXY:i(60540),GetTileCorners:i(55826),GetTileCornersFunction:i(11758),GetTilesWithin:i(7386),GetTilesWithinShape:i(91141),GetTilesWithinWorldXY:i(96523),GetTileToWorldXFunction:i(39167),GetTileToWorldXYFunction:i(62e3),GetTileToWorldYFunction:i(5984),GetWorldToTileXFunction:i(96113),GetWorldToTileXYFunction:i(16926),GetWorldToTileYFunction:i(55762),HasTileAt:i(45091),HasTileAtWorldXY:i(24152),HexagonalCullBounds:i(90454),HexagonalCullTiles:i(9474),HexagonalGetTileCorners:i(27229),HexagonalTileToWorldXY:i(19951),HexagonalWorldToTileXY:i(86625),IsInLayerBounds:i(62991),IsometricCullTiles:i(14018),IsometricTileToWorldXY:i(14127),IsometricWorldToTileXY:i(96897),PutTileAt:i(71558),PutTileAtWorldXY:i(26303),PutTilesAt:i(14051),Randomize:i(77389),RemoveTileAt:i(63557),RemoveTileAtWorldXY:i(94178),RenderDebug:i(15533),ReplaceByIndex:i(27987),RunCull:i(32483),SetCollision:i(57068),SetCollisionBetween:i(37266),SetCollisionByExclusion:i(75661),SetCollisionByProperty:i(64740),SetCollisionFromCollisionGroup:i(63307),SetLayerCollisionIndex:i(9589),SetTileCollision:i(20576),SetTileIndexCallback:i(79583),SetTileLocationCallback:i(93254),Shuffle:i(32903),StaggeredCullBounds:i(61325),StaggeredCullTiles:i(54503),StaggeredTileToWorldXY:i(97202),StaggeredTileToWorldY:i(28054),StaggeredWorldToTileXY:i(15108),StaggeredWorldToTileY:i(51900),SwapByIndex:i(86560),TileToWorldX:i(97281),TileToWorldXY:i(70326),TileToWorldY:i(29650),WeightedRandomize:i(77366),WorldToTileX:i(10095),WorldToTileXY:i(85896),WorldToTileY:i(63288)}},91907:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(t,e,i)=>{var s={ORIENTATION:i(91907)};t.exports=s},62501:(t,e,i)=>{var s=i(79291),n=i(21829),r={Components:i(81086),Parsers:i(57442),Formats:i(80341),ImageCollection:i(16536),ParseToTilemap:i(31989),Tile:i(23029),Tilemap:i(49075),TilemapCreator:i(45939),TilemapFactory:i(46029),Tileset:i(33629),TilemapLayer:i(20442),Orientation:i(91907),LayerData:i(14977),MapData:i(87010),ObjectLayer:i(48700)};r=s(!1,r,n.ORIENTATION),t.exports=r},14977:(t,e,i)=>{var s=i(83419),n=i(91907),r=i(95540),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.id=r(t,"id",0),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=o},87010:(t,e,i)=>{var s=i(83419),n=i(91907),r=i(95540),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=o},48700:(t,e,i)=>{var s=i(83419),n=i(95540),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.id=n(t,"id",0),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});t.exports=r},6641:(t,e,i)=>{var s=i(91907);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},46177:(t,e,i)=>{var s=i(80341),n=i(2342),r=i(82593),o=i(46594),a=i(87021);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},2342:(t,e,i)=>{var s=i(80341),n=i(14977),r=i(87010),o=i(23029);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p{var s=i(80341),n=i(2342);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},6656:(t,e,i)=>{var s=i(14977),n=i(23029);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,f,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},96483:(t,e,i)=>{var s=i(33629);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(80341),n=i(87010),r=i(6656),o=i(96483);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},52833:(t,e,i)=>{t.exports={ParseTileLayers:i(6656),ParseTilesets:i(96483),ParseWeltmeister:i(87021)}},57442:(t,e,i)=>{t.exports={FromOrientationString:i(6641),Parse:i(46177),Parse2DArray:i(2342),ParseCSV:i(82593),Impact:i(52833),Tiled:i(96761)}},51233:(t,e,i)=>{var s=i(79291);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},84101:(t,e,i)=>{var s=i(33629);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(95540);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},29920:t=>{t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),s=Boolean(536870912&t);t&=536870911;var n=0,r=!1;return e&&i&&s?(n=Math.PI/2,r=!0):e&&i&&!s?(n=Math.PI,r=!1):e&&!i&&s?(n=Math.PI/2,r=!1):!e||i||s?!e&&i&&s?(n=3*Math.PI/2,r=!1):e||!i||s?e||i||!s?e||i||s||(n=0,r=!1):(n=3*Math.PI/2,r=!0):(n=Math.PI,r=!0):(n=0,r=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:s,rotation:n,flipped:r}}},12635:(t,e,i)=>{var s=i(95540),n=i(79677);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},46594:(t,e,i)=>{var s=i(51233),n=i(84101),r=i(91907),o=i(62644),a=i(80341),h=i(6641),l=i(87010),u=i(12635),c=i(22611),d=i(28200),f=i(24619);t.exports=function(t,e,i){var p=o(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:a.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});g.orientation===r.HEXAGONAL&&(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex),g.layers=d(p,i),g.images=u(p);var v=f(p);return g.tilesets=v.tilesets,g.imageCollections=v.imageCollections,g.objects=c(p),g.tiles=n(g),s(g),g}},52205:(t,e,i)=>{var s=i(18254),n=i(29920),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},22611:(t,e,i)=>{var s=i(95540),n=i(52205),r=i(48700),o=i(79677);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(41868),n=i(91907),r=i(79677),o=i(6641),a=i(95540),h=i(14977),l=i(29920),u=i(23029);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],f=r(t);f.i0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(v,m.gid,O,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][O]=y):(x=e?null:new u(v,-1,O,F,t.tilewidth,t.tileheight),T[F][O]=x),++w===_.width&&(P++,w=0)}}else{(v=new h({name:f.name+p.name,id:p.id,x:f.x+a(p,"offsetx",0)+p.x,y:f.y+a(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:a(p,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(v.hexSideLength=t.hexsidelength,v.staggerAxis=t.staggeraxis,v.staggerIndex=t.staggerindex);for(var D=[],k=0,I=p.data.length;k0?((y=new u(v,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(v,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===p.width&&(T.push(D),w=0,D=[])}v.data=T,c.push(v)}else if("group"===p.type){var B=r(t,p,f);d.push(f),f=B}}return c}},24619:(t,e,i)=>{var s=i(33629),n=i(16536),r=i(52205),o=i(57880);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(51233),Base64Decode:i(41868),BuildTilesetIndex:i(84101),CreateGroupLayer:i(79677),ParseGID:i(29920),ParseImageLayers:i(12635),ParseJSONTiled:i(46594),ParseObject:i(52205),ParseObjectLayers:i(22611),ParseTileLayers:i(28200),ParseTilesets:i(24619)}},33385:(t,e,i)=>{var s=i(83419),n=i(37277),r=i(44594),o=i(94880),a=i(72905),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(83419),n=i(50792),r=i(39429),o=i(95540),a=i(44594),h=i(89809),l=new s({Extends:n,initialize:function(t,e){n.call(this),this.scene=t,this.systems=t.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var i=this.systems.events;i.on(a.PRE_UPDATE,this.preUpdate,this),i.on(a.UPDATE,this.update,this),i.once(a.SHUTDOWN,this.destroy,this),e&&this.add(e)},preUpdate:function(t,e){this.paused||(this.elapsed+=e)},update:function(){if(!this.paused&&!this.complete){var t,e,i=this.events,s=!1,n=this.systems;for(t=0;t=i.length&&(0!==this.loop&&(-1===this.loop||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){return this.paused=!0,this},repeat:function(t){return void 0!==t&&!0!==t||(t=-1),!1===t&&(t=0),this.loop=t,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(t){void 0===t&&(t=!1),this.elapsed=0,t||(this.iteration=0);for(var e=0;e0&&(i=e[e.length-1].time);for(var s=0;s{var s=i(83419),n=i(95540),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){if(this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,0===this.delay&&(this.repeat>0||this.loop))throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},35945:t=>{t.exports="complete"},89809:(t,e,i)=>{t.exports={COMPLETE:i(35945)}},90291:(t,e,i)=>{t.exports={Clock:i(33385),Events:i(89809),Timeline:i(96120),TimerEvent:i(94880)}},40382:(t,e,i)=>{var s=i(72905),n=i(83419),r=i(43491),o=i(88032),a=i(37277),h=i(44594),l=i(93109),u=i(86081),c=i(8357),d=i(43960),f=i(26012),p=new n({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=o(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(a,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},6113:(t,e,i)=>{var s=i(62640),n=i(35355);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var o=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===o?r="easeIn":"out"===o?r="easeOut":"inout"===o&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},91389:(t,e,i)=>{var s=i(89318),n=i(77259),r={bezier:s,catmull:n,catmullrom:n,linear:i(28392)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},55292:t=>{t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},82985:(t,e,i)=>{var s=i(81076);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},62329:(t,e,i)=>{var s=i(35154);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},17777:(t,e,i)=>{var s=i(30976),n=i(99472);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function o(t){return!!t.getStart&&"function"==typeof t.getStart}function a(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,f=typeof e;if("number"===f)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===f){var p=e.toLowerCase(),g="random"===p.substring(0,6),v="int"===p.substring(0,3);if(g||v){var m=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(m&&y&&x))throw new Error("invalid random() format");var T=parseFloat(p.substring(m+1,x)),w=parseFloat(p.substring(x+1,y));u=g?function(){return n(T,w)}:function(){return s(T,w)}}else{p=p[0];var b=parseFloat(e.substr(2));switch(p){case"+":u=function(t,e,i){return i+b};break;case"-":u=function(t,e,i){return i-b};break;case"*":u=function(t,e,i){return i*b};break;case"/":u=function(t,e,i){return i/b};break;default:u=function(){return parseFloat(e)}}}}else if("function"===f)u=e;else if("object"===f)if(o(l=e)||a(l)||r(l))r(e)&&(d=e.getActive),a(e)&&(u=e.getEnd),o(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var E=e.hasOwnProperty("to"),S=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(E&&(S||A)){if(i=h(t,e.to),A){var _=h(t,e.start);i.getActive=_.getEnd}if(S){var C=h(t,e.from);i.getStart=C.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},88032:(t,e,i)=>{var s=i(70402),n=i(69902),r=i(23568),o=i(57355),a=i(6113),h=i(55292),l=i(35154),u=i(17777),c=i(269),d=i(86081);t.exports=function(t,e,i){if(e instanceof d)return e.parent=t,e;i=void 0===i?n:c(n,i);var f=l(e,"from",0),p=l(e,"to",1),g=[{value:f}],v=l(e,"delay",i.delay),m=l(e,"easeParams",i.easeParams),y=l(e,"ease",i.ease),x=u("value",p),T=new d(t,g),w=T.add(0,"value",x.getEnd,x.getStart,x.getActive,a(l(e,"ease",y),l(e,"easeParams",m)),h(e,"delay",v),l(e,"duration",i.duration),o(e,"yoyo",i.yoyo),l(e,"hold",i.hold),l(e,"repeat",i.repeat),l(e,"repeatDelay",i.repeatDelay),!1,!1);w.start=f,w.current=f,T.completeDelay=r(e,"completeDelay",0),T.loop=Math.round(r(e,"loop",0)),T.loopDelay=Math.round(r(e,"loopDelay",0)),T.paused=o(e,"paused",!1),T.persist=o(e,"persist",!1),T.callbackScope=l(e,"callbackScope",T);for(var b=s.TYPES,E=0;E{var s=i(6113),n=i(35154),r=i(36383);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,f="number"==typeof l,p=Array.isArray(t),g=p?parseFloat(t[0]):parseFloat(t),v=p?parseFloat(t[1]):0,m=Math.max(g,v);if(p&&(o+=g),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):f?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=M),S[_][C]=M}}}var P=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(70402),n=i(69902),r=i(23568),o=i(57355),a=i(6113),h=i(91389),l=i(55292),u=i(82985),c=i(62329),d=i(35154),f=i(17777),p=i(269),g=i(86081);t.exports=function(t,e,i){if(e instanceof g)return e.parent=t,e;i=void 0===i?n:p(n,i);var v=c(e);!v&&i.targets&&(v=i.targets);for(var m=u(e),y=d(e,"delay",i.delay),x=d(e,"duration",i.duration),T=d(e,"easeParams",i.easeParams),w=d(e,"ease",i.ease),b=d(e,"hold",i.hold),E=d(e,"repeat",i.repeat),S=d(e,"repeatDelay",i.repeatDelay),A=o(e,"yoyo",i.yoyo),_=o(e,"flipX",i.flipX),C=o(e,"flipY",i.flipY),M=d(e,"interpolation",i.interpolation),P=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")?(n=s.value,Array.isArray(s.value)?(n=s.value[0],r=s.value[1]):"string"==typeof s.value&&(n=s.value)):"string"==typeof s&&(n=s),t.addFrame(e,n,r,l(s,"delay",y),d(s,"duration",x),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C))}else{var u=f(i,s),c=h(d(s,"interpolation",M));t.add(e,i,u.getEnd,u.getStart,u.getActive,a(d(s,"ease",w),d(s,"easeParams",T)),l(s,"delay",y),d(s,"duration",x),o(s,"yoyo",A),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C),c,c?s:null)}},R=new g(t,v),L=0;L{var s=i(70402),n=i(23568),r=i(57355),o=i(62329),a=i(35154),h=i(8357),l=i(43960);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=a(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",a(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",a(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!1),u.callbackScope=a(e,"callbackScope",u);var c=s.TYPES;for(i=0;i{t.exports={GetBoolean:i(57355),GetEaseFunction:i(6113),GetInterpolationFunction:i(91389),GetNewValue:i(55292),GetProps:i(82985),GetTargets:i(62329),GetValueOp:i(17777),NumberTweenBuilder:i(88032),StaggerBuilder:i(93109),TweenBuilder:i(8357)}},73685:t=>{t.exports="active"},98540:t=>{t.exports="complete"},67233:t=>{t.exports="loop"},2859:t=>{t.exports="pause"},98336:t=>{t.exports="repeat"},25764:t=>{t.exports="resume"},32193:t=>{t.exports="start"},84371:t=>{t.exports="stop"},70766:t=>{t.exports="update"},55659:t=>{t.exports="yoyo"},842:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(73685),TWEEN_COMPLETE:i(98540),TWEEN_LOOP:i(67233),TWEEN_PAUSE:i(2859),TWEEN_RESUME:i(25764),TWEEN_REPEAT:i(98336),TWEEN_START:i(32193),TWEEN_STOP:i(84371),TWEEN_UPDATE:i(70766),TWEEN_YOYO:i(55659)}},43066:(t,e,i)=>{var s={States:i(86353),Builders:i(30231),Events:i(842),TweenManager:i(40382),Tween:i(86081),TweenData:i(48177),TweenFrameData:i(42220),BaseTween:i(70402),TweenChain:i(43960)};t.exports=s},70402:(t,e,i)=>{var s=i(83419),n=i(50792),r=i(842),o=i(86353),a=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});a.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=a},95042:(t,e,i)=>{var s=i(83419),n=i(842),r=i(86353),o=new s({initialize:function(t,e,i,s,n,r,o,a,h,l){this.tween=t,this.targetIndex=e,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=o,this.repeatDelay=a,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=r.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=r.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=r.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=r.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=r.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=r.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=r.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=r.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===r.CREATED},isDelayed:function(){return this.state===r.DELAY},isPendingRender:function(){return this.state===r.PENDING_RENDER},isPlayingForward:function(){return this.state===r.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===r.PLAYING_BACKWARD},isHolding:function(){return this.state===r.HOLD_DELAY},isRepeating:function(){return this.state===r.REPEAT_DELAY},isComplete:function(){return this.state===r.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],n=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,n,0,i,e,t),this.repeatCounter=-1===this.repeat?r.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var a=o+this.repeatDelay;this.totalDuration=this.delay+o,-1===this.repeat?(this.totalDuration+=a*r.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=a*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,r=s.totalTargets,o=this.targetIndex,a=s.targets[o],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&a.toggleFlipX(),this.flipY&&a.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(a,h,this.start,o,r,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(n.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(a,h,this.start,o,r,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,a[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(n.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=o},69902:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},81076:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},86081:(t,e,i)=>{var s=i(70402),n=i(83419),r=i(842),o=i(44603),a=i(39429),h=i(36383),l=i(86353),u=i(48177),c=i(42220),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0},add:function(t,e,i,s,n,r,o,a,h,l,c,d,f,p,g,v){var m=new u(this,t,e,i,s,n,r,o,a,h,l,c,d,f,p,g,v);return this.totalData=this.data.push(m),m},addFrame:function(t,e,i,s,n,r,o,a,h,l){var u=new c(this,t,e,i,s,n,r,o,a,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var n=Math.floor(t/e),o=t-n*e,a=0;a0&&this.update(o)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?s+n+(s+o)*r:s+n},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s{var s=i(72905),n=i(70402),r=i(83419),o=i(842),a=i(44603),h=i(39429),l=i(86353),u=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive"),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i{var s=i(95042),n=i(45319),r=i(83419),o=i(842),a=new r({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c,d,f,p,g,v,m){s.call(this,t,e,h,l,u,c,d,f,p,g),this.key=i,this.getActiveValue=o,this.getEndValue=n,this.getStartValue=r,this.ease=a,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=v,this.interpolationData=m},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex],i=this.key;t&&(e[i]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(e[i]=this.getActiveValue(e,i,0))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,r=e.targets[s],a=this.key;if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(r,a,r[a],s,i,e),this.end=this.getEndValue(r,a,this.start,s,i,e),this.current=this.start,r[a]=this.start,this.setPlayingForwardState(),!0;var h=this.isPlayingForward(),l=this.isPlayingBackward();if(h||l){var u=this.elapsed,c=this.duration,d=0,f=!1;(u+=t)>=c?(d=u-c,u=c,f=!0):u<0&&(u=0);var p=n(u/c,0,1);if(this.elapsed=u,this.progress=p,this.previous=this.current,f)h?(this.current=this.end,r[a]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(d)):(this.current=this.start,r[a]=this.start,this.setStateFromStart(d));else{h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,r[a]=this.current}this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,o=this.previous;i.emit(t,i,n,s,r,o);var a=i.callbacks[e];a&&a.func.apply(i.callbackScope,[i,s,n,r,o].concat(a.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=a},42220:(t,e,i)=>{var s=i(95042),n=i(45319),r=i(83419),o=i(842),a=new r({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c){s.call(this,t,e,r,o,!1,a,h,l,u,c),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var r=this.isPlayingForward(),a=this.isPlayingBackward();if(r||a){var h=this.elapsed,l=this.duration,u=0,c=!1;(h+=t)>=l?(u=h-l,h=l,c=!0):h<0&&(h=0);var d=n(h/l,0,1);this.elapsed=h,this.progress=d,c&&(r?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key;i.emit(t,i,n,s);var r=i.callbacks[e];r&&r.func.apply(i.callbackScope,[i,s,n].concat(r.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=a},86353:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},83419:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},20242:t=>{t.exports=function(){return null}},71146:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},66905:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(82011);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},43491:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(82011);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},85835:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},83371:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},69693:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},40853:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},593:(t,e,i)=>{var s=i(2284);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(n-l*c/h+d)),p=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,f,p,a)}var g=t[n],v=r,m=o;for(e(t,r,n),a(t[o],g)>0&&e(t,r,o);v0;)m--}0===a(t[r],g)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},88492:(t,e,i)=>{var s=i(35154),n=i(33680),r=function(t,e,i){for(var s=[],n=0;n{var s=i(19133);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},60248:(t,e,i)=>{var s=i(19133);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},81409:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(19133);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},42169:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},86003:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},89545:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},17810:(t,e,i)=>{var s=i(82011);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},90126:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},19133:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{var s=i(82264);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},37105:(t,e,i)=>{t.exports={Matrix:i(54915),Add:i(71146),AddAt:i(51067),BringToTop:i(66905),CountAllMatching:i(21612),Each:i(95428),EachInRange:i(36914),FindClosestInSorted:i(81957),Flatten:i(43491),GetAll:i(46710),GetFirst:i(58731),GetRandom:i(26546),MoveDown:i(70864),MoveTo:i(69693),MoveUp:i(40853),MoveAbove:i(85835),MoveBelow:i(83371),NumberArray:i(20283),NumberArrayStep:i(593),QuickSelect:i(43886),Range:i(88492),Remove:i(72905),RemoveAt:i(60248),RemoveBetween:i(81409),RemoveRandomElement:i(31856),Replace:i(42169),RotateLeft:i(86003),RotateRight:i(49498),SafeRange:i(82011),SendToBack:i(89545),SetAll:i(17810),Shuffle:i(33680),SortByDigits:i(90126),SpliceOne:i(19133),StableSort:i(19186),Swap:i(25630)}},86922:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(41836),n=i(86922);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},21224:t=>{t.exports=function(t){for(var e=0;e{var s=i(37829);t.exports=function(t){return s(t,180)}},44657:(t,e,i)=>{var s=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i{var s=i(86922),n=i(2429);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(37829);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i{var s=i(86003),n=i(49498);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},54915:(t,e,i)=>{t.exports={CheckMatrix:i(86922),MatrixToString:i(63362),ReverseColumns:i(92598),ReverseRows:i(21224),Rotate180:i(98717),RotateLeft:i(44657),RotateMatrix:i(37829),RotateRight:i(92632),Translate:i(69512),TransposeMatrix:i(2429)}},71334:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},53134:t=>{for(var e=new Uint8Array(256),i=0;i<64;i++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(i)]=i;t.exports=function(t){var i,s,n,r,o=(t=t.substr(t.indexOf(",")+1)).length,a=.75*o,h=0;"="===t[o-1]&&(a--,"="===t[o-2]&&a--);for(var l=new ArrayBuffer(a),u=new Uint8Array(l),c=0;c>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},65839:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(71334),Base64ToArrayBuffer:i(53134)}},91799:(t,e,i)=>{t.exports={Array:i(37105),Base64:i(65839),Objects:i(1183),String:i(31749),NOOP:i(29747),NULL:i(20242)}},41786:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},62644:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},79291:(t,e,i)=>{var s=i(41212),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(75508),n=i(35154);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},95540:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},82840:(t,e,i)=>{var s=i(35154),n=i(45319);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},35154:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,o=s,a=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},41212:t=>{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},46975:(t,e,i)=>{var s=i(41786);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},269:(t,e,i)=>{var s=i(41786);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},18254:(t,e,i)=>{var s=i(97022);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(41786),DeepCopy:i(62644),Extend:i(79291),GetAdvancedValue:i(23568),GetFastValue:i(95540),GetMinMaxValue:i(82840),GetValue:i(35154),HasAll:i(69036),HasAny:i(1985),HasValue:i(97022),IsPlainObject:i(41212),Merge:i(46975),MergeRight:i(269),Pick:i(18254),SetValue:i(61622)}},27902:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},41836:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},33628:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},27671:t=>{t.exports=function(t){return t.split("").reverse().join("")}},45650:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},35355:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},31749:(t,e,i)=>{t.exports={Format:i(27902),Pad:i(41836),RemoveAt:i(33628),Reverse:i(27671),UppercaseFirst:i(35355),UUID:i(45650)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(85454)})(),t.exports=e()},260:(t,e,i)=>{"use strict";i.d(e,{Ps:()=>Io,Vb:()=>mh});var s="undefined"!=typeof self?self:{};function n(t){t:{for(var e=["CLOSURE_FLAGS"],i=s,n=0;ne)s[i++]=e;else{if(2048>e)s[i++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&n=r){e=1024*(e-55296)+r-56320+65536,s[i++]=e>>18|240,s[i++]=e>>12&63|128,s[i++]=e>>6&63|128,s[i++]=63&e|128;continue}n--}e=65533}s[i++]=e>>12|224,s[i++]=e>>6&63|128}s[i++]=63&e|128}}t=i===s.length?s:s.subarray(0,i)}return t}var f,p=n(610401301),g=n(188588736);const v=s.navigator;function m(t){return!!p&&!!f&&f.brands.some((({brand:e})=>e&&-1!=e.indexOf(t)))}function y(t){var e;return(e=s.navigator)&&(e=e.userAgent)||(e=""),-1!=e.indexOf(t)}function x(){return!!p&&!!f&&0i;i++){var s=t.concat(e[i].split(""));b[i]=s;for(var n=0;n>2];n=e[(3&n)<<4|r>>4],r=e[(15&r)<<2|o>>6],o=e[63&o],i[l++]=a+n+r+o}switch(a=0,o=s,t.length-h){case 2:o=e[(15&(a=t[h+1]))<<2]||s;case 1:t=t[h],i[l]=e[t>>2]+e[(3&t)<<4|a>>4]+o+s}return i.join("")}for(e="",i=0,s=t.length-10240;i>4),64!=o&&(e(r<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){s[n++]=t})),n!==i?s.subarray(0,n):s}(t);M.test(t)&&(t=t.replace(M,R)),t=atob(t);const e=new Uint8Array(t.length);for(let i=0;i ${t}`)}function V(t){if("string"==typeof t)return{buffer:L(t),N:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),N:!1};if(t.constructor===Uint8Array)return{buffer:t,N:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),N:!1};if(t.constructor===X)return{buffer:U(t)||D(),N:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),N:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function W(){return"function"==typeof BigInt}const H="function"==typeof Uint8Array.prototype.slice;let j,K=0,q=0;function Z(t){const e=0>t;let i=(t=Math.abs(t))>>>0;if(t=Math.floor((t-i)/4294967296),e){const[e,s]=nt(i,t);t=s,i=e}K=i>>>0,q=t>>>0}function J(t){const e=j||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,K=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function $(t,e){const i=2147483648&e;return i&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),i?-t:t}function tt(t,e){if(t>>>=0,2097151>=(e>>>=0))var i=""+(4294967296*e+t);else W()?i=""+(BigInt(e)<>>24|e<<8))+6710656*(e=e>>16&65535),i+=8147497*e,e*=2,1e7<=t&&(i+=Math.floor(t/1e7),t%=1e7),1e7<=i&&(e+=Math.floor(i/1e7),i%=1e7),i=e+et(i)+et(t));return i}function et(t){return t=String(t),"0000000".slice(t.length)+t}function it(){var t=K,e=q;if(2147483648&e)if(W())t=""+(BigInt(0|e)<>>0));else{const[i,s]=nt(t,e);t="-"+tt(i,s)}else t=tt(t,e);return t}function st(t){if(16>t.length)Z(Number(t));else if(W())t=BigInt(t),K=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=K=0;const i=t.length;for(let s=e,n=(i-e)%6+e;n<=i;s=n,n+=6){const e=Number(t.slice(s,n));q*=1e6,K=1e6*K+e,4294967296<=K&&(q+=Math.trunc(K/4294967296),q>>>=0,K>>>=0)}if(e){const[t,e]=nt(K,q);K=t,q=e}}}function nt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function rt(t,e){let i,s=0,n=0,r=0;const o=t.h;let a=t.g;do{i=o[a++],s|=(127&i)<r&&128&i);for(32>4),r=3;32>r&&128&i;r+=7)i=o[a++],n|=(127&i)<i)return e(s>>>0,n>>>0);throw z()}function ot(t){let e=0,i=t.g;const s=i+10,n=t.h;for(;i>>0}function lt(t){var e=t.h;const i=t.g,s=e[i],n=e[i+1],r=e[i+2];return e=e[i+3],ft(t,t.g+4),(s<<0|n<<8|r<<16|e<<24)>>>0}function ut(t){var e=lt(t);t=2*(e>>31)+1;const i=e>>>23&255;return e&=8388607,255==i?e?NaN:1/0*t:0==i?t*Math.pow(2,-149)*e:t*Math.pow(2,i-150)*(e+Math.pow(2,23))}function ct(t){return at(t)}function dt(t,e,{ca:i=!1}={}){t.ca=i,e&&(e=V(e),t.h=e.buffer,t.m=e.N,t.j=0,t.l=t.h.length,t.g=t.j)}function ft(t,e){if(t.g=e,e>t.l)throw G(t.l,e)}function pt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,s=i+e;if(s>t.l)throw G(e,t.l-i);return t.g=s,i}function gt(t,e){if(0==e)return N();var i=pt(t,e);return t.ca&&t.m?i=t.h.subarray(i,i+e):(t=t.h,i=i===(e=i+e)?D():H?t.slice(i,e):new Uint8Array(t.subarray(i,e))),0==i.length?N():new X(i,k)}var vt=[];function mt(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=ht(t.g);if(e=i>>>3,!(0<=(i&=7)&&5>=i))throw Y(i,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=i,!0}function yt(t){switch(t.h){case 0:0!=t.h?yt(t):ot(t.g);break;case 1:ft(t=t.g,t.g+8);break;case 2:if(2!=t.h)yt(t);else{var e=ht(t.g);ft(t=t.g,t.g+e)}break;case 5:ft(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!mt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}yt(t)}break;default:throw Y(t.h,t.l)}}function xt(t,e,i){const s=t.g.l,n=ht(t.g),r=t.g.g+n;let o=r-s;if(0>=o&&(t.g.l=r,i(e,t,void 0,void 0,void 0),o=r-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=r,t.g.l=s,e}function Tt(t){var e=ht(t.g),i=pt(t=t.g,e);if(t=t.h,l){var s,n=t;(s=h)||(s=h=new TextDecoder("utf-8",{fatal:!0})),e=i+e,n=0===i&&e===n.length?n:n.subarray(i,e);try{var u=s.decode(n)}catch(t){if(void 0===a){try{s.decode(new Uint8Array([128]))}catch(t){}try{s.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(h=void 0),t}}else{e=(u=i)+e,i=[];let a,h=null;for(;uc?i.push(c):224>c?u>=e?r():(a=t[u++],194>c||128!=(192&a)?(u--,r()):i.push((31&c)<<6|63&a)):240>c?u>=e-1?r():(a=t[u++],128!=(192&a)||224===c&&160>a||237===c&&160<=a||128!=(192&(s=t[u++]))?(u--,r()):i.push((15&c)<<12|(63&a)<<6|63&s)):244>=c?u>=e-2?r():(a=t[u++],128!=(192&a)||0!=a-144+(c<<28)>>30||128!=(192&(s=t[u++]))||128!=(192&(n=t[u++]))?(u--,r()):(c=(7&c)<<18|(63&a)<<12|(63&s)<<6|63&n,c-=65536,i.push(55296+(c>>10&1023),56320+(1023&c)))):r(),8192<=i.length&&(h=o(h,i),i.length=0)}u=o(h,i)}return u}function wt(t){const e=ht(t.g);return gt(t.g,e)}function bt(t,e,i){var s=ht(t.g);for(s=t.g.g+s;t.g.g>>0,this.g=e>>>0}};let _t;function Ct(t){return t?/^-?\d+$/.test(t)?(st(t),new Mt(K,q)):null:Pt||=new Mt(0,0)}var Mt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Pt;function Rt(t,e,i){for(;0>>7|i<<25)>>>0,i>>>=7;t.g.push(e)}function Lt(t,e){for(;127>>=7;t.g.push(e)}function Ot(t,e){if(0<=e)Lt(t,e);else{for(let i=0;9>i;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Ft(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Dt(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function kt(t,e,i){Lt(t.g,8*e+i)}function It(t,e){return kt(t,e,2),e=t.g.end(),Dt(t,e),e.push(t.h),e}function Bt(t,e){var i=e.pop();for(i=t.h+t.g.length()-i;127>>=7,t.h++;e.push(i),t.h++}function Nt(t,e,i){kt(t,e,2),Lt(t.g,i.length),Dt(t,t.g.end()),Dt(t,i)}function Ut(t,e,i,s){null!=i&&(e=It(t,e),s(i,t),Bt(t,e))}class Xt{constructor(t,e,i,s){this.g=t,this.h=e,this.l=i,this.pa=s}}function Yt(t){return Array.prototype.slice.call(t)}function zt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var Gt=zt(),Vt=zt("0di"),Wt=Gt?(t,e)=>{t[Gt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Ht=Gt?(t,e)=>{t[Gt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)};function jt(t,e,i){return i?t|e:t&~e}var Kt=Gt?t=>0|t[Gt]:t=>0|t.g,qt=Gt?t=>t[Gt]:t=>t.g,Zt=Gt?(t,e)=>(t[Gt]=e,t):(t,e)=>(void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}}),t);function Jt(t){return Wt(t,34),t}function Qt(t,e){Zt(e,-14591&(0|t))}function $t(t,e){Zt(e,-14557&(34|t))}function te(t){return 0==(t=t>>14&1023)?536870912:t}var ee,ie={},se={};function ne(t){return!(!t||"object"!=typeof t||t.Ja!==se)}function re(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function oe(t,e,i){if(null!=t)if("string"==typeof t)t=t?new X(t,k):N();else if(t.constructor!==X)if(O(t))t=t.length?new X(i?t:new Uint8Array(t),k):N();else{if(!e)throw Error();t=void 0}return t}function ae(t,e,i){if(!Array.isArray(t)||t.length)return!1;const s=Kt(t);return!!(1&s)||!(!e||!(Array.isArray(e)?e.includes(i):e.has(i)))&&(Zt(t,1|s),!0)}const he=[];function le(t){if(2&t)throw Error()}Zt(he,55),ee=Object.freeze(he);class ue{constructor(t,e,i){this.l=0,this.g=t,this.h=e,this.m=i}next(){if(this.l>>0:void 0}function we(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function be(t){return"-"===t[0]?20>t.length||20===t.length&&-922337t.length||19===t.length&&922337>Number(t.substring(0,6))}function Ee(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Z(t),t=$(K,q)),t}function Se(t){var e=Math.trunc(Number(t));return Number.isSafeInteger(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),be(t)||(st(t),t=it()),t)}function Ae(t){return null==t?t:ye(t)?"number"==typeof t?Ee(t):Se(t):void 0}function _e(t){if("string"!=typeof t)throw Error();return t}function Ce(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Me(t){return null==t||"string"==typeof t?t:void 0}function Pe(t,e,i,s){if(null!=t&&"object"==typeof t&&t.X===ie)return t;if(!Array.isArray(t))return i?2&s?(t=e[Vt])?e=t:(Jt((t=new e).u),e=e[Vt]=t):e=new e:e=void 0,e;let n=i=Kt(t);return 0===n&&(n|=32&s),n|=2&s,n!==i&&Zt(t,n),new e(t)}function Re(t,e,i){if(e){var s=!!s;if(!ye(e=t))throw pe("int64");"string"==typeof e?s=Se(e):s?(s=Math.trunc(e),Number.isSafeInteger(s)?s=String(s):be(e=String(s))?s=e:(Z(s),s=it())):s=Ee(e)}else s=Ae(t);return"string"==typeof(i=null==(t=s)?i?0:void 0:t)&&(s=+i,Number.isSafeInteger(s))?s:i}let Le,Oe,Fe;function De(t){switch(typeof t){case"boolean":return Oe||=[0,void 0,!0];case"number":return 0{t.call(e,this.get(s),s,this)}))}set(t,e){return ze(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Z(e,!0,!0,this.U,!1,this.L))}Oa(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.U?void 0===t?null:t:this.Z(t,!1,!0,void 0,!1,this.L),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(void 0!==e){var i=this.U;return i?((i=this.Z(e,!1,!0,i,this.ta,this.L))!==e&&super.set(t,i),i):e}}na(){return Array.from(super.keys())}Ia(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Ve(t,e,i,s,n,r){return t=Pe(t,s,i,r),n&&(t=ii(t)),t}function We(t){return t}function He(t){return[t,this.get(t)]}let je;function Ke(){return je||=new Ge(Jt([]),void 0,void 0,void 0,Be)}function qe(t,e,i,s,n){if(null!=t){if(Array.isArray(t))t=ae(t,void 0,0)?void 0:n&&2&Kt(t)?t:Ze(t,e,i,void 0!==s,n);else if(re(t)){const r={};for(let o in t)r[o]=qe(t[o],e,i,s,n);t=r}else t=e(t,s);return t}}function Ze(t,e,i,s,n){const r=s||i?Kt(t):0;s=s?!!(32&r):void 0;const o=Yt(t);for(let t=0;t$e(t,n,s))),Wt(t,32|(i?2:0)),t}function ii(t){const e=t.u,i=qt(e);return 2&i?ti(t,e,i,!1):t}function si(t,e){return ni(t=t.u,qt(t),e)}function ni(t,e,i,s){if(-1===i)return null;if(i>=te(e)){if(256&e)return t[t.length-1][i]}else{var n=t.length;if(s&&256&e&&null!=(s=t[n-1][i]))return s;if((e=i+(+!!(512&e)-1))=r||n){let o=e;if(256&e)n=t[t.length-1];else{if(null==s)return o;n=t[r+(+!!(512&e)-1)]={},o|=256}return n[i]=s,in(t,e,s):(t,e)=>{for(;mt(e)&&4!=e.h;){var n=e.m,r=s[n];if(!r){var o=s.ea;o&&(o=o[n])&&(r=s[n]=Vi(o))}r&&r(e,t,n)||(n=(r=e).l,yt(r),r.ia?r=void 0:(o=r.g.g-n,r.g.g=n,r=gt(r.g,o)),n=t,r&&(ce||=Symbol(),(o=n[ce])?o.push(r):n[ce]=[r]))}i===Hi||i===ji||i.j||(t[de||=Symbol()]=i)},t[zi]=e}return e}function Vi(t){const e=(t=Xi(t))[0].g;if(t=t[1]){const i=Gi(t),s=ls(t).T;return(t,n,r)=>e(t,n,r,s,i)}return e}class Wi{}let Hi,ji;const Ki=Symbol();function qi(t,e,i){const s=i[1];let n;if(s){const i=s[Ki];n=i?i.T:De(s[0]),t[e]=i??s}n&&n===Oe?(t.g||(t.g=new Set)).add(e):i[0]&&(t.h||(t.h=new Set)).add(e)}function Zi(t,e){return[t.l,!e||0o&&(u-=o,o=t[++r]);hds(t,e,i),t[ts]=e}return e}const is=Symbol();function ss(t){return t.h}function ns(t,e){let i,s;const n=t.h;return(t,r,o)=>n(t,r,o,s||=rs(e).T,i||=es(e))}function rs(t){let e=t[is];return e||(e=$i(t,t[is]={},ss,ns),us(t),e)}const os=Symbol();function as(t,e){const i=t.g;return e?(t,s,n)=>i(t,s,n,e):i}function hs(t,e,i){const s=t.g;let n,r;return(t,o,a)=>s(t,o,a,r||=ls(e).T,n||=Gi(e),i)}function ls(t){let e=t[os];return e||(Ji(t),e=$i(t,t[os]={},as,hs),us(t),e)}function us(t){os in t&&Ki in t&&is in t&&(t.length=0)}function cs(t,e){var i=t[e];if(i)return i;if((i=t.ea)&&(i=i[e])){var s=(i=Xi(i))[0].h;if(i=i[1]){const e=es(i),n=rs(i).T;i=(i=t.m)?i(n,e):(t,i,r)=>s(t,i,r,n,e)}else i=s;return t[e]=i}}function ds(t,e,i){for(var s=qt(t),n=+!!(512&s)-1,r=t.length,o=512&s?1:0,a=r+(256&s?-1:0);o{Ut(t,i,ke([r,e],s),n)}));else if(Array.isArray(e))for(let r=0;r>31)+1;const r=n>>>20&2047;return t=4294967296*(1048575&n)+t,vs(e,i,2047==r?t?NaN:1/0*s:0==r?s*Math.pow(2,-1074)*t:s*Math.pow(2,r-1075)*(t+4503599627370496)),!0}),(function(t,e,i){null!=(e=ge(e))&&(kt(t,i,1),t=t.g,(i=j||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),K=i.getUint32(0,!0),q=i.getUint32(4,!0),Ft(t,K),Ft(t,q))})),Cs=fs((function(t,e,i){return 5===t.h&&(vs(e,i,ut(t.g)),!0)}),(function(t,e,i){null!=(e=ge(e))&&(kt(t,i,5),t=t.g,J(e),Ft(t,K))})),Ms=ps(Ss,(function(t,e,i){if(null!=(e=Yi(ge,e)))for(let o=0;ot){Z(t);const e=tt(K,q);return t=Number(e),Number.isSafeInteger(t)?t:e}return we(String(t))?t:(Z(t),Q(K,q))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&St(e),null!=e&&(kt(t,i,0),"number"==typeof e?(t=t.g,Z(e),Rt(t,K,q)):(i=St(e),Rt(t.g,i.h,i.g))))})),Fs=fs((function(t,e,i){return 0===t.h&&(vs(e,i,at(t.g)),!0)}),xs),Ds=ps((function(t,e,i){return(0===t.h||2===t.h)&&(e=ai(e,qt(e),i,2,!1),2==t.h?bt(t,at,e):e.push(at(t.g)),!0)}),(function(t,e,i){if(null!=(e=Yi(xe,e))&&e.length){i=It(t,i);for(let i=0;i{t:{if(Et.length){const t=Et.pop();t.o(s),dt(t.g,i,s),i=t}else i=new class{constructor(t,e){if(vt.length){const i=vt.pop();dt(i,t,e),t=i}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,dt(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ia:t=!1}={}){this.ia=t}}(i,s);try{const s=new t,r=s.u;Gi(e)(r,i);var n=s;break t}finally{i.g.clear(),i.m=-1,i.h=-1,100>Et.length&&Et.push(i)}n=void 0}return n}}function Js(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};ds(this.u,e,rs(t)),Dt(e,e.g.end());const i=new Uint8Array(e.h),s=e.l,n=s.length;let r=0;for(let t=0;t({index:Oi(Ri(t,1))??-1,score:Fi(t,2)??0,categoryName:Li(t,3)??""??"",displayName:Li(t,4)??""??""}))),headIndex:e,headName:i}}function Co(t){var e=ui(t,3,ge),i=ui(t,2,xe),s=ui(t,1,Me),n=ui(t,9,Me);const r={categories:[],keypoints:[]};for(let t=0;t127=s||0>=n)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(s*n)}let Oo;cn[516587230]=[0,Cr,oo,ho,Cs];const Fo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Do(){if(void 0===Oo)try{await WebAssembly.instantiate(Fo),Oo=!0}catch{Oo=!1}return Oo}async function ko(t,e=""){const i=await Do()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${i}.js`,wasmBinaryPath:`${e}/${t}_${i}.wasm`}}var Io=class{};function Bo(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")}async function No(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,i)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{i(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Uo(t){return void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function Xo(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Yo(t,e,i){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(i?t.i._bindTextureToStream(i):t.i._bindTextureToCanvas(),!(i=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);const[s,n]=Uo(e);return!t.l||s===t.i.canvas.width&&n===t.i.canvas.height||(t.i.canvas.width=s,t.i.canvas.height=n),[s,n]}function zo(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const s=new Uint32Array(e.length);for(let i=0;i>2),i(e);for(const e of s)t.i._free(e);t.i._free(e)}function Go(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function Vo(t,e,i){let s=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,n)=>{e?(i(s,n),s=[]):s.push(t)}}function Wo(t,e){const i=Ei(t.baseOptions,Sr,1)||new Sr;"string"==typeof e?(ri(i,2,Ce(e)),ri(i,1)):e instanceof Uint8Array&&(ri(i,1,oe(e,!1,!1)),ri(i,2)),_i(t.baseOptions,0,1,i)}function Ho(t){try{const e=t.H.length;if(1===e)throw Error(t.H[0].message);if(1t.message)).join(", "))}finally{t.H=[]}}function jo(t,e){t.C=Math.max(t.C,e)}function Ko(t,e){t.B=new wn,yn(t.B,"PassThroughCalculator"),xn(t.B,"free_memory"),Tn(t.B,"free_memory_unused_out"),Mn(e,"free_memory"),Cn(e,t.B)}function qo(t,e){xn(t.B,e),Tn(t.B,e+"_unused_out")}function Zo(t){t.g.addBoolToStream(!0,"free_memory",t.C)}Io.forVisionTasks=function(t){return ko("vision",t)},Io.forTextTasks=function(t){return ko("text",t)},Io.forAudioTasks=function(t){return ko("audio",t)},Io.isSimdSupported=function(){return Do()};var Jo=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ei(this.baseOptions,Sr,1)?.g()||Ei(this.baseOptions,Sr,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let i=Ei(t.baseOptions,br,3);if(!i){var s=i=new br,n=new an;Ci(s,4,Er,n)}"delegate"in e&&("GPU"===e.delegate?(e=i,s=new nn,Ci(e,2,Er,s)):(e=i,s=new an,Ci(e,4,Er,s))),_i(t.baseOptions,0,3,i)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Wo(this,"/model.dat"),this.m(),this.K()}));Wo(this,e.modelAssetBuffer)}return this.m(),this.K(),Promise.resolve()}K(){}fa(){let t;if(this.g.fa((e=>{t=On(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.H.push(Error(e))})),this.g.Ma(),this.g.setGraph(t,e),this.B=void 0,Ho(this)}finishProcessing(){this.g.finishProcessing(),Ho(this)}close(){this.B=void 0,this.g.closeGraph()}};function Qo(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Jo.prototype.close=Jo.prototype.close;class $o{constructor(t,e,i,s){this.g=t,this.h=e,this.m=i,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ta(t,e,i){const s=t.g;if(i=Qo(s.createShader(i),"Failed to create WebGL shader"),s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(i)}`);return s.attachShader(t.h,i),i}function ea(t,e){const i=t.g,s=Qo(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(s);const n=Qo(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,n),i.enableVertexAttribArray(t.P),i.vertexAttribPointer(t.P,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const r=Qo(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(t.O),i.vertexAttribPointer(t.O,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new $o(i,s,n,r)}function ia(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function sa(t,e,i,s){return ia(t,e),t.h||(t.m(),t.D()),i?(t.s||(t.s=ea(t,!0)),i=t.s):(t.v||(t.v=ea(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=s(),i.g.bindVertexArray(null),t}function na(t,e,i){return ia(t,e),t=Qo(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function ra(t,e,i){ia(t,e),t.B||(t.B=Qo(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0)}function oa(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var aa=class{H(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){const t=this.g;if(this.h=Qo(t.createProgram(),"Failed to create WebGL program"),this.ba=ta(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.aa=ta(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.P=t.getAttribLocation(this.h,"aVertex"),this.O=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.ba),t.deleteShader(this.aa)}this.B&&this.g.deleteFramebuffer(this.B),this.v&&this.v.close(),this.s&&this.s.close()}},ha=class extends aa{H(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}D(){const t=this.g;t.activeTexture(t.TEXTURE1),this.C=na(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=na(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.K=Qo(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.V=Qo(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.J=Qo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.J,0),t.uniform1i(this.K,1),t.uniform1i(this.V,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},la=class extends aa{H(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}D(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=na(this,t),t.activeTexture(t.TEXTURE2),this.C=na(this,t)}m(){super.m();const t=this.g;this.J=Qo(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.K=Qo(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=Qo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.J,1),t.uniform1i(this.K,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function ua(t,e){switch(e){case 0:return t.g.find((t=>t instanceof Uint8Array));case 1:return t.g.find((t=>t instanceof Float32Array));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function ca(t){var e=ua(t,1);if(!e){if(e=ua(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const s=fa(t);var i=ga(t);if(ra(i,s,da(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){i=new Float32Array(t.width*t.height*4),s.readPixels(0,0,t.width,t.height,s.RGBA,s.FLOAT,i);for(let t=0,s=0;t255*t))),this.g.push(t)),t;var t}ja(){return ca(this)}M(){return da(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof Uint8Array)i=new Uint8Array(e);else if(e instanceof Float32Array)i=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=fa(this),e=ga(this);t.activeTexture(t.TEXTURE1),i=na(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,i);const s=pa(this);t.texImage2D(t.TEXTURE_2D,0,s,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),ra(e,t,i),sa(e,t,!1,(()=>{va(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),ma(this)})),oa(e),ma(this)}}t.push(i)}return new xa(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&fa(this).deleteTexture(ua(this,2)),Ta=-1}};xa.prototype.close=xa.prototype.close,xa.prototype.clone=xa.prototype.clone,xa.prototype.getAsWebGLTexture=xa.prototype.M,xa.prototype.getAsFloat32Array=xa.prototype.ja,xa.prototype.getAsUint8Array=xa.prototype.ka,xa.prototype.hasWebGLTexture=xa.prototype.R,xa.prototype.hasFloat32Array=xa.prototype.la,xa.prototype.hasUint8Array=xa.prototype.Ha;var Ta=250;const wa={color:"white",lineWidth:4,radius:6};function ba(t){return{...wa,fillColor:(t=t||{}).color,...t}}function Ea(t,e){return t instanceof Function?t(e):t}function Sa(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function Aa(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function _a(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Ca(t,e,i){if(e.R())i(e.M());else{const s=e.la()?e.ja():e.ka();t.m=t.m??new aa;const n=_a(t);i((t=new xa([s],e.m,!1,n.canvas,t.m,e.width,e.height)).M()),t.close()}}function Ma(t,e,i,s){const n=function(t){return t.g||(t.g=new ha),t.g}(t),r=_a(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;sa(n,r,!0,(()=>{!function(t,e,i,s){const n=t.g;if(n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,t.C),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(const[s,n]of t){t=s;const r=n;var i=e.next();if(i.done)return!1;const[o,a]=i.value;if(i=a,t!==o||r[0]!==i[0]||r[1]!==i[1]||r[2]!==i[2]||r[3]!==i[3])return!1}return!!e.next().done}(t.I,s))n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,t.j);else{t.I=s;const e=Array(1024).fill(0);s.forEach(((t,i)=>{if(4!==t.length)throw Error(`Color at index ${i} is not a four-channel value.`);e[4*i]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]})),n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,t.j),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,256,1,0,n.RGBA,n.UNSIGNED_BYTE,new Uint8Array(e))}}(n,e,o,s),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4);const t=n.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}function Pa(t,e,i,s){const n=_a(t),r=function(t){return t.h||(t.h=new la),t.h}(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(s)?new ImageData(new Uint8ClampedArray(s),1,1):s;sa(r,n,!0,(()=>{var t=r.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,r.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,r.C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),n.bindTexture(n.TEXTURE_2D,null),(t=r.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}var Ra=class{constructor(t,e){t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}Aa(t,e){if(t){var i=Aa(this);e=ba(e),i.save();var s=i.canvas,n=0;for(const r of t)i.fillStyle=Ea(e.fillColor,{index:n,from:r}),i.strokeStyle=Ea(e.color,{index:n,from:r}),i.lineWidth=Ea(e.lineWidth,{index:n,from:r}),(t=new Path2D).arc(r.x*s.width,r.y*s.height,Ea(e.radius,{index:n,from:r}),0,2*Math.PI),i.fill(t),i.stroke(t),++n;i.restore()}}za(t,e,i){if(t&&e){var s=Aa(this);i=ba(i),s.save();var n=s.canvas,r=0;for(const o of e){s.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(s.strokeStyle=Ea(i.color,{index:r,from:e,to:a}),s.lineWidth=Ea(i.lineWidth,{index:r,from:e,to:a}),s.moveTo(e.x*n.width,e.y*n.height),s.lineTo(a.x*n.width,a.y*n.height)),++r,s.stroke()}s.restore()}}wa(t,e){const i=Aa(this);e=ba(e),i.save(),i.beginPath(),i.lineWidth=Ea(e.lineWidth,{}),i.strokeStyle=Ea(e.color,{}),i.fillStyle=Ea(e.fillColor,{}),i.moveTo(t.originX,t.originY),i.lineTo(t.originX+t.width,t.originY),i.lineTo(t.originX+t.width,t.originY+t.height),i.lineTo(t.originX,t.originY+t.height),i.lineTo(t.originX,t.originY),i.stroke(),i.fill(),i.restore()}xa(t,e,i=[0,0,0,255]){this.l?function(t,e,i,s){const n=_a(t);Ca(t,e,(e=>{Ma(t,e,i,s),(e=Aa(t)).drawImage(n.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,i,e):Ma(this,t.M(),i,e)}ya(t,e,i){this.l?function(t,e,i,s){const n=_a(t);Ca(t,e,(e=>{Pa(t,e,i,s),(e=Aa(t)).drawImage(n.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,e,i):Pa(this,t.M(),e,i)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function La(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function Oa(t){var e=La(t,0);if(!e){e=Da(t);const i=ka(t),s=new Uint8Array(t.width*t.height*4);ra(i,e,Fa(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,s),oa(i),e=new ImageData(new Uint8ClampedArray(s.buffer),t.width,t.height),t.g.push(e)}return e}function Fa(t){let e=La(t,2);if(!e){const i=Da(t);e=Ia(t);const s=La(t,1)||Oa(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,s),Ba(t)}return e}function Da(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=Qo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function ka(t){return t.l||(t.l=new aa),t.l}function Ia(t){const e=Da(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=La(t,2);return i||(i=na(ka(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function Ba(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Na(t){const e=Da(t);return sa(ka(t),e,!0,(()=>function(t,e){const i=t.canvas;if(i.width===t.width&&i.height===t.height)return e();const s=i.width,n=i.height;return i.width=t.width,i.height=t.height,t=e(),i.width=s,i.height=n,t}(t,(()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))))}Ra.prototype.close=Ra.prototype.close,Ra.prototype.drawConfidenceMask=Ra.prototype.ya,Ra.prototype.drawCategoryMask=Ra.prototype.xa,Ra.prototype.drawBoundingBox=Ra.prototype.wa,Ra.prototype.drawConnectors=Ra.prototype.za,Ra.prototype.drawLandmarks=Ra.prototype.Aa,Ra.lerp=function(t,e,i,s,n){return Sa(s*(1-(t-e)/(i-e))+n*(1-(i-t)/(i-e)),s,n)},Ra.clamp=Sa;var Ua=class{constructor(t,e,i,s,n,r,o){this.g=t,this.j=e,this.m=i,this.canvas=s,this.l=n,this.width=r,this.height=o,(this.j||this.m)&&0==--Xa&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ga(){return!!La(this,0)}ma(){return!!La(this,1)}R(){return!!La(this,2)}Ea(){return Oa(this)}Da(){var t=La(this,1);return t||(Fa(this),Ia(this),t=Na(this),Ba(this),this.g.push(t),this.j=!0),t}M(){return Fa(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof ImageData)i=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=Da(this),e=ka(this);t.activeTexture(t.TEXTURE1),i=na(e,t),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),ra(e,t,i),sa(e,t,!1,(()=>{Ia(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ba(this)})),oa(e),Ba(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Fa(this),Ia(this),i=Na(this),Ba(this)}t.push(i)}return new Ua(t,this.ma(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&La(this,1).close(),this.m&&Da(this).deleteTexture(La(this,2)),Xa=-1}};Ua.prototype.close=Ua.prototype.close,Ua.prototype.clone=Ua.prototype.clone,Ua.prototype.getAsWebGLTexture=Ua.prototype.M,Ua.prototype.getAsImageBitmap=Ua.prototype.Da,Ua.prototype.getAsImageData=Ua.prototype.Ea,Ua.prototype.hasWebGLTexture=Ua.prototype.R,Ua.prototype.hasImageBitmap=Ua.prototype.ma,Ua.prototype.hasImageData=Ua.prototype.Ga;var Xa=250;function Ya(...t){return t.map((([t,e])=>({start:t,end:e})))}const za=function(t){return class extends t{Ma(){this.i._registerModelResourcesGraphService()}}}((Ga=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:"undefined"==typeof OffscreenCanvas||Bo()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const i=t.length,s=this.i._malloc(i);this.i.HEAPU8.set(t,s),e?this.i._changeBinaryGraph(i,s):this.i._changeTextGraph(i,s),this.i._free(s)}configureAudio(t,e,i,s,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Xo(this,s||"input_audio",(s=>{Xo(this,n=n||"audio_header",(n=>{this.i._configureAudio(s,n,t,e,i)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}fa(t){Go(this,"__graph_config__",(e=>{t(e)})),Xo(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,i){this.addAudioToStreamWithShape(t,0,0,e,i)}addAudioToStreamWithShape(t,e,i,s,n){const r=4*t.length;this.h!==r&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(r),this.h=r),this.i.HEAPF32.set(t,this.g/4),Xo(this,s,(t=>{this.i._addAudioToInputStream(this.g,e,i,t,n)}))}addGpuBufferToStream(t,e,i){Xo(this,e,(e=>{const[s,n]=Yo(this,t,e);this.i._addBoundTextureToStream(e,s,n,i)}))}addBoolToStream(t,e,i){Xo(this,e,(e=>{this.i._addBoolToInputStream(t,e,i)}))}addDoubleToStream(t,e,i){Xo(this,e,(e=>{this.i._addDoubleToInputStream(t,e,i)}))}addFloatToStream(t,e,i){Xo(this,e,(e=>{this.i._addFloatToInputStream(t,e,i)}))}addIntToStream(t,e,i){Xo(this,e,(e=>{this.i._addIntToInputStream(t,e,i)}))}addStringToStream(t,e,i){Xo(this,e,(e=>{Xo(this,t,(t=>{this.i._addStringToInputStream(t,e,i)}))}))}addStringRecordToStream(t,e,i){Xo(this,e,(e=>{zo(this,Object.keys(t),(s=>{zo(this,Object.values(t),(n=>{this.i._addFlatHashMapToInputStream(s,n,Object.keys(t).length,e,i)}))}))}))}addProtoToStream(t,e,i,s){Xo(this,i,(i=>{Xo(this,e,(e=>{const n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputStream(n,t.length,e,i,s),this.i._free(n)}))}))}addEmptyPacketToStream(t,e){Xo(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,i){Xo(this,e,(e=>{const s=this.i._allocateBoolVector(t.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(s,e);this.i._addBoolVectorToInputStream(s,e,i)}))}addDoubleVectorToStream(t,e,i){Xo(this,e,(e=>{const s=this.i._allocateDoubleVector(t.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(s,e);this.i._addDoubleVectorToInputStream(s,e,i)}))}addFloatVectorToStream(t,e,i){Xo(this,e,(e=>{const s=this.i._allocateFloatVector(t.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(s,e);this.i._addFloatVectorToInputStream(s,e,i)}))}addIntVectorToStream(t,e,i){Xo(this,e,(e=>{const s=this.i._allocateIntVector(t.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(s,e);this.i._addIntVectorToInputStream(s,e,i)}))}addStringVectorToStream(t,e,i){Xo(this,e,(e=>{const s=this.i._allocateStringVector(t.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Xo(this,e,(t=>{this.i._addStringVectorEntry(s,t)}));this.i._addStringVectorToInputStream(s,e,i)}))}addBoolToInputSidePacket(t,e){Xo(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Xo(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Xo(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Xo(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Xo(this,e,(e=>{Xo(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,i){Xo(this,i,(i=>{Xo(this,e,(e=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,e,i),this.i._free(s)}))}))}addBoolVectorToInputSidePacket(t,e){Xo(this,e,(e=>{const i=this.i._allocateBoolVector(t.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(i,e);this.i._addBoolVectorToInputSidePacket(i,e)}))}addDoubleVectorToInputSidePacket(t,e){Xo(this,e,(e=>{const i=this.i._allocateDoubleVector(t.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(i,e);this.i._addDoubleVectorToInputSidePacket(i,e)}))}addFloatVectorToInputSidePacket(t,e){Xo(this,e,(e=>{const i=this.i._allocateFloatVector(t.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(i,e);this.i._addFloatVectorToInputSidePacket(i,e)}))}addIntVectorToInputSidePacket(t,e){Xo(this,e,(e=>{const i=this.i._allocateIntVector(t.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(i,e);this.i._addIntVectorToInputSidePacket(i,e)}))}addStringVectorToInputSidePacket(t,e){Xo(this,e,(e=>{const i=this.i._allocateStringVector(t.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Xo(this,e,(t=>{this.i._addStringVectorEntry(i,t)}));this.i._addStringVectorToInputSidePacket(i,e)}))}attachBoolListener(t,e){Go(this,t,e),Xo(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Go(this,t,e),Xo(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Go(this,t,e),Xo(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Go(this,t,e),Xo(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Go(this,t,e),Xo(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,i){Go(this,t,e),Xo(this,t,(t=>{this.i._attachProtoListener(t,i||!1)}))}attachProtoVectorListener(t,e,i){Vo(this,t,e),Xo(this,t,(t=>{this.i._attachProtoVectorListener(t,i||!1)}))}attachAudioListener(t,e,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Go(this,t,((t,i)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,i)})),Xo(this,t,(t=>{this.i._attachAudioListener(t,i||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Ga{get ha(){return this.i}sa(t,e,i){Xo(this,e,(e=>{const[s,n]=Yo(this,t,e);this.ha._addBoundTextureAsImageToStream(e,s,n,i)}))}W(t,e){Go(this,t,e),Xo(this,t,(t=>{this.ha._attachImageListener(t)}))}da(t,e){Vo(this,t,e),Xo(this,t,(t=>{this.ha._attachImageVectorListener(t)}))}}));var Ga,Va=class extends za{};async function Wa(t,e,i){return async function(t,e,i,s){return async function(t,e,i,s){return t=await(async(t,e,i,s,n)=>{if(e&&await No(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(i&&(await No(i),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,s)})(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&t.endsWith(".data")?i.assetBinaryPath.toString():t}),await t.o(s),t}(t,e,i,s)}(t,i.canvas??("undefined"==typeof OffscreenCanvas||Bo()?document.createElement("canvas"):void 0),e,i)}function Ha(t,e,i,s){if(t.V){const r=new or;if(i?.regionOfInterest){if(!t.ra)throw Error("This task doesn't support region-of-interest.");var n=i.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>n.left||0>n.top||1{for(const e of t)t=qn(e),this.j.detections.push(Co(t));jo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ja.prototype.detectForVideo=Ja.prototype.G,Ja.prototype.detect=Ja.prototype.F,Ja.prototype.setOptions=Ja.prototype.o,Ja.createFromModelPath=async function(t,e){return Wa(Ja,t,{baseOptions:{modelAssetPath:e}})},Ja.createFromModelBuffer=function(t,e){return Wa(Ja,t,{baseOptions:{modelAssetBuffer:e}})},Ja.createFromOptions=function(t,e){return Wa(Ja,t,e)};var Qa=Ya([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),$a=Ya([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),th=Ya([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),eh=Ya([474,475],[475,476],[476,477],[477,474]),ih=Ya([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),sh=Ya([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),nh=Ya([469,470],[470,471],[471,472],[472,469]),rh=Ya([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),oh=[...Qa,...$a,...th,...ih,...sh,...rh],ah=Ya([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function hh(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var lh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,_i(t=this.h=new Br,0,1,e=new _r),this.v=new kr,_i(this.h,0,3,this.v),this.s=new Mr,_i(this.h,0,2,this.s),ki(this.s,4,1),Ii(this.s,2,.5),Ii(this.v,2,.5),Ii(this.h,4,.5)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return"numFaces"in t&&ki(this.s,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Ii(this.s,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Ii(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Ii(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return hh(this),ja(this,t,e),this.j}G(t,e,i){return hh(this),Ka(this,t,i,e),this.j}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"face_landmarks");const e=new un;Bi(e,Ur,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Cn(t,i),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=sr(e),this.j.faceLandmarks.push(Mo(t));jo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{jo(this,t)})),this.outputFaceBlendshapes&&(Pn(t,"blendshapes"),Tn(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=Nn(e),this.j.faceBlendshapes.push(_o(t.g()??[]));jo(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{jo(this,t)}))),this.outputFacialTransformationMatrixes&&(Pn(t,"face_geometry"),Tn(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=Ei(Fr(e),nr,2))&&this.j.facialTransformationMatrixes.push({rows:Oi(Ri(t,1))??0,columns:Oi(Ri(t,2))??0,data:ui(t,3,ge)??[]});jo(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{jo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};lh.prototype.detectForVideo=lh.prototype.G,lh.prototype.detect=lh.prototype.F,lh.prototype.setOptions=lh.prototype.o,lh.createFromModelPath=function(t,e){return Wa(lh,t,{baseOptions:{modelAssetPath:e}})},lh.createFromModelBuffer=function(t,e){return Wa(lh,t,{baseOptions:{modelAssetBuffer:e}})},lh.createFromOptions=function(t,e){return Wa(lh,t,e)},lh.FACE_LANDMARKS_LIPS=Qa,lh.FACE_LANDMARKS_LEFT_EYE=$a,lh.FACE_LANDMARKS_LEFT_EYEBROW=th,lh.FACE_LANDMARKS_LEFT_IRIS=eh,lh.FACE_LANDMARKS_RIGHT_EYE=ih,lh.FACE_LANDMARKS_RIGHT_EYEBROW=sh,lh.FACE_LANDMARKS_RIGHT_IRIS=nh,lh.FACE_LANDMARKS_FACE_OVAL=rh,lh.FACE_LANDMARKS_CONTOURS=oh,lh.FACE_LANDMARKS_TESSELATION=ah;var uh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!0),_i(t=this.j=new Xr,0,1,e=new _r)}get baseOptions(){return Ei(this.j,_r,1)}set baseOptions(t){_i(this.j,0,1,t)}o(t){return super.l(t)}Pa(t,e,i){const s="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:i,ja(this,t,s??{}),!this.h)return this.s}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"stylized_image");const e=new un;Bi(e,Yr,this.j);const i=new wn;yn(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Cn(t,i),this.g.W("stylized_image",((t,e)=>{var i=!this.h,s=t.data,n=t.width;const r=n*(t=t.height);if(s instanceof Uint8Array)if(s.length===3*r){const e=new Uint8ClampedArray(4*r);for(let t=0;t{this.s=null,this.h&&this.h(null),jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};uh.prototype.stylize=uh.prototype.Pa,uh.prototype.setOptions=uh.prototype.o,uh.createFromModelPath=function(t,e){return Wa(uh,t,{baseOptions:{modelAssetPath:e}})},uh.createFromModelBuffer=function(t,e){return Wa(uh,t,{baseOptions:{modelAssetBuffer:e}})},uh.createFromOptions=function(t,e){return Wa(uh,t,e)};var ch=Ya([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function dh(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function fh(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function ph(t,e=!0){const i=[];for(const n of t){var s=Nn(n);t=[];for(const i of s.g())s=e&&null!=Ri(i,1)?Oi(Ri(i,1)):-1,t.push({score:Fi(i,2)??0,index:s,categoryName:Li(i,3)??""??"",displayName:Li(i,4)??""??""});i.push(t)}return i}var gh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_i(t=this.j=new $r,0,1,e=new _r),this.s=new Jr,_i(this.j,0,2,this.s),this.D=new qr,_i(this.s,0,3,this.D),this.v=new jr,_i(this.s,0,2,this.v),this.h=new Wr,_i(this.j,0,3,this.h),Ii(this.v,2,.5),Ii(this.s,4,.5),Ii(this.D,2,.5)}get baseOptions(){return Ei(this.j,_r,1)}set baseOptions(t){_i(this.j,0,1,t)}o(t){if(ki(this.v,3,t.numHands??1),"minHandDetectionConfidence"in t&&Ii(this.v,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Ii(this.s,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Ii(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new zr,i=e,s=Ao(t.cannedGesturesClassifierOptions,Ei(this.h,zr,3)?.h());_i(i,0,2,s),_i(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&Ei(this.h,zr,3)?.g();return t.customGesturesClassifierOptions?(_i(i=e=new zr,0,2,s=Ao(t.customGesturesClassifierOptions,Ei(this.h,zr,4)?.h())),_i(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&Ei(this.h,zr,4)?.g(),this.l(t)}Ka(t,e){return dh(this),ja(this,t,e),fh(this)}La(t,e,i){return dh(this),Ka(this,t,i,e),fh(this)}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"hand_gestures"),Pn(t,"hand_landmarks"),Pn(t,"world_hand_landmarks"),Pn(t,"handedness");const e=new un;Bi(e,io,this.j);const i=new wn;yn(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"HAND_GESTURES:hand_gestures"),Tn(i,"LANDMARKS:hand_landmarks"),Tn(i,"WORLD_LANDMARKS:world_hand_landmarks"),Tn(i,"HANDEDNESS:handedness"),i.o(e),Cn(t,i),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=sr(e);const i=[];for(const e of Ai(t,tr,1))i.push({x:Fi(e,1)??0,y:Fi(e,2)??0,z:Fi(e,3)??0});this.landmarks.push(i)}jo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=$n(e);const i=[];for(const e of Ai(t,Zn,1))i.push({x:Fi(e,1)??0,y:Fi(e,2)??0,z:Fi(e,3)??0});this.worldLandmarks.push(i)}jo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...ph(t,!1)),jo(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{jo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...ph(t)),jo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function vh(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}gh.prototype.recognizeForVideo=gh.prototype.La,gh.prototype.recognize=gh.prototype.Ka,gh.prototype.setOptions=gh.prototype.o,gh.createFromModelPath=function(t,e){return Wa(gh,t,{baseOptions:{modelAssetPath:e}})},gh.createFromModelBuffer=function(t,e){return Wa(gh,t,{baseOptions:{modelAssetBuffer:e}})},gh.createFromOptions=function(t,e){return Wa(gh,t,e)},gh.HAND_CONNECTIONS=ch;var mh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],_i(t=this.h=new Jr,0,1,e=new _r),this.s=new qr,_i(this.h,0,3,this.s),this.j=new jr,_i(this.h,0,2,this.j),ki(this.j,3,1),Ii(this.j,2,.5),Ii(this.s,2,.5),Ii(this.h,4,.5)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return"numHands"in t&&ki(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&Ii(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Ii(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Ii(this.s,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ja(this,t,e),vh(this)}G(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ka(this,t,i,e),vh(this)}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"hand_landmarks"),Pn(t,"world_hand_landmarks"),Pn(t,"handedness");const e=new un;Bi(e,eo,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"LANDMARKS:hand_landmarks"),Tn(i,"WORLD_LANDMARKS:world_hand_landmarks"),Tn(i,"HANDEDNESS:handedness"),i.o(e),Cn(t,i),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=sr(e),this.landmarks.push(Mo(t));jo(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=$n(e),this.worldLandmarks.push(Po(t));jo(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var i=this.handedness,s=i.push;const n=[];for(const e of t){t=Nn(e);const i=[];for(const e of t.g())i.push({score:Fi(e,2)??0,index:Oi(Ri(e,1))??-1,categoryName:Li(e,3)??""??"",displayName:Li(e,4)??""??""});n.push(i)}s.call(i,...n),jo(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};mh.prototype.detectForVideo=mh.prototype.G,mh.prototype.detect=mh.prototype.F,mh.prototype.setOptions=mh.prototype.o,mh.createFromModelPath=function(t,e){return Wa(mh,t,{baseOptions:{modelAssetPath:e}})},mh.createFromModelBuffer=function(t,e){return Wa(mh,t,{baseOptions:{modelAssetBuffer:e}})},mh.createFromOptions=function(t,e){return Wa(mh,t,e)},mh.HAND_CONNECTIONS=ch;var yh=Ya([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function xh(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Th(t){try{if(!t.D)return t.h;t.D(t.h)}finally{Zo(t)}}function wh(t,e){t=sr(t),e.push(Mo(t))}var bh=class extends Za{constructor(t,e){super(new Va(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,_i(t=this.j=new lo,0,1,e=new _r),this.I=new qr,_i(this.j,0,2,this.I),this.aa=new so,_i(this.j,0,3,this.aa),this.s=new Mr,_i(this.j,0,4,this.s),this.P=new kr,_i(this.j,0,5,this.P),this.v=new ro,_i(this.j,0,6,this.v),this.J=new ao,_i(this.j,0,7,this.J),Ii(this.s,2,.5),Ii(this.s,3,.3),Ii(this.P,2,.5),Ii(this.v,2,.5),Ii(this.v,3,.3),Ii(this.J,2,.5),Ii(this.I,2,.5)}get baseOptions(){return Ei(this.j,_r,1)}set baseOptions(t){_i(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&Ii(this.s,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&Ii(this.s,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&Ii(this.P,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&Ii(this.v,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&Ii(this.v,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&Ii(this.J,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&Ii(this.I,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,i){const s="function"!=typeof e?e:{};return this.D="function"==typeof e?e:i,xh(this),ja(this,t,s),Th(this)}G(t,e,i,s){const n="function"!=typeof i?i:{};return this.D="function"==typeof i?i:s,xh(this),Ka(this,t,n,e),Th(this)}m(){var t=new Rn;Mn(t,"input_frames_image"),Pn(t,"pose_landmarks"),Pn(t,"pose_world_landmarks"),Pn(t,"face_landmarks"),Pn(t,"left_hand_landmarks"),Pn(t,"left_hand_world_landmarks"),Pn(t,"right_hand_landmarks"),Pn(t,"right_hand_world_landmarks");const e=new un,i=new Qs;vi(i,1,Ce("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(t,e){if(null!=e)if(Array.isArray(e))ri(t,2,Ze(e,Qe,void 0,void 0,!1));else{if(!("string"==typeof e||e instanceof X||O(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");vi(t,2,oe(e,!1,!1),N())}}(i,this.j.g());const s=new wn;yn(s,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Pi(s,8,Qs,i),xn(s,"IMAGE:input_frames_image"),Tn(s,"POSE_LANDMARKS:pose_landmarks"),Tn(s,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Tn(s,"FACE_LANDMARKS:face_landmarks"),Tn(s,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Tn(s,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Tn(s,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Tn(s,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),s.o(e),Cn(t,s),Ko(this,t),this.g.attachProtoListener("pose_landmarks",((t,e)=>{wh(t,this.h.poseLandmarks),jo(this,e)})),this.g.attachEmptyPacketListener("pose_landmarks",(t=>{jo(this,t)})),this.g.attachProtoListener("pose_world_landmarks",((t,e)=>{var i=this.h.poseWorldLandmarks;t=$n(t),i.push(Po(t)),jo(this,e)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(t=>{jo(this,t)})),this.outputPoseSegmentationMasks&&(Tn(s,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),qo(this,"pose_segmentation_mask"),this.g.W("pose_segmentation_mask",((t,e)=>{this.h.poseSegmentationMasks=[qa(this,t,!0,!this.D)],jo(this,e)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(t=>{this.h.poseSegmentationMasks=[],jo(this,t)}))),this.g.attachProtoListener("face_landmarks",((t,e)=>{wh(t,this.h.faceLandmarks),jo(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{jo(this,t)})),this.outputFaceBlendshapes&&(Pn(t,"extra_blendshapes"),Tn(s,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((t,e)=>{var i=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=Nn(t),i.push(_o(t.g()??[]))),jo(this,e)})),this.g.attachEmptyPacketListener("extra_blendshapes",(t=>{jo(this,t)}))),this.g.attachProtoListener("left_hand_landmarks",((t,e)=>{wh(t,this.h.leftHandLandmarks),jo(this,e)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoListener("left_hand_world_landmarks",((t,e)=>{var i=this.h.leftHandWorldLandmarks;t=$n(t),i.push(Po(t)),jo(this,e)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(t=>{jo(this,t)})),this.g.attachProtoListener("right_hand_landmarks",((t,e)=>{wh(t,this.h.rightHandLandmarks),jo(this,e)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(t=>{jo(this,t)})),this.g.attachProtoListener("right_hand_world_landmarks",((t,e)=>{var i=this.h.rightHandWorldLandmarks;t=$n(t),i.push(Po(t)),jo(this,e)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};bh.prototype.detectForVideo=bh.prototype.G,bh.prototype.detect=bh.prototype.F,bh.prototype.setOptions=bh.prototype.o,bh.createFromModelPath=function(t,e){return Wa(bh,t,{baseOptions:{modelAssetPath:e}})},bh.createFromModelBuffer=function(t,e){return Wa(bh,t,{baseOptions:{modelAssetBuffer:e}})},bh.createFromOptions=function(t,e){return Wa(bh,t,e)},bh.HAND_CONNECTIONS=ch,bh.POSE_CONNECTIONS=yh,bh.FACE_LANDMARKS_LIPS=Qa,bh.FACE_LANDMARKS_LEFT_EYE=$a,bh.FACE_LANDMARKS_LEFT_EYEBROW=th,bh.FACE_LANDMARKS_LEFT_IRIS=eh,bh.FACE_LANDMARKS_RIGHT_EYE=ih,bh.FACE_LANDMARKS_RIGHT_EYEBROW=sh,bh.FACE_LANDMARKS_RIGHT_IRIS=nh,bh.FACE_LANDMARKS_FACE_OVAL=rh,bh.FACE_LANDMARKS_CONTOURS=oh,bh.FACE_LANDMARKS_TESSELATION=ah;var Eh=class extends Za{constructor(t,e){super(new Va(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},_i(t=this.h=new uo,0,1,e=new _r)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return _i(this.h,0,2,Ao(t,Ei(this.h,yr,2))),this.l(t)}ua(t,e){return this.j={classifications:[]},ja(this,t,e),this.j}va(t,e,i){return this.j={classifications:[]},Ka(this,t,i,e),this.j}m(){var t=new Rn;Mn(t,"input_image"),Mn(t,"norm_rect"),Pn(t,"classifications");const e=new un;Bi(e,co,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),xn(i,"IMAGE:input_image"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"CLASSIFICATIONS:classifications"),i.o(e),Cn(t,i),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:Ai(t,ar,1).map((t=>_o(Ei(t,In,4)?.g()??[],Oi(Ri(t,2)),Li(t,3)??"")))};return null!=Ae(si(t,2))&&(e.timestampMs=Oi(Ae(si(t,2)))),e}(ur(t)),jo(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Eh.prototype.classifyForVideo=Eh.prototype.va,Eh.prototype.classify=Eh.prototype.ua,Eh.prototype.setOptions=Eh.prototype.o,Eh.createFromModelPath=function(t,e){return Wa(Eh,t,{baseOptions:{modelAssetPath:e}})},Eh.createFromModelBuffer=function(t,e){return Wa(Eh,t,{baseOptions:{modelAssetBuffer:e}})},Eh.createFromOptions=function(t,e){return Wa(Eh,t,e)};var Sh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!0),this.h=new fo,this.embeddings={embeddings:[]},_i(t=this.h,0,1,e=new _r)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){var e=this.h,i=Ei(this.h,Tr,2);return i=i?i.clone():new Tr,void 0!==t.l2Normalize?Di(i,1,t.l2Normalize):"l2Normalize"in t&&ri(i,1),void 0!==t.quantize?Di(i,2,t.quantize):"quantize"in t&&ri(i,2),_i(e,0,2,i),this.l(t)}Ba(t,e){return ja(this,t,e),this.embeddings}Ca(t,e,i){return Ka(this,t,i,e),this.embeddings}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"embeddings_out");const e=new un;Bi(e,po,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"EMBEDDINGS:embeddings_out"),i.o(e),Cn(t,i),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=mr(t),this.embeddings=function(t){return{embeddings:Ai(t,fr,1).map((t=>{const e={headIndex:Oi(Ri(t,3))??-1,headName:Li(t,4)??""??""};if(void 0!==bi(t,cr,xi(t,1)))t=ui(t=Ei(t,cr,xi(t,1)),1,ge),e.floatEmbedding=t;else{const i=new Uint8Array(0);e.quantizedEmbedding=Ei(t,dr,xi(t,2))?.qa()?.h()??i}return e})),timestampMs:Oi(Ae(si(t,2)))}}(t),jo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Sh.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Lo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Lo(Ro(t.quantizedEmbedding),Ro(e.quantizedEmbedding))}return t},Sh.prototype.embedForVideo=Sh.prototype.Ca,Sh.prototype.embed=Sh.prototype.Ba,Sh.prototype.setOptions=Sh.prototype.o,Sh.createFromModelPath=function(t,e){return Wa(Sh,t,{baseOptions:{modelAssetPath:e}})},Sh.createFromModelBuffer=function(t,e){return Wa(Sh,t,{baseOptions:{modelAssetBuffer:e}})},Sh.createFromOptions=function(t,e){return Wa(Sh,t,e)};var Ah=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function _h(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Ch(t){try{const e=new Ah(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Zo(t)}}Ah.prototype.close=Ah.prototype.close;var Mh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new xo,this.v=new go,_i(this.h,0,3,this.v),_i(t=this.h,0,1,e=new _r)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?ri(this.h,2,Ce(t.displayNamesLocale)):"displayNamesLocale"in t&&ri(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}K(){!function(t){const e=Ai(t.fa(),wn,1).filter((t=>(Li(t,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.s=[],1{t.s[Number(i)]=Li(e,1)??""}))}(this)}ga(t,e,i){const s="function"!=typeof e?e:{};return this.j="function"==typeof e?e:i,_h(this),ja(this,t,s),Ch(this)}Na(t,e,i,s){const n="function"!=typeof i?i:{};return this.j="function"==typeof i?i:s,_h(this),Ka(this,t,n,e),Ch(this)}Fa(){return this.s}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect");const e=new un;Bi(e,To,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),i.o(e),Cn(t,i),Ko(this,t),this.outputConfidenceMasks&&(Pn(t,"confidence_masks"),Tn(i,"CONFIDENCE_MASKS:confidence_masks"),qo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>qa(this,t,!0,!this.j))),jo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],jo(this,t)}))),this.outputCategoryMask&&(Pn(t,"category_mask"),Tn(i,"CATEGORY_MASK:category_mask"),qo(this,"category_mask"),this.g.W("category_mask",((t,e)=>{this.categoryMask=qa(this,t,!1,!this.j),jo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,jo(this,t)}))),Pn(t,"quality_scores"),Tn(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,jo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Mh.prototype.getLabels=Mh.prototype.Fa,Mh.prototype.segmentForVideo=Mh.prototype.Na,Mh.prototype.segment=Mh.prototype.ga,Mh.prototype.setOptions=Mh.prototype.o,Mh.createFromModelPath=function(t,e){return Wa(Mh,t,{baseOptions:{modelAssetPath:e}})},Mh.createFromModelBuffer=function(t,e){return Wa(Mh,t,{baseOptions:{modelAssetBuffer:e}})},Mh.createFromOptions=function(t,e){return Wa(Mh,t,e)};var Ph=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};Ph.prototype.close=Ph.prototype.close;var Rh=class extends Ni{constructor(t){super(t)}},Lh=[0,Fs,-2],Oh=[0,_s,-3,Is],Fh=[0,_s,-3,Is,_s,-1],Dh=[0,Fh],kh=[0,Dh,Lh],Ih=[0,Fh,Lh],Bh=[0,Fh,Fs,-1],Nh=[0,Bh,Lh],Uh=[0,_s,-3,Is,Lh,-1],Xh=[0,_s,-3,Is,Hs],Yh=class extends Ni{constructor(t){super(t)}},zh=[0,_s,-1,Is],Gh=class extends Ni{constructor(){super()}};Gh.A=[1];var Vh=class extends Ni{constructor(t){super(t)}},Wh=[1,2,3,4,5,6,7,8,9,10,14,15],Hh=[0,Wh,Gs,Fh,Gs,Ih,Gs,Dh,Gs,kh,Gs,zh,Gs,Xh,Gs,Oh,Gs,[0,Xs,_s,-2,Is,Fs,Is,-1,2,_s,Lh],Gs,Bh,Gs,Nh,_s,Lh,Xs,Gs,Uh,Gs,[0,As,zh]],jh=[0,Xs,Fs,-1,Is],Kh=class extends Ni{constructor(){super()}};Kh.A=[1],Kh.prototype.g=Js([0,As,Hh,Xs,jh]);var qh=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new xo,this.s=new go,_i(this.h,0,3,this.s),_i(t=this.h,0,1,e=new _r)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}ga(t,e,i,s){const n="function"!=typeof i?i:{};this.j="function"==typeof i?i:s,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.C+1,s=new Kh;const r=new Vh;var o=new Rh;if(ki(o,1,255),_i(r,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new Yh;Di(a,3,!0),Ii(a,1,e.keypoint.x),Ii(a,2,e.keypoint.y),Ci(r,5,Wh,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Gh,e.scribble))Di(e=new Yh,3,!0),Ii(e,1,a.x),Ii(e,2,a.y),Pi(o,1,Yh,e);Ci(r,15,Wh,o)}Pi(s,1,Vh,r),this.g.addProtoToStream(s.g(),"drishti.RenderData","roi_in",i),ja(this,t,n);t:{try{const t=new Ph(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var h=t;break t}this.j(t)}finally{Zo(this)}h=void 0}return h}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"roi_in"),Mn(t,"norm_rect_in");const e=new un;Bi(e,To,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),xn(i,"IMAGE:image_in"),xn(i,"ROI:roi_in"),xn(i,"NORM_RECT:norm_rect_in"),i.o(e),Cn(t,i),Ko(this,t),this.outputConfidenceMasks&&(Pn(t,"confidence_masks"),Tn(i,"CONFIDENCE_MASKS:confidence_masks"),qo(this,"confidence_masks"),this.g.da("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>qa(this,t,!0,!this.j))),jo(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],jo(this,t)}))),this.outputCategoryMask&&(Pn(t,"category_mask"),Tn(i,"CATEGORY_MASK:category_mask"),qo(this,"category_mask"),this.g.W("category_mask",((t,e)=>{this.categoryMask=qa(this,t,!1,!this.j),jo(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,jo(this,t)}))),Pn(t,"quality_scores"),Tn(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,jo(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};qh.prototype.segment=qh.prototype.ga,qh.prototype.setOptions=qh.prototype.o,qh.createFromModelPath=function(t,e){return Wa(qh,t,{baseOptions:{modelAssetPath:e}})},qh.createFromModelBuffer=function(t,e){return Wa(qh,t,{baseOptions:{modelAssetBuffer:e}})},qh.createFromOptions=function(t,e){return Wa(qh,t,e)};var Zh=class extends Za{constructor(t,e){super(new Va(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},_i(t=this.h=new wo,0,1,e=new _r)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?ri(this.h,2,Ce(t.displayNamesLocale)):"displayNamesLocale"in t&&ri(this.h,2),void 0!==t.maxResults?ki(this.h,3,t.maxResults):"maxResults"in t&&ri(this.h,3),void 0!==t.scoreThreshold?Ii(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&ri(this.h,4),void 0!==t.categoryAllowlist?gi(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&ri(this.h,5),void 0!==t.categoryDenylist?gi(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&ri(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},ja(this,t,e),this.j}G(t,e,i){return this.j={detections:[]},Ka(this,t,i,e),this.j}m(){var t=new Rn;Mn(t,"input_frame_gpu"),Mn(t,"norm_rect"),Pn(t,"detections");const e=new un;Bi(e,bo,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),xn(i,"IMAGE:input_frame_gpu"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"DETECTIONS:detections"),i.o(e),Cn(t,i),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=qn(e),this.j.detections.push(Co(t));jo(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{jo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Zh.prototype.detectForVideo=Zh.prototype.G,Zh.prototype.detect=Zh.prototype.F,Zh.prototype.setOptions=Zh.prototype.o,Zh.createFromModelPath=async function(t,e){return Wa(Zh,t,{baseOptions:{modelAssetPath:e}})},Zh.createFromModelBuffer=function(t,e){return Wa(Zh,t,{baseOptions:{modelAssetBuffer:e}})},Zh.createFromOptions=function(t,e){return Wa(Zh,t,e)};var Jh=class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=i}close(){this.segmentationMasks?.forEach((t=>{t.close()}))}};function Qh(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function $h(t){try{const e=new Jh(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.s)return e;t.s(e)}finally{Zo(t)}}Jh.prototype.close=Jh.prototype.close;var tl=class extends Za{constructor(t,e){super(new Va(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,_i(t=this.h=new Eo,0,1,e=new _r),this.v=new ao,_i(this.h,0,3,this.v),this.j=new ro,_i(this.h,0,2,this.j),ki(this.j,4,1),Ii(this.j,2,.5),Ii(this.v,2,.5),Ii(this.h,4,.5)}get baseOptions(){return Ei(this.h,_r,1)}set baseOptions(t){_i(this.h,0,1,t)}o(t){return"numPoses"in t&&ki(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Ii(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Ii(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Ii(this.v,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,i){const s="function"!=typeof e?e:{};return this.s="function"==typeof e?e:i,Qh(this),ja(this,t,s),$h(this)}G(t,e,i,s){const n="function"!=typeof i?i:{};return this.s="function"==typeof i?i:s,Qh(this),Ka(this,t,n,e),$h(this)}m(){var t=new Rn;Mn(t,"image_in"),Mn(t,"norm_rect"),Pn(t,"normalized_landmarks"),Pn(t,"world_landmarks"),Pn(t,"segmentation_masks");const e=new un;Bi(e,So,this.h);const i=new wn;yn(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),xn(i,"IMAGE:image_in"),xn(i,"NORM_RECT:norm_rect"),Tn(i,"NORM_LANDMARKS:normalized_landmarks"),Tn(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Cn(t,i),Ko(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=sr(e),this.landmarks.push(Mo(t));jo(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],jo(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=$n(e),this.worldLandmarks.push(Po(t));jo(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],jo(this,t)})),this.outputSegmentationMasks&&(Tn(i,"SEGMENTATION_MASK:segmentation_masks"),qo(this,"segmentation_masks"),this.g.da("segmentation_masks",((t,e)=>{this.segmentationMasks=t.map((t=>qa(this,t,!0,!this.s))),jo(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.segmentationMasks=[],jo(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};tl.prototype.detectForVideo=tl.prototype.G,tl.prototype.detect=tl.prototype.F,tl.prototype.setOptions=tl.prototype.o,tl.createFromModelPath=function(t,e){return Wa(tl,t,{baseOptions:{modelAssetPath:e}})},tl.createFromModelBuffer=function(t,e){return Wa(tl,t,{baseOptions:{modelAssetBuffer:e}})},tl.createFromOptions=function(t,e){return Wa(tl,t,e)},tl.POSE_CONNECTIONS=yh}}]); \ No newline at end of file diff --git a/vendors.8f84529342dee7f75523.bundle.js.LICENSE.txt b/vendors.10ca8e881e09faa4d661.bundle.js.LICENSE.txt similarity index 61% rename from vendors.8f84529342dee7f75523.bundle.js.LICENSE.txt rename to vendors.10ca8e881e09faa4d661.bundle.js.LICENSE.txt index 91d49a8..baa241e 100644 --- a/vendors.8f84529342dee7f75523.bundle.js.LICENSE.txt +++ b/vendors.10ca8e881e09faa4d661.bundle.js.LICENSE.txt @@ -1,7 +1,19 @@ +/** + * @author Ben Richards + * @copyright 2024 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + /** * @author Florian Vazelle * @author Geoffrey Glaive - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -13,97 +25,97 @@ /** * @author Joachim Grill - * @author Richard Davey + * @author Richard Davey * @copyright 2018 CodeAndWeb GmbH - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author @samme - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Angry Bytes (and contributors) - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @author Matthew Groves <@doormat> - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Florian Mertens - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Igor Ognichenko - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @author samme - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** - * @author Richard Davey + * @author Richard Davey * @copyright 2021 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @author Seth Berrier - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -114,20 +126,20 @@ /** * @author Vladimir Agafonkin - * @author Richard Davey - * @copyright 2013-2023 Photon Storm Ltd. + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @author pi-kei - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @author samme - * @copyright 2013-2023 Photon Storm Ltd. + * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ @@ -138,7 +150,7 @@ */ /** -* @author Richard Davey -* @copyright 2013-2023 Photon Storm Ltd. +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ diff --git a/vendors.8f84529342dee7f75523.bundle.js b/vendors.8f84529342dee7f75523.bundle.js deleted file mode 100644 index d7daf6b..0000000 --- a/vendors.8f84529342dee7f75523.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendors.8f84529342dee7f75523.bundle.js.LICENSE.txt */ -(self.webpackChunkPizzicato=self.webpackChunkPizzicato||[]).push([[96],{440:function(t){var e;e=()=>(()=>{var t={6659: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;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},a.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,o=new Array(r);n{var s=i(82590);t.exports=function(t,e,i,n){for(var r=t[0],o=1;o{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"angle",e,i,n,r)}},22015:t=>{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=i;s{t.exports=function(t,e,i){void 0===i&&(i=0);for(var s=t.length-1;s>=i;s--){var n=t[s],r=!0;for(var o in e)n[o]!==e[o]&&(r=!1);if(r)return n}return null}},12673:(t,e,i)=>{var s=i(40327),n=i(84093),r=i(72632),o=i(72283),a=new(i(71030))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1).setOrigin(0,0);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=r(e,"width",-1),l=r(e,"height",-1),u=r(e,"cellWidth",1),c=r(e,"cellHeight",u),d=r(e,"position",n.TOP_LEFT),f=r(e,"x",0),p=r(e,"y",0),g=0,v=0,m=h*u,y=l*c;a.setPosition(f,p),a.setSize(u,c);for(var x=0;x{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},3877:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},71020:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},28970:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},82249:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.x,a=e.y,h=e.radius,l=0;l{t.exports=function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=6.28);for(var n=i,r=(s-i)/t.length,o=e.width/2,a=e.height/2,h=0;h{var s=i(8570);t.exports=function(t,e){for(var i=s(e,t.length),n=0;n{var s=i(40053),n=i(77640),r=i(38487);t.exports=function(t,e,i){void 0===i&&(i=0);var o=s(e,!1,t.length);i>0?n(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a{var s=i(58813);t.exports=function(t,e,i){var n=s({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),r=s({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=s({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);n.pop(),r.pop(),o.pop();for(var a=(n=n.concat(r,o)).length/t.length,h=0,l=0;l{t.exports=function(t,e,i){for(var s=0;s{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]+=i+a*s,a++;return t}},23646:t=>{t.exports=function(t,e,i,s,n,r){var o;void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=n;o=0;o--)t[o][e]=i+a*s,a++;return t}},4392:(t,e,i)=>{var s=i(30977);t.exports=function(t,e){for(var i=0;i{var s=i(72006);t.exports=function(t,e){for(var i=0;i{var s=i(74077);t.exports=function(t,e){for(var i=0;i{var s=i(30001);t.exports=function(t,e){for(var i=0;i{var s=i(99761);t.exports=function(t,e){for(var i=0;i{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},87299:(t,e,i)=>{var s=i(72395),n=i(53996);t.exports=function(t,e,i){for(var r=e.x,o=e.y,a=0;a{var s=i(72395);t.exports=function(t,e,i,n){var r=e.x,o=e.y;if(0===n)return t;for(var a=0;a{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},51449:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},64895:(t,e,i)=>{var s=i(6124);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},30329:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"alpha",e,i,n,r)}},43954:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"blendMode",e,0,i,n)}},70688:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"depth",e,i,n,r)}},8314:t=>{t.exports=function(t,e,i){for(var s=0;s{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"originX",e,n,o,a),s(t,"originY",i,r,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},38767:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"rotation",e,i,n,r)}},18584:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scaleX",e,n,o,a),s(t,"scaleY",i,r,o,a)}},17381:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleX",e,i,n,r)}},74370:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scaleY",e,i,n,r)}},27773:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"scrollFactorX",e,n,o,a),s(t,"scrollFactorY",i,r,o,a)}},75257:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorX",e,i,n,r)}},54512:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"scrollFactorY",e,i,n,r)}},69423:t=>{t.exports=function(t,e,i,s,n){for(var r=0;r{var s=i(23646);t.exports=function(t,e,i,n){return s(t,"visible",e,0,i,n)}},94833:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"x",e,i,n,r)}},14284:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r,o,a){return null==i&&(i=e),s(t,"x",e,n,o,a),s(t,"y",i,r,o,a)}},96574:(t,e,i)=>{var s=i(23646);t.exports=function(t,e,i,n,r){return s(t,"y",e,i,n,r)}},74086:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){var o,a;void 0===n&&(n=0),void 0===r&&(r=new s);var h=t.length;if(1===h)o=t[0].x,a=t[0].y,t[0].x=e,t[0].y=i;else{var l=1,u=0;0===n&&(u=h-1,l=h-2),o=t[u].x,a=t[u].y,t[u].x=e,t[u].y=i;for(var c=0;c=h||-1===l)){var d=t[l],f=d.x,p=d.y;d.x=o,d.y=a,o=f,a=p,0===n?l--:l++}}return r.x=o,r.y=a,r}},86347:(t,e,i)=>{var s=i(18592);t.exports=function(t){return s(t)}},1558:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{var s=i(87736);t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var o,a=Math.abs(n-i)/t.length;if(r)for(o=0;o{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=!1),0===t.length)return t;if(1===t.length)return n?t[0][e]+=(s+i)/2:t[0][e]=(s+i)/2,t;var r,o=Math.abs(s-i)/(t.length-1);if(n)for(r=0;r{t.exports=function(t){for(var e=0;e{var s=i(1071);t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=0;n{t.exports={AlignTo:i(62270),Angle:i(61148),Call:i(22015),GetFirst:i(31060),GetLast:i(52367),GridAlign:i(12673),IncAlpha:i(691),IncX:i(3877),IncXY:i(71020),IncY:i(28970),PlaceOnCircle:i(82249),PlaceOnEllipse:i(30285),PlaceOnLine:i(61557),PlaceOnRectangle:i(63549),PlaceOnTriangle:i(51629),PlayAnimation:i(1045),PropertyValueInc:i(6124),PropertyValueSet:i(23646),RandomCircle:i(4392),RandomEllipse:i(94985),RandomLine:i(63305),RandomRectangle:i(90739),RandomTriangle:i(91417),Rotate:i(26182),RotateAround:i(87299),RotateAroundDistance:i(92194),ScaleX:i(30363),ScaleXY:i(51449),ScaleY:i(64895),SetAlpha:i(30329),SetBlendMode:i(43954),SetDepth:i(70688),SetHitArea:i(8314),SetOrigin:i(12894),SetRotation:i(38767),SetScale:i(18584),SetScaleX:i(17381),SetScaleY:i(74370),SetScrollFactor:i(27773),SetScrollFactorX:i(75257),SetScrollFactorY:i(54512),SetTint:i(69423),SetVisible:i(58291),SetX:i(94833),SetXY:i(14284),SetY:i(96574),ShiftPosition:i(74086),Shuffle:i(86347),SmootherStep:i(9938),SmoothStep:i(1558),Spread:i(71060),ToggleVisible:i(11207),WrapInRectangle:i(24404)}},85463:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16938),o=i(2406),a=i(71519),h=i(10850),l=i(28834),u=new n({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showBeforeDelay=h(i,"showBeforeDelay",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.randomFrame=h(i,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(r.PAUSE_ALL,this.pause,this),this.manager.on(r.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,s){null===i&&null===s?(t.frameRate=24,t.duration=24/e*1e3):i&&null===s?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=s,t.duration=e/s*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var s=this.frames.slice(0,t),n=this.frames.slice(t);this.frames=s.concat(i,n)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){r.isLast=!0,r.nextFrame=c[0],c[0].prevFrame=r;var y=1/(c.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showBeforeDelay:this.showBeforeDelay,showOnStart:this.showOnStart,randomFrame:this.randomFrame,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),s=0;s1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[s-1],t.nextFrame=this.frames[s+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(r.PAUSE_ALL,this.pause,this),this.manager.off(r.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t{var s=new(i(56694))({initialize:function(t,e,i,s,n){void 0===n&&(n=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=s,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=n},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=s},90249:(t,e,i)=>{var s=i(85463),n=i(56694),r=i(33885),o=i(6659),a=i(16938),h=i(97081),l=i(72632),u=i(10850),c=i(83392),d=i(13401),f=i(76400),p=new n({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var s=this.anims,n=this.mixes,r="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(s.has(r)&&s.has(o)){var a=n.get(r);a||(a={}),a[o]=i,n.set(r,a)}return this},removeMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n=i.get(s);if(n)if(e){var r="string"==typeof e?e:e.key;n.hasOwnProperty(r)&&delete n[r]}else e||i.delete(s);return this},getMix:function(t,e){var i=this.mixes,s="string"==typeof t?t:t.key,n="string"==typeof e?e:e.key,r=i.get(s);return r&&r.hasOwnProperty(n)?r[n]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e,i){var s=[],n=this.game.cache.json.get(t);if(!n)return console.warn("No Aseprite data found for: "+t),s;var r=this,o=u(n,"meta",null),a=u(n,"frames",null);return o&&a&&u(o,"frameTags",[]).forEach((function(n){var o=[],h=l(n,"name",null),u=l(n,"from",0),d=l(n,"to",0),f=l(n,"direction","forward");if(h&&(!e||e&&e.indexOf(h)>-1)){for(var p=0,g=u;g<=d;g++){var v=g.toString(),m=a[v];if(m){var y=l(m,"duration",c.MAX_SAFE_INTEGER);o.push({key:t,frame:v,duration:y}),p+=y}}var x=p/o.length;o.forEach((function(t){t.duration-=x})),"reverse"===f&&(o=o.reverse());var T,w={key:h,frames:o,duration:p,yoyo:"pingpong"===f};i?i.anims&&(T=i.anims.create(w)):T=r.create(w),T&&s.push(T)}})),s},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("AnimationManager key already exists: "+e):(i=new s(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var s=0;s{var s=i(85463),n=i(17489),r=i(56694),o=i(33885),a=i(16938),h=i(72632),l=new r({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(a.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.randomFrame=!1,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showBeforeDelay=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;ir&&(l=0),this.randomFrame&&(l=n(0,r-1));var u=s.frames[l];0!==l||this.forward||(u=s.getLastFrame()),this.currentFrame=u}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,s=this.nextAnimsQueue;i&&s.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent,n="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===n)return s;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(r>0)return this.playAfterDelay(t,r)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(a.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(a.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(a.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(a.ANIMATION_COMPLETE,a.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim;if(i){var s=this.currentFrame,n=this.parent,r=s.textureFrame;n.emit(t,i,s,n,r),e&&n.emit(e+i.key,i,s,n,r)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,s=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(a.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):s},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale*this.animationManager.globalTimeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var s=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),s++}while(this.isPlaying&&this.accumulator>this.nextTick&&s<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(a.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))?console.warn("Animation key already exists: "+e):(i=new s(this,e,t),this.anims||(this.anims=new o),this.anims.set(e,i))),i},createFromAseprite:function(t,e){return this.animationManager.createFromAseprite(t,e,this.parent)},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(a.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=l},44509:t=>{t.exports="add"},84563:t=>{t.exports="animationcomplete"},61586:t=>{t.exports="animationcomplete-"},72175:t=>{t.exports="animationrepeat"},568:t=>{t.exports="animationrestart"},37690:t=>{t.exports="animationstart"},58525:t=>{t.exports="animationstop"},5243:t=>{t.exports="animationupdate"},10598:t=>{t.exports="pauseall"},4860:t=>{t.exports="remove"},31865:t=>{t.exports="resumeall"},16938:(t,e,i)=>{t.exports={ADD_ANIMATION:i(44509),ANIMATION_COMPLETE:i(84563),ANIMATION_COMPLETE_KEY:i(61586),ANIMATION_REPEAT:i(72175),ANIMATION_RESTART:i(568),ANIMATION_START:i(37690),ANIMATION_STOP:i(58525),ANIMATION_UPDATE:i(5243),PAUSE_ALL:i(10598),REMOVE_ANIMATION:i(4860),RESUME_ALL:i(31865)}},13517:(t,e,i)=>{t.exports={Animation:i(85463),AnimationFrame:i(71519),AnimationManager:i(90249),AnimationState:i(16569),Events:i(16938)}},23740:(t,e,i)=>{var s=i(56694),n=i(33885),r=i(6659),o=i(69773),a=new s({initialize:function(){this.entries=new n,this.events=new r},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},43474:(t,e,i)=>{var s=i(23740),n=i(56694),r=i(97081),o=new n({initialize:function(t){this.game=t,this.binary=new s,this.bitmapFont=new s,this.json=new s,this.physics=new s,this.shader=new s,this.audio=new s,this.video=new s,this.text=new s,this.html=new s,this.obj=new s,this.tilemap=new s,this.xml=new s,this.custom={},this.game.events.once(r.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new s),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e{t.exports="add"},75968:t=>{t.exports="remove"},69773:(t,e,i)=>{t.exports={ADD:i(94762),REMOVE:i(75968)}},45820:(t,e,i)=>{t.exports={BaseCache:i(23740),CacheManager:i(43474),Events:i(69773)}},51052:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(6659),a=i(89787),h=i(74118),l=i(69360),u=i(93222),c=i(93736),d=new s({Extends:o,Mixins:[n.AlphaSingle,n.Visible],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=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=s,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,s/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var s=.5*this.width,n=.5*this.height;return i.x=t-s,i.y=e-n,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.y,p=f+d,g=this.x,v=g+c,m=this.culledObjects,y=t.length;o=1/o,m.length=0;for(var x=0;xg&&E*i+S*n+af&&E*s+S*r+hn&&(t=n),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,s=e.y+(i-this.height)/2,n=Math.max(s,s+e.height-i);return tn&&(t=n),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,s,n){return void 0===n&&(n=!1),this._bounds.setTo(t,e,i,s),this.dirty=!0,this.useBounds=!0,n?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t,e){void 0===e&&(e=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t,this.isSceneCamera=e;var i=t.sys;return this.sceneManager=i.game.scene,this.scaleManager=i.scale,this.cameraManager=i.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},setIsSceneCamera:function(t){return this.isSceneCamera=t,this},updateSystem:function(){if(this.scaleManager&&this.isSceneCamera){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){t!==this._scrollX&&(this._scrollX=t,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(t){t!==this._scrollY&&(this._scrollY=t,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},47751:(t,e,i)=>{var s=i(51052),n=i(79993),r=i(82897),o=i(56694),a=i(64937),h=i(53030),l=i(89787),u=i(42798),c=i(74118),d=i(93736),f=new o({Extends:s,Mixins:[a.PostPipeline],initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new c(0,0,t,e),this._follow){var i=this.width/2,s=this.height/2,r=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(r,o),this.scrollX=r-i,this.scrollY=o-s}n(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,s,n,r){return this.fadeEffect.start(!1,t,e,i,s,!0,n,r)},fadeOut:function(t,e,i,s,n,r){return this.fadeEffect.start(!0,t,e,i,s,!0,n,r)},fadeFrom:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!1,t,e,i,s,n,r,o)},fade:function(t,e,i,s,n,r,o){return this.fadeEffect.start(!0,t,e,i,s,n,r,o)},flash:function(t,e,i,s,n,r,o){return this.flashEffect.start(t,e,i,s,n,r,o)},shake:function(t,e,i,s,n){return this.shakeEffect.start(t,e,i,s,n)},pan:function(t,e,i,s,n,r,o){return this.panEffect.start(t,e,i,s,n,r,o)},rotateTo:function(t,e,i,s,n,r,o){return this.rotateToEffect.start(t,e,i,s,n,r,o)},zoomTo:function(t,e,i,s,n,r){return this.zoomEffect.start(t,e,i,s,n,r)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,s=.5*e,r=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,c=this._follow,d=this.deadzone,f=this.scrollX,p=this.scrollY;d&&n(d,this.midPoint.x,this.midPoint.y);var g=!1;if(c&&!this.panEffect.isRunning){var v=this.lerp,m=c.x-this.followOffset.x,y=c.y-this.followOffset.y;d?(md.right&&(f=u(f,f+(m-d.right),v.x)),yd.bottom&&(p=u(p,p+(y-d.bottom),v.y))):(f=u(f,m-a,v.x),p=u(p,y-h,v.y)),g=!0}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.scrollX=f,this.scrollY=p;var x=f+i,T=p+s;this.midPoint.set(x,T);var w=t/r,b=e/r,E=Math.floor(x-w/2),S=Math.floor(T-b/2);this.worldView.setTo(E,S,w,b),o.applyITRS(Math.floor(this.x+a),Math.floor(this.y+h),this.rotation,r,r),o.translate(-a,-h),this.shakeEffect.preRender(),g&&this.emit(l.FOLLOW_UPDATE,this,c)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,s,n,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===s&&(s=i),void 0===n&&(n=0),void 0===o&&(o=n),this._follow=t,this.roundPixels=e,i=r(i,0,1),s=r(s,0,1),this.lerp.set(i,s),this.followOffset.set(n,o);var a=this.width/2,h=this.height/2,l=t.x-n,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},62382:(t,e,i)=>{var s=i(47751),n=i(56694),r=i(72632),o=i(91963),a=i(94287),h=i(40444),l=i(7599),u=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new s(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=!1),void 0===o&&(o="");var a=new s(t,e,i,n);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),r&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var s=!1,n=0;n0){r.preRender();var o=this.getVisibleChildren(e.getChildren(),r);t.render(i,o,r)}}},getVisibleChildren:function(t,e){return t.filter((function(t){return t.willRender(e)}))},resetAll:function(){for(var t=0;t{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=s,this.blue=n,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,s,n),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===s&&(s=255),void 0===n&&(n=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!n&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=s,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(r.FLASH_START,this.camera,this,t,e,i,s)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=i(93736),h=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=r.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof s&&r.hasOwnProperty(s)?this.ease=r[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed{var s=i(82897),n=i(56694),r=i(89787),o=i(35060),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,s,n,a,h){void 0===i&&(i=1e3),void 0===s&&(s=o.Linear),void 0===n&&(n=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!n&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.rotation,this.destination=l,"string"==typeof s&&o.hasOwnProperty(s)?this.ease=o[s]:"function"==typeof s&&(this.ease=s),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d,f;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+u)-this.source)<(f=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>f&&(this.clockwise=!1)}return this.camera.emit(r.ROTATE_START,this.camera,this,i,l),c},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=s(this._elapsed/this.duration,0,1);this.progress=i;var n=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var u;u=this.clockwise?n.rotation+o*r:n.rotation-o*r,n.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,u)}else n.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,n,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(r.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},3241:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(89787),o=i(93736),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===s&&(s=null),void 0===n&&(n=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=n,this.camera.emit(r.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{var s=i(82897),n=i(56694),r=i(35060),o=i(89787),a=new n({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,s,n,a){void 0===e&&(e=1e3),void 0===i&&(i=r.Linear),void 0===s&&(s=!1),void 0===n&&(n=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&r.hasOwnProperty(i)?this.ease=r[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=n,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=s(this._elapsed/this.duration,0,1),this._elapsed{t.exports={Fade:i(92522),Flash:i(22151),Pan:i(37551),Shake:i(3241),RotateTo:i(1771),Zoom:i(13383)}},39577:t=>{t.exports="cameradestroy"},85373:t=>{t.exports="camerafadeincomplete"},92057:t=>{t.exports="camerafadeinstart"},1903:t=>{t.exports="camerafadeoutcomplete"},96131:t=>{t.exports="camerafadeoutstart"},85409:t=>{t.exports="cameraflashcomplete"},25500:t=>{t.exports="cameraflashstart"},44071:t=>{t.exports="followupdate"},19818:t=>{t.exports="camerapancomplete"},80002:t=>{t.exports="camerapanstart"},87966:t=>{t.exports="postrender"},74217:t=>{t.exports="prerender"},34805:t=>{t.exports="camerarotatecomplete"},30408:t=>{t.exports="camerarotatestart"},49856:t=>{t.exports="camerashakecomplete"},69189:t=>{t.exports="camerashakestart"},67657:t=>{t.exports="camerazoomcomplete"},14229:t=>{t.exports="camerazoomstart"},89787:(t,e,i)=>{t.exports={DESTROY:i(39577),FADE_IN_COMPLETE:i(85373),FADE_IN_START:i(92057),FADE_OUT_COMPLETE:i(1903),FADE_OUT_START:i(96131),FLASH_COMPLETE:i(85409),FLASH_START:i(25500),FOLLOW_UPDATE:i(44071),PAN_COMPLETE:i(19818),PAN_START:i(80002),POST_RENDER:i(87966),PRE_RENDER:i(74217),ROTATE_COMPLETE:i(34805),ROTATE_START:i(30408),SHAKE_COMPLETE:i(49856),SHAKE_START:i(69189),ZOOM_COMPLETE:i(67657),ZOOM_START:i(14229)}},32356:(t,e,i)=>{t.exports={Camera:i(47751),BaseCamera:i(51052),CameraManager:i(62382),Effects:i(53030),Events:i(89787)}},84219:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.speedX=0,this.speedY=0;var e=n(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=n(t,"speed.x",0),this.speedY=n(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},69370:(t,e,i)=>{var s=i(56694),n=i(10850),r=new s({initialize:function(t){this.camera=n(t,"camera",null),this.left=n(t,"left",null),this.right=n(t,"right",null),this.up=n(t,"up",null),this.down=n(t,"down",null),this.zoomIn=n(t,"zoomIn",null),this.zoomOut=n(t,"zoomOut",null),this.zoomSpeed=n(t,"zoomSpeed",.01),this.minZoom=n(t,"minZoom",.001),this.maxZoom=n(t,"maxZoom",1e3),this.accelX=0,this.accelY=0;var e=n(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=n(t,"acceleration.x",0),this.accelY=n(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=n(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=n(t,"drag.x",0),this.dragY=n(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var s=n(t,"maxSpeed",null);"number"==typeof s?(this.maxSpeedX=s,this.maxSpeedY=s):(this.maxSpeedX=n(t,"maxSpeed.x",0),this.maxSpeedY=n(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoomthis.maxZoom&&(e.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},6524:(t,e,i)=>{t.exports={FixedKeyControl:i(84219),SmoothedKeyControl:i(69370)}},44143:(t,e,i)=>{t.exports={Controls:i(6524),Scene2D:i(32356)}},86459:(t,e,i)=>{var s={VERSION:"3.70.0",BlendModes:i(95723),ScaleModes:i(27394),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=s},14033:(t,e,i)=>{var s=i(56694),n=i(86459),r=i(18360),o=i(77290),a=i(72632),h=i(10850),l=i(42911),u=i(72283),c=i(5923),d=i(65641),f=i(93222),p=new s({initialize:function(t){void 0===t&&(t={});var e=h(t,"scale",null);this.width=h(e,"width",1024,t),this.height=h(e,"height",768,t),this.zoom=h(e,"zoom",1,t),this.parent=h(e,"parent",void 0,t),this.scaleMode=h(e,e?"mode":"scaleMode",0,t),this.expandParent=h(e,"expandParent",!0,t),this.autoRound=h(e,"autoRound",!1,t),this.autoCenter=h(e,"autoCenter",0,t),this.resizeInterval=h(e,"resizeInterval",500,t),this.fullscreenTarget=h(e,"fullscreenTarget",null,t),this.minWidth=h(e,"min.width",0,t),this.maxWidth=h(e,"max.width",0,t),this.minHeight=h(e,"min.height",0,t),this.maxHeight=h(e,"max.height",0,t),this.renderType=h(t,"type",n.AUTO),this.canvas=h(t,"canvas",null),this.context=h(t,"context",null),this.canvasStyle=h(t,"canvasStyle",null),this.customEnvironment=h(t,"customEnvironment",!1),this.sceneConfig=h(t,"scene",null),this.seed=h(t,"seed",[(Date.now()*Math.random()).toString()]),c.RND=new c.RandomDataGenerator(this.seed),this.gameTitle=h(t,"title",""),this.gameURL=h(t,"url","https://phaser.io"),this.gameVersion=h(t,"version",""),this.autoFocus=h(t,"autoFocus",!0),this.stableSort=h(t,"stableSort",-1),-1===this.stableSort&&(this.stableSort=o.browser.es2019?1:0),o.features.stableSort=this.stableSort,this.domCreateContainer=h(t,"dom.createContainer",!1),this.domPointerEvents=h(t,"dom.pointerEvents","none"),this.inputKeyboard=h(t,"input.keyboard",!0),this.inputKeyboardEventTarget=h(t,"input.keyboard.target",window),this.inputKeyboardCapture=h(t,"input.keyboard.capture",[]),this.inputMouse=h(t,"input.mouse",!0),this.inputMouseEventTarget=h(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=h(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=h(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=h(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=h(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=h(t,"input.touch",o.input.touch),this.inputTouchEventTarget=h(t,"input.touch.target",null),this.inputTouchCapture=h(t,"input.touch.capture",!0),this.inputActivePointers=h(t,"input.activePointers",1),this.inputSmoothFactor=h(t,"input.smoothFactor",0),this.inputWindowEvents=h(t,"input.windowEvents",!0),this.inputGamepad=h(t,"input.gamepad",!1),this.inputGamepadEventTarget=h(t,"input.gamepad.target",window),this.disableContextMenu=h(t,"disableContextMenu",!1),this.audio=h(t,"audio",{}),this.hideBanner=!1===h(t,"banner",null),this.hidePhaser=h(t,"banner.hidePhaser",!1),this.bannerTextColor=h(t,"banner.text","#ffffff"),this.bannerBackgroundColor=h(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=h(t,"fps",null),this.disablePreFX=h(t,"disablePreFX",!1),this.disablePostFX=h(t,"disablePostFX",!1);var i=h(t,"render",null);this.pipeline=h(i,"pipeline",null,t),this.autoMobilePipeline=h(i,"autoMobilePipeline",!0,t),this.defaultPipeline=h(i,"defaultPipeline",d.MULTI_PIPELINE,t),this.antialias=h(i,"antialias",!0,t),this.antialiasGL=h(i,"antialiasGL",!0,t),this.mipmapFilter=h(i,"mipmapFilter","",t),this.desynchronized=h(i,"desynchronized",!1,t),this.roundPixels=h(i,"roundPixels",!0,t),this.pixelArt=h(i,"pixelArt",1!==this.zoom,t),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=h(i,"transparent",!1,t),this.clearBeforeRender=h(i,"clearBeforeRender",!0,t),this.preserveDrawingBuffer=h(i,"preserveDrawingBuffer",!1,t),this.premultipliedAlpha=h(i,"premultipliedAlpha",!0,t),this.failIfMajorPerformanceCaveat=h(i,"failIfMajorPerformanceCaveat",!1,t),this.powerPreference=h(i,"powerPreference","default",t),this.batchSize=h(i,"batchSize",4096,t),this.maxTextures=h(i,"maxTextures",-1,t),this.maxLights=h(i,"maxLights",10,t);var s=h(t,"backgroundColor",0);this.backgroundColor=f(s),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=h(t,"callbacks.preBoot",u),this.postBoot=h(t,"callbacks.postBoot",u),this.physics=h(t,"physics",{}),this.defaultPhysicsSystem=h(this.physics,"default",!1),this.loaderBaseURL=h(t,"loader.baseURL",""),this.loaderPath=h(t,"loader.path",""),this.loaderMaxParallelDownloads=h(t,"loader.maxParallelDownloads",o.os.android?6:32),this.loaderCrossOrigin=h(t,"loader.crossOrigin",void 0),this.loaderResponseType=h(t,"loader.responseType",""),this.loaderAsync=h(t,"loader.async",!0),this.loaderUser=h(t,"loader.user",""),this.loaderPassword=h(t,"loader.password",""),this.loaderTimeout=h(t,"loader.timeout",0),this.loaderWithCredentials=h(t,"loader.withCredentials",!1),this.loaderImageLoadType=h(t,"loader.imageLoadType","XHR"),this.loaderLocalScheme=h(t,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=h(t,"fx.glow.quality",.1),this.glowFXDistance=h(t,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var p=h(t,"plugins",null),g=r.DefaultScene;p&&(Array.isArray(p)?this.defaultPlugins=p:l(p)&&(this.installGlobalPlugins=a(p,"global",[]),this.installScenePlugins=a(p,"scene",[]),Array.isArray(p.default)?g=p.default:Array.isArray(p.defaultMerge)&&(g=g.concat(p.defaultMerge)))),this.defaultPlugins=g;var v="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=h(t,"images.default",v+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=h(t,"images.missing",v+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=h(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=n.WEBGL:window.FORCE_CANVAS&&(this.renderType=n.CANVAS))}});t.exports=p},50150:(t,e,i)=>{var s=i(70616),n=i(61068),r=i(86459),o=i(90185);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.AUTO&&(e.renderType=o.webGL?r.WEBGL:r.CANVAS),e.renderType===r.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else{if(e.renderType!==r.CANVAS)throw new Error("Unknown value for renderer type: "+e.renderType);if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}e.antialias||n.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=n.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||s.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(91135),h=i(11857),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},77291:(t,e,i)=>{var s=i(86459);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===s.CANVAS?i="Canvas":e.renderType===s.HEADLESS&&(i="Headless");var n,r=e.audio,o=t.device.audio;if(n=o.webAudio&&!r.disableWebAudio?"Web Audio":r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+s.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+s.VERSION+" ("+i+" | "+n+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},15213:(t,e,i)=>{var s=i(99584),n=i(90249),r=i(43474),o=i(61068),a=i(56694),h=i(14033),l=i(85178),u=i(50150),c=i(81078),d=i(77291),f=i(77290),p=i(21546),g=i(6659),v=i(97081),m=i(69898),y=i(91963),x=i(49274),T=i(756),w=i(13553),b=i(38203),E=i(6237),S=i(26617),A=i(26493),_=i(84191),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new n(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this,new g),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),s(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var s=this.renderer;s.preRender(),i.emit(v.PRE_RENDER,s,t,e),this.scene.render(s),s.postRender(),i.emit(v.POST_RENDER,s,t,e)}},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),this.scene.isProcessing=!1,i.emit(v.PRE_RENDER,null,t,e),i.emit(v.POST_RENDER,null,t,e)}},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},pause:function(){var t=this.isPaused;this.isPaused=!0,t||this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},resume:function(){var t=this.isPaused;this.isPaused=!1,t&&this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},26617:(t,e,i)=>{var s=i(56694),n=i(10850),r=i(72283),o=i(27385),a=new s({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=n(e,"min",5),this.targetFps=n(e,"target",60),this.fpsLimit=n(e,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=n(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=n(e,"deltaHistory",10),this.panicMax=n(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=n(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,t=Math.min(t,this._target)),t>this._min&&(t=i[e],t=Math.min(t,this._min)),i[e]=t,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var n=0,r=0;r=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(t,this.delta),this.delta=0),this.lastTime=t,this.frame++},step:function(t){this.now=t;var e=Math.max(0,t-this.lastTime);this.rawDelta=e,this.time+=this.rawDelta,this.smoothStep&&(e=this.smoothDelta(e)),this.delta=e,t>=this.nextFpsUpdate&&this.updateFPS(t),this.framesThisSecond++,this.callback(t,e),this.lastTime=t,this.frame++},tick:function(){var t=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(t):this.step(t)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){void 0===t&&(t=!1);var e=window.performance.now();if(!this.running){t&&(this.startTime+=-this.lastTime+(this.lastTime+e));var i=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(i,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=e+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});t.exports=a},26493:(t,e,i)=>{var s=i(97081);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(s.HIDDEN):i.emit(s.VISIBLE)}),!1),window.onblur=function(){i.emit(s.BLUR)},window.onfocus=function(){i.emit(s.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},41651:t=>{t.exports="blur"},5520:t=>{t.exports="boot"},51673:t=>{t.exports="contextlost"},25055:t=>{t.exports="destroy"},23767:t=>{t.exports="focus"},57564:t=>{t.exports="hidden"},38327:t=>{t.exports="pause"},43807:t=>{t.exports="postrender"},73652:t=>{t.exports="poststep"},780:t=>{t.exports="prerender"},13781:t=>{t.exports="prestep"},38247:t=>{t.exports="ready"},29129:t=>{t.exports="resume"},34994:t=>{t.exports="step"},55237:t=>{t.exports="systemready"},98704:t=>{t.exports="visible"},97081:(t,e,i)=>{t.exports={BLUR:i(41651),BOOT:i(5520),CONTEXT_LOST:i(51673),DESTROY:i(25055),FOCUS:i(23767),HIDDEN:i(57564),PAUSE:i(38327),POST_RENDER:i(43807),POST_STEP:i(73652),PRE_RENDER:i(780),PRE_STEP:i(13781),READY:i(38247),RESUME:i(29129),STEP:i(34994),SYSTEM_READY:i(55237),VISIBLE:i(98704)}},80293:(t,e,i)=>{t.exports={Config:i(14033),CreateRenderer:i(50150),DebugHeader:i(77291),Events:i(97081),TimeStep:i(26617),VisibilityHandler:i(26493)}},52780:(t,e,i)=>{var s=i(81543),n=i(61068),r=i(10850);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",s),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=n.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d",{willReadFrequently:!0});u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;v{t.exports={GenerateTexture:i(52780),Palettes:i(25235)}},81543:t=>{t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},75846:t=>{t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},83206:t=>{t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},13194:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},50686:t=>{t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},25235:(t,e,i)=>{t.exports={ARNE16:i(81543),C64:i(75846),CGA:i(83206),JMP:i(13194),MSX:i(50686)}},63120:(t,e,i)=>{var s=i(56694),n=i(34631),r=i(38517),o=i(93736),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,"CubicBezierCurve"),Array.isArray(t)&&(s=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=s},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,r=this.p2,a=this.p3;return e.set(n(t,i.x,s.x,r.x,a.x),n(t,i.y,s.y,r.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(56694),n=i(80222),r=i(74118),o=i(93736),a=new s({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new r),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var s=Math.max(1,Math.round(i/e));return n(this.getSpacedPoints(s),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],s=this.getPoint(0,this._tmpVec2A),n=0;i.push(0);for(var r=1;r<=t;r++)n+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(s),i.push(n),s.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++)i.push(this.getPoint(s/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var s=0;s<=t;s++){var n=this.getUtoTmapping(s/t,null,t);i.push(this.getPoint(n))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=1e-4,s=t-i,n=t+i;return s<0&&(s=0),n>1&&(n=1),this.getPoint(s,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var s,n=this.getLengths(i),r=0,o=n.length;s=e?Math.min(e,n[o-1]):t*n[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=n[r=Math.floor(h+(l-h)/2)]-s)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===s)return r/(o-1);var u=n[r];return(r+(s-u)/(n[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},48835:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(75606),o=i(10850),a=i(23701),h=i(93736),l=new s({Extends:n,initialize:function(t,e,i,s,a,l,u,c){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),s=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===s&&(s=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=0);n.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=s,this._startAngle=r(a),this._endAngle=r(l),this._clockwise=u,this._rotation=r(c)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,s=this._endAngle-this._startAngle,n=Math.abs(s)i;)s-=i;s{var s=i(56694),n=i(38517),r=i(80222),o=i(74118),a=i(93736),h=new s({Extends:n,initialize:function(t,e){n.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),r([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},getUtoTmapping:function(t,e,i){var s;if(e){var n=this.getLengths(i),r=n[n.length-1];s=Math.min(e,r)/r}else s=t;return s},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),s=new a(e[2],e[3]);return new h(i,s)},t.exports=h},64761:(t,e,i)=>{var s=i(56694),n=i(38517),r=i(16252),o=i(93736),a=new s({Extends:n,initialize:function(t,e,i){n.call(this,"QuadraticBezierCurve"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,s=this.p1,n=this.p2;return e.set(r(t,i.x,s.x,n.x),r(t,i.y,s.y,n.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var s=1;s{var s=i(14976),n=i(56694),r=i(38517),o=i(93736),a=new n({Extends:r,initialize:function(t){void 0===t&&(t=[]),r.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(s(a,h.x,l.x,u.x,c.x),s(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e{t.exports={Path:i(12822),MoveTo:i(53639),CubicBezier:i(63120),Curve:i(38517),Ellipse:i(48835),Line:i(58084),QuadraticBezier:i(64761),Spline:i(11956)}},53639:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e){this.active=!1,this.p0=new n(t,e)},getPoint:function(t,e){return void 0===e&&(e=new n),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=r},12822:(t,e,i)=>{var s=i(56694),n=i(63120),r=i(48835),o=i(61286),a=i(58084),h=i(53639),l=i(64761),u=i(74118),c=i(11956),d=i(93736),f=i(83392),p=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);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=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=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;n1&&!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=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):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{var s=i(56694),n=i(35026),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{var s=i(56694),n=i(81078),r=i(91963),o=i(7599),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},73569:t=>{t.exports="changedata"},15590:t=>{t.exports="changedata-"},37669:t=>{t.exports="destroy"},87090:t=>{t.exports="removedata"},90142:t=>{t.exports="setdata"},35026:(t,e,i)=>{t.exports={CHANGE_DATA:i(73569),CHANGE_DATA_KEY:i(15590),DESTROY:i(37669),REMOVE_DATA:i(87090),SET_DATA:i(90142)}},1999:(t,e,i)=>{t.exports={DataManager:i(81078),DataManagerPlugin:i(76508),Events:i(35026)}},10720:(t,e,i)=>{var s=i(1350),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}()},1350:(t,e,i)=>{var s,n=i(36580),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/.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+) 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)},98581:(t,e,i)=>{var s,n,r,o=i(61068),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)},90185:(t,e,i)=>{var s=i(36580),n=i(1350),r=i(61068),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}()},33553: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{var s=i(1350),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)},36580: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}()},53861:(t,e,i)=>{var s=i(72632),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.exports={os:i(36580),browser:i(1350),features:i(90185),input:i(95872),audio:i(10720),video:i(53861),fullscreen:i(33553),canvasFeatures:i(98581)}},65246:(t,e,i)=>{var s=i(56694),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},39298:(t,e,i)=>{var s=i(56694),n=i(72283),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},84093: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}},32058:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(73174),o=i(28417);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}},85535:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(74465);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}},9605:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(19298);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}},22529:(t,e,i)=>{var s=i(21843),n=i(59994),r=i(29568);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}},5739:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(74465);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}},40327:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(32058),n[s.BOTTOM_LEFT]=i(85535),n[s.BOTTOM_RIGHT]=i(9605),n[s.CENTER]=i(22529),n[s.LEFT_CENTER]=i(5739),n[s.RIGHT_CENTER]=i(27683),n[s.TOP_CENTER]=i(96439),n[s.TOP_LEFT]=i(81447),n[s.TOP_RIGHT]=i(47888),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)}},27683:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(19298);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}},96439:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(28417),o=i(84349);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}},81447:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(74465),o=i(84349);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}},47888:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(19298),o=i(84349);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}},46997:(t,e,i)=>{t.exports={BottomCenter:i(32058),BottomLeft:i(85535),BottomRight:i(9605),Center:i(22529),LeftCenter:i(5739),QuickSet:i(40327),RightCenter:i(27683),TopCenter:i(96439),TopLeft:i(81447),TopRight:i(47888)}},93545:(t,e,i)=>{var s=i(84093),n=i(98611),r={In:i(46997),To:i(86639)};r=n(!1,r,s),t.exports=r},27118:(t,e,i)=>{var s=i(97328),n=i(59994),r=i(28417),o=i(84349);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}},84469:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(74465),o=i(84349);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}},51577:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(19298),o=i(84349);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}},90271:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(73174),o=i(19298);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}},30466:(t,e,i)=>{var s=i(29568),n=i(40163),r=i(81711),o=i(19298);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}},50087:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(19298),o=i(84349);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}},82590:(t,e,i)=>{var s=i(84093),n=[];n[s.BOTTOM_CENTER]=i(27118),n[s.BOTTOM_LEFT]=i(84469),n[s.BOTTOM_RIGHT]=i(51577),n[s.LEFT_BOTTOM]=i(90271),n[s.LEFT_CENTER]=i(30466),n[s.LEFT_TOP]=i(50087),n[s.RIGHT_BOTTOM]=i(13555),n[s.RIGHT_CENTER]=i(99049),n[s.RIGHT_TOP]=i(67788),n[s.TOP_CENTER]=i(78170),n[s.TOP_LEFT]=i(54145),n[s.TOP_RIGHT]=i(75548),t.exports=function(t,e,i,s,r){return n[i](t,e,s,r)}},13555:(t,e,i)=>{var s=i(97328),n=i(70271),r=i(73174),o=i(74465);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}},99049:(t,e,i)=>{var s=i(29568),n=i(70271),r=i(81711),o=i(74465);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}},67788:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(74465),o=i(84349);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}},78170:(t,e,i)=>{var s=i(59994),n=i(47196),r=i(73174),o=i(28417);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}},54145:(t,e,i)=>{var s=i(40163),n=i(47196),r=i(73174),o=i(74465);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}},75548:(t,e,i)=>{var s=i(70271),n=i(47196),r=i(73174),o=i(19298);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}},86639:(t,e,i)=>{t.exports={BottomCenter:i(27118),BottomLeft:i(84469),BottomRight:i(51577),LeftBottom:i(90271),LeftCenter:i(30466),LeftTop:i(50087),QuickSet:i(82590),RightBottom:i(13555),RightCenter:i(99049),RightTop:i(67788),TopCenter:i(78170),TopLeft:i(54145),TopRight:i(75548)}},21843:(t,e,i)=>{var s=i(28417),n=i(81711);t.exports=function(t,e,i){return s(t,e),n(t,i)}},97328:t=>{t.exports=function(t){return t.y+t.height-t.height*t.originY}},7126:(t,e,i)=>{var s=i(97328),n=i(40163),r=i(70271),o=i(47196),a=i(74118);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}},59994:t=>{t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},29568:t=>{t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},40163:t=>{t.exports=function(t){return t.x-t.width*t.originX}},52088:t=>{t.exports=function(t){return t.width*t.originX}},23379:t=>{t.exports=function(t){return t.height*t.originY}},70271:t=>{t.exports=function(t){return t.x+t.width-t.width*t.originX}},47196:t=>{t.exports=function(t){return t.y-t.height*t.originY}},73174:t=>{t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},28417:t=>{t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},81711:t=>{t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},74465:t=>{t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},19298:t=>{t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},84349:t=>{t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},15252:(t,e,i)=>{t.exports={CenterOn:i(21843),GetBottom:i(97328),GetBounds:i(7126),GetCenterX:i(59994),GetCenterY:i(29568),GetLeft:i(40163),GetOffsetX:i(52088),GetOffsetY:i(23379),GetRight:i(70271),GetTop:i(47196),SetBottom:i(73174),SetCenterX:i(28417),SetCenterY:i(81711),SetLeft:i(74465),SetRight:i(19298),SetTop:i(84349)}},70616: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}}},61068:(t,e,i)=>{var s,n,r,o=i(86459),a=i(8213),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{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{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}},36505:t=>{t.exports=function(t,e){return void 0===e&&(e="none"),["-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}},23514:(t,e,i)=>{t.exports={CanvasInterpolation:i(70616),CanvasPool:i(61068),Smoothing:i(8213),TouchAction:i(59271),UserSelect:i(36505)}},27119:(t,e,i)=>{var s=i(56694),n=i(22946),r=i(5657),o=i(24650),a=i(68033),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},30245:(t,e,i)=>{var s=i(22946);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,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,g:o,b:e,color:s(r,o,e)});for(o=0,a=255,e=0;e<=n;e++,a--,r++)i.push({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.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}},25409:t=>{t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},22946:t=>{t.exports=function(t,e,i){return t<<16|e<<8|i}},5657:t=>{t.exports=function(t,e,i,s){return s<<24|t<<16|e<<8|i}},74777:(t,e,i)=>{var s=i(27119),n=i(59998);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)}},89263:(t,e,i)=>{var s=i(24650);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}},24650:(t,e,i)=>{var s=i(22946);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)}}},91487:(t,e,i)=>{var s=i(27119);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}},59998: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}},74853:(t,e,i)=>{var s=i(27119),n=i(15978);t.exports=function(t){var e=n(t);return new s(e.r,e.g,e.b,e.a)}},15978: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}}},53756:(t,e,i)=>{var s=i(42798),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)}}},73904:(t,e,i)=>{var s=i(27119);t.exports=function(t){return new s(t.r,t.g,t.b,t.a)}},26841:(t,e,i)=>{var s=i(27119);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}},68033: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{var s=i(25409);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)}},37243:(t,e,i)=>{var s=i(17489),n=i(27119);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))}},93222:(t,e,i)=>{var s=i(91487),n=i(74853),r=i(73904),o=i(26841);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)}}},95509:(t,e,i)=>{var s=i(27119);s.ColorSpectrum=i(30245),s.ColorToRGBA=i(86672),s.ComponentToHex=i(25409),s.GetColor=i(22946),s.GetColor32=i(5657),s.HexStringToColor=i(91487),s.HSLToColor=i(74777),s.HSVColorWheel=i(89263),s.HSVToRGB=i(24650),s.HueToComponent=i(59998),s.IntegerToColor=i(74853),s.IntegerToRGB=i(15978),s.Interpolate=i(53756),s.ObjectToColor=i(73904),s.RandomRGB=i(37243),s.RGBStringToColor=i(26841),s.RGBToHSV=i(68033),s.RGBToString=i(4880),s.ValueToColor=i(93222),t.exports=s},24816:(t,e,i)=>{t.exports={Align:i(93545),BaseShader:i(31053),Bounds:i(15252),Canvas:i(23514),Color:i(95509),ColorMatrix:i(65246),Masks:i(93310),RGB:i(39298)}},76756:(t,e,i)=>{var s=i(56694),n=i(61286),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},63037:(t,e,i)=>{var s=new(i(56694))({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},93310:(t,e,i)=>{t.exports={BitmapMask:i(76756),GeometryMask:i(63037)}},31053:(t,e,i)=>{var s=new(i(56694))({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},99584: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}},85178:(t,e,i)=>{var s=i(99584);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)}}},21546:(t,e,i)=>{var s=i(36580);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()}},74181: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}},9229:(t,e,i)=>{var s=i(55301);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}},2893: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}},89200:t=>{t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},55638:t=>{t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},27385:(t,e,i)=>{var s=i(56694),n=i(72283),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},3590:(t,e,i)=>{var s={AddToDOM:i(99584),DOMContentLoaded:i(21546),GetInnerHeight:i(74181),GetScreenOrientation:i(9229),GetTarget:i(2893),ParseXML:i(89200),RemoveFromDOM:i(55638),RequestAnimationFrame:i(27385)};t.exports=s},78491:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(91963),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},95146:(t,e,i)=>{t.exports={EventEmitter:i(78491)}},20170:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},51182:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},51498:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},12042:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},69900:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},48991:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(47406),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},47551:(t,e,i)=>{var s=new(i(56694))({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},47909:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},18919:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},62494:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},68897:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},58575:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},33755:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},24949:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},66241:(t,e,i)=>{var s=i(56694),n=i(47551),r=i(47406),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},47406: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}},96910:(t,e,i)=>{var s=i(98611),n=i(47406),r={Barrel:i(20170),Controller:i(47551),Bloom:i(51182),Blur:i(51498),Bokeh:i(12042),Circle:i(69900),ColorMatrix:i(48991),Displacement:i(47909),Glow:i(18919),Gradient:i(62494),Pixelate:i(68897),Shadow:i(58575),Shine:i(33755),Vignette:i(24949),Wipe:i(66241)};r=s(!1,r,n),t.exports=r},88933:(t,e,i)=>{var s=i(95723),n=i(20494);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}},32291:(t,e,i)=>{var s=i(20494);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}},91713:(t,e,i)=>{var s=i(56694),n=i(71207),r=i(91963),o=i(56631),a=i(7599),h=i(17922),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},89980:(t,e,i)=>{var s=i(56694),n=i(48129),r=i(81078),o=i(6659),a=i(56631),h=i(7599),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},99325:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),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},61286:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),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},73329:(t,e,i)=>{var s=i(69360),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}},92034:(t,e,i)=>{var s=i(56694),n=i(74623),r=i(91963),o=i(7599),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{t.exports=function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p){var g=i.x-e.displayOriginX+n,v=i.y-e.displayOriginY+r,m=g+i.w,y=v+i.h,x=o.getXRound(g,v,a),T=o.getYRound(g,v,a),w=o.getXRound(g,y,a),b=o.getYRound(g,y,a),E=o.getXRound(m,y,a),S=o.getYRound(m,y,a),A=o.getXRound(m,v,a),_=o.getYRound(m,v,a);t.batchQuad(e,x,T,w,b,E,S,A,_,s.u0,s.v0,s.u1,s.v1,h,l,u,c,d,f,p)}},82173:t=>{t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),void 0===s)return{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=t.text,h=a.length,l=t.maxWidth,u=t.wordWrapCharCode,c=Number.MAX_VALUE,d=Number.MAX_VALUE,f=0,p=0,g=t.fontData.chars,v=t.fontData.lineHeight,m=t.letterSpacing,y=t.lineSpacing,x=0,T=0,w=0,b=null,E=t._align,S=0,A=0,_=t.fontSize/t.fontData.size,C=_*t.scaleX,M=_*t.scaleY,R=null,P=0,O=[],L=Number.MAX_VALUE,F=0,D=0,k=0,I=[],B=[],N=null;if(l>0){for(n=0;nl||W-Y>l?(z.push(G.i-1),G.cr?(z.push(G.i+G.word.length),Y=0,X=null):X=G):G.cr&&(z.push(G.i+G.word.length),Y=0,X=null)}for(n=z.length-1;n>=0;n--)r=a,o=z[n],"\n",a=r.substr(0,o)+"\n"+r.substr(o+1);s.wrappedText=a,h=a.length,I=[],N=null}var H=0;for(n=0;nS&&(c=S),d>A&&(d=A);var q=S+b.xAdvance,K=A+v;fF&&(F=k),kF&&(F=k),k0)for(var J=0;J{var s=i(31476);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}},39860:(t,e,i)=>{var s=i(10850);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),g=s(e,"offset.y",0),v=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=g,b={retroFont:!0,font:h,size:i,lineHeight:n+y,chars:{}},E=0,S=0;S{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"),g=void 0!==i&&i.trimmed;if(g)var v=i.height,m=i.width;for(var y=0;y{var s=i(66863),n=i(98611),r={Parse:i(39860)};r=n(!1,r,s),t.exports=r},66863: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"}},13468:(t,e,i)=>{var s=i(44616),n=i(56694),r=i(88899),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},93438:(t,e,i)=>{var s=i(49584);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,g=0,v=0,m=null,y=0,x=0,T=0,w=0,b=0,E=0,S=null,A=0,_=e.frame.source.image,C=h.cutX,M=h.cutY,R=0,P=0,O=e._fontSize/e.fontData.size,L=e._align,F=0,D=0;e.getTextBounds(!1);var k=e._bounds.lines;1===L?D=(k.longest-k.lengths[0])/2:2===L&&(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{var s=i(13468),n=i(88933),r=i(99325),o=i(20494);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}))},94145:(t,e,i)=>{var s=i(13468);i(61286).register("dynamicBitmapText",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,n,r))}))},88899:(t,e,i)=>{var s,n,r=i(72283);s=i(16873),n=i(93438),t.exports={renderWebGL:s,renderCanvas:n}},16873:(t,e,i)=>{var s=i(73329),n=i(69360),r=i(75512),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 g,v,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),E=l.setGameObject(e),S=0,A=0,_=0,C=0,M=e.letterSpacing,R=0,P=0,O=e.scrollX,L=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{var s=i(56694),n=i(82897),r=i(64937),o=i(89980),a=i(82173),h=i(68298),l=i(31476),u=i(74118),c=i(84557),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{var s=i(49584);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,g=0,v=null,m=0,y=0,x=0,T=0,w=0,b=0,E=null,S=0,A=h.source.image,_=h.cutX,C=h.cutY,M=e._fontSize/e.fontData.size,R=e._align,P=0,O=0,L=e.getTextBounds(!1);e.maxWidth>0&&(o=(r=L.wrappedText).length);var F=e._bounds.lines;1===R?O=(F.longest-F.lengths[0])/2:2===R&&(O=F.longest-F.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,k=0;k{var s=i(44616),n=i(88933),r=i(99325),o=i(20494),a=i(10850);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}))},21797:(t,e,i)=>{var s=i(44616);i(61286).register("bitmapText",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84557:(t,e,i)=>{var s,n,r=i(72283);s=i(26372),n=i(97545),t.exports={renderWebGL:s,renderCanvas:n}},26372:(t,e,i)=>{var s=i(8810),n=i(73329),r=i(75512);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,g=e.tintFill,v=r.getTintAppendFloatAlpha,m=v(e.tintTopLeft,f*e._alphaTL),y=v(e.tintTopRight,f*e._alphaTR),x=v(e.tintBottomLeft,f*e._alphaBL),T=v(e.tintBottomRight,f*e._alphaBR),w=e.frame.glTexture,b=a.setGameObject(e),E=e.getTextBounds(!1).characters,S=e.dropShadowX,A=e.dropShadowY;if(0!==S||0!==A){var _=e.dropShadowColor,C=e.dropShadowAlpha,M=v(_,f*C*e._alphaTL),R=v(_,f*C*e._alphaTR),P=v(_,f*C*e._alphaBL),O=v(_,f*C*e._alphaBR);for(l=0;l{var s=i(92246),n=i(41664),r=i(56694),o=i(64937),a=i(82047),h=i(89980),l=i(71207),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;r0},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},33177: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;u0&&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,g,v,p.width,p.height),r.restore())):(l&&(g=Math.round(g),v=Math.round(v)),p.width>0&&p.height>0&&r.drawImage(f.source.image,p.x,p.y,p.width,p.height,g+c.x+a,v+c.y+h,p.width,p.height)))}r.restore()}}}},68452:(t,e,i)=>{var s=i(52816),n=i(88933),r=i(99325),o=i(20494);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}))},38906:(t,e,i)=>{var s=i(52816);i(61286).register("blitter",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},92246:(t,e,i)=>{var s,n,r=i(72283);s=i(89165),n=i(33177),t.exports={renderWebGL:s,renderCanvas:n}},89165:(t,e,i)=>{var s=i(69360),n=i(75512),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 g=0;g{var s=i(56694),n=i(82047),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},97123:(t,e,i)=>{var s=i(82897),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,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=s(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=s(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=s(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=s(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=n},15720:(t,e,i)=>{var s=i(82897),n={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=s(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=n},69732:(t,e,i)=>{var s=i(95723),n={_blendMode:s.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=s[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=n},28284:t=>{t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},85293:t=>{t.exports={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}}},14975:t=>{t.exports={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}}},88677:(t,e,i)=>{var s=i(56694),n=i(96910),r=i(72677),o=new s({initialize:function(t,e){this.gameObject=t,this.isPost=e,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(t){return void 0===t&&(t=0),this.padding=t,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(t){if(!this.isPost){var e=this.gameObject.scene.sys.renderer;e&&e.pipelines?(this.gameObject.pipeline=e.pipelines.FX_PIPELINE,void 0!==t&&(this.padding=t),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var t=this.list,e=0;e{t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,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},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},80693:(t,e,i)=>{var s=i(74118),n=i(2386),r=i(93736),o={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t,e){return void 0===t&&(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getTopLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new r),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,n,r,o,a,h,l;if(void 0===t&&(t=new s),this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,r=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),n=t.x,r=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,n,o,h),t.y=Math.min(i,r,a,l),t.width=Math.max(e,n,o,h)-t.x,t.height=Math.max(i,r,a,l)-t.y,t}};t.exports=o},39171:(t,e,i)=>{var s=i(76756),n=i(63037),r={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t,e,i,n,r){return void 0===t&&(this.texture||this.shader||this.geom)&&(t=this),new s(this.scene,t,e,i,n,r)},createGeometryMask:function(t){return void 0!==t||"Graphics"!==this.type&&!this.geom||(t=this),new n(this.scene,t)}};t.exports=r},28072:t=>{t.exports={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}}},54211:(t,e,i)=>{var s=i(75606),n=i(63130),r=i(10850),o=i(55303),a=i(93736),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=r(t,"from",0),t.to=r(t,"to",1);var h=n(t,"positionOnPath",!1);this.rotateToPath=n(t,"rotateToPath",!1),this.pathRotationOffset=r(t,"rotationOffset",0);var l=r(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.setTargetValue()}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),t.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.x-this.x)+s(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t&&t.data){var e=t.data[0],i=this.pathDelta,n=this.pathVector;if(i.copy(n).negate(),e.state===o.COMPLETE)return this.path.getPoint(e.end,n),i.add(n),n.add(this.pathOffset),void this.setPosition(n.x,n.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),n),i.add(n),n.add(this.pathOffset);var r=this.x,a=this.y;this.setPosition(n.x,n.y);var h=this.x-r,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+s(this.pathRotationOffset))}}};t.exports=h},58210:(t,e,i)=>{var s=i(28699),n={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(t){this.pipelineData={};var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(i){void 0===t&&(t=i.default);var s=i.get(t);if(s)return this.defaultPipeline=s,this.pipeline=s,!0}return!1},setPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){var o=r.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?s(e):e)}return this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},resetPipeline:function(t){return void 0===t&&(t=!1),this.pipeline=this.defaultPipeline,t&&(this.pipelineData={}),null!==this.pipeline},getPipelineName:function(){return this.pipeline.name}};t.exports=n},44086:(t,e,i)=>{var s=i(28699),n=i(88677),r=i(72677),o={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(t){this.postPipelines=[],this.postPipelineData={},this.postFX=new n(this,!0),t&&(this.preFX=new n(this,!1))},setPostPipeline:function(t,e,i){var n=this.scene.sys.renderer;if(!n)return this;var r=n.pipelines;if(r){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPostPipelineData:function(t,e){var i=this.postPipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e="string"==typeof t,i=this.postPipelines,s=[],n=0;n=0;s--){var n=i[s];(e&&n.name===t||!e&&n===t)&&(n.destroy(),r(i,s))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};t.exports=o},45900:t=>{t.exports={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}}},31654:t=>{var e={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var e=this.input;return e&&!e.customHitArea&&(e.hitArea.width=this.width,e.hitArea.height=this.height),this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=e},82081:(t,e,i)=>{var s=i(82047),n={texture:null,frame:null,isCropped:!1,setTexture:function(t,e,i,s){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e,i,s)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=n},21850:(t,e,i)=>{var s=i(82047),n={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,s){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,s,this.flipX,this.flipY);else{var n=t;this.frame.setCropUVs(this._crop,n.x,n.y,n.width,n.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),t instanceof s?(this.texture=this.scene.sys.textures.get(t.texture.key),this.frame=t):this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},58072:t=>{t.exports={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,s=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=s,this.tintFill=!1,this},setTintFill:function(t,e,i,s){return this.setTint(t,e,i,s),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}}},48129:t=>{t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},56584:(t,e,i)=>{var s=i(83392),n=i(69360),r=i(64462),o=i(35786),a=i(62138),h=i(93736),l={hasTransformComponent:!0,_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:0!==this._scaleY&&(this.renderFlags|=4)}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:0!==this._scaleX&&(this.renderFlags|=4)}},angle:{get:function(){return a(this._rotation*s.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*s.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.z=i,this.w=s,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*s,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new n);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(e||(e=new n),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,s){i||(i=new h),s||(s=this.scene.sys.cameras.main);var n=s.scrollX,o=s.scrollY,a=t+n*this.scrollFactorX-n,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):r(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},69360:(t,e,i)=>{var s=i(56694),n=i(83392),r=i(93736),o=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,s,n,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0},this.quad=new Float32Array(8)},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):s||r?n.TAU-(r>0?Math.acos(-s/this.scaleY):-Math.acos(s/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3];return s[0]=n*i+o*e,s[1]=r*i+a*e,s[2]=n*-e+o*i,s[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,s=t.matrix,n=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=s[0],c=s[1],d=s[2],f=s[3],p=s[4],g=s[5],v=void 0===e?i:e.matrix;return v[0]=u*n+c*o,v[1]=u*r+c*a,v[2]=d*n+f*o,v[3]=d*r+f*a,v[4]=p*n+g*o+h,v[5]=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var s=this.matrix,n=t.matrix,r=s[0],o=s[1],a=s[2],h=s[3],l=e*r+i*a+s[4],u=e*o+i*h+s[5],c=n[0],d=n[1],f=n[2],p=n[3],g=n[4],v=n[5];return s[0]=c*r+d*a,s[1]=c*o+d*h,s[2]=f*r+p*a,s[3]=f*o+p*h,s[4]=g*r+v*a+l,s[5]=g*o+v*h+u,this},transform:function(t,e,i,s,n,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+s*l,o[3]=i*h+s*u,o[4]=n*a+r*l+c,o[5]=n*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var s=this.matrix,n=s[0],r=s[1],o=s[2],a=s[3],h=s[4],l=s[5];return i.x=t*n+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=e*n-i*s;return t[0]=n/a,t[1]=-i/a,t[2]=-s/a,t[3]=e/a,t[4]=(s*o-n*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){return t.setTransform(this),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,s,n,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=s,o[4]=n,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],s=e[1],n=e[2],r=e[3],o=i*r-s*n;if(t.translateX=e[4],t.translateY=e[5],i||s){var a=Math.sqrt(i*i+s*s);t.rotation=s>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(n||r){var h=Math.sqrt(n*n+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-n/h):-Math.acos(n/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,s,n){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*s,r[1]=o*s,r[2]=-o*n,r[3]=a*n,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var s=this.matrix,n=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=1/(n*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=n*c*e+-o*c*t+(-u*n+l*o)*c,i},setQuad:function(t,e,i,s,n,r){void 0===n&&(n=!1),void 0===r&&(r=this.quad);var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return n?(r[0]=Math.round(t*a+e*l+c),r[1]=Math.round(t*h+e*u+d),r[2]=Math.round(t*a+s*l+c),r[3]=Math.round(t*h+s*u+d),r[4]=Math.round(i*a+s*l+c),r[5]=Math.round(i*h+s*u+d),r[6]=Math.round(i*a+e*l+c),r[7]=Math.round(i*h+e*u+d)):(r[0]=t*a+e*l+c,r[1]=t*h+e*u+d,r[2]=t*a+s*l+c,r[3]=t*h+s*u+d,r[4]=i*a+s*l+c,r[5]=i*h+s*u+d,r[6]=i*a+e*l+c,r[7]=i*h+e*u+d),r},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var s=this.getX(t,e);return i&&(s=Math.round(s)),s},getYRound:function(t,e,i){var s=this.getY(t,e);return i&&(s=Math.round(s)),s},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});t.exports=o},59694:t=>{t.exports={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}}},64937:(t,e,i)=>{t.exports={Alpha:i(97123),AlphaSingle:i(15720),BlendMode:i(69732),ComputedSize:i(28284),Crop:i(85293),Depth:i(14975),Flip:i(92972),FX:i(88677),GetBounds:i(80693),Mask:i(39171),Origin:i(28072),PathFollower:i(54211),Pipeline:i(58210),PostPipeline:i(44086),ScrollFactor:i(45900),Size:i(31654),Texture:i(82081),TextureCrop:i(21850),Tint:i(58072),ToJSON:i(48129),Transform:i(56584),TransformMatrix:i(69360),Visible:i(59694)}},70339:(t,e,i)=>{var s=i(59959),n=i(95723),r=i(56694),o=i(64937),a=i(56631),h=i(89980),l=i(74118),u=i(98524),c=i(58795),d=i(93736),f=new r({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.PostPipeline,o.Transform,o.Visible,u],initialize:function(t,e,i,s){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(e,i),this.setBlendMode(n.SKIP_CHECK),s&&this.add(s)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,s=new l,n=!1;t.setEmpty();for(var r=0;r-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){var i,s=[null],n=this.list.slice(),r=n.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=f},13916:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list;if(0!==n.length){var r=e.localTransform;s?(r.loadIdentity(),r.multiply(s),r.translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.scaleX,e.scaleY)):r.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u{var s=i(88933),n=i(70339),r=i(99325),o=i(20494);r.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),r=o(t,"y",0),a=o(t,"children",null),h=new n(this.scene,i,r,a);return void 0!==e&&(t.add=e),s(this.scene,h,t),h}))},23400:(t,e,i)=>{var s=i(70339);i(61286).register("container",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},98524:(t,e,i)=>{var s,n,r=i(72283);s=i(36934),n=i(13916),t.exports={renderWebGL:s,renderCanvas:n}},36934:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e);var n=e.list,r=n.length;if(0!==r){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=0;c{t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},38943:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(11603),o=i(89980),a=i(42911),h=i(55638),l=i(7599),u=i(51729),c=new s({Extends:o,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Origin,n.ScrollFactor,n.Transform,n.Visible,r],initialize:function(t,e,i,s,n,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new u,this.rotate3dAngle="deg",this.pointerEvents="auto",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof s?"#"===s[0]?this.setElement(s.substr(1),n,r):this.createElement(s,n,r):s&&this.setElement(s,n,r),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this),t.sys.events.on(l.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e{var s=i(2452),n=i(89980),r=i(69360),o=new r,a=new r,h=new r;t.exports=function(t,e,i,r){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||n.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var f=o,p=a,g=h,v=0,m=0,y="0%",x="0%";r?(v=e.width*e.scaleX*e.originX,m=e.height*e.scaleY*e.originY,p.applyITRS(e.x-v,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(r,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),p.e=e.x-v,p.f=e.y-m,f.multiply(p,g)):(v=e.width*e.originX,m=e.height*e.originY,p.applyITRS(e.x-v,e.y-m,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",p.e-=i.scrollX*e.scrollFactorX,p.f-=i.scrollY*e.scrollFactorY,f.multiply(p,g)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=s[e._blendMode]),l.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},66788:(t,e,i)=>{var s=i(38943);i(61286).register("dom",(function(t,e,i,n,r){var o=new s(this.scene,t,e,i,n,r);return this.displayList.add(o),o}))},11603:(t,e,i)=>{var s,n,r=i(72283);s=i(66070),n=i(66070),t.exports={renderWebGL:s,renderCanvas:n}},65492:t=>{t.exports="addedtoscene"},98398:t=>{t.exports="destroy"},40239:t=>{t.exports="removedfromscene"},17286:t=>{t.exports="complete"},31496:t=>{t.exports="created"},89587:t=>{t.exports="error"},59792:t=>{t.exports="locked"},96342:t=>{t.exports="loop"},6017:t=>{t.exports="playing"},49614:t=>{t.exports="play"},24418:t=>{t.exports="seeked"},87318:t=>{t.exports="seeking"},50009:t=>{t.exports="stalled"},61922:t=>{t.exports="stop"},79501:t=>{t.exports="textureready"},4052:t=>{t.exports="unlocked"},54857:t=>{t.exports="unsupported"},56631:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(65492),DESTROY:i(98398),REMOVED_FROM_SCENE:i(40239),VIDEO_COMPLETE:i(17286),VIDEO_CREATED:i(31496),VIDEO_ERROR:i(89587),VIDEO_LOCKED:i(59792),VIDEO_LOOP:i(96342),VIDEO_PLAY:i(49614),VIDEO_PLAYING:i(6017),VIDEO_SEEKED:i(24418),VIDEO_SEEKING:i(87318),VIDEO_STALLED:i(50009),VIDEO_STOP:i(61922),VIDEO_TEXTURE:i(79501),VIDEO_UNLOCKED:i(4052),VIDEO_UNSUPPORTED:i(54857)}},39419:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(79394),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.Origin,n.ScrollFactor,n.Size,n.Texture,n.Tint,n.Transform,n.Visible,o],initialize:function(t){r.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},96699:()=>{},41155:(t,e,i)=>{var s=i(39419);i(61286).register("extern",(function(){var t=new s(this.scene);return this.displayList.add(t),t}))},79394:(t,e,i)=>{var s,n,r=i(72283);s=i(81410),n=i(96699),t.exports={renderWebGL:s,renderCanvas:n}},81410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){t.pipelines.clear();var r=s(e,i,n).calc;e.render.call(e,t,i,r),t.pipelines.rebind()}},36266:t=>{t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},33182:(t,e,i)=>{var s=i(51052),n=i(56694),r=i(36266),o=i(64937),a=i(95669),h=i(89980),l=i(72632),u=i(10850),c=i(83392),d=i(60898),f=new n({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.PostPipeline,o.Transform,o.Visible,o.ScrollFactor,d],initialize:function(t,e){var i=u(e,"x",0),s=u(e,"y",0);h.call(this,t,"Graphics"),this.setPosition(i,s),this.initPipeline(),this.initPostPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.lineStyle(1,0,0),this.fillStyle(0,0),this.setDefaultStyles(e)},setDefaultStyles:function(t){return u(t,"lineStyle",null)&&(this.defaultStrokeWidth=u(t,"lineStyle.width",1),this.defaultStrokeColor=u(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=u(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),u(t,"fillStyle",null)&&(this.defaultFillColor=u(t,"fillStyle.color",16777215),this.defaultFillAlpha=u(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,s,n,o,a,h){return void 0===n&&(n=1),void 0===o&&(o=n),void 0===a&&(a=n),void 0===h&&(h=n),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,n,o,a,h,t,e,i,s),this},lineGradientStyle:function(t,e,i,s,n,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,s,n),this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,c.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,s){return this.commandBuffer.push(r.FILL_RECT,t,e,i,s),this},strokeRect:function(t,e,i,s){var n=this._lineWidth/2,r=t-n,o=t+n;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+s),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+s),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+s),this.lineTo(o+i,e+s),this.strokePath(),this},fillRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n;"number"!=typeof n&&(r=l(n,"tl",20),o=l(n,"tr",20),a=l(n,"bl",20),h=l(n,"br",20));var u=r>=0,d=o>=0,f=a>=0,p=h>=0;return r=Math.abs(r),o=Math.abs(o),a=Math.abs(a),h=Math.abs(h),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),d?this.arc(t+i-o,e+o,o,-c.TAU,0):this.arc(t+i,e,o,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),p?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+a,e+s),f?this.arc(t+a,e+s-a,a,c.TAU,Math.PI):this.arc(t,e+s,a,0,-c.TAU,!0),this.lineTo(t,e+r),u?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(t,e,i,s,n){void 0===n&&(n=20);var r=n,o=n,a=n,h=n,u=Math.min(i,s)/2;"number"!=typeof n&&(r=l(n,"tl",20),o=l(n,"tr",20),a=l(n,"bl",20),h=l(n,"br",20));var d=r>=0,f=o>=0,p=a>=0,g=h>=0;return r=Math.min(Math.abs(r),u),o=Math.min(Math.abs(o),u),a=Math.min(Math.abs(a),u),h=Math.min(Math.abs(h),u),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),f?this.arc(t+i-o,e+o,o,-c.TAU,0):this.arc(t+i,e,o,Math.PI,c.TAU,!0),this.lineTo(t+i,e+s-h),this.moveTo(t+i,e+s-h),g?this.arc(t+i-h,e+s-h,h,0,c.TAU):this.arc(t+i,e+s,h,-c.TAU,Math.PI,!0),this.lineTo(t+a,e+s),this.moveTo(t+a,e+s),p?this.arc(t+a,e+s-a,a,c.TAU,Math.PI):this.arc(t,e+s,a,0,-c.TAU,!0),this.lineTo(t,e+r),this.moveTo(t,e+r),d?this.arc(t+r,e+r,r,-Math.PI,-c.TAU):this.arc(t,e,r,c.TAU,0,!0),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,s,n,o),this},strokeTriangle:function(t,e,i,s,n,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,s,n,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,s){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,s),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===s&&(s=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var n=1;n-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},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};if("string"==typeof t)if(r.textures.exists(t)){var h=(s=r.textures.get(t)).getSourceImage();h instanceof HTMLCanvasElement&&(n=h.getContext("2d",a))}else n=(s=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d",a);else t instanceof HTMLCanvasElement&&(n=t.getContext("2d",a));return n&&(this.renderCanvas(o,this,f.TargetCamera,null,n,!1),s&&s.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new s,t.exports=f},91543:(t,e,i)=>{var s=i(36266),n=i(49584);t.exports=function(t,e,i,r,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&n(t,u,e,i,r)){i.addToRenderList(e);var c=1,d=1,f=0,p=0,g=1,v=0,m=0,y=0;u.beginPath();for(var x=0;x>>16,m=(65280&f)>>>8,y=255&f,u.strokeStyle="rgba("+v+","+m+","+y+","+c+")",u.lineWidth=g,x+=3;break;case s.FILL_STYLE:p=h[x+1],d=h[x+2],v=(16711680&p)>>>16,m=(65280&p)>>>8,y=255&p,u.fillStyle="rgba("+v+","+m+","+y+","+d+")",x+=2;break;case s.BEGIN_PATH:u.beginPath();break;case s.CLOSE_PATH:u.closePath();break;case s.FILL_PATH:a||u.fill();break;case s.STROKE_PATH:a||u.stroke();break;case s.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case s.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case s.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case s.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case s.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case s.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case s.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case s.SAVE:u.save();break;case s.RESTORE:u.restore();break;case s.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case s.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case s.ROTATE:u.rotate(h[x+1]),x+=1;break;case s.GRADIENT_FILL_STYLE:x+=5;break;case s.GRADIENT_LINE_STYLE:x+=6}u.restore()}}},41286:(t,e,i)=>{var s=i(99325),n=i(33182);s.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}))},13122:(t,e,i)=>{var s=i(33182);i(61286).register("graphics",(function(t){return this.displayList.add(new s(this.scene,t))}))},60898:(t,e,i)=>{var s,n,r=i(72283);s=i(34429),i(91543),n=i(91543),t.exports={renderWebGL:s,renderCanvas:n}},34429:(t,e,i)=>{var s=i(36266),n=i(73329),r=i(69360),o=i(75512),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],u=new r;t.exports=function(t,e,i,r){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=n(e,i,r).calc,f=u.loadIdentity(),p=e.commandBuffer,g=i.alpha*e.alpha,v=1,m=c.fillTint,y=c.strokeTint,x=0,T=0,w=0,b=2*Math.PI,E=[],S=0,A=!0,_=null,C=o.getTintAppendFloatAlpha,M=0;M0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===_&&(_=new h(B+Math.cos(X)*U,N+Math.sin(X)*U,v),E.push(_),I+=.01);I<1+G;)w=Y*I+X,x=B+Math.cos(w)*U,T=N+Math.sin(w)*U,_.points.push(new a(x,T,v)),I+=.01;w=Y+X,x=B+Math.cos(w)*U,T=N+Math.sin(w)*U,_.points.push(new a(x,T,v));break;case s.FILL_RECT:c.batchFillRect(p[++M],p[++M],p[++M],p[++M],f,d);break;case s.FILL_TRIANGLE:c.batchFillTriangle(p[++M],p[++M],p[++M],p[++M],p[++M],p[++M],f,d);break;case s.STROKE_TRIANGLE:c.batchStrokeTriangle(p[++M],p[++M],p[++M],p[++M],p[++M],p[++M],v,f,d);break;case s.LINE_TO:null!==_?_.points.push(new a(p[++M],p[++M],v)):(_=new h(p[++M],p[++M],v),E.push(_));break;case s.MOVE_TO:_=new h(p[++M],p[++M],v),E.push(_);break;case s.SAVE:l.push(f.copyToArray());break;case s.RESTORE:f.copyFromArray(l.pop());break;case s.TRANSLATE:B=p[++M],N=p[++M],f.translate(B,N);break;case s.SCALE:B=p[++M],N=p[++M],f.scale(B,N);break;case s.ROTATE:f.rotate(p[++M])}t.pipelines.postBatch(e)}}},59192:(t,e,i)=>{var s=i(83979),n=i(56694),r=i(56631),o=i(6659),a=i(71608),h=i(72632),l=i(10850),u=i(19256),c=i(42911),d=i(75757),f=i(58403),p=i(13747),g=new n({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?c(e[0])&&(i=e,e=null):c(e)&&(i=e,e=null),this.scene=t,this.children=new f,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i),this.on(r.ADDED_TO_SCENE,this.addedToScene,this),this.on(r.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,s,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===s&&(s=this.defaultFrame),void 0===n&&(n=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,s);return o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),o.visible=n,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof n&&(l.x=n),"number"==typeof r&&(l.y=r),l):s?this.create(n,r,o,a,h):null},get:function(t,e,i,s,n){return this.getFirst(!1,!0,t,e,i,s,n)},getFirstAlive:function(t,e,i,s,n,r){return this.getFirst(!0,t,e,i,s,n,r)},getFirstDead:function(t,e,i,s,n,r){return this.getFirst(!1,t,e,i,s,n,r)},playAnimation:function(t,e){return s.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i{var s=i(99325),n=i(59192);s.register("group",(function(t){return new n(this.scene,null,t)}))},62598:(t,e,i)=>{var s=i(59192);i(61286).register("group",(function(t,e){return this.updateList.add(new s(this.scene,t,e))}))},1539:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(57322),a=new s({Extends:r,Mixins:[n.Alpha,n.BlendMode,n.Depth,n.Flip,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Size,n.TextureCrop,n.Tint,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n){r.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=a},57786:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},83556:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(1539);n.register("image",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,a,t),a}))},20927:(t,e,i)=>{var s=i(1539);i(61286).register("image",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},57322:(t,e,i)=>{var s,n,r=i(72283);s=i(59390),n=i(57786),t.exports={renderWebGL:s,renderCanvas:n}},59390:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),this.pipeline.batchSprite(e,i,s)}},48013:(t,e,i)=>{var s={Events:i(56631),DisplayList:i(91713),GameObjectCreator:i(99325),GameObjectFactory:i(61286),UpdateList:i(92034),Components:i(64937),GetCalcMatrix:i(73329),BuildGameObject:i(88933),BuildGameObjectAnimation:i(32291),GameObject:i(89980),BitmapText:i(44616),Blitter:i(52816),Bob:i(41664),Container:i(70339),DOMElement:i(38943),DynamicBitmapText:i(13468),Extern:i(39419),Graphics:i(33182),Group:i(59192),Image:i(1539),Layer:i(85305),Particles:i(27684),PathFollower:i(29598),RenderTexture:i(15996),RetroFont:i(55873),Rope:i(79968),Sprite:i(13747),Text:i(76555),GetTextSize:i(32979),MeasureText:i(27030),TextStyle:i(74744),TileSprite:i(35856),Zone:i(71030),Video:i(8630),Shape:i(91461),Arc:i(28593),Curve:i(15220),Ellipse:i(28591),Grid:i(39169),IsoBox:i(4415),IsoTriangle:i(65159),Line:i(579),Polygon:i(91249),Rectangle:i(517),Star:i(77843),Triangle:i(21873),Factories:{Blitter:i(38906),Container:i(23400),DOMElement:i(66788),DynamicBitmapText:i(94145),Extern:i(41155),Graphics:i(13122),Group:i(62598),Image:i(20927),Layer:i(17676),Particles:i(81212),PathFollower:i(19626),RenderTexture:i(29599),Rope:i(31982),Sprite:i(66135),StaticBitmapText:i(21797),Text:i(94627),TileSprite:i(20509),Zone:i(34546),Video:i(215),Arc:i(10369),Curve:i(10147),Ellipse:i(99869),Grid:i(9326),IsoBox:i(88154),IsoTriangle:i(67765),Line:i(85665),Polygon:i(88203),Rectangle:i(94355),Star:i(23962),Triangle:i(79296)},Creators:{Blitter:i(68452),Container:i(44516),DynamicBitmapText:i(67513),Graphics:i(41286),Group:i(61295),Image:i(83556),Layer:i(56378),Particles:i(765),RenderTexture:i(85692),Rope:i(96027),Sprite:i(89219),StaticBitmapText:i(95499),Text:i(75397),TileSprite:i(63950),Zone:i(24067),Video:i(65601)}};s.Shader=i(27902),s.Mesh=i(83321),s.NineSlice=i(44139),s.PointLight=i(13171),s.Plane=i(33412),s.Factories.Shader=i(51979),s.Factories.Mesh=i(8767),s.Factories.NineSlice=i(53778),s.Factories.PointLight=i(91201),s.Factories.Plane=i(58322),s.Creators.Shader=i(13908),s.Creators.Mesh=i(41839),s.Creators.NineSlice=i(40964),s.Creators.PointLight=i(162),s.Creators.Plane=i(10912),s.Light=i(14455),s.LightsManager=i(26193),s.LightsPlugin=i(50296),t.exports=s},85305:(t,e,i)=>{var s=i(95723),n=i(56694),r=i(64937),o=i(48129),a=i(81078),h=i(6659),l=i(56631),u=i(71207),c=i(47427),d=i(58010),f=i(7599),p=i(17922),g=new n({Extends:u,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.PostPipeline,r.Visible,h,d],initialize:function(t,e){u.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",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.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),e&&this.add(e),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 a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},add:function(t){return u.prototype.add.call(this,t),this},remove:function(t,e){var i=u.prototype.remove.call(this,t);if(e&&i){Array.isArray(i)||(i=[i]);for(var s=0;s{t.exports=function(t,e,i){var s=e.list;if(0!==s.length){e.depthSort();var n=-1!==e.blendMode;n||t.setBlendMode(0);var r=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o{var s=i(88933),n=i(85305),r=i(99325),o=i(20494);r.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),r=new n(this.scene,i);return void 0!==e&&(t.add=e),s(this.scene,r,t),r}))},17676:(t,e,i)=>{var s=i(85305);i(61286).register("layer",(function(t){return this.displayList.add(new s(this.scene,t))}))},58010:(t,e,i)=>{var s,n,r=i(72283);s=i(17576),n=i(834),t.exports={renderWebGL:s,renderCanvas:n}},17576:t=>{t.exports=function(t,e,i){var s=e.list,n=s.length;if(0!==n){e.depthSort(),t.pipelines.preBatch(e);var r=-1!==e.blendMode;r||t.setBlendMode(0);for(var o=e.alpha,a=0;a{var s=i(26673),n=i(56694),r=i(64937),o=i(39298),a=i(75512),h=new n({Extends:s,Mixins:[r.Origin,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i,n,r,a,h){s.call(this,t,e,i),this.color=new o(n,r,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(i)},displayWidth:{get:function(){return this.diameter},set:function(t){this.diameter=t}},displayHeight:{get:function(){return this.diameter},set:function(t){this.diameter=t}},width:{get:function(){return this.diameter},set:function(t){this.diameter=t}},height:{get:function(){return this.diameter},set:function(t){this.diameter=t}},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},26193:(t,e,i)=>{var s=i(26535),n=i(56694),r=i(53996),o=i(14455),a=i(13171),h=i(39298),l=i(72677),u=i(17922),c=i(75512),d=new n({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,s,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,s,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,n=[],o=0;othis.maxLights&&(u(n,this.sortByDistance),n=n.slice(0,this.maxLights)),this.visibleLights=n.length,n},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=c.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,s,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===s&&(s=16777215),void 0===n&&(n=1);var r=c.getFloatsFromUintRGB(s),a=new o(t,e,i,r[0],r[1],r[2],n);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},50296:(t,e,i)=>{var s=i(56694),n=i(26193),r=i(91963),o=i(7599),a=new s({Extends:n,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),n.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});r.register("LightsPlugin",a,"lights"),t.exports=a},83321:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(75606),o=i(18693),a=i(89980),h=i(53267),l=i(67623),u=i(73329),c=i(16650),d=i(23464),f=i(23701),p=i(17922),g=i(70015),v=i(85769),m=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 g,this.modelScale=new g(1,1,1),this.modelRotation=new g,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new c,this.viewPosition=new g,this.viewMatrix=new c,this.projectionMatrix=new c,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var p=t.sys.renderer;this.setPosition(e,i),this.setTexture(s,n),this.setSize(p.width,p.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(p.width,p.height),r&&this.addVertices(r,o,h,l,u,d,f)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(g.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=g.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,s,n){return void 0===i&&(i=45),void 0===s&&(s=.01),void 0===n&&(n=1e3),this.fov=i,this.projectionMatrix.perspective(r(i),t/e,s,n),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,s){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===s&&(s=1e3),this.fov=0,this.projectionMatrix.ortho(-t,t,-e,e,i,s),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,s,n,r,o,a,l){var u,c=this.scene.sys.cache.obj.get(t);return c&&(u=h(c,this,e,i,s,n,r,o,a,l)),u&&0!==u.verts.length||console.warn("Mesh.addVerticesFromObj data empty:",t),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,s,n,r,o){var a=new v(t,e,i,s,n,r,o);return this.vertices.push(a),a},addFace:function(t,e,i){var s=new o(t,e,i);return this.faces.push(s),this.dirtyCache[9]=-1,s},addVertices:function(t,e,i,s,n,r,o){var a=l(t,e,i,s,n,r,o);return a?(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)):console.warn("Mesh.addVertices data empty or invalid"),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},hasFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var s=u(this,i).calc,n=this.faces,r=0;r{t.exports=function(){}},41839:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(83321);n.register("mesh",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),u=o(t,"indicies",[]),c=o(t,"containsZ",!1),d=o(t,"normals",[]),f=o(t,"colors",16777215),p=o(t,"alphas",1),g=new a(this.scene,0,0,i,n,h,l,u,c,d,f,p);return void 0!==e&&(t.add=e),s(this.scene,g,t),g}))},8767:(t,e,i)=>{var s=i(83321);i(61286).register("mesh",(function(t,e,i,n,r,o,a,h,l,u,c){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u,c))}))},23464:(t,e,i)=>{var s,n,r=i(72283);s=i(57410),n=i(6317),t.exports={renderWebGL:s,renderCanvas:n}},57410:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){var r=e.faces,o=r.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=s(e,i,n).calc;t.pipelines.preBatch(e);for(var l=a.setGameObject(e),u=a.vertexViewF32,c=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,f=e.tintFill,p=[],g=e.debugCallback,v=h.a,m=h.b,y=h.c,x=h.d,T=h.e,w=h.f,b=e.viewPosition.z,E=e.hideCCW,S=i.roundPixels,A=i.alpha*e.alpha,_=0,C=0;C{var s=i(56694),n=i(64937),r=i(89980),o=i(94456),a=i(85769),h=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,o],initialize:function(t,e,i,s,n,o,h,l,u,c,d){r.call(this,t,"NineSlice"),this._width,this._height,this._originX=.5,this._originY=.5,this._sizeComponent=!0,this.vertices=[],this.leftWidth,this.rightWidth,this.topHeight,this.bottomHeight,this.tint=16777215,this.tintFill=!1;var f=t.textures.getFrame(s,n);this.is3Slice=!c&&!d,f.scale9&&(this.is3Slice=f.is3Slice);for(var p=this.is3Slice?18:54,g=0;g{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(44139);n.register("nineslice",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=o(t,"width",256),l=o(t,"height",256),u=o(t,"leftWidth",10),c=o(t,"rightWidth",10),d=o(t,"topHeight",0),f=o(t,"bottomHeight",0),p=new a(this.scene,0,0,i,n,h,l,u,c,d,f);return void 0!==e&&(t.add=e),s(this.scene,p,t),p}))},53778:(t,e,i)=>{var s=i(44139);i(61286).register("nineslice",(function(t,e,i,n,r,o,a,h,l,u){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h,l,u))}))},94456:(t,e,i)=>{var s,n=i(72283),r=n;s=i(27420),t.exports={renderWebGL:s,renderCanvas:r}},27420:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){var o=e.vertices,a=o.length;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(e.pipeline,e),l=s(e,i,r,!1).calc;t.pipelines.preBatch(e);var u=h.setGameObject(e),c=h.vertexViewF32,d=h.vertexViewU32,f=h.vertexCount*h.currentShader.vertexComponentCount-1,p=i.roundPixels,g=e.tintFill,v=i.alpha*e.alpha,m=n.getTintAppendFloatAlpha(e.tint,v),y=h.vertexAvailable(),x=-1;y{var s=i(56694),n=i(93025),r=i(22946),o=i(21902),a=i(4840),h=i(15978),l=new s({Extends:n,initialize:function(t){n.call(this,t,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return null===this.propertyValue?0:9},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;if(9===this.method){this.start=t[0],this.ease=o("Linear"),this.interpolation=a("linear"),i=this.easedValueEmit,s=this.easeValueUpdate,e=t[0],this.active=!0;for(var n=0;n{var s=i(17489),n=i(82897),r=i(56694),o=i(61616),a=i(21902),h=i(72632),l=i(4840),u=i(88462),c=i(1071),d=new r({initialize:function(t,e,i){void 0===i&&(i=!1),this.propertyKey=t,this.propertyValue=e,this.defaultValue=e,this.steps=0,this.counter=0,this.yoyo=!1,this.direction=0,this.start=0,this.current=0,this.end=0,this.ease=null,this.interpolation=null,this.emitOnly=i,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=h(t,this.propertyKey,this.defaultValue),this.method=this.getMethod(),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return JSON.stringify(this.propertyValue)},onChange:function(t){var e;switch(this.method){case 1:case 3:case 8:e=t;break;case 2:this.propertyValue.indexOf(t)>=0&&(e=t);break;case 4:var i=(this.end-this.start)/this.steps;e=u(t,i),this.counter=e;break;case 5:case 6:case 7:e=n(t,this.start,this.end);break;case 9:e=this.start[0]}return this.current=e,this},getMethod:function(){var t=this.propertyValue;if(null===t)return 0;var e=typeof t;if("number"===e)return 1;if(Array.isArray(t))return 2;if("function"===e)return 3;if("object"===e){if(this.hasBoth(t,"start","end"))return this.has(t,"steps")?4:5;if(this.hasBoth(t,"min","max"))return 6;if(this.has(t,"random"))return 7;if(this.hasEither(t,"onEmit","onUpdate"))return 8;if(this.hasEither(t,"values","interpolation"))return 9}return 0},setMethods:function(){var t=this.propertyValue,e=t,i=this.defaultEmit,s=this.defaultUpdate;switch(this.method){case 1:i=this.staticValueEmit;break;case 2:i=this.randomStaticValueEmit,e=t[0];break;case 3:this._onEmit=t,i=this.proxyEmit;break;case 4:this.start=t.start,this.end=t.end,this.steps=t.steps,this.counter=this.start,this.yoyo=!!this.has(t,"yoyo")&&t.yoyo,this.direction=0,i=this.steppedEmit,e=this.start;break;case 5:this.start=t.start,this.end=t.end;var n=this.has(t,"ease")?t.ease:"Linear";this.ease=a(n,t.easeParams),i=this.has(t,"random")&&t.random?this.randomRangedValueEmit:this.easedValueEmit,s=this.easeValueUpdate,e=this.start;break;case 6:this.start=t.min,this.end=t.max,i=this.has(t,"int")&&t.int?this.randomRangedIntEmit:this.randomRangedValueEmit,e=this.start;break;case 7:var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),i=this.randomRangedIntEmit,e=this.start;break;case 8:this._onEmit=this.has(t,"onEmit")?t.onEmit:this.defaultEmit,this._onUpdate=this.has(t,"onUpdate")?t.onUpdate:this.defaultUpdate,i=this.proxyEmit,s=this.proxyUpdate;break;case 9:this.start=t.values;var o=this.has(t,"ease")?t.ease:"Linear";this.ease=a(o,t.easeParams),this.interpolation=l(t.interpolation),i=this.easedValueEmit,s=this.easeValueUpdate,e=this.start[0]}return this.onEmit=i,this.onUpdate=s,this.current=e,this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,s){return s},proxyEmit:function(t,e,i){var s=this._onEmit(t,e,i);return this.current=s,s},proxyUpdate:function(t,e,i,s){var n=this._onUpdate(t,e,i,s);return this.current=n,n},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[t],this.current},randomRangedValueEmit:function(t,e){var i=o(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},randomRangedIntEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i,t.data[e].max=this.end),this.current=i,i},steppedEmit:function(){var t,e=this.counter,i=e,s=(this.end-this.start)/this.steps;return this.yoyo?(0===this.direction?(i+=s)>=this.end&&(t=i-this.end,i=this.end-t,this.direction=1):(i-=s)<=this.start&&(t=this.start-i,i=this.start+t,this.direction=0),this.counter=i):this.counter=c(i+s,this.start,this.end),this.current=e,e},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(t,e,i){var s,n=t.data[e],r=this.ease(i);return s=this.interpolation?this.interpolation(this.start,r):(n.max-n.min)*r+n.min,this.current=s,s},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});t.exports=d},87811:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(30891),o=new s({Extends:r,initialize:function(t,e,i,s,o){if("object"==typeof t){var a=t;t=n(a,"x",0),e=n(a,"y",0),i=n(a,"power",0),s=n(a,"epsilon",100),o=n(a,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=100),void 0===o&&(o=50);r.call(this,t,e,!0),this._gravity=o,this._power=i*o,this._epsilon=s*s},update:function(t,e){var i=this.x-t.x,s=this.y-t.y,n=i*i+s*s;if(0!==n){var r=Math.sqrt(n);n{var s=i(16569),n=i(82897),r=i(56694),o=i(75606),a=i(74118),h=i(2386),l=i(93736),u=new r({initialize:function(t){this.emitter=t,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new l,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.holdCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1},x:{min:0,max:0},y:{min:0,max:0},accelerationX:{min:0,max:0},accelerationY:{min:0,max:0},maxVelocityX:{min:0,max:0},maxVelocityY:{min:0,max:0},moveToX:{min:0,max:0},moveToY:{min:0,max:0},bounce:{min:0,max:0}},this.isCropped=!1,this.scene=t.scene,this.anims=new s(this),this.bounds=new a},emit:function(t,e,i,s,n,r){return this.emitter.emit(t,e,i,s,n,r)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},fire:function(t,e){var i=this.emitter,s=i.ops,n=i.getAnim();if(n?this.anims.play(n):(this.frame=i.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(i.getEmitZone(this),void 0===t?this.x+=s.x.onEmit(this,"x"):s.x.steps>0?this.x+=t+s.x.onEmit(this,"x"):this.x+=t,void 0===e?this.y+=s.y.onEmit(this,"y"):s.y.steps>0?this.y+=e+s.y.onEmit(this,"y"):this.y+=e,this.life=s.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=s.delay.onEmit(this,"delay"),this.holdCurrent=s.hold.onEmit(this,"hold"),this.scaleX=s.scaleX.onEmit(this,"scaleX"),this.scaleY=s.scaleY.active?s.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=s.rotate.onEmit(this,"rotate"),this.rotation=o(this.angle),i.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),0===this.delayCurrent&&i.getDeathZone(this))return this.lifeCurrent=0,!1;var r=s.speedX.onEmit(this,"speedX"),a=s.speedY.active?s.speedY.onEmit(this,"speedY"):r;if(i.radial){var h=o(s.angle.onEmit(this,"angle"));this.velocityX=Math.cos(h)*Math.abs(r),this.velocityY=Math.sin(h)*Math.abs(a)}else if(i.moveTo){var l=s.moveToX.onEmit(this,"moveToX"),u=s.moveToY.onEmit(this,"moveToY"),c=this.life/1e3;this.velocityX=(l-this.x)/c,this.velocityY=(u-this.y)/c}else this.velocityX=r,this.velocityY=a;return i.acceleration&&(this.accelerationX=s.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=s.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=s.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=s.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=s.bounce.onEmit(this,"bounce"),this.alpha=s.alpha.onEmit(this,"alpha"),s.color.active?this.tint=s.color.onEmit(this,"tint"):this.tint=s.tint.onEmit(this,"tint"),!0},update:function(t,e,i){if(this.lifeCurrent<=0)return!(this.holdCurrent>0)||(this.holdCurrent-=t,this.holdCurrent<=0);if(this.delayCurrent>0)return this.delayCurrent-=t,!1;this.anims.update(0,t);var s=this.emitter,r=s.ops,a=1-this.lifeCurrent/this.life;if(this.lifeT=a,this.x=r.x.onUpdate(this,"x",a,this.x),this.y=r.y.onUpdate(this,"y",a,this.y),s.moveTo){var h=r.moveToX.onUpdate(this,"moveToX",a,s.moveToX),l=r.moveToY.onUpdate(this,"moveToY",a,s.moveToY),u=this.lifeCurrent/1e3;this.velocityX=(h-this.x)/u,this.velocityY=(l-this.y)/u}return this.computeVelocity(s,t,e,i,a),this.scaleX=r.scaleX.onUpdate(this,"scaleX",a,this.scaleX),r.scaleY.active?this.scaleY=r.scaleY.onUpdate(this,"scaleY",a,this.scaleY):this.scaleY=this.scaleX,this.angle=r.rotate.onUpdate(this,"rotate",a,this.angle),this.rotation=o(this.angle),s.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=n(r.alpha.onUpdate(this,"alpha",a,this.alpha),0,1),r.color.active?this.tint=r.color.onUpdate(this,"color",a,this.tint):this.tint=r.tint.onUpdate(this,"tint",a,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(t,e,i,s,r){var o=t.ops,a=this.velocityX,h=this.velocityY,l=o.accelerationX.onUpdate(this,"accelerationX",r,this.accelerationX),u=o.accelerationY.onUpdate(this,"accelerationY",r,this.accelerationY),c=o.maxVelocityX.onUpdate(this,"maxVelocityX",r,this.maxVelocityX),d=o.maxVelocityY.onUpdate(this,"maxVelocityY",r,this.maxVelocityY);this.bounce=o.bounce.onUpdate(this,"bounce",r,this.bounce),a+=t.gravityX*i+l*i,h+=t.gravityY*i+u*i,a=n(a,-c,c),h=n(h,-d,d),this.velocityX=a,this.velocityY=h,this.x+=a*i,this.y+=h*i,t.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var f=0;f{var s=i(56694),n=i(30891),r=i(74118),o=new s({Extends:n,initialize:function(t,e,i,s,o,a,h,l){void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),void 0===l&&(l=!0),n.call(this,t,e,!0),this.bounds=new r(t,e,i,s),this.collideLeft=o,this.collideRight=a,this.collideTop=h,this.collideBottom=l},update:function(t){var e=this.bounds,i=-t.bounce,s=t.worldPosition;s.xe.right&&this.collideRight&&(t.x-=s.x-e.right,t.velocityX*=i),s.ye.bottom&&this.collideBottom&&(t.y-=s.y-e.bottom,t.velocityY*=i)}});t.exports=o},9216:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(48129),o=i(29538),a=i(69361),h=i(54213),l=i(19737),u=i(93025),c=i(40629),d=i(89980),f=i(72632),p=i(72861),g=i(87811),v=i(53523),m=i(19256),y=i(7782),x=i(71207),T=i(14655),w=i(14909),b=i(68433),E=i(74118),S=i(90205),A=i(66458),_=i(69116),C=i(17922),M=i(69360),R=i(93736),P=i(1071),O=i(73106),L=["active","advance","blendMode","colorEase","deathCallback","deathCallbackScope","duration","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxAliveParticles","maxParticles","name","emitting","particleBringToTop","particleClass","radial","sortCallback","sortOrderAsc","sortProperty","stopAfter","tintFill","timeScale","trackVisible","visible"],F=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],D=new s({Extends:d,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Texture,n.Transform,n.Visible,_],initialize:function(t,e,i,s,n){d.call(this,t,"ParticleEmitter"),this.particleClass=w,this.ops={accelerationX:new u("accelerationX",0),accelerationY:new u("accelerationY",0),alpha:new u("alpha",1),angle:new u("angle",{min:0,max:360},!0),bounce:new u("bounce",0),color:new l("color"),delay:new u("delay",0,!0),hold:new u("hold",0,!0),lifespan:new u("lifespan",1e3,!0),maxVelocityX:new u("maxVelocityX",1e4),maxVelocityY:new u("maxVelocityY",1e4),moveToX:new u("moveToX",0),moveToY:new u("moveToY",0),quantity:new u("quantity",1,!0),rotate:new u("rotate",0),scaleX:new u("scaleX",1),scaleY:new u("scaleY",1),speedX:new u("speedX",0,!0),speedY:new u("speedY",0,!0),tint:new u("tint",16777215),x:new u("x",0),y:new u("y",0)},this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.moveTo=!1,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.maxAliveParticles=0,this.stopAfter=0,this.duration=0,this.frequency=0,this.emitting=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZones=[],this.deathZones=[],this.viewBounds=null,this.follow=null,this.followOffset=new R,this.trackVisible=!1,this.frames=[],this.randomFrame=!0,this.frameQuantity=1,this.anims=[],this.randomAnim=!0,this.animQuantity=1,this.dead=[],this.alive=[],this.counters=new Float32Array(10),this.skipping=!1,this.worldMatrix=new M,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new x(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(e,i),this.setTexture(s),n&&this.setConfig(n)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(t){if(!t)return this;var e=0,i="",s=this.ops;for(e=0;e=this.animQuantity&&(this.animCounter=0,this.currentAnim=P(this.currentAnim+1,0,e)),i},setAnim:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomAnim=e,this.animQuantity=i,this.currentAnim=0;var s=typeof t;if(this.anims.length=0,Array.isArray(t))this.anims=this.anims.concat(t);else if("string"===s)this.anims.push(t);else if("object"===s){var n=t;(t=f(n,"anims",null))&&(this.anims=this.anims.concat(t));var r=f(n,"cycle",!1);this.randomAnim=!r,this.animQuantity=f(n,"quantity",i)}return 1===this.anims.length&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},addParticleBounds:function(t,e,i,s,n,r,o,a){if("object"==typeof t){var h=t;t=h.x,e=h.y,i=m(h,"w")?h.w:h.width,s=m(h,"h")?h.h:h.height}return this.addParticleProcessor(new O(t,e,i,s,n,r,o,a))},setParticleSpeed:function(t,e){return void 0===e&&(e=t),this.ops.speedX.onChange(t),t===e?this.ops.speedY.active=!1:this.ops.speedY.onChange(e),this.radial=!0,this},setParticleScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.ops.scaleX.onChange(t),this.ops.scaleY.onChange(e),this},setParticleGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setParticleAlpha:function(t){return this.ops.alpha.onChange(t),this},setParticleTint:function(t){return this.ops.tint.onChange(t),this},setEmitterAngle:function(t){return this.ops.angle.onChange(t),this},setParticleLifespan:function(t){return this.ops.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity=t,this},setFrequency:function(t,e){return this.frequency=t,this.flowCounter=t>0?t:0,e&&(this.quantity=e),this},addDeathZone:function(t){var e;Array.isArray(t)||(t=[t]);for(var i=[],s=0;s-1&&(this.zoneTotal++,this.zoneTotal===s.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===i&&(this.zoneIndex=0)))}},getDeathZone:function(t){for(var e=this.deathZones,i=0;i=0&&(this.zoneIndex=e),this},addParticleProcessor:function(t){return this.processors.exists(t)||(t.emitter&&t.emitter.removeParticleProcessor(t),this.processors.add(t),t.emitter=this),t},removeParticleProcessor:function(t){return this.processors.exists(t)&&(this.processors.remove(t,!0),t.emitter=null),t},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(t){return this.addParticleProcessor(new g(t))},reserve:function(t){var e=this.dead;if(this.maxParticles>0){var i=this.getParticleCount();i+t>this.maxParticles&&(t=this.maxParticles-(i+t))}for(var s=0;s0&&this.getParticleCount()>=this.maxParticles||this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,s=i.length,n=0;n0&&this.fastForward(t),this.emitting=!0,this.resetCounters(this.frequency,!0),void 0!==e&&(this.duration=Math.abs(e)),this.emit(c.START,this)),this},stop:function(t){return void 0===t&&(t=!1),this.emitting&&(this.emitting=!1,t&&this.killAll(),this.emit(c.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(t,e){return void 0===t&&(t=""),void 0===e&&(e=this.true),this.sortProperty=t,this.sortOrderAsc=e,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(t){return t=""!==this.sortProperty?this.depthSortCallback:null,this.sortCallback=t,this},depthSort:function(){return C(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(t,e){var i=this.sortProperty;return this.sortOrderAsc?t[i]-e[i]:e[i]-t[i]},flow:function(t,e,i){return void 0===e&&(e=1),this.emitting=!1,this.frequency=t,this.quantity=e,void 0!==i&&(this.stopAfter=i),this.start()},explode:function(t,e,i){this.frequency=-1,this.resetCounters(-1,!0);var s=this.emitParticle(t,e,i);return this.emit(c.EXPLODE,this,s),s},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.ops.quantity.onEmit());for(var s=this.dead,n=this.stopAfter,r=this.follow?this.follow.x+this.followOffset.x:e,o=this.follow?this.follow.y+this.followOffset.y:i,a=0;a0&&(this.stopCounter++,this.stopCounter>=n))break;if(this.atLimit())break}return h}},fastForward:function(t,e){void 0===e&&(e=1e3/60);var i=0;for(this.skipping=!0;i0){var u=this.deathCallback,d=this.deathCallbackScope;for(o=h-1;o>=0;o--){var f=a[o];n.splice(f.index,1),r.push(f.particle),u&&u.call(d,f.particle),f.particle.setPosition()}}if(this.emitting||this.skipping){if(0===this.frequency)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=e;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=e,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())}else 1===this.completeFlag&&0===n.length&&(this.completeFlag=0,this.emit(c.COMPLETE,this))},overlap:function(t){for(var e=this.getWorldTransformMatrix(),i=this.alive,s=i.length,n=[],r=0;r0){var u=0;for(this.skipping=!0;u0&&y(s,t,t),s},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(t){this.ops.x.onChange(t)}},particleY:{get:function(){return this.ops.y.current},set:function(t){this.ops.y.onChange(t)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(t){this.ops.accelerationX.onChange(t)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(t){this.ops.accelerationY.onChange(t)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(t){this.ops.maxVelocityX.onChange(t)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(t){this.ops.maxVelocityY.onChange(t)}},speed:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t),this.ops.speedY.onChange(t)}},speedX:{get:function(){return this.ops.speedX.current},set:function(t){this.ops.speedX.onChange(t)}},speedY:{get:function(){return this.ops.speedY.current},set:function(t){this.ops.speedY.onChange(t)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(t){this.ops.moveToX.onChange(t)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(t){this.ops.moveToY.onChange(t)}},bounce:{get:function(){return this.ops.bounce.current},set:function(t){this.ops.bounce.onChange(t)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(t){this.ops.scaleX.onChange(t)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(t){this.ops.scaleY.onChange(t)}},particleColor:{get:function(){return this.ops.color.current},set:function(t){this.ops.color.onChange(t)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(t){this.ops.color.setEase(t)}},particleTint:{get:function(){return this.ops.tint.current},set:function(t){this.ops.tint.onChange(t)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(t){this.ops.alpha.onChange(t)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(t){this.ops.lifespan.onChange(t)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(t){this.ops.angle.onChange(t)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(t){this.ops.rotate.onChange(t)}},quantity:{get:function(){return this.ops.quantity.current},set:function(t){this.ops.quantity.onChange(t)}},delay:{get:function(){return this.ops.delay.current},set:function(t){this.ops.delay.onChange(t)}},hold:{get:function(){return this.ops.hold.current},set:function(t){this.ops.hold.onChange(t)}},flowCounter:{get:function(){return this.counters[0]},set:function(t){this.counters[0]=t}},frameCounter:{get:function(){return this.counters[1]},set:function(t){this.counters[1]=t}},animCounter:{get:function(){return this.counters[2]},set:function(t){this.counters[2]=t}},elapsed:{get:function(){return this.counters[3]},set:function(t){this.counters[3]=t}},stopCounter:{get:function(){return this.counters[4]},set:function(t){this.counters[4]=t}},completeFlag:{get:function(){return this.counters[5]},set:function(t){this.counters[5]=t}},zoneIndex:{get:function(){return this.counters[6]},set:function(t){this.counters[6]=t}},zoneTotal:{get:function(){return this.counters[7]},set:function(t){this.counters[7]=t}},currentFrame:{get:function(){return this.counters[8]},set:function(t){this.counters[8]=t}},currentAnim:{get:function(){return this.counters[9]},set:function(t){this.counters[9]=t}},preDestroy:function(){var t;this.texture=null,this.frames=null,this.anims=null,this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.emitZones=null,this.deathZones=null,this.bounds=null,this.follow=null,this.counters=null;var e=this.ops;for(t=0;t{var s=i(90205),n=i(69360),r=new n,o=new n,a=new n,h=new n;t.exports=function(t,e,i,n){var l=r,u=o,c=a,d=h;n?(d.loadIdentity(),d.multiply(n),d.translate(e.x,e.y),d.rotate(e.rotation),d.scale(e.scaleX,e.scaleY)):d.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var f=t.currentContext,p=i.roundPixels,g=i.alpha,v=e.alpha,m=e.alive,y=m.length,x=e.viewBounds;if(e.visible&&0!==y&&(!x||s(x,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e);var T=e.scrollFactorX,w=e.scrollFactorY;f.save(),f.globalCompositeOperation=t.blendModes[e.blendMode];for(var b=0;b0&&_.height>0){var C=-A.halfWidth,M=-A.halfHeight;f.globalAlpha=S,f.save(),u.setToContext(f),p&&(C=Math.round(C),M=Math.round(M)),f.imageSmoothingEnabled=!A.source.scaleMode,f.drawImage(A.source.image,_.x,_.y,_.width,_.height,C,M,_.width,_.height),f.restore()}}}f.restore()}}},765:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(72632),a=i(9216);n.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=o(t,"config",null),h=new a(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,h,t),n&&h.setConfig(n),h}))},81212:(t,e,i)=>{var s=i(61286),n=i(9216);s.register("particles",(function(t,e,i,s){return void 0!==t&&"string"==typeof t&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new n(this.scene,t,e,i,s))}))},69116:(t,e,i)=>{var s,n,r=i(72283);s=i(10275),n=i(10456),t.exports={renderWebGL:s,renderCanvas:n}},10275:(t,e,i)=>{var s=i(90205),n=i(69360),r=i(75512),o=new n,a=new n,h=new n,l=new n;t.exports=function(t,e,i,n){var u=t.pipelines.set(e.pipeline),c=o,d=a,f=h,p=l;n?(p.loadIdentity(),p.multiply(n),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=r.getTintAppendFloatAlpha,v=i.alpha,m=e.alpha;t.pipelines.preBatch(e);var y=e.alive,x=y.length,T=e.viewBounds;if(0!==x&&(!T||s(T,i.worldView))){e.sortCallback&&e.depthSort(),i.addToRenderList(e),c.copyFrom(i.matrix),c.multiplyWithOffset(p,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),t.setBlendMode(e.blendMode),e.mask&&(e.mask.preRenderWebGL(t,e,i),t.pipelines.set(e.pipeline));for(var w,b,E=e.tintFill,S=0;S{var s=new(i(56694))({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=!0),this.emitter,this.x=t,this.y=e,this.active=i},update:function(){},destroy:function(){this.emitter=null}});t.exports=s},76100:t=>{t.exports="complete"},26677:t=>{t.exports="deathzone"},62736:t=>{t.exports="explode"},56490:t=>{t.exports="start"},85715:t=>{t.exports="stop"},40629:(t,e,i)=>{t.exports={COMPLETE:i(76100),DEATH_ZONE:i(26677),EXPLODE:i(62736),START:i(56490),STOP:i(85715)}},27684:(t,e,i)=>{t.exports={EmitterColorOp:i(19737),EmitterOp:i(93025),Events:i(40629),GravityWell:i(87811),Particle:i(14909),ParticleBounds:i(73106),ParticleEmitter:i(9216),ParticleProcessor:i(30891),Zones:i(25962)}},69361:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=t.worldPosition,i=this.source.contains(e.x,e.y);return i&&this.killOnEnter||!i&&!this.killOnEnter}});t.exports=s},54213:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r){void 0===s&&(s=!1),void 0===n&&(n=!0),void 0===r&&(r=-1),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=s,this.counter=-1,this.seamless=n,this._length=0,this._direction=0,this.total=r,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=s},68433:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(t){this.source=t,this._tempVec=new n,this.total=-1},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=r},25962:(t,e,i)=>{t.exports={DeathZone:i(69361),EdgeZone:i(54213),RandomZone:i(68433)}},29598:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(13747),o=new s({Extends:r,Mixins:[n.PathFollower],initialize:function(t,e,i,s,n,o){r.call(this,t,i,s,n,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},19626:(t,e,i)=>{var s=i(61286),n=i(29598);s.register("follower",(function(t,e,i,s,r){var o=new n(this.scene,t,e,i,s,r);return this.displayList.add(o),this.updateList.add(o),o}))},33412:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(99425),o=i(15978),a=i(83321),h=i(76583),l=new n({Extends:a,initialize:function(t,e,i,n,r,o,h,l){n||(n="__DEFAULT"),a.call(this,t,e,i,n,r),this.type="Plane",this.anims=new s(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(o,h,l),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return.5}},originY:{get:function(){return.5}},setGridSize:function(t,e,i){void 0===t&&(t=8),void 0===e&&(e=8),void 0===i&&(i=!1);var s=!1;return i&&(s=!0),this.gridWidth=t,this.gridHeight=e,this.isTiled=i,this.clear(),r({mesh:this,widthSegments:t,heightSegments:e,isOrtho:!1,tile:i,flipY:s}),this},setSizeToFrame:function(t){void 0===t&&(t=!0);var e=this.frame;if(this.setPerspective(this.width/e.width,this.height/e.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!t)return this;var i,s,n=this.gridWidth,r=this.gridHeight,o=this.vertices,a=e.u0,h=e.u1,l=e.v0,u=e.v1,c=0;if(this.isTiled)for(l=e.v1,u=e.v0,s=0;s7&&f>7?c.push(l.r,l.g,l.b,i):c.push(u.r,u.g,u.b,s);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,16,16,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array(c)),a.isAlphaPremultiplied=!0,a.isRenderTexture=!1,a.width=16,a.height=16;var p=this.scene.sys.textures.addGLTexture(h(),a,16,16);return this.removeCheckerboard(),this._checkerboard=p,r.bindTexture(r.TEXTURE_2D,null),this.setTexture(p),this.setSizeToFrame(),this.setViewHeight(n),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},preUpdate:function(t,e){a.prototype.preUpdate.call(this,t,e),this.anims.update(t,e)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});t.exports=l},10912:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(10850),h=i(33412);r.register("plane",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),l=a(t,"width",8),u=a(t,"height",8),c=a(t,"tile",!1),d=new h(this.scene,0,0,i,r,l,u,c);void 0!==e&&(t.add=e);var f=a(t,"checkerboard",null);if(f){var p=a(f,"color1",16777215),g=a(f,"color2",255),v=a(f,"alpha1",255),m=a(f,"alpha2",255),y=a(f,"height",128);d.createCheckerboard(p,g,v,m,y)}return s(this.scene,d,t),n(d,t),d}))},58322:(t,e,i)=>{var s=i(33412);i(61286).register("plane",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},13171:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(74853),a=i(65641),h=i(71606),l=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.Mask,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible,h],initialize:function(t,e,i,s,n,h,l){void 0===s&&(s=16777215),void 0===n&&(n=128),void 0===h&&(h=1),void 0===l&&(l=.1),r.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(e,i),this.color=o(s),this.intensity=h,this.attenuation=l,this.width=2*n,this.height=2*n,this._radius=n},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},162:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(13171);n.register("pointlight",(function(t,e){void 0===t&&(t={});var i=r(t,"color",16777215),n=r(t,"radius",128),a=r(t,"intensity",1),h=r(t,"attenuation",.1),l=new o(this.scene,0,0,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},91201:(t,e,i)=>{var s=i(61286),n=i(13171);s.register("pointlight",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},71606:(t,e,i)=>{var s,n=i(72283),r=n;s=i(80590),t.exports={renderWebGL:s,renderCanvas:r}},80590:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){i.addToRenderList(e);var r=t.pipelines.set(e.pipeline),o=s(e,i,n).calc,a=e.width,h=e.height,l=-e._radius,u=-e._radius,c=l+a,d=u+h,f=o.getX(0,0),p=o.getY(0,0),g=o.getX(l,u),v=o.getY(l,u),m=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),T=o.getY(c,d),w=o.getX(c,u),b=o.getY(c,u);t.pipelines.preBatch(e),r.batchPointLight(e,i,g,v,m,y,x,T,w,b,f,p),t.pipelines.postBatch(e)}},15996:(t,e,i)=>{var s=i(56694),n=i(845),r=i(1539),o=new s({Extends:r,initialize:function(t,e,i,s,o){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=32),void 0===o&&(o=32);var a=new n(t.sys.textures,"",s,o);r.call(this,t,e,i,a),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(t,e){this.width=t,this.height=e,this.texture.setSize(t,e),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},resize:function(t,e){return this.setSize(t,e),this},saveTexture:function(t){var e=this.texture;return e.key=t,e.manager.addDynamicTexture(e)&&(this._saved=!0),e},fill:function(t,e,i,s,n,r){return this.texture.fill(t,e,i,s,n,r),this},clear:function(){return this.texture.clear(),this},stamp:function(t,e,i,s,n){return this.texture.stamp(t,e,i,s,n),this},erase:function(t,e,i){return this.texture.erase(t,e,i),this},draw:function(t,e,i,s,n){return this.texture.draw(t,e,i,s,n),this},drawFrame:function(t,e,i,s,n,r){return this.texture.drawFrame(t,e,i,s,n,r),this},repeat:function(t,e,i,s,n,r,o,a,h){return this.texture.repeat(t,e,i,s,n,r,o,a,h),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(t,e,i,s,n){return this.texture.batchDraw(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){return this.texture.batchDrawFrame(t,e,i,s,n,r),this},endDraw:function(t){return this.texture.endDraw(t),this},snapshotArea:function(t,e,i,s,n,r,o){return this.texture.snapshotArea(t,e,i,s,n,r,o),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});t.exports=o},85692:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(15996);n.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",32),h=r(t,"height",32),l=new o(this.scene,i,n,a,h);return void 0!==e&&(t.add=e),s(this.scene,l,t),l}))},29599:(t,e,i)=>{var s=i(61286),n=i(15996);s.register("renderTexture",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},79968:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(65641),h=i(58912),l=i(93736),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Flip,r.Mask,r.Pipeline,r.PostPipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,h],initialize:function(t,e,i,n,r,h,u,c,d){void 0===n&&(n="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!0),o.call(this,t,"Rope"),this.anims=new s(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===n,this.dirty=!1,this.horizontal=u,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,c,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate: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:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var s,n=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var r=0;if(void 0!==e)for(s=0;sr&&(o=t[r]),n[r]=o,t.length>r+1&&(o=t[r+1]),n[r+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,s=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(i=0;in&&(r=t[n]),s[n]=r,t.length>n+1&&(r=t[n+1]),s[n+1]=r}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var s,n,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,n=this.frame.width/(o-1),s=0;s{t.exports=function(){}},96027:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(10850),a=i(79968);n.register("rope",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),h=r(t,"horizontal",!0),l=o(t,"points",void 0),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,n,l,h,u,c);return void 0!==e&&(t.add=e),s(this.scene,d,t),d}))},31982:(t,e,i)=>{var s=i(79968);i(61286).register("rope",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))}))},58912:(t,e,i)=>{var s,n,r=i(72283);s=i(49489),n=i(44598),t.exports={renderWebGL:s,renderCanvas:n}},49489:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=s(e,i,r).calc,h=e.vertices,l=e.uv,u=e.colors,c=e.alphas,d=e.alpha,f=n.getTintAppendFloatAlpha,p=i.roundPixels,g=h.length,v=Math.floor(.5*g);o.flush(),t.pipelines.preBatch(e);var m=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,T=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,b=e.tintFill;e.dirty&&e.updateVertices();for(var E=e.debugCallback,S=[],A=0;A{var s=i(56694),n=i(64937),r=i(89980),o=i(72632),a=i(98611),h=i(22440),l=i(24252),u=i(69360),c=new s({Extends:r,Mixins:[n.ComputedSize,n.Depth,n.GetBounds,n.Mask,n.Origin,n.ScrollFactor,n.Transform,n.Visible,l],initialize:function(t,e,i,s,n,o,a,h){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new u,this._tempMatrix2=new u,this._tempMatrix3=new u,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,s),this.setSize(n,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(r.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,s=this.height,n=this.renderer;this.glTexture=n.createTextureFromSource(null,i,s,0),this.glTexture.flipY=e,this.framebuffer=n.createFramebuffer(i,s,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=s,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,s))}return this.shader&&(n.pipelines.clear(),this.load(),this.flush(),n.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var s=this.scene.sys.cache.shader;if(!s.has(t))return console.warn("Shader missing: "+t),this;this.shader=s.get(t)}else this.shader=t;var n=this.gl,r=this.renderer;this.program&&n.deleteProgram(this.program);var o=r.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);n.uniformMatrix4fv(n.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),n.uniformMatrix4fv(n.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),n.uniform2f(n.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,s){var n=1/(t-e),r=1/(i-s),o=this.projectionMatrix;o[0]=-2*n,o[5]=-2*r,o[10]=-.001,o[12]=(t+e)*n,o[13]=(s+i)*r,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var s in this._textureCount=0,this.uniforms){var n=this.uniforms[s],r=n.type,o=e[r];n.uniformLocation=t.getUniformLocation(i,s),"sampler2D"!==r&&(n.glMatrix=o.matrix,n.glValueLength=o.length,n.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,s,n,r){void 0===n&&(n=0),void 0===r&&(r={});var o=this.uniforms[t];return o.value=e,r.width=i,r.height=s,o.textureData=r,this._textureCount=n,this.initSampler2D(o),this},setSampler2D:function(t,e,i,s){void 0===i&&(i=0);var n=this.scene.sys.textures;if(n.exists(e)){var r=n.getFrame(e);if(r.glTexture&&r.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,r.glTexture,r.width,r.height,i,s);var o=this.uniforms[t],a=r.source;o.textureKey=e,o.source=a.image,o.value=r.glTexture,a.isGLTexture&&(s||(s={}),s.width=a.width,s.height=a.height),s&&(o.textureData=s),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var s=e[o(i,"magFilter","linear").toUpperCase()],n=e[o(i,"minFilter","linear").toUpperCase()],r=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(r=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,s,n,r=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,s=t.uniformLocation,null!==(n=t.value)&&(1===e?t.glMatrix?i.call(r,s,t.transpose,n):i.call(r,s,n):2===e?i.call(r,s,n.x,n.y):3===e?i.call(r,s,n.x,n.y,n.z):4===e?i.call(r,s,n.x,n.y,n.z,n.w):"sampler2D"===t.type&&(r.activeTexture(r.TEXTURE0+a),r.bindTexture(r.TEXTURE_2D,n),r.uniform1i(s,a),a++))},load:function(t){var e=this.gl,i=this.width,s=this.height,n=this.renderer,r=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(r),e.uniformMatrix4fv(e.getUniformLocation(r,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(r,"uResolution"),this.width,this.height);var l=this.uniforms,u=l.resolution;u.value.x=i,u.value.y=s,l.time.value=n.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,f=c.x/i,p=1-c.y/s;d.value.x=f.toFixed(2),d.value.y=p.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,s=this.gl,n=this.vertexBuffer,r=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(r.setFramebuffer(this.framebuffer),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT)),s.bindBuffer(s.ARRAY_BUFFER,n);var a=s.getAttribLocation(i,"inPosition");-1!==a&&(s.enableVertexAttribArray(a),s.vertexAttribPointer(a,2,s.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t,s.bufferSubData(s.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),s.drawArrays(s.TRIANGLES,0,6),this.renderToTexture&&r.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=c},10612:t=>{t.exports=function(){}},13908:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(27902);n.register("shader",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"x",0),a=r(t,"y",0),h=r(t,"width",128),l=r(t,"height",128),u=new o(this.scene,i,n,a,h,l);return void 0!==e&&(t.add=e),s(this.scene,u,t),u}))},51979:(t,e,i)=>{var s=i(27902);i(61286).register("shader",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},24252:(t,e,i)=>{var s,n,r=i(72283);s=i(19782),n=i(10612),t.exports={renderWebGL:s,renderCanvas:n}},19782:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var r=s(e,i,n).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(r.matrix),e.flush()}t.pipelines.rebind()}}},19543:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r,o){for(var a=s.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*n),h=i.pathData,l=i.pathIndexes,u=0;u{t.exports=function(t,e,i,s){var n=i||e.fillColor,r=s||e.fillAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},17876:t=>{t.exports=function(t,e,i,s){var n=i||e.strokeColor,r=s||e.strokeAlpha,o=(16711680&n)>>>16,a=(65280&n)>>>8,h=255&n;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},91461:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(89980),o=i(88829),a=new s({Extends:r,Mixins:[n.AlphaSingle,n.BlendMode,n.Depth,n.GetBounds,n.Mask,n.Origin,n.Pipeline,n.PostPipeline,n.ScrollFactor,n.Transform,n.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=a},50262:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n,r){var o=t.strokeTint,a=s.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-n,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p{var s=i(2213),n=i(56694),r=i(75606),o=i(11117),a=i(26673),h=i(83392),l=i(91461),u=new n({Extends:l,Mixins:[s],initialize:function(t,e,i,s,n,r,o,h,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=0),void 0===r&&(r=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,s)),this._startAngle=n,this._endAngle=r,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,s=r(this._startAngle),n=r(this._endAngle),a=i,l=i;n-=s,this._anticlockwise?n<-h.PI2?n=-h.PI2:n>0&&(n=-h.PI2+n%h.PI2):n>h.PI2?n=h.PI2:n<0&&(n=h.PI2+n%h.PI2);for(var u,c=[a+Math.cos(s)*i,l+Math.sin(s)*i];e<1;)u=n*e+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=n+s,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(s)*i,l+Math.sin(s)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},23560:(t,e,i)=>{var s=i(75606),n=i(15608),r=i(17876),o=i(49584);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,s(e._startAngle),s(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(n(h,e),h.fill()),e.isStroked&&(r(h,e),h.stroke()),h.restore()}}},10369:(t,e,i)=>{var s=i(28593),n=i(61286);n.register("arc",(function(t,e,i,n,r,o,a,h){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a,h))})),n.register("circle",(function(t,e,i,n,r){return this.displayList.add(new s(this.scene,t,e,i,0,360,!1,n,r))}))},2213:(t,e,i)=>{var s,n,r=i(72283);s=i(58356),n=i(23560),t.exports={renderWebGL:s,renderCanvas:n}},58356:(t,e,i)=>{var s=i(73329),n=i(19543),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},15220:(t,e,i)=>{var s=i(56694),n=i(87203),r=i(11117),o=i(74118),a=i(91461),h=new s({Extends:a,Mixins:[n],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",s),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==n&&this.setFillStyle(n,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],s=this.geom.getPoints(e),n=0;n{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),n=i(15220);s.register("curve",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},87203:(t,e,i)=>{var s,n,r=i(72283);s=i(82958),n=i(4024),t.exports={renderWebGL:s,renderCanvas:n}},82958:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},28591:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(84171),o=i(95669),a=i(91461),h=new s({Extends:a,Mixins:[r],initialize:function(t,e,i,s,n,r,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===n&&(n=128),a.call(this,t,"Ellipse",new o(s/2,n/2,s,n)),this._smoothness=64,this.setPosition(e,i),this.width=s,this.height=n,void 0!==r&&this.setFillStyle(r,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(28591);i(61286).register("ellipse",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},84171:(t,e,i)=>{var s,n,r=i(72283);s=i(17554),n=i(55881),t.exports={renderWebGL:s,renderCanvas:n}},17554:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},39169:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88059),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a,h,l,u,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===r&&(r=128),void 0===o&&(o=32),void 0===a&&(a=32),n.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(s,r),this.setFillStyle(h,l),void 0!==u&&this.setOutlineStyle(u,c),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},95525:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),v=Math.ceil(d/p),m=f,y=p,x=f-(g*f-c),T=p-(v*p-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===f&&x--,T===p&&T--),w&&e.fillAlpha>0)for(s(a,e),A=0;A0)for(s(a,e,e.altFillColor,e.altFillAlpha*u),A=0;A0){for(n(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S{var s=i(61286),n=i(39169);s.register("grid",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},88059:(t,e,i)=>{var s,n,r=i(72283);s=i(50639),n=i(95525),t.exports={renderWebGL:s,renderCanvas:n}},50639:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,u=i.alpha*e.alpha,c=e.width,d=e.height,f=e.cellWidth,p=e.cellHeight,g=Math.ceil(c/f),v=Math.ceil(d/p),m=f,y=p,x=f-(g*f-c),T=p-(v*p-d),w=e.showCells,b=e.showAltCells,E=e.showOutline,S=0,A=0,_=0,C=0,M=0;if(E&&(m--,y--,x===f&&x--,T===p&&T--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0)for(h=o.fillTint,l=n.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,A=0;A0){var R=o.strokeTint,P=n.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(R.TL=P,R.TR=P,R.BL=P,R.BR=P,S=1;S{var s=i(72296),n=i(56694),r=i(91461),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,s,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),r.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},32884:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection;e.showTop&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},88154:(t,e,i)=>{var s=i(61286),n=i(4415);s.register("isobox",(function(t,e,i,s,r,o,a){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a))}))},72296:(t,e,i)=>{var s,n,r=i(72283);s=i(33101),n=i(32884),t.exports={renderWebGL:s,renderCanvas:n}},33101:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o,a,h,l,u,c,d,f,p,g=t.pipelines.set(e.pipeline),v=s(e,i,r),m=g.calcMatrix.copyFrom(v.calc),y=e.width,x=e.height,T=y/2,w=y/e.projection,b=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=n.getTintAppendFloatAlpha(e.fillTop,b),a=m.getX(-T,-x),h=m.getY(-T,-x),l=m.getX(0,-w-x),u=m.getY(0,-w-x),c=m.getX(T,-x),d=m.getY(T,-x),f=m.getX(0,w-x),p=m.getY(0,w-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=n.getTintAppendFloatAlpha(e.fillLeft,b),a=m.getX(-T,0),h=m.getY(-T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(-T,-x),p=m.getY(-T,-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=n.getTintAppendFloatAlpha(e.fillRight,b),a=m.getX(T,0),h=m.getY(T,0),l=m.getX(0,w),u=m.getY(0,w),c=m.getX(0,w-x),d=m.getY(0,w-x),f=m.getX(T,-x),p=m.getY(T,-x),g.batchQuad(e,a,h,l,u,c,d,f,p,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},65159:(t,e,i)=>{var s=i(56694),n=i(93387),r=i(91461),o=new s({Extends:r,Mixins:[n],initialize:function(t,e,i,s,n,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=48),void 0===n&&(n=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),r.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(s,n),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},9923:(t,e,i)=>{var s=i(15608),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)&&e.isFilled){var a=e.width,h=e.height,l=a/2,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(s(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(s(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(s(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},67765:(t,e,i)=>{var s=i(61286),n=i(65159);s.register("isotriangle",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},93387:(t,e,i)=>{var s,n,r=i(72283);s=i(54946),n=i(9923),t.exports={renderWebGL:s,renderCanvas:n}},54946:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r),h=o.calcMatrix.copyFrom(a.calc),l=e.width,u=e.height,c=l/2,d=l/e.projection,f=e.isReversed,p=i.alpha*e.alpha;if(e.isFilled){var g,v,m,y,x,T,w;if(t.pipelines.preBatch(e),e.showTop&&f){g=n.getTintAppendFloatAlpha(e.fillTop,p),v=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),T=h.getX(c,-u),w=h.getY(c,-u);var b=h.getX(0,d-u),E=h.getY(0,d-u);o.batchQuad(e,v,m,y,x,T,w,b,E,0,0,1,1,g,g,g,g,2)}e.showLeft&&(g=n.getTintAppendFloatAlpha(e.fillLeft,p),f?(v=h.getX(-c,-u),m=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(v=h.getX(-c,0),m=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,v,m,y,x,T,w,0,0,1,1,g,g,g,2)),e.showRight&&(g=n.getTintAppendFloatAlpha(e.fillRight,p),f?(v=h.getX(c,-u),m=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)):(v=h.getX(c,0),m=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),T=h.getX(0,d-u),w=h.getY(0,d-u)),o.batchTri(e,v,m,y,x,T,w,0,0,1,1,g,g,g,2)),t.pipelines.postBatch(e)}}},579:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(88829),o=i(52660),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),n.call(this,t,"Line",new r(s,o,a,h));var c=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,s){return this.geom.setTo(t,e,i,s),this}});t.exports=a},52044:(t,e,i)=>{var s=i(17876),n=i(49584);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.currentContext;if(n(t,o,e,i,r)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(s(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},85665:(t,e,i)=>{var s=i(61286),n=i(579);s.register("line",(function(t,e,i,s,r,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h))}))},52660:(t,e,i)=>{var s,n,r=i(72283);s=i(46952),n=i(52044),t.exports={renderWebGL:s,renderCanvas:n}},46952:(t,e,i)=>{var s=i(73329),n=i(75512);t.exports=function(t,e,i,r){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=s(e,i,r);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.BR=d,o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,e._startWidth/2,e._endWidth/2,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},91249:(t,e,i)=>{var s=i(70573),n=i(56694),r=i(11117),o=i(14045),a=i(8580),h=i(91461),l=i(18974),u=new n({Extends:h,Mixins:[s],initialize:function(t,e,i,s,n,r){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(s));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==n&&this.setFillStyle(n,r),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(61286),n=i(91249);s.register("polygon",(function(t,e,i,s,r){return this.displayList.add(new n(this.scene,t,e,i,s,r))}))},70573:(t,e,i)=>{var s,n,r=i(72283);s=i(72841),n=i(40834),t.exports={renderWebGL:s,renderCanvas:n}},72841:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},517:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(91461),o=i(37673),a=new s({Extends:r,Mixins:[o],initialize:function(t,e,i,s,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new n(0,0,s,o)),this.setPosition(e,i),this.setSize(s,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this.updateDisplayOrigin();var i=this.input;return i&&!i.customHitArea&&(i.hitArea.width=t,i.hitArea.height=e),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},4091:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(s(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(n(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},94355:(t,e,i)=>{var s=i(61286),n=i(517);s.register("rectangle",(function(t,e,i,s,r,o){return this.displayList.add(new n(this.scene,t,e,i,s,r,o))}))},37673:(t,e,i)=>{var s,n,r=i(72283);s=i(43532),n=i(4091),t.exports={renderWebGL:s,renderCanvas:n}},43532:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},77843:(t,e,i)=>{var s=i(87956),n=i(56694),r=i(11117),o=i(91461),a=new n({Extends:o,Mixins:[s],initialize:function(t,e,i,s,n,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=5),void 0===n&&(n=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=s,this._innerRadius=n,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,s=this._outerRadius,n=Math.PI/2*3,o=Math.PI/e,a=s,h=s;t.push(a,h+-s);for(var l=0;l{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.pathData,c=u.length-1,d=u[0]-h,f=u[1]-l;a.beginPath(),a.moveTo(d,f),e.closePath||(c-=2);for(var p=2;p{var s=i(77843);i(61286).register("star",(function(t,e,i,n,r,o,a){return this.displayList.add(new s(this.scene,t,e,i,n,r,o,a))}))},87956:(t,e,i)=>{var s,n,r=i(72283);s=i(12037),n=i(11401),t.exports={renderWebGL:s,renderCanvas:n}},12037:(t,e,i)=>{var s=i(19543),n=i(73329),r=i(50262);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&s(a,l,e,d,u,c),e.isStroked&&r(a,e,d,u,c),t.pipelines.postBatch(e)}},21873:(t,e,i)=>{var s=i(56694),n=i(91461),r=i(66349),o=i(70498),a=new s({Extends:n,Mixins:[o],initialize:function(t,e,i,s,o,a,h,l,u,c,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===u&&(u=128),n.call(this,t,"Triangle",new r(s,o,a,h,l,u));var f=this.geom.right-this.geom.left,p=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(f,p),void 0!==c&&this.setFillStyle(c,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,s,n,r){return this.geom.setTo(t,e,i,s,n,r),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},60213:(t,e,i)=>{var s=i(15608),n=i(17876),r=i(49584);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(r(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,u=e.geom.x1-h,c=e.geom.y1-l,d=e.geom.x2-h,f=e.geom.y2-l,p=e.geom.x3-h,g=e.geom.y3-l;a.beginPath(),a.moveTo(u,c),a.lineTo(d,f),a.lineTo(p,g),a.closePath(),e.isFilled&&(s(a,e),a.fill()),e.isStroked&&(n(a,e),a.stroke()),a.restore()}}},79296:(t,e,i)=>{var s=i(61286),n=i(21873);s.register("triangle",(function(t,e,i,s,r,o,a,h,l,u){return this.displayList.add(new n(this.scene,t,e,i,s,r,o,a,h,l,u))}))},70498:(t,e,i)=>{var s,n,r=i(72283);s=i(72291),n=i(60213),t.exports={renderWebGL:s,renderCanvas:n}},72291:(t,e,i)=>{var s=i(73329),n=i(50262),r=i(75512);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=s(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,f=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=f,d.TR=f,d.BL=f,d.BR=f;var p=e.geom.x1-l,g=e.geom.y1-u,v=e.geom.x2-l,m=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(p,g,v,m,y,x,h.sprite,h.camera)}e.isStroked&&n(a,e,c,l,u),t.pipelines.postBatch(e)}},13747:(t,e,i)=>{var s=i(16569),n=i(56694),r=i(64937),o=i(89980),a=i(20791),h=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,a],initialize:function(t,e,i,n,r){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return r.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},27573:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},89219:(t,e,i)=>{var s=i(88933),n=i(32291),r=i(99325),o=i(20494),a=i(13747);r.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),r=o(t,"frame",null),h=new a(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),s(this.scene,h,t),n(h,t),h}))},66135:(t,e,i)=>{var s=i(61286),n=i(13747);s.register("sprite",(function(t,e,i,s){return this.displayList.add(new n(this.scene,t,e,i,s))}))},20791:(t,e,i)=>{var s,n,r=i(72283);s=i(21034),n=i(27573),t.exports={renderWebGL:s,renderCanvas:n}},21034:t=>{t.exports=function(t,e,i,s){i.addToRenderList(e),e.pipeline.batchSprite(e,i,s)}},32979:t=>{t.exports=function(t,e,i){var s=t.canvas,n=t.context,r=t.style,o=[],a=0,h=i.length;r.maxLines>0&&r.maxLines1&&(u+=t.letterSpacing*(i[l].length-1)),r.wordWrap&&(u-=n.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+r.strokeThickness,d=c*h,f=t.lineSpacing;return h>1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},27030:(t,e,i)=>{var s=i(61068);t.exports=function(t){var e=s.create(this),i=e.getContext("2d",{willReadFrequently:!0});t.syncFont(e,i);var n=i.measureText(t.testString);if("actualBoundingBoxAscent"in n){var r=n.actualBoundingBoxAscent,o=n.actualBoundingBoxDescent;return s.remove(e),{ascent:r,descent:o,fontSize:r+o}}var a=Math.ceil(n.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,s.remove(e),u;var d,f,p=c.data,g=p.length,v=4*a,m=0,y=!1;for(d=0;dh;d--){for(f=0;f{var s=i(99584),n=i(61068),r=i(56694),o=i(64937),a=i(89980),h=i(32979),l=i(10850),u=i(55638),c=i(80032),d=i(74744),f=new r({Extends:a,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,c],initialize:function(t,e,i,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=n.create(this),this.context,this.style=new d(this,r),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.letterSpacing=0,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.context=this.texture.context,this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(s),r&&r.padding&&this.setPadding(r.padding),r&&r.lineSpacing&&this.setLineSpacing(r.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",s(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var s="",n=t.replace(/ +/gi," ").split(this.splitRegExp),r=n.length,o=0;ol){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("wordWrapWidth < a single character");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");n.splice(o+1,0,y),r=n.length;break}h+=f,l-=p}s+=h.replace(/[ \n]*$/gi,"")+"\n"}}return s.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var s="",n=t.split(this.splitRegExp),r=n.length-1,o=e.measureText(" ").width,a=0;a<=r;a++){for(var h=i,l=n[a].split(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],f=e.measureText(d).width,p=f;ch&&c>0&&(s+="\n",h=i),s+=d,c0&&(d+=l.lineSpacing*g),i.rtl)c=f-c-u.left-u.right;else if("right"===i.align)c+=o-l.lineWidths[g];else if("center"===i.align)c+=(o-l.lineWidths[g])/2;else if("justify"===i.align&&l.lineWidths[g]/l.width>=.85){var v=l.width-l.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}if(this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(i.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color){i.syncShadow(e,i.shadowFill);var b=this.letterSpacing;if(0!==b)for(var E=0,S=a[g].split(""),A=0;A{t.exports=function(t,e,i,s){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},75397:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(76555);n.register("text",(function(t,e){void 0===t&&(t={});var i=r(t,"text",""),n=r(t,"style",null),a=r(t,"padding",null);null!==a&&(n.padding=a);var h=new o(this.scene,0,0,i,n);return void 0!==e&&(t.add=e),s(this.scene,h,t),h.autoRound=r(t,"autoRound",!0),h.resolution=r(t,"resolution",1),h}))},94627:(t,e,i)=>{var s=i(76555);i(61286).register("text",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},80032:(t,e,i)=>{var s,n,r=i(72283);s=i(76128),n=i(71649),t.exports={renderWebGL:s,renderCanvas:n}},74744:(t,e,i)=>{var s=i(56694),n=i(20494),r=i(10850),o=i(27030),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new s({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0)},setStyle:function(t,e,i){for(var s in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var h=i?a[s][1]:this[s];this[s]="wordWrapCallback"===s||"wordWrapCallbackScope"===s?r(t,a[s][0],h):n(t,a[s][0],h)}var l=r(t,"font",null);null!==l&&this.setFont(l,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var u=r(t,"fill",null);null!==u&&(this.color=u);var c=r(t,"metrics",!1);return c?this.metrics={ascent:r(c,"ascent",0),descent:r(c,"descent",0),fontSize:r(c,"fontSize",0)}:!e&&this.metrics||(this.metrics=o(this)),e?this.parent.updateText():this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,s="",n="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),s=r(t,"fontSize","16px"),n=r(t,"fontStyle","");else{var o=t.split(" "),a=0;n=o.length>2?o[a++]:"",s=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&s===this.fontSize&&n===this.fontStyle||(this.fontFamily=i,this.fontSize=s,this.fontStyle=n,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===s&&(s=0),void 0===n&&(n=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=s,this.shadowStroke=n,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},76128:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var r=e.frame,o=r.width,a=r.height,h=s.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),u=l.setTexture2D(r.glTexture,e);l.batchTexture(e,r.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,n,!1,u)}}},35856:(t,e,i)=>{var s=i(61068),n=i(56694),r=i(64937),o=i(89980),a=i(3504),h=i(8213),l=i(9271),u=i(93736),c=new n({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,l],initialize:function(t,e,i,n,r,h,l){var c=t.sys.renderer;o.call(this,t,"TileSprite");var d=t.sys.textures.get(h),f=d.get(l);f.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),f=(d=t.sys.textures.get("__MISSING")).get()),"DynamicTexture"===d.type&&(console.warn("TileSprite cannot use Dynamic Texture"),f=(d=t.sys.textures.get("__MISSING")).get()),n&&r?(n=Math.floor(n),r=Math.floor(r)):(n=f.width,r=f.height),this._tilePosition=new u,this._tileScale=new u(1,1),this.dirty=!1,this.renderer=c,this.canvas=s.create(this,n,r),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=d,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=a(f.width),this.potHeight=a(f.height),this.fillCanvas=s.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(e,i),this.setSize(n,r),this.setFrame(l),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=a(e.width),this.potHeight=a(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,s=this.potWidth,n=this.potHeight;this.renderer&&this.renderer.gl||(s=t.cutWidth,n=t.cutHeight),e.clearRect(0,0,s,n),i.width=s,i.height=n,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,s,n),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||h.disable(e);var i=this._tileScale.x,s=this._tileScale.y,n=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,s),e.translate(-n,-r),e.fillStyle=this.fillPattern,e.fillRect(n,r,this.width/i,this.height/s),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),s.remove(this.canvas),s.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=c},93305:t=>{t.exports=function(t,e,i,s){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,s)}},63950:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(35856);n.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=r(t,"x",0),n=r(t,"y",0),a=r(t,"width",512),h=r(t,"height",512),l=r(t,"key",""),u=r(t,"frame",""),c=new o(this.scene,i,n,a,h,l,u);return void 0!==e&&(t.add=e),s(this.scene,c,t),c}))},20509:(t,e,i)=>{var s=i(35856);i(61286).register("tileSprite",(function(t,e,i,n,r,o){return this.displayList.add(new s(this.scene,t,e,i,n,r,o))}))},9271:(t,e,i)=>{var s,n,r=i(72283);s=i(74287),n=i(93305),t.exports={renderWebGL:s,renderCanvas:n}},74287:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i,n){e.updateCanvas();var r=e.width,o=e.height;if(0!==r&&0!==o){i.addToRenderList(e);var a=s.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,r,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*r,e.originY*o,0,0,r,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,n,!1,l)}}},8630:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(64937),o=i(56631),a=i(97081),h=i(89980),l=i(83392),u=i(76038),c=i(76583),d=i(77974),f=new n({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,d],initialize:function(t,e,i,s){h.call(this,t,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=c(),this.touchLocked=!1,this.playWhenUnlocked=!1,this.frameReady=!1,this.isStalled=!1,this.failedPlayAttempts=0,this.metadata,this.retry=0,this.retryInterval=500,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={ended:this.completeHandler.bind(this),legacy:this.legacyPlayHandler.bind(this),playing:this.playingHandler.bind(this),seeked:this.seekedHandler.bind(this),seeking:this.seekingHandler.bind(this),stalled:this.stalledHandler.bind(this),suspend:this.stalledHandler.bind(this),waiting:this.stalledHandler.bind(this)},this._loadCallbackHandler=this.loadErrorHandler.bind(this),this._crop=this.resetCropObject(),this.markers={},this._markerIn=0,this._markerOut=0,this._playingMarker=!1,this._lastUpdate=0,this.cacheKey="",this.isSeeking=!1,this._playCalled=!1,this._rfvCallbackId=0;var n=t.sys.game;this._device=n.device.video,this.setPosition(e,i),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),n.events.on(a.PAUSE,this.globalPause,this),n.events.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(u.GLOBAL_MUTE,this.globalMute,this),s&&this.load(s)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(t){var e=this.scene.sys.cache.video.get(t);return e?(this.cacheKey=t,this.loadHandler(e.url,e.noAudio,e.crossOrigin)):console.warn("No video in cache for key: "+t),this},changeSource:function(t,e,i,s,n){void 0===e&&(e=!0),void 0===i&&(i=!1),this.cacheKey!==t&&(this.load(t),e&&this.play(i,s,n))},getVideoKey:function(){return this.cacheKey},loadURL:function(t,e,i){void 0===e&&(e=!1);var s=this._device.getVideoURL(t);return s?(this.cacheKey="",this.loadHandler(s.url,e,i)):console.warn("No supported video format found for "+t),this},loadMediaStream:function(t,e,i){return this.loadHandler(null,e,i,t)},loadHandler:function(t,e,i,s){e||(e=!1);var n=this.video;if(n?(this.removeLoadEventHandlers(),this.stop()):((n=document.createElement("video")).controls=!1,n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.setAttribute("disablePictureInPicture","true")),e?(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")):(n.muted=!1,n.defaultMuted=!1,n.removeAttribute("autoplay")),i?n.setAttribute("crossorigin",i):n.removeAttribute("crossorigin"),s)if("srcObject"in n)try{n.srcObject=s}catch(t){if("TypeError"!==t.name)throw t;n.src=URL.createObjectURL(s)}else n.src=URL.createObjectURL(s);else n.src=t;return this.addLoadEventHandlers(),this.retry=0,this.video=n,this._playCalled=!1,n.load(),this},requestVideoFrame:function(t,e){var i=this.video;if(i){var s=e.width,n=e.height,r=this.videoTexture,a=this.videoTextureSource,h=!r||a.source!==i;h?(this._codePaused=i.paused,this._codeMuted=i.muted,r?(a.source=i,a.width=s,a.height=n,r.get().setSize(s,n)):((r=this.scene.sys.textures.create(this._key,i,s,n)).add("__BASE",0,0,0,s,n),this.setTexture(r),this.videoTexture=r,this.videoTextureSource=r.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(o.VIDEO_TEXTURE,this,r)),this.setSizeToFrame(),this.updateDisplayOrigin()):a.update(),this.isStalled=!1,this.metadata=e;var l=e.mediaTime;h&&(this._lastUpdate=l,this.emit(o.VIDEO_CREATED,this,s,n),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?l>=this._markerOut&&(i.loop?(i.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):l-1&&i>e&&i=0&&!isNaN(i)&&i>e&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,s,n,r){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=i),void 0===r&&(r=s);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(n,r),o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)):(a=this.scene.sys.textures.createCanvas(c(),n,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,s,0,0,n,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var t=this.scene.sys.sound;t&&t.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(t){var e=t.name;"NotAllowedError"===e?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):"NotSupportedError"===e?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,t)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,t))},legacyPlayHandler:function(){var t=this.video;t&&(this.playSuccess(),t.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(t){this.stop(!1),this.emit(o.VIDEO_ERROR,this,t)},stalledHandler:function(t){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,t)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(t,e){this.video&&this._playCalled&&this.touchLocked&&this.playWhenUnlocked&&(this.retry+=e,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var s=i*t;this.setCurrentTime(s)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],s=parseFloat(t.substr(1));"+"===i?t=e.currentTime+s:"-"===i&&(t=e.currentTime-s)}e.currentTime=t}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var t=this.video;if(t){var e=t.duration;if(e!==1/0&&!isNaN(e))return t.currentTime/e}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&!this.video.ended&&(this.removeEventHandlers(),this.video.pause())},globalResume:function(){this._systemPaused=!1,!this.video||this._codePaused||this.video.ended||this.createPlayPromise()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&!e.ended&&(t?e.paused||(this.removeEventHandlers(),e.pause()):t||(this._playCalled?e.paused&&!this._systemPaused&&this.createPlayPromise():this.play())),this},pause:function(){return this.setPaused(!0)},resume:function(){return this.setPaused(!1)},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,t),this.videoTextureSource.setFlipY(e)),this._key=t,this.flipY=e,!!this.videoTexture},stop:function(t){void 0===t&&(t=!0);var e=this.video;return e&&(this.removeEventHandlers(),e.cancelVideoFrameCallback(this._rfvCallbackId),e.pause()),this.retry=0,this._playCalled=!1,t&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(u.GLOBAL_MUTE,this.globalMute,this)}});t.exports=f},56933:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,s))}},65601:(t,e,i)=>{var s=i(88933),n=i(99325),r=i(20494),o=i(8630);n.register("video",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),s(this.scene,n,t),n}))},215:(t,e,i)=>{var s=i(8630);i(61286).register("video",(function(t,e,i){return this.displayList.add(new s(this.scene,t,e,i))}))},77974:(t,e,i)=>{var s,n,r=i(72283);s=i(83572),n=i(56933),t.exports={renderWebGL:s,renderCanvas:n}},83572:t=>{t.exports=function(t,e,i,s){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,s))}},71030:(t,e,i)=>{var s=i(95723),n=i(26673),r=i(65650),o=i(56694),a=i(64937),h=i(89980),l=i(74118),u=i(94287),c=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r=n),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=n,this.height=r,this.blendMode=s.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var s=this.input;return i&&s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new n(0,0,t),r)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),u)},setDropZone:function(t,e){return this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},24067:(t,e,i)=>{var s=i(99325),n=i(20494),r=i(71030);s.register("zone",(function(t){var e=n(t,"x",0),i=n(t,"y",0),s=n(t,"width",1),o=n(t,"height",s);return new r(this.scene,e,i,s,o)}))},34546:(t,e,i)=>{var s=i(71030);i(61286).register("zone",(function(t,e,i,n){return this.displayList.add(new s(this.scene,t,e,i,n))}))},95847:t=>{t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},26673:(t,e,i)=>{var s=i(56694),n=i(65650),r=i(94026),o=i(62941),a=i(52394),h=i(30977),l=new s({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},37964:t=>{t.exports=function(t){return Math.PI*t.radius*2}},72233:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},61761:(t,e,i)=>{var s=i(26673);t.exports=function(t){return new s(t.x,t.y,t.radius)}},65650:t=>{t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},39187:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)}},58672:(t,e,i)=>{var s=i(65650);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},42997:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},94894:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},48027:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},94026:(t,e,i)=>{var s=i(72233),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},62941:(t,e,i)=>{var s=i(37964),n=i(72233),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},88665:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},30977:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),r=n>1?2-n:n,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},6112:(t,e,i)=>{var s=i(26673);s.Area=i(95847),s.Circumference=i(37964),s.CircumferencePoint=i(72233),s.Clone=i(61761),s.Contains=i(65650),s.ContainsPoint=i(39187),s.ContainsRect=i(58672),s.CopyFrom=i(42997),s.Equals=i(94894),s.GetBounds=i(48027),s.GetPoint=i(94026),s.GetPoints=i(62941),s.Offset=i(34585),s.OffsetPoint=i(88665),s.Random=i(30977),t.exports=s},52394:t=>{t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},58605:t=>{t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},39507:t=>{t.exports=function(t){var e=t.width/2,i=t.height/2,s=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*s/(10+Math.sqrt(4-3*s)))}},86998:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.width/2,r=t.height/2;return i.x=t.x+n*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},81773:(t,e,i)=>{var s=i(95669);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},72313:t=>{t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var s=(e-t.x)/t.width,n=(i-t.y)/t.height;return(s*=s)+(n*=n)<.25}},34368:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)}},71431:(t,e,i)=>{var s=i(72313);t.exports=function(t,e){return s(t,e.x,e.y)&&s(t,e.right,e.y)&&s(t,e.x,e.bottom)&&s(t,e.right,e.bottom)}},75459:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},95669:(t,e,i)=>{var s=i(56694),n=i(72313),r=i(95340),o=i(54978),a=i(52394),h=i(72006),l=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=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},98068:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},72897:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},95340:(t,e,i)=>{var s=i(86998),n=i(91806),r=i(83392),o=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=n(e,0,r.PI2);return s(t,a,i)}},54978:(t,e,i)=>{var s=i(39507),n=i(86998),r=i(91806),o=i(83392);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=s(t)/i);for(var h=0;h{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},36233:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},72006:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return e.x=t.x+n*Math.cos(i)*t.width/2,e.y=t.y+n*Math.sin(i)*t.height/2,e}},40652:(t,e,i)=>{var s=i(95669);s.Area=i(58605),s.Circumference=i(39507),s.CircumferencePoint=i(86998),s.Clone=i(81773),s.Contains=i(72313),s.ContainsPoint=i(34368),s.ContainsRect=i(71431),s.CopyFrom=i(75459),s.Equals=i(98068),s.GetBounds=i(72897),s.GetPoint=i(95340),s.GetPoints=i(54978),s.Offset=i(77951),s.OffsetPoint=i(36233),s.Random=i(72006),t.exports=s},84068:(t,e,i)=>{var s=i(52394),n=i(98611),r={Circle:i(6112),Ellipse:i(40652),Intersects:i(7563),Line:i(28482),Mesh:i(14293),Point:i(63472),Polygon:i(44359),Rectangle:i(66658),Triangle:i(87619)};r=n(!1,r,s),t.exports=r},22184:(t,e,i)=>{var s=i(53996);t.exports=function(t,e){return s(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},26535:t=>{t.exports=function(t,e){var i=e.width/2,s=e.height/2,n=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-s),o=i+t.radius,a=s+t.radius;if(n>o||r>a)return!1;if(n<=i||r<=s)return!0;var h=n-i,l=r-s;return h*h+l*l<=t.radius*t.radius}},71145:(t,e,i)=>{var s=i(79967),n=i(22184);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new s(h,-o/(2*r))):a>0&&(i.push(new s(h,(-o+Math.sqrt(a))/(2*r))),i.push(new s(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new s(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new s(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new s(h,v-h*g)))}}return i}},62508:(t,e,i)=>{var s=i(26111),n=i(26535);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();s(r,t,i),s(o,t,i),s(a,t,i),s(h,t,i)}return i}},26111:(t,e,i)=>{var s=i(79967),n=i(61472);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r,o,a=t.x1,h=t.y1,l=t.x2,u=t.y2,c=e.x,d=e.y,f=e.radius,p=l-a,g=u-h,v=a-c,m=h-d,y=p*p+g*g,x=2*(p*v+g*m),T=x*x-4*y*(v*v+m*m-f*f);if(0===T){var w=-x/(2*y);r=a+w*p,o=h+w*g,w>=0&&w<=1&&i.push(new s(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new s(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*p,o=h+E*g,E>=0&&E<=1&&i.push(new s(r,o))}}return i}},96537:(t,e,i)=>{var s=i(70015);t.exports=function(t,e,i,n){void 0===i&&(i=!1);var r,o,a,h=t.x1,l=t.y1,u=t.x2,c=t.y2,d=e.x1,f=e.y1,p=u-h,g=c-l,v=e.x2-d,m=e.y2-f,y=p*m-g*v;if(0===y)return null;if(i){if((o=(d+v*(r=(p*(f-l)+g*(h-d))/(v*g-m*p))-h)/p)<0||r<0||r>1)return null;a=o}else{if(o=((l-f)*p-(h-d)*g)/y,(r=((d-h)*m-(f-l)*v)/y)<0||r>1||o<0||o>1)return null;a=r}return void 0===n&&(n=new s),n.set(h+p*a,l+g*a,a)}},17647:(t,e,i)=>{var s=i(96537),n=i(88829),r=i(70015),o=new n,a=new r;t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=new r);var h=!1;n.set(),a.set();for(var l=e[e.length-1],u=0;u{var s=i(70015),n=i(51729),r=i(17647),o=new s;t.exports=function(t,e,i,s){void 0===s&&(s=new n),Array.isArray(e)||(e=[e]);var a=!1;s.set(),o.set();for(var h=0;h{var s=i(79967),n=i(25227),r=i(47910);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new s,new s,new s,new s],c=[n(o,t,u[0]),n(a,t,u[1]),n(h,t,u[2]),n(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},7449:(t,e,i)=>{var s=i(51729),n=i(68439),r=new(i(88829));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);r.setTo(e,i,e+h,i+l);var u=n(r,o,!0);u&&a.push(new s(u.x,u.y,t,u.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var s=[],n=[],r=0;r{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},1946:(t,e,i)=>{var s=i(9569),n=i(90205);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();s(r,e,i),s(o,e,i),s(a,e,i),s(h,e,i)}return i}},34211:(t,e,i)=>{var s=i(20370),n=i(9569);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(r,t,i),n(o,t,i),n(a,t,i)}return i}},80511:(t,e,i)=>{var s=i(26111),n=i(48411);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();s(r,e,i),s(o,e,i),s(a,e,i)}return i}},31343:(t,e,i)=>{var s=i(79967),n=i(86117),r=i(25227);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new s,new s,new s],u=[r(o,e,l[0]),r(a,e,l[1]),r(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},70534:(t,e,i)=>{var s=i(23589),n=i(31343);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();n(t,r,i),n(t,o,i),n(t,a,i)}return i}},61472:(t,e,i)=>{var s=i(65650),n=new(i(79967));t.exports=function(t,e,i){if(void 0===i&&(i=n),s(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(s(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&s(e,i.x,i.y)}},25227:t=>{t.exports=function(t,e,i){var s=t.x1,n=t.y1,r=t.x2,o=t.y2,a=e.x1,h=e.y1,l=e.x2,u=e.y2;if(s===r&&n===o||a===l&&h===u)return!1;var c=(u-h)*(r-s)-(l-a)*(o-n);if(0===c)return!1;var d=((l-a)*(n-h)-(u-h)*(s-a))/c,f=((r-s)*(n-h)-(o-n)*(s-a))/c;return!(d<0||d>1||f<0||f>1||(i&&(i.x=s+d*(r-s),i.y=n+d*(o-n)),0))}},47910:t=>{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&s>=a&&s<=l||n>=o&&n<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=s+(r-s)*(o-i)/(n-i))>a&&u<=l)return!0}else if(i>h&&n<=h&&(u=s+(r-s)*(h-i)/(n-i))>=a&&u<=l)return!0;if(s=a){if((u=i+(n-i)*(a-s)/(r-s))>=o&&u<=h)return!0}else if(s>l&&r<=l&&(u=i+(n-i)*(l-s)/(r-s))>=o&&u<=h)return!0;return!1}},34426:t=>{t.exports=function(t,e,i){void 0===i&&(i=1);var s=e.x1,n=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-s)*(r-s)+(o-n)*(o-n);if(0===l)return!1;var u=((a-s)*(r-s)+(h-n)*(o-n))/l;if(u<0)return Math.sqrt((s-a)*(s-a)+(n-h)*(n-h))<=i;if(u>=0&&u<=1){var c=((n-h)*(r-s)-(s-a)*(o-n))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},81414:(t,e,i)=>{var s=i(34426);t.exports=function(t,e){if(!s(t,e))return!1;var i=Math.min(e.x1,e.x2),n=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=n&&t.y>=r&&t.y<=o}},90205:t=>{t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},20370:(t,e,i)=>{var s=i(25227),n=i(94287),r=i(86875),o=i(87279);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},8786:t=>{t.exports=function(t,e,i,s,n,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||n{var s=i(61472),n=i(60689);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom{var s=i(25227);t.exports=function(t,e){return!!(t.contains(e.x1,e.y1)||t.contains(e.x2,e.y2)||s(t.getLineA(),e)||s(t.getLineB(),e)||s(t.getLineC(),e))}},23589:(t,e,i)=>{var s=i(86875),n=i(18680),r=i(25227);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(c=n(e),(d=s(t,c,!0)).length>0)}},7563:(t,e,i)=>{t.exports={CircleToCircle:i(22184),CircleToRectangle:i(26535),GetCircleToCircle:i(71145),GetCircleToRectangle:i(62508),GetLineToCircle:i(26111),GetLineToLine:i(96537),GetLineToPoints:i(17647),GetLineToPolygon:i(68439),GetLineToRectangle:i(9569),GetRaysFromPointToPolygon:i(7449),GetRectangleIntersection:i(82931),GetRectangleToRectangle:i(1946),GetRectangleToTriangle:i(34211),GetTriangleToCircle:i(80511),GetTriangleToLine:i(31343),GetTriangleToTriangle:i(70534),LineToCircle:i(61472),LineToLine:i(25227),LineToRectangle:i(47910),PointToLine:i(34426),PointToLineSegment:i(81414),RectangleToRectangle:i(90205),RectangleToTriangle:i(20370),RectangleToValues:i(8786),TriangleToCircle:i(48411),TriangleToLine:i(86117),TriangleToTriangle:i(23589)}},50599:t=>{t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},58813:t=>{t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var s=Math.round(t.x1),n=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-s),h=Math.abs(o-n),l=s-h&&(c-=h,s+=l),f{t.exports=function(t,e,i){var s=e-(t.x1+t.x2)/2,n=i-(t.y1+t.y2)/2;return t.x1+=s,t.y1+=n,t.x2+=s,t.y2+=n,t}},26718:(t,e,i)=>{var s=i(88829);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2)}},88930:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},90656:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},30897:(t,e,i)=>{var s=i(16028);t.exports=function(t,e,i){void 0===i&&(i=e);var n=s(t),r=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-r/n*e,t.y1=t.y1-o/n*e),i&&(t.x2=t.x2+r/n*i,t.y2=t.y2+o/n*i),t}},30684:(t,e,i)=>{var s=i(92951),n=i(21902),r=i(79967);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,u=[],c=t.x1,d=t.y1,f=t.x2-c,p=t.y2-d,g=n(e,a),v=i-1;for(h=0;h0){var m=u[0],y=[m];for(h=1;h=o&&(y.push(x),m=x)}var T=u[u.length-1];return s(m,T){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},11222:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x1,r=t.y1,o=t.x2,a=t.y2,h=(o-n)*(o-n)+(a-r)*(a-r);if(0===h)return i;var l=((e.x-n)*(o-n)+(e.y-r)*(a-r))/h;return i.x=n+l*(o-n),i.y=r+l*(a-r),i}},7377:(t,e,i)=>{var s=i(83392),n=i(50599),r=i(79967);t.exports=function(t,e){void 0===e&&(e=new r);var i=n(t)-s.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},66464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){return void 0===i&&(i=new s),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},8570:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=s(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u{t.exports=function(t,e){var i=t.x1,s=t.y1,n=t.x2,r=t.y2,o=(n-i)*(n-i)+(r-s)*(r-s);if(0===o)return!1;var a=((s-e.y)*(n-i)-(i-e.x)*(r-s))/o;return Math.abs(a)*Math.sqrt(o)}},82996:t=>{t.exports=function(t){return Math.abs(t.y1-t.y2)}},16028:t=>{t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},88829:(t,e,i)=>{var s=i(56694),n=i(66464),r=i(8570),o=i(52394),a=i(74077),h=i(93736),l=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=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=s},getPoint:function(t,e){return n(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo: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=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this},setFromObjects:function(t,e){return this.x1=t.x,this.y1=t.y,this.x2=e.x,this.y2=e.y,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},73273:(t,e,i)=>{var s=i(83392),n=i(1071),r=i(50599);t.exports=function(t){var e=r(t)-s.TAU;return n(e,-Math.PI,Math.PI)}},96936:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.cos(n(t)-s.TAU)}},43581:(t,e,i)=>{var s=i(83392),n=i(50599);t.exports=function(t){return Math.sin(n(t)-s.TAU)}},13990:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},1298:t=>{t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},74077:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},30473:(t,e,i)=>{var s=i(50599),n=i(73273);t.exports=function(t,e){return 2*n(e)-Math.PI-s(t)}},25968:(t,e,i)=>{var s=i(1809);t.exports=function(t,e){var i=(t.x1+t.x2)/2,n=(t.y1+t.y2)/2;return s(t,i,n,e)}},24296:(t,e,i)=>{var s=i(1809);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},1809:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,t}},88171:t=>{t.exports=function(t,e,i,s,n){return t.x1=e,t.y1=i,t.x2=e+Math.cos(s)*n,t.y2=i+Math.sin(s)*n,t}},82797:t=>{t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},41067:t=>{t.exports=function(t){return Math.abs(t.x1-t.x2)}},28482:(t,e,i)=>{var s=i(88829);s.Angle=i(50599),s.BresenhamPoints=i(58813),s.CenterOn=i(88513),s.Clone=i(26718),s.CopyFrom=i(88930),s.Equals=i(90656),s.Extend=i(30897),s.GetEasedPoints=i(30684),s.GetMidPoint=i(20487),s.GetNearestPoint=i(11222),s.GetNormal=i(7377),s.GetPoint=i(66464),s.GetPoints=i(8570),s.GetShortestDistance=i(65269),s.Height=i(82996),s.Length=i(16028),s.NormalAngle=i(73273),s.NormalX=i(96936),s.NormalY=i(43581),s.Offset=i(13990),s.PerpSlope=i(1298),s.Random=i(74077),s.ReflectAngle=i(30473),s.Rotate=i(25968),s.RotateAroundPoint=i(24296),s.RotateAroundXY=i(1809),s.SetToAngle=i(88171),s.Slope=i(82797),s.Width=i(41067),t.exports=s},18693:(t,e,i)=>{var s=i(56694),n=i(74118),r=i(93736);function o(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}var a=new s({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new n,this._inCenter=new r},getInCenter:function(t){void 0===t&&(t=!0);var e,i,s,n,r,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,s=l.x,n=l.y,r=u.x,a=u.y):(e=h.vx,i=h.vy,s=l.vx,n=l.vy,r=u.vx,a=u.vy);var c=o(r,a,s,n),d=o(e,i,r,a),f=o(s,n,e,i),p=c+d+f;return this._inCenter.set((e*c+s*d+r*f)/p,(i*c+n*d+a*f)/p)},contains:function(t,e,i){var s=this.vertex1,n=this.vertex2,r=this.vertex3,o=s.vx,a=s.vy,h=n.vx,l=n.vy,u=r.vx,c=r.vy;if(i){var d=i.a,f=i.b,p=i.c,g=i.d,v=i.e,m=i.f;o=s.vx*d+s.vy*p+v,a=s.vx*f+s.vy*g+m,h=n.vx*d+n.vy*p+v,l=n.vx*f+n.vy*g+m,u=r.vx*d+r.vy*p+v,c=r.vx*f+r.vy*g+m}var y=u-o,x=c-a,T=h-o,w=l-a,b=t-o,E=e-a,S=y*y+x*x,A=y*T+x*w,_=y*b+x*E,C=T*T+w*w,M=T*b+w*E,R=S*C-A*A,P=0===R?0:1/R,O=(C*_-A*M)*P,L=(S*M-A*_)*P;return O>=0&&L>=0&&O+L<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,s=this.vertex3,n=(i.vx-e.vx)*(s.vy-e.vy)-(i.vy-e.vy)*(s.vx-e.vx);return t<=0?n>=0:n<0},load:function(t,e,i,s,n){return i=this.vertex1.load(t,e,i,s,n),i=this.vertex2.load(t,e,i,s,n),this.vertex3.load(t,e,i,s,n)},transformCoordinatesLocal:function(t,e,i,s){return this.vertex1.transformCoordinatesLocal(t,e,i,s),this.vertex2.transformCoordinatesLocal(t,e,i,s),this.vertex3.transformCoordinatesLocal(t,e,i,s),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,s=this.bounds;return s.x=Math.min(t.vx,e.vx,i.vx),s.y=Math.min(t.vy,e.vy,i.vy),s.width=Math.max(t.vx,e.vx,i.vx)-s.x,s.height=Math.max(t.vy,e.vy,i.vy)-s.y,this},isInView:function(t,e,i,s,n,r,o,a,h,l,u){this.update(s,n,r,o,a,h,l,u);var c=this.vertex1,d=this.vertex2,f=this.vertex3;if(c.ta<=0&&d.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var p=this.bounds;p.x=Math.min(c.tx,d.tx,f.tx),p.y=Math.min(c.ty,d.ty,f.ty),p.width=Math.max(c.tx,d.tx,f.tx)-p.x,p.height=Math.max(c.ty,d.ty,f.ty)-p.y;var g=t.x+t.width,v=t.y+t.height;return!(p.width<=0||p.height<=0||t.width<=0||t.height<=0||p.rightg||p.y>v)},scrollUV:function(t,e){return this.vertex1.scrollUV(t,e),this.vertex2.scrollUV(t,e),this.vertex3.scrollUV(t,e),this},scaleUV:function(t,e){return this.vertex1.scaleUV(t,e),this.vertex2.scaleUV(t,e),this.vertex3.scaleUV(t,e),this},setColor:function(t){return this.vertex1.color=t,this.vertex2.color=t,this.vertex3.color=t,this},update:function(t,e,i,s,n,r,o,a){return this.vertex1.update(e,i,s,n,r,o,a,t),this.vertex2.update(e,i,s,n,r,o,a,t),this.vertex3.update(e,i,s,n,r,o,a,t),this},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,s=this.vertex2,n=this.vertex3;return i.x+=t,i.y+=e,s.x+=t,s.y+=e,n.x+=t,n.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=a},99425:(t,e,i)=>{var s=i(18693),n=i(72632),r=i(16650),o=i(70015),a=i(85769),h=new o,l=new o,u=new r;t.exports=function(t){var e,i=n(t,"mesh"),r=n(t,"texture",null),o=n(t,"frame"),c=n(t,"width",1),d=n(t,"height",c),f=n(t,"widthSegments",1),p=n(t,"heightSegments",f),g=n(t,"x",0),v=n(t,"y",0),m=n(t,"z",0),y=n(t,"rotateX",0),x=n(t,"rotateY",0),T=n(t,"rotateZ",0),w=n(t,"zIsUp",!0),b=n(t,"isOrtho",!!i&&i.dirtyCache[11]),E=n(t,"colors",[16777215]),S=n(t,"alphas",[1]),A=n(t,"tile",!1),_=n(t,"flipY",!1),C=n(t,"width",null),M={faces:[],verts:[]};if(h.set(g,v,m),l.set(y,x,T),u.fromRotationXYTranslation(l,h,w),!r&&i)r=i.texture,o||(e=i.frame);else if(i&&"string"==typeof r)r=i.scene.sys.textures.get(r);else if(!r)return M;e||(e=r.get(o)),!C&&b&&r&&i&&(c=e.width/i.height,d=e.height/i.height);var R,P,O=c/2,L=d/2,F=Math.floor(f),D=Math.floor(p),k=F+1,I=D+1,B=c/F,N=d/D,U=[],X=[],Y=0,z=1,G=0,V=1;e&&(Y=e.u0,z=e.u1,_?(G=e.v1,V=e.v0):(G=e.v0,V=e.v1));var W=z-Y,H=V-G;for(P=0;P{var s=i(18693),n=i(16650),r=i(70015),o=i(85769),a=new r,h=new r,l=new n;t.exports=function(t,e,i,n,r,u,c,d,f,p){void 0===i&&(i=1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===u&&(u=0),void 0===c&&(c=0),void 0===d&&(d=0),void 0===f&&(f=0),void 0===p&&(p=!0);var g={faces:[],verts:[]},v=t.materials;a.set(n,r,u),h.set(c,d,f),l.fromRotationXYTranslation(h,a,p);for(var m=0;m{var s=i(18693),n=i(85769);t.exports=function(t,e,i,r,o,a,h,l){if(void 0===r&&(r=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),void 0===l&&(l=!1),t.length===e.length||r){var u,c,d,f,p,g,v,m,y,x,T,w={faces:[],vertices:[]},b=r?3:2,E=Array.isArray(a),S=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(u=0;u{var e=!0,i="untitled",s="",n="";function r(t){return 0===t.models.length&&t.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),s="",t.models[t.models.length-1]}function o(t,e){var n=t.length>=2?t[1]:i;e.models.push({faces:[],name:n,textureCoords:[],vertexNormals:[],vertices:[]}),s=""}function a(t){2===t.length&&(s=t[1])}function h(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,o=i>=4?parseFloat(t[3]):0;r(e).vertices.push({x:s,y:n,z:o})}function l(t,i){var s=t.length,n=s>=2?parseFloat(t[1]):0,o=s>=3?parseFloat(t[2]):0,a=s>=4?parseFloat(t[3]):0;isNaN(n)&&(n=0),isNaN(o)&&(o=0),isNaN(a)&&(a=0),e&&(o=1-o),r(i).textureCoords.push({u:n,v:o,w:a})}function u(t,e){var i=t.length,s=i>=2?parseFloat(t[1]):0,n=i>=3?parseFloat(t[2]):0,o=i>=4?parseFloat(t[3]):0;r(e).vertexNormals.push({x:s,y:n,z:o})}function c(t,e){var i=t.length-1;if(!(i<3)){for(var o={group:s,material:n,vertices:[]},a=0;a3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=r(e).vertices.length+1+u),c-=1,u-=1,d-=1,o.vertices.push({textureCoordsIndex:c,vertexIndex:u,vertexNormalIndex:d}))}}r(e).faces.push(o)}}function d(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(n=t[1])}t.exports=function(t,i){void 0===i&&(i=!0),e=i;var r,p,g={materials:{},materialLibraries:[],models:[]};s="",n="";for(var v=t.split("\n"),m=0;m-1?r.substring(0,p):r).replace(/\s\s+/g," ").trim().split(" ");switch(y[0].toLowerCase()){case"o":o(y,g);break;case"g":a(y);break;case"v":h(y,g);break;case"vt":l(y,g);break;case"vn":u(y,g);break;case"f":c(y,g);break;case"mtllib":d(y,g);break;case"usemtl":f(y)}}return g}},76799:(t,e,i)=>{var s=i(22946);t.exports=function(t){for(var e={},i=t.split("\n"),n="",r=0;r=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[n]=s(h,l,u)}}}return e}},15313:t=>{t.exports=function(t,e,i,s){var n,r;if(void 0===i&&void 0===s){var o=t.getInCenter();n=o.x,r=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-n,f=l.y-r;l.set(d*a-f*h+n,d*h+f*a+r),d=u.x-n,f=u.y-r,u.set(d*a-f*h+n,d*h+f*a+r),d=c.x-n,f=c.y-r,c.set(d*a-f*h+n,d*h+f*a+r)}},85769:(t,e,i)=>{var s=i(56694),n=i(75512),r=i(70015),o=new s({Extends:r,initialize:function(t,e,i,s,n,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),r.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,this.u=s,this.v=n,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=n},setUVs:function(t,e){return this.u=t,this.v=e,this.tu=t,this.tv=e,this},scrollUV:function(t,e){return this.tu+=t,this.tv+=e,this},scaleUV:function(t,e){return this.tu=this.u*t,this.tv=this.v*e,this},transformCoordinatesLocal:function(t,e,i,s){var n=this.x,r=this.y,o=this.z,a=t.val,h=n*a[0]+r*a[4]+o*a[8]+a[12],l=n*a[1]+r*a[5]+o*a[9]+a[13],u=n*a[2]+r*a[6]+o*a[10]+a[14],c=n*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=s<=0?u/c:-u/c},resize:function(t,e,i,s,n,r){return this.x=t,this.y=e,this.vx=this.x*i,this.vy=-this.y*s,this.vz=0,n<.5?this.vx+=i*(.5-n):n>.5&&(this.vx-=i*(n-.5)),r<.5?this.vy+=s*(.5-r):r>.5&&(this.vy-=s*(r-.5)),this},update:function(t,e,i,s,n,r,o,a){var h=this.vx*t+this.vy*i+n,l=this.vx*e+this.vy*s+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,s,r){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.tu,t[++i]=this.tv,t[++i]=s,t[++i]=r,e[++i]=n.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},14293:(t,e,i)=>{var s={Face:i(18693),GenerateGridVerts:i(99425),GenerateObjVerts:i(53267),GenerateVerts:i(67623),ParseObj:i(27291),ParseObjMaterial:i(76799),RotateFace:i(15313),Vertex:i(85769)};t.exports=s},77601:t=>{t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},38933:(t,e,i)=>{var s=i(79967);t.exports=function(t){return new s(t.x,t.y)}},47103:t=>{t.exports=function(t,e){return e.setTo(t.x,t.y)}},13625:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},12536:t=>{t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},54205:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){if(void 0===e&&(e=new s),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var n=0;n{t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},82712:t=>{t.exports=function(t){return t.x*t.x+t.y*t.y}},20052:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xr&&(r=h.y),h.y{var s=i(79967);t.exports=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=new s),n.x=t.x+(e.x-t.x)*i,n.y=t.y+(e.y-t.y)*i,n}},42397:t=>{t.exports=function(t){return t.setTo(t.y,t.x)}},59464:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.setTo(-t.x,-t.y)}},79967:(t,e,i)=>{var s=i(56694),n=i(52394),r=new s({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=n.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},53581:(t,e,i)=>{var s=i(79967),n=i(82712);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=(t.x*e.x+t.y*e.y)/n(e);return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},50817:(t,e,i)=>{var s=i(79967);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=t.x*e.x+t.y*e.y;return 0!==n&&(i.x=n*e.x,i.y=n*e.y),i}},40525:(t,e,i)=>{var s=i(50083);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=s(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},63472:(t,e,i)=>{var s=i(79967);s.Ceil=i(77601),s.Clone=i(38933),s.CopyFrom=i(47103),s.Equals=i(13625),s.Floor=i(12536),s.GetCentroid=i(54205),s.GetMagnitude=i(50083),s.GetMagnitudeSq=i(82712),s.GetRectangleFromPoints=i(20052),s.Interpolate=i(77154),s.Invert=i(42397),s.Negative=i(59464),s.Project=i(53581),s.ProjectUnit=i(50817),s.SetMagnitude=i(40525),t.exports=s},19631:(t,e,i)=>{var s=i(8580);t.exports=function(t){return new s(t.points)}},45604:t=>{t.exports=function(t,e,i){for(var s=!1,n=-1,r=t.points.length-1;++n{var s=i(45604);t.exports=function(t,e){return s(t,e.x,e.y)}},11117:t=>{"use strict";function e(t,e,s){s=s||2;var r,o,a,h,c,d,p,g=e&&e.length,v=g?e[0]*s:t.length,m=i(t,0,v,s,!0),y=[];if(!m||m.next===m.prev)return y;if(g&&(m=function(t,e,s,n){var r,o,a,h=[];for(r=0,o=e.length;r80*s){r=a=t[0],o=h=t[1];for(var x=s;xa&&(a=c),d>h&&(h=d);p=0!==(p=Math.max(a-r,h-o))?32767/p:0}return n(m,y,s,r,o,p,0),y}function i(t,e,i,s,n){var r,o;if(n===_(t,e,i,s)>0)for(r=e;r=e;r-=s)o=E(r,t[r],t[r+1],o);return o&&m(o,o.next)&&(S(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==v(s.prev,s,s.next))s=s.next;else{if(S(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function n(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var n=t;do{0===n.z&&(n.z=d(n.x,n.y,e,i,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,i,s,n,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,s=i,a=0,e=0;e0||h>0&&s;)0!==a&&(0===h||!s||i.z<=s.z)?(n=i,i=i.nextZ,a--):(n=s,s=s.nextZ,h--),r?r.nextZ=n:t=n,n.prevZ=r,r=n;i=s}r.nextZ=null,l*=2}while(o>1)}(n)}(t,l,u,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?o(t,l,u,c):r(t))e.push(p.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),S(t),t=g.next,v=g.next;else if((t=g)===v){f?1===f?n(t=a(s(t),e,i),e,i,l,u,c,2):2===f&&h(t,e,i,l,u,c):n(s(t),e,i,l,u,c,1);break}}}function r(t){var e=t.prev,i=t,s=t.next;if(v(e,i,s)>=0)return!1;for(var n=e.x,r=i.x,o=s.x,a=e.y,h=i.y,l=s.y,u=nr?n>o?n:o:r>o?r:o,f=a>h?a>l?a:l:h>l?h:l,g=s.next;g!==e;){if(g.x>=u&&g.x<=d&&g.y>=c&&g.y<=f&&p(n,a,r,h,o,l,g.x,g.y)&&v(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function o(t,e,i,s){var n=t.prev,r=t,o=t.next;if(v(n,r,o)>=0)return!1;for(var a=n.x,h=r.x,l=o.x,u=n.y,c=r.y,f=o.y,g=ah?a>l?a:l:h>l?h:l,x=u>c?u>f?u:f:c>f?c:f,T=d(g,m,e,i,s),w=d(y,x,e,i,s),b=t.prevZ,E=t.nextZ;b&&b.z>=T&&E&&E.z<=w;){if(b.x>=g&&b.x<=y&&b.y>=m&&b.y<=x&&b!==n&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&v(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=x&&E!==n&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&v(E.prev,E,E.next)>=0)return!1;E=E.nextZ}for(;b&&b.z>=T;){if(b.x>=g&&b.x<=y&&b.y>=m&&b.y<=x&&b!==n&&b!==o&&p(a,u,h,c,l,f,b.x,b.y)&&v(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=w;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=x&&E!==n&&E!==o&&p(a,u,h,c,l,f,E.x,E.y)&&v(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function a(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!m(r,o)&&y(r,n,n.next,o)&&w(r,o)&&w(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),S(n),S(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function h(t,e,i,r,o,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&g(h,l)){var u=b(h,l);return h=s(h,h.next),u=s(u,u.next),n(h,e,i,r,o,a,0),void n(u,e,i,r,o,a,0)}l=l.next}h=h.next}while(h!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,n=t.x,r=t.y,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=n&&a>o&&(o=a,i=s.x=s.x&&s.x>=u&&n!==s.x&&p(ri.x||s.x===i.x&&c(i,s)))&&(i=s,f=h)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var n=b(i,t);return s(n,n.next),s(i,i.next)}function c(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function d(t,e,i,s,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(r-a)&&(t-o)*(s-a)>=(i-o)*(e-a)&&(i-o)*(r-a)>=(n-o)*(s-a)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,s=!1,n=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&n<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||m(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,s){var n=T(v(t,e,i)),r=T(v(t,e,s)),o=T(v(i,s,t)),a=T(v(i,s,e));return n!==r&&o!==a||!(0!==n||!x(t,i,e))||!(0!==r||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==a||!x(i,e,s))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function w(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function b(t,e){var i=new A(t.i,t.x,t.y),s=new A(e.i,e.x,e.y),n=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function E(t,e,i,s){var n=new A(t,e,i);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,s){for(var n=0,r=e,o=i-s;r0&&(s+=t[n-1].length,i.holes.push(s))}return i},t.exports=e},14045:(t,e,i)=>{var s=i(74118);t.exports=function(t,e){void 0===e&&(e=new s);for(var i,n=1/0,r=1/0,o=-n,a=-r,h=0;h{t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i{var s=i(16028),n=i(88829),r=i(5159);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=r(t);!e&&i>0&&(e=h/i);for(var l=0;lc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},5159:(t,e,i)=>{var s=i(16028),n=i(88829);t.exports=function(t){for(var e=t.points,i=0,r=0;r{var s=i(56694),n=i(45604),r=i(89294),o=i(52394),a=new s({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return n(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=0;i{t.exports=function(t){return t.points.reverse(),t}},95874:t=>{function e(t,e,i){var s=e.x,n=e.y,r=i.x-s,o=i.y-n;if(0!==r||0!==o){var a=((t.x-s)*r+(t.y-n)*o)/(r*r+o*o);a>1?(s=i.x,n=i.y):a>0&&(s+=r*a,n+=o*a)}return(r=t.x-s)*r+(o=t.y-n)*o}function i(t,s,n,r,o){for(var a,h=r,l=s+1;lh&&(a=l,h=u)}h>r&&(a-s>1&&i(t,s,a,r,o),o.push(t[a]),n-a>1&&i(t,a,n,r,o))}function s(t,e){var s=t.length-1,n=[t[0]];return i(t,0,s,e,n),n.push(t[s]),n}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var n=t.points;if(n.length>2){var r=e*e;i||(n=function(t,e){for(var i,s,n,r,o,a=t[0],h=[a],l=1,u=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(n,r)),t.setTo(s(n,r))}return t}},18974:t=>{var e=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var i,s=[],n=t.points;for(i=0;i0&&r.push(e([0,0],s[0])),i=0;i1&&r.push(e([0,0],s[s.length-1])),t.setTo(r)}},23490:t=>{t.exports=function(t,e,i){for(var s=t.points,n=0;n{var s=i(8580);s.Clone=i(19631),s.Contains=i(45604),s.ContainsPoint=i(87289),s.Earcut=i(11117),s.GetAABB=i(14045),s.GetNumberArray=i(98286),s.GetPoints=i(89294),s.Perimeter=i(5159),s.Reverse=i(32244),s.Simplify=i(95874),s.Smooth=i(18974),s.Translate=i(23490),t.exports=s},1653:t=>{t.exports=function(t){return t.width*t.height}},33943:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},58662:t=>{t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},79993:t=>{t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},81572:(t,e,i)=>{var s=i(74118);t.exports=function(t){return new s(t.x,t.y,t.width,t.height)}},94287:t=>{t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},28687:(t,e,i)=>{var s=i(94287);t.exports=function(t,e){return s(t,e.x,e.y)}},73222:t=>{t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom{t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},87279:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},19989:t=>{t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},92628:(t,e,i)=>{var s=i(6700);t.exports=function(t,e){var i=s(t);return i{var s=i(6700);t.exports=function(t,e){var i=s(t);return i>s(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},71356:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},21687:t=>{t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},80222:(t,e,i)=>{var s=i(74118),n=i(83392);t.exports=function(t,e){if(void 0===e&&(e=new s),0===t.length)return e;for(var i,r,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=n.MIN_SAFE_INTEGER,u=n.MIN_SAFE_INTEGER,c=0;c{var s=i(74118);t.exports=function(t,e,i,n,r){return void 0===r&&(r=new s),r.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},6700:t=>{t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},35242:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.centerX,e.y=t.centerY,e}},47698:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new n),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var r=s(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},54932:(t,e,i)=>{var s=i(47698),n=i(85876);t.exports=function(t,e,i,r){void 0===r&&(r=[]),!e&&i>0&&(e=n(t)/i);for(var o=0;o{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.width,e.y=t.height,e}},7782:(t,e,i)=>{var s=i(79993);t.exports=function(t,e,i){var n=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),s(t,n,r)}},66217:(t,e,i)=>{var s=i(74118),n=i(90205);t.exports=function(t,e,i){return void 0===i&&(i=new s),n(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},40053:(t,e,i)=>{var s=i(85876),n=i(79967);t.exports=function(t,e,i,r){if(void 0===r&&(r=[]),!e&&!i)return r;e?i=Math.round(s(t)/e):e=s(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},86673:t=>{t.exports=function(t,e){for(var i=t.x,s=t.right,n=t.y,r=t.bottom,o=0;o{t.exports=function(t,e){var i=Math.min(t.x,e.x),s=Math.max(t.right,e.right);t.x=i,t.width=s-i;var n=Math.min(t.y,e.y),r=Math.max(t.bottom,e.bottom);return t.y=n,t.height=r-n,t}},44755:t=>{t.exports=function(t,e,i){var s=Math.min(t.x,e),n=Math.max(t.right,e);t.x=s,t.width=n-s;var r=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=r,t.height=o-r,t}},74466:t=>{t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},55946:t=>{t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},97474:t=>{t.exports=function(t,e){return t.xe.x&&t.ye.y}},85876:t=>{t.exports=function(t){return 2*(t.width+t.height)}},20243:(t,e,i)=>{var s=i(79967),n=i(75606);t.exports=function(t,e,i){void 0===i&&(i=new s),e=n(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r){var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},97691:(t,e,i)=>{var s=i(17489),n=i(73222),r=i(79967);t.exports=function(t,e,i){if(void 0===i&&(i=new r),n(t,e))switch(s(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},74118:(t,e,i)=>{var s=i(56694),n=i(94287),r=i(47698),o=i(54932),a=i(52394),h=i(88829),l=i(30001),u=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=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=s},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s){return this.x=t,this.y=e,this.width=i,this.height=s,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},51828:t=>{t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},5691:t=>{t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},58795:(t,e,i)=>{var s=i(74118);t.exports=function(t,e,i){void 0===i&&(i=new s);var n=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-n,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(n,r,o,a)}},66658:(t,e,i)=>{var s=i(74118);s.Area=i(1653),s.Ceil=i(33943),s.CeilAll=i(58662),s.CenterOn=i(79993),s.Clone=i(81572),s.Contains=i(94287),s.ContainsPoint=i(28687),s.ContainsRect=i(73222),s.CopyFrom=i(29538),s.Decompose=i(87279),s.Equals=i(19989),s.FitInside=i(92628),s.FitOutside=i(85028),s.Floor=i(71356),s.FloorAll=i(21687),s.FromPoints=i(80222),s.FromXY=i(75785),s.GetAspectRatio=i(6700),s.GetCenter=i(35242),s.GetPoint=i(47698),s.GetPoints=i(54932),s.GetSize=i(31591),s.Inflate=i(7782),s.Intersection=i(66217),s.MarchingAnts=i(40053),s.MergePoints=i(86673),s.MergeRect=i(14655),s.MergeXY=i(44755),s.Offset=i(74466),s.OffsetPoint=i(55946),s.Overlaps=i(97474),s.Perimeter=i(85876),s.PerimeterPoint=i(20243),s.Random=i(30001),s.RandomOutside=i(97691),s.SameDimensions=i(51828),s.Scale=i(5691),s.Union=i(58795),t.exports=s},19108:t=>{t.exports=function(t){var e=t.x1,i=t.y1,s=t.x2,n=t.y2,r=t.x3,o=t.y3;return Math.abs(((r-e)*(n-i)-(s-e)*(o-i))/2)}},41199:(t,e,i)=>{var s=i(66349);t.exports=function(t,e,i){var n=i*(Math.sqrt(3)/2);return new s(t,e,t+i/2,e+n,t-i/2,e+n)}},88730:(t,e,i)=>{var s=i(11117),n=i(66349);t.exports=function(t,e,i,r,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===r&&(r=1),void 0===o&&(o=[]);for(var a,h,l,u,c,d,f,p,g,v=s(t,e),m=0;m{var s=i(66349);t.exports=function(t,e,i,n){return void 0===n&&(n=i),new s(t,e,t,e-n,t+i,e)}},1882:(t,e,i)=>{var s=i(56595),n=i(9640);t.exports=function(t,e,i,r){void 0===r&&(r=s);var o=r(t),a=e-o.x,h=i-o.y;return n(t,a,h)}},56595:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){return void 0===e&&(e=new s),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},91835:(t,e,i)=>{var s=i(93736);function n(t,e,i,s){return t*s-e*i}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x3,r=t.y3,o=t.x1-i,a=t.y1-r,h=t.x2-i,l=t.y2-r,u=2*n(o,a,h,l),c=n(a,o*o+a*a,l,h*h+l*l),d=n(o,o*o+a*a,h,h*h+l*l);return e.x=i-c/u,e.y=r+d/u,e}},97073:(t,e,i)=>{var s=i(26673);t.exports=function(t,e){void 0===e&&(e=new s);var i,n,r=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,u=t.y3,c=a-r,d=h-o,f=l-r,p=u-o,g=c*(r+a)+d*(o+h),v=f*(r+l)+p*(o+u),m=2*(c*(u-h)-d*(l-a));if(Math.abs(m)<1e-6){var y=Math.min(r,a,l),x=Math.min(o,h,u);i=.5*(Math.max(r,a,l)-y),n=.5*(Math.max(o,h,u)-x),e.x=y+i,e.y=x+n,e.radius=Math.sqrt(i*i+n*n)}else e.x=(p*g-d*v)/m,e.y=(c*v-f*g)/m,i=e.x-r,n=e.y-o,e.radius=Math.sqrt(i*i+n*n);return e}},75974:(t,e,i)=>{var s=i(66349);t.exports=function(t){return new s(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},60689:t=>{t.exports=function(t,e,i){var s=t.x3-t.x1,n=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=s*s+n*n,u=s*r+n*o,c=s*a+n*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},86875:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=!1),void 0===s&&(s=[]);for(var n,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&n+r<1&&(s.push({x:e[w].x,y:e[w].y}),i)));w++);return s}},51532:(t,e,i)=>{var s=i(60689);t.exports=function(t,e){return s(t,e.x,e.y)}},42538:t=>{t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},18680:t=>{t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},29977:t=>{t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},56088:(t,e,i)=>{var s=i(79967),n=i(16028);t.exports=function(t,e,i){void 0===i&&(i=new s);var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=r.x1,i.y=r.y1,i;var h=n(r),l=n(o),u=n(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},24402:(t,e,i)=>{var s=i(16028),n=i(79967);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=s(o),u=s(a),c=s(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},83648:(t,e,i)=>{var s=i(79967);function n(t,e,i,s){var n=t-i,r=e-s,o=n*n+r*r;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x1,r=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,u=n(h,l,o,a),c=n(i,r,h,l),d=n(o,a,i,r),f=u+c+d;return e.x=(i*u+o*c+h*d)/f,e.y=(r*u+a*c+l*d)/f,e}},9640:t=>{t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},95290:(t,e,i)=>{var s=i(16028);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),n=t.getLineC();return s(e)+s(i)+s(n)}},99761:(t,e,i)=>{var s=i(79967);t.exports=function(t,e){void 0===e&&(e=new s);var i=t.x2-t.x1,n=t.y2-t.y1,r=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(n*a+o*h),e}},21934:(t,e,i)=>{var s=i(19211),n=i(83648);t.exports=function(t,e){var i=n(t);return s(t,i.x,i.y,e)}},68454:(t,e,i)=>{var s=i(19211);t.exports=function(t,e,i){return s(t,e.x,e.y,i)}},19211:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x1-e,a=t.y1-i;return t.x1=o*n-a*r+e,t.y1=o*r+a*n+i,o=t.x2-e,a=t.y2-i,t.x2=o*n-a*r+e,t.y2=o*r+a*n+i,o=t.x3-e,a=t.y3-i,t.x3=o*n-a*r+e,t.y3=o*r+a*n+i,t}},66349:(t,e,i)=>{var s=i(56694),n=i(60689),r=i(56088),o=i(24402),a=i(52394),h=i(88829),l=i(99761),u=new s({initialize:function(t,e,i,s,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r},contains:function(t,e){return n(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,s,n,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x1=t,this.y1=e,this.x2=i,this.y2=s,this.x3=n,this.y3=r,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},87619:(t,e,i)=>{var s=i(66349);s.Area=i(19108),s.BuildEquilateral=i(41199),s.BuildFromPolygon=i(88730),s.BuildRight=i(3635),s.CenterOn=i(1882),s.Centroid=i(56595),s.CircumCenter=i(91835),s.CircumCircle=i(97073),s.Clone=i(75974),s.Contains=i(60689),s.ContainsArray=i(86875),s.ContainsPoint=i(51532),s.CopyFrom=i(42538),s.Decompose=i(18680),s.Equals=i(29977),s.GetPoint=i(56088),s.GetPoints=i(24402),s.InCenter=i(83648),s.Perimeter=i(95290),s.Offset=i(9640),s.Random=i(99761),s.Rotate=i(21934),s.RotateAroundPoint=i(68454),s.RotateAroundXY=i(19211),t.exports=s},27395:t=>{t.exports=function(t,e,i){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},18104:t=>{t.exports=function(t,e){return function(i,s,n,r){var o=t.getPixelAlpha(s,n,r.texture.key,r.frame.name);return o&&o>=e}}},69898:(t,e,i)=>{var s=i(56694),n=i(72687),r=i(6659),o=i(33963),a=i(97081),h=i(71064),l=i(7905),u=i(40398),c=i(37579),d=i(69360),f=i(64462),p=new s({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var s=new u(this,i);s.smoothFactor=e.inputSmoothFactor,this.pointers.push(s)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game,e=t.events;this.canvas=t.canvas,this.scaleManager=t.scale,this.events.emit(o.MANAGER_BOOT),e.on(a.PRE_RENDER,this.preRender,this),e.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var s=0;s10&&(t=10-this.pointersTotal);for(var i=0;i{var s=i(26673),n=i(65650),r=i(56694),o=i(72687),a=i(27395),h=i(18104),l=i(53996),u=i(95669),c=i(72313),d=i(33963),f=i(6659),p=i(72632),g=i(52394),v=i(63399),m=i(42911),y=i(91963),x=i(74118),T=i(94287),w=i(7599),b=i(66349),E=i(60689),S=new r({Extends:f,initialize:function(t){f.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,v.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,s=e.length;if(0!==i||0!==s){for(var n=this._list,r=0;r-1&&(n.splice(a,1),this.clear(o,!0))}this._pendingRemoval.length=0,this._list=n.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,s=this.manager,n=s.pointers,r=s.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,s=!1,n=0;n0&&(s=!0)}return this._updatedThisFrame=!0,s},clear:function(t,e){void 0===e&&(e=!1),this.disable(t);var i=t.input;i&&(this.removeDebug(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null),e||this.queueForRemoval(t);var s=this._draggable.indexOf(t);return s>-1&&this._draggable.splice(s,1),t},disable:function(t){var e=t.input;e&&(e.enabled=!1,e.dragState=0);var i=this._temp,s=this._drag,n=this._over,r=this.manager,o=i.indexOf(t);o>-1&&i.splice(o,1);for(var a=0;a-1&&s[a].splice(o,1),(o=n[a].indexOf(t))>-1&&(n[a].splice(o,1),r.resetCursor(e));return this},enable:function(t,e,i,s){return void 0===s&&(s=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&s&&!t.input.dropZone&&(t.input.dropZone=s),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=s,n}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,s=this._eventData,n=this._eventContainer;s.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=n||s>0&&e>=t.downTime+s)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],s=0;s0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);p*=1/o.parentContainer.scaleX,g*=1/o.parentContainer.scaleY,n=p+a.dragStartX,r=g+a.dragStartY}else n=t.worldX-a.dragX,r=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,n,r),this.emit(d.DRAG,t,o,n,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var n=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(n,t),e=0;e0){for(this.sortGameObjects(r,t),e=0;e-1&&this._draggable.splice(n,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var s=!1,n=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),s=p(u,"draggable",!1),n=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d{var s=i(10850),n={},r={register:function(t,e,i,s,r){n[t]={plugin:e,mapping:i,settingsKey:s,configKey:r}},getPlugin:function(t){return n[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in n){var a=n[o].plugin,h=n[o].mapping,l=n[o].settingsKey,u=n[o].configKey;s(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},40398:(t,e,i)=>{var s=i(90447),n=i(56694),r=i(53996),o=i(88456),a=i(44521),h=i(93736),l=i(36580),u=new n({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,n=this.midPoint.y;if(t!==i||e!==n){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,n,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=s(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,s=this.prevPosition.y,n=this.position.x,r=this.position.y,o=0;o{t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},14874:t=>{t.exports="boot"},54168:t=>{t.exports="destroy"},526:t=>{t.exports="dragend"},81623:t=>{t.exports="dragenter"},94472:t=>{t.exports="drag"},9304:t=>{t.exports="dragleave"},34265:t=>{t.exports="dragover"},50151:t=>{t.exports="dragstart"},98134:t=>{t.exports="drop"},56773:t=>{t.exports="gameobjectdown"},45824:t=>{t.exports="dragend"},39578:t=>{t.exports="dragenter"},72072:t=>{t.exports="drag"},82569:t=>{t.exports="dragleave"},70833:t=>{t.exports="dragover"},81442:t=>{t.exports="dragstart"},32936:t=>{t.exports="drop"},99658:t=>{t.exports="gameobjectmove"},60515:t=>{t.exports="gameobjectout"},55254:t=>{t.exports="gameobjectover"},34782:t=>{t.exports="pointerdown"},41769:t=>{t.exports="pointermove"},65588:t=>{t.exports="pointerout"},61640:t=>{t.exports="pointerover"},49342:t=>{t.exports="pointerup"},82662:t=>{t.exports="wheel"},13058:t=>{t.exports="gameobjectup"},52426:t=>{t.exports="gameobjectwheel"},78072:t=>{t.exports="gameout"},1545:t=>{t.exports="gameover"},67137:t=>{t.exports="boot"},27678:t=>{t.exports="process"},22257:t=>{t.exports="update"},90379:t=>{t.exports="pointerlockchange"},88909:t=>{t.exports="pointerdown"},36548:t=>{t.exports="pointerdownoutside"},18483:t=>{t.exports="pointermove"},22355:t=>{t.exports="pointerout"},7997:t=>{t.exports="pointerover"},66318:t=>{t.exports="pointerup"},94812:t=>{t.exports="pointerupoutside"},37310:t=>{t.exports="wheel"},24196:t=>{t.exports="preupdate"},27053:t=>{t.exports="shutdown"},29413:t=>{t.exports="start"},25165:t=>{t.exports="update"},33963:(t,e,i)=>{t.exports={BOOT:i(14874),DESTROY:i(54168),DRAG_END:i(526),DRAG_ENTER:i(81623),DRAG:i(94472),DRAG_LEAVE:i(9304),DRAG_OVER:i(34265),DRAG_START:i(50151),DROP:i(98134),GAME_OUT:i(78072),GAME_OVER:i(1545),GAMEOBJECT_DOWN:i(56773),GAMEOBJECT_DRAG_END:i(45824),GAMEOBJECT_DRAG_ENTER:i(39578),GAMEOBJECT_DRAG:i(72072),GAMEOBJECT_DRAG_LEAVE:i(82569),GAMEOBJECT_DRAG_OVER:i(70833),GAMEOBJECT_DRAG_START:i(81442),GAMEOBJECT_DROP:i(32936),GAMEOBJECT_MOVE:i(99658),GAMEOBJECT_OUT:i(60515),GAMEOBJECT_OVER:i(55254),GAMEOBJECT_POINTER_DOWN:i(34782),GAMEOBJECT_POINTER_MOVE:i(41769),GAMEOBJECT_POINTER_OUT:i(65588),GAMEOBJECT_POINTER_OVER:i(61640),GAMEOBJECT_POINTER_UP:i(49342),GAMEOBJECT_POINTER_WHEEL:i(82662),GAMEOBJECT_UP:i(13058),GAMEOBJECT_WHEEL:i(52426),MANAGER_BOOT:i(67137),MANAGER_PROCESS:i(27678),MANAGER_UPDATE:i(22257),POINTER_DOWN:i(88909),POINTER_DOWN_OUTSIDE:i(36548),POINTER_MOVE:i(18483),POINTER_OUT:i(22355),POINTER_OVER:i(7997),POINTER_UP:i(66318),POINTER_UP_OUTSIDE:i(94812),POINTER_WHEEL:i(37310),POINTERLOCK_CHANGE:i(90379),PRE_UPDATE:i(24196),SHUTDOWN:i(27053),START:i(29413),UPDATE:i(25165)}},70848:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value){var s=i(56694),n=i(43200),r=new s({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(n.BUTTON_DOWN,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(n.BUTTON_UP,e,this,t),this.pad.emit(n.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},75956:(t,e,i)=>{var s=i(70848),n=i(21274),r=i(56694),o=i(6659),a=i(93736),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),n>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t{var s=i(56694),n=i(6659),r=i(43200),o=i(75956),a=i(10850),h=i(63399),l=i(33963),u=new s({Extends:n,initialize:function(t){n.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},74982:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},43247:t=>{t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},4898:(t,e,i)=>{t.exports={DUALSHOCK_4:i(74982),SNES_USB:i(33171),XBOX_360:i(43247)}},17344:t=>{t.exports="down"},36635:t=>{t.exports="up"},85724:t=>{t.exports="connected"},55832:t=>{t.exports="disconnected"},772:t=>{t.exports="down"},33608:t=>{t.exports="up"},43200:(t,e,i)=>{t.exports={BUTTON_DOWN:i(17344),BUTTON_UP:i(36635),CONNECTED:i(85724),DISCONNECTED:i(55832),GAMEPAD_BUTTON_DOWN:i(772),GAMEPAD_BUTTON_UP:i(33608)}},92636:(t,e,i)=>{t.exports={Axis:i(70848),Button:i(21274),Events:i(43200),Gamepad:i(75956),GamepadPlugin:i(1379),Configs:i(4898)}},20873:(t,e,i)=>{var s=i(72687),n=i(98611),r={CreatePixelPerfectHandler:i(18104),CreateInteractiveObject:i(27395),Events:i(33963),Gamepad:i(92636),InputManager:i(69898),InputPlugin:i(12499),InputPluginCache:i(63399),Keyboard:i(28388),Mouse:i(11343),Pointer:i(40398),Touch:i(77423)};r=n(!1,r,s),t.exports=r},71064:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(97081),o=i(33963),a=i(11873),h=i(72283),l=new n({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(r.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},89666:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=i(97081),a=i(10850),h=i(33963),l=i(63399),u=i(50165),c=i(11873),d=i(95625),f=i(48044),p=i(7599),g=i(84314),v=new s({Extends:n,initialize:function(t){n.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(p.PAUSE,this.resetKeys,this),this.scene.sys.events.on(p.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var s={};if("string"==typeof t){t=t.split(",");for(var n=0;n-1?s[n]=t:s[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),s[t]||(s[t]=new u(this,t),e&&this.addCapture(t),s[t].setEmitOnRepeat(i)),s[t]},removeKey:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s,n=this.keys;if(t instanceof u){var r=n.indexOf(t);r>-1&&(s=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(s=n[t],n[t]=void 0),s&&(s.plugin=null,i&&this.removeCapture(s.keyCode),e&&s.destroy()),this},removeAllKeys:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.keys,s=0;st._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,s=0;s{t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},95625:(t,e,i)=>{var s=i(56694),n=i(94030),r=i(72632),o=i(2544),a=i(88754),h=new s({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var s=0;s{var s=i(60258);t.exports=function(t,e){if(e.matched)return!0;var i=!1,n=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(n=!0,i=s(t,e))}else n=!0,i=s(t,e);return!n&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},88754:t=>{t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},5044:t=>{t.exports="keydown"},40813:t=>{t.exports="keyup"},89319:t=>{t.exports="keycombomatch"},43267:t=>{t.exports="down"},78595:t=>{t.exports="keydown-"},30056:t=>{t.exports="keyup-"},81939:t=>{t.exports="up"},94030:(t,e,i)=>{t.exports={ANY_KEY_DOWN:i(5044),ANY_KEY_UP:i(40813),COMBO_MATCH:i(89319),DOWN:i(43267),KEY_DOWN:i(78595),KEY_UP:i(30056),UP:i(81939)}},28388:(t,e,i)=>{t.exports={Events:i(94030),KeyboardManager:i(71064),KeyboardPlugin:i(89666),Key:i(50165),KeyCodes:i(11873),KeyCombo:i(95625),AdvanceKeyCombo:i(60258),ProcessKeyCombo:i(2544),ResetKeyCombo:i(88754),JustDown:i(42460),JustUp:i(53162),DownDuration:i(64964),UpDuration:i(70331)}},64964:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i{t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},53162:t=>{t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},50165:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(94030),o=new s({Extends:n,initialize:function(t,e){n.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(r.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(r.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(r.UP,this,t))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},11873:t=>{t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},48044:(t,e,i)=>{var s=i(11873),n={};for(var r in s)n[s[r]]=r;t.exports=n},70331:t=>{t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i{var s=i(56694),n=i(90185),r=i(33963),o=i(72283),a=new s({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(n.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){n.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,r=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){r&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===s&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===s&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===s&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}n.pointerLock&&(this.pointerLockChange=function(t){var s=e.target;e.locked=document.pointerLockElement===s||document.mozPointerLockElement===s||document.webkitPointerLockElement===s,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),n.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},11343:(t,e,i)=>{t.exports={MouseManager:i(7905)}},37579:(t,e,i)=>{var s=i(56694),n=i(33963),r=i(72283),o=new s({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=r,this.onTouchStartWindow=r,this.onTouchMove=r,this.onTouchEnd=r,this.onTouchEndWindow=r,this.onTouchCancel=r,this.onTouchCancelWindow=r,this.isTop=!0,t.events.once(n.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,s=i.canvas,n=window&&window.focus&&i.game.config.autoFocus;this.onTouchMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchMove(t),e.capture&&t.cancelable&&t.preventDefault())},this.onTouchStart=function(t){n&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchStart(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchStartWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchStart(t)},this.onTouchEnd=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchEnd(t),e.capture&&t.cancelable&&t.target===s&&t.preventDefault())},this.onTouchEndWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==s&&i.onTouchEnd(t)},this.onTouchCancel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onTouchCancel(t),e.capture&&t.preventDefault())},this.onTouchCancelWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onTouchCancel(t)};var r=this.capture,o={passive:!0},a={passive:!1};if(t.addEventListener("touchstart",this.onTouchStart,r?a:o),t.addEventListener("touchmove",this.onTouchMove,r?a:o),t.addEventListener("touchend",this.onTouchEnd,r?a:o),t.addEventListener("touchcancel",this.onTouchCancel,r?a:o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,a),window.top.addEventListener("touchend",this.onTouchEndWindow,a),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,a)}catch(t){window.addEventListener("touchstart",this.onTouchStartWindow,a),window.addEventListener("touchend",this.onTouchEndWindow,a),window.addEventListener("touchcancel",this.onTouchCancelWindow,a),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),window&&((t=this.isTop?window.top:window).removeEventListener("touchstart",this.onTouchStartWindow),t.removeEventListener("touchend",this.onTouchEndWindow),t.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},77423:(t,e,i)=>{t.exports={TouchManager:i(37579)}},98035:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=i(72632),a=i(30750),h=i(43531),l=i(88490),u=i(33868),c=new s({initialize:function(t,e){if(this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.key)throw new Error("Invalid File key: "+this.key);var s=o(e,"url");void 0===s?s=t.path+i+"."+o(e,"extension",""):"string"!=typeof s||s.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)||(s=t.path+s),this.url=s,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?n.FILE_POPULATED:n.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===n.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=n.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&this.loader.localSchemes.some((function(e){return 0===t.responseURL.indexOf(e)}))&&0===e.target.status,s=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(s=!1),this.state=n.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,s)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=n.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=n.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=n.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(t){if(this.state!==n.FILE_PENDING_DESTROY){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this),this.state=n.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var s=new FileReader;s.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+s.result.split(",")[1]},s.onerror=t.onerror,s.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},76846:t=>{var e={},i={install:function(t){for(var i in e)t[i]=e[i]},register:function(t,i){e[t]=i},destroy:function(){e={}}};t.exports=i},30750:t=>{t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},67285:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(58403),o=i(6659),a=i(683),h=i(76846),l=i(72632),u=i(10850),c=i(91963),d=i(7599),f=i(33868),p=new s({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=f(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.imageLoadType=l(i,"imageLoadType",e.loaderImageLoadType),this.localSchemes=l(i,"localScheme",e.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new r,this.inflight=new r,this.queue=new r,this._deleteQueue=new r,this.totalFailed=0,this.totalComplete=0,this.state=n.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(d.BOOT,this.boot,this),t.sys.events.on(d.START,this.pluginStart,this)},boot:function(){this.systems.events.once(d.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(d.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===n.LOADER_LOADING||this.state===n.LOADER_PROCESSING},isReady:function(){return this.state===n.LOADER_IDLE||this.state===n.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=n.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(d.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===n.LOADER_LOADING&&this.list.size>0&&this.inflight.size{var s=i(98611),n=i(33868);t.exports=function(t,e){var i=void 0===t?n():s({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},45176:(t,e,i)=>{var s=i(56694),n=i(12117),r=i(683),o=new s({initialize:function(t,e,i,s){var r=[];s.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i;var o=this.key;t.prefix&&""!==t.prefix&&(this.key=t.prefix+o),this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.state=n.FILE_PENDING,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var a=0;a{var s=i(43531);t.exports=function(t,e){var i=s(e,t.xhrSettings),n=new XMLHttpRequest;if(n.open("GET",t.src,i.async,i.user,i.password),n.responseType=t.xhrSettings.responseType,n.timeout=i.timeout,i.headers)for(var r in i.headers)n.setRequestHeader(r,i.headers[r]);return i.header&&i.headerValue&&n.setRequestHeader(i.header,i.headerValue),i.requestedWith&&n.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&n.overrideMimeType(i.overrideMimeType),i.withCredentials&&(n.withCredentials=!0),n.onload=t.onLoad.bind(t,n),n.onerror=t.onError.bind(t,n),n.onprogress=t.onProgress.bind(t),n.send(),n}},33868:t=>{t.exports=function(t,e,i,s,n,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===s&&(s=""),void 0===n&&(n=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:s,timeout:n,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},12117:t=>{t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20}},7398:t=>{t.exports="addfile"},52187:t=>{t.exports="complete"},36627:t=>{t.exports="filecomplete"},81925:t=>{t.exports="filecomplete-"},29774:t=>{t.exports="loaderror"},20943:t=>{t.exports="load"},74693:t=>{t.exports="fileprogress"},71176:t=>{t.exports="postprocess"},88984:t=>{t.exports="progress"},72753:t=>{t.exports="start"},683:(t,e,i)=>{t.exports={ADD:i(7398),COMPLETE:i(52187),FILE_COMPLETE:i(36627),FILE_KEY_COMPLETE:i(81925),FILE_LOAD_ERROR:i(29774),FILE_LOAD:i(20943),FILE_PROGRESS:i(74693),POST_PROCESS:i(71176),PROGRESS:i(88984),START:i(72753)}},46468:(t,e,i)=>{var s=i(56694),n=i(76846),r=i(70806),o=i(683),a=new s({Extends:r,initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),r.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});n.register("animation",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});n.register("aseprite",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new h(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","json"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new h(t,e,s,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(15297),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","xml"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),this.complete=!0}}});n.register("atlasXML",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(30929),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,n){if(l(e)){var o=e;e=a(o,"key"),s=a(o,"xhrSettings"),n=a(o,"context",n)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:s,config:{context:n}};r.call(this,t,h)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,s,n){var r=t.systems.game,o=r.config.audio,c=r.device.audio;l(e)&&(i=a(e,"url",[]),s=a(e,"config",{}));var d=u.getAudioURL(r,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,n,r.sound.context):new h(t,e,d,s):(console.warn('No audio URLs for "%s" matched this device',e),null)},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i{var s=i(67448),n=i(56694),r=i(76846),o=i(72632),a=i(42911),h=i(70806),l=i(45176),u=new n({Extends:l,initialize:function(t,e,i,n,r,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),n=o(d,"audioURL"),r=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var f;if(n){var p=s.create(t,e,n,r,u);p&&(f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p,f]),this.config.resourceLoad=!1)}else f=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f]),this.config.resourceLoad=!0,this.config.audioConfig=r,this.config.audioXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),n=o(this.config,"audioXhrSettings"),r=s.create(this.loader,t.key,e,i,n);r&&(this.addToMultiFile(r),this.loader.addFile(r))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});r.register("audioSprite",(function(t,e,i,s,n,r){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var c=0;c{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"xhrSettings"),o=a(l,"extension",o),n=a(l,"dataType",n)}var u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:s,config:{dataType:n}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(31476),u=i(15297),c=new s({Extends:h,initialize:function(t,e,i,s,n,l){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new u(t,{key:e,url:r(f,"fontDataURL"),extension:r(f,"fontDataExtension","xml"),xhrSettings:r(f,"fontDataXhrSettings")})}else c=new o(t,e,i,n),d=new u(t,e,s,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache();var i=t.cache.get(t.key),s=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:s,texture:t.key,frame:null}),this.complete=!0}}});n.register("bitmapFont",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"script",cache:!1,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(73152),n=i(40612),r=i(56694),o=i(76846),a=i(72632),h=i(42927),l=i(42911),u=i(70806),c=i(67409),d=i(30657),f=i(80802),p=i(45176),g=i(24904),v=new r({Extends:p,initialize:function(t,e,i,s){if(i.multiAtlasURL){var r=new u(t,{key:e,url:i.multiAtlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[r])}else{var o=i.textureURL.substr(i.textureURL.length-3);i.type||(i.type="ktx"===o.toLowerCase()?"KTX":"PVR");var a=new n(t,{key:e,url:i.textureURL,extension:o,xhrSettings:s,config:i});if(i.atlasURL){var h=new u(t,{key:e,url:i.atlasURL,xhrSettings:s,config:i});p.call(this,t,"texture",e,[a,h])}else p.call(this,t,"texture",e,[a])}this.config=i},onFileComplete:function(t){if(-1!==this.files.indexOf(t)){if(this.pending--,!this.config.multiAtlasURL)return;if("json"===t.type&&t.data.hasOwnProperty("textures")){var e=t.data.textures,i=this.config,s=this.loader,r=s.baseURL,o=s.path,h=s.prefix,l=a(i,"multiBaseURL",this.baseURL),u=a(i,"multiPath",this.path),c=a(i,"prefix",this.prefix),d=a(i,"textureXhrSettings");l&&s.setBaseURL(l),u&&s.setPath(u),c&&s.setPrefix(c);for(var f=0;f{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(31053),u=new s({Extends:r,initialize:function(t,e,i,s,n){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"shaderType","fragment"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="fragment");var u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:s},xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),s=this.getShaderType(e.header),n=this.getShaderUniforms(e.header),r=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===s?o.fragmentSrc=r:o.vertexSrc=r,o.uniforms||(o.uniforms=n)}else"fragment"===s?this.cache.add(i,new l(i,r,"",n)):this.cache.add(i,new l(i,"",r,n));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data))},getShaderName:function(t){for(var e=0;e{var s=i(56694),n=i(683),r=i(98035),o=i(72632),a=i(30750),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){if(h(e)){var n=e;e=o(n,"key"),s=o(n,"config",s)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:s};r.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",cache:t.cacheManager.html,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n,o){void 0===s&&(s=512),void 0===n&&(n=512);var l="html";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),s=a(u,"width",s),n=a(u,"height",n)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:s,height:n}};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var s=[i.join("\n")],o=this;try{var a=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=n.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("htmlTexture",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(30750),u=new s({Extends:r,initialize:function t(e,i,s,n,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),s=a(c,"url"),l=a(c,"normalMap"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(s)&&(l=s[1],s=s[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:s,xhrSettings:n,config:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,n,o);f.type="normalMap",this.setLink(f),e.addFile(f)}this.useImageElementLoad="HTMLImageElement"===e.imageLoadType,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var t=this.state;this.state=n.FILE_PROCESSING,t===n.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){if(this.state=n.FILE_LOADING,this.src=l(this,this.loader.baseURL),0===this.src.indexOf("data:"))console.warn("Local data URIs are not supported: "+this.key);else{this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){t.state=n.FILE_LOADED,t.loader.nextFile(t,!0)},this.data.onerror=function(){t.loader.nextFile(t,!1)},this.data.src=this.src}},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("spritesheet"===t.type?t.addToCache():"normalMap"===this.type?this.cache.addImage(this.key,t.data,this.data):this.cache.addImage(this.key,this.data,t.data)):this.cache.addImage(this.key,this.data)}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(10850),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:s,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=n.FILE_POPULATED)},onProcess:function(){if(this.state!==n.FILE_POPULATED){this.state=n.FILE_PROCESSING;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(70806),l=i(45176),u=new s({Extends:l,initialize:function(t,e,i,s,n,o,u){if(a(e)){var c=e;e=r(c,"key"),i=r(c,"url",!1)?r(c,"url"):r(c,"atlasURL"),o=r(c,"xhrSettings"),s=r(c,"path"),n=r(c,"baseURL"),u=r(c,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=s,this.config.baseURL=n,this.config.textureXhrSettings=u},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,s=this.loader,n=s.baseURL,a=s.path,h=s.prefix,l=r(i,"baseURL",this.baseURL),u=r(i,"path",this.path),c=r(i,"prefix",this.prefix),d=r(i,"textureXhrSettings");s.setBaseURL(l),s.setPath(u),s.setPrefix(c);for(var f=0;f{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(55188),l=new s({Extends:a,initialize:function(t,e,i,s){var n="js",l=[];if(o(e)){var u=e;e=r(u,"key"),i=r(u,"url"),s=r(u,"xhrSettings"),n=r(u,"extension",n)}Array.isArray(i)||(i=[i]);for(var c=0;c{var s=i(56694),n=i(76846),r=i(72632),o=i(42911),a=i(45176),h=i(27291),l=i(76799),u=i(86897),c=new s({Extends:a,initialize:function(t,e,i,s,n,h){var l,c,d=t.cacheManager.obj;if(o(e)){var f=e;e=r(f,"key"),l=new u(t,{key:e,type:"obj",cache:d,url:r(f,"url"),extension:r(f,"extension","obj"),xhrSettings:r(f,"xhrSettings"),config:{flipUV:r(f,"flipUV",n)}}),(s=r(f,"matURL"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:s,extension:r(f,"matExtension","mat"),xhrSettings:r(f,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:n}}),s&&(c=new u(t,{key:e,url:s,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});n.register("obj",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(76846),o=i(70806),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,s,n),this.type="packfile"},onProcess:function(){if(this.state!==n.FILE_POPULATED&&(this.state=n.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var t={};t[this.config]=this.data,this.data=t}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});r.register("pack",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:s,mapping:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),s=a(e,"mapping",null);if(this.state===n.FILE_POPULATED)t.install(this.key,this.data,i,s);else{this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var r=t.install(this.key,window[this.key],i,s);(i||s)&&(this.loader.systems[s]=r,this.loader.scene[s]=r)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"svgConfig",{}),n=a(l,"xhrSettings"),o=a(l,"extension",o)}var u={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:{width:a(s,"width"),height:a(s,"height"),scale:a(s,"scale")}};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,s=this.config.height,o=this.config.scale;t:if(i&&s||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,s=u*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",s.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var f=this,p=!1;this.data.onload=function(){p||r.revokeObjectURL(f.data),f.onProcessComplete()},this.data.onerror=function(){p?f.onProcessError():(p=!0,r.revokeObjectURL(f.data),f.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},r.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("svg",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"text",extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,o,l){var u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),s=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:s,sceneKey:o}};r.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=n.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,s=a(e,"systemKey",i),r=a(e,"sceneKey",i);this.state===n.FILE_POPULATED?t.installScenePlugin(s,this.data,r,this.loader.scene,!0):(this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(s,window[this.key],r,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,s,n){if(Array.isArray(t))for(var r=0;r{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s,n){var o="js";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),s=a(l,"type","script"),n=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===s&&(s="script");var u={type:s,cache:!1,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,u)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(76846),o=i(42927),a=new s({Extends:o,initialize:function(t,e,i,s,n){o.call(this,t,e,i,n,s),this.type="spritesheet"},addToCache:function(){var t=this.linkFile;t?t.state>=n.FILE_COMPLETE&&("normalMap"===this.type?this.cache.addSpriteSheet(this.key,t.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,t.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});r.register("spritesheet",(function(t,e,i,s){if(Array.isArray(t))for(var n=0;n{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=new s({Extends:r,initialize:function(t,e,i,s){var n="text",o="txt",l=t.cacheManager.text;if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),s=a(u,"xhrSettings"),o=a(u,"extension",o),n=a(u,"type",n),l=a(u,"cache",l)}var c={type:n,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,c)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(93560),u=new s({Extends:r,initialize:function(t,e,i,s){var n="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,u),this.tilemapFormat=l.CSV},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(70806),o=i(93560),a=new s({Extends:r,initialize:function(t,e,i,s){r.call(this,t,e,i,s),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t)}});n.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(76846),r=i(72632),o=i(42927),a=i(42911),h=i(45176),l=i(86897),u=new s({Extends:h,initialize:function(t,e,i,s,n,u){var c,d;if(a(e)){var f=e;e=r(f,"key"),c=new o(t,{key:e,url:r(f,"textureURL"),extension:r(f,"textureExtension","png"),normalMap:r(f,"normalMap"),xhrSettings:r(f,"textureXhrSettings")}),d=new l(t,{key:e,url:r(f,"atlasURL"),extension:r(f,"atlasExtension","txt"),xhrSettings:r(f,"atlasXhrSettings")})}else c=new o(t,e,i,n),d=new l(t,e,s,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),this.complete=!0}}});n.register("unityAtlas",(function(t,e,i,s,n){var r;if(Array.isArray(t))for(var o=0;o{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(30750),h=i(72632),l=i(42911),u=new s({Extends:r,initialize:function(t,e,i,s){if(void 0===s&&(s=!1),l(e)){var n=e;e=h(n,"key"),i=h(n,"url",[]),s=h(n,"noAudio",!1)}var o=t.systems.game.device.video.getVideoURL(i);o||console.warn("VideoFile: No supported format for "+e);var a={type:"video",cache:t.cacheManager.video,extension:o.type,key:e,url:o.url,config:{noAudio:s}};r.call(this,t,a)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=a(this,this.loader.baseURL),this.state=n.FILE_LOADED,this.loader.nextFile(this,!0)}});o.register("video",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{var s=i(56694),n=i(12117),r=i(98035),o=i(76846),a=i(72632),h=i(42911),l=i(89200),u=new s({Extends:r,initialize:function(t,e,i,s){var n="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),s=a(o,"xhrSettings"),n=a(o,"extension",n)}var l={type:"xml",cache:t.cacheManager.xml,extension:n,responseType:"text",key:e,url:i,xhrSettings:s};r.call(this,t,l)},onProcess:function(){this.state=n.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var s=0;s{t.exports={AnimationJSONFile:i(46468),AsepriteFile:i(31648),AtlasJSONFile:i(73152),AtlasXMLFile:i(24616),AudioFile:i(67448),AudioSpriteFile:i(66109),BinaryFile:i(40612),BitmapFontFile:i(54565),CompressedTextureFile:i(47375),CSSFile:i(99898),GLSLFile:i(46568),HTML5AudioFile:i(30929),HTMLFile:i(77459),HTMLTextureFile:i(9755),ImageFile:i(42927),JSONFile:i(70806),MultiAtlasFile:i(80802),MultiScriptFile:i(39034),OBJFile:i(85527),PackFile:i(3616),PluginFile:i(12217),SceneFile:i(95171),ScenePluginFile:i(82458),ScriptFile:i(55188),SpriteSheetFile:i(33536),SVGFile:i(4474),TextFile:i(86897),TilemapCSVFile:i(58673),TilemapImpactFile:i(98896),TilemapJSONFile:i(50563),UnityAtlasFile:i(82857),VideoFile:i(22833),XMLFile:i(15297)}},95695:(t,e,i)=>{var s=i(12117),n=i(98611),r={Events:i(683),FileTypes:i(34034),File:i(98035),FileTypesManager:i(76846),GetURL:i(30750),LoaderPlugin:i(67285),MergeXHRSettings:i(43531),MultiFile:i(45176),XHRLoader:i(88490),XHRSettings:i(33868)};r=n(!1,r,s),t.exports=r},26042:t=>{t.exports=function(t){for(var e=0,i=0;i{var s=i(8034);t.exports=function(t,e){return s(t)/s(e)/s(t-e)}},17489:t=>{t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},14976:t=>{t.exports=function(t,e,i,s,n){var r=.5*(s-e),o=.5*(n-i),a=t*t;return(2*i-2*s+r+o)*(t*a)+(-3*i+3*s-2*r-o)*a+r*t+i}},89129:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.ceil(t*s)/s}},82897:t=>{t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},75606:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.DEG_TO_RAD}},767:t=>{t.exports=function(t,e){return Math.abs(t-e)}},9849:(t,e,i)=>{var s=i(82897),n=i(56694),r=i(16650),o=i(72283),a=new r,h=new n({initialize:function t(e,i,s,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=t.DefaultOrder),this._x=e,this._y=i,this._z=s,this._order=n,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,s){return void 0===s&&(s=this._order),this._x=t,this._y=e,this._z=i,this._order=s,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var n=t.val,r=n[0],o=n[4],a=n[8],h=n[1],l=n[5],u=n[9],c=n[2],d=n[6],f=n[10],p=0,g=0,v=0,m=.99999;switch(e){case"XYZ":g=Math.asin(s(a,-1,1)),Math.abs(a){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},61616:t=>{t.exports=function(t,e){return Math.random()*(e-t)+t}},60679:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.floor(t*s)/s}},91806:(t,e,i)=>{var s=i(82897);t.exports=function(t,e,i){return(i-e)*(t=s(t,0,1))+e}},79366:t=>{t.exports=function(t,e){return t/e/1e3}},43776:t=>{t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},58442:t=>{t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},42798:t=>{t.exports=function(t,e,i){return(e-t)*i+t}},61072:t=>{t.exports=function(t,e,i){return void 0===i&&(i=0),t.clone().lerp(e,i)}},5341:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=s,this},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*n+o*a,d=h*n-r*a,f=e*u+i*c+s*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+s*h)*f,t[2]=(o*i-s*r)*f,t[3]=c*f,t[4]=(l*e-s*a)*f,t[5]=(-o*e+s*n)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*n)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=s*h-i*l,t[2]=i*o-s*r,t[3]=o*a-n*l,t[4]=e*l-s*a,t[5]=s*n-e*o,t[6]=n*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*n,this},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*n+o*a)+s*(h*n-r*a)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*s+f*o+p*l,e[2]=d*n+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*s+v*o+m*l,e[5]=g*n+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*s+x*o+T*l,e[8]=y*n+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,s=t.y;return e[6]=i*e[0]+s*e[3]+e[6],e[7]=i*e[1]+s*e[4]+e[7],e[8]=i*e[2]+s*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*s+h*o,e[2]=l*n+h*a,e[3]=l*r-h*i,e[4]=l*o-h*s,e[5]=l*a-h*n,this},scale:function(t){var e=this.val,i=t.x,s=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=s*e[3],e[4]=s*e[4],e[5]=s*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,s=t.z,n=t.w,r=e+e,o=i+i,a=s+s,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=s*a,p=n*r,g=n*o,v=n*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,s=e[0],n=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=s*h-n*a,T=s*l-r*a,w=s*u-o*a,b=n*l-r*h,E=n*u-o*h,S=r*u-o*l,A=c*v-d*g,_=c*m-f*g,C=c*y-p*g,M=d*m-f*v,R=d*y-p*v,P=f*y-p*m,O=x*P-T*R+w*M+b*C-E*_+S*A;return O?(O=1/O,i[0]=(h*P-l*R+u*M)*O,i[1]=(l*C-a*P-u*_)*O,i[2]=(a*R-h*C+u*A)*O,i[3]=(r*R-n*P-o*M)*O,i[4]=(s*P-r*C+o*_)*O,i[5]=(n*C-s*R-o*A)*O,i[6]=(v*S-m*E+y*b)*O,i[7]=(m*w-g*S-y*T)*O,i[8]=(g*E-v*w+y*x)*O,this):null}});t.exports=s},16650:(t,e,i)=>{var s=i(56694),n=i(70015),r=1e-6,o=new s({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new o(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p,g){var v=this.val;return v[0]=t,v[1]=e,v[2]=i,v[3]=s,v[4]=n,v[5]=r,v[6]=o,v[7]=a,v[8]=h,v[9]=l,v[10]=u,v[11]=c,v[12]=d,v[13]=f,v[14]=p,v[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var s=a.fromQuat(i).val,n=e.x,r=e.y,o=e.z;return this.setValues(s[0]*n,s[1]*n,s[2]*n,0,s[4]*r,s[5]*r,s[6]*r,0,s[8]*o,s[9]*o,s[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var s=this.val;return s[12]=t,s[13]=e,s[14]=i,this},scaling:function(t,e,i){this.zero();var s=this.val;return s[0]=t,s[5]=e,s[10]=i,s[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],s=t[3],n=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=n,t[11]=t[14],t[12]=s,t[13]=r,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-s*r,x=e*h-n*r,T=i*a-s*o,w=i*h-n*o,b=s*h-n*a,E=l*p-u*f,S=l*g-c*f,A=l*v-d*f,_=u*g-c*p,C=u*v-d*p,M=c*v-d*g,R=m*M-y*C+x*_+T*A-w*S+b*E;return R?(R=1/R,this.setValues((o*M-a*C+h*_)*R,(s*C-i*M-n*_)*R,(p*b-g*w+v*T)*R,(c*w-u*b-d*T)*R,(a*A-r*M-h*S)*R,(e*M-s*A+n*S)*R,(g*x-f*b-v*y)*R,(l*b-c*x+d*y)*R,(r*C-o*A+h*E)*R,(i*A-e*C-n*E)*R,(f*w-p*x+v*m)*R,(u*x-l*w-d*m)*R,(o*S-r*_-a*E)*R,(e*_-i*S+s*E)*R,(p*y-f*T-g*m)*R,(l*T-u*y+c*m)*R)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return this.setValues(o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),-(i*(c*v-d*g)-u*(s*v-n*g)+p*(s*d-n*c)),i*(a*v-h*g)-o*(s*v-n*g)+p*(s*h-n*a),-(i*(a*d-h*c)-o*(s*d-n*c)+u*(s*h-n*a)),-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),e*(c*v-d*g)-l*(s*v-n*g)+f*(s*d-n*c),-(e*(a*v-h*g)-r*(s*v-n*g)+f*(s*h-n*a)),e*(a*d-h*c)-r*(s*d-n*c)+l*(s*h-n*a),r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),-(e*(u*v-d*p)-l*(i*v-n*p)+f*(i*d-n*u)),e*(o*v-h*p)-r*(i*v-n*p)+f*(i*h-n*o),-(e*(o*d-h*u)-r*(i*d-n*u)+l*(i*h-n*o)),-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),e*(u*g-c*p)-l*(i*g-s*p)+f*(i*c-s*u),-(e*(o*g-a*p)-r*(i*g-s*p)+f*(i*a-s*o)),e*(o*c-a*u)-r*(i*c-s*u)+l*(i*a-s*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-s*r)*(u*v-d*p)+(e*h-n*r)*(u*g-c*p)+(i*a-s*o)*(l*v-d*f)-(i*h-n*o)*(l*g-c*f)+(s*h-n*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],s=e[1],n=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*s+T*a+w*c+b*g,e[2]=x*n+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*s+T*a+w*c+b*g,e[6]=x*n+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*s+T*a+w*c+b*g,e[10]=x*n+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*s+T*a+w*c+b*g,e[14]=x*n+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,s=e.val,n=i[0],r=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],d=i[2],f=i[6],p=i[10],g=i[14],v=i[3],m=i[7],y=i[11],x=i[15],T=s[0],w=s[4],b=s[8],E=s[12],S=s[1],A=s[5],_=s[9],C=s[13],M=s[2],R=s[6],P=s[10],O=s[14],L=s[3],F=s[7],D=s[11],k=s[15];return this.setValues(n*T+r*S+o*M+a*L,h*T+l*S+u*M+c*L,d*T+f*S+p*M+g*L,v*T+m*S+y*M+x*L,n*w+r*A+o*R+a*F,h*w+l*A+u*R+c*F,d*w+f*A+p*R+g*F,v*w+m*A+y*R+x*F,n*b+r*_+o*P+a*D,h*b+l*_+u*P+c*D,d*b+f*_+p*P+g*D,v*b+m*_+y*P+x*D,n*E+r*C+o*O+a*k,h*E+l*C+u*O+c*k,d*E+f*C+p*O+g*k,v*E+m*C+y*O+x*k)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var s=this.val;return s[12]=s[0]*t+s[4]*e+s[8]*i+s[12],s[13]=s[1]*t+s[5]*e+s[9]*i+s[13],s[14]=s[2]*t+s[6]*e+s[10]*i+s[14],s[15]=s[3]*t+s[7]*e+s[11]*i+s[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var s=this.val;return s[0]=s[0]*t,s[1]=s[1]*t,s[2]=s[2]*t,s[3]=s[3]*t,s[4]=s[4]*e,s[5]=s[5]*e,s[6]=s[6]*e,s[7]=s[7]*e,s[8]=s[8]*i,s[9]=s[9]*i,s[10]=s[10]*i,s[11]=s[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),s=Math.sin(e),n=1-i,r=t.x,o=t.y,a=t.z,h=n*r,l=n*o;return this.setValues(h*r+i,h*o-s*a,h*a+s*o,0,h*o+s*a,l*o+i,l*a-s*r,0,h*a-s*o,l*a+s*r,n*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,s=e.x,n=e.y,o=e.z,a=Math.sqrt(s*s+n*n+o*o);if(Math.abs(a){t.exports=function(t,e,i){return Math.min(t+e,i)}},37394:t=>{t.exports=function(t){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[i]}},17259:t=>{t.exports=function(t,e,i){return Math.max(t-e,i)}},61820:t=>{t.exports=function(t,e,i,s){void 0===i&&(i=e+1);var n=(t-e)/(i-e);return n>1?void 0!==s?(n=(s-t)/(s-i))<0&&(n=0):n=1:n<0&&(n=0),n}},75003:(t,e,i)=>{var s=i(56694),n=i(5341),r=i(72283),o=i(70015),a=1e-6,h=new Int8Array([1,2,0]),l=new Float32Array([0,0,0]),u=new o(1,0,0),c=new o(0,1,0),d=new o,f=new n,p=new s({initialize:function(t,e,i,s){this.onChangeCallback=r,this.set(t,e,i,s)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,s,n){return void 0===n&&(n=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=s||0),n&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this._x=t*n,this._y=e*n,this._z=i*n,this._w=s*n),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.set(i+e*(t.x-i),s+e*(t.y-s),n+e*(t.z-n),r+e*(t.w-r))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(d.copy(u).cross(t).length().999999?this.set(0,0,0,1):(d.copy(t).cross(e),this._x=d.x,this._y=d.y,this._z=d.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var s=f.val;return s[0]=e.x,s[3]=e.y,s[6]=e.z,s[1]=i.x,s[4]=i.y,s[7]=i.z,s[2]=-t.x,s[5]=-t.y,s[8]=-t.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+n*r+i*a-s*o,i*h+n*o+s*r-e*a,s*h+n*a+e*o-i*r,n*h-e*r-i*o-s*a)},slerp:function(t,e){var i=this.x,s=this.y,n=this.z,r=this.w,o=t.x,h=t.y,l=t.z,u=t.w,c=i*o+s*h+n*l+r*u;c<0&&(c=-c,o=-o,h=-h,l=-l,u=-u);var d=1-e,f=e;if(1-c>a){var p=Math.acos(c),g=Math.sin(p);d=Math.sin((1-e)*p)/g,f=Math.sin(e*p)/g}return this.set(d*i+f*o,d*s+f*h,d*n+f*l,d*r+f*u)},invert:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s,r=n?1/n:0;return this.set(-t*r,-e*r,-i*r,s*r)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+n*r,i*o+s*r,s*o-i*r,n*o-e*r)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o-s*r,i*o+n*r,s*o+e*r,n*o-i*r)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,s=this.z,n=this.w,r=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*r,i*o-e*r,s*o+n*r,n*o-s*r)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,s=t.y/2,n=t.z/2,r=Math.cos(i),o=Math.cos(s),a=Math.cos(n),h=Math.sin(i),l=Math.sin(s),u=Math.sin(n);switch(t.order){case"XYZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+r*l*u,r*l*a-h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u+h*l*a,r*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+r*l*u,r*l*a+h*o*u,r*o*u-h*l*a,r*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-r*l*u,r*l*a-h*o*u,r*o*u+h*l*a,r*o*a+h*l*u,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,s=i[0],n=i[4],r=i[8],o=i[1],a=i[5],h=i[9],l=i[2],u=i[6],c=i[10],d=s+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(r-l)*e,(o-n)*e,.25/e)):s>a&&s>c?(e=2*Math.sqrt(1+s-a-c),this.set(.25*e,(n+o)/e,(r+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-s-c),this.set((n+o)/e,.25*e,(h+u)/e,(r-l)/e)):(e=2*Math.sqrt(1+c-s-a),this.set((r+l)/e,(h+u)/e,.25*e,(o-n)/e)),this},fromMat3:function(t){var e,i=t.val,s=i[0]+i[4]+i[8];if(s>0)e=Math.sqrt(s+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var n=0;i[4]>i[0]&&(n=1),i[8]>i[3*n+n]&&(n=2);var r=h[n],o=h[r];e=Math.sqrt(i[3*n+n]-i[3*r+r]-i[3*o+o]+1),l[n]=.5*e,e=.5/e,l[r]=(i[3*r+n]+i[3*n+r])*e,l[o]=(i[3*o+n]+i[3*n+o])*e,this._x=l[0],this._y=l[1],this._z=l[2],this._w=(i[3*o+r]-i[3*r+o])*e}return this.onChangeCallback(this),this}});t.exports=p},23701:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t*s.RAD_TO_DEG}},16906:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},52417:t=>{t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,s=2*Math.random()-1,n=Math.sqrt(1-s*s)*e;return t.x=Math.cos(i)*n,t.y=Math.sin(i)*n,t.z=s*e,t}},17915:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},52257:t=>{t.exports=function(t,e){var i=t.x,s=t.y;return t.x=i*Math.cos(e)-s*Math.sin(e),t.y=i*Math.sin(e)+s*Math.cos(e),t}},2386:t=>{t.exports=function(t,e,i,s){var n=Math.cos(s),r=Math.sin(s),o=t.x-e,a=t.y-i;return t.x=o*n-a*r+e,t.y=o*r+a*n+i,t}},72395:t=>{t.exports=function(t,e,i,s,n){var r=s+Math.atan2(t.y-i,t.x-e);return t.x=e+n*Math.cos(r),t.y=i+n*Math.sin(r),t}},41061:t=>{t.exports=function(t,e,i,s,n){return t.x=e+n*Math.cos(s),t.y=i+n*Math.sin(s),t}},93709:(t,e,i)=>{var s=i(70015),n=i(16650),r=i(75003),o=new n,a=new r,h=new s;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},67233:t=>{t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},64333:t=>{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var s=Math.pow(i,-e);return Math.round(t*s)/s}},59533:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1),void 0===s&&(s=1),s*=Math.PI/t;for(var n=[],r=[],o=0;o{t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},87736:t=>{t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},55805:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){void 0===n&&(n=new s);var r=0,o=0;return t>0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t),n.set(r,o)}},64462:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a,h){void 0===h&&(h=new s);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(n*f-i*p)*g,h.y=c*g*e+-d*g*t+(-n*c+i*d)*g,h}},93736:(t,e,i)=>{var s=i(56694),n=i(88456),r=new s({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new r(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return n(this.x,t.x,e)&&n(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this},transformMat3:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[3]*i+s[6],this.y=s[1]*e+s[4]*i+s[7],this},transformMat4:function(t){var e=this.x,i=this.y,s=t.val;return this.x=s[0]*e+s[4]*i+s[12],this.y=s[1]*e+s[5]*i+s[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)},project:function(t){var e=this.dot(t)/t.dot(t);return this.copy(t).scale(e)}});r.ZERO=new r,r.RIGHT=new r(1,0),r.LEFT=new r(-1,0),r.UP=new r(0,-1),r.DOWN=new r(0,1),r.ONE=new r(1,1),t.exports=r},70015:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new s(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,s=t.y,n=t.z,r=e.x,o=e.y,a=e.z;return this.x=s*a-n*o,this.y=n*r-i*a,this.z=i*o-s*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return Math.sqrt(e*e+i*i+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0;return e*e+i*i+s*s},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,s=t*t+e*e+i*i;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z;return this.x=i*o-s*r,this.y=s*n-e*o,this.z=e*r-i*n,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this},applyMatrix3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[3]*i+n[6]*s,this.y=n[1]*e+n[4]*i+n[7]*s,this.z=n[2]*e+n[5]*i+n[8]*s,this},applyMatrix4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=1/(n[3]*e+n[7]*i+n[11]*s+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*s+n[12])*r,this.y=(n[1]*e+n[5]*i+n[9]*s+n[13])*r,this.z=(n[2]*e+n[6]*i+n[10]*s+n[14])*r,this},transformMat3:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=e*n[0]+i*n[3]+s*n[6],this.y=e*n[1]+i*n[4]+s*n[7],this.z=e*n[2]+i*n[5]+s*n[8],this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=t.val;return this.x=n[0]*e+n[4]*i+n[8]*s+n[12],this.y=n[1]*e+n[5]*i+n[9]*s+n[13],this.z=n[2]*e+n[6]*i+n[10]*s+n[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=e*n[0]+i*n[4]+s*n[8]+n[12],o=e*n[1]+i*n[5]+s*n[9]+n[13],a=e*n[2]+i*n[6]+s*n[10]+n[14],h=e*n[3]+i*n[7]+s*n[11]+n[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},project:function(t){var e=this.x,i=this.y,s=this.z,n=t.val,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=n[6],d=n[7],f=n[8],p=n[9],g=n[10],v=n[11],m=n[12],y=n[13],x=n[14],T=1/(e*h+i*d+s*v+n[15]);return this.x=(e*r+i*l+s*f+m)*T,this.y=(e*o+i*u+s*p+y)*T,this.z=(e*a+i*c+s*g+x)*T,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,s=t.y,n=t.z,r=t.w,o=this.x-i,a=r-this.y-1-s,h=this.z;return this.x=2*o/n-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});s.ZERO=new s,s.RIGHT=new s(1,0,0),s.LEFT=new s(-1,0,0),s.UP=new s(0,-1,0),s.DOWN=new s(0,1,0),s.FORWARD=new s(0,0,1),s.BACK=new s(0,0,-1),s.ONE=new s(1,1,1),t.exports=s},51729:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0)},clone:function(){return new s(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,s){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=s||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return Math.sqrt(t*t+e*e+i*i+s*s)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,s=this.w;return t*t+e*e+i*i+s*s},normalize:function(){var t=this.x,e=this.y,i=this.z,s=this.w,n=t*t+e*e+i*i+s*s;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n,this.w=s*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,s=this.y,n=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=s+e*(t.y-s),this.z=n+e*(t.z-n),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return Math.sqrt(e*e+i*i+s*s+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,s=t.z-this.z||0,n=t.w-this.w||0;return e*e+i*i+s*s+n*n},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,s=this.z,n=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*s+r[12]*n,this.y=r[1]*e+r[5]*i+r[9]*s+r[13]*n,this.z=r[2]*e+r[6]*i+r[10]*s+r[14]*n,this.w=r[3]*e+r[7]*i+r[11]*s+r[15]*n,this},transformQuat:function(t){var e=this.x,i=this.y,s=this.z,n=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*s-o*i,l=a*i+o*e-n*s,u=a*s+n*i-r*e,c=-n*e-r*i-o*s;return this.x=h*a+c*-n+l*-o-u*-r,this.y=l*a+c*-r+u*-n-h*-o,this.z=u*a+c*-o+h*-r-l*-n,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});s.prototype.sub=s.prototype.subtract,s.prototype.mul=s.prototype.multiply,s.prototype.div=s.prototype.divide,s.prototype.dist=s.prototype.distance,s.prototype.distSq=s.prototype.distanceSq,s.prototype.len=s.prototype.length,s.prototype.lenSq=s.prototype.lengthSq,t.exports=s},9557:t=>{t.exports=function(t,e,i){return Math.abs(t-e)<=i}},1071:t=>{t.exports=function(t,e,i){var s=i-e;return e+((t-e)%s+s)%s}},90447:t=>{t.exports=function(t,e,i,s){return Math.atan2(s-e,i-t)}},94240:t=>{t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},84066:t=>{t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},9678:t=>{t.exports=function(t,e,i,s){return Math.atan2(i-t,s-e)}},76861:(t,e,i)=>{var s=i(83392);t.exports=function(t){return t>Math.PI&&(t-=s.PI2),Math.abs(((t+s.TAU)%s.PI2-s.PI2)%s.PI2)}},37570:t=>{t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},87597:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-Math.PI,Math.PI)}},74493:(t,e,i)=>{var s=i(61616);t.exports=function(){return s(-180,180)}},19049:(t,e,i)=>{var s=i(37570);t.exports=function(t){return s(t+Math.PI)}},90612:(t,e,i)=>{var s=i(83392);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=s.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e{t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},35786:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-Math.PI,Math.PI)}},62138:(t,e,i)=>{var s=i(1071);t.exports=function(t){return s(t,-180,180)}},22153:(t,e,i)=>{t.exports={Between:i(90447),BetweenPoints:i(94240),BetweenPointsY:i(84066),BetweenY:i(9678),CounterClockwise:i(76861),Normalize:i(37570),Random:i(87597),RandomDegrees:i(74493),Reverse:i(19049),RotateTo:i(90612),ShortestBetween:i(93954),Wrap:i(35786),WrapDegrees:i(62138)}},83392:t=>{var e={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=e},53996:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return Math.sqrt(n*n+r*r)}},92951:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}},12161:t=>{t.exports=function(t,e){var i=t.x-e.x,s=t.y-e.y;return i*i+s*s}},38057:t=>{t.exports=function(t,e,i,s){return Math.max(Math.abs(t-i),Math.abs(e-s))}},33297:t=>{t.exports=function(t,e,i,s,n){return void 0===n&&(n=2),Math.sqrt(Math.pow(i-t,n)+Math.pow(s-e,n))}},90366:t=>{t.exports=function(t,e,i,s){return Math.abs(t-i)+Math.abs(e-s)}},35032:t=>{t.exports=function(t,e,i,s){var n=t-i,r=e-s;return n*n+r*r}},10130:(t,e,i)=>{t.exports={Between:i(53996),BetweenPoints:i(92951),BetweenPointsSquared:i(12161),Chebyshev:i(38057),Power:i(33297),Snake:i(90366),Squared:i(35032)}},35060:(t,e,i)=>{var s=i(25265),n=i(57428),r=i(73214),o=i(71778),a=i(36468),h=i(88258),l=i(52910),u=i(67799),c=i(74083),d=i(92284),f=i(28035),p=i(8754);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.Out,Quint:d.Out,Sine:f.Out,Expo:h.Out,Circ:r.Out,Elastic:a.Out,Back:s.Out,Bounce:n.Out,Stepped:p,"Quad.easeIn":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.In,"Quint.easeIn":d.In,"Sine.easeIn":f.In,"Expo.easeIn":h.In,"Circ.easeIn":r.In,"Elastic.easeIn":a.In,"Back.easeIn":s.In,"Bounce.easeIn":n.In,"Quad.easeOut":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.Out,"Quint.easeOut":d.Out,"Sine.easeOut":f.Out,"Expo.easeOut":h.Out,"Circ.easeOut":r.Out,"Elastic.easeOut":a.Out,"Back.easeOut":s.Out,"Bounce.easeOut":n.Out,"Quad.easeInOut":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":f.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":r.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":s.InOut,"Bounce.easeInOut":n.InOut}},25860:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},45264:t=>{t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},36699:t=>{t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},25265:(t,e,i)=>{t.exports={In:i(25860),Out:i(36699),InOut:i(45264)}},62191:t=>{t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},24799:t=>{t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},60819:t=>{t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},57428:(t,e,i)=>{t.exports={In:i(62191),Out:i(60819),InOut:i(24799)}},86855:t=>{t.exports=function(t){return 1-Math.sqrt(1-t*t)}},7280:t=>{t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},18058:t=>{t.exports=function(t){return Math.sqrt(1- --t*t)}},73214:(t,e,i)=>{t.exports={In:i(86855),Out:i(18058),InOut:i(7280)}},91532:t=>{t.exports=function(t){return t*t*t}},63180:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},16518:t=>{t.exports=function(t){return--t*t*t+1}},71778:(t,e,i)=>{t.exports={In:i(91532),Out:i(16518),InOut:i(63180)}},24729:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)}},50325:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-s)*(2*Math.PI)/i)*.5+1}},84074:t=>{t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var s=i/4;return e<1?e=1:s=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-s)*(2*Math.PI)/i)+1}},36468:(t,e,i)=>{t.exports={In:i(24729),Out:i(84074),InOut:i(50325)}},95638:t=>{t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},10357:t=>{t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},14894:t=>{t.exports=function(t){return 1-Math.pow(2,-10*t)}},88258:(t,e,i)=>{t.exports={In:i(95638),Out:i(14894),InOut:i(10357)}},33063:(t,e,i)=>{t.exports={Back:i(25265),Bounce:i(57428),Circular:i(73214),Cubic:i(71778),Elastic:i(36468),Expo:i(88258),Linear:i(52910),Quadratic:i(67799),Quartic:i(74083),Quintic:i(92284),Sine:i(28035),Stepped:i(8754)}},43927:t=>{t.exports=function(t){return t}},52910:(t,e,i)=>{t.exports=i(43927)},77471:t=>{t.exports=function(t){return t*t}},83863:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},44383:t=>{t.exports=function(t){return t*(2-t)}},67799:(t,e,i)=>{t.exports={In:i(77471),Out:i(44383),InOut:i(83863)}},48311:t=>{t.exports=function(t){return t*t*t*t}},55248:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},23135:t=>{t.exports=function(t){return 1- --t*t*t*t}},74083:(t,e,i)=>{t.exports={In:i(48311),Out:i(23135),InOut:i(55248)}},7313:t=>{t.exports=function(t){return t*t*t*t*t}},98759:t=>{t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},26670:t=>{t.exports=function(t){return--t*t*t*t*t+1}},92284:(t,e,i)=>{t.exports={In:i(7313),Out:i(26670),InOut:i(98759)}},52929:t=>{t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},66333:t=>{t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},37255:t=>{t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},28035:(t,e,i)=>{t.exports={In:i(52929),Out:i(37255),InOut:i(66333)}},52770:t=>{t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},8754:(t,e,i)=>{t.exports=i(52770)},17247:t=>{t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},88456:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},41935:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},54726:t=>{t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t{t.exports={Ceil:i(17247),Equal:i(88456),Floor:i(61824),GreaterThan:i(41935),LessThan:i(54726)}},5923:(t,e,i)=>{var s=i(83392),n=i(98611),r={Angle:i(22153),Distance:i(10130),Easing:i(33063),Fuzzy:i(52778),Interpolation:i(48528),Pow2:i(73773),Snap:i(23679),RandomDataGenerator:i(81429),Average:i(26042),Bernstein:i(22824),Between:i(17489),CatmullRom:i(14976),CeilTo:i(89129),Clamp:i(82897),DegToRad:i(75606),Difference:i(767),Euler:i(9849),Factorial:i(8034),FloatBetween:i(61616),FloorTo:i(60679),FromPercent:i(91806),GetSpeed:i(79366),IsEven:i(43776),IsEvenStrict:i(58442),Linear:i(42798),LinearXY:i(61072),MaxAdd:i(69635),Median:i(37394),MinSub:i(17259),Percent:i(61820),RadToDeg:i(23701),RandomXY:i(16906),RandomXYZ:i(52417),RandomXYZW:i(17915),Rotate:i(52257),RotateAround:i(2386),RotateAroundDistance:i(72395),RotateTo:i(41061),RoundAwayFromZero:i(67233),RoundTo:i(64333),SinCosTableGenerator:i(59533),SmootherStep:i(87736),SmoothStep:i(5514),ToXY:i(55805),TransformXY:i(64462),Within:i(9557),Wrap:i(1071),Vector2:i(93736),Vector3:i(70015),Vector4:i(51729),Matrix3:i(5341),Matrix4:i(16650),Quaternion:i(75003),RotateVec3:i(93709)};r=n(!1,r,s),t.exports=r},63210:(t,e,i)=>{var s=i(22824);t.exports=function(t,e){for(var i=0,n=t.length-1,r=0;r<=n;r++)i+=Math.pow(1-e,n-r)*Math.pow(e,r)*t[r]*s(n,r);return i}},88332:(t,e,i)=>{var s=i(14976);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),s(n-r,t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i])):e<0?t[0]-(s(-n,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(s(n-i,t[i],t[i],t[i-1],t[i-1])-t[i]):s(n-r,t[r?r-1:0],t[r],t[i{t.exports=function(t,e,i,s,n){return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,s)+function(t,e){return t*t*t*e}(t,n)}},47614:(t,e,i)=>{var s=i(42798);t.exports=function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n);return e<0?s(t[0],t[1],n):e>1?s(t[i],t[i-1],i-n):s(t[r],t[r+1>i?i:r+1],n-r)}},16252:t=>{t.exports=function(t,e,i,s){return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,s)}},44521:(t,e,i)=>{var s=i(5514);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},45507:(t,e,i)=>{var s=i(87736);t.exports=function(t,e,i){return e+(i-e)*s(t,0,1)}},48528:(t,e,i)=>{t.exports={Bezier:i(63210),CatmullRom:i(88332),CubicBezier:i(34631),Linear:i(47614),QuadraticBezier:i(16252),SmoothStep:i(44521),SmootherStep:i(45507)}},3504:t=>{t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<{t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},2018:t=>{t.exports=function(t){return t>0&&0==(t&t-1)}},73773:(t,e,i)=>{t.exports={GetNext:i(3504),IsSize:i(28621),IsValue:i(2018)}},81429:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var s=0;s>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}});t.exports=s},82127:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),s?(i+t)/e:i+t)}},84314:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),s?(i+t)/e:i+t)}},88462:t=>{t.exports=function(t,e,i,s){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),s?(i+t)/e:i+t)}},23679:(t,e,i)=>{t.exports={Ceil:i(82127),Floor:i(84314),To:i(88462)}},92491:(t,e,i)=>{i(75205);var s=i(86459),n=i(98611),r={Actions:i(83979),Animations:i(13517),BlendModes:i(95723),Cache:i(45820),Cameras:i(44143),Core:i(80293),Class:i(56694),Create:i(84106),Curves:i(73962),Data:i(1999),Display:i(24816),DOM:i(3590),Events:i(95146),FX:i(96910),Game:i(15213),GameObjects:i(48013),Geom:i(84068),Input:i(20873),Loader:i(95695),Math:i(5923),Physics:i(53954),Plugins:i(45615),Renderer:i(42069),Scale:i(86754),ScaleModes:i(27394),Scene:i(87157),Scenes:i(20436),Structs:i(20010),Textures:i(87499),Tilemaps:i(52678),Time:i(97121),Tweens:i(75193),Utils:i(22178)};r.Sound=i(56751),r=n(!1,r,s),t.exports=r,i.g.Phaser=r},62832:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(1539),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},66150:(t,e,i)=>{var s=i(56694),n=i(75606),r=i(53996),o=i(35032),a=i(99523),h=i(72632),l=i(30657),u=i(2732),c=i(15147),d=i(91963),f=i(7599),p=i(93736),g=i(85233),v=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,t.sys.events.once(f.BOOT,this.boot,this),t.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new g(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new g(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(f.UPDATE,this.world.update,this.world),t.on(f.POST_UPDATE,this.world.postUpdate,this.world),t.once(f.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(f.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(f.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.world.collideObjects(t,e,i,s,n,!1)},collideTiles:function(t,e,i,s,n){return this.world.collideTiles(t,e,i,s,n)},overlapTiles:function(t,e,i,s,n){return this.world.overlapTiles(t,e,i,s,n)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,s,n,r){void 0===s&&(s=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,s),void 0!==n&&void 0!==r&&t.body.maxVelocity.set(n,r),o},accelerateToObject:function(t,e,i,s,n){return this.accelerateTo(t,e.x,e.y,i,s,n)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,s=null,n=t.x,r=t.y,a=e.length,h=0;hi&&(s=l,i=c)}}return s},moveTo:function(t,e,i,s,n){void 0===s&&(s=60),void 0===n&&(n=0);var o=Math.atan2(i-t.y,e-t.x);return n>0&&(s=r(t.x,t.y,e,i)/(n/1e3)),t.body.velocity.setToPolar(o,s),o},moveToObject:function(t,e,i,s){return this.moveTo(t,e.x,e.y,i,s)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(n(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new p),i.setToPolar(t,e)},overlapRect:function(t,e,i,s,n,r){return c(this.world,t,e,i,s,n,r)},overlapCirc:function(t,e,i,s,n){return u(this.world,t,e,i,s,n)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(f.UPDATE,this.world.update,this.world),t.off(f.POST_UPDATE,this.world.postUpdate,this.world),t.off(f.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null,this._category=1}},destroy:function(){this.shutdown(),this.scene.sys.events.off(f.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",v,"arcadePhysics"),t.exports=v},25084:(t,e,i)=>{var s=i(56694),n=i(7864),r=i(13747),o=new s({Extends:r,Mixins:[n.Acceleration,n.Angular,n.Bounce,n.Collision,n.Debug,n.Drag,n.Enable,n.Friction,n.Gravity,n.Immovable,n.Mass,n.Pushable,n.Size,n.Velocity],initialize:function(t,e,i,s,n){r.call(this,t,e,i,s,n),this.body=null}});t.exports=o},97602:(t,e,i)=>{var s=i(56694),n=i(95239),r=i(47401),o=i(27037),a=i(23701),h=i(74118),l=i(94287),u=i(15084),c=i(93736),d=new s({Mixins:[n],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new c,this.position=new c(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=s,this.sourceWidth=i,this.sourceHeight=s,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(s/2),this.center=new c(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new c,this.newVelocity=new c,this.deltaMax=new c,this.acceleration=new c,this.allowDrag=!0,this.drag=new c,this.allowGravity=!0,this.gravity=new c,this.bounce=new c,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new c(1e4,1e4),this.maxSpeed=-1,this.friction=new c(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new c(1,1),this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=u(!1),this.touching=u(!0),this.wasTouching=u(!0),this.blocked=u(!0),this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new h,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=a(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var s=!1;if(this.syncBounds){var n=t.getBounds(this._bounds);this.width=n.width,this.height=n.height,s=!0}else{var r=Math.abs(e.scaleX),o=Math.abs(e.scaleY);this._sx===r&&this._sy===o||(this.width=this.sourceWidth*r,this.height=this.sourceHeight*o,this._sx=r,this._sy=o,s=!0)}s&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,s=this.blocked;t?u(!0,e):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),u(!0,i),u(!0,s),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){if(t&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var i=this.position;this.prev.x=i.x,this.prev.y=i.y,this.prevFrame.x=i.x,this.prevFrame.y=i.y}t&&this.update(e)},update:function(t){var e=this.prev,i=this.position,s=this.velocity;if(e.set(i.x,i.y),!this.moves)return this._dx=i.x-e.x,void(this._dy=i.y-e.y);if(this.directControl){var n=this.autoFrame;s.set((i.x-n.x)/t,(i.y-n.y)/t),this.world.updateMotion(this,t),this._dx=i.x-n.x,this._dy=i.y-n.y}else this.world.updateMotion(this,t),this.newVelocity.set(s.x*t,s.y*t),i.add(this.newVelocity),this._dx=i.x-e.x,this._dy=i.y-e.y;var r=s.x,a=s.y;if(this.updateCenter(),this.angle=Math.atan2(a,r),this.speed=Math.sqrt(r*r+a*a),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var h=this.blocked;this.world.emit(o.WORLD_BOUNDS,this,h.up,h.down,h.left,h.right)}},postUpdate:function(){var t=this.position,e=t.x-this.prevFrame.x,i=t.y-this.prevFrame.y,s=this.gameObject;if(this.moves){var n=this.deltaMax.x,o=this.deltaMax.y;0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),0!==o&&0!==i&&(i<0&&i<-o?i=-o:i>0&&i>o&&(i=o)),s&&(s.x+=e,s.y+=i)}e<0?this.facing=r.FACING_LEFT:e>0&&(this.facing=r.FACING_RIGHT),i<0?this.facing=r.FACING_UP:i>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&s&&(s.angle+=this.deltaZ()),this._tx=e,this._ty=i,this.autoFrame.set(t.x,t.y)},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.velocity,i=this.blocked,s=this.customBoundsRectangle,n=this.world.checkCollision,r=this.worldBounce?-this.worldBounce.x:-this.bounce.x,o=this.worldBounce?-this.worldBounce.y:-this.bounce.y,a=!1;return t.xs.right&&n.right&&(t.x=s.right-this.width,e.x*=r,i.right=!0,a=!0),t.ys.bottom&&n.down&&(t.y=s.bottom-this.height,e.y*=o,i.down=!0,a=!0),a&&(this.blocked.none=!1,this.updateCenter()),a},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setGameObject:function(t,e){return void 0===e&&(e=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=t,t.body&&(t.body=this),this.setSize(),this.world.add(this),this.enable=e,this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&(!t&&s.frame&&(t=s.frame.realWidth),!e&&s.frame&&(e=s.frame.realHeight)),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&s&&s.getCenter){var n=(s.width-t)/2,r=(s.height-e)/2;this.offset.set(n,r)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i&&(i.setPosition(t,e),this.rotation=i.angle,this.preRotation=i.angle);var s=this.position;i&&i.getTopLeft?i.getTopLeft(s):s.set(t,e),this.prev.copy(s),this.prevFrame.copy(s),this.autoFrame.copy(s),i&&this.updateBounds(),this.updateCenter(),this.collideWorldBounds&&this.checkWorldBounds(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:l(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,s,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,s,i+this.velocity.x/2,s+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(t){return void 0===t&&(t=!0),this.directControl=t,this},setCollideWorldBounds:function(t,e,i,s){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,r=void 0!==i;return(n||r)&&(this.worldBounce||(this.worldBounce=new c),n&&(this.worldBounce.x=e),r&&(this.worldBounce.y=i)),void 0!==s&&(this.onWorldBounds=s),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){return this.setVelocity(t,this.velocity.y)},setVelocityY:function(t){return this.setVelocity(this.velocity.x,t)},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setSlideFactor:function(t,e){return this.slideFactor.set(t,e),this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,s){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e*this.slideFactor.x);var n=this.blocked;i&&(n.left=!0,n.none=!1),s&&(n.right=!0,n.none=!1)},processY:function(t,e,i,s){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e*this.slideFactor.y);var n=this.blocked;i&&(n.up=!0,n.none=!1),s&&(n.down=!0,n.none=!1)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=d},3909:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=s,this.collideCallback=n,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=s},99523:(t,e,i)=>{var s=i(62832),n=i(25084),r=i(97602),o=i(56694),a=i(47401),h=i(10481),l=i(66634),u=i(46346),c=new o({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,s,n){return this.world.addCollider(t,e,i,s,n)},overlap:function(t,e,i,s,n){return this.world.addOverlap(t,e,i,s,n)},existing:function(t,e){var i=e?a.STATIC_BODY:a.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},image:function(t,e,i,n){var r=new s(this.scene,t,e,i,n);return this.sys.displayList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticSprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.STATIC_BODY),r},sprite:function(t,e,i,s){var r=new n(this.scene,t,e,i,s);return this.sys.displayList.add(r),this.sys.updateList.add(r),this.world.enableBody(r,a.DYNAMIC_BODY),r},staticGroup:function(t,e){return this.sys.updateList.add(new u(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},body:function(t,e,i,s){var n=new r(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.DYNAMIC_BODY),n},staticBody:function(t,e,i,s){var n=new l(this.world);return n.position.set(t,e),i&&s&&n.setSize(i,s),this.world.add(n,a.STATIC_BODY),n},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=c},44880:t=>{t.exports=function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+n;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},66185:(t,e,i)=>{var s=i(47401);t.exports=function(t,e,i,n){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+n;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==s.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==s.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},10481:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(95239),o=i(47401),a=i(72632),h=i(59192),l=i(42911),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){if(i||n)if(l(i))n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&l(i[0])){var r=this;i.forEach((function(t){t.internalCreateCallback=r.createCallbackHandler,t.internalRemoveCallback=r.removeCallbackHandler,t.classType=a(t,"classType",s)})),n=null}else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,n&&(n.classType=a(n,"classType",s)),this.physicsType=o.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:a(n,"collideWorldBounds",!1),setBoundsRectangle:a(n,"customBoundsRectangle",null),setAccelerationX:a(n,"accelerationX",0),setAccelerationY:a(n,"accelerationY",0),setAllowDrag:a(n,"allowDrag",!0),setAllowGravity:a(n,"allowGravity",!0),setAllowRotation:a(n,"allowRotation",!0),setDamping:a(n,"useDamping",!1),setBounceX:a(n,"bounceX",0),setBounceY:a(n,"bounceY",0),setDragX:a(n,"dragX",0),setDragY:a(n,"dragY",0),setEnable:a(n,"enable",!0),setGravityX:a(n,"gravityX",0),setGravityY:a(n,"gravityY",0),setFrictionX:a(n,"frictionX",0),setFrictionY:a(n,"frictionY",0),setMaxSpeed:a(n,"maxSpeed",-1),setMaxVelocityX:a(n,"maxVelocityX",1e4),setMaxVelocityY:a(n,"maxVelocityY",1e4),setVelocityX:a(n,"velocityX",0),setVelocityY:a(n,"velocityY",0),setAngularVelocity:a(n,"angularVelocity",0),setAngularAcceleration:a(n,"angularAcceleration",0),setAngularDrag:a(n,"angularDrag",0),setMass:a(n,"mass",1),setImmovable:a(n,"immovable",!1)},h.call(this,e,i,n),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,o.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var s=this.getChildren(),n=0;n{var e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y=function(){return u&&g&&i.blocked.right?(e.processX(-m,a,!1,!0),1):l&&v&&i.blocked.left?(e.processX(m,a,!0),1):f&&v&&e.blocked.right?(i.processX(-m,h,!1,!0),2):d&&g&&e.blocked.left?(i.processX(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processX(m,r),i.processX(-m,o)):(e.processX(-m,r),i.processX(m,o));else if(s&&!n)0===t||3===t?e.processX(m,a,!0):e.processX(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processX(-m,h,!1,!0):i.processX(m,h,!0);else{var g=.5*m;0===t?p?(e.processX(m,0,!0),i.processX(0,null,!1,!0)):f?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.x,!0),i.processX(-g,null,!1,!0)):1===t?c?(e.processX(0,null,!1,!0),i.processX(m,0,!0)):u?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,null,!1,!0),i.processX(g,e.velocity.x,!0)):2===t?p?(e.processX(-m,0,!1,!0),i.processX(0,null,!0)):d?(e.processX(-g,0,!1,!0),i.processX(g,0,!0)):(e.processX(-g,i.velocity.x,!1,!0),i.processX(g,null,!0)):3===t&&(c?(e.processX(0,null,!0),i.processX(-m,0,!1,!0)):l?(e.processX(g,0,!0),i.processX(-g,0,!1,!0)):(e.processX(g,i.velocity.y,!0),i.processX(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.x,s=i.velocity.x,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.x,o=h+a*i.bounce.x,l&&v?x(0):d&&g?x(1):u&&g?x(2):!(!f||!v)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.x,T=i.velocity.x;return s=e.pushable,l=e._dx<0,u=e._dx>0,c=0===e._dx,g=Math.abs(e.right-i.x)<=Math.abs(i.right-e.x),a=T-x*e.bounce.x,n=i.pushable,d=i._dx<0,f=i._dx>0,p=0===i._dx,v=!g,h=x-T*i.bounce.x,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.x=0:g?i.processX(m,h,!0):i.processX(-m,h,!1,!0),e.moves&&(i.y+=(e.y-e.prev.y)*e.friction.y,i._dy=i.y-i.prev.y)},RunImmovableBody2:function(t){2===t?e.velocity.x=0:v?e.processX(m,a,!0):e.processX(-m,a,!1,!0),i.moves&&(e.y+=(i.y-i.prev.y)*i.friction.y,e._dy=e.y-e.prev.y)}}},67050:t=>{var e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y=function(){return u&&g&&i.blocked.down?(e.processY(-m,a,!1,!0),1):l&&v&&i.blocked.up?(e.processY(m,a,!0),1):f&&v&&e.blocked.down?(i.processY(-m,h,!1,!0),2):d&&g&&e.blocked.up?(i.processY(m,h,!0),2):0},x=function(t){if(s&&n)m*=.5,0===t||3===t?(e.processY(m,r),i.processY(-m,o)):(e.processY(-m,r),i.processY(m,o));else if(s&&!n)0===t||3===t?e.processY(m,a,!0):e.processY(-m,a,!1,!0);else if(!s&&n)0===t||3===t?i.processY(-m,h,!1,!0):i.processY(m,h,!0);else{var g=.5*m;0===t?p?(e.processY(m,0,!0),i.processY(0,null,!1,!0)):f?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)):1===t?c?(e.processY(0,null,!1,!0),i.processY(m,0,!0)):u?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,null,!1,!0),i.processY(g,e.velocity.y,!0)):2===t?p?(e.processY(-m,0,!1,!0),i.processY(0,null,!0)):d?(e.processY(-g,0,!1,!0),i.processY(g,0,!0)):(e.processY(-g,i.velocity.y,!1,!0),i.processY(g,null,!0)):3===t&&(c?(e.processY(0,null,!0),i.processY(-m,0,!1,!0)):l?(e.processY(g,0,!0),i.processY(-g,0,!1,!0)):(e.processY(g,i.velocity.y,!0),i.processY(-g,null,!1,!0)))}return!0};t.exports={BlockCheck:y,Check:function(){var t=e.velocity.y,s=i.velocity.y,n=Math.sqrt(s*s*i.mass/e.mass)*(s>0?1:-1),a=Math.sqrt(t*t*e.mass/i.mass)*(t>0?1:-1),h=.5*(n+a);return a-=h,r=h+(n-=h)*e.bounce.y,o=h+a*i.bounce.y,l&&v?x(0):d&&g?x(1):u&&g?x(2):!(!f||!v)&&x(3)},Set:function(t,r,o){i=r;var x=(e=t).velocity.y,T=i.velocity.y;return s=e.pushable,l=e._dy<0,u=e._dy>0,c=0===e._dy,g=Math.abs(e.bottom-i.y)<=Math.abs(i.bottom-e.y),a=T-x*e.bounce.y,n=i.pushable,d=i._dy<0,f=i._dy>0,p=0===i._dy,v=!g,h=x-T*i.bounce.y,m=Math.abs(o),y()},Run:x,RunImmovableBody1:function(t){1===t?i.velocity.y=0:g?i.processY(m,h,!0):i.processY(-m,h,!1,!0),e.moves&&(i.x+=(e.x-e.prev.x)*e.friction.x,i._dx=i.x-i.prev.x)},RunImmovableBody2:function(t){2===t?e.velocity.y=0:v?e.processY(m,a,!0):e.processY(-m,a,!1,!0),i.moves&&(e.x+=(i.x-i.prev.x)*i.friction.x,e._dx=e.x-e.prev.x)}}},61777:(t,e,i)=>{var s=i(75671),n=i(22916);t.exports=function(t,e,i,r,o){void 0===o&&(o=s(t,e,i,r));var a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},25299:(t,e,i)=>{var s=i(66185),n=i(67050);t.exports=function(t,e,i,r,o){void 0===o&&(o=s(t,e,i,r));var a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=n.Set(t,e,o);return a||h?(a?n.RunImmovableBody1(l):h&&n.RunImmovableBody2(l),!0):l>0||n.Check()}},15084:t=>{t.exports=function(t,e){return void 0===e&&(e={}),e.none=t,e.up=!1,e.down=!1,e.left=!1,e.right=!1,t||(e.up=!0,e.down=!0,e.left=!0,e.right=!0),e}},66634:(t,e,i)=>{var s=i(65650),n=i(56694),r=i(95239),o=i(47401),a=i(94287),h=i(15084),l=i(93736),u=new n({Mixins:[r],initialize:function(t,e){var i=64,s=64,n=void 0!==e;n&&e.displayWidth&&(i=e.displayWidth,s=e.displayHeight),n||(e={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0}),this.world=t,this.gameObject=n?e:void 0,this.isBody=!0,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-i*e.originX,e.y-s*e.originY),this.width=i,this.height=s,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=l.ZERO,this.allowGravity=!1,this.gravity=l.ZERO,this.bounce=l.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var s=this.gameObject;if(s&&s.frame&&(t||(t=s.frame.realWidth),e||(e=s.frame.realHeight)),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&s&&s.getCenter){var n=s.displayWidth/2,r=s.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(n-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?s(this,t,e):a(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,s=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,s,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},46346:(t,e,i)=>{var s=i(25084),n=i(56694),r=i(95239),o=i(47401),a=i(72632),h=i(59192),l=i(42911),u=new n({Extends:h,Mixins:[r],initialize:function(t,e,i,n){i||n?l(i)?(n=i,i=null,n.internalCreateCallback=this.createCallbackHandler,n.internalRemoveCallback=this.removeCallbackHandler,n.createMultipleCallback=this.createMultipleCallbackHandler,n.classType=a(n,"classType",s)):Array.isArray(i)&&l(i[0])?(n=i,i=null,n.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=a(t,"classType",s)}))):n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:n={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:s},this.world=t,this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,h.call(this,e,i,n),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,o.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e{var s=i(94240),n=i(97602),r=i(82897),o=i(56694),a=i(3909),h=i(47401),l=i(53996),u=i(92951),c=i(6659),d=i(27037),f=i(88456),p=i(41935),g=i(54726),v=i(75671),m=i(66185),y=i(44662),x=i(10850),T=i(83392),w=i(74623),b=i(25163),E=i(74118),S=i(68687),A=i(27354),_=i(61777),C=i(25299),M=i(58403),R=i(66634),P=i(28808),O=i(69360),L=i(93736),F=i(1071),D=new o({Extends:c,initialize:function(t,e){c.call(this),this.scene=t,this.bodies=new M,this.staticBodies=new M,this.pendingDestroy=new M,this.colliders=new w,this.gravity=new L(x(e,"gravity.x",0),x(e,"gravity.y",0)),this.bounds=new E(x(e,"x",0),x(e,"y",0),x(e,"width",t.sys.scale.width),x(e,"height",t.sys.scale.height)),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)},this.fps=x(e,"fps",60),this.fixedStep=x(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(e,"timeScale",1),this.OVERLAP_BIAS=x(e,"overlapBias",4),this.TILE_BIAS=x(e,"tileBias",16),this.forceX=x(e,"forceX",!1),this.isPaused=x(e,"isPaused",!1),this._total=0,this.drawDebug=x(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(e,"debugShowBody",!0),debugShowStaticBody:x(e,"debugShowStaticBody",!0),debugShowVelocity:x(e,"debugShowVelocity",!0),bodyDebugColor:x(e,"debugBodyColor",16711935),staticBodyDebugColor:x(e,"debugStaticBodyColor",255),velocityDebugColor:x(e,"debugVelocityColor",65280)},this.maxEntries=x(e,"maxEntries",16),this.useTree=x(e,"useTree",!0),this.tree=new S(this.maxEntries),this.staticTree=new S(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new O,this._tempMatrix2=new O,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=r;for(this.fixedStep||(n=.001*e,a=!0,this._elapsed=0),i=0;i=r;)this._elapsed-=r,this.step(n)}},step:function(t){var e,i,s=this.bodies.entries,n=s.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(s=(i=a.entries).length,t=0;t-1&&t.velocity.length()>d&&(t.velocity.normalize().scale(d),c=d),t.speed=c},separate:function(t,e,i,s,n){var r,o,a=!1,h=!0;if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return a;if(i&&!1===i.call(s,t.gameObject,e.gameObject))return a;if(t.isCircle||e.isCircle){var l=this.separateCircle(t,e,n);l.result?(a=!0,h=!1):(r=l.x,o=l.y,h=!0)}if(h){var u=!1,c=!1,f=this.OVERLAP_BIAS;n?(u=_(t,e,n,f,r),c=C(t,e,n,f,o)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)S&&(p=l(y,x,S,E)-w):x>A&&(yS&&(p=l(y,x,S,A)-w)),p*=-1}else p=t.halfWidth+e.halfWidth-u(o,a);t.overlapR=p,e.overlapR=p;var _=s(o,a),C=(p+T.EPSILON)*Math.cos(_),M=(p+T.EPSILON)*Math.sin(_),R={overlap:p,result:!1,x:C,y:M};if(i&&(!g||g&&0!==p))return R.result=!0,R;if(!g&&0===p||h&&c||t.customSeparateX||e.customSeparateX)return R.x=void 0,R.y=void 0,R;var P=!t.pushable&&!e.pushable;if(g){var O=o.x-a.x,L=o.y-a.y,F=Math.sqrt(Math.pow(O,2)+Math.pow(L,2)),D=(a.x-o.x)/F||0,k=(a.y-o.y)/F||0,I=2*(d.x*D+d.y*k-f.x*D-f.y*k)/(t.mass+e.mass);(h||c)&&(I*=2),h||(d.x=d.x-I/t.mass*D,d.y=d.y-I/t.mass*k,d.multiply(t.bounce)),c||(f.x=f.x+I/e.mass*D,f.y=f.y+I/e.mass*k,f.multiply(e.bounce)),h||c||(C*=.5,M*=.5),h||(t.x-=C,t.y-=M,t.updateCenter()),c||(e.x+=C,e.y+=M,e.updateCenter()),R.result=!0}else!h||t.pushable||P?(t.x-=C,t.y-=M,t.updateCenter()):(!c||e.pushable||P)&&(e.x+=C,e.y+=M,e.updateCenter()),R.x=void 0,R.y=void 0;return R},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?u(t.center,e.center)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.left||t.bottom<=e.top||t.left>=e.right||t.top>=e.bottom))},circleBodyIntersects:function(t,e){var i=r(t.center.x,e.left,e.right),s=r(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-s)*(t.center.y-s)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!0)},collide:function(t,e,i,s,n){return void 0===i&&(i=null),void 0===s&&(s=null),void 0===n&&(n=i),this.collideObjects(t,e,i,s,n,!1)},collideObjects:function(t,e,i,s,n,r){var o,a;!t.isParent||void 0!==t.physicsType&&void 0!==e&&t!==e||(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,s,n,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,s,n,r);if(!t||!e)return!1;if(t.body||t.isBody){if(e.body||e.isBody)return this.collideSpriteVsSprite(t,e,i,s,n,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,s,n,r)}else if(t.isParent){if(e.body||e.isBody)return this.collideSpriteVsGroup(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,s,n,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,s,n,r)}else if(t.isTilemap){if(e.body||e.isBody)return this.collideSpriteVsTilemapLayer(e,t,i,s,n,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,s,n,r)}},canCollide:function(t,e){return t&&e&&0!=(t.collisionMask&e.collisionCategory)&&0!=(e.collisionMask&t.collisionCategory)},collideSpriteVsSprite:function(t,e,i,s,n,r){var o=t.isBody?t:t.body,a=e.isBody?e:e.body;return!!this.canCollide(o,a)&&(this.separate(o,a,s,n,r)&&(i&&i.call(n,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,s,n,r){var o,a,l,u=t.isBody?t:t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none&&this.canCollide(u,e))if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=r?null:this.tileFilterOptions,p=y(a,h,l,u,f,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,s,n,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,s,n,r,o){for(var a,h,l=t.isBody?t:t.body,u={left:0,right:0,top:0,bottom:0},c=!1,f=0;f{t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},29257:t=>{t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},62122:t=>{t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i,s){return this.body.setCollideWorldBounds(t,e,i,s),this}}},95239:(t,e,i)=>{var s=i(44880),n={setCollisionCategory:function(t){return(this.body?this.body:this).collisionCategory=t,this},willCollideWith:function(t){return 0!=((this.body?this.body:this).collisionMask&t)},addCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask|t,this},removeCollidesWith:function(t){var e=this.body?this.body:this;return e.collisionMask=e.collisionMask&~t,this},setCollidesWith:function(t){return(this.body?this.body:this).collisionMask=s(t),this},resetCollisionCategory:function(){var t=this.body?this.body:this;return t.collisionCategory=1,t.collisionMask=1,this}};t.exports=n},99803:t=>{t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},87145:t=>{t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},96174:t=>{t.exports={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,e,i,s,n){return t&&this.body.reset(e,i),s&&(this.body.gameObject.active=!0),n&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}}},51702:t=>{t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},25578:t=>{t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},72029:t=>{t.exports={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}}},34566:t=>{t.exports={setMass:function(t){return this.body.mass=t,this}}},2732:(t,e,i)=>{var s=i(15147),n=i(26673),r=i(22184),o=i(26535);t.exports=function(t,e,i,a,h,l){var u=s(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new n(e,i,a),d=new n,f=[],p=0;p{t.exports=function(t,e,i,s,n,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+s,l.maxY=i+n,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+s,bottom:i+n,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},57527:t=>{t.exports={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}}},77687:t=>{t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},66536:t=>{t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},7864:(t,e,i)=>{t.exports={Acceleration:i(5321),Angular:i(29257),Bounce:i(62122),Collision:i(95239),Debug:i(99803),Drag:i(87145),Enable:i(96174),Friction:i(51702),Gravity:i(25578),Immovable:i(72029),Mass:i(34566),OverlapCirc:i(2732),OverlapRect:i(15147),Pushable:i(57527),Size:i(77687),Velocity:i(66536)}},47401:t=>{t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},22346:t=>{t.exports="collide"},95092:t=>{t.exports="overlap"},15775:t=>{t.exports="pause"},74142:t=>{t.exports="resume"},22825:t=>{t.exports="tilecollide"},10851:t=>{t.exports="tileoverlap"},7543:t=>{t.exports="worldbounds"},1487:t=>{t.exports="worldstep"},27037:(t,e,i)=>{t.exports={COLLIDE:i(22346),OVERLAP:i(95092),PAUSE:i(15775),RESUME:i(74142),TILE_COLLIDE:i(22825),TILE_OVERLAP:i(10851),WORLD_BOUNDS:i(7543),WORLD_STEP:i(1487)}},39977:(t,e,i)=>{var s=i(47401),n=i(98611),r={ArcadePhysics:i(66150),Body:i(97602),Collider:i(3909),Components:i(7864),Events:i(27037),Factory:i(99523),GetCollidesWith:i(44880),GetOverlapX:i(75671),GetOverlapY:i(66185),SeparateX:i(61777),SeparateY:i(25299),Group:i(10481),Image:i(62832),Sprite:i(25084),StaticBody:i(66634),StaticGroup:i(46346),Tilemap:i(8413),World:i(85233)};r=n(!1,r,s),t.exports=r},25163:t=>{t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},98209:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,t.updateCenter(),0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},72792:t=>{t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,t.updateCenter(),0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},27354:(t,e,i)=>{var s=i(14405),n=i(52926),r=i(28808);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX(){var s=i(98209);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:s(t,a)),a}},52926:(t,e,i)=>{var s=i(72792);t.exports=function(t,e,i,n,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:s(t,a)),a}},28808:t=>{t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},8413:(t,e,i)=>{var s={ProcessTileCallbacks:i(25163),ProcessTileSeparationX:i(98209),ProcessTileSeparationY:i(72792),SeparateTile:i(27354),TileCheckX:i(14405),TileCheckY:i(52926),TileIntersectsBody:i(28808)};t.exports=s},53954:(t,e,i)=>{t.exports={Arcade:i(39977),Matter:i(45949)}},63568:(t,e,i)=>{var s=i(56694),n=i(93736),r=new s({initialize:function(){this.boundsCenter=new n,this.centerDiff=new n},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,s=t.bounds.max.x-t.bounds.min.x,n=t.bounds.max.y-t.bounds.min.y,r=s*t.centerOfMass.x,o=n*t.centerOfMass.y;return e.set(s/2,n/2),i.set(r-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+s.y+r.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i+s.y+r.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+s.y+r.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i+r.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.centerDiff;return new n(e+s.x,i+s.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i+r.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+s.x+r.x,i-(s.y-r.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e+r.x,i-(s.y-r.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var s=this.boundsCenter,r=this.centerDiff;return new n(e-(s.x-r.x),i-(s.y-r.y))}return!1}});t.exports=r},18171:(t,e,i)=>{var s=i(16929);s.Body=i(84125),s.Composite=i(11299),s.World=i(72005),s.Collision=i(63454),s.Detector=i(13657),s.Pairs=i(91327),s.Pair=i(70584),s.Query=i(13390),s.Resolver=i(44272),s.Constraint=i(52838),s.Common=i(68758),s.Engine=i(45775),s.Events=i(39073),s.Sleeping=i(22806),s.Plugin=i(84474),s.Bodies=i(68516),s.Composites=i(56643),s.Axes=i(50658),s.Bounds=i(84091),s.Svg=i(92765),s.Vector=i(10438),s.Vertices=i(39745),s.World.add=s.Composite.add,s.World.remove=s.Composite.remove,s.World.addComposite=s.Composite.addComposite,s.World.addBody=s.Composite.addBody,s.World.addConstraint=s.Composite.addConstraint,s.World.clear=s.Composite.clear,t.exports=s},72653:(t,e,i)=>{var s=i(68516),n=i(56694),r=i(56643),o=i(52838),a=i(92765),h=i(3860),l=i(7030),u=i(73658),c=i(84720),d=i(10998),f=i(72829),p=i(88596),g=i(39745),v=new n({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return this.world.add(o),o},trapezoid:function(t,e,i,n,r,o){var a=s.trapezoid(t,e,i,n,r,o);return this.world.add(a),a},circle:function(t,e,i,n,r){var o=s.circle(t,e,i,n,r);return this.world.add(o),o},polygon:function(t,e,i,n,r){var o=s.polygon(t,e,i,n,r);return this.world.add(o),o},fromVertices:function(t,e,i,n,r,o,a){"string"==typeof i&&(i=g.fromPath(i));var h=s.fromVertices(t,e,i,n,r,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,s,n){void 0===n&&(n=!0);var r=d.parseBody(t,e,i,s);return n&&!this.world.has(r)&&this.world.add(r),r},fromSVG:function(t,e,i,n,r,o){void 0===n&&(n=1),void 0===r&&(r={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],u=0;u{var s=i(74527),n=i(72632),r=i(93736);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity].forEach((function(t){for(var i in t)(s=t[i]).get&&"function"==typeof s.get||s.set&&"function"==typeof s.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var s})),e.world=t,e._tempVec2=new r(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=n(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},7030:(t,e,i)=>{var s=i(56694),n=i(74527),r=i(89980),o=i(72632),a=i(1539),h=i(58210),l=i(93736),u=new s({Extends:a,Mixins:[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity,h],initialize:function(t,e,i,s,n,a){r.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(s,n),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=u},50583:(t,e,i)=>{var s=i(84093),n=i(50658),r=i(68516),o=i(84125),a=i(63568),h=i(84091),l=i(56694),u=i(63454),c=i(68758),d=i(11299),f=i(56643),p=i(52838),g=i(13657),v=i(53996),m=i(72653),y=i(72632),x=i(10850),T=i(1675),w=i(80391),b=i(16929),E=i(44097),S=i(30657),A=i(70584),_=i(91327),C=i(84474),M=i(91963),R=i(13390),P=i(44272),O=i(7599),L=i(92765),F=i(10438),D=i(39745),k=i(31468);c.setDecomp(i(81084));var I=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=d,this.collision=u,this.detector=g,this.pair=A,this.pairs=_,this.query=R,this.resolver=P,this.constraint=p,this.bodies=r,this.composites=f,this.axes=n,this.bounds=h,this.svg=L,this.vector=F,this.vertices=D,this.verts=D,this._tempVec2=F.create(),x(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),x(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),x(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),P._restingThresh=x(this.config,"restingThresh",4),P._restingThreshTangent=x(this.config,"restingThreshTangent",6),P._positionDampen=x(this.config,"positionDampen",.9),P._positionWarming=x(this.config,"positionWarming",.8),P._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),t.sys.events.once(O.BOOT,this.boot,this),t.sys.events.on(O.START,this.start,this)},boot:function(){this.world=new k(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(O.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new k(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(O.UPDATE,this.world.update,this.world),t.on(O.POST_UPDATE,this.world.postUpdate,this.world),t.once(O.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return S(y(e,"matter",{}),y(t,"matter",{}))},enableAttractorPlugin:function(){return C.register(T),C.use(b,T),this},enableWrapPlugin:function(){return C.register(E),C.use(b,E),this},enableCollisionEventsPlugin:function(){return C.register(w),C.use(b,w),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var s=F.create(e,i);return R.point(t,s).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var s=F.create(t,e),n=[];return R.point(i,s).forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n},intersectRect:function(t,e,i,s,n,r){void 0===n&&(n=!1),r=this.getMatterBodies(r);var o={min:{x:t,y:e},max:{x:t+i,y:e+s}},a=[];return R.region(r,o,n).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,s,n,r){void 0===n&&(n=1),r=this.getMatterBodies(r);for(var o=[],a=R.ray(r,F.create(t,e),F.create(i,s),n),h=0;h{var s=i(16569),n=i(56694),r=i(74527),o=i(89980),a=i(72632),h=i(58210),l=i(13747),u=i(93736),c=new n({Extends:l,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s(this),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new u(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline(),this.initPostPipeline(!0)}});t.exports=c},84720:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(56694),o=i(74527),a=i(28699),h=i(6659),l=i(72632),u=i(19256),c=i(39745),d=new r({Extends:h,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){h.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var s=l(i,"body",null),r=l(i,"addToWorld",!0);if(s)this.setBody(s,r);else{var o=e.getCollisionGroup();l(o,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}if(e.flipX||e.flipY){var a={x:e.getCenterX(),y:e.getCenterY()},u=e.flipX?-1:1,c=e.flipY?-1:1;n.scale(s,u,c,a)}},setFromTileRectangle:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,n=e.y+e.height/2,r=s.rectangle(i,n,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),u(t,"isStatic")||(t.isStatic=!0),u(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),h=this.tile.getCollisionGroup(),d=l(h,"objects",[]),f=[],p=0;p1){var S=a(t);S.parts=f,this.setBody(n.create(S),S.addToWorld)}return this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=d},10998:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(68758),o=i(72632),a=i(39745),h={parseBody:function(t,e,i,s){void 0===s&&(s={});for(var a=o(i,"fixtures",[]),h=[],l=0;l{var s=i(68516),n=i(84125),r={parseBody:function(t,e,i,r){var o;void 0===r&&(r={});var a=i.vertices;if(1===a.length)r.vertices=a[0],o=n.create(r),s.flagCoincidentParts(o.parts);else{for(var h=[],l=0;l{var s=i(84091),n=i(56694),r=i(11299),o=i(52838),a=i(13657),h=i(35416),l=i(33963),u=i(30657),c=i(22806),d=i(93736),f=i(39745),p=new n({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(u(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var n=r.allBodies(this.world.localWorld),o=0;o1?1:0;n{var s=i(68516),n=i(84125),r=i(56694),o=i(68758),a=i(11299),h=i(45775),l=i(6659),u=i(35416),c=i(72632),d=i(10850),f=i(84125),p=i(39073),g=i(84720),v=i(72005),m=i(10438),y=new r({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.getDelta=d(e,"getDelta",this.update60Hz);var s=c(e,"runner",{}),n=c(s,"fps",!1),r=c(s,"fps",60),o=c(s,"delta",1e3/r),a=c(s,"deltaMin",1e3/r),u=c(s,"deltaMax",1e3/(.5*r));n||(r=1e3/o),this.runner={fps:r,deltaSampleSize:c(s,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(s,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var f=d(e,"debug",!1);if(this.drawDebug="object"==typeof f||f,this.debugGraphic,this.debugConfig={showAxes:c(f,"showAxes",!1),showAngleIndicator:c(f,"showAngleIndicator",!1),angleColor:c(f,"angleColor",15208787),showBroadphase:c(f,"showBroadphase",!1),broadphaseColor:c(f,"broadphaseColor",16757760),showBounds:c(f,"showBounds",!1),boundsColor:c(f,"boundsColor",16777215),showVelocity:c(f,"showVelocity",!1),velocityColor:c(f,"velocityColor",44783),showCollisions:c(f,"showCollisions",!1),collisionColor:c(f,"collisionColor",16094476),showSeparations:c(f,"showSeparations",!1),separationColor:c(f,"separationColor",16753920),showBody:c(f,"showBody",!0),showStaticBody:c(f,"showStaticBody",!0),showInternalEdges:c(f,"showInternalEdges",!1),renderFill:c(f,"renderFill",!1),renderLine:c(f,"renderLine",!0),fillColor:c(f,"fillColor",1075465),fillOpacity:c(f,"fillOpacity",1),lineColor:c(f,"lineColor",2678297),lineOpacity:c(f,"lineOpacity",1),lineThickness:c(f,"lineThickness",1),staticFillColor:c(f,"staticFillColor",857979),staticLineColor:c(f,"staticLineColor",1255396),showSleeping:c(f,"showSleeping",!1),staticBodySleepOpacity:c(f,"staticBodySleepOpacity",.7),sleepFillColor:c(f,"sleepFillColor",4605510),sleepLineColor:c(f,"sleepLineColor",10066585),showSensors:c(f,"showSensors",!0),sensorFillColor:c(f,"sensorFillColor",857979),sensorLineColor:c(f,"sensorLineColor",1255396),showPositions:c(f,"showPositions",!0),positionSize:c(f,"positionSize",4),positionColor:c(f,"positionColor",14697178),showJoint:c(f,"showJoint",!0),jointColor:c(f,"jointColor",14737474),jointLineOpacity:c(f,"jointLineOpacity",1),jointLineThickness:c(f,"jointLineThickness",2),pinSize:c(f,"pinSize",4),pinColor:c(f,"pinColor",4382944),springColor:c(f,"springColor",14697184),anchorColor:c(f,"anchorColor",15724527),anchorSize:c(f,"anchorSize",4),showConvexHulls:c(f,"showConvexHulls",!1),hullColor:c(f,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var p=e.setBounds;if("boolean"==typeof p)this.setBounds();else{var g=c(p,"x",0),v=c(p,"y",0),m=c(p,"width",t.sys.scale.width),y=c(p,"height",t.sys.scale.height),x=c(p,"thickness",64),T=c(p,"left",!0),w=c(p,"right",!0),b=c(p,"top",!0),E=c(p,"bottom",!0);this.setBounds(g,v,m,y,x,T,w,b,E)}}},setCompositeRenderStyle:function(t){var e,i,s,n=t.bodies,r=t.constraints,o=t.composites;for(e=0;e0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_START,e,i,s)})),p.on(e,"collisionActive",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,s)})),p.on(e,"collisionEnd",(function(e){var i,s,n=e.pairs;n.length>0&&(i=n[0].bodyA,s=n[0].bodyB),t.emit(u.COLLISION_END,e,i,s)}))},setBounds:function(t,e,i,s,n,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===s&&(s=this.scene.sys.scale.height),void 0===n&&(n=64),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-n,e-n,n,s+2*n),this.updateWall(o,"right",t+i,e-n,n,s+2*n),this.updateWall(a,"top",t,e-n,i,n),this.updateWall(h,"bottom",t,e+s,i,n),this},updateWall:function(t,e,i,s,n,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=n/2,s+=r/2,this.walls[e]=this.create(i,s,n,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=.001),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,this.localWorld.gravity.scale=i,this},create:function(t,e,i,n,r){var o=s.rectangle(t,e,i,n,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;is.deltaMax?s.deltaMax:e,s.delta=e),s.timeScalePrev=n.timeScale,s.frameCounter+=1,t-s.counterTimestamp>=1e3&&(s.fps=s.frameCounter*((t-s.counterTimestamp)/1e3),s.counterTimestamp=t,s.frameCounter=0),h.update(i,e)}},step:function(t){h.update(this.engine,t)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,s=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(s,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(s),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(s,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(s,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=o.keys(t.buckets),r=0;r0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,s){e.lineStyle(1,i,s);for(var n=0;n1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(g,e,f,y)}}},renderBody:function(t,e,i,s,n,r,o,a){void 0===s&&(s=null),void 0===n&&(n=null),void 0===r&&(r=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,u=h.sensorLineColor,c=t.parts,d=c.length,f=d>1?1:0;f1){var n=t.vertices;e.lineStyle(s,i),e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var r=1;r0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.y,h)),this},resetCollisionIDs:function(){return n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,this},shutdown:function(){p.off(this.engine),this.removeAllListeners(),v.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},95349:t=>{t.exports={setBounce:function(t){return this.body.restitution=t,this}}},70679:t=>{var e={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i{var s=i(84125),n={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),s.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return s.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),s.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=n},74015:t=>{t.exports={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}}},11535:t=>{t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},74497:(t,e,i)=>{var s=i(84125),n=i(93736),r={setMass:function(t){return s.setMass(this.body,t),this},setDensity:function(t){return s.setDensity(this.body,t),this},centerOfMass:{get:function(){return new n(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=r},75529:t=>{t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},64024:(t,e,i)=>{var s=i(68516),n=i(84125),r=i(88456),o=i(72632),a=i(10998),h=i(72829),l=i(39745),u={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,s){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},s)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i{var s=i(35416),n=i(22806),r=i(39073),o={setToSleep:function(){return n.set(this.body,!0),this},setAwake:function(){return n.set(this.body,!1),this},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepStart",(function(t){e.emit(s.SLEEP_START,t,this)}))}else r.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;r.on(this.body,"sleepEnd",(function(t){e.emit(s.SLEEP_END,t,this)}))}else r.off(this.body,"sleepEnd");return this}};t.exports=o},82884:(t,e,i)=>{var s=i(84125),n={setStatic:function(t){return s.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=n},4753:(t,e,i)=>{var s=i(84125),n=i(83392),r=i(35786),o=i(62138),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),s.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),s.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,s.scale(this.body,e,i),s.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=r(t),s.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),s.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=r(t),s.setAngle(this.body,t),this},setFixedRotation:function(){return s.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,s.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var n=1/this._scaleX,r=1/this._scaleY;return this._scaleX=t,this._scaleY=e,s.scale(this.body,n,r,i),s.scale(this.body,t,e,i),this}};t.exports=a},37268:(t,e,i)=>{var s=i(84125),n={setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),s.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),s.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),s.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return s.getVelocity(this.body)},setAngularVelocity:function(t){return s.setAngularVelocity(this.body,t),this},getAngularVelocity:function(){return s.getAngularVelocity(this.body)},setAngularSpeed:function(t){return s.setAngularSpeed(this.body,t),this},getAngularSpeed:function(){return s.getAngularSpeed(this.body)}};t.exports=n},74527:(t,e,i)=>{t.exports={Bounce:i(95349),Collision:i(70679),Force:i(77178),Friction:i(74015),Gravity:i(11535),Mass:i(74497),Sensor:i(75529),SetBody:i(64024),Sleep:i(25106),Static:i(82884),Transform:i(4753),Velocity:i(37268)}},63201:t=>{t.exports="afteradd"},30474:t=>{t.exports="afterremove"},44822:t=>{t.exports="afterupdate"},88820:t=>{t.exports="beforeadd"},94849:t=>{t.exports="beforeremove"},6391:t=>{t.exports="beforeupdate"},96738:t=>{t.exports="collisionactive"},7916:t=>{t.exports="collisionend"},59529:t=>{t.exports="collisionstart"},10219:t=>{t.exports="dragend"},183:t=>{t.exports="drag"},39143:t=>{t.exports="dragstart"},16483:t=>{t.exports="pause"},35806:t=>{t.exports="resume"},22106:t=>{t.exports="sleepend"},5803:t=>{t.exports="sleepstart"},35416:(t,e,i)=>{t.exports={AFTER_ADD:i(63201),AFTER_REMOVE:i(30474),AFTER_UPDATE:i(44822),BEFORE_ADD:i(88820),BEFORE_REMOVE:i(94849),BEFORE_UPDATE:i(6391),COLLISION_ACTIVE:i(96738),COLLISION_END:i(7916),COLLISION_START:i(59529),DRAG_END:i(10219),DRAG:i(183),DRAG_START:i(39143),PAUSE:i(16483),RESUME:i(35806),SLEEP_END:i(22106),SLEEP_START:i(5803)}},45949:(t,e,i)=>{t.exports={BodyBounds:i(63568),Components:i(74527),Events:i(35416),Factory:i(72653),MatterGameObject:i(3860),Image:i(7030),Matter:i(18171),MatterPhysics:i(50583),PolyDecomp:i(81084),Sprite:i(73658),TileBody:i(84720),PhysicsEditorParser:i(10998),PhysicsJSONParser:i(72829),PointerConstraint:i(88596),World:i(31468)}},84125:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(68758),h=i(84091),l=i(50658);!function(){s._timeCorrection=!0,s._inertiaScale=4,s._nextCollidingGroupId=1,s._nextNonCollidingGroupId=-1,s._nextCategory=1,s._baseDelta=1e3/60,s.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,deltaTime:1e3/60,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=n.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=n.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var s=a.extend(i,e);return t(s,e),s.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},s},s.nextGroup=function(t){return t?s._nextNonCollidingGroupId--:s._nextCollidingGroupId++},s.nextCategory=function(){return s._nextCategory=s._nextCategory<<1,s._nextCategory};var t=function(t,e){if(e=e||{},s.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||r.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t}),n.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(t.bounds,t.vertices,t.velocity),s.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var i=t.bounds,o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};s.set=function(t,e,i){var n;for(n in"string"==typeof e&&(n=e,(e={})[n]=i),e)if(Object.prototype.hasOwnProperty.call(e,n))switch(i=e[n],n){case"isStatic":s.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":s.setMass(t,i);break;case"density":s.setDensity(t,i);break;case"inertia":s.setInertia(t,i);break;case"vertices":s.setVertices(t,i);break;case"position":s.setPosition(t,i);break;case"angle":s.setAngle(t,i);break;case"velocity":s.setVelocity(t,i);break;case"angularVelocity":s.setAngularVelocity(t,i);break;case"speed":s.setSpeed(t,i);break;case"angularSpeed":s.setAngularSpeed(t,i);break;case"parts":s.setParts(t,i);break;case"centre":s.setCentre(t,i);break;default:t[n]=i}},s.setStatic=function(t,e){for(var i=0;i0&&r.rotateAbout(a.position,s,t.position,a.position)}},s.setVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.positionPrev.x=t.position.x-e.x*i,t.positionPrev.y=t.position.y-e.y*i,t.velocity.x=(t.position.x-t.positionPrev.x)/i,t.velocity.y=(t.position.y-t.positionPrev.y)/i,t.speed=r.magnitude(t.velocity)},s.getVelocity=function(t){var e=s._baseDelta/t.deltaTime;return{x:(t.position.x-t.positionPrev.x)*e,y:(t.position.y-t.positionPrev.y)*e}},s.getSpeed=function(t){return r.magnitude(s.getVelocity(t))},s.setSpeed=function(t,e){s.setVelocity(t,r.mult(r.normalise(s.getVelocity(t)),e))},s.setAngularVelocity=function(t,e){var i=t.deltaTime/s._baseDelta;t.anglePrev=t.angle-e*i,t.angularVelocity=(t.angle-t.anglePrev)/i,t.angularSpeed=Math.abs(t.angularVelocity)},s.getAngularVelocity=function(t){return(t.angle-t.anglePrev)*s._baseDelta/t.deltaTime},s.getAngularSpeed=function(t){return Math.abs(s.getAngularVelocity(t))},s.setAngularSpeed=function(t,e){s.setAngularVelocity(t,a.sign(s.getAngularVelocity(t))*e)},s.translate=function(t,e,i){s.setPosition(t,r.add(t.position,e),i)},s.rotate=function(t,e,i,n){if(i){var r=Math.cos(e),o=Math.sin(e),a=t.position.x-i.x,h=t.position.y-i.y;s.setPosition(t,{x:i.x+(a*r-h*o),y:i.y+(a*o+h*r)},n),s.setAngle(t,t.angle+e,n)}else s.setAngle(t,t.angle+e,n)},s.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(s.setMass(t,t.density*o),s.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},s.update=function(t,e){var i=(e=(void 0!==e?e:1e3/60)*t.timeScale)*e,o=s._timeCorrection?e/(t.deltaTime||e):1,u=1-t.frictionAir*(e/a._baseDelta),c=(t.position.x-t.positionPrev.x)*o,d=(t.position.y-t.positionPrev.y)*o;t.velocity.x=c*u+t.force.x/t.mass*i,t.velocity.y=d*u+t.force.y/t.mass*i,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.deltaTime=e,t.angularVelocity=(t.angle-t.anglePrev)*u*o+t.torque/t.inertia*i,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var f=0;f0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(n.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),f>0&&r.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},s.updateVelocities=function(t){var e=s._baseDelta/t.deltaTime,i=t.velocity;i.x=(t.position.x-t.positionPrev.x)*e,i.y=(t.position.y-t.positionPrev.y)*e,t.speed=Math.sqrt(i.x*i.x+i.y*i.y),t.angularVelocity=(t.angle-t.anglePrev)*e,t.angularSpeed=Math.abs(t.angularVelocity)},s.applyForce=function(t,e,i){var s=e.x-t.position.x,n=e.y-t.position.y;t.force.x+=i.x,t.force.y+=i.y,t.torque+=s*i.y-n*i.x},s._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i{var s={};t.exports=s;var n=i(39073),r=i(68758),o=i(84091),a=i(84125);s.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},t)},s.setModified=function(t,e,i,r){if(n.trigger(t,"compositeModified",t),t.isModified=e,e&&t.cache&&(t.cache.allBodies=null,t.cache.allConstraints=null,t.cache.allComposites=null),i&&t.parent&&s.setModified(t.parent,e,i,r),r)for(var o=0;o{var s={};t.exports=s;var n=i(11299);s.create=n.create,s.add=n.add,s.remove=n.remove,s.clear=n.clear,s.addComposite=n.addComposite,s.addBody=n.addBody,s.addConstraint=n.addConstraint},63454:(t,e,i)=>{var s={};t.exports=s;var n,r,o,a=i(39745),h=i(70584);n=[],r={overlap:0,axis:null},o={overlap:0,axis:null},s.create=function(t,e){return{pair:null,collided:!1,bodyA:t,bodyB:e,parentA:t.parent,parentB:e.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},s.collides=function(t,e,i){if(s._overlapAxes(r,t.vertices,e.vertices,t.axes),r.overlap<=0)return null;if(s._overlapAxes(o,e.vertices,t.vertices,e.axes),o.overlap<=0)return null;var n,l,u=i&&i.table[h.id(t,e)];u?n=u.collision:((n=s.create(t,e)).collided=!0,n.bodyA=t.idS?S=a:aA?A=a:an?n=o:o{var e={};t.exports=e,e.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}},13657:(t,e,i)=>{var s={};t.exports=s;var n=i(68758),r=i(63454);s.create=function(t){return n.extend({bodies:[],pairs:null},t)},s.setBodies=function(t,e){t.bodies=e.slice(0)},s.clear=function(t){t.bodies=[]},s.collisions=function(t){var e,i,n=[],o=t.pairs,a=t.bodies,h=a.length,l=s.canCollide,u=r.collides;for(a.sort(s._compareBoundsX),e=0;ef)break;if(!(pC.max.y)&&(!v||!x.isStatic&&!x.isSleeping)&&l(c.collisionFilter,x.collisionFilter)){var T=x.parts.length;if(y&&1===T)(A=u(c,x,o))&&n.push(A);else for(var w=T>1?1:0,b=m>1?1:0;bC.max.x||d.max.xC.max.y||(A=u(E,_,o))&&n.push(A)}}}}return n},s.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)},s._compareBoundsX=function(t,e){return t.bounds.min.x-e.bounds.min.x}},70584:(t,e,i)=>{var s={};t.exports=s;var n=i(17319);s.create=function(t,e){var i=t.bodyA,n=t.bodyB,r={id:s.id(i,n),bodyA:i,bodyB:n,collision:t,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:i.isSensor||n.isSensor,timeCreated:e,timeUpdated:e,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return s.update(r,t,e),r},s.update=function(t,e,i){var s=t.contacts,r=e.supports,o=t.activeContacts,a=e.parentA,h=e.parentB,l=a.vertices.length;t.isActive=!0,t.timeUpdated=i,t.collision=e,t.separation=e.depth,t.inverseMass=a.inverseMass+h.inverseMass,t.friction=a.frictionh.frictionStatic?a.frictionStatic:h.frictionStatic,t.restitution=a.restitution>h.restitution?a.restitution:h.restitution,t.slop=a.slop>h.slop?a.slop:h.slop,e.pair=t,o.length=0;for(var u=0;u{var s={};t.exports=s;var n=i(70584),r=i(68758);s.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},s.update=function(t,e,i){var s,r,o,a,h=t.list,l=h.length,u=t.table,c=e.length,d=t.collisionStart,f=t.collisionEnd,p=t.collisionActive;for(d.length=0,f.length=0,p.length=0,a=0;a{var s={};t.exports=s;var n=i(10438),r=i(63454),o=i(84091),a=i(68516),h=i(39745);s.collides=function(t,e){for(var i=[],s=e.length,n=t.bounds,a=r.collides,h=o.overlaps,l=0;l{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84091);s._restingThresh=2,s._restingThreshTangent=Math.sqrt(6),s._positionDampen=.9,s._positionWarming=.8,s._frictionNormalMultiplier=5,s._frictionMaxStatic=Number.MAX_VALUE,s.preSolvePosition=function(t){var e,i,s,n=t.length;for(e=0;eV?(n=Y>0?Y:-Y,(i=g.friction*(Y>0?1:-1)*l)<-n?i=-n:i>n&&(i=n)):(i=Y,n=f);var W=L*b-F*w,H=D*b-k*w,j=C/(M+m.inverseInertia*W*W+y.inverseInertia*H*H),q=(1+g.restitution)*X*j;if(i*=j,X0&&(P.normalImpulse=0),q=P.normalImpulse-K}if(Y<-c||Y>c)P.tangentImpulse=0;else{var Z=P.tangentImpulse;P.tangentImpulse+=i,P.tangentImpulse<-n&&(P.tangentImpulse=-n),P.tangentImpulse>n&&(P.tangentImpulse=n),i=P.tangentImpulse-Z}var J=w*q+E*i,Q=b*q+S*i;m.isStatic||m.isSleeping||(m.positionPrev.x+=J*m.inverseMass,m.positionPrev.y+=Q*m.inverseMass,m.anglePrev+=(L*Q-F*J)*m.inverseInertia),y.isStatic||y.isSleeping||(y.positionPrev.x-=J*y.inverseMass,y.positionPrev.y-=Q*y.inverseMass,y.anglePrev-=(D*Q-k*J)*y.inverseInertia)}}}}},52838:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(10438),o=i(22806),a=i(84091),h=i(50658),l=i(68758);s._warming=.4,s._torqueDampen=1,s._minLength=1e-6,s.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?r.add(e.bodyA.position,e.pointA):e.pointA,s=e.bodyB?r.add(e.bodyB.position,e.pointB):e.pointB,n=r.magnitude(r.sub(i,s));e.length=void 0!==e.length?e.length:n,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},s.preSolveAll=function(t){for(var e=0;e=1||0===t.length?t.stiffness*e:t.stiffness*e*e,x=t.damping*e,T=r.mult(u,m*y),w=(i?i.inverseMass:0)+(n?n.inverseMass:0),b=w+((i?i.inverseInertia:0)+(n?n.inverseInertia:0));if(x>0){var E=r.create();p=r.div(u,c),v=r.sub(n&&r.sub(n.position,n.positionPrev)||E,i&&r.sub(i.position,i.positionPrev)||E),g=r.dot(p,v)}i&&!i.isStatic&&(f=i.inverseMass/w,i.constraintImpulse.x-=T.x*f,i.constraintImpulse.y-=T.y*f,i.position.x-=T.x*f,i.position.y-=T.y*f,x>0&&(i.positionPrev.x-=x*p.x*g*f,i.positionPrev.y-=x*p.y*g*f),d=r.cross(o,T)/b*s._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),n&&!n.isStatic&&(f=n.inverseMass/w,n.constraintImpulse.x+=T.x*f,n.constraintImpulse.y+=T.y*f,n.position.x+=T.x*f,n.position.y+=T.y*f,x>0&&(n.positionPrev.x+=x*p.x*g*f,n.positionPrev.y+=x*p.y*g*f),d=r.cross(a,T)/b*s._torqueDampen*n.inverseInertia*(1-t.angularStiffness),n.constraintImpulse.angle+=d,n.angle+=d)}}},s.postSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(n.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=s._warming,l.x*=s._warming,l.y*=s._warming}}},s.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),y:(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0)}},s.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0),y:(t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0)}},s.currentLength=function(t){var e=(t.bodyA?t.bodyA.position.x:0)+(t.pointA?t.pointA.x:0),i=(t.bodyA?t.bodyA.position.y:0)+(t.pointA?t.pointA.y:0),s=e-((t.bodyB?t.bodyB.position.x:0)+(t.pointB?t.pointB.x:0)),n=i-((t.bodyB?t.bodyB.position.y:0)+(t.pointB?t.pointB.y:0));return Math.sqrt(s*s+n*n)}},68758:(t,e,i)=>{var s={};t.exports=s,function(){s._baseDelta=1e3/60,s._nextId=0,s._seed=0,s._nowStartTime=+new Date,s._warnedOnce={},s._decomp=null,s.extend=function(t,e){var i,n;"boolean"==typeof e?(i=2,n=e):(i=1,n=!0);for(var r=i;r0;e--){var i=Math.floor(s.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t},s.choose=function(t){return t[Math.floor(s.random()*t.length)]},s.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},s.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isFunction=function(t){return"function"==typeof t},s.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},s.isString=function(t){return"[object String]"===toString.call(t)},s.clamp=function(t,e,i){return ti?i:t},s.sign=function(t){return t<0?-1:1},s.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return Date.now?Date.now():new Date-s._nowStartTime},s.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return s._seed=(9301*s._seed+49297)%233280,s._seed/233280};s.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},s.logLevel=1,s.log=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.info=function(){console&&s.logLevel>0&&s.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warn=function(){console&&s.logLevel>0&&s.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},s.warnOnce=function(){var t=Array.prototype.slice.call(arguments).join(" ");s._warnedOnce[t]||(s.warn(t),s._warnedOnce[t]=!0)},s.deprecated=function(t,e,i){t[e]=s.chain((function(){s.warnOnce("🔅 deprecated 🔅",i)}),t[e])},s.nextId=function(){return s._nextId++},s.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i{var s={};t.exports=s;var n=i(22806),r=i(44272),o=i(13657),a=i(91327),h=i(39073),l=i(11299),u=i(52838),c=i(68758),d=i(84125);s.create=function(t){t=t||{};var e=c.extend({positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},gravity:{x:0,y:1,scale:.001},timing:{timestamp:0,timeScale:1,lastDelta:0,lastElapsed:0}},t);return e.world=t.world||l.create({label:"World"}),e.pairs=t.pairs||a.create(),e.detector=t.detector||o.create(),e.grid={buckets:[]},e.world.gravity=e.gravity,e.broadphase=e.grid,e.metrics={},e},s.update=function(t,e){var i,d=c.now(),f=t.world,p=t.detector,g=t.pairs,v=t.timing,m=v.timestamp;e=void 0!==e?e:c._baseDelta,e*=v.timeScale,v.timestamp+=e,v.lastDelta=e;var y={timestamp:v.timestamp,delta:e};h.trigger(t,"beforeUpdate",y);var x=l.allBodies(f),T=l.allConstraints(f);for(f.isModified&&(o.setBodies(p,x),l.setModified(f,!1,!1,!0)),t.enableSleeping&&n.update(x,e),s._bodiesApplyGravity(x,t.gravity),e>0&&s._bodiesUpdate(x,e),h.trigger(t,"beforeSolve",y),u.preSolveAll(x),i=0;i0&&h.trigger(t,"collisionStart",{pairs:g.collisionStart,timestamp:v.timestamp,delta:e});var b=c.clamp(20/t.positionIterations,0,1);for(r.preSolvePosition(g.list),i=0;i0&&h.trigger(t,"collisionActive",{pairs:g.collisionActive,timestamp:v.timestamp,delta:e}),g.collisionEnd.length>0&&h.trigger(t,"collisionEnd",{pairs:g.collisionEnd,timestamp:v.timestamp,delta:e}),s._bodiesClearForces(x),h.trigger(t,"afterUpdate",y),t.timing.lastElapsed=c.now()-d,t},s.merge=function(t,e){if(c.extend(t,e),e.world){t.world=e.world,s.clear(t);for(var i=l.allBodies(t.world),r=0;r{var s={};t.exports=s;var n=i(68758);s.on=function(t,e,i){for(var s,n=e.split(" "),r=0;r0){i||(i={}),s=e.split(" ");for(var l=0;l{var s={};t.exports=s;var n=i(84474),r=i(68758);s.name="matter-js",s.version="0.19.0",s.uses=[],s.used=[],s.use=function(){n.use(s,Array.prototype.slice.call(arguments))},s.before=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathBefore(s,t,e)},s.after=function(t,e){return t=t.replace(/^Matter./,""),r.chainPathAfter(s,t,e)}},84474:(t,e,i)=>{var s={};t.exports=s;var n=i(68758);s._registry={},s.register=function(t){if(s.isPlugin(t)||n.warn("Plugin.register:",s.toString(t),"does not implement all required fields."),t.name in s._registry){var e=s._registry[t.name],i=s.versionParse(t.version).number,r=s.versionParse(e.version).number;i>r?(n.warn("Plugin.register:",s.toString(e),"was upgraded to",s.toString(t)),s._registry[t.name]=t):i-1},s.isFor=function(t,e){var i=t.for&&s.dependencyParse(t.for);return!t.for||e.name===i.name&&s.versionSatisfies(e.version,i.range)},s.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=s.dependencies(t),r=n.topologicalSort(i),o=[],a=0;a0&&!h.silent&&n.info(o.join(" "))}else n.warn("Plugin.use:",s.toString(t),"does not specify any dependencies to install.")},s.dependencies=function(t,e){var i=s.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=s.resolve(t)||t,e[r]=n.map(t.uses||[],(function(e){s.isPlugin(e)&&s.register(e);var r=s.dependencyParse(e),o=s.resolve(e);return o&&!s.versionSatisfies(o.version,r.range)?(n.warn("Plugin.dependencies:",s.toString(o),"does not satisfy",s.toString(r),"used by",s.toString(i)+"."),o._warned=!0,t._warned=!0):o||(n.warn("Plugin.dependencies:",s.toString(e),"used by",s.toString(i),"could not be resolved."),t._warned=!0),r.name}));for(var o=0;o=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;e.test(t)||n.warn("Plugin.versionParse:",t,"is not a valid version or range.");var i=e.exec(t),s=Number(i[4]),r=Number(i[5]),o=Number(i[6]);return{isRange:Boolean(i[1]||i[2]),version:i[3],range:t,operator:i[1]||i[2]||"",major:s,minor:r,patch:o,parts:[s,r,o],prerelease:i[7],number:1e8*s+1e4*r+o}},s.versionSatisfies=function(t,e){e=e||"*";var i=s.versionParse(e),n=s.versionParse(t);if(i.isRange){if("*"===i.operator||"*"===t)return!0;if(">"===i.operator)return n.number>i.number;if(">="===i.operator)return n.number>=i.number;if("~"===i.operator)return n.major===i.major&&n.minor===i.minor&&n.patch>=i.patch;if("^"===i.operator)return i.major>0?n.major===i.major&&n.number>=i.number:i.minor>0?n.minor===i.minor&&n.patch>=i.patch:n.patch===i.patch}return t===e||"*"===t}},22806:(t,e,i)=>{var s={};t.exports=s;var n=i(84125),r=i(39073),o=i(68758);s._motionWakeThreshold=.18,s._motionSleepThreshold=.08,s._minBias=.9,s.update=function(t,e){for(var i=e/o._baseDelta,r=s._motionSleepThreshold,a=0;a0&&h.motion=h.sleepThreshold/i&&s.set(h,!0)):h.sleepCounter>0&&(h.sleepCounter-=1)}else s.set(h,!1)}},s.afterCollisions=function(t){for(var e=s._motionSleepThreshold,i=0;ie&&s.set(h,!1)}}}},s.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||r.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&r.trigger(t,"sleepEnd"))}},68516:(t,e,i)=>{var s={};t.exports=s;var n=i(39745),r=i(68758),o=i(84125),a=i(84091),h=i(10438);s.rectangle=function(t,e,i,s,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:n.fromPath("L 0 0 L "+i+" 0 L "+i+" "+s+" L 0 "+s)};if(a.chamfer){var l=a.chamfer;h.vertices=n.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},s.trapezoid=function(t,e,i,s,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-s+" L "+c+" "+-s+" L "+d+" 0":"L 0 0 L "+c+" "+-s+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:n.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=n.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},s.circle=function(t,e,i,n,o){n=n||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),s.polygon(t,e,h,i,r.extend({},a,n))},s.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return s.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&n.area(_)1?(p=o.create(r.extend({parts:g.slice(0)},s)),o.setPosition(p,{x:t,y:e}),p):g[0]},s.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i{var s={};t.exports=s;var n=i(11299),r=i(52838),o=i(68758),a=i(84125),h=i(68516);s.stack=function(t,e,i,s,r,o,h){for(var l,u=n.create({label:"Stack"}),c=t,d=e,f=0,p=0;pg&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,n.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},s.chain=function(t,e,i,s,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],n.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),s&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,s,o,l,u,c)}))},s.newtonsCradle=function(t,e,i,s,o){for(var a=n.create({label:"Newtons Cradle"}),l=0;l{var s={};t.exports=s;var n=i(10438),r=i(68758);s.fromVertices=function(t){for(var e={},i=0;i{var e={};t.exports=e,e.create=function(t){var i={min:{x:0,y:0},max:{x:0,y:0}};return t&&e.update(i,t),i},e.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var s=0;st.max.x&&(t.max.x=n.x),n.xt.max.y&&(t.max.y=n.y),n.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},e.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},e.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},e.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},e.shift=function(t,e){var i=t.max.x-t.min.x,s=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+s}},92765:(t,e,i)=>{var s={};t.exports=s,i(84091);var n=i(68758);s.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||n.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,r,o,a,h,l,u,c,d,f,p,g=[],v=0,m=0,y=0;e=e||15;var x=function(t,e,i){var s=i%2==1&&i>1;if(!d||t!=d.x||e!=d.y){d&&s?(f=d.x,p=d.y):(f=0,p=0);var n={x:f+t,y:p+e};!s&&d||(d=n),g.push(n),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(s._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i{var e={};t.exports=e,e.create=function(t,e){return{x:t||0,y:e||0}},e.clone=function(t){return{x:t.x,y:t.y}},e.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},e.rotate=function(t,e,i){var s=Math.cos(e),n=Math.sin(e);i||(i={});var r=t.x*s-t.y*n;return i.y=t.x*n+t.y*s,i.x=r,i},e.rotateAbout=function(t,e,i,s){var n=Math.cos(e),r=Math.sin(e);s||(s={});var o=i.x+((t.x-i.x)*n-(t.y-i.y)*r);return s.y=i.y+((t.x-i.x)*r+(t.y-i.y)*n),s.x=o,s},e.normalise=function(t){var i=e.magnitude(t);return 0===i?{x:0,y:0}:{x:t.x/i,y:t.y/i}},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.cross=function(t,e){return t.x*e.y-t.y*e.x},e.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},e.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},e.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},e.mult=function(t,e){return{x:t.x*e,y:t.y*e}},e.div=function(t,e){return{x:t.x/e,y:t.y/e}},e.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},e.neg=function(t){return{x:-t.x,y:-t.y}},e.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e._temp=[e.create(),e.create(),e.create(),e.create(),e.create(),e.create()]},39745:(t,e,i)=>{var s={};t.exports=s;var n=i(10438),r=i(68758);s.create=function(t,e){for(var i=[],s=0;s0)return!1;o=i}return!0},s.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||s.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},s.hull=function(t){var e,i,s=[],r=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&n.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];s.length>=2&&n.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}return s.pop(),r.pop(),s.concat(r)}},1675:(t,e,i)=>{var s=i(18171),n={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Body.create",(function(){n.Body.init(this)})),t.before("Engine.update",(function(t){n.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=s.Composite.allBodies(t.world),i=0;i0)for(var o=0;o{t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,s,e),s.gameObject&&s.gameObject.emit("collide",s,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(s,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),s.onCollideCallback&&s.onCollideCallback(e),i.onCollideWith[s.id]&&i.onCollideWith[s.id](s,e),s.onCollideWith[i.id]&&s.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,s,e),s.gameObject&&s.gameObject.emit("collideActive",s,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(s,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),s.onCollideActiveCallback&&s.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,s=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,s,e),s.gameObject&&s.gameObject.emit("collideEnd",s,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(s,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),s.onCollideEndCallback&&s.onCollideEndCallback(e)}))}))}))}}},44097:(t,e,i)=>{var s=i(18171),n={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(t){t.after("Engine.update",(function(){n.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=s.Composite.allBodies(e),r=s.Composite.allComposites(e),o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?s=e.min.y-t.max.y:t.max.y{function e(t,e,i){i=i||0;var s,n,r,o,a,h,l,u=[0,0];return s=t[1][1]-t[0][1],n=t[0][0]-t[1][0],r=s*t[0][0]+n*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],E(l=s*a-o*n,0,i)||(u[0]=(a*r-n*h)/l,u[1]=(s*h-o*r)/l),u}function i(t,e,i,s){var n=e[0]-t[0],r=e[1]-t[1],o=s[0]-i[0],a=s[1]-i[1];if(o*r-a*n==0)return!1;var h=(n*(i[1]-t[1])+r*(t[0]-i[0]))/(o*r-a*n),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*n-o*r);return h>=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function n(t,e,i){return s(t,e,i)>0}function r(t,e,i){return s(t,e,i)>=0}function o(t,e,i){return s(t,e,i)<0}function a(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=T(t);return e.length>0?w(t,e):[t]},quickDecomp:function t(e,i,s,h,l,u,g){u=u||100,g=g||0,l=l||25,i=void 0!==i?i:[],s=s||[],h=h||[];var v=[0,0],m=[0,0],x=[0,0],T=0,w=0,E=0,S=0,A=0,_=0,C=0,M=[],R=[],P=e,O=e;if(O.length<3)return i;if(++g>u)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;LA&&(A+=e.length),S=Number.MAX_VALUE,A<_)return i;for(F=_;F<=A;++F)r(d(P,L-1),d(P,L),d(P,F))&&a(d(P,L+1),d(P,L),d(P,F))&&(E=c(d(P,L),d(P,F)))3&&s>=0;--s)u(d(t,s-1),d(t,s),d(t,s+1),e)&&(t.splice(s%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var s=t[i],n=i-1;n>=0;--n)S(s,t[n],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,s=1;si[e][0])&&(e=s);return!n(d(t,e-1),d(t,e),d(t,e+1))&&(function(t){for(var e=[],i=t.length,s=0;s!==i;s++)e.push(t.pop());for(s=0;s!==i;s++)t[s]=e[s]}(t),!0)}};var h=[],l=[];function u(t,e,i,n){if(n){var r=h,o=l;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],u=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(u*c)){var s=new(i(56694))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=s},18360:t=>{t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},91963:t=>{var e={},i={},s={register:function(t,i,s,n){void 0===n&&(n=!1),e[t]={plugin:i,mapping:s,custom:n}},registerCustom:function(t,e,s,n){i[t]={plugin:e,mapping:s,data:n}},hasCore:function(t){return e.hasOwnProperty(t)},hasCustom:function(t){return i.hasOwnProperty(t)},getCore:function(t){return e[t]},getCustom:function(t){return i[t]},getCustomClass:function(t){return i.hasOwnProperty(t)?i[t].plugin:null},remove:function(t){e.hasOwnProperty(t)&&delete e[t]},removeCustom:function(t){i.hasOwnProperty(t)&&delete i[t]},destroyCorePlugins:function(){for(var t in e)e.hasOwnProperty(t)&&delete e[t]},destroyCustomPlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]}};t.exports=s},49274:(t,e,i)=>{var s=i(56694),n=i(97081),r=i(6659),o=i(76846),a=i(99325),h=i(61286),l=i(72632),u=i(91963),c=i(66458),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(n.BOOT,this.boot,this)},boot:function(){var t,e,i,s,r,o,a,h=this.game.config,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t{var s=i(88257),n=i(56694),r=i(7599),o=new n({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)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},45615:(t,e,i)=>{t.exports={BasePlugin:i(88257),DefaultPlugins:i(18360),PluginCache:i(91963),PluginManager:i(49274),ScenePlugin:i(39283)}},75205:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(t){const e=performance.now(),i=this.getVideoPlaybackQuality(),s=this.mozPresentedFrames||this.mozPaintedFrames||i.totalVideoFrames-i.droppedVideoFrames,n=(r,o)=>{const a=this.getVideoPlaybackQuality(),h=this.mozPresentedFrames||this.mozPaintedFrames||a.totalVideoFrames-a.droppedVideoFrames;if(h>s){const s=this.mozFrameDelay||a.totalFrameDelay-i.totalFrameDelay||0,n=o-r;t(o,{presentationTime:o+1e3*s,expectedDisplayTime:o+n,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+n/1e3,presentedFrames:h,processingDuration:s}),delete this._rvfcpolyfillmap[e]}else this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(o,t)))};return this._rvfcpolyfillmap[e]=requestAnimationFrame((t=>n(e,t))),e},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(t){cancelAnimationFrame(this._rvfcpolyfillmap[t]),delete this._rvfcpolyfillmap[t]})},95723:t=>{t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},27394:t=>{t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},91135:(t,e,i)=>{var s=i(89787),n=i(61840),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(32834),u=i(40444),c=i(38203),d=i(69360),f=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized,willReadFrequently:!1};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(c.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(u.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,s=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&(t.clearRect(0,0,i,s),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,s))),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var n=e.length;this.emit(h.RENDER,t,i);var r=i.x,o=i.y,a=i.width,l=i.height,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(r,o,a,l),u.clip()),i.emit(s.PRE_RENDER,i),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(r,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=n,i.renderToTexture&&i.emit(s.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d=0?m=-(m+c):m<0&&(m=Math.abs(m)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var T=1,w=1;t.flipX&&(f||(m+=-e.realWidth+2*g),T=-1),t.flipY&&(f||(y+=-e.realHeight+2*v),w=-1);var b=t.x,E=t.y;a.applyITRS(b,E,t.rotation,t.scaleX*T,t.scaleY*w),o.copyFrom(i.matrix),s?(o.multiplyWithOffset(s,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=b,a.f=E):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),i.roundPixels&&(o.e=Math.round(o.e),o.f=Math.round(o.f)),r.save(),o.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=n,r.imageSmoothingEnabled=!e.source.scaleMode,t.mask&&t.mask.preRenderCanvas(this,t,i),c>0&&d>0&&(i.roundPixels?r.drawImage(e.source.image,l,u,c,d,Math.round(m),Math.round(y),Math.round(c/p),Math.round(d/p)):r.drawImage(e.source.image,l,u,c,d,m,y,c/p,d/p)),t.mask&&t.mask.postRenderCanvas(this,t,i),r.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=f},6046:(t,e,i)=>{t.exports={CanvasRenderer:i(91135),GetBlendModes:i(32834),SetTransform:i(49584)}},32834:(t,e,i)=>{var s=i(95723),n=i(98581);t.exports=function(){var t=[],e=n.supportNewBlendModes,i="source-over";return t[s.NORMAL]=i,t[s.ADD]="lighter",t[s.MULTIPLY]=e?"multiply":i,t[s.SCREEN]=e?"screen":i,t[s.OVERLAY]=e?"overlay":i,t[s.DARKEN]=e?"darken":i,t[s.LIGHTEN]=e?"lighten":i,t[s.COLOR_DODGE]=e?"color-dodge":i,t[s.COLOR_BURN]=e?"color-burn":i,t[s.HARD_LIGHT]=e?"hard-light":i,t[s.SOFT_LIGHT]=e?"soft-light":i,t[s.DIFFERENCE]=e?"difference":i,t[s.EXCLUSION]=e?"exclusion":i,t[s.HUE]=e?"hue":i,t[s.SATURATION]=e?"saturation":i,t[s.COLOR]=e?"color":i,t[s.LUMINOSITY]=e?"luminosity":i,t[s.ERASE]="destination-out",t[s.SOURCE_IN]="source-in",t[s.SOURCE_OUT]="source-out",t[s.SOURCE_ATOP]="source-atop",t[s.DESTINATION_OVER]="destination-over",t[s.DESTINATION_IN]="destination-in",t[s.DESTINATION_OUT]="destination-out",t[s.DESTINATION_ATOP]="destination-atop",t[s.LIGHTER]="lighter",t[s.COPY]="copy",t[s.XOR]="xor",t}},49584:(t,e,i)=>{var s=i(73329);t.exports=function(t,e,i,n,r){var o=n.alpha*i.alpha;if(o<=0)return!1;var a=s(i,n,r).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=i.frame?!i.frame.source.scaleMode:t.antialias,!0}},70936:t=>{t.exports="postrender"},99298:t=>{t.exports="prerender"},7743:t=>{t.exports="render"},99519:t=>{t.exports="resize"},81044:(t,e,i)=>{t.exports={POST_RENDER:i(70936),PRE_RENDER:i(99298),RENDER:i(7743),RESIZE:i(99519)}},42069:(t,e,i)=>{t.exports={Canvas:i(6046),Events:i(81044),Snapshot:i(95528),WebGL:i(55478)}},61840:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=Math.floor(r(e,"width",t.width)),c=Math.floor(r(e,"height",t.height));if(r(e,"getPixel",!1)){var d=t.getContext("2d",{willReadFrequently:!1}).getImageData(h,l,1,1).data;i.call(null,new n(d[0],d[1],d[2],d[3]))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=s.createWebGL(this,u,c),p=f.getContext("2d",{willReadFrequently:!0});u>0&&c>0&&p.drawImage(t,h,l,u,c,0,0,u,c);var g=new Image;g.onerror=function(){i.call(null),s.remove(f)},g.onload=function(){i.call(null,g),s.remove(f)},g.src=f.toDataURL(o,a)}else{var v=new Image;v.onerror=function(){i.call(null)},v.onload=function(){i.call(null,v)},v.src=t.toDataURL(o,a)}}},1217:(t,e,i)=>{var s=i(61068),n=i(27119),r=i(72632);t.exports=function(t,e){var i=t,o=r(e,"callback"),a=r(e,"type","image/png"),h=r(e,"encoder",.92),l=Math.abs(Math.round(r(e,"x",0))),u=Math.abs(Math.round(r(e,"y",0))),c=r(e,"getPixel",!1),d=r(e,"isFramebuffer",!1),f=d?r(e,"bufferWidth",1):i.drawingBufferWidth,p=d?r(e,"bufferHeight",1):i.drawingBufferHeight;if(c){var g=new Uint8Array(4),v=d?u:p-u;i.readPixels(l,v,1,1,i.RGBA,i.UNSIGNED_BYTE,g),o.call(null,new n(g[0],g[1],g[2],g[3]))}else{var m=Math.floor(r(e,"width",f)),y=Math.floor(r(e,"height",p)),x=m*y*4,T=new Uint8Array(x);i.readPixels(l,p-u-y,m,y,i.RGBA,i.UNSIGNED_BYTE,T);for(var w=s.createWebGL(this,m,y),b=w.getContext("2d",{willReadFrequently:!0}),E=b.getImageData(0,0,m,y),S=E.data,A=0;A{t.exports={Canvas:i(61840),WebGL:i(1217)}},35217:(t,e,i)=>{var s=i(56694),n=i(65641),r=i(33885),o=i(77290),a=i(72632),h=i(37410),l=i(82127),u=i(5583),c=i(58136),d=i(47406),f=i(81828),p=i(66901),g=i(71264),v=i(77310),m=i(10919),y=i(21213),x=i(51212),T=i(60848),w=new s({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new r([[n.UTILITY_PIPELINE,T],[n.MULTI_PIPELINE,v],[n.BITMAPMASK_PIPELINE,u],[n.SINGLE_PIPELINE,x],[n.ROPE_PIPELINE,y],[n.LIGHT_PIPELINE,p],[n.POINTLIGHT_PIPELINE,m],[n.MOBILE_PIPELINE,g]]),this.postPipelineClasses=new r,this.pipelines=new r,this.default=null,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.MOBILE_PIPELINE=null,this.FX_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderTargets=[],this.maxDimension=0,this.frameInc=32,this.targetIndex=0},boot:function(t,e,i){var s=this.renderer,r=this.renderTargets;this.frameInc=Math.floor(a(t,"frameInc",32));var l,u,p=s.width,g=s.height,v=this.game.config.disablePreFX;if(this.game.config.disablePostFX||this.postPipelineClasses.setAll([[String(d.BARREL),c.Barrel],[String(d.BLOOM),c.Bloom],[String(d.BLUR),c.Blur],[String(d.BOKEH),c.Bokeh],[String(d.CIRCLE),c.Circle],[String(d.COLOR_MATRIX),c.ColorMatrix],[String(d.DISPLACEMENT),c.Displacement],[String(d.GLOW),c.Glow],[String(d.GRADIENT),c.Gradient],[String(d.PIXELATE),c.Pixelate],[String(d.SHADOW),c.Shadow],[String(d.SHINE),c.Shine],[String(d.VIGNETTE),c.Vignette],[String(d.WIPE),c.Wipe]]),!v){this.classes.set(n.FX_PIPELINE,f);for(var m=Math.min(p,g),y=Math.ceil(m/this.frameInc),x=1;x=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var s=e[i];s.active&&s.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;ithis.maxDimension)return this.targetIndex=e.length-3,e[this.targetIndex];var i=3*(l(t,this.frameInc,0,!0)-1);return this.targetIndex=i,e[i]},getSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+1]},getAltSwapRenderTarget:function(){return this.renderTargets[this.targetIndex+2]},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.default=null,this.current=null,this.previous=null}});t.exports=w},37410:(t,e,i)=>{var s=i(56694),n=i(81044),r=new s({initialize:function(t,e,i,s,n,r,o,a,h){void 0===s&&(s=1),void 0===n&&(n=0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!0),void 0===h&&(h=!0),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=s,this.minFilter=n,this.autoClear=r,this.autoResize=!0,this.hasDepthBuffer=a,this.forceClamp=h,this.resize(e,i),o?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(n.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(n.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){if((t=Math.round(t*this.scale))<=0&&(t=1),(e=Math.round(e*this.scale))<=0&&(e=1),this.autoResize&&(t!==this.width||e!==this.height)){var i=this.renderer;i.deleteFramebuffer(this.framebuffer),i.deleteTexture(this.texture),this.texture=i.createTextureFromSource(null,t,e,this.minFilter,this.forceClamp),this.framebuffer=i.createFramebuffer(t,e,this.texture,this.hasDepthBuffer),this.width=t,this.height=e}return this},willResize:function(t,e){return(t=Math.round(t*this.scale))<=0&&(t=1),(e=Math.round(e*this.scale))<=0&&(e=1),t!==this.width||e!==this.height},bind:function(t,e,i){void 0===t&&(t=!1);var s=this.renderer;if(t&&s.flush(),e&&i&&this.resize(e,i),s.pushFramebuffer(this.framebuffer,!1,!1),t&&this.adjustViewport(),this.autoClear){var n=this.renderer.gl;n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)}s.clearStencilMask()},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.off(n.RESIZE,this.resize,this),t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=r},75512:t=>{t.exports={getTintFromFloats:function(t,e,i,s){return((255&(255*s|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){var i=Math.min(16,t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));return e&&-1!==e?Math.min(i,e):i},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="",s=0;s0&&(i+="\n\telse "),s{var s=i(56694),n=i(28699),r=i(6659),o=i(18970),a=i(72632),h=i(16650),l=i(81044),u=i(37410),c=i(75512),d=i(71305),f=new s({Extends:r,initialize:function(t){r.call(this);var e=t.game,i=e.renderer,s=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=s,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=a(t,"topology",s.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.isPreFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[]},boot:function(){var t,e=this.gl,i=this.config,s=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var n=this.renderTargets,r=a(i,"renderTarget",!1);"boolean"==typeof r&&r&&(r=1);var c=s.width,d=s.height;if("number"==typeof r)for(t=0;tx&&(x=y[t].vertexSize);var T=a(i,"batchSize",s.config.batchSize);this.vertexCapacity=6*T;var w=new ArrayBuffer(this.vertexCapacity*x);this.vertexData=w,this.bytes=new Uint8Array(w),this.vertexViewF32=new Float32Array(w),this.vertexViewU32=new Uint32Array(w);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=s.createVertexBuffer(w,e.STATIC_DRAW)):this.vertexBuffer=s.createVertexBuffer(w.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=y.length-1;t>=0;t--)y[t].rebind();this.hasBooted=!0,s.on(l.RESIZE,this.resize,this),s.on(l.PRE_RENDER,this.onPreRender,this),s.on(l.RENDER,this.onRender,this),s.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e,i){var s=this.renderer;return t===this.currentShader&&s.currentProgram===this.currentShader.program||(this.flush(),this.setVertexBuffer(i)&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t),this},getShaderByName:function(t){for(var e=this.shaders,i=0;i-1&&(m=b.substring(20))}y&&x&&v.push(new d(this,m,y,x,n(T)))}this.shaders=v}return 0===this.shaders.length?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(t){return this.currentBatch={start:this.vertexCount,count:0,texture:[t],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=t,this.batch.push(this.currentBatch),0},addTextureToBatch:function(t){var e=this.currentBatch;e&&(e.texture.push(t),e.unit++,e.maxUnit++)},pushBatch:function(t){if(!this.currentBatch||this.forceZero&&t!==this.currentTexture)return this.createBatch(t);if(t===this.currentTexture)return this.currentUnit;var e=this.currentBatch,i=e.texture.indexOf(t);return-1===i?e.texture.length===this.renderer.maxTextures?this.createBatch(t):(e.unit++,e.maxUnit++,e.texture.push(t),this.currentUnit=e.unit,this.currentTexture=t,e.unit):(this.currentUnit=i,this.currentTexture=t,i)},setGameObject:function(t,e){return void 0===e&&(e=t.frame),this.pushBatch(e.source.glTexture)},shouldFlush:function(t){return void 0===t&&(t=0),this.vertexCount+t>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,s=0;s=0;i--){var s=e[i].rebind();t&&s!==t||(this.currentShader=s)}return this.activeTextures.length=0,this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},setVertexBuffer:function(t){if(void 0===t&&(t=this.vertexBuffer),t!==this.activeBuffer){var e=this.gl;return this.gl.bindBuffer(e.ARRAY_BUFFER,t),this.activeBuffer=t,!0}return!1},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,s=this.currentShader.vertexSize,n=this.topology;if(this.active){var r,a,h;this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*s));var l=this.batch,u=this.activeTextures;if(this.forceZero)for(u[0]||e.activeTexture(e.TEXTURE0),r=0;r{var s=i(66458),n=i(89787),r=i(56694),o=i(86459),a=i(6659),h=i(81044),l=i(28621),u=i(16650),c=i(72283),d=i(35217),f=i(37410),p=i(40444),g=i(38203),v=i(75512),m=i(1217),y=new r({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!0,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference,preserveDrawingBuffer:e.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.maxTextures=0,this.textureIndexes,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=c,this.contextRestoredHandler=c,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.maskSource=null,this.maskTarget=null,this.spector=null,this._debugCapture=!1,this.init(this.config)},init:function(t){var e,i=this.game,s=this.canvas,n=t.backgroundColor;if(!(e=i.config.context?i.config.context:s.getContext("webgl",t.contextCreation)||s.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),t.preventDefault()},s.addEventListener("webglcontextlost",this.contextLostHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats=[e.BYTE,e.SHORT,e.UNSIGNED_BYTE,e.UNSIGNED_SHORT,e.FLOAT],this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),this.supportedExtensions=h;var l="ANGLE_instanced_arrays";this.instancedArraysExtension=h.indexOf(l)>-1?e.getExtension(l):null;var c="OES_vertex_array_object";this.vaoExtension=h.indexOf(c)>-1?e.getExtension(c):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(n.redGL,n.greenGL,n.blueGL,n.alphaGL),-1!==["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"].indexOf(t.mipmapFilter)&&(this.mipmapFilter=e[t.mipmapFilter]),this.maxTextures=v.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];for(var f=0;f0&&s>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==s}a&&(this.flush(),r.scissor(t,n-e-s,i,s))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],s=e[1],n=e[2],r=e[3];n>0&&r>0&&t.scissor(i,this.drawingBufferHeight-s-r,n,r)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,s=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(s.equation),s.func.length>2?i.blendFuncSeparate(s.func[0],s.func[1],s.func[2],s.func[3]):i.blendFunc(s.func[0],s.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},pushFramebuffer:function(t,e,i,s,n){return t===this.currentFramebuffer?this:(this.fboStack.push(t),this.setFramebuffer(t,e,i,s,n))},setFramebuffer:function(t,e,i,s,n){if(void 0===e&&(e=!1),void 0===i&&(i=!0),void 0===s&&(s=null),void 0===n&&(n=!1),t===this.currentFramebuffer)return this;var r=this.gl,o=this.width,a=this.height;return t&&t.renderTexture&&i?(o=t.renderTexture.width,a=t.renderTexture.height):this.flush(),r.bindFramebuffer(r.FRAMEBUFFER,t),i&&r.viewport(0,0,o,a),s&&r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,s,0),n&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT)),e&&(t?(this.drawingBufferHeight=a,this.pushScissor(0,0,o,a)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t,this},popFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack;i.pop();var s=i[i.length-1];return s||(s=null),this.setFramebuffer(s,t,e),s},restoreFramebuffer:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!0);var i=this.fboStack,s=i[i.length-1];s||(s=null),this.currentFramebuffer=null,this.setFramebuffer(s,t,e)},setProgram:function(t){return t!==this.currentProgram&&(this.flush(),this.gl.useProgram(t),this.currentProgram=t,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram),this},createTextureFromSource:function(t,e,i,s,n){void 0===n&&(n=!1);var r=this.gl,a=r.NEAREST,h=r.NEAREST,u=r.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var c=l(e,i);return c&&!n&&(u=r.REPEAT),s===o.ScaleModes.LINEAR&&this.config.antialias&&(a=c&&this.mipmapFilter?this.mipmapFilter:r.LINEAR,h=r.LINEAR),t&&t.compressed&&(a=r.LINEAR,h=r.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,a,h,u,u,r.RGBA,t):this.createTexture2D(0,a,h,u,u,r.RGBA,null,e,i)},createTexture2D:function(t,e,i,s,n,r,o,a,h,u,c,d){u=null==u||u,void 0===c&&(c=!1),void 0===d&&(d=!1);var f=this.gl,p=f.createTexture();f.activeTexture(f.TEXTURE0);var g=f.getParameter(f.TEXTURE_BINDING_2D);f.bindTexture(f.TEXTURE_2D,p),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,e),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,i),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,n),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,s),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d&&f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!0);var v=!1;if(null==o)f.texImage2D(f.TEXTURE_2D,t,r,a,h,0,r,f.UNSIGNED_BYTE,null),v=l(a,h);else if(o.compressed){a=o.width,h=o.height,v=o.generateMipmap;for(var m=0;m0&&this.pipelines.setMulti().drawFillRect(e,i,s,r,v.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var s=this.pipelines.setMulti();e.postRenderWebGL(s,v.getTintFromFloats),i.postRenderWebGL(s,v.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(n.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var s=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===s)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var n=this.currentMask,r=0;r0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),i&&s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!0),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.gl,n=s.NEAREST,r=s.NEAREST,o=t.videoWidth,a=t.videoHeight,h=s.CLAMP_TO_EDGE,u=l(o,a);return!e&&u&&(h=s.REPEAT),this.config.antialias&&(n=u&&this.mipmapFilter?this.mipmapFilter:s.LINEAR,r=s.LINEAR),this.createTexture2D(0,n,r,h,h,s.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var s=this.gl,n=t.videoWidth,r=t.videoHeight;if(n>0&&r>0){s.activeTexture(s.TEXTURE0);var o=s.getParameter(s.TEXTURE_BINDING_2D);s.bindTexture(s.TEXTURE_2D,e),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,i),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,t),e.width=n,e.height=r,o&&s.bindTexture(s.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,s=0===e?i.LINEAR:i.NEAREST;i.activeTexture(i.TEXTURE0);var n=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,s),n&&i.bindTexture(i.TEXTURE_2D,n),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.maskTarget.destroy(),this.maskSource.destroy(),this.pipelines.destroy(),this.removeAllListeners(),this.fboStack=[],this.maskStack=[],this.extensions={},this.textureIndexes=[],this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0,this.currentMask=null,this.currentCameraMask=null}});t.exports=y},71305:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(71402),o=new s({initialize:function(t,e,i,s,n){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.fragSrc=s,this.vertSrc=i,this.program=this.renderer.createProgram(i,s),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(n),this.createUniforms()},createAttributes:function(t){var e=0,i=0,s=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(f),e.vertexAttribPointer(f,a,h,d,i,l),o.enabled=!0,o.location=f):-1!==f&&e.disableVertexAttribArray(f)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),o.location=-1)}return this},createUniforms:function(){var t,e,i,s=this.gl,n=this.program,r=this.uniforms,o=s.getProgramParameter(n,s.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),r.hasOwnProperty(e)||null!==(i=s.getUniformLocation(n,e))&&(r[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i,s){var n=this.uniforms[e];return n?((s||n.value1!==i)&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,s,n){var r=this.uniforms[e];return r?((n||r.value1!==i||r.value2!==s)&&(r.value1=i,r.value2=s,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,s),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,s,n,r){var o=this.uniforms[e];return o?((r||o.value1!==i||o.value2!==s||o.value3!==n)&&(o.value1=i,o.value2=s,o.value3=n,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,s,n),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,s,n,r,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==s||a.value3!==n||a.value4!==r)&&(a.value1=i,a.value2=s,a.value3=n,a.value4=r,this.renderer.setProgram(this.program),t.call(this.gl,a.location,i,s,n,r),this.pipeline.currentShader=this),this):this},setBoolean:function(t,e){return this.setUniform1(this.gl.uniform1i,t,Number(e))},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,s){return this.setUniform3(this.gl.uniform3f,t,e,i,s)},set4f:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4f,t,e,i,s,n)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,s){return this.setUniform3(this.gl.uniform3i,t,e,i,s)},set4i:function(t,e,i,s,n){return this.setUniform4(this.gl.uniform4i,t,e,i,s,n)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},createProgram:function(t,e){void 0===t&&(t=this.vertSrc),void 0===e&&(e=this.fragSrc);var i=this.gl;return this.program&&i.deleteProgram(this.program),this.vertSrc=t,this.fragSrc=e,this.program=this.renderer.createProgram(t,e),this.createUniforms(),this.rebind()},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},71402:t=>{t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},55478:(t,e,i)=>{var s=i(71402),n=i(98611),r={PipelineManager:i(35217),Pipelines:i(62253),RenderTarget:i(37410),Utils:i(75512),WebGLPipeline:i(44775),WebGLRenderer:i(11857),WebGLShader:i(71305)};r=n(!1,r,s),t.exports=r},5583:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(91679),o=i(89053),a=i(71402),h=i(44775),l=new s({Extends:h,initialize:function(t){t.fragShader=n(t,"fragShader",r),t.vertShader=n(t,"vertShader",o),t.batchSize=n(t,"batchSize",1),t.vertices=n(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=n(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){this.renderer.beginBitmapMask(t,i)},endMask:function(t,e,i){var s=this.gl,n=this.renderer,r=t.bitmapMask;r&&s&&(n.drawBitmapMask(r,e,this),i&&this.set2f("uResolution",i.width,i.height),this.set1i("uInvertMaskAlpha",t.invertAlpha),s.drawArrays(this.topology,0,3),i&&this.set2f("uResolution",this.width,this.height),s.bindTexture(s.TEXTURE_2D,null))}});t.exports=l},81828:(t,e,i)=>{var s=i(56694),n=i(58136),r=i(47406),o=i(72632),a=i(87228),h=i(92462),l=i(75512),u=new s({Extends:a,initialize:function(t){t.shaders=[l.setGlowQuality(h.FXGlowFrag,t.game),h.FXShadowFrag,h.FXPixelateFrag,h.FXVignetteFrag,h.FXShineFrag,h.FXBlurLowFrag,h.FXBlurMedFrag,h.FXBlurHighFrag,h.FXGradientFrag,h.FXBloomFrag,h.ColorMatrixFrag,h.FXCircleFrag,h.FXBarrelFrag,h.FXDisplacementFrag,h.FXWipeFrag,h.FXBokehFrag],a.call(this,t);var e=this.game;this.glow=new n.Glow(e),this.shadow=new n.Shadow(e),this.pixelate=new n.Pixelate(e),this.vignette=new n.Vignette(e),this.shine=new n.Shine(e),this.gradient=new n.Gradient(e),this.circle=new n.Circle(e),this.barrel=new n.Barrel(e),this.wipe=new n.Wipe(e),this.bokeh=new n.Bokeh(e);var i=[];i[r.GLOW]=this.onGlow,i[r.SHADOW]=this.onShadow,i[r.PIXELATE]=this.onPixelate,i[r.VIGNETTE]=this.onVignette,i[r.SHINE]=this.onShine,i[r.BLUR]=this.onBlur,i[r.GRADIENT]=this.onGradient,i[r.BLOOM]=this.onBloom,i[r.COLOR_MATRIX]=this.onColorMatrix,i[r.CIRCLE]=this.onCircle,i[r.BARREL]=this.onBarrel,i[r.DISPLACEMENT]=this.onDisplacement,i[r.WIPE]=this.onWipe,i[r.BOKEH]=this.onBokeh,this.fxHandlers=i,this.source,this.target,this.swap},onDraw:function(t,e,i){this.source=t,this.target=e,this.swap=i;var s=t.width,n=t.height,r=this.tempSprite,o=this.fxHandlers;if(r&&r.preFX)for(var a=r.preFX.list,h=0;h{var s=i(56694),n=i(72632),r=i(65045),o=i(77310),a=i(69360),h=i(93736),l=i(44775),u=new s({Extends:o,initialize:function(t){var e=n(t,"fragShader",r);t.fragShader=e.replace("%LIGHT_COUNT%",t.game.renderer.config.maxLights),o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap,this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new h,this._tempMatrix=new a,this._tempMatrix2=new a},boot:function(){l.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e}},onRender:function(t,e){var i=t.sys.lights;if(this.lightsActive=!1,i&&i.active){var s,n=i.getLights(e),r=n.length;this.lightsActive=!0;var o=this.renderer.height,a=e.matrix,h=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",e.x,e.y,e.rotation,e.zoom),this.set3f("uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),this.set1i("uLightCount",r),s=0;s0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,s=Math.cos(i),n=Math.sin(i);e[1]=n,e[3]=-n,e[0]=e[4]=s}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.whiteTexture);var s=this.getNormalMap(e);this.isNewNormalMap(t,s)&&(this.flush(),this.createBatch(t),this.addTextureToBatch(s),this.currentNormalMap=s);var n=0;return e&&e.parentContainer?n=e.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2).rotationNormalized:e&&(n=e.rotation),this.setNormalMapRotation(n),0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=e.glTexture,s=this.getNormalMap(t);if(this.isNewNormalMap(i,s)&&(this.flush(),this.createBatch(i),this.addTextureToBatch(s),this.currentNormalMap=s),t.parentContainer){var n=t.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(n.rotationNormalized)}else this.setNormalMapRotation(t.rotation);return 0},isNewNormalMap:function(t,e){return this.currentTexture!==t||this.currentNormalMap!==e},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,s,n,r,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,s,n,r,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L)},batchTextureFrame:function(t,e,i,s,n,r,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,s,n,r,a)}});t.exports=u},71264:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(71402),l=i(44775),u=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),t.forceZero=!0,r.call(this,t)},boot:function(){l.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)}});t.exports=u},77310:(t,e,i)=>{var s=i(56694),n=i(11117),r=i(72632),o=i(53787),a=i(15968),h=i(69360),l=i(75512),u=i(71402),c=i(44775),d=new s({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},boot:function(){c.prototype.boot.call(this);var t=this.renderer;this.set1iv("uMainSampler",t.textureIndexes),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)},batchSprite:function(t,e,i){this.manager.set(this,t);var s=this._tempMatrix1,n=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,u=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,u=b.v0,c=b.u1,d=b.v1,g=b.width,v=b.height,T=-y+(f=b.x),w=-x+(p=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1);var A=t.x,_=t.y;n.applyITRS(A,_,t.rotation,t.scaleX*E,t.scaleY*S),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),n.e=A,n.f=_):(n.e-=e.scrollX*t.scrollFactorX,n.f-=e.scrollY*t.scrollFactorY),s.multiply(n,r);var C=r.setQuad(T,w,T+g,w+v),M=l.getTintAppendFloatAlpha,R=e.alpha,P=M(t.tintTopLeft,R*t._alphaTL),O=M(t.tintTopRight,R*t._alphaTR),L=M(t.tintBottomLeft,R*t._alphaBL),F=M(t.tintBottomRight,R*t._alphaBR);this.shouldFlush(6)&&this.flush();var D=this.setGameObject(t,o);this.manager.preBatch(t),this.currentShader.set1i("uRoundPixels",e.roundPixels),this.batchQuad(t,C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],h,u,c,d,P,O,L,F,t.tintFill,a,D),this.manager.postBatch(t)},batchTexture:function(t,e,i,s,n,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,R,P,O,L){void 0===L&&(L=!1),this.manager.set(this,t);var F=this._tempMatrix1,D=this._tempMatrix2,k=this._tempMatrix3,I=m/i+_,B=y/s+C,N=(m+x)/i+_,U=(y+T)/s+C,X=o,Y=a,z=-g,G=-v;if(t.isCropped){var V=t._crop,W=V.width,H=V.height;X=W,Y=H,o=W,a=H;var j=m=V.x,q=y=V.y;c&&(j=x-V.x-W),d&&(q=T-V.y-H),I=j/i+_,B=q/s+C,N=(j+W)/i+_,U=(q+H)/s+C,z=-g+m,G=-v+y}c&&(X*=-1,z+=o),(d^=!P&&e.isRenderTexture?1:0)&&(Y*=-1,G+=a),D.applyITRS(n,r,u,h,l),F.copyFrom(M.matrix),R?(F.multiplyWithOffset(R,-M.scrollX*f,-M.scrollY*p),D.e=n,D.f=r):(D.e-=M.scrollX*f,D.f-=M.scrollY*p),F.multiply(D,k);var K=k.setQuad(z,G,z+X,G+Y);null==O&&(O=this.setTexture2D(e)),t&&!L&&this.manager.preBatch(t),this.currentShader.set1i("uRoundPixels",M.roundPixels),this.batchQuad(t,K[0],K[1],K[2],K[3],K[4],K[5],K[6],K[7],I,B,N,U,w,b,E,S,A,e,O),t&&!L&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,s,n,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2;o?a.multiply(o,h):h=a;var u=h.setQuad(e,i,e+t.width,i+t.height),c=this.setTexture2D(t.source.glTexture);s=l.getTintAppendFloatAlpha(s,n),this.batchQuad(null,u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],t.u0,t.v0,t.u1,t.v1,s,s,s,s,0,t.glTexture,c)},batchFillRect:function(t,e,i,s,n,r){this.renderer.pipelines.set(this);var o=this.calcMatrix;r&&r.multiply(n,o);var a=o.setQuad(t,e,t+i,e+s),h=this.fillTint;this.batchQuad(null,a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],0,0,1,1,h.TL,h.TR,h.BL,h.BR,2)},batchFillTriangle:function(t,e,i,s,n,r,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,s),d=h.getY(i,s),f=h.getX(n,r),p=h.getY(n,r),g=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,l,u,c,d,f,p,0,0,1,1,g.TL,g.TR,g.BL,2)},batchStrokeTriangle:function(t,e,i,s,n,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=s,l[1].width=o,l[2].x=n,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var s=this.calcMatrix;i&&i.multiply(e,s);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d0&&X[4]?this.batchQuad(null,F,D,R,P,X[0],X[1],X[2],X[3],0,0,1,1,I,B,N,U,2):(Y[0]=F,Y[1]=D,Y[2]=R,Y[3]=P,Y[4]=1),h&&Y[4]?this.batchQuad(null,C,M,O,L,Y[0],Y[1],Y[2],Y[3],0,0,1,1,I,B,N,U,2):(X[0]=C,X[1]=M,X[2]=O,X[3]=L,X[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,c.prototype.destroy.call(this),this}});t.exports=d},10919:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(83327),o=i(54677),a=i(44775),h=new s({Extends:a,initialize:function(t){t.vertShader=n(t,"vertShader",o),t.fragShader=n(t,"fragShader",r),t.attributes=n(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,s,n,r,o,a,h,l,u,c){var d=t.color,f=t.intensity,p=t.radius,g=t.attenuation,v=d.r*f,m=d.g*f,y=d.b*f,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(i,s,u,c,p,g,v,m,y,x),this.batchLightVert(n,r,u,c,p,g,v,m,y,x),this.batchLightVert(o,a,u,c,p,g,v,m,y,x),this.batchLightVert(i,s,u,c,p,g,v,m,y,x),this.batchLightVert(o,a,u,c,p,g,v,m,y,x),this.batchLightVert(h,l,u,c,p,g,v,m,y,x),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(t,e,i,s,n,r,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=s,u[++c]=n,u[++c]=r,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},80486:(t,e,i)=>{var s=i(56694),n=i(65246),r=i(72632),o=i(12569),a=i(99365),h=i(44775),l=new s({Extends:h,initialize:function(t){t.renderTarget=r(t,"renderTarget",1),t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new n,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2;var e=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",e.width,e.height),this.set1i("uRoundPixels",e.config.roundPixels);for(var i=this.renderTargets,s=0;s{var s=i(95723),n=i(79993),r=i(56694),o=i(37486),a=i(72632),h=i(77310),l=i(12569),u=i(74118),c=i(37410),d=i(85060),f=i(18166),p=i(44775),g=new r({Extends:h,initialize:function(t){var e=a(t,"fragShader",l),i=a(t,"vertShader",f),s=a(t,"drawShader",l),n=[{name:"DrawSprite",fragShader:d,vertShader:f},{name:"CopySprite",fragShader:e,vertShader:i},{name:"DrawGame",fragShader:s,vertShader:f},{name:"ColorMatrix",fragShader:o}],r=a(t,"shaders",[]);t.shaders=n.concat(r),t.vertShader||(t.vertShader=i),t.batchSize=1,h.call(this,t),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new u,this.targetBounds=new u,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){p.prototype.boot.call(this);var t=this.shaders,e=this.renderer;this.drawSpriteShader=t[0],this.copyShader=t[1],this.gameShader=t[2],this.colorMatrixShader=t[3],this.fsTarget=new c(e,e.width,e.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var i=new ArrayBuffer(168);this.quadVertexData=i,this.quadVertexViewF32=new Float32Array(i),this.quadVertexBuffer=e.createVertexBuffer(i,this.gl.STATIC_DRAW),this.onResize(e.width,e.height),this.currentShader=this.copyShader,this.set2f("uResolution",e.width,e.height),this.set1i("uRoundPixels",e.config.roundPixels)},onResize:function(t,e){var i=this.quadVertexViewF32;i[1]=e,i[22]=e,i[14]=t,i[28]=t,i[35]=t,i[36]=e},batchQuad:function(t,e,i,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x){var T=Math.min(e,s,o,h),w=Math.min(i,r,a,l),b=Math.max(e,s,o,h)-T,E=Math.max(i,r,a,l)-w,S=this.spriteBounds.setTo(T,w,b,E),A=t?t.preFX.padding:0,_=b+2*A,C=E+2*A,M=Math.abs(Math.max(_,C)),R=this.manager.getRenderTarget(M),P=this.targetBounds.setTo(0,0,R.width,R.height);n(P,S.centerX,S.centerY),this.tempSprite=t;var O=this.gl,L=this.renderer;L.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",L.width,L.height),this.set1i("uRoundPixels",L.config.roundPixels),this.flipProjectionMatrix(!0),t&&(this.onDrawSprite(t,R),t.preFX.onFX(this));var F=this.fsTarget;return this.flush(),O.viewport(0,0,L.width,L.height),O.bindFramebuffer(O.FRAMEBUFFER,F.framebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,F.texture,0),O.clearColor(0,0,0,0),O.clear(O.COLOR_BUFFER_BIT),this.setTexture2D(x),this.batchVert(e,i,u,c,0,y,p),this.batchVert(s,r,u,f,0,y,v),this.batchVert(o,a,d,f,0,y,m),this.batchVert(e,i,u,c,0,y,p),this.batchVert(o,a,d,f,0,y,m),this.batchVert(h,l,d,c,0,y,g),this.flush(),this.flipProjectionMatrix(!1),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,R.texture),O.copyTexSubImage2D(O.TEXTURE_2D,0,0,0,P.x,P.y,P.width,P.height),O.bindFramebuffer(O.FRAMEBUFFER,null),O.bindTexture(O.TEXTURE_2D,null),this.onBatch(t),this.currentShader=this.copyShader,this.onDraw(R,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(t,e,i,n,r,o,a){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===a&&(a=this.copyShader);var h=this.gl,l=this.tempSprite;o&&(a=this.colorMatrixShader),this.currentShader=a;var u=this.setVertexBuffer(this.quadVertexBuffer);a.bind(u,!1);var c=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",c.width,c.height),this.set1i("uRoundPixels",c.config.roundPixels),l.preFX.onFXCopy(this),this.onCopySprite(t,e,l),o&&(this.set1fv("uColorMatrix",o.getData()),this.set1f("uAlpha",o.alpha)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var d=e.height-t.height;h.viewport(0,d,t.width,t.height),this.resetUVs()}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture,0),i&&(h.clearColor(0,0,0,Number(!n)),h.clear(h.COLOR_BUFFER_BIT)),r){var f=this.renderer.currentBlendMode;this.renderer.setBlendMode(s.ERASE)}h.bufferData(h.ARRAY_BUFFER,this.quadVertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),r&&this.renderer.setBlendMode(f),h.bindFramebuffer(h.FRAMEBUFFER,null)},copy:function(t,e){var i=this.gl;this.set1i("uMainSampler",0),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.texture),i.viewport(0,0,t.width,t.height),this.setUVs(0,0,0,1,1,1,1,0),i.bindFramebuffer(i.FRAMEBUFFER,e.framebuffer),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e.texture,0),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.bufferData(i.ARRAY_BUFFER,this.quadVertexData,i.STATIC_DRAW),i.drawArrays(i.TRIANGLES,0,6),i.bindFramebuffer(i.FRAMEBUFFER,null)},blendFrames:function(t,e,i,s,n){this.manager.blendFrames(t,e,i,s,n)},blendFramesAdditive:function(t,e,i,s,n){this.manager.blendFramesAdditive(t,e,i,s,n)},drawToGame:function(t){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(t)},copyToGame:function(t){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(t)},bindAndDraw:function(t){var e=this.gl,i=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(t.texture);var s=this._tempMatrix1.loadIdentity(),n=this.targetBounds.x,r=this.targetBounds.y,o=n+t.width,a=r+t.height,h=s.getX(n,r),l=s.getX(n,a),u=s.getX(o,a),c=s.getX(o,r),d=s.getY(n,r),f=s.getY(n,a),p=s.getY(o,a),g=s.getY(o,r),v=16777215;this.batchVert(h,d,0,0,0,0,v),this.batchVert(l,f,0,1,0,0,v),this.batchVert(u,p,1,1,0,0,v),this.batchVert(h,d,0,0,0,0,v),this.batchVert(u,p,1,1,0,0,v),this.batchVert(c,g,1,0,0,0,v),i.restoreFramebuffer(!1,!0),i.currentFramebuffer||e.viewport(0,0,i.width,i.height),i.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(t){this.drawToGame(t)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.quadVertexViewF32;h[2]=t,h[3]=e,h[9]=i,h[10]=s,h[16]=n,h[17]=r,h[23]=t,h[24]=e,h[30]=n,h[31]=r,h[37]=o,h[38]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)},destroy:function(){return this.gl.deleteBuffer(this.quadVertexBuffer),this.drawSpriteShader=null,this.copyShader=null,this.gameShader=null,this.colorMatrixShader=null,this.quadVertexData=null,this.quadVertexBuffer=null,this.quadVertexViewF32=null,this.fsTarget=null,this.tempSprite=null,h.prototype.destroy.call(this),this}});t.exports=g},21213:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=new s({Extends:r,initialize:function(t){t.topology=5,t.batchSize=n(t,"batchSize",256),r.call(this,t)}});t.exports=o},51212:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(77310),o=i(85060),a=i(18166),h=i(44775),l=new s({Extends:r,initialize:function(t){t.fragShader=n(t,"fragShader",o),t.vertShader=n(t,"vertShader",a),t.forceZero=!0,r.call(this,t)},boot:function(){h.prototype.boot.call(this);var t=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",t.width,t.height),this.set1i("uRoundPixels",t.config.roundPixels)}});t.exports=l},60848:(t,e,i)=>{var s=i(2529),n=i(95723),r=i(56694),o=i(65246),a=i(37486),h=i(79060),l=i(72632),u=i(98921),c=i(99365),d=i(44775),f=new r({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:s},{name:"LinearBlend",fragShader:u},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,s,n){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===n&&(n=!0);var r=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),s&&(n?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blitFrame:function(t,e,i,s,r,o,a){void 0===i&&(i=1),void 0===s&&(s=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===a&&(a=!1);var h=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,t.texture),t.height>e.height)h.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var l=e.height-t.height;h.viewport(0,l,t.width,t.height)}if(h.bindFramebuffer(h.FRAMEBUFFER,e.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,e.texture,0),s&&(r?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),o){var u=this.renderer.currentBlendMode;this.renderer.setBlendMode(n.ERASE)}a&&this.flipY(),h.bufferData(h.ARRAY_BUFFER,this.vertexData,h.STATIC_DRAW),h.drawArrays(h.TRIANGLES,0,6),o&&this.renderer.setBlendMode(u),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,s,n,r,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,s,n,r),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6)},drawFrame:function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=this.colorMatrix);var n=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",s.getData()),this.set1f("uAlpha",s.alpha),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.texture),e?(n.viewport(0,0,e.width,e.height),n.bindFramebuffer(n.FRAMEBUFFER,e.framebuffer),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e.texture,0)):n.viewport(0,0,t.width,t.height),i?n.clearColor(0,0,0,0):n.clearColor(0,0,0,1),n.clear(n.COLOR_BUFFER_BIT),n.bufferData(n.ARRAY_BUFFER,this.vertexData,n.STATIC_DRAW),n.drawArrays(n.TRIANGLES,0,6),n.bindFramebuffer(n.FRAMEBUFFER,null),n.bindTexture(n.TEXTURE_2D,null)},blendFrames:function(t,e,i,s,n,r){void 0===s&&(s=1),void 0===n&&(n=!0),void 0===r&&(r=this.linearShader);var o=this.gl;this.setShader(r),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",s),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),n?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,s,n){this.blendFrames(t,e,i,s,n,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var s=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,s)},setUVs:function(t,e,i,s,n,r,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=s,h[10]=n,h[11]=r,h[14]=t,h[15]=e,h[18]=n,h[19]=r,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=f},65641:t=>{t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"}},68726:t=>{t.exports="pipelineafterflush"},67186:t=>{t.exports="pipelinebeforeflush"},22709:t=>{t.exports="pipelinebind"},74469:t=>{t.exports="pipelineboot"},93953:t=>{t.exports="pipelinedestroy"},51687:t=>{t.exports="pipelinerebind"},25034:t=>{t.exports="pipelineresize"},18970:(t,e,i)=>{t.exports={AFTER_FLUSH:i(68726),BEFORE_FLUSH:i(67186),BIND:i(22709),BOOT:i(74469),DESTROY:i(93953),REBIND:i(51687),RESIZE:i(25034)}},32469:(t,e,i)=>{var s=i(56694),n=i(87751),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e){t=this.getController(t),this.set1f("amount",t.amount,e)}});t.exports=o},2134:(t,e,i)=>{var s=i(56694),n=i(88222),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(t){t=this.getController(t),this.set1f("strength",t.blurStrength),this.set3fv("color",t.glcolor)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1,s=this.fullFrame2;this.copyFrame(t,s);for(var n=2/t.width*e.offsetX,r=2/t.height*e.offsetY,o=0;o{var s=i(56694),n=i(35491),r=i(75568),o=i(44481),a=i(80486),h=new s({Extends:a,initialize:function(t){a.call(this,{game:t,shaders:[{name:"Gaussian5",fragShader:n},{name:"Gaussian9",fragShader:r},{name:"Gaussian13",fragShader:o}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(t){var e=this.getController(),i=this.gl,s=this.fullFrame1,n=i.getParameter(i.FRAMEBUFFER_BINDING);this.bind(this.shaders[e.quality]),i.activeTexture(i.TEXTURE0),i.viewport(0,0,t.width,t.height),this.set1i("uMainSampler",0),this.set2f("resolution",t.width,t.height),this.set1f("strength",e.strength),this.set3fv("color",e.glcolor);for(var r=0;r{var s=i(56694),n=i(69960),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("amount",t.amount,e),this.set1f("contrast",t.contrast,e),this.set1f("strength",t.strength,e),this.set2f("blur",t.blurX,t.blurY,e),this.setBoolean("isTiltShift",t.isTiltShift,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},4323:(t,e,i)=>{var s=i(56694),n=i(33754),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("scale",t.scale,e),this.set1f("feather",t.feather,e),this.set1f("thickness",t.thickness,e),this.set3fv("color",t.glcolor,e),this.set4fv("backgroundColor",t.glcolor2,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},92066:(t,e,i)=>{var s=i(56694),n=i(80486),r=new s({Extends:n,initialize:function(t){n.call(this,{game:t})},onDraw:function(t){var e=this.fullFrame1;this.controller?this.manager.drawFrame(t,e,!0,this.controller):this.drawFrame(t,e),this.copyToGame(e)}});t.exports=r},89581:(t,e,i)=>{var s=i(56694),n=i(35668),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(t){var e=this.game.textures.getFrame(t);e&&(this.glTexture=e.glTexture)},onDraw:function(t){var e=this.getController(),i=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",e.x,e.y),this.bindTexture(e.glTexture,1),this.copySprite(t,i),this.copyToGame(i)}});t.exports=o},55084:(t,e,i)=>{var s=i(56694),n=i(72632),r=i(69675),o=i(80486),a=i(75512),h=new s({Extends:o,initialize:function(t,e){var i=n(e,"quality",.1),s=n(e,"distance",10);o.call(this,{game:t,fragShader:a.setGlowQuality(r,t,i,s)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("outerStrength",t.outerStrength,e),this.set1f("innerStrength",t.innerStrength,e),this.set4fv("glowColor",t.glcolor,e),this.setBoolean("knockout",t.knockout,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=h},41653:(t,e,i)=>{var s=i(56694),n=i(90993),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(t,e){t=this.getController(t),this.set1f("alpha",t.alpha,e),this.set1i("size",t.size,e),this.set3fv("color1",t.glcolor1,e),this.set3fv("color2",t.glcolor2,e),this.set2f("positionFrom",t.fromX,t.fromY,e),this.set2f("positionTo",t.toX,t.toY,e)}});t.exports=o},73416:(t,e,i)=>{var s=i(56694),n=i(37945),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.amount=1},onPreRender:function(t,e,i,s){t=this.getController(t),this.set1f("amount",t.amount,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},58049:(t,e,i)=>{var s=i(56694),n=i(85718),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(t,e){var i=(t=this.getController(t)).samples;this.set1i("samples",i,e),this.set1f("intensity",t.intensity,e),this.set1f("decay",t.decay,e),this.set1f("power",t.power/i,e),this.set2f("lightPosition",t.x,t.y,e),this.set4fv("color",t.glcolor,e)}});t.exports=o},18026:(t,e,i)=>{var s=i(56694),n=i(13740),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(t,e,i,s){t=this.getController(t),this.setTime("time",e),this.set1f("speed",t.speed,e),this.set1f("lineWidth",t.lineWidth,e),this.set1f("gradient",t.gradient,e),this.setBoolean("reveal",t.reveal,e),i&&s&&this.set2f("resolution",i,s,e)},onDraw:function(t){this.set2f("resolution",t.width,t.height),this.bindAndDraw(t)}});t.exports=o},72381:(t,e,i)=>{var s=i(56694),n=i(80617),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(t,e){t=this.getController(t),this.set1f("radius",t.radius,e),this.set1f("strength",t.strength,e),this.set2f("position",t.x,t.y,e)}});t.exports=o},80542:(t,e,i)=>{var s=i(56694),n=i(62879),r=i(80486),o=new s({Extends:r,initialize:function(t){r.call(this,{game:t,fragShader:n}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(t,e){var i=(t=this.getController(t)).progress,s=t.wipeWidth,n=t.direction,r=t.axis;this.set4f("config",i,s,n,r,e),this.setBoolean("reveal",t.reveal,e)}});t.exports=o},58136:(t,e,i)=>{var s={Barrel:i(32469),Bloom:i(2134),Blur:i(63377),Bokeh:i(49745),Circle:i(4323),ColorMatrix:i(92066),Displacement:i(89581),Glow:i(55084),Gradient:i(41653),Pixelate:i(73416),Shadow:i(58049),Shine:i(18026),Vignette:i(72381),Wipe:i(80542)};t.exports=s},62253:(t,e,i)=>{var s=i(65641),n=i(98611),r={FX:i(58136),BitmapMaskPipeline:i(5583),Events:i(18970),FXPipeline:i(81828),LightPipeline:i(66901),MobilePipeline:i(71264),MultiPipeline:i(77310),PointLightPipeline:i(10919),PostFXPipeline:i(80486),PreFXPipeline:i(87228),RopePipeline:i(21213),SinglePipeline:i(51212),UtilityPipeline:i(60848)};r=n(!1,r,s),t.exports=r},2529:t=>{t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = frame1 + frame2 * uStrength;","}"].join("\n")},91679:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","precision mediump float;","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join("\n")},89053:t=>{t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","precision mediump float;","attribute vec2 inPosition;","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}"].join("\n")},37486:t=>{t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join("\n")},79060:t=>{t.exports=["#define SHADER_NAME PHASER_COPY_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uBrightness;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}"].join("\n")},87751:t=>{t.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join("\n")},88222:t=>{t.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join("\n")},44481:t=>{t.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},35491:t=>{t.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},75568:t=>{t.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join("\n")},69960:t=>{t.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join("\n")},33754:t=>{t.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join("\n")},35668:t=>{t.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join("\n")},69675:t=>{t.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join("\n")},90993:t=>{t.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join("\n")},37945:t=>{t.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join("\n")},85718:t=>{t.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join("\n")},13740:t=>{t.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{","\tvec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join("\n")},80617:t=>{t.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," \tcol = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join("\n")},62879:t=>{t.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join("\n")},65045:t=>{t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","precision mediump float;","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = %LIGHT_COUNT%;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}"].join("\n")},98921:t=>{t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}"].join("\n")},25005:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join("\n")},94914:t=>{t.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join("\n")},11263:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},51852:t=>{t.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},53787:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler[%count%];","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture;"," %forloop%"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},15968:t=>{t.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},83327:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","precision mediump float;","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join("\n")},54677:t=>{t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}"].join("\n")},12569:t=>{t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join("\n")},99365:t=>{t.exports=["#define SHADER_NAME PHASER_QUAD_VS","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join("\n")},85060:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join("\n")},18166:t=>{t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join("\n")},92462:(t,e,i)=>{t.exports={AddBlendFrag:i(2529),BitmapMaskFrag:i(91679),BitmapMaskVert:i(89053),ColorMatrixFrag:i(37486),CopyFrag:i(79060),FXBarrelFrag:i(87751),FXBloomFrag:i(88222),FXBlurHighFrag:i(44481),FXBlurLowFrag:i(35491),FXBlurMedFrag:i(75568),FXBokehFrag:i(69960),FXCircleFrag:i(33754),FXDisplacementFrag:i(35668),FXGlowFrag:i(69675),FXGradientFrag:i(90993),FXPixelateFrag:i(37945),FXShadowFrag:i(85718),FXShineFrag:i(13740),FXVignetteFrag:i(80617),FXWipeFrag:i(62879),LightFrag:i(65045),LinearBlendFrag:i(98921),MeshFrag:i(25005),MeshVert:i(94914),MobileFrag:i(11263),MobileVert:i(51852),MultiFrag:i(53787),MultiVert:i(15968),PointLightFrag:i(83327),PointLightVert:i(54677),PostFXFrag:i(12569),QuadVert:i(99365),SingleFrag:i(85060),SingleVert:i(18166)}},756:(t,e,i)=>{var s=i(55301),n=i(56694),r=i(6659),o=i(40444),a=i(97081),h=i(74181),l=i(2893),u=i(9229),c=i(72283),d=i(74118),f=i(90881),p=i(84314),g=i(93736),v=i(47751),m=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=s.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new g(1,1),this.autoRound=!1,this.autoCenter=s.CENTER.NO_CENTER,this.orientation=s.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.domlisteners={orientationChange:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==s.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===s.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,n=t.scaleMode,r=t.zoom,o=t.autoRound;if("string"==typeof e)if("%"!==e.substr(-1))e=parseInt(e,10);else{var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i)if("%"!==i.substr(-1))i=parseInt(i,10);else{var l=this.parentSize.height;0===l&&(l=window.innerHeight);var c=parseInt(i,10)/100;i=Math.floor(l*c)}this.scaleMode=n,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),r===s.ZOOM.MAX_ZOOM&&(r=this.getMaxZoom()),this.zoom=r,1!==r&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*r,t.minHeight*r),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*r,t.maxHeight*r),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==s.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,s=e.height;if(t.width!==i||t.height!==s)return t.setSize(i,s),!0;if(this.canvas){var n=this.canvasBounds,r=this.canvas.getBoundingClientRect();if(r.x!==n.x||r.y!==n.y)return!0}return!1},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,n=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,n)},resize:function(t,e){var i=this.zoom,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return s&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(n,r)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var s=this.canvas.style,n=i.style;n.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",n.marginLeft=s.marginLeft,n.marginTop=s.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,n=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===s.SCALE_MODE.NONE?(this.displaySize.setSize(n*o,r*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===s.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==s.CENTER.NO_CENTER){var e=this.canvas,i=e.style,n=e.getBoundingClientRect(),r=n.width,o=n.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===s.CENTER.CENTER_HORIZONTALLY?h=0:t===s.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}return this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas)),this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.domlisteners;e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available&&(e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)},["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1))},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},getViewPort:function(t,e){t instanceof v||(e=t,t=void 0),void 0===e&&(e=new d);var i,s,n=this.baseSize,r=this.parentSize,o=this.canvasBounds,a=this.displayScale,h=o.x>=0?0:-o.x*a.x,l=o.y>=0?0:-o.y*a.y;return i=r.width>=o.width?n.width:n.width-(o.width-r.width)*a.x,s=r.height>=o.height?n.height:n.height-(o.height-r.height)*a.y,e.setTo(h,l,i,s),t&&(e.width/=t.zoomX,e.height/=t.zoomY,e.centerX=t.centerX+t.scrollX,e.centerY=t.centerY+t.scrollY),e},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.domlisteners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===s.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===s.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=m},35098:t=>{t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},53539:t=>{t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},12637:t=>{t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},10217:t=>{t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},55301:(t,e,i)=>{var s={CENTER:i(35098),ORIENTATION:i(53539),SCALE_MODE:i(12637),ZOOM:i(10217)};t.exports=s},82085:t=>{t.exports="enterfullscreen"},11826:t=>{t.exports="fullscreenfailed"},56691:t=>{t.exports="fullscreenunsupported"},34739:t=>{t.exports="leavefullscreen"},26681:t=>{t.exports="orientationchange"},11428:t=>{t.exports="resize"},40444:(t,e,i)=>{t.exports={ENTER_FULLSCREEN:i(82085),FULLSCREEN_FAILED:i(11826),FULLSCREEN_UNSUPPORTED:i(56691),LEAVE_FULLSCREEN:i(34739),ORIENTATION_CHANGE:i(26681),RESIZE:i(11428)}},86754:(t,e,i)=>{var s=i(98611),n=i(55301),r={Center:i(35098),Events:i(40444),Orientation:i(53539),ScaleManager:i(756),ScaleModes:i(12637),Zoom:i(10217)};r=s(!1,r,n.CENTER),r=s(!1,r,n.ORIENTATION),r=s(!1,r,n.SCALE_MODE),r=s(!1,r,n.ZOOM),t.exports=r},47736:(t,e,i)=>{var s=i(72632),n=i(40587);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=s(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(n(e+"Physics")),i)for(var o in i)o=n(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},91088:(t,e,i)=>{var s=i(72632);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=s(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},90415:t=>{t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},87157:(t,e,i)=>{var s=i(56694),n=i(63946),r=new s({initialize:function(t){this.sys=new n(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=r},13553:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(7599),o=i(97081),a=i(10850),h=i(683),l=i(72283),u=i(87157),c=i(63946),d=new s({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[s],this.scenes.splice(i,1),this._start.indexOf(s)>-1&&(i=this._start.indexOf(s),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,s=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,s.data),s.status=n.INIT,s.isTransition&&i.events.emit(r.TRANSITION_INIT,s.transitionFrom,s.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),s.status=n.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start()):this.create(t)},loadComplete:function(t){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(t.scene)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var s=this.scenes[i].sys;s.settings.status>n.START&&s.settings.status<=n.RUNNING&&s.step(t,e),s.scenePlugin._target&&s.scenePlugin.step(t,e)}},render:function(t){for(var e=0;e=n.LOADING&&i.settings.status=n.START&&o<=n.CREATING)return this;if(o>=n.RUNNING&&o<=n.SLEEPING)r.shutdown(),r.sceneUpdate=l,r.start(e);else if(r.sceneUpdate=l,r.start(e),r.load&&(s=r.load),s&&r.settings.hasOwnProperty("pack")&&(s.reset(),s.addPack({payload:r.settings.pack})))return r.settings.status=n.LOADING,s.once(h.COMPLETE,this.payloadComplete,this),s.start(),this;return this.bootScene(i),this},stop:function(t,e){var i=this.getScene(t);if(i&&!i.sys.isTransitioning()&&i.sys.settings.status!==n.SHUTDOWN){var s=i.sys.load;s&&(s.off(h.COMPLETE,this.loadComplete,this),s.off(h.COMPLETE,this.payloadComplete,this)),i.sys.shutdown(e)}return this},switch:function(t,e){var i=this.getScene(t),s=this.getScene(e);return i&&s&&i!==s&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,s=this.getScene(t),n=this.getAt(i);this.scenes[e]=n,this.scenes[i]=s}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(ei),0,n)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),s=this.getIndex(e);if(-1!==i&&-1!==s&&s>i){var n=this.getAt(s);this.scenes.splice(s,1),0===i?this.scenes.unshift(n):this.scenes.splice(i-(s{var s=i(82897),n=i(56694),r=i(7599),o=i(72632),a=i(91963),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var s=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=s,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var n=o(t,"onUpdate",null);n&&(this._onUpdate=n,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=s,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data"));var l=o(t,"onStart",null),u=o(t,"onStartScope",this.scene);return l&&l.call(u,this.scene,i,s),this.systems.events.emit(r.TRANSITION_OUT,i,s),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=s(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,s){return this.manager.add(t,e,i,s)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var s=this.manager.getScene(e);return s&&s.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getStatus:function(t){var e=this.manager.getScene(t);if(e)return e.sys.getStatus()},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},36765:(t,e,i)=>{var s=i(92980),n=i(10850),r=i(30657),o=i(90415),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:s.PENDING,key:n(t,"key",""),active:n(t,"active",!1),visible:n(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:n(t,"pack",!1),cameras:n(t,"cameras",null),map:n(t,"map",r(o,n(t,"mapAdd",{}))),physics:n(t,"physics",{}),loader:n(t,"loader",{}),plugins:n(t,"plugins",!1),input:n(t,"input",{})}}};t.exports=a},63946:(t,e,i)=>{var s=i(56694),n=i(92980),r=i(18360),o=i(7599),a=i(47736),h=i(91088),l=i(72283),u=i(36765),c=new s({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=l},init:function(t){this.settings.status=n.INIT,this.sceneUpdate=l,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,r.Global,[r.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.events.emit(o.PRE_RENDER,t),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot pause non-running Scene",e.key):this.settings.active&&(e.status=n.PAUSED,e.active=!1,this.events.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=n.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.settings,i=this.getStatus();return i!==n.CREATING&&i!==n.RUNNING?console.warn("Cannot sleep non-running Scene",e.key):(e.status=n.SLEEPING,e.active=!1,e.visible=!1,this.events.emit(o.SLEEP,this,t)),this},wake:function(t){var e=this.events,i=this.settings;return i.status=n.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var t=this.settings.status;return t>n.PENDING&&t<=n.RUNNING},isSleeping:function(){return this.settings.status===n.SLEEPING},isActive:function(){return this.settings.status===n.RUNNING},isPaused:function(){return this.settings.status===n.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=n.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=n.SHUTDOWN,i.active=!1,i.visible=!1,e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=n.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],s=0;s{t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},31803:t=>{t.exports="addedtoscene"},94817:t=>{t.exports="boot"},28977:t=>{t.exports="create"},91959:t=>{t.exports="destroy"},363:t=>{t.exports="pause"},15643:t=>{t.exports="postupdate"},17058:t=>{t.exports="prerender"},77125:t=>{t.exports="preupdate"},76018:t=>{t.exports="ready"},28620:t=>{t.exports="removedfromscene"},41538:t=>{t.exports="render"},34268:t=>{t.exports="resume"},2342:t=>{t.exports="shutdown"},96541:t=>{t.exports="sleep"},74244:t=>{t.exports="start"},17046:t=>{t.exports="transitioncomplete"},13637:t=>{t.exports="transitioninit"},14733:t=>{t.exports="transitionout"},33899:t=>{t.exports="transitionstart"},52418:t=>{t.exports="transitionwake"},31735:t=>{t.exports="update"},8470:t=>{t.exports="wake"},7599:(t,e,i)=>{t.exports={ADDED_TO_SCENE:i(31803),BOOT:i(94817),CREATE:i(28977),DESTROY:i(91959),PAUSE:i(363),POST_UPDATE:i(15643),PRE_RENDER:i(17058),PRE_UPDATE:i(77125),READY:i(76018),REMOVED_FROM_SCENE:i(28620),RENDER:i(41538),RESUME:i(34268),SHUTDOWN:i(2342),SLEEP:i(96541),START:i(74244),TRANSITION_COMPLETE:i(17046),TRANSITION_INIT:i(13637),TRANSITION_OUT:i(14733),TRANSITION_START:i(33899),TRANSITION_WAKE:i(52418),UPDATE:i(31735),WAKE:i(8470)}},20436:(t,e,i)=>{var s=i(92980),n=i(98611),r={Events:i(7599),GetPhysicsPlugins:i(47736),GetScenePlugins:i(91088),SceneManager:i(13553),ScenePlugin:i(64051),Settings:i(36765),Systems:i(63946)};r=n(!1,r,s),t.exports=r},25798:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(76038),o=i(98611),a=i(72283),h=new s({Extends:n,initialize:function(t,e,i){n.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying||(this.isPlaying=!1,this.isPaused=!0,0))},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1,0))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.stop(),this.emit(r.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},12486:(t,e,i)=>{var s=i(56694),n=i(32742),r=i(6659),o=i(76038),a=i(97081),h=i(71608),l=i(51463),u=i(72283),c=i(93736),d=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,this.gameLostFocus=!1,this.listenerPosition=new c,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:u,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var s in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(s)){var r=n(e),o=i.spritemap[s];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:s,start:o.start,duration:o.end-o.start,config:r})}return i},get:function(t){return l(this.sounds,"key",t)},getAll:function(t){return t?h(this.sounds,"key",t):h(this.sounds)},getAllPlaying:function(){return h(this.sounds,"isPlaying",!0)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var s=this.addAudioSprite(t);return s.once(o.COMPLETE,s.destroy,s),s.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var s=this.sounds[i];s.key===t&&(s.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},setListenerPosition:u,stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:u,onBlur:u,onFocus:u,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(s,n){s&&!s.pendingRemove&&t.call(e||i,s,n,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=d},84191:(t,e,i)=>{var s=i(27622),n=i(17546),r=i(55491),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new n(t):i.webAudio&&!e.disableWebAudio?new r(t):new s(t)}};t.exports=o},77578:t=>{t.exports="complete"},19679:t=>{t.exports="decodedall"},56951:t=>{t.exports="decoded"},16436:t=>{t.exports="destroy"},55154:t=>{t.exports="detune"},57818:t=>{t.exports="detune"},57890:t=>{t.exports="mute"},83022:t=>{t.exports="rate"},99170:t=>{t.exports="volume"},64289:t=>{t.exports="looped"},67214:t=>{t.exports="loop"},53128:t=>{t.exports="mute"},73078:t=>{t.exports="pan"},76763:t=>{t.exports="pauseall"},88426:t=>{t.exports="pause"},13765:t=>{t.exports="play"},80291:t=>{t.exports="rate"},11124:t=>{t.exports="resumeall"},55382:t=>{t.exports="resume"},71157:t=>{t.exports="seek"},31776:t=>{t.exports="stopall"},39450:t=>{t.exports="stop"},21939:t=>{t.exports="unlocked"},33019:t=>{t.exports="volume"},76038:(t,e,i)=>{t.exports={COMPLETE:i(77578),DECODED:i(56951),DECODED_ALL:i(19679),DESTROY:i(16436),DETUNE:i(55154),GLOBAL_DETUNE:i(57818),GLOBAL_MUTE:i(57890),GLOBAL_RATE:i(83022),GLOBAL_VOLUME:i(99170),LOOP:i(67214),LOOPED:i(64289),MUTE:i(53128),PAN:i(73078),PAUSE_ALL:i(76763),PAUSE:i(88426),PLAY:i(13765),RATE:i(80291),RESUME_ALL:i(11124),RESUME:i(55382),SEEK:i(71157),STOP_ALL:i(31776),STOP:i(39450),UNLOCKED:i(21939),VOLUME:i(33019)}},34350:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(82897),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('No cached audio asset with key "'+e);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,s.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!s.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(r.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||this.startTime>0||!s.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||this.startTime>0||!s.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(r.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!s.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,s-i),s=this.audio.currentTime):s=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){s.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){s.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(r.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},27622:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(76038),o=i(34350),a=new n({Extends:s,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,s.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var s=0;s{t.exports={SoundManagerCreator:i(84191),Events:i(76038),BaseSound:i(25798),BaseSoundManager:i(12486),WebAudioSound:i(96008),WebAudioSoundManager:i(55491),HTML5AudioSound:i(34350),HTML5AudioSoundManager:i(27622),NoAudioSound:i(38662),NoAudioSoundManager:i(17546)}},38662:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(6659),o=i(98611),a=i(72283),h=function(){return!1},l=function(){return null},u=function(){return this},c=new n({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:h,updateMarker:h,removeMarker:l,play:h,pause:h,resume:h,stop:h,setMute:u,setVolume:u,setRate:u,setDetune:u,setSeek:u,setLoop:u,setPan:u,applyConfig:l,resetConfig:l,update:a,calculateRate:l,destroy:function(){s.prototype.destroy.call(this)}});t.exports=c},17546:(t,e,i)=>{var s=i(12486),n=i(56694),r=i(6659),o=i(38662),a=i(72283),h=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},get:function(t){return s.prototype.get.call(this,t)},getAll:function(t){return s.prototype.getAll.call(this,t)},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return s.prototype.remove.call(this,t)},removeAll:function(){return s.prototype.removeAll.call(this)},removeByKey:function(t){return s.prototype.removeByKey.call(this,t)},stopByKey:function(t){return s.prototype.stopByKey.call(this,t)},onBlur:a,onFocus:a,onGameBlur:a,onGameFocus:a,pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,unlock:a,forEachActiveSound:function(t,e){s.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){s.prototype.destroy.call(this)}});t.exports=h},96008:(t,e,i)=>{var s=i(25798),n=i(56694),r=i(76038),o=i(72632),a=new n({Extends:s,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createPanner&&(this.spatialNode=t.context.createPanner(),this.volumeNode.connect(this.spatialNode)),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),t.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):t.context.createPanner?this.spatialNode.connect(t.destination):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,s.call(this,t,e,i)},play:function(t,e){return!!s.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime{var s=i(82329),n=i(12486),r=i(56694),o=i(76038),a=i(97081),h=i(96008),l=i(72632),u=new r({Extends:n,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),n.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var n=this.game.cache.audio,r=i.length,a=0;a{var s=i(59959),n=i(56694),r=i(72283),o=i(17922),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},moveAbove:function(t,e){return s.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return s.MoveBelow(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,n){return s.SetAll(this.list,t,e,i,n),this},each:function(t,e){for(var i=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},33885:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){this.entries={},this.size=0,this.setAll(t)},setAll:function(t){if(Array.isArray(t))for(var e=0;e{var s=i(56694),n=i(6659),r=i(36716),o=new s({Extends:n,initialize:function(){n.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(t){return this._active.indexOf(t)>-1},isPending:function(t){return this._toProcess>0&&this._pending.indexOf(t)>-1},isDestroying:function(t){return this._destroy.indexOf(t)>-1},add:function(t){return this.checkQueue&&this.isActive(t)&&!this.isDestroying(t)||this.isPending(t)||(this._pending.push(t),this._toProcess++),t},remove:function(t){if(this.isPending(t)){var e=this._pending,i=e.indexOf(t);-1!==i&&e.splice(i,1)}else this.isActive(t)&&(this._destroy.push(t),this._toProcess++);return t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,s=this._active;for(t=0;t{var s=i(53466);function n(t){if(!(this instanceof n))return new n(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var s=0;s=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,n,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((i-e)/n/2)*n,s(t,o,e,i,r),a.push(e,o,o,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!p(t,e))return i;for(var n,r,o,a,h=[];e;){for(n=0,r=e.children.length;n=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},_split:function(t,e){var i=t[e],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);var r=this._chooseSplitIndex(i,n,s),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,n,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,s=e;s<=i-e;s++)f=n=a(t,0,s,this.toBBox),p=r=a(t,s,i,this.toBBox),void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(n)+c(r),o=e;n--)r=t.children[n],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)h(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=n},58403:(t,e,i)=>{var s=new(i(56694))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new s;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new s;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t{var s=i(82897),n=i(56694),r=i(84314),o=i(93736),a=new n({initialize:function(t,e,i,s){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===s&&(s=null),this._width=t,this._height=e,this._parent=s,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=s(t,0,this.maxWidth),this.minHeight=s(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=s(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=s(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=s(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var s=this.snapTo,n=0===e?1:t/e;return i&&this.aspectRatio>n||!i&&this.aspectRatio0&&(t=(e=r(e,s.y))*this.aspectRatio)):(i&&this.aspectRation)&&(t=(e=r(e,s.y))*this.aspectRatio,s.x>0&&(e=(t=r(t,s.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},94160:t=>{t.exports="add"},95393:t=>{t.exports="remove"},36716:(t,e,i)=>{t.exports={PROCESS_QUEUE_ADD:i(94160),PROCESS_QUEUE_REMOVE:i(95393)}},20010:(t,e,i)=>{t.exports={Events:i(36716),List:i(71207),Map:i(33885),ProcessQueue:i(74623),RTree:i(68687),Set:i(58403),Size:i(90881)}},17487:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(27119),o=i(86459),a=i(28621),h=i(31673),l=new s({Extends:h,initialize:function(t,e,i,s,n){h.call(this,t,e,i,s,n),this.add("__BASE",0,0,0,s,n),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=s,this.height=n,this.imageData=this.context.getImageData(0,0,s,n),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i,s){return void 0===s&&(s=!0),this.context.drawImage(i,t,e),s&&this.update(),this},drawFrame:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=!0);var r=this.manager.getFrame(t,e);if(r){var o=r.canvasData,a=r.cutWidth,h=r.cutHeight,l=r.source.resolution;this.context.drawImage(r.source.image,o.x,o.y,a,h,i,s,a/l,h/l),n&&this.update()}return this},setPixel:function(t,e,i,s,n,r){if(void 0===r&&(r=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=s,o.data[2]=n,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,s,n,r,o){return void 0===s&&(s=0),void 0===n&&(n=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,s,n,r,o),this},getData:function(t,e,i,s){return t=n(Math.floor(t),0,this.width-1),e=n(Math.floor(e),0,this.height-1),i=n(i,1,this.width-t),s=n(s,1,this.height-e),this.context.getImageData(t,e,i,s)},getPixel:function(t,e,i){i||(i=new 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{var s=i(95723),n=i(51052),r=i(61068),o=i(56694),a=i(86459),h=i(82047),l=i(72632),u=i(65641),c=i(37410),d=i(31673),f=i(75512),p=new o({Extends:d,initialize:function(t,e,i,s){void 0===i&&(i=256),void 0===s&&(s=256),this.type="DynamicTexture";var o=t.game.renderer,h=o&&o.type===a.CANVAS,l=h?r.create2D(this,i,s):[this];d.call(this,t,e,l,i,s),this.add("__BASE",0,0,0,i,s),this.renderer=o,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=h?l:null,this.context=h?l.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new n(0,0,i,s).setScene(t.game.scene.systemScene,!1),this.renderTarget=h?null:new c(o,i,s,1,0,!1,!0,!0,!1),this.pipeline=h?null:o.pipelines.get(u.SINGLE_PIPELINE),h||this.setSize(i,s)},setSize:function(t,e){void 0===e&&(e=t);var i=this.get(),s=i.source;if(t!==this.width||e!==this.height){this.canvas&&(this.canvas.width=t,this.canvas.height=e);var n=this.renderTarget;n&&(n.willResize(t,e)&&(n.resize(t,e),this.renderer.deleteTexture(s.glTexture)),this.setFromRenderTarget()),this.camera.setSize(t,e),s.width=t,s.height=e,i.setSize(t,e),this.width=t,this.height=e}else{var r=this.getSourceImage();i.cutX+t>r.width&&(t=r.width-i.cutX),i.cutY+e>r.height&&(e=r.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}return this},setFromRenderTarget:function(){var t=this.get(),e=t.source,i=this.renderTarget;return t.glTexture=i.texture,e.isRenderTexture=!0,e.isGLTexture=!0,e.glTexture=i.texture,e.glTexture.flipY=!0,this},setIsSpriteTexture:function(t){return this.isSpriteTexture=t,this},fill:function(t,e,i,s,n,r){var o=this.camera,a=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height);var h=t>>16&255,l=t>>8&255,u=255&t,c=this.renderTarget;if(o.preRender(),c){c.bind(!0);var d=this.pipeline.manager.set(this.pipeline),p=a.width/c.width,g=a.height/c.height,v=c.height-(s+r);d.drawFillRect(i*p,v*g,n*p,r*g,f.getTintFromFloats(u/255,l/255,h/255,1),e),c.unbind(!0)}else{var m=this.context;a.setContext(m),m.globalCompositeOperation="source-over",m.fillStyle="rgba("+h+","+l+","+u+","+e+")",m.fillRect(i,s,n,r),a.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.context,e=this.renderTarget;e?e.clear():t&&(t.save(),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,this.width,this.height),t.restore()),this.dirty=!1}return this},stamp:function(t,e,i,s,n){void 0===i&&(i=0),void 0===s&&(s=0);var r=l(n,"alpha",1),o=l(n,"tint",16777215),a=l(n,"angle",0),h=l(n,"rotation",0),u=l(n,"scale",1),c=l(n,"scaleX",u),d=l(n,"scaleY",u),f=l(n,"originX",.5),p=l(n,"originY",.5),g=l(n,"blendMode",0),v=l(n,"erase",!1),m=l(n,"skipBatch",!1),y=this.manager.resetStamp(r,o);return y.setAngle(0),0!==a?y.setAngle(a):0!==h&&y.setRotation(h),y.setScale(c,d),y.setTexture(t,e),y.setOrigin(f,p),y.setBlendMode(g),v&&(this._eraseMode=!0),m?this.batchGameObject(y,i,s):this.draw(y,i,s),v&&(this._eraseMode=!1),this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i),this._eraseMode=!1,this},draw:function(t,e,i,s,n){return this.beginDraw(),this.batchDraw(t,e,i,s,n),this.endDraw(),this},drawFrame:function(t,e,i,s,n,r){return this.beginDraw(),this.batchDrawFrame(t,e,i,s,n,r),this.endDraw(),this},repeat:function(t,e,i,s,n,r,o,a,l){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=1),void 0===a&&(a=16777215),void 0===l&&(l=!1),!(e=t instanceof h?t:this.manager.getFrame(t,e)))return this;var u=this.manager.resetStamp(o,a);u.setFrame(e),u.setOrigin(0);var c=e.width,d=e.height;n=Math.floor(n),r=Math.floor(r);var f=Math.ceil(n/c),p=Math.ceil(r/d),g=f*c-n,v=p*d-r;g>0&&(g=c-g),v>0&&(v=d-v),i<0&&(f+=Math.ceil(Math.abs(i)/c)),s<0&&(p+=Math.ceil(Math.abs(s)/d));var m=i,y=s,x=!1,T=this.manager.stampCrop.setTo(0,0,c,d);l||this.beginDraw();for(var w=0;w0&&b===f-1&&(x=!0,T.width=g),v>0&&w===p-1&&(x=!0,T.height=v),x&&u.setCrop(T),this.batchGameObject(u,m,y),u.isCropped=!1,T.setTo(0,0,c,d)),m+=c;m=i,y+=d}return l||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var t=this.camera,e=this.renderer,i=this.renderTarget;t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(t,e,i,s,n){return Array.isArray(t)||(t=[t]),this.batchList(t,e,i,s,n),this},batchDrawFrame:function(t,e,i,s,n,r){void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=1),void 0===r&&(r=16777215);var o=this.manager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,s,r,n,this.camera.matrix,null):this.batchTextureFrame(o,i,s,n,r)),this},endDraw:function(t){if(void 0===t&&(t=this._eraseMode),this.isDrawing){var e=this.renderer,i=this.renderTarget;if(i){var s=e.endCapture();e.pipelines.setUtility().blitFrame(s,i,1,!1,!1,t,this.isSpriteTexture),e.resetScissor(),e.resetViewport()}else e.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(t,e,i,s,n){var r=t.length;if(0!==r)for(var o=0;o0&&a.height>0&&o.drawImage(h,a.x,a.y,a.width,a.height,e,i,a.width,a.height),o.restore()}},snapshotArea:function(t,e,i,s,n,r,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,n,!1,t,e,i,s,r,o):this.renderer.snapshotCanvas(this.canvas,n,!1,t,e,i,s,r,o),this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.width,this.height,t,e,i)},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(t,e,i,s){var n=this.manager.resetStamp();n.setTexture(this),n.setOrigin(0),n.renderWebGL(t,n,i,s)},renderCanvas:function(){},destroy:function(){var t=this.manager.stamp;t&&t.texture===this&&this.manager.resetStamp(),d.prototype.destroy.call(this),r.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});t.exports=p},82047:(t,e,i)=>{var s=i(56694),n=i(82897),r=i(98611),o=new s({initialize:function(t,e,i,s,n,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0},is3Slice:!1,scale9:!1,scale9Borders:{x:0,y:0,w:0,h:0}},this.setSize(r,o,s,n)},setSize:function(t,e,i,s){void 0===i&&(i=0),void 0===s&&(s=0),this.cutX=i,this.cutY=s,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var n=this.data,r=n.cut;r.x=i,r.y=s,r.w=t,r.h=e,r.r=i+t,r.b=s+e,n.sourceSize.w=t,n.sourceSize.h=e,n.spriteSourceSize.w=t,n.spriteSourceSize.h=e,n.radius=.5*Math.sqrt(t*t+e*e);var o=n.drawImage;return o.x=i,o.y=s,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,s,n,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=s,a.w=n,a.h=r,a.r=i+n,a.b=s+r,this.x=i,this.y=s,this.width=n,this.height=r,this.halfWidth=.5*n,this.halfHeight=.5*r,this.centerX=Math.floor(n/2),this.centerY=Math.floor(r/2),this.updateUVs()},setScale9:function(t,e,i,s){var n=this.data;return n.scale9=!0,n.is3Slice=0===e&&s===this.height,n.scale9Borders.x=t,n.scale9Borders.y=e,n.scale9Borders.w=i,n.scale9Borders.h=s,this},setCropUVs:function(t,e,i,s,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=n(e,0,d)),g=l+(i=n(i,0,f)),v=s=n(s,0,d-e),m=r=n(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(s=n(s,0,u-e)),w=i+(r=n(r,0,c-i));if(x.rT||x.y>w)p=0,g=0,v=0,m=0;else{var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,A=Math.min(x.b,w)-E;v=S,m=A,p=o?h+(u-(b-x.x)-S):h+(b-x.x),g=a?l+(c-(E-x.y)-A):l+(E-x.y),e=b,i=E,s=S,r=A}}else o&&(p=h+(u-e-s)),a&&(g=l+(c-i-r));var _=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/_),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/_),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=s,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,s,n,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=s,this.u1=n,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,s=this.cutHeight,n=this.data.drawImage;n.width=i,n.height=s;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+s)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.texture=null,this.source=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},scale9:{get:function(){return this.data.scale9}},is3Slice:{get:function(){return this.data.is3Slice}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},31673:(t,e,i)=>{var s=i(56694),n=i(82047),r=i(32547),o='Texture "%s" has no frame "%s"',a=new s({initialize:function(t,e,i,s,n){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var o=0;o{var s=i(61068),n=i(17487),r=i(56694),o=i(27119),a=i(86459),h=i(845),l=i(6659),u=i(38203),c=i(82047),d=i(97081),f=i(52780),p=i(10850),g=i(1539),v=i(42911),m=i(69150),y=i(74118),x=i(31673),T=new r({Extends:l,initialize:function(t){l.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=s.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.silentWarnings=!1,t.events.once(d.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(u.LOAD,this.updatePending,this),this.on(u.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this.game.events.once(d.DESTROY,this.destroy,this),this.game.events.once(d.SYSTEM_READY,(function(t){this.stamp=new g(t).setOrigin(0)}),this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(u.LOAD),this.off(u.ERROR),this.emit(u.READY))},checkKey:function(t){return!this.exists(t)||(this.silentWarnings||console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return this.silentWarnings||console.warn("No texture found matching key: "+t),this;t=this.get(t)}var e=t.key;return this.list.hasOwnProperty(e)&&(t.destroy(),this.emit(u.REMOVE,e),this.emit(u.REMOVE_KEY+e)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,s=new Image;s.onerror=function(){i.emit(u.ERROR,t)},s.onload=function(){var e=i.create(t,s);m.Image(e,0),i.emit(u.ADD,t,e),i.emit(u.ADD_KEY+t,e),i.emit(u.LOAD,t,e)},s.src=e}return this},getBase64:function(t,e,i,n){void 0===i&&(i="image/png"),void 0===n&&(n=.92);var r="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=s.create2D(this,a.width,a.height),l=h.getContext("2d",{willReadFrequently:!0});a.width>0&&a.height>0&&l.drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),r=h.toDataURL(i,n),s.remove(h)}return r},addImage:function(t,e,i){var s=null;return this.checkKey(t)&&(s=this.create(t,e),m.Image(s,0),i&&s.setDataSource(i),this.emit(u.ADD,t,s),this.emit(u.ADD_KEY+t,s)),s},addGLTexture:function(t,e,i,s){var n=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===s&&(s=e.height),(n=this.create(t,e,i,s)).add("__BASE",0,0,0,i,s),this.emit(u.ADD,t,n),this.emit(u.ADD_KEY+t,n)),n},addCompressedTexture:function(t,e,i){var s=null;if(this.checkKey(t)){if((s=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),i)if(Array.isArray(i))for(var n=0;n=r.x&&t=r.y&&e=r.x&&t=r.y&&e{var s=i(61068),n=i(56694),r=i(28621),o=i(27394),a=new n({initialize:function(t,e,i,s,n){void 0===n&&(n=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e.compressed?null:e,this.compressionAlgorithm=e.compressed?e.format:null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=s||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type||"DynamicTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=r(this.width,this.height),this.glTexture=null,this.flipY=n,this.init(a)},init:function(t){var e=this.renderer;if(e){var i=this.source;if(e.gl){var s=this.image,n=this.flipY,r=this.width,o=this.height,a=this.scaleMode;this.isCanvas?this.glTexture=e.createCanvasTexture(s,!1,n):this.isVideo?this.glTexture=e.createVideoTexture(s,!1,n):this.isRenderTexture?this.glTexture=e.createTextureFromSource(null,r,o,a):this.isGLTexture?this.glTexture=i:this.compressionAlgorithm?this.glTexture=e.createTextureFromSource(i):this.glTexture=e.createTextureFromSource(s,r,o,a)}else this.isRenderTexture&&(this.image=i.canvas)}t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer,e=this.image,i=this.flipY,s=t.gl;s&&this.isCanvas?this.glTexture=t.updateCanvasTexture(e,this.glTexture,i):s&&this.isVideo&&(this.glTexture=t.updateVideoTexture(e,this.glTexture,i))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&s.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},65154:t=>{t.exports={LINEAR:0,NEAREST:1}},49644:t=>{t.exports="addtexture"},29569:t=>{t.exports="addtexture-"},60079:t=>{t.exports="onerror"},72665:t=>{t.exports="onload"},93006:t=>{t.exports="ready"},69018:t=>{t.exports="removetexture"},85549:t=>{t.exports="removetexture-"},38203:(t,e,i)=>{t.exports={ADD:i(49644),ADD_KEY:i(29569),ERROR:i(60079),LOAD:i(72665),READY:i(93006),REMOVE:i(69018),REMOVE_KEY:i(85549)}},87499:(t,e,i)=>{var s=i(98611),n=i(65154),r={CanvasTexture:i(17487),DynamicTexture:i(845),Events:i(38203),FilterMode:n,Frame:i(82047),Parsers:i(69150),Texture:i(31673),TextureManager:i(6237),TextureSource:i(32547)};r=s(!1,r,n),t.exports=r},35082:t=>{t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height);for(var n,r=i.getElementsByTagName("SubTexture"),o=0;o{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},21560:t=>{t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},64423:(t,e,i)=>{var s=i(32742);t.exports=function(t,e,i){if(i.frames||i.textures){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a{var s=i(32742);t.exports=function(t,e,i){if(i.frames){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);var r,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];if(r=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h)){h.trimmed&&r.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(r.rotated=!0,r.updateUVsInverted());var l=h.anchor||h.pivot;l&&(r.customPivot=!0,r.pivotX=l.x,r.pivotY=l.y),h.scale9Borders&&r.setScale9(h.scale9Borders.x,h.scale9Borders.y,h.scale9Borders.w,h.scale9Borders.h),r.customData=s(h)}else console.warn("Invalid atlas json, frame already exists: "+a)}for(var u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},67409:t=>{t.exports=function(t){var e,i=[171,75,84,88,32,49,49,187,13,10,26,10],s=new Uint8Array(t,0,12);for(e=0;e>1),g=Math.max(1,g>>1),f+=v}return{mipmaps:d,width:h,height:l,internalFormat:a,compressed:!0,generateMipmap:!1}}console.warn("KTXParser - Only compressed formats supported")}},24904:t=>{function e(t,e,i,s,n,r,o){return void 0===o&&(o=16),Math.floor((t+i)/n)*Math.floor((e+s)/r)*o}function i(t,e){return(t=Math.max(t,16))*(e=Math.max(e,8))/4}function s(t,e){return(t=Math.max(t,8))*(e=Math.max(e,8))/2}function n(t,i){return e(t,i,3,3,4,4,8)}function r(t,i){return e(t,i,3,3,4,4)}var o={0:{sizeFunc:i,glFormat:35841},1:{sizeFunc:i,glFormat:35843},2:{sizeFunc:s,glFormat:35840},3:{sizeFunc:s,glFormat:35842},6:{sizeFunc:n,glFormat:36196},7:{sizeFunc:n,glFormat:33776},8:{sizeFunc:r,glFormat:33777},9:{sizeFunc:r,glFormat:33778},11:{sizeFunc:r,glFormat:33779},22:{sizeFunc:n,glFormat:37492},23:{sizeFunc:r,glFormat:37496},24:{sizeFunc:n,glFormat:37494},25:{sizeFunc:n,glFormat:37488},26:{sizeFunc:r,glFormat:37490},27:{sizeFunc:r,glFormat:37808},28:{sizeFunc:function(t,i){return e(t,i,4,3,5,4)},glFormat:37809},29:{sizeFunc:function(t,i){return e(t,i,4,4,5,5)},glFormat:37810},30:{sizeFunc:function(t,i){return e(t,i,5,4,6,5)},glFormat:37811},31:{sizeFunc:function(t,i){return e(t,i,5,5,6,6)},glFormat:37812},32:{sizeFunc:function(t,i){return e(t,i,7,4,8,5)},glFormat:37813},33:{sizeFunc:function(t,i){return e(t,i,7,5,8,6)},glFormat:37814},34:{sizeFunc:function(t,i){return e(t,i,7,7,8,8)},glFormat:37815},35:{sizeFunc:function(t,i){return e(t,i,9,4,10,5)},glFormat:37816},36:{sizeFunc:function(t,i){return e(t,i,9,5,10,6)},glFormat:37817},37:{sizeFunc:function(t,i){return e(t,i,9,7,10,8)},glFormat:37818},38:{sizeFunc:function(t,i){return e(t,i,9,9,10,10)},glFormat:37819},39:{sizeFunc:function(t,i){return e(t,i,11,9,12,10)},glFormat:37820},40:{sizeFunc:function(t,i){return e(t,i,11,11,12,12)},glFormat:37821}};t.exports=function(t){for(var e=new Uint32Array(t,0,13),i=e[2],s=o[i].glFormat,n=o[i].sizeFunc,r=e[11],a=e[7],h=e[6],l=52+e[12],u=new Uint8Array(t,l),c=new Array(r),d=0,f=a,p=h,g=0;g>1),p=Math.max(1,p>>1),d+=v}return{mipmaps:c,width:a,height:h,internalFormat:s,compressed:!0,generateMipmap:!1}}},6143:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o,a){var h=s(a,"frameWidth",null),l=s(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=s(a,"startFrame",0),d=s(a,"endFrame",-1),f=s(a,"margin",0),p=s(a,"spacing",0),g=Math.floor((r-f+p)/(h+p))*Math.floor((o-f+p)/(l+p));0===g&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(c>g||c<-g)&&(c=0),c<0&&(c=g+c),(-1===d||d>g||dr&&(y=b-r),E>o&&(x=E-o),w>=c&&w<=d&&(t.add(T,e,i+v,n+m,h-y,l-x),T++),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},20030:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i){var n=s(i,"frameWidth",null),r=s(i,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=s(i,"startFrame",0),l=s(i,"endFrame",-1),u=s(i,"margin",0),c=s(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(n+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=n-w,E=n-(v-p-w),S=e.y,A=r-S,_=r-(m-g-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,R=0,P=0;P{var e=0,i=function(t,i,s,n){var r=e-n.y-n.height;t.add(s,i,n.x,r,n.width,n.height)};t.exports=function(t,s,n){var r=t.source[s];t.add("__BASE",s,0,0,r.width,r.height),e=r.height;for(var o=n.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",u={x:0,y:0,width:0,height:0},c=0;c{t.exports={AtlasXML:i(35082),Canvas:i(83332),Image:i(21560),JSONArray:i(64423),JSONHash:i(17264),KTXParser:i(67409),PVRParser:i(24904),SpriteSheet:i(6143),SpriteSheetFromAtlas:i(20030),UnityYAML:i(89187)}},93560:t=>{t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},97042:(t,e,i)=>{var s=new(i(56694))({initialize:function(t,e,i,s,n,r,o){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===n&&(n=0),void 0===r&&(r=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|s,this.imageMargin=0|n,this.imageSpacing=0|r,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t{var s=new(i(56694))({initialize:function(t){if(this.gids=[],void 0!==t)for(var e=0;e{var s=i(93560),n=i(16586),r=i(90715),o=i(89797);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=r(void 0!==e?e:"map",s.ARRAY_2D,u,i,a,c);else if(void 0!==e){var f=t.cache.tilemap.get(e);f?d=r(e,f.format,f.data,i,a,c):console.warn("No map data found for key "+e)}return null===d&&(d=new n({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},29633:(t,e,i)=>{var s=i(56694),n=i(64937),r=i(12920),o=i(28699),a=i(66658),h=new s({Mixins:[n.AlphaSingle,n.Flip,n.Visible],initialize:function(t,e,i,s,n,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=s,this.width=n,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:n,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.tintFill=!1,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=o(t.properties),this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).x:this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldXY(this.x,this.y,void 0,t).y:this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new a),e.x=this.getLeft(t),e.y=this.getTop(t),e.width=this.getRight(t)-e.x,e.height=this.getBottom(t)-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,s){return!(i<=this.pixelX||s<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,s,n){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===s&&(s=t),void 0===n&&(n=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=s,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=s,n&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,s){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==s&&(this.baseHeight=s),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===r.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===r.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===r.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===r.HEXAGONAL){var e,i,s=this.layer.staggerAxis,n=this.layer.staggerIndex,o=this.layer.hexSideLength;"y"===s?(i=(this.baseHeight-o)/2+o,this.pixelX="odd"===n?this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*i):"x"===s&&(e=(this.baseWidth-o)/2+o,this.pixelX=this.x*e,this.pixelY="odd"===n?this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=h},89797:(t,e,i)=>{var s=i(14556),n=i(56694),r=i(75606),o=i(93560),a=i(72632),h=i(94990),l=i(46422),u=i(12920),c=i(52257),d=i(72677),f=i(13747),p=i(29633),g=i(5047),v=i(87177),m=i(47975),y=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tiles=e.tiles,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:g.GetWorldToTileXYFunction(i),WorldToTileX:g.GetWorldToTileXFunction(i),WorldToTileY:g.GetWorldToTileYFunction(i),TileToWorldXY:g.GetTileToWorldXYFunction(i),TileToWorldX:g.GetTileToWorldXFunction(i),TileToWorldY:g.GetTileToWorldYFunction(i),GetTileCorners:g.GetTileCornersFunction(i)}},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,r,a,h,l){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var u=this.scene.sys.textures.get(e),c=this.getTilesetIndex(t);if(null===c&&this.format===o.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var d=this.tilesets[c];return d?(d.setTileSize(i,n),d.setSpacing(r,a),d.setImage(u),d):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===a&&(a=0),void 0===h&&(h=0),void 0===l&&(l={x:0,y:0}),(d=new m(t,h,i,n,r,a,void 0,void 0,l)).setImage(u),this.tilesets.push(d),this.tiles=s(this),d)},copy:function(t,e,i,s,n,r,o,a){return null!==(a=this.getLayer(a))?(g.Copy(t,e,i,s,n,r,o,a),this):null},createBlankLayer:function(t,e,i,s,n,r,o,a){if(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=this.width),void 0===r&&(r=this.height),void 0===o&&(o=this.tileWidth),void 0===a&&(a=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,u=new h({name:t,tileWidth:o,tileHeight:a,width:n,height:r,orientation:this.orientation}),c=0;c-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return s},removeTileAt:function(t,e,i,s,n){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(n=this.getLayer(n))?null:g.RemoveTileAt(t,e,i,s,n)},removeTileAtWorldXY:function(t,e,i,s,n,r){return void 0===i&&(i=!0),void 0===s&&(s=!0),null===(r=this.getLayer(r))?null:g.RemoveTileAtWorldXY(t,e,i,s,n,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===u.ORTHOGONAL&&g.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,s=0;s{var s=i(99325),n=i(15043);s.register("tilemap",(function(t){var e=void 0!==t?t:{};return n(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},37940:(t,e,i)=>{var s=i(61286),n=i(15043);s.register("tilemap",(function(t,e,i,s,r,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===s&&(s=void 0),null===r&&(r=void 0),n(this.scene,t,e,i,s,r,o,a)}))},87177:(t,e,i)=>{var s=i(56694),n=i(95239),r=i(64937),o=i(89980),a=i(5047),h=i(96193),l=i(93736),u=new s({Extends:o,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,n,h],initialize:function(t,e,i,s,n,r){o.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=a.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new l,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(s),this.setAlpha(this.layer.alpha),this.setPosition(n,r),this.setOrigin(0,0),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(t){var e=[],i=[],s=this.tilemap;Array.isArray(t)||(t=[t]);for(var n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,s){return a.CalculateFacesWithin(t,e,i,s,this.layer),this},createFromTiles:function(t,e,i,s,n){return a.CreateFromTiles(t,e,i,s,n,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,s,n,r,o){return a.Copy(t,e,i,s,n,r,o,this.layer),this},fill:function(t,e,i,s,n,r){return a.Fill(t,e,i,s,n,r,this.layer),this},filterTiles:function(t,e,i,s,n,r,o){return a.FilterTiles(t,e,i,s,n,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,s,n,r,o){return a.FindTile(t,e,i,s,n,r,o,this.layer)},forEachTile:function(t,e,i,s,n,r,o){return a.ForEachTile(t,e,i,s,n,r,o,this.layer),this},setTint:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!1}),this,e,i,s,n,r)},setTintFill:function(t,e,i,s,n,r){return void 0===t&&(t=16777215),this.forEachTile((function(e){e.tint=t,e.tintFill=!0}),this,e,i,s,n,r)},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,s){return a.GetTileAtWorldXY(t,e,i,s,this.layer)},getIsoTileAtWorldXY:function(t,e,i,s,n){void 0===i&&(i=!0);var r=this.tempVec;return a.IsometricWorldToTileXY(t,e,!0,r,n,this.layer,i),this.getTileAt(r.x,r.y,s)},getTilesWithin:function(t,e,i,s,n){return a.GetTilesWithin(t,e,i,s,n,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,s,n,r){return a.GetTilesWithinWorldXY(t,e,i,s,n,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,s){return a.PutTileAt(t,e,i,s,this.layer)},putTileAtWorldXY:function(t,e,i,s,n){return a.PutTileAtWorldXY(t,e,i,s,n,this.layer)},putTilesAt:function(t,e,i,s){return a.PutTilesAt(t,e,i,s,this.layer),this},randomize:function(t,e,i,s,n){return a.Randomize(t,e,i,s,n,this.layer),this},removeTileAt:function(t,e,i,s){return a.RemoveTileAt(t,e,i,s,this.layer)},removeTileAtWorldXY:function(t,e,i,s,n){return a.RemoveTileAtWorldXY(t,e,i,s,n,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,s,n,r){return a.ReplaceByIndex(t,e,i,s,n,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,s){return a.SetCollision(t,e,i,this.layer,s),this},setCollisionBetween:function(t,e,i,s){return a.SetCollisionBetween(t,e,i,s,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,s,n,r){return a.SetTileLocationCallback(t,e,i,s,n,r,this.layer),this},shuffle:function(t,e,i,s){return a.Shuffle(t,e,i,s,this.layer),this},swapByIndex:function(t,e,i,s,n,r){return a.SwapByIndex(t,e,i,s,n,r,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,s){return this.tilemap.tileToWorldXY(t,e,i,s,this)},getTileCorners:function(t,e,i){return this.tilemap.getTileCorners(t,e,i,this)},weightedRandomize:function(t,e,i,s,n){return a.WeightedRandomize(e,i,s,n,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,s,n){return this.tilemap.worldToTileXY(t,e,i,s,n,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))}});t.exports=u},17394:(t,e,i)=>{var s=i(69360),n=new s,r=new s,o=new s;t.exports=function(t,e,i,s){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var u=n,c=r,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var f=t.currentContext,p=e.gidMap;f.save(),s?(u.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(f)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(f)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(f.imageSmoothingEnabled=!1);for(var g=0;g{var s,n,r=i(72283);s=i(51395),n=i(17394),t.exports={renderWebGL:s,renderCanvas:n}},51395:(t,e,i)=>{var s=i(75512);t.exports=function(t,e,i){var n=e.cull(i),r=n.length,o=i.alpha*e.alpha;if(!(0===r||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=s.getTintAppendFloatAlpha,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,f=e.y,p=e.scaleX,g=e.scaleY;t.pipelines.preBatch(e);for(var v=0;v{var s=i(56694),n=i(93736),r=new s({initialize:function(t,e,i,s,r,o,a,h,l){(void 0===i||i<=0)&&(i=32),(void 0===s||s<=0)&&(s=32),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a={}),void 0===h&&(h={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=s,this.tileMargin=r,this.tileSpacing=o,this.tileProperties=a,this.tileData=h,this.tileOffset=new n,void 0!==l&&this.tileOffset.set(l.x,l.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t{var s=i(15494);t.exports=function(t,e,i){var n=s(t,e,!0,i),r=s(t,e-1,!0,i),o=s(t,e+1,!0,i),a=s(t-1,e,!0,i),h=s(t+1,e,!0,i),l=n&&n.collides;return l&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),r&&r.collides&&(l&&(n.faceTop=!1),r.faceBottom=!l),o&&o.collides&&(l&&(n.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(n.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(n.faceRight=!1),h.faceLeft=!l),n&&!n.collides&&n.resetFaces(),n}},60386:(t,e,i)=>{var s=i(15494),n=i(50811);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=n(t,e,i,r,null,o),d=0;d{var s=new(i(93736));t.exports=function(t,e,i,n){var r=i.tilemapLayer,o=r.cullPaddingX,a=r.cullPaddingY,h=r.tilemap.tileToWorldXY(t,e,s,n,r);return h.x>n.worldView.x+r.scaleX*i.tileWidth*(-o-.5)&&h.xn.worldView.y+r.scaleY*i.tileHeight*(-a-1)&&h.y{var s=i(60386),n=i(50811),r=i(62839),o=i(29633);t.exports=function(t,e,i,a,h,l,u,c){void 0===u&&(u=!0);var d=n(t,e,i,a,null,c),f=[];d.forEach((function(t){var e=new o(t.layer,t.index,t.x,t.y,t.width,t.height,t.baseWidth,t.baseHeight);e.copy(t),f.push(e)}));for(var p=h-t,g=l-e,v=0;v{var s=i(50811),n=i(51202);t.exports=function(t,e,i,r,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;r||(r=h.scene),o||(o=r.cameras.main);var l,u=s(0,0,a.width,a.height,null,a),c=[];for(l=0;l{var s=i(74118),n=i(82127),r=i(84314),o=new s;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,a=Math.floor(i.tileWidth*s.scaleX),h=Math.floor(i.tileHeight*s.scaleY),l=r(e.worldView.x-s.x,a,0,!0)-s.cullPaddingX,u=n(e.worldView.right-s.x,a,0,!0)+s.cullPaddingX,c=r(e.worldView.y-s.y,h,0,!0)-s.cullPaddingY,d=n(e.worldView.bottom-s.y,h,0,!0)+s.cullPaddingY;return o.setTo(l,c,u-l,d-c)}},381:(t,e,i)=>{var s=i(71586),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},97734:(t,e,i)=>{var s=i(50811),n=i(60386),r=i(68234);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=s(e,i,o,a,null,l),d=0;d{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).filter(t,e)}},37982:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=!1);var n,r,o,a=0;if(i){for(r=s.height-1;r>=0;r--)for(n=s.width-1;n>=0;n--)if((o=s.data[r][n])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;r{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){return s(i,n,r,o,a,h).find(t,e)||null}},80916:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a,h){s(i,n,r,o,a,h).forEach(t,e)}},31493:(t,e,i)=>{var s=i(12920),n=i(381),r=i(37524),o=i(20887),a=i(72283),h=i(19242);t.exports=function(t){return t===s.ORTHOGONAL?n:t===s.HEXAGONAL?r:t===s.STAGGERED?h:t===s.ISOMETRIC?o:a}},15494:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),s(t,e,n)){var r=n.data[e][t]||null;return r?-1===r.index?i?r:null:r:null}return null}},24640:(t,e,i)=>{var s=i(15494),n=new(i(93736));t.exports=function(t,e,i,r,o){return o.tilemapLayer.worldToTileXY(t,e,!0,n,r),s(n.x,n.y,i,o)}},48495:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n){var r=n.baseTileWidth,o=n.baseTileHeight,a=n.tilemapLayer,h=0,l=0;a&&(i||(i=a.scene.cameras.main),h=a.x+i.scrollX*(1-a.scrollFactorX),l=a.y+i.scrollY*(1-a.scrollFactorY),r*=a.scaleX,o*=a.scaleY);var u=h+t*r,c=l+e*o;return[new s(u,c),new s(u+r,c),new s(u+r,c+o),new s(u,c+o)]}},7160:(t,e,i)=>{var s=i(12920),n=i(63634),r=i(72283),o=i(48495);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:(s.STAGGERED,r)}},16884:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(44150);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},68182:(t,e,i)=>{var s=i(12920),n=i(21715),r=i(21808),o=i(72283),a=i(33388),h=i(46836);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},3752:(t,e,i)=>{var s=i(12920),n=i(72283),r=i(84132),o=i(42477);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.STAGGERED?r:n}},50811:(t,e,i)=>{var s=i(72632);t.exports=function(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===n&&(n=o.height),r||(r={});var a=s(r,"isNotEmpty",!1),h=s(r,"isColliding",!1),l=s(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(n+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+n>o.height&&(n=Math.max(o.height-e,0));for(var u=[],c=e;c{var s=i(84068),n=i(50811),r=i(7563),o=i(72283),a=i(93736),h=function(t,e){return r.RectangleToTriangle(e,t)},l=new a,u=new a,c=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof s.Circle?d=r.CircleToRectangle:t instanceof s.Rectangle?d=r.RectangleToRectangle:t instanceof s.Triangle?d=h:t instanceof s.Line&&(d=r.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,u,i);var f=u.x,p=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!1,c,i);var g=Math.ceil(c.x),v=Math.ceil(c.y),m=Math.max(g-f,1),y=Math.max(v-p,1),x=n(f,p,m,y,e,a),T=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(T*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var b=[],E=new s.Rectangle(0,0,T,w),S=0;S{var s=i(50811),n=i(93736),r=new n,o=new n;t.exports=function(t,e,i,n,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,r,h,l);var c=r.x,d=r.y;u(t+i,e+n,!1,o,h,l);var f=Math.ceil(o.x),p=Math.ceil(o.y);return s(c,d,f-c,p-d,a,l)}},29296:(t,e,i)=>{var s=i(12920),n=i(10618),r=i(806);t.exports=function(t){return t===s.ORTHOGONAL?r:n}},32688:(t,e,i)=>{var s=i(12920),n=i(11516),r=i(18750),o=i(72283),a=i(90562),h=i(45676);t.exports=function(t){return t===s.ORTHOGONAL?h:t===s.ISOMETRIC?r:t===s.HEXAGONAL?n:t===s.STAGGERED?a:o}},74326:(t,e,i)=>{var s=i(12920),n=i(10618),r=i(3689),o=i(70520);t.exports=function(t){return t===s.ORTHOGONAL?o:t===s.STAGGERED?r:n}},46598:(t,e,i)=>{var s=i(62839);t.exports=function(t,e,i){if(s(t,e,i)){var n=i.data[e][t];return null!==n&&n.index>-1}return!1}},28654:(t,e,i)=>{var s=i(46598),n=new(i(93736));t.exports=function(t,e,i,r){r.tilemapLayer.worldToTileXY(t,e,!0,n,i);var o=n.x,a=n.y;return s(o,a,r)}},6358:(t,e,i)=>{var s=i(82127),n=i(84314);t.exports=function(t,e){var i,r,o,a,h=t.tilemapLayer.tilemap,l=t.tilemapLayer,u=Math.floor(h.tileWidth*l.scaleX),c=Math.floor(h.tileHeight*l.scaleY),d=t.hexSideLength;if("y"===t.staggerAxis){var f=(c-d)/2+d;i=n(e.worldView.x-l.x,u,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,u,0,!0)+l.cullPaddingX,o=n(e.worldView.y-l.y,f,0,!0)-l.cullPaddingY,a=s(e.worldView.bottom-l.y,f,0,!0)+l.cullPaddingY}else{var p=(u-d)/2+d;i=n(e.worldView.x-l.x,p,0,!0)-l.cullPaddingX,r=s(e.worldView.right-l.x,p,0,!0)+l.cullPaddingX,o=n(e.worldView.y-l.y,c,0,!0)-l.cullPaddingY,a=s(e.worldView.bottom-l.y,c,0,!0)+l.cullPaddingY}return{left:i,right:r,top:o,bottom:a}}},37524:(t,e,i)=>{var s=i(6358),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},63634:(t,e,i)=>{var s=i(21715),n=i(93736),r=new n;t.exports=function(t,e,i,o){var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(a*=l.scaleX,h*=l.scaleY);var u,c,d=s(t,e,r,i,o),f=[],p=.5773502691896257;"y"===o.staggerAxis?(u=p*a,c=h/2):(u=a/2,c=p*h);for(var g=0;g<6;g++){var v=2*Math.PI*(.5-g)/6;f.push(new n(d.x+u*Math.cos(v),d.y+c*Math.sin(v)))}return f}},21715:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),u=h.y+n.scrollY*(1-h.scrollFactorY),o*=h.scaleX,a*=h.scaleY);var c,d,f=o/2,p=a/2;return"y"===r.staggerAxis?(c=l+o*t+o,d=u+1.5*e*p+p,e%2==0&&("odd"===this.staggerIndex?c-=f:c+=f)):"x"===this.staggerAxis&&"odd"===this.staggerIndex&&(c=l+1.5*t*f+f,d=u+a*t+a,t%2==0&&("odd"===this.staggerIndex?d-=p:d+=p)),i.set(c,d)}},11516:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),a*=l.scaleX,h*=l.scaleY);var u,c,d,f,p,g=.5773502691896257,v=-.3333333333333333,m=.6666666666666666,y=a/2,x=h/2;"y"===o.staggerAxis?(d=g*(u=(t-y)/(g*a))+v*(c=(e-x)/x),f=0*u+m*c):(d=v*(u=(t-y)/y)+g*(c=(e-x)/(g*h)),f=m*u+0*c),p=-d-f;var T,w=Math.round(d),b=Math.round(f),E=Math.round(p),S=Math.abs(w-d),A=Math.abs(b-f),_=Math.abs(E-p);S>A&&S>_?w=-b-E:A>_&&(b=-w-E);var C=b;return T="odd"===o.staggerIndex?C%2==0?b/2+w:b/2+w-.5:C%2==0?b/2+w:b/2+w+.5,n.set(T,C)}},62839:t=>{t.exports=function(t,e,i){return t>=0&&t=0&&e{var s=i(13125);t.exports=function(t,e,i,n){void 0===i&&(i=[]),void 0===n&&(n=0),i.length=0;var r,o,a,h=t.tilemapLayer,l=t.data,u=t.width,c=t.height,d=h.skipCull,f=u,p=c;if(0===n){for(o=0;o=0;r--)if(d||s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===n){for(o=p;o>=0;o--)for(r=0;r=0;o--)for(r=f;r>=0;r--)if(d||s(r,o,t,e)){if(!(a=l[o][r])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=u*c,i}},21808:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},18750:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o,a){n||(n=new s);var h=o.baseTileWidth,l=o.baseTileHeight,u=o.tilemapLayer;u&&(r||(r=u.scene.cameras.main),e-=u.y+r.scrollY*(1-u.scrollFactorY),l*=u.scaleY,t-=u.x+r.scrollX*(1-u.scrollFactorX),h*=u.scaleX);var c=h/2,d=l/2;a||(e-=l);var f=.5*((t-=c)/c+e/d),p=.5*(-t/c+e/d);return i&&(f=Math.floor(f),p=Math.floor(p)),n.set(f,p)}},29003:(t,e,i)=>{var s=i(29633),n=i(62839),r=i(92839),o=i(68234);t.exports=function(t,e,i,a,h){if(void 0===a&&(a=!0),!n(e,i,h))return null;var l,u=h.data[i][e],c=u&&u.collides;t instanceof s?(null===h.data[i][e]&&(h.data[i][e]=new s(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t)):(l=t,null===h.data[i][e]?h.data[i][e]=new s(h,l,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=l);var d=h.data[i][e],f=-1!==h.collideIndexes.indexOf(d.index);if(-1===(l=t instanceof s?t.index:t))d.width=h.tileWidth,d.height=h.tileHeight;else{var p=h.tilemapLayer.tilemap,g=p.tiles[l][2],v=p.tilesets[g];d.width=v.tileWidth,d.height=v.tileHeight}return o(d,f),a&&c!==d.collides&&r(e,i,h),d}},48565:(t,e,i)=>{var s=i(29003),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,n,o,a),s(t,n.x,n.y,r,a)}},56547:(t,e,i)=>{var s=i(60386),n=i(29003);t.exports=function(t,e,i,r,o){if(void 0===r&&(r=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l{var s=i(50811),n=i(72861);t.exports=function(t,e,i,r,o,a){var h,l=s(t,e,i,r,{},a);if(!o)for(o=[],h=0;h{var s=i(29633),n=i(62839),r=i(92839);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!n(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new s(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&r(t,e,a),h):null}},17384:(t,e,i)=>{var s=i(929),n=new(i(93736));t.exports=function(t,e,i,r,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,n,o,a),s(n.x,n.y,i,r,a)}},93763:(t,e,i)=>{var s=i(50811),n=i(95509),r=new n(105,210,231,150),o=new n(243,134,48,200),a=new n(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var n=void 0!==e.tileColor?e.tileColor:r,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,u=s(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var c=0;c{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i,s){var n,r,o,a=t.data,h=t.width,l=t.height,u=t.tilemapLayer,c=Math.max(0,e.left),d=Math.min(h,e.right),f=Math.max(0,e.top),p=Math.min(l,e.bottom);if(0===i)for(r=f;r=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);else if(2===i)for(r=p;r>=f;r--)for(n=c;a[r]&&n=f;r--)for(n=d;a[r]&&n>=c;n--)(o=a[r][n])&&-1!==o.index&&o.visible&&0!==o.alpha&&s.push(o);return u.tilesDrawn=s.length,u.tilesTotal=h*l,s}},51710:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&s(d,i)}o&&n(0,0,a.width,a.height,a)}}},33158:(t,e,i)=>{var s=i(68234),n=i(60386),r=i(91181);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a{var s=i(68234),n=i(60386),r=i(19256);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a{var s=i(68234),n=i(60386);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var r=0;r0&&s(a,t)}}e&&n(0,0,i.width,i.height,i)}},91181:t=>{t.exports=function(t,e,i){var s=i.collideIndexes.indexOf(t);e&&-1===s?i.collideIndexes.push(t):e||-1===s||i.collideIndexes.splice(s,1)}},68234:t=>{t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},11628:t=>{t.exports=function(t,e,i,s){if("number"==typeof t)s.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var n=0,r=t.length;n{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(t,e,i,n,null,a),l=0;l{var s=i(50811),n=i(18592);t.exports=function(t,e,i,r,o){var a=s(t,e,i,r,null,o),h=a.map((function(t){return t.index}));n(h);for(var l=0;l{var s=i(82127),n=i(84314);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,r=t.tilemapLayer,o=Math.floor(i.tileWidth*r.scaleX),a=Math.floor(i.tileHeight*r.scaleY);return{left:n(e.worldView.x-r.x,o,0,!0)-r.cullPaddingX,right:s(e.worldView.right-r.x,o,0,!0)+r.cullPaddingX,top:n(e.worldView.y-r.y,a/2,0,!0)-r.cullPaddingY,bottom:s(e.worldView.bottom-r.y,a/2,0,!0)+r.cullPaddingY}}},19242:(t,e,i)=>{var s=i(53945),n=i(6987);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var o=t.tilemapLayer,a=s(t,e);return o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),n(t,a,r,i),i}},33388:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r){i||(i=new s);var o=r.baseTileWidth,a=r.baseTileHeight,h=r.tilemapLayer,l=0,u=0;h&&(n||(n=h.scene.cameras.main),l=h.x+n.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+n.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},84132:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(void 0===e&&(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*(s/2)+s}},90562:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),e-=l.y+r.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+r.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return n.set(c,u)}},3689:t=>{t.exports=function(t,e,i,s){var n=s.baseTileHeight,r=s.tilemapLayer;return r&&(i||(i=r.scene.cameras.main),t-=r.y+i.scrollY*(1-r.scrollFactorY),n*=r.scaleY),e?Math.floor(t/(n/2)):t/(n/2)}},55217:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o,a){for(var h=s(i,n,r,o,null,a),l=0;l{t.exports=function(t,e,i){var s=i.baseTileWidth,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.x+e.scrollX*(1-n.scrollFactorX),s*=n.scaleX),r+t*s}},46836:(t,e,i)=>{var s=i(44150),n=i(42477),r=i(93736);t.exports=function(t,e,i,o,a){return i||(i=new r(0,0)),i.x=s(t,o,a),i.y=n(e,o,a),i}},42477:t=>{t.exports=function(t,e,i){var s=i.baseTileHeight,n=i.tilemapLayer,r=0;return n&&(e||(e=n.scene.cameras.main),r=n.y+e.scrollY*(1-n.scrollFactorY),s*=n.scaleY),r+t*s}},39677:(t,e,i)=>{var s=i(50811);t.exports=function(t,e,i,n,r,o){if(r){var a,h=s(t,e,i,n,null,o),l=0;for(a=0;a{var s=i(45676),n=new(i(93736));t.exports=function(t,e,i,r){return s(t,0,e,n,i,r),n.x}},45676:(t,e,i)=>{var s=i(93736);t.exports=function(t,e,i,n,r,o){void 0===i&&(i=!0),n||(n=new s);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(r||(r=l.scene.cameras.main),t-=l.x+r.scrollX*(1-l.scrollFactorX),e-=l.y+r.scrollY*(1-l.scrollFactorY),a*=l.scaleX,h*=l.scaleY);var u=t/a,c=e/h;return i&&(u=Math.floor(u),c=Math.floor(c)),n.set(u,c)}},70520:(t,e,i)=>{var s=i(45676),n=new(i(93736));t.exports=function(t,e,i,r){return s(0,t,e,n,i,r),n.y}},5047:(t,e,i)=>{t.exports={CalculateFacesAt:i(92839),CalculateFacesWithin:i(60386),CheckIsoBounds:i(13125),Copy:i(17347),CreateFromTiles:i(93604),CullBounds:i(71586),CullTiles:i(381),Fill:i(97734),FilterTiles:i(63555),FindByIndex:i(37982),FindTile:i(48297),ForEachTile:i(80916),GetCullTilesFunction:i(31493),GetTileAt:i(15494),GetTileAtWorldXY:i(24640),GetTileCorners:i(48495),GetTileCornersFunction:i(7160),GetTilesWithin:i(50811),GetTilesWithinShape:i(31674),GetTilesWithinWorldXY:i(44662),GetTileToWorldXFunction:i(16884),GetTileToWorldXYFunction:i(68182),GetTileToWorldYFunction:i(3752),GetWorldToTileXFunction:i(29296),GetWorldToTileXYFunction:i(32688),GetWorldToTileYFunction:i(74326),HasTileAt:i(46598),HasTileAtWorldXY:i(28654),HexagonalCullBounds:i(6358),HexagonalCullTiles:i(37524),HexagonalGetTileCorners:i(63634),HexagonalTileToWorldXY:i(21715),HexagonalWorldToTileXY:i(11516),IsInLayerBounds:i(62839),IsometricCullTiles:i(20887),IsometricTileToWorldXY:i(21808),IsometricWorldToTileXY:i(18750),PutTileAt:i(29003),PutTileAtWorldXY:i(48565),PutTilesAt:i(56547),Randomize:i(91180),RemoveTileAt:i(929),RemoveTileAtWorldXY:i(17384),RenderDebug:i(93763),ReplaceByIndex:i(51202),RunCull:i(6987),SetCollision:i(51710),SetCollisionBetween:i(15216),SetCollisionByExclusion:i(33158),SetCollisionByProperty:i(4180),SetCollisionFromCollisionGroup:i(18625),SetLayerCollisionIndex:i(91181),SetTileCollision:i(68234),SetTileIndexCallback:i(11628),SetTileLocationCallback:i(72732),Shuffle:i(34397),StaggeredCullBounds:i(53945),StaggeredCullTiles:i(19242),StaggeredTileToWorldXY:i(33388),StaggeredTileToWorldY:i(84132),StaggeredWorldToTileXY:i(90562),StaggeredWorldToTileY:i(3689),SwapByIndex:i(55217),TileToWorldX:i(44150),TileToWorldXY:i(46836),TileToWorldY:i(42477),WeightedRandomize:i(39677),WorldToTileX:i(806),WorldToTileXY:i(45676),WorldToTileY:i(70520)}},12920:t=>{t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},84758:(t,e,i)=>{var s={ORIENTATION:i(12920)};t.exports=s},52678:(t,e,i)=>{var s=i(98611),n=i(84758),r={Components:i(5047),Parsers:i(34124),Formats:i(93560),ImageCollection:i(97042),ParseToTilemap:i(15043),Tile:i(29633),Tilemap:i(89797),TilemapCreator:i(4843),TilemapFactory:i(37940),Tileset:i(47975),TilemapLayer:i(87177),Orientation:i(12920),LayerData:i(94990),MapData:i(16586),ObjectLayer:i(15256)};r=s(!1,r,n.ORIENTATION),t.exports=r},94990:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","layer"),this.id=r(t,"id",0),this.x=r(t,"x",0),this.y=r(t,"y",0),this.width=r(t,"width",0),this.height=r(t,"height",0),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.baseTileWidth=r(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=r(t,"baseTileHeight",this.tileHeight),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.widthInPixels=r(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=r(t,"alpha",1),this.visible=r(t,"visible",!0),this.properties=r(t,"properties",[]),this.indexes=r(t,"indexes",[]),this.collideIndexes=r(t,"collideIndexes",[]),this.callbacks=r(t,"callbacks",[]),this.bodies=r(t,"bodies",[]),this.data=r(t,"data",[]),this.tilemapLayer=r(t,"tilemapLayer",null),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=o},16586:(t,e,i)=>{var s=i(56694),n=i(12920),r=i(72632),o=new s({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","map"),this.width=r(t,"width",0),this.height=r(t,"height",0),this.infinite=r(t,"infinite",!1),this.tileWidth=r(t,"tileWidth",0),this.tileHeight=r(t,"tileHeight",0),this.widthInPixels=r(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=r(t,"heightInPixels",this.height*this.tileHeight),this.format=r(t,"format",null),this.orientation=r(t,"orientation",n.ORTHOGONAL),this.renderOrder=r(t,"renderOrder","right-down"),this.version=r(t,"version","1"),this.properties=r(t,"properties",{}),this.layers=r(t,"layers",[]),this.images=r(t,"images",[]),this.objects=r(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=r(t,"collision",{}),this.tilesets=r(t,"tilesets",[]),this.imageCollections=r(t,"imageCollections",[]),this.tiles=r(t,"tiles",[]),this.hexSideLength=r(t,"hexSideLength",0),this.staggerAxis=r(t,"staggerAxis","y"),this.staggerIndex=r(t,"staggerIndex","odd")}});t.exports=o},15256:(t,e,i)=>{var s=i(56694),n=i(72632),r=new s({initialize:function(t){void 0===t&&(t={}),this.name=n(t,"name","object layer"),this.id=n(t,"id",0),this.opacity=n(t,"opacity",1),this.properties=n(t,"properties",{}),this.propertyTypes=n(t,"propertytypes",{}),this.type=n(t,"type","objectgroup"),this.visible=n(t,"visible",!0),this.objects=n(t,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});t.exports=r},21394:(t,e,i)=>{var s=i(12920);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?s.ISOMETRIC:"staggered"===t?s.STAGGERED:"hexagonal"===t?s.HEXAGONAL:s.ORTHOGONAL}},90715:(t,e,i)=>{var s=i(93560),n=i(84346),r=i(96097),o=i(2378),a=i(44909);t.exports=function(t,e,i,h,l,u){var c;switch(e){case s.ARRAY_2D:c=n(t,i,h,l,u);break;case s.CSV:c=r(t,i,h,l,u);break;case s.TILED_JSON:c=o(t,i,u);break;case s.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},84346:(t,e,i)=>{var s=i(93560),n=i(94990),r=i(16586),o=i(29633);t.exports=function(t,e,i,a,h){for(var l=new n({tileWidth:i,tileHeight:a}),u=new r({name:t,tileWidth:i,tileHeight:a,format:s.ARRAY_2D,layers:[l]}),c=[],d=e.length,f=0,p=0;p{var s=i(93560),n=i(84346);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=n(t,a,i,r,o);return h.format=s.CSV,h}},30951:(t,e,i)=>{var s=i(94990),n=i(29633);t.exports=function(t,e){for(var i=[],r=0;r-1?new n(a,f,c,u,o.tilesize,o.tilesize):e?null:new n(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},47488:(t,e,i)=>{var s=i(47975);t.exports=function(t){for(var e=[],i=[],n=0;n{var s=i(93560),n=i(16586),r=i(30951),o=i(47488);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new n({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:s.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},24507:(t,e,i)=>{t.exports={ParseTileLayers:i(30951),ParseTilesets:i(47488),ParseWeltmeister:i(44909)}},34124:(t,e,i)=>{t.exports={FromOrientationString:i(21394),Parse:i(90715),Parse2DArray:i(84346),ParseCSV:i(96097),Impact:i(24507),Tiled:i(50044)}},48646:(t,e,i)=>{var s=i(98611);t.exports=function(t){for(var e,i,n,r,o,a=0;a{t.exports=function(t){for(var e=window.atob(t),i=e.length,s=new Array(i/4),n=0;n>>0;return s}},14556:(t,e,i)=>{var s=i(47975);t.exports=function(t){var e,i,n=[];for(e=0;e{var s=i(72632);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+s(e,"startx",0)*t.tilewidth+s(e,"offsetx",0),r=e.y+s(e,"starty",0)*t.tileheight+s(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+r}}},8847:t=>{t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),s=Boolean(536870912&t);t&=536870911;var n=0,r=!1;return e&&i&&s?(n=Math.PI/2,r=!0):e&&i&&!s?(n=Math.PI,r=!1):e&&!i&&s?(n=Math.PI/2,r=!1):!e||i||s?!e&&i&&s?(n=3*Math.PI/2,r=!1):e||!i||s?e||i||!s?e||i||s||(n=0,r=!1):(n=3*Math.PI/2,r=!0):(n=Math.PI,r=!0):(n=0,r=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:s,rotation:n,flipped:r}}},78339:(t,e,i)=>{var s=i(72632),n=i(92044);t.exports=function(t){for(var e=[],i=[],r=n(t);r.i0;)if(r.i>=r.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=i.pop()}else{var o=r.layers[r.i];if(r.i++,"imagelayer"===o.type){var a=s(o,"offsetx",0)+s(o,"startx",0),h=s(o,"offsety",0)+s(o,"starty",0);e.push({name:r.name+o.name,image:o.image,x:r.x+a+o.x,y:r.y+h+o.y,alpha:r.opacity*o.opacity,visible:r.visible&&o.visible,properties:s(o,"properties",{})})}else if("group"===o.type){var l=n(t,o,r);i.push(r),r=l}}return e}},2378:(t,e,i)=>{var s=i(48646),n=i(14556),r=i(12920),o=i(28699),a=i(93560),h=i(21394),l=i(16586),u=i(78339),c=i(61136),d=i(95925),f=i(93392);t.exports=function(t,e,i){var p=o(e),g=new l({width:p.width,height:p.height,name:t,tileWidth:p.tilewidth,tileHeight:p.tileheight,orientation:h(p.orientation),format:a.TILED_JSON,version:p.version,properties:p.properties,renderOrder:p.renderorder,infinite:p.infinite});g.orientation===r.HEXAGONAL&&(g.hexSideLength=p.hexsidelength,g.staggerAxis=p.staggeraxis,g.staggerIndex=p.staggerindex),g.layers=d(p,i),g.images=u(p);var v=f(p);return g.tilesets=v.tilesets,g.imageCollections=v.imageCollections,g.objects=c(p),g.tiles=n(g),s(g),g}},4281:(t,e,i)=>{var s=i(28820),n=i(8847),r=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=s(t,o);if(a.x+=e,a.y+=i,t.gid){var h=n(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(r):t.polygon?a.polygon=t.polygon.map(r):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},61136:(t,e,i)=>{var s=i(72632),n=i(4281),r=i(15256),o=i(92044);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+s(h,"startx",0)+s(h,"offsetx",0),u=a.y+s(h,"starty",0)+s(h,"offsety",0),c=[],d=0;d{var s=i(43908),n=i(12920),r=i(92044),o=i(21394),a=i(72632),h=i(94990),l=i(8847),u=i(29633);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],f=r(t);f.i0;)if(f.i>=f.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}f=d.pop()}else{var p=f.layers[f.i];if(f.i++,"tilelayer"===p.type)if(p.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+p.name+"'");else{if(p.encoding&&"base64"===p.encoding){if(p.chunks)for(var g=0;g0?((y=new u(v,m.gid,L,F,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,T[F][L]=y):(x=e?null:new u(v,-1,L,F,t.tilewidth,t.tileheight),T[F][L]=x),++w===_.width&&(R++,w=0)}}else{(v=new h({name:f.name+p.name,id:p.id,x:f.x+a(p,"offsetx",0)+p.x,y:f.y+a(p,"offsety",0)+p.y,width:p.width,height:p.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:f.opacity*p.opacity,visible:f.visible&&p.visible,properties:a(p,"properties",[]),orientation:o(t.orientation)})).orientation===n.HEXAGONAL&&(v.hexSideLength=t.hexsidelength,v.staggerAxis=t.staggeraxis,v.staggerIndex=t.staggerindex);for(var D=[],k=0,I=p.data.length;k0?((y=new u(v,m.gid,w,T.length,t.tilewidth,t.tileheight)).rotation=m.rotation,y.flipX=m.flipped,D.push(y)):(x=e?null:new u(v,-1,w,T.length,t.tilewidth,t.tileheight),D.push(x)),++w===p.width&&(T.push(D),w=0,D=[])}v.data=T,c.push(v)}else if("group"===p.type){var B=r(t,p,f);d.push(f),f=B}}return c}},93392:(t,e,i)=>{var s=i(47975),n=i(97042),r=i(4281),o=i(39642);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l1){var d=void 0,f=void 0;if(Array.isArray(u.tiles)){d=d||{},f=f||{};for(var p=0;p{t.exports=function(t,e){for(var i=0;i0){var r,o,a,h={},l={};if(Array.isArray(s.edgecolors))for(r=0;r{t.exports={AssignTileProperties:i(48646),Base64Decode:i(43908),BuildTilesetIndex:i(14556),CreateGroupLayer:i(92044),ParseGID:i(8847),ParseImageLayers:i(78339),ParseJSONTiled:i(2378),ParseObject:i(4281),ParseObjectLayers:i(61136),ParseTileLayers:i(95925),ParseTilesets:i(93392)}},73779:(t,e,i)=>{var s=i(56694),n=i(91963),r=i(7599),o=i(57911),a=i(66458),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var t=this.systems.events;t.on(r.PRE_UPDATE,this.preUpdate,this),t.on(r.UPDATE,this.update,this),t.once(r.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,s){return this.addEvent({delay:t,callback:e,args:i,callbackScope:s})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(n,1),s.destroy()}for(i=0;i=s.delay)){var n=s.elapsed-s.delay;if(s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),s.repeatCount>0){if(s.repeatCount--,n>=s.delay)for(;n>=s.delay&&s.repeatCount>0;)s.callback&&s.callback.apply(s.callbackScope,s.args),n-=s.delay,s.repeatCount--;s.elapsed=n,s.hasDispatched=!1}else s.hasDispatched&&this._pendingRemoval.push(s)}}}},shutdown:function(){var t;for(t=0;t{var s=i(56694),n=i(6659),r=i(61286),o=i(72632),a=i(7599),h=i(52944),l=new s({Extends:n,initialize:function(t,e){n.call(this),this.scene=t,this.systems=t.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.events=[];var i=this.systems.events;i.on(a.PRE_UPDATE,this.preUpdate,this),i.on(a.UPDATE,this.update,this),i.once(a.SHUTDOWN,this.destroy,this),e&&this.add(e)},preUpdate:function(t,e){this.paused||(this.elapsed+=e)},update:function(){if(!this.paused&&!this.complete){var t,e,i=this.events,s=!1,n=this.systems;for(t=0;t=i.length&&(this.complete=!0),this.complete&&this.emit(h.COMPLETE,this)}},play:function(t){return void 0===t&&(t=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,t&&this.reset(),this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(){this.elapsed=0;for(var t=0;t0&&(i=e[e.length-1].time);for(var s=0;s{var s=i(56694),n=i(72632),r=new s({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){if(this.delay=n(t,"delay",0),this.repeat=n(t,"repeat",0),this.loop=n(t,"loop",!1),this.callback=n(t,"callback",void 0),this.callbackScope=n(t,"callbackScope",this),this.args=n(t,"args",[]),this.timeScale=n(t,"timeScale",1),this.startAt=n(t,"startAt",0),this.paused=n(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,0===this.delay&&(this.repeat>0||this.loop))throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},12144:t=>{t.exports="complete"},52944:(t,e,i)=>{t.exports={COMPLETE:i(12144)}},97121:(t,e,i)=>{t.exports={Clock:i(73779),Events:i(52944),Timeline:i(20517),TimerEvent:i(57911)}},64532:(t,e,i)=>{var s=i(66458),n=i(56694),r=i(5454),o=i(68710),a=i(91963),h=i(7599),l=i(91944),u=i(39366),c=i(68061),d=i(45641),f=i(56034),p=new n({initialize:function(t){this.scene=t,this.events=t.sys.events,this.timeScale=1,this.paused=!1,this.processing=!1,this.tweens=[],this.time=0,this.startTime=0,this.nextTime=0,this.prevTime=0,this.maxLag=500,this.lagSkip=33,this.gap=1e3/240,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.timeScale=1,this.paused=!1,this.startTime=Date.now(),this.prevTime=this.startTime,this.nextTime=this.gap,this.events.on(h.UPDATE,this.update,this),this.events.once(h.SHUTDOWN,this.shutdown,this)},create:function(t){Array.isArray(t)||(t=[t]);for(var e=[],i=0;i-1},existing:function(t){return this.has(t)||this.tweens.push(t.reset()),this},addCounter:function(t){var e=o(this,t);return this.tweens.push(e.reset()),e},stagger:function(t,e){return l(t,e)},setLagSmooth:function(t,e){return void 0===t&&(t=1/1e-8),void 0===e&&(e=0),this.maxLag=t,this.lagSkip=Math.min(e,this.maxLag),this},setFps:function(t){return void 0===t&&(t=240),this.gap=1e3/t,this.nextTime=1e3*this.time+this.gap,this},getDelta:function(t){var e=Date.now()-this.prevTime;e>this.maxLag&&(this.startTime+=e-this.lagSkip),this.prevTime+=e;var i=this.prevTime-this.startTime,s=i-this.nextTime,n=i-1e3*this.time;return s>0||t?(i/=1e3,this.time=i,this.nextTime+=s+(s>=this.gap?4:this.gap-s)):n=0,n},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(t){void 0===t&&(t=!1);var e=this.getDelta(t);if(!(e<=0)){var i,s;this.processing=!0;var n=[],r=this.tweens;for(i=0;i0){for(i=0;i-1&&(s.isPendingRemove()||s.isDestroyed())&&(r.splice(a,1),s.destroy())}n.length=0}this.processing=!1}},remove:function(t){return this.processing?t.setPendingRemoveState():(s(this.tweens,t),t.setRemovedState()),this},reset:function(t){return this.existing(t),t.seek(),t.setActiveState(),this},makeActive:function(t){return this.existing(t),t.setActiveState(),this},each:function(t,e){var i,s=[null];for(i=1;i{t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},21902:(t,e,i)=>{var s=i(35060),n=i(40587);t.exports=function(t,e){var i=s.Power0;if("string"==typeof t)if(s.hasOwnProperty(t))i=s[t];else{var r="";if(t.indexOf(".")){var o=(r=t.substring(t.indexOf(".")+1)).toLowerCase();"in"===o?r="easeIn":"out"===o?r="easeOut":"inout"===o&&(r="easeInOut")}t=n(t.substring(0,t.indexOf(".")+1)+r),s.hasOwnProperty(t)&&(i=s[t])}else"function"==typeof t&&(i=t);if(!e)return i;var a=e.slice(0);return a.unshift(0),function(t){return a[0]=t,i.apply(this,a)}}},4840:(t,e,i)=>{var s=i(63210),n=i(88332),r={bezier:s,catmull:n,catmullrom:n,linear:i(47614)};t.exports=function(t){if(null===t)return null;var e=r.linear;return"string"==typeof t?r.hasOwnProperty(t)&&(e=r[t]):"function"==typeof t&&(e=t),e}},28348:t=>{t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,s,n,r,o,a){return t[e](i,s,n,r,o,a)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},92407:(t,e,i)=>{var s=i(53709);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substring(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===s.indexOf(e)&&"_"!==e.substring(0,1)&&i.push({key:e,value:t[e]});return i}},65868:(t,e,i)=>{var s=i(10850);t.exports=function(t){var e=s(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},9744:(t,e,i)=>{var s=i(17489),n=i(61616);function r(t){return!!t.getActive&&"function"==typeof t.getActive}function o(t){return!!t.getStart&&"function"==typeof t.getStart}function a(t){return!!t.getEnd&&"function"==typeof t.getEnd}var h=function(t,e){var i,l,u=function(t,e,i){return i},c=function(t,e,i){return i},d=null,f=typeof e;if("number"===f)u=function(){return e};else if(Array.isArray(e))c=function(){return e[0]},u=function(){return e[e.length-1]};else if("string"===f){var p=e.toLowerCase(),g="random"===p.substring(0,6),v="int"===p.substring(0,3);if(g||v){var m=p.indexOf("("),y=p.indexOf(")"),x=p.indexOf(",");if(!(m&&y&&x))throw new Error("invalid random() format");var T=parseFloat(p.substring(m+1,x)),w=parseFloat(p.substring(x+1,y));u=g?function(){return n(T,w)}:function(){return s(T,w)}}else{p=p[0];var b=parseFloat(e.substr(2));switch(p){case"+":u=function(t,e,i){return i+b};break;case"-":u=function(t,e,i){return i-b};break;case"*":u=function(t,e,i){return i*b};break;case"/":u=function(t,e,i){return i/b};break;default:u=function(){return parseFloat(e)}}}}else if("function"===f)u=e;else if("object"===f)if(o(l=e)||a(l)||r(l))r(e)&&(d=e.getActive),a(e)&&(u=e.getEnd),o(e)&&(c=e.getStart);else if(e.hasOwnProperty("value"))i=h(t,e.value);else{var E=e.hasOwnProperty("to"),S=e.hasOwnProperty("from"),A=e.hasOwnProperty("start");if(E&&(S||A)){if(i=h(t,e.to),A){var _=h(t,e.start);i.getActive=_.getEnd}if(S){var C=h(t,e.from);i.getStart=C.getEnd}}}return i||(i={getActive:d,getEnd:u,getStart:c}),i};t.exports=h},68710:(t,e,i)=>{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(28348),l=i(10850),u=i(9744),c=i(72066),d=i(39366);t.exports=function(t,e,i){if(e instanceof d)return e.parent=t,e;i=void 0===i?n:c(n,i);var f=l(e,"from",0),p=l(e,"to",1),g=[{value:f}],v=l(e,"delay",i.delay),m=l(e,"easeParams",i.easeParams),y=l(e,"ease",i.ease),x=u("value",p),T=new d(t,g),w=T.add(0,"value",x.getEnd,x.getStart,x.getActive,a(l(e,"ease",y),l(e,"easeParams",m)),h(e,"delay",v),l(e,"duration",i.duration),o(e,"yoyo",i.yoyo),l(e,"hold",i.hold),l(e,"repeat",i.repeat),l(e,"repeatDelay",i.repeatDelay),!1,!1);w.start=f,w.current=f,T.completeDelay=r(e,"completeDelay",0),T.loop=Math.round(r(e,"loop",0)),T.loopDelay=Math.round(r(e,"loopDelay",0)),T.paused=o(e,"paused",!1),T.persist=o(e,"persist",!1),T.callbackScope=l(e,"callbackScope",T);for(var b=s.TYPES,E=0;E{var s=i(21902),n=i(10850),r=i(83392);t.exports=function(t,e){var i;void 0===e&&(e={});var o=n(e,"start",0),a=n(e,"ease",null),h=n(e,"grid",null),l=n(e,"from",0),u="first"===l,c="center"===l,d="last"===l,f="number"==typeof l,p=Array.isArray(t),g=p?parseFloat(t[0]):parseFloat(t),v=p?parseFloat(t[1]):0,m=Math.max(g,v);if(p&&(o+=g),h){var y=h[0],x=h[1],T=0,w=0,b=0,E=0,S=[];d?(T=y-1,w=x-1):f?(T=l%y,w=Math.floor(l/y)):c&&(T=(y-1)/2,w=(x-1)/2);for(var A=r.MIN_SAFE_INTEGER,_=0;_A&&(A=M),S[_][C]=M}}}var R=a?s(a):null;return i=h?function(t,e,i,s){var n,r=0,a=s%y,h=Math.floor(s/y);if(a>=0&&a=0&&h{var s=i(502),n=i(99730),r=i(20494),o=i(63130),a=i(21902),h=i(4840),l=i(28348),u=i(92407),c=i(65868),d=i(10850),f=i(9744),p=i(72066),g=i(39366);t.exports=function(t,e,i){if(e instanceof g)return e.parent=t,e;i=void 0===i?n:p(n,i);var v=c(e);!v&&i.targets&&(v=i.targets);for(var m=u(e),y=d(e,"delay",i.delay),x=d(e,"duration",i.duration),T=d(e,"easeParams",i.easeParams),w=d(e,"ease",i.ease),b=d(e,"hold",i.hold),E=d(e,"repeat",i.repeat),S=d(e,"repeatDelay",i.repeatDelay),A=o(e,"yoyo",i.yoyo),_=o(e,"flipX",i.flipX),C=o(e,"flipY",i.flipY),M=d(e,"interpolation",i.interpolation),R=function(t,e,i,s){if("texture"===i){var n=s,r=void 0;Array.isArray(s)?(n=s[0],r=s[1]):s.hasOwnProperty("value")?(n=s.value,Array.isArray(s.value)?(n=s.value[0],r=s.value[1]):"string"==typeof s.value&&(n=s.value)):"string"==typeof s&&(n=s),t.addFrame(e,n,r,l(s,"delay",y),d(s,"duration",x),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C))}else{var u=f(i,s),c=h(d(s,"interpolation",M));t.add(e,i,u.getEnd,u.getStart,u.getActive,a(d(s,"ease",w),d(s,"easeParams",T)),l(s,"delay",y),d(s,"duration",x),o(s,"yoyo",A),d(s,"hold",b),d(s,"repeat",E),d(s,"repeatDelay",S),o(s,"flipX",_),o(s,"flipY",C),c,c?s:null)}},P=new g(t,v),O=0;O{var s=i(502),n=i(20494),r=i(63130),o=i(65868),a=i(10850),h=i(68061),l=i(45641);t.exports=function(t,e){if(e instanceof l)return e.parent=t,e;var i,u=new l(t);u.startDelay=a(e,"delay",0),u.completeDelay=n(e,"completeDelay",0),u.loop=Math.round(n(e,"loop",a(e,"repeat",0))),u.loopDelay=Math.round(n(e,"loopDelay",a(e,"repeatDelay",0))),u.paused=r(e,"paused",!1),u.persist=r(e,"persist",!0),u.callbackScope=a(e,"callbackScope",u);var c=s.TYPES;for(i=0;i{t.exports={GetBoolean:i(63130),GetEaseFunction:i(21902),GetInterpolationFunction:i(4840),GetNewValue:i(28348),GetProps:i(92407),GetTargets:i(65868),GetValueOp:i(9744),NumberTweenBuilder:i(68710),StaggerBuilder:i(91944),TweenBuilder:i(68061)}},5570:t=>{t.exports="active"},6383:t=>{t.exports="complete"},72582:t=>{t.exports="loop"},90281:t=>{t.exports="pause"},80803:t=>{t.exports="repeat"},13640:t=>{t.exports="resume"},10472:t=>{t.exports="start"},5379:t=>{t.exports="stop"},43449:t=>{t.exports="update"},61541:t=>{t.exports="yoyo"},54272:(t,e,i)=>{t.exports={TWEEN_ACTIVE:i(5570),TWEEN_COMPLETE:i(6383),TWEEN_LOOP:i(72582),TWEEN_PAUSE:i(90281),TWEEN_RESUME:i(13640),TWEEN_REPEAT:i(80803),TWEEN_START:i(10472),TWEEN_STOP:i(5379),TWEEN_UPDATE:i(43449),TWEEN_YOYO:i(61541)}},75193:(t,e,i)=>{var s={States:i(55303),Builders:i(79619),Events:i(54272),TweenManager:i(64532),Tween:i(39366),TweenData:i(15718),TweenFrameData:i(96490),BaseTween:i(502),TweenChain:i(45641)};t.exports=s},502:(t,e,i)=>{var s=i(56694),n=i(6659),r=i(54272),o=i(55303),a=new s({Extends:n,initialize:function(t){n.call(this),this.parent=t,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(r.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(r.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(r.TWEEN_COMPLETE,"onComplete")},complete:function(t){return void 0===t&&(t=0),t?(this.setCompleteDelayState(),this.countdown=t):this.onCompleteHandler(),this},completeAfterLoop:function(t){return void 0===t&&(t=0),this.loopCounter>t&&(this.loopCounter=t),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return!this.parent||this.isRemoved()||this.isPendingRemove()||this.isDestroyed()||(this.dispatchEvent(r.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(t){this.countdown-=t,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(t){return this.countdown-=t,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(r.TWEEN_START,"onStart"),t=0),t},updateCompleteDelay:function(t){this.countdown-=t,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(t,e,i){return void 0===i&&(i=[]),this.callbacks.hasOwnProperty(t)&&(this.callbacks[t]={func:e,params:i}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach((function(t){t.destroy()})),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});a.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],t.exports=a},65521:(t,e,i)=>{var s=i(56694),n=i(54272),r=i(55303),o=new s({initialize:function(t,e,i,s,n,r,o,a,h,l){this.tween=t,this.targetIndex=e,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=i,this.yoyo=n,this.hold=r,this.repeat=o,this.repeatDelay=a,this.repeatCounter=0,this.flipX=h,this.flipY=l,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(t){void 0===t&&(t=this.current),this.tween.targets[this.targetIndex][this.key]=t},setCreatedState:function(){this.state=r.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=r.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=r.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=r.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=r.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=r.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=r.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=r.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===r.CREATED},isDelayed:function(){return this.state===r.DELAY},isPendingRender:function(){return this.state===r.PENDING_RENDER},isPlayingForward:function(){return this.state===r.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===r.PLAYING_BACKWARD},isHolding:function(){return this.state===r.HOLD_DELAY},isRepeating:function(){return this.state===r.REPEAT_DELAY},isComplete:function(){return this.state===r.COMPLETE},setStateFromEnd:function(t){this.yoyo?this.onRepeat(t,!0,!0):this.repeatCounter>0?this.onRepeat(t,!0,!1):this.setCompleteState()},setStateFromStart:function(t){this.repeatCounter>0?this.onRepeat(t,!1):this.setCompleteState()},reset:function(){var t=this.tween,e=t.totalTargets,i=this.targetIndex,s=t.targets[i],n=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(s,n,0,i,e,t),this.repeatCounter=-1===this.repeat?r.MAX:this.repeat,this.setPendingRenderState();var o=this.duration+this.hold;this.yoyo&&(o+=this.duration);var a=o+this.repeatDelay;this.totalDuration=this.delay+o,-1===this.repeat?(this.totalDuration+=a*r.MAX,t.isInfinite=!0):this.repeat>0&&(this.totalDuration+=a*this.repeat),this.totalDuration>t.duration&&(t.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(t,e,i){var s=this.tween,r=s.totalTargets,o=this.targetIndex,a=s.targets[o],h=this.key,l="texture"!==h;if(this.elapsed=t,this.progress=t/this.duration,this.flipX&&a.toggleFlipX(),this.flipY&&a.toggleFlipY(),l&&(e||i)&&(this.start=this.getStartValue(a,h,this.start,o,r,s)),i)return this.setPlayingBackwardState(),void this.dispatchEvent(n.TWEEN_YOYO,"onYoyo");this.repeatCounter--,l&&(this.end=this.getEndValue(a,h,this.start,o,r,s)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-t,l&&(this.current=this.start,a[h]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(n.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});t.exports=o},99730:t=>{t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null}},53709:t=>{t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},39366:(t,e,i)=>{var s=i(502),n=i(56694),r=i(54272),o=i(99325),a=i(61286),h=i(83392),l=i(55303),u=i(15718),c=i(96490),d=new n({Extends:s,initialize:function(t,e){s.call(this,t),this.targets=e,this.totalTargets=e.length,this.isSeeking=!1,this.isInfinite=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0},add:function(t,e,i,s,n,r,o,a,h,l,c,d,f,p,g,v){var m=new u(this,t,e,i,s,n,r,o,a,h,l,c,d,f,p,g,v);return this.totalData=this.data.push(m),m},addFrame:function(t,e,i,s,n,r,o,a,h,l){var u=new c(this,t,e,i,s,n,r,o,a,h,l);return this.totalData=this.data.push(u),u},getValue:function(t){void 0===t&&(t=0);var e=null;return this.data&&(e=this.data[t].current),e},hasTarget:function(t){return this.targets&&-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){if(void 0===i&&(i=!1),"texture"!==t)for(var s=0;s0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(r.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,s.prototype.onCompleteHandler.call(this)},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed Tween",this),this):((this.isPendingRemove()||this.isFinished())&&this.seek(),this.paused=!1,this.setActiveState(),this)},seek:function(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=16.6),void 0===i&&(i=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;i||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive");var s=this.paused;if(this.paused=!1,t>0){for(var n=Math.floor(t/e),o=t-n*e,a=0;a0&&this.update(o)}return this.paused=s,this.isSeeking=!1,this},initTweenData:function(t){void 0===t&&(t=!1),this.duration=0,this.startDelay=h.MAX_SAFE_INTEGER;for(var e=this.data,i=0;i0?s+n+(s+o)*r:s+n},reset:function(t){return void 0===t&&(t=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,-1===this.loop&&(this.isInfinite=!0,this.loopCounter=l.MAX),t||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(r.TWEEN_ACTIVE,"onActive")),this},update:function(t){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(t*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(t),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(t),!1;this.hasStarted||(this.startDelay-=t,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(r.TWEEN_START,"onStart"),t=0));var e=!1;if(this.isActive())for(var i=this.data,s=0;s{var s=i(66458),n=i(502),r=i(56694),o=i(54272),a=i(99325),h=i(61286),l=i(55303),u=new r({Extends:n,initialize:function(t){n.call(this,t),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=-1===this.loop?l.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive"),this},add:function(t){var e=this.parent.create(t);Array.isArray(e)||(e=[e]);for(var i=this.data,s=0;s0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"));else{if(!(this.completeDelay>0))return this.onCompleteHandler(),!0;this.countdown=this.completeDelay,this.setCompleteDelayState()}return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var t=this.data,e=this.totalData,i=0;i{var s=i(65521),n=i(82897),r=i(56694),o=i(54272),a=new r({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c,d,f,p,g,v,m){s.call(this,t,e,h,l,u,c,d,f,p,g),this.key=i,this.getActiveValue=o,this.getEndValue=n,this.getStartValue=r,this.ease=a,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=v,this.interpolationData=m},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex],i=this.key;t&&(e[i]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(e[i]=this.getActiveValue(e,i,0))},update:function(t){var e=this.tween,i=e.totalTargets,s=this.targetIndex,r=e.targets[s],a=this.key;if(!r)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(r,a,r[a],s,i,e),this.end=this.getEndValue(r,a,this.start,s,i,e),this.current=this.start,r[a]=this.start,this.setPlayingForwardState(),!0;var h=this.isPlayingForward(),l=this.isPlayingBackward();if(h||l){var u=this.elapsed,c=this.duration,d=0,f=!1;(u+=t)>=c?(d=u-c,u=c,f=!0):u<0&&(u=0);var p=n(u/c,0,1);if(this.elapsed=u,this.progress=p,this.previous=this.current,f)h?(this.current=this.end,r[a]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(d)):(this.current=this.start,r[a]=this.start,this.setStateFromStart(d));else{h||(p=1-p);var g=this.ease(p);this.interpolation?this.current=this.interpolation(this.interpolationData,g):this.current=this.start+(this.end-this.start)*g,r[a]=this.current}this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key,r=this.current,o=this.previous;i.emit(t,i,n,s,r,o);var a=i.callbacks[e];a&&a.func.apply(i.callbackScope,[i,s,n,r,o].concat(a.params))}},destroy:function(){s.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});t.exports=a},96490:(t,e,i)=>{var s=i(65521),n=i(82897),r=i(56694),o=i(54272),a=new r({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u,c){s.call(this,t,e,r,o,!1,a,h,l,u,c),this.key="texture",this.startTexture=null,this.endTexture=i,this.startFrame=null,this.endFrame=n,this.yoyo=0!==h},reset:function(t){s.prototype.reset.call(this);var e=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=e.texture.key,this.startFrame=e.frame.name),t&&e.setTexture(this.startTexture,this.startFrame)},update:function(t){var e=this.tween,i=this.targetIndex,s=e.targets[i];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=t,this.elapsed<=0&&(this.elapsed=0,t=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var r=this.isPlayingForward(),a=this.isPlayingBackward();if(r||a){var h=this.elapsed,l=this.duration,u=0,c=!1;(h+=t)>=l?(u=h-l,h=l,c=!0):h<0&&(h=0);var d=n(h/l,0,1);this.elapsed=h,this.progress=d,c&&(r?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(u)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(u))),this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(t,e){var i=this.tween;if(!i.isSeeking){var s=i.targets[this.targetIndex],n=this.key;i.emit(t,i,n,s);var r=i.callbacks[e];r&&r.func.apply(i.callbackScope,[i,s,n].concat(r.params))}},destroy:function(){s.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});t.exports=a},55303:t=>{t.exports={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999}},56694:t=>{function e(t,e,i){var s=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&s.value&&"object"==typeof s.value&&(s=s.value),!(!s||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(s))&&(void 0===s.enumerable&&(s.enumerable=!0),void 0===s.configurable&&(s.configurable=!0),s)}function i(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,s,n,o){for(var a in s)if(s.hasOwnProperty(a)){var h=e(s,a,n);if(!1!==h){if(i((o||t).prototype,a)){if(r.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=s[a]}}function n(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i{t.exports=function(){}},10618:t=>{t.exports=function(){return null}},78991:t=>{t.exports=function(t,e,i,s,n){if(void 0===n&&(n=t),i>0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),s&&s.call(n,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a{t.exports=function(t,e,i,s,n,r){if(void 0===i&&(i=0),void 0===r&&(r=t),s>0){var o=s-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),n&&n.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;s>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),n&&n.call(r,l)}return e}},58742:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=0;if(s(t,n,r))for(var a=n;a{t.exports=function(t,e,i){var s,n=[null];for(s=3;s{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r)){var o,a=[null];for(o=5;o{t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var s,n,r=1;if(i){if(te.length&&(r=e.length),i?(s=e[r-1][i],(n=e[r][i])-t<=t-s?e[r]:e[r-1]):(s=e[r-1],(n=e[r])-t<=t-s?n:s)}},5454:t=>{var e=function(t,i){void 0===i&&(i=[]);for(var s=0;s{var s=i(45838);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var o=[];if(s(t,n,r))for(var a=n;a{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var s=e+Math.floor(Math.random()*i);return void 0===t[s]?null:t[s]}},24218:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s>n||(t.splice(s,1),n===t.length-1?t.push(e):t.splice(n,0,e)),t}},58258:t=>{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return s{t.exports=function(t,e){var i=t.indexOf(e);if(i>0){var s=t[i-1],n=t.indexOf(s);t[i]=s,t[n]=e}return t}},68396:t=>{t.exports=function(t,e,i){var s=t.indexOf(e);if(-1===s||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return s!==i&&(t.splice(s,1),t.splice(i,0,e)),e}},27555:t=>{t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i{t.exports=function(t,e,i,s){var n,r=[],o=!1;if((i||s)&&(o=!0,i||(i=""),s||(s="")),e=e;n--)o?r.push(i+n.toString()+s):r.push(n);else for(n=t;n<=e;n++)o?r.push(i+n.toString()+s):r.push(n);return r}},89955:(t,e,i)=>{var s=i(67233);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var n=[],r=Math.max(s((e-t)/(i||1)),0),o=0;o{function e(t,e,i){var s=t[e];t[e]=t[i],t[i]=s}function i(t,e){return te?1:0}var s=function(t,n,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=i);o>r;){if(o-r>600){var h=o-r+1,l=n-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(n-l*c/h+d)),p=Math.min(o,Math.floor(n+(h-l)*c/h+d));s(t,n,f,p,a)}var g=t[n],v=r,m=o;for(e(t,r,n),a(t[o],g)>0&&e(t,r,o);v0;)m--}0===a(t[r],g)?e(t,r,m):e(t,++m,o),m<=n&&(r=m+1),n<=m&&(o=m-1)}};t.exports=s},75757:(t,e,i)=>{var s=i(10850),n=i(18592),r=function(t,e,i){for(var s=[],n=0;n{var s=i(72677);t.exports=function(t,e,i,n){var r;if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(s(t,r),i&&i.call(n,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(r=t.indexOf(h))&&(s(t,r),a.push(h),i&&i.call(n,h)),o--}return a}},8324:(t,e,i)=>{var s=i(72677);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},47427:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),s(t,e,i)){var o=i-e,a=t.splice(e,o);if(n)for(var h=0;h{var s=i(72677);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return s(t,n)}},80402:t=>{t.exports=function(t,e,i){var s=t.indexOf(e),n=t.indexOf(i);return-1!==s&&-1===n&&(t[s]=i,!0)}},77640:t=>{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,s=0;s{t.exports=function(t,e,i,s){var n=t.length;if(e<0||e>n||e>=i||i>n){if(s)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},27847:t=>{t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},6034:(t,e,i)=>{var s=i(45838);t.exports=function(t,e,i,n,r){if(void 0===n&&(n=0),void 0===r&&(r=t.length),s(t,n,r))for(var o=n;o{t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),s=t[e];t[e]=t[i],t[i]=s}return t}},28834:t=>{t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},72677:t=>{t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,s=t[e],n=e;n{var s=i(77290);function n(t,e){return String(t).localeCompare(e)}function r(t,e,i,s){var n,r,o,a,h,l=t.length,u=0,c=2*i;for(n=0;nl&&(r=l),o>l&&(o=l),a=n,h=r;;)if(a{t.exports=function(t,e,i){if(e===i)return t;var s=t.indexOf(e),n=t.indexOf(i);if(s<0||n<0)throw new Error("Supplied items must be elements of the same array");return t[s]=i,t[n]=e,t}},59959:(t,e,i)=>{t.exports={Matrix:i(13515),Add:i(78991),AddAt:i(48522),BringToTop:i(58742),CountAllMatching:i(30164),Each:i(36337),EachInRange:i(46208),FindClosestInSorted:i(2406),Flatten:i(5454),GetAll:i(71608),GetFirst:i(51463),GetRandom:i(72861),MoveDown:i(51172),MoveTo:i(68396),MoveUp:i(27555),MoveAbove:i(24218),MoveBelow:i(58258),NumberArray:i(13401),NumberArrayStep:i(89955),QuickSelect:i(53466),Range:i(75757),Remove:i(66458),RemoveAt:i(8324),RemoveBetween:i(47427),RemoveRandomElement:i(50147),Replace:i(80402),RotateLeft:i(77640),RotateRight:i(38487),SafeRange:i(45838),SendToBack:i(27847),SetAll:i(6034),Shuffle:i(18592),SortByDigits:i(28834),SpliceOne:i(72677),StableSort:i(17922),Swap:i(96928)}},97494:t=>{t.exports=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i{var s=i(76400),n=i(97494);t.exports=function(t){var e="";if(!n(t))return e;for(var i=0;i{t.exports=function(t){return t.reverse()}},51995:t=>{t.exports=function(t){for(var e=0;e{var s=i(63515);t.exports=function(t){return s(t,180)}},42549:(t,e,i)=>{var s=i(63515);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i{var s=i(97494),n=i(78581);t.exports=function(t,e){if(void 0===e&&(e=90),!s(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=n(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=n(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i{var s=i(63515);t.exports=function(t,e){void 0===e&&(e=1);for(var i=0;i{var s=i(77640),n=i(38487);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?s(t,Math.abs(i)):n(t,i)),0!==e)for(var r=0;r{t.exports=function(t){for(var e=t.length,i=t[0].length,s=new Array(i),n=0;n-1;r--)s[n][r]=t[r][n]}return s}},13515:(t,e,i)=>{t.exports={CheckMatrix:i(97494),MatrixToString:i(68428),ReverseColumns:i(59521),ReverseRows:i(51995),Rotate180:i(89011),RotateLeft:i(42549),RotateMatrix:i(63515),RotateRight:i(14305),Translate:i(27365),TransposeMatrix:i(78581)}},40581:t=>{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,i){for(var s=new Uint8Array(t),n=s.length,r=i?"data:"+i+";base64,":"",o=0;o>2],r+=e[(3&s[o])<<4|s[o+1]>>4],r+=e[(15&s[o+1])<<2|s[o+2]>>6],r+=e[63&s[o+2]];return n%3==2?r=r.substring(0,r.length-1)+"=":n%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},82329:t=>{for(var e=new Uint8Array(256),i=0;i<64;i++)e["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(i)]=i;t.exports=function(t){var i,s,n,r,o=(t=t.substr(t.indexOf(",")+1)).length,a=.75*o,h=0;"="===t[o-1]&&(a--,"="===t[o-2]&&a--);for(var l=new ArrayBuffer(a),u=new Uint8Array(l),c=0;c>4,u[h++]=(15&s)<<4|n>>2,u[h++]=(3&n)<<6|63&r;return l}},78417:(t,e,i)=>{t.exports={ArrayBufferToBase64:i(40581),Base64ToArrayBuffer:i(82329)}},22178:(t,e,i)=>{t.exports={Array:i(59959),Base64:i(78417),Objects:i(64615),String:i(50379),NOOP:i(72283),NULL:i(10618)}},32742:t=>{t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},28699:t=>{var e=function(t){var i,s,n;if("object"!=typeof t||null===t)return t;for(n in i=Array.isArray(t)?[]:{},t)s=t[n],i[n]=e(s);return i};t.exports=e},98611:(t,e,i)=>{var s=i(42911),n=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l{var s=i(5923),n=i(10850);t.exports=function(t,e,i){var r=n(t,e,null);if(null===r)return i;if(Array.isArray(r))return s.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return s.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return s.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},72632:t=>{t.exports=function(t,e,i){var s=typeof t;return t&&"number"!==s&&"string"!==s&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},94324:(t,e,i)=>{var s=i(10850),n=i(82897);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=s(t,e,o);return n(a,i,r)}},10850:t=>{t.exports=function(t,e,i,s){if(!t&&!s||"number"==typeof t)return i;if(t&&t.hasOwnProperty(e))return t[e];if(s&&s.hasOwnProperty(e))return s[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,o=s,a=i,h=i,l=!0,u=!0,c=0;c{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){for(var i=0;i{t.exports=function(t,e){return t.hasOwnProperty(e)}},42911:t=>{t.exports=function(t){if(!t||"object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},30657:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)||(i[n]=e[n]);return i}},72066:(t,e,i)=>{var s=i(32742);t.exports=function(t,e){var i=s(t);for(var n in e)i.hasOwnProperty(n)&&(i[n]=e[n]);return i}},28820:(t,e,i)=>{var s=i(19256);t.exports=function(t,e){for(var i={},n=0;n{t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var s=e.split("."),n=t,r=t,o=0;o{t.exports={Clone:i(32742),DeepCopy:i(28699),Extend:i(98611),GetAdvancedValue:i(20494),GetFastValue:i(72632),GetMinMaxValue:i(94324),GetValue:i(10850),HasAll:i(87701),HasAny:i(53523),HasValue:i(19256),IsPlainObject:i(42911),Merge:i(30657),MergeRight:i(72066),Pick:i(28820),SetValue:i(22440)}},69429:t=>{t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},76400:t=>{t.exports=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===s&&(s=3);var n=0;if(e+1>=(t=t.toString()).length)switch(s){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((n=e-t.length)/2);t=new Array(n-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},76872:t=>{t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},8051:t=>{t.exports=function(t){return t.split("").reverse().join("")}},76583:t=>{t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},40587:t=>{t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},50379:(t,e,i)=>{t.exports={Format:i(69429),Pad:i(76400),RemoveAt:i(76872),Reverse:i(8051),UppercaseFirst:i(40587),UUID:i(76583)}}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}return i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i(92491)})(),t.exports=e()},260:(t,e,i)=>{"use strict";i.d(e,{Ps:()=>Io,Vb:()=>vh});var s="undefined"!=typeof self?self:{};function n(t,e){t:{for(var i=["CLOSURE_FLAGS"],n=s,r=0;re)s[i++]=e;else{if(2048>e)s[i++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&n=r){e=1024*(e-55296)+r-56320+65536,s[i++]=e>>18|240,s[i++]=e>>12&63|128,s[i++]=e>>6&63|128,s[i++]=63&e|128;continue}n--}e=65533}s[i++]=e>>12|224,s[i++]=e>>6&63|128}s[i++]=63&e|128}}t=i===s.length?s:s.subarray(0,i)}return t}var f,p=n(610401301,!1),g=n(572417392,!0);const v=s.navigator;function m(t){return!!p&&!!f&&f.brands.some((({brand:e})=>e&&-1!=e.indexOf(t)))}function y(t){var e;return(e=s.navigator)&&(e=e.userAgent)||(e=""),-1!=e.indexOf(t)}function x(){return!!p&&!!f&&0i;i++){var s=t.concat(e[i].split(""));b[i]=s;for(var n=0;n>2];n=e[(3&n)<<4|r>>4],r=e[(15&r)<<2|o>>6],o=e[63&o],i[l++]=a+n+r+o}switch(a=0,o=s,t.length-h){case 2:o=e[(15&(a=t[h+1]))<<2]||s;case 1:t=t[h],i[l]=e[t>>2]+e[(3&t)<<4|a>>4]+o+s}return i.join("")}for(e="",i=0,s=t.length-10240;i>4),64!=o&&(e(r<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){s[n++]=t})),n!==i?s.subarray(0,n):s}(t);M.test(t)&&(t=t.replace(M,P)),t=atob(t);const e=new Uint8Array(t.length);for(let i=0;i ${t}`)}function V(t){return 0==t.length?N():new X(t,k)}function W(t){if("string"==typeof t)return{buffer:O(t),L:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),L:!1};if(t.constructor===Uint8Array)return{buffer:t,L:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),L:!1};if(t.constructor===X)return{buffer:U(t)||D(),L:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),L:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function H(){return"function"==typeof BigInt}var j=!g;let q=!g;const K="function"==typeof Uint8Array.prototype.slice;let Z,J=0,Q=0;function $(t){const e=0>t;let i=(t=Math.abs(t))>>>0;if(t=Math.floor((t-i)/4294967296),e){const[e,s]=at(i,t);t=s,i=e}J=i>>>0,Q=t>>>0}function tt(t){const e=Z||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Q=0,J=e.getUint32(0,!0)}function et(t,e){return 4294967296*e+(t>>>0)}function it(t,e){const i=2147483648&e;return i&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=et(t,e),i?-t:t}function st(t,e){if(t>>>=0,2097151>=(e>>>=0))var i=""+(4294967296*e+t);else H()?i=""+(BigInt(e)<>>24|e<<8))+6710656*(e=e>>16&65535),i+=8147497*e,e*=2,1e7<=t&&(i+=Math.floor(t/1e7),t%=1e7),1e7<=i&&(e+=Math.floor(i/1e7),i%=1e7),i=e+nt(i)+nt(t));return i}function nt(t){return t=String(t),"0000000".slice(t.length)+t}function rt(){var t=J,e=Q;if(2147483648&e)if(H())t=""+(BigInt(0|e)<>>0));else{const[i,s]=at(t,e);t="-"+st(i,s)}else t=st(t,e);return t}function ot(t){if(16>t.length)$(Number(t));else if(H())t=BigInt(t),J=Number(t&BigInt(4294967295))>>>0,Q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Q=J=0;const i=t.length;for(let s=e,n=(i-e)%6+e;n<=i;s=n,n+=6){const e=Number(t.slice(s,n));Q*=1e6,J=1e6*J+e,4294967296<=J&&(Q+=Math.trunc(J/4294967296),Q>>>=0,J>>>=0)}if(e){const[t,e]=at(J,Q);J=t,Q=e}}}function at(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function ht(t,e){let i,s=0,n=0,r=0;const o=t.h;let a=t.g;do{i=o[a++],s|=(127&i)<r&&128&i);for(32>4),r=3;32>r&&128&i;r+=7)i=o[a++],n|=(127&i)<i)return e(s>>>0,n>>>0);throw z()}function lt(t){let e=0,i=t.g;const s=i+10,n=t.h;for(;i>>0}function dt(t){var e=t.h;const i=t.g,s=e[i],n=e[i+1],r=e[i+2];return e=e[i+3],vt(t,t.g+4),(s<<0|n<<8|r<<16|e<<24)>>>0}function ft(t){var e=dt(t);t=2*(e>>31)+1;const i=e>>>23&255;return e&=8388607,255==i?e?NaN:1/0*t:0==i?t*Math.pow(2,-149)*e:t*Math.pow(2,i-150)*(e+Math.pow(2,23))}function pt(t){return ut(t)}function gt(t,e,{aa:i=!1}={}){t.aa=i,e&&(e=W(e),t.h=e.buffer,t.m=e.L,t.j=0,t.l=t.h.length,t.g=t.j)}function vt(t,e){if(t.g=e,e>t.l)throw G(t.l,e)}function mt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const i=t.g,s=i+e;if(s>t.l)throw G(e,t.l-i);return t.g=s,i}function yt(t,e){if(0==e)return N();var i=mt(t,e);return t.aa&&t.m?i=t.h.subarray(i,i+e):(t=t.h,i=i===(e=i+e)?D():K?t.slice(i,e):new Uint8Array(t.subarray(i,e))),V(i)}var xt=[];function Tt(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var i=ct(t.g);if(e=i>>>3,!(0<=(i&=7)&&5>=i))throw Y(i,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=i,!0}function wt(t){switch(t.h){case 0:0!=t.h?wt(t):lt(t.g);break;case 1:vt(t=t.g,t.g+8);break;case 2:if(2!=t.h)wt(t);else{var e=ct(t.g);vt(t=t.g,t.g+e)}break;case 5:vt(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Tt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}wt(t)}break;default:throw Y(t.h,t.l)}}function bt(t,e,i){const s=t.g.l,n=ct(t.g),r=t.g.g+n;let o=r-s;if(0>=o&&(t.g.l=r,i(e,t,void 0,void 0,void 0),o=r-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=r,t.g.l=s,e}function Et(t){var e=ct(t.g),i=mt(t=t.g,e);if(t=t.h,l){var s,n=t;(s=h)||(s=h=new TextDecoder("utf-8",{fatal:!0})),e=i+e,n=0===i&&e===n.length?n:n.subarray(i,e);try{var u=s.decode(n)}catch(t){if(void 0===a){try{s.decode(new Uint8Array([128]))}catch(t){}try{s.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(h=void 0),t}}else{e=(u=i)+e,i=[];let a,h=null;for(;uc?i.push(c):224>c?u>=e?r():(a=t[u++],194>c||128!=(192&a)?(u--,r()):i.push((31&c)<<6|63&a)):240>c?u>=e-1?r():(a=t[u++],128!=(192&a)||224===c&&160>a||237===c&&160<=a||128!=(192&(s=t[u++]))?(u--,r()):i.push((15&c)<<12|(63&a)<<6|63&s)):244>=c?u>=e-2?r():(a=t[u++],128!=(192&a)||0!=a-144+(c<<28)>>30||128!=(192&(s=t[u++]))||128!=(192&(n=t[u++]))?(u--,r()):(c=(7&c)<<18|(63&a)<<12|(63&s)<<6|63&n,c-=65536,i.push(55296+(c>>10&1023),56320+(1023&c)))):r(),8192<=i.length&&(h=o(h,i),i.length=0)}u=o(h,i)}return u}function St(t){const e=ct(t.g);return yt(t.g,e)}function At(t,e,i){var s=ct(t.g);for(s=t.g.g+s;t.g.g>>0,this.g=e>>>0}};let Rt;function Pt(t){return t?/^-?\d+$/.test(t)?(ot(t),new Ot(J,Q)):null:Lt||=new Ot(0,0)}var Ot=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Lt;function Ft(t,e,i){for(;0>>7|i<<25)>>>0,i>>>=7;t.g.push(e)}function Dt(t,e){for(;127>>=7;t.g.push(e)}function kt(t,e){if(0<=e)Dt(t,e);else{for(let i=0;9>i;i++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function It(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Bt(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Nt(t,e,i){Dt(t.g,8*e+i)}function Ut(t,e){return Nt(t,e,2),e=t.g.end(),Bt(t,e),e.push(t.h),e}function Xt(t,e){var i=e.pop();for(i=t.h+t.g.length()-i;127>>=7,t.h++;e.push(i),t.h++}function Yt(t,e,i){Nt(t,e,2),Dt(t.g,i.length),Bt(t,t.g.end()),Bt(t,i)}function zt(t,e,i,s){null!=i&&(e=Ut(t,e),s(i,t),Xt(t,e))}class Gt{constructor(t,e,i,s){this.g=t,this.h=e,this.l=i,this.qa=s}}function Vt(t){return Array.prototype.slice.call(t)}function Wt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var Ht=Wt(),jt=Wt("0di"),qt=Ht?(t,e)=>{t[Ht]|=e}:(t,e)=>{void 0!==t.D?t.D|=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Kt(t){const e=Qt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Vt(t)),te(t,1|e))}var Zt=Ht?(t,e)=>{t[Ht]&=~e}:(t,e)=>{void 0!==t.D&&(t.D&=~e)};function Jt(t,e,i){return i?t|e:t&~e}var Qt=Ht?t=>0|t[Ht]:t=>0|t.D,$t=Ht?t=>t[Ht]:t=>t.D,te=Ht?(t,e)=>{t[Ht]=e}:(t,e)=>{void 0!==t.D?t.D=e:Object.defineProperties(t,{D:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function ee(){var t=[];return qt(t,1),t}function ie(t){return qt(t,34),t}function se(t,e){te(e,-14591&(0|t))}function ne(t,e){te(e,-14557&(34|t))}function re(t){return 0==(t=t>>14&1023)?536870912:t}var oe={},ae={};function he(t){return!(!t||"object"!=typeof t||t.Na!==ae)}function le(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let ue=!g;function ce(t,e,i){if(null!=t)if("string"==typeof t)t=t?new X(t,k):N();else if(t.constructor!==X)if(L(t))t=i?V(t):t.length?new X(new Uint8Array(t),k):N();else{if(!e)throw Error();t=void 0}return t}function de(t,e,i){if(!Array.isArray(t)||t.length)return!1;const s=Qt(t);return!!(1&s)||!(!e||!(Array.isArray(e)?e.includes(i):e.has(i)))&&(te(t,1|s),!0)}var fe;const pe=[];function ge(t){if(2&t)throw Error()}te(pe,55),fe=Object.freeze(pe);class ve{constructor(t,e,i){this.l=0,this.g=t,this.h=e,this.m=i}next(){if(this.l>>0:void 0}function Me(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function Re(t){return"-"===t[0]?20>t.length||20===t.length&&-922337t.length||19===t.length&&922337>Number(t.substring(0,6))}function Pe(t){return t=Math.trunc(t),Number.isSafeInteger(t)||($(t),t=it(J,Q)),t}function Oe(t){var e=Math.trunc(Number(t));return Number.isSafeInteger(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Re(t)||(ot(t),t=rt()),t)}function Le(t){return null==t?t:Ae(t)?"number"==typeof t?Pe(t):Oe(t):void 0}function Fe(t){if("string"!=typeof t)throw Error();return t}function De(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ke(t){return null==t||"string"==typeof t?t:void 0}function Ie(t,e,i,s){if(null!=t&&"object"==typeof t&&t.W===oe)return t;if(!Array.isArray(t))return i?2&s?(t=e[jt])?e=t:(ie((t=new e).s),e=e[jt]=t):e=new e:e=void 0,e;let n=i=Qt(t);return 0===n&&(n|=32&s),n|=2&s,n!==i&&te(t,n),new e(t)}function Be(t,e,i){if(e){var s=!!s;if(!Ae(e=t))throw we("int64");"string"==typeof e?s=Oe(e):s?(s=Math.trunc(e),Number.isSafeInteger(s)?s=String(s):Re(e=String(s))?s=e:($(s),s=rt())):s=Pe(e)}else s=Le(t);return"string"==typeof(i=null==(t=s)?i?0:void 0:t)&&(s=+i,Number.isSafeInteger(s))?s:i}let Ne,Ue,Xe;function Ye(t){switch(typeof t){case"boolean":return Ue||=[0,void 0,!0];case"number":return 0{t.call(e,this.get(s),s,this)}))}set(t,e){return qe(this),null==(t=this.R(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.Y(e,!0,!0,this.V,!1,this.O))}Ta(t){const e=this.R(t[0],!1,!0);t=t[1],t=this.V?void 0===t?null:t:this.Y(t,!1,!0,void 0,!1,this.O),super.set(e,t)}has(t){return super.has(this.R(t,!1,!1))}get(t){t=this.R(t,!1,!1);const e=super.get(t);if(void 0!==e){var i=this.V;return i?((i=this.Y(e,!1,!0,i,this.xa,this.O))!==e&&super.set(t,i),i):e}}ma(){return Array.from(super.keys())}Ma(){return super.keys()}[Symbol.iterator](){return this.entries()}};function Ze(t,e,i,s,n,r){return t=Ie(t,s,i,r),n&&(t=oi(t)),t}function Je(t){return t}function Qe(t){return[t,this.get(t)]}function $e(t,e,i,s,n,r){if(null!=t){if(Array.isArray(t))t=n&&0==t.length&&1&Qt(t)?void 0:r&&2&Qt(t)?t:ti(t,e,i,void 0!==s,n,r);else if(le(t)){const o={};for(let a in t)o[a]=$e(t[a],e,i,s,n,r);t=o}else t=e(t,s);return t}}function ti(t,e,i,s,n,r){const o=s||i?Qt(t):0;s=s?!!(32&o):void 0;const a=Vt(t);for(let t=0;tsi(t,n,s))),qt(t,32|(i?2:0)),t}function oi(t){const e=t.s,i=$t(e);return 2&i?ni(t,e,i,!1):t}function ai(t,e){return hi(t=t.s,$t(t),e)}function hi(t,e,i,s){if(-1===i)return null;if(i>=re(e)){if(256&e)return t[t.length-1][i]}else{var n=t.length;if(s&&256&e&&null!=(s=t[n-1][i]))return s;if((e=i+(+!!(512&e)-1))=r||n){if(n=e,256&e)r=t[t.length-1];else{if(null==s)return n;r=t[r+(+!!(512&e)-1)]={},n|=256}return r[i]=s,n!==e&&te(t,n),n}return t[i+(+!!(512&e)-1)]=s,256&e&&i in(t=t[t.length-1])&&delete t[i],e}function ci(t,e,i,s,n){var r=2&e;let o=hi(t,e,i,n);Array.isArray(o)||(o=fe);const a=!(2&s);s=!(1&s);const h=!!(32&e);let l=Qt(o);return 0!==l||!h||r||a?1&l||(l|=1,te(o,l)):(l|=33,te(o,l)),r?(t=!1,2&l||(ie(o),t=!!(4&l)),(s||t)&&Object.freeze(o)):(r=!!(2&l)||!!(2048&l),s&&r?(o=Vt(o),s=1,h&&!a&&(s|=32),te(o,s),ui(t,e,i,o,n)):a&&32&l&&!r&&Zt(o,32)),o}function di(t,e){t=t.s;let i=$t(t);const s=hi(t,i,e),n=be(s);return null!=n&&n!==s&&ui(t,i,e,n),n}function fi(t){t=t.s;let e=$t(t);const i=hi(t,e,1),s=ce(i,!0,!!(34&e));return null!=s&&s!==i&&ui(t,e,1,s),s}function pi(t,e,i){t=t.s;let s=$t(t);const n=2&s?1:2;let r=gi(t,s,e);var o=Qt(r);if(!(4&o)){(4&o||Object.isFrozen(r))&&(r=Vt(r),o=Fi(o,s,!1),s=ui(t,s,e,r));var a=0;let n=0;for(;a=r){Object.assign(e[e.length-1]={},a);break}o=!0}var h;r=e,i=!i,t=re(a=$t(t.s)),a=+!!(512&a)-1;for(let e=0;en(t,e,s):(t,e)=>{for(;Tt(e)&&4!=e.h;){var n=e.m,r=s[n];if(!r){var o=s.ha;o&&(o=o[n])&&(r=s[n]=Ki(o))}r&&r(e,t,n)||(n=(r=e).l,wt(r),r.ga?r=void 0:(o=r.g.g-n,r.g.g=n,r=yt(r.g,o)),n=t,r&&(ye||=Symbol(),(o=n[ye])?o.push(r):n[ye]=[r]))}i===Zi||i===Ji||i.Oa||(t[xe||=Symbol()]=i)},t[ji]=e}return e}function Ki(t){const e=(t=Wi(t))[0].g;if(t=t[1]){const i=qi(t),s=fs(t).S;return(t,n,r)=>e(t,n,r,s,i)}return e}let Zi,Ji;const Qi=Symbol();function $i(t,e,i){const s=i[1];let n;if(s){const i=s[Qi];n=i?i.S:Ye(s[0]),t[e]=i??s}n&&n===Ue?(t.na||(t.na=[])).push(e):i[0]&&(t.oa||(t.oa=[])).push(e)}function ts(t,e){return[t.l,!e||0o&&(u-=o,o=t[++r]);hgs(t,e,i),t[ns]=e}return e}const os=Symbol();function as(t){return t.h}function hs(t,e){let i,s;const n=t.h;return(t,r,o)=>n(t,r,o,s||=ls(e).S,i||=rs(e))}function ls(t){let e=t[os];return e||(e=ss(t,t[os]={},as,hs),us in t&&os in t&&(t.length=0),e)}const us=Symbol();function cs(t,e){const i=t.g;return e?(t,s,n)=>i(t,s,n,e):i}function ds(t,e,i){const s=t.g;let n,r;return(t,o,a)=>s(t,o,a,r||=fs(e).S,n||=qi(e),i)}function fs(t){let e=t[us];return e||(es(t),e=ss(t,t[us]={},cs,ds),us in t&&os in t&&(t.length=0),e)}function ps(t,e){var i=t[e];if(i)return i;if((i=t.ha)&&(i=i[e])){var s=(i=Wi(i))[0].h;if(i=i[1]){const e=rs(i),n=ls(i).S;i=(i=t.h)?i(n,e):(t,i,r)=>s(t,i,r,n,e)}else i=s;return t[e]=i}}function gs(t,e,i){for(var s=$t(t),n=+!!(512&s)-1,r=t.length,o=512&s?1:0,a=r+(256&s?-1:0);o{zt(t,i,ze([r,e],s),n)}));else if(Array.isArray(e))for(let r=0;r>31)+1;const r=n>>>20&2047;return t=4294967296*(1048575&n)+t,xs(e,i,2047==r?t?NaN:1/0*s:0==r?s*Math.pow(2,-1074)*t:s*Math.pow(2,r-1075)*(t+4503599627370496)),!0}),(function(t,e,i){null!=(e=be(e))&&(Nt(t,i,1),t=t.g,(i=Z||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),J=i.getUint32(0,!0),Q=i.getUint32(4,!0),It(t,J),It(t,Q))})),Ps=vs((function(t,e,i){return 5===t.h&&(xs(e,i,ft(t.g)),!0)}),(function(t,e,i){null!=(e=be(e))&&(Nt(t,i,5),t=t.g,tt(e),It(t,J))})),Os=ms(Cs,(function(t,e,i){if(null!=(e=Hi(be,e)))for(let o=0;ot){$(t);const e=st(J,Q);return t=Number(e),Number.isSafeInteger(t)?t:e}return Me(String(t))?t:($(t),et(J,Q))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Ct(e),null!=e&&(Nt(t,i,0),"number"==typeof e?(t=t.g,$(e),Ft(t,J,Q)):(i=Ct(e),Ft(t.g,i.h,i.g))))})),Is=vs((function(t,e,i){return 0===t.h&&(xs(e,i,ut(t.g)),!0)}),bs),Bs=ms((function(t,e,i){return(0===t.h||2===t.h)&&(e=ci(e,$t(e),i,2,!1),2==t.h?At(t,ut,e):e.push(ut(t.g)),!0)}),(function(t,e,i){if(null!=(e=Hi(_e,e))&&e.length){i=Ut(t,i);for(let i=0;i{t:{if(_t.length){const t=_t.pop();t.o(s),gt(t.g,i,s),i=t}else i=new class{constructor(t,e){if(xt.length){const i=xt.pop();gt(i,t,e),t=i}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,gt(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ga:t=!1}={}){this.ga=t}}(i,s);try{const s=new t,r=s.s;qi(e)(r,i),xe&&delete r[xe];var n=s;break t}finally{i.g.clear(),i.m=-1,i.h=-1,100>_t.length&&_t.push(i)}n=void 0}return n}}function tn(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};gs(this.s,e,ls(t)),Bt(e,e.g.end());const i=new Uint8Array(e.h),s=e.l,n=s.length;let r=0;for(let t=0;t({index:Bi(ki(t,1))??-1,score:Ni(t,2)??0,categoryName:Ii(t,3)??""??"",displayName:Ii(t,4)??""??""}))),headIndex:e,headName:i}}function Co(t){var e=pi(t,3,be),i=pi(t,2,_e),s=pi(t,1,ke),n=pi(t,9,ke);const r={categories:[],keypoints:[]};for(let t=0;t127=s||0>=n)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return i/Math.sqrt(s*n)}let Lo;fn[516587230]=Eo;const Fo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Do(){if(void 0===Lo)try{await WebAssembly.instantiate(Fo),Lo=!0}catch{Lo=!1}return Lo}async function ko(t,e=""){const i=await Do()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${i}.js`,wasmBinaryPath:`${e}/${t}_${i}.wasm`}}var Io=class{};function Bo(){const t=navigator.userAgent;return t.includes("Safari")&&!t.includes("Chrome")}async function No(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,i)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{i(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Uo(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),i(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Xo(t,e,i){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(i?t.i._bindTextureToStream(i):t.i._bindTextureToCanvas(),!(i=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");return t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!0),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),e.videoWidth?(i=e.videoWidth,e=e.videoHeight):e.naturalWidth?(i=e.naturalWidth,e=e.naturalHeight):(i=e.width,e=e.height),!t.l||i===t.i.canvas.width&&e===t.i.canvas.height||(t.i.canvas.width=i,t.i.canvas.height=e),[i,e]}function Yo(t,e,i){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const s=new Uint32Array(e.length);for(let i=0;i>2),i(e);for(const e of s)t.i._free(e);t.i._free(e)}function zo(t,e,i){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=i}function Go(t,e,i){let s=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,n)=>{e?(i(s,n),s=[]):s.push(t)}}function Vo(t,e){const i=Mi(t.baseOptions,_r,1)||new _r;"string"==typeof e?(li(i,2,De(e)),li(i,1)):e instanceof Uint8Array&&(li(i,1,ce(e,!1,!1)),li(i,2)),Oi(t.baseOptions,0,1,i)}function Wo(t){try{const e=t.F.length;if(1===e)throw Error(t.F[0].message);if(1t.message)).join(", "))}finally{t.F=[]}}function Ho(t,e){t.I=Math.max(t.I,e)}function jo(t,e){t.C=new En,Tn(t.C,"PassThroughCalculator"),wn(t.C,"free_memory"),bn(t.C,"free_memory_unused_out"),Pn(e,"free_memory"),Rn(e,t.C)}function qo(t,e){wn(t.C,e),bn(t.C,e+"_unused_out")}function Ko(t){t.g.addBoolToStream(!0,"free_memory",t.I)}Io.forVisionTasks=function(t){return ko("vision",t)},Io.forTextTasks=function(t){return ko("text",t)},Io.forAudioTasks=function(t){return ko("audio",t)},Io.isSimdSupported=function(){return Do()};var Zo=class{constructor(t){this.g=t,this.F=[],this.I=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Mi(this.baseOptions,_r,1)?.g()||Mi(this.baseOptions,_r,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let i=Mi(t.baseOptions,Sr,3);if(!i){var s=i=new Sr,n=new ln;Li(s,4,Ar,n)}"delegate"in e&&("GPU"===e.delegate?(e=i,s=new on,Li(e,2,Ar,s)):(e=i,s=new ln,Li(e,4,Ar,s))),Oi(t.baseOptions,0,3,i)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Vo(this,"/model.dat"),this.m(),this.N()}));Vo(this,e.modelAssetBuffer)}return this.m(),this.N(),Promise.resolve()}N(){}da(){let t;if(this.g.da((e=>{t=Dn(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.F.push(Error(e))})),this.g.Ra(),this.g.setGraph(t,e),this.C=void 0,Wo(this)}finishProcessing(){this.g.finishProcessing(),Wo(this)}close(){this.C=void 0,this.g.closeGraph()}};function Jo(t,e){if(null===t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}Zo.prototype.close=Zo.prototype.close;class Qo{constructor(t,e,i,s){this.g=t,this.h=e,this.m=i,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function $o(t,e,i){const s=t.g;if(i=Jo(s.createShader(i),"Failed to create WebGL shader"),s.shaderSource(i,e),s.compileShader(i),!s.getShaderParameter(i,s.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(i)}`);return s.attachShader(t.h,i),i}function ta(t,e){const i=t.g,s=Jo(i.createVertexArray(),"Failed to create vertex array");i.bindVertexArray(s);const n=Jo(i.createBuffer(),"Failed to create buffer");i.bindBuffer(i.ARRAY_BUFFER,n),i.enableVertexAttribArray(t.N),i.vertexAttribPointer(t.N,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);const r=Jo(i.createBuffer(),"Failed to create buffer");return i.bindBuffer(i.ARRAY_BUFFER,r),i.enableVertexAttribArray(t.M),i.vertexAttribPointer(t.M,2,i.FLOAT,!1,0,0),i.bufferData(i.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),i.STATIC_DRAW),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindVertexArray(null),new Qo(i,s,n,r)}function ea(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function ia(t,e,i,s){return ea(t,e),t.h||(t.m(),t.F()),i?(t.u||(t.u=ta(t,!0)),i=t.u):(t.v||(t.v=ta(t,!1)),i=t.v),e.useProgram(t.h),i.bind(),t.l(),t=s(),i.g.bindVertexArray(null),t}function sa(t,e,i){return ea(t,e),t=Jo(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function na(t,e,i){ea(t,e),t.C||(t.C=Jo(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.C),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0)}function ra(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var oa=class{I(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){const t=this.g;if(this.h=Jo(t.createProgram(),"Failed to create WebGL program"),this.ta=$o(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.sa=$o(this,this.I(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.N=t.getAttribLocation(this.h,"aVertex"),this.M=t.getAttribLocation(this.h,"aTex")}F(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.ta),t.deleteShader(this.sa)}this.C&&this.g.deleteFramebuffer(this.C),this.v&&this.v.close(),this.u&&this.u.close()}},aa=class extends oa{I(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}F(){const t=this.g;t.activeTexture(t.TEXTURE1),this.B=sa(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=sa(this,t,t.NEAREST)}m(){super.m();const t=this.g;this.U=Jo(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.ra=Jo(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.T=Jo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.T,0),t.uniform1i(this.U,1),t.uniform1i(this.ra,2)}close(){this.B&&this.g.deleteTexture(this.B),this.j&&this.g.deleteTexture(this.j),super.close()}},ha=class extends oa{I(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}F(){const t=this.g;t.activeTexture(t.TEXTURE1),this.j=sa(this,t),t.activeTexture(t.TEXTURE2),this.B=sa(this,t)}m(){super.m();const t=this.g;this.T=Jo(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.U=Jo(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.J=Jo(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();const t=this.g;t.uniform1i(this.J,0),t.uniform1i(this.T,1),t.uniform1i(this.U,2)}close(){this.j&&this.g.deleteTexture(this.j),this.B&&this.g.deleteTexture(this.B),super.close()}};function la(t,e){switch(e){case 0:return t.g.find((t=>t instanceof Uint8Array));case 1:return t.g.find((t=>t instanceof Float32Array));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function ua(t){var e=la(t,1);if(!e){if(e=la(t,0))e=new Float32Array(e).map((t=>t/255));else{e=new Float32Array(t.width*t.height);const s=da(t);var i=pa(t);if(na(i,s,ca(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in self.document){i=new Float32Array(t.width*t.height*4),s.readPixels(0,0,t.width,t.height,s.RGBA,s.FLOAT,i);for(let t=0,s=0;t255*t))),this.g.push(t)),t;var t}ia(){return ua(this)}K(){return ca(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof Uint8Array)i=new Uint8Array(e);else if(e instanceof Float32Array)i=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const t=da(this),e=pa(this);t.activeTexture(t.TEXTURE1),i=sa(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,i);const s=fa(this);t.texImage2D(t.TEXTURE_2D,0,s,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),na(e,t,i),ia(e,t,!1,(()=>{ga(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),va(this)})),ra(e),va(this)}}t.push(i)}return new ya(t,this.m,this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&da(this).deleteTexture(la(this,2)),xa=-1}};ya.prototype.close=ya.prototype.close,ya.prototype.clone=ya.prototype.clone,ya.prototype.getAsWebGLTexture=ya.prototype.K,ya.prototype.getAsFloat32Array=ya.prototype.ia,ya.prototype.getAsUint8Array=ya.prototype.ja,ya.prototype.hasWebGLTexture=ya.prototype.P,ya.prototype.hasFloat32Array=ya.prototype.ka,ya.prototype.hasUint8Array=ya.prototype.La;var xa=250;const Ta={color:"white",lineWidth:4,radius:6};function wa(t){return{...Ta,fillColor:(t=t||{}).color,...t}}function ba(t,e){return t instanceof Function?t(e):t}function Ea(t,e,i){return Math.max(Math.min(e,i),Math.min(Math.max(e,i),t))}function Sa(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Aa(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function _a(t,e,i){if(e.P())i(e.K());else{const s=e.ka()?e.ia():e.ja();t.m=t.m??new oa;const n=Aa(t);i((t=new ya([s],e.m,!1,n.canvas,t.m,e.width,e.height)).K()),t.close()}}function Ca(t,e,i,s){const n=function(t){return t.g||(t.g=new aa),t.g}(t),r=Aa(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i;ia(n,r,!0,(()=>{!function(t,e,i,s){const n=t.g;if(n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,e),n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,t.B),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i),t.J&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(const[s,n]of t){t=s;const r=n;var i=e.next();if(i.done)return!1;const[o,a]=i.value;if(i=a,t!==o||r[0]!==i[0]||r[1]!==i[1]||r[2]!==i[2]||r[3]!==i[3])return!1}return!!e.next().done}(t.J,s))n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,t.j);else{t.J=s;const e=Array(1024).fill(0);s.forEach(((t,i)=>{if(4!==t.length)throw Error(`Color at index ${i} is not a four-channel value.`);e[4*i]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]})),n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,t.j),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,256,1,0,n.RGBA,n.UNSIGNED_BYTE,new Uint8Array(e))}}(n,e,o,s),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4);const t=n.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}function Ma(t,e,i,s){const n=Aa(t),r=function(t){return t.h||(t.h=new ha),t.h}(t),o=Array.isArray(i)?new ImageData(new Uint8ClampedArray(i),1,1):i,a=Array.isArray(s)?new ImageData(new Uint8ClampedArray(s),1,1):s;ia(r,n,!0,(()=>{var t=r.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,r.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,r.B),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),n.bindTexture(n.TEXTURE_2D,null),(t=r.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)}))}var Ra=class{constructor(t,e){t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}Ea(t,e){if(t){var i=Sa(this);e=wa(e),i.save();var s=i.canvas,n=0;for(const r of t)i.fillStyle=ba(e.fillColor,{index:n,from:r}),i.strokeStyle=ba(e.color,{index:n,from:r}),i.lineWidth=ba(e.lineWidth,{index:n,from:r}),(t=new Path2D).arc(r.x*s.width,r.y*s.height,ba(e.radius,{index:n,from:r}),0,2*Math.PI),i.fill(t),i.stroke(t),++n;i.restore()}}Da(t,e,i){if(t&&e){var s=Sa(this);i=wa(i),s.save();var n=s.canvas,r=0;for(const o of e){s.beginPath(),e=t[o.start];const a=t[o.end];e&&a&&(s.strokeStyle=ba(i.color,{index:r,from:e,to:a}),s.lineWidth=ba(i.lineWidth,{index:r,from:e,to:a}),s.moveTo(e.x*n.width,e.y*n.height),s.lineTo(a.x*n.width,a.y*n.height)),++r,s.stroke()}s.restore()}}Aa(t,e){const i=Sa(this);e=wa(e),i.save(),i.beginPath(),i.lineWidth=ba(e.lineWidth,{}),i.strokeStyle=ba(e.color,{}),i.fillStyle=ba(e.fillColor,{}),i.moveTo(t.originX,t.originY),i.lineTo(t.originX+t.width,t.originY),i.lineTo(t.originX+t.width,t.originY+t.height),i.lineTo(t.originX,t.originY+t.height),i.lineTo(t.originX,t.originY),i.stroke(),i.fill(),i.restore()}Ba(t,e,i=[0,0,0,255]){this.l?function(t,e,i,s){const n=Aa(t);_a(t,e,(e=>{Ca(t,e,i,s),(e=Sa(t)).drawImage(n.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,i,e):Ca(this,t.K(),i,e)}Ca(t,e,i){this.l?function(t,e,i,s){const n=Aa(t);_a(t,e,(e=>{Ma(t,e,i,s),(e=Sa(t)).drawImage(n.canvas,0,0,e.canvas.width,e.canvas.height)}))}(this,t,e,i):Ma(this,t.K(),e,i)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Pa(t,e){switch(e){case 0:return t.g.find((t=>t instanceof ImageData));case 1:return t.g.find((t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap));case 2:return t.g.find((t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function Oa(t){var e=Pa(t,0);if(!e){e=Fa(t);const i=Da(t),s=new Uint8Array(t.width*t.height*4);na(i,e,La(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,s),ra(i),e=new ImageData(new Uint8ClampedArray(s.buffer),t.width,t.height),t.g.push(e)}return e}function La(t){let e=Pa(t,2);if(!e){const i=Fa(t);e=ka(t);const s=Pa(t,1)||Oa(t);i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,s),Ia(t)}return e}function Fa(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when iniitializing the image.");return t.h||(t.h=Jo(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Da(t){return t.l||(t.l=new oa),t.l}function ka(t){const e=Fa(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let i=Pa(t,2);return i||(i=sa(Da(t),e),t.g.push(i),t.m=!0),e.bindTexture(e.TEXTURE_2D,i),i}function Ia(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Ba(t){const e=Fa(t);return ia(Da(t),e,!0,(()=>function(t,e){const i=t.canvas;if(i.width===t.width&&i.height===t.height)return e();const s=i.width,n=i.height;return i.width=t.width,i.height=t.height,t=e(),i.width=s,i.height=n,t}(t,(()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))))}Ra.prototype.close=Ra.prototype.close,Ra.prototype.drawConfidenceMask=Ra.prototype.Ca,Ra.prototype.drawCategoryMask=Ra.prototype.Ba,Ra.prototype.drawBoundingBox=Ra.prototype.Aa,Ra.prototype.drawConnectors=Ra.prototype.Da,Ra.prototype.drawLandmarks=Ra.prototype.Ea,Ra.lerp=function(t,e,i,s,n){return Ea(s*(1-(t-e)/(i-e))+n*(1-(i-t)/(i-e)),s,n)},Ra.clamp=Ea;var Na=class{constructor(t,e,i,s,n,r,o){this.g=t,this.j=e,this.m=i,this.canvas=s,this.l=n,this.width=r,this.height=o,(this.j||this.m)&&0==--Ua&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ka(){return!!Pa(this,0)}la(){return!!Pa(this,1)}P(){return!!Pa(this,2)}Ia(){return Oa(this)}Ha(){var t=Pa(this,1);return t||(La(this),ka(this),t=Ba(this),Ia(this),this.g.push(t),this.j=!0),t}K(){return La(this)}clone(){const t=[];for(const e of this.g){let i;if(e instanceof ImageData)i=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){const t=Fa(this),e=Da(this);t.activeTexture(t.TEXTURE1),i=sa(e,t),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),na(e,t,i),ia(e,t,!1,(()=>{ka(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ia(this)})),ra(e),Ia(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);La(this),ka(this),i=Ba(this),Ia(this)}t.push(i)}return new Na(t,this.la(),this.P(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Pa(this,1).close(),this.m&&Fa(this).deleteTexture(Pa(this,2)),Ua=-1}};Na.prototype.close=Na.prototype.close,Na.prototype.clone=Na.prototype.clone,Na.prototype.getAsWebGLTexture=Na.prototype.K,Na.prototype.getAsImageBitmap=Na.prototype.Ha,Na.prototype.getAsImageData=Na.prototype.Ia,Na.prototype.hasWebGLTexture=Na.prototype.P,Na.prototype.hasImageBitmap=Na.prototype.la,Na.prototype.hasImageData=Na.prototype.Ka;var Ua=250;function Xa(...t){return t.map((([t,e])=>({start:t,end:e})))}const Ya=function(t){return class extends t{Ra(){this.i._registerModelResourcesGraphService()}}}((za=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:"undefined"==typeof OffscreenCanvas||Bo()?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1)}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const i=t.length,s=this.i._malloc(i);this.i.HEAPU8.set(t,s),e?this.i._changeBinaryGraph(i,s):this.i._changeTextGraph(i,s),this.i._free(s)}configureAudio(t,e,i,s,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Uo(this,s||"input_audio",(s=>{Uo(this,n=n||"audio_header",(n=>{this.i._configureAudio(s,n,t,e,i)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}da(t){zo(this,"__graph_config__",(e=>{t(e)})),Uo(this,"__graph_config__",(t=>{this.i._getGraphConfig(t,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,i){this.addAudioToStreamWithShape(t,0,0,e,i)}addAudioToStreamWithShape(t,e,i,s,n){const r=4*t.length;this.h!==r&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(r),this.h=r),this.i.HEAPF32.set(t,this.g/4),Uo(this,s,(t=>{this.i._addAudioToInputStream(this.g,e,i,t,n)}))}addGpuBufferToStream(t,e,i){Uo(this,e,(e=>{const[s,n]=Xo(this,t,e);this.i._addBoundTextureToStream(e,s,n,i)}))}addBoolToStream(t,e,i){Uo(this,e,(e=>{this.i._addBoolToInputStream(t,e,i)}))}addDoubleToStream(t,e,i){Uo(this,e,(e=>{this.i._addDoubleToInputStream(t,e,i)}))}addFloatToStream(t,e,i){Uo(this,e,(e=>{this.i._addFloatToInputStream(t,e,i)}))}addIntToStream(t,e,i){Uo(this,e,(e=>{this.i._addIntToInputStream(t,e,i)}))}addStringToStream(t,e,i){Uo(this,e,(e=>{Uo(this,t,(t=>{this.i._addStringToInputStream(t,e,i)}))}))}addStringRecordToStream(t,e,i){Uo(this,e,(e=>{Yo(this,Object.keys(t),(s=>{Yo(this,Object.values(t),(n=>{this.i._addFlatHashMapToInputStream(s,n,Object.keys(t).length,e,i)}))}))}))}addProtoToStream(t,e,i,s){Uo(this,i,(i=>{Uo(this,e,(e=>{const n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputStream(n,t.length,e,i,s),this.i._free(n)}))}))}addEmptyPacketToStream(t,e){Uo(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,i){Uo(this,e,(e=>{const s=this.i._allocateBoolVector(t.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(s,e);this.i._addBoolVectorToInputStream(s,e,i)}))}addDoubleVectorToStream(t,e,i){Uo(this,e,(e=>{const s=this.i._allocateDoubleVector(t.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(s,e);this.i._addDoubleVectorToInputStream(s,e,i)}))}addFloatVectorToStream(t,e,i){Uo(this,e,(e=>{const s=this.i._allocateFloatVector(t.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(s,e);this.i._addFloatVectorToInputStream(s,e,i)}))}addIntVectorToStream(t,e,i){Uo(this,e,(e=>{const s=this.i._allocateIntVector(t.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(s,e);this.i._addIntVectorToInputStream(s,e,i)}))}addStringVectorToStream(t,e,i){Uo(this,e,(e=>{const s=this.i._allocateStringVector(t.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Uo(this,e,(t=>{this.i._addStringVectorEntry(s,t)}));this.i._addStringVectorToInputStream(s,e,i)}))}addBoolToInputSidePacket(t,e){Uo(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Uo(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Uo(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Uo(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Uo(this,e,(e=>{Uo(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,i){Uo(this,i,(i=>{Uo(this,e,(e=>{const s=this.i._malloc(t.length);this.i.HEAPU8.set(t,s),this.i._addProtoToInputSidePacket(s,t.length,e,i),this.i._free(s)}))}))}addBoolVectorToInputSidePacket(t,e){Uo(this,e,(e=>{const i=this.i._allocateBoolVector(t.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.i._addBoolVectorEntry(i,e);this.i._addBoolVectorToInputSidePacket(i,e)}))}addDoubleVectorToInputSidePacket(t,e){Uo(this,e,(e=>{const i=this.i._allocateDoubleVector(t.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.i._addDoubleVectorEntry(i,e);this.i._addDoubleVectorToInputSidePacket(i,e)}))}addFloatVectorToInputSidePacket(t,e){Uo(this,e,(e=>{const i=this.i._allocateFloatVector(t.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.i._addFloatVectorEntry(i,e);this.i._addFloatVectorToInputSidePacket(i,e)}))}addIntVectorToInputSidePacket(t,e){Uo(this,e,(e=>{const i=this.i._allocateIntVector(t.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.i._addIntVectorEntry(i,e);this.i._addIntVectorToInputSidePacket(i,e)}))}addStringVectorToInputSidePacket(t,e){Uo(this,e,(e=>{const i=this.i._allocateStringVector(t.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Uo(this,e,(t=>{this.i._addStringVectorEntry(i,t)}));this.i._addStringVectorToInputSidePacket(i,e)}))}attachBoolListener(t,e){zo(this,t,e),Uo(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Go(this,t,e),Uo(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){zo(this,t,e),Uo(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){Go(this,t,e),Uo(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){zo(this,t,e),Uo(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Go(this,t,e),Uo(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){zo(this,t,e),Uo(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Go(this,t,e),Uo(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){zo(this,t,e),Uo(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){Go(this,t,e),Uo(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,i){zo(this,t,e),Uo(this,t,(t=>{this.i._attachProtoListener(t,i||!1)}))}attachProtoVectorListener(t,e,i){Go(this,t,e),Uo(this,t,(t=>{this.i._attachProtoVectorListener(t,i||!1)}))}attachAudioListener(t,e,i){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),zo(this,t,((t,i)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,i)})),Uo(this,t,(t=>{this.i._attachAudioListener(t,i||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends za{get fa(){return this.i}va(t,e,i){Uo(this,e,(e=>{const[s,n]=Xo(this,t,e);this.fa._addBoundTextureAsImageToStream(e,s,n,i)}))}ba(t,e){zo(this,t,e),Uo(this,t,(t=>{this.fa._attachImageListener(t)}))}ca(t,e){Go(this,t,e),Uo(this,t,(t=>{this.fa._attachImageVectorListener(t)}))}}));var za,Ga=class extends Ya{};async function Va(t,e,i){return async function(t,e,i,s){return async function(t,e,i,s){return t=await(async(t,e,i,s,n)=>{if(e&&await No(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(i&&(await No(i),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,s)})(t,i.wasmLoaderPath,i.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?i.wasmBinaryPath.toString():i.assetBinaryPath&&t.endsWith(".data")?i.assetBinaryPath.toString():t}),await t.o(s),t}(t,e,i,s)}(t,i.canvas??("undefined"==typeof OffscreenCanvas||Bo()?document.createElement("canvas"):void 0),e,i)}function Wa(t,e,i,s){if(t.J){const r=new hr;if(i?.regionOfInterest){if(!t.U)throw Error("This task doesn't support region-of-interest.");var n=i.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(0>n.left||0>n.top||1{for(const e of t)t=Jn(e),this.j.detections.push(Co(t));Ho(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Za.prototype.detectForVideo=Za.prototype.H,Za.prototype.detect=Za.prototype.G,Za.prototype.setOptions=Za.prototype.o,Za.createFromModelPath=async function(t,e){return Va(Za,t,{baseOptions:{modelAssetPath:e}})},Za.createFromModelBuffer=function(t,e){return Va(Za,t,{baseOptions:{modelAssetBuffer:e}})},Za.createFromOptions=function(t,e){return Va(Za,t,e)};var Ja=Xa([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Qa=Xa([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),$a=Xa([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),th=Xa([474,475],[475,476],[476,477],[477,474]),eh=Xa([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),ih=Xa([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),sh=Xa([469,470],[470,471],[471,472],[472,469]),nh=Xa([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),rh=[...Ja,...Qa,...$a,...eh,...ih,...nh],oh=Xa([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function ah(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var hh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Oi(t=this.h=new Ur,0,1,e=new Mr),this.v=new Br,Oi(this.h,0,3,this.v),this.u=new Pr,Oi(this.h,0,2,this.u),Xi(this.u,4,1),Yi(this.u,2,.5),Yi(this.v,2,.5),Yi(this.h,4,.5)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return"numFaces"in t&&Xi(this.u,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Yi(this.u,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Yi(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Yi(this.v,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}G(t,e){return ah(this),Ha(this,t,e),this.j}H(t,e,i){return ah(this),ja(this,t,i,e),this.j}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"face_landmarks");const e=new dn;zi(e,Yr,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"NORM_LANDMARKS:face_landmarks"),i.o(e),Rn(t,i),this.g.attachProtoVectorListener("face_landmarks",((t,e)=>{for(const e of t)t=rr(e),this.j.faceLandmarks.push(Mo(t));Ho(this,e)})),this.g.attachEmptyPacketListener("face_landmarks",(t=>{Ho(this,t)})),this.outputFaceBlendshapes&&(On(t,"blendshapes"),bn(i,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((t,e)=>{if(this.outputFaceBlendshapes)for(const e of t)t=Xn(e),this.j.faceBlendshapes.push(_o(t.g()??[]));Ho(this,e)})),this.g.attachEmptyPacketListener("blendshapes",(t=>{Ho(this,t)}))),this.outputFacialTransformationMatrixes&&(On(t,"face_geometry"),bn(i,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((t,e)=>{if(this.outputFacialTransformationMatrixes)for(const e of t)(t=Mi(kr(e),or,2))&&this.j.facialTransformationMatrixes.push({rows:Bi(ki(t,1))??0,columns:Bi(ki(t,2))??0,data:pi(t,3,be)??[]});Ho(this,e)})),this.g.attachEmptyPacketListener("face_geometry",(t=>{Ho(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};hh.prototype.detectForVideo=hh.prototype.H,hh.prototype.detect=hh.prototype.G,hh.prototype.setOptions=hh.prototype.o,hh.createFromModelPath=function(t,e){return Va(hh,t,{baseOptions:{modelAssetPath:e}})},hh.createFromModelBuffer=function(t,e){return Va(hh,t,{baseOptions:{modelAssetBuffer:e}})},hh.createFromOptions=function(t,e){return Va(hh,t,e)},hh.FACE_LANDMARKS_LIPS=Ja,hh.FACE_LANDMARKS_LEFT_EYE=Qa,hh.FACE_LANDMARKS_LEFT_EYEBROW=$a,hh.FACE_LANDMARKS_LEFT_IRIS=th,hh.FACE_LANDMARKS_RIGHT_EYE=eh,hh.FACE_LANDMARKS_RIGHT_EYEBROW=ih,hh.FACE_LANDMARKS_RIGHT_IRIS=sh,hh.FACE_LANDMARKS_FACE_OVAL=nh,hh.FACE_LANDMARKS_CONTOURS=rh,hh.FACE_LANDMARKS_TESSELATION=oh;var lh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!0),Oi(t=this.j=new zr,0,1,e=new Mr)}get baseOptions(){return Mi(this.j,Mr,1)}set baseOptions(t){Oi(this.j,0,1,t)}o(t){return super.l(t)}Ua(t,e,i){const s="function"!=typeof e?e:{};if(this.h="function"==typeof e?e:i,Ha(this,t,s??{}),!this.h)return this.u}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"stylized_image");const e=new dn;zi(e,Gr,this.j);const i=new En;Tn(i,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"STYLIZED_IMAGE:stylized_image"),i.o(e),Rn(t,i),this.g.ba("stylized_image",((t,e)=>{var i=!this.h,s=t.data,n=t.width;const r=n*(t=t.height);if(s instanceof Uint8Array)if(s.length===3*r){const e=new Uint8ClampedArray(4*r);for(let t=0;t{this.u=null,this.h&&this.h(null),Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};lh.prototype.stylize=lh.prototype.Ua,lh.prototype.setOptions=lh.prototype.o,lh.createFromModelPath=function(t,e){return Va(lh,t,{baseOptions:{modelAssetPath:e}})},lh.createFromModelBuffer=function(t,e){return Va(lh,t,{baseOptions:{modelAssetBuffer:e}})},lh.createFromOptions=function(t,e){return Va(lh,t,e)};var uh=Xa([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function ch(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function dh(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function fh(t,e=!0){const i=[];for(const n of t){var s=Xn(n);t=[];for(const i of s.g())s=e&&null!=ki(i,1)?Bi(ki(i,1)):-1,t.push({score:Ni(i,2)??0,index:s,categoryName:Ii(i,3)??""??"",displayName:Ii(i,4)??""??""});i.push(t)}return i}var ph=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Oi(t=this.v=new eo,0,1,e=new Mr),this.B=new $r,Oi(this.v,0,2,this.B),this.u=new Jr,Oi(this.B,0,3,this.u),this.h=new Kr,Oi(this.B,0,2,this.h),this.j=new jr,Oi(this.v,0,3,this.j),Yi(this.h,2,.5),Yi(this.B,4,.5),Yi(this.u,2,.5)}get baseOptions(){return Mi(this.v,Mr,1)}set baseOptions(t){Oi(this.v,0,1,t)}o(t){if(Xi(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Yi(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Yi(this.B,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Yi(this.u,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Vr,i=e,s=Ao(t.cannedGesturesClassifierOptions,Mi(this.j,Vr,3)?.h());Oi(i,0,2,s),Oi(this.j,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&Mi(this.j,Vr,3)?.g();return t.customGesturesClassifierOptions?(Oi(i=e=new Vr,0,2,s=Ao(t.customGesturesClassifierOptions,Mi(this.j,Vr,4)?.h())),Oi(this.j,0,4,e)):void 0===t.customGesturesClassifierOptions&&Mi(this.j,Vr,4)?.g(),this.l(t)}Pa(t,e){return ch(this),Ha(this,t,e),dh(this)}Qa(t,e,i){return ch(this),ja(this,t,i,e),dh(this)}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"hand_gestures"),On(t,"hand_landmarks"),On(t,"world_hand_landmarks"),On(t,"handedness");const e=new dn;zi(e,no,this.v);const i=new En;Tn(i,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"HAND_GESTURES:hand_gestures"),bn(i,"LANDMARKS:hand_landmarks"),bn(i,"WORLD_LANDMARKS:world_hand_landmarks"),bn(i,"HANDEDNESS:handedness"),i.o(e),Rn(t,i),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t){t=rr(e);const i=[];for(const e of Pi(t,ir,1))i.push({x:Ni(e,1)??0,y:Ni(e,2)??0,z:Ni(e,3)??0});this.landmarks.push(i)}Ho(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Ho(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t){t=er(e);const i=[];for(const e of Pi(t,Qn,1))i.push({x:Ni(e,1)??0,y:Ni(e,2)??0,z:Ni(e,3)??0});this.worldLandmarks.push(i)}Ho(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Ho(this,t)})),this.g.attachProtoVectorListener("hand_gestures",((t,e)=>{this.gestures.push(...fh(t,!1)),Ho(this,e)})),this.g.attachEmptyPacketListener("hand_gestures",(t=>{Ho(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{this.handedness.push(...fh(t)),Ho(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function gh(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}ph.prototype.recognizeForVideo=ph.prototype.Qa,ph.prototype.recognize=ph.prototype.Pa,ph.prototype.setOptions=ph.prototype.o,ph.createFromModelPath=function(t,e){return Va(ph,t,{baseOptions:{modelAssetPath:e}})},ph.createFromModelBuffer=function(t,e){return Va(ph,t,{baseOptions:{modelAssetBuffer:e}})},ph.createFromOptions=function(t,e){return Va(ph,t,e)},ph.HAND_CONNECTIONS=uh;var vh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Oi(t=this.j=new $r,0,1,e=new Mr),this.u=new Jr,Oi(this.j,0,3,this.u),this.h=new Kr,Oi(this.j,0,2,this.h),Xi(this.h,3,1),Yi(this.h,2,.5),Yi(this.u,2,.5),Yi(this.j,4,.5)}get baseOptions(){return Mi(this.j,Mr,1)}set baseOptions(t){Oi(this.j,0,1,t)}o(t){return"numHands"in t&&Xi(this.h,3,t.numHands??1),"minHandDetectionConfidence"in t&&Yi(this.h,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Yi(this.j,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Yi(this.u,2,t.minHandPresenceConfidence??.5),this.l(t)}G(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ha(this,t,e),gh(this)}H(t,e,i){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ja(this,t,i,e),gh(this)}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"hand_landmarks"),On(t,"world_hand_landmarks"),On(t,"handedness");const e=new dn;zi(e,so,this.j);const i=new En;Tn(i,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"LANDMARKS:hand_landmarks"),bn(i,"WORLD_LANDMARKS:world_hand_landmarks"),bn(i,"HANDEDNESS:handedness"),i.o(e),Rn(t,i),this.g.attachProtoVectorListener("hand_landmarks",((t,e)=>{for(const e of t)t=rr(e),this.landmarks.push(Mo(t));Ho(this,e)})),this.g.attachEmptyPacketListener("hand_landmarks",(t=>{Ho(this,t)})),this.g.attachProtoVectorListener("world_hand_landmarks",((t,e)=>{for(const e of t)t=er(e),this.worldLandmarks.push(Ro(t));Ho(this,e)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(t=>{Ho(this,t)})),this.g.attachProtoVectorListener("handedness",((t,e)=>{var i=this.handedness,s=i.push;const n=[];for(const e of t){t=Xn(e);const i=[];for(const e of t.g())i.push({score:Ni(e,2)??0,index:Bi(ki(e,1))??-1,categoryName:Ii(e,3)??""??"",displayName:Ii(e,4)??""??""});n.push(i)}s.call(i,...n),Ho(this,e)})),this.g.attachEmptyPacketListener("handedness",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};vh.prototype.detectForVideo=vh.prototype.H,vh.prototype.detect=vh.prototype.G,vh.prototype.setOptions=vh.prototype.o,vh.createFromModelPath=function(t,e){return Va(vh,t,{baseOptions:{modelAssetPath:e}})},vh.createFromModelBuffer=function(t,e){return Va(vh,t,{baseOptions:{modelAssetBuffer:e}})},vh.createFromOptions=function(t,e){return Va(vh,t,e)},vh.HAND_CONNECTIONS=uh;var mh=class extends Ka{constructor(t,e){super(new Ga(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},Oi(t=this.h=new ro,0,1,e=new Mr)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return Oi(this.h,0,2,Ao(t,Mi(this.h,Tr,2))),this.l(t)}ya(t,e){return this.j={classifications:[]},Ha(this,t,e),this.j}za(t,e,i){return this.j={classifications:[]},ja(this,t,i,e),this.j}m(){var t=new Ln;Pn(t,"input_image"),Pn(t,"norm_rect"),On(t,"classifications");const e=new dn;zi(e,oo,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),wn(i,"IMAGE:input_image"),wn(i,"NORM_RECT:norm_rect"),bn(i,"CLASSIFICATIONS:classifications"),i.o(e),Rn(t,i),this.g.attachProtoListener("classifications",((t,e)=>{this.j=function(t){const e={classifications:Pi(t,lr,1).map((t=>_o(Mi(t,Nn,4)?.g()??[],Bi(ki(t,2)),Ii(t,3)??"")))};return null!=Le(ai(t,2))&&(e.timestampMs=Bi(Le(ai(t,2)))),e}(dr(t)),Ho(this,e)})),this.g.attachEmptyPacketListener("classifications",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};mh.prototype.classifyForVideo=mh.prototype.za,mh.prototype.classify=mh.prototype.ya,mh.prototype.setOptions=mh.prototype.o,mh.createFromModelPath=function(t,e){return Va(mh,t,{baseOptions:{modelAssetPath:e}})},mh.createFromModelBuffer=function(t,e){return Va(mh,t,{baseOptions:{modelAssetBuffer:e}})},mh.createFromOptions=function(t,e){return Va(mh,t,e)};var yh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!0),this.h=new ao,this.embeddings={embeddings:[]},Oi(t=this.h,0,1,e=new Mr)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){var e=this.h,i=Mi(this.h,br,2);return i=i?i.clone():new br,void 0!==t.l2Normalize?Ui(i,1,t.l2Normalize):"l2Normalize"in t&&li(i,1),void 0!==t.quantize?Ui(i,2,t.quantize):"quantize"in t&&li(i,2),Oi(e,0,2,i),this.l(t)}Fa(t,e){return Ha(this,t,e),this.embeddings}Ga(t,e,i){return ja(this,t,i,e),this.embeddings}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"embeddings_out");const e=new dn;zi(e,ho,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"EMBEDDINGS:embeddings_out"),i.o(e),Rn(t,i),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=xr(t),this.embeddings=function(t){return{embeddings:Pi(t,gr,1).map((t=>{const e={headIndex:Bi(ki(t,3))??-1,headName:Ii(t,4)??""??""};if(void 0!==Ci(t,fr,Si(t,1)))t=pi(t=Mi(t,fr,Si(t,1)),1,be),e.floatEmbedding=t;else{const i=new Uint8Array(0);e.quantizedEmbedding=Mi(t,pr,Si(t,2))?.ua()?.wa()??i}return e})),timestampMs:Bi(Le(ai(t,2)))}}(t),Ho(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};yh.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Oo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Oo(Po(t.quantizedEmbedding),Po(e.quantizedEmbedding))}return t},yh.prototype.embedForVideo=yh.prototype.Ga,yh.prototype.embed=yh.prototype.Fa,yh.prototype.setOptions=yh.prototype.o,yh.createFromModelPath=function(t,e){return Va(yh,t,{baseOptions:{modelAssetPath:e}})},yh.createFromModelBuffer=function(t,e){return Va(yh,t,{baseOptions:{modelAssetBuffer:e}})},yh.createFromOptions=function(t,e){return Va(yh,t,e)};var xh=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};function Th(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function wh(t){try{const e=new xh(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Ko(t)}}xh.prototype.close=xh.prototype.close;var bh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new po,this.v=new lo,Oi(this.h,0,3,this.v),Oi(t=this.h,0,1,e=new Mr)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?li(this.h,2,De(t.displayNamesLocale)):"displayNamesLocale"in t&&li(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}N(){!function(t){const e=Pi(t.da(),En,1).filter((t=>(Ii(t,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.u=[],1{t.u[Number(i)]=Ii(e,1)??""}))}(this)}ea(t,e,i){const s="function"!=typeof e?e:{};return this.j="function"==typeof e?e:i,Th(this),Ha(this,t,s),wh(this)}Sa(t,e,i,s){const n="function"!=typeof i?i:{};return this.j="function"==typeof i?i:s,Th(this),ja(this,t,n,e),wh(this)}Ja(){return this.u}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect");const e=new dn;zi(e,go,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),i.o(e),Rn(t,i),jo(this,t),this.outputConfidenceMasks&&(On(t,"confidence_masks"),bn(i,"CONFIDENCE_MASKS:confidence_masks"),qo(this,"confidence_masks"),this.g.ca("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>qa(this,t,!0,!this.j))),Ho(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Ho(this,t)}))),this.outputCategoryMask&&(On(t,"category_mask"),bn(i,"CATEGORY_MASK:category_mask"),qo(this,"category_mask"),this.g.ba("category_mask",((t,e)=>{this.categoryMask=qa(this,t,!1,!this.j),Ho(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Ho(this,t)}))),On(t,"quality_scores"),bn(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Ho(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};bh.prototype.getLabels=bh.prototype.Ja,bh.prototype.segmentForVideo=bh.prototype.Sa,bh.prototype.segment=bh.prototype.ea,bh.prototype.setOptions=bh.prototype.o,bh.createFromModelPath=function(t,e){return Va(bh,t,{baseOptions:{modelAssetPath:e}})},bh.createFromModelBuffer=function(t,e){return Va(bh,t,{baseOptions:{modelAssetBuffer:e}})},bh.createFromOptions=function(t,e){return Va(bh,t,e)};var Eh=class{constructor(t,e,i){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=i}close(){this.confidenceMasks?.forEach((t=>{t.close()})),this.categoryMask?.close()}};Eh.prototype.close=Eh.prototype.close;var Sh=class extends Gi{constructor(t){super(t)}},Ah=[0,Is,-2],_h=[0,Rs,-3,Us],Ch=[0,Rs,-3,Us,Rs,-1],Mh=[0,Ch],Rh=[0,Mh,Ah],Ph=[0,Ch,Ah],Oh=[0,Ch,Is,-1],Lh=[0,Oh,Ah],Fh=[0,Rs,-3,Us,Ah,-1],Dh=[0,Rs,-3,Us,Ks],kh=class extends Gi{constructor(t){super(t)}},Ih=[0,Rs,-1,Us],Bh=class extends Gi{constructor(){super()}};Bh.A=[1];var Nh=class extends Gi{constructor(t){super(t)}},Uh=[1,2,3,4,5,6,7,8,9,10,14,15],Xh=[0,Uh,Hs,Ch,Hs,Ph,Hs,Mh,Hs,Rh,Hs,Ih,Hs,Dh,Hs,_h,Hs,[0,Gs,Rs,-2,Us,Is,Us,-1,2,Rs,Ah],Hs,Oh,Hs,Lh,Rs,Ah,Gs,Hs,Fh,Hs,[0,Ms,Ih]],Yh=[0,Gs,Is,-1,Us],zh=class extends Gi{constructor(){super()}};zh.A=[1],zh.prototype.g=tn([0,Ms,Xh,Gs,Yh]);var Gh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new po,this.v=new lo,Oi(this.h,0,3,this.v),Oi(t=this.h,0,1,e=new Mr)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}ea(t,e,i,s){const n="function"!=typeof i?i:{};this.j="function"==typeof i?i:s,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,i=this.I+1,s=new zh;const r=new Nh;var o=new Sh;if(Xi(o,1,255),Oi(r,0,12,o),e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var a=new kh;Ui(a,3,!0),Yi(a,1,e.keypoint.x),Yi(a,2,e.keypoint.y),Li(r,5,Uh,a)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");for(a of(o=new Bh,e.scribble))Ui(e=new kh,3,!0),Yi(e,1,a.x),Yi(e,2,a.y),Di(o,kh,e);Li(r,15,Uh,o)}Di(s,Nh,r),this.g.addProtoToStream(s.g(),"drishti.RenderData","roi_in",i),Ha(this,t,n);t:{try{const t=new Eh(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var h=t;break t}this.j(t)}finally{Ko(this)}h=void 0}return h}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"roi_in"),Pn(t,"norm_rect_in");const e=new dn;zi(e,go,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),wn(i,"IMAGE:image_in"),wn(i,"ROI:roi_in"),wn(i,"NORM_RECT:norm_rect_in"),i.o(e),Rn(t,i),jo(this,t),this.outputConfidenceMasks&&(On(t,"confidence_masks"),bn(i,"CONFIDENCE_MASKS:confidence_masks"),qo(this,"confidence_masks"),this.g.ca("confidence_masks",((t,e)=>{this.confidenceMasks=t.map((t=>qa(this,t,!0,!this.j))),Ho(this,e)})),this.g.attachEmptyPacketListener("confidence_masks",(t=>{this.confidenceMasks=[],Ho(this,t)}))),this.outputCategoryMask&&(On(t,"category_mask"),bn(i,"CATEGORY_MASK:category_mask"),qo(this,"category_mask"),this.g.ba("category_mask",((t,e)=>{this.categoryMask=qa(this,t,!1,!this.j),Ho(this,e)})),this.g.attachEmptyPacketListener("category_mask",(t=>{this.categoryMask=void 0,Ho(this,t)}))),On(t,"quality_scores"),bn(i,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((t,e)=>{this.qualityScores=t,Ho(this,e)})),this.g.attachEmptyPacketListener("quality_scores",(t=>{this.categoryMask=void 0,Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gh.prototype.segment=Gh.prototype.ea,Gh.prototype.setOptions=Gh.prototype.o,Gh.createFromModelPath=function(t,e){return Va(Gh,t,{baseOptions:{modelAssetPath:e}})},Gh.createFromModelBuffer=function(t,e){return Va(Gh,t,{baseOptions:{modelAssetBuffer:e}})},Gh.createFromOptions=function(t,e){return Va(Gh,t,e)};var Vh=class extends Ka{constructor(t,e){super(new Ga(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Oi(t=this.h=new vo,0,1,e=new Mr)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return void 0!==t.displayNamesLocale?li(this.h,2,De(t.displayNamesLocale)):"displayNamesLocale"in t&&li(this.h,2),void 0!==t.maxResults?Xi(this.h,3,t.maxResults):"maxResults"in t&&li(this.h,3),void 0!==t.scoreThreshold?Yi(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&li(this.h,4),void 0!==t.categoryAllowlist?wi(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&li(this.h,5),void 0!==t.categoryDenylist?wi(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&li(this.h,6),this.l(t)}G(t,e){return this.j={detections:[]},Ha(this,t,e),this.j}H(t,e,i){return this.j={detections:[]},ja(this,t,i,e),this.j}m(){var t=new Ln;Pn(t,"input_frame_gpu"),Pn(t,"norm_rect"),On(t,"detections");const e=new dn;zi(e,mo,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.ObjectDetectorGraph"),wn(i,"IMAGE:input_frame_gpu"),wn(i,"NORM_RECT:norm_rect"),bn(i,"DETECTIONS:detections"),i.o(e),Rn(t,i),this.g.attachProtoVectorListener("detections",((t,e)=>{for(const e of t)t=Jn(e),this.j.detections.push(Co(t));Ho(this,e)})),this.g.attachEmptyPacketListener("detections",(t=>{Ho(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Wh(t){t.landmarks=[],t.worldLandmarks=[],t.v=void 0}function Hh(t){try{const e=new class{constructor(t,e,i){this.landmarks=t,this.worldLandmarks=e,this.g=i}close(){this.g?.forEach((t=>{t.close()}))}}(t.landmarks,t.worldLandmarks,t.v);if(!t.u)return e;t.u(e)}finally{Ko(t)}}Vh.prototype.detectForVideo=Vh.prototype.H,Vh.prototype.detect=Vh.prototype.G,Vh.prototype.setOptions=Vh.prototype.o,Vh.createFromModelPath=async function(t,e){return Va(Vh,t,{baseOptions:{modelAssetPath:e}})},Vh.createFromModelBuffer=function(t,e){return Va(Vh,t,{baseOptions:{modelAssetBuffer:e}})},Vh.createFromOptions=function(t,e){return Va(Vh,t,e)};var jh=class extends Ka{constructor(t,e){super(new Ga(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Oi(t=this.h=new bo,0,1,e=new Mr),this.B=new To,Oi(this.h,0,3,this.B),this.j=new yo,Oi(this.h,0,2,this.j),Xi(this.j,4,1),Yi(this.j,2,.5),Yi(this.B,2,.5),Yi(this.h,4,.5)}get baseOptions(){return Mi(this.h,Mr,1)}set baseOptions(t){Oi(this.h,0,1,t)}o(t){return"numPoses"in t&&Xi(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Yi(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Yi(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Yi(this.B,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}G(t,e,i){const s="function"!=typeof e?e:{};return this.u="function"==typeof e?e:i,Wh(this),Ha(this,t,s),Hh(this)}H(t,e,i,s){const n="function"!=typeof i?i:{};return this.u="function"==typeof i?i:s,Wh(this),ja(this,t,n,e),Hh(this)}m(){var t=new Ln;Pn(t,"image_in"),Pn(t,"norm_rect"),On(t,"normalized_landmarks"),On(t,"world_landmarks"),On(t,"segmentation_masks");const e=new dn;zi(e,So,this.h);const i=new En;Tn(i,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),wn(i,"IMAGE:image_in"),wn(i,"NORM_RECT:norm_rect"),bn(i,"NORM_LANDMARKS:normalized_landmarks"),bn(i,"WORLD_LANDMARKS:world_landmarks"),i.o(e),Rn(t,i),jo(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((t,e)=>{this.landmarks=[];for(const e of t)t=rr(e),this.landmarks.push(Mo(t));Ho(this,e)})),this.g.attachEmptyPacketListener("normalized_landmarks",(t=>{this.landmarks=[],Ho(this,t)})),this.g.attachProtoVectorListener("world_landmarks",((t,e)=>{this.worldLandmarks=[];for(const e of t)t=er(e),this.worldLandmarks.push(Ro(t));Ho(this,e)})),this.g.attachEmptyPacketListener("world_landmarks",(t=>{this.worldLandmarks=[],Ho(this,t)})),this.outputSegmentationMasks&&(bn(i,"SEGMENTATION_MASK:segmentation_masks"),qo(this,"segmentation_masks"),this.g.ca("segmentation_masks",((t,e)=>{this.v=t.map((t=>qa(this,t,!0,!this.u))),Ho(this,e)})),this.g.attachEmptyPacketListener("segmentation_masks",(t=>{this.v=[],Ho(this,t)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};jh.prototype.detectForVideo=jh.prototype.H,jh.prototype.detect=jh.prototype.G,jh.prototype.setOptions=jh.prototype.o,jh.createFromModelPath=function(t,e){return Va(jh,t,{baseOptions:{modelAssetPath:e}})},jh.createFromModelBuffer=function(t,e){return Va(jh,t,{baseOptions:{modelAssetBuffer:e}})},jh.createFromOptions=function(t,e){return Va(jh,t,e)},jh.POSE_CONNECTIONS=Xa([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32])}}]); \ No newline at end of file