From 4e7ef160dc50884d6e9f8c946d73a1213382200f Mon Sep 17 00:00:00 2001 From: h0lybyte <5599058+h0lybyte@users.noreply.github.com> Date: Sun, 7 Jul 2024 08:25:40 +0000 Subject: [PATCH] Merge pull request #2333 from KBVE/beta Preparing Release Branch --- .../{App.C9255lI7.js => App.B_w_T50s.js} | 508 +++++++++--------- docs/index.html | 2 +- 2 files changed, 255 insertions(+), 255 deletions(-) rename docs/_astro/{App.C9255lI7.js => App.B_w_T50s.js} (81%) diff --git a/docs/_astro/App.C9255lI7.js b/docs/_astro/App.B_w_T50s.js similarity index 81% rename from docs/_astro/App.C9255lI7.js rename to docs/_astro/App.B_w_T50s.js index ed5e117..fd456a8 100644 --- a/docs/_astro/App.C9255lI7.js +++ b/docs/_astro/App.B_w_T50s.js @@ -1,4 +1,4 @@ -import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c as o1}from"./index.DIpCM_17.js";import{p as h1,a as bf}from"./index.DxhZiom7.js";import{t as vn}from"./index.BH1EYZ08.js";var Nf={exports:{}},te={};/** +import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as bf,r as Mr,a as Oe,c as h1}from"./index.DIpCM_17.js";import{p as l1,a as Nf}from"./index.DxhZiom7.js";import{t as De}from"./index.BH1EYZ08.js";var Gf={exports:{}},te={};/** * @license React * react-is.production.min.js * @@ -6,17 +6,17 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jo=Symbol.for("react.element"),$o=Symbol.for("react.portal"),wr=Symbol.for("react.fragment"),Rr=Symbol.for("react.strict_mode"),Fr=Symbol.for("react.profiler"),Lr=Symbol.for("react.provider"),Or=Symbol.for("react.context"),l1=Symbol.for("react.server_context"),Dr=Symbol.for("react.forward_ref"),Ir=Symbol.for("react.suspense"),Br=Symbol.for("react.suspense_list"),br=Symbol.for("react.memo"),Nr=Symbol.for("react.lazy"),u1=Symbol.for("react.offscreen"),Gf;Gf=Symbol.for("react.module.reference");function ni(S){if(typeof S=="object"&&S!==null){var T=S.$$typeof;switch(T){case jo:switch(S=S.type,S){case wr:case Fr:case Rr:case Ir:case Br:return S;default:switch(S=S&&S.$$typeof,S){case l1:case Or:case Dr:case Nr:case br:case Lr:return S;default:return T}}case $o:return T}}}te.ContextConsumer=Or;te.ContextProvider=Lr;te.Element=jo;te.ForwardRef=Dr;te.Fragment=wr;te.Lazy=Nr;te.Memo=br;te.Portal=$o;te.Profiler=Fr;te.StrictMode=Rr;te.Suspense=Ir;te.SuspenseList=Br;te.isAsyncMode=function(){return!1};te.isConcurrentMode=function(){return!1};te.isContextConsumer=function(S){return ni(S)===Or};te.isContextProvider=function(S){return ni(S)===Lr};te.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===jo};te.isForwardRef=function(S){return ni(S)===Dr};te.isFragment=function(S){return ni(S)===wr};te.isLazy=function(S){return ni(S)===Nr};te.isMemo=function(S){return ni(S)===br};te.isPortal=function(S){return ni(S)===$o};te.isProfiler=function(S){return ni(S)===Fr};te.isStrictMode=function(S){return ni(S)===Rr};te.isSuspense=function(S){return ni(S)===Ir};te.isSuspenseList=function(S){return ni(S)===Br};te.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===wr||S===Fr||S===Rr||S===Ir||S===Br||S===u1||typeof S=="object"&&S!==null&&(S.$$typeof===Nr||S.$$typeof===br||S.$$typeof===Lr||S.$$typeof===Or||S.$$typeof===Dr||S.$$typeof===Gf||S.getModuleId!==void 0)};te.typeOf=ni;Nf.exports=te;var zf=Nf.exports;function f1(S){function T(J,X,Y,b,z){for(var W=0,H=0,Z=0,Q=0,k,et,st=0,rt=0,ot,ft=ot=k=0,at=0,vt=0,At=0,Et=0,Pt=Y.length,ct=Pt-1,Ct,pt="",wt="",Bt="",jt="",zt;atk)&&(Et=(pt=pt.replace(" ",":")).length),0b&&(b=(X=X.trim()).charCodeAt(0)),b){case 38:return X.replace(s,"$1"+J.trim());case 58:return J.trim()+X.replace(s,"$1"+J.trim());default:if(0<1*Y&&0H.charCodeAt(8))break;case 115:z=z.replace(H,"-webkit-"+H)+";"+z;break;case 207:case 102:z=z.replace(H,"-webkit-"+(102Y.charCodeAt(0)&&(Y=Y.trim()),j=Y,Y=[j],0k)&&(Et=(pt=pt.replace(" ",":")).length),0b&&(b=(X=X.trim()).charCodeAt(0)),b){case 38:return X.replace(s,"$1"+J.trim());case 58:return J.trim()+X.replace(s,"$1"+J.trim());default:if(0<1*Y&&0H.charCodeAt(8))break;case 115:z=z.replace(H,"-webkit-"+H)+";"+z;break;case 207:case 102:z=z.replace(H,"-webkit-"+(102Y.charCodeAt(0)&&(Y=Y.trim()),j=Y,Y=[j],01?T-1:0),F=1;F0?" Args: "+E.join(", "):""))}var O1=function(){function S(E){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=E}var T=S.prototype;return T.indexOfGroup=function(E){for(var F=0,O=0;O=this.groupSizes.length){for(var O=this.groupSizes,D=O.length,c=D;E>=c;)(c<<=1)<0&&pn(16,""+E);this.groupSizes=new Uint32Array(c),this.groupSizes.set(O),this.length=c;for(var m=D;m=this.length||this.groupSizes[E]===0)return F;for(var O=this.groupSizes[E],D=this.indexOfGroup(E),c=D+O,m=D;m=sn&&(sn=T+1),dr.set(S,T),Tr.set(T,S)},B1="style["+Fs+'][data-styled-version="5.3.6"]',b1=new RegExp("^"+Fs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),N1=function(S,T,E){for(var F,O=E.split(","),D=0,c=O.length;D=0;o--){var v=t[o];if(v&&v.nodeType===1&&v.hasAttribute(Fs))return v}}(E),D=O!==void 0?O.nextSibling:null;F.setAttribute(Fs,"active"),F.setAttribute("data-styled-version","5.3.6");var c=z1();return c&&F.setAttribute("nonce",c),E.insertBefore(F,D),F},U1=function(){function S(E){var F=this.element=Yf(E);F.appendChild(document.createTextNode("")),this.sheet=function(O){if(O.sheet)return O.sheet;for(var D=document.styleSheets,c=0,m=D.length;c=0){var O=document.createTextNode(F),D=this.nodes[E];return this.element.insertBefore(O,D||null),this.length++,!0}return!1},T.deleteRule=function(E){this.element.removeChild(this.nodes[E]),this.length--},T.getRule=function(E){return E0&&(a+=r+",")}),D+=""+o+v+'{content:"'+a+`"}/*!sc*/ -`}}}return D}(this)},S}(),Y1=/(a)(d)/gi,tf=function(S){return String.fromCharCode(S+(S>25?39:97))};function Ro(S){var T,E="";for(T=Math.abs(S);T>52;T=T/52|0)E=tf(T%52)+E;return(tf(T%52)+E).replace(Y1,"$1-$2")}var As=function(S,T){for(var E=T.length;E;)S=33*S^T.charCodeAt(--E);return S},Kf=function(S){return As(5381,S)};function H1(S){for(var T=0;T>>0);if(!E.hasNameForId(O,m)){var t=F(c,"."+m,void 0,O);E.insertRules(O,m,t)}D.push(m),this.staticRulesId=m}else{for(var o=this.rules.length,v=As(this.baseHash,F.hash),a="",r=0;r>>0);if(!E.hasNameForId(O,h)){var s=F(a,"."+h,void 0,O);E.insertRules(O,h,s)}D.push(h)}}return D.join(" ")},S}(),$1=/^\s*\/\/.*$/gm,Z1=[":","[",".","#"];function J1(S){var T,E,F,O,D=S===void 0?Yi:S,c=D.options,m=c===void 0?Yi:c,t=D.plugins,o=t===void 0?yr:t,v=new f1(m),a=[],r=function(i){function h(s){if(s)try{i(s+"}")}catch{}}return function(s,l,f,u,d,p,g,y,x,C){switch(s){case 1:if(x===0&&l.charCodeAt(0)===64)return i(l+";"),"";break;case 2:if(y===0)return l+"/*|*/";break;case 3:switch(y){case 102:case 112:return i(f[0]+l),"";default:return l+(C===0?"/*|*/":"")}case-2:l.split("/*|*/}").forEach(h)}}}(function(i){a.push(i)}),n=function(i,h,s){return h===0&&Z1.indexOf(s[E.length])!==-1||s.match(O)?i:"."+T};function e(i,h,s,l){l===void 0&&(l="&");var f=i.replace($1,""),u=h&&s?s+" "+h+" { "+f+" }":f;return T=l,E=h,F=new RegExp("\\"+E+"\\b","g"),O=new RegExp("(\\"+E+"\\b){2,}"),v(s||!h?"":h,u)}return v.use([].concat(o,[function(i,h,s){i===2&&s.length&&s[0].lastIndexOf(E)>0&&(s[0]=s[0].replace(F,n))},r,function(i){if(i===-2){var h=a;return a=[],h}}])),e.hash=o.length?o.reduce(function(i,h){return h.name||pn(15),As(i,h.name)},5381).toString():"",e}var jf=Mr.createContext();jf.Consumer;var $f=Mr.createContext(),Q1=($f.Consumer,new Hf),Fo=J1();function k1(){return Fe.useContext(jf)||Q1}function q1(){return Fe.useContext($f)||Fo}var _1=function(){function S(T,E){var F=this;this.inject=function(O,D){D===void 0&&(D=Fo);var c=F.name+D.hash;O.hasNameForId(F.id,c)||O.insertRules(F.id,c,D(F.rules,c,"@keyframes"))},this.toString=function(){return pn(12,String(F.name))},this.name=T,this.id="sc-keyframes-"+T,this.rules=E}return S.prototype.getName=function(T){return T===void 0&&(T=Fo),this.name+T.hash},S}(),tT=/([A-Z])/,eT=/([A-Z])/g,iT=/^ms-/,sT=function(S){return"-"+S.toLowerCase()};function ef(S){return tT.test(S)?S.replace(eT,sT).replace(iT,"-ms-"):S}var sf=function(S){return S==null||S===!1||S===""};function Ls(S,T,E,F){if(Array.isArray(S)){for(var O,D=[],c=0,m=S.length;c1?T-1:0),F=1;F?@[\\\]^`{|}~-]+/g,oT=/(^-|-$)/g;function go(S){return S.replace(aT,"-").replace(oT,"")}var hT=function(S){return Ro(Kf(S)>>>0)};function lr(S){return typeof S=="string"&&!0}var Lo=function(S){return typeof S=="function"||typeof S=="object"&&S!==null&&!Array.isArray(S)},lT=function(S){return S!=="__proto__"&&S!=="constructor"&&S!=="prototype"};function uT(S,T,E){var F=S[E];Lo(T)&&Lo(F)?Zf(F,T):S[E]=T}function Zf(S){for(var T=arguments.length,E=new Array(T>1?T-1:0),F=1;F=0||(C[y]=p[y]);return C}(T,["componentId"]),d=f&&f+"-"+(lr(l)?l:go(qu(l)));return Qf(l,Li({},u,{attrs:r,componentId:d}),E)},Object.defineProperty(e,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(l){this._foldedDefaultProps=F?Zf({},S.defaultProps,l):l}}),e.toString=function(){return"."+e.styledComponentId},O&&F1(e,S,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),e}var Sr=function(S){return function T(E,F,O){if(O===void 0&&(O=Yi),!zf.isValidElementType(F))return pn(1,String(F));var D=function(){return E(F,O,nT.apply(void 0,arguments))};return D.withConfig=function(c){return T(E,F,Li({},O,{},c))},D.attrs=function(c){return T(E,F,Li({},O,{attrs:Array.prototype.concat(O.attrs,c).filter(Boolean)}))},D}(Qf,S)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(S){Sr[S]=Sr(S)});var kf={exports:{}};(function(S,T){(function(F,O){S.exports=O()})(o1,()=>(()=>{var E={50792:c=>{var m=Object.prototype.hasOwnProperty,t="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(t=!1));function v(e,i,h){this.fn=e,this.context=i,this.once=h||!1}function a(e,i,h,s,l){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new v(h,s||e,l),u=t?t+i:i;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],f]:e._events[u].push(f):(e._events[u]=f,e._eventsCount++),e}function r(e,i){--e._eventsCount===0?e._events=new o:delete e._events[i]}function n(){this._events=new o,this._eventsCount=0}n.prototype.eventNames=function(){var i=[],h,s;if(this._eventsCount===0)return i;for(s in h=this._events)m.call(h,s)&&i.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(h)):i},n.prototype.listeners=function(i){var h=t?t+i:i,s=this._events[h];if(!s)return[];if(s.fn)return[s.fn];for(var l=0,f=s.length,u=new Array(f);l{/** + */var Pe=typeof Symbol=="function"&&Symbol.for,$o=Pe?Symbol.for("react.element"):60103,Zo=Pe?Symbol.for("react.portal"):60106,Gr=Pe?Symbol.for("react.fragment"):60107,zr=Pe?Symbol.for("react.strict_mode"):60108,Ur=Pe?Symbol.for("react.profiler"):60114,Xr=Pe?Symbol.for("react.provider"):60109,Vr=Pe?Symbol.for("react.context"):60110,Jo=Pe?Symbol.for("react.async_mode"):60111,Wr=Pe?Symbol.for("react.concurrent_mode"):60111,Yr=Pe?Symbol.for("react.forward_ref"):60112,Hr=Pe?Symbol.for("react.suspense"):60113,g1=Pe?Symbol.for("react.suspense_list"):60120,Kr=Pe?Symbol.for("react.memo"):60115,jr=Pe?Symbol.for("react.lazy"):60116,m1=Pe?Symbol.for("react.block"):60121,y1=Pe?Symbol.for("react.fundamental"):60117,x1=Pe?Symbol.for("react.responder"):60118,T1=Pe?Symbol.for("react.scope"):60119;function $e(S){if(typeof S=="object"&&S!==null){var T=S.$$typeof;switch(T){case $o:switch(S=S.type,S){case Jo:case Wr:case Gr:case Ur:case zr:case Hr:return S;default:switch(S=S&&S.$$typeof,S){case Vr:case Yr:case jr:case Kr:case Xr:return S;default:return T}}case Zo:return T}}}function Vf(S){return $e(S)===Wr}ee.AsyncMode=Jo;ee.ConcurrentMode=Wr;ee.ContextConsumer=Vr;ee.ContextProvider=Xr;ee.Element=$o;ee.ForwardRef=Yr;ee.Fragment=Gr;ee.Lazy=jr;ee.Memo=Kr;ee.Portal=Zo;ee.Profiler=Ur;ee.StrictMode=zr;ee.Suspense=Hr;ee.isAsyncMode=function(S){return Vf(S)||$e(S)===Jo};ee.isConcurrentMode=Vf;ee.isContextConsumer=function(S){return $e(S)===Vr};ee.isContextProvider=function(S){return $e(S)===Xr};ee.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===$o};ee.isForwardRef=function(S){return $e(S)===Yr};ee.isFragment=function(S){return $e(S)===Gr};ee.isLazy=function(S){return $e(S)===jr};ee.isMemo=function(S){return $e(S)===Kr};ee.isPortal=function(S){return $e(S)===Zo};ee.isProfiler=function(S){return $e(S)===Ur};ee.isStrictMode=function(S){return $e(S)===zr};ee.isSuspense=function(S){return $e(S)===Hr};ee.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===Gr||S===Wr||S===Ur||S===zr||S===Hr||S===g1||typeof S=="object"&&S!==null&&(S.$$typeof===jr||S.$$typeof===Kr||S.$$typeof===Xr||S.$$typeof===Vr||S.$$typeof===Yr||S.$$typeof===y1||S.$$typeof===x1||S.$$typeof===T1||S.$$typeof===m1)};ee.typeOf=$e;Xf.exports=ee;var S1=Xf.exports,Qo=S1,C1={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},E1={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},P1={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ko={};ko[Qo.ForwardRef]=P1;ko[Qo.Memo]=Wf;function Zu(S){return Qo.isMemo(S)?Wf:ko[S.$$typeof]||C1}var A1=Object.defineProperty,M1=Object.getOwnPropertyNames,Ju=Object.getOwnPropertySymbols,w1=Object.getOwnPropertyDescriptor,R1=Object.getPrototypeOf,Qu=Object.prototype;function Yf(S,T,E){if(typeof T!="string"){if(Qu){var R=R1(T);R&&R!==Qu&&Yf(S,R,E)}var O=M1(T);Ju&&(O=O.concat(Ju(T)));for(var D=Zu(S),c=Zu(T),m=0;m1?T-1:0),R=1;R0?" Args: "+E.join(", "):""))}var D1=function(){function S(E){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=E}var T=S.prototype;return T.indexOfGroup=function(E){for(var R=0,O=0;O=this.groupSizes.length){for(var O=this.groupSizes,D=O.length,c=D;E>=c;)(c<<=1)<0&&gn(16,""+E);this.groupSizes=new Uint32Array(c),this.groupSizes.set(O),this.length=c;for(var m=D;m=this.length||this.groupSizes[E]===0)return R;for(var O=this.groupSizes[E],D=this.indexOfGroup(E),c=D+O,m=D;m=an&&(an=T+1),cr.set(S,T),Sr.set(T,S)},b1="style["+Bs+'][data-styled-version="5.3.6"]',N1=new RegExp("^"+Bs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),G1=function(S,T,E){for(var R,O=E.split(","),D=0,c=O.length;D=0;o--){var v=t[o];if(v&&v.nodeType===1&&v.hasAttribute(Bs))return v}}(E),D=O!==void 0?O.nextSibling:null;R.setAttribute(Bs,"active"),R.setAttribute("data-styled-version","5.3.6");var c=U1();return c&&R.setAttribute("nonce",c),E.insertBefore(R,D),R},X1=function(){function S(E){var R=this.element=Hf(E);R.appendChild(document.createTextNode("")),this.sheet=function(O){if(O.sheet)return O.sheet;for(var D=document.styleSheets,c=0,m=D.length;c=0){var O=document.createTextNode(R),D=this.nodes[E];return this.element.insertBefore(O,D||null),this.length++,!0}return!1},T.deleteRule=function(E){this.element.removeChild(this.nodes[E]),this.length--},T.getRule=function(E){return E0&&(a+=r+",")}),D+=""+o+v+'{content:"'+a+`"}/*!sc*/ +`}}}return D}(this)},S}(),H1=/(a)(d)/gi,tf=function(S){return String.fromCharCode(S+(S>25?39:97))};function wo(S){var T,E="";for(T=Math.abs(S);T>52;T=T/52|0)E=tf(T%52)+E;return(tf(T%52)+E).replace(H1,"$1-$2")}var Fs=function(S,T){for(var E=T.length;E;)S=33*S^T.charCodeAt(--E);return S},jf=function(S){return Fs(5381,S)};function K1(S){for(var T=0;T>>0);if(!E.hasNameForId(O,m)){var t=R(c,"."+m,void 0,O);E.insertRules(O,m,t)}D.push(m),this.staticRulesId=m}else{for(var o=this.rules.length,v=Fs(this.baseHash,R.hash),a="",r=0;r>>0);if(!E.hasNameForId(O,h)){var s=R(a,"."+h,void 0,O);E.insertRules(O,h,s)}D.push(h)}}return D.join(" ")},S}(),Z1=/^\s*\/\/.*$/gm,J1=[":","[",".","#"];function Q1(S){var T,E,R,O,D=S===void 0?$i:S,c=D.options,m=c===void 0?$i:c,t=D.plugins,o=t===void 0?Tr:t,v=new d1(m),a=[],r=function(i){function h(s){if(s)try{i(s+"}")}catch{}}return function(s,l,f,u,d,p,g,x,y,C){switch(s){case 1:if(y===0&&l.charCodeAt(0)===64)return i(l+";"),"";break;case 2:if(x===0)return l+"/*|*/";break;case 3:switch(x){case 102:case 112:return i(f[0]+l),"";default:return l+(C===0?"/*|*/":"")}case-2:l.split("/*|*/}").forEach(h)}}}(function(i){a.push(i)}),n=function(i,h,s){return h===0&&J1.indexOf(s[E.length])!==-1||s.match(O)?i:"."+T};function e(i,h,s,l){l===void 0&&(l="&");var f=i.replace(Z1,""),u=h&&s?s+" "+h+" { "+f+" }":f;return T=l,E=h,R=new RegExp("\\"+E+"\\b","g"),O=new RegExp("(\\"+E+"\\b){2,}"),v(s||!h?"":h,u)}return v.use([].concat(o,[function(i,h,s){i===2&&s.length&&s[0].lastIndexOf(E)>0&&(s[0]=s[0].replace(R,n))},r,function(i){if(i===-2){var h=a;return a=[],h}}])),e.hash=o.length?o.reduce(function(i,h){return h.name||gn(15),Fs(i,h.name)},5381).toString():"",e}var $f=Mr.createContext();$f.Consumer;var Zf=Mr.createContext(),k1=(Zf.Consumer,new Kf),Ro=Q1();function q1(){return Oe.useContext($f)||k1}function _1(){return Oe.useContext(Zf)||Ro}var tT=function(){function S(T,E){var R=this;this.inject=function(O,D){D===void 0&&(D=Ro);var c=R.name+D.hash;O.hasNameForId(R.id,c)||O.insertRules(R.id,c,D(R.rules,c,"@keyframes"))},this.toString=function(){return gn(12,String(R.name))},this.name=T,this.id="sc-keyframes-"+T,this.rules=E}return S.prototype.getName=function(T){return T===void 0&&(T=Ro),this.name+T.hash},S}(),eT=/([A-Z])/,iT=/([A-Z])/g,sT=/^ms-/,nT=function(S){return"-"+S.toLowerCase()};function ef(S){return eT.test(S)?S.replace(iT,nT).replace(sT,"-ms-"):S}var sf=function(S){return S==null||S===!1||S===""};function bs(S,T,E,R){if(Array.isArray(S)){for(var O,D=[],c=0,m=S.length;c1?T-1:0),R=1;R?@[\\\]^`{|}~-]+/g,hT=/(^-|-$)/g;function po(S){return S.replace(oT,"-").replace(hT,"")}var lT=function(S){return wo(jf(S)>>>0)};function ur(S){return typeof S=="string"&&!0}var Fo=function(S){return typeof S=="function"||typeof S=="object"&&S!==null&&!Array.isArray(S)},uT=function(S){return S!=="__proto__"&&S!=="constructor"&&S!=="prototype"};function fT(S,T,E){var R=S[E];Fo(T)&&Fo(R)?Jf(R,T):S[E]=T}function Jf(S){for(var T=arguments.length,E=new Array(T>1?T-1:0),R=1;R=0||(C[x]=p[x]);return C}(T,["componentId"]),d=f&&f+"-"+(ur(l)?l:po(qu(l)));return kf(l,Ii({},u,{attrs:r,componentId:d}),E)},Object.defineProperty(e,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(l){this._foldedDefaultProps=R?Jf({},S.defaultProps,l):l}}),e.toString=function(){return"."+e.styledComponentId},O&&L1(e,S,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),e}var Cr=function(S){return function T(E,R,O){if(O===void 0&&(O=$i),!Uf.isValidElementType(R))return gn(1,String(R));var D=function(){return E(R,O,rT.apply(void 0,arguments))};return D.withConfig=function(c){return T(E,R,Ii({},O,{},c))},D.attrs=function(c){return T(E,R,Ii({},O,{attrs:Array.prototype.concat(O.attrs,c).filter(Boolean)}))},D}(kf,S)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(S){Cr[S]=Cr(S)});var qf={exports:{}};(function(S,T){(function(R,O){S.exports=O()})(h1,()=>(()=>{var E={50792:c=>{var m=Object.prototype.hasOwnProperty,t="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(t=!1));function v(e,i,h){this.fn=e,this.context=i,this.once=h||!1}function a(e,i,h,s,l){if(typeof h!="function")throw new TypeError("The listener must be a function");var f=new v(h,s||e,l),u=t?t+i:i;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],f]:e._events[u].push(f):(e._events[u]=f,e._eventsCount++),e}function r(e,i){--e._eventsCount===0?e._events=new o:delete e._events[i]}function n(){this._events=new o,this._eventsCount=0}n.prototype.eventNames=function(){var i=[],h,s;if(this._eventsCount===0)return i;for(s in h=this._events)m.call(h,s)&&i.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(h)):i},n.prototype.listeners=function(i){var h=t?t+i:i,s=this._events[h];if(!s)return[];if(s.fn)return[s.fn];for(var l=0,f=s.length,u=new Array(f);l{/** * @author samme * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -40,7 +40,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(11879),v=t(60461),a=t(95540),r=t(29747),n=t(41481),e=new n({sys:{queueDepthSort:r,events:{once:r}}},0,0,1,1).setOrigin(0,0),i=function(h,s){s===void 0&&(s={});var l=s.hasOwnProperty("width"),f=s.hasOwnProperty("height"),u=a(s,"width",-1),d=a(s,"height",-1),p=a(s,"cellWidth",1),g=a(s,"cellHeight",p),y=a(s,"position",v.TOP_LEFT),x=a(s,"x",0),C=a(s,"y",0),P=0,M=0,w=u*p,I=d*g;e.setPosition(x,C),e.setSize(p,g);for(var L=0;L{/** + */var o=t(11879),v=t(60461),a=t(95540),r=t(29747),n=t(41481),e=new n({sys:{queueDepthSort:r,events:{once:r}}},0,0,1,1).setOrigin(0,0),i=function(h,s){s===void 0&&(s={});var l=s.hasOwnProperty("width"),f=s.hasOwnProperty("height"),u=a(s,"width",-1),d=a(s,"height",-1),p=a(s,"cellWidth",1),g=a(s,"cellHeight",p),x=a(s,"position",v.TOP_LEFT),y=a(s,"x",0),C=a(s,"y",0),P=0,M=0,w=u*p,I=d*g;e.setPosition(y,C),e.setSize(p,g);for(var L=0;L{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -204,7 +204,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(26099),v=function(a,r,n,e,i){e===void 0&&(e=0),i===void 0&&(i=new o);var h,s,l=a.length;if(l===1)h=a[0].x,s=a[0].y,a[0].x=r,a[0].y=n;else{var f=1,u=0;e===0&&(u=l-1,f=l-2),h=a[u].x,s=a[u].y,a[u].x=r,a[u].y=n;for(var d=0;d=l||f===-1)){var p=a[f],g=p.x,y=p.y;p.x=h,p.y=s,h=g,s=y,e===0?f--:f++}}return i.x=h,i.y=s,i};c.exports=v},8628:(c,m,t)=>{/** + */var o=t(26099),v=function(a,r,n,e,i){e===void 0&&(e=0),i===void 0&&(i=new o);var h,s,l=a.length;if(l===1)h=a[0].x,s=a[0].y,a[0].x=r,a[0].y=n;else{var f=1,u=0;e===0&&(u=l-1,f=l-2),h=a[u].x,s=a[u].y,a[u].x=r,a[u].y=n;for(var d=0;d=l||f===-1)){var p=a[f],g=p.x,x=p.y;p.x=h,p.y=s,h=g,s=x,e===0?f--:f++}}return i.x=h,i.y=s,i};c.exports=v},8628:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -237,7 +237,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(45319),v=t(83419),a=t(74943),r=t(81957),n=t(41138),e=t(35154),i=t(90126),h=new v({initialize:function(l,f,u){this.manager=l,this.key=f,this.type="frame",this.frames=this.getFrames(l.textureManager,e(u,"frames",[]),e(u,"defaultTextureKey",null),e(u,"sortFrames",!0)),this.frameRate=e(u,"frameRate",null),this.duration=e(u,"duration",null),this.msPerFrame,this.skipMissedFrames=e(u,"skipMissedFrames",!0),this.delay=e(u,"delay",0),this.repeat=e(u,"repeat",0),this.repeatDelay=e(u,"repeatDelay",0),this.yoyo=e(u,"yoyo",!1),this.showBeforeDelay=e(u,"showBeforeDelay",!1),this.showOnStart=e(u,"showOnStart",!1),this.hideOnComplete=e(u,"hideOnComplete",!1),this.randomFrame=e(u,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(s,l,f,u){f===null&&u===null?(s.frameRate=24,s.duration=24/l*1e3):f&&u===null?(s.duration=f,s.frameRate=l/(f/1e3)):(s.frameRate=u,s.duration=l/u*1e3),s.msPerFrame=1e3/s.frameRate},addFrame:function(s){return this.addFrameAt(this.frames.length,s)},addFrameAt:function(s,l){var f=this.getFrames(this.manager.textureManager,l);if(f.length>0){if(s===0)this.frames=f.concat(this.frames);else if(s===this.frames.length)this.frames=this.frames.concat(f);else{var u=this.frames.slice(0,s),d=this.frames.slice(s);this.frames=u.concat(f,d)}this.updateFrameSequence()}return this},checkFrame:function(s){return s>=0&&s0){g.isLast=!0,g.nextFrame=d[0],d[0].prevFrame=g;var N=1/(d.length-1);for(x=0;x0?s.inReverse&&s.forward?s.forward=!1:this.repeatAnimation(s):s.complete():this.updateAndGetNextTick(s,l.nextFrame)},handleYoyoFrame:function(s,l){if(l||(l=!1),s.inReverse===!l&&s.repeatCounter>0){(s.repeatDelay===0||s.pendingRepeat)&&(s.forward=l),this.repeatAnimation(s);return}if(s.inReverse!==l&&s.repeatCounter===0){s.complete();return}s.forward=l;var f=l?s.currentFrame.nextFrame:s.currentFrame.prevFrame;this.updateAndGetNextTick(s,f)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(s){var l=s.currentFrame;l.isFirst?s.yoyo?this.handleYoyoFrame(s,!0):s.repeatCounter>0?s.inReverse&&!s.forward?this.repeatAnimation(s):(s.forward=!0,this.repeatAnimation(s)):s.complete():this.updateAndGetNextTick(s,l.prevFrame)},updateAndGetNextTick:function(s,l){s.setCurrentFrame(l),this.getNextTick(s)},removeFrame:function(s){var l=this.frames.indexOf(s);return l!==-1&&this.removeFrameAt(l),this},removeFrameAt:function(s){return this.frames.splice(s,1),this.updateFrameSequence(),this},repeatAnimation:function(s){if(s._pendingStop===2){if(s._pendingStopValue===0)return s.stop();s._pendingStopValue--}s.repeatDelay>0&&!s.pendingRepeat?(s.pendingRepeat=!0,s.accumulator-=s.nextTick,s.nextTick+=s.repeatDelay):(s.repeatCounter--,s.forward?s.setCurrentFrame(s.currentFrame.nextFrame):s.setCurrentFrame(s.currentFrame.prevFrame),s.isPlaying&&(this.getNextTick(s),s.handleRepeat()))},toJSON:function(){var s={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(l){s.frames.push(l.toJSON())}),s},updateFrameSequence:function(){for(var s=this.frames.length,l=1/(s-1),f,u=0;u1?(f.isLast=!0,f.prevFrame=this.frames[s-2],f.nextFrame=this.frames[0]):s>1&&(f.prevFrame=this.frames[u-1],f.nextFrame=this.frames[u+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(a.PAUSE_ALL,this.pause,this),this.manager.off(a.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var s=0;s{/** + */var o=t(45319),v=t(83419),a=t(74943),r=t(81957),n=t(41138),e=t(35154),i=t(90126),h=new v({initialize:function(l,f,u){this.manager=l,this.key=f,this.type="frame",this.frames=this.getFrames(l.textureManager,e(u,"frames",[]),e(u,"defaultTextureKey",null),e(u,"sortFrames",!0)),this.frameRate=e(u,"frameRate",null),this.duration=e(u,"duration",null),this.msPerFrame,this.skipMissedFrames=e(u,"skipMissedFrames",!0),this.delay=e(u,"delay",0),this.repeat=e(u,"repeat",0),this.repeatDelay=e(u,"repeatDelay",0),this.yoyo=e(u,"yoyo",!1),this.showBeforeDelay=e(u,"showBeforeDelay",!1),this.showOnStart=e(u,"showOnStart",!1),this.hideOnComplete=e(u,"hideOnComplete",!1),this.randomFrame=e(u,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(s,l,f,u){f===null&&u===null?(s.frameRate=24,s.duration=24/l*1e3):f&&u===null?(s.duration=f,s.frameRate=l/(f/1e3)):(s.frameRate=u,s.duration=l/u*1e3),s.msPerFrame=1e3/s.frameRate},addFrame:function(s){return this.addFrameAt(this.frames.length,s)},addFrameAt:function(s,l){var f=this.getFrames(this.manager.textureManager,l);if(f.length>0){if(s===0)this.frames=f.concat(this.frames);else if(s===this.frames.length)this.frames=this.frames.concat(f);else{var u=this.frames.slice(0,s),d=this.frames.slice(s);this.frames=u.concat(f,d)}this.updateFrameSequence()}return this},checkFrame:function(s){return s>=0&&s0){g.isLast=!0,g.nextFrame=d[0],d[0].prevFrame=g;var N=1/(d.length-1);for(y=0;y0?s.inReverse&&s.forward?s.forward=!1:this.repeatAnimation(s):s.complete():this.updateAndGetNextTick(s,l.nextFrame)},handleYoyoFrame:function(s,l){if(l||(l=!1),s.inReverse===!l&&s.repeatCounter>0){(s.repeatDelay===0||s.pendingRepeat)&&(s.forward=l),this.repeatAnimation(s);return}if(s.inReverse!==l&&s.repeatCounter===0){s.complete();return}s.forward=l;var f=l?s.currentFrame.nextFrame:s.currentFrame.prevFrame;this.updateAndGetNextTick(s,f)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(s){var l=s.currentFrame;l.isFirst?s.yoyo?this.handleYoyoFrame(s,!0):s.repeatCounter>0?s.inReverse&&!s.forward?this.repeatAnimation(s):(s.forward=!0,this.repeatAnimation(s)):s.complete():this.updateAndGetNextTick(s,l.prevFrame)},updateAndGetNextTick:function(s,l){s.setCurrentFrame(l),this.getNextTick(s)},removeFrame:function(s){var l=this.frames.indexOf(s);return l!==-1&&this.removeFrameAt(l),this},removeFrameAt:function(s){return this.frames.splice(s,1),this.updateFrameSequence(),this},repeatAnimation:function(s){if(s._pendingStop===2){if(s._pendingStopValue===0)return s.stop();s._pendingStopValue--}s.repeatDelay>0&&!s.pendingRepeat?(s.pendingRepeat=!0,s.accumulator-=s.nextTick,s.nextTick+=s.repeatDelay):(s.repeatCounter--,s.forward?s.setCurrentFrame(s.currentFrame.nextFrame):s.setCurrentFrame(s.currentFrame.prevFrame),s.isPlaying&&(this.getNextTick(s),s.handleRepeat()))},toJSON:function(){var s={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(l){s.frames.push(l.toJSON())}),s},updateFrameSequence:function(){for(var s=this.frames.length,l=1/(s-1),f,u=0;u1?(f.isLast=!0,f.prevFrame=this.frames[s-2],f.nextFrame=this.frames[0]):s>1&&(f.prevFrame=this.frames[u-1],f.nextFrame=this.frames[u+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(a.PAUSE_ALL,this.pause,this),this.manager.off(a.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var s=0;s{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -245,11 +245,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(42099),v=t(83419),a=t(90330),r=t(50792),n=t(74943),e=t(8443),i=t(95540),h=t(35154),s=t(36383),l=t(20283),f=t(41836),u=new v({Extends:r,initialize:function(p){r.call(this),this.game=p,this.textureManager=null,this.globalTimeScale=1,this.anims=new a,this.mixes=new a,this.paused=!1,this.name="AnimationManager",p.events.once(e.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(e.DESTROY,this.destroy,this)},addMix:function(d,p,g){var y=this.anims,x=this.mixes,C=typeof d=="string"?d:d.key,P=typeof p=="string"?p:p.key;if(y.has(C)&&y.has(P)){var M=x.get(C);M||(M={}),M[P]=g,x.set(C,M)}return this},removeMix:function(d,p){var g=this.mixes,y=typeof d=="string"?d:d.key,x=g.get(y);if(x)if(p){var C=typeof p=="string"?p:p.key;x.hasOwnProperty(C)&&delete x[C]}else p||g.delete(y);return this},getMix:function(d,p){var g=this.mixes,y=typeof d=="string"?d:d.key,x=typeof p=="string"?p:p.key,C=g.get(y);return C&&C.hasOwnProperty(x)?C[x]:0},add:function(d,p){return this.anims.has(d)?(console.warn("Animation key exists: "+d),this):(p.key=d,this.anims.set(d,p),this.emit(n.ADD_ANIMATION,d,p),this)},exists:function(d){return this.anims.has(d)},createFromAseprite:function(d,p,g){var y=[],x=this.game.cache.json.get(d);if(!x)return console.warn("No Aseprite data found for: "+d),y;var C=this,P=h(x,"meta",null),M=h(x,"frames",null);if(P&&M){var w=h(P,"frameTags",[]);w.forEach(function(I){var L=[],B=i(I,"name",null),N=i(I,"from",0),G=i(I,"to",0),V=i(I,"direction","forward");if(B&&(!p||p&&p.indexOf(B)>-1)){for(var K=0,j=N;j<=G;j++){var J=j.toString(),X=M[J];if(X){var Y=i(X,"duration",s.MAX_SAFE_INTEGER);L.push({key:d,frame:J,duration:Y}),K+=Y}}V==="reverse"&&(L=L.reverse());var b={key:B,frames:L,duration:K,yoyo:V==="pingpong"},z;g?g.anims&&(z=g.anims.create(b)):z=C.create(b),z&&y.push(z)}})}return y},create:function(d){var p=d.key,g=!1;return p&&(g=this.get(p),g?console.warn("AnimationManager key already exists: "+p):(g=new o(this,p,d),this.anims.set(p,g),this.emit(n.ADD_ANIMATION,p,g))),g},fromJSON:function(d,p){p===void 0&&(p=!1),p&&this.anims.clear(),typeof d=="string"&&(d=JSON.parse(d));var g=[];if(d.hasOwnProperty("anims")&&Array.isArray(d.anims)){for(var y=0;y{/** + */var o=t(42099),v=t(83419),a=t(90330),r=t(50792),n=t(74943),e=t(8443),i=t(95540),h=t(35154),s=t(36383),l=t(20283),f=t(41836),u=new v({Extends:r,initialize:function(p){r.call(this),this.game=p,this.textureManager=null,this.globalTimeScale=1,this.anims=new a,this.mixes=new a,this.paused=!1,this.name="AnimationManager",p.events.once(e.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(e.DESTROY,this.destroy,this)},addMix:function(d,p,g){var x=this.anims,y=this.mixes,C=typeof d=="string"?d:d.key,P=typeof p=="string"?p:p.key;if(x.has(C)&&x.has(P)){var M=y.get(C);M||(M={}),M[P]=g,y.set(C,M)}return this},removeMix:function(d,p){var g=this.mixes,x=typeof d=="string"?d:d.key,y=g.get(x);if(y)if(p){var C=typeof p=="string"?p:p.key;y.hasOwnProperty(C)&&delete y[C]}else p||g.delete(x);return this},getMix:function(d,p){var g=this.mixes,x=typeof d=="string"?d:d.key,y=typeof p=="string"?p:p.key,C=g.get(x);return C&&C.hasOwnProperty(y)?C[y]:0},add:function(d,p){return this.anims.has(d)?(console.warn("Animation key exists: "+d),this):(p.key=d,this.anims.set(d,p),this.emit(n.ADD_ANIMATION,d,p),this)},exists:function(d){return this.anims.has(d)},createFromAseprite:function(d,p,g){var x=[],y=this.game.cache.json.get(d);if(!y)return console.warn("No Aseprite data found for: "+d),x;var C=this,P=h(y,"meta",null),M=h(y,"frames",null);if(P&&M){var w=h(P,"frameTags",[]);w.forEach(function(I){var L=[],B=i(I,"name",null),N=i(I,"from",0),G=i(I,"to",0),V=i(I,"direction","forward");if(B&&(!p||p&&p.indexOf(B)>-1)){for(var K=0,j=N;j<=G;j++){var J=j.toString(),X=M[J];if(X){var Y=i(X,"duration",s.MAX_SAFE_INTEGER);L.push({key:d,frame:J,duration:Y}),K+=Y}}V==="reverse"&&(L=L.reverse());var b={key:B,frames:L,duration:K,yoyo:V==="pingpong"},z;g?g.anims&&(z=g.anims.create(b)):z=C.create(b),z&&x.push(z)}})}return x},create:function(d){var p=d.key,g=!1;return p&&(g=this.get(p),g?console.warn("AnimationManager key already exists: "+p):(g=new o(this,p,d),this.anims.set(p,g),this.emit(n.ADD_ANIMATION,p,g))),g},fromJSON:function(d,p){p===void 0&&(p=!1),p&&this.anims.clear(),typeof d=="string"&&(d=JSON.parse(d));var g=[];if(d.hasOwnProperty("anims")&&Array.isArray(d.anims)){for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(42099),v=t(30976),a=t(83419),r=t(90330),n=t(74943),e=t(95540),i=new a({initialize:function(s){this.parent=s,this.animationManager=s.scene.sys.anims,this.animationManager.on(n.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(h){var s=this.parent;if(h===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,s;Array.isArray(h)||(h=[h]);for(var l=0;lu&&(g=0),this.randomFrame&&(g=v(0,u-1));var y=f.frames[g];g===0&&!this.forward&&(y=f.getLastFrame()),this.currentFrame=y}return this.parent},pause:function(h){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),h!==void 0&&this.setCurrentFrame(h),this.parent},resume:function(h){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),h!==void 0&&this.setCurrentFrame(h),this.parent},playAfterDelay:function(h,s){if(!this.isPlaying)this.delayCounter=s,this.play(h,!0);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.nextAnim=h,this._pendingStop=1,this._pendingStopValue=s}return this.parent},playAfterRepeat:function(h,s){if(s===void 0&&(s=1),!this.isPlaying)this.play(h);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.repeatCounter!==-1&&s>this.repeatCounter&&(s=this.repeatCounter),this.nextAnim=h,this._pendingStop=2,this._pendingStopValue=s}return this.parent},play:function(h,s){s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent,u=typeof h=="string"?h:h.key;if(s&&this.isPlaying&&l.key===u)return f;if(l&&this.isPlaying){var d=this.animationManager.getMix(l.key,h);if(d>0)return this.playAfterDelay(h,d)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h)},playReverse:function(h,s){s===void 0&&(s=!1);var l=typeof h=="string"?h:h.key;return s&&this.isPlaying&&this.currentAnim.key===l?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h))},startAnimation:function(h){this.load(h);var s=this.currentAnim,l=this.parent;return s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,s.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,this.delayCounter===0?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame)),l},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(n.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(n.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(n.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(n.ANIMATION_COMPLETE,n.ANIMATION_COMPLETE_KEY)},emitEvents:function(h,s){var l=this.currentAnim;if(l){var f=this.currentFrame,u=this.parent,d=f.textureFrame;u.emit(h,l,f,u,d),s&&u.emit(s+l.key,l,f,u,d)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var h=this.currentFrame;if(!h)return 0;var s=h.progress;return this.inReverse&&(s*=-1),s},setProgress:function(h){return this.forward||(h=1-h),this.setCurrentFrame(this.currentAnim.getFrameByProgress(h)),this.parent},setRepeat:function(h){return this.repeatCounter=h===-1?Number.MAX_VALUE:h,this.parent},globalRemove:function(h,s){s===void 0&&(s=this.currentAnim),this.isPlaying&&s.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(h,s){h===void 0&&(h=!1),s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent;return l?(s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),l.getFirstTick(this),this.emitEvents(n.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!h,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(l.frames[0]),this.parent):f},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(h)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(h)}return this.parent},stopAfterDelay:function(h){return this._pendingStop=1,this._pendingStopValue=h,this.parent},stopAfterRepeat:function(h){return h===void 0&&(h=1),this.repeatCounter!==-1&&h>this.repeatCounter&&(h=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=h,this.parent},stopOnFrame:function(h){return this._pendingStop=3,this._pendingStopValue=h,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(h,s){var l=this.currentAnim;if(!(!this.isPlaying||!l||l.paused)){if(this.accumulator+=s*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=s,this._pendingStopValue<=0))return this.stop();if(!this.hasStarted)this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart());else if(this.accumulator>=this.nextTick&&(this.forward?l.nextFrame(this):l.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var f=0;do this.forward?l.nextFrame(this):l.previousFrame(this),f++;while(this.isPlaying&&this.accumulator>this.nextTick&&f<60)}}},setCurrentFrame:function(h){var s=this.parent;return this.currentFrame=h,s.texture=h.frame.texture,s.frame=h.frame,s.isCropped&&s.frame.updateCropUVs(s._crop,s.flipX,s.flipY),h.setAlpha&&(s.alpha=h.alpha),s.setSizeToFrame(),s._originComponent&&(h.frame.customPivot?s.setOrigin(h.frame.pivotX,h.frame.pivotY):s.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(n.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===h&&this.stop()),s},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(h){return this.anims?this.anims.get(h):null},exists:function(h){return this.anims?this.anims.has(h):!1},create:function(h){var s=h.key,l=!1;return s&&(l=this.get(s),l?console.warn("Animation key already exists: "+s):(l=new o(this,s,h),this.anims||(this.anims=new r),this.anims.set(s,l))),l},createFromAseprite:function(h,s){return this.animationManager.createFromAseprite(h,s,this.parent)},generateFrameNames:function(h,s){return this.animationManager.generateFrameNames(h,s)},generateFrameNumbers:function(h,s){return this.animationManager.generateFrameNumbers(h,s)},remove:function(h){var s=this.get(h);return s&&(this.currentAnim===s&&this.stop(),this.anims.delete(h)),s},destroy:function(){this.animationManager.off(n.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}}});c.exports=i},57090:c=>{/** + */var o=t(42099),v=t(30976),a=t(83419),r=t(90330),n=t(74943),e=t(95540),i=new a({initialize:function(s){this.parent=s,this.animationManager=s.scene.sys.anims,this.animationManager.on(n.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(h){var s=this.parent;if(h===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,s;Array.isArray(h)||(h=[h]);for(var l=0;lu&&(g=0),this.randomFrame&&(g=v(0,u-1));var x=f.frames[g];g===0&&!this.forward&&(x=f.getLastFrame()),this.currentFrame=x}return this.parent},pause:function(h){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),h!==void 0&&this.setCurrentFrame(h),this.parent},resume:function(h){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),h!==void 0&&this.setCurrentFrame(h),this.parent},playAfterDelay:function(h,s){if(!this.isPlaying)this.delayCounter=s,this.play(h,!0);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.nextAnim=h,this._pendingStop=1,this._pendingStopValue=s}return this.parent},playAfterRepeat:function(h,s){if(s===void 0&&(s=1),!this.isPlaying)this.play(h);else{var l=this.nextAnim,f=this.nextAnimsQueue;l&&f.unshift(l),this.repeatCounter!==-1&&s>this.repeatCounter&&(s=this.repeatCounter),this.nextAnim=h,this._pendingStop=2,this._pendingStopValue=s}return this.parent},play:function(h,s){s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent,u=typeof h=="string"?h:h.key;if(s&&this.isPlaying&&l.key===u)return f;if(l&&this.isPlaying){var d=this.animationManager.getMix(l.key,h);if(d>0)return this.playAfterDelay(h,d)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h)},playReverse:function(h,s){s===void 0&&(s=!1);var l=typeof h=="string"?h:h.key;return s&&this.isPlaying&&this.currentAnim.key===l?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(h))},startAnimation:function(h){this.load(h);var s=this.currentAnim,l=this.parent;return s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,s.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,this.delayCounter===0?this.handleStart():this.showBeforeDelay&&this.setCurrentFrame(this.currentFrame)),l},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(n.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(n.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(n.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(n.ANIMATION_COMPLETE,n.ANIMATION_COMPLETE_KEY)},emitEvents:function(h,s){var l=this.currentAnim;if(l){var f=this.currentFrame,u=this.parent,d=f.textureFrame;u.emit(h,l,f,u,d),s&&u.emit(s+l.key,l,f,u,d)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var h=this.currentFrame;if(!h)return 0;var s=h.progress;return this.inReverse&&(s*=-1),s},setProgress:function(h){return this.forward||(h=1-h),this.setCurrentFrame(this.currentAnim.getFrameByProgress(h)),this.parent},setRepeat:function(h){return this.repeatCounter=h===-1?Number.MAX_VALUE:h,this.parent},globalRemove:function(h,s){s===void 0&&(s=this.currentAnim),this.isPlaying&&s.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(h,s){h===void 0&&(h=!1),s===void 0&&(s=!1);var l=this.currentAnim,f=this.parent;return l?(s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),l.getFirstTick(this),this.emitEvents(n.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!h,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(l.frames[0]),this.parent):f},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(h)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var h=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(h)}return this.parent},stopAfterDelay:function(h){return this._pendingStop=1,this._pendingStopValue=h,this.parent},stopAfterRepeat:function(h){return h===void 0&&(h=1),this.repeatCounter!==-1&&h>this.repeatCounter&&(h=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=h,this.parent},stopOnFrame:function(h){return this._pendingStop=3,this._pendingStopValue=h,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(h,s){var l=this.currentAnim;if(!(!this.isPlaying||!l||l.paused)){if(this.accumulator+=s*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=s,this._pendingStopValue<=0))return this.stop();if(!this.hasStarted)this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart());else if(this.accumulator>=this.nextTick&&(this.forward?l.nextFrame(this):l.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var f=0;do this.forward?l.nextFrame(this):l.previousFrame(this),f++;while(this.isPlaying&&this.accumulator>this.nextTick&&f<60)}}},setCurrentFrame:function(h){var s=this.parent;return this.currentFrame=h,s.texture=h.frame.texture,s.frame=h.frame,s.isCropped&&s.frame.updateCropUVs(s._crop,s.flipX,s.flipY),h.setAlpha&&(s.alpha=h.alpha),s.setSizeToFrame(),s._originComponent&&(h.frame.customPivot?s.setOrigin(h.frame.pivotX,h.frame.pivotY):s.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(n.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===h&&this.stop()),s},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(h){return this.anims?this.anims.get(h):null},exists:function(h){return this.anims?this.anims.has(h):!1},create:function(h){var s=h.key,l=!1;return s&&(l=this.get(s),l?console.warn("Animation key already exists: "+s):(l=new o(this,s,h),this.anims||(this.anims=new r),this.anims.set(s,l))),l},createFromAseprite:function(h,s){return this.animationManager.createFromAseprite(h,s,this.parent)},generateFrameNames:function(h,s){return this.animationManager.generateFrameNames(h,s)},generateFrameNumbers:function(h,s){return this.animationManager.generateFrameNumbers(h,s)},remove:function(h){var s=this.get(h);return s&&(this.currentAnim===s&&this.stop(),this.anims.delete(h)),s},destroy:function(){this.animationManager.off(n.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}}});c.exports=i},57090:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -329,15 +329,15 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(39506),r=t(50792),n=t(19715),e=t(87841),i=t(61340),h=t(80333),s=t(26099),l=new o({Extends:r,Mixins:[v.AlphaSingle,v.Visible],initialize:function(u,d,p,g){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),r.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new e,this.dirty=!0,this._x=u,this._y=d,this._width=p,this._height=g,this._bounds=new e,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new i,this.transparent=!0,this.backgroundColor=h("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new s(p/2,g/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(f){this.renderList.push(f)},setOrigin:function(f,u){return f===void 0&&(f=.5),u===void 0&&(u=f),this.originX=f,this.originY=u,this},getScroll:function(f,u,d){d===void 0&&(d=new s);var p=this.width*.5,g=this.height*.5;return d.x=f-p,d.y=u-g,this.useBounds&&(d.x=this.clampX(d.x),d.y=this.clampY(d.y)),d},centerOnX:function(f){var u=this.width*.5;return this.midPoint.x=f,this.scrollX=f-u,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(f){var u=this.height*.5;return this.midPoint.y=f,this.scrollY=f-u,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(f,u){return this.centerOnX(f),this.centerOnY(u),this},centerToBounds:function(){if(this.useBounds){var f=this._bounds,u=this.width*.5,d=this.height*.5;this.midPoint.set(f.centerX,f.centerY),this.scrollX=f.centerX-u,this.scrollY=f.centerY-d}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(f){if(this.disableCull)return f;var u=this.matrix.matrix,d=u[0],p=u[1],g=u[2],y=u[3],x=d*y-p*g;if(!x)return f;var C=u[4],P=u[5],M=this.scrollX,w=this.scrollY,I=this.width,L=this.height,B=this.y,N=B+L,G=this.x,V=G+I,K=this.culledObjects,j=f.length;x=1/x,K.length=0;for(var J=0;JG&&HB&&Zg&&(f=g),f},clampY:function(f){var u=this._bounds,d=this.displayHeight,p=u.y+(d-this.height)/2,g=Math.max(p,p+u.height-d);return fg&&(f=g),f},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(f){return f===void 0&&(f=0),this.rotation=a(f),this},setBackgroundColor:function(f){return f===void 0&&(f="rgba(0,0,0,0)"),this.backgroundColor=h(f),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(f,u,d,p,g){return g===void 0&&(g=!1),this._bounds.setTo(f,u,d,p),this.dirty=!0,this.useBounds=!0,g?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(f){f===void 0&&(f=new e);var u=this._bounds;return f.setTo(u.x,u.y,u.width,u.height),f},setName:function(f){return f===void 0&&(f=""),this.name=f,this},setPosition:function(f,u){return u===void 0&&(u=f),this.x=f,this.y=u,this},setRotation:function(f){return f===void 0&&(f=0),this.rotation=f,this},setRoundPixels:function(f){return this.roundPixels=f,this},setScene:function(f,u){u===void 0&&(u=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=f,this.isSceneCamera=u;var d=f.sys;return this.sceneManager=d.game.scene,this.scaleManager=d.scale,this.cameraManager=d.cameras,this.updateSystem(),this},setScroll:function(f,u){return u===void 0&&(u=f),this.scrollX=f,this.scrollY=u,this},setSize:function(f,u){return u===void 0&&(u=f),this.width=f,this.height=u,this},setViewport:function(f,u,d,p){return this.x=f,this.y=u,this.width=d,this.height=p,this},setZoom:function(f,u){return f===void 0&&(f=1),u===void 0&&(u=f),f===0&&(f=.001),u===0&&(u=.001),this.zoomX=f,this.zoomY=u,this},setMask:function(f,u){return u===void 0&&(u=!0),this.mask=f,this._maskCamera=u?this.cameraManager.default:this,this},clearMask:function(f){return f===void 0&&(f=!1),f&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var f={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&&(f.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),f},update:function(){},setIsSceneCamera:function(f){return this.isSceneCamera=f,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var f=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,u=this.sceneManager;f&&!this._customViewport?u.customViewports++:!f&&this._customViewport&&u.customViewports--,this.dirty=!0,this._customViewport=f}},destroy:function(){this.emit(n.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(f){this._x=f,this.updateSystem()}},y:{get:function(){return this._y},set:function(f){this._y=f,this.updateSystem()}},width:{get:function(){return this._width},set:function(f){this._width=f,this.updateSystem()}},height:{get:function(){return this._height},set:function(f){this._height=f,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(f){f!==this._scrollX&&(this._scrollX=f,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(f){f!==this._scrollY&&(this._scrollY=f,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(f){this._zoomX=f,this._zoomY=f,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(f){this._zoomX=f,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(f){this._zoomY=f,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(f){this._rotation=f,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}}});c.exports=l},38058:(c,m,t)=>{/** + */var o=t(83419),v=t(31401),a=t(39506),r=t(50792),n=t(19715),e=t(87841),i=t(61340),h=t(80333),s=t(26099),l=new o({Extends:r,Mixins:[v.AlphaSingle,v.Visible],initialize:function(u,d,p,g){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),r.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new e,this.dirty=!0,this._x=u,this._y=d,this._width=p,this._height=g,this._bounds=new e,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new i,this.transparent=!0,this.backgroundColor=h("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new s(p/2,g/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(f){this.renderList.push(f)},setOrigin:function(f,u){return f===void 0&&(f=.5),u===void 0&&(u=f),this.originX=f,this.originY=u,this},getScroll:function(f,u,d){d===void 0&&(d=new s);var p=this.width*.5,g=this.height*.5;return d.x=f-p,d.y=u-g,this.useBounds&&(d.x=this.clampX(d.x),d.y=this.clampY(d.y)),d},centerOnX:function(f){var u=this.width*.5;return this.midPoint.x=f,this.scrollX=f-u,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(f){var u=this.height*.5;return this.midPoint.y=f,this.scrollY=f-u,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(f,u){return this.centerOnX(f),this.centerOnY(u),this},centerToBounds:function(){if(this.useBounds){var f=this._bounds,u=this.width*.5,d=this.height*.5;this.midPoint.set(f.centerX,f.centerY),this.scrollX=f.centerX-u,this.scrollY=f.centerY-d}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(f){if(this.disableCull)return f;var u=this.matrix.matrix,d=u[0],p=u[1],g=u[2],x=u[3],y=d*x-p*g;if(!y)return f;var C=u[4],P=u[5],M=this.scrollX,w=this.scrollY,I=this.width,L=this.height,B=this.y,N=B+L,G=this.x,V=G+I,K=this.culledObjects,j=f.length;y=1/y,K.length=0;for(var J=0;JG&&HB&&Zg&&(f=g),f},clampY:function(f){var u=this._bounds,d=this.displayHeight,p=u.y+(d-this.height)/2,g=Math.max(p,p+u.height-d);return fg&&(f=g),f},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(f){return f===void 0&&(f=0),this.rotation=a(f),this},setBackgroundColor:function(f){return f===void 0&&(f="rgba(0,0,0,0)"),this.backgroundColor=h(f),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(f,u,d,p,g){return g===void 0&&(g=!1),this._bounds.setTo(f,u,d,p),this.dirty=!0,this.useBounds=!0,g?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(f){f===void 0&&(f=new e);var u=this._bounds;return f.setTo(u.x,u.y,u.width,u.height),f},setName:function(f){return f===void 0&&(f=""),this.name=f,this},setPosition:function(f,u){return u===void 0&&(u=f),this.x=f,this.y=u,this},setRotation:function(f){return f===void 0&&(f=0),this.rotation=f,this},setRoundPixels:function(f){return this.roundPixels=f,this},setScene:function(f,u){u===void 0&&(u=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=f,this.isSceneCamera=u;var d=f.sys;return this.sceneManager=d.game.scene,this.scaleManager=d.scale,this.cameraManager=d.cameras,this.updateSystem(),this},setScroll:function(f,u){return u===void 0&&(u=f),this.scrollX=f,this.scrollY=u,this},setSize:function(f,u){return u===void 0&&(u=f),this.width=f,this.height=u,this},setViewport:function(f,u,d,p){return this.x=f,this.y=u,this.width=d,this.height=p,this},setZoom:function(f,u){return f===void 0&&(f=1),u===void 0&&(u=f),f===0&&(f=.001),u===0&&(u=.001),this.zoomX=f,this.zoomY=u,this},setMask:function(f,u){return u===void 0&&(u=!0),this.mask=f,this._maskCamera=u?this.cameraManager.default:this,this},clearMask:function(f){return f===void 0&&(f=!1),f&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var f={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&&(f.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),f},update:function(){},setIsSceneCamera:function(f){return this.isSceneCamera=f,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var f=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,u=this.sceneManager;f&&!this._customViewport?u.customViewports++:!f&&this._customViewport&&u.customViewports--,this.dirty=!0,this._customViewport=f}},destroy:function(){this.emit(n.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(f){this._x=f,this.updateSystem()}},y:{get:function(){return this._y},set:function(f){this._y=f,this.updateSystem()}},width:{get:function(){return this._width},set:function(f){this._width=f,this.updateSystem()}},height:{get:function(){return this._height},set:function(f){this._height=f,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(f){f!==this._scrollX&&(this._scrollX=f,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(f){f!==this._scrollY&&(this._scrollY=f,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(f){this._zoomX=f,this._zoomY=f,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(f){this._zoomX=f,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(f){this._zoomY=f,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(f){this._rotation=f,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}}});c.exports=l},38058:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(71911),v=t(67502),a=t(45319),r=t(83419),n=t(31401),e=t(20052),i=t(19715),h=t(28915),s=t(87841),l=t(26099),f=new r({Extends:o,Mixins:[n.PostPipeline],initialize:function(d,p,g,y){o.call(this,d,p,g,y),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new e.Fade(this),this.flashEffect=new e.Flash(this),this.shakeEffect=new e.Shake(this),this.panEffect=new e.Pan(this),this.rotateToEffect=new e.RotateTo(this),this.zoomEffect=new e.Zoom(this),this.lerp=new l(1,1),this.followOffset=new l,this.deadzone=null,this._follow=null},setDeadzone:function(u,d){if(u===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=u,this.deadzone.height=d):this.deadzone=new s(0,0,u,d),this._follow){var p=this.width/2,g=this.height/2,y=this._follow.x-this.followOffset.x,x=this._follow.y-this.followOffset.y;this.midPoint.set(y,x),this.scrollX=y-p,this.scrollY=x-g}v(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(u,d,p,g,y,x){return this.fadeEffect.start(!1,u,d,p,g,!0,y,x)},fadeOut:function(u,d,p,g,y,x){return this.fadeEffect.start(!0,u,d,p,g,!0,y,x)},fadeFrom:function(u,d,p,g,y,x,C){return this.fadeEffect.start(!1,u,d,p,g,y,x,C)},fade:function(u,d,p,g,y,x,C){return this.fadeEffect.start(!0,u,d,p,g,y,x,C)},flash:function(u,d,p,g,y,x,C){return this.flashEffect.start(u,d,p,g,y,x,C)},shake:function(u,d,p,g,y){return this.shakeEffect.start(u,d,p,g,y)},pan:function(u,d,p,g,y,x,C){return this.panEffect.start(u,d,p,g,y,x,C)},rotateTo:function(u,d,p,g,y,x,C){return this.rotateToEffect.start(u,d,p,g,y,x,C)},zoomTo:function(u,d,p,g,y,x){return this.zoomEffect.start(u,d,p,g,y,x)},preRender:function(){this.renderList.length=0;var u=this.width,d=this.height,p=u*.5,g=d*.5,y=this.zoom,x=this.matrix,C=u*this.originX,P=d*this.originY,M=this._follow,w=this.deadzone,I=this.scrollX,L=this.scrollY;w&&v(w,this.midPoint.x,this.midPoint.y);var B=!1;if(M&&!this.panEffect.isRunning){var N=this.lerp,G=M.x-this.followOffset.x,V=M.y-this.followOffset.y;w?(Gw.right&&(I=h(I,I+(G-w.right),N.x)),Vw.bottom&&(L=h(L,L+(V-w.bottom),N.y))):(I=h(I,G-C,N.x),L=h(L,V-P,N.y)),B=!0}this.useBounds&&(I=this.clampX(I),L=this.clampY(L)),this.scrollX=I,this.scrollY=L;var K=I+p,j=L+g;this.midPoint.set(K,j);var J=u/y,X=d/y,Y=Math.floor(K-J/2),b=Math.floor(j-X/2);this.worldView.setTo(Y,b,J,X),x.applyITRS(Math.floor(this.x+C),Math.floor(this.y+P),this.rotation,y,y),x.translate(-C,-P),this.shakeEffect.preRender(),B&&this.emit(i.FOLLOW_UPDATE,this,M)},setLerp:function(u,d){return u===void 0&&(u=1),d===void 0&&(d=u),this.lerp.set(u,d),this},setFollowOffset:function(u,d){return u===void 0&&(u=0),d===void 0&&(d=0),this.followOffset.set(u,d),this},startFollow:function(u,d,p,g,y,x){d===void 0&&(d=!1),p===void 0&&(p=1),g===void 0&&(g=p),y===void 0&&(y=0),x===void 0&&(x=y),this._follow=u,this.roundPixels=d,p=a(p,0,1),g=a(g,0,1),this.lerp.set(p,g),this.followOffset.set(y,x);var C=this.width/2,P=this.height/2,M=u.x-y,w=u.y-x;return this.midPoint.set(M,w),this.scrollX=M-C,this.scrollY=w-P,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(u,d){this.visible&&(this.rotateToEffect.update(u,d),this.panEffect.update(u,d),this.zoomEffect.update(u,d),this.shakeEffect.update(u,d),this.flashEffect.update(u,d),this.fadeEffect.update(u,d))},destroy:function(){this.resetFX(),o.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});c.exports=f},32743:(c,m,t)=>{/** + */var o=t(71911),v=t(67502),a=t(45319),r=t(83419),n=t(31401),e=t(20052),i=t(19715),h=t(28915),s=t(87841),l=t(26099),f=new r({Extends:o,Mixins:[n.PostPipeline],initialize:function(d,p,g,x){o.call(this,d,p,g,x),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new e.Fade(this),this.flashEffect=new e.Flash(this),this.shakeEffect=new e.Shake(this),this.panEffect=new e.Pan(this),this.rotateToEffect=new e.RotateTo(this),this.zoomEffect=new e.Zoom(this),this.lerp=new l(1,1),this.followOffset=new l,this.deadzone=null,this._follow=null},setDeadzone:function(u,d){if(u===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=u,this.deadzone.height=d):this.deadzone=new s(0,0,u,d),this._follow){var p=this.width/2,g=this.height/2,x=this._follow.x-this.followOffset.x,y=this._follow.y-this.followOffset.y;this.midPoint.set(x,y),this.scrollX=x-p,this.scrollY=y-g}v(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(u,d,p,g,x,y){return this.fadeEffect.start(!1,u,d,p,g,!0,x,y)},fadeOut:function(u,d,p,g,x,y){return this.fadeEffect.start(!0,u,d,p,g,!0,x,y)},fadeFrom:function(u,d,p,g,x,y,C){return this.fadeEffect.start(!1,u,d,p,g,x,y,C)},fade:function(u,d,p,g,x,y,C){return this.fadeEffect.start(!0,u,d,p,g,x,y,C)},flash:function(u,d,p,g,x,y,C){return this.flashEffect.start(u,d,p,g,x,y,C)},shake:function(u,d,p,g,x){return this.shakeEffect.start(u,d,p,g,x)},pan:function(u,d,p,g,x,y,C){return this.panEffect.start(u,d,p,g,x,y,C)},rotateTo:function(u,d,p,g,x,y,C){return this.rotateToEffect.start(u,d,p,g,x,y,C)},zoomTo:function(u,d,p,g,x,y){return this.zoomEffect.start(u,d,p,g,x,y)},preRender:function(){this.renderList.length=0;var u=this.width,d=this.height,p=u*.5,g=d*.5,x=this.zoom,y=this.matrix,C=u*this.originX,P=d*this.originY,M=this._follow,w=this.deadzone,I=this.scrollX,L=this.scrollY;w&&v(w,this.midPoint.x,this.midPoint.y);var B=!1;if(M&&!this.panEffect.isRunning){var N=this.lerp,G=M.x-this.followOffset.x,V=M.y-this.followOffset.y;w?(Gw.right&&(I=h(I,I+(G-w.right),N.x)),Vw.bottom&&(L=h(L,L+(V-w.bottom),N.y))):(I=h(I,G-C,N.x),L=h(L,V-P,N.y)),B=!0}this.useBounds&&(I=this.clampX(I),L=this.clampY(L)),this.scrollX=I,this.scrollY=L;var K=I+p,j=L+g;this.midPoint.set(K,j);var J=u/x,X=d/x,Y=Math.floor(K-J/2),b=Math.floor(j-X/2);this.worldView.setTo(Y,b,J,X),y.applyITRS(Math.floor(this.x+C),Math.floor(this.y+P),this.rotation,x,x),y.translate(-C,-P),this.shakeEffect.preRender(),B&&this.emit(i.FOLLOW_UPDATE,this,M)},setLerp:function(u,d){return u===void 0&&(u=1),d===void 0&&(d=u),this.lerp.set(u,d),this},setFollowOffset:function(u,d){return u===void 0&&(u=0),d===void 0&&(d=0),this.followOffset.set(u,d),this},startFollow:function(u,d,p,g,x,y){d===void 0&&(d=!1),p===void 0&&(p=1),g===void 0&&(g=p),x===void 0&&(x=0),y===void 0&&(y=x),this._follow=u,this.roundPixels=d,p=a(p,0,1),g=a(g,0,1),this.lerp.set(p,g),this.followOffset.set(x,y);var C=this.width/2,P=this.height/2,M=u.x-x,w=u.y-y;return this.midPoint.set(M,w),this.scrollX=M-C,this.scrollY=w-P,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(u,d){this.visible&&(this.rotateToEffect.update(u,d),this.panEffect.update(u,d),this.zoomEffect.update(u,d),this.shakeEffect.update(u,d),this.flashEffect.update(u,d),this.fadeEffect.update(u,d))},destroy:function(){this.resetFX(),o.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});c.exports=f},32743:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(38058),v=t(83419),a=t(95540),r=t(37277),n=t(37303),e=t(97480),i=t(44594),h=new v({initialize:function(l){this.scene=l,this.systems=l.sys,this.roundPixels=l.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,l.sys.events.once(i.BOOT,this.boot,this),l.sys.events.on(i.START,this.start,this)},boot:function(){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new o(0,0,s.scale.width,s.scale.height).setScene(this.scene),s.game.scale.on(e.RESIZE,this.onResize,this),this.systems.events.once(i.DESTROY,this.destroy,this)},start:function(){if(!this.main){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0]}var l=this.systems.events;l.on(i.UPDATE,this.update,this),l.once(i.SHUTDOWN,this.shutdown,this)},add:function(s,l,f,u,d,p){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),d===void 0&&(d=!1),p===void 0&&(p="");var g=new o(s,l,f,u);return g.setName(p),g.setScene(this.scene),g.setRoundPixels(this.roundPixels),g.id=this.getNextID(),this.cameras.push(g),d&&(this.main=g),g},addExisting:function(s,l){l===void 0&&(l=!1);var f=this.cameras.indexOf(s);return f===-1?(s.id=this.getNextID(),s.setRoundPixels(this.roundPixels),this.cameras.push(s),l&&(this.main=s),s):null},getNextID:function(){for(var s=this.cameras,l=1,f=0;f<32;f++){for(var u=!1,d=0;d0){p.preRender();var g=this.getVisibleChildren(l.getChildren(),p);s.render(f,g,p)}}},getVisibleChildren:function(s,l){return s.filter(function(f){return f.willRender(l)})},resetAll:function(){for(var s=0;s{/** + */var o=t(38058),v=t(83419),a=t(95540),r=t(37277),n=t(37303),e=t(97480),i=t(44594),h=new v({initialize:function(l){this.scene=l,this.systems=l.sys,this.roundPixels=l.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,l.sys.events.once(i.BOOT,this.boot,this),l.sys.events.on(i.START,this.start,this)},boot:function(){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new o(0,0,s.scale.width,s.scale.height).setScene(this.scene),s.game.scale.on(e.RESIZE,this.onResize,this),this.systems.events.once(i.DESTROY,this.destroy,this)},start:function(){if(!this.main){var s=this.systems;s.settings.cameras?this.fromJSON(s.settings.cameras):this.add(),this.main=this.cameras[0]}var l=this.systems.events;l.on(i.UPDATE,this.update,this),l.once(i.SHUTDOWN,this.shutdown,this)},add:function(s,l,f,u,d,p){s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),d===void 0&&(d=!1),p===void 0&&(p="");var g=new o(s,l,f,u);return g.setName(p),g.setScene(this.scene),g.setRoundPixels(this.roundPixels),g.id=this.getNextID(),this.cameras.push(g),d&&(this.main=g),g},addExisting:function(s,l){l===void 0&&(l=!1);var f=this.cameras.indexOf(s);return f===-1?(s.id=this.getNextID(),s.setRoundPixels(this.roundPixels),this.cameras.push(s),l&&(this.main=s),s):null},getNextID:function(){for(var s=this.cameras,l=1,f=0;f<32;f++){for(var u=!1,d=0;d0){p.preRender();var g=this.getVisibleChildren(l.getChildren(),p);s.render(f,g,p)}}},getVisibleChildren:function(s,l){return s.filter(function(f){return f.willRender(l)})},resetAll:function(){for(var s=0;s{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -353,7 +353,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Jason Nicholls * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */var o=t(45319),v=t(83419),a=t(19715),r=t(62640),n=new v({initialize:function(i){this.camera=i,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(e,i,h,s,l,f,u){h===void 0&&(h=1e3),s===void 0&&(s=r.Linear),l===void 0&&(l=!1),f===void 0&&(f=null),u===void 0&&(u=this.camera.scene),i===void 0&&(i=!1),this.shortestPath=i;var d=e;e<0?(d=-1*e,this.clockwise=!1):this.clockwise=!0;var p=360*Math.PI/180;d=d-Math.floor(d/p)*p;var g=this.camera;if(!l&&this.isRunning)return g;if(this.isRunning=!0,this.duration=h,this.progress=0,this.source=g.rotation,this.destination=d,typeof s=="string"&&r.hasOwnProperty(s)?this.ease=r[s]:typeof s=="function"&&(this.ease=s),this._elapsed=0,this._onUpdate=f,this._onUpdateScope=u,this.shortestPath){var y=0,x=0;this.destination>this.source?y=Math.abs(this.destination-this.source):y=Math.abs(this.destination+p)-this.source,this.source>this.destination?x=Math.abs(this.source-this.destination):x=Math.abs(this.source+p)-this.destination,yx&&(this.clockwise=!1)}return this.camera.emit(a.ROTATE_START,this.camera,this,h,d),g},update:function(e,i){if(this.isRunning){this._elapsed+=i;var h=o(this._elapsed/this.duration,0,1);this.progress=h;var s=this.camera;if(this._elapsed=p?f=Math.abs(d-p):f=Math.abs(d+u)-p;var g=0;this.clockwise?g=s.rotation+f*l:g=s.rotation-f*l,s.rotation=g,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,g)}else s.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.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}});c.exports=n},30330:(c,m,t)=>{/** + */var o=t(45319),v=t(83419),a=t(19715),r=t(62640),n=new v({initialize:function(i){this.camera=i,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(e,i,h,s,l,f,u){h===void 0&&(h=1e3),s===void 0&&(s=r.Linear),l===void 0&&(l=!1),f===void 0&&(f=null),u===void 0&&(u=this.camera.scene),i===void 0&&(i=!1),this.shortestPath=i;var d=e;e<0?(d=-1*e,this.clockwise=!1):this.clockwise=!0;var p=360*Math.PI/180;d=d-Math.floor(d/p)*p;var g=this.camera;if(!l&&this.isRunning)return g;if(this.isRunning=!0,this.duration=h,this.progress=0,this.source=g.rotation,this.destination=d,typeof s=="string"&&r.hasOwnProperty(s)?this.ease=r[s]:typeof s=="function"&&(this.ease=s),this._elapsed=0,this._onUpdate=f,this._onUpdateScope=u,this.shortestPath){var x=0,y=0;this.destination>this.source?x=Math.abs(this.destination-this.source):x=Math.abs(this.destination+p)-this.source,this.source>this.destination?y=Math.abs(this.source-this.destination):y=Math.abs(this.source+p)-this.destination,xy&&(this.clockwise=!1)}return this.camera.emit(a.ROTATE_START,this.camera,this,h,d),g},update:function(e,i){if(this.isRunning){this._elapsed+=i;var h=o(this._elapsed/this.duration,0,1);this.progress=h;var s=this.camera;if(this._elapsed=p?f=Math.abs(d-p):f=Math.abs(d+u)-p;var g=0;this.clockwise?g=s.rotation+f*l:g=s.rotation-f*l,s.rotation=g,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,g)}else s.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,h,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(a.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}});c.exports=n},30330:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -469,7 +469,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(8054),a=t(42363),r=t(82264),n=t(95540),e=t(35154),i=t(41212),h=t(29747),s=t(75508),l=t(36060),f=t(80333),u=new o({initialize:function(p){p===void 0&&(p={});var g=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],y="#ffffff",x=e(p,"scale",null);this.width=e(x,"width",1024,p),this.height=e(x,"height",768,p),this.zoom=e(x,"zoom",1,p),this.parent=e(x,"parent",void 0,p),this.scaleMode=e(x,x?"mode":"scaleMode",0,p),this.expandParent=e(x,"expandParent",!0,p),this.autoRound=e(x,"autoRound",!1,p),this.autoCenter=e(x,"autoCenter",0,p),this.resizeInterval=e(x,"resizeInterval",500,p),this.fullscreenTarget=e(x,"fullscreenTarget",null,p),this.minWidth=e(x,"min.width",0,p),this.maxWidth=e(x,"max.width",0,p),this.minHeight=e(x,"min.height",0,p),this.maxHeight=e(x,"max.height",0,p),this.snapWidth=e(x,"snap.width",0,p),this.snapHeight=e(x,"snap.height",0,p),this.renderType=e(p,"type",v.AUTO),this.canvas=e(p,"canvas",null),this.context=e(p,"context",null),this.canvasStyle=e(p,"canvasStyle",null),this.customEnvironment=e(p,"customEnvironment",!1),this.sceneConfig=e(p,"scene",null),this.seed=e(p,"seed",[(Date.now()*Math.random()).toString()]),s.RND=new s.RandomDataGenerator(this.seed),this.gameTitle=e(p,"title",""),this.gameURL=e(p,"url","https://phaser.io"),this.gameVersion=e(p,"version",""),this.autoFocus=e(p,"autoFocus",!0),this.stableSort=e(p,"stableSort",-1),this.stableSort===-1&&(this.stableSort=r.browser.es2019?1:0),r.features.stableSort=this.stableSort,this.domCreateContainer=e(p,"dom.createContainer",!1),this.domPointerEvents=e(p,"dom.pointerEvents","none"),this.inputKeyboard=e(p,"input.keyboard",!0),this.inputKeyboardEventTarget=e(p,"input.keyboard.target",window),this.inputKeyboardCapture=e(p,"input.keyboard.capture",[]),this.inputMouse=e(p,"input.mouse",!0),this.inputMouseEventTarget=e(p,"input.mouse.target",null),this.inputMousePreventDefaultDown=e(p,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=e(p,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=e(p,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=e(p,"input.mouse.preventDefaultWheel",!0),this.inputTouch=e(p,"input.touch",r.input.touch),this.inputTouchEventTarget=e(p,"input.touch.target",null),this.inputTouchCapture=e(p,"input.touch.capture",!0),this.inputActivePointers=e(p,"input.activePointers",1),this.inputSmoothFactor=e(p,"input.smoothFactor",0),this.inputWindowEvents=e(p,"input.windowEvents",!0),this.inputGamepad=e(p,"input.gamepad",!1),this.inputGamepadEventTarget=e(p,"input.gamepad.target",window),this.disableContextMenu=e(p,"disableContextMenu",!1),this.audio=e(p,"audio",{}),this.hideBanner=e(p,"banner",null)===!1,this.hidePhaser=e(p,"banner.hidePhaser",!1),this.bannerTextColor=e(p,"banner.text",y),this.bannerBackgroundColor=e(p,"banner.background",g),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=e(p,"fps",null),this.disablePreFX=e(p,"disablePreFX",!1),this.disablePostFX=e(p,"disablePostFX",!1);var C=e(p,"render",null);this.pipeline=e(C,"pipeline",null,p),this.autoMobilePipeline=e(C,"autoMobilePipeline",!0,p),this.defaultPipeline=e(C,"defaultPipeline",l.MULTI_PIPELINE,p),this.antialias=e(C,"antialias",!0,p),this.antialiasGL=e(C,"antialiasGL",!0,p),this.mipmapFilter=e(C,"mipmapFilter","",p),this.desynchronized=e(C,"desynchronized",!1,p),this.roundPixels=e(C,"roundPixels",!0,p),this.pixelArt=e(C,"pixelArt",this.zoom!==1,p),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=e(C,"transparent",!1,p),this.clearBeforeRender=e(C,"clearBeforeRender",!0,p),this.preserveDrawingBuffer=e(C,"preserveDrawingBuffer",!1,p),this.premultipliedAlpha=e(C,"premultipliedAlpha",!0,p),this.failIfMajorPerformanceCaveat=e(C,"failIfMajorPerformanceCaveat",!1,p),this.powerPreference=e(C,"powerPreference","default",p),this.batchSize=e(C,"batchSize",4096,p),this.maxTextures=e(C,"maxTextures",-1,p),this.maxLights=e(C,"maxLights",10,p);var P=e(p,"backgroundColor",0);this.backgroundColor=f(P),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=e(p,"callbacks.preBoot",h),this.postBoot=e(p,"callbacks.postBoot",h),this.physics=e(p,"physics",{}),this.defaultPhysicsSystem=e(this.physics,"default",!1),this.loaderBaseURL=e(p,"loader.baseURL",""),this.loaderPath=e(p,"loader.path",""),this.loaderMaxParallelDownloads=e(p,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=e(p,"loader.crossOrigin",void 0),this.loaderResponseType=e(p,"loader.responseType",""),this.loaderAsync=e(p,"loader.async",!0),this.loaderUser=e(p,"loader.user",""),this.loaderPassword=e(p,"loader.password",""),this.loaderTimeout=e(p,"loader.timeout",0),this.loaderWithCredentials=e(p,"loader.withCredentials",!1),this.loaderImageLoadType=e(p,"loader.imageLoadType","XHR"),this.loaderLocalScheme=e(p,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=e(p,"fx.glow.quality",.1),this.glowFXDistance=e(p,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var M=e(p,"plugins",null),w=a.DefaultScene;M&&(Array.isArray(M)?this.defaultPlugins=M:i(M)&&(this.installGlobalPlugins=n(M,"global",[]),this.installScenePlugins=n(M,"scene",[]),Array.isArray(M.default)?w=M.default:Array.isArray(M.defaultMerge)&&(w=w.concat(M.defaultMerge)))),this.defaultPlugins=w;var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=e(p,"images.default",I+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=e(p,"images.missing",I+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=e(p,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=v.WEBGL:window.FORCE_CANVAS&&(this.renderType=v.CANVAS))}});c.exports=u},86054:(c,m,t)=>{/** + */var o=t(83419),v=t(8054),a=t(42363),r=t(82264),n=t(95540),e=t(35154),i=t(41212),h=t(29747),s=t(75508),l=t(36060),f=t(80333),u=new o({initialize:function(p){p===void 0&&(p={});var g=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],x="#ffffff",y=e(p,"scale",null);this.width=e(y,"width",1024,p),this.height=e(y,"height",768,p),this.zoom=e(y,"zoom",1,p),this.parent=e(y,"parent",void 0,p),this.scaleMode=e(y,y?"mode":"scaleMode",0,p),this.expandParent=e(y,"expandParent",!0,p),this.autoRound=e(y,"autoRound",!1,p),this.autoCenter=e(y,"autoCenter",0,p),this.resizeInterval=e(y,"resizeInterval",500,p),this.fullscreenTarget=e(y,"fullscreenTarget",null,p),this.minWidth=e(y,"min.width",0,p),this.maxWidth=e(y,"max.width",0,p),this.minHeight=e(y,"min.height",0,p),this.maxHeight=e(y,"max.height",0,p),this.snapWidth=e(y,"snap.width",0,p),this.snapHeight=e(y,"snap.height",0,p),this.renderType=e(p,"type",v.AUTO),this.canvas=e(p,"canvas",null),this.context=e(p,"context",null),this.canvasStyle=e(p,"canvasStyle",null),this.customEnvironment=e(p,"customEnvironment",!1),this.sceneConfig=e(p,"scene",null),this.seed=e(p,"seed",[(Date.now()*Math.random()).toString()]),s.RND=new s.RandomDataGenerator(this.seed),this.gameTitle=e(p,"title",""),this.gameURL=e(p,"url","https://phaser.io"),this.gameVersion=e(p,"version",""),this.autoFocus=e(p,"autoFocus",!0),this.stableSort=e(p,"stableSort",-1),this.stableSort===-1&&(this.stableSort=r.browser.es2019?1:0),r.features.stableSort=this.stableSort,this.domCreateContainer=e(p,"dom.createContainer",!1),this.domPointerEvents=e(p,"dom.pointerEvents","none"),this.inputKeyboard=e(p,"input.keyboard",!0),this.inputKeyboardEventTarget=e(p,"input.keyboard.target",window),this.inputKeyboardCapture=e(p,"input.keyboard.capture",[]),this.inputMouse=e(p,"input.mouse",!0),this.inputMouseEventTarget=e(p,"input.mouse.target",null),this.inputMousePreventDefaultDown=e(p,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=e(p,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=e(p,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=e(p,"input.mouse.preventDefaultWheel",!0),this.inputTouch=e(p,"input.touch",r.input.touch),this.inputTouchEventTarget=e(p,"input.touch.target",null),this.inputTouchCapture=e(p,"input.touch.capture",!0),this.inputActivePointers=e(p,"input.activePointers",1),this.inputSmoothFactor=e(p,"input.smoothFactor",0),this.inputWindowEvents=e(p,"input.windowEvents",!0),this.inputGamepad=e(p,"input.gamepad",!1),this.inputGamepadEventTarget=e(p,"input.gamepad.target",window),this.disableContextMenu=e(p,"disableContextMenu",!1),this.audio=e(p,"audio",{}),this.hideBanner=e(p,"banner",null)===!1,this.hidePhaser=e(p,"banner.hidePhaser",!1),this.bannerTextColor=e(p,"banner.text",x),this.bannerBackgroundColor=e(p,"banner.background",g),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=e(p,"fps",null),this.disablePreFX=e(p,"disablePreFX",!1),this.disablePostFX=e(p,"disablePostFX",!1);var C=e(p,"render",null);this.pipeline=e(C,"pipeline",null,p),this.autoMobilePipeline=e(C,"autoMobilePipeline",!0,p),this.defaultPipeline=e(C,"defaultPipeline",l.MULTI_PIPELINE,p),this.antialias=e(C,"antialias",!0,p),this.antialiasGL=e(C,"antialiasGL",!0,p),this.mipmapFilter=e(C,"mipmapFilter","",p),this.desynchronized=e(C,"desynchronized",!1,p),this.roundPixels=e(C,"roundPixels",!0,p),this.pixelArt=e(C,"pixelArt",this.zoom!==1,p),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=e(C,"transparent",!1,p),this.clearBeforeRender=e(C,"clearBeforeRender",!0,p),this.preserveDrawingBuffer=e(C,"preserveDrawingBuffer",!1,p),this.premultipliedAlpha=e(C,"premultipliedAlpha",!0,p),this.failIfMajorPerformanceCaveat=e(C,"failIfMajorPerformanceCaveat",!1,p),this.powerPreference=e(C,"powerPreference","default",p),this.batchSize=e(C,"batchSize",4096,p),this.maxTextures=e(C,"maxTextures",-1,p),this.maxLights=e(C,"maxLights",10,p);var P=e(p,"backgroundColor",0);this.backgroundColor=f(P),this.transparent&&(this.backgroundColor=f(0),this.backgroundColor.alpha=0),this.preBoot=e(p,"callbacks.preBoot",h),this.postBoot=e(p,"callbacks.postBoot",h),this.physics=e(p,"physics",{}),this.defaultPhysicsSystem=e(this.physics,"default",!1),this.loaderBaseURL=e(p,"loader.baseURL",""),this.loaderPath=e(p,"loader.path",""),this.loaderMaxParallelDownloads=e(p,"loader.maxParallelDownloads",r.os.android?6:32),this.loaderCrossOrigin=e(p,"loader.crossOrigin",void 0),this.loaderResponseType=e(p,"loader.responseType",""),this.loaderAsync=e(p,"loader.async",!0),this.loaderUser=e(p,"loader.user",""),this.loaderPassword=e(p,"loader.password",""),this.loaderTimeout=e(p,"loader.timeout",0),this.loaderWithCredentials=e(p,"loader.withCredentials",!1),this.loaderImageLoadType=e(p,"loader.imageLoadType","XHR"),this.loaderLocalScheme=e(p,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=e(p,"fx.glow.quality",.1),this.glowFXDistance=e(p,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var M=e(p,"plugins",null),w=a.DefaultScene;M&&(Array.isArray(M)?this.defaultPlugins=M:i(M)&&(this.installGlobalPlugins=n(M,"global",[]),this.installScenePlugins=n(M,"scene",[]),Array.isArray(M.default)?w=M.default:Array.isArray(M.defaultMerge)&&(w=w.concat(M.defaultMerge)))),this.defaultPlugins=w;var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=e(p,"images.default",I+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=e(p,"images.missing",I+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=e(p,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=v.WEBGL:window.FORCE_CANVAS&&(this.renderType=v.CANVAS))}});c.exports=u},86054:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -481,7 +481,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(40366),v=t(60848),a=t(24047),r=t(27919),n=t(83419),e=t(69547),i=t(83719),h=t(86054),s=t(45893),l=t(96391),f=t(82264),u=t(57264),d=t(50792),p=t(8443),g=t(7003),y=t(37277),x=t(77332),C=t(76531),P=t(60903),M=t(69442),w=t(17130),I=t(65898),L=t(51085),B=t(14747),N=new n({initialize:function(V){this.config=new e(V),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new d,this.anims=new v(this),this.textures=new w(this),this.cache=new a(this),this.registry=new s(this,new d),this.input=new g(this,this.config),this.scene=new P(this,this.config.sceneConfig),this.device=f,this.scale=new C(this,this.config),this.sound=null,this.sound=B.create(this),this.loop=new I(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,u(this.boot.bind(this))},boot:function(){if(!y.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),h(this),i(this),l(this),o(this.canvas,this.config.parent),this.textures.once(M.READY,this.texturesReady,this),this.events.emit(p.BOOT)},texturesReady:function(){this.events.emit(p.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)),L(this);var G=this.events;G.on(p.HIDDEN,this.onHidden,this),G.on(p.VISIBLE,this.onVisible,this),G.on(p.BLUR,this.onBlur,this),G.on(p.FOCUS,this.onFocus,this)},step:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(p.PRE_STEP,G,V),K.emit(p.STEP,G,V),this.scene.update(G,V),K.emit(p.POST_STEP,G,V);var j=this.renderer;j.preRender(),K.emit(p.PRE_RENDER,j,G,V),this.scene.render(j),j.postRender(),K.emit(p.POST_RENDER,j,G,V)}},headlessStep:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(p.PRE_STEP,G,V),K.emit(p.STEP,G,V),this.scene.update(G,V),K.emit(p.POST_STEP,G,V),this.scene.isProcessing=!1,K.emit(p.PRE_RENDER,null,G,V),K.emit(p.POST_RENDER,null,G,V)}},onHidden:function(){this.loop.pause(),this.events.emit(p.PAUSE)},pause:function(){var G=this.isPaused;this.isPaused=!0,G||this.events.emit(p.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(p.RESUME)},resume:function(){var G=this.isPaused;this.isPaused=!1,G&&this.events.emit(p.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(G,V){V===void 0&&(V=!1),this.pendingDestroy=!0,this.removeCanvas=G,this.noReturn=V},runDestroy:function(){this.scene.destroy(),this.events.emit(p.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(r.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}});c.exports=N},65898:(c,m,t)=>{/** + */var o=t(40366),v=t(60848),a=t(24047),r=t(27919),n=t(83419),e=t(69547),i=t(83719),h=t(86054),s=t(45893),l=t(96391),f=t(82264),u=t(57264),d=t(50792),p=t(8443),g=t(7003),x=t(37277),y=t(77332),C=t(76531),P=t(60903),M=t(69442),w=t(17130),I=t(65898),L=t(51085),B=t(14747),N=new n({initialize:function(V){this.config=new e(V),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new d,this.anims=new v(this),this.textures=new w(this),this.cache=new a(this),this.registry=new s(this,new d),this.input=new g(this,this.config),this.scene=new P(this,this.config.sceneConfig),this.device=f,this.scale=new C(this,this.config),this.sound=null,this.sound=B.create(this),this.loop=new I(this,this.config.fps),this.plugins=new y(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,u(this.boot.bind(this))},boot:function(){if(!x.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),h(this),i(this),l(this),o(this.canvas,this.config.parent),this.textures.once(M.READY,this.texturesReady,this),this.events.emit(p.BOOT)},texturesReady:function(){this.events.emit(p.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)),L(this);var G=this.events;G.on(p.HIDDEN,this.onHidden,this),G.on(p.VISIBLE,this.onVisible,this),G.on(p.BLUR,this.onBlur,this),G.on(p.FOCUS,this.onFocus,this)},step:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(p.PRE_STEP,G,V),K.emit(p.STEP,G,V),this.scene.update(G,V),K.emit(p.POST_STEP,G,V);var j=this.renderer;j.preRender(),K.emit(p.PRE_RENDER,j,G,V),this.scene.render(j),j.postRender(),K.emit(p.POST_RENDER,j,G,V)}},headlessStep:function(G,V){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(p.PRE_STEP,G,V),K.emit(p.STEP,G,V),this.scene.update(G,V),K.emit(p.POST_STEP,G,V),this.scene.isProcessing=!1,K.emit(p.PRE_RENDER,null,G,V),K.emit(p.POST_RENDER,null,G,V)}},onHidden:function(){this.loop.pause(),this.events.emit(p.PAUSE)},pause:function(){var G=this.isPaused;this.isPaused=!0,G||this.events.emit(p.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(p.RESUME)},resume:function(){var G=this.isPaused;this.isPaused=!1,G&&this.events.emit(p.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(G,V){V===void 0&&(V=!1),this.pendingDestroy=!0,this.removeCanvas=G,this.noReturn=V},runDestroy:function(){this.scene.destroy(),this.events.emit(p.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(r.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}});c.exports=N},65898:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -565,7 +565,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(5290),v=t(27919),a=t(35154),r=function(n){var e=a(n,"data",[]),i=a(n,"canvas",null),h=a(n,"palette",o),s=a(n,"pixelWidth",1),l=a(n,"pixelHeight",s),f=a(n,"resizeCanvas",!0),u=a(n,"clearCanvas",!0),d=a(n,"preRender",null),p=a(n,"postRender",null),g=Math.floor(Math.abs(e[0].length*s)),y=Math.floor(Math.abs(e.length*l));i||(i=v.create2D(this,g,y),f=!1,u=!1),f&&(i.width=g,i.height=y);var x=i.getContext("2d",{willReadFrequently:!0});u&&x.clearRect(0,0,g,y),d&&d(i,x);for(var C=0;C{/** + */var o=t(5290),v=t(27919),a=t(35154),r=function(n){var e=a(n,"data",[]),i=a(n,"canvas",null),h=a(n,"palette",o),s=a(n,"pixelWidth",1),l=a(n,"pixelHeight",s),f=a(n,"resizeCanvas",!0),u=a(n,"clearCanvas",!0),d=a(n,"preRender",null),p=a(n,"postRender",null),g=Math.floor(Math.abs(e[0].length*s)),x=Math.floor(Math.abs(e.length*l));i||(i=v.create2D(this,g,x),f=!1,u=!1),f&&(i.width=g,i.height=x);var y=i.getContext("2d",{willReadFrequently:!0});u&&y.clearRect(0,0,g,x),d&&d(i,y);for(var C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -601,11 +601,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(19217),a=t(87841),r=t(26099),n=new o({initialize:function(i){this.type=i,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new r,this._tmpVec2B=new r},draw:function(e,i){return i===void 0&&(i=32),e.strokePoints(this.getPoints(i))},getBounds:function(e,i){e||(e=new a),i===void 0&&(i=16);var h=this.getLength();i>h&&(i=h/2);var s=Math.max(1,Math.round(h/i));return v(this.getSpacedPoints(s),e)},getDistancePoints:function(e){var i=this.getLength(),h=Math.max(1,i/e);return this.getSpacedPoints(h)},getEndPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(1,e)},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i=[],h,s=this.getPoint(0,this._tmpVec2A),l=0;i.push(0);for(var f=1;f<=e;f++)h=this.getPoint(f/e,this._tmpVec2B),l+=h.distance(s),i.push(l),s.copy(h);return this.cacheArcLengths=i,i},getPointAt:function(e,i){var h=this.getUtoTmapping(e);return this.getPoint(h,i)},getPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++)h.push(this.getPoint(s/e));return h},getRandomPoint:function(e){return e===void 0&&(e=new r),this.getPoint(Math.random(),e)},getSpacedPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++){var l=this.getUtoTmapping(s/e,null,e);h.push(this.getPoint(l))}return h},getStartPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(0,e)},getTangent:function(e,i){i===void 0&&(i=new r);var h=1e-4,s=e-h,l=e+h;return s<0&&(s=0),l>1&&(l=1),this.getPoint(s,this._tmpVec2A),this.getPoint(l,i),i.subtract(this._tmpVec2A).normalize()},getTangentAt:function(e,i){var h=this.getUtoTmapping(e);return this.getTangent(h,i)},getTFromDistance:function(e,i){return e<=0?0:this.getUtoTmapping(0,e,i)},getUtoTmapping:function(e,i,h){var s=this.getLengths(h),l=0,f=s.length,u;i?u=Math.min(i,s[f-1]):u=e*s[f-1];for(var d=0,p=f-1,g;d<=p;)if(l=Math.floor(d+(p-d)/2),g=s[l]-u,g<0)d=l+1;else if(g>0)p=l-1;else{p=l;break}if(l=p,s[l]===u)return l/(f-1);var y=s[l],x=s[l+1],C=x-y,P=(u-y)/C;return(l+P)/(f-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});c.exports=n},73825:(c,m,t)=>{/** + */var o=t(83419),v=t(19217),a=t(87841),r=t(26099),n=new o({initialize:function(i){this.type=i,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new r,this._tmpVec2B=new r},draw:function(e,i){return i===void 0&&(i=32),e.strokePoints(this.getPoints(i))},getBounds:function(e,i){e||(e=new a),i===void 0&&(i=16);var h=this.getLength();i>h&&(i=h/2);var s=Math.max(1,Math.round(h/i));return v(this.getSpacedPoints(s),e)},getDistancePoints:function(e){var i=this.getLength(),h=Math.max(1,i/e);return this.getSpacedPoints(h)},getEndPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(1,e)},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e===void 0&&(e=this.arcLengthDivisions),this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i=[],h,s=this.getPoint(0,this._tmpVec2A),l=0;i.push(0);for(var f=1;f<=e;f++)h=this.getPoint(f/e,this._tmpVec2B),l+=h.distance(s),i.push(l),s.copy(h);return this.cacheArcLengths=i,i},getPointAt:function(e,i){var h=this.getUtoTmapping(e);return this.getPoint(h,i)},getPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++)h.push(this.getPoint(s/e));return h},getRandomPoint:function(e){return e===void 0&&(e=new r),this.getPoint(Math.random(),e)},getSpacedPoints:function(e,i,h){h===void 0&&(h=[]),e||(i?e=this.getLength()/i:e=this.defaultDivisions);for(var s=0;s<=e;s++){var l=this.getUtoTmapping(s/e,null,e);h.push(this.getPoint(l))}return h},getStartPoint:function(e){return e===void 0&&(e=new r),this.getPointAt(0,e)},getTangent:function(e,i){i===void 0&&(i=new r);var h=1e-4,s=e-h,l=e+h;return s<0&&(s=0),l>1&&(l=1),this.getPoint(s,this._tmpVec2A),this.getPoint(l,i),i.subtract(this._tmpVec2A).normalize()},getTangentAt:function(e,i){var h=this.getUtoTmapping(e);return this.getTangent(h,i)},getTFromDistance:function(e,i){return e<=0?0:this.getUtoTmapping(0,e,i)},getUtoTmapping:function(e,i,h){var s=this.getLengths(h),l=0,f=s.length,u;i?u=Math.min(i,s[f-1]):u=e*s[f-1];for(var d=0,p=f-1,g;d<=p;)if(l=Math.floor(d+(p-d)/2),g=s[l]-u,g<0)d=l+1;else if(g>0)p=l-1;else{p=l;break}if(l=p,s[l]===u)return l/(f-1);var x=s[l],y=s[l+1],C=y-x,P=(u-x)/C;return(l+P)/(f-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});c.exports=n},73825:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(80021),a=t(39506),r=t(35154),n=t(43396),e=t(26099),i=new o({Extends:v,initialize:function(s,l,f,u,d,p,g,y){if(typeof s=="object"){var x=s;s=r(x,"x",0),l=r(x,"y",0),f=r(x,"xRadius",0),u=r(x,"yRadius",f),d=r(x,"startAngle",0),p=r(x,"endAngle",360),g=r(x,"clockwise",!1),y=r(x,"rotation",0)}else u===void 0&&(u=f),d===void 0&&(d=0),p===void 0&&(p=360),g===void 0&&(g=!1),y===void 0&&(y=0);v.call(this,"EllipseCurve"),this.p0=new e(s,l),this._xRadius=f,this._yRadius=u,this._startAngle=a(d),this._endAngle=a(p),this._clockwise=g,this._rotation=a(y)},getStartPoint:function(h){return h===void 0&&(h=new e),this.getPoint(0,h)},getResolution:function(h){return h*2},getPoint:function(h,s){s===void 0&&(s=new e);for(var l=Math.PI*2,f=this._endAngle-this._startAngle,u=Math.abs(f)l;)f-=l;f{/** + */var o=t(83419),v=t(80021),a=t(39506),r=t(35154),n=t(43396),e=t(26099),i=new o({Extends:v,initialize:function(s,l,f,u,d,p,g,x){if(typeof s=="object"){var y=s;s=r(y,"x",0),l=r(y,"y",0),f=r(y,"xRadius",0),u=r(y,"yRadius",f),d=r(y,"startAngle",0),p=r(y,"endAngle",360),g=r(y,"clockwise",!1),x=r(y,"rotation",0)}else u===void 0&&(u=f),d===void 0&&(d=0),p===void 0&&(p=360),g===void 0&&(g=!1),x===void 0&&(x=0);v.call(this,"EllipseCurve"),this.p0=new e(s,l),this._xRadius=f,this._yRadius=u,this._startAngle=a(d),this._endAngle=a(p),this._clockwise=g,this._rotation=a(x)},getStartPoint:function(h){return h===void 0&&(h=new e),this.getPoint(0,h)},getResolution:function(h){return h*2},getPoint:function(h,s){s===void 0&&(s=new e);for(var l=Math.PI*2,f=this._endAngle-this._startAngle,u=Math.abs(f)l;)f-=l;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -629,7 +629,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(46728),a=t(73825),r=t(39429),n=t(33951),e=t(68618),i=t(14744),h=t(87841),s=t(42534),l=t(26099),f=t(36383),u=new o({initialize:function(p,g){p===void 0&&(p=0),g===void 0&&(g=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new l,this._tmpVec2A=new l,this._tmpVec2B=new l,typeof p=="object"?this.fromJSON(p):this.startPoint.set(p,g)},add:function(d){return this.curves.push(d),this},circleTo:function(d,p,g){return p===void 0&&(p=!1),this.ellipseTo(d,d,0,360,p,g)},closePath:function(){var d=this.curves[0].getPoint(0),p=this.curves[this.curves.length-1].getPoint(1);return d.equals(p)||this.curves.push(new n(p,d)),this},cubicBezierTo:function(d,p,g,y,x,C){var P=this.getEndPoint(),M,w,I;return d instanceof l?(M=d,w=p,I=g):(M=new l(g,y),w=new l(x,C),I=new l(d,p)),this.add(new v(P,M,w,I))},quadraticBezierTo:function(d,p,g,y){var x=this.getEndPoint(),C,P;return d instanceof l?(C=d,P=p):(C=new l(g,y),P=new l(d,p)),this.add(new i(x,C,P))},draw:function(d,p){for(var g=0;g=p)return this.curves[y];y++}return null},getEndPoint:function(d){return d===void 0&&(d=new l),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,d):d.copy(this.startPoint),d},getLength:function(){var d=this.getCurveLengths();return d[d.length-1]},getPoint:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),y=this.getCurveLengths(),x=0;x=g){var C=y[x]-g,P=this.curves[x],M=P.getLength(),w=M===0?0:1-C/M;return P.getPointAt(w,p)}x++}return null},getPoints:function(d,p){!d&&!p&&(d=this.defaultDivisions);for(var g=[],y,x=0;x1&&!g[g.length-1].equals(g[0])&&g.push(g[0]),g},getRandomPoint:function(d){return d===void 0&&(d=new l),this.getPoint(Math.random(),d)},getSpacedPoints:function(d){d===void 0&&(d=40);for(var p=[],g=0;g<=d;g++)p.push(this.getPoint(g/d));return this.autoClose&&p.push(p[0]),p},getStartPoint:function(d){return d===void 0&&(d=new l),d.copy(this.startPoint)},getTangent:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),y=this.getCurveLengths(),x=0;x=g){var C=y[x]-g,P=this.curves[x],M=P.getLength(),w=M===0?0:1-C/M;return P.getTangentAt(w,p)}x++}return null},lineTo:function(d,p){d instanceof l?this._tmpVec2B.copy(d):typeof d=="object"?this._tmpVec2B.setFromObject(d):this._tmpVec2B.set(d,p);var g=this.getEndPoint(this._tmpVec2A);return this.add(new n([g.x,g.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(d){return d.unshift(this.getEndPoint()),this.add(new s(d))},moveTo:function(d,p){return d instanceof l?this.add(new e(d.x,d.y)):this.add(new e(d,p))},toJSON:function(){for(var d=[],p=0;p{/** + */var o=t(83419),v=t(46728),a=t(73825),r=t(39429),n=t(33951),e=t(68618),i=t(14744),h=t(87841),s=t(42534),l=t(26099),f=t(36383),u=new o({initialize:function(p,g){p===void 0&&(p=0),g===void 0&&(g=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new l,this._tmpVec2A=new l,this._tmpVec2B=new l,typeof p=="object"?this.fromJSON(p):this.startPoint.set(p,g)},add:function(d){return this.curves.push(d),this},circleTo:function(d,p,g){return p===void 0&&(p=!1),this.ellipseTo(d,d,0,360,p,g)},closePath:function(){var d=this.curves[0].getPoint(0),p=this.curves[this.curves.length-1].getPoint(1);return d.equals(p)||this.curves.push(new n(p,d)),this},cubicBezierTo:function(d,p,g,x,y,C){var P=this.getEndPoint(),M,w,I;return d instanceof l?(M=d,w=p,I=g):(M=new l(g,x),w=new l(y,C),I=new l(d,p)),this.add(new v(P,M,w,I))},quadraticBezierTo:function(d,p,g,x){var y=this.getEndPoint(),C,P;return d instanceof l?(C=d,P=p):(C=new l(g,x),P=new l(d,p)),this.add(new i(y,C,P))},draw:function(d,p){for(var g=0;g=p)return this.curves[x];x++}return null},getEndPoint:function(d){return d===void 0&&(d=new l),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,d):d.copy(this.startPoint),d},getLength:function(){var d=this.getCurveLengths();return d[d.length-1]},getPoint:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),x=this.getCurveLengths(),y=0;y=g){var C=x[y]-g,P=this.curves[y],M=P.getLength(),w=M===0?0:1-C/M;return P.getPointAt(w,p)}y++}return null},getPoints:function(d,p){!d&&!p&&(d=this.defaultDivisions);for(var g=[],x,y=0;y1&&!g[g.length-1].equals(g[0])&&g.push(g[0]),g},getRandomPoint:function(d){return d===void 0&&(d=new l),this.getPoint(Math.random(),d)},getSpacedPoints:function(d){d===void 0&&(d=40);for(var p=[],g=0;g<=d;g++)p.push(this.getPoint(g/d));return this.autoClose&&p.push(p[0]),p},getStartPoint:function(d){return d===void 0&&(d=new l),d.copy(this.startPoint)},getTangent:function(d,p){p===void 0&&(p=new l);for(var g=d*this.getLength(),x=this.getCurveLengths(),y=0;y=g){var C=x[y]-g,P=this.curves[y],M=P.getLength(),w=M===0?0:1-C/M;return P.getTangentAt(w,p)}y++}return null},lineTo:function(d,p){d instanceof l?this._tmpVec2B.copy(d):typeof d=="object"?this._tmpVec2B.setFromObject(d):this._tmpVec2B.set(d,p);var g=this.getEndPoint(this._tmpVec2A);return this.add(new n([g.x,g.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(d){return d.unshift(this.getEndPoint()),this.add(new s(d))},moveTo:function(d,p){return d instanceof l?this.add(new e(d.x,d.y)):this.add(new e(d,p))},toJSON:function(){for(var d=[],p=0;p{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -893,7 +893,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(8054),v=t(68703),a=[],r=!1,n=function(){var e=function(g,y,x,C,P){y===void 0&&(y=1),x===void 0&&(x=1),C===void 0&&(C=o.CANVAS),P===void 0&&(P=!1);var M,w=s(C);return w===null?(w={parent:g,canvas:document.createElement("canvas"),type:C},C===o.CANVAS&&a.push(w),M=w.canvas):(w.parent=g,M=w.canvas),P&&(w.parent=M),M.width=y,M.height=x,r&&C===o.CANVAS&&v.disable(M.getContext("2d",{willReadFrequently:!1})),M},i=function(g,y,x){return e(g,y,x,o.CANVAS)},h=function(g,y,x){return e(g,y,x,o.WEBGL)},s=function(g){if(g===void 0&&(g=o.CANVAS),g===o.WEBGL)return null;for(var y=0;y{/** + */var o=t(8054),v=t(68703),a=[],r=!1,n=function(){var e=function(g,x,y,C,P){x===void 0&&(x=1),y===void 0&&(y=1),C===void 0&&(C=o.CANVAS),P===void 0&&(P=!1);var M,w=s(C);return w===null?(w={parent:g,canvas:document.createElement("canvas"),type:C},C===o.CANVAS&&a.push(w),M=w.canvas):(w.parent=g,M=w.canvas),P&&(w.parent=M),M.width=x,M.height=y,r&&C===o.CANVAS&&v.disable(M.getContext("2d",{willReadFrequently:!1})),M},i=function(g,x,y){return e(g,x,y,o.CANVAS)},h=function(g,x,y){return e(g,x,y,o.WEBGL)},s=function(g){if(g===void 0&&(g=o.CANVAS),g===o.WEBGL)return null;for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1167,12 +1167,12 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v,a,r,n,e,i,h,s,l,f,u,d,p){var g=v.x-o.displayOriginX+r,y=v.y-o.displayOriginY+n,x=g+v.w,C=y+v.h,P=e.getXRound(g,y,i),M=e.getYRound(g,y,i),w=e.getXRound(g,C,i),I=e.getYRound(g,C,i),L=e.getXRound(x,C,i),B=e.getYRound(x,C,i),N=e.getXRound(x,y,i),G=e.getYRound(x,y,i);t.batchQuad(o,P,M,w,I,L,B,N,G,a.u0,a.v0,a.u1,a.v1,h,s,l,f,u,d,p)};c.exports=m},53048:c=>{/** + */var m=function(t,o,v,a,r,n,e,i,h,s,l,f,u,d,p){var g=v.x-o.displayOriginX+r,x=v.y-o.displayOriginY+n,y=g+v.w,C=x+v.h,P=e.getXRound(g,x,i),M=e.getYRound(g,x,i),w=e.getXRound(g,C,i),I=e.getYRound(g,C,i),L=e.getXRound(y,C,i),B=e.getYRound(y,C,i),N=e.getXRound(y,x,i),G=e.getYRound(y,x,i);t.batchQuad(o,P,M,w,I,L,B,N,G,a.u0,a.v0,a.u1,a.v1,h,s,l,f,u,d,p)};c.exports=m},53048:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v,a){if(v===void 0&&(v=!1),a===void 0)return a={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},a;var r=t.text,n=r.length,e=t.maxWidth,i=t.wordWrapCharCode,h=Number.MAX_VALUE,s=Number.MAX_VALUE,l=0,f=0,u=t.fontData.chars,d=t.fontData.lineHeight,p=t.letterSpacing,g=t.lineSpacing,y=0,x=0,C=0,P=null,M=t._align,w=0,I=0,L=t.fontSize/t.fontData.size,B=L*t.scaleX,N=L*t.scaleY,G=null,V=0,K=[],j=Number.MAX_VALUE,J=0,X=0,Y=0,b,z=[],W=[],H=null;if(e>0){for(b=0;be||vt>e?(et.push(st.i-1),st.cr?(et.push(st.i+st.word.length),k=0,Q=null):Q=st):st.cr&&(et.push(st.i+st.word.length),k=0,Q=null)}var At=function(Qt,fe,ce){return Qt.substr(0,fe)+ce+Qt.substr(fe+1)};for(b=et.length-1;b>=0;b--)r=At(r,et[b],` -`);a.wrappedText=r,n=r.length,z=[],H=null}var Et=0;for(b=0;bJ&&(J=Y),Yw&&(h=w),s>I&&(s=I);var ct=w+P.xAdvance,Ct=I+d;lJ&&(J=Y),Y0)for(var wt=0;wt{/** + */var m=function(t,o,v,a){if(v===void 0&&(v=!1),a===void 0)return a={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},a;var r=t.text,n=r.length,e=t.maxWidth,i=t.wordWrapCharCode,h=Number.MAX_VALUE,s=Number.MAX_VALUE,l=0,f=0,u=t.fontData.chars,d=t.fontData.lineHeight,p=t.letterSpacing,g=t.lineSpacing,x=0,y=0,C=0,P=null,M=t._align,w=0,I=0,L=t.fontSize/t.fontData.size,B=L*t.scaleX,N=L*t.scaleY,G=null,V=0,K=[],j=Number.MAX_VALUE,J=0,X=0,Y=0,b,z=[],W=[],H=null;if(e>0){for(b=0;be||vt>e?(et.push(st.i-1),st.cr?(et.push(st.i+st.word.length),k=0,Q=null):Q=st):st.cr&&(et.push(st.i+st.word.length),k=0,Q=null)}var At=function(Qt,de,ve){return Qt.substr(0,de)+ve+Qt.substr(de+1)};for(b=et.length-1;b>=0;b--)r=At(r,et[b],` +`);a.wrappedText=r,n=r.length,z=[],H=null}var Et=0;for(b=0;bJ&&(J=Y),Yw&&(h=w),s>I&&(s=I);var ct=w+P.xAdvance,Ct=I+d;lJ&&(J=Y),Y0)for(var wt=0;wt{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1180,11 +1180,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(35154),v=function(a,r){var n=r.width,e=r.height,i=Math.floor(n/2),h=Math.floor(e/2),s=o(r,"chars","");if(s!==""){var l=o(r,"image",""),f=a.sys.textures.getFrame(l),u=f.cutX,d=f.cutY,p=f.source.width,g=f.source.height,y=o(r,"offset.x",0),x=o(r,"offset.y",0),C=o(r,"spacing.x",0),P=o(r,"spacing.y",0),M=o(r,"lineSpacing",0),w=o(r,"charsPerRow",null);w===null&&(w=p/n,w>s.length&&(w=s.length));for(var I=y,L=x,B={retroFont:!0,font:l,size:n,lineHeight:e+M,chars:{}},N=0,G=0;G{/** + */var o=t(35154),v=function(a,r){var n=r.width,e=r.height,i=Math.floor(n/2),h=Math.floor(e/2),s=o(r,"chars","");if(s!==""){var l=o(r,"image",""),f=a.sys.textures.getFrame(l),u=f.cutX,d=f.cutY,p=f.source.width,g=f.source.height,x=o(r,"offset.x",0),y=o(r,"offset.y",0),C=o(r,"spacing.x",0),P=o(r,"spacing.y",0),M=o(r,"lineSpacing",0),w=o(r,"charsPerRow",null);w===null&&(w=p/n,w>s.length&&(w=s.length));for(var I=x,L=y,B={retroFont:!0,font:l,size:n,lineHeight:e+M,chars:{}},N=0,G=0;G{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(o,v){return parseInt(o.getAttribute(v),10)}var t=function(o,v,a,r,n){a===void 0&&(a=0),r===void 0&&(r=0);var e=v.cutX,i=v.cutY,h=v.source.width,s=v.source.height,l=v.sourceIndex,f={},u=o.getElementsByTagName("info")[0],d=o.getElementsByTagName("common")[0];f.font=u.getAttribute("face"),f.size=m(u,"size"),f.lineHeight=m(d,"lineHeight")+r,f.chars={};var p=o.getElementsByTagName("char"),g=v!==void 0&&v.trimmed;if(g)var y=v.height,x=v.width;for(var C=0;C{/** + */function m(o,v){return parseInt(o.getAttribute(v),10)}var t=function(o,v,a,r,n){a===void 0&&(a=0),r===void 0&&(r=0);var e=v.cutX,i=v.cutY,h=v.source.width,s=v.source.height,l=v.sourceIndex,f={},u=o.getElementsByTagName("info")[0],d=o.getElementsByTagName("common")[0];f.font=u.getAttribute("face"),f.size=m(u,"size"),f.lineHeight=m(d,"lineHeight")+r,f.chars={};var p=o.getElementsByTagName("char"),g=v!==void 0&&v.trimmed;if(g)var x=v.height,y=v.width;for(var C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1200,7 +1200,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(20926),v=function(a,r,n,e){var i=r._text,h=i.length,s=a.currentContext;if(!(h===0||!o(a,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.displayCallback,u=r.callbackData,d=r.fontData.chars,p=r.fontData.lineHeight,g=r._letterSpacing,y=0,x=0,C=0,P=null,M=0,w=0,I=0,L=0,B=0,N=0,G=null,V=0,K=r.frame.source.image,j=l.cutX,J=l.cutY,X=0,Y=0,b=r._fontSize/r.fontData.size,z=r._align,W=0,H=0;r.getTextBounds(!1);var Z=r._bounds.lines;z===1?H=(Z.longest-Z.lengths[0])/2:z===2&&(H=Z.longest-Z.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);var Q=n.roundPixels;r.cropWidth>0&&r.cropHeight>0&&(s.beginPath(),s.rect(0,0,r.cropWidth,r.cropHeight),s.clip());for(var k=0;k{/** + */var o=t(20926),v=function(a,r,n,e){var i=r._text,h=i.length,s=a.currentContext;if(!(h===0||!o(a,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.displayCallback,u=r.callbackData,d=r.fontData.chars,p=r.fontData.lineHeight,g=r._letterSpacing,x=0,y=0,C=0,P=null,M=0,w=0,I=0,L=0,B=0,N=0,G=null,V=0,K=r.frame.source.image,j=l.cutX,J=l.cutY,X=0,Y=0,b=r._fontSize/r.fontData.size,z=r._align,W=0,H=0;r.getTextBounds(!1);var Z=r._bounds.lines;z===1?H=(Z.longest-Z.lengths[0])/2:z===2&&(H=Z.longest-Z.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);var Q=n.roundPixels;r.cropWidth>0&&r.cropHeight>0&&(s.beginPath(),s.rect(0,0,r.cropWidth,r.cropHeight),s.clip());for(var k=0;k{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1216,16 +1216,16 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(61340),a=t(70554),r=new v,n=function(e,i,h,s){var l=i.text,f=l.length;if(f!==0){h.addToRenderList(i);var u=e.pipelines.set(i.pipeline,i),d=o(i,h,s);e.pipelines.preBatch(i);var p=d.sprite,g=d.calc,y=r,x=i.cropWidth>0||i.cropHeight>0;x&&(u.flush(),e.pushScissor(g.tx,g.ty,i.cropWidth*g.scaleX,i.cropHeight*g.scaleY));var C=i.frame,P=C.glTexture,M=i.tintFill,w=a.getTintAppendFloatAlpha(i.tintTopLeft,h.alpha*i._alphaTL),I=a.getTintAppendFloatAlpha(i.tintTopRight,h.alpha*i._alphaTR),L=a.getTintAppendFloatAlpha(i.tintBottomLeft,h.alpha*i._alphaBL),B=a.getTintAppendFloatAlpha(i.tintBottomRight,h.alpha*i._alphaBR),N=u.setGameObject(i),G=0,V=0,K=0,j=0,J=i.letterSpacing,X,Y=0,b=0,z,W=i.scrollX,H=i.scrollY,Z=i.fontData,Q=Z.chars,k=Z.lineHeight,et=i.fontSize/Z.size,st=0,rt=i._align,ot=0,ft=0,at=i.getTextBounds(!1);i.maxWidth>0&&(l=at.wrappedText,f=l.length);var vt=i._bounds.lines;rt===1?ft=(vt.longest-vt.lengths[0])/2:rt===2&&(ft=vt.longest-vt.lengths[0]);for(var At=h.roundPixels,Et=i.displayCallback,Pt=i.callbackData,ct=0;ct{/** + */var o=t(91296),v=t(61340),a=t(70554),r=new v,n=function(e,i,h,s){var l=i.text,f=l.length;if(f!==0){h.addToRenderList(i);var u=e.pipelines.set(i.pipeline,i),d=o(i,h,s);e.pipelines.preBatch(i);var p=d.sprite,g=d.calc,x=r,y=i.cropWidth>0||i.cropHeight>0;y&&(u.flush(),e.pushScissor(g.tx,g.ty,i.cropWidth*g.scaleX,i.cropHeight*g.scaleY));var C=i.frame,P=C.glTexture,M=i.tintFill,w=a.getTintAppendFloatAlpha(i.tintTopLeft,h.alpha*i._alphaTL),I=a.getTintAppendFloatAlpha(i.tintTopRight,h.alpha*i._alphaTR),L=a.getTintAppendFloatAlpha(i.tintBottomLeft,h.alpha*i._alphaBL),B=a.getTintAppendFloatAlpha(i.tintBottomRight,h.alpha*i._alphaBR),N=u.setGameObject(i),G=0,V=0,K=0,j=0,J=i.letterSpacing,X,Y=0,b=0,z,W=i.scrollX,H=i.scrollY,Z=i.fontData,Q=Z.chars,k=Z.lineHeight,et=i.fontSize/Z.size,st=0,rt=i._align,ot=0,ft=0,at=i.getTextBounds(!1);i.maxWidth>0&&(l=at.wrappedText,f=l.length);var vt=i._bounds.lines;rt===1?ft=(vt.longest-vt.lengths[0])/2:rt===2&&(ft=vt.longest-vt.lengths[0]);for(var At=h.roundPixels,Et=i.displayCallback,Pt=i.callbackData,ct=0;ct{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(45319),a=t(31401),r=t(95643),n=t(53048),e=t(61327),i=t(21859),h=t(87841),s=t(18658),l=new o({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Texture,a.Tint,a.Transform,a.Visible,s],initialize:function(u,d,p,g,y,x,C){y===void 0&&(y=""),C===void 0&&(C=0),r.call(this,u,"BitmapText"),this.font=g;var P=this.scene.sys.cache.bitmapFont.get(g);P||console.warn("Invalid BitmapText key: "+g),this.fontData=P.data,this._text="",this._fontSize=x||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=C,this._bounds=n(),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=P.fromAtlas,this.setTexture(P.texture,P.frame),this.setPosition(d,p),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(y)},setLeftAlign:function(){return this._align=l.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=l.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=l.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(f){return this._fontSize=f,this._dirty=!0,this},setLetterSpacing:function(f){return f===void 0&&(f=0),this._letterSpacing=f,this._dirty=!0,this},setLineSpacing:function(f){return f===void 0&&(f=0),this.lineSpacing=f,this},setText:function(f){return!f&&f!==0&&(f=""),Array.isArray(f)&&(f=f.join(` -`)),f!==this.text&&(this._text=f.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(f,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=.5),this.dropShadowX=f,this.dropShadowY=u,this.dropShadowColor=d,this.dropShadowAlpha=p,this},setCharacterTint:function(f,u,d,p,g,y,x){f===void 0&&(f=0),u===void 0&&(u=1),d===void 0&&(d=!1),p===void 0&&(p=-1),g===void 0&&(g=p,y=p,x=p);var C=this.text.length;u===-1&&(u=C),f<0&&(f=C+f),f=v(f,0,C-1);for(var P=v(f+u,f,C),M=this.charColors,w=f;w{/** + */var o=t(83419),v=t(45319),a=t(31401),r=t(95643),n=t(53048),e=t(61327),i=t(21859),h=t(87841),s=t(18658),l=new o({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Texture,a.Tint,a.Transform,a.Visible,s],initialize:function(u,d,p,g,x,y,C){x===void 0&&(x=""),C===void 0&&(C=0),r.call(this,u,"BitmapText"),this.font=g;var P=this.scene.sys.cache.bitmapFont.get(g);P||console.warn("Invalid BitmapText key: "+g),this.fontData=P.data,this._text="",this._fontSize=y||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=C,this._bounds=n(),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=P.fromAtlas,this.setTexture(P.texture,P.frame),this.setPosition(d,p),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(x)},setLeftAlign:function(){return this._align=l.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=l.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=l.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(f){return this._fontSize=f,this._dirty=!0,this},setLetterSpacing:function(f){return f===void 0&&(f=0),this._letterSpacing=f,this._dirty=!0,this},setLineSpacing:function(f){return f===void 0&&(f=0),this.lineSpacing=f,this},setText:function(f){return!f&&f!==0&&(f=""),Array.isArray(f)&&(f=f.join(` +`)),f!==this.text&&(this._text=f.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(f,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=.5),this.dropShadowX=f,this.dropShadowY=u,this.dropShadowColor=d,this.dropShadowAlpha=p,this},setCharacterTint:function(f,u,d,p,g,x,y){f===void 0&&(f=0),u===void 0&&(u=1),d===void 0&&(d=!1),p===void 0&&(p=-1),g===void 0&&(g=p,x=p,y=p);var C=this.text.length;u===-1&&(u=C),f<0&&(f=C+f),f=v(f,0,C-1);for(var P=v(f+u,f,C),M=this.charColors,w=f;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(20926),v=function(a,r,n,e){var i=r._text,h=i.length,s=a.currentContext;if(!(h===0||!o(a,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.fontData.chars,u=r.fontData.lineHeight,d=r._letterSpacing,p=r._lineSpacing,g=0,y=0,x=0,C=null,P=0,M=0,w=0,I=0,L=0,B=0,N=null,G=0,V=l.source.image,K=l.cutX,j=l.cutY,J=r._fontSize/r.fontData.size,X=r._align,Y=0,b=0,z=r.getTextBounds(!1);r.maxWidth>0&&(i=z.wrappedText,h=i.length);var W=r._bounds.lines;X===1?b=(W.longest-W.lengths[0])/2:X===2&&(b=W.longest-W.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);for(var H=n.roundPixels,Z=0;Z{/** + */var o=t(20926),v=function(a,r,n,e){var i=r._text,h=i.length,s=a.currentContext;if(!(h===0||!o(a,s,r,n,e))){n.addToRenderList(r);var l=r.fromAtlas?r.frame:r.texture.frames.__BASE,f=r.fontData.chars,u=r.fontData.lineHeight,d=r._letterSpacing,p=r._lineSpacing,g=0,x=0,y=0,C=null,P=0,M=0,w=0,I=0,L=0,B=0,N=null,G=0,V=l.source.image,K=l.cutX,j=l.cutY,J=r._fontSize/r.fontData.size,X=r._align,Y=0,b=0,z=r.getTextBounds(!1);r.maxWidth>0&&(i=z.wrappedText,h=i.length);var W=r._bounds.lines;X===1?b=(W.longest-W.lengths[0])/2:X===2&&(b=W.longest-W.lengths[0]),s.translate(-r.displayOriginX,-r.displayOriginY);for(var H=n.roundPixels,Z=0;Z{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1241,7 +1241,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(3217),v=t(91296),a=t(70554),r=function(n,e,i,h){var s=e._text,l=s.length;if(l!==0){i.addToRenderList(e);var f=n.pipelines.set(e.pipeline,e),u=v(e,i,h).calc;n.pipelines.preBatch(e);var d=i.roundPixels,p=i.alpha,g=e.charColors,y=e.tintFill,x=a.getTintAppendFloatAlpha,C=x(e.tintTopLeft,p*e._alphaTL),P=x(e.tintTopRight,p*e._alphaTR),M=x(e.tintBottomLeft,p*e._alphaBL),w=x(e.tintBottomRight,p*e._alphaBR),I=e.frame.glTexture,L=f.setGameObject(e),B=e.getTextBounds(!1),N,G,V,K=B.characters,j=e.dropShadowX,J=e.dropShadowY,X=j!==0||J!==0;if(X){var Y=e.dropShadowColor,b=e.dropShadowAlpha,z=x(Y,p*b*e._alphaTL),W=x(Y,p*b*e._alphaTR),H=x(Y,p*b*e._alphaBL),Z=x(Y,p*b*e._alphaBR);for(N=0;N{/** + */var o=t(3217),v=t(91296),a=t(70554),r=function(n,e,i,h){var s=e._text,l=s.length;if(l!==0){i.addToRenderList(e);var f=n.pipelines.set(e.pipeline,e),u=v(e,i,h).calc;n.pipelines.preBatch(e);var d=i.roundPixels,p=i.alpha,g=e.charColors,x=e.tintFill,y=a.getTintAppendFloatAlpha,C=y(e.tintTopLeft,p*e._alphaTL),P=y(e.tintTopRight,p*e._alphaTR),M=y(e.tintBottomLeft,p*e._alphaBL),w=y(e.tintBottomRight,p*e._alphaBR),I=e.frame.glTexture,L=f.setGameObject(e),B=e.getTextBounds(!1),N,G,V,K=B.characters,j=e.dropShadowX,J=e.dropShadowY,X=j!==0||J!==0;if(X){var Y=e.dropShadowColor,b=e.dropShadowAlpha,z=y(Y,p*b*e._alphaTL),W=y(Y,p*b*e._alphaTR),H=y(Y,p*b*e._alphaBL),Z=y(Y,p*b*e._alphaBR);for(N=0;N{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1249,7 +1249,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v,a){var r=o.getRenderList();if(r.length!==0){var n=t.currentContext,e=v.alpha*o.alpha;if(e!==0){v.addToRenderList(o),n.globalCompositeOperation=t.blendModes[o.blendMode],n.imageSmoothingEnabled=!o.frame.source.scaleMode;var i=o.x-v.scrollX*o.scrollFactorX,h=o.y-v.scrollY*o.scrollFactorY;n.save(),a&&a.copyToContext(n);for(var s=v.roundPixels,l=0;l0&&p.height>0&&(n.save(),n.translate(f.x+i,f.y+h),n.scale(x,C),n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g,y,p.width,p.height),n.restore())):(s&&(g=Math.round(g),y=Math.round(y)),p.width>0&&p.height>0&&n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g+f.x+i,y+f.y+h,p.width,p.height)))}n.restore()}}};c.exports=m},9403:(c,m,t)=>{/** + */var m=function(t,o,v,a){var r=o.getRenderList();if(r.length!==0){var n=t.currentContext,e=v.alpha*o.alpha;if(e!==0){v.addToRenderList(o),n.globalCompositeOperation=t.blendModes[o.blendMode],n.imageSmoothingEnabled=!o.frame.source.scaleMode;var i=o.x-v.scrollX*o.scrollFactorX,h=o.y-v.scrollY*o.scrollFactorY;n.save(),a&&a.copyToContext(n);for(var s=v.roundPixels,l=0;l0&&p.height>0&&(n.save(),n.translate(f.x+i,f.y+h),n.scale(y,C),n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g,x,p.width,p.height),n.restore())):(s&&(g=Math.round(g),x=Math.round(x)),p.width>0&&p.height>0&&n.drawImage(d.source.image,p.x,p.y,p.width,p.height,g+f.x+i,x+f.y+h,p.width,p.height)))}n.restore()}}};c.exports=m},9403:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1265,7 +1265,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(61340),v=t(70554),a=new o,r=function(n,e,i,h){var s=e.getRenderList(),l=i.alpha*e.alpha;if(!(s.length===0||l===0)){i.addToRenderList(e);var f=n.pipelines.set(this.pipeline,e),u=i.scrollX*e.scrollFactorX,d=i.scrollY*e.scrollFactorY,p=a.copyFrom(i.matrix);h&&(p.multiplyWithOffset(h,-u,-d),u=0,d=0);var g=e.x-u,y=e.y-d,x=-1,C=!1;n.pipelines.preBatch(e);for(var P=0;P{/** + */var o=t(61340),v=t(70554),a=new o,r=function(n,e,i,h){var s=e.getRenderList(),l=i.alpha*e.alpha;if(!(s.length===0||l===0)){i.addToRenderList(e);var f=n.pipelines.set(this.pipeline,e),u=i.scrollX*e.scrollFactorX,d=i.scrollY*e.scrollFactorY,p=a.copyFrom(i.matrix);h&&(p.multiplyWithOffset(h,-u,-d),u=0,d=0);var g=e.x-u,x=e.y-d,y=-1,C=!1;n.pipelines.preBatch(e);for(var P=0;P{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1353,11 +1353,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(36383),v=t(61340),a=t(85955),r=t(86554),n=t(30954),e=t(26099),i=4,h={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(s){this._scaleX=s,this._scaleY=s,s===0?this.renderFlags&=~i:this.renderFlags|=i}},scaleX:{get:function(){return this._scaleX},set:function(s){this._scaleX=s,s===0?this.renderFlags&=~i:this._scaleY!==0&&(this.renderFlags|=i)}},scaleY:{get:function(){return this._scaleY},set:function(s){this._scaleY=s,s===0?this.renderFlags&=~i:this._scaleX!==0&&(this.renderFlags|=i)}},angle:{get:function(){return n(this._rotation*o.RAD_TO_DEG)},set:function(s){this.rotation=n(s)*o.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(s){this._rotation=r(s)}},setPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=s),f===void 0&&(f=0),u===void 0&&(u=0),this.x=s,this.y=l,this.z=f,this.w=u,this},copyPosition:function(s){return s.x!==void 0&&(this.x=s.x),s.y!==void 0&&(this.y=s.y),s.z!==void 0&&(this.z=s.z),s.w!==void 0&&(this.w=s.w),this},setRandomPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),this.x=s+Math.random()*f,this.y=l+Math.random()*u,this},setRotation:function(s){return s===void 0&&(s=0),this.rotation=s,this},setAngle:function(s){return s===void 0&&(s=0),this.angle=s,this},setScale:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=s),this.scaleX=s,this.scaleY=l,this},setX:function(s){return s===void 0&&(s=0),this.x=s,this},setY:function(s){return s===void 0&&(s=0),this.y=s,this},setZ:function(s){return s===void 0&&(s=0),this.z=s,this},setW:function(s){return s===void 0&&(s=0),this.w=s,this},getLocalTransformMatrix:function(s){return s===void 0&&(s=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(s,l){s===void 0&&(s=new v);var f=this.parentContainer;if(!f)return this.getLocalTransformMatrix(s);for(l||(l=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);f;)l.applyITRS(f.x,f.y,f._rotation,f._scaleX,f._scaleY),l.multiply(s,s),f=f.parentContainer;return s},getLocalPoint:function(s,l,f,u){f||(f=new e),u||(u=this.scene.sys.cameras.main);var d=u.scrollX,p=u.scrollY,g=s+d*this.scrollFactorX-d,y=l+p*this.scrollFactorY-p;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(g,y,f):a(g,y,this.x,this.y,this.rotation,this.scaleX,this.scaleY,f),this._originComponent&&(f.x+=this._displayOriginX,f.y+=this._displayOriginY),f},getParentRotation:function(){for(var s=0,l=this.parentContainer;l;)s+=l.rotation,l=l.parentContainer;return s}};c.exports=h},61340:(c,m,t)=>{/** + */var o=t(36383),v=t(61340),a=t(85955),r=t(86554),n=t(30954),e=t(26099),i=4,h={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(s){this._scaleX=s,this._scaleY=s,s===0?this.renderFlags&=~i:this.renderFlags|=i}},scaleX:{get:function(){return this._scaleX},set:function(s){this._scaleX=s,s===0?this.renderFlags&=~i:this._scaleY!==0&&(this.renderFlags|=i)}},scaleY:{get:function(){return this._scaleY},set:function(s){this._scaleY=s,s===0?this.renderFlags&=~i:this._scaleX!==0&&(this.renderFlags|=i)}},angle:{get:function(){return n(this._rotation*o.RAD_TO_DEG)},set:function(s){this.rotation=n(s)*o.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(s){this._rotation=r(s)}},setPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=s),f===void 0&&(f=0),u===void 0&&(u=0),this.x=s,this.y=l,this.z=f,this.w=u,this},copyPosition:function(s){return s.x!==void 0&&(this.x=s.x),s.y!==void 0&&(this.y=s.y),s.z!==void 0&&(this.z=s.z),s.w!==void 0&&(this.w=s.w),this},setRandomPosition:function(s,l,f,u){return s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=this.scene.sys.scale.width),u===void 0&&(u=this.scene.sys.scale.height),this.x=s+Math.random()*f,this.y=l+Math.random()*u,this},setRotation:function(s){return s===void 0&&(s=0),this.rotation=s,this},setAngle:function(s){return s===void 0&&(s=0),this.angle=s,this},setScale:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=s),this.scaleX=s,this.scaleY=l,this},setX:function(s){return s===void 0&&(s=0),this.x=s,this},setY:function(s){return s===void 0&&(s=0),this.y=s,this},setZ:function(s){return s===void 0&&(s=0),this.z=s,this},setW:function(s){return s===void 0&&(s=0),this.w=s,this},getLocalTransformMatrix:function(s){return s===void 0&&(s=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(s,l){s===void 0&&(s=new v);var f=this.parentContainer;if(!f)return this.getLocalTransformMatrix(s);for(l||(l=new v),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);f;)l.applyITRS(f.x,f.y,f._rotation,f._scaleX,f._scaleY),l.multiply(s,s),f=f.parentContainer;return s},getLocalPoint:function(s,l,f,u){f||(f=new e),u||(u=this.scene.sys.cameras.main);var d=u.scrollX,p=u.scrollY,g=s+d*this.scrollFactorX-d,x=l+p*this.scrollFactorY-p;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(g,x,f):a(g,x,this.x,this.y,this.rotation,this.scaleX,this.scaleY,f),this._originComponent&&(f.x+=this._displayOriginX,f.y+=this._displayOriginY),f},getParentRotation:function(){for(var s=0,l=this.parentContainer;l;)s+=l.rotation,l=l.parentContainer;return s}};c.exports=h},61340:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(36383),a=t(26099),r=new o({initialize:function(e,i,h,s,l,f){e===void 0&&(e=1),i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=1),l===void 0&&(l=0),f===void 0&&(f=0),this.matrix=new Float32Array([e,i,h,s,l,f,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(n){this.matrix[0]=n}},b:{get:function(){return this.matrix[1]},set:function(n){this.matrix[1]=n}},c:{get:function(){return this.matrix[2]},set:function(n){this.matrix[2]=n}},d:{get:function(){return this.matrix[3]},set:function(n){this.matrix[3]=n}},e:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},f:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},tx:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},ty:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var n=this.matrix,e=n[0],i=n[1],h=n[2],s=n[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):h||s?v.TAU-(s>0?Math.acos(-h/this.scaleY):-Math.acos(h/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 n=this.matrix;return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,this},translate:function(n,e){var i=this.matrix;return i[4]=i[0]*n+i[2]*e+i[4],i[5]=i[1]*n+i[3]*e+i[5],this},scale:function(n,e){var i=this.matrix;return i[0]*=n,i[1]*=n,i[2]*=e,i[3]*=e,this},rotate:function(n){var e=Math.sin(n),i=Math.cos(n),h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3];return h[0]=s*i+f*e,h[1]=l*i+u*e,h[2]=s*-e+f*i,h[3]=l*-e+u*i,this},multiply:function(n,e){var i=this.matrix,h=n.matrix,s=i[0],l=i[1],f=i[2],u=i[3],d=i[4],p=i[5],g=h[0],y=h[1],x=h[2],C=h[3],P=h[4],M=h[5],w=e===void 0?i:e.matrix;return w[0]=g*s+y*f,w[1]=g*l+y*u,w[2]=x*s+C*f,w[3]=x*l+C*u,w[4]=P*s+M*f+d,w[5]=P*l+M*u+p,w},multiplyWithOffset:function(n,e,i){var h=this.matrix,s=n.matrix,l=h[0],f=h[1],u=h[2],d=h[3],p=h[4],g=h[5],y=e*l+i*u+p,x=e*f+i*d+g,C=s[0],P=s[1],M=s[2],w=s[3],I=s[4],L=s[5];return h[0]=C*l+P*u,h[1]=C*f+P*d,h[2]=M*l+w*u,h[3]=M*f+w*d,h[4]=I*l+L*u+y,h[5]=I*f+L*d+x,this},transform:function(n,e,i,h,s,l){var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5];return f[0]=n*u+e*p,f[1]=n*d+e*g,f[2]=i*u+h*p,f[3]=i*d+h*g,f[4]=s*u+l*p+y,f[5]=s*d+l*g+x,this},transformPoint:function(n,e,i){i===void 0&&(i={x:0,y:0});var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5];return i.x=n*s+e*f+d,i.y=n*l+e*u+p,i},invert:function(){var n=this.matrix,e=n[0],i=n[1],h=n[2],s=n[3],l=n[4],f=n[5],u=e*s-i*h;return n[0]=s/u,n[1]=-i/u,n[2]=-h/u,n[3]=e/u,n[4]=(h*f-s*l)/u,n[5]=-(e*f-i*l)/u,this},copyFrom:function(n){var e=this.matrix;return e[0]=n.a,e[1]=n.b,e[2]=n.c,e[3]=n.d,e[4]=n.e,e[5]=n.f,this},copyFromArray:function(n){var e=this.matrix;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],this},copyToContext:function(n){var e=this.matrix;return n.transform(e[0],e[1],e[2],e[3],e[4],e[5]),n},setToContext:function(n){return n.setTransform(this),n},copyToArray:function(n){var e=this.matrix;return n===void 0?n=[e[0],e[1],e[2],e[3],e[4],e[5]]:(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5]),n},setTransform:function(n,e,i,h,s,l){var f=this.matrix;return f[0]=n,f[1]=e,f[2]=i,f[3]=h,f[4]=s,f[5]=l,this},decomposeMatrix:function(){var n=this.decomposedMatrix,e=this.matrix,i=e[0],h=e[1],s=e[2],l=e[3],f=i*l-h*s;if(n.translateX=e[4],n.translateY=e[5],i||h){var u=Math.sqrt(i*i+h*h);n.rotation=h>0?Math.acos(i/u):-Math.acos(i/u),n.scaleX=u,n.scaleY=f/u}else if(s||l){var d=Math.sqrt(s*s+l*l);n.rotation=Math.PI*.5-(l>0?Math.acos(-s/d):-Math.acos(s/d)),n.scaleX=f/d,n.scaleY=d}else n.rotation=0,n.scaleX=0,n.scaleY=0;return n},applyITRS:function(n,e,i,h,s){var l=this.matrix,f=Math.sin(i),u=Math.cos(i);return l[4]=n,l[5]=e,l[0]=u*h,l[1]=f*h,l[2]=-f*s,l[3]=u*s,this},applyInverse:function(n,e,i){i===void 0&&(i=new a);var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5],g=1/(s*u+f*-l);return i.x=u*g*n+-f*g*e+(p*f-d*u)*g,i.y=s*g*e+-l*g*n+(-p*s+d*l)*g,i},setQuad:function(n,e,i,h,s,l){s===void 0&&(s=!1),l===void 0&&(l=this.quad);var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5];return s?(l[0]=Math.round(n*u+e*p+y),l[1]=Math.round(n*d+e*g+x),l[2]=Math.round(n*u+h*p+y),l[3]=Math.round(n*d+h*g+x),l[4]=Math.round(i*u+h*p+y),l[5]=Math.round(i*d+h*g+x),l[6]=Math.round(i*u+e*p+y),l[7]=Math.round(i*d+e*g+x)):(l[0]=n*u+e*p+y,l[1]=n*d+e*g+x,l[2]=n*u+h*p+y,l[3]=n*d+h*g+x,l[4]=i*u+h*p+y,l[5]=i*d+h*g+x,l[6]=i*u+e*p+y,l[7]=i*d+e*g+x),l},getX:function(n,e){return n*this.a+e*this.c+this.e},getY:function(n,e){return n*this.b+e*this.d+this.f},getXRound:function(n,e,i){var h=this.getX(n,e);return i&&(h=Math.round(h)),h},getYRound:function(n,e,i){var h=this.getY(n,e);return i&&(h=Math.round(h)),h},getCSSMatrix:function(){var n=this.matrix;return"matrix("+n[0]+","+n[1]+","+n[2]+","+n[3]+","+n[4]+","+n[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});c.exports=r},59715:c=>{/** + */var o=t(83419),v=t(36383),a=t(26099),r=new o({initialize:function(e,i,h,s,l,f){e===void 0&&(e=1),i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=1),l===void 0&&(l=0),f===void 0&&(f=0),this.matrix=new Float32Array([e,i,h,s,l,f,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(n){this.matrix[0]=n}},b:{get:function(){return this.matrix[1]},set:function(n){this.matrix[1]=n}},c:{get:function(){return this.matrix[2]},set:function(n){this.matrix[2]=n}},d:{get:function(){return this.matrix[3]},set:function(n){this.matrix[3]=n}},e:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},f:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},tx:{get:function(){return this.matrix[4]},set:function(n){this.matrix[4]=n}},ty:{get:function(){return this.matrix[5]},set:function(n){this.matrix[5]=n}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var n=this.matrix,e=n[0],i=n[1],h=n[2],s=n[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):h||s?v.TAU-(s>0?Math.acos(-h/this.scaleY):-Math.acos(h/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 n=this.matrix;return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n[4]=0,n[5]=0,this},translate:function(n,e){var i=this.matrix;return i[4]=i[0]*n+i[2]*e+i[4],i[5]=i[1]*n+i[3]*e+i[5],this},scale:function(n,e){var i=this.matrix;return i[0]*=n,i[1]*=n,i[2]*=e,i[3]*=e,this},rotate:function(n){var e=Math.sin(n),i=Math.cos(n),h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3];return h[0]=s*i+f*e,h[1]=l*i+u*e,h[2]=s*-e+f*i,h[3]=l*-e+u*i,this},multiply:function(n,e){var i=this.matrix,h=n.matrix,s=i[0],l=i[1],f=i[2],u=i[3],d=i[4],p=i[5],g=h[0],x=h[1],y=h[2],C=h[3],P=h[4],M=h[5],w=e===void 0?i:e.matrix;return w[0]=g*s+x*f,w[1]=g*l+x*u,w[2]=y*s+C*f,w[3]=y*l+C*u,w[4]=P*s+M*f+d,w[5]=P*l+M*u+p,w},multiplyWithOffset:function(n,e,i){var h=this.matrix,s=n.matrix,l=h[0],f=h[1],u=h[2],d=h[3],p=h[4],g=h[5],x=e*l+i*u+p,y=e*f+i*d+g,C=s[0],P=s[1],M=s[2],w=s[3],I=s[4],L=s[5];return h[0]=C*l+P*u,h[1]=C*f+P*d,h[2]=M*l+w*u,h[3]=M*f+w*d,h[4]=I*l+L*u+x,h[5]=I*f+L*d+y,this},transform:function(n,e,i,h,s,l){var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],x=f[4],y=f[5];return f[0]=n*u+e*p,f[1]=n*d+e*g,f[2]=i*u+h*p,f[3]=i*d+h*g,f[4]=s*u+l*p+x,f[5]=s*d+l*g+y,this},transformPoint:function(n,e,i){i===void 0&&(i={x:0,y:0});var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5];return i.x=n*s+e*f+d,i.y=n*l+e*u+p,i},invert:function(){var n=this.matrix,e=n[0],i=n[1],h=n[2],s=n[3],l=n[4],f=n[5],u=e*s-i*h;return n[0]=s/u,n[1]=-i/u,n[2]=-h/u,n[3]=e/u,n[4]=(h*f-s*l)/u,n[5]=-(e*f-i*l)/u,this},copyFrom:function(n){var e=this.matrix;return e[0]=n.a,e[1]=n.b,e[2]=n.c,e[3]=n.d,e[4]=n.e,e[5]=n.f,this},copyFromArray:function(n){var e=this.matrix;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],this},copyToContext:function(n){var e=this.matrix;return n.transform(e[0],e[1],e[2],e[3],e[4],e[5]),n},setToContext:function(n){return n.setTransform(this),n},copyToArray:function(n){var e=this.matrix;return n===void 0?n=[e[0],e[1],e[2],e[3],e[4],e[5]]:(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5]),n},setTransform:function(n,e,i,h,s,l){var f=this.matrix;return f[0]=n,f[1]=e,f[2]=i,f[3]=h,f[4]=s,f[5]=l,this},decomposeMatrix:function(){var n=this.decomposedMatrix,e=this.matrix,i=e[0],h=e[1],s=e[2],l=e[3],f=i*l-h*s;if(n.translateX=e[4],n.translateY=e[5],i||h){var u=Math.sqrt(i*i+h*h);n.rotation=h>0?Math.acos(i/u):-Math.acos(i/u),n.scaleX=u,n.scaleY=f/u}else if(s||l){var d=Math.sqrt(s*s+l*l);n.rotation=Math.PI*.5-(l>0?Math.acos(-s/d):-Math.acos(s/d)),n.scaleX=f/d,n.scaleY=d}else n.rotation=0,n.scaleX=0,n.scaleY=0;return n},applyITRS:function(n,e,i,h,s){var l=this.matrix,f=Math.sin(i),u=Math.cos(i);return l[4]=n,l[5]=e,l[0]=u*h,l[1]=f*h,l[2]=-f*s,l[3]=u*s,this},applyInverse:function(n,e,i){i===void 0&&(i=new a);var h=this.matrix,s=h[0],l=h[1],f=h[2],u=h[3],d=h[4],p=h[5],g=1/(s*u+f*-l);return i.x=u*g*n+-f*g*e+(p*f-d*u)*g,i.y=s*g*e+-l*g*n+(-p*s+d*l)*g,i},setQuad:function(n,e,i,h,s,l){s===void 0&&(s=!1),l===void 0&&(l=this.quad);var f=this.matrix,u=f[0],d=f[1],p=f[2],g=f[3],x=f[4],y=f[5];return s?(l[0]=Math.round(n*u+e*p+x),l[1]=Math.round(n*d+e*g+y),l[2]=Math.round(n*u+h*p+x),l[3]=Math.round(n*d+h*g+y),l[4]=Math.round(i*u+h*p+x),l[5]=Math.round(i*d+h*g+y),l[6]=Math.round(i*u+e*p+x),l[7]=Math.round(i*d+e*g+y)):(l[0]=n*u+e*p+x,l[1]=n*d+e*g+y,l[2]=n*u+h*p+x,l[3]=n*d+h*g+y,l[4]=i*u+h*p+x,l[5]=i*d+h*g+y,l[6]=i*u+e*p+x,l[7]=i*d+e*g+y),l},getX:function(n,e){return n*this.a+e*this.c+this.e},getY:function(n,e){return n*this.b+e*this.d+this.f},getXRound:function(n,e,i){var h=this.getX(n,e);return i&&(h=Math.round(h)),h},getYRound:function(n,e,i){var h=this.getY(n,e);return i&&(h=Math.round(h)),h},getCSSMatrix:function(){var n=this.matrix;return"matrix("+n[0]+","+n[1]+","+n[2]+","+n[3]+","+n[4]+","+n[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});c.exports=r},59715:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1370,7 +1370,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(37105),v=t(10312),a=t(83419),r=t(31401),n=t(51708),e=t(95643),i=t(87841),h=t(29959),s=t(36899),l=t(26099),f=new a({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.ComputedSize,r.Depth,r.Mask,r.PostPipeline,r.Transform,r.Visible,h],initialize:function(d,p,g,y){e.call(this,d,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new r.TransformMatrix,this.tempTransformMatrix=new r.TransformMatrix,this._sortKey="",this._sysEvents=d.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(p,g),this.setBlendMode(v.SKIP_CHECK),y&&this.add(y)},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this.width*.5}},displayOriginY:{get:function(){return this.height*.5}},setExclusive:function(u){return u===void 0&&(u=!0),this.exclusive=u,this},getBounds:function(u){if(u===void 0&&(u=new i),u.setTo(this.x,this.y,0,0),this.parentContainer){var d=this.parentContainer.getBoundsTransformMatrix(),p=d.transformPoint(this.x,this.y);u.setTo(p.x,p.y,0,0)}if(this.list.length>0){var g=this.list,y=new i,x=!1;u.setEmpty();for(var C=0;C-1},setAll:function(u,d,p,g){return o.SetAll(this.list,u,d,p,g),this},each:function(u,d){var p=[null],g,y=this.list.slice(),x=y.length;for(g=2;g0?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(u){o.Remove(this.list,u),this.exclusive&&(u.parentContainer=null,u.removedFromScene())}});c.exports=f},53584:c=>{/** + */var o=t(37105),v=t(10312),a=t(83419),r=t(31401),n=t(51708),e=t(95643),i=t(87841),h=t(29959),s=t(36899),l=t(26099),f=new a({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.ComputedSize,r.Depth,r.Mask,r.PostPipeline,r.Transform,r.Visible,h],initialize:function(d,p,g,x){e.call(this,d,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new r.TransformMatrix,this.tempTransformMatrix=new r.TransformMatrix,this._sortKey="",this._sysEvents=d.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(p,g),this.setBlendMode(v.SKIP_CHECK),x&&this.add(x)},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this.width*.5}},displayOriginY:{get:function(){return this.height*.5}},setExclusive:function(u){return u===void 0&&(u=!0),this.exclusive=u,this},getBounds:function(u){if(u===void 0&&(u=new i),u.setTo(this.x,this.y,0,0),this.parentContainer){var d=this.parentContainer.getBoundsTransformMatrix(),p=d.transformPoint(this.x,this.y);u.setTo(p.x,p.y,0,0)}if(this.list.length>0){var g=this.list,x=new i,y=!1;u.setEmpty();for(var C=0;C-1},setAll:function(u,d,p,g){return o.SetAll(this.list,u,d,p,g),this},each:function(u,d){var p=[null],g,x=this.list.slice(),y=x.length;for(g=2;g0?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(u){o.Remove(this.list,u),this.exclusive&&(u.parentContainer=null,u.removedFromScene())}});c.exports=f},53584:c=>{/** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. @@ -1395,7 +1395,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v,a){v.addToRenderList(o);var r=o.list,n=r.length;if(n!==0){var e=o.localTransform;a?(e.loadIdentity(),e.multiply(a),e.translate(o.x,o.y),e.rotate(o.rotation),e.scale(o.scaleX,o.scaleY)):e.applyITRS(o.x,o.y,o.rotation,o.scaleX,o.scaleY),t.pipelines.preBatch(o);var i=o.blendMode!==-1;i||t.setBlendMode(0);for(var h=o.alpha,s=o.scrollFactorX,l=o.scrollFactorY,f=0;f{/** + */var m=function(t,o,v,a){v.addToRenderList(o);var r=o.list,n=r.length;if(n!==0){var e=o.localTransform;a?(e.loadIdentity(),e.multiply(a),e.translate(o.x,o.y),e.rotate(o.rotation),e.scale(o.scaleX,o.scaleY)):e.applyITRS(o.x,o.y,o.rotation,o.scaleX,o.scaleY),t.pipelines.preBatch(o);var i=o.blendMode!==-1;i||t.setBlendMode(0);for(var h=o.alpha,s=o.scrollFactorX,l=o.scrollFactorY,f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1403,11 +1403,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(441),r=t(95643),n=t(41212),e=t(35846),i=t(44594),h=t(61369),s=new o({Extends:r,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Origin,v.ScrollFactor,v.Transform,v.Visible,a],initialize:function(f,u,d,p,g,y){r.call(this,f,"DOMElement"),this.parent=f.sys.game.domContainer,this.cache=f.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new h,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(u,d),typeof p=="string"?p[0]==="#"?this.setElement(p.substr(1),g,y):this.createElement(p,g,y):p&&this.setElement(p,g,y),f.sys.events.on(i.SLEEP,this.handleSceneEvent,this),f.sys.events.on(i.WAKE,this.handleSceneEvent,this),f.sys.events.on(i.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(l){var f=this.node,u=f.style;f&&(u.display=l.settings.visible?"block":"none")},setSkew:function(l,f){return l===void 0&&(l=0),f===void 0&&(f=l),this.skewX=l,this.skewY=f,this},setPerspective:function(l){return this.parent.style.perspective=l+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(l){this.parent.style.perspective=l+"px"}},addListener:function(l){if(this.node){l=l.split(" ");for(var f=0;f{/** + */var o=t(83419),v=t(31401),a=t(441),r=t(95643),n=t(41212),e=t(35846),i=t(44594),h=t(61369),s=new o({Extends:r,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Origin,v.ScrollFactor,v.Transform,v.Visible,a],initialize:function(f,u,d,p,g,x){r.call(this,f,"DOMElement"),this.parent=f.sys.game.domContainer,this.cache=f.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new h,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(u,d),typeof p=="string"?p[0]==="#"?this.setElement(p.substr(1),g,x):this.createElement(p,g,x):p&&this.setElement(p,g,x),f.sys.events.on(i.SLEEP,this.handleSceneEvent,this),f.sys.events.on(i.WAKE,this.handleSceneEvent,this),f.sys.events.on(i.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(l){var f=this.node,u=f.style;f&&(u.display=l.settings.visible?"block":"none")},setSkew:function(l,f){return l===void 0&&(l=0),f===void 0&&(f=l),this.skewX=l,this.skewY=f,this},setPerspective:function(l){return this.parent.style.perspective=l+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(l){this.parent.style.perspective=l+"px"}},addListener:function(l){if(this.node){l=l.split(" ");for(var f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(47407),v=t(95643),a=t(61340),r=new a,n=new a,e=new a,i=function(h,s,l,f){if(s.node){var u=s.node.style,d=s.scene.sys.settings;if(!u||!d.visible||v.RENDER_MASK!==s.renderFlags||s.cameraFilter!==0&&s.cameraFilter&l.id||s.parentContainer&&!s.parentContainer.willRender()){u.display="none";return}var p=s.parentContainer,g=l.alpha*s.alpha;p&&(g*=p.alpha);var y=r,x=n,C=e,P=0,M=0,w="0%",I="0%";f?(P=s.width*s.scaleX*s.originX,M=s.height*s.scaleY*s.originY,x.applyITRS(s.x-P,s.y-M,s.rotation,s.scaleX,s.scaleY),y.copyFrom(l.matrix),y.multiplyWithOffset(f,-l.scrollX*s.scrollFactorX,-l.scrollY*s.scrollFactorY),x.e=s.x-P,x.f=s.y-M,y.multiply(x,C)):(P=s.width*s.originX,M=s.height*s.originY,x.applyITRS(s.x-P,s.y-M,s.rotation,s.scaleX,s.scaleY),y.copyFrom(l.matrix),w=100*s.originX+"%",I=100*s.originY+"%",x.e-=l.scrollX*s.scrollFactorX,x.f-=l.scrollY*s.scrollFactorY,y.multiply(x,C)),s.transformOnly||(u.display="block",u.opacity=g,u.zIndex=s._depth,u.pointerEvents=s.pointerEvents,u.mixBlendMode=o[s._blendMode]),u.transform=C.getCSSMatrix()+" skew("+s.skewX+"rad, "+s.skewY+"rad) rotate3d("+s.rotate3d.x+","+s.rotate3d.y+","+s.rotate3d.z+","+s.rotate3d.w+s.rotate3dAngle+")",u.transformOrigin=w+" "+I}};c.exports=i},2611:(c,m,t)=>{/** + */var o=t(47407),v=t(95643),a=t(61340),r=new a,n=new a,e=new a,i=function(h,s,l,f){if(s.node){var u=s.node.style,d=s.scene.sys.settings;if(!u||!d.visible||v.RENDER_MASK!==s.renderFlags||s.cameraFilter!==0&&s.cameraFilter&l.id||s.parentContainer&&!s.parentContainer.willRender()){u.display="none";return}var p=s.parentContainer,g=l.alpha*s.alpha;p&&(g*=p.alpha);var x=r,y=n,C=e,P=0,M=0,w="0%",I="0%";f?(P=s.width*s.scaleX*s.originX,M=s.height*s.scaleY*s.originY,y.applyITRS(s.x-P,s.y-M,s.rotation,s.scaleX,s.scaleY),x.copyFrom(l.matrix),x.multiplyWithOffset(f,-l.scrollX*s.scrollFactorX,-l.scrollY*s.scrollFactorY),y.e=s.x-P,y.f=s.y-M,x.multiply(y,C)):(P=s.width*s.originX,M=s.height*s.originY,y.applyITRS(s.x-P,s.y-M,s.rotation,s.scaleX,s.scaleY),x.copyFrom(l.matrix),w=100*s.originX+"%",I=100*s.originY+"%",y.e-=l.scrollX*s.scrollFactorX,y.f-=l.scrollY*s.scrollFactorY,x.multiply(y,C)),s.transformOnly||(u.display="block",u.opacity=g,u.zIndex=s._depth,u.pointerEvents=s.pointerEvents,u.mixBlendMode=o[s._blendMode]),u.transform=C.getCSSMatrix()+" skew("+s.skewX+"rad, "+s.skewY+"rad) rotate3d("+s.rotate3d.x+","+s.rotate3d.y+","+s.rotate3d.z+","+s.rotate3d.w+s.rotate3dAngle+")",u.transformOrigin=w+" "+I}};c.exports=i},2611:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1515,11 +1515,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(71911),v=t(83419),a=t(85592),r=t(31401),n=t(8497),e=t(95643),i=t(95540),h=t(35154),s=t(36383),l=t(84503),f=new v({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,l],initialize:function(d,p){var g=h(p,"x",0),y=h(p,"y",0);e.call(this,d,"Graphics"),this.setPosition(g,y),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(p)},setDefaultStyles:function(u){return h(u,"lineStyle",null)&&(this.defaultStrokeWidth=h(u,"lineStyle.width",1),this.defaultStrokeColor=h(u,"lineStyle.color",16777215),this.defaultStrokeAlpha=h(u,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),h(u,"fillStyle",null)&&(this.defaultFillColor=h(u,"fillStyle.color",16777215),this.defaultFillAlpha=h(u,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(u,d,p){return p===void 0&&(p=1),this.commandBuffer.push(a.LINE_STYLE,u,d,p),this._lineWidth=u,this},fillStyle:function(u,d){return d===void 0&&(d=1),this.commandBuffer.push(a.FILL_STYLE,u,d),this},fillGradientStyle:function(u,d,p,g,y,x,C,P){return y===void 0&&(y=1),x===void 0&&(x=y),C===void 0&&(C=y),P===void 0&&(P=y),this.commandBuffer.push(a.GRADIENT_FILL_STYLE,y,x,C,P,u,d,p,g),this},lineGradientStyle:function(u,d,p,g,y,x){return x===void 0&&(x=1),this.commandBuffer.push(a.GRADIENT_LINE_STYLE,u,x,d,p,g,y),this},beginPath:function(){return this.commandBuffer.push(a.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(a.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(a.FILL_PATH),this},fill:function(){return this.commandBuffer.push(a.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(a.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(a.STROKE_PATH),this},fillCircleShape:function(u){return this.fillCircle(u.x,u.y,u.radius)},strokeCircleShape:function(u){return this.strokeCircle(u.x,u.y,u.radius)},fillCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.fillPath(),this},strokeCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.strokePath(),this},fillRectShape:function(u){return this.fillRect(u.x,u.y,u.width,u.height)},strokeRectShape:function(u){return this.strokeRect(u.x,u.y,u.width,u.height)},fillRect:function(u,d,p,g){return this.commandBuffer.push(a.FILL_RECT,u,d,p,g),this},strokeRect:function(u,d,p,g){var y=this._lineWidth/2,x=u-y,C=u+y;return this.beginPath(),this.moveTo(u,d),this.lineTo(u,d+g),this.strokePath(),this.beginPath(),this.moveTo(u+p,d),this.lineTo(u+p,d+g),this.strokePath(),this.beginPath(),this.moveTo(x,d),this.lineTo(C+p,d),this.strokePath(),this.beginPath(),this.moveTo(x,d+g),this.lineTo(C+p,d+g),this.strokePath(),this},fillRoundedRect:function(u,d,p,g,y){y===void 0&&(y=20);var x=y,C=y,P=y,M=y;typeof y!="number"&&(x=i(y,"tl",20),C=i(y,"tr",20),P=i(y,"bl",20),M=i(y,"br",20));var w=x>=0,I=C>=0,L=P>=0,B=M>=0;return x=Math.abs(x),C=Math.abs(C),P=Math.abs(P),M=Math.abs(M),this.beginPath(),this.moveTo(u+x,d),this.lineTo(u+p-C,d),I?this.arc(u+p-C,d+C,C,-s.TAU,0):this.arc(u+p,d,C,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),B?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+P,d+g),L?this.arc(u+P,d+g-P,P,s.TAU,Math.PI):this.arc(u,d+g,P,0,-s.TAU,!0),this.lineTo(u,d+x),w?this.arc(u+x,d+x,x,-Math.PI,-s.TAU):this.arc(u,d,x,s.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(u,d,p,g,y){y===void 0&&(y=20);var x=y,C=y,P=y,M=y,w=Math.min(p,g)/2;typeof y!="number"&&(x=i(y,"tl",20),C=i(y,"tr",20),P=i(y,"bl",20),M=i(y,"br",20));var I=x>=0,L=C>=0,B=P>=0,N=M>=0;return x=Math.min(Math.abs(x),w),C=Math.min(Math.abs(C),w),P=Math.min(Math.abs(P),w),M=Math.min(Math.abs(M),w),this.beginPath(),this.moveTo(u+x,d),this.lineTo(u+p-C,d),this.moveTo(u+p-C,d),L?this.arc(u+p-C,d+C,C,-s.TAU,0):this.arc(u+p,d,C,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),this.moveTo(u+p,d+g-M),N?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+P,d+g),this.moveTo(u+P,d+g),B?this.arc(u+P,d+g-P,P,s.TAU,Math.PI):this.arc(u,d+g,P,0,-s.TAU,!0),this.lineTo(u,d+x),this.moveTo(u,d+x),I?this.arc(u+x,d+x,x,-Math.PI,-s.TAU):this.arc(u,d,x,s.TAU,0,!0),this.strokePath(),this},fillPointShape:function(u,d){return this.fillPoint(u.x,u.y,d)},fillPoint:function(u,d,p){return!p||p<1?p=1:(u-=p/2,d-=p/2),this.commandBuffer.push(a.FILL_RECT,u,d,p,p),this},fillTriangleShape:function(u){return this.fillTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},strokeTriangleShape:function(u){return this.strokeTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},fillTriangle:function(u,d,p,g,y,x){return this.commandBuffer.push(a.FILL_TRIANGLE,u,d,p,g,y,x),this},strokeTriangle:function(u,d,p,g,y,x){return this.commandBuffer.push(a.STROKE_TRIANGLE,u,d,p,g,y,x),this},strokeLineShape:function(u){return this.lineBetween(u.x1,u.y1,u.x2,u.y2)},lineBetween:function(u,d,p,g){return this.beginPath(),this.moveTo(u,d),this.lineTo(p,g),this.strokePath(),this},lineTo:function(u,d){return this.commandBuffer.push(a.LINE_TO,u,d),this},moveTo:function(u,d){return this.commandBuffer.push(a.MOVE_TO,u,d),this},strokePoints:function(u,d,p,g){d===void 0&&(d=!1),p===void 0&&(p=!1),g===void 0&&(g=u.length),this.beginPath(),this.moveTo(u[0].x,u[0].y);for(var y=1;y-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(u,d,p){var g=this.scene.sys,y=g.game.renderer;d===void 0&&(d=g.scale.width),p===void 0&&(p=g.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,d,p),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var x,C,P={willReadFrequently:!0};if(typeof u=="string")if(g.textures.exists(u)){x=g.textures.get(u);var M=x.getSourceImage();M instanceof HTMLCanvasElement&&(C=M.getContext("2d",P))}else x=g.textures.createCanvas(u,d,p),C=x.getSourceImage().getContext("2d",P);else u instanceof HTMLCanvasElement&&(C=u.getContext("2d",P));return C&&(this.renderCanvas(y,this,f.TargetCamera,null,C,!1),x&&x.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new o,c.exports=f},32768:(c,m,t)=>{/** + */var o=t(71911),v=t(83419),a=t(85592),r=t(31401),n=t(8497),e=t(95643),i=t(95540),h=t(35154),s=t(36383),l=t(84503),f=new v({Extends:e,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.PostPipeline,r.Transform,r.Visible,r.ScrollFactor,l],initialize:function(d,p){var g=h(p,"x",0),x=h(p,"y",0);e.call(this,d,"Graphics"),this.setPosition(g,x),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(p)},setDefaultStyles:function(u){return h(u,"lineStyle",null)&&(this.defaultStrokeWidth=h(u,"lineStyle.width",1),this.defaultStrokeColor=h(u,"lineStyle.color",16777215),this.defaultStrokeAlpha=h(u,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),h(u,"fillStyle",null)&&(this.defaultFillColor=h(u,"fillStyle.color",16777215),this.defaultFillAlpha=h(u,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(u,d,p){return p===void 0&&(p=1),this.commandBuffer.push(a.LINE_STYLE,u,d,p),this._lineWidth=u,this},fillStyle:function(u,d){return d===void 0&&(d=1),this.commandBuffer.push(a.FILL_STYLE,u,d),this},fillGradientStyle:function(u,d,p,g,x,y,C,P){return x===void 0&&(x=1),y===void 0&&(y=x),C===void 0&&(C=x),P===void 0&&(P=x),this.commandBuffer.push(a.GRADIENT_FILL_STYLE,x,y,C,P,u,d,p,g),this},lineGradientStyle:function(u,d,p,g,x,y){return y===void 0&&(y=1),this.commandBuffer.push(a.GRADIENT_LINE_STYLE,u,y,d,p,g,x),this},beginPath:function(){return this.commandBuffer.push(a.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(a.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(a.FILL_PATH),this},fill:function(){return this.commandBuffer.push(a.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(a.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(a.STROKE_PATH),this},fillCircleShape:function(u){return this.fillCircle(u.x,u.y,u.radius)},strokeCircleShape:function(u){return this.strokeCircle(u.x,u.y,u.radius)},fillCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.fillPath(),this},strokeCircle:function(u,d,p){return this.beginPath(),this.arc(u,d,p,0,s.PI2),this.strokePath(),this},fillRectShape:function(u){return this.fillRect(u.x,u.y,u.width,u.height)},strokeRectShape:function(u){return this.strokeRect(u.x,u.y,u.width,u.height)},fillRect:function(u,d,p,g){return this.commandBuffer.push(a.FILL_RECT,u,d,p,g),this},strokeRect:function(u,d,p,g){var x=this._lineWidth/2,y=u-x,C=u+x;return this.beginPath(),this.moveTo(u,d),this.lineTo(u,d+g),this.strokePath(),this.beginPath(),this.moveTo(u+p,d),this.lineTo(u+p,d+g),this.strokePath(),this.beginPath(),this.moveTo(y,d),this.lineTo(C+p,d),this.strokePath(),this.beginPath(),this.moveTo(y,d+g),this.lineTo(C+p,d+g),this.strokePath(),this},fillRoundedRect:function(u,d,p,g,x){x===void 0&&(x=20);var y=x,C=x,P=x,M=x;typeof x!="number"&&(y=i(x,"tl",20),C=i(x,"tr",20),P=i(x,"bl",20),M=i(x,"br",20));var w=y>=0,I=C>=0,L=P>=0,B=M>=0;return y=Math.abs(y),C=Math.abs(C),P=Math.abs(P),M=Math.abs(M),this.beginPath(),this.moveTo(u+y,d),this.lineTo(u+p-C,d),I?this.arc(u+p-C,d+C,C,-s.TAU,0):this.arc(u+p,d,C,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),B?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+P,d+g),L?this.arc(u+P,d+g-P,P,s.TAU,Math.PI):this.arc(u,d+g,P,0,-s.TAU,!0),this.lineTo(u,d+y),w?this.arc(u+y,d+y,y,-Math.PI,-s.TAU):this.arc(u,d,y,s.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(u,d,p,g,x){x===void 0&&(x=20);var y=x,C=x,P=x,M=x,w=Math.min(p,g)/2;typeof x!="number"&&(y=i(x,"tl",20),C=i(x,"tr",20),P=i(x,"bl",20),M=i(x,"br",20));var I=y>=0,L=C>=0,B=P>=0,N=M>=0;return y=Math.min(Math.abs(y),w),C=Math.min(Math.abs(C),w),P=Math.min(Math.abs(P),w),M=Math.min(Math.abs(M),w),this.beginPath(),this.moveTo(u+y,d),this.lineTo(u+p-C,d),this.moveTo(u+p-C,d),L?this.arc(u+p-C,d+C,C,-s.TAU,0):this.arc(u+p,d,C,Math.PI,s.TAU,!0),this.lineTo(u+p,d+g-M),this.moveTo(u+p,d+g-M),N?this.arc(u+p-M,d+g-M,M,0,s.TAU):this.arc(u+p,d+g,M,-s.TAU,Math.PI,!0),this.lineTo(u+P,d+g),this.moveTo(u+P,d+g),B?this.arc(u+P,d+g-P,P,s.TAU,Math.PI):this.arc(u,d+g,P,0,-s.TAU,!0),this.lineTo(u,d+y),this.moveTo(u,d+y),I?this.arc(u+y,d+y,y,-Math.PI,-s.TAU):this.arc(u,d,y,s.TAU,0,!0),this.strokePath(),this},fillPointShape:function(u,d){return this.fillPoint(u.x,u.y,d)},fillPoint:function(u,d,p){return!p||p<1?p=1:(u-=p/2,d-=p/2),this.commandBuffer.push(a.FILL_RECT,u,d,p,p),this},fillTriangleShape:function(u){return this.fillTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},strokeTriangleShape:function(u){return this.strokeTriangle(u.x1,u.y1,u.x2,u.y2,u.x3,u.y3)},fillTriangle:function(u,d,p,g,x,y){return this.commandBuffer.push(a.FILL_TRIANGLE,u,d,p,g,x,y),this},strokeTriangle:function(u,d,p,g,x,y){return this.commandBuffer.push(a.STROKE_TRIANGLE,u,d,p,g,x,y),this},strokeLineShape:function(u){return this.lineBetween(u.x1,u.y1,u.x2,u.y2)},lineBetween:function(u,d,p,g){return this.beginPath(),this.moveTo(u,d),this.lineTo(p,g),this.strokePath(),this},lineTo:function(u,d){return this.commandBuffer.push(a.LINE_TO,u,d),this},moveTo:function(u,d){return this.commandBuffer.push(a.MOVE_TO,u,d),this},strokePoints:function(u,d,p,g){d===void 0&&(d=!1),p===void 0&&(p=!1),g===void 0&&(g=u.length),this.beginPath(),this.moveTo(u[0].x,u[0].y);for(var x=1;x-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(u,d,p){var g=this.scene.sys,x=g.game.renderer;d===void 0&&(d=g.scale.width),p===void 0&&(p=g.scale.height),f.TargetCamera.setScene(this.scene),f.TargetCamera.setViewport(0,0,d,p),f.TargetCamera.scrollX=this.x,f.TargetCamera.scrollY=this.y;var y,C,P={willReadFrequently:!0};if(typeof u=="string")if(g.textures.exists(u)){y=g.textures.get(u);var M=y.getSourceImage();M instanceof HTMLCanvasElement&&(C=M.getContext("2d",P))}else y=g.textures.createCanvas(u,d,p),C=y.getSourceImage().getContext("2d",P);else u instanceof HTMLCanvasElement&&(C=u.getContext("2d",P));return C&&(this.renderCanvas(x,this,f.TargetCamera,null,C,!1),y&&y.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});f.TargetCamera=new o,c.exports=f},32768:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(85592),v=t(20926),a=function(r,n,e,i,h,s){var l=n.commandBuffer,f=l.length,u=h||r.currentContext;if(!(f===0||!v(r,u,n,e,i))){e.addToRenderList(n);var d=1,p=1,g=0,y=0,x=1,C=0,P=0,M=0;u.beginPath();for(var w=0;w>>16,P=(g&65280)>>>8,M=g&255,u.strokeStyle="rgba("+C+","+P+","+M+","+d+")",u.lineWidth=x,w+=3;break;case o.FILL_STYLE:y=l[w+1],p=l[w+2],C=(y&16711680)>>>16,P=(y&65280)>>>8,M=y&255,u.fillStyle="rgba("+C+","+P+","+M+","+p+")",w+=2;break;case o.BEGIN_PATH:u.beginPath();break;case o.CLOSE_PATH:u.closePath();break;case o.FILL_PATH:s||u.fill();break;case o.STROKE_PATH:s||u.stroke();break;case o.FILL_RECT:s?u.rect(l[w+1],l[w+2],l[w+3],l[w+4]):u.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case o.FILL_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.fill(),w+=6;break;case o.STROKE_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.stroke(),w+=6;break;case o.LINE_TO:u.lineTo(l[w+1],l[w+2]),w+=2;break;case o.MOVE_TO:u.moveTo(l[w+1],l[w+2]),w+=2;break;case o.LINE_FX_TO:u.lineTo(l[w+1],l[w+2]),w+=5;break;case o.MOVE_FX_TO:u.moveTo(l[w+1],l[w+2]),w+=5;break;case o.SAVE:u.save();break;case o.RESTORE:u.restore();break;case o.TRANSLATE:u.translate(l[w+1],l[w+2]),w+=2;break;case o.SCALE:u.scale(l[w+1],l[w+2]),w+=2;break;case o.ROTATE:u.rotate(l[w+1]),w+=1;break;case o.GRADIENT_FILL_STYLE:w+=5;break;case o.GRADIENT_LINE_STYLE:w+=6;break}}u.restore()}};c.exports=a},87079:(c,m,t)=>{/** + */var o=t(85592),v=t(20926),a=function(r,n,e,i,h,s){var l=n.commandBuffer,f=l.length,u=h||r.currentContext;if(!(f===0||!v(r,u,n,e,i))){e.addToRenderList(n);var d=1,p=1,g=0,x=0,y=1,C=0,P=0,M=0;u.beginPath();for(var w=0;w>>16,P=(g&65280)>>>8,M=g&255,u.strokeStyle="rgba("+C+","+P+","+M+","+d+")",u.lineWidth=y,w+=3;break;case o.FILL_STYLE:x=l[w+1],p=l[w+2],C=(x&16711680)>>>16,P=(x&65280)>>>8,M=x&255,u.fillStyle="rgba("+C+","+P+","+M+","+p+")",w+=2;break;case o.BEGIN_PATH:u.beginPath();break;case o.CLOSE_PATH:u.closePath();break;case o.FILL_PATH:s||u.fill();break;case o.STROKE_PATH:s||u.stroke();break;case o.FILL_RECT:s?u.rect(l[w+1],l[w+2],l[w+3],l[w+4]):u.fillRect(l[w+1],l[w+2],l[w+3],l[w+4]),w+=4;break;case o.FILL_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.fill(),w+=6;break;case o.STROKE_TRIANGLE:u.beginPath(),u.moveTo(l[w+1],l[w+2]),u.lineTo(l[w+3],l[w+4]),u.lineTo(l[w+5],l[w+6]),u.closePath(),s||u.stroke(),w+=6;break;case o.LINE_TO:u.lineTo(l[w+1],l[w+2]),w+=2;break;case o.MOVE_TO:u.moveTo(l[w+1],l[w+2]),w+=2;break;case o.LINE_FX_TO:u.lineTo(l[w+1],l[w+2]),w+=5;break;case o.MOVE_FX_TO:u.moveTo(l[w+1],l[w+2]),w+=5;break;case o.SAVE:u.save();break;case o.RESTORE:u.restore();break;case o.TRANSLATE:u.translate(l[w+1],l[w+2]),w+=2;break;case o.SCALE:u.scale(l[w+1],l[w+2]),w+=2;break;case o.ROTATE:u.rotate(l[w+1]),w+=1;break;case o.GRADIENT_FILL_STYLE:w+=5;break;case o.GRADIENT_LINE_STYLE:w+=6;break}}u.restore()}};c.exports=a},87079:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1535,11 +1535,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(85592),v=t(91296),a=t(61340),r=t(70554),n=function(l,f,u){this.x=l,this.y=f,this.width=u},e=function(l,f,u){this.points=[],this.pointsLength=1,this.points[0]=new n(l,f,u)},i=[],h=new a,s=function(l,f,u,d){if(f.commandBuffer.length!==0){u.addToRenderList(f);var p=l.pipelines.set(f.pipeline,f);l.pipelines.preBatch(f);for(var g=v(f,u,d).calc,y=h.loadIdentity(),x=f.commandBuffer,C=u.alpha*f.alpha,P=1,M=p.fillTint,w=p.strokeTint,I=0,L=0,B=0,N=.01,G=Math.PI*2,V,K=[],j=0,J=!0,X=null,Y=r.getTintAppendFloatAlpha,b=0;b0&&(ct=-G+ct%G):ct>G?ct=G:ct<0&&(ct=G+ct%G),X===null&&(X=new e(vt+Math.cos(Pt)*Et,At+Math.sin(Pt)*Et,P),K.push(X),at+=N);at<1+pt;)B=ct*at+Pt,I=vt+Math.cos(B)*Et,L=At+Math.sin(B)*Et,X.points.push(new n(I,L,P)),at+=N;B=ct+Pt,I=vt+Math.cos(B)*Et,L=At+Math.sin(B)*Et,X.points.push(new n(I,L,P));break}case o.FILL_RECT:{p.batchFillRect(x[++b],x[++b],x[++b],x[++b],y,g);break}case o.FILL_TRIANGLE:{p.batchFillTriangle(x[++b],x[++b],x[++b],x[++b],x[++b],x[++b],y,g);break}case o.STROKE_TRIANGLE:{p.batchStrokeTriangle(x[++b],x[++b],x[++b],x[++b],x[++b],x[++b],P,y,g);break}case o.LINE_TO:{X!==null?X.points.push(new n(x[++b],x[++b],P)):(X=new e(x[++b],x[++b],P),K.push(X));break}case o.MOVE_TO:{X=new e(x[++b],x[++b],P),K.push(X);break}case o.SAVE:{i.push(y.copyToArray());break}case o.RESTORE:{y.copyFromArray(i.pop());break}case o.TRANSLATE:{vt=x[++b],At=x[++b],y.translate(vt,At);break}case o.SCALE:{vt=x[++b],At=x[++b],y.scale(vt,At);break}case o.ROTATE:{y.rotate(x[++b]);break}}l.pipelines.postBatch(f)}};c.exports=s},26479:(c,m,t)=>{/** + */var o=t(85592),v=t(91296),a=t(61340),r=t(70554),n=function(l,f,u){this.x=l,this.y=f,this.width=u},e=function(l,f,u){this.points=[],this.pointsLength=1,this.points[0]=new n(l,f,u)},i=[],h=new a,s=function(l,f,u,d){if(f.commandBuffer.length!==0){u.addToRenderList(f);var p=l.pipelines.set(f.pipeline,f);l.pipelines.preBatch(f);for(var g=v(f,u,d).calc,x=h.loadIdentity(),y=f.commandBuffer,C=u.alpha*f.alpha,P=1,M=p.fillTint,w=p.strokeTint,I=0,L=0,B=0,N=.01,G=Math.PI*2,V,K=[],j=0,J=!0,X=null,Y=r.getTintAppendFloatAlpha,b=0;b0&&(ct=-G+ct%G):ct>G?ct=G:ct<0&&(ct=G+ct%G),X===null&&(X=new e(vt+Math.cos(Pt)*Et,At+Math.sin(Pt)*Et,P),K.push(X),at+=N);at<1+pt;)B=ct*at+Pt,I=vt+Math.cos(B)*Et,L=At+Math.sin(B)*Et,X.points.push(new n(I,L,P)),at+=N;B=ct+Pt,I=vt+Math.cos(B)*Et,L=At+Math.sin(B)*Et,X.points.push(new n(I,L,P));break}case o.FILL_RECT:{p.batchFillRect(y[++b],y[++b],y[++b],y[++b],x,g);break}case o.FILL_TRIANGLE:{p.batchFillTriangle(y[++b],y[++b],y[++b],y[++b],y[++b],y[++b],x,g);break}case o.STROKE_TRIANGLE:{p.batchStrokeTriangle(y[++b],y[++b],y[++b],y[++b],y[++b],y[++b],P,x,g);break}case o.LINE_TO:{X!==null?X.points.push(new n(y[++b],y[++b],P)):(X=new e(y[++b],y[++b],P),K.push(X));break}case o.MOVE_TO:{X=new e(y[++b],y[++b],P),K.push(X);break}case o.SAVE:{i.push(x.copyToArray());break}case o.RESTORE:{x.copyFromArray(i.pop());break}case o.TRANSLATE:{vt=y[++b],At=y[++b],x.translate(vt,At);break}case o.SCALE:{vt=y[++b],At=y[++b],x.scale(vt,At);break}case o.ROTATE:{x.rotate(y[++b]);break}}l.pipelines.postBatch(f)}};c.exports=s},26479:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(61061),v=t(83419),a=t(51708),r=t(50792),n=t(46710),e=t(95540),i=t(35154),h=t(97022),s=t(41212),l=t(88492),f=t(35072),u=t(68287),d=new v({Extends:r,initialize:function(g,y,x){r.call(this),x?y&&!Array.isArray(y)&&(y=[y]):Array.isArray(y)?s(y[0])&&(x=y,y=null):s(y)&&(x=y,y=null),this.scene=g,this.children=new f,this.isParent=!0,this.type="Group",this.classType=e(x,"classType",u),this.name=e(x,"name",""),this.active=e(x,"active",!0),this.maxSize=e(x,"maxSize",-1),this.defaultKey=e(x,"defaultKey",null),this.defaultFrame=e(x,"defaultFrame",null),this.runChildUpdate=e(x,"runChildUpdate",!1),this.createCallback=e(x,"createCallback",null),this.removeCallback=e(x,"removeCallback",null),this.createMultipleCallback=e(x,"createMultipleCallback",null),this.internalCreateCallback=e(x,"internalCreateCallback",null),this.internalRemoveCallback=e(x,"internalRemoveCallback",null),y&&this.addMultiple(y),x&&this.createMultiple(x),this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(p,g,y,x,C,P){if(p===void 0&&(p=0),g===void 0&&(g=0),y===void 0&&(y=this.defaultKey),x===void 0&&(x=this.defaultFrame),C===void 0&&(C=!0),P===void 0&&(P=!0),this.isFull())return null;var M=new this.classType(this.scene,p,g,y,x);return M.addToDisplayList(this.scene.sys.displayList),M.addToUpdateList(),M.visible=C,M.setActive(P),this.add(M),M},createMultiple:function(p){if(this.isFull())return[];Array.isArray(p)||(p=[p]);var g=[];if(p[0].key)for(var y=0;y=0;B--)if(L=G[B],L.active===y){if(N++,N===g)break}else L=null;return L?(typeof C=="number"&&(L.x=C),typeof P=="number"&&(L.y=P),L):x?this.create(C,P,M,w,I):null},get:function(p,g,y,x,C){return this.getFirst(!1,!0,p,g,y,x,C)},getFirstAlive:function(p,g,y,x,C,P){return this.getFirst(!0,p,g,y,x,C,P)},getFirstDead:function(p,g,y,x,C,P){return this.getFirst(!1,p,g,y,x,C,P)},playAnimation:function(p,g){return o.PlayAnimation(this.children.entries,p,g),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(p){p===void 0&&(p=!0);for(var g=0,y=0;y{/** + */var o=t(61061),v=t(83419),a=t(51708),r=t(50792),n=t(46710),e=t(95540),i=t(35154),h=t(97022),s=t(41212),l=t(88492),f=t(35072),u=t(68287),d=new v({Extends:r,initialize:function(g,x,y){r.call(this),y?x&&!Array.isArray(x)&&(x=[x]):Array.isArray(x)?s(x[0])&&(y=x,x=null):s(x)&&(y=x,x=null),this.scene=g,this.children=new f,this.isParent=!0,this.type="Group",this.classType=e(y,"classType",u),this.name=e(y,"name",""),this.active=e(y,"active",!0),this.maxSize=e(y,"maxSize",-1),this.defaultKey=e(y,"defaultKey",null),this.defaultFrame=e(y,"defaultFrame",null),this.runChildUpdate=e(y,"runChildUpdate",!1),this.createCallback=e(y,"createCallback",null),this.removeCallback=e(y,"removeCallback",null),this.createMultipleCallback=e(y,"createMultipleCallback",null),this.internalCreateCallback=e(y,"internalCreateCallback",null),this.internalRemoveCallback=e(y,"internalRemoveCallback",null),x&&this.addMultiple(x),y&&this.createMultiple(y),this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(p,g,x,y,C,P){if(p===void 0&&(p=0),g===void 0&&(g=0),x===void 0&&(x=this.defaultKey),y===void 0&&(y=this.defaultFrame),C===void 0&&(C=!0),P===void 0&&(P=!0),this.isFull())return null;var M=new this.classType(this.scene,p,g,x,y);return M.addToDisplayList(this.scene.sys.displayList),M.addToUpdateList(),M.visible=C,M.setActive(P),this.add(M),M},createMultiple:function(p){if(this.isFull())return[];Array.isArray(p)||(p=[p]);var g=[];if(p[0].key)for(var x=0;x=0;B--)if(L=G[B],L.active===x){if(N++,N===g)break}else L=null;return L?(typeof C=="number"&&(L.x=C),typeof P=="number"&&(L.y=P),L):y?this.create(C,P,M,w,I):null},get:function(p,g,x,y,C){return this.getFirst(!1,!0,p,g,x,y,C)},getFirstAlive:function(p,g,x,y,C,P){return this.getFirst(!0,p,g,x,y,C,P)},getFirstDead:function(p,g,x,y,C,P){return this.getFirst(!1,p,g,x,y,C,P)},playAnimation:function(p,g){return o.PlayAnimation(this.children.entries,p,g),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(p){p===void 0&&(p=!0);for(var g=0,x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1607,7 +1607,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(81491),v=t(83419),a=t(20339),r=t(41432),n=t(80321),e=t(51767),i=t(19133),h=t(19186),s=t(70554),l=new v({initialize:function(){this.lights=[],this.ambientColor=new e(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(f,u,d,p,g,y){return this.systems.displayList.add(new n(this.scene,f,u,d,p,g,y))},enable:function(){return this.maxLights===-1&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(f){for(var u=this.lights,d=f.worldView,p=[],g=0;gthis.maxLights&&(h(p,this.sortByDistance),p=p.slice(0,this.maxLights)),this.visibleLights=p.length,p},sortByDistance:function(f,u){return f.distance>=u.distance},setAmbientColor:function(f){var u=s.getFloatsFromUintRGB(f);return this.ambientColor.set(u[0],u[1],u[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=16777215),g===void 0&&(g=1);var y=s.getFloatsFromUintRGB(p),x=new r(f,u,d,y[0],y[1],y[2],g);return this.lights.push(x),x},removeLight:function(f){var u=this.lights.indexOf(f);return u>=0&&i(this.lights,u),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});c.exports=l},88992:(c,m,t)=>{/** + */var o=t(81491),v=t(83419),a=t(20339),r=t(41432),n=t(80321),e=t(51767),i=t(19133),h=t(19186),s=t(70554),l=new v({initialize:function(){this.lights=[],this.ambientColor=new e(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(f,u,d,p,g,x){return this.systems.displayList.add(new n(this.scene,f,u,d,p,g,x))},enable:function(){return this.maxLights===-1&&(this.maxLights=this.systems.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(f){for(var u=this.lights,d=f.worldView,p=[],g=0;gthis.maxLights&&(h(p,this.sortByDistance),p=p.slice(0,this.maxLights)),this.visibleLights=p.length,p},sortByDistance:function(f,u){return f.distance>=u.distance},setAmbientColor:function(f){var u=s.getFloatsFromUintRGB(f);return this.ambientColor.set(u[0],u[1],u[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=16777215),g===void 0&&(g=1);var x=s.getFloatsFromUintRGB(p),y=new r(f,u,d,x[0],x[1],x[2],g);return this.lights.push(y),y},removeLight:function(f){var u=this.lights.indexOf(f);return u>=0&&i(this.lights,u),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});c.exports=l},88992:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1615,7 +1615,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(39506),r=t(83997),n=t(95643),e=t(34684),i=t(92515),h=t(91296),s=t(37867),l=t(29807),f=t(43396),u=t(19186),d=t(25836),p=t(39318),g=new o({Extends:n,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Size,v.Texture,v.Transform,v.Visible,l],initialize:function(x,C,P,M,w,I,L,B,N,G,V,K){C===void 0&&(C=0),P===void 0&&(P=0),M===void 0&&(M="__WHITE"),n.call(this,x,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new d,this.modelScale=new d(1,1,1),this.modelRotation=new d,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new s,this.viewPosition=new d,this.viewMatrix=new s,this.projectionMatrix=new s,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var j=x.sys.renderer;this.setPosition(C,P),this.setTexture(M,w),this.setSize(j.width,j.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(j.width,j.height),I&&this.addVertices(I,L,B,N,G,V,K)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(y){return this.viewPosition.addScale(d.LEFT,y),this.dirtyCache[10]=1,this},panY:function(y){return this.viewPosition.y+=d.DOWN.y*y,this.dirtyCache[10]=1,this},panZ:function(y){return this.viewPosition.z+=y,this.dirtyCache[10]=1,this},setPerspective:function(y,x,C,P,M){return C===void 0&&(C=45),P===void 0&&(P=.01),M===void 0&&(M=1e3),this.fov=C,this.projectionMatrix.perspective(a(C),y/x,P,M),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(y,x,C,P){return y===void 0&&(y=this.scene.sys.renderer.getAspectRatio()),x===void 0&&(x=1),C===void 0&&(C=-1e3),P===void 0&&(P=1e3),this.fov=0,this.projectionMatrix.ortho(-y,y,-x,x,C,P),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(y){y.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(y,x,C,P,M,w,I,L,B){var N=this.scene.sys.cache.obj.get(y),G;return N&&(G=e(N,this,x,C,P,M,w,I,L,B)),(!G||G.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",y),this},sortByDepth:function(y,x){return y.depth-x.depth},depthSort:function(){return u(this.faces,this.sortByDepth),this},addVertex:function(y,x,C,P,M,w,I){var L=new p(y,x,C,P,M,w,I);return this.vertices.push(L),L},addFace:function(y,x,C){var P=new r(y,x,C);return this.faces.push(P),this.dirtyCache[9]=-1,P},addVertices:function(y,x,C,P,M,w,I){var L=i(y,x,C,P,M,w,I);return L?(this.faces=this.faces.concat(L.faces),this.vertices=this.vertices.concat(L.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(y){return this.faces[y]},hasFaceAt:function(y,x,C){C===void 0&&(C=this.scene.sys.cameras.main);for(var P=h(this,C).calc,M=this.faces,w=0;w{/** + */var o=t(83419),v=t(31401),a=t(39506),r=t(83997),n=t(95643),e=t(34684),i=t(92515),h=t(91296),s=t(37867),l=t(29807),f=t(43396),u=t(19186),d=t(25836),p=t(39318),g=new o({Extends:n,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Size,v.Texture,v.Transform,v.Visible,l],initialize:function(y,C,P,M,w,I,L,B,N,G,V,K){C===void 0&&(C=0),P===void 0&&(P=0),M===void 0&&(M="__WHITE"),n.call(this,y,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new d,this.modelScale=new d(1,1,1),this.modelRotation=new d,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new s,this.viewPosition=new d,this.viewMatrix=new s,this.projectionMatrix=new s,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var j=y.sys.renderer;this.setPosition(C,P),this.setTexture(M,w),this.setSize(j.width,j.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(j.width,j.height),I&&this.addVertices(I,L,B,N,G,V,K)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(x){return this.viewPosition.addScale(d.LEFT,x),this.dirtyCache[10]=1,this},panY:function(x){return this.viewPosition.y+=d.DOWN.y*x,this.dirtyCache[10]=1,this},panZ:function(x){return this.viewPosition.z+=x,this.dirtyCache[10]=1,this},setPerspective:function(x,y,C,P,M){return C===void 0&&(C=45),P===void 0&&(P=.01),M===void 0&&(M=1e3),this.fov=C,this.projectionMatrix.perspective(a(C),x/y,P,M),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(x,y,C,P){return x===void 0&&(x=this.scene.sys.renderer.getAspectRatio()),y===void 0&&(y=1),C===void 0&&(C=-1e3),P===void 0&&(P=1e3),this.fov=0,this.projectionMatrix.ortho(-x,x,-y,y,C,P),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(x){x.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(x,y,C,P,M,w,I,L,B){var N=this.scene.sys.cache.obj.get(x),G;return N&&(G=e(N,this,y,C,P,M,w,I,L,B)),(!G||G.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",x),this},sortByDepth:function(x,y){return x.depth-y.depth},depthSort:function(){return u(this.faces,this.sortByDepth),this},addVertex:function(x,y,C,P,M,w,I){var L=new p(x,y,C,P,M,w,I);return this.vertices.push(L),L},addFace:function(x,y,C){var P=new r(x,y,C);return this.faces.push(P),this.dirtyCache[9]=-1,P},addVertices:function(x,y,C,P,M,w,I){var L=i(x,y,C,P,M,w,I);return L?(this.faces=this.faces.concat(L.faces),this.vertices=this.vertices.concat(L.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(x){return this.faces[x]},hasFaceAt:function(x,y,C){C===void 0&&(C=this.scene.sys.cameras.main);for(var P=h(this,C).calc,M=this.faces,w=0;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1623,7 +1623,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(25305),v=t(44603),a=t(23568),r=t(35154),n=t(4703);v.register("mesh",function(e,i){e===void 0&&(e={});var h=a(e,"key",null),s=a(e,"frame",null),l=r(e,"vertices",[]),f=r(e,"uvs",[]),u=r(e,"indicies",[]),d=r(e,"containsZ",!1),p=r(e,"normals",[]),g=r(e,"colors",16777215),y=r(e,"alphas",1),x=new n(this.scene,0,0,h,s,l,f,u,d,p,g,y);return i!==void 0&&(e.add=i),o(this.scene,x,e),x})},9225:(c,m,t)=>{/** + */var o=t(25305),v=t(44603),a=t(23568),r=t(35154),n=t(4703);v.register("mesh",function(e,i){e===void 0&&(e={});var h=a(e,"key",null),s=a(e,"frame",null),l=r(e,"vertices",[]),f=r(e,"uvs",[]),u=r(e,"indicies",[]),d=r(e,"containsZ",!1),p=r(e,"normals",[]),g=r(e,"colors",16777215),x=r(e,"alphas",1),y=new n(this.scene,0,0,h,s,l,f,u,d,p,g,x);return i!==void 0&&(e.add=i),o(this.scene,y,e),y})},9225:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1635,15 +1635,15 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=function(a,r,n,e){var i=r.faces,h=i.length;if(h!==0){n.addToRenderList(r);var s=a.pipelines.set(r.pipeline,r),l=o(r,n,e).calc;a.pipelines.preBatch(r);for(var f=s.setGameObject(r),u=s.vertexViewF32,d=s.vertexViewU32,p=s.vertexCount*s.currentShader.vertexComponentCount-1,g=r.tintFill,y=[],x=r.debugCallback,C=l.a,P=l.b,M=l.c,w=l.d,I=l.e,L=l.f,B=r.viewPosition.z,N=r.hideCCW,G=n.roundPixels,V=n.alpha*r.alpha,K=0,j=0;j{/** + */var o=t(91296),v=function(a,r,n,e){var i=r.faces,h=i.length;if(h!==0){n.addToRenderList(r);var s=a.pipelines.set(r.pipeline,r),l=o(r,n,e).calc;a.pipelines.preBatch(r);for(var f=s.setGameObject(r),u=s.vertexViewF32,d=s.vertexViewU32,p=s.vertexCount*s.currentShader.vertexComponentCount-1,g=r.tintFill,x=[],y=r.debugCallback,C=l.a,P=l.b,M=l.c,w=l.d,I=l.e,L=l.f,B=r.viewPosition.z,N=r.hideCCW,G=n.roundPixels,V=n.alpha*r.alpha,K=0,j=0;j{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(95643),r=t(78023),n=t(39318),e=new o({Extends:a,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.GetBounds,v.Mask,v.Origin,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,r],initialize:function(h,s,l,f,u,d,p,g,y,x,C){a.call(this,h,"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 P=h.textures.getFrame(f,u);this.is3Slice=!x&&!C,P.scale9&&(this.is3Slice=P.is3Slice);for(var M=this.is3Slice?18:54,w=0;w{/** + */var o=t(83419),v=t(31401),a=t(95643),r=t(78023),n=t(39318),e=new o({Extends:a,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.GetBounds,v.Mask,v.Origin,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,r],initialize:function(h,s,l,f,u,d,p,g,x,y,C){a.call(this,h,"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 P=h.textures.getFrame(f,u);this.is3Slice=!y&&!C,P.scale9&&(this.is3Slice=P.is3Slice);for(var M=this.is3Slice?18:54,w=0;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(25305),v=t(44603),a=t(23568),r=t(35154),n=t(28103);v.register("nineslice",function(e,i){e===void 0&&(e={});var h=a(e,"key",null),s=a(e,"frame",null),l=r(e,"width",256),f=r(e,"height",256),u=r(e,"leftWidth",10),d=r(e,"rightWidth",10),p=r(e,"topHeight",0),g=r(e,"bottomHeight",0),y=new n(this.scene,0,0,h,s,l,f,u,d,p,g);return i!==void 0&&(e.add=i),o(this.scene,y,e),y})},47521:(c,m,t)=>{/** + */var o=t(25305),v=t(44603),a=t(23568),r=t(35154),n=t(28103);v.register("nineslice",function(e,i){e===void 0&&(e={});var h=a(e,"key",null),s=a(e,"frame",null),l=r(e,"width",256),f=r(e,"height",256),u=r(e,"leftWidth",10),d=r(e,"rightWidth",10),p=r(e,"topHeight",0),g=r(e,"bottomHeight",0),x=new n(this.scene,0,0,h,s,l,f,u,d,p,g);return i!==void 0&&(e.add=i),o(this.scene,x,e),x})},47521:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1655,7 +1655,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(70554),a=function(r,n,e,i){var h=n.vertices,s=h.length;if(s!==0){e.addToRenderList(n);var l=r.pipelines.set(n.pipeline,n),f=o(n,e,i,!1).calc;r.pipelines.preBatch(n);var u=l.setGameObject(n),d=l.vertexViewF32,p=l.vertexViewU32,g=l.vertexCount*l.currentShader.vertexComponentCount-1,y=e.roundPixels,x=n.tintFill,C=e.alpha*n.alpha,P=v.getTintAppendFloatAlpha(n.tint,C),M=l.vertexAvailable(),w=-1;M{/** + */var o=t(91296),v=t(70554),a=function(r,n,e,i){var h=n.vertices,s=h.length;if(s!==0){e.addToRenderList(n);var l=r.pipelines.set(n.pipeline,n),f=o(n,e,i,!1).calc;r.pipelines.preBatch(n);var u=l.setGameObject(n),d=l.vertexViewF32,p=l.vertexViewU32,g=l.vertexCount*l.currentShader.vertexComponentCount-1,x=e.roundPixels,y=n.tintFill,C=e.alpha*n.alpha,P=v.getTintAppendFloatAlpha(n.tint,C),M=l.vertexAvailable(),w=-1;M{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1663,7 +1663,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(30976),v=t(45319),a=t(83419),r=t(99472),n=t(6113),e=t(95540),i=t(91389),h=t(77720),s=t(15994),l=new a({initialize:function(u,d,p){p===void 0&&(p=!1),this.propertyKey=u,this.propertyValue=d,this.defaultValue=d,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=p,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(f,u){f===void 0&&(f={}),u&&(this.propertyKey=u),this.propertyValue=e(f,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(f){var u;switch(this.method){case 1:case 3:case 8:u=f;break;case 2:this.propertyValue.indexOf(f)>=0&&(u=f);break;case 4:var d=(this.end-this.start)/this.steps;u=h(f,d),this.counter=u;break;case 5:case 6:case 7:u=v(f,this.start,this.end);break;case 9:u=this.start[0];break}return this.current=u,this},getMethod:function(){var f=this.propertyValue;if(f===null)return 0;var u=typeof f;if(u==="number")return 1;if(Array.isArray(f))return 2;if(u==="function")return 3;if(u==="object"){if(this.hasBoth(f,"start","end"))return this.has(f,"steps")?4:5;if(this.hasBoth(f,"min","max"))return 6;if(this.has(f,"random"))return 7;if(this.hasEither(f,"onEmit","onUpdate"))return 8;if(this.hasEither(f,"values","interpolation"))return 9}return 0},setMethods:function(){var f=this.propertyValue,u=f,d=this.defaultEmit,p=this.defaultUpdate;switch(this.method){case 1:d=this.staticValueEmit;break;case 2:d=this.randomStaticValueEmit,u=f[0];break;case 3:this._onEmit=f,d=this.proxyEmit;break;case 4:this.start=f.start,this.end=f.end,this.steps=f.steps,this.counter=this.start,this.yoyo=this.has(f,"yoyo")?f.yoyo:!1,this.direction=0,d=this.steppedEmit,u=this.start;break;case 5:this.start=f.start,this.end=f.end;var g=this.has(f,"ease")?f.ease:"Linear";this.ease=n(g,f.easeParams),d=this.has(f,"random")&&f.random?this.randomRangedValueEmit:this.easedValueEmit,p=this.easeValueUpdate,u=this.start;break;case 6:this.start=f.min,this.end=f.max,d=this.has(f,"int")&&f.int?this.randomRangedIntEmit:this.randomRangedValueEmit,u=this.start;break;case 7:var y=f.random;Array.isArray(y)&&(this.start=y[0],this.end=y[1]),d=this.randomRangedIntEmit,u=this.start;break;case 8:this._onEmit=this.has(f,"onEmit")?f.onEmit:this.defaultEmit,this._onUpdate=this.has(f,"onUpdate")?f.onUpdate:this.defaultUpdate,d=this.proxyEmit,p=this.proxyUpdate;break;case 9:this.start=f.values;var x=this.has(f,"ease")?f.ease:"Linear";this.ease=n(x,f.easeParams),this.interpolation=i(f.interpolation),d=this.easedValueEmit,p=this.easeValueUpdate,u=this.start[0];break}return this.onEmit=d,this.onUpdate=p,this.current=u,this},has:function(f,u){return f.hasOwnProperty(u)},hasBoth:function(f,u,d){return f.hasOwnProperty(u)&&f.hasOwnProperty(d)},hasEither:function(f,u,d){return f.hasOwnProperty(u)||f.hasOwnProperty(d)},defaultEmit:function(f,u,d){return d},defaultUpdate:function(f,u,d,p){return p},proxyEmit:function(f,u,d){var p=this._onEmit(f,u,d);return this.current=p,p},proxyUpdate:function(f,u,d,p){var g=this._onUpdate(f,u,d,p);return this.current=g,g},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var f=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[f],this.current},randomRangedValueEmit:function(f,u){var d=r(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},randomRangedIntEmit:function(f,u){var d=o(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},steppedEmit:function(){var f=this.counter,u=f,d=(this.end-this.start)/this.steps;if(this.yoyo){var p;this.direction===0?(u+=d,u>=this.end&&(p=u-this.end,u=this.end-p,this.direction=1)):(u-=d,u<=this.start&&(p=this.start-u,u=this.start+p,this.direction=0)),this.counter=u}else this.counter=s(u+d,this.start,this.end);return this.current=f,f},easedValueEmit:function(f,u){if(f&&f.data[u]){var d=f.data[u];d.min=this.start,d.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(f,u,d){var p=f.data[u],g,y=this.ease(d);return this.interpolation?g=this.interpolation(this.start,y):g=(p.max-p.min)*y+p.min,this.current=g,g},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});c.exports=l},24502:(c,m,t)=>{/** + */var o=t(30976),v=t(45319),a=t(83419),r=t(99472),n=t(6113),e=t(95540),i=t(91389),h=t(77720),s=t(15994),l=new a({initialize:function(u,d,p){p===void 0&&(p=!1),this.propertyKey=u,this.propertyValue=d,this.defaultValue=d,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=p,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(f,u){f===void 0&&(f={}),u&&(this.propertyKey=u),this.propertyValue=e(f,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(f){var u;switch(this.method){case 1:case 3:case 8:u=f;break;case 2:this.propertyValue.indexOf(f)>=0&&(u=f);break;case 4:var d=(this.end-this.start)/this.steps;u=h(f,d),this.counter=u;break;case 5:case 6:case 7:u=v(f,this.start,this.end);break;case 9:u=this.start[0];break}return this.current=u,this},getMethod:function(){var f=this.propertyValue;if(f===null)return 0;var u=typeof f;if(u==="number")return 1;if(Array.isArray(f))return 2;if(u==="function")return 3;if(u==="object"){if(this.hasBoth(f,"start","end"))return this.has(f,"steps")?4:5;if(this.hasBoth(f,"min","max"))return 6;if(this.has(f,"random"))return 7;if(this.hasEither(f,"onEmit","onUpdate"))return 8;if(this.hasEither(f,"values","interpolation"))return 9}return 0},setMethods:function(){var f=this.propertyValue,u=f,d=this.defaultEmit,p=this.defaultUpdate;switch(this.method){case 1:d=this.staticValueEmit;break;case 2:d=this.randomStaticValueEmit,u=f[0];break;case 3:this._onEmit=f,d=this.proxyEmit;break;case 4:this.start=f.start,this.end=f.end,this.steps=f.steps,this.counter=this.start,this.yoyo=this.has(f,"yoyo")?f.yoyo:!1,this.direction=0,d=this.steppedEmit,u=this.start;break;case 5:this.start=f.start,this.end=f.end;var g=this.has(f,"ease")?f.ease:"Linear";this.ease=n(g,f.easeParams),d=this.has(f,"random")&&f.random?this.randomRangedValueEmit:this.easedValueEmit,p=this.easeValueUpdate,u=this.start;break;case 6:this.start=f.min,this.end=f.max,d=this.has(f,"int")&&f.int?this.randomRangedIntEmit:this.randomRangedValueEmit,u=this.start;break;case 7:var x=f.random;Array.isArray(x)&&(this.start=x[0],this.end=x[1]),d=this.randomRangedIntEmit,u=this.start;break;case 8:this._onEmit=this.has(f,"onEmit")?f.onEmit:this.defaultEmit,this._onUpdate=this.has(f,"onUpdate")?f.onUpdate:this.defaultUpdate,d=this.proxyEmit,p=this.proxyUpdate;break;case 9:this.start=f.values;var y=this.has(f,"ease")?f.ease:"Linear";this.ease=n(y,f.easeParams),this.interpolation=i(f.interpolation),d=this.easedValueEmit,p=this.easeValueUpdate,u=this.start[0];break}return this.onEmit=d,this.onUpdate=p,this.current=u,this},has:function(f,u){return f.hasOwnProperty(u)},hasBoth:function(f,u,d){return f.hasOwnProperty(u)&&f.hasOwnProperty(d)},hasEither:function(f,u,d){return f.hasOwnProperty(u)||f.hasOwnProperty(d)},defaultEmit:function(f,u,d){return d},defaultUpdate:function(f,u,d,p){return p},proxyEmit:function(f,u,d){var p=this._onEmit(f,u,d);return this.current=p,p},proxyUpdate:function(f,u,d,p){var g=this._onUpdate(f,u,d,p);return this.current=g,g},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var f=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[f],this.current},randomRangedValueEmit:function(f,u){var d=r(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},randomRangedIntEmit:function(f,u){var d=o(this.start,this.end);return f&&f.data[u]&&(f.data[u].min=d,f.data[u].max=this.end),this.current=d,d},steppedEmit:function(){var f=this.counter,u=f,d=(this.end-this.start)/this.steps;if(this.yoyo){var p;this.direction===0?(u+=d,u>=this.end&&(p=u-this.end,u=this.end-p,this.direction=1)):(u-=d,u<=this.start&&(p=this.start-u,u=this.start+p,this.direction=0)),this.counter=u}else this.counter=s(u+d,this.start,this.end);return this.current=f,f},easedValueEmit:function(f,u){if(f&&f.data[u]){var d=f.data[u];d.min=this.start,d.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(f,u,d){var p=f.data[u],g,x=this.ease(d);return this.interpolation?g=this.interpolation(this.start,x):g=(p.max-p.min)*x+p.min,this.current=g,g},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});c.exports=l},24502:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1671,7 +1671,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(9674),v=t(45319),a=t(83419),r=t(39506),n=t(87841),e=t(11520),i=t(26099),h=new a({initialize:function(l){this.emitter=l,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new i,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=l.scene,this.anims=new o(this),this.bounds=new n},emit:function(s,l,f,u,d,p){return this.emitter.emit(s,l,f,u,d,p)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(s,l){s===void 0&&(s=0),l===void 0&&(l=0),this.x=s,this.y=l},fire:function(s,l){var f=this.emitter,u=f.ops,d=f.getAnim();if(d?this.anims.play(d):(this.frame=f.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(f.getEmitZone(this),s===void 0?this.x+=u.x.onEmit(this,"x"):u.x.steps>0?this.x+=s+u.x.onEmit(this,"x"):this.x+=s,l===void 0?this.y+=u.y.onEmit(this,"y"):u.y.steps>0?this.y+=l+u.y.onEmit(this,"y"):this.y+=l,this.life=u.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=u.delay.onEmit(this,"delay"),this.holdCurrent=u.hold.onEmit(this,"hold"),this.scaleX=u.scaleX.onEmit(this,"scaleX"),this.scaleY=u.scaleY.active?u.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=u.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),f.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&f.getDeathZone(this))return this.lifeCurrent=0,!1;var p=u.speedX.onEmit(this,"speedX"),g=u.speedY.active?u.speedY.onEmit(this,"speedY"):p;if(f.radial){var y=r(u.angle.onEmit(this,"angle"));this.velocityX=Math.cos(y)*Math.abs(p),this.velocityY=Math.sin(y)*Math.abs(g)}else if(f.moveTo){var x=u.moveToX.onEmit(this,"moveToX"),C=u.moveToY.onEmit(this,"moveToY"),P=this.life/1e3;this.velocityX=(x-this.x)/P,this.velocityY=(C-this.y)/P}else this.velocityX=p,this.velocityY=g;return f.acceleration&&(this.accelerationX=u.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=u.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=u.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=u.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=u.bounce.onEmit(this,"bounce"),this.alpha=u.alpha.onEmit(this,"alpha"),u.color.active?this.tint=u.color.onEmit(this,"tint"):this.tint=u.tint.onEmit(this,"tint"),!0},update:function(s,l,f){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=s,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=s,!1;this.anims.update(0,s);var u=this.emitter,d=u.ops,p=1-this.lifeCurrent/this.life;if(this.lifeT=p,this.x=d.x.onUpdate(this,"x",p,this.x),this.y=d.y.onUpdate(this,"y",p,this.y),u.moveTo){var g=d.moveToX.onUpdate(this,"moveToX",p,u.moveToX),y=d.moveToY.onUpdate(this,"moveToY",p,u.moveToY),x=this.lifeCurrent/1e3;this.velocityX=(g-this.x)/x,this.velocityY=(y-this.y)/x}return this.computeVelocity(u,s,l,f,p),this.scaleX=d.scaleX.onUpdate(this,"scaleX",p,this.scaleX),d.scaleY.active?this.scaleY=d.scaleY.onUpdate(this,"scaleY",p,this.scaleY):this.scaleY=this.scaleX,this.angle=d.rotate.onUpdate(this,"rotate",p,this.angle),this.rotation=r(this.angle),u.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=v(d.alpha.onUpdate(this,"alpha",p,this.alpha),0,1),d.color.active?this.tint=d.color.onUpdate(this,"color",p,this.tint):this.tint=d.tint.onUpdate(this,"tint",p,this.tint),this.lifeCurrent-=s,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(s,l,f,u,d){var p=s.ops,g=this.velocityX,y=this.velocityY,x=p.accelerationX.onUpdate(this,"accelerationX",d,this.accelerationX),C=p.accelerationY.onUpdate(this,"accelerationY",d,this.accelerationY),P=p.maxVelocityX.onUpdate(this,"maxVelocityX",d,this.maxVelocityX),M=p.maxVelocityY.onUpdate(this,"maxVelocityY",d,this.maxVelocityY);this.bounce=p.bounce.onUpdate(this,"bounce",d,this.bounce),g+=s.gravityX*f+x*f,y+=s.gravityY*f+C*f,g=v(g,-P,P),y=v(y,-M,M),this.velocityX=g,this.velocityY=y,this.x+=g*f,this.y+=y*f,s.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var w=0;w{/** + */var o=t(9674),v=t(45319),a=t(83419),r=t(39506),n=t(87841),e=t(11520),i=t(26099),h=new a({initialize:function(l){this.emitter=l,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new i,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=l.scene,this.anims=new o(this),this.bounds=new n},emit:function(s,l,f,u,d,p){return this.emitter.emit(s,l,f,u,d,p)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(s,l){s===void 0&&(s=0),l===void 0&&(l=0),this.x=s,this.y=l},fire:function(s,l){var f=this.emitter,u=f.ops,d=f.getAnim();if(d?this.anims.play(d):(this.frame=f.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(f.getEmitZone(this),s===void 0?this.x+=u.x.onEmit(this,"x"):u.x.steps>0?this.x+=s+u.x.onEmit(this,"x"):this.x+=s,l===void 0?this.y+=u.y.onEmit(this,"y"):u.y.steps>0?this.y+=l+u.y.onEmit(this,"y"):this.y+=l,this.life=u.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=u.delay.onEmit(this,"delay"),this.holdCurrent=u.hold.onEmit(this,"hold"),this.scaleX=u.scaleX.onEmit(this,"scaleX"),this.scaleY=u.scaleY.active?u.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=u.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),f.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&f.getDeathZone(this))return this.lifeCurrent=0,!1;var p=u.speedX.onEmit(this,"speedX"),g=u.speedY.active?u.speedY.onEmit(this,"speedY"):p;if(f.radial){var x=r(u.angle.onEmit(this,"angle"));this.velocityX=Math.cos(x)*Math.abs(p),this.velocityY=Math.sin(x)*Math.abs(g)}else if(f.moveTo){var y=u.moveToX.onEmit(this,"moveToX"),C=u.moveToY.onEmit(this,"moveToY"),P=this.life/1e3;this.velocityX=(y-this.x)/P,this.velocityY=(C-this.y)/P}else this.velocityX=p,this.velocityY=g;return f.acceleration&&(this.accelerationX=u.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=u.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=u.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=u.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=u.bounce.onEmit(this,"bounce"),this.alpha=u.alpha.onEmit(this,"alpha"),u.color.active?this.tint=u.color.onEmit(this,"tint"):this.tint=u.tint.onEmit(this,"tint"),!0},update:function(s,l,f){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=s,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=s,!1;this.anims.update(0,s);var u=this.emitter,d=u.ops,p=1-this.lifeCurrent/this.life;if(this.lifeT=p,this.x=d.x.onUpdate(this,"x",p,this.x),this.y=d.y.onUpdate(this,"y",p,this.y),u.moveTo){var g=d.moveToX.onUpdate(this,"moveToX",p,u.moveToX),x=d.moveToY.onUpdate(this,"moveToY",p,u.moveToY),y=this.lifeCurrent/1e3;this.velocityX=(g-this.x)/y,this.velocityY=(x-this.y)/y}return this.computeVelocity(u,s,l,f,p),this.scaleX=d.scaleX.onUpdate(this,"scaleX",p,this.scaleX),d.scaleY.active?this.scaleY=d.scaleY.onUpdate(this,"scaleY",p,this.scaleY):this.scaleY=this.scaleX,this.angle=d.rotate.onUpdate(this,"rotate",p,this.angle),this.rotation=r(this.angle),u.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=v(d.alpha.onUpdate(this,"alpha",p,this.alpha),0,1),d.color.active?this.tint=d.color.onUpdate(this,"color",p,this.tint):this.tint=d.tint.onUpdate(this,"tint",p,this.tint),this.lifeCurrent-=s,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(s,l,f,u,d){var p=s.ops,g=this.velocityX,x=this.velocityY,y=p.accelerationX.onUpdate(this,"accelerationX",d,this.accelerationX),C=p.accelerationY.onUpdate(this,"accelerationY",d,this.accelerationY),P=p.maxVelocityX.onUpdate(this,"maxVelocityX",d,this.maxVelocityX),M=p.maxVelocityY.onUpdate(this,"maxVelocityY",d,this.maxVelocityY);this.bounce=p.bounce.onUpdate(this,"bounce",d,this.bounce),g+=s.gravityX*f+y*f,x+=s.gravityY*f+C*f,g=v(g,-P,P),x=v(x,-M,M),this.velocityX=g,this.velocityY=x,this.x+=g*f,this.y+=x*f,s.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var w=0;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1679,11 +1679,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(53774),r=t(43459),n=t(26388),e=t(19909),i=t(76472),h=t(44777),s=t(20696),l=t(95643),f=t(95540),u=t(26546),d=t(24502),p=t(1985),g=t(97022),y=t(86091),x=t(73162),C=t(20074),P=t(56480),M=t(68875),w=t(87841),I=t(59996),L=t(72905),B=t(90668),N=t(19186),G=t(61340),V=t(26099),K=t(15994),j=t(69601),J=["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"],X=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],Y=new o({Extends:l,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,B],initialize:function(z,W,H,Z,Q){l.call(this,z,"ParticleEmitter"),this.particleClass=P,this.ops={accelerationX:new h("accelerationX",0),accelerationY:new h("accelerationY",0),alpha:new h("alpha",1),angle:new h("angle",{min:0,max:360},!0),bounce:new h("bounce",0),color:new i("color"),delay:new h("delay",0,!0),hold:new h("hold",0,!0),lifespan:new h("lifespan",1e3,!0),maxVelocityX:new h("maxVelocityX",1e4),maxVelocityY:new h("maxVelocityY",1e4),moveToX:new h("moveToX",0),moveToY:new h("moveToY",0),quantity:new h("quantity",1,!0),rotate:new h("rotate",0),scaleX:new h("scaleX",1),scaleY:new h("scaleY",1),speedX:new h("speedX",0,!0),speedY:new h("speedY",0,!0),tint:new h("tint",16777215),x:new h("x",0),y:new h("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 V,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 G,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new x(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(W,H),this.setTexture(Z),Q&&this.setConfig(Q)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(b){if(!b)return this;var z=0,W="",H=this.ops;for(z=0;z=this.animQuantity&&(this.animCounter=0,this.currentAnim=K(this.currentAnim+1,0,z)),W},setAnim:function(b,z,W){z===void 0&&(z=!0),W===void 0&&(W=1),this.randomAnim=z,this.animQuantity=W,this.currentAnim=0;var H=typeof b;if(this.anims.length=0,Array.isArray(b))this.anims=this.anims.concat(b);else if(H==="string")this.anims.push(b);else if(H==="object"){var Z=b;b=f(Z,"anims",null),b&&(this.anims=this.anims.concat(b));var Q=f(Z,"cycle",!1);this.randomAnim=!Q,this.animQuantity=f(Z,"quantity",W)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(b){return b===void 0&&(b=!0),this.radial=b,this},addParticleBounds:function(b,z,W,H,Z,Q,k,et){if(typeof b=="object"){var st=b;b=st.x,z=st.y,W=g(st,"w")?st.w:st.width,H=g(st,"h")?st.h:st.height}return this.addParticleProcessor(new j(b,z,W,H,Z,Q,k,et))},setParticleSpeed:function(b,z){return z===void 0&&(z=b),this.ops.speedX.onChange(b),b===z?this.ops.speedY.active=!1:this.ops.speedY.onChange(z),this.radial=!0,this},setParticleScale:function(b,z){return b===void 0&&(b=1),z===void 0&&(z=b),this.ops.scaleX.onChange(b),this.ops.scaleY.onChange(z),this},setParticleGravity:function(b,z){return this.gravityX=b,this.gravityY=z,this},setParticleAlpha:function(b){return this.ops.alpha.onChange(b),this},setParticleTint:function(b){return this.ops.tint.onChange(b),this},setEmitterAngle:function(b){return this.ops.angle.onChange(b),this},setParticleLifespan:function(b){return this.ops.lifespan.onChange(b),this},setQuantity:function(b){return this.quantity=b,this},setFrequency:function(b,z){return this.frequency=b,this.flowCounter=b>0?b:0,z&&(this.quantity=z),this},addDeathZone:function(b){Array.isArray(b)||(b=[b]);for(var z,W=[],H=0;H-1&&(this.zoneTotal++,this.zoneTotal===H.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===W&&(this.zoneIndex=0)))}},getDeathZone:function(b){for(var z=this.deathZones,W=0;W=0&&(this.zoneIndex=z),this},addParticleProcessor:function(b){return this.processors.exists(b)||(b.emitter&&b.emitter.removeParticleProcessor(b),this.processors.add(b),b.emitter=this),b},removeParticleProcessor:function(b){return this.processors.exists(b)&&(this.processors.remove(b,!0),b.emitter=null),b},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(b){return this.addParticleProcessor(new d(b))},reserve:function(b){var z=this.dead;if(this.maxParticles>0){var W=this.getParticleCount();W+b>this.maxParticles&&(b=this.maxParticles-(W+b))}for(var H=0;H0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(b,z){return b===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof b=="function"&&(this.emitCallback=b,z&&(this.emitCallbackScope=z)),this},onParticleDeath:function(b,z){return b===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof b=="function"&&(this.deathCallback=b,z&&(this.deathCallbackScope=z)),this},killAll:function(){for(var b=this.dead,z=this.alive;z.length>0;)b.push(z.pop());return this},forEachAlive:function(b,z){for(var W=this.alive,H=W.length,Z=0;Z0&&this.fastForward(b),this.emitting=!0,this.resetCounters(this.frequency,!0),z!==void 0&&(this.duration=Math.abs(z)),this.emit(s.START,this)),this},stop:function(b){return b===void 0&&(b=!1),this.emitting&&(this.emitting=!1,b&&this.killAll(),this.emit(s.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(b,z){return b===void 0&&(b=""),z===void 0&&(z=this.true),this.sortProperty=b,this.sortOrderAsc=z,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(b){return this.sortProperty!==""?b=this.depthSortCallback:b=null,this.sortCallback=b,this},depthSort:function(){return N(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(b,z){var W=this.sortProperty;return this.sortOrderAsc?b[W]-z[W]:z[W]-b[W]},flow:function(b,z,W){return z===void 0&&(z=1),this.emitting=!1,this.frequency=b,this.quantity=z,W!==void 0&&(this.stopAfter=W),this.start()},explode:function(b,z,W){this.frequency=-1,this.resetCounters(-1,!0);var H=this.emitParticle(b,z,W);return this.emit(s.EXPLODE,this,H),H},emitParticleAt:function(b,z,W){return this.emitParticle(W,b,z)},emitParticle:function(b,z,W){if(!this.atLimit()){b===void 0&&(b=this.ops.quantity.onEmit());for(var H=this.dead,Z=this.stopAfter,Q=this.follow?this.follow.x+this.followOffset.x:z,k=this.follow?this.follow.y+this.followOffset.y:W,et=0;et0&&(this.stopCounter++,this.stopCounter>=Z)||this.atLimit())break}return st}},fastForward:function(b,z){z===void 0&&(z=1e3/60);var W=0;for(this.skipping=!0;W0){var ot=this.deathCallback,ft=this.deathCallbackScope;for(k=st-1;k>=0;k--){var at=et[k];Z.splice(at.index,1),Q.push(at.particle),ot&&ot.call(ft,at.particle),at.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&Z.length===0&&(this.completeFlag=0,this.emit(s.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=z;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=z,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(b){for(var z=this.getWorldTransformMatrix(),W=this.alive,H=W.length,Z=[],Q=0;Q0){var rt=0;for(this.skipping=!0;rt0&&y(H,b,b),H},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(b){this.ops.x.onChange(b)}},particleY:{get:function(){return this.ops.y.current},set:function(b){this.ops.y.onChange(b)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(b){this.ops.accelerationX.onChange(b)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(b){this.ops.accelerationY.onChange(b)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(b){this.ops.maxVelocityX.onChange(b)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(b){this.ops.maxVelocityY.onChange(b)}},speed:{get:function(){return this.ops.speedX.current},set:function(b){this.ops.speedX.onChange(b),this.ops.speedY.onChange(b)}},speedX:{get:function(){return this.ops.speedX.current},set:function(b){this.ops.speedX.onChange(b)}},speedY:{get:function(){return this.ops.speedY.current},set:function(b){this.ops.speedY.onChange(b)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(b){this.ops.moveToX.onChange(b)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(b){this.ops.moveToY.onChange(b)}},bounce:{get:function(){return this.ops.bounce.current},set:function(b){this.ops.bounce.onChange(b)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(b){this.ops.scaleX.onChange(b)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(b){this.ops.scaleY.onChange(b)}},particleColor:{get:function(){return this.ops.color.current},set:function(b){this.ops.color.onChange(b)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(b){this.ops.color.setEase(b)}},particleTint:{get:function(){return this.ops.tint.current},set:function(b){this.ops.tint.onChange(b)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(b){this.ops.alpha.onChange(b)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(b){this.ops.lifespan.onChange(b)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(b){this.ops.angle.onChange(b)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(b){this.ops.rotate.onChange(b)}},quantity:{get:function(){return this.ops.quantity.current},set:function(b){this.ops.quantity.onChange(b)}},delay:{get:function(){return this.ops.delay.current},set:function(b){this.ops.delay.onChange(b)}},hold:{get:function(){return this.ops.hold.current},set:function(b){this.ops.hold.onChange(b)}},flowCounter:{get:function(){return this.counters[0]},set:function(b){this.counters[0]=b}},frameCounter:{get:function(){return this.counters[1]},set:function(b){this.counters[1]=b}},animCounter:{get:function(){return this.counters[2]},set:function(b){this.counters[2]=b}},elapsed:{get:function(){return this.counters[3]},set:function(b){this.counters[3]=b}},stopCounter:{get:function(){return this.counters[4]},set:function(b){this.counters[4]=b}},completeFlag:{get:function(){return this.counters[5]},set:function(b){this.counters[5]=b}},zoneIndex:{get:function(){return this.counters[6]},set:function(b){this.counters[6]=b}},zoneTotal:{get:function(){return this.counters[7]},set:function(b){this.counters[7]=b}},currentFrame:{get:function(){return this.counters[8]},set:function(b){this.counters[8]=b}},currentAnim:{get:function(){return this.counters[9]},set:function(b){this.counters[9]=b}},preDestroy:function(){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 b,z=this.ops;for(b=0;b{/** + */var o=t(83419),v=t(31401),a=t(53774),r=t(43459),n=t(26388),e=t(19909),i=t(76472),h=t(44777),s=t(20696),l=t(95643),f=t(95540),u=t(26546),d=t(24502),p=t(1985),g=t(97022),x=t(86091),y=t(73162),C=t(20074),P=t(56480),M=t(68875),w=t(87841),I=t(59996),L=t(72905),B=t(90668),N=t(19186),G=t(61340),V=t(26099),K=t(15994),j=t(69601),J=["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"],X=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],Y=new o({Extends:l,Mixins:[v.AlphaSingle,v.BlendMode,v.Depth,v.Mask,v.Pipeline,v.PostPipeline,v.ScrollFactor,v.Texture,v.Transform,v.Visible,B],initialize:function(z,W,H,Z,Q){l.call(this,z,"ParticleEmitter"),this.particleClass=P,this.ops={accelerationX:new h("accelerationX",0),accelerationY:new h("accelerationY",0),alpha:new h("alpha",1),angle:new h("angle",{min:0,max:360},!0),bounce:new h("bounce",0),color:new i("color"),delay:new h("delay",0,!0),hold:new h("hold",0,!0),lifespan:new h("lifespan",1e3,!0),maxVelocityX:new h("maxVelocityX",1e4),maxVelocityY:new h("maxVelocityY",1e4),moveToX:new h("moveToX",0),moveToY:new h("moveToY",0),quantity:new h("quantity",1,!0),rotate:new h("rotate",0),scaleX:new h("scaleX",1),scaleY:new h("scaleY",1),speedX:new h("speedX",0,!0),speedY:new h("speedY",0,!0),tint:new h("tint",16777215),x:new h("x",0),y:new h("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 V,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 G,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new y(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(W,H),this.setTexture(Z),Q&&this.setConfig(Q)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(b){if(!b)return this;var z=0,W="",H=this.ops;for(z=0;z=this.animQuantity&&(this.animCounter=0,this.currentAnim=K(this.currentAnim+1,0,z)),W},setAnim:function(b,z,W){z===void 0&&(z=!0),W===void 0&&(W=1),this.randomAnim=z,this.animQuantity=W,this.currentAnim=0;var H=typeof b;if(this.anims.length=0,Array.isArray(b))this.anims=this.anims.concat(b);else if(H==="string")this.anims.push(b);else if(H==="object"){var Z=b;b=f(Z,"anims",null),b&&(this.anims=this.anims.concat(b));var Q=f(Z,"cycle",!1);this.randomAnim=!Q,this.animQuantity=f(Z,"quantity",W)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(b){return b===void 0&&(b=!0),this.radial=b,this},addParticleBounds:function(b,z,W,H,Z,Q,k,et){if(typeof b=="object"){var st=b;b=st.x,z=st.y,W=g(st,"w")?st.w:st.width,H=g(st,"h")?st.h:st.height}return this.addParticleProcessor(new j(b,z,W,H,Z,Q,k,et))},setParticleSpeed:function(b,z){return z===void 0&&(z=b),this.ops.speedX.onChange(b),b===z?this.ops.speedY.active=!1:this.ops.speedY.onChange(z),this.radial=!0,this},setParticleScale:function(b,z){return b===void 0&&(b=1),z===void 0&&(z=b),this.ops.scaleX.onChange(b),this.ops.scaleY.onChange(z),this},setParticleGravity:function(b,z){return this.gravityX=b,this.gravityY=z,this},setParticleAlpha:function(b){return this.ops.alpha.onChange(b),this},setParticleTint:function(b){return this.ops.tint.onChange(b),this},setEmitterAngle:function(b){return this.ops.angle.onChange(b),this},setParticleLifespan:function(b){return this.ops.lifespan.onChange(b),this},setQuantity:function(b){return this.quantity=b,this},setFrequency:function(b,z){return this.frequency=b,this.flowCounter=b>0?b:0,z&&(this.quantity=z),this},addDeathZone:function(b){Array.isArray(b)||(b=[b]);for(var z,W=[],H=0;H-1&&(this.zoneTotal++,this.zoneTotal===H.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===W&&(this.zoneIndex=0)))}},getDeathZone:function(b){for(var z=this.deathZones,W=0;W=0&&(this.zoneIndex=z),this},addParticleProcessor:function(b){return this.processors.exists(b)||(b.emitter&&b.emitter.removeParticleProcessor(b),this.processors.add(b),b.emitter=this),b},removeParticleProcessor:function(b){return this.processors.exists(b)&&(this.processors.remove(b,!0),b.emitter=null),b},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(b){return this.addParticleProcessor(new d(b))},reserve:function(b){var z=this.dead;if(this.maxParticles>0){var W=this.getParticleCount();W+b>this.maxParticles&&(b=this.maxParticles-(W+b))}for(var H=0;H0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(b,z){return b===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof b=="function"&&(this.emitCallback=b,z&&(this.emitCallbackScope=z)),this},onParticleDeath:function(b,z){return b===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof b=="function"&&(this.deathCallback=b,z&&(this.deathCallbackScope=z)),this},killAll:function(){for(var b=this.dead,z=this.alive;z.length>0;)b.push(z.pop());return this},forEachAlive:function(b,z){for(var W=this.alive,H=W.length,Z=0;Z0&&this.fastForward(b),this.emitting=!0,this.resetCounters(this.frequency,!0),z!==void 0&&(this.duration=Math.abs(z)),this.emit(s.START,this)),this},stop:function(b){return b===void 0&&(b=!1),this.emitting&&(this.emitting=!1,b&&this.killAll(),this.emit(s.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(b,z){return b===void 0&&(b=""),z===void 0&&(z=this.true),this.sortProperty=b,this.sortOrderAsc=z,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(b){return this.sortProperty!==""?b=this.depthSortCallback:b=null,this.sortCallback=b,this},depthSort:function(){return N(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(b,z){var W=this.sortProperty;return this.sortOrderAsc?b[W]-z[W]:z[W]-b[W]},flow:function(b,z,W){return z===void 0&&(z=1),this.emitting=!1,this.frequency=b,this.quantity=z,W!==void 0&&(this.stopAfter=W),this.start()},explode:function(b,z,W){this.frequency=-1,this.resetCounters(-1,!0);var H=this.emitParticle(b,z,W);return this.emit(s.EXPLODE,this,H),H},emitParticleAt:function(b,z,W){return this.emitParticle(W,b,z)},emitParticle:function(b,z,W){if(!this.atLimit()){b===void 0&&(b=this.ops.quantity.onEmit());for(var H=this.dead,Z=this.stopAfter,Q=this.follow?this.follow.x+this.followOffset.x:z,k=this.follow?this.follow.y+this.followOffset.y:W,et=0;et0&&(this.stopCounter++,this.stopCounter>=Z)||this.atLimit())break}return st}},fastForward:function(b,z){z===void 0&&(z=1e3/60);var W=0;for(this.skipping=!0;W0){var ot=this.deathCallback,ft=this.deathCallbackScope;for(k=st-1;k>=0;k--){var at=et[k];Z.splice(at.index,1),Q.push(at.particle),ot&&ot.call(ft,at.particle),at.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&Z.length===0&&(this.completeFlag=0,this.emit(s.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=z;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=z,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(b){for(var z=this.getWorldTransformMatrix(),W=this.alive,H=W.length,Z=[],Q=0;Q0){var rt=0;for(this.skipping=!0;rt0&&x(H,b,b),H},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(b){this.ops.x.onChange(b)}},particleY:{get:function(){return this.ops.y.current},set:function(b){this.ops.y.onChange(b)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(b){this.ops.accelerationX.onChange(b)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(b){this.ops.accelerationY.onChange(b)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(b){this.ops.maxVelocityX.onChange(b)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(b){this.ops.maxVelocityY.onChange(b)}},speed:{get:function(){return this.ops.speedX.current},set:function(b){this.ops.speedX.onChange(b),this.ops.speedY.onChange(b)}},speedX:{get:function(){return this.ops.speedX.current},set:function(b){this.ops.speedX.onChange(b)}},speedY:{get:function(){return this.ops.speedY.current},set:function(b){this.ops.speedY.onChange(b)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(b){this.ops.moveToX.onChange(b)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(b){this.ops.moveToY.onChange(b)}},bounce:{get:function(){return this.ops.bounce.current},set:function(b){this.ops.bounce.onChange(b)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(b){this.ops.scaleX.onChange(b)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(b){this.ops.scaleY.onChange(b)}},particleColor:{get:function(){return this.ops.color.current},set:function(b){this.ops.color.onChange(b)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(b){this.ops.color.setEase(b)}},particleTint:{get:function(){return this.ops.tint.current},set:function(b){this.ops.tint.onChange(b)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(b){this.ops.alpha.onChange(b)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(b){this.ops.lifespan.onChange(b)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(b){this.ops.angle.onChange(b)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(b){this.ops.rotate.onChange(b)}},quantity:{get:function(){return this.ops.quantity.current},set:function(b){this.ops.quantity.onChange(b)}},delay:{get:function(){return this.ops.delay.current},set:function(b){this.ops.delay.onChange(b)}},hold:{get:function(){return this.ops.hold.current},set:function(b){this.ops.hold.onChange(b)}},flowCounter:{get:function(){return this.counters[0]},set:function(b){this.counters[0]=b}},frameCounter:{get:function(){return this.counters[1]},set:function(b){this.counters[1]=b}},animCounter:{get:function(){return this.counters[2]},set:function(b){this.counters[2]=b}},elapsed:{get:function(){return this.counters[3]},set:function(b){this.counters[3]=b}},stopCounter:{get:function(){return this.counters[4]},set:function(b){this.counters[4]=b}},completeFlag:{get:function(){return this.counters[5]},set:function(b){this.counters[5]=b}},zoneIndex:{get:function(){return this.counters[6]},set:function(b){this.counters[6]=b}},zoneTotal:{get:function(){return this.counters[7]},set:function(b){this.counters[7]=b}},currentFrame:{get:function(){return this.counters[8]},set:function(b){this.counters[8]=b}},currentAnim:{get:function(){return this.counters[9]},set:function(b){this.counters[9]=b}},preDestroy:function(){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 b,z=this.ops;for(b=0;b{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(59996),v=t(61340),a=new v,r=new v,n=new v,e=new v,i=function(h,s,l,f){var u=a,d=r,p=n,g=e;f?(g.loadIdentity(),g.multiply(f),g.translate(s.x,s.y),g.rotate(s.rotation),g.scale(s.scaleX,s.scaleY)):g.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY);var y=h.currentContext,x=l.roundPixels,C=l.alpha,P=s.alpha,M=s.alive,w=M.length,I=s.viewBounds;if(!(!s.visible||w===0||I&&!o(I,l.worldView))){s.sortCallback&&s.depthSort(),l.addToRenderList(s);var L=s.scrollFactorX,B=s.scrollFactorY;y.save(),y.globalCompositeOperation=h.blendModes[s.blendMode];for(var N=0;N0&&j.height>0){var J=-K.halfWidth,X=-K.halfHeight;y.globalAlpha=V,y.save(),d.setToContext(y),x&&(J=Math.round(J),X=Math.round(X)),y.imageSmoothingEnabled=!K.source.scaleMode,y.drawImage(K.source.image,j.x,j.y,j.width,j.height,J,X,j.width,j.height),y.restore()}}}y.restore()}};c.exports=i},92730:(c,m,t)=>{/** + */var o=t(59996),v=t(61340),a=new v,r=new v,n=new v,e=new v,i=function(h,s,l,f){var u=a,d=r,p=n,g=e;f?(g.loadIdentity(),g.multiply(f),g.translate(s.x,s.y),g.rotate(s.rotation),g.scale(s.scaleX,s.scaleY)):g.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY);var x=h.currentContext,y=l.roundPixels,C=l.alpha,P=s.alpha,M=s.alive,w=M.length,I=s.viewBounds;if(!(!s.visible||w===0||I&&!o(I,l.worldView))){s.sortCallback&&s.depthSort(),l.addToRenderList(s);var L=s.scrollFactorX,B=s.scrollFactorY;x.save(),x.globalCompositeOperation=h.blendModes[s.blendMode];for(var N=0;N0&&j.height>0){var J=-K.halfWidth,X=-K.halfHeight;x.globalAlpha=V,x.save(),d.setToContext(x),y&&(J=Math.round(J),X=Math.round(X)),x.imageSmoothingEnabled=!K.source.scaleMode,x.drawImage(K.source.image,j.x,j.y,j.width,j.height,J,X,j.width,j.height),x.restore()}}}x.restore()}};c.exports=i},92730:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1699,7 +1699,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(59996),v=t(61340),a=t(70554),r=new v,n=new v,e=new v,i=new v,h=function(s,l,f,u){var d=s.pipelines.set(l.pipeline),p=r,g=n,y=e,x=i;u?(x.loadIdentity(),x.multiply(u),x.translate(l.x,l.y),x.rotate(l.rotation),x.scale(l.scaleX,l.scaleY)):x.applyITRS(l.x,l.y,l.rotation,l.scaleX,l.scaleY);var C=a.getTintAppendFloatAlpha,P=f.alpha,M=l.alpha;s.pipelines.preBatch(l);var w=l.alive,I=w.length,L=l.viewBounds;if(!(I===0||L&&!o(L,f.worldView))){l.sortCallback&&l.depthSort(),f.addToRenderList(l),p.copyFrom(f.matrix),p.multiplyWithOffset(x,-f.scrollX*l.scrollFactorX,-f.scrollY*l.scrollFactorY),s.setBlendMode(l.blendMode),l.mask&&(l.mask.preRenderWebGL(s,l,f),s.pipelines.set(l.pipeline));for(var B=l.tintFill,N,G,V=0;V{/** + */var o=t(59996),v=t(61340),a=t(70554),r=new v,n=new v,e=new v,i=new v,h=function(s,l,f,u){var d=s.pipelines.set(l.pipeline),p=r,g=n,x=e,y=i;u?(y.loadIdentity(),y.multiply(u),y.translate(l.x,l.y),y.rotate(l.rotation),y.scale(l.scaleX,l.scaleY)):y.applyITRS(l.x,l.y,l.rotation,l.scaleX,l.scaleY);var C=a.getTintAppendFloatAlpha,P=f.alpha,M=l.alpha;s.pipelines.preBatch(l);var w=l.alive,I=w.length,L=l.viewBounds;if(!(I===0||L&&!o(L,f.worldView))){l.sortCallback&&l.depthSort(),f.addToRenderList(l),p.copyFrom(f.matrix),p.multiplyWithOffset(y,-f.scrollX*l.scrollFactorX,-f.scrollY*l.scrollFactorY),s.setBlendMode(l.blendMode),l.mask&&(l.mask.preRenderWebGL(s,l,f),s.pipelines.set(l.pipeline));for(var B=l.tintFill,N,G,V=0;V{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1759,11 +1759,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(9674),v=t(83419),a=t(48803),r=t(90664),n=t(4703),e=t(45650),i=new v({Extends:n,initialize:function(s,l,f,u,d,p,g,y){u||(u="__DEFAULT"),n.call(this,s,l,f,u,d),this.type="Plane",this.anims=new o(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(p,g,y),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(h,s,l){h===void 0&&(h=8),s===void 0&&(s=8),l===void 0&&(l=!1);var f=!1;return l&&(f=!0),this.gridWidth=h,this.gridHeight=s,this.isTiled=l,this.clear(),a({mesh:this,widthSegments:h,heightSegments:s,isOrtho:!1,tile:l,flipY:f}),this},setSizeToFrame:function(h){h===void 0&&(h=!0);var s=this.frame;if(this.setPerspective(this.width/s.width,this.height/s.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!h)return this;var l=this.gridWidth,f=this.gridHeight,u=this.vertices,d=s.u0,p=s.u1,g=s.v0,y=s.v1,x,C,P=0;if(this.isTiled)for(g=s.v1,y=s.v0,C=0;C7&&x>7?g.push(d.r,d.g,d.b,l):g.push(p.r,p.g,p.b,f);var C=this.scene.sys.textures.addUint8Array(e(),new Uint8Array(g),16,16);return this.removeCheckerboard(),this.setTexture(C),this.setSizeToFrame(),this.setViewHeight(u),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(h,s){return this.anims.play(h,s)},playReverse:function(h,s){return this.anims.playReverse(h,s)},playAfterDelay:function(h,s){return this.anims.playAfterDelay(h,s)},playAfterRepeat:function(h,s){return this.anims.playAfterRepeat(h,s)},stop:function(){return this.anims.stop()},stopAfterDelay:function(h){return this.anims.stopAfterDelay(h)},stopAfterRepeat:function(h){return this.anims.stopAfterRepeat(h)},stopOnFrame:function(h){return this.anims.stopOnFrame(h)},preUpdate:function(h,s){n.prototype.preUpdate.call(this,h,s),this.anims.update(h,s)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});c.exports=i},56015:(c,m,t)=>{/** + */var o=t(9674),v=t(83419),a=t(48803),r=t(90664),n=t(4703),e=t(45650),i=new v({Extends:n,initialize:function(s,l,f,u,d,p,g,x){u||(u="__DEFAULT"),n.call(this,s,l,f,u,d),this.type="Plane",this.anims=new o(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(p,g,x),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(h,s,l){h===void 0&&(h=8),s===void 0&&(s=8),l===void 0&&(l=!1);var f=!1;return l&&(f=!0),this.gridWidth=h,this.gridHeight=s,this.isTiled=l,this.clear(),a({mesh:this,widthSegments:h,heightSegments:s,isOrtho:!1,tile:l,flipY:f}),this},setSizeToFrame:function(h){h===void 0&&(h=!0);var s=this.frame;if(this.setPerspective(this.width/s.width,this.height/s.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!h)return this;var l=this.gridWidth,f=this.gridHeight,u=this.vertices,d=s.u0,p=s.u1,g=s.v0,x=s.v1,y,C,P=0;if(this.isTiled)for(g=s.v1,x=s.v0,C=0;C7&&y>7?g.push(d.r,d.g,d.b,l):g.push(p.r,p.g,p.b,f);var C=this.scene.sys.textures.addUint8Array(e(),new Uint8Array(g),16,16);return this.removeCheckerboard(),this.setTexture(C),this.setSizeToFrame(),this.setViewHeight(u),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(h,s){return this.anims.play(h,s)},playReverse:function(h,s){return this.anims.playReverse(h,s)},playAfterDelay:function(h,s){return this.anims.playAfterDelay(h,s)},playAfterRepeat:function(h,s){return this.anims.playAfterRepeat(h,s)},stop:function(){return this.anims.stop()},stopAfterDelay:function(h){return this.anims.stopAfterDelay(h)},stopAfterRepeat:function(h){return this.anims.stopAfterRepeat(h)},stopOnFrame:function(h){return this.anims.stopOnFrame(h)},preUpdate:function(h,s){n.prototype.preUpdate.call(this,h,s),this.anims.update(h,s)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});c.exports=i},56015:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(25305),v=t(13059),a=t(44603),r=t(23568),n=t(35154),e=t(33663);a.register("plane",function(i,h){i===void 0&&(i={});var s=r(i,"key",null),l=r(i,"frame",null),f=n(i,"width",8),u=n(i,"height",8),d=n(i,"tile",!1),p=new e(this.scene,0,0,s,l,f,u,d);h!==void 0&&(i.add=h);var g=n(i,"checkerboard",null);if(g){var y=n(g,"color1",16777215),x=n(g,"color2",255),C=n(g,"alpha1",255),P=n(g,"alpha2",255),M=n(g,"height",128);p.createCheckerboard(y,x,C,P,M)}return o(this.scene,p,i),v(p,i),p})},30985:(c,m,t)=>{/** + */var o=t(25305),v=t(13059),a=t(44603),r=t(23568),n=t(35154),e=t(33663);a.register("plane",function(i,h){i===void 0&&(i={});var s=r(i,"key",null),l=r(i,"frame",null),f=n(i,"width",8),u=n(i,"height",8),d=n(i,"tile",!1),p=new e(this.scene,0,0,s,l,f,u,d);h!==void 0&&(i.add=h);var g=n(i,"checkerboard",null);if(g){var x=n(g,"color1",16777215),y=n(g,"color2",255),C=n(g,"alpha1",255),P=n(g,"alpha2",255),M=n(g,"height",128);p.createCheckerboard(x,y,C,P,M)}return o(this.scene,p,i),v(p,i),p})},30985:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1787,7 +1787,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=function(a,r,n,e){n.addToRenderList(r);var i=a.pipelines.set(r.pipeline),h=o(r,n,e).calc,s=r.width,l=r.height,f=-r._radius,u=-r._radius,d=f+s,p=u+l,g=h.getX(0,0),y=h.getY(0,0),x=h.getX(f,u),C=h.getY(f,u),P=h.getX(f,p),M=h.getY(f,p),w=h.getX(d,p),I=h.getY(d,p),L=h.getX(d,u),B=h.getY(d,u);a.pipelines.preBatch(r),i.batchPointLight(r,n,x,C,P,M,w,I,L,B,g,y),a.pipelines.postBatch(r)};c.exports=v},591:(c,m,t)=>{/** + */var o=t(91296),v=function(a,r,n,e){n.addToRenderList(r);var i=a.pipelines.set(r.pipeline),h=o(r,n,e).calc,s=r.width,l=r.height,f=-r._radius,u=-r._radius,d=f+s,p=u+l,g=h.getX(0,0),x=h.getY(0,0),y=h.getX(f,u),C=h.getY(f,u),P=h.getX(f,p),M=h.getY(f,p),w=h.getX(d,p),I=h.getY(d,p),L=h.getX(d,u),B=h.getY(d,u);a.pipelines.preBatch(r),i.batchPointLight(r,n,y,C,P,M,w,I,L,B,g,x),a.pipelines.postBatch(r)};c.exports=v},591:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1803,7 +1803,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(9674),v=t(83419),a=t(31401),r=t(95643),n=t(36060),e=t(38745),i=t(26099),h=new v({Extends:r,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.Pipeline,a.PostPipeline,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,e],initialize:function(l,f,u,d,p,g,y,x,C){d===void 0&&(d="__DEFAULT"),g===void 0&&(g=2),y===void 0&&(y=!0),r.call(this,l,"Rope"),this.anims=new o(this),this.points=g,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=d==="__DEFAULT",this.dirty=!1,this.horizontal=y,this._flipX=!1,this._flipY=!1,this._perp=new i,this.debugCallback=null,this.debugGraphic=null,this.setTexture(d,p),this.setPosition(f,u),this.setSizeToFrame(),this.initPipeline(n.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(g)&&this.resizeArrays(g.length),this.setPoints(g,x,C),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(s,l){var f=this.anims.currentFrame;this.anims.update(s,l),this.anims.currentFrame!==f&&(this.updateUVs(),this.updateVertices())},play:function(s,l,f){return this.anims.play(s,l,f),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(s,l,f))},setVertical:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(s,l,f)):this},setTintFill:function(s){return s===void 0&&(s=!1),this.tintFill=s,this},setAlphas:function(s,l){var f=this.points.length;if(f<1)return this;var u=this.alphas;s===void 0?s=[1]:!Array.isArray(s)&&l===void 0&&(s=[s]);var d,p=0;if(l!==void 0)for(d=0;dp&&(g=s[p]),u[p]=g,s.length>p+1&&(g=s[p+1]),u[p+1]=g}return this},setColors:function(s){var l=this.points.length;if(l<1)return this;var f=this.colors;s===void 0?s=[16777215]:Array.isArray(s)||(s=[s]);var u,d=0;if(s.length===l)for(u=0;ud&&(p=s[d]),f[d]=p,s.length>d+1&&(p=s[d+1]),f[d+1]=p}return this},setPoints:function(s,l,f){if(s===void 0&&(s=2),typeof s=="number"){var u=s;u<2&&(u=2),s=[];var d,p,g;if(this.horizontal)for(g=-this.frame.halfWidth,p=this.frame.width/(u-1),d=0;d{/** + */var o=t(9674),v=t(83419),a=t(31401),r=t(95643),n=t(36060),e=t(38745),i=t(26099),h=new v({Extends:r,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Flip,a.Mask,a.Pipeline,a.PostPipeline,a.Size,a.Texture,a.Transform,a.Visible,a.ScrollFactor,e],initialize:function(l,f,u,d,p,g,x,y,C){d===void 0&&(d="__DEFAULT"),g===void 0&&(g=2),x===void 0&&(x=!0),r.call(this,l,"Rope"),this.anims=new o(this),this.points=g,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=d==="__DEFAULT",this.dirty=!1,this.horizontal=x,this._flipX=!1,this._flipY=!1,this._perp=new i,this.debugCallback=null,this.debugGraphic=null,this.setTexture(d,p),this.setPosition(f,u),this.setSizeToFrame(),this.initPipeline(n.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(g)&&this.resizeArrays(g.length),this.setPoints(g,y,C),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(s,l){var f=this.anims.currentFrame;this.anims.update(s,l),this.anims.currentFrame!==f&&(this.updateUVs(),this.updateVertices())},play:function(s,l,f){return this.anims.play(s,l,f),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(s,l,f))},setVertical:function(s,l,f){return s===void 0&&(s=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(s,l,f)):this},setTintFill:function(s){return s===void 0&&(s=!1),this.tintFill=s,this},setAlphas:function(s,l){var f=this.points.length;if(f<1)return this;var u=this.alphas;s===void 0?s=[1]:!Array.isArray(s)&&l===void 0&&(s=[s]);var d,p=0;if(l!==void 0)for(d=0;dp&&(g=s[p]),u[p]=g,s.length>p+1&&(g=s[p+1]),u[p+1]=g}return this},setColors:function(s){var l=this.points.length;if(l<1)return this;var f=this.colors;s===void 0?s=[16777215]:Array.isArray(s)||(s=[s]);var u,d=0;if(s.length===l)for(u=0;ud&&(p=s[d]),f[d]=p,s.length>d+1&&(p=s[d+1]),f[d+1]=p}return this},setPoints:function(s,l,f){if(s===void 0&&(s=2),typeof s=="number"){var u=s;u<2&&(u=2),s=[];var d,p,g;if(this.horizontal)for(g=-this.frame.halfWidth,p=this.frame.width/(u-1),d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1823,11 +1823,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline,n),s=o(n,e,i).calc,l=n.vertices,f=n.uv,u=n.colors,d=n.alphas,p=n.alpha,g=v.getTintAppendFloatAlpha,y=e.roundPixels,x=l.length,C=Math.floor(x*.5);h.flush(),r.pipelines.preBatch(n);var P=h.setGameObject(n),M=h.vertexViewF32,w=h.vertexViewU32,I=h.vertexCount*h.currentShader.vertexComponentCount-1,L=0,B=n.tintFill;n.dirty&&n.updateVertices();for(var N=n.debugCallback,G=[],V=0;V{/** + */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline,n),s=o(n,e,i).calc,l=n.vertices,f=n.uv,u=n.colors,d=n.alphas,p=n.alpha,g=v.getTintAppendFloatAlpha,x=e.roundPixels,y=l.length,C=Math.floor(y*.5);h.flush(),r.pipelines.preBatch(n);var P=h.setGameObject(n),M=h.vertexViewF32,w=h.vertexViewU32,I=h.vertexCount*h.currentShader.vertexComponentCount-1,L=0,B=n.tintFill;n.dirty&&n.updateVertices();for(var N=n.debugCallback,G=[],V=0;V{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31401),a=t(95643),r=t(95540),n=t(79291),e=t(61622),i=t(25479),h=t(61340),s=t(95428),l=t(92503),f=new o({Extends:a,Mixins:[v.ComputedSize,v.Depth,v.GetBounds,v.Mask,v.Origin,v.ScrollFactor,v.Transform,v.Visible,i],initialize:function(d,p,g,y,x,C,P,M){g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=128),C===void 0&&(C=128),a.call(this,d,"Shader"),this.blendMode=-1,this.shader;var w=d.sys.renderer;this.renderer=w,this.gl=w.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=w.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 h,this._tempMatrix2=new h,this._tempMatrix3=new h,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=w.width,this._rendererHeight=w.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(g,y),this.setSize(x,C),this.setOrigin(.5,.5),this.setShader(p,P,M),this.renderer.on(l.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(u){return this.renderToTexture?!0:!(a.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setRenderToTexture:function(u,d){if(!this.renderToTexture){var p=this.width,g=this.height,y=this.renderer;this.glTexture=y.createTextureFromSource(null,p,g,0),this.framebuffer=y.createFramebuffer(p,g,this.glTexture,!1),this._rendererWidth=p,this._rendererHeight=g,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),u&&(this.texture=this.scene.sys.textures.addGLTexture(u,this.glTexture))}return this.shader&&(y.pipelines.clear(),this.load(),this.flush(),y.pipelines.rebind()),this},setShader:function(u,d,p){if(this.renderer.contextLost)return this._deferSetShader={key:u,textures:d,textureData:p},this;if(d===void 0&&(d=[]),typeof u=="string"){var g=this.scene.sys.cache.shader;if(!g.has(u))return console.warn("Shader missing: "+u),this;this.shader=g.get(u)}else this.shader=u;var y=this.gl,x=this.renderer;this.program&&x.deleteProgram(this.program);var C=x.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);y.uniformMatrix4fv(y.getUniformLocation(C.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),y.uniformMatrix4fv(y.getUniformLocation(C.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),y.uniform2f(y.getUniformLocation(C.webGLProgram,"uResolution"),this.width,this.height),this.program=C;var P=new Date,M={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:[P.getFullYear(),P.getMonth(),P.getDate(),P.getHours()*60*60+P.getMinutes()*60+P.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=n(!0,{},this.shader.uniforms,M):this.uniforms=M;for(var w=0;w<4;w++)d[w]&&this.setSampler2D("iChannel"+w,d[w],w,p);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(u){return this.pointer=u,this},projOrtho:function(u,d,p,g){if(this.renderer.contextLost){this._deferProjOrtho={left:u,right:d,bottom:p,top:g};return}var y=-1e3,x=1e3,C=1/(u-d),P=1/(p-g),M=1/(y-x),w=this.projectionMatrix;w[0]=-2*C,w[5]=-2*P,w[10]=2*M,w[12]=(u+d)*C,w[13]=(g+p)*P,w[14]=(x+y)*M;var I=this.program,L=this.gl,B=this.renderer;B.setProgram(I),L.uniformMatrix4fv(L.getUniformLocation(I.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=d,this._rendererHeight=p},initUniforms:function(){var u=this.renderer.glFuncMap,d=this.program;this._textureCount=0;for(var p in this.uniforms){var g=this.uniforms[p],y=g.type,x=u[y];g.uniformLocation=this.renderer.createUniformLocation(d,p),y!=="sampler2D"&&(g.glMatrix=x.matrix,g.glValueLength=x.length,g.glFunc=x.func)}},setSampler2DBuffer:function(u,d,p,g,y,x){y===void 0&&(y=0),x===void 0&&(x={});var C=this.uniforms[u];return C.value=d,x.width=p,x.height=g,C.textureData=x,this._textureCount=y,this.initSampler2D(C),this},setSampler2D:function(u,d,p,g){p===void 0&&(p=0);var y=this.scene.sys.textures;if(y.exists(d)){var x=y.getFrame(d);if(x.glTexture&&x.glTexture.isRenderTexture)return this.setSampler2DBuffer(u,x.glTexture,x.width,x.height,p,g);var C=this.uniforms[u],P=x.source;C.textureKey=d,C.source=P.image,C.value=x.glTexture,P.isGLTexture&&(g||(g={}),g.width=P.width,g.height=P.height),g&&(C.textureData=g),this._textureCount=p,this.initSampler2D(C)}return this},setUniform:function(u,d){return e(this.uniforms,u,d),this},getUniform:function(u){return r(this.uniforms,u,null)},setChannel0:function(u,d){return this.setSampler2D("iChannel0",u,0,d)},setChannel1:function(u,d){return this.setSampler2D("iChannel1",u,1,d)},setChannel2:function(u,d){return this.setSampler2D("iChannel2",u,2,d)},setChannel3:function(u,d){return this.setSampler2D("iChannel3",u,3,d)},initSampler2D:function(u){if(u.value){var d=u.textureData;if(d&&!u.value.isRenderTexture){var p=this.gl,g=u.value,y=p[r(d,"magFilter","linear").toUpperCase()],x=p[r(d,"minFilter","linear").toUpperCase()],C=p[r(d,"wrapS","repeat").toUpperCase()],P=p[r(d,"wrapT","repeat").toUpperCase()],M=p[r(d,"format","rgba").toUpperCase()],w=r(d,"flipY",!1),I=r(d,"width",g.width),L=r(d,"height",g.height),B=r(d,"source",g.pixels);d.repeat&&(C=p.REPEAT,P=p.REPEAT),d.width&&(B=null),g.update(B,I,L,w,C,P,x,y,M)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var u=this.gl,d=this.uniforms,p,g,y,x,C,P=0;for(var M in d)p=d[M],y=p.glFunc,g=p.glValueLength,x=p.uniformLocation,C=p.value,C!==null&&(g===1?p.glMatrix?y.call(u,x.webGLUniformLocation,p.transpose,C):y.call(u,x.webGLUniformLocation,C):g===2?y.call(u,x.webGLUniformLocation,C.x,C.y):g===3?y.call(u,x.webGLUniformLocation,C.x,C.y,C.z):g===4?y.call(u,x.webGLUniformLocation,C.x,C.y,C.z,C.w):p.type==="sampler2D"&&(u.activeTexture(u.TEXTURE0+P),u.bindTexture(u.TEXTURE_2D,C.webGLTexture),u.uniform1i(x.webGLUniformLocation,P),P++))},load:function(u){var d=this.gl,p=this.width,g=this.height,y=this.renderer,x=this.program,C=this.viewMatrix;if(!this.renderToTexture){var P=-this._displayOriginX,M=-this._displayOriginY;C[0]=u[0],C[1]=u[1],C[4]=u[2],C[5]=u[3],C[8]=u[4],C[9]=u[5],C[12]=C[0]*P+C[4]*M,C[13]=C[1]*P+C[5]*M}d.useProgram(x.webGLProgram),d.uniformMatrix4fv(d.getUniformLocation(x.webGLProgram,"uViewMatrix"),!1,C),d.uniformMatrix4fv(d.getUniformLocation(x.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),d.uniform2f(d.getUniformLocation(x.webGLProgram,"uResolution"),this.width,this.height);var w=this.uniforms,I=w.resolution;I.value.x=p,I.value.y=g,w.time.value=y.game.loop.getDuration();var L=this.pointer;if(L){var B=w.mouse,N=L.x/p,G=1-L.y/g;B.value.x=N.toFixed(2),B.value.y=G.toFixed(2)}this.syncUniforms()},flush:function(){var u=this.width,d=this.height,p=this.program,g=this.gl,y=this.vertexBuffer,x=this.renderer,C=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(x.setFramebuffer(this.framebuffer),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT)),g.bindBuffer(g.ARRAY_BUFFER,y.webGLBuffer);var P=g.getAttribLocation(p.webGLProgram,"inPosition");P!==-1&&(g.enableVertexAttribArray(P),g.vertexAttribPointer(P,2,g.FLOAT,!1,C,0));var M=this.vertexViewF32;M[3]=d,M[4]=u,M[5]=d,M[8]=u,M[9]=d,M[10]=u;var w=6;g.bufferSubData(g.ARRAY_BUFFER,0,this.bytes.subarray(0,w*C)),g.drawArrays(g.TRIANGLES,0,w),this.renderToTexture&&x.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var u=this._deferSetShader.key,d=this._deferSetShader.textures,p=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(u,d,p)}if(this._deferProjOrtho!==null){var g=this._deferProjOrtho.left,y=this._deferProjOrtho.right,x=this._deferProjOrtho.bottom,C=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(g,y,x,C)}},preDestroy:function(){var u=this.renderer;u.off(l.RESTORE_WEBGL,this.onContextRestored,this),u.deleteProgram(this.program),u.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(u.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),s(this.uniforms,function(d){u.deleteUniformLocation(d.uniformLocation),d.uniformLocation=null})}});c.exports=f},80464:c=>{/** + */var o=t(83419),v=t(31401),a=t(95643),r=t(95540),n=t(79291),e=t(61622),i=t(25479),h=t(61340),s=t(95428),l=t(92503),f=new o({Extends:a,Mixins:[v.ComputedSize,v.Depth,v.GetBounds,v.Mask,v.Origin,v.ScrollFactor,v.Transform,v.Visible,i],initialize:function(d,p,g,x,y,C,P,M){g===void 0&&(g=0),x===void 0&&(x=0),y===void 0&&(y=128),C===void 0&&(C=128),a.call(this,d,"Shader"),this.blendMode=-1,this.shader;var w=d.sys.renderer;this.renderer=w,this.gl=w.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=w.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 h,this._tempMatrix2=new h,this._tempMatrix3=new h,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=w.width,this._rendererHeight=w.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(g,x),this.setSize(y,C),this.setOrigin(.5,.5),this.setShader(p,P,M),this.renderer.on(l.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(u){return this.renderToTexture?!0:!(a.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setRenderToTexture:function(u,d){if(!this.renderToTexture){var p=this.width,g=this.height,x=this.renderer;this.glTexture=x.createTextureFromSource(null,p,g,0),this.framebuffer=x.createFramebuffer(p,g,this.glTexture,!1),this._rendererWidth=p,this._rendererHeight=g,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),u&&(this.texture=this.scene.sys.textures.addGLTexture(u,this.glTexture))}return this.shader&&(x.pipelines.clear(),this.load(),this.flush(),x.pipelines.rebind()),this},setShader:function(u,d,p){if(this.renderer.contextLost)return this._deferSetShader={key:u,textures:d,textureData:p},this;if(d===void 0&&(d=[]),typeof u=="string"){var g=this.scene.sys.cache.shader;if(!g.has(u))return console.warn("Shader missing: "+u),this;this.shader=g.get(u)}else this.shader=u;var x=this.gl,y=this.renderer;this.program&&y.deleteProgram(this.program);var C=y.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);x.uniformMatrix4fv(x.getUniformLocation(C.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),x.uniformMatrix4fv(x.getUniformLocation(C.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),x.uniform2f(x.getUniformLocation(C.webGLProgram,"uResolution"),this.width,this.height),this.program=C;var P=new Date,M={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:[P.getFullYear(),P.getMonth(),P.getDate(),P.getHours()*60*60+P.getMinutes()*60+P.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=n(!0,{},this.shader.uniforms,M):this.uniforms=M;for(var w=0;w<4;w++)d[w]&&this.setSampler2D("iChannel"+w,d[w],w,p);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(u){return this.pointer=u,this},projOrtho:function(u,d,p,g){if(this.renderer.contextLost){this._deferProjOrtho={left:u,right:d,bottom:p,top:g};return}var x=-1e3,y=1e3,C=1/(u-d),P=1/(p-g),M=1/(x-y),w=this.projectionMatrix;w[0]=-2*C,w[5]=-2*P,w[10]=2*M,w[12]=(u+d)*C,w[13]=(g+p)*P,w[14]=(y+x)*M;var I=this.program,L=this.gl,B=this.renderer;B.setProgram(I),L.uniformMatrix4fv(L.getUniformLocation(I.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=d,this._rendererHeight=p},initUniforms:function(){var u=this.renderer.glFuncMap,d=this.program;this._textureCount=0;for(var p in this.uniforms){var g=this.uniforms[p],x=g.type,y=u[x];g.uniformLocation=this.renderer.createUniformLocation(d,p),x!=="sampler2D"&&(g.glMatrix=y.matrix,g.glValueLength=y.length,g.glFunc=y.func)}},setSampler2DBuffer:function(u,d,p,g,x,y){x===void 0&&(x=0),y===void 0&&(y={});var C=this.uniforms[u];return C.value=d,y.width=p,y.height=g,C.textureData=y,this._textureCount=x,this.initSampler2D(C),this},setSampler2D:function(u,d,p,g){p===void 0&&(p=0);var x=this.scene.sys.textures;if(x.exists(d)){var y=x.getFrame(d);if(y.glTexture&&y.glTexture.isRenderTexture)return this.setSampler2DBuffer(u,y.glTexture,y.width,y.height,p,g);var C=this.uniforms[u],P=y.source;C.textureKey=d,C.source=P.image,C.value=y.glTexture,P.isGLTexture&&(g||(g={}),g.width=P.width,g.height=P.height),g&&(C.textureData=g),this._textureCount=p,this.initSampler2D(C)}return this},setUniform:function(u,d){return e(this.uniforms,u,d),this},getUniform:function(u){return r(this.uniforms,u,null)},setChannel0:function(u,d){return this.setSampler2D("iChannel0",u,0,d)},setChannel1:function(u,d){return this.setSampler2D("iChannel1",u,1,d)},setChannel2:function(u,d){return this.setSampler2D("iChannel2",u,2,d)},setChannel3:function(u,d){return this.setSampler2D("iChannel3",u,3,d)},initSampler2D:function(u){if(u.value){var d=u.textureData;if(d&&!u.value.isRenderTexture){var p=this.gl,g=u.value,x=p[r(d,"magFilter","linear").toUpperCase()],y=p[r(d,"minFilter","linear").toUpperCase()],C=p[r(d,"wrapS","repeat").toUpperCase()],P=p[r(d,"wrapT","repeat").toUpperCase()],M=p[r(d,"format","rgba").toUpperCase()],w=r(d,"flipY",!1),I=r(d,"width",g.width),L=r(d,"height",g.height),B=r(d,"source",g.pixels);d.repeat&&(C=p.REPEAT,P=p.REPEAT),d.width&&(B=null),g.update(B,I,L,w,C,P,y,x,M)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var u=this.gl,d=this.uniforms,p,g,x,y,C,P=0;for(var M in d)p=d[M],x=p.glFunc,g=p.glValueLength,y=p.uniformLocation,C=p.value,C!==null&&(g===1?p.glMatrix?x.call(u,y.webGLUniformLocation,p.transpose,C):x.call(u,y.webGLUniformLocation,C):g===2?x.call(u,y.webGLUniformLocation,C.x,C.y):g===3?x.call(u,y.webGLUniformLocation,C.x,C.y,C.z):g===4?x.call(u,y.webGLUniformLocation,C.x,C.y,C.z,C.w):p.type==="sampler2D"&&(u.activeTexture(u.TEXTURE0+P),u.bindTexture(u.TEXTURE_2D,C.webGLTexture),u.uniform1i(y.webGLUniformLocation,P),P++))},load:function(u){var d=this.gl,p=this.width,g=this.height,x=this.renderer,y=this.program,C=this.viewMatrix;if(!this.renderToTexture){var P=-this._displayOriginX,M=-this._displayOriginY;C[0]=u[0],C[1]=u[1],C[4]=u[2],C[5]=u[3],C[8]=u[4],C[9]=u[5],C[12]=C[0]*P+C[4]*M,C[13]=C[1]*P+C[5]*M}d.useProgram(y.webGLProgram),d.uniformMatrix4fv(d.getUniformLocation(y.webGLProgram,"uViewMatrix"),!1,C),d.uniformMatrix4fv(d.getUniformLocation(y.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),d.uniform2f(d.getUniformLocation(y.webGLProgram,"uResolution"),this.width,this.height);var w=this.uniforms,I=w.resolution;I.value.x=p,I.value.y=g,w.time.value=x.game.loop.getDuration();var L=this.pointer;if(L){var B=w.mouse,N=L.x/p,G=1-L.y/g;B.value.x=N.toFixed(2),B.value.y=G.toFixed(2)}this.syncUniforms()},flush:function(){var u=this.width,d=this.height,p=this.program,g=this.gl,x=this.vertexBuffer,y=this.renderer,C=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(y.setFramebuffer(this.framebuffer),g.clearColor(0,0,0,0),g.clear(g.COLOR_BUFFER_BIT)),g.bindBuffer(g.ARRAY_BUFFER,x.webGLBuffer);var P=g.getAttribLocation(p.webGLProgram,"inPosition");P!==-1&&(g.enableVertexAttribArray(P),g.vertexAttribPointer(P,2,g.FLOAT,!1,C,0));var M=this.vertexViewF32;M[3]=d,M[4]=u,M[5]=d,M[8]=u,M[9]=d,M[10]=u;var w=6;g.bufferSubData(g.ARRAY_BUFFER,0,this.bytes.subarray(0,w*C)),g.drawArrays(g.TRIANGLES,0,w),this.renderToTexture&&y.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var u=this._deferSetShader.key,d=this._deferSetShader.textures,p=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(u,d,p)}if(this._deferProjOrtho!==null){var g=this._deferProjOrtho.left,x=this._deferProjOrtho.right,y=this._deferProjOrtho.bottom,C=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(g,x,y,C)}},preDestroy:function(){var u=this.renderer;u.off(l.RESTORE_WEBGL,this.onContextRestored,this),u.deleteProgram(this.program),u.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(u.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),s(this.uniforms,function(d){u.deleteUniformLocation(d.uniformLocation),d.uniformLocation=null})}});c.exports=f},80464:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1851,7 +1851,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70554),v=function(a,r,n,e,i,h){for(var s=o.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*e),l=n.pathData,f=n.pathIndexes,u=0;u{/** + */var o=t(70554),v=function(a,r,n,e,i,h){for(var s=o.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*e),l=n.pathData,f=n.pathIndexes,u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1867,11 +1867,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70554),v=function(a,r,n,e,i){var h=a.strokeTint,s=o.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n);h.TL=s,h.TR=s,h.BL=s,h.BR=s;var l=r.pathData,f=l.length-1,u=r.lineWidth,d=u/2,p=l[0]-e,g=l[1]-i;r.closePath||(f-=2);for(var y=2;y{/** + */var o=t(70554),v=function(a,r,n,e,i){var h=a.strokeTint,s=o.getTintAppendFloatAlpha(r.strokeColor,r.strokeAlpha*n);h.TL=s,h.TR=s,h.BL=s,h.BR=s;var l=r.pathData,f=l.length-1,u=r.lineWidth,d=u/2,p=l[0]-e,g=l[1]-i;r.closePath||(f-=2);for(var x=2;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(13609),v=t(83419),a=t(39506),r=t(94811),n=t(96503),e=t(36383),i=t(17803),h=new v({Extends:i,Mixins:[o],initialize:function(l,f,u,d,p,g,y,x,C){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=0),g===void 0&&(g=360),y===void 0&&(y=!1),i.call(this,l,"Arc",new n(0,0,d)),this._startAngle=p,this._endAngle=g,this._anticlockwise=y,this._iterations=.01,this.setPosition(f,u);var P=this.geom.radius*2;this.setSize(P,P),x!==void 0&&this.setFillStyle(x,C),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(s){this._iterations=s,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(s){this.geom.radius=s;var l=s*2;this.setSize(l,l),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(s){this._startAngle=s,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(s){this._endAngle=s,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(s){this._anticlockwise=s,this.updateData()}},setRadius:function(s){return this.radius=s,this},setIterations:function(s){return s===void 0&&(s=.01),this.iterations=s,this},setStartAngle:function(s,l){return this._startAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},setEndAngle:function(s,l){return this._endAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},updateData:function(){var s=this._iterations,l=s,f=this.geom.radius,u=a(this._startAngle),d=a(this._endAngle),p=this._anticlockwise,g=f,y=f;d-=u,p?d<-e.PI2?d=-e.PI2:d>0&&(d=-e.PI2+d%e.PI2):d>e.PI2?d=e.PI2:d<0&&(d=e.PI2+d%e.PI2);for(var x=[g+Math.cos(u)*f,y+Math.sin(u)*f],C;l<1;)C=d*l+u,x.push(g+Math.cos(C)*f,y+Math.sin(C)*f),l+=s;return C=d+u,x.push(g+Math.cos(C)*f,y+Math.sin(C)*f),x.push(g+Math.cos(u)*f,y+Math.sin(u)*f),this.pathIndexes=r(x),this.pathData=x,this}});c.exports=h},42542:(c,m,t)=>{/** + */var o=t(13609),v=t(83419),a=t(39506),r=t(94811),n=t(96503),e=t(36383),i=t(17803),h=new v({Extends:i,Mixins:[o],initialize:function(l,f,u,d,p,g,x,y,C){f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=128),p===void 0&&(p=0),g===void 0&&(g=360),x===void 0&&(x=!1),i.call(this,l,"Arc",new n(0,0,d)),this._startAngle=p,this._endAngle=g,this._anticlockwise=x,this._iterations=.01,this.setPosition(f,u);var P=this.geom.radius*2;this.setSize(P,P),y!==void 0&&this.setFillStyle(y,C),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(s){this._iterations=s,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(s){this.geom.radius=s;var l=s*2;this.setSize(l,l),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(s){this._startAngle=s,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(s){this._endAngle=s,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(s){this._anticlockwise=s,this.updateData()}},setRadius:function(s){return this.radius=s,this},setIterations:function(s){return s===void 0&&(s=.01),this.iterations=s,this},setStartAngle:function(s,l){return this._startAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},setEndAngle:function(s,l){return this._endAngle=s,l!==void 0&&(this._anticlockwise=l),this.updateData()},updateData:function(){var s=this._iterations,l=s,f=this.geom.radius,u=a(this._startAngle),d=a(this._endAngle),p=this._anticlockwise,g=f,x=f;d-=u,p?d<-e.PI2?d=-e.PI2:d>0&&(d=-e.PI2+d%e.PI2):d>e.PI2?d=e.PI2:d<0&&(d=e.PI2+d%e.PI2);for(var y=[g+Math.cos(u)*f,x+Math.sin(u)*f],C;l<1;)C=d*l+u,y.push(g+Math.cos(C)*f,x+Math.sin(C)*f),l+=s;return C=d+u,y.push(g+Math.cos(C)*f,x+Math.sin(C)*f),y.push(g+Math.cos(u)*f,x+Math.sin(u)*f),this.pathIndexes=r(y),this.pathData=y,this}});c.exports=h},42542:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1895,7 +1895,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX+e._curveBounds.x,f=e._displayOriginY+e._curveBounds.y,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX+e._curveBounds.x,f=e._displayOriginY+e._curveBounds.y,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var x=2;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1915,7 +1915,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var x=2;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1931,11 +1931,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(17803),a=t(26015),r=new o({Extends:v,Mixins:[a],initialize:function(e,i,h,s,l,f,u,d,p,g,y){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=128),l===void 0&&(l=128),f===void 0&&(f=32),u===void 0&&(u=32),v.call(this,e,"Grid",null),this.cellWidth=f,this.cellHeight=u,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(i,h),this.setSize(s,l),this.setFillStyle(d,p),g!==void 0&&this.setOutlineStyle(g,y),this.updateDisplayOrigin()},setFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showCells=!1:(this.fillColor=n,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showAltCells=!1:(this.altFillColor=n,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showOutline=!1:(this.outlineFillColor=n,this.outlineFillAlpha=e,this.showOutline=!0),this}});c.exports=r},49912:(c,m,t)=>{/** + */var o=t(83419),v=t(17803),a=t(26015),r=new o({Extends:v,Mixins:[a],initialize:function(e,i,h,s,l,f,u,d,p,g,x){i===void 0&&(i=0),h===void 0&&(h=0),s===void 0&&(s=128),l===void 0&&(l=128),f===void 0&&(f=32),u===void 0&&(u=32),v.call(this,e,"Grid",null),this.cellWidth=f,this.cellHeight=u,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(i,h),this.setSize(s,l),this.setFillStyle(d,p),g!==void 0&&this.setOutlineStyle(g,x),this.updateDisplayOrigin()},setFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showCells=!1:(this.fillColor=n,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showAltCells=!1:(this.altFillColor=n,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(n,e){return e===void 0&&(e=1),n===void 0?this.showOutline=!1:(this.outlineFillColor=n,this.outlineFillAlpha=e,this.showOutline=!0),this}});c.exports=r},49912:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=-e._displayOriginX,f=-e._displayOriginY,u=i.alpha*e.alpha,d=e.width,p=e.height,g=e.cellWidth,y=e.cellHeight,x=Math.ceil(d/g),C=Math.ceil(p/y),P=g,M=y,w=g-(x*g-d),I=y-(C*y-p),L=e.showCells,B=e.showAltCells,N=e.showOutline,G=0,V=0,K=0,j=0,J=0;if(N&&(P--,M--,w===g&&w--,I===y&&I--),L&&e.fillAlpha>0)for(o(s,e),V=0;V0)for(o(s,e,e.altFillColor,e.altFillAlpha*u),V=0;V0){for(v(s,e,e.outlineFillColor,e.outlineFillAlpha*u),G=1;G{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=-e._displayOriginX,f=-e._displayOriginY,u=i.alpha*e.alpha,d=e.width,p=e.height,g=e.cellWidth,x=e.cellHeight,y=Math.ceil(d/g),C=Math.ceil(p/x),P=g,M=x,w=g-(y*g-d),I=x-(C*x-p),L=e.showCells,B=e.showAltCells,N=e.showOutline,G=0,V=0,K=0,j=0,J=0;if(N&&(P--,M--,w===g&&w--,I===x&&I--),L&&e.fillAlpha>0)for(o(s,e),V=0;V0)for(o(s,e,e.altFillColor,e.altFillAlpha*u),V=0;V0){for(v(s,e,e.outlineFillColor,e.outlineFillAlpha*u),G=1;G{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1947,7 +1947,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc);l.translate(-n._displayOriginX,-n._displayOriginY);var f=e.alpha*n.alpha,u=n.width,d=n.height,p=n.cellWidth,g=n.cellHeight,y=Math.ceil(u/p),x=Math.ceil(d/g),C=p,P=g,M=p-(y*p-u),w=g-(x*g-d),I,L,B=n.showCells,N=n.showAltCells,G=n.showOutline,V=0,K=0,j=0,J=0,X=0;if(G&&(C--,P--,M===p&&M--,w===g&&w--),r.pipelines.preBatch(n),B&&n.fillAlpha>0)for(I=h.fillTint,L=v.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*f),I.TL=L,I.TR=L,I.BL=L,I.BR=L,K=0;K0)for(I=h.fillTint,L=v.getTintAppendFloatAlpha(n.altFillColor,n.altFillAlpha*f),I.TL=L,I.TR=L,I.BL=L,I.BR=L,K=0;K0){var Y=h.strokeTint,b=v.getTintAppendFloatAlpha(n.outlineFillColor,n.outlineFillAlpha*f);for(Y.TL=b,Y.TR=b,Y.BL=b,Y.BR=b,V=1;V{/** + */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc);l.translate(-n._displayOriginX,-n._displayOriginY);var f=e.alpha*n.alpha,u=n.width,d=n.height,p=n.cellWidth,g=n.cellHeight,x=Math.ceil(u/p),y=Math.ceil(d/g),C=p,P=g,M=p-(x*p-u),w=g-(y*g-d),I,L,B=n.showCells,N=n.showAltCells,G=n.showOutline,V=0,K=0,j=0,J=0,X=0;if(G&&(C--,P--,M===p&&M--,w===g&&w--),r.pipelines.preBatch(n),B&&n.fillAlpha>0)for(I=h.fillTint,L=v.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*f),I.TL=L,I.TR=L,I.BL=L,I.BR=L,K=0;K0)for(I=h.fillTint,L=v.getTintAppendFloatAlpha(n.altFillColor,n.altFillAlpha*f),I.TL=L,I.TR=L,I.BL=L,I.BR=L,K=0;K0){var Y=h.strokeTint,b=v.getTintAppendFloatAlpha(n.outlineFillColor,n.outlineFillAlpha*f);for(Y.TL=b,Y.TR=b,Y.BL=b,Y.BR=b,V=1;V{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1967,7 +1967,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=e.alpha*n.alpha;if(n.isFilled){var y,x,C,P,M,w,I,L,B;r.pipelines.preBatch(n),n.showTop&&(y=v.getTintAppendFloatAlpha(n.fillTop,g),x=l.getX(-d,-u),C=l.getY(-d,-u),P=l.getX(0,-p-u),M=l.getY(0,-p-u),w=l.getX(d,-u),I=l.getY(d,-u),L=l.getX(0,p-u),B=l.getY(0,p-u),h.batchQuad(n,x,C,P,M,w,I,L,B,0,0,1,1,y,y,y,y,2)),n.showLeft&&(y=v.getTintAppendFloatAlpha(n.fillLeft,g),x=l.getX(-d,0),C=l.getY(-d,0),P=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),I=l.getY(0,p-u),L=l.getX(-d,-u),B=l.getY(-d,-u),h.batchQuad(n,x,C,P,M,w,I,L,B,0,0,1,1,y,y,y,y,2)),n.showRight&&(y=v.getTintAppendFloatAlpha(n.fillRight,g),x=l.getX(d,0),C=l.getY(d,0),P=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),I=l.getY(0,p-u),L=l.getX(d,-u),B=l.getY(d,-u),h.batchQuad(n,x,C,P,M,w,I,L,B,0,0,1,1,y,y,y,y,2)),r.pipelines.postBatch(n)}};c.exports=a},16933:(c,m,t)=>{/** + */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=e.alpha*n.alpha;if(n.isFilled){var x,y,C,P,M,w,I,L,B;r.pipelines.preBatch(n),n.showTop&&(x=v.getTintAppendFloatAlpha(n.fillTop,g),y=l.getX(-d,-u),C=l.getY(-d,-u),P=l.getX(0,-p-u),M=l.getY(0,-p-u),w=l.getX(d,-u),I=l.getY(d,-u),L=l.getX(0,p-u),B=l.getY(0,p-u),h.batchQuad(n,y,C,P,M,w,I,L,B,0,0,1,1,x,x,x,x,2)),n.showLeft&&(x=v.getTintAppendFloatAlpha(n.fillLeft,g),y=l.getX(-d,0),C=l.getY(-d,0),P=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),I=l.getY(0,p-u),L=l.getX(-d,-u),B=l.getY(-d,-u),h.batchQuad(n,y,C,P,M,w,I,L,B,0,0,1,1,x,x,x,x,2)),n.showRight&&(x=v.getTintAppendFloatAlpha(n.fillRight,g),y=l.getX(d,0),C=l.getY(d,0),P=l.getX(0,p),M=l.getY(0,p),w=l.getX(0,p-u),I=l.getY(0,p-u),L=l.getX(d,-u),B=l.getY(d,-u),h.batchQuad(n,y,C,P,M,w,I,L,B,0,0,1,1,x,x,x,x,2)),r.pipelines.postBatch(n)}};c.exports=a},16933:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -1987,11 +1987,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=n.isReversed,y=e.alpha*n.alpha;if(n.isFilled){r.pipelines.preBatch(n);var x,C,P,M,w,I,L;if(n.showTop&&g){x=v.getTintAppendFloatAlpha(n.fillTop,y),C=l.getX(-d,-u),P=l.getY(-d,-u),M=l.getX(0,-p-u),w=l.getY(0,-p-u),I=l.getX(d,-u),L=l.getY(d,-u);var B=l.getX(0,p-u),N=l.getY(0,p-u);h.batchQuad(n,C,P,M,w,I,L,B,N,0,0,1,1,x,x,x,x,2)}n.showLeft&&(x=v.getTintAppendFloatAlpha(n.fillLeft,y),g?(C=l.getX(-d,-u),P=l.getY(-d,-u),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)):(C=l.getX(-d,0),P=l.getY(-d,0),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)),h.batchTri(n,C,P,M,w,I,L,0,0,1,1,x,x,x,2)),n.showRight&&(x=v.getTintAppendFloatAlpha(n.fillRight,y),g?(C=l.getX(d,-u),P=l.getY(d,-u),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)):(C=l.getX(d,0),P=l.getY(d,0),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)),h.batchTri(n,C,P,M,w,I,L,0,0,1,1,x,x,x,2)),r.pipelines.postBatch(n)}};c.exports=a},57847:(c,m,t)=>{/** + */var o=t(91296),v=t(70554),a=function(r,n,e,i){e.addToRenderList(n);var h=r.pipelines.set(n.pipeline),s=o(n,e,i),l=h.calcMatrix.copyFrom(s.calc),f=n.width,u=n.height,d=f/2,p=f/n.projection,g=n.isReversed,x=e.alpha*n.alpha;if(n.isFilled){r.pipelines.preBatch(n);var y,C,P,M,w,I,L;if(n.showTop&&g){y=v.getTintAppendFloatAlpha(n.fillTop,x),C=l.getX(-d,-u),P=l.getY(-d,-u),M=l.getX(0,-p-u),w=l.getY(0,-p-u),I=l.getX(d,-u),L=l.getY(d,-u);var B=l.getX(0,p-u),N=l.getY(0,p-u);h.batchQuad(n,C,P,M,w,I,L,B,N,0,0,1,1,y,y,y,y,2)}n.showLeft&&(y=v.getTintAppendFloatAlpha(n.fillLeft,x),g?(C=l.getX(-d,-u),P=l.getY(-d,-u),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)):(C=l.getX(-d,0),P=l.getY(-d,0),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)),h.batchTri(n,C,P,M,w,I,L,0,0,1,1,y,y,y,2)),n.showRight&&(y=v.getTintAppendFloatAlpha(n.fillRight,x),g?(C=l.getX(d,-u),P=l.getY(d,-u),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)):(C=l.getX(d,0),P=l.getY(d,0),M=l.getX(0,p),w=l.getY(0,p),I=l.getX(0,p-u),L=l.getY(0,p-u)),h.batchTri(n,C,P,M,w,I,L,0,0,1,1,y,y,y,2)),r.pipelines.postBatch(n)}};c.exports=a},57847:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(17803),a=t(23031),r=t(36823),n=new o({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=128),d===void 0&&(d=0),v.call(this,i,"Line",new a(l,f,u,d));var y=Math.max(1,this.geom.right-this.geom.left),x=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(h,s),this.setSize(y,x),p!==void 0&&this.setStrokeStyle(1,p,g),this.updateDisplayOrigin()},setLineWidth:function(e,i){return i===void 0&&(i=e),this._startWidth=e,this._endWidth=i,this.lineWidth=e,this},setTo:function(e,i,h,s){return this.geom.setTo(e,i,h,s),this}});c.exports=n},17440:(c,m,t)=>{/** + */var o=t(83419),v=t(17803),a=t(23031),r=t(36823),n=new o({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=128),d===void 0&&(d=0),v.call(this,i,"Line",new a(l,f,u,d));var x=Math.max(1,this.geom.right-this.geom.left),y=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(h,s),this.setSize(x,y),p!==void 0&&this.setStrokeStyle(1,p,g),this.updateDisplayOrigin()},setLineWidth:function(e,i){return i===void 0&&(i=e),this._startWidth=e,this._endWidth=i,this.lineWidth=e,this},setTo:function(e,i,h,s){return this.geom.setTo(e,i,h,s),this}});c.exports=n},17440:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2011,11 +2011,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(90273),v=t(83419),a=t(94811),r=t(13829),n=t(25717),e=t(17803),i=t(5469),h=new v({Extends:e,Mixins:[o],initialize:function(l,f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),e.call(this,l,"Polygon",new n(d));var y=r(this.geom);this.setPosition(f,u),this.setSize(y.width,y.height),p!==void 0&&this.setFillStyle(p,g),this.updateDisplayOrigin(),this.updateData()},smooth:function(s){s===void 0&&(s=1);for(var l=0;l{/** + */var o=t(90273),v=t(83419),a=t(94811),r=t(13829),n=t(25717),e=t(17803),i=t(5469),h=new v({Extends:e,Mixins:[o],initialize:function(l,f,u,d,p,g){f===void 0&&(f=0),u===void 0&&(u=0),e.call(this,l,"Polygon",new n(d));var x=r(this.geom);this.setPosition(f,u),this.setSize(x.width,x.height),p!==void 0&&this.setFillStyle(p,g),this.updateDisplayOrigin(),this.updateData()},smooth:function(s){s===void 0&&(s=1);for(var l=0;l{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var x=2;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2055,7 +2055,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var y=2;y{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.pathData,d=u.length-1,p=u[0]-l,g=u[1]-f;s.beginPath(),s.moveTo(p,g),e.closePath||(d-=2);for(var x=2;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2071,11 +2071,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(17803),a=t(16483),r=t(96195),n=new o({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g,y,x){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=128),u===void 0&&(u=64),d===void 0&&(d=0),p===void 0&&(p=128),g===void 0&&(g=128),v.call(this,i,"Triangle",new a(l,f,u,d,p,g));var C=this.geom.right-this.geom.left,P=this.geom.bottom-this.geom.top;this.setPosition(h,s),this.setSize(C,P),y!==void 0&&this.setFillStyle(y,x),this.updateDisplayOrigin(),this.updateData()},setTo:function(e,i,h,s,l,f){return this.geom.setTo(e,i,h,s,l,f),this.updateData()},updateData:function(){var e=[],i=this.geom,h=this._tempLine;return i.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),i.getLineB(h),e.push(h.x2,h.y2),i.getLineC(h),e.push(h.x2,h.y2),this.pathData=e,this}});c.exports=n},85172:(c,m,t)=>{/** + */var o=t(83419),v=t(17803),a=t(16483),r=t(96195),n=new o({Extends:v,Mixins:[r],initialize:function(i,h,s,l,f,u,d,p,g,x,y){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=128),u===void 0&&(u=64),d===void 0&&(d=0),p===void 0&&(p=128),g===void 0&&(g=128),v.call(this,i,"Triangle",new a(l,f,u,d,p,g));var C=this.geom.right-this.geom.left,P=this.geom.bottom-this.geom.top;this.setPosition(h,s),this.setSize(C,P),x!==void 0&&this.setFillStyle(x,y),this.updateDisplayOrigin(),this.updateData()},setTo:function(e,i,h,s,l,f){return this.geom.setTo(e,i,h,s,l,f),this.updateData()},updateData:function(){var e=[],i=this.geom,h=this._tempLine;return i.getLineA(h),e.push(h.x1,h.y1,h.x2,h.y2),i.getLineB(h),e.push(h.x2,h.y2),i.getLineC(h),e.push(h.x2,h.y2),this.pathData=e,this}});c.exports=n},85172:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.geom.x1-l,d=e.geom.y1-f,p=e.geom.x2-l,g=e.geom.y2-f,y=e.geom.x3-l,x=e.geom.y3-f;s.beginPath(),s.moveTo(u,d),s.lineTo(p,g),s.lineTo(y,x),s.closePath(),e.isFilled&&(o(s,e),s.fill()),e.isStroked&&(v(s,e),s.stroke()),s.restore()}};c.exports=r},45245:(c,m,t)=>{/** + */var o=t(65960),v=t(75177),a=t(20926),r=function(n,e,i,h){i.addToRenderList(e);var s=n.currentContext;if(a(n,s,e,i,h)){var l=e._displayOriginX,f=e._displayOriginY,u=e.geom.x1-l,d=e.geom.y1-f,p=e.geom.x2-l,g=e.geom.y2-f,x=e.geom.x3-l,y=e.geom.y3-f;s.beginPath(),s.moveTo(u,d),s.lineTo(p,g),s.lineTo(x,y),s.closePath(),e.isFilled&&(o(s,e),s.fill()),e.isStroked&&(v(s,e),s.stroke()),s.restore()}};c.exports=r},45245:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2087,7 +2087,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(91296),v=t(34682),a=t(70554),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=o(e,i,h);s.calcMatrix.copyFrom(l.calc);var f=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var p=s.fillTint,g=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d);p.TL=g,p.TR=g,p.BL=g,p.BR=g;var y=e.geom.x1-f,x=e.geom.y1-u,C=e.geom.x2-f,P=e.geom.y2-u,M=e.geom.x3-f,w=e.geom.y3-u;s.batchFillTriangle(y,x,C,P,M,w,l.sprite,l.camera)}e.isStroked&&v(s,e,d,f,u),n.pipelines.postBatch(e)};c.exports=r},68287:(c,m,t)=>{/** + */var o=t(91296),v=t(34682),a=t(70554),r=function(n,e,i,h){i.addToRenderList(e);var s=n.pipelines.set(e.pipeline),l=o(e,i,h);s.calcMatrix.copyFrom(l.calc);var f=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;if(n.pipelines.preBatch(e),e.isFilled){var p=s.fillTint,g=a.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*d);p.TL=g,p.TR=g,p.BL=g,p.BR=g;var x=e.geom.x1-f,y=e.geom.y1-u,C=e.geom.x2-f,P=e.geom.y2-u,M=e.geom.x3-f,w=e.geom.y3-u;s.batchFillTriangle(x,y,C,P,M,w,l.sprite,l.camera)}e.isStroked&&v(s,e,d,f,u),n.pipelines.postBatch(e)};c.exports=r},68287:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2119,19 +2119,19 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(27919),v=function(a){var r=o.create(this),n=r.getContext("2d",{willReadFrequently:!0});a.syncFont(r,n);var e=n.measureText(a.testString);if("actualBoundingBoxAscent"in e){var i=e.actualBoundingBoxAscent,h=e.actualBoundingBoxDescent;return o.remove(r),{ascent:i,descent:h,fontSize:i+h}}var s=Math.ceil(e.width*a.baselineX),l=s,f=2*l;l=l*a.baselineY|0,r.width=s,r.height=f,n.fillStyle="#f00",n.fillRect(0,0,s,f),n.font=a._font,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a.testString,0,l);var u={ascent:0,descent:0,fontSize:0},d=n.getImageData(0,0,s,f);if(!d)return u.ascent=l,u.descent=l+6,u.fontSize=u.ascent+u.descent,o.remove(r),u;var p=d.data,g=p.length,y=s*4,x,C,P=0,M=!1;for(x=0;xl;x--){for(C=0;C{/** + */var o=t(27919),v=function(a){var r=o.create(this),n=r.getContext("2d",{willReadFrequently:!0});a.syncFont(r,n);var e=n.measureText(a.testString);if("actualBoundingBoxAscent"in e){var i=e.actualBoundingBoxAscent,h=e.actualBoundingBoxDescent;return o.remove(r),{ascent:i,descent:h,fontSize:i+h}}var s=Math.ceil(e.width*a.baselineX),l=s,f=2*l;l=l*a.baselineY|0,r.width=s,r.height=f,n.fillStyle="#f00",n.fillRect(0,0,s,f),n.font=a._font,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(a.testString,0,l);var u={ascent:0,descent:0,fontSize:0},d=n.getImageData(0,0,s,f);if(!d)return u.ascent=l,u.descent=l+6,u.fontSize=u.ascent+u.descent,o.remove(r),u;var p=d.data,g=p.length,x=s*4,y,C,P=0,M=!1;for(y=0;yl;y--){for(C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(40366),v=t(27919),a=t(83419),r=t(31401),n=t(95643),e=t(14220),i=t(35154),h=t(35846),s=t(61771),l=t(35762),f=t(45650),u=new a({Extends:n,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,s],initialize:function(p,g,y,x,C){g===void 0&&(g=0),y===void 0&&(y=0),n.call(this,p,"Text"),this.renderer=p.sys.renderer,this.setPosition(g,y),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=v.create(this),this.context,this.style=new l(this,C),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,this.style.resolution===0&&(this.style.resolution=1),this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=p.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(x),C&&C.padding&&this.setPadding(C.padding),C&&C.lineSpacing&&this.setLineSpacing(C.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",o(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(d){var p=this.style;if(p.wordWrapCallback){var g=p.wordWrapCallback.call(p.wordWrapCallbackScope,d,this);return Array.isArray(g)&&(g=g.join(` -`)),g}else return p.wordWrapWidth?p.wordWrapUseAdvanced?this.advancedWordWrap(d,this.context,this.style.wordWrapWidth):this.basicWordWrap(d,this.context,this.style.wordWrapWidth):d},advancedWordWrap:function(d,p,g){for(var y="",x=d.replace(/ +/gi," ").split(this.splitRegExp),C=x.length,P=0;PL){if(N===0){for(var j=V;j.length&&(j=j.slice(0,-1),K=p.measureText(j).width,!(K<=L)););if(!j.length)throw new Error("wordWrapWidth < a single character");var J=G.substr(j.length);B[N]=J,w+=j}var X=B[N].length?N:N+1,Y=B.slice(X).join(" ").replace(/[ \n]*$/gi,"");x.splice(P+1,0,Y),C=x.length;break}else w+=V,L-=K}y+=w.replace(/[ \n]*$/gi,"")+` -`}return y=y.replace(/[\s|\n]*$/gi,""),y},basicWordWrap:function(d,p,g){for(var y="",x=d.split(this.splitRegExp),C=x.length-1,P=p.measureText(" ").width,M=0;M<=C;M++){for(var w=g,I=x[M].split(" "),L=I.length-1,B=0;B<=L;B++){var N=I[B],G=p.measureText(N).width,V=G;Bw&&B>0&&(y+=` -`,w=g),y+=N,BL){if(N===0){for(var j=V;j.length&&(j=j.slice(0,-1),K=p.measureText(j).width,!(K<=L)););if(!j.length)throw new Error("wordWrapWidth < a single character");var J=G.substr(j.length);B[N]=J,w+=j}var X=B[N].length?N:N+1,Y=B.slice(X).join(" ").replace(/[ \n]*$/gi,"");y.splice(P+1,0,Y),C=y.length;break}else w+=V,L-=K}x+=w.replace(/[ \n]*$/gi,"")+` +`}return x=x.replace(/[\s|\n]*$/gi,""),x},basicWordWrap:function(d,p,g){for(var x="",y=d.split(this.splitRegExp),C=y.length-1,P=p.measureText(" ").width,M=0;M<=C;M++){for(var w=g,I=y[M].split(" "),L=I.length-1,B=0;B<=L;B++){var N=I[B],G=p.measureText(N).width,V=G;Bw&&B>0&&(x+=` +`,w=g),x+=N,B0&&(G+=M.lineSpacing*V),g.rtl)N=L-N-w.left-w.right;else if(g.align==="right")N+=I-M.lineWidths[V];else if(g.align==="center")N+=(I-M.lineWidths[V])/2;else if(g.align==="justify"){var K=.85;if(M.lineWidths[V]/M.width>=K){var j=M.width-M.lineWidths[V],J=p.measureText(" ").width,X=P[V].trim(),Y=X.split(" ");j+=(P[V].length-X.length)*J;for(var b=Math.floor(j/J),z=0;b>0;)Y[z]+=" ",z=(z+1)%(Y.length-1||1),--b;P[V]=Y.join(" ")}}if(this.autoRound&&(N=Math.round(N),G=Math.round(G)),g.strokeThickness&&(g.syncShadow(p,g.shadowStroke),p.strokeText(P[V],N,G)),g.color){g.syncShadow(p,g.shadowFill);var W=this.letterSpacing;if(W!==0)for(var H=0,Z=P[V].split(""),Q=0;Q{/** +`+d:d);return g!==this._text&&(this._text=g,this.updateText()),this},setStyle:function(d){return this.style.setStyle(d)},setFont:function(d){return this.style.setFont(d)},setFontFamily:function(d){return this.style.setFontFamily(d)},setFontSize:function(d){return this.style.setFontSize(d)},setFontStyle:function(d){return this.style.setFontStyle(d)},setFixedSize:function(d,p){return this.style.setFixedSize(d,p)},setBackgroundColor:function(d){return this.style.setBackgroundColor(d)},setFill:function(d){return this.style.setFill(d)},setColor:function(d){return this.style.setColor(d)},setStroke:function(d,p){return this.style.setStroke(d,p)},setShadow:function(d,p,g,x,y,C){return this.style.setShadow(d,p,g,x,y,C)},setShadowOffset:function(d,p){return this.style.setShadowOffset(d,p)},setShadowColor:function(d){return this.style.setShadowColor(d)},setShadowBlur:function(d){return this.style.setShadowBlur(d)},setShadowStroke:function(d){return this.style.setShadowStroke(d)},setShadowFill:function(d){return this.style.setShadowFill(d)},setWordWrapWidth:function(d,p){return this.style.setWordWrapWidth(d,p)},setWordWrapCallback:function(d,p){return this.style.setWordWrapCallback(d,p)},setAlign:function(d){return this.style.setAlign(d)},setResolution:function(d){return this.style.setResolution(d)},setLineSpacing:function(d){return this.lineSpacing=d,this.updateText()},setLetterSpacing:function(d){return this.letterSpacing=d,this.updateText()},setPadding:function(d,p,g,x){if(typeof d=="object"){var y=d,C=i(y,"x",null);C!==null?(d=C,g=C):(d=i(y,"left",0),g=i(y,"right",d));var P=i(y,"y",null);P!==null?(p=P,x=P):(p=i(y,"top",0),x=i(y,"bottom",p))}else d===void 0&&(d=0),p===void 0&&(p=d),g===void 0&&(g=d),x===void 0&&(x=p);return this.padding.left=d,this.padding.top=p,this.padding.right=g,this.padding.bottom=x,this.updateText()},setMaxLines:function(d){return this.style.setMaxLines(d)},setRTL:function(d){d===void 0&&(d=!0);var p=this.style;return p.rtl===d?this:(p.rtl=d,d?(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",o(this.canvas,this.scene.sys.canvas)):(this.canvas.dir="ltr",this.context.direction="ltr"),p.align==="left"?p.align="right":p.align==="right"&&(p.align="left"),this)},updateText:function(){var d=this.canvas,p=this.context,g=this.style,x=g.resolution,y=g.metrics;g.syncFont(d,p);var C=this._text;(g.wordWrapWidth||g.wordWrapCallback)&&(C=this.runWordWrap(this._text));var P=C.split(this.splitRegExp),M=e(this,y,P),w=this.padding,I;g.fixedWidth===0?(this.width=M.width+w.left+w.right,I=M.width):(this.width=g.fixedWidth,I=this.width-w.left-w.right,I0&&(G+=M.lineSpacing*V),g.rtl)N=L-N-w.left-w.right;else if(g.align==="right")N+=I-M.lineWidths[V];else if(g.align==="center")N+=(I-M.lineWidths[V])/2;else if(g.align==="justify"){var K=.85;if(M.lineWidths[V]/M.width>=K){var j=M.width-M.lineWidths[V],J=p.measureText(" ").width,X=P[V].trim(),Y=X.split(" ");j+=(P[V].length-X.length)*J;for(var b=Math.floor(j/J),z=0;b>0;)Y[z]+=" ",z=(z+1)%(Y.length-1||1),--b;P[V]=Y.join(" ")}}if(this.autoRound&&(N=Math.round(N),G=Math.round(G)),g.strokeThickness&&(g.syncShadow(p,g.shadowStroke),p.strokeText(P[V],N,G)),g.color){g.syncShadow(p,g.shadowFill);var W=this.letterSpacing;if(W!==0)for(var H=0,Z=P[V].split(""),Q=0;Q{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2159,7 +2159,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(27919),v=t(83419),a=t(31401),r=t(95643),n=t(98439),e=t(68703),i=t(56295),h=t(45650),s=t(26099),l=8,f=new v({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,i],initialize:function(d,p,g,y,x,C,P){var M=d.sys.renderer;r.call(this,d,"TileSprite");var w=d.sys.textures.get(C),I=w.get(P);I.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),w=d.sys.textures.get("__MISSING"),I=w.get()),w.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),w=d.sys.textures.get("__MISSING"),I=w.get()),!y||!x?(y=I.width,x=I.height):(y=Math.floor(y),x=Math.floor(x)),this._tilePosition=new s,this._tileScale=new s(1,1),this.dirty=!1,this.renderer=M,this.canvas=o.create(this,y,x),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=w,this.displayFrame=I,this._crop=this.resetCropObject(),this._textureKey=h(),this.texture=d.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=n(I.width),this.potHeight=n(I.height),this.fillCanvas=o.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(p,g),this.setSize(y,x),this.setFrame(P),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(u,d){return this.displayTexture=this.scene.sys.textures.get(u),this.setFrame(d)},setFrame:function(u){var d=this.displayTexture.get(u);return this.potWidth=n(d.width),this.potHeight=n(d.height),this.canvas.width=0,!d.cutWidth||!d.cutHeight?this.renderFlags&=~l:this.renderFlags|=l,this.displayFrame=d,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(u,d){return u!==void 0&&(this.tilePositionX=u),d!==void 0&&(this.tilePositionY=d),this},setTileScale:function(u,d){return u===void 0&&(u=this.tileScaleX),d===void 0&&(d=u),this.tileScaleX=u,this.tileScaleY=d,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var u=this.displayFrame;if(u.source.isRenderTexture||u.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var d=this.fillContext,p=this.fillCanvas,g=this.potWidth,y=this.potHeight;(!this.renderer||!this.renderer.gl)&&(g=u.cutWidth,y=u.cutHeight),d.clearRect(0,0,g,y),p.width=g,p.height=y,d.drawImage(u.source.image,u.cutX,u.cutY,u.cutWidth,u.cutHeight,0,0,g,y),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(p,this.fillPattern):this.fillPattern=d.createPattern(p,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var u=this.canvas;if((u.width!==this.width||u.height!==this.height)&&(u.width=this.width,u.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;return}var d=this.context;this.scene.sys.game.config.antialias||e.disable(d);var p=this._tileScale.x,g=this._tileScale.y,y=this._tilePosition.x,x=this._tilePosition.y;d.clearRect(0,0,this.width,this.height),d.save(),d.scale(p,g),d.translate(-y,-x),d.fillStyle=this.fillPattern,d.fillRect(y,x,this.width/p,this.height/g),d.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),o.remove(this.canvas),o.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var u=this.texture;u&&u.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(u){this._tilePosition.x=u,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(u){this._tilePosition.y=u,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(u){this._tileScale.x=u,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(u){this._tileScale.y=u,this.dirty=!0}}});c.exports=f},46992:c=>{/** + */var o=t(27919),v=t(83419),a=t(31401),r=t(95643),n=t(98439),e=t(68703),i=t(56295),h=t(45650),s=t(26099),l=8,f=new v({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,i],initialize:function(d,p,g,x,y,C,P){var M=d.sys.renderer;r.call(this,d,"TileSprite");var w=d.sys.textures.get(C),I=w.get(P);I.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),w=d.sys.textures.get("__MISSING"),I=w.get()),w.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),w=d.sys.textures.get("__MISSING"),I=w.get()),!x||!y?(x=I.width,y=I.height):(x=Math.floor(x),y=Math.floor(y)),this._tilePosition=new s,this._tileScale=new s(1,1),this.dirty=!1,this.renderer=M,this.canvas=o.create(this,x,y),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=w,this.displayFrame=I,this._crop=this.resetCropObject(),this._textureKey=h(),this.texture=d.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=n(I.width),this.potHeight=n(I.height),this.fillCanvas=o.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(p,g),this.setSize(x,y),this.setFrame(P),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(u,d){return this.displayTexture=this.scene.sys.textures.get(u),this.setFrame(d)},setFrame:function(u){var d=this.displayTexture.get(u);return this.potWidth=n(d.width),this.potHeight=n(d.height),this.canvas.width=0,!d.cutWidth||!d.cutHeight?this.renderFlags&=~l:this.renderFlags|=l,this.displayFrame=d,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(u,d){return u!==void 0&&(this.tilePositionX=u),d!==void 0&&(this.tilePositionY=d),this},setTileScale:function(u,d){return u===void 0&&(u=this.tileScaleX),d===void 0&&(d=u),this.tileScaleX=u,this.tileScaleY=d,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var u=this.displayFrame;if(u.source.isRenderTexture||u.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var d=this.fillContext,p=this.fillCanvas,g=this.potWidth,x=this.potHeight;(!this.renderer||!this.renderer.gl)&&(g=u.cutWidth,x=u.cutHeight),d.clearRect(0,0,g,x),p.width=g,p.height=x,d.drawImage(u.source.image,u.cutX,u.cutY,u.cutWidth,u.cutHeight,0,0,g,x),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(p,this.fillPattern):this.fillPattern=d.createPattern(p,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var u=this.canvas;if((u.width!==this.width||u.height!==this.height)&&(u.width=this.width,u.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;return}var d=this.context;this.scene.sys.game.config.antialias||e.disable(d);var p=this._tileScale.x,g=this._tileScale.y,x=this._tilePosition.x,y=this._tilePosition.y;d.clearRect(0,0,this.width,this.height),d.save(),d.scale(p,g),d.translate(-x,-y),d.fillStyle=this.fillPattern,d.fillRect(x,y,this.width/p,this.height/g),d.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),o.remove(this.canvas),o.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var u=this.texture;u&&u.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(u){this._tilePosition.x=u,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(u){this._tilePosition.y=u,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(u){this._tileScale.x=u,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(u){this._tileScale.y=u,this.dirty=!0}}});c.exports=f},46992:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2183,7 +2183,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(45319),v=t(83419),a=t(31401),r=t(51708),n=t(8443),e=t(95643),i=t(36383),h=t(14463),s=t(45650),l=t(10247),f=new v({Extends:e,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,l],initialize:function(d,p,g,y){e.call(this,d,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=s(),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 x=d.sys.game;this._device=x.device.video,this.setPosition(p,g),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),x.events.on(n.PAUSE,this.globalPause,this),x.events.on(n.RESUME,this.globalResume,this);var C=d.sys.sound;C&&C.on(h.GLOBAL_MUTE,this.globalMute,this),y&&this.load(y)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(u){var d=this.scene.sys.cache.video.get(u);return d?(this.cacheKey=u,this.loadHandler(d.url,d.noAudio,d.crossOrigin)):console.warn("No video in cache for key: "+u),this},changeSource:function(u,d,p,g,y){d===void 0&&(d=!0),p===void 0&&(p=!1),this.cacheKey!==u&&(this.load(u),d&&this.play(p,g,y))},getVideoKey:function(){return this.cacheKey},loadURL:function(u,d,p){d===void 0&&(d=!1);var g=this._device.getVideoURL(u);return g?(this.cacheKey="",this.loadHandler(g.url,d,p)):console.warn("No supported video format found for "+u),this},loadMediaStream:function(u,d,p){return this.loadHandler(null,d,p,u)},loadHandler:function(u,d,p,g){d||(d=!1);var y=this.video;if(y?(this.removeLoadEventHandlers(),this.stop()):(y=document.createElement("video"),y.controls=!1,y.setAttribute("playsinline","playsinline"),y.setAttribute("preload","auto"),y.setAttribute("disablePictureInPicture","true")),d?(y.muted=!0,y.defaultMuted=!0,y.setAttribute("autoplay","autoplay")):(y.muted=!1,y.defaultMuted=!1,y.removeAttribute("autoplay")),p?y.setAttribute("crossorigin",p):y.removeAttribute("crossorigin"),g)if("srcObject"in y)try{y.srcObject=g}catch(C){if(C.name!=="TypeError")throw C;y.src=URL.createObjectURL(g)}else y.src=URL.createObjectURL(g);else y.src=u;this.retry=0,this.video=y,this._playCalled=!1,y.load(),this.addLoadEventHandlers();var x=this.scene.sys.textures.get(this._key);return this.setTexture(x),this},requestVideoFrame:function(u,d){var p=this.video;if(p){var g=d.width,y=d.height,x=this.videoTexture,C=this.videoTextureSource,P=!x||C.source!==p;P?(this._codePaused=p.paused,this._codeMuted=p.muted,x?(C.source=p,C.width=g,C.height=y,x.get().setSize(g,y)):(x=this.scene.sys.textures.create(this._key,p,g,y),x.add("__BASE",0,0,0,g,y),this.setTexture(x),this.videoTexture=x,this.videoTextureSource=x.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(r.VIDEO_TEXTURE,this,x)),this.setSizeToFrame(),this.updateDisplayOrigin()):C.update(),this.isStalled=!1,this.metadata=d;var M=d.mediaTime;P&&(this._lastUpdate=M,this.emit(r.VIDEO_CREATED,this,g,y),this.frameReady||(this.frameReady=!0,this.emit(r.VIDEO_PLAY,this))),this._playingMarker?M>=this._markerOut&&(p.loop?(p.currentTime=this._markerIn,this.emit(r.VIDEO_LOOP,this)):(this.stop(!1),this.emit(r.VIDEO_COMPLETE,this))):M-1&&p>d&&p=0&&!isNaN(p)&&p>d&&(this.markers[u]=[d,p]),this},playMarker:function(u,d){var p=this.markers[u];return p&&this.play(d,p[0],p[1]),this},removeMarker:function(u){return delete this.markers[u],this},snapshot:function(u,d){return u===void 0&&(u=this.width),d===void 0&&(d=this.height),this.snapshotArea(0,0,this.width,this.height,u,d)},snapshotArea:function(u,d,p,g,y,x){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=this.width),g===void 0&&(g=this.height),y===void 0&&(y=p),x===void 0&&(x=g);var C=this.video,P=this.snapshotTexture;return P?(P.setSize(y,x),C&&P.context.drawImage(C,u,d,p,g,0,0,y,x)):(P=this.scene.sys.textures.createCanvas(s(),y,x),this.snapshotTexture=P,C&&P.context.drawImage(C,u,d,p,g,0,0,y,x)),P.update()},saveSnapshotTexture:function(u){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,u):this.snapshotTexture=this.scene.sys.textures.createCanvas(u,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(r.VIDEO_UNLOCKED,this));var u=this.scene.sys.sound;u&&u.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(u){var d=u.name;d==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(r.VIDEO_LOCKED,this)):d==="NotSupportedError"?(this.stop(!1),this.emit(r.VIDEO_UNSUPPORTED,this,u)):(this.stop(!1),this.emit(r.VIDEO_ERROR,this,u))},legacyPlayHandler:function(){var u=this.video;u&&(this.playSuccess(),u.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(r.VIDEO_PLAYING,this)},loadErrorHandler:function(u){this.stop(!1),this.emit(r.VIDEO_ERROR,this,u)},metadataHandler:function(u){this.emit(r.VIDEO_METADATA,this,u)},setSizeToFrame:function(u){u||(u=this.frame),this.width=u.realWidth,this.height=u.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var d=this.input;return d&&!d.customHitArea&&(d.hitArea.width=this.width,d.hitArea.height=this.height),this},stalledHandler:function(u){this.isStalled=!0,this.emit(r.VIDEO_STALLED,this,u)},completeHandler:function(){this._playCalled=!1,this.emit(r.VIDEO_COMPLETE,this)},preUpdate:function(u,d){var p=this.video;!p||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=d,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(u){var d=this.video;if(d){var p=d.duration;if(p!==1/0&&!isNaN(p)){var g=p*u;this.setCurrentTime(g)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(u){var d=this.video;if(d){if(typeof u=="string"){var p=u[0],g=parseFloat(u.substr(1));p==="+"?u=d.currentTime+g:p==="-"&&(u=d.currentTime-g)}d.currentTime=u}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(r.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(r.VIDEO_SEEKED,this)},getProgress:function(){var u=this.video;if(u){var d=u.duration;if(d!==1/0&&!isNaN(d))return u.currentTime/d}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(u){u===void 0&&(u=!0),this._codeMuted=u;var d=this.video;return d&&(d.muted=this._systemMuted?!0:u),this},isMuted:function(){return this._codeMuted},globalMute:function(u,d){this._systemMuted=d;var p=this.video;p&&(p.muted=this._codeMuted?!0:d)},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(u){u===void 0&&(u=!0);var d=this.video;return this._codePaused=u,d&&!d.ended&&(u?d.paused||(this.removeEventHandlers(),d.pause()):u||(this._playCalled?d.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(u){return u===void 0&&(u=1),this.video&&(this.video.volume=o(u,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(u){return this.video&&(this.video.playbackRate=u),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(u){return u===void 0&&(u=!0),this.video&&(this.video.loop=u),this},isPlaying:function(){return this.video?!(this.video.paused||this.video.ended):!1},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(u,d){return d===void 0&&(d=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,u),this.videoTextureSource.setFlipY(d)),this._key=u,this.flipY=d,!!this.videoTexture},stop:function(u){u===void 0&&(u=!0);var d=this.video;return d&&(this.removeEventHandlers(),d.cancelVideoFrameCallback(this._rfvCallbackId),d.pause()),this.retry=0,this._playCalled=!1,u&&this.emit(r.VIDEO_STOP,this),this},removeVideoElement:function(){var u=this.video;if(u){for(u.parentNode&&u.parentNode.removeChild(u);u.hasChildNodes();)u.removeChild(u.firstChild);u.removeAttribute("autoplay"),u.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var u=this.scene.sys.game.events;u.off(n.PAUSE,this.globalPause,this),u.off(n.RESUME,this.globalResume,this);var d=this.scene.sys.sound;d&&d.off(h.GLOBAL_MUTE,this.globalMute,this)}});c.exports=f},58352:c=>{/** + */var o=t(45319),v=t(83419),a=t(31401),r=t(51708),n=t(8443),e=t(95643),i=t(36383),h=t(14463),s=t(45650),l=t(10247),f=new v({Extends:e,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.TextureCrop,a.Tint,a.Transform,a.Visible,l],initialize:function(d,p,g,x){e.call(this,d,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=s(),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 y=d.sys.game;this._device=y.device.video,this.setPosition(p,g),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),y.events.on(n.PAUSE,this.globalPause,this),y.events.on(n.RESUME,this.globalResume,this);var C=d.sys.sound;C&&C.on(h.GLOBAL_MUTE,this.globalMute,this),x&&this.load(x)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(u){var d=this.scene.sys.cache.video.get(u);return d?(this.cacheKey=u,this.loadHandler(d.url,d.noAudio,d.crossOrigin)):console.warn("No video in cache for key: "+u),this},changeSource:function(u,d,p,g,x){d===void 0&&(d=!0),p===void 0&&(p=!1),this.cacheKey!==u&&(this.load(u),d&&this.play(p,g,x))},getVideoKey:function(){return this.cacheKey},loadURL:function(u,d,p){d===void 0&&(d=!1);var g=this._device.getVideoURL(u);return g?(this.cacheKey="",this.loadHandler(g.url,d,p)):console.warn("No supported video format found for "+u),this},loadMediaStream:function(u,d,p){return this.loadHandler(null,d,p,u)},loadHandler:function(u,d,p,g){d||(d=!1);var x=this.video;if(x?(this.removeLoadEventHandlers(),this.stop()):(x=document.createElement("video"),x.controls=!1,x.setAttribute("playsinline","playsinline"),x.setAttribute("preload","auto"),x.setAttribute("disablePictureInPicture","true")),d?(x.muted=!0,x.defaultMuted=!0,x.setAttribute("autoplay","autoplay")):(x.muted=!1,x.defaultMuted=!1,x.removeAttribute("autoplay")),p?x.setAttribute("crossorigin",p):x.removeAttribute("crossorigin"),g)if("srcObject"in x)try{x.srcObject=g}catch(C){if(C.name!=="TypeError")throw C;x.src=URL.createObjectURL(g)}else x.src=URL.createObjectURL(g);else x.src=u;this.retry=0,this.video=x,this._playCalled=!1,x.load(),this.addLoadEventHandlers();var y=this.scene.sys.textures.get(this._key);return this.setTexture(y),this},requestVideoFrame:function(u,d){var p=this.video;if(p){var g=d.width,x=d.height,y=this.videoTexture,C=this.videoTextureSource,P=!y||C.source!==p;P?(this._codePaused=p.paused,this._codeMuted=p.muted,y?(C.source=p,C.width=g,C.height=x,y.get().setSize(g,x)):(y=this.scene.sys.textures.create(this._key,p,g,x),y.add("__BASE",0,0,0,g,x),this.setTexture(y),this.videoTexture=y,this.videoTextureSource=y.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(r.VIDEO_TEXTURE,this,y)),this.setSizeToFrame(),this.updateDisplayOrigin()):C.update(),this.isStalled=!1,this.metadata=d;var M=d.mediaTime;P&&(this._lastUpdate=M,this.emit(r.VIDEO_CREATED,this,g,x),this.frameReady||(this.frameReady=!0,this.emit(r.VIDEO_PLAY,this))),this._playingMarker?M>=this._markerOut&&(p.loop?(p.currentTime=this._markerIn,this.emit(r.VIDEO_LOOP,this)):(this.stop(!1),this.emit(r.VIDEO_COMPLETE,this))):M-1&&p>d&&p=0&&!isNaN(p)&&p>d&&(this.markers[u]=[d,p]),this},playMarker:function(u,d){var p=this.markers[u];return p&&this.play(d,p[0],p[1]),this},removeMarker:function(u){return delete this.markers[u],this},snapshot:function(u,d){return u===void 0&&(u=this.width),d===void 0&&(d=this.height),this.snapshotArea(0,0,this.width,this.height,u,d)},snapshotArea:function(u,d,p,g,x,y){u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=this.width),g===void 0&&(g=this.height),x===void 0&&(x=p),y===void 0&&(y=g);var C=this.video,P=this.snapshotTexture;return P?(P.setSize(x,y),C&&P.context.drawImage(C,u,d,p,g,0,0,x,y)):(P=this.scene.sys.textures.createCanvas(s(),x,y),this.snapshotTexture=P,C&&P.context.drawImage(C,u,d,p,g,0,0,x,y)),P.update()},saveSnapshotTexture:function(u){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,u):this.snapshotTexture=this.scene.sys.textures.createCanvas(u,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(r.VIDEO_UNLOCKED,this));var u=this.scene.sys.sound;u&&u.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(u){var d=u.name;d==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(r.VIDEO_LOCKED,this)):d==="NotSupportedError"?(this.stop(!1),this.emit(r.VIDEO_UNSUPPORTED,this,u)):(this.stop(!1),this.emit(r.VIDEO_ERROR,this,u))},legacyPlayHandler:function(){var u=this.video;u&&(this.playSuccess(),u.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(r.VIDEO_PLAYING,this)},loadErrorHandler:function(u){this.stop(!1),this.emit(r.VIDEO_ERROR,this,u)},metadataHandler:function(u){this.emit(r.VIDEO_METADATA,this,u)},setSizeToFrame:function(u){u||(u=this.frame),this.width=u.realWidth,this.height=u.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var d=this.input;return d&&!d.customHitArea&&(d.hitArea.width=this.width,d.hitArea.height=this.height),this},stalledHandler:function(u){this.isStalled=!0,this.emit(r.VIDEO_STALLED,this,u)},completeHandler:function(){this._playCalled=!1,this.emit(r.VIDEO_COMPLETE,this)},preUpdate:function(u,d){var p=this.video;!p||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=d,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(u){var d=this.video;if(d){var p=d.duration;if(p!==1/0&&!isNaN(p)){var g=p*u;this.setCurrentTime(g)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(u){var d=this.video;if(d){if(typeof u=="string"){var p=u[0],g=parseFloat(u.substr(1));p==="+"?u=d.currentTime+g:p==="-"&&(u=d.currentTime-g)}d.currentTime=u}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(r.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(r.VIDEO_SEEKED,this)},getProgress:function(){var u=this.video;if(u){var d=u.duration;if(d!==1/0&&!isNaN(d))return u.currentTime/d}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(u){u===void 0&&(u=!0),this._codeMuted=u;var d=this.video;return d&&(d.muted=this._systemMuted?!0:u),this},isMuted:function(){return this._codeMuted},globalMute:function(u,d){this._systemMuted=d;var p=this.video;p&&(p.muted=this._codeMuted?!0:d)},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(u){u===void 0&&(u=!0);var d=this.video;return this._codePaused=u,d&&!d.ended&&(u?d.paused||(this.removeEventHandlers(),d.pause()):u||(this._playCalled?d.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(u){return u===void 0&&(u=1),this.video&&(this.video.volume=o(u,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(u){return this.video&&(this.video.playbackRate=u),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(u){return u===void 0&&(u=!0),this.video&&(this.video.loop=u),this},isPlaying:function(){return this.video?!(this.video.paused||this.video.ended):!1},isPaused:function(){return this.video&&this._playCalled&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(u,d){return d===void 0&&(d=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,u),this.videoTextureSource.setFlipY(d)),this._key=u,this.flipY=d,!!this.videoTexture},stop:function(u){u===void 0&&(u=!0);var d=this.video;return d&&(this.removeEventHandlers(),d.cancelVideoFrameCallback(this._rfvCallbackId),d.pause()),this.retry=0,this._playCalled=!1,u&&this.emit(r.VIDEO_STOP,this),this},removeVideoElement:function(){var u=this.video;if(u){for(u.parentNode&&u.parentNode.removeChild(u);u.hasChildNodes();)u.removeChild(u.firstChild);u.removeAttribute("autoplay"),u.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var u=this.scene.sys.game.events;u.off(n.PAUSE,this.globalPause,this),u.off(n.RESUME,this.globalResume,this);var d=this.scene.sys.sound;d&&d.off(h.GLOBAL_MUTE,this.globalMute,this)}});c.exports=f},58352:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2372,7 +2372,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Geoffrey Glaive * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(2141),v=t(2044),a=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x,h=r.y,s=r.radius,l=n.x,f=n.y,u=n.radius,d,p,g,y,x;if(h===f)x=(u*u-s*s-l*l+i*i)/(2*(i-l)),d=1,p=-2*f,g=l*l+x*x-2*l*x+f*f-u*u,y=p*p-4*d*g,y===0?e.push(new o(x,-p/(2*d))):y>0&&(e.push(new o(x,(-p+Math.sqrt(y))/(2*d))),e.push(new o(x,(-p-Math.sqrt(y))/(2*d))));else{var C=(i-l)/(h-f),P=(u*u-s*s-l*l+i*i-f*f+h*h)/(2*(h-f));d=C*C+1,p=2*h*C-2*P*C-2*i,g=i*i+h*h+P*P-s*s-2*h*P,y=p*p-4*d*g,y===0?(x=-p/(2*d),e.push(new o(x,P-x*C))):y>0&&(x=(-p+Math.sqrt(y))/(2*d),e.push(new o(x,P-x*C)),x=(-p-Math.sqrt(y))/(2*d),e.push(new o(x,P-x*C)))}}return e};c.exports=a},97439:(c,m,t)=>{/** + */var o=t(2141),v=t(2044),a=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x,h=r.y,s=r.radius,l=n.x,f=n.y,u=n.radius,d,p,g,x,y;if(h===f)y=(u*u-s*s-l*l+i*i)/(2*(i-l)),d=1,p=-2*f,g=l*l+y*y-2*l*y+f*f-u*u,x=p*p-4*d*g,x===0?e.push(new o(y,-p/(2*d))):x>0&&(e.push(new o(y,(-p+Math.sqrt(x))/(2*d))),e.push(new o(y,(-p-Math.sqrt(x))/(2*d))));else{var C=(i-l)/(h-f),P=(u*u-s*s-l*l+i*i-f*f+h*h)/(2*(h-f));d=C*C+1,p=2*h*C-2*P*C-2*i,g=i*i+h*h+P*P-s*s-2*h*P,x=p*p-4*d*g,x===0?(y=-p/(2*d),e.push(new o(y,P-y*C))):x>0&&(y=(-p+Math.sqrt(x))/(2*d),e.push(new o(y,P-y*C)),y=(-p-Math.sqrt(x))/(2*d),e.push(new o(y,P-y*C)))}}return e};c.exports=a},97439:(c,m,t)=>{/** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2013-2024 Phaser Studio Inc. @@ -2382,11 +2382,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Geoffrey Glaive * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(2141),v=t(80462),a=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x1,h=r.y1,s=r.x2,l=r.y2,f=n.x,u=n.y,d=n.radius,p=s-i,g=l-h,y=i-f,x=h-u,C=p*p+g*g,P=2*(p*y+g*x),M=y*y+x*x-d*d,w=P*P-4*C*M,I,L;if(w===0){var B=-P/(2*C);I=i+B*p,L=h+B*g,B>=0&&B<=1&&e.push(new o(I,L))}else if(w>0){var N=(-P-Math.sqrt(w))/(2*C);I=i+N*p,L=h+N*g,N>=0&&N<=1&&e.push(new o(I,L));var G=(-P+Math.sqrt(w))/(2*C);I=i+G*p,L=h+G*g,G>=0&&G<=1&&e.push(new o(I,L))}}return e};c.exports=a},36100:(c,m,t)=>{/** + */var o=t(2141),v=t(80462),a=function(r,n,e){if(e===void 0&&(e=[]),v(r,n)){var i=r.x1,h=r.y1,s=r.x2,l=r.y2,f=n.x,u=n.y,d=n.radius,p=s-i,g=l-h,x=i-f,y=h-u,C=p*p+g*g,P=2*(p*x+g*y),M=x*x+y*y-d*d,w=P*P-4*C*M,I,L;if(w===0){var B=-P/(2*C);I=i+B*p,L=h+B*g,B>=0&&B<=1&&e.push(new o(I,L))}else if(w>0){var N=(-P-Math.sqrt(w))/(2*C);I=i+N*p,L=h+N*g,N>=0&&N<=1&&e.push(new o(I,L));var G=(-P+Math.sqrt(w))/(2*C);I=i+G*p,L=h+G*g,G>=0&&G<=1&&e.push(new o(I,L))}}return e};c.exports=a},36100:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(25836),v=function(a,r,n,e){n===void 0&&(n=!1);var i=a.x1,h=a.y1,s=a.x2,l=a.y2,f=r.x1,u=r.y1,d=r.x2,p=r.y2,g=s-i,y=l-h,x=d-f,C=p-u,P=g*C-y*x;if(P===0)return null;var M,w,I;if(n){if(M=(g*(u-h)+y*(i-f))/(x*y-C*g),w=(f+x*M-i)/g,w<0||M<0||M>1)return null;I=w}else{if(M=((f-i)*C-(u-h)*x)/P,w=((h-u)*g-(i-f)*y)/P,M<0||M>1||w<0||w>1)return null;I=M}return e===void 0&&(e=new o),e.set(i+g*I,h+y*I,I)};c.exports=v},3073:(c,m,t)=>{/** + */var o=t(25836),v=function(a,r,n,e){n===void 0&&(n=!1);var i=a.x1,h=a.y1,s=a.x2,l=a.y2,f=r.x1,u=r.y1,d=r.x2,p=r.y2,g=s-i,x=l-h,y=d-f,C=p-u,P=g*C-x*y;if(P===0)return null;var M,w,I;if(n){if(M=(g*(u-h)+x*(i-f))/(y*x-C*g),w=(f+y*M-i)/g,w<0||M<0||M>1)return null;I=w}else{if(M=((f-i)*C-(u-h)*y)/P,w=((h-u)*g-(i-f)*x)/P,M<0||M>1||w<0||w>1)return null;I=M}return e===void 0&&(e=new o),e.set(i+g*I,h+x*I,I)};c.exports=v},3073:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2403,7 +2403,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(61369),v=t(56362),a=t(23031),r=new a;function n(h,s,l,f,u){var d=Math.cos(h),p=Math.sin(h);r.setTo(s,l,s+d,l+p);var g=v(r,f,!0);g&&u.push(new o(g.x,g.y,h,g.w))}function e(h,s){return h.z-s.z}var i=function(h,s,l){Array.isArray(l)||(l=[l]);for(var f=[],u=[],d=0;d{/** + */var o=t(61369),v=t(56362),a=t(23031),r=new a;function n(h,s,l,f,u){var d=Math.cos(h),p=Math.sin(h);r.setTo(s,l,s+d,l+p);var g=v(r,f,!0);g&&u.push(new o(g.x,g.y,h,g.w))}function e(h,s){return h.z-s.z}var i=function(h,s,l){Array.isArray(l)||(l=[l]);for(var f=[],u=[],d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2436,7 +2436,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(87902),v=t(2141),a=new v,r=function(n,e,i){if(i===void 0&&(i=a),o(e,n.x1,n.y1))return i.x=n.x1,i.y=n.y1,!0;if(o(e,n.x2,n.y2))return i.x=n.x2,i.y=n.y2,!0;var h=n.x2-n.x1,s=n.y2-n.y1,l=e.x-n.x1,f=e.y-n.y1,u=h*h+s*s,d=h,p=s;if(u>0){var g=(l*h+f*s)/u;d*=g,p*=g}i.x=n.x1+d,i.y=n.y1+p;var y=d*d+p*p;return y<=u&&d*h+p*s>=0&&o(e,i.x,i.y)};c.exports=r},76112:c=>{/** + */var o=t(87902),v=t(2141),a=new v,r=function(n,e,i){if(i===void 0&&(i=a),o(e,n.x1,n.y1))return i.x=n.x1,i.y=n.y1,!0;if(o(e,n.x2,n.y2))return i.x=n.x2,i.y=n.y2,!0;var h=n.x2-n.x1,s=n.y2-n.y1,l=e.x-n.x1,f=e.y-n.y1,u=h*h+s*s,d=h,p=s;if(u>0){var g=(l*h+f*s)/u;d*=g,p*=g}i.x=n.x1+d,i.y=n.y1+p;var x=d*d+p*p;return x<=u&&d*h+p*s>=0&&o(e,i.x,i.y)};c.exports=r},76112:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2461,7 +2461,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(76112),v=t(37303),a=t(48653),r=t(77493),n=function(e,i){if(i.left>e.right||i.righte.bottom||i.bottom0};c.exports=n},84411:c=>{/** + */var o=t(76112),v=t(37303),a=t(48653),r=t(77493),n=function(e,i){if(i.left>e.right||i.righte.bottom||i.bottom0};c.exports=n},84411:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2513,7 +2513,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(52816),v=t(6113),a=t(2141),r=function(n,e,i,h,s){h===void 0&&(h=0),s===void 0&&(s=[]);var l=[],f=n.x1,u=n.y1,d=n.x2-f,p=n.y2-u,g=v(e,s),y,x,C=i-1;for(y=0;y0){var P=l[0],M=[P];for(y=1;y=h&&(M.push(w),P=w)}var I=l[l.length-1];return o(P,I){/** + */var o=t(52816),v=t(6113),a=t(2141),r=function(n,e,i,h,s){h===void 0&&(h=0),s===void 0&&(s=[]);var l=[],f=n.x1,u=n.y1,d=n.x2-f,p=n.y2-u,g=v(e,s),x,y,C=i-1;for(x=0;x0){var P=l[0],M=[P];for(x=1;x=h&&(M.push(w),P=w)}var I=l[l.length-1];return o(P,I){/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2611,24 +2611,24 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(87841),a=t(26099);function r(e,i,h,s){var l=e-h,f=i-s,u=l*l+f*f;return Math.sqrt(u)}var n=new o({initialize:function(i,h,s){this.vertex1=i,this.vertex2=h,this.vertex3=s,this.bounds=new v,this._inCenter=new a},getInCenter:function(e){e===void 0&&(e=!0);var i=this.vertex1,h=this.vertex2,s=this.vertex3,l,f,u,d,p,g;e?(l=i.x,f=i.y,u=h.x,d=h.y,p=s.x,g=s.y):(l=i.vx,f=i.vy,u=h.vx,d=h.vy,p=s.vx,g=s.vy);var y=r(p,g,u,d),x=r(l,f,p,g),C=r(u,d,l,f),P=y+x+C;return this._inCenter.set((l*y+u*x+p*C)/P,(f*y+d*x+g*C)/P)},contains:function(e,i,h){var s=this.vertex1,l=this.vertex2,f=this.vertex3,u=s.vx,d=s.vy,p=l.vx,g=l.vy,y=f.vx,x=f.vy;if(h){var C=h.a,P=h.b,M=h.c,w=h.d,I=h.e,L=h.f;u=s.vx*C+s.vy*M+I,d=s.vx*P+s.vy*w+L,p=l.vx*C+l.vy*M+I,g=l.vx*P+l.vy*w+L,y=f.vx*C+f.vy*M+I,x=f.vx*P+f.vy*w+L}var B=y-u,N=x-d,G=p-u,V=g-d,K=e-u,j=i-d,J=B*B+N*N,X=B*G+N*V,Y=B*K+N*j,b=G*G+V*V,z=G*K+V*j,W=J*b-X*X,H=W===0?0:1/W,Z=(b*Y-X*z)*H,Q=(J*z-X*Y)*H;return Z>=0&&Q>=0&&Z+Q<1},isCounterClockwise:function(e){var i=this.vertex1,h=this.vertex2,s=this.vertex3,l=(h.vx-i.vx)*(s.vy-i.vy)-(h.vy-i.vy)*(s.vx-i.vx);return e<=0?l>=0:l<0},load:function(e,i,h,s,l){return h=this.vertex1.load(e,i,h,s,l),h=this.vertex2.load(e,i,h,s,l),h=this.vertex3.load(e,i,h,s,l),h},transformCoordinatesLocal:function(e,i,h,s){return this.vertex1.transformCoordinatesLocal(e,i,h,s),this.vertex2.transformCoordinatesLocal(e,i,h,s),this.vertex3.transformCoordinatesLocal(e,i,h,s),this},updateBounds:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3,s=this.bounds;return s.x=Math.min(e.vx,i.vx,h.vx),s.y=Math.min(e.vy,i.vy,h.vy),s.width=Math.max(e.vx,i.vx,h.vx)-s.x,s.height=Math.max(e.vy,i.vy,h.vy)-s.y,this},isInView:function(e,i,h,s,l,f,u,d,p,g,y){this.update(s,l,f,u,d,p,g,y);var x=this.vertex1,C=this.vertex2,P=this.vertex3;if(x.ta<=0&&C.ta<=0&&P.ta<=0||i&&!this.isCounterClockwise(h))return!1;var M=this.bounds;M.x=Math.min(x.tx,C.tx,P.tx),M.y=Math.min(x.ty,C.ty,P.ty),M.width=Math.max(x.tx,C.tx,P.tx)-M.x,M.height=Math.max(x.ty,C.ty,P.ty)-M.y;var w=e.x+e.width,I=e.y+e.height;return M.width<=0||M.height<=0||e.width<=0||e.height<=0?!1:!(M.rightw||M.y>I)},scrollUV:function(e,i){return this.vertex1.scrollUV(e,i),this.vertex2.scrollUV(e,i),this.vertex3.scrollUV(e,i),this},scaleUV:function(e,i){return this.vertex1.scaleUV(e,i),this.vertex2.scaleUV(e,i),this.vertex3.scaleUV(e,i),this},setColor:function(e){return this.vertex1.color=e,this.vertex2.color=e,this.vertex3.color=e,this},update:function(e,i,h,s,l,f,u,d){return this.vertex1.update(i,h,s,l,f,u,d,e),this.vertex2.update(i,h,s,l,f,u,d,e),this.vertex3.update(i,h,s,l,f,u,d,e),this},translate:function(e,i){i===void 0&&(i=0);var h=this.vertex1,s=this.vertex2,l=this.vertex3;return h.x+=e,h.y+=i,s.x+=e,s.y+=i,l.x+=e,l.y+=i,this},x:{get:function(){return this.getInCenter().x},set:function(e){var i=this.getInCenter();this.translate(e-i.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(e){var i=this.getInCenter();this.translate(0,e-i.y)}},alpha:{get:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3;return(e.alpha+i.alpha+h.alpha)/3},set:function(e){this.vertex1.alpha=e,this.vertex2.alpha=e,this.vertex3.alpha=e}},depth:{get:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3;return(e.vz+i.vz+h.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});c.exports=n},48803:(c,m,t)=>{/** + */var o=t(83419),v=t(87841),a=t(26099);function r(e,i,h,s){var l=e-h,f=i-s,u=l*l+f*f;return Math.sqrt(u)}var n=new o({initialize:function(i,h,s){this.vertex1=i,this.vertex2=h,this.vertex3=s,this.bounds=new v,this._inCenter=new a},getInCenter:function(e){e===void 0&&(e=!0);var i=this.vertex1,h=this.vertex2,s=this.vertex3,l,f,u,d,p,g;e?(l=i.x,f=i.y,u=h.x,d=h.y,p=s.x,g=s.y):(l=i.vx,f=i.vy,u=h.vx,d=h.vy,p=s.vx,g=s.vy);var x=r(p,g,u,d),y=r(l,f,p,g),C=r(u,d,l,f),P=x+y+C;return this._inCenter.set((l*x+u*y+p*C)/P,(f*x+d*y+g*C)/P)},contains:function(e,i,h){var s=this.vertex1,l=this.vertex2,f=this.vertex3,u=s.vx,d=s.vy,p=l.vx,g=l.vy,x=f.vx,y=f.vy;if(h){var C=h.a,P=h.b,M=h.c,w=h.d,I=h.e,L=h.f;u=s.vx*C+s.vy*M+I,d=s.vx*P+s.vy*w+L,p=l.vx*C+l.vy*M+I,g=l.vx*P+l.vy*w+L,x=f.vx*C+f.vy*M+I,y=f.vx*P+f.vy*w+L}var B=x-u,N=y-d,G=p-u,V=g-d,K=e-u,j=i-d,J=B*B+N*N,X=B*G+N*V,Y=B*K+N*j,b=G*G+V*V,z=G*K+V*j,W=J*b-X*X,H=W===0?0:1/W,Z=(b*Y-X*z)*H,Q=(J*z-X*Y)*H;return Z>=0&&Q>=0&&Z+Q<1},isCounterClockwise:function(e){var i=this.vertex1,h=this.vertex2,s=this.vertex3,l=(h.vx-i.vx)*(s.vy-i.vy)-(h.vy-i.vy)*(s.vx-i.vx);return e<=0?l>=0:l<0},load:function(e,i,h,s,l){return h=this.vertex1.load(e,i,h,s,l),h=this.vertex2.load(e,i,h,s,l),h=this.vertex3.load(e,i,h,s,l),h},transformCoordinatesLocal:function(e,i,h,s){return this.vertex1.transformCoordinatesLocal(e,i,h,s),this.vertex2.transformCoordinatesLocal(e,i,h,s),this.vertex3.transformCoordinatesLocal(e,i,h,s),this},updateBounds:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3,s=this.bounds;return s.x=Math.min(e.vx,i.vx,h.vx),s.y=Math.min(e.vy,i.vy,h.vy),s.width=Math.max(e.vx,i.vx,h.vx)-s.x,s.height=Math.max(e.vy,i.vy,h.vy)-s.y,this},isInView:function(e,i,h,s,l,f,u,d,p,g,x){this.update(s,l,f,u,d,p,g,x);var y=this.vertex1,C=this.vertex2,P=this.vertex3;if(y.ta<=0&&C.ta<=0&&P.ta<=0||i&&!this.isCounterClockwise(h))return!1;var M=this.bounds;M.x=Math.min(y.tx,C.tx,P.tx),M.y=Math.min(y.ty,C.ty,P.ty),M.width=Math.max(y.tx,C.tx,P.tx)-M.x,M.height=Math.max(y.ty,C.ty,P.ty)-M.y;var w=e.x+e.width,I=e.y+e.height;return M.width<=0||M.height<=0||e.width<=0||e.height<=0?!1:!(M.rightw||M.y>I)},scrollUV:function(e,i){return this.vertex1.scrollUV(e,i),this.vertex2.scrollUV(e,i),this.vertex3.scrollUV(e,i),this},scaleUV:function(e,i){return this.vertex1.scaleUV(e,i),this.vertex2.scaleUV(e,i),this.vertex3.scaleUV(e,i),this},setColor:function(e){return this.vertex1.color=e,this.vertex2.color=e,this.vertex3.color=e,this},update:function(e,i,h,s,l,f,u,d){return this.vertex1.update(i,h,s,l,f,u,d,e),this.vertex2.update(i,h,s,l,f,u,d,e),this.vertex3.update(i,h,s,l,f,u,d,e),this},translate:function(e,i){i===void 0&&(i=0);var h=this.vertex1,s=this.vertex2,l=this.vertex3;return h.x+=e,h.y+=i,s.x+=e,s.y+=i,l.x+=e,l.y+=i,this},x:{get:function(){return this.getInCenter().x},set:function(e){var i=this.getInCenter();this.translate(e-i.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(e){var i=this.getInCenter();this.translate(0,e-i.y)}},alpha:{get:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3;return(e.alpha+i.alpha+h.alpha)/3},set:function(e){this.vertex1.alpha=e,this.vertex2.alpha=e,this.vertex3.alpha=e}},depth:{get:function(){var e=this.vertex1,i=this.vertex2,h=this.vertex3;return(e.vz+i.vz+h.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});c.exports=n},48803:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83997),v=t(95540),a=t(37867),r=t(25836),n=t(39318),e=new r,i=new r,h=new a,s=function(l){var f=v(l,"mesh"),u=v(l,"texture",null),d=v(l,"frame"),p=v(l,"width",1),g=v(l,"height",p),y=v(l,"widthSegments",1),x=v(l,"heightSegments",y),C=v(l,"x",0),P=v(l,"y",0),M=v(l,"z",0),w=v(l,"rotateX",0),I=v(l,"rotateY",0),L=v(l,"rotateZ",0),B=v(l,"zIsUp",!0),N=v(l,"isOrtho",f?f.dirtyCache[11]:!1),G=v(l,"colors",[16777215]),V=v(l,"alphas",[1]),K=v(l,"tile",!1),j=v(l,"flipY",!1),J=v(l,"width",null),X={faces:[],verts:[]};e.set(C,P,M),i.set(w,I,L),h.fromRotationXYTranslation(i,e,B);var Y;if(!u&&f)u=f.texture,d||(Y=f.frame);else if(f&&typeof u=="string")u=f.scene.sys.textures.get(u);else if(!u)return X;Y||(Y=u.get(d)),!J&&N&&u&&f&&(p=Y.width/f.height,g=Y.height/f.height);var b=p/2,z=g/2,W=Math.floor(y),H=Math.floor(x),Z=W+1,Q=H+1,k=p/W,et=g/H,st=[],rt=[],ot,ft,at=0,vt=1,At=0,Et=1;Y&&(at=Y.u0,vt=Y.u1,j?(At=Y.v1,Et=Y.v0):(At=Y.v0,Et=Y.v1));var Pt=vt-at,ct=Et-At;for(ft=0;ft{/** + */var o=t(83997),v=t(95540),a=t(37867),r=t(25836),n=t(39318),e=new r,i=new r,h=new a,s=function(l){var f=v(l,"mesh"),u=v(l,"texture",null),d=v(l,"frame"),p=v(l,"width",1),g=v(l,"height",p),x=v(l,"widthSegments",1),y=v(l,"heightSegments",x),C=v(l,"x",0),P=v(l,"y",0),M=v(l,"z",0),w=v(l,"rotateX",0),I=v(l,"rotateY",0),L=v(l,"rotateZ",0),B=v(l,"zIsUp",!0),N=v(l,"isOrtho",f?f.dirtyCache[11]:!1),G=v(l,"colors",[16777215]),V=v(l,"alphas",[1]),K=v(l,"tile",!1),j=v(l,"flipY",!1),J=v(l,"width",null),X={faces:[],verts:[]};e.set(C,P,M),i.set(w,I,L),h.fromRotationXYTranslation(i,e,B);var Y;if(!u&&f)u=f.texture,d||(Y=f.frame);else if(f&&typeof u=="string")u=f.scene.sys.textures.get(u);else if(!u)return X;Y||(Y=u.get(d)),!J&&N&&u&&f&&(p=Y.width/f.height,g=Y.height/f.height);var b=p/2,z=g/2,W=Math.floor(x),H=Math.floor(y),Z=W+1,Q=H+1,k=p/W,et=g/H,st=[],rt=[],ot,ft,at=0,vt=1,At=0,Et=1;Y&&(at=Y.u0,vt=Y.u1,j?(At=Y.v1,Et=Y.v0):(At=Y.v0,Et=Y.v1));var Pt=vt-at,ct=Et-At;for(ft=0;ft{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83997),v=t(37867),a=t(25836),r=t(39318),n=new a,e=new a,i=new v,h=function(s,l,f,u,d,p,g,y,x,C){f===void 0&&(f=1),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=0),C===void 0&&(C=!0);var P={faces:[],verts:[]},M=s.materials;n.set(u,d,p),e.set(g,y,x),i.fromRotationXYTranslation(e,n,C);for(var w=0;w{/** + */var o=t(83997),v=t(37867),a=t(25836),r=t(39318),n=new a,e=new a,i=new v,h=function(s,l,f,u,d,p,g,x,y,C){f===void 0&&(f=1),u===void 0&&(u=0),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),x===void 0&&(x=0),y===void 0&&(y=0),C===void 0&&(C=!0);var P={faces:[],verts:[]},M=s.materials;n.set(u,d,p),e.set(g,x,y),i.fromRotationXYTranslation(e,n,C);for(var w=0;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83997),v=t(39318),a=function(r,n,e,i,h,s,l,f){if(i===void 0&&(i=!1),s===void 0&&(s=16777215),l===void 0&&(l=1),f===void 0&&(f=!1),r.length!==n.length&&!i){console.warn("GenerateVerts: vertices and uvs count not equal");return}var u={faces:[],vertices:[]},d,p,g,y,x,C,P,M,w,I,L,B=i?3:2,N=Array.isArray(s),G=Array.isArray(l);if(Array.isArray(e)&&e.length>0)for(d=0;d{/** + */var o=t(83997),v=t(39318),a=function(r,n,e,i,h,s,l,f){if(i===void 0&&(i=!1),s===void 0&&(s=16777215),l===void 0&&(l=1),f===void 0&&(f=!1),r.length!==n.length&&!i){console.warn("GenerateVerts: vertices and uvs count not equal");return}var u={faces:[],vertices:[]},d,p,g,x,y,C,P,M,w,I,L,B=i?3:2,N=Array.isArray(s),G=Array.isArray(l);if(Array.isArray(e)&&e.length>0)for(d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=!0,t="untitled",o="",v="";function a(p){var g=p.indexOf("#");return g>-1?p.substring(0,g):p}function r(p){return p.models.length===0&&p.models.push({faces:[],name:t,textureCoords:[],vertexNormals:[],vertices:[]}),o="",p.models[p.models.length-1]}function n(p,g){var y=p.length>=2?p[1]:t;g.models.push({faces:[],name:y,textureCoords:[],vertexNormals:[],vertices:[]}),o=""}function e(p){p.length===2&&(o=p[1])}function i(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,C=y>=3?parseFloat(p[2]):0,P=y>=4?parseFloat(p[3]):0;r(g).vertices.push({x,y:C,z:P})}function h(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,C=y>=3?parseFloat(p[2]):0,P=y>=4?parseFloat(p[3]):0;isNaN(x)&&(x=0),isNaN(C)&&(C=0),isNaN(P)&&(P=0),m&&(C=1-C),r(g).textureCoords.push({u:x,v:C,w:P})}function s(p,g){var y=p.length,x=y>=2?parseFloat(p[1]):0,C=y>=3?parseFloat(p[2]):0,P=y>=4?parseFloat(p[3]):0;r(g).vertexNormals.push({x,y:C,z:P})}function l(p,g){var y=p.length-1;if(!(y<3)){for(var x={group:o,material:v,vertices:[]},C=0;C3)){var I=0,L=0,B=0;I=parseInt(M[0],10),w>1&&M[1]!==""&&(L=parseInt(M[1],10)),w>2&&(B=parseInt(M[2],10)),I!==0&&(I<0&&(I=r(g).vertices.length+1+I),L-=1,I-=1,B-=1,x.vertices.push({textureCoordsIndex:L,vertexIndex:I,vertexNormalIndex:B}))}}r(g).faces.push(x)}}function f(p,g){p.length>=2&&g.materialLibraries.push(p[1])}function u(p){p.length>=2&&(v=p[1])}var d=function(p,g){g===void 0&&(g=!0),m=g;var y={materials:{},materialLibraries:[],models:[]};o="",v="";for(var x=p.split(` -`),C=0;C{/** + */var m=!0,t="untitled",o="",v="";function a(p){var g=p.indexOf("#");return g>-1?p.substring(0,g):p}function r(p){return p.models.length===0&&p.models.push({faces:[],name:t,textureCoords:[],vertexNormals:[],vertices:[]}),o="",p.models[p.models.length-1]}function n(p,g){var x=p.length>=2?p[1]:t;g.models.push({faces:[],name:x,textureCoords:[],vertexNormals:[],vertices:[]}),o=""}function e(p){p.length===2&&(o=p[1])}function i(p,g){var x=p.length,y=x>=2?parseFloat(p[1]):0,C=x>=3?parseFloat(p[2]):0,P=x>=4?parseFloat(p[3]):0;r(g).vertices.push({x:y,y:C,z:P})}function h(p,g){var x=p.length,y=x>=2?parseFloat(p[1]):0,C=x>=3?parseFloat(p[2]):0,P=x>=4?parseFloat(p[3]):0;isNaN(y)&&(y=0),isNaN(C)&&(C=0),isNaN(P)&&(P=0),m&&(C=1-C),r(g).textureCoords.push({u:y,v:C,w:P})}function s(p,g){var x=p.length,y=x>=2?parseFloat(p[1]):0,C=x>=3?parseFloat(p[2]):0,P=x>=4?parseFloat(p[3]):0;r(g).vertexNormals.push({x:y,y:C,z:P})}function l(p,g){var x=p.length-1;if(!(x<3)){for(var y={group:o,material:v,vertices:[]},C=0;C3)){var I=0,L=0,B=0;I=parseInt(M[0],10),w>1&&M[1]!==""&&(L=parseInt(M[1],10)),w>2&&(B=parseInt(M[2],10)),I!==0&&(I<0&&(I=r(g).vertices.length+1+I),L-=1,I-=1,B-=1,y.vertices.push({textureCoordsIndex:L,vertexIndex:I,vertexNormalIndex:B}))}}r(g).faces.push(y)}}function f(p,g){p.length>=2&&g.materialLibraries.push(p[1])}function u(p){p.length>=2&&(v=p[1])}var d=function(p,g){g===void 0&&(g=!0),m=g;var x={materials:{},materialLibraries:[],models:[]};o="",v="";for(var y=p.split(` +`),C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2641,7 +2641,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(70554),a=t(25836),r=new o({Extends:a,initialize:function(e,i,h,s,l,f,u,d,p,g){f===void 0&&(f=16777215),u===void 0&&(u=1),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),a.call(this,e,i,h),this.vx=0,this.vy=0,this.vz=0,this.nx=d,this.ny=p,this.nz=g,this.u=s,this.v=l,this.color=f,this.alpha=u,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=l},setUVs:function(n,e){return this.u=n,this.v=e,this.tu=n,this.tv=e,this},scrollUV:function(n,e){return this.tu+=n,this.tv+=e,this},scaleUV:function(n,e){return this.tu=this.u*n,this.tv=this.v*e,this},transformCoordinatesLocal:function(n,e,i,h){var s=this.x,l=this.y,f=this.z,u=n.val,d=s*u[0]+l*u[4]+f*u[8]+u[12],p=s*u[1]+l*u[5]+f*u[9]+u[13],g=s*u[2]+l*u[6]+f*u[10]+u[14],y=s*u[3]+l*u[7]+f*u[11]+u[15];this.vx=d/y*e,this.vy=-(p/y)*i,h<=0?this.vz=g/y:this.vz=-(g/y)},resize:function(n,e,i,h,s,l){return this.x=n,this.y=e,this.vx=this.x*i,this.vy=-this.y*h,this.vz=0,s<.5?this.vx+=i*(.5-s):s>.5&&(this.vx-=i*(s-.5)),l<.5?this.vy+=h*(.5-l):l>.5&&(this.vy-=h*(l-.5)),this},update:function(n,e,i,h,s,l,f,u){var d=this.vx*n+this.vy*i+s,p=this.vx*e+this.vy*h+l;return f&&(d=Math.round(d),p=Math.round(p)),this.tx=d,this.ty=p,this.ta=this.alpha*u,this},load:function(n,e,i,h,s){return n[++i]=this.tx,n[++i]=this.ty,n[++i]=this.tu,n[++i]=this.tv,n[++i]=h,n[++i]=s,e[++i]=v.getTintAppendFloatAlpha(this.color,this.ta),i}});c.exports=r},73090:(c,m,t)=>{/** + */var o=t(83419),v=t(70554),a=t(25836),r=new o({Extends:a,initialize:function(e,i,h,s,l,f,u,d,p,g){f===void 0&&(f=16777215),u===void 0&&(u=1),d===void 0&&(d=0),p===void 0&&(p=0),g===void 0&&(g=0),a.call(this,e,i,h),this.vx=0,this.vy=0,this.vz=0,this.nx=d,this.ny=p,this.nz=g,this.u=s,this.v=l,this.color=f,this.alpha=u,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=l},setUVs:function(n,e){return this.u=n,this.v=e,this.tu=n,this.tv=e,this},scrollUV:function(n,e){return this.tu+=n,this.tv+=e,this},scaleUV:function(n,e){return this.tu=this.u*n,this.tv=this.v*e,this},transformCoordinatesLocal:function(n,e,i,h){var s=this.x,l=this.y,f=this.z,u=n.val,d=s*u[0]+l*u[4]+f*u[8]+u[12],p=s*u[1]+l*u[5]+f*u[9]+u[13],g=s*u[2]+l*u[6]+f*u[10]+u[14],x=s*u[3]+l*u[7]+f*u[11]+u[15];this.vx=d/x*e,this.vy=-(p/x)*i,h<=0?this.vz=g/x:this.vz=-(g/x)},resize:function(n,e,i,h,s,l){return this.x=n,this.y=e,this.vx=this.x*i,this.vy=-this.y*h,this.vz=0,s<.5?this.vx+=i*(.5-s):s>.5&&(this.vx-=i*(s-.5)),l<.5?this.vy+=h*(.5-l):l>.5&&(this.vy-=h*(l-.5)),this},update:function(n,e,i,h,s,l,f,u){var d=this.vx*n+this.vy*i+s,p=this.vx*e+this.vy*h+l;return f&&(d=Math.round(d),p=Math.round(p)),this.tx=d,this.ty=p,this.ta=this.alpha*u,this},load:function(n,e,i,h,s){return n[++i]=this.tx,n[++i]=this.ty,n[++i]=this.tu,n[++i]=this.tv,n[++i]=h,n[++i]=s,e[++i]=v.getTintAppendFloatAlpha(this.color,this.ta),i}});c.exports=r},73090:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2729,7 +2729,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(X,Y,b){b=b||2;var z=Y&&Y.length,W=z?Y[0]*b:X.length,H=t(X,0,W,b,!0),Z=[];if(!H||H.next===H.prev)return Z;var Q,k,et,st,rt,ot,ft;if(z&&(H=i(X,Y,H,b)),X.length>80*b){Q=et=X[0],k=st=X[1];for(var at=b;atet&&(et=rt),ot>st&&(st=ot);ft=Math.max(et-Q,st-k),ft=ft!==0?32767/ft:0}return v(H,Z,b,Q,k,ft,0),Z}function t(X,Y,b,z,W){var H,Z;if(W===J(X,Y,b,z)>0)for(H=Y;H=Y;H-=z)Z=V(H,X[H],X[H+1],Z);return Z&&P(Z,Z.next)&&(K(Z),Z=Z.next),Z}function o(X,Y){if(!X)return X;Y||(Y=X);var b=X,z;do if(z=!1,!b.steiner&&(P(b,b.next)||C(b.prev,b,b.next)===0)){if(K(b),b=Y=b.prev,b===b.next)break;z=!0}else b=b.next;while(z||b!==Y);return Y}function v(X,Y,b,z,W,H,Z){if(X){!Z&&H&&u(X,z,W,H);for(var Q=X,k,et;X.prev!==X.next;){if(k=X.prev,et=X.next,H?r(X,z,W,H):a(X)){Y.push(k.i/b|0),Y.push(X.i/b|0),Y.push(et.i/b|0),K(X),X=et.next,Q=et.next;continue}if(X=et,X===Q){Z?Z===1?(X=n(o(X),Y,b),v(X,Y,b,z,W,H,2)):Z===2&&e(X,Y,b,z,W,H):v(o(X),Y,b,z,W,H,1);break}}}}function a(X){var Y=X.prev,b=X,z=X.next;if(C(Y,b,z)>=0)return!1;for(var W=Y.x,H=b.x,Z=z.x,Q=Y.y,k=b.y,et=z.y,st=WH?W>Z?W:Z:H>Z?H:Z,ft=Q>k?Q>et?Q:et:k>et?k:et,at=z.next;at!==Y;){if(at.x>=st&&at.x<=ot&&at.y>=rt&&at.y<=ft&&y(W,Q,H,k,Z,et,at.x,at.y)&&C(at.prev,at,at.next)>=0)return!1;at=at.next}return!0}function r(X,Y,b,z){var W=X.prev,H=X,Z=X.next;if(C(W,H,Z)>=0)return!1;for(var Q=W.x,k=H.x,et=Z.x,st=W.y,rt=H.y,ot=Z.y,ft=Qk?Q>et?Q:et:k>et?k:et,At=st>rt?st>ot?st:ot:rt>ot?rt:ot,Et=p(ft,at,Y,b,z),Pt=p(vt,At,Y,b,z),ct=X.prevZ,Ct=X.nextZ;ct&&ct.z>=Et&&Ct&&Ct.z<=Pt;){if(ct.x>=ft&&ct.x<=vt&&ct.y>=at&&ct.y<=At&&ct!==W&&ct!==Z&&y(Q,st,k,rt,et,ot,ct.x,ct.y)&&C(ct.prev,ct,ct.next)>=0||(ct=ct.prevZ,Ct.x>=ft&&Ct.x<=vt&&Ct.y>=at&&Ct.y<=At&&Ct!==W&&Ct!==Z&&y(Q,st,k,rt,et,ot,Ct.x,Ct.y)&&C(Ct.prev,Ct,Ct.next)>=0))return!1;Ct=Ct.nextZ}for(;ct&&ct.z>=Et;){if(ct.x>=ft&&ct.x<=vt&&ct.y>=at&&ct.y<=At&&ct!==W&&ct!==Z&&y(Q,st,k,rt,et,ot,ct.x,ct.y)&&C(ct.prev,ct,ct.next)>=0)return!1;ct=ct.prevZ}for(;Ct&&Ct.z<=Pt;){if(Ct.x>=ft&&Ct.x<=vt&&Ct.y>=at&&Ct.y<=At&&Ct!==W&&Ct!==Z&&y(Q,st,k,rt,et,ot,Ct.x,Ct.y)&&C(Ct.prev,Ct,Ct.next)>=0)return!1;Ct=Ct.nextZ}return!0}function n(X,Y,b){var z=X;do{var W=z.prev,H=z.next.next;!P(W,H)&&M(W,z,z.next,H)&&B(W,H)&&B(H,W)&&(Y.push(W.i/b|0),Y.push(z.i/b|0),Y.push(H.i/b|0),K(z),K(z.next),z=X=H),z=z.next}while(z!==X);return o(z)}function e(X,Y,b,z,W,H){var Z=X;do{for(var Q=Z.next.next;Q!==Z.prev;){if(Z.i!==Q.i&&x(Z,Q)){var k=G(Z,Q);Z=o(Z,Z.next),k=o(k,k.next),v(Z,Y,b,z,W,H,0),v(k,Y,b,z,W,H,0);return}Q=Q.next}Z=Z.next}while(Z!==X)}function i(X,Y,b,z){var W=[],H,Z,Q,k,et;for(H=0,Z=Y.length;H=b.next.y&&b.next.y!==b.y){var Q=b.x+(W-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(Q<=z&&Q>H&&(H=Q,Z=b.x=b.x&&b.x>=et&&z!==b.x&&y(WZ.x||b.x===Z.x&&f(Z,b)))&&(Z=b,rt=ot)),b=b.next;while(b!==k);return Z}function f(X,Y){return C(X.prev,X,Y.prev)<0&&C(Y.next,X,X.next)<0}function u(X,Y,b,z){var W=X;do W.z===0&&(W.z=p(W.x,W.y,Y,b,z)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==X);W.prevZ.nextZ=null,W.prevZ=null,d(W)}function d(X){var Y,b,z,W,H,Z,Q,k,et=1;do{for(b=X,X=null,H=null,Z=0;b;){for(Z++,z=b,Q=0,Y=0;Y0||k>0&&z;)Q!==0&&(k===0||!z||b.z<=z.z)?(W=b,b=b.nextZ,Q--):(W=z,z=z.nextZ,k--),H?H.nextZ=W:X=W,W.prevZ=H,H=W;b=z}H.nextZ=null,et*=2}while(Z>1);return X}function p(X,Y,b,z,W){return X=(X-b)*W|0,Y=(Y-z)*W|0,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,X|Y<<1}function g(X){var Y=X,b=X;do(Y.x=(X-Z)*(H-Q)&&(X-Z)*(z-Q)>=(b-Z)*(Y-Q)&&(b-Z)*(H-Q)>=(W-Z)*(z-Q)}function x(X,Y){return X.next.i!==Y.i&&X.prev.i!==Y.i&&!L(X,Y)&&(B(X,Y)&&B(Y,X)&&N(X,Y)&&(C(X.prev,X,Y.prev)||C(X,Y.prev,Y))||P(X,Y)&&C(X.prev,X,X.next)>0&&C(Y.prev,Y,Y.next)>0)}function C(X,Y,b){return(Y.y-X.y)*(b.x-Y.x)-(Y.x-X.x)*(b.y-Y.y)}function P(X,Y){return X.x===Y.x&&X.y===Y.y}function M(X,Y,b,z){var W=I(C(X,Y,b)),H=I(C(X,Y,z)),Z=I(C(b,z,X)),Q=I(C(b,z,Y));return!!(W!==H&&Z!==Q||W===0&&w(X,b,Y)||H===0&&w(X,z,Y)||Z===0&&w(b,X,z)||Q===0&&w(b,Y,z))}function w(X,Y,b){return Y.x<=Math.max(X.x,b.x)&&Y.x>=Math.min(X.x,b.x)&&Y.y<=Math.max(X.y,b.y)&&Y.y>=Math.min(X.y,b.y)}function I(X){return X>0?1:X<0?-1:0}function L(X,Y){var b=X;do{if(b.i!==X.i&&b.next.i!==X.i&&b.i!==Y.i&&b.next.i!==Y.i&&M(b,b.next,X,Y))return!0;b=b.next}while(b!==X);return!1}function B(X,Y){return C(X.prev,X,X.next)<0?C(X,Y,X.next)>=0&&C(X,X.prev,Y)>=0:C(X,Y,X.prev)<0||C(X,X.next,Y)<0}function N(X,Y){var b=X,z=!1,W=(X.x+Y.x)/2,H=(X.y+Y.y)/2;do b.y>H!=b.next.y>H&&b.next.y!==b.y&&W<(b.next.x-b.x)*(H-b.y)/(b.next.y-b.y)+b.x&&(z=!z),b=b.next;while(b!==X);return z}function G(X,Y){var b=new j(X.i,X.x,X.y),z=new j(Y.i,Y.x,Y.y),W=X.next,H=Y.prev;return X.next=Y,Y.prev=X,b.next=W,W.prev=b,z.next=b,b.prev=z,H.next=z,z.prev=H,z}function V(X,Y,b,z){var W=new j(X,Y,b);return z?(W.next=z.next,W.prev=z,z.next.prev=W,z.next=W):(W.prev=W,W.next=W),W}function K(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function j(X,Y,b){this.i=X,this.x=Y,this.y=b,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}m.deviation=function(X,Y,b,z){var W=Y&&Y.length,H=W?Y[0]*b:X.length,Z=Math.abs(J(X,0,H,b));if(W)for(var Q=0,k=Y.length;Q0&&(z+=X[W-1].length,b.holes.push(z))}return b},c.exports=m},13829:(c,m,t)=>{/** + */function m(X,Y,b){b=b||2;var z=Y&&Y.length,W=z?Y[0]*b:X.length,H=t(X,0,W,b,!0),Z=[];if(!H||H.next===H.prev)return Z;var Q,k,et,st,rt,ot,ft;if(z&&(H=i(X,Y,H,b)),X.length>80*b){Q=et=X[0],k=st=X[1];for(var at=b;atet&&(et=rt),ot>st&&(st=ot);ft=Math.max(et-Q,st-k),ft=ft!==0?32767/ft:0}return v(H,Z,b,Q,k,ft,0),Z}function t(X,Y,b,z,W){var H,Z;if(W===J(X,Y,b,z)>0)for(H=Y;H=Y;H-=z)Z=V(H,X[H],X[H+1],Z);return Z&&P(Z,Z.next)&&(K(Z),Z=Z.next),Z}function o(X,Y){if(!X)return X;Y||(Y=X);var b=X,z;do if(z=!1,!b.steiner&&(P(b,b.next)||C(b.prev,b,b.next)===0)){if(K(b),b=Y=b.prev,b===b.next)break;z=!0}else b=b.next;while(z||b!==Y);return Y}function v(X,Y,b,z,W,H,Z){if(X){!Z&&H&&u(X,z,W,H);for(var Q=X,k,et;X.prev!==X.next;){if(k=X.prev,et=X.next,H?r(X,z,W,H):a(X)){Y.push(k.i/b|0),Y.push(X.i/b|0),Y.push(et.i/b|0),K(X),X=et.next,Q=et.next;continue}if(X=et,X===Q){Z?Z===1?(X=n(o(X),Y,b),v(X,Y,b,z,W,H,2)):Z===2&&e(X,Y,b,z,W,H):v(o(X),Y,b,z,W,H,1);break}}}}function a(X){var Y=X.prev,b=X,z=X.next;if(C(Y,b,z)>=0)return!1;for(var W=Y.x,H=b.x,Z=z.x,Q=Y.y,k=b.y,et=z.y,st=WH?W>Z?W:Z:H>Z?H:Z,ft=Q>k?Q>et?Q:et:k>et?k:et,at=z.next;at!==Y;){if(at.x>=st&&at.x<=ot&&at.y>=rt&&at.y<=ft&&x(W,Q,H,k,Z,et,at.x,at.y)&&C(at.prev,at,at.next)>=0)return!1;at=at.next}return!0}function r(X,Y,b,z){var W=X.prev,H=X,Z=X.next;if(C(W,H,Z)>=0)return!1;for(var Q=W.x,k=H.x,et=Z.x,st=W.y,rt=H.y,ot=Z.y,ft=Qk?Q>et?Q:et:k>et?k:et,At=st>rt?st>ot?st:ot:rt>ot?rt:ot,Et=p(ft,at,Y,b,z),Pt=p(vt,At,Y,b,z),ct=X.prevZ,Ct=X.nextZ;ct&&ct.z>=Et&&Ct&&Ct.z<=Pt;){if(ct.x>=ft&&ct.x<=vt&&ct.y>=at&&ct.y<=At&&ct!==W&&ct!==Z&&x(Q,st,k,rt,et,ot,ct.x,ct.y)&&C(ct.prev,ct,ct.next)>=0||(ct=ct.prevZ,Ct.x>=ft&&Ct.x<=vt&&Ct.y>=at&&Ct.y<=At&&Ct!==W&&Ct!==Z&&x(Q,st,k,rt,et,ot,Ct.x,Ct.y)&&C(Ct.prev,Ct,Ct.next)>=0))return!1;Ct=Ct.nextZ}for(;ct&&ct.z>=Et;){if(ct.x>=ft&&ct.x<=vt&&ct.y>=at&&ct.y<=At&&ct!==W&&ct!==Z&&x(Q,st,k,rt,et,ot,ct.x,ct.y)&&C(ct.prev,ct,ct.next)>=0)return!1;ct=ct.prevZ}for(;Ct&&Ct.z<=Pt;){if(Ct.x>=ft&&Ct.x<=vt&&Ct.y>=at&&Ct.y<=At&&Ct!==W&&Ct!==Z&&x(Q,st,k,rt,et,ot,Ct.x,Ct.y)&&C(Ct.prev,Ct,Ct.next)>=0)return!1;Ct=Ct.nextZ}return!0}function n(X,Y,b){var z=X;do{var W=z.prev,H=z.next.next;!P(W,H)&&M(W,z,z.next,H)&&B(W,H)&&B(H,W)&&(Y.push(W.i/b|0),Y.push(z.i/b|0),Y.push(H.i/b|0),K(z),K(z.next),z=X=H),z=z.next}while(z!==X);return o(z)}function e(X,Y,b,z,W,H){var Z=X;do{for(var Q=Z.next.next;Q!==Z.prev;){if(Z.i!==Q.i&&y(Z,Q)){var k=G(Z,Q);Z=o(Z,Z.next),k=o(k,k.next),v(Z,Y,b,z,W,H,0),v(k,Y,b,z,W,H,0);return}Q=Q.next}Z=Z.next}while(Z!==X)}function i(X,Y,b,z){var W=[],H,Z,Q,k,et;for(H=0,Z=Y.length;H=b.next.y&&b.next.y!==b.y){var Q=b.x+(W-b.y)*(b.next.x-b.x)/(b.next.y-b.y);if(Q<=z&&Q>H&&(H=Q,Z=b.x=b.x&&b.x>=et&&z!==b.x&&x(WZ.x||b.x===Z.x&&f(Z,b)))&&(Z=b,rt=ot)),b=b.next;while(b!==k);return Z}function f(X,Y){return C(X.prev,X,Y.prev)<0&&C(Y.next,X,X.next)<0}function u(X,Y,b,z){var W=X;do W.z===0&&(W.z=p(W.x,W.y,Y,b,z)),W.prevZ=W.prev,W.nextZ=W.next,W=W.next;while(W!==X);W.prevZ.nextZ=null,W.prevZ=null,d(W)}function d(X){var Y,b,z,W,H,Z,Q,k,et=1;do{for(b=X,X=null,H=null,Z=0;b;){for(Z++,z=b,Q=0,Y=0;Y0||k>0&&z;)Q!==0&&(k===0||!z||b.z<=z.z)?(W=b,b=b.nextZ,Q--):(W=z,z=z.nextZ,k--),H?H.nextZ=W:X=W,W.prevZ=H,H=W;b=z}H.nextZ=null,et*=2}while(Z>1);return X}function p(X,Y,b,z,W){return X=(X-b)*W|0,Y=(Y-z)*W|0,X=(X|X<<8)&16711935,X=(X|X<<4)&252645135,X=(X|X<<2)&858993459,X=(X|X<<1)&1431655765,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,X|Y<<1}function g(X){var Y=X,b=X;do(Y.x=(X-Z)*(H-Q)&&(X-Z)*(z-Q)>=(b-Z)*(Y-Q)&&(b-Z)*(H-Q)>=(W-Z)*(z-Q)}function y(X,Y){return X.next.i!==Y.i&&X.prev.i!==Y.i&&!L(X,Y)&&(B(X,Y)&&B(Y,X)&&N(X,Y)&&(C(X.prev,X,Y.prev)||C(X,Y.prev,Y))||P(X,Y)&&C(X.prev,X,X.next)>0&&C(Y.prev,Y,Y.next)>0)}function C(X,Y,b){return(Y.y-X.y)*(b.x-Y.x)-(Y.x-X.x)*(b.y-Y.y)}function P(X,Y){return X.x===Y.x&&X.y===Y.y}function M(X,Y,b,z){var W=I(C(X,Y,b)),H=I(C(X,Y,z)),Z=I(C(b,z,X)),Q=I(C(b,z,Y));return!!(W!==H&&Z!==Q||W===0&&w(X,b,Y)||H===0&&w(X,z,Y)||Z===0&&w(b,X,z)||Q===0&&w(b,Y,z))}function w(X,Y,b){return Y.x<=Math.max(X.x,b.x)&&Y.x>=Math.min(X.x,b.x)&&Y.y<=Math.max(X.y,b.y)&&Y.y>=Math.min(X.y,b.y)}function I(X){return X>0?1:X<0?-1:0}function L(X,Y){var b=X;do{if(b.i!==X.i&&b.next.i!==X.i&&b.i!==Y.i&&b.next.i!==Y.i&&M(b,b.next,X,Y))return!0;b=b.next}while(b!==X);return!1}function B(X,Y){return C(X.prev,X,X.next)<0?C(X,Y,X.next)>=0&&C(X,X.prev,Y)>=0:C(X,Y,X.prev)<0||C(X,X.next,Y)<0}function N(X,Y){var b=X,z=!1,W=(X.x+Y.x)/2,H=(X.y+Y.y)/2;do b.y>H!=b.next.y>H&&b.next.y!==b.y&&W<(b.next.x-b.x)*(H-b.y)/(b.next.y-b.y)+b.x&&(z=!z),b=b.next;while(b!==X);return z}function G(X,Y){var b=new j(X.i,X.x,X.y),z=new j(Y.i,Y.x,Y.y),W=X.next,H=Y.prev;return X.next=Y,Y.prev=X,b.next=W,W.prev=b,z.next=b,b.prev=z,H.next=z,z.prev=H,z}function V(X,Y,b,z){var W=new j(X,Y,b);return z?(W.next=z.next,W.prev=z,z.next.prev=W,z.next=W):(W.prev=W,W.next=W),W}function K(X){X.next.prev=X.prev,X.prev.next=X.next,X.prevZ&&(X.prevZ.nextZ=X.nextZ),X.nextZ&&(X.nextZ.prevZ=X.prevZ)}function j(X,Y,b){this.i=X,this.x=Y,this.y=b,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}m.deviation=function(X,Y,b,z){var W=Y&&Y.length,H=W?Y[0]*b:X.length,Z=Math.abs(J(X,0,H,b));if(W)for(var Q=0,k=Y.length;Q0&&(z+=X[W-1].length,b.holes.push(z))}return b},c.exports=m},13829:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2741,7 +2741,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(35001),v=t(23031),a=t(30052),r=function(n,e,i,h){h===void 0&&(h=[]);var s=n.points,l=a(n);!e&&i>0&&(e=l/i);for(var f=0;fd+C){d+=C;continue}var P=x.getPoint((u-d)/C);h.push(P);break}return h};c.exports=r},30052:(c,m,t)=>{/** + */var o=t(35001),v=t(23031),a=t(30052),r=function(n,e,i,h){h===void 0&&(h=[]);var s=n.points,l=a(n);!e&&i>0&&(e=l/i);for(var f=0;fd+C){d+=C;continue}var P=y.getPoint((u-d)/C);h.push(P);break}return h};c.exports=r},30052:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2938,7 +2938,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(94811),v=t(16483),a=function(r,n,e,i,h){n===void 0&&(n=null),e===void 0&&(e=1),i===void 0&&(i=1),h===void 0&&(h=[]);for(var s=o(r,n),l,f,u,d,p,g,y,x,C,P=0;P{/** + */var o=t(94811),v=t(16483),a=function(r,n,e,i,h){n===void 0&&(n=null),e===void 0&&(e=1),i===void 0&&(i=1),h===void 0&&(h=[]);for(var s=o(r,n),l,f,u,d,p,g,x,y,C,P=0;P{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2958,7 +2958,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(96503),v=function(a,r){r===void 0&&(r=new o);var n=a.x1,e=a.y1,i=a.x2,h=a.y2,s=a.x3,l=a.y3,f=i-n,u=h-e,d=s-n,p=l-e,g=f*(n+i)+u*(e+h),y=d*(n+s)+p*(e+l),x=2*(f*(l-h)-u*(s-i)),C,P;if(Math.abs(x)<1e-6){var M=Math.min(n,i,s),w=Math.min(e,h,l);C=(Math.max(n,i,s)-M)*.5,P=(Math.max(e,h,l)-w)*.5,r.x=M+C,r.y=w+P,r.radius=Math.sqrt(C*C+P*P)}else r.x=(p*g-u*y)/x,r.y=(f*y-d*g)/x,C=r.x-n,P=r.y-e,r.radius=Math.sqrt(C*C+P*P);return r};c.exports=v},74422:(c,m,t)=>{/** + */var o=t(96503),v=function(a,r){r===void 0&&(r=new o);var n=a.x1,e=a.y1,i=a.x2,h=a.y2,s=a.x3,l=a.y3,f=i-n,u=h-e,d=s-n,p=l-e,g=f*(n+i)+u*(e+h),x=d*(n+s)+p*(e+l),y=2*(f*(l-h)-u*(s-i)),C,P;if(Math.abs(y)<1e-6){var M=Math.min(n,i,s),w=Math.min(e,h,l);C=(Math.max(n,i,s)-M)*.5,P=(Math.max(e,h,l)-w)*.5,r.x=M+C,r.y=w+P,r.radius=Math.sqrt(C*C+P*P)}else r.x=(p*g-u*x)/y,r.y=(f*x-d*g)/y,C=r.x-n,P=r.y-e,r.radius=Math.sqrt(C*C+P*P);return r};c.exports=v},74422:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2966,11 +2966,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v){var a=t.x3-t.x1,r=t.y3-t.y1,n=t.x2-t.x1,e=t.y2-t.y1,i=o-t.x1,h=v-t.y1,s=a*a+r*r,l=a*n+r*e,f=a*i+r*h,u=n*n+e*e,d=n*i+e*h,p=s*u-l*l,g=p===0?0:1/p,y=(u*f-l*d)*g,x=(s*d-l*f)*g;return y>=0&&x>=0&&y+x<1};c.exports=m},48653:c=>{/** + */var m=function(t,o,v){var a=t.x3-t.x1,r=t.y3-t.y1,n=t.x2-t.x1,e=t.y2-t.y1,i=o-t.x1,h=v-t.y1,s=a*a+r*r,l=a*n+r*e,f=a*i+r*h,u=n*n+e*e,d=n*i+e*h,p=s*u-l*l,g=p===0?0:1/p,x=(u*f-l*d)*g,y=(s*d-l*f)*g;return x>=0&&y>=0&&x+y<1};c.exports=m},48653:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v,a){v===void 0&&(v=!1),a===void 0&&(a=[]);for(var r=t.x3-t.x1,n=t.y3-t.y1,e=t.x2-t.x1,i=t.y2-t.y1,h=r*r+n*n,s=r*e+n*i,l=e*e+i*i,f=h*l-s*s,u=f===0?0:1/f,d,p,g,y,x,C,P=t.x1,M=t.y1,w=0;w=0&&p>=0&&d+p<1&&(a.push({x:o[w].x,y:o[w].y}),v)));w++);return a};c.exports=m},96006:(c,m,t)=>{/** + */var m=function(t,o,v,a){v===void 0&&(v=!1),a===void 0&&(a=[]);for(var r=t.x3-t.x1,n=t.y3-t.y1,e=t.x2-t.x1,i=t.y2-t.y1,h=r*r+n*n,s=r*e+n*i,l=e*e+i*i,f=h*l-s*s,u=f===0?0:1/f,d,p,g,x,y,C,P=t.x1,M=t.y1,w=0;w=0&&p>=0&&d+p<1&&(a.push({x:o[w].x,y:o[w].y}),v)));w++);return a};c.exports=m},96006:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -2994,7 +2994,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(35001),v=t(2141),a=function(r,n,e,i){i===void 0&&(i=[]);var h=r.getLineA(),s=r.getLineB(),l=r.getLineC(),f=o(h),u=o(s),d=o(l),p=f+u+d;!n&&e>0&&(n=p/e);for(var g=0;gf+u?(y-=f+u,x=y/d,C.x=l.x1+(l.x2-l.x1)*x,C.y=l.y1+(l.y2-l.y1)*x):(y-=f,x=y/u,C.x=s.x1+(s.x2-s.x1)*x,C.y=s.y1+(s.y2-s.y1)*x),i.push(C)}return i};c.exports=a},39757:(c,m,t)=>{/** + */var o=t(35001),v=t(2141),a=function(r,n,e,i){i===void 0&&(i=[]);var h=r.getLineA(),s=r.getLineB(),l=r.getLineC(),f=o(h),u=o(s),d=o(l),p=f+u+d;!n&&e>0&&(n=p/e);for(var g=0;gf+u?(x-=f+u,y=x/d,C.x=l.x1+(l.x2-l.x1)*y,C.y=l.y1+(l.y2-l.y1)*y):(x-=f,y=x/u,C.x=s.x1+(s.x2-s.x1)*y,C.y=s.y1+(s.y2-s.y1)*y),i.push(C)}return i};c.exports=a},39757:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3042,11 +3042,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(93301),a=t(50792),r=t(8214),n=t(8443),e=t(78970),i=t(85098),h=t(42515),s=t(36210),l=t(61340),f=t(85955),u=new o({initialize:function(p,g){this.game=p,this.scaleManager,this.canvas,this.config=g,this.enabled=!0,this.events=new a,this.isOver=!0,this.defaultCursor="",this.keyboard=g.inputKeyboard?new e(this):null,this.mouse=g.inputMouse?new i(this):null,this.touch=g.inputTouch?new s(this):null,this.pointers=[],this.pointersTotal=g.inputActivePointers,g.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var y=0;y<=this.pointersTotal;y++){var x=new h(this,y);x.smoothFactor=g.inputSmoothFactor,this.pointers.push(x)}this.mousePointer=g.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 l,this._tempMatrix2=new l,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],p.events.once(n.BOOT,this.boot,this)},boot:function(){var d=this.game,p=d.events;this.canvas=d.canvas,this.scaleManager=d.scale,this.events.emit(r.MANAGER_BOOT),p.on(n.PRE_RENDER,this.preRender,this),p.once(n.DESTROY,this.destroy,this)},setCanvasOver:function(d){this.isOver=!0,this.events.emit(r.GAME_OVER,d)},setCanvasOut:function(d){this.isOver=!1,this.events.emit(r.GAME_OUT,d)},preRender:function(){var d=this.game.loop.now,p=this.game.loop.delta,g=this.game.scene.getScenes(!0,!0);this.time=d,this.events.emit(r.MANAGER_UPDATE);for(var y=0;y10&&(d=10-this.pointersTotal);for(var g=0;g{/** + */var o=t(83419),v=t(93301),a=t(50792),r=t(8214),n=t(8443),e=t(78970),i=t(85098),h=t(42515),s=t(36210),l=t(61340),f=t(85955),u=new o({initialize:function(p,g){this.game=p,this.scaleManager,this.canvas,this.config=g,this.enabled=!0,this.events=new a,this.isOver=!0,this.defaultCursor="",this.keyboard=g.inputKeyboard?new e(this):null,this.mouse=g.inputMouse?new i(this):null,this.touch=g.inputTouch?new s(this):null,this.pointers=[],this.pointersTotal=g.inputActivePointers,g.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var x=0;x<=this.pointersTotal;x++){var y=new h(this,x);y.smoothFactor=g.inputSmoothFactor,this.pointers.push(y)}this.mousePointer=g.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 l,this._tempMatrix2=new l,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],p.events.once(n.BOOT,this.boot,this)},boot:function(){var d=this.game,p=d.events;this.canvas=d.canvas,this.scaleManager=d.scale,this.events.emit(r.MANAGER_BOOT),p.on(n.PRE_RENDER,this.preRender,this),p.once(n.DESTROY,this.destroy,this)},setCanvasOver:function(d){this.isOver=!0,this.events.emit(r.GAME_OVER,d)},setCanvasOut:function(d){this.isOver=!1,this.events.emit(r.GAME_OUT,d)},preRender:function(){var d=this.game.loop.now,p=this.game.loop.delta,g=this.game.scene.getScenes(!0,!0);this.time=d,this.events.emit(r.MANAGER_UPDATE);for(var x=0;x10&&(d=10-this.pointersTotal);for(var g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(96503),v=t(87902),a=t(83419),r=t(93301),n=t(74457),e=t(84409),i=t(20339),h=t(8497),s=t(81154),l=t(8214),f=t(50792),u=t(95540),d=t(23777),p=t(89639),g=t(41212),y=t(37277),x=t(87841),C=t(37303),P=t(44594),M=t(16483),w=t(10690),I=new a({Extends:f,initialize:function(B){f.call(this),this.scene=B,this.systems=B.sys,this.settings=B.sys.settings,this.manager=B.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,p.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var N={cancelled:!1};this._eventContainer={stopPropagation:function(){N.cancelled=!0}},this._eventData=N,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,B.sys.events.once(P.BOOT,this.boot,this),B.sys.events.on(P.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(P.DESTROY,this.destroy,this),this.pluginEvents.emit(l.BOOT)},start:function(){var L=this.systems.events;L.on(P.TRANSITION_START,this.transitionIn,this),L.on(P.TRANSITION_OUT,this.transitionOut,this),L.on(P.TRANSITION_COMPLETE,this.transitionComplete,this),L.on(P.PRE_UPDATE,this.preUpdate,this),L.once(P.SHUTDOWN,this.shutdown,this),this.manager.events.on(l.GAME_OUT,this.onGameOut,this),this.manager.events.on(l.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(l.START)},onGameOver:function(L){this.isActive()&&this.emit(l.GAME_OVER,L.timeStamp,L)},onGameOut:function(L){this.isActive()&&this.emit(l.GAME_OUT,L.timeStamp,L)},preUpdate:function(){this.pluginEvents.emit(l.PRE_UPDATE);var L=this._pendingRemoval,B=this._pendingInsertion,N=L.length,G=B.length;if(!(N===0&&G===0)){for(var V=this._list,K=0;K-1&&(V.splice(J,1),this.clear(j,!0))}this._pendingRemoval.length=0,this._list=V.concat(B.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(L,B){if(!this.isActive())return!1;if(this.pluginEvents.emit(l.UPDATE,L,B),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var N,G=this.manager,V=G.pointers,K=G.pointersTotal;for(N=0;N0)if(this._pollTimer-=B,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var J=!1;for(N=0;N0&&(J=!0)}return J},update:function(L,B){if(!this.isActive())return!1;for(var N=B.length,G=!1,V=0;V0&&(G=!0)}return this._updatedThisFrame=!0,G},clear:function(L,B){B===void 0&&(B=!1),this.disable(L);var N=L.input;N&&(this.removeDebug(L),this.manager.resetCursor(N),N.gameObject=void 0,N.target=void 0,N.hitArea=void 0,N.hitAreaCallback=void 0,N.callbackContext=void 0,L.input=null),B||this.queueForRemoval(L);var G=this._draggable.indexOf(L);return G>-1&&this._draggable.splice(G,1),L},disable:function(L){var B=L.input;B&&(B.enabled=!1,B.dragState=0);for(var N=this._drag,G=this._over,V=this.manager,K=0,j;K-1&&N[K].splice(j,1),j=G[K].indexOf(L),j>-1&&G[K].splice(j,1);return this},enable:function(L,B,N,G){return G===void 0&&(G=!1),L.input?L.input.enabled=!0:this.setHitArea(L,B,N),L.input&&G&&!L.input.dropZone&&(L.input.dropZone=G),this},hitTestPointer:function(L){for(var B=this.cameras.getCamerasBelowPointer(L),N=0;N0)return L.camera=G,V}return L.camera=B[0],[]},processDownEvents:function(L){var B=0,N=this._temp,G=this._eventData,V=this._eventContainer;G.cancelled=!1;for(var K=!1,j=0;j0&&i(L.x,L.y,L.downX,L.downY)>=V||G>0&&B>=L.downTime+G)&&(N=!0),N)return this.setDragState(L,3),this.processDragStartList(L)},processDragStartList:function(L){if(this.getDragState(L)!==3)return 0;for(var B=this._drag[L.id],N=0;N1&&(this.sortGameObjects(N,L),this.topOnly&&N.splice(1)),this._drag[L.id]=N,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(L,3),this.processDragStartList(L)):(this.setDragState(L,2),0))},processDragMoveEvent:function(L){if(this.getDragState(L)===2&&this.processDragThresholdEvent(L,this.manager.game.loop.now),this.getDragState(L)!==4)return 0;for(var B=this._tempZones,N=this._drag[L.id],G=0;G0?(V.emit(l.GAMEOBJECT_DRAG_LEAVE,L,j),this.emit(l.DRAG_LEAVE,L,V,j),K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j)):(V.emit(l.GAMEOBJECT_DRAG_LEAVE,L,j),this.emit(l.DRAG_LEAVE,L,V,j),B[0]?(K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j)):K.target=null)}else!j&&B[0]&&(K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j));var X,Y;if(!V.parentContainer)X=L.worldX-K.dragX,Y=L.worldY-K.dragY;else{var b=L.worldX-K.dragStartXGlobal,z=L.worldY-K.dragStartYGlobal,W=V.getParentRotation(),H=b*Math.cos(W)+z*Math.sin(W),Z=z*Math.cos(W)-b*Math.sin(W);H*=1/V.parentContainer.scaleX,Z*=1/V.parentContainer.scaleY,X=H+K.dragStartX,Y=Z+K.dragStartY}V.emit(l.GAMEOBJECT_DRAG,L,X,Y),this.emit(l.DRAG,L,V,X,Y)}return N.length},processDragUpEvent:function(L){for(var B=this._drag[L.id],N=0;N0){var K=this.manager,j=this._eventData,J=this._eventContainer;j.cancelled=!1;for(var X=!1,Y=0;Y0){var V=this.manager,K=this._eventData,j=this._eventContainer;K.cancelled=!1;var J=!1;this.sortGameObjects(B,L);for(var X=0;X0){for(this.sortGameObjects(V,L),N=0;N0){for(this.sortGameObjects(K,L),N=0;N-1&&this._draggable.splice(V,1)}return this},makePixelPerfect:function(L){L===void 0&&(L=1);var B=this.systems.textures;return e(B,L)},setHitArea:function(L,B,N){if(B===void 0)return this.setHitAreaFromTexture(L);Array.isArray(L)||(L=[L]);var G=!1,V=!1,K=!1,j=!1,J=!1,X=!0;if(g(B)&&Object.keys(B).length){var Y=B,b=L.some(function(Q){return Q.hasOwnProperty("faces")});if(!b){B=u(Y,"hitArea",null),N=u(Y,"hitAreaCallback",null),J=u(Y,"pixelPerfect",!1);var z=u(Y,"alphaTolerance",1);J&&(B={},N=this.makePixelPerfect(z))}G=u(Y,"draggable",!1),V=u(Y,"dropZone",!1),K=u(Y,"cursor",!1),j=u(Y,"useHandCursor",!1),(!B||!N)&&(this.setHitAreaFromTexture(L),X=!1)}else typeof B=="function"&&!N&&(N=B,B={});for(var W=0;W{/** + */var o=t(96503),v=t(87902),a=t(83419),r=t(93301),n=t(74457),e=t(84409),i=t(20339),h=t(8497),s=t(81154),l=t(8214),f=t(50792),u=t(95540),d=t(23777),p=t(89639),g=t(41212),x=t(37277),y=t(87841),C=t(37303),P=t(44594),M=t(16483),w=t(10690),I=new a({Extends:f,initialize:function(B){f.call(this),this.scene=B,this.systems=B.sys,this.settings=B.sys.settings,this.manager=B.sys.game.input,this.pluginEvents=new f,this.enabled=!0,this.displayList,this.cameras,p.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var N={cancelled:!1};this._eventContainer={stopPropagation:function(){N.cancelled=!0}},this._eventData=N,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,B.sys.events.once(P.BOOT,this.boot,this),B.sys.events.on(P.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(P.DESTROY,this.destroy,this),this.pluginEvents.emit(l.BOOT)},start:function(){var L=this.systems.events;L.on(P.TRANSITION_START,this.transitionIn,this),L.on(P.TRANSITION_OUT,this.transitionOut,this),L.on(P.TRANSITION_COMPLETE,this.transitionComplete,this),L.on(P.PRE_UPDATE,this.preUpdate,this),L.once(P.SHUTDOWN,this.shutdown,this),this.manager.events.on(l.GAME_OUT,this.onGameOut,this),this.manager.events.on(l.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(l.START)},onGameOver:function(L){this.isActive()&&this.emit(l.GAME_OVER,L.timeStamp,L)},onGameOut:function(L){this.isActive()&&this.emit(l.GAME_OUT,L.timeStamp,L)},preUpdate:function(){this.pluginEvents.emit(l.PRE_UPDATE);var L=this._pendingRemoval,B=this._pendingInsertion,N=L.length,G=B.length;if(!(N===0&&G===0)){for(var V=this._list,K=0;K-1&&(V.splice(J,1),this.clear(j,!0))}this._pendingRemoval.length=0,this._list=V.concat(B.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(L,B){if(!this.isActive())return!1;if(this.pluginEvents.emit(l.UPDATE,L,B),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var N,G=this.manager,V=G.pointers,K=G.pointersTotal;for(N=0;N0)if(this._pollTimer-=B,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var J=!1;for(N=0;N0&&(J=!0)}return J},update:function(L,B){if(!this.isActive())return!1;for(var N=B.length,G=!1,V=0;V0&&(G=!0)}return this._updatedThisFrame=!0,G},clear:function(L,B){B===void 0&&(B=!1),this.disable(L);var N=L.input;N&&(this.removeDebug(L),this.manager.resetCursor(N),N.gameObject=void 0,N.target=void 0,N.hitArea=void 0,N.hitAreaCallback=void 0,N.callbackContext=void 0,L.input=null),B||this.queueForRemoval(L);var G=this._draggable.indexOf(L);return G>-1&&this._draggable.splice(G,1),L},disable:function(L){var B=L.input;B&&(B.enabled=!1,B.dragState=0);for(var N=this._drag,G=this._over,V=this.manager,K=0,j;K-1&&N[K].splice(j,1),j=G[K].indexOf(L),j>-1&&G[K].splice(j,1);return this},enable:function(L,B,N,G){return G===void 0&&(G=!1),L.input?L.input.enabled=!0:this.setHitArea(L,B,N),L.input&&G&&!L.input.dropZone&&(L.input.dropZone=G),this},hitTestPointer:function(L){for(var B=this.cameras.getCamerasBelowPointer(L),N=0;N0)return L.camera=G,V}return L.camera=B[0],[]},processDownEvents:function(L){var B=0,N=this._temp,G=this._eventData,V=this._eventContainer;G.cancelled=!1;for(var K=!1,j=0;j0&&i(L.x,L.y,L.downX,L.downY)>=V||G>0&&B>=L.downTime+G)&&(N=!0),N)return this.setDragState(L,3),this.processDragStartList(L)},processDragStartList:function(L){if(this.getDragState(L)!==3)return 0;for(var B=this._drag[L.id],N=0;N1&&(this.sortGameObjects(N,L),this.topOnly&&N.splice(1)),this._drag[L.id]=N,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(L,3),this.processDragStartList(L)):(this.setDragState(L,2),0))},processDragMoveEvent:function(L){if(this.getDragState(L)===2&&this.processDragThresholdEvent(L,this.manager.game.loop.now),this.getDragState(L)!==4)return 0;for(var B=this._tempZones,N=this._drag[L.id],G=0;G0?(V.emit(l.GAMEOBJECT_DRAG_LEAVE,L,j),this.emit(l.DRAG_LEAVE,L,V,j),K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j)):(V.emit(l.GAMEOBJECT_DRAG_LEAVE,L,j),this.emit(l.DRAG_LEAVE,L,V,j),B[0]?(K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j)):K.target=null)}else!j&&B[0]&&(K.target=B[0],j=K.target,V.emit(l.GAMEOBJECT_DRAG_ENTER,L,j),this.emit(l.DRAG_ENTER,L,V,j));var X,Y;if(!V.parentContainer)X=L.worldX-K.dragX,Y=L.worldY-K.dragY;else{var b=L.worldX-K.dragStartXGlobal,z=L.worldY-K.dragStartYGlobal,W=V.getParentRotation(),H=b*Math.cos(W)+z*Math.sin(W),Z=z*Math.cos(W)-b*Math.sin(W);H*=1/V.parentContainer.scaleX,Z*=1/V.parentContainer.scaleY,X=H+K.dragStartX,Y=Z+K.dragStartY}V.emit(l.GAMEOBJECT_DRAG,L,X,Y),this.emit(l.DRAG,L,V,X,Y)}return N.length},processDragUpEvent:function(L){for(var B=this._drag[L.id],N=0;N0){var K=this.manager,j=this._eventData,J=this._eventContainer;j.cancelled=!1;for(var X=!1,Y=0;Y0){var V=this.manager,K=this._eventData,j=this._eventContainer;K.cancelled=!1;var J=!1;this.sortGameObjects(B,L);for(var X=0;X0){for(this.sortGameObjects(V,L),N=0;N0){for(this.sortGameObjects(K,L),N=0;N-1&&this._draggable.splice(V,1)}return this},makePixelPerfect:function(L){L===void 0&&(L=1);var B=this.systems.textures;return e(B,L)},setHitArea:function(L,B,N){if(B===void 0)return this.setHitAreaFromTexture(L);Array.isArray(L)||(L=[L]);var G=!1,V=!1,K=!1,j=!1,J=!1,X=!0;if(g(B)&&Object.keys(B).length){var Y=B,b=L.some(function(Q){return Q.hasOwnProperty("faces")});if(!b){B=u(Y,"hitArea",null),N=u(Y,"hitAreaCallback",null),J=u(Y,"pixelPerfect",!1);var z=u(Y,"alphaTolerance",1);J&&(B={},N=this.makePixelPerfect(z))}G=u(Y,"draggable",!1),V=u(Y,"dropZone",!1),K=u(Y,"cursor",!1),j=u(Y,"useHandCursor",!1),(!B||!N)&&(this.setHitAreaFromTexture(L),X=!1)}else typeof B=="function"&&!N&&(N=B,B={});for(var W=0;W{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3054,7 +3054,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(31040),v=t(83419),a=t(20339),r=t(43855),n=t(47235),e=t(26099),i=t(25892),h=new v({initialize:function(l,f){this.manager=l,this.id=f,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new e,this.prevPosition=new e,this.midPoint=new e(-1,-1),this.velocity=new e,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=f===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(s){var l=s.getWorldPoint(this.x,this.y);return this.worldX=l.x,this.worldY=l.y,this},positionToCamera:function(s,l){return s.getWorldPoint(this.x,this.y,l)},updateMotion:function(){var s=this.position.x,l=this.position.y,f=this.midPoint.x,u=this.midPoint.y;if(!(s===f&&l===u)){var d=n(this.motionFactor,f,s),p=n(this.motionFactor,u,l);r(d,s,.1)&&(d=s),r(p,l,.1)&&(p=l),this.midPoint.set(d,p);var g=s-d,y=l-p;this.velocity.set(g,y),this.angle=o(d,p,s,l),this.distance=Math.sqrt(g*g+y*y)}},up:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=s.timeStamp,this.wasTouch=!1)},down:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),i.macOS&&s.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=s.timeStamp),this.wasTouch=!1},move:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.locked&&(this.movementX=s.movementX||s.mozMovementX||s.webkitMovementX||0,this.movementY=s.movementY||s.mozMovementY||s.webkitMovementY||0),this.moveTime=s.timeStamp,this.wasTouch=!1},wheel:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.deltaX=s.deltaX,this.deltaY=s.deltaY,this.deltaZ=s.deltaZ,this.wasTouch=!1},touchstart:function(s,l){s.pointerId&&(this.pointerId=s.pointerId),this.identifier=s.identifier,this.target=s.target,this.active=!0,this.buttons=1,this.event=l,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=l.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(s,l){this.event=l,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.moveTime=l.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return this.buttons===0},leftButtonDown:function(){return!!(this.buttons&1)},rightButtonDown:function(){return!!(this.buttons&2)},middleButtonDown:function(){return!!(this.buttons&4)},backButtonDown:function(){return!!(this.buttons&8)},forwardButtonDown:function(){return!!(this.buttons&16)},leftButtonReleased:function(){return this.button===0&&!this.isDown},rightButtonReleased:function(){return this.button===2&&!this.isDown},middleButtonReleased:function(){return this.button===1&&!this.isDown},backButtonReleased:function(){return this.button===3&&!this.isDown},forwardButtonReleased:function(){return this.button===4&&!this.isDown},getDistance:function(){return this.isDown?a(this.downX,this.downY,this.x,this.y):a(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?o(this.downX,this.downY,this.x,this.y):o(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(s,l){s===void 0&&(s=10),l===void 0&&(l=[]);for(var f=this.prevPosition.x,u=this.prevPosition.y,d=this.position.x,p=this.position.y,g=0;g{/** + */var o=t(31040),v=t(83419),a=t(20339),r=t(43855),n=t(47235),e=t(26099),i=t(25892),h=new v({initialize:function(l,f){this.manager=l,this.id=f,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new e,this.prevPosition=new e,this.midPoint=new e(-1,-1),this.velocity=new e,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=f===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(s){var l=s.getWorldPoint(this.x,this.y);return this.worldX=l.x,this.worldY=l.y,this},positionToCamera:function(s,l){return s.getWorldPoint(this.x,this.y,l)},updateMotion:function(){var s=this.position.x,l=this.position.y,f=this.midPoint.x,u=this.midPoint.y;if(!(s===f&&l===u)){var d=n(this.motionFactor,f,s),p=n(this.motionFactor,u,l);r(d,s,.1)&&(d=s),r(p,l,.1)&&(p=l),this.midPoint.set(d,p);var g=s-d,x=l-p;this.velocity.set(g,x),this.angle=o(d,p,s,l),this.distance=Math.sqrt(g*g+x*x)}},up:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=s.timeStamp,this.wasTouch=!1)},down:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.button=s.button,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),s.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),i.macOS&&s.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=s.timeStamp),this.wasTouch=!1},move:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.locked&&(this.movementX=s.movementX||s.mozMovementX||s.webkitMovementX||0,this.movementY=s.movementY||s.mozMovementY||s.webkitMovementY||0),this.moveTime=s.timeStamp,this.wasTouch=!1},wheel:function(s){"buttons"in s&&(this.buttons=s.buttons),this.event=s,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.deltaX=s.deltaX,this.deltaY=s.deltaY,this.deltaZ=s.deltaZ,this.wasTouch=!1},touchstart:function(s,l){s.pointerId&&(this.pointerId=s.pointerId),this.identifier=s.identifier,this.target=s.target,this.active=!0,this.buttons=1,this.event=l,this.downElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=l.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(s,l){this.event=l,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.moveTime=l.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(s,l){this.buttons=0,this.event=l,this.upElement=s.target,this.manager.transformPointer(this,s.pageX,s.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=l.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return this.buttons===0},leftButtonDown:function(){return!!(this.buttons&1)},rightButtonDown:function(){return!!(this.buttons&2)},middleButtonDown:function(){return!!(this.buttons&4)},backButtonDown:function(){return!!(this.buttons&8)},forwardButtonDown:function(){return!!(this.buttons&16)},leftButtonReleased:function(){return this.button===0&&!this.isDown},rightButtonReleased:function(){return this.button===2&&!this.isDown},middleButtonReleased:function(){return this.button===1&&!this.isDown},backButtonReleased:function(){return this.button===3&&!this.isDown},forwardButtonReleased:function(){return this.button===4&&!this.isDown},getDistance:function(){return this.isDown?a(this.downX,this.downY,this.x,this.y):a(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?o(this.downX,this.downY,this.x,this.y):o(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(s,l){s===void 0&&(s=10),l===void 0&&(l=[]);for(var f=this.prevPosition.x,u=this.prevPosition.y,d=this.position.x,p=this.position.y,g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3262,7 +3262,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(50792),a=t(92734),r=t(99125),n=t(35154),e=t(89639),i=t(8214),h=new o({Extends:v,initialize:function(l){v.call(this),this.scene=l.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=l,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,l.pluginEvents.once(i.BOOT,this.boot,this),l.pluginEvents.on(i.START,this.start,this)},boot:function(){var s=this.scene.sys.game,l=this.settings.input,f=s.config;this.enabled=n(l,"gamepad",f.inputGamepad)&&s.device.input.gamepads,this.target=n(l,"gamepad.target",f.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(i.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(i.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var s=this,l=this.target,f=function(u){u.defaultPrevented||!s.isActive()||(s.refreshPads(),s.queue.push(u))};this.onGamepadHandler=f,l.addEventListener("gamepadconnected",f,!1),l.addEventListener("gamepaddisconnected",f,!1),this.sceneInputPlugin.pluginEvents.on(i.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(i.UPDATE,this.update);for(var s=0;s{/** + */var o=t(83419),v=t(50792),a=t(92734),r=t(99125),n=t(35154),e=t(89639),i=t(8214),h=new o({Extends:v,initialize:function(l){v.call(this),this.scene=l.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=l,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,l.pluginEvents.once(i.BOOT,this.boot,this),l.pluginEvents.on(i.START,this.start,this)},boot:function(){var s=this.scene.sys.game,l=this.settings.input,f=s.config;this.enabled=n(l,"gamepad",f.inputGamepad)&&s.device.input.gamepads,this.target=n(l,"gamepad.target",f.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(i.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(i.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var s=this,l=this.target,f=function(u){u.defaultPrevented||!s.isActive()||(s.refreshPads(),s.queue.push(u))};this.onGamepadHandler=f,l.addEventListener("gamepadconnected",f,!1),l.addEventListener("gamepaddisconnected",f,!1),this.sceneInputPlugin.pluginEvents.on(i.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(i.UPDATE,this.update);for(var s=0;s{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3322,7 +3322,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(50792),a=t(95922),r=t(8443),n=t(35154),e=t(8214),i=t(89639),h=t(30472),s=t(46032),l=t(87960),f=t(74600),u=t(44594),d=t(56583),p=new o({Extends:v,initialize:function(y){v.call(this),this.game=y.systems.game,this.scene=y.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=y,this.manager=y.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,y.pluginEvents.once(e.BOOT,this.boot,this),y.pluginEvents.on(e.START,this.start,this)},boot:function(){var g=this.settings.input;this.enabled=n(g,"keyboard",!0);var y=n(g,"keyboard.capture",null);y&&this.addCaptures(y),this.sceneInputPlugin.pluginEvents.once(e.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(e.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(e.SHUTDOWN,this.shutdown,this),this.game.events.on(r.BLUR,this.resetKeys,this),this.scene.sys.events.on(u.PAUSE,this.resetKeys,this),this.scene.sys.events.on(u.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(g){return this.manager.addCapture(g),this},removeCapture:function(g){return this.manager.removeCapture(g),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:s.UP,down:s.DOWN,left:s.LEFT,right:s.RIGHT,space:s.SPACE,shift:s.SHIFT})},addKeys:function(g,y,x){y===void 0&&(y=!0),x===void 0&&(x=!1);var C={};if(typeof g=="string"){g=g.split(",");for(var P=0;P-1?C[P]=g:C[g.keyCode]=g,y&&this.addCapture(g.keyCode),g.setEmitOnRepeat(x),g}return typeof g=="string"&&(g=s[g.toUpperCase()]),C[g]||(C[g]=new h(this,g),y&&this.addCapture(g),C[g].setEmitOnRepeat(x)),C[g]},removeKey:function(g,y,x){y===void 0&&(y=!1),x===void 0&&(x=!1);var C=this.keys,P;if(g instanceof h){var M=C.indexOf(g);M>-1&&(P=this.keys[M],this.keys[M]=void 0)}else typeof g=="string"&&(g=s[g.toUpperCase()]);return C[g]&&(P=C[g],C[g]=void 0),P&&(P.plugin=null,x&&this.removeCapture(P.keyCode),y&&P.destroy()),this},removeAllKeys:function(g,y){g===void 0&&(g=!1),y===void 0&&(y=!1);for(var x=this.keys,C=0;Cg._tick)return g._tick=x,!0}return!1},update:function(){var g=this.manager.queue,y=g.length;if(!(!this.isActive()||y===0))for(var x=this.keys,C=0;C{/** + */var o=t(83419),v=t(50792),a=t(95922),r=t(8443),n=t(35154),e=t(8214),i=t(89639),h=t(30472),s=t(46032),l=t(87960),f=t(74600),u=t(44594),d=t(56583),p=new o({Extends:v,initialize:function(x){v.call(this),this.game=x.systems.game,this.scene=x.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=x,this.manager=x.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,x.pluginEvents.once(e.BOOT,this.boot,this),x.pluginEvents.on(e.START,this.start,this)},boot:function(){var g=this.settings.input;this.enabled=n(g,"keyboard",!0);var x=n(g,"keyboard.capture",null);x&&this.addCaptures(x),this.sceneInputPlugin.pluginEvents.once(e.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(e.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(e.SHUTDOWN,this.shutdown,this),this.game.events.on(r.BLUR,this.resetKeys,this),this.scene.sys.events.on(u.PAUSE,this.resetKeys,this),this.scene.sys.events.on(u.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(g){return this.manager.addCapture(g),this},removeCapture:function(g){return this.manager.removeCapture(g),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:s.UP,down:s.DOWN,left:s.LEFT,right:s.RIGHT,space:s.SPACE,shift:s.SHIFT})},addKeys:function(g,x,y){x===void 0&&(x=!0),y===void 0&&(y=!1);var C={};if(typeof g=="string"){g=g.split(",");for(var P=0;P-1?C[P]=g:C[g.keyCode]=g,x&&this.addCapture(g.keyCode),g.setEmitOnRepeat(y),g}return typeof g=="string"&&(g=s[g.toUpperCase()]),C[g]||(C[g]=new h(this,g),x&&this.addCapture(g),C[g].setEmitOnRepeat(y)),C[g]},removeKey:function(g,x,y){x===void 0&&(x=!1),y===void 0&&(y=!1);var C=this.keys,P;if(g instanceof h){var M=C.indexOf(g);M>-1&&(P=this.keys[M],this.keys[M]=void 0)}else typeof g=="string"&&(g=s[g.toUpperCase()]);return C[g]&&(P=C[g],C[g]=void 0),P&&(P.plugin=null,y&&this.removeCapture(P.keyCode),x&&P.destroy()),this},removeAllKeys:function(g,x){g===void 0&&(g=!1),x===void 0&&(x=!1);for(var y=this.keys,C=0;Cg._tick)return g._tick=y,!0}return!1},update:function(){var g=this.manager.queue,x=g.length;if(!(!this.isActive()||x===0))for(var y=this.keys,C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3330,7 +3330,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(95922),a=t(95540),r=t(68769),n=t(92803),e=new o({initialize:function(h,s,l){if(l===void 0&&(l={}),s.length<2)return!1;this.manager=h,this.enabled=!0,this.keyCodes=[];for(var f=0;f{/** + */var o=t(83419),v=t(95922),a=t(95540),r=t(68769),n=t(92803),e=new o({initialize:function(h,s,l){if(l===void 0&&(l={}),s.length<2)return!1;this.manager=h,this.enabled=!0,this.keyCodes=[];for(var f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3434,7 +3434,7 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(35072),r=t(50792),n=t(54899),e=t(74099),i=t(95540),h=t(35154),s=t(37277),l=t(44594),f=t(92638),u=new o({Extends:r,initialize:function(p){r.call(this);var g=p.sys.game.config,y=p.sys.settings.loader;this.scene=p,this.systems=p.sys,this.cacheManager=p.sys.cache,this.textureManager=p.sys.textures,this.sceneManager=p.sys.game.scene,e.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(i(y,"baseURL",g.loaderBaseURL)),this.setPath(i(y,"path",g.loaderPath)),this.setPrefix(i(y,"prefix",g.loaderPrefix)),this.maxParallelDownloads=i(y,"maxParallelDownloads",g.loaderMaxParallelDownloads),this.xhr=f(i(y,"responseType",g.loaderResponseType),i(y,"async",g.loaderAsync),i(y,"user",g.loaderUser),i(y,"password",g.loaderPassword),i(y,"timeout",g.loaderTimeout),i(y,"withCredentials",g.loaderWithCredentials)),this.crossOrigin=i(y,"crossOrigin",g.loaderCrossOrigin),this.imageLoadType=i(y,"imageLoadType",g.loaderImageLoadType),this.localSchemes=i(y,"localScheme",g.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new a,this.inflight=new a,this.queue=new a,this._deleteQueue=new a,this.totalFailed=0,this.totalComplete=0,this.state=v.LOADER_IDLE,this.multiKeyIndex=0,p.sys.events.once(l.BOOT,this.boot,this),p.sys.events.on(l.START,this.pluginStart,this)},boot:function(){this.systems.events.once(l.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(l.SHUTDOWN,this.shutdown,this)},setBaseURL:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.baseURL=d,this},setPath:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.path=d,this},setPrefix:function(d){return d===void 0&&(d=""),this.prefix=d,this},setCORS:function(d){return this.crossOrigin=d,this},addFile:function(d){Array.isArray(d)||(d=[d]);for(var p=0;p0},isLoading:function(){return this.state===v.LOADER_LOADING||this.state===v.LOADER_PROCESSING},isReady:function(){return this.state===v.LOADER_IDLE||this.state===v.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(n.START,this),this.list.size===0?this.loadComplete():(this.state=v.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(l.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(n.PROGRESS,this.progress)},update:function(){this.state===v.LOADER_LOADING&&this.list.size>0&&this.inflight.size{/** + */var o=t(83419),v=t(23906),a=t(35072),r=t(50792),n=t(54899),e=t(74099),i=t(95540),h=t(35154),s=t(37277),l=t(44594),f=t(92638),u=new o({Extends:r,initialize:function(p){r.call(this);var g=p.sys.game.config,x=p.sys.settings.loader;this.scene=p,this.systems=p.sys,this.cacheManager=p.sys.cache,this.textureManager=p.sys.textures,this.sceneManager=p.sys.game.scene,e.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(i(x,"baseURL",g.loaderBaseURL)),this.setPath(i(x,"path",g.loaderPath)),this.setPrefix(i(x,"prefix",g.loaderPrefix)),this.maxParallelDownloads=i(x,"maxParallelDownloads",g.loaderMaxParallelDownloads),this.xhr=f(i(x,"responseType",g.loaderResponseType),i(x,"async",g.loaderAsync),i(x,"user",g.loaderUser),i(x,"password",g.loaderPassword),i(x,"timeout",g.loaderTimeout),i(x,"withCredentials",g.loaderWithCredentials)),this.crossOrigin=i(x,"crossOrigin",g.loaderCrossOrigin),this.imageLoadType=i(x,"imageLoadType",g.loaderImageLoadType),this.localSchemes=i(x,"localScheme",g.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new a,this.inflight=new a,this.queue=new a,this._deleteQueue=new a,this.totalFailed=0,this.totalComplete=0,this.state=v.LOADER_IDLE,this.multiKeyIndex=0,p.sys.events.once(l.BOOT,this.boot,this),p.sys.events.on(l.START,this.pluginStart,this)},boot:function(){this.systems.events.once(l.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(l.SHUTDOWN,this.shutdown,this)},setBaseURL:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.baseURL=d,this},setPath:function(d){return d===void 0&&(d=""),d!==""&&d.substr(-1)!=="/"&&(d=d.concat("/")),this.path=d,this},setPrefix:function(d){return d===void 0&&(d=""),this.prefix=d,this},setCORS:function(d){return this.crossOrigin=d,this},addFile:function(d){Array.isArray(d)||(d=[d]);for(var p=0;p0},isLoading:function(){return this.state===v.LOADER_LOADING||this.state===v.LOADER_PROCESSING},isReady:function(){return this.state===v.LOADER_IDLE||this.state===v.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(n.START,this),this.list.size===0?this.loadComplete():(this.state=v.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(l.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(n.PROGRESS,this.progress)},update:function(){this.state===v.LOADER_LOADING&&this.list.size>0&&this.inflight.size{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3506,31 +3506,31 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var C=f;f=a(C,"key"),y=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),x=new e(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","json"),xhrSettings:a(C,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new e(l,f,d,g);y.linkFile?i.call(this,l,"atlasjson",f,[y,x,y.linkFile]):i.call(this,l,"atlasjson",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),l.addToCache(),this.complete=!0}}});v.register("aseprite",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g){var x,y;if(n(f)){var C=f;f=a(C,"key"),x=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),y=new e(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","json"),xhrSettings:a(C,"atlasXhrSettings")})}else x=new r(l,f,u,p),y=new e(l,f,d,g);x.linkFile?i.call(this,l,"atlasjson",f,[x,y,x.linkFile]):i.call(this,l,"atlasjson",f,[x,y])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),l.addToCache(),this.complete=!0}}});v.register("aseprite",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var C=f;f=a(C,"key"),y=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),x=new e(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","json"),xhrSettings:a(C,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new e(l,f,d,g);y.linkFile?i.call(this,l,"atlasjson",f,[y,x,y.linkFile]):i.call(this,l,"atlasjson",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g){var x,y;if(n(f)){var C=f;f=a(C,"key"),x=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),y=new e(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","json"),xhrSettings:a(C,"atlasXhrSettings")})}else x=new r(l,f,u,p),y=new e(l,f,d,g);x.linkFile?i.call(this,l,"atlasjson",f,[x,y,x.linkFile]):i.call(this,l,"atlasjson",f,[x,y])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(57318),h=new o({Extends:e,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var C=f;f=a(C,"key"),y=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),x=new i(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","xml"),xhrSettings:a(C,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new i(l,f,d,g);y.linkFile?e.call(this,l,"atlasxml",f,[y,x,y.linkFile]):e.call(this,l,"atlasxml",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlasXML",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(57318),h=new o({Extends:e,initialize:function(l,f,u,d,p,g){var x,y;if(n(f)){var C=f;f=a(C,"key"),x=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),y=new i(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","xml"),xhrSettings:a(C,"atlasXhrSettings")})}else x=new r(l,f,u,p),y=new i(l,f,d,g);x.linkFile?e.call(this,l,"atlasxml",f,[x,y,x.linkFile]):e.call(this,l,"atlasxml",f,[x,y])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(s.key,s.data,l.data,f),this.complete=!0}}});v.register("atlasXML",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(89749),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d,p){if(i(f)){var g=f;f=n(g,"key"),d=n(g,"xhrSettings"),p=n(g,"context",p)}var y={type:"audio",cache:l.cacheManager.audio,extension:u.type,responseType:"arraybuffer",key:f,url:u.url,xhrSettings:d,config:{context:p}};a.call(this,l,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var s=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(l){s.data=l,s.onProcessComplete()},function(l){console.error("Error decoding audio: "+s.key+" - ",l?l.message:null),s.onProcessError()}),this.config.context=null}});h.create=function(s,l,f,u,d){var p=s.systems.game,g=p.config.audio,y=p.device.audio;i(l)&&(f=n(l,"url",[]),u=n(l,"config",{}));var x=h.getAudioURL(p,f);return x?y.webAudio&&!g.disableWebAudio?new h(s,l,x,d,p.sound.context):new e(s,l,x,u):(console.warn('No audio URLs for "%s" matched this device',l),null)},h.getAudioURL=function(s,l){Array.isArray(l)||(l=[l]);for(var f=0;f{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(89749),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d,p){if(i(f)){var g=f;f=n(g,"key"),d=n(g,"xhrSettings"),p=n(g,"context",p)}var x={type:"audio",cache:l.cacheManager.audio,extension:u.type,responseType:"arraybuffer",key:f,url:u.url,xhrSettings:d,config:{context:p}};a.call(this,l,x)},onProcess:function(){this.state=v.FILE_PROCESSING;var s=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(l){s.data=l,s.onProcessComplete()},function(l){console.error("Error decoding audio: "+s.key+" - ",l?l.message:null),s.onProcessError()}),this.config.context=null}});h.create=function(s,l,f,u,d){var p=s.systems.game,g=p.config.audio,x=p.device.audio;i(l)&&(f=n(l,"url",[]),u=n(l,"config",{}));var y=h.getAudioURL(p,f);return y?x.webAudio&&!g.disableWebAudio?new h(s,l,y,d,p.sound.context):new e(s,l,y,u):(console.warn('No audio URLs for "%s" matched this device',l),null)},h.getAudioURL=function(s,l){Array.isArray(l)||(l=[l]);for(var f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(21097),v=t(83419),a=t(74099),r=t(95540),n=t(41212),e=t(518),i=t(26430),h=new v({Extends:i,initialize:function(l,f,u,d,p,g,y){if(n(f)){var x=f;f=r(x,"key"),u=r(x,"jsonURL"),d=r(x,"audioURL"),p=r(x,"audioConfig"),g=r(x,"audioXhrSettings"),y=r(x,"jsonXhrSettings")}var C;if(!d)C=new e(l,f,u,y),i.call(this,l,"audiosprite",f,[C]),this.config.resourceLoad=!0,this.config.audioConfig=p,this.config.audioXhrSettings=g;else{var P=o.create(l,f,d,p,g);P&&(C=new e(l,f,u,y),i.call(this,l,"audiosprite",f,[P,C]),this.config.resourceLoad=!1)}},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,this.config.resourceLoad&&s.type==="json"&&s.data.hasOwnProperty("resources"))){var f=s.data.resources,u=r(this.config,"audioConfig"),d=r(this.config,"audioXhrSettings"),p=o.create(this.loader,s.key,f,u,d);p&&(this.addToMultiFile(p),this.loader.addFile(p))}},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1];s.addToCache(),l.addToCache(),this.complete=!0}}});a.register("audioSprite",function(s,l,f,u,d,p){var g=this.systems.game,y=g.config.audio,x=g.device.audio;if(y&&y.noAudio||!x.webAudio&&!x.audioData)return this;var C;if(Array.isArray(s))for(var P=0;P{/** + */var o=t(21097),v=t(83419),a=t(74099),r=t(95540),n=t(41212),e=t(518),i=t(26430),h=new v({Extends:i,initialize:function(l,f,u,d,p,g,x){if(n(f)){var y=f;f=r(y,"key"),u=r(y,"jsonURL"),d=r(y,"audioURL"),p=r(y,"audioConfig"),g=r(y,"audioXhrSettings"),x=r(y,"jsonXhrSettings")}var C;if(!d)C=new e(l,f,u,x),i.call(this,l,"audiosprite",f,[C]),this.config.resourceLoad=!0,this.config.audioConfig=p,this.config.audioXhrSettings=g;else{var P=o.create(l,f,d,p,g);P&&(C=new e(l,f,u,x),i.call(this,l,"audiosprite",f,[P,C]),this.config.resourceLoad=!1)}},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,this.config.resourceLoad&&s.type==="json"&&s.data.hasOwnProperty("resources"))){var f=s.data.resources,u=r(this.config,"audioConfig"),d=r(this.config,"audioXhrSettings"),p=o.create(this.loader,s.key,f,u,d);p&&(this.addToMultiFile(p),this.loader.addFile(p))}},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1];s.addToCache(),l.addToCache(),this.complete=!0}}});a.register("audioSprite",function(s,l,f,u,d,p){var g=this.systems.game,x=g.config.audio,y=g.device.audio;if(x&&x.noAudio||!y.webAudio&&!y.audioData)return this;var C;if(Array.isArray(s))for(var P=0;P{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="bin";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"xhrSettings"),p=n(g,"extension",p),d=n(g,"dataType",d)}var y={type:"binary",cache:s.cacheManager.binary,extension:p,responseType:"arraybuffer",key:l,url:f,xhrSettings:u,config:{dataType:d}};a.call(this,s,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.config.dataType;this.data=h?new h(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});r.register("binary",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="bin";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"xhrSettings"),p=n(g,"extension",p),d=n(g,"dataType",d)}var x={type:"binary",cache:s.cacheManager.binary,extension:p,responseType:"arraybuffer",key:l,url:f,xhrSettings:u,config:{dataType:d}};a.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.config.dataType;this.data=h?new h(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});r.register("binary",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(21859),h=t(57318),s=new o({Extends:e,initialize:function(f,u,d,p,g,y){var x,C;if(n(u)){var P=u;u=a(P,"key"),x=new r(f,{key:u,url:a(P,"textureURL"),extension:a(P,"textureExtension","png"),normalMap:a(P,"normalMap"),xhrSettings:a(P,"textureXhrSettings")}),C=new h(f,{key:u,url:a(P,"fontDataURL"),extension:a(P,"fontDataExtension","xml"),xhrSettings:a(P,"fontDataXhrSettings")})}else x=new r(f,u,d,g),C=new h(f,u,p,y);x.linkFile?e.call(this,f,"bitmapfont",u,[x,C,x.linkFile]):e.call(this,f,"bitmapfont",u,[x,C])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1];l.addToCache();var u=l.cache.get(l.key),d=i(f.data,l.cache.getFrame(l.key),0,0,u);this.loader.cacheManager.bitmapFont.add(l.key,{data:d,texture:l.key,frame:null}),this.complete=!0}}});v.register("bitmapFont",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var y=0;y{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(21859),h=t(57318),s=new o({Extends:e,initialize:function(f,u,d,p,g,x){var y,C;if(n(u)){var P=u;u=a(P,"key"),y=new r(f,{key:u,url:a(P,"textureURL"),extension:a(P,"textureExtension","png"),normalMap:a(P,"normalMap"),xhrSettings:a(P,"textureXhrSettings")}),C=new h(f,{key:u,url:a(P,"fontDataURL"),extension:a(P,"fontDataExtension","xml"),xhrSettings:a(P,"fontDataXhrSettings")})}else y=new r(f,u,d,g),C=new h(f,u,p,x);y.linkFile?e.call(this,f,"bitmapfont",u,[y,C,y.linkFile]):e.call(this,f,"bitmapfont",u,[y,C])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1];l.addToCache();var u=l.cache.get(l.key),d=i(f.data,l.cache.getFrame(l.key),0,0,u);this.loader.cacheManager.bitmapFont.add(l.key,{data:d,texture:l.key,frame:null}),this.complete=!0}}});v.register("bitmapFont",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3538,12 +3538,12 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2021 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(38734),v=t(85722),a=t(83419),r=t(74099),n=t(95540),e=t(19550),i=t(41212),h=t(518),s=t(31403),l=t(46975),f=t(59327),u=t(26430),d=t(82038),p=t(55222),g=new a({Extends:u,initialize:function(x,C,P,M){if(P.multiAtlasURL){var w=new h(x,{key:C,url:P.multiAtlasURL,xhrSettings:M,config:P});u.call(this,x,"texture",C,[w])}else{var I=P.textureURL.substr(P.textureURL.length-3);P.type||(P.type=I.toLowerCase()==="ktx"?"KTX":"PVR");var L=new v(x,{key:C,url:P.textureURL,extension:I,xhrSettings:M,config:P});if(P.atlasURL){var B=new h(x,{key:C,url:P.atlasURL,xhrSettings:M,config:P});u.call(this,x,"texture",C,[L,B])}else u.call(this,x,"texture",C,[L])}this.config=P},onFileComplete:function(y){var x=this.files.indexOf(y);if(x!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(y.type==="json"&&y.data.hasOwnProperty("textures")){var C=y.data.textures,P=this.config,M=this.loader,w=M.baseURL,I=M.path,L=M.prefix,B=n(P,"multiBaseURL",this.baseURL),N=n(P,"multiPath",this.path),G=n(P,"prefix",this.prefix),V=n(P,"textureXhrSettings");B&&M.setBaseURL(B),N&&M.setPath(N),G&&M.setPrefix(G);for(var K=0;K{/** + */var o=t(38734),v=t(85722),a=t(83419),r=t(74099),n=t(95540),e=t(19550),i=t(41212),h=t(518),s=t(31403),l=t(46975),f=t(59327),u=t(26430),d=t(82038),p=t(55222),g=new a({Extends:u,initialize:function(y,C,P,M){if(P.multiAtlasURL){var w=new h(y,{key:C,url:P.multiAtlasURL,xhrSettings:M,config:P});u.call(this,y,"texture",C,[w])}else{var I=P.textureURL.substr(P.textureURL.length-3);P.type||(P.type=I.toLowerCase()==="ktx"?"KTX":"PVR");var L=new v(y,{key:C,url:P.textureURL,extension:I,xhrSettings:M,config:P});if(P.atlasURL){var B=new h(y,{key:C,url:P.atlasURL,xhrSettings:M,config:P});u.call(this,y,"texture",C,[L,B])}else u.call(this,y,"texture",C,[L])}this.config=P},onFileComplete:function(x){var y=this.files.indexOf(x);if(y!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(x.type==="json"&&x.data.hasOwnProperty("textures")){var C=x.data.textures,P=this.config,M=this.loader,w=M.baseURL,I=M.path,L=M.prefix,B=n(P,"multiBaseURL",this.baseURL),N=n(P,"multiPath",this.path),G=n(P,"prefix",this.prefix),V=n(P,"textureXhrSettings");B&&M.setBaseURL(B),N&&M.setPath(N),G&&M.setPrefix(G);for(var K=0;K{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(73894),h=new o({Extends:a,initialize:function(l,f,u,d,p){var g="glsl";if(e(f)){var y=f;f=n(y,"key"),u=n(y,"url"),d=n(y,"shaderType","fragment"),p=n(y,"xhrSettings"),g=n(y,"extension",g)}else d===void 0&&(d="fragment");var x={type:"glsl",cache:l.cacheManager.shader,extension:g,responseType:"text",key:f,url:u,config:{shaderType:d},xhrSettings:p};a.call(this,l,x)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s=this.data.split(` -`),l=this.extractBlock(s,0);if(l)for(;l;){var f=this.getShaderName(l.header),u=this.getShaderType(l.header),d=this.getShaderUniforms(l.header),p=l.shader;if(this.cache.has(f)){var g=this.cache.get(f);u==="fragment"?g.fragmentSrc=p:g.vertexSrc=p,g.uniforms||(g.uniforms=d)}else u==="fragment"?this.cache.add(f,new i(f,p,"",d)):this.cache.add(f,new i(f,"",p,d));l=this.extractBlock(s,l.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new i(this.key,this.data)):this.cache.add(this.key,new i(this.key,"",this.data))},getShaderName:function(s){for(var l=0;l{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. @@ -3556,28 +3556,28 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){u===void 0&&(u=512),d===void 0&&(d=512);var g="html";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"width",u),d=n(y,"height",d)}var x={type:"html",cache:s.textureManager,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{width:u,height:d}};a.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.config.width,s=this.config.height,l=[];l.push(''),l.push(''),l.push(''),l.push(this.xhrLoader.responseText),l.push(""),l.push(""),l.push("");var f=[l.join(` + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){u===void 0&&(u=512),d===void 0&&(d=512);var g="html";if(e(l)){var x=l;l=n(x,"key"),f=n(x,"url"),p=n(x,"xhrSettings"),g=n(x,"extension",g),u=n(x,"width",u),d=n(x,"height",d)}var y={type:"html",cache:s.textureManager,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{width:u,height:d}};a.call(this,s,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.config.width,s=this.config.height,l=[];l.push(''),l.push(''),l.push(''),l.push(this.xhrLoader.responseText),l.push(""),l.push(""),l.push("");var f=[l.join(` `)],u=this;try{var d=new window.Blob(f,{type:"image/svg+xml;charset=utf-8"})}catch{u.state=v.FILE_ERRORED,u.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){a.revokeObjectURL(u.data),u.onProcessComplete()},this.data.onerror=function(){a.revokeObjectURL(u.data),u.onProcessError()},a.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("htmlTexture",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(98356),h=new o({Extends:a,initialize:function s(l,f,u,d,p){var g="png",y;if(e(f)){var x=f;f=n(x,"key"),u=n(x,"url"),y=n(x,"normalMap"),d=n(x,"xhrSettings"),g=n(x,"extension",g),p=n(x,"frameConfig")}Array.isArray(u)&&(y=u[1],u=u[0]);var C={type:"image",cache:l.textureManager,extension:g,responseType:"blob",key:f,url:u,xhrSettings:d,config:p};if(a.call(this,l,C),y){var P=new s(l,this.key,y,d,p);P.type="normalMap",this.setLink(P),l.addFile(P)}this.useImageElementLoad=l.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){a.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){a.revokeObjectURL(s.data),s.onProcessError()},a.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var s=this.state;this.state=v.FILE_PROCESSING,s===v.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=v.FILE_LOADING,this.src=i(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){s.state=v.FILE_LOADED,s.loader.nextFile(s,!0)},this.data.onerror=function(){s.loader.nextFile(s,!1)},this.data.src=this.src},addToCache:function(){var s=this.linkFile;s?s.state>=v.FILE_COMPLETE&&(s.type==="spritesheet"?s.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,s.data,this.data):this.cache.addImage(this.key,this.data,s.data)):this.cache.addImage(this.key,this.data)}});r.register("image",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(98356),h=new o({Extends:a,initialize:function s(l,f,u,d,p){var g="png",x;if(e(f)){var y=f;f=n(y,"key"),u=n(y,"url"),x=n(y,"normalMap"),d=n(y,"xhrSettings"),g=n(y,"extension",g),p=n(y,"frameConfig")}Array.isArray(u)&&(x=u[1],u=u[0]);var C={type:"image",cache:l.textureManager,extension:g,responseType:"blob",key:f,url:u,xhrSettings:d,config:p};if(a.call(this,l,C),x){var P=new s(l,this.key,x,d,p);P.type="normalMap",this.setLink(P),l.addFile(P)}this.useImageElementLoad=l.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){a.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){a.revokeObjectURL(s.data),s.onProcessError()},a.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var s=this.state;this.state=v.FILE_PROCESSING,s===v.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=v.FILE_LOADING,this.src=i(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){s.state=v.FILE_LOADED,s.loader.nextFile(s,!0)},this.data.onerror=function(){s.loader.nextFile(s,!1)},this.data.src=this.src},addToCache:function(){var s=this.linkFile;s?s.state>=v.FILE_COMPLETE&&(s.type==="spritesheet"?s.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,s.data,this.data):this.cache.addImage(this.key,this.data,s.data)):this.cache.addImage(this.key,this.data)}});r.register("image",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(35154),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d,p){var g="json";if(i(f)){var y=f;f=n(y,"key"),u=n(y,"url"),d=n(y,"xhrSettings"),g=n(y,"extension",g),p=n(y,"dataKey",p)}var x={type:"json",cache:l.cacheManager.json,extension:g,responseType:"text",key:f,url:u,xhrSettings:d,config:p};a.call(this,l,x),i(u)&&(p?this.data=e(u,p):this.data=u,this.state=v.FILE_POPULATED)},onProcess:function(){if(this.state!==v.FILE_POPULATED){this.state=v.FILE_PROCESSING;try{var s=JSON.parse(this.xhrLoader.responseText)}catch(f){throw this.onProcessError(),f}var l=this.config;typeof l=="string"?this.data=e(s,l,s):this.data=s}this.onProcessComplete()}});r.register("json",function(s,l,f,u){if(Array.isArray(s))for(var d=0;d{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(35154),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d,p){var g="json";if(i(f)){var x=f;f=n(x,"key"),u=n(x,"url"),d=n(x,"xhrSettings"),g=n(x,"extension",g),p=n(x,"dataKey",p)}var y={type:"json",cache:l.cacheManager.json,extension:g,responseType:"text",key:f,url:u,xhrSettings:d,config:p};a.call(this,l,y),i(u)&&(p?this.data=e(u,p):this.data=u,this.state=v.FILE_POPULATED)},onProcess:function(){if(this.state!==v.FILE_POPULATED){this.state=v.FILE_PROCESSING;try{var s=JSON.parse(this.xhrLoader.responseText)}catch(f){throw this.onProcessError(),f}var l=this.config;typeof l=="string"?this.data=e(s,l,s):this.data=s}this.onProcessComplete()}});r.register("json",function(s,l,f,u){if(Array.isArray(s))for(var d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g,y){if(n(f)){var x=f;f=a(x,"key"),a(x,"url",!1)?u=a(x,"url"):u=a(x,"atlasURL"),g=a(x,"xhrSettings"),d=a(x,"path"),p=a(x,"baseURL"),y=a(x,"textureXhrSettings")}var C=new e(l,f,u,g);i.call(this,l,"multiatlas",f,[C]),this.config.path=d,this.config.baseURL=p,this.config.textureXhrSettings=y},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,s.type==="json"&&s.data.hasOwnProperty("textures"))){var f=s.data.textures,u=this.config,d=this.loader,p=d.baseURL,g=d.path,y=d.prefix,x=a(u,"baseURL",this.baseURL),C=a(u,"path",this.path),P=a(u,"prefix",this.prefix),M=a(u,"textureXhrSettings");d.setBaseURL(x),d.setPath(C),d.setPrefix(P);for(var w=0;w{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(518),i=t(26430),h=new o({Extends:i,initialize:function(l,f,u,d,p,g,x){if(n(f)){var y=f;f=a(y,"key"),a(y,"url",!1)?u=a(y,"url"):u=a(y,"atlasURL"),g=a(y,"xhrSettings"),d=a(y,"path"),p=a(y,"baseURL"),x=a(y,"textureXhrSettings")}var C=new e(l,f,u,g);i.call(this,l,"multiatlas",f,[C]),this.config.path=d,this.config.baseURL=p,this.config.textureXhrSettings=x},onFileComplete:function(s){var l=this.files.indexOf(s);if(l!==-1&&(this.pending--,s.type==="json"&&s.data.hasOwnProperty("textures"))){var f=s.data.textures,u=this.config,d=this.loader,p=d.baseURL,g=d.path,x=d.prefix,y=a(u,"baseURL",this.baseURL),C=a(u,"path",this.path),P=a(u,"prefix",this.prefix),M=a(u,"textureXhrSettings");d.setBaseURL(y),d.setPath(C),d.setPrefix(P);for(var w=0;w{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(34328),i=new o({Extends:n,initialize:function(s,l,f,u){var d="js",p=[];if(r(l)){var g=l;l=a(g,"key"),f=a(g,"url"),u=a(g,"xhrSettings"),d=a(g,"extension",d)}Array.isArray(f)||(f=[f]);for(var y=0;y{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(34328),i=new o({Extends:n,initialize:function(s,l,f,u){var d="js",p=[];if(r(l)){var g=l;l=a(g,"key"),f=a(g,"url"),u=a(g,"xhrSettings"),d=a(g,"extension",d)}Array.isArray(f)||(f=[f]);for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(85048),i=t(61485),h=t(78776),s=new o({Extends:n,initialize:function(f,u,d,p,g,y){var x,C,P=f.cacheManager.obj;if(r(u)){var M=u;u=a(M,"key"),x=new h(f,{key:u,type:"obj",cache:P,url:a(M,"url"),extension:a(M,"extension","obj"),xhrSettings:a(M,"xhrSettings"),config:{flipUV:a(M,"flipUV",g)}}),p=a(M,"matURL"),p&&(C=new h(f,{key:u,type:"mat",cache:P,url:p,extension:a(M,"matExtension","mat"),xhrSettings:a(M,"xhrSettings")}))}else x=new h(f,{key:u,url:d,type:"obj",cache:P,extension:"obj",xhrSettings:y,config:{flipUV:g}}),p&&(C=new h(f,{key:u,url:p,type:"mat",cache:P,extension:"mat",xhrSettings:y}));n.call(this,f,"obj",u,[x,C])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1],u=e(l.data,l.config.flipUV);f&&(u.materials=i(f.data)),l.cache.add(l.key,u),this.complete=!0}}});v.register("obj",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var y=0;y{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(41212),n=t(26430),e=t(85048),i=t(61485),h=t(78776),s=new o({Extends:n,initialize:function(f,u,d,p,g,x){var y,C,P=f.cacheManager.obj;if(r(u)){var M=u;u=a(M,"key"),y=new h(f,{key:u,type:"obj",cache:P,url:a(M,"url"),extension:a(M,"extension","obj"),xhrSettings:a(M,"xhrSettings"),config:{flipUV:a(M,"flipUV",g)}}),p=a(M,"matURL"),p&&(C=new h(f,{key:u,type:"mat",cache:P,url:p,extension:a(M,"matExtension","mat"),xhrSettings:a(M,"xhrSettings")}))}else y=new h(f,{key:u,url:d,type:"obj",cache:P,extension:"obj",xhrSettings:x,config:{flipUV:g}}),p&&(C=new h(f,{key:u,url:p,type:"mat",cache:P,extension:"mat",xhrSettings:x}));n.call(this,f,"obj",u,[y,C])},addToCache:function(){if(this.isReadyToProcess()){var l=this.files[0],f=this.files[1],u=e(l.data,l.config.flipUV);f&&(u.materials=i(f.data)),l.cache.add(l.key,u),this.complete=!0}}});v.register("obj",function(l,f,u,d,p){var g;if(Array.isArray(l))for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3585,11 +3585,11 @@ import{j as St}from"./jsx-runtime.BFYNFNPI.js";import{g as Bf,r as Mr,a as Fe,c * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"start"),d=n(y,"mapping")}var x={type:"plugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{start:u,mapping:d}};a.call(this,s,x),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=n(s,"start",!1),f=n(s,"mapping",null);if(this.state===v.FILE_POPULATED)h.install(this.key,this.data,l,f);else{this.state=v.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 u=h.install(this.key,window[this.key],l,f);(l||f)&&(this.loader.systems[f]=u,this.loader.scene[f]=u)}this.onProcessComplete()}});r.register("plugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var x=l;l=n(x,"key"),f=n(x,"url"),p=n(x,"xhrSettings"),g=n(x,"extension",g),u=n(x,"start"),d=n(x,"mapping")}var y={type:"plugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{start:u,mapping:d}};a.call(this,s,y),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=n(s,"start",!1),f=n(s,"mapping",null);if(this.state===v.FILE_POPULATED)h.install(this.key,this.data,l,f);else{this.state=v.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 u=h.install(this.key,window[this.key],l,f);(l||f)&&(this.loader.systems[f]=u,this.loader.scene[f]=u)}this.onProcessComplete()}});r.register("plugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="svg";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"svgConfig",{}),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"svg",cache:s.textureManager,extension:p,responseType:"text",key:l,url:f,xhrSettings:d,config:{width:n(u,"width"),height:n(u,"height"),scale:n(u,"scale")}};a.call(this,s,y)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.xhrLoader.responseText,s=[h],l=this.config.width,f=this.config.height,u=this.config.scale;t:if(l&&f||u){var d=null,p=new DOMParser;d=p.parseFromString(h,"text/xml");var g=d.getElementsByTagName("svg")[0],y=g.hasAttribute("viewBox"),x=parseFloat(g.getAttribute("width")),C=parseFloat(g.getAttribute("height"));if(!y&&x&&C)g.setAttribute("viewBox","0 0 "+x+" "+C);else if(y&&!x&&!C){var P=g.getAttribute("viewBox").split(/\s+|,/);x=P[2],C=P[3]}if(u)if(x&&C)l=x*u,f=C*u;else break t;g.setAttribute("width",l.toString()+"px"),g.setAttribute("height",f.toString()+"px"),s=[new XMLSerializer().serializeToString(g)]}try{var M=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var w=this,I=!1;this.data.onload=function(){I||a.revokeObjectURL(w.data),w.onProcessComplete()},this.data.onerror=function(){I?w.onProcessError():(I=!0,a.revokeObjectURL(w.data),w.data.src="data:image/svg+xml,"+encodeURIComponent(s.join("")))},a.createObjectURL(this.data,M,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("svg",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="svg";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"svgConfig",{}),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var x={type:"svg",cache:s.textureManager,extension:p,responseType:"text",key:l,url:f,xhrSettings:d,config:{width:n(u,"width"),height:n(u,"height"),scale:n(u,"scale")}};a.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING;var h=this.xhrLoader.responseText,s=[h],l=this.config.width,f=this.config.height,u=this.config.scale;t:if(l&&f||u){var d=null,p=new DOMParser;d=p.parseFromString(h,"text/xml");var g=d.getElementsByTagName("svg")[0],x=g.hasAttribute("viewBox"),y=parseFloat(g.getAttribute("width")),C=parseFloat(g.getAttribute("height"));if(!x&&y&&C)g.setAttribute("viewBox","0 0 "+y+" "+C);else if(x&&!y&&!C){var P=g.getAttribute("viewBox").split(/\s+|,/);y=P[2],C=P[3]}if(u)if(y&&C)l=y*u,f=C*u;else break t;g.setAttribute("width",l.toString()+"px"),g.setAttribute("height",f.toString()+"px"),s=[new XMLSerializer().serializeToString(g)]}try{var M=new window.Blob(s,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var w=this,I=!1;this.data.onload=function(){I||a.revokeObjectURL(w.data),w.onProcessComplete()},this.data.onerror=function(){I?w.onProcessError():(I=!0,a.revokeObjectURL(w.data),w.data.src="data:image/svg+xml,"+encodeURIComponent(s.join("")))},a.createObjectURL(this.data,M,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});r.register("svg",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3599,11 +3599,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),p=n(y,"xhrSettings"),g=n(y,"extension",g),u=n(y,"systemKey"),d=n(y,"sceneKey")}var x={type:"scenePlugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{systemKey:u,sceneKey:d}};a.call(this,s,x),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=this.key,f=n(s,"systemKey",l),u=n(s,"sceneKey",l);this.state===v.FILE_POPULATED?h.installScenePlugin(f,this.data,u,this.loader.scene,!0):(this.state=v.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),h.installScenePlugin(f,window[this.key],u,this.loader.scene,!0)),this.onProcessComplete()}});r.register("scenePlugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d,p){var g="js";if(e(l)){var x=l;l=n(x,"key"),f=n(x,"url"),p=n(x,"xhrSettings"),g=n(x,"extension",g),u=n(x,"systemKey"),d=n(x,"sceneKey")}var y={type:"scenePlugin",cache:!1,extension:g,responseType:"text",key:l,url:f,xhrSettings:p,config:{systemKey:u,sceneKey:d}};a.call(this,s,y),typeof f=="function"&&(this.data=f,this.state=v.FILE_POPULATED)},onProcess:function(){var h=this.loader.systems.plugins,s=this.config,l=this.key,f=n(s,"systemKey",l),u=n(s,"sceneKey",l);this.state===v.FILE_POPULATED?h.installScenePlugin(f,this.data,u,this.loader.scene,!0):(this.state=v.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),h.installScenePlugin(f,window[this.key],u,this.loader.scene,!0)),this.onProcessComplete()}});r.register("scenePlugin",function(h,s,l,f,u){if(Array.isArray(h))for(var d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="js";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"type","script"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}else u===void 0&&(u="script");var y={type:u,cache:!1,extension:p,responseType:"text",key:l,url:f,xhrSettings:d};a.call(this,s,y)},onProcess:function(){this.state=v.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()}});r.register("script",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u,d){var p="js";if(e(l)){var g=l;l=n(g,"key"),f=n(g,"url"),u=n(g,"type","script"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}else u===void 0&&(u="script");var x={type:u,cache:!1,extension:p,responseType:"text",key:l,url:f,xhrSettings:d};a.call(this,s,x)},onProcess:function(){this.state=v.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()}});r.register("script",function(h,s,l,f){if(Array.isArray(h))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3611,11 +3611,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u){var d="text",p="txt",g=s.cacheManager.text;if(e(l)){var y=l;l=n(y,"key"),f=n(y,"url"),u=n(y,"xhrSettings"),p=n(y,"extension",p),d=n(y,"type",d),g=n(y,"cache",g)}var x={type:d,cache:g,extension:p,responseType:"text",key:l,url:f,xhrSettings:u};a.call(this,s,x)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(h,s,l){if(Array.isArray(h))for(var f=0;f{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=new o({Extends:a,initialize:function(s,l,f,u){var d="text",p="txt",g=s.cacheManager.text;if(e(l)){var x=l;l=n(x,"key"),f=n(x,"url"),u=n(x,"xhrSettings"),p=n(x,"extension",p),d=n(x,"type",d),g=n(x,"cache",g)}var y={type:d,cache:g,extension:p,responseType:"text",key:l,url:f,xhrSettings:u};a.call(this,s,y)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});r.register("text",function(h,s,l){if(Array.isArray(h))for(var f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(80341),h=new o({Extends:a,initialize:function(l,f,u,d){var p="csv";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"tilemapCSV",cache:l.cacheManager.tilemap,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};a.call(this,l,y),this.tilemapFormat=i.CSV},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,s)}});r.register("tilemapCSV",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(80341),h=new o({Extends:a,initialize:function(l,f,u,d){var p="csv";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var x={type:"tilemapCSV",cache:l.cacheManager.tilemap,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};a.call(this,l,x),this.tilemapFormat=i.CSV},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,s)}});r.register("tilemapCSV",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3627,15 +3627,15 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(78776),h=new o({Extends:e,initialize:function(l,f,u,d,p,g){var y,x;if(n(f)){var C=f;f=a(C,"key"),y=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),x=new i(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","txt"),xhrSettings:a(C,"atlasXhrSettings")})}else y=new r(l,f,u,p),x=new i(l,f,d,g);y.linkFile?e.call(this,l,"unityatlas",f,[y,x,y.linkFile]):e.call(this,l,"unityatlas",f,[y,x])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("unityAtlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** + */var o=t(83419),v=t(74099),a=t(95540),r=t(19550),n=t(41212),e=t(26430),i=t(78776),h=new o({Extends:e,initialize:function(l,f,u,d,p,g){var x,y;if(n(f)){var C=f;f=a(C,"key"),x=new r(l,{key:f,url:a(C,"textureURL"),extension:a(C,"textureExtension","png"),normalMap:a(C,"normalMap"),xhrSettings:a(C,"textureXhrSettings")}),y=new i(l,{key:f,url:a(C,"atlasURL"),extension:a(C,"atlasExtension","txt"),xhrSettings:a(C,"atlasXhrSettings")})}else x=new r(l,f,u,p),y=new i(l,f,d,g);x.linkFile?e.call(this,l,"unityatlas",f,[x,y,x.linkFile]):e.call(this,l,"unityatlas",f,[x,y])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],l=this.files[1],f=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(s.key,s.data,l.data,f),this.complete=!0}}});v.register("unityAtlas",function(s,l,f,u,d){var p;if(Array.isArray(s))for(var g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(98356),e=t(95540),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d){if(d===void 0&&(d=!1),i(f)){var p=f;f=e(p,"key"),u=e(p,"url",[]),d=e(p,"noAudio",!1)}var g=l.systems.game.device.video.getVideoURL(u);g||console.warn("VideoFile: No supported format for "+f);var y={type:"video",cache:l.cacheManager.video,extension:g.type,key:f,url:g.url,config:{noAudio:d}};a.call(this,l,y)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=n(this,this.loader.baseURL),this.state=v.FILE_LOADED,this.loader.nextFile(this,!0)}});r.register("video",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(98356),e=t(95540),i=t(41212),h=new o({Extends:a,initialize:function(l,f,u,d){if(d===void 0&&(d=!1),i(f)){var p=f;f=e(p,"key"),u=e(p,"url",[]),d=e(p,"noAudio",!1)}var g=l.systems.game.device.video.getVideoURL(u);g||console.warn("VideoFile: No supported format for "+f);var x={type:"video",cache:l.cacheManager.video,extension:g.type,key:f,url:g.url,config:{noAudio:d}};a.call(this,l,x)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=n(this,this.loader.baseURL),this.state=v.FILE_LOADED,this.loader.nextFile(this,!0)}});r.register("video",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(56836),h=new o({Extends:a,initialize:function(l,f,u,d){var p="xml";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var y={type:"xml",cache:l.cacheManager.xml,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};a.call(this,l,y)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=i(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});r.register("xml",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** + */var o=t(83419),v=t(23906),a=t(41299),r=t(74099),n=t(95540),e=t(41212),i=t(56836),h=new o({Extends:a,initialize:function(l,f,u,d){var p="xml";if(e(f)){var g=f;f=n(g,"key"),u=n(g,"url"),d=n(g,"xhrSettings"),p=n(g,"extension",p)}var x={type:"xml",cache:l.cacheManager.xml,extension:p,responseType:"text",key:f,url:u,xhrSettings:d};a.call(this,l,x)},onProcess:function(){this.state=v.FILE_PROCESSING,this.data=i(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});r.register("xml",function(s,l,f){if(Array.isArray(s))for(var u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3679,7 +3679,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(45319),v=t(83419),a=t(37867),r=t(29747),n=new a,e=new v({initialize:function i(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=i.DefaultOrder),this._x=h,this._y=s,this._z=l,this._order=f,this.onChangeCallback=r},x:{get:function(){return this._x},set:function(i){this._x=i,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(i){this._y=i,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(i){this._z=i,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(i){this._order=i,this.onChangeCallback(this)}},set:function(i,h,s,l){return l===void 0&&(l=this._order),this._x=i,this._y=h,this._z=s,this._order=l,this.onChangeCallback(this),this},copy:function(i){return this.set(i.x,i.y,i.z,i.order)},setFromQuaternion:function(i,h,s){return h===void 0&&(h=this._order),s===void 0&&(s=!1),n.fromQuat(i),this.setFromRotationMatrix(n,h,s)},setFromRotationMatrix:function(i,h,s){h===void 0&&(h=this._order),s===void 0&&(s=!1);var l=i.val,f=l[0],u=l[4],d=l[8],p=l[1],g=l[5],y=l[9],x=l[2],C=l[6],P=l[10],M=0,w=0,I=0,L=.99999;switch(h){case"XYZ":{w=Math.asin(o(d,-1,1)),Math.abs(d){/** + */var o=t(45319),v=t(83419),a=t(37867),r=t(29747),n=new a,e=new v({initialize:function i(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=0),f===void 0&&(f=i.DefaultOrder),this._x=h,this._y=s,this._z=l,this._order=f,this.onChangeCallback=r},x:{get:function(){return this._x},set:function(i){this._x=i,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(i){this._y=i,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(i){this._z=i,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(i){this._order=i,this.onChangeCallback(this)}},set:function(i,h,s,l){return l===void 0&&(l=this._order),this._x=i,this._y=h,this._z=s,this._order=l,this.onChangeCallback(this),this},copy:function(i){return this.set(i.x,i.y,i.z,i.order)},setFromQuaternion:function(i,h,s){return h===void 0&&(h=this._order),s===void 0&&(s=!1),n.fromQuat(i),this.setFromRotationMatrix(n,h,s)},setFromRotationMatrix:function(i,h,s){h===void 0&&(h=this._order),s===void 0&&(s=!1);var l=i.val,f=l[0],u=l[4],d=l[8],p=l[1],g=l[5],x=l[9],y=l[2],C=l[6],P=l[10],M=0,w=0,I=0,L=.99999;switch(h){case"XYZ":{w=Math.asin(o(d,-1,1)),Math.abs(d){/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3719,11 +3719,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=new o({initialize:function(r){this.val=new Float32Array(9),r?this.copy(r):this.identity()},clone:function(){return new v(this)},set:function(a){return this.copy(a)},copy:function(a){var r=this.val,n=a.val;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],this},fromMat4:function(a){var r=a.val,n=this.val;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10],this},fromArray:function(a){var r=this.val;return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],this},identity:function(){var a=this.val;return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,this},transpose:function(){var a=this.val,r=a[1],n=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=r,a[5]=a[7],a[6]=n,a[7]=e,this},invert:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8],d=u*h-s*f,p=-u*i+s*l,g=f*i-h*l,y=r*d+n*p+e*g;return y?(y=1/y,a[0]=d*y,a[1]=(-u*n+e*f)*y,a[2]=(s*n-e*h)*y,a[3]=p*y,a[4]=(u*r-e*l)*y,a[5]=(-s*r+e*i)*y,a[6]=g*y,a[7]=(-f*r+n*l)*y,a[8]=(h*r-n*i)*y,this):null},adjoint:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8];return a[0]=h*u-s*f,a[1]=e*f-n*u,a[2]=n*s-e*h,a[3]=s*l-i*u,a[4]=r*u-e*l,a[5]=e*i-r*s,a[6]=i*f-h*l,a[7]=n*l-r*f,a[8]=r*h-n*i,this},determinant:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8];return r*(u*h-s*f)+n*(-u*i+s*l)+e*(f*i-h*l)},multiply:function(a){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=r[6],u=r[7],d=r[8],p=a.val,g=p[0],y=p[1],x=p[2],C=p[3],P=p[4],M=p[5],w=p[6],I=p[7],L=p[8];return r[0]=g*n+y*h+x*f,r[1]=g*e+y*s+x*u,r[2]=g*i+y*l+x*d,r[3]=C*n+P*h+M*f,r[4]=C*e+P*s+M*u,r[5]=C*i+P*l+M*d,r[6]=w*n+I*h+L*f,r[7]=w*e+I*s+L*u,r[8]=w*i+I*l+L*d,this},translate:function(a){var r=this.val,n=a.x,e=a.y;return r[6]=n*r[0]+e*r[3]+r[6],r[7]=n*r[1]+e*r[4]+r[7],r[8]=n*r[2]+e*r[5]+r[8],this},rotate:function(a){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=Math.sin(a),u=Math.cos(a);return r[0]=u*n+f*h,r[1]=u*e+f*s,r[2]=u*i+f*l,r[3]=u*h-f*n,r[4]=u*s-f*e,r[5]=u*l-f*i,this},scale:function(a){var r=this.val,n=a.x,e=a.y;return r[0]=n*r[0],r[1]=n*r[1],r[2]=n*r[2],r[3]=e*r[3],r[4]=e*r[4],r[5]=e*r[5],this},fromQuat:function(a){var r=a.x,n=a.y,e=a.z,i=a.w,h=r+r,s=n+n,l=e+e,f=r*h,u=r*s,d=r*l,p=n*s,g=n*l,y=e*l,x=i*h,C=i*s,P=i*l,M=this.val;return M[0]=1-(p+y),M[3]=u+P,M[6]=d-C,M[1]=u-P,M[4]=1-(f+y),M[7]=g+x,M[2]=d+C,M[5]=g-x,M[8]=1-(f+p),this},normalFromMat4:function(a){var r=a.val,n=this.val,e=r[0],i=r[1],h=r[2],s=r[3],l=r[4],f=r[5],u=r[6],d=r[7],p=r[8],g=r[9],y=r[10],x=r[11],C=r[12],P=r[13],M=r[14],w=r[15],I=e*f-i*l,L=e*u-h*l,B=e*d-s*l,N=i*u-h*f,G=i*d-s*f,V=h*d-s*u,K=p*P-g*C,j=p*M-y*C,J=p*w-x*C,X=g*M-y*P,Y=g*w-x*P,b=y*w-x*M,z=I*b-L*Y+B*X+N*J-G*j+V*K;return z?(z=1/z,n[0]=(f*b-u*Y+d*X)*z,n[1]=(u*J-l*b-d*j)*z,n[2]=(l*Y-f*J+d*K)*z,n[3]=(h*Y-i*b-s*X)*z,n[4]=(e*b-h*J+s*j)*z,n[5]=(i*J-e*Y-s*K)*z,n[6]=(P*V-M*G+w*N)*z,n[7]=(M*B-C*V-w*L)*z,n[8]=(C*G-P*B+w*I)*z,this):null}});c.exports=v},37867:(c,m,t)=>{/** + */var o=t(83419),v=new o({initialize:function(r){this.val=new Float32Array(9),r?this.copy(r):this.identity()},clone:function(){return new v(this)},set:function(a){return this.copy(a)},copy:function(a){var r=this.val,n=a.val;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],this},fromMat4:function(a){var r=a.val,n=this.val;return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[4],n[4]=r[5],n[5]=r[6],n[6]=r[8],n[7]=r[9],n[8]=r[10],this},fromArray:function(a){var r=this.val;return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r[4]=a[4],r[5]=a[5],r[6]=a[6],r[7]=a[7],r[8]=a[8],this},identity:function(){var a=this.val;return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,this},transpose:function(){var a=this.val,r=a[1],n=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=r,a[5]=a[7],a[6]=n,a[7]=e,this},invert:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8],d=u*h-s*f,p=-u*i+s*l,g=f*i-h*l,x=r*d+n*p+e*g;return x?(x=1/x,a[0]=d*x,a[1]=(-u*n+e*f)*x,a[2]=(s*n-e*h)*x,a[3]=p*x,a[4]=(u*r-e*l)*x,a[5]=(-s*r+e*i)*x,a[6]=g*x,a[7]=(-f*r+n*l)*x,a[8]=(h*r-n*i)*x,this):null},adjoint:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8];return a[0]=h*u-s*f,a[1]=e*f-n*u,a[2]=n*s-e*h,a[3]=s*l-i*u,a[4]=r*u-e*l,a[5]=e*i-r*s,a[6]=i*f-h*l,a[7]=n*l-r*f,a[8]=r*h-n*i,this},determinant:function(){var a=this.val,r=a[0],n=a[1],e=a[2],i=a[3],h=a[4],s=a[5],l=a[6],f=a[7],u=a[8];return r*(u*h-s*f)+n*(-u*i+s*l)+e*(f*i-h*l)},multiply:function(a){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=r[6],u=r[7],d=r[8],p=a.val,g=p[0],x=p[1],y=p[2],C=p[3],P=p[4],M=p[5],w=p[6],I=p[7],L=p[8];return r[0]=g*n+x*h+y*f,r[1]=g*e+x*s+y*u,r[2]=g*i+x*l+y*d,r[3]=C*n+P*h+M*f,r[4]=C*e+P*s+M*u,r[5]=C*i+P*l+M*d,r[6]=w*n+I*h+L*f,r[7]=w*e+I*s+L*u,r[8]=w*i+I*l+L*d,this},translate:function(a){var r=this.val,n=a.x,e=a.y;return r[6]=n*r[0]+e*r[3]+r[6],r[7]=n*r[1]+e*r[4]+r[7],r[8]=n*r[2]+e*r[5]+r[8],this},rotate:function(a){var r=this.val,n=r[0],e=r[1],i=r[2],h=r[3],s=r[4],l=r[5],f=Math.sin(a),u=Math.cos(a);return r[0]=u*n+f*h,r[1]=u*e+f*s,r[2]=u*i+f*l,r[3]=u*h-f*n,r[4]=u*s-f*e,r[5]=u*l-f*i,this},scale:function(a){var r=this.val,n=a.x,e=a.y;return r[0]=n*r[0],r[1]=n*r[1],r[2]=n*r[2],r[3]=e*r[3],r[4]=e*r[4],r[5]=e*r[5],this},fromQuat:function(a){var r=a.x,n=a.y,e=a.z,i=a.w,h=r+r,s=n+n,l=e+e,f=r*h,u=r*s,d=r*l,p=n*s,g=n*l,x=e*l,y=i*h,C=i*s,P=i*l,M=this.val;return M[0]=1-(p+x),M[3]=u+P,M[6]=d-C,M[1]=u-P,M[4]=1-(f+x),M[7]=g+y,M[2]=d+C,M[5]=g-y,M[8]=1-(f+p),this},normalFromMat4:function(a){var r=a.val,n=this.val,e=r[0],i=r[1],h=r[2],s=r[3],l=r[4],f=r[5],u=r[6],d=r[7],p=r[8],g=r[9],x=r[10],y=r[11],C=r[12],P=r[13],M=r[14],w=r[15],I=e*f-i*l,L=e*u-h*l,B=e*d-s*l,N=i*u-h*f,G=i*d-s*f,V=h*d-s*u,K=p*P-g*C,j=p*M-x*C,J=p*w-y*C,X=g*M-x*P,Y=g*w-y*P,b=x*w-y*M,z=I*b-L*Y+B*X+N*J-G*j+V*K;return z?(z=1/z,n[0]=(f*b-u*Y+d*X)*z,n[1]=(u*J-l*b-d*j)*z,n[2]=(l*Y-f*J+d*K)*z,n[3]=(h*Y-i*b-s*X)*z,n[4]=(e*b-h*J+s*j)*z,n[5]=(i*J-e*Y-s*K)*z,n[6]=(P*V-M*G+w*N)*z,n[7]=(M*B-C*V-w*L)*z,n[8]=(C*G-P*B+w*I)*z,this):null}});c.exports=v},37867:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(25836),a=1e-6,r=new o({initialize:function(f){this.val=new Float32Array(16),f?this.copy(f):this.identity()},clone:function(){return new r(this)},set:function(l){return this.copy(l)},setValues:function(l,f,u,d,p,g,y,x,C,P,M,w,I,L,B,N){var G=this.val;return G[0]=l,G[1]=f,G[2]=u,G[3]=d,G[4]=p,G[5]=g,G[6]=y,G[7]=x,G[8]=C,G[9]=P,G[10]=M,G[11]=w,G[12]=I,G[13]=L,G[14]=B,G[15]=N,this},copy:function(l){var f=l.val;return this.setValues(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])},fromArray:function(l){return this.setValues(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(l,f,u){var d=n.fromQuat(u),p=d.val,g=f.x,y=f.y,x=f.z;return this.setValues(p[0]*g,p[1]*g,p[2]*g,0,p[4]*y,p[5]*y,p[6]*y,0,p[8]*x,p[9]*x,p[10]*x,0,l.x,l.y,l.z,1)},xyz:function(l,f,u){this.identity();var d=this.val;return d[12]=l,d[13]=f,d[14]=u,this},scaling:function(l,f,u){this.zero();var d=this.val;return d[0]=l,d[5]=f,d[10]=u,d[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 l=this.val,f=l[1],u=l[2],d=l[3],p=l[6],g=l[7],y=l[11];return l[1]=l[4],l[2]=l[8],l[3]=l[12],l[4]=f,l[6]=l[9],l[7]=l[13],l[8]=u,l[9]=p,l[11]=l[14],l[12]=d,l[13]=g,l[14]=y,this},getInverse:function(l){return this.copy(l),this.invert()},invert:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15],V=f*y-u*g,K=f*x-d*g,j=f*C-p*g,J=u*x-d*y,X=u*C-p*y,Y=d*C-p*x,b=P*B-M*L,z=P*N-w*L,W=P*G-I*L,H=M*N-w*B,Z=M*G-I*B,Q=w*G-I*N,k=V*Q-K*Z+j*H+J*W-X*z+Y*b;return k?(k=1/k,this.setValues((y*Q-x*Z+C*H)*k,(d*Z-u*Q-p*H)*k,(B*Y-N*X+G*J)*k,(w*X-M*Y-I*J)*k,(x*W-g*Q-C*z)*k,(f*Q-d*W+p*z)*k,(N*j-L*Y-G*K)*k,(P*Y-w*j+I*K)*k,(g*Z-y*W+C*b)*k,(u*W-f*Z-p*b)*k,(L*X-B*j+G*V)*k,(M*j-P*X-I*V)*k,(y*z-g*H-x*b)*k,(f*H-u*z+d*b)*k,(B*K-L*J-N*V)*k,(P*J-M*K+w*V)*k)):this},adjoint:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15];return this.setValues(y*(w*G-I*N)-M*(x*G-C*N)+B*(x*I-C*w),-(u*(w*G-I*N)-M*(d*G-p*N)+B*(d*I-p*w)),u*(x*G-C*N)-y*(d*G-p*N)+B*(d*C-p*x),-(u*(x*I-C*w)-y*(d*I-p*w)+M*(d*C-p*x)),-(g*(w*G-I*N)-P*(x*G-C*N)+L*(x*I-C*w)),f*(w*G-I*N)-P*(d*G-p*N)+L*(d*I-p*w),-(f*(x*G-C*N)-g*(d*G-p*N)+L*(d*C-p*x)),f*(x*I-C*w)-g*(d*I-p*w)+P*(d*C-p*x),g*(M*G-I*B)-P*(y*G-C*B)+L*(y*I-C*M),-(f*(M*G-I*B)-P*(u*G-p*B)+L*(u*I-p*M)),f*(y*G-C*B)-g*(u*G-p*B)+L*(u*C-p*y),-(f*(y*I-C*M)-g*(u*I-p*M)+P*(u*C-p*y)),-(g*(M*N-w*B)-P*(y*N-x*B)+L*(y*w-x*M)),f*(M*N-w*B)-P*(u*N-d*B)+L*(u*w-d*M),-(f*(y*N-x*B)-g*(u*N-d*B)+L*(u*x-d*y)),f*(y*w-x*M)-g*(u*w-d*M)+P*(u*x-d*y))},determinant:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],y=l[5],x=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15],V=f*y-u*g,K=f*x-d*g,j=f*C-p*g,J=u*x-d*y,X=u*C-p*y,Y=d*C-p*x,b=P*B-M*L,z=P*N-w*L,W=P*G-I*L,H=M*N-w*B,Z=M*G-I*B,Q=w*G-I*N;return V*Q-K*Z+j*H+J*W-X*z+Y*b},multiply:function(l){var f=this.val,u=f[0],d=f[1],p=f[2],g=f[3],y=f[4],x=f[5],C=f[6],P=f[7],M=f[8],w=f[9],I=f[10],L=f[11],B=f[12],N=f[13],G=f[14],V=f[15],K=l.val,j=K[0],J=K[1],X=K[2],Y=K[3];return f[0]=j*u+J*y+X*M+Y*B,f[1]=j*d+J*x+X*w+Y*N,f[2]=j*p+J*C+X*I+Y*G,f[3]=j*g+J*P+X*L+Y*V,j=K[4],J=K[5],X=K[6],Y=K[7],f[4]=j*u+J*y+X*M+Y*B,f[5]=j*d+J*x+X*w+Y*N,f[6]=j*p+J*C+X*I+Y*G,f[7]=j*g+J*P+X*L+Y*V,j=K[8],J=K[9],X=K[10],Y=K[11],f[8]=j*u+J*y+X*M+Y*B,f[9]=j*d+J*x+X*w+Y*N,f[10]=j*p+J*C+X*I+Y*G,f[11]=j*g+J*P+X*L+Y*V,j=K[12],J=K[13],X=K[14],Y=K[15],f[12]=j*u+J*y+X*M+Y*B,f[13]=j*d+J*x+X*w+Y*N,f[14]=j*p+J*C+X*I+Y*G,f[15]=j*g+J*P+X*L+Y*V,this},multiplyLocal:function(l){var f=this.val,u=l.val;return this.setValues(f[0]*u[0]+f[1]*u[4]+f[2]*u[8]+f[3]*u[12],f[0]*u[1]+f[1]*u[5]+f[2]*u[9]+f[3]*u[13],f[0]*u[2]+f[1]*u[6]+f[2]*u[10]+f[3]*u[14],f[0]*u[3]+f[1]*u[7]+f[2]*u[11]+f[3]*u[15],f[4]*u[0]+f[5]*u[4]+f[6]*u[8]+f[7]*u[12],f[4]*u[1]+f[5]*u[5]+f[6]*u[9]+f[7]*u[13],f[4]*u[2]+f[5]*u[6]+f[6]*u[10]+f[7]*u[14],f[4]*u[3]+f[5]*u[7]+f[6]*u[11]+f[7]*u[15],f[8]*u[0]+f[9]*u[4]+f[10]*u[8]+f[11]*u[12],f[8]*u[1]+f[9]*u[5]+f[10]*u[9]+f[11]*u[13],f[8]*u[2]+f[9]*u[6]+f[10]*u[10]+f[11]*u[14],f[8]*u[3]+f[9]*u[7]+f[10]*u[11]+f[11]*u[15],f[12]*u[0]+f[13]*u[4]+f[14]*u[8]+f[15]*u[12],f[12]*u[1]+f[13]*u[5]+f[14]*u[9]+f[15]*u[13],f[12]*u[2]+f[13]*u[6]+f[14]*u[10]+f[15]*u[14],f[12]*u[3]+f[13]*u[7]+f[14]*u[11]+f[15]*u[15])},premultiply:function(l){return this.multiplyMatrices(l,this)},multiplyMatrices:function(l,f){var u=l.val,d=f.val,p=u[0],g=u[4],y=u[8],x=u[12],C=u[1],P=u[5],M=u[9],w=u[13],I=u[2],L=u[6],B=u[10],N=u[14],G=u[3],V=u[7],K=u[11],j=u[15],J=d[0],X=d[4],Y=d[8],b=d[12],z=d[1],W=d[5],H=d[9],Z=d[13],Q=d[2],k=d[6],et=d[10],st=d[14],rt=d[3],ot=d[7],ft=d[11],at=d[15];return this.setValues(p*J+g*z+y*Q+x*rt,C*J+P*z+M*Q+w*rt,I*J+L*z+B*Q+N*rt,G*J+V*z+K*Q+j*rt,p*X+g*W+y*k+x*ot,C*X+P*W+M*k+w*ot,I*X+L*W+B*k+N*ot,G*X+V*W+K*k+j*ot,p*Y+g*H+y*et+x*ft,C*Y+P*H+M*et+w*ft,I*Y+L*H+B*et+N*ft,G*Y+V*H+K*et+j*ft,p*b+g*Z+y*st+x*at,C*b+P*Z+M*st+w*at,I*b+L*Z+B*st+N*at,G*b+V*Z+K*st+j*at)},translate:function(l){return this.translateXYZ(l.x,l.y,l.z)},translateXYZ:function(l,f,u){var d=this.val;return d[12]=d[0]*l+d[4]*f+d[8]*u+d[12],d[13]=d[1]*l+d[5]*f+d[9]*u+d[13],d[14]=d[2]*l+d[6]*f+d[10]*u+d[14],d[15]=d[3]*l+d[7]*f+d[11]*u+d[15],this},scale:function(l){return this.scaleXYZ(l.x,l.y,l.z)},scaleXYZ:function(l,f,u){var d=this.val;return d[0]=d[0]*l,d[1]=d[1]*l,d[2]=d[2]*l,d[3]=d[3]*l,d[4]=d[4]*f,d[5]=d[5]*f,d[6]=d[6]*f,d[7]=d[7]*f,d[8]=d[8]*u,d[9]=d[9]*u,d[10]=d[10]*u,d[11]=d[11]*u,this},makeRotationAxis:function(l,f){var u=Math.cos(f),d=Math.sin(f),p=1-u,g=l.x,y=l.y,x=l.z,C=p*g,P=p*y;return this.setValues(C*g+u,C*y-d*x,C*x+d*y,0,C*y+d*x,P*y+u,P*x-d*g,0,C*x-d*y,P*x+d*g,p*x*x+u,0,0,0,0,1)},rotate:function(l,f){var u=this.val,d=f.x,p=f.y,g=f.z,y=Math.sqrt(d*d+p*p+g*g);if(Math.abs(y){/** + */var o=t(83419),v=t(25836),a=1e-6,r=new o({initialize:function(f){this.val=new Float32Array(16),f?this.copy(f):this.identity()},clone:function(){return new r(this)},set:function(l){return this.copy(l)},setValues:function(l,f,u,d,p,g,x,y,C,P,M,w,I,L,B,N){var G=this.val;return G[0]=l,G[1]=f,G[2]=u,G[3]=d,G[4]=p,G[5]=g,G[6]=x,G[7]=y,G[8]=C,G[9]=P,G[10]=M,G[11]=w,G[12]=I,G[13]=L,G[14]=B,G[15]=N,this},copy:function(l){var f=l.val;return this.setValues(f[0],f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8],f[9],f[10],f[11],f[12],f[13],f[14],f[15])},fromArray:function(l){return this.setValues(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],l[9],l[10],l[11],l[12],l[13],l[14],l[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(l,f,u){var d=n.fromQuat(u),p=d.val,g=f.x,x=f.y,y=f.z;return this.setValues(p[0]*g,p[1]*g,p[2]*g,0,p[4]*x,p[5]*x,p[6]*x,0,p[8]*y,p[9]*y,p[10]*y,0,l.x,l.y,l.z,1)},xyz:function(l,f,u){this.identity();var d=this.val;return d[12]=l,d[13]=f,d[14]=u,this},scaling:function(l,f,u){this.zero();var d=this.val;return d[0]=l,d[5]=f,d[10]=u,d[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 l=this.val,f=l[1],u=l[2],d=l[3],p=l[6],g=l[7],x=l[11];return l[1]=l[4],l[2]=l[8],l[3]=l[12],l[4]=f,l[6]=l[9],l[7]=l[13],l[8]=u,l[9]=p,l[11]=l[14],l[12]=d,l[13]=g,l[14]=x,this},getInverse:function(l){return this.copy(l),this.invert()},invert:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],x=l[5],y=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15],V=f*x-u*g,K=f*y-d*g,j=f*C-p*g,J=u*y-d*x,X=u*C-p*x,Y=d*C-p*y,b=P*B-M*L,z=P*N-w*L,W=P*G-I*L,H=M*N-w*B,Z=M*G-I*B,Q=w*G-I*N,k=V*Q-K*Z+j*H+J*W-X*z+Y*b;return k?(k=1/k,this.setValues((x*Q-y*Z+C*H)*k,(d*Z-u*Q-p*H)*k,(B*Y-N*X+G*J)*k,(w*X-M*Y-I*J)*k,(y*W-g*Q-C*z)*k,(f*Q-d*W+p*z)*k,(N*j-L*Y-G*K)*k,(P*Y-w*j+I*K)*k,(g*Z-x*W+C*b)*k,(u*W-f*Z-p*b)*k,(L*X-B*j+G*V)*k,(M*j-P*X-I*V)*k,(x*z-g*H-y*b)*k,(f*H-u*z+d*b)*k,(B*K-L*J-N*V)*k,(P*J-M*K+w*V)*k)):this},adjoint:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],x=l[5],y=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15];return this.setValues(x*(w*G-I*N)-M*(y*G-C*N)+B*(y*I-C*w),-(u*(w*G-I*N)-M*(d*G-p*N)+B*(d*I-p*w)),u*(y*G-C*N)-x*(d*G-p*N)+B*(d*C-p*y),-(u*(y*I-C*w)-x*(d*I-p*w)+M*(d*C-p*y)),-(g*(w*G-I*N)-P*(y*G-C*N)+L*(y*I-C*w)),f*(w*G-I*N)-P*(d*G-p*N)+L*(d*I-p*w),-(f*(y*G-C*N)-g*(d*G-p*N)+L*(d*C-p*y)),f*(y*I-C*w)-g*(d*I-p*w)+P*(d*C-p*y),g*(M*G-I*B)-P*(x*G-C*B)+L*(x*I-C*M),-(f*(M*G-I*B)-P*(u*G-p*B)+L*(u*I-p*M)),f*(x*G-C*B)-g*(u*G-p*B)+L*(u*C-p*x),-(f*(x*I-C*M)-g*(u*I-p*M)+P*(u*C-p*x)),-(g*(M*N-w*B)-P*(x*N-y*B)+L*(x*w-y*M)),f*(M*N-w*B)-P*(u*N-d*B)+L*(u*w-d*M),-(f*(x*N-y*B)-g*(u*N-d*B)+L*(u*y-d*x)),f*(x*w-y*M)-g*(u*w-d*M)+P*(u*y-d*x))},determinant:function(){var l=this.val,f=l[0],u=l[1],d=l[2],p=l[3],g=l[4],x=l[5],y=l[6],C=l[7],P=l[8],M=l[9],w=l[10],I=l[11],L=l[12],B=l[13],N=l[14],G=l[15],V=f*x-u*g,K=f*y-d*g,j=f*C-p*g,J=u*y-d*x,X=u*C-p*x,Y=d*C-p*y,b=P*B-M*L,z=P*N-w*L,W=P*G-I*L,H=M*N-w*B,Z=M*G-I*B,Q=w*G-I*N;return V*Q-K*Z+j*H+J*W-X*z+Y*b},multiply:function(l){var f=this.val,u=f[0],d=f[1],p=f[2],g=f[3],x=f[4],y=f[5],C=f[6],P=f[7],M=f[8],w=f[9],I=f[10],L=f[11],B=f[12],N=f[13],G=f[14],V=f[15],K=l.val,j=K[0],J=K[1],X=K[2],Y=K[3];return f[0]=j*u+J*x+X*M+Y*B,f[1]=j*d+J*y+X*w+Y*N,f[2]=j*p+J*C+X*I+Y*G,f[3]=j*g+J*P+X*L+Y*V,j=K[4],J=K[5],X=K[6],Y=K[7],f[4]=j*u+J*x+X*M+Y*B,f[5]=j*d+J*y+X*w+Y*N,f[6]=j*p+J*C+X*I+Y*G,f[7]=j*g+J*P+X*L+Y*V,j=K[8],J=K[9],X=K[10],Y=K[11],f[8]=j*u+J*x+X*M+Y*B,f[9]=j*d+J*y+X*w+Y*N,f[10]=j*p+J*C+X*I+Y*G,f[11]=j*g+J*P+X*L+Y*V,j=K[12],J=K[13],X=K[14],Y=K[15],f[12]=j*u+J*x+X*M+Y*B,f[13]=j*d+J*y+X*w+Y*N,f[14]=j*p+J*C+X*I+Y*G,f[15]=j*g+J*P+X*L+Y*V,this},multiplyLocal:function(l){var f=this.val,u=l.val;return this.setValues(f[0]*u[0]+f[1]*u[4]+f[2]*u[8]+f[3]*u[12],f[0]*u[1]+f[1]*u[5]+f[2]*u[9]+f[3]*u[13],f[0]*u[2]+f[1]*u[6]+f[2]*u[10]+f[3]*u[14],f[0]*u[3]+f[1]*u[7]+f[2]*u[11]+f[3]*u[15],f[4]*u[0]+f[5]*u[4]+f[6]*u[8]+f[7]*u[12],f[4]*u[1]+f[5]*u[5]+f[6]*u[9]+f[7]*u[13],f[4]*u[2]+f[5]*u[6]+f[6]*u[10]+f[7]*u[14],f[4]*u[3]+f[5]*u[7]+f[6]*u[11]+f[7]*u[15],f[8]*u[0]+f[9]*u[4]+f[10]*u[8]+f[11]*u[12],f[8]*u[1]+f[9]*u[5]+f[10]*u[9]+f[11]*u[13],f[8]*u[2]+f[9]*u[6]+f[10]*u[10]+f[11]*u[14],f[8]*u[3]+f[9]*u[7]+f[10]*u[11]+f[11]*u[15],f[12]*u[0]+f[13]*u[4]+f[14]*u[8]+f[15]*u[12],f[12]*u[1]+f[13]*u[5]+f[14]*u[9]+f[15]*u[13],f[12]*u[2]+f[13]*u[6]+f[14]*u[10]+f[15]*u[14],f[12]*u[3]+f[13]*u[7]+f[14]*u[11]+f[15]*u[15])},premultiply:function(l){return this.multiplyMatrices(l,this)},multiplyMatrices:function(l,f){var u=l.val,d=f.val,p=u[0],g=u[4],x=u[8],y=u[12],C=u[1],P=u[5],M=u[9],w=u[13],I=u[2],L=u[6],B=u[10],N=u[14],G=u[3],V=u[7],K=u[11],j=u[15],J=d[0],X=d[4],Y=d[8],b=d[12],z=d[1],W=d[5],H=d[9],Z=d[13],Q=d[2],k=d[6],et=d[10],st=d[14],rt=d[3],ot=d[7],ft=d[11],at=d[15];return this.setValues(p*J+g*z+x*Q+y*rt,C*J+P*z+M*Q+w*rt,I*J+L*z+B*Q+N*rt,G*J+V*z+K*Q+j*rt,p*X+g*W+x*k+y*ot,C*X+P*W+M*k+w*ot,I*X+L*W+B*k+N*ot,G*X+V*W+K*k+j*ot,p*Y+g*H+x*et+y*ft,C*Y+P*H+M*et+w*ft,I*Y+L*H+B*et+N*ft,G*Y+V*H+K*et+j*ft,p*b+g*Z+x*st+y*at,C*b+P*Z+M*st+w*at,I*b+L*Z+B*st+N*at,G*b+V*Z+K*st+j*at)},translate:function(l){return this.translateXYZ(l.x,l.y,l.z)},translateXYZ:function(l,f,u){var d=this.val;return d[12]=d[0]*l+d[4]*f+d[8]*u+d[12],d[13]=d[1]*l+d[5]*f+d[9]*u+d[13],d[14]=d[2]*l+d[6]*f+d[10]*u+d[14],d[15]=d[3]*l+d[7]*f+d[11]*u+d[15],this},scale:function(l){return this.scaleXYZ(l.x,l.y,l.z)},scaleXYZ:function(l,f,u){var d=this.val;return d[0]=d[0]*l,d[1]=d[1]*l,d[2]=d[2]*l,d[3]=d[3]*l,d[4]=d[4]*f,d[5]=d[5]*f,d[6]=d[6]*f,d[7]=d[7]*f,d[8]=d[8]*u,d[9]=d[9]*u,d[10]=d[10]*u,d[11]=d[11]*u,this},makeRotationAxis:function(l,f){var u=Math.cos(f),d=Math.sin(f),p=1-u,g=l.x,x=l.y,y=l.z,C=p*g,P=p*x;return this.setValues(C*g+u,C*x-d*y,C*y+d*x,0,C*x+d*y,P*x+u,P*y-d*g,0,C*y-d*x,P*y+d*g,p*y*y+u,0,0,0,0,1)},rotate:function(l,f){var u=this.val,d=f.x,p=f.y,g=f.z,x=Math.sqrt(d*d+p*p+g*g);if(Math.abs(x){/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3743,7 +3743,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(94434),a=t(29747),r=t(25836),n=1e-6,e=new Int8Array([1,2,0]),i=new Float32Array([0,0,0]),h=new r(1,0,0),s=new r(0,1,0),l=new r,f=new v,u=new o({initialize:function(p,g,y,x){this.onChangeCallback=a,this.set(p,g,y,x)},x:{get:function(){return this._x},set:function(d){this._x=d,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(d){this._y=d,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(d){this._z=d,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(d){this._w=d,this.onChangeCallback(this)}},copy:function(d){return this.set(d)},set:function(d,p,g,y,x){return x===void 0&&(x=!0),typeof d=="object"?(this._x=d.x||0,this._y=d.y||0,this._z=d.z||0,this._w=d.w||0):(this._x=d||0,this._y=p||0,this._z=g||0,this._w=y||0),x&&this.onChangeCallback(this),this},add:function(d){return this._x+=d.x,this._y+=d.y,this._z+=d.z,this._w+=d.w,this.onChangeCallback(this),this},subtract:function(d){return this._x-=d.x,this._y-=d.y,this._z-=d.z,this._w-=d.w,this.onChangeCallback(this),this},scale:function(d){return this._x*=d,this._y*=d,this._z*=d,this._w*=d,this.onChangeCallback(this),this},length:function(){var d=this.x,p=this.y,g=this.z,y=this.w;return Math.sqrt(d*d+p*p+g*g+y*y)},lengthSq:function(){var d=this.x,p=this.y,g=this.z,y=this.w;return d*d+p*p+g*g+y*y},normalize:function(){var d=this.x,p=this.y,g=this.z,y=this.w,x=d*d+p*p+g*g+y*y;return x>0&&(x=1/Math.sqrt(x),this._x=d*x,this._y=p*x,this._z=g*x,this._w=y*x),this.onChangeCallback(this),this},dot:function(d){return this.x*d.x+this.y*d.y+this.z*d.z+this.w*d.w},lerp:function(d,p){p===void 0&&(p=0);var g=this.x,y=this.y,x=this.z,C=this.w;return this.set(g+p*(d.x-g),y+p*(d.y-y),x+p*(d.z-x),C+p*(d.w-C))},rotationTo:function(d,p){var g=d.x*p.x+d.y*p.y+d.z*p.z;return g<-.999999?(l.copy(h).cross(d).length().999999?this.set(0,0,0,1):(l.copy(d).cross(p),this._x=l.x,this._y=l.y,this._z=l.z,this._w=1+g,this.normalize())},setAxes:function(d,p,g){var y=f.val;return y[0]=p.x,y[3]=p.y,y[6]=p.z,y[1]=g.x,y[4]=g.y,y[7]=g.z,y[2]=-d.x,y[5]=-d.y,y[8]=-d.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(d,p){p=p*.5;var g=Math.sin(p);return this.set(g*d.x,g*d.y,g*d.z,Math.cos(p))},multiply:function(d){var p=this.x,g=this.y,y=this.z,x=this.w,C=d.x,P=d.y,M=d.z,w=d.w;return this.set(p*w+x*C+g*M-y*P,g*w+x*P+y*C-p*M,y*w+x*M+p*P-g*C,x*w-p*C-g*P-y*M)},slerp:function(d,p){var g=this.x,y=this.y,x=this.z,C=this.w,P=d.x,M=d.y,w=d.z,I=d.w,L=g*P+y*M+x*w+C*I;L<0&&(L=-L,P=-P,M=-M,w=-w,I=-I);var B=1-p,N=p;if(1-L>n){var G=Math.acos(L),V=Math.sin(G);B=Math.sin((1-p)*G)/V,N=Math.sin(p*G)/V}return this.set(B*g+N*P,B*y+N*M,B*x+N*w,B*C+N*I)},invert:function(){var d=this.x,p=this.y,g=this.z,y=this.w,x=d*d+p*p+g*g+y*y,C=x?1/x:0;return this.set(-d*C,-p*C,-g*C,y*C)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P+x*C,g*P+y*C,y*P-g*C,x*P-p*C)},rotateY:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P-y*C,g*P+x*C,y*P+p*C,x*P-g*C)},rotateZ:function(d){d*=.5;var p=this.x,g=this.y,y=this.z,x=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P+g*C,g*P-p*C,y*P+x*C,x*P-y*C)},calculateW:function(){var d=this.x,p=this.y,g=this.z;return this.w=-Math.sqrt(1-d*d-p*p-g*g),this},setFromEuler:function(d,p){var g=d.x/2,y=d.y/2,x=d.z/2,C=Math.cos(g),P=Math.cos(y),M=Math.cos(x),w=Math.sin(g),I=Math.sin(y),L=Math.sin(x);switch(d.order){case"XYZ":{this.set(w*P*M+C*I*L,C*I*M-w*P*L,C*P*L+w*I*M,C*P*M-w*I*L,p);break}case"YXZ":{this.set(w*P*M+C*I*L,C*I*M-w*P*L,C*P*L-w*I*M,C*P*M+w*I*L,p);break}case"ZXY":{this.set(w*P*M-C*I*L,C*I*M+w*P*L,C*P*L+w*I*M,C*P*M-w*I*L,p);break}case"ZYX":{this.set(w*P*M-C*I*L,C*I*M+w*P*L,C*P*L-w*I*M,C*P*M+w*I*L,p);break}case"YZX":{this.set(w*P*M+C*I*L,C*I*M+w*P*L,C*P*L-w*I*M,C*P*M-w*I*L,p);break}case"XZY":{this.set(w*P*M-C*I*L,C*I*M-w*P*L,C*P*L+w*I*M,C*P*M+w*I*L,p);break}}return this},setFromRotationMatrix:function(d){var p=d.val,g=p[0],y=p[4],x=p[8],C=p[1],P=p[5],M=p[9],w=p[2],I=p[6],L=p[10],B=g+P+L,N;return B>0?(N=.5/Math.sqrt(B+1),this.set((I-M)*N,(x-w)*N,(C-y)*N,.25/N)):g>P&&g>L?(N=2*Math.sqrt(1+g-P-L),this.set(.25*N,(y+C)/N,(x+w)/N,(I-M)/N)):P>L?(N=2*Math.sqrt(1+P-g-L),this.set((y+C)/N,.25*N,(M+I)/N,(x-w)/N)):(N=2*Math.sqrt(1+L-g-P),this.set((x+w)/N,(M+I)/N,.25*N,(C-y)/N)),this},fromMat3:function(d){var p=d.val,g=p[0]+p[4]+p[8],y;if(g>0)y=Math.sqrt(g+1),this.w=.5*y,y=.5/y,this._x=(p[7]-p[5])*y,this._y=(p[2]-p[6])*y,this._z=(p[3]-p[1])*y;else{var x=0;p[4]>p[0]&&(x=1),p[8]>p[x*3+x]&&(x=2);var C=e[x],P=e[C];y=Math.sqrt(p[x*3+x]-p[C*3+C]-p[P*3+P]+1),i[x]=.5*y,y=.5/y,i[C]=(p[C*3+x]+p[x*3+C])*y,i[P]=(p[P*3+x]+p[x*3+P])*y,this._x=i[0],this._y=i[1],this._z=i[2],this._w=(p[P*3+C]-p[C*3+P])*y}return this.onChangeCallback(this),this}});c.exports=u},43396:(c,m,t)=>{/** + */var o=t(83419),v=t(94434),a=t(29747),r=t(25836),n=1e-6,e=new Int8Array([1,2,0]),i=new Float32Array([0,0,0]),h=new r(1,0,0),s=new r(0,1,0),l=new r,f=new v,u=new o({initialize:function(p,g,x,y){this.onChangeCallback=a,this.set(p,g,x,y)},x:{get:function(){return this._x},set:function(d){this._x=d,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(d){this._y=d,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(d){this._z=d,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(d){this._w=d,this.onChangeCallback(this)}},copy:function(d){return this.set(d)},set:function(d,p,g,x,y){return y===void 0&&(y=!0),typeof d=="object"?(this._x=d.x||0,this._y=d.y||0,this._z=d.z||0,this._w=d.w||0):(this._x=d||0,this._y=p||0,this._z=g||0,this._w=x||0),y&&this.onChangeCallback(this),this},add:function(d){return this._x+=d.x,this._y+=d.y,this._z+=d.z,this._w+=d.w,this.onChangeCallback(this),this},subtract:function(d){return this._x-=d.x,this._y-=d.y,this._z-=d.z,this._w-=d.w,this.onChangeCallback(this),this},scale:function(d){return this._x*=d,this._y*=d,this._z*=d,this._w*=d,this.onChangeCallback(this),this},length:function(){var d=this.x,p=this.y,g=this.z,x=this.w;return Math.sqrt(d*d+p*p+g*g+x*x)},lengthSq:function(){var d=this.x,p=this.y,g=this.z,x=this.w;return d*d+p*p+g*g+x*x},normalize:function(){var d=this.x,p=this.y,g=this.z,x=this.w,y=d*d+p*p+g*g+x*x;return y>0&&(y=1/Math.sqrt(y),this._x=d*y,this._y=p*y,this._z=g*y,this._w=x*y),this.onChangeCallback(this),this},dot:function(d){return this.x*d.x+this.y*d.y+this.z*d.z+this.w*d.w},lerp:function(d,p){p===void 0&&(p=0);var g=this.x,x=this.y,y=this.z,C=this.w;return this.set(g+p*(d.x-g),x+p*(d.y-x),y+p*(d.z-y),C+p*(d.w-C))},rotationTo:function(d,p){var g=d.x*p.x+d.y*p.y+d.z*p.z;return g<-.999999?(l.copy(h).cross(d).length().999999?this.set(0,0,0,1):(l.copy(d).cross(p),this._x=l.x,this._y=l.y,this._z=l.z,this._w=1+g,this.normalize())},setAxes:function(d,p,g){var x=f.val;return x[0]=p.x,x[3]=p.y,x[6]=p.z,x[1]=g.x,x[4]=g.y,x[7]=g.z,x[2]=-d.x,x[5]=-d.y,x[8]=-d.z,this.fromMat3(f).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(d,p){p=p*.5;var g=Math.sin(p);return this.set(g*d.x,g*d.y,g*d.z,Math.cos(p))},multiply:function(d){var p=this.x,g=this.y,x=this.z,y=this.w,C=d.x,P=d.y,M=d.z,w=d.w;return this.set(p*w+y*C+g*M-x*P,g*w+y*P+x*C-p*M,x*w+y*M+p*P-g*C,y*w-p*C-g*P-x*M)},slerp:function(d,p){var g=this.x,x=this.y,y=this.z,C=this.w,P=d.x,M=d.y,w=d.z,I=d.w,L=g*P+x*M+y*w+C*I;L<0&&(L=-L,P=-P,M=-M,w=-w,I=-I);var B=1-p,N=p;if(1-L>n){var G=Math.acos(L),V=Math.sin(G);B=Math.sin((1-p)*G)/V,N=Math.sin(p*G)/V}return this.set(B*g+N*P,B*x+N*M,B*y+N*w,B*C+N*I)},invert:function(){var d=this.x,p=this.y,g=this.z,x=this.w,y=d*d+p*p+g*g+x*x,C=y?1/y:0;return this.set(-d*C,-p*C,-g*C,x*C)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(d){d*=.5;var p=this.x,g=this.y,x=this.z,y=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P+y*C,g*P+x*C,x*P-g*C,y*P-p*C)},rotateY:function(d){d*=.5;var p=this.x,g=this.y,x=this.z,y=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P-x*C,g*P+y*C,x*P+p*C,y*P-g*C)},rotateZ:function(d){d*=.5;var p=this.x,g=this.y,x=this.z,y=this.w,C=Math.sin(d),P=Math.cos(d);return this.set(p*P+g*C,g*P-p*C,x*P+y*C,y*P-x*C)},calculateW:function(){var d=this.x,p=this.y,g=this.z;return this.w=-Math.sqrt(1-d*d-p*p-g*g),this},setFromEuler:function(d,p){var g=d.x/2,x=d.y/2,y=d.z/2,C=Math.cos(g),P=Math.cos(x),M=Math.cos(y),w=Math.sin(g),I=Math.sin(x),L=Math.sin(y);switch(d.order){case"XYZ":{this.set(w*P*M+C*I*L,C*I*M-w*P*L,C*P*L+w*I*M,C*P*M-w*I*L,p);break}case"YXZ":{this.set(w*P*M+C*I*L,C*I*M-w*P*L,C*P*L-w*I*M,C*P*M+w*I*L,p);break}case"ZXY":{this.set(w*P*M-C*I*L,C*I*M+w*P*L,C*P*L+w*I*M,C*P*M-w*I*L,p);break}case"ZYX":{this.set(w*P*M-C*I*L,C*I*M+w*P*L,C*P*L-w*I*M,C*P*M+w*I*L,p);break}case"YZX":{this.set(w*P*M+C*I*L,C*I*M+w*P*L,C*P*L-w*I*M,C*P*M-w*I*L,p);break}case"XZY":{this.set(w*P*M-C*I*L,C*I*M-w*P*L,C*P*L+w*I*M,C*P*M+w*I*L,p);break}}return this},setFromRotationMatrix:function(d){var p=d.val,g=p[0],x=p[4],y=p[8],C=p[1],P=p[5],M=p[9],w=p[2],I=p[6],L=p[10],B=g+P+L,N;return B>0?(N=.5/Math.sqrt(B+1),this.set((I-M)*N,(y-w)*N,(C-x)*N,.25/N)):g>P&&g>L?(N=2*Math.sqrt(1+g-P-L),this.set(.25*N,(x+C)/N,(y+w)/N,(I-M)/N)):P>L?(N=2*Math.sqrt(1+P-g-L),this.set((x+C)/N,.25*N,(M+I)/N,(y-w)/N)):(N=2*Math.sqrt(1+L-g-P),this.set((y+w)/N,(M+I)/N,.25*N,(C-x)/N)),this},fromMat3:function(d){var p=d.val,g=p[0]+p[4]+p[8],x;if(g>0)x=Math.sqrt(g+1),this.w=.5*x,x=.5/x,this._x=(p[7]-p[5])*x,this._y=(p[2]-p[6])*x,this._z=(p[3]-p[1])*x;else{var y=0;p[4]>p[0]&&(y=1),p[8]>p[y*3+y]&&(y=2);var C=e[y],P=e[C];x=Math.sqrt(p[y*3+y]-p[C*3+C]-p[P*3+P]+1),i[y]=.5*x,x=.5/x,i[C]=(p[C*3+y]+p[y*3+C])*x,i[P]=(p[P*3+y]+p[y*3+P])*x,this._x=i[0],this._y=i[1],this._z=i[2],this._w=(p[P*3+C]-p[C*3+P])*x}return this.onChangeCallback(this),this}});c.exports=u},43396:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3807,7 +3807,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(26099),v=function(a,r,n,e,i,h,s,l){l===void 0&&(l=new o);var f=Math.sin(i),u=Math.cos(i),d=u*h,p=f*h,g=-f*s,y=u*s,x=1/(d*y+g*-p);return l.x=y*x*a+-g*x*r+(e*g-n*y)*x,l.y=d*x*r+-p*x*a+(-e*d+n*p)*x,l};c.exports=v},26099:(c,m,t)=>{/** + */var o=t(26099),v=function(a,r,n,e,i,h,s,l){l===void 0&&(l=new o);var f=Math.sin(i),u=Math.cos(i),d=u*h,p=f*h,g=-f*s,x=u*s,y=1/(d*x+g*-p);return l.x=x*y*a+-g*y*r+(e*g-n*x)*y,l.y=d*y*r+-p*y*a+(-e*d+n*p)*y,l};c.exports=v},26099:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -3815,7 +3815,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=new o({initialize:function(r,n,e){this.x=0,this.y=0,this.z=0,typeof r=="object"?(this.x=r.x||0,this.y=r.y||0,this.z=r.z||0):(this.x=r||0,this.y=n||0,this.z=e||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this.z=Math.min(this.z,a.z),this},max:function(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this.z=Math.max(this.z,a.z),this},clone:function(){return new v(this.x,this.y,this.z)},addVectors:function(a,r){return this.x=a.x+r.x,this.y=a.y+r.y,this.z=a.z+r.z,this},crossVectors:function(a,r){var n=a.x,e=a.y,i=a.z,h=r.x,s=r.y,l=r.z;return this.x=e*l-i*s,this.y=i*h-n*l,this.z=n*s-e*h,this},equals:function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z||0,this},set:function(a,r,n){return typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0):(this.x=a||0,this.y=r||0,this.z=n||0),this},setFromMatrixPosition:function(a){return this.fromArray(a.val,12)},setFromMatrixColumn:function(a,r){return this.fromArray(a.val,r*4)},fromArray:function(a,r){return r===void 0&&(r=0),this.x=a[r],this.y=a[r+1],this.z=a[r+2],this},add:function(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z||0,this},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addScale:function(a,r){return this.x+=a.x*r,this.y+=a.y*r,this.z+=a.z*r||0,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z||0,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z||1,this},scale:function(a){return isFinite(a)?(this.x*=a,this.y*=a,this.z*=a):(this.x=0,this.y=0,this.z=0),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return Math.sqrt(r*r+n*n+e*e)},distanceSq:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return r*r+n*n+e*e},length:function(){var a=this.x,r=this.y,n=this.z;return Math.sqrt(a*a+r*r+n*n)},lengthSq:function(){var a=this.x,r=this.y,n=this.z;return a*a+r*r+n*n},normalize:function(){var a=this.x,r=this.y,n=this.z,e=a*a+r*r+n*n;return e>0&&(e=1/Math.sqrt(e),this.x=a*e,this.y=r*e,this.z=n*e),this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},cross:function(a){var r=this.x,n=this.y,e=this.z,i=a.x,h=a.y,s=a.z;return this.x=n*s-e*h,this.y=e*i-r*s,this.z=r*h-n*i,this},lerp:function(a,r){r===void 0&&(r=0);var n=this.x,e=this.y,i=this.z;return this.x=n+r*(a.x-n),this.y=e+r*(a.y-e),this.z=i+r*(a.z-i),this},applyMatrix3:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=i[0]*r+i[3]*n+i[6]*e,this.y=i[1]*r+i[4]*n+i[7]*e,this.z=i[2]*r+i[5]*n+i[8]*e,this},applyMatrix4:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=1/(i[3]*r+i[7]*n+i[11]*e+i[15]);return this.x=(i[0]*r+i[4]*n+i[8]*e+i[12])*h,this.y=(i[1]*r+i[5]*n+i[9]*e+i[13])*h,this.z=(i[2]*r+i[6]*n+i[10]*e+i[14])*h,this},transformMat3:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=r*i[0]+n*i[3]+e*i[6],this.y=r*i[1]+n*i[4]+e*i[7],this.z=r*i[2]+n*i[5]+e*i[8],this},transformMat4:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=i[0]*r+i[4]*n+i[8]*e+i[12],this.y=i[1]*r+i[5]*n+i[9]*e+i[13],this.z=i[2]*r+i[6]*n+i[10]*e+i[14],this},transformCoordinates:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=r*i[0]+n*i[4]+e*i[8]+i[12],s=r*i[1]+n*i[5]+e*i[9]+i[13],l=r*i[2]+n*i[6]+e*i[10]+i[14],f=r*i[3]+n*i[7]+e*i[11]+i[15];return this.x=h/f,this.y=s/f,this.z=l/f,this},transformQuat:function(a){var r=this.x,n=this.y,e=this.z,i=a.x,h=a.y,s=a.z,l=a.w,f=l*r+h*e-s*n,u=l*n+s*r-i*e,d=l*e+i*n-h*r,p=-i*r-h*n-s*e;return this.x=f*l+p*-i+u*-s-d*-h,this.y=u*l+p*-h+d*-i-f*-s,this.z=d*l+p*-s+f*-h-u*-i,this},project:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=i[0],s=i[1],l=i[2],f=i[3],u=i[4],d=i[5],p=i[6],g=i[7],y=i[8],x=i[9],C=i[10],P=i[11],M=i[12],w=i[13],I=i[14],L=i[15],B=1/(r*f+n*g+e*P+L);return this.x=(r*h+n*u+e*y+M)*B,this.y=(r*s+n*d+e*x+w)*B,this.z=(r*l+n*p+e*C+I)*B,this},projectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unprojectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unproject:function(a,r){var n=a.x,e=a.y,i=a.z,h=a.w,s=this.x-n,l=h-this.y-1-e,f=this.z;return this.x=2*s/i-1,this.y=2*l/h-1,this.z=2*f-1,this.project(r)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});v.ZERO=new v,v.RIGHT=new v(1,0,0),v.LEFT=new v(-1,0,0),v.UP=new v(0,-1,0),v.DOWN=new v(0,1,0),v.FORWARD=new v(0,0,1),v.BACK=new v(0,0,-1),v.ONE=new v(1,1,1),c.exports=v},61369:(c,m,t)=>{/** + */var o=t(83419),v=new o({initialize:function(r,n,e){this.x=0,this.y=0,this.z=0,typeof r=="object"?(this.x=r.x||0,this.y=r.y||0,this.z=r.z||0):(this.x=r||0,this.y=n||0,this.z=e||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(a){return this.x=Math.min(this.x,a.x),this.y=Math.min(this.y,a.y),this.z=Math.min(this.z,a.z),this},max:function(a){return this.x=Math.max(this.x,a.x),this.y=Math.max(this.y,a.y),this.z=Math.max(this.z,a.z),this},clone:function(){return new v(this.x,this.y,this.z)},addVectors:function(a,r){return this.x=a.x+r.x,this.y=a.y+r.y,this.z=a.z+r.z,this},crossVectors:function(a,r){var n=a.x,e=a.y,i=a.z,h=r.x,s=r.y,l=r.z;return this.x=e*l-i*s,this.y=i*h-n*l,this.z=n*s-e*h,this},equals:function(a){return this.x===a.x&&this.y===a.y&&this.z===a.z},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z||0,this},set:function(a,r,n){return typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0):(this.x=a||0,this.y=r||0,this.z=n||0),this},setFromMatrixPosition:function(a){return this.fromArray(a.val,12)},setFromMatrixColumn:function(a,r){return this.fromArray(a.val,r*4)},fromArray:function(a,r){return r===void 0&&(r=0),this.x=a[r],this.y=a[r+1],this.z=a[r+2],this},add:function(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z||0,this},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addScale:function(a,r){return this.x+=a.x*r,this.y+=a.y*r,this.z+=a.z*r||0,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z||0,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this.z*=a.z||1,this},scale:function(a){return isFinite(a)?(this.x*=a,this.y*=a,this.z*=a):(this.x=0,this.y=0,this.z=0),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return Math.sqrt(r*r+n*n+e*e)},distanceSq:function(a){var r=a.x-this.x,n=a.y-this.y,e=a.z-this.z||0;return r*r+n*n+e*e},length:function(){var a=this.x,r=this.y,n=this.z;return Math.sqrt(a*a+r*r+n*n)},lengthSq:function(){var a=this.x,r=this.y,n=this.z;return a*a+r*r+n*n},normalize:function(){var a=this.x,r=this.y,n=this.z,e=a*a+r*r+n*n;return e>0&&(e=1/Math.sqrt(e),this.x=a*e,this.y=r*e,this.z=n*e),this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},cross:function(a){var r=this.x,n=this.y,e=this.z,i=a.x,h=a.y,s=a.z;return this.x=n*s-e*h,this.y=e*i-r*s,this.z=r*h-n*i,this},lerp:function(a,r){r===void 0&&(r=0);var n=this.x,e=this.y,i=this.z;return this.x=n+r*(a.x-n),this.y=e+r*(a.y-e),this.z=i+r*(a.z-i),this},applyMatrix3:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=i[0]*r+i[3]*n+i[6]*e,this.y=i[1]*r+i[4]*n+i[7]*e,this.z=i[2]*r+i[5]*n+i[8]*e,this},applyMatrix4:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=1/(i[3]*r+i[7]*n+i[11]*e+i[15]);return this.x=(i[0]*r+i[4]*n+i[8]*e+i[12])*h,this.y=(i[1]*r+i[5]*n+i[9]*e+i[13])*h,this.z=(i[2]*r+i[6]*n+i[10]*e+i[14])*h,this},transformMat3:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=r*i[0]+n*i[3]+e*i[6],this.y=r*i[1]+n*i[4]+e*i[7],this.z=r*i[2]+n*i[5]+e*i[8],this},transformMat4:function(a){var r=this.x,n=this.y,e=this.z,i=a.val;return this.x=i[0]*r+i[4]*n+i[8]*e+i[12],this.y=i[1]*r+i[5]*n+i[9]*e+i[13],this.z=i[2]*r+i[6]*n+i[10]*e+i[14],this},transformCoordinates:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=r*i[0]+n*i[4]+e*i[8]+i[12],s=r*i[1]+n*i[5]+e*i[9]+i[13],l=r*i[2]+n*i[6]+e*i[10]+i[14],f=r*i[3]+n*i[7]+e*i[11]+i[15];return this.x=h/f,this.y=s/f,this.z=l/f,this},transformQuat:function(a){var r=this.x,n=this.y,e=this.z,i=a.x,h=a.y,s=a.z,l=a.w,f=l*r+h*e-s*n,u=l*n+s*r-i*e,d=l*e+i*n-h*r,p=-i*r-h*n-s*e;return this.x=f*l+p*-i+u*-s-d*-h,this.y=u*l+p*-h+d*-i-f*-s,this.z=d*l+p*-s+f*-h-u*-i,this},project:function(a){var r=this.x,n=this.y,e=this.z,i=a.val,h=i[0],s=i[1],l=i[2],f=i[3],u=i[4],d=i[5],p=i[6],g=i[7],x=i[8],y=i[9],C=i[10],P=i[11],M=i[12],w=i[13],I=i[14],L=i[15],B=1/(r*f+n*g+e*P+L);return this.x=(r*h+n*u+e*x+M)*B,this.y=(r*s+n*d+e*y+w)*B,this.z=(r*l+n*p+e*C+I)*B,this},projectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unprojectViewMatrix:function(a,r){return this.applyMatrix4(a).applyMatrix4(r)},unproject:function(a,r){var n=a.x,e=a.y,i=a.z,h=a.w,s=this.x-n,l=h-this.y-1-e,f=this.z;return this.x=2*s/i-1,this.y=2*l/h-1,this.z=2*f-1,this.project(r)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});v.ZERO=new v,v.RIGHT=new v(1,0,0),v.LEFT=new v(-1,0,0),v.UP=new v(0,-1,0),v.DOWN=new v(0,1,0),v.FORWARD=new v(0,0,1),v.BACK=new v(0,0,-1),v.ONE=new v(1,1,1),c.exports=v},61369:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4213,7 +4213,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(39506),a=t(20339),r=t(89774),n=t(66022),e=t(95540),i=t(46975),h=t(72441),s=t(47956),l=t(37277),f=t(44594),u=t(26099),d=t(82248),p=new o({initialize:function(y){this.scene=y,this.systems=y.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,y.sys.events.once(f.BOOT,this.boot,this),y.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new d(this.scene,this.config),this.add=new n(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new d(this.scene,this.config),this.add=new n(this.world));var g=this.systems.events;e(this.config,"customUpdate",!1)||g.on(f.UPDATE,this.world.update,this.world),g.on(f.POST_UPDATE,this.world.postUpdate,this.world),g.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 g=this.systems.game.config.physics,y=this.systems.settings.physics,x=i(e(y,"arcade",{}),e(g,"arcade",{}));return x},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(g,y,x,C,P){return x===void 0&&(x=null),C===void 0&&(C=null),P===void 0&&(P=x),this.world.collideObjects(g,y,x,C,P,!0)},collide:function(g,y,x,C,P){return x===void 0&&(x=null),C===void 0&&(C=null),P===void 0&&(P=x),this.world.collideObjects(g,y,x,C,P,!1)},collideTiles:function(g,y,x,C,P){return this.world.collideTiles(g,y,x,C,P)},overlapTiles:function(g,y,x,C,P){return this.world.overlapTiles(g,y,x,C,P)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(g,y,x,C,P,M){C===void 0&&(C=60);var w=Math.atan2(x-g.y,y-g.x);return g.body.acceleration.setToPolar(w,C),P!==void 0&&M!==void 0&&g.body.maxVelocity.set(P,M),w},accelerateToObject:function(g,y,x,C,P){return this.accelerateTo(g,y.x,y.y,x,C,P)},closest:function(g,y){y||(y=this.world.bodies.entries);for(var x=Number.MAX_VALUE,C=null,P=g.x,M=g.y,w=y.length,I=0;Ix&&(C=L,x=N)}}return C},moveTo:function(g,y,x,C,P){C===void 0&&(C=60),P===void 0&&(P=0);var M=Math.atan2(x-g.y,y-g.x);return P>0&&(C=a(g.x,g.y,y,x)/(P/1e3)),g.body.velocity.setToPolar(M,C),M},moveToObject:function(g,y,x,C){return this.moveTo(g,y.x,y.y,x,C)},velocityFromAngle:function(g,y,x){return y===void 0&&(y=60),x===void 0&&(x=new u),x.setToPolar(v(g),y)},velocityFromRotation:function(g,y,x){return y===void 0&&(y=60),x===void 0&&(x=new u),x.setToPolar(g,y)},overlapRect:function(g,y,x,C,P,M){return s(this.world,g,y,x,C,P,M)},overlapCirc:function(g,y,x,C,P){return h(this.world,g,y,x,C,P)},shutdown:function(){if(this.world){var g=this.systems.events;g.off(f.UPDATE,this.world.update,this.world),g.off(f.POST_UPDATE,this.world.postUpdate,this.world),g.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}});l.register("ArcadePhysics",p,"arcadePhysics"),c.exports=p},13759:(c,m,t)=>{/** + */var o=t(83419),v=t(39506),a=t(20339),r=t(89774),n=t(66022),e=t(95540),i=t(46975),h=t(72441),s=t(47956),l=t(37277),f=t(44594),u=t(26099),d=t(82248),p=new o({initialize:function(x){this.scene=x,this.systems=x.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,x.sys.events.once(f.BOOT,this.boot,this),x.sys.events.on(f.START,this.start,this)},boot:function(){this.world=new d(this.scene,this.config),this.add=new n(this.world),this.systems.events.once(f.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new d(this.scene,this.config),this.add=new n(this.world));var g=this.systems.events;e(this.config,"customUpdate",!1)||g.on(f.UPDATE,this.world.update,this.world),g.on(f.POST_UPDATE,this.world.postUpdate,this.world),g.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 g=this.systems.game.config.physics,x=this.systems.settings.physics,y=i(e(x,"arcade",{}),e(g,"arcade",{}));return y},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(g,x,y,C,P){return y===void 0&&(y=null),C===void 0&&(C=null),P===void 0&&(P=y),this.world.collideObjects(g,x,y,C,P,!0)},collide:function(g,x,y,C,P){return y===void 0&&(y=null),C===void 0&&(C=null),P===void 0&&(P=y),this.world.collideObjects(g,x,y,C,P,!1)},collideTiles:function(g,x,y,C,P){return this.world.collideTiles(g,x,y,C,P)},overlapTiles:function(g,x,y,C,P){return this.world.overlapTiles(g,x,y,C,P)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(g,x,y,C,P,M){C===void 0&&(C=60);var w=Math.atan2(y-g.y,x-g.x);return g.body.acceleration.setToPolar(w,C),P!==void 0&&M!==void 0&&g.body.maxVelocity.set(P,M),w},accelerateToObject:function(g,x,y,C,P){return this.accelerateTo(g,x.x,x.y,y,C,P)},closest:function(g,x){x||(x=this.world.bodies.entries);for(var y=Number.MAX_VALUE,C=null,P=g.x,M=g.y,w=x.length,I=0;Iy&&(C=L,y=N)}}return C},moveTo:function(g,x,y,C,P){C===void 0&&(C=60),P===void 0&&(P=0);var M=Math.atan2(y-g.y,x-g.x);return P>0&&(C=a(g.x,g.y,x,y)/(P/1e3)),g.body.velocity.setToPolar(M,C),M},moveToObject:function(g,x,y,C){return this.moveTo(g,x.x,x.y,y,C)},velocityFromAngle:function(g,x,y){return x===void 0&&(x=60),y===void 0&&(y=new u),y.setToPolar(v(g),x)},velocityFromRotation:function(g,x,y){return x===void 0&&(x=60),y===void 0&&(y=new u),y.setToPolar(g,x)},overlapRect:function(g,x,y,C,P,M){return s(this.world,g,x,y,C,P,M)},overlapCirc:function(g,x,y,C,P){return h(this.world,g,x,y,C,P)},shutdown:function(){if(this.world){var g=this.systems.events;g.off(f.UPDATE,this.world.update,this.world),g.off(f.POST_UPDATE,this.world.postUpdate,this.world),g.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}});l.register("ArcadePhysics",p,"arcadePhysics"),c.exports=p},13759:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4221,7 +4221,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(78389),a=t(37747),r=t(63012),n=t(43396),e=t(87841),i=t(37303),h=t(95829),s=t(26099),l=new o({Mixins:[v],initialize:function(u,d){var p=64,g=64,y={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},x=d!==void 0;x&&d.displayWidth&&(p=d.displayWidth,g=d.displayHeight),x||(d=y),this.world=u,this.gameObject=x?d:void 0,this.isBody=!0,this.transform={x:d.x,y:d.y,rotation:d.angle,scaleX:d.scaleX,scaleY:d.scaleY,displayOriginX:d.displayOriginX,displayOriginY:d.displayOriginY},this.debugShowBody=u.defaults.debugShowBody,this.debugShowVelocity=u.defaults.debugShowVelocity,this.debugBodyColor=u.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new s,this.position=new s(d.x-d.scaleX*d.displayOriginX,d.y-d.scaleY*d.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=d.angle,this.preRotation=d.angle,this.width=p,this.height=g,this.sourceWidth=p,this.sourceHeight=g,d.frame&&(this.sourceWidth=d.frame.realWidth,this.sourceHeight=d.frame.realHeight),this.halfWidth=Math.abs(p/2),this.halfHeight=Math.abs(g/2),this.center=new s(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new s,this.newVelocity=new s,this.deltaMax=new s,this.acceleration=new s,this.allowDrag=!0,this.drag=new s,this.allowGravity=!0,this.gravity=new s,this.bounce=new s,this.worldBounce=null,this.customBoundsRectangle=u.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new s(1e4,1e4),this.maxSpeed=-1,this.friction=new s(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=a.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new s(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=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.syncBounds=!1,this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=d.scaleX,this._sy=d.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new e,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var f=this.gameObject,u=this.transform;if(f.parentContainer){var d=f.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);u.x=d.tx,u.y=d.ty,u.rotation=n(d.rotation),u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY}else u.x=f.x,u.y=f.y,u.rotation=f.angle,u.scaleX=f.scaleX,u.scaleY=f.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY;var p=!1;if(this.syncBounds){var g=f.getBounds(this._bounds);this.width=g.width,this.height=g.height,p=!0}else{var y=Math.abs(u.scaleX),x=Math.abs(u.scaleY);(this._sx!==y||this._sy!==x)&&(this.width=this.sourceWidth*y,this.height=this.sourceHeight*x,this._sx=y,this._sy=x,p=!0)}p&&(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 f=this.transform;this.position.x=f.x+f.scaleX*(this.offset.x-f.displayOriginX),this.position.y=f.y+f.scaleY*(this.offset.y-f.displayOriginY),this.updateCenter()},resetFlags:function(f){f===void 0&&(f=!1);var u=this.wasTouching,d=this.touching,p=this.blocked;f?h(!0,u):(u.none=d.none,u.up=d.up,u.down=d.down,u.left=d.left,u.right=d.right),h(!0,d),h(!0,p),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(f,u){if(f&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var d=this.position;this.prev.x=d.x,this.prev.y=d.y,this.prevFrame.x=d.x,this.prevFrame.y=d.y}f&&this.update(u)},update:function(f){var u=this.prev,d=this.position,p=this.velocity;if(u.set(d.x,d.y),!this.moves){this._dx=d.x-u.x,this._dy=d.y-u.y;return}if(this.directControl){var g=this.autoFrame;p.set((d.x-g.x)/f,(d.y-g.y)/f),this.world.updateMotion(this,f),this._dx=d.x-g.x,this._dy=d.y-g.y}else this.world.updateMotion(this,f),this.newVelocity.set(p.x*f,p.y*f),d.add(this.newVelocity),this._dx=d.x-u.x,this._dy=d.y-u.y;var y=p.x,x=p.y;if(this.updateCenter(),this.angle=Math.atan2(x,y),this.speed=Math.sqrt(y*y+x*x),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var C=this.blocked;this.world.emit(r.WORLD_BOUNDS,this,C.up,C.down,C.left,C.right)}},postUpdate:function(){var f=this.position,u=f.x-this.prevFrame.x,d=f.y-this.prevFrame.y,p=this.gameObject;if(this.moves){var g=this.deltaMax.x,y=this.deltaMax.y;g!==0&&u!==0&&(u<0&&u<-g?u=-g:u>0&&u>g&&(u=g)),y!==0&&d!==0&&(d<0&&d<-y?d=-y:d>0&&d>y&&(d=y)),p&&(p.x+=u,p.y+=d)}u<0?this.facing=a.FACING_LEFT:u>0&&(this.facing=a.FACING_RIGHT),d<0?this.facing=a.FACING_UP:d>0&&(this.facing=a.FACING_DOWN),this.allowRotation&&p&&(p.angle+=this.deltaZ()),this._tx=u,this._ty=d,this.autoFrame.set(f.x,f.y)},setBoundsRectangle:function(f){return this.customBoundsRectangle=f||this.world.bounds,this},checkWorldBounds:function(){var f=this.position,u=this.velocity,d=this.blocked,p=this.customBoundsRectangle,g=this.world.checkCollision,y=this.worldBounce?-this.worldBounce.x:-this.bounce.x,x=this.worldBounce?-this.worldBounce.y:-this.bounce.y,C=!1;return f.xp.right&&g.right&&(f.x=p.right-this.width,u.x*=y,d.right=!0,C=!0),f.yp.bottom&&g.down&&(f.y=p.bottom-this.height,u.y*=x,d.down=!0,C=!0),C&&(this.blocked.none=!1,this.updateCenter()),C},setOffset:function(f,u){return u===void 0&&(u=f),this.offset.set(f,u),this},setGameObject:function(f,u){return u===void 0&&(u=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=f,f.body&&(f.body=this),this.setSize(),this.world.add(this),this.enable=u,this},setSize:function(f,u,d){d===void 0&&(d=!0);var p=this.gameObject;if(p&&(!f&&p.frame&&(f=p.frame.realWidth),!u&&p.frame&&(u=p.frame.realHeight)),this.sourceWidth=f,this.sourceHeight=u,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(),d&&p&&p.getCenter){var g=(p.width-f)/2,y=(p.height-u)/2;this.offset.set(g,y)}return this.isCircle=!1,this.radius=0,this},setCircle:function(f,u,d){return u===void 0&&(u=this.offset.x),d===void 0&&(d=this.offset.y),f>0?(this.isCircle=!0,this.radius=f,this.sourceWidth=f*2,this.sourceHeight=f*2,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(u,d),this.updateCenter()):this.isCircle=!1,this},reset:function(f,u){this.stop();var d=this.gameObject;d&&(d.setPosition(f,u),this.rotation=d.angle,this.preRotation=d.angle);var p=this.position;d&&d.getTopLeft?d.getTopLeft(p):p.set(f,u),this.prev.copy(p),this.prevFrame.copy(p),this.autoFrame.copy(p),d&&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(f){return f.x=this.x,f.y=this.y,f.right=this.right,f.bottom=this.bottom,f},hitTest:function(f,u){if(!this.isCircle)return i(this,f,u);if(this.radius>0&&f>=this.left&&f<=this.right&&u>=this.top&&u<=this.bottom){var d=(this.center.x-f)*(this.center.x-f),p=(this.center.y-u)*(this.center.y-u);return d+p<=this.radius*this.radius}return!1},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(f){var u=this.position,d=u.x+this.halfWidth,p=u.y+this.halfHeight;this.debugShowBody&&(f.lineStyle(f.defaultStrokeWidth,this.debugBodyColor),this.isCircle?f.strokeCircle(d,p,this.width/2):(this.checkCollision.up&&f.lineBetween(u.x,u.y,u.x+this.width,u.y),this.checkCollision.right&&f.lineBetween(u.x+this.width,u.y,u.x+this.width,u.y+this.height),this.checkCollision.down&&f.lineBetween(u.x,u.y+this.height,u.x+this.width,u.y+this.height),this.checkCollision.left&&f.lineBetween(u.x,u.y,u.x,u.y+this.height))),this.debugShowVelocity&&(f.lineStyle(f.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),f.lineBetween(d,p,d+this.velocity.x/2,p+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(f){return f===void 0&&(f=!0),this.directControl=f,this},setCollideWorldBounds:function(f,u,d,p){f===void 0&&(f=!0),this.collideWorldBounds=f;var g=u!==void 0,y=d!==void 0;return(g||y)&&(this.worldBounce||(this.worldBounce=new s),g&&(this.worldBounce.x=u),y&&(this.worldBounce.y=d)),p!==void 0&&(this.onWorldBounds=p),this},setVelocity:function(f,u){return this.velocity.set(f,u),f=this.velocity.x,u=this.velocity.y,this.speed=Math.sqrt(f*f+u*u),this},setVelocityX:function(f){return this.setVelocity(f,this.velocity.y)},setVelocityY:function(f){return this.setVelocity(this.velocity.x,f)},setMaxVelocity:function(f,u){return this.maxVelocity.set(f,u),this},setMaxVelocityX:function(f){return this.maxVelocity.x=f,this},setMaxVelocityY:function(f){return this.maxVelocity.y=f,this},setMaxSpeed:function(f){return this.maxSpeed=f,this},setSlideFactor:function(f,u){return this.slideFactor.set(f,u),this},setBounce:function(f,u){return this.bounce.set(f,u),this},setBounceX:function(f){return this.bounce.x=f,this},setBounceY:function(f){return this.bounce.y=f,this},setAcceleration:function(f,u){return this.acceleration.set(f,u),this},setAccelerationX:function(f){return this.acceleration.x=f,this},setAccelerationY:function(f){return this.acceleration.y=f,this},setAllowDrag:function(f){return f===void 0&&(f=!0),this.allowDrag=f,this},setAllowGravity:function(f){return f===void 0&&(f=!0),this.allowGravity=f,this},setAllowRotation:function(f){return f===void 0&&(f=!0),this.allowRotation=f,this},setDrag:function(f,u){return this.drag.set(f,u),this},setDamping:function(f){return this.useDamping=f,this},setDragX:function(f){return this.drag.x=f,this},setDragY:function(f){return this.drag.y=f,this},setGravity:function(f,u){return this.gravity.set(f,u),this},setGravityX:function(f){return this.gravity.x=f,this},setGravityY:function(f){return this.gravity.y=f,this},setFriction:function(f,u){return this.friction.set(f,u),this},setFrictionX:function(f){return this.friction.x=f,this},setFrictionY:function(f){return this.friction.y=f,this},setAngularVelocity:function(f){return this.angularVelocity=f,this},setAngularAcceleration:function(f){return this.angularAcceleration=f,this},setAngularDrag:function(f){return this.angularDrag=f,this},setMass:function(f){return this.mass=f,this},setImmovable:function(f){return f===void 0&&(f=!0),this.immovable=f,this},setEnable:function(f){return f===void 0&&(f=!0),this.enable=f,this},processX:function(f,u,d,p){this.x+=f,this.updateCenter(),u!==null&&(this.velocity.x=u*this.slideFactor.x);var g=this.blocked;d&&(g.left=!0,g.none=!1),p&&(g.right=!0,g.none=!1)},processY:function(f,u,d,p){this.y+=f,this.updateCenter(),u!==null&&(this.velocity.y=u*this.slideFactor.y);var g=this.blocked;d&&(g.up=!0,g.none=!1),p&&(g.down=!0,g.none=!1)},x:{get:function(){return this.position.x},set:function(f){this.position.x=f}},y:{get:function(){return this.position.y},set:function(f){this.position.y=f}},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}}});c.exports=l},79342:(c,m,t)=>{/** + */var o=t(83419),v=t(78389),a=t(37747),r=t(63012),n=t(43396),e=t(87841),i=t(37303),h=t(95829),s=t(26099),l=new o({Mixins:[v],initialize:function(u,d){var p=64,g=64,x={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},y=d!==void 0;y&&d.displayWidth&&(p=d.displayWidth,g=d.displayHeight),y||(d=x),this.world=u,this.gameObject=y?d:void 0,this.isBody=!0,this.transform={x:d.x,y:d.y,rotation:d.angle,scaleX:d.scaleX,scaleY:d.scaleY,displayOriginX:d.displayOriginX,displayOriginY:d.displayOriginY},this.debugShowBody=u.defaults.debugShowBody,this.debugShowVelocity=u.defaults.debugShowVelocity,this.debugBodyColor=u.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new s,this.position=new s(d.x-d.scaleX*d.displayOriginX,d.y-d.scaleY*d.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=d.angle,this.preRotation=d.angle,this.width=p,this.height=g,this.sourceWidth=p,this.sourceHeight=g,d.frame&&(this.sourceWidth=d.frame.realWidth,this.sourceHeight=d.frame.realHeight),this.halfWidth=Math.abs(p/2),this.halfHeight=Math.abs(g/2),this.center=new s(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new s,this.newVelocity=new s,this.deltaMax=new s,this.acceleration=new s,this.allowDrag=!0,this.drag=new s,this.allowGravity=!0,this.gravity=new s,this.bounce=new s,this.worldBounce=null,this.customBoundsRectangle=u.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new s(1e4,1e4),this.maxSpeed=-1,this.friction=new s(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=a.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new s(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=h(!1),this.touching=h(!0),this.wasTouching=h(!0),this.blocked=h(!0),this.syncBounds=!1,this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=d.scaleX,this._sy=d.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new e,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var f=this.gameObject,u=this.transform;if(f.parentContainer){var d=f.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);u.x=d.tx,u.y=d.ty,u.rotation=n(d.rotation),u.scaleX=d.scaleX,u.scaleY=d.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY}else u.x=f.x,u.y=f.y,u.rotation=f.angle,u.scaleX=f.scaleX,u.scaleY=f.scaleY,u.displayOriginX=f.displayOriginX,u.displayOriginY=f.displayOriginY;var p=!1;if(this.syncBounds){var g=f.getBounds(this._bounds);this.width=g.width,this.height=g.height,p=!0}else{var x=Math.abs(u.scaleX),y=Math.abs(u.scaleY);(this._sx!==x||this._sy!==y)&&(this.width=this.sourceWidth*x,this.height=this.sourceHeight*y,this._sx=x,this._sy=y,p=!0)}p&&(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 f=this.transform;this.position.x=f.x+f.scaleX*(this.offset.x-f.displayOriginX),this.position.y=f.y+f.scaleY*(this.offset.y-f.displayOriginY),this.updateCenter()},resetFlags:function(f){f===void 0&&(f=!1);var u=this.wasTouching,d=this.touching,p=this.blocked;f?h(!0,u):(u.none=d.none,u.up=d.up,u.down=d.down,u.left=d.left,u.right=d.right),h(!0,d),h(!0,p),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(f,u){if(f&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var d=this.position;this.prev.x=d.x,this.prev.y=d.y,this.prevFrame.x=d.x,this.prevFrame.y=d.y}f&&this.update(u)},update:function(f){var u=this.prev,d=this.position,p=this.velocity;if(u.set(d.x,d.y),!this.moves){this._dx=d.x-u.x,this._dy=d.y-u.y;return}if(this.directControl){var g=this.autoFrame;p.set((d.x-g.x)/f,(d.y-g.y)/f),this.world.updateMotion(this,f),this._dx=d.x-g.x,this._dy=d.y-g.y}else this.world.updateMotion(this,f),this.newVelocity.set(p.x*f,p.y*f),d.add(this.newVelocity),this._dx=d.x-u.x,this._dy=d.y-u.y;var x=p.x,y=p.y;if(this.updateCenter(),this.angle=Math.atan2(y,x),this.speed=Math.sqrt(x*x+y*y),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var C=this.blocked;this.world.emit(r.WORLD_BOUNDS,this,C.up,C.down,C.left,C.right)}},postUpdate:function(){var f=this.position,u=f.x-this.prevFrame.x,d=f.y-this.prevFrame.y,p=this.gameObject;if(this.moves){var g=this.deltaMax.x,x=this.deltaMax.y;g!==0&&u!==0&&(u<0&&u<-g?u=-g:u>0&&u>g&&(u=g)),x!==0&&d!==0&&(d<0&&d<-x?d=-x:d>0&&d>x&&(d=x)),p&&(p.x+=u,p.y+=d)}u<0?this.facing=a.FACING_LEFT:u>0&&(this.facing=a.FACING_RIGHT),d<0?this.facing=a.FACING_UP:d>0&&(this.facing=a.FACING_DOWN),this.allowRotation&&p&&(p.angle+=this.deltaZ()),this._tx=u,this._ty=d,this.autoFrame.set(f.x,f.y)},setBoundsRectangle:function(f){return this.customBoundsRectangle=f||this.world.bounds,this},checkWorldBounds:function(){var f=this.position,u=this.velocity,d=this.blocked,p=this.customBoundsRectangle,g=this.world.checkCollision,x=this.worldBounce?-this.worldBounce.x:-this.bounce.x,y=this.worldBounce?-this.worldBounce.y:-this.bounce.y,C=!1;return f.xp.right&&g.right&&(f.x=p.right-this.width,u.x*=x,d.right=!0,C=!0),f.yp.bottom&&g.down&&(f.y=p.bottom-this.height,u.y*=y,d.down=!0,C=!0),C&&(this.blocked.none=!1,this.updateCenter()),C},setOffset:function(f,u){return u===void 0&&(u=f),this.offset.set(f,u),this},setGameObject:function(f,u){return u===void 0&&(u=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=f,f.body&&(f.body=this),this.setSize(),this.world.add(this),this.enable=u,this},setSize:function(f,u,d){d===void 0&&(d=!0);var p=this.gameObject;if(p&&(!f&&p.frame&&(f=p.frame.realWidth),!u&&p.frame&&(u=p.frame.realHeight)),this.sourceWidth=f,this.sourceHeight=u,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(),d&&p&&p.getCenter){var g=(p.width-f)/2,x=(p.height-u)/2;this.offset.set(g,x)}return this.isCircle=!1,this.radius=0,this},setCircle:function(f,u,d){return u===void 0&&(u=this.offset.x),d===void 0&&(d=this.offset.y),f>0?(this.isCircle=!0,this.radius=f,this.sourceWidth=f*2,this.sourceHeight=f*2,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(u,d),this.updateCenter()):this.isCircle=!1,this},reset:function(f,u){this.stop();var d=this.gameObject;d&&(d.setPosition(f,u),this.rotation=d.angle,this.preRotation=d.angle);var p=this.position;d&&d.getTopLeft?d.getTopLeft(p):p.set(f,u),this.prev.copy(p),this.prevFrame.copy(p),this.autoFrame.copy(p),d&&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(f){return f.x=this.x,f.y=this.y,f.right=this.right,f.bottom=this.bottom,f},hitTest:function(f,u){if(!this.isCircle)return i(this,f,u);if(this.radius>0&&f>=this.left&&f<=this.right&&u>=this.top&&u<=this.bottom){var d=(this.center.x-f)*(this.center.x-f),p=(this.center.y-u)*(this.center.y-u);return d+p<=this.radius*this.radius}return!1},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(f){var u=this.position,d=u.x+this.halfWidth,p=u.y+this.halfHeight;this.debugShowBody&&(f.lineStyle(f.defaultStrokeWidth,this.debugBodyColor),this.isCircle?f.strokeCircle(d,p,this.width/2):(this.checkCollision.up&&f.lineBetween(u.x,u.y,u.x+this.width,u.y),this.checkCollision.right&&f.lineBetween(u.x+this.width,u.y,u.x+this.width,u.y+this.height),this.checkCollision.down&&f.lineBetween(u.x,u.y+this.height,u.x+this.width,u.y+this.height),this.checkCollision.left&&f.lineBetween(u.x,u.y,u.x,u.y+this.height))),this.debugShowVelocity&&(f.lineStyle(f.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),f.lineBetween(d,p,d+this.velocity.x/2,p+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(f){return f===void 0&&(f=!0),this.directControl=f,this},setCollideWorldBounds:function(f,u,d,p){f===void 0&&(f=!0),this.collideWorldBounds=f;var g=u!==void 0,x=d!==void 0;return(g||x)&&(this.worldBounce||(this.worldBounce=new s),g&&(this.worldBounce.x=u),x&&(this.worldBounce.y=d)),p!==void 0&&(this.onWorldBounds=p),this},setVelocity:function(f,u){return this.velocity.set(f,u),f=this.velocity.x,u=this.velocity.y,this.speed=Math.sqrt(f*f+u*u),this},setVelocityX:function(f){return this.setVelocity(f,this.velocity.y)},setVelocityY:function(f){return this.setVelocity(this.velocity.x,f)},setMaxVelocity:function(f,u){return this.maxVelocity.set(f,u),this},setMaxVelocityX:function(f){return this.maxVelocity.x=f,this},setMaxVelocityY:function(f){return this.maxVelocity.y=f,this},setMaxSpeed:function(f){return this.maxSpeed=f,this},setSlideFactor:function(f,u){return this.slideFactor.set(f,u),this},setBounce:function(f,u){return this.bounce.set(f,u),this},setBounceX:function(f){return this.bounce.x=f,this},setBounceY:function(f){return this.bounce.y=f,this},setAcceleration:function(f,u){return this.acceleration.set(f,u),this},setAccelerationX:function(f){return this.acceleration.x=f,this},setAccelerationY:function(f){return this.acceleration.y=f,this},setAllowDrag:function(f){return f===void 0&&(f=!0),this.allowDrag=f,this},setAllowGravity:function(f){return f===void 0&&(f=!0),this.allowGravity=f,this},setAllowRotation:function(f){return f===void 0&&(f=!0),this.allowRotation=f,this},setDrag:function(f,u){return this.drag.set(f,u),this},setDamping:function(f){return this.useDamping=f,this},setDragX:function(f){return this.drag.x=f,this},setDragY:function(f){return this.drag.y=f,this},setGravity:function(f,u){return this.gravity.set(f,u),this},setGravityX:function(f){return this.gravity.x=f,this},setGravityY:function(f){return this.gravity.y=f,this},setFriction:function(f,u){return this.friction.set(f,u),this},setFrictionX:function(f){return this.friction.x=f,this},setFrictionY:function(f){return this.friction.y=f,this},setAngularVelocity:function(f){return this.angularVelocity=f,this},setAngularAcceleration:function(f){return this.angularAcceleration=f,this},setAngularDrag:function(f){return this.angularDrag=f,this},setMass:function(f){return this.mass=f,this},setImmovable:function(f){return f===void 0&&(f=!0),this.immovable=f,this},setEnable:function(f){return f===void 0&&(f=!0),this.enable=f,this},processX:function(f,u,d,p){this.x+=f,this.updateCenter(),u!==null&&(this.velocity.x=u*this.slideFactor.x);var g=this.blocked;d&&(g.left=!0,g.none=!1),p&&(g.right=!0,g.none=!1)},processY:function(f,u,d,p){this.y+=f,this.updateCenter(),u!==null&&(this.velocity.y=u*this.slideFactor.y);var g=this.blocked;d&&(g.up=!0,g.none=!1),p&&(g.down=!0,g.none=!1)},x:{get:function(){return this.position.x},set:function(f){this.position.x=f}},y:{get:function(){return this.position.y},set:function(f){this.position.y=f}},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}}});c.exports=l},79342:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4249,11 +4249,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m,t,o,v,a,r,n,e,i,h,s,l,f,u,d,p,g,y=function(I,L,B){m=I,t=L;var N=m.velocity.x,G=t.velocity.x;return o=m.pushable,i=m._dx<0,h=m._dx>0,s=m._dx===0,d=Math.abs(m.right-t.x)<=Math.abs(t.right-m.x),n=G-N*m.bounce.x,v=t.pushable,l=t._dx<0,f=t._dx>0,u=t._dx===0,p=!d,e=N-G*t.bounce.x,g=Math.abs(B),x()},x=function(){return h&&d&&t.blocked.right?(m.processX(-g,n,!1,!0),1):i&&p&&t.blocked.left?(m.processX(g,n,!0),1):f&&p&&m.blocked.right?(t.processX(-g,e,!1,!0),2):l&&d&&m.blocked.left?(t.processX(g,e,!0),2):0},C=function(){var I=m.velocity.x,L=t.velocity.x,B=Math.sqrt(L*L*t.mass/m.mass)*(L>0?1:-1),N=Math.sqrt(I*I*m.mass/t.mass)*(I>0?1:-1),G=(B+N)*.5;return B-=G,N-=G,a=G+B*m.bounce.x,r=G+N*t.bounce.x,i&&p?P(0):l&&d?P(1):h&&d?P(2):f&&p?P(3):!1},P=function(I){if(o&&v)g*=.5,I===0||I===3?(m.processX(g,a),t.processX(-g,r)):(m.processX(-g,a),t.processX(g,r));else if(o&&!v)I===0||I===3?m.processX(g,n,!0):m.processX(-g,n,!1,!0);else if(!o&&v)I===0||I===3?t.processX(-g,e,!1,!0):t.processX(g,e,!0);else{var L=g*.5;I===0?u?(m.processX(g,0,!0),t.processX(0,null,!1,!0)):f?(m.processX(L,0,!0),t.processX(-L,0,!1,!0)):(m.processX(L,t.velocity.x,!0),t.processX(-L,null,!1,!0)):I===1?s?(m.processX(0,null,!1,!0),t.processX(g,0,!0)):h?(m.processX(-L,0,!1,!0),t.processX(L,0,!0)):(m.processX(-L,null,!1,!0),t.processX(L,m.velocity.x,!0)):I===2?u?(m.processX(-g,0,!1,!0),t.processX(0,null,!0)):l?(m.processX(-L,0,!1,!0),t.processX(L,0,!0)):(m.processX(-L,t.velocity.x,!1,!0),t.processX(L,null,!0)):I===3&&(s?(m.processX(0,null,!0),t.processX(-g,0,!1,!0)):i?(m.processX(L,0,!0),t.processX(-L,0,!1,!0)):(m.processX(L,t.velocity.y,!0),t.processX(-L,null,!1,!0)))}return!0},M=function(I){I===1?t.velocity.x=0:d?t.processX(g,e,!0):t.processX(-g,e,!1,!0),m.moves&&(t.y+=(m.y-m.prev.y)*m.friction.y,t._dy=t.y-t.prev.y)},w=function(I){I===2?m.velocity.x=0:p?m.processX(g,n,!0):m.processX(-g,n,!1,!0),t.moves&&(m.y+=(t.y-t.prev.y)*t.friction.y,m._dy=m.y-m.prev.y)};c.exports={BlockCheck:x,Check:C,Set:y,Run:P,RunImmovableBody1:M,RunImmovableBody2:w}},47962:c=>{/** + */var m,t,o,v,a,r,n,e,i,h,s,l,f,u,d,p,g,x=function(I,L,B){m=I,t=L;var N=m.velocity.x,G=t.velocity.x;return o=m.pushable,i=m._dx<0,h=m._dx>0,s=m._dx===0,d=Math.abs(m.right-t.x)<=Math.abs(t.right-m.x),n=G-N*m.bounce.x,v=t.pushable,l=t._dx<0,f=t._dx>0,u=t._dx===0,p=!d,e=N-G*t.bounce.x,g=Math.abs(B),y()},y=function(){return h&&d&&t.blocked.right?(m.processX(-g,n,!1,!0),1):i&&p&&t.blocked.left?(m.processX(g,n,!0),1):f&&p&&m.blocked.right?(t.processX(-g,e,!1,!0),2):l&&d&&m.blocked.left?(t.processX(g,e,!0),2):0},C=function(){var I=m.velocity.x,L=t.velocity.x,B=Math.sqrt(L*L*t.mass/m.mass)*(L>0?1:-1),N=Math.sqrt(I*I*m.mass/t.mass)*(I>0?1:-1),G=(B+N)*.5;return B-=G,N-=G,a=G+B*m.bounce.x,r=G+N*t.bounce.x,i&&p?P(0):l&&d?P(1):h&&d?P(2):f&&p?P(3):!1},P=function(I){if(o&&v)g*=.5,I===0||I===3?(m.processX(g,a),t.processX(-g,r)):(m.processX(-g,a),t.processX(g,r));else if(o&&!v)I===0||I===3?m.processX(g,n,!0):m.processX(-g,n,!1,!0);else if(!o&&v)I===0||I===3?t.processX(-g,e,!1,!0):t.processX(g,e,!0);else{var L=g*.5;I===0?u?(m.processX(g,0,!0),t.processX(0,null,!1,!0)):f?(m.processX(L,0,!0),t.processX(-L,0,!1,!0)):(m.processX(L,t.velocity.x,!0),t.processX(-L,null,!1,!0)):I===1?s?(m.processX(0,null,!1,!0),t.processX(g,0,!0)):h?(m.processX(-L,0,!1,!0),t.processX(L,0,!0)):(m.processX(-L,null,!1,!0),t.processX(L,m.velocity.x,!0)):I===2?u?(m.processX(-g,0,!1,!0),t.processX(0,null,!0)):l?(m.processX(-L,0,!1,!0),t.processX(L,0,!0)):(m.processX(-L,t.velocity.x,!1,!0),t.processX(L,null,!0)):I===3&&(s?(m.processX(0,null,!0),t.processX(-g,0,!1,!0)):i?(m.processX(L,0,!0),t.processX(-L,0,!1,!0)):(m.processX(L,t.velocity.y,!0),t.processX(-L,null,!1,!0)))}return!0},M=function(I){I===1?t.velocity.x=0:d?t.processX(g,e,!0):t.processX(-g,e,!1,!0),m.moves&&(t.y+=(m.y-m.prev.y)*m.friction.y,t._dy=t.y-t.prev.y)},w=function(I){I===2?m.velocity.x=0:p?m.processX(g,n,!0):m.processX(-g,n,!1,!0),t.moves&&(m.y+=(t.y-t.prev.y)*t.friction.y,m._dy=m.y-m.prev.y)};c.exports={BlockCheck:y,Check:C,Set:x,Run:P,RunImmovableBody1:M,RunImmovableBody2:w}},47962:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m,t,o,v,a,r,n,e,i,h,s,l,f,u,d,p,g,y=function(I,L,B){m=I,t=L;var N=m.velocity.y,G=t.velocity.y;return o=m.pushable,i=m._dy<0,h=m._dy>0,s=m._dy===0,d=Math.abs(m.bottom-t.y)<=Math.abs(t.bottom-m.y),n=G-N*m.bounce.y,v=t.pushable,l=t._dy<0,f=t._dy>0,u=t._dy===0,p=!d,e=N-G*t.bounce.y,g=Math.abs(B),x()},x=function(){return h&&d&&t.blocked.down?(m.processY(-g,n,!1,!0),1):i&&p&&t.blocked.up?(m.processY(g,n,!0),1):f&&p&&m.blocked.down?(t.processY(-g,e,!1,!0),2):l&&d&&m.blocked.up?(t.processY(g,e,!0),2):0},C=function(){var I=m.velocity.y,L=t.velocity.y,B=Math.sqrt(L*L*t.mass/m.mass)*(L>0?1:-1),N=Math.sqrt(I*I*m.mass/t.mass)*(I>0?1:-1),G=(B+N)*.5;return B-=G,N-=G,a=G+B*m.bounce.y,r=G+N*t.bounce.y,i&&p?P(0):l&&d?P(1):h&&d?P(2):f&&p?P(3):!1},P=function(I){if(o&&v)g*=.5,I===0||I===3?(m.processY(g,a),t.processY(-g,r)):(m.processY(-g,a),t.processY(g,r));else if(o&&!v)I===0||I===3?m.processY(g,n,!0):m.processY(-g,n,!1,!0);else if(!o&&v)I===0||I===3?t.processY(-g,e,!1,!0):t.processY(g,e,!0);else{var L=g*.5;I===0?u?(m.processY(g,0,!0),t.processY(0,null,!1,!0)):f?(m.processY(L,0,!0),t.processY(-L,0,!1,!0)):(m.processY(L,t.velocity.y,!0),t.processY(-L,null,!1,!0)):I===1?s?(m.processY(0,null,!1,!0),t.processY(g,0,!0)):h?(m.processY(-L,0,!1,!0),t.processY(L,0,!0)):(m.processY(-L,null,!1,!0),t.processY(L,m.velocity.y,!0)):I===2?u?(m.processY(-g,0,!1,!0),t.processY(0,null,!0)):l?(m.processY(-L,0,!1,!0),t.processY(L,0,!0)):(m.processY(-L,t.velocity.y,!1,!0),t.processY(L,null,!0)):I===3&&(s?(m.processY(0,null,!0),t.processY(-g,0,!1,!0)):i?(m.processY(L,0,!0),t.processY(-L,0,!1,!0)):(m.processY(L,t.velocity.y,!0),t.processY(-L,null,!1,!0)))}return!0},M=function(I){I===1?t.velocity.y=0:d?t.processY(g,e,!0):t.processY(-g,e,!1,!0),m.moves&&(t.x+=(m.x-m.prev.x)*m.friction.x,t._dx=t.x-t.prev.x)},w=function(I){I===2?m.velocity.y=0:p?m.processY(g,n,!0):m.processY(-g,n,!1,!0),t.moves&&(m.x+=(t.x-t.prev.x)*t.friction.x,m._dx=m.x-m.prev.x)};c.exports={BlockCheck:x,Check:C,Set:y,Run:P,RunImmovableBody1:M,RunImmovableBody2:w}},14087:(c,m,t)=>{/** + */var m,t,o,v,a,r,n,e,i,h,s,l,f,u,d,p,g,x=function(I,L,B){m=I,t=L;var N=m.velocity.y,G=t.velocity.y;return o=m.pushable,i=m._dy<0,h=m._dy>0,s=m._dy===0,d=Math.abs(m.bottom-t.y)<=Math.abs(t.bottom-m.y),n=G-N*m.bounce.y,v=t.pushable,l=t._dy<0,f=t._dy>0,u=t._dy===0,p=!d,e=N-G*t.bounce.y,g=Math.abs(B),y()},y=function(){return h&&d&&t.blocked.down?(m.processY(-g,n,!1,!0),1):i&&p&&t.blocked.up?(m.processY(g,n,!0),1):f&&p&&m.blocked.down?(t.processY(-g,e,!1,!0),2):l&&d&&m.blocked.up?(t.processY(g,e,!0),2):0},C=function(){var I=m.velocity.y,L=t.velocity.y,B=Math.sqrt(L*L*t.mass/m.mass)*(L>0?1:-1),N=Math.sqrt(I*I*m.mass/t.mass)*(I>0?1:-1),G=(B+N)*.5;return B-=G,N-=G,a=G+B*m.bounce.y,r=G+N*t.bounce.y,i&&p?P(0):l&&d?P(1):h&&d?P(2):f&&p?P(3):!1},P=function(I){if(o&&v)g*=.5,I===0||I===3?(m.processY(g,a),t.processY(-g,r)):(m.processY(-g,a),t.processY(g,r));else if(o&&!v)I===0||I===3?m.processY(g,n,!0):m.processY(-g,n,!1,!0);else if(!o&&v)I===0||I===3?t.processY(-g,e,!1,!0):t.processY(g,e,!0);else{var L=g*.5;I===0?u?(m.processY(g,0,!0),t.processY(0,null,!1,!0)):f?(m.processY(L,0,!0),t.processY(-L,0,!1,!0)):(m.processY(L,t.velocity.y,!0),t.processY(-L,null,!1,!0)):I===1?s?(m.processY(0,null,!1,!0),t.processY(g,0,!0)):h?(m.processY(-L,0,!1,!0),t.processY(L,0,!0)):(m.processY(-L,null,!1,!0),t.processY(L,m.velocity.y,!0)):I===2?u?(m.processY(-g,0,!1,!0),t.processY(0,null,!0)):l?(m.processY(-L,0,!1,!0),t.processY(L,0,!0)):(m.processY(-L,t.velocity.y,!1,!0),t.processY(L,null,!0)):I===3&&(s?(m.processY(0,null,!0),t.processY(-g,0,!1,!0)):i?(m.processY(L,0,!0),t.processY(-L,0,!1,!0)):(m.processY(L,t.velocity.y,!0),t.processY(-L,null,!1,!0)))}return!0},M=function(I){I===1?t.velocity.y=0:d?t.processY(g,e,!0):t.processY(-g,e,!1,!0),m.moves&&(t.x+=(m.x-m.prev.x)*m.friction.x,t._dx=t.x-t.prev.x)},w=function(I){I===2?m.velocity.y=0:p?m.processY(g,n,!0):m.processY(-g,n,!1,!0),t.moves&&(m.x+=(t.x-t.prev.x)*t.friction.x,m._dx=m.x-m.prev.x)};c.exports={BlockCheck:y,Check:C,Set:x,Run:P,RunImmovableBody1:M,RunImmovableBody2:w}},14087:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4277,7 +4277,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(55495),v=t(37742),a=t(45319),r=t(83419),n=t(79342),e=t(37747),i=t(20339),h=t(52816),s=t(50792),l=t(63012),f=t(43855),u=t(5470),d=t(94977),p=t(64897),g=t(45170),y=t(96523),x=t(35154),C=t(36383),P=t(25774),M=t(96602),w=t(87841),I=t(59542),L=t(40012),B=t(14087),N=t(89936),G=t(35072),V=t(72624),K=t(2483),j=t(61340),J=t(26099),X=t(15994),Y=new r({Extends:s,initialize:function(z,W){s.call(this),this.scene=z,this.bodies=new G,this.staticBodies=new G,this.pendingDestroy=new G,this.colliders=new P,this.gravity=new J(x(W,"gravity.x",0),x(W,"gravity.y",0)),this.bounds=new w(x(W,"x",0),x(W,"y",0),x(W,"width",z.sys.scale.width),x(W,"height",z.sys.scale.height)),this.checkCollision={up:x(W,"checkCollision.up",!0),down:x(W,"checkCollision.down",!0),left:x(W,"checkCollision.left",!0),right:x(W,"checkCollision.right",!0)},this.fps=x(W,"fps",60),this.fixedStep=x(W,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=x(W,"timeScale",1),this.OVERLAP_BIAS=x(W,"overlapBias",4),this.TILE_BIAS=x(W,"tileBias",16),this.forceX=x(W,"forceX",!1),this.isPaused=x(W,"isPaused",!1),this._total=0,this.drawDebug=x(W,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:x(W,"debugShowBody",!0),debugShowStaticBody:x(W,"debugShowStaticBody",!0),debugShowVelocity:x(W,"debugShowVelocity",!0),bodyDebugColor:x(W,"debugBodyColor",16711935),staticBodyDebugColor:x(W,"debugStaticBodyColor",255),velocityDebugColor:x(W,"debugVelocityColor",65280)},this.maxEntries=x(W,"maxEntries",16),this.useTree=x(W,"useTree",!0),this.tree=new I(this.maxEntries),this.staticTree=new I(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new j,this._tempMatrix2=new j,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(b,z){z===void 0&&(z=e.DYNAMIC_BODY),Array.isArray(b)||(b=[b]);for(var W=0;W=Z;for(this.fixedStep||(H=z*.001,et=!0,this._elapsed=0),W=0;W=Z;)this._elapsed-=Z,this.step(H)}},step:function(b){var z,W,H=this.bodies.entries,Z=H.length;for(z=0;z0){var st=this.tree,rt=this.staticTree;for(W=et.entries,H=W.length,b=0;b-1&&b.velocity.length()>ft&&(b.velocity.normalize().scale(ft),ot=ft),b.speed=ot},separate:function(b,z,W,H,Z){var Q,k,et=!1,st=!0;if(!b.enable||!z.enable||b.checkCollision.none||z.checkCollision.none||!this.intersects(b,z)||W&&W.call(H,b.gameObject,z.gameObject)===!1)return et;if(b.isCircle||z.isCircle){var rt=this.separateCircle(b,z,Z);rt.result?(et=!0,st=!1):(Q=rt.x,k=rt.y,st=!0)}if(st){var ot=!1,ft=!1,at=this.OVERLAP_BIAS;Z?(ot=B(b,z,Z,at,Q),ft=N(b,z,Z,at,k)):this.forceX||Math.abs(this.gravity.y+b.gravity.y)Ct&&(ft=i(vt,At,Ct,ct)-Et):At>pt&&(vtCt&&(ft=i(vt,At,Ct,pt)-Et)),ft*=-1}else ft=b.halfWidth+z.halfWidth-h(Q,k);b.overlapR=ft,z.overlapR=ft;var wt=o(Q,k),Bt=(ft+C.EPSILON)*Math.cos(wt),jt=(ft+C.EPSILON)*Math.sin(wt),zt={overlap:ft,result:!1,x:Bt,y:jt};if(W&&(!at||at&&ft!==0))return zt.result=!0,zt;if(!at&&ft===0||et&&st||b.customSeparateX||z.customSeparateX)return zt.x=void 0,zt.y=void 0,zt;var Yt=!b.pushable&&!z.pushable;if(at){var bt=Q.x-k.x,ne=Q.y-k.y,Qt=Math.sqrt(Math.pow(bt,2)+Math.pow(ne,2)),fe=(k.x-Q.x)/Qt||0,ce=(k.y-Q.y)/Qt||0,Pe=2*(rt.x*fe+rt.y*ce-ot.x*fe-ot.y*ce)/(b.mass+z.mass);(et||st)&&(Pe*=2),et||(rt.x=rt.x-Pe/b.mass*fe,rt.y=rt.y-Pe/b.mass*ce,rt.multiply(b.bounce)),st||(ot.x=ot.x+Pe/z.mass*fe,ot.y=ot.y+Pe/z.mass*ce,ot.multiply(z.bounce)),!et&&!st&&(Bt*=.5,jt*=.5),et||(b.x-=Bt,b.y-=jt,b.updateCenter()),st||(z.x+=Bt,z.y+=jt,z.updateCenter()),zt.result=!0}else!et||b.pushable||Yt?(b.x-=Bt,b.y-=jt,b.updateCenter()):(!st||z.pushable||Yt)&&(z.x+=Bt,z.y+=jt,z.updateCenter()),zt.x=void 0,zt.y=void 0;return zt},intersects:function(b,z){return b===z?!1:!b.isCircle&&!z.isCircle?!(b.right<=z.left||b.bottom<=z.top||b.left>=z.right||b.top>=z.bottom):b.isCircle?z.isCircle?h(b.center,z.center)<=b.halfWidth+z.halfWidth:this.circleBodyIntersects(b,z):this.circleBodyIntersects(z,b)},circleBodyIntersects:function(b,z){var W=a(b.center.x,z.left,z.right),H=a(b.center.y,z.top,z.bottom),Z=(b.center.x-W)*(b.center.x-W),Q=(b.center.y-H)*(b.center.y-H);return Z+Q<=b.halfWidth*b.halfWidth},overlap:function(b,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(b,z,W,H,Z,!0)},collide:function(b,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(b,z,W,H,Z,!1)},collideObjects:function(b,z,W,H,Z,Q){var k,et;b.isParent&&(b.physicsType===void 0||z===void 0||b===z)&&(b=b.children.entries),z&&z.isParent&&z.physicsType===void 0&&(z=z.children.entries);var st=Array.isArray(b),rt=Array.isArray(z);if(this._total=0,!st&&!rt)this.collideHandler(b,z,W,H,Z,Q);else if(!st&&rt)for(k=0;k0},collideHandler:function(b,z,W,H,Z,Q){if(z===void 0&&b.isParent)return this.collideGroupVsGroup(b,b,W,H,Z,Q);if(!b||!z)return!1;if(b.body||b.isBody){if(z.body||z.isBody)return this.collideSpriteVsSprite(b,z,W,H,Z,Q);if(z.isParent)return this.collideSpriteVsGroup(b,z,W,H,Z,Q);if(z.isTilemap)return this.collideSpriteVsTilemapLayer(b,z,W,H,Z,Q)}else if(b.isParent){if(z.body||z.isBody)return this.collideSpriteVsGroup(z,b,W,H,Z,Q);if(z.isParent)return this.collideGroupVsGroup(b,z,W,H,Z,Q);if(z.isTilemap)return this.collideGroupVsTilemapLayer(b,z,W,H,Z,Q)}else if(b.isTilemap){if(z.body||z.isBody)return this.collideSpriteVsTilemapLayer(z,b,W,H,Z,Q);if(z.isParent)return this.collideGroupVsTilemapLayer(z,b,W,H,Z,Q)}},canCollide:function(b,z){return b&&z&&(b.collisionMask&z.collisionCategory)!==0&&(z.collisionMask&b.collisionCategory)!==0},collideSpriteVsSprite:function(b,z,W,H,Z,Q){var k=b.isBody?b:b.body,et=z.isBody?z:z.body;return this.canCollide(k,et)?(this.separate(k,et,H,Z,Q)&&(W&&W.call(Z,b,z),this._total++),!0):!1},collideSpriteVsGroup:function(b,z,W,H,Z,Q){var k=b.isBody?b:b.body;if(!(z.length===0||!k||!k.enable||k.checkCollision.none||!this.canCollide(k,z))){var et,st,rt;if(this.useTree||z.physicsType===e.STATIC_BODY){var ot=this.treeMinMax;ot.minX=k.left,ot.minY=k.top,ot.maxX=k.right,ot.maxY=k.bottom;var ft=z.physicsType===e.DYNAMIC_BODY?this.tree.search(ot):this.staticTree.search(ot);for(st=ft.length,et=0;et{/** + */var o=t(55495),v=t(37742),a=t(45319),r=t(83419),n=t(79342),e=t(37747),i=t(20339),h=t(52816),s=t(50792),l=t(63012),f=t(43855),u=t(5470),d=t(94977),p=t(64897),g=t(45170),x=t(96523),y=t(35154),C=t(36383),P=t(25774),M=t(96602),w=t(87841),I=t(59542),L=t(40012),B=t(14087),N=t(89936),G=t(35072),V=t(72624),K=t(2483),j=t(61340),J=t(26099),X=t(15994),Y=new r({Extends:s,initialize:function(z,W){s.call(this),this.scene=z,this.bodies=new G,this.staticBodies=new G,this.pendingDestroy=new G,this.colliders=new P,this.gravity=new J(y(W,"gravity.x",0),y(W,"gravity.y",0)),this.bounds=new w(y(W,"x",0),y(W,"y",0),y(W,"width",z.sys.scale.width),y(W,"height",z.sys.scale.height)),this.checkCollision={up:y(W,"checkCollision.up",!0),down:y(W,"checkCollision.down",!0),left:y(W,"checkCollision.left",!0),right:y(W,"checkCollision.right",!0)},this.fps=y(W,"fps",60),this.fixedStep=y(W,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(W,"timeScale",1),this.OVERLAP_BIAS=y(W,"overlapBias",4),this.TILE_BIAS=y(W,"tileBias",16),this.forceX=y(W,"forceX",!1),this.isPaused=y(W,"isPaused",!1),this._total=0,this.drawDebug=y(W,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(W,"debugShowBody",!0),debugShowStaticBody:y(W,"debugShowStaticBody",!0),debugShowVelocity:y(W,"debugShowVelocity",!0),bodyDebugColor:y(W,"debugBodyColor",16711935),staticBodyDebugColor:y(W,"debugStaticBodyColor",255),velocityDebugColor:y(W,"debugVelocityColor",65280)},this.maxEntries=y(W,"maxEntries",16),this.useTree=y(W,"useTree",!0),this.tree=new I(this.maxEntries),this.staticTree=new I(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new j,this._tempMatrix2=new j,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(b,z){z===void 0&&(z=e.DYNAMIC_BODY),Array.isArray(b)||(b=[b]);for(var W=0;W=Z;for(this.fixedStep||(H=z*.001,et=!0,this._elapsed=0),W=0;W=Z;)this._elapsed-=Z,this.step(H)}},step:function(b){var z,W,H=this.bodies.entries,Z=H.length;for(z=0;z0){var st=this.tree,rt=this.staticTree;for(W=et.entries,H=W.length,b=0;b-1&&b.velocity.length()>ft&&(b.velocity.normalize().scale(ft),ot=ft),b.speed=ot},separate:function(b,z,W,H,Z){var Q,k,et=!1,st=!0;if(!b.enable||!z.enable||b.checkCollision.none||z.checkCollision.none||!this.intersects(b,z)||W&&W.call(H,b.gameObject,z.gameObject)===!1)return et;if(b.isCircle||z.isCircle){var rt=this.separateCircle(b,z,Z);rt.result?(et=!0,st=!1):(Q=rt.x,k=rt.y,st=!0)}if(st){var ot=!1,ft=!1,at=this.OVERLAP_BIAS;Z?(ot=B(b,z,Z,at,Q),ft=N(b,z,Z,at,k)):this.forceX||Math.abs(this.gravity.y+b.gravity.y)Ct&&(ft=i(vt,At,Ct,ct)-Et):At>pt&&(vtCt&&(ft=i(vt,At,Ct,pt)-Et)),ft*=-1}else ft=b.halfWidth+z.halfWidth-h(Q,k);b.overlapR=ft,z.overlapR=ft;var wt=o(Q,k),Bt=(ft+C.EPSILON)*Math.cos(wt),jt=(ft+C.EPSILON)*Math.sin(wt),zt={overlap:ft,result:!1,x:Bt,y:jt};if(W&&(!at||at&&ft!==0))return zt.result=!0,zt;if(!at&&ft===0||et&&st||b.customSeparateX||z.customSeparateX)return zt.x=void 0,zt.y=void 0,zt;var Yt=!b.pushable&&!z.pushable;if(at){var bt=Q.x-k.x,re=Q.y-k.y,Qt=Math.sqrt(Math.pow(bt,2)+Math.pow(re,2)),de=(k.x-Q.x)/Qt||0,ve=(k.y-Q.y)/Qt||0,Ae=2*(rt.x*de+rt.y*ve-ot.x*de-ot.y*ve)/(b.mass+z.mass);(et||st)&&(Ae*=2),et||(rt.x=rt.x-Ae/b.mass*de,rt.y=rt.y-Ae/b.mass*ve,rt.multiply(b.bounce)),st||(ot.x=ot.x+Ae/z.mass*de,ot.y=ot.y+Ae/z.mass*ve,ot.multiply(z.bounce)),!et&&!st&&(Bt*=.5,jt*=.5),et||(b.x-=Bt,b.y-=jt,b.updateCenter()),st||(z.x+=Bt,z.y+=jt,z.updateCenter()),zt.result=!0}else!et||b.pushable||Yt?(b.x-=Bt,b.y-=jt,b.updateCenter()):(!st||z.pushable||Yt)&&(z.x+=Bt,z.y+=jt,z.updateCenter()),zt.x=void 0,zt.y=void 0;return zt},intersects:function(b,z){return b===z?!1:!b.isCircle&&!z.isCircle?!(b.right<=z.left||b.bottom<=z.top||b.left>=z.right||b.top>=z.bottom):b.isCircle?z.isCircle?h(b.center,z.center)<=b.halfWidth+z.halfWidth:this.circleBodyIntersects(b,z):this.circleBodyIntersects(z,b)},circleBodyIntersects:function(b,z){var W=a(b.center.x,z.left,z.right),H=a(b.center.y,z.top,z.bottom),Z=(b.center.x-W)*(b.center.x-W),Q=(b.center.y-H)*(b.center.y-H);return Z+Q<=b.halfWidth*b.halfWidth},overlap:function(b,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(b,z,W,H,Z,!0)},collide:function(b,z,W,H,Z){return W===void 0&&(W=null),H===void 0&&(H=null),Z===void 0&&(Z=W),this.collideObjects(b,z,W,H,Z,!1)},collideObjects:function(b,z,W,H,Z,Q){var k,et;b.isParent&&(b.physicsType===void 0||z===void 0||b===z)&&(b=b.children.entries),z&&z.isParent&&z.physicsType===void 0&&(z=z.children.entries);var st=Array.isArray(b),rt=Array.isArray(z);if(this._total=0,!st&&!rt)this.collideHandler(b,z,W,H,Z,Q);else if(!st&&rt)for(k=0;k0},collideHandler:function(b,z,W,H,Z,Q){if(z===void 0&&b.isParent)return this.collideGroupVsGroup(b,b,W,H,Z,Q);if(!b||!z)return!1;if(b.body||b.isBody){if(z.body||z.isBody)return this.collideSpriteVsSprite(b,z,W,H,Z,Q);if(z.isParent)return this.collideSpriteVsGroup(b,z,W,H,Z,Q);if(z.isTilemap)return this.collideSpriteVsTilemapLayer(b,z,W,H,Z,Q)}else if(b.isParent){if(z.body||z.isBody)return this.collideSpriteVsGroup(z,b,W,H,Z,Q);if(z.isParent)return this.collideGroupVsGroup(b,z,W,H,Z,Q);if(z.isTilemap)return this.collideGroupVsTilemapLayer(b,z,W,H,Z,Q)}else if(b.isTilemap){if(z.body||z.isBody)return this.collideSpriteVsTilemapLayer(z,b,W,H,Z,Q);if(z.isParent)return this.collideGroupVsTilemapLayer(z,b,W,H,Z,Q)}},canCollide:function(b,z){return b&&z&&(b.collisionMask&z.collisionCategory)!==0&&(z.collisionMask&b.collisionCategory)!==0},collideSpriteVsSprite:function(b,z,W,H,Z,Q){var k=b.isBody?b:b.body,et=z.isBody?z:z.body;return this.canCollide(k,et)?(this.separate(k,et,H,Z,Q)&&(W&&W.call(Z,b,z),this._total++),!0):!1},collideSpriteVsGroup:function(b,z,W,H,Z,Q){var k=b.isBody?b:b.body;if(!(z.length===0||!k||!k.enable||k.checkCollision.none||!this.canCollide(k,z))){var et,st,rt;if(this.useTree||z.physicsType===e.STATIC_BODY){var ot=this.treeMinMax;ot.minX=k.left,ot.minY=k.top,ot.maxX=k.right,ot.maxY=k.bottom;var ft=z.physicsType===e.DYNAMIC_BODY?this.tree.search(ot):this.staticTree.search(ot);for(st=ft.length,et=0;et{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4321,7 +4321,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m={setMass:function(t){return this.body.mass=t,this}};c.exports=m},72441:(c,m,t)=>{var o=t(47956),v=t(96503),a=t(2044),r=t(81491),n=function(e,i,h,s,l,f){var u=o(e,i-s,h-s,2*s,2*s,l,f);if(u.length===0)return u;for(var d=new v(i,h,s),p=new v,g=[],y=0;y{var m=function(t,o,v,a,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var i=[],h=[],s=t.treeMinMax;if(s.minX=o,s.minY=v,s.maxX=o+a,s.maxY=v+r,e&&(h=t.staticTree.search(s)),n&&t.useTree)i=t.tree.search(s);else if(n){var l=t.bodies,f={position:{x:o,y:v},left:o,top:v,right:o+a,bottom:v+r,isCircle:!1},u=t.intersects;l.iterate(function(d){u(d,f)&&i.push(d)})}return h.concat(i)};c.exports=m},62121:c=>{/** + */var m={setMass:function(t){return this.body.mass=t,this}};c.exports=m},72441:(c,m,t)=>{var o=t(47956),v=t(96503),a=t(2044),r=t(81491),n=function(e,i,h,s,l,f){var u=o(e,i-s,h-s,2*s,2*s,l,f);if(u.length===0)return u;for(var d=new v(i,h,s),p=new v,g=[],x=0;x{var m=function(t,o,v,a,r,n,e){n===void 0&&(n=!0),e===void 0&&(e=!1);var i=[],h=[],s=t.treeMinMax;if(s.minX=o,s.minY=v,s.maxX=o+a,s.maxY=v+r,e&&(h=t.staticTree.search(s)),n&&t.useTree)i=t.tree.search(s);else if(n){var l=t.bodies,f={position:{x:o,y:v},left:o,top:v,right:o+a,bottom:v+r,isCircle:!1},u=t.intersects;l.iterate(function(d){u(d,f)&&i.push(d)})}return h.concat(i)};c.exports=m},62121:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4397,7 +4397,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(21329),v=t(53442),a=t(2483),r=function(n,e,i,h,s,l,f){var u=h.left,d=h.top,p=h.right,g=h.bottom,y=i.faceLeft||i.faceRight,x=i.faceTop||i.faceBottom;if(f||(y=!0,x=!0),!y&&!x)return!1;var C=0,P=0,M=0,w=1;if(e.deltaAbsX()>e.deltaAbsY()?M=-1:e.deltaAbsX(){/** + */var o=t(21329),v=t(53442),a=t(2483),r=function(n,e,i,h,s,l,f){var u=h.left,d=h.top,p=h.right,g=h.bottom,x=i.faceLeft||i.faceRight,y=i.faceTop||i.faceBottom;if(f||(x=!0,y=!0),!x&&!y)return!1;var C=0,P=0,M=0,w=1;if(e.deltaAbsX()>e.deltaAbsY()?M=-1:e.deltaAbsX(){/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4429,7 +4429,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(66280),v=t(83419),a=t(74116),r=t(48140),n=t(74058),e=t(75803),i=t(23181),h=t(34803),s=t(73834),l=t(19496),f=t(85791),u=t(98713),d=t(41598),p=new v({initialize:function(y){this.world=y,this.scene=y.scene,this.sys=y.scene.sys},rectangle:function(g,y,x,C,P){var M=o.rectangle(g,y,x,C,P);return this.world.add(M),M},trapezoid:function(g,y,x,C,P,M){var w=o.trapezoid(g,y,x,C,P,M);return this.world.add(w),w},circle:function(g,y,x,C,P){var M=o.circle(g,y,x,C,P);return this.world.add(M),M},polygon:function(g,y,x,C,P){var M=o.polygon(g,y,x,C,P);return this.world.add(M),M},fromVertices:function(g,y,x,C,P,M,w){typeof x=="string"&&(x=d.fromPath(x));var I=o.fromVertices(g,y,x,C,P,M,w);return this.world.add(I),I},fromPhysicsEditor:function(g,y,x,C,P){P===void 0&&(P=!0);var M=l.parseBody(g,y,x,C);return P&&!this.world.has(M)&&this.world.add(M),M},fromSVG:function(g,y,x,C,P,M){C===void 0&&(C=1),P===void 0&&(P={}),M===void 0&&(M=!0);for(var w=x.getElementsByTagName("path"),I=[],L=0;L{/** + */var o=t(66280),v=t(83419),a=t(74116),r=t(48140),n=t(74058),e=t(75803),i=t(23181),h=t(34803),s=t(73834),l=t(19496),f=t(85791),u=t(98713),d=t(41598),p=new v({initialize:function(x){this.world=x,this.scene=x.scene,this.sys=x.scene.sys},rectangle:function(g,x,y,C,P){var M=o.rectangle(g,x,y,C,P);return this.world.add(M),M},trapezoid:function(g,x,y,C,P,M){var w=o.trapezoid(g,x,y,C,P,M);return this.world.add(w),w},circle:function(g,x,y,C,P){var M=o.circle(g,x,y,C,P);return this.world.add(M),M},polygon:function(g,x,y,C,P){var M=o.polygon(g,x,y,C,P);return this.world.add(M),M},fromVertices:function(g,x,y,C,P,M,w){typeof y=="string"&&(y=d.fromPath(y));var I=o.fromVertices(g,x,y,C,P,M,w);return this.world.add(I),I},fromPhysicsEditor:function(g,x,y,C,P){P===void 0&&(P=!0);var M=l.parseBody(g,x,y,C);return P&&!this.world.has(M)&&this.world.add(M),M},fromSVG:function(g,x,y,C,P,M){C===void 0&&(C=1),P===void 0&&(P={}),M===void 0&&(M=!0);for(var w=y.getElementsByTagName("path"),I=[],L=0;L{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4437,25 +4437,25 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(31884),a=t(95643),r=t(95540),n=t(88571),e=t(72699),i=t(26099),h=new o({Extends:n,Mixins:[v.Bounce,v.Collision,v.Force,v.Friction,v.Gravity,v.Mass,v.Sensor,v.SetBody,v.Sleep,v.Static,v.Transform,v.Velocity,e],initialize:function(l,f,u,d,p,g){a.call(this,l.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(d,p),this.setSizeToFrame(),this.setOrigin(),this.world=l,this._tempVec2=new i(f,u);var y=r(g,"shape",null);y?this.setBody(y,g):this.setRectangle(this.width,this.height,g),this.setPosition(f,u),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=h},42045:(c,m,t)=>{/** + */var o=t(83419),v=t(31884),a=t(95643),r=t(95540),n=t(88571),e=t(72699),i=t(26099),h=new o({Extends:n,Mixins:[v.Bounce,v.Collision,v.Force,v.Friction,v.Gravity,v.Mass,v.Sensor,v.SetBody,v.Sleep,v.Static,v.Transform,v.Velocity,e],initialize:function(l,f,u,d,p,g){a.call(this,l.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(d,p),this.setSizeToFrame(),this.setOrigin(),this.world=l,this._tempVec2=new i(f,u);var x=r(g,"shape",null);x?this.setBody(x,g):this.setRectangle(this.width,this.height,g),this.setPosition(f,u),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=h},42045:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(60461),v=t(66615),a=t(66280),r=t(22562),n=t(68174),e=t(15647),i=t(83419),h=t(52284),s=t(53402),l=t(69351),f=t(74116),u=t(48140),d=t(81388),p=t(20339),g=t(28137),y=t(95540),x=t(35154),C=t(18210),P=t(40178),M=t(6790),w=t(74507),I=t(46975),L=t(4506),B=t(99561),N=t(73832),G=t(37277),V=t(73296),K=t(66272),j=t(44594),J=t(74058),X=t(31725),Y=t(41598),b=t(68243);s.setDecomp(t(55973));var z=new i({initialize:function(H){this.scene=H,this.systems=H.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=r,this.composite=l,this.collision=h,this.detector=d,this.pair=L,this.pairs=B,this.query=V,this.resolver=K,this.constraint=u,this.bodies=a,this.composites=f,this.axes=v,this.bounds=e,this.svg=J,this.vector=X,this.vertices=Y,this.verts=Y,this._tempVec2=X.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(),K._restingThresh=x(this.config,"restingThresh",4),K._restingThreshTangent=x(this.config,"restingThreshTangent",6),K._positionDampen=x(this.config,"positionDampen",.9),K._positionWarming=x(this.config,"positionWarming",.8),K._frictionNormalMultiplier=x(this.config,"frictionNormalMultiplier",5),H.sys.events.once(j.BOOT,this.boot,this),H.sys.events.on(j.START,this.start,this)},boot:function(){this.world=new b(this.scene,this.config),this.add=new g(this.world),this.bodyBounds=new n,this.systems.events.once(j.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new b(this.scene,this.config),this.add=new g(this.world));var W=this.systems.events;W.on(j.UPDATE,this.world.update,this.world),W.on(j.POST_UPDATE,this.world.postUpdate,this.world),W.once(j.SHUTDOWN,this.shutdown,this)},getConfig:function(){var W=this.systems.game.config.physics,H=this.systems.settings.physics,Z=I(y(H,"matter",{}),y(W,"matter",{}));return Z},enableAttractorPlugin:function(){return N.register(C),N.use(M,C),this},enableWrapPlugin:function(){return N.register(w),N.use(M,w),this},enableCollisionEventsPlugin:function(){return N.register(P),N.use(M,P),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(W,H){this.world.step(W,H)},containsPoint:function(W,H,Z){W=this.getMatterBodies(W);var Q=X.create(H,Z),k=V.point(W,Q);return k.length>0},intersectPoint:function(W,H,Z){Z=this.getMatterBodies(Z);var Q=X.create(W,H),k=[],et=V.point(Z,Q);return et.forEach(function(st){k.indexOf(st)===-1&&k.push(st)}),k},intersectRect:function(W,H,Z,Q,k,et){k===void 0&&(k=!1),et=this.getMatterBodies(et);var st={min:{x:W,y:H},max:{x:W+Z,y:H+Q}},rt=[],ot=V.region(et,st,k);return ot.forEach(function(ft){rt.indexOf(ft)===-1&&rt.push(ft)}),rt},intersectRay:function(W,H,Z,Q,k,et){k===void 0&&(k=1),et=this.getMatterBodies(et);for(var st=[],rt=V.ray(et,X.create(W,H),X.create(Z,Q),k),ot=0;ot{/** + */var o=t(60461),v=t(66615),a=t(66280),r=t(22562),n=t(68174),e=t(15647),i=t(83419),h=t(52284),s=t(53402),l=t(69351),f=t(74116),u=t(48140),d=t(81388),p=t(20339),g=t(28137),x=t(95540),y=t(35154),C=t(18210),P=t(40178),M=t(6790),w=t(74507),I=t(46975),L=t(4506),B=t(99561),N=t(73832),G=t(37277),V=t(73296),K=t(66272),j=t(44594),J=t(74058),X=t(31725),Y=t(41598),b=t(68243);s.setDecomp(t(55973));var z=new i({initialize:function(H){this.scene=H,this.systems=H.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=r,this.composite=l,this.collision=h,this.detector=d,this.pair=L,this.pairs=B,this.query=V,this.resolver=K,this.constraint=u,this.bodies=a,this.composites=f,this.axes=v,this.bounds=e,this.svg=J,this.vector=X,this.vertices=Y,this.verts=Y,this._tempVec2=X.create(),y(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),y(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),y(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),K._restingThresh=y(this.config,"restingThresh",4),K._restingThreshTangent=y(this.config,"restingThreshTangent",6),K._positionDampen=y(this.config,"positionDampen",.9),K._positionWarming=y(this.config,"positionWarming",.8),K._frictionNormalMultiplier=y(this.config,"frictionNormalMultiplier",5),H.sys.events.once(j.BOOT,this.boot,this),H.sys.events.on(j.START,this.start,this)},boot:function(){this.world=new b(this.scene,this.config),this.add=new g(this.world),this.bodyBounds=new n,this.systems.events.once(j.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new b(this.scene,this.config),this.add=new g(this.world));var W=this.systems.events;W.on(j.UPDATE,this.world.update,this.world),W.on(j.POST_UPDATE,this.world.postUpdate,this.world),W.once(j.SHUTDOWN,this.shutdown,this)},getConfig:function(){var W=this.systems.game.config.physics,H=this.systems.settings.physics,Z=I(x(H,"matter",{}),x(W,"matter",{}));return Z},enableAttractorPlugin:function(){return N.register(C),N.use(M,C),this},enableWrapPlugin:function(){return N.register(w),N.use(M,w),this},enableCollisionEventsPlugin:function(){return N.register(P),N.use(M,P),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(W,H){this.world.step(W,H)},containsPoint:function(W,H,Z){W=this.getMatterBodies(W);var Q=X.create(H,Z),k=V.point(W,Q);return k.length>0},intersectPoint:function(W,H,Z){Z=this.getMatterBodies(Z);var Q=X.create(W,H),k=[],et=V.point(Z,Q);return et.forEach(function(st){k.indexOf(st)===-1&&k.push(st)}),k},intersectRect:function(W,H,Z,Q,k,et){k===void 0&&(k=!1),et=this.getMatterBodies(et);var st={min:{x:W,y:H},max:{x:W+Z,y:H+Q}},rt=[],ot=V.region(et,st,k);return ot.forEach(function(ft){rt.indexOf(ft)===-1&&rt.push(ft)}),rt},intersectRay:function(W,H,Z,Q,k,et){k===void 0&&(k=1),et=this.getMatterBodies(et);for(var st=[],rt=V.ray(et,X.create(W,H),X.create(Z,Q),k),ot=0;ot{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(9674),v=t(83419),a=t(31884),r=t(95643),n=t(95540),e=t(72699),i=t(68287),h=t(26099),s=new v({Extends:i,Mixins:[a.Bounce,a.Collision,a.Force,a.Friction,a.Gravity,a.Mass,a.Sensor,a.SetBody,a.Sleep,a.Static,a.Transform,a.Velocity,e],initialize:function(f,u,d,p,g,y){r.call(this,f.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new o(this),this.setTexture(p,g),this.setSizeToFrame(),this.setOrigin(),this.world=f,this._tempVec2=new h(u,d);var x=n(y,"shape",null);x?this.setBody(x,y):this.setRectangle(this.width,this.height,y),this.setPosition(u,d),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=s},73834:(c,m,t)=>{/** + */var o=t(9674),v=t(83419),a=t(31884),r=t(95643),n=t(95540),e=t(72699),i=t(68287),h=t(26099),s=new v({Extends:i,Mixins:[a.Bounce,a.Collision,a.Force,a.Friction,a.Gravity,a.Mass,a.Sensor,a.SetBody,a.Sleep,a.Static,a.Transform,a.Velocity,e],initialize:function(f,u,d,p,g,x){r.call(this,f.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new o(this),this.setTexture(p,g),this.setSizeToFrame(),this.setOrigin(),this.world=f,this._tempVec2=new h(u,d);var y=n(x,"shape",null);y?this.setBody(y,x):this.setRectangle(this.width,this.height,x),this.setPosition(u,d),this.initPipeline(),this.initPostPipeline(!0)}});c.exports=s},73834:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(66280),v=t(22562),a=t(83419),r=t(31884),n=t(62644),e=t(50792),i=t(95540),h=t(97022),s=t(41598),l=new a({Extends:e,Mixins:[r.Bounce,r.Collision,r.Friction,r.Gravity,r.Mass,r.Sensor,r.Sleep,r.Static],initialize:function(u,d,p){e.call(this),this.tile=d,this.world=u,d.physics.matterBody&&d.physics.matterBody.destroy(),d.physics.matterBody=this;var g=i(p,"body",null),y=i(p,"addToWorld",!0);if(g)this.setBody(g,y);else{var x=d.getCollisionGroup(),C=i(x,"objects",[]);C.length>0?this.setFromTileCollision(p):this.setFromTileRectangle(p)}if(d.flipX||d.flipY){var P={x:d.getCenterX(),y:d.getCenterY()},M=d.flipX?-1:1,w=d.flipY?-1:1;v.scale(g,M,w,P)}},setFromTileRectangle:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);var u=this.tile.getBounds(),d=u.x+u.width/2,p=u.y+u.height/2,g=o.rectangle(d,p,u.width,u.height,f);return this.setBody(g,f.addToWorld),this},setFromTileCollision:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);for(var u=this.tile.tilemapLayer.scaleX,d=this.tile.tilemapLayer.scaleY,p=this.tile.getLeft(),g=this.tile.getTop(),y=this.tile.getCollisionGroup(),x=i(y,"objects",[]),C=[],P=0;P1){var J=n(f);J.parts=C,this.setBody(v.create(J),J.addToWorld)}return this},setBody:function(f,u){return u===void 0&&(u=!0),this.body&&this.removeBody(),this.body=f,this.body.gameObject=this,u&&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()}});c.exports=l},19496:(c,m,t)=>{/** + */var o=t(66280),v=t(22562),a=t(83419),r=t(31884),n=t(62644),e=t(50792),i=t(95540),h=t(97022),s=t(41598),l=new a({Extends:e,Mixins:[r.Bounce,r.Collision,r.Friction,r.Gravity,r.Mass,r.Sensor,r.Sleep,r.Static],initialize:function(u,d,p){e.call(this),this.tile=d,this.world=u,d.physics.matterBody&&d.physics.matterBody.destroy(),d.physics.matterBody=this;var g=i(p,"body",null),x=i(p,"addToWorld",!0);if(g)this.setBody(g,x);else{var y=d.getCollisionGroup(),C=i(y,"objects",[]);C.length>0?this.setFromTileCollision(p):this.setFromTileRectangle(p)}if(d.flipX||d.flipY){var P={x:d.getCenterX(),y:d.getCenterY()},M=d.flipX?-1:1,w=d.flipY?-1:1;v.scale(g,M,w,P)}},setFromTileRectangle:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);var u=this.tile.getBounds(),d=u.x+u.width/2,p=u.y+u.height/2,g=o.rectangle(d,p,u.width,u.height,f);return this.setBody(g,f.addToWorld),this},setFromTileCollision:function(f){f===void 0&&(f={}),h(f,"isStatic")||(f.isStatic=!0),h(f,"addToWorld")||(f.addToWorld=!0);for(var u=this.tile.tilemapLayer.scaleX,d=this.tile.tilemapLayer.scaleY,p=this.tile.getLeft(),g=this.tile.getTop(),x=this.tile.getCollisionGroup(),y=i(x,"objects",[]),C=[],P=0;P1){var J=n(f);J.parts=C,this.setBody(v.create(J),J.addToWorld)}return this},setBody:function(f,u){return u===void 0&&(u=!0),this.body&&this.removeBody(),this.body=f,this.body.gameObject=this,u&&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()}});c.exports=l},19496:(c,m,t)=>{/** * @author Joachim Grill * @author Richard Davey * @copyright 2018 CodeAndWeb GmbH * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(66280),v=t(22562),a=t(53402),r=t(95540),n=t(41598),e={parseBody:function(i,h,s,l){l===void 0&&(l={});for(var f=r(s,"fixtures",[]),u=[],d=0;d{/** + */var o=t(66280),v=t(22562),a=t(53402),r=t(95540),n=t(41598),e={parseBody:function(i,h,s,l){l===void 0&&(l={});for(var f=r(s,"fixtures",[]),u=[],d=0;d{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4463,11 +4463,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(15647),v=t(83419),a=t(69351),r=t(48140),n=t(81388),e=t(1121),i=t(8214),h=t(46975),s=t(53614),l=t(26099),f=t(41598),u=new v({initialize:function(p,g,y){y===void 0&&(y={});var x={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.scene=p,this.world=g,this.camera=null,this.pointer=null,this.active=!0,this.position=new l,this.body=null,this.part=null,this.constraint=r.create(h(y,x)),this.world.on(e.BEFORE_UPDATE,this.update,this),p.sys.input.on(i.POINTER_DOWN,this.onDown,this),p.sys.input.on(i.POINTER_UP,this.onUp,this)},onDown:function(d){this.pointer||(this.pointer=d,this.camera=d.camera)},onUp:function(d){d===this.pointer&&(this.pointer=null)},getBody:function(d){var p=this.position,g=this.constraint;this.camera.getWorldPoint(d.x,d.y,p);for(var y=a.allBodies(this.world.localWorld),x=0;x1?1:0,C=x;C{/** + */var o=t(15647),v=t(83419),a=t(69351),r=t(48140),n=t(81388),e=t(1121),i=t(8214),h=t(46975),s=t(53614),l=t(26099),f=t(41598),u=new v({initialize:function(p,g,x){x===void 0&&(x={});var y={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.scene=p,this.world=g,this.camera=null,this.pointer=null,this.active=!0,this.position=new l,this.body=null,this.part=null,this.constraint=r.create(h(x,y)),this.world.on(e.BEFORE_UPDATE,this.update,this),p.sys.input.on(i.POINTER_DOWN,this.onDown,this),p.sys.input.on(i.POINTER_UP,this.onUp,this)},onDown:function(d){this.pointer||(this.pointer=d,this.camera=d.camera)},onUp:function(d){d===this.pointer&&(this.pointer=null)},getBody:function(d){var p=this.position,g=this.constraint;this.camera.getWorldPoint(d.x,d.y,p);for(var x=a.allBodies(this.world.localWorld),y=0;y1?1:0,C=y;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(66280),v=t(22562),a=t(83419),r=t(53402),n=t(69351),e=t(48413),i=t(50792),h=t(1121),s=t(95540),l=t(35154),f=t(22562),u=t(35810),d=t(73834),p=t(4372),g=t(31725),y=new a({Extends:i,initialize:function(C,P){i.call(this),this.scene=C,this.engine=e.create(P),this.localWorld=this.engine.world;var M=l(P,"gravity",null);M?this.setGravity(M.x,M.y,M.scale):M===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=l(P,"enabled",!0),this.getDelta=l(P,"getDelta",this.update60Hz);var w=s(P,"runner",{}),I=s(w,"fps",!1),L=s(w,"fps",60),B=s(w,"delta",1e3/L),N=s(w,"deltaMin",1e3/L),G=s(w,"deltaMax",1e3/(L*.5));I||(L=1e3/B),this.runner={fps:L,deltaSampleSize:s(w,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:s(w,"isFixed",!1),delta:B,deltaMin:N,deltaMax:G},this.autoUpdate=l(P,"autoUpdate",!0);var V=l(P,"debug",!1);if(this.drawDebug=typeof V=="object"?!0:V,this.debugGraphic,this.debugConfig={showAxes:s(V,"showAxes",!1),showAngleIndicator:s(V,"showAngleIndicator",!1),angleColor:s(V,"angleColor",15208787),showBroadphase:s(V,"showBroadphase",!1),broadphaseColor:s(V,"broadphaseColor",16757760),showBounds:s(V,"showBounds",!1),boundsColor:s(V,"boundsColor",16777215),showVelocity:s(V,"showVelocity",!1),velocityColor:s(V,"velocityColor",44783),showCollisions:s(V,"showCollisions",!1),collisionColor:s(V,"collisionColor",16094476),showSeparations:s(V,"showSeparations",!1),separationColor:s(V,"separationColor",16753920),showBody:s(V,"showBody",!0),showStaticBody:s(V,"showStaticBody",!0),showInternalEdges:s(V,"showInternalEdges",!1),renderFill:s(V,"renderFill",!1),renderLine:s(V,"renderLine",!0),fillColor:s(V,"fillColor",1075465),fillOpacity:s(V,"fillOpacity",1),lineColor:s(V,"lineColor",2678297),lineOpacity:s(V,"lineOpacity",1),lineThickness:s(V,"lineThickness",1),staticFillColor:s(V,"staticFillColor",857979),staticLineColor:s(V,"staticLineColor",1255396),showSleeping:s(V,"showSleeping",!1),staticBodySleepOpacity:s(V,"staticBodySleepOpacity",.7),sleepFillColor:s(V,"sleepFillColor",4605510),sleepLineColor:s(V,"sleepLineColor",10066585),showSensors:s(V,"showSensors",!0),sensorFillColor:s(V,"sensorFillColor",857979),sensorLineColor:s(V,"sensorLineColor",1255396),showPositions:s(V,"showPositions",!0),positionSize:s(V,"positionSize",4),positionColor:s(V,"positionColor",14697178),showJoint:s(V,"showJoint",!0),jointColor:s(V,"jointColor",14737474),jointLineOpacity:s(V,"jointLineOpacity",1),jointLineThickness:s(V,"jointLineThickness",2),pinSize:s(V,"pinSize",4),pinColor:s(V,"pinColor",4382944),springColor:s(V,"springColor",14697184),anchorColor:s(V,"anchorColor",15724527),anchorSize:s(V,"anchorSize",4),showConvexHulls:s(V,"showConvexHulls",!1),hullColor:s(V,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),s(P,"setBounds",!1)){var K=P.setBounds;if(typeof K=="boolean")this.setBounds();else{var j=s(K,"x",0),J=s(K,"y",0),X=s(K,"width",C.sys.scale.width),Y=s(K,"height",C.sys.scale.height),b=s(K,"thickness",64),z=s(K,"left",!0),W=s(K,"right",!0),H=s(K,"top",!0),Z=s(K,"bottom",!0);this.setBounds(j,J,X,Y,b,z,W,H,Z)}}},setCompositeRenderStyle:function(x){var C=x.bodies,P=x.constraints,M=x.composites,w,I,L;for(w=0;w0&&(I=w[0].bodyA,L=w[0].bodyB),x.emit(h.COLLISION_START,M,I,L)}),u.on(C,"collisionActive",function(M){var w=M.pairs,I,L;w.length>0&&(I=w[0].bodyA,L=w[0].bodyB),x.emit(h.COLLISION_ACTIVE,M,I,L)}),u.on(C,"collisionEnd",function(M){var w=M.pairs,I,L;w.length>0&&(I=w[0].bodyA,L=w[0].bodyB),x.emit(h.COLLISION_END,M,I,L)})},setBounds:function(x,C,P,M,w,I,L,B,N){return x===void 0&&(x=0),C===void 0&&(C=0),P===void 0&&(P=this.scene.sys.scale.width),M===void 0&&(M=this.scene.sys.scale.height),w===void 0&&(w=64),I===void 0&&(I=!0),L===void 0&&(L=!0),B===void 0&&(B=!0),N===void 0&&(N=!0),this.updateWall(I,"left",x-w,C-w,w,M+w*2),this.updateWall(L,"right",x+P,C-w,w,M+w*2),this.updateWall(B,"top",x,C-w,P,w),this.updateWall(N,"bottom",x,C+M,P,w),this},updateWall:function(x,C,P,M,w,I){var L=this.walls[C];x?(L&&p.remove(this.localWorld,L),P+=w/2,M+=I/2,this.walls[C]=this.create(P,M,w,I,{isStatic:!0,friction:0,frictionStatic:0})):(L&&p.remove(this.localWorld,L),this.walls[C]=null)},createDebugGraphic:function(){var x=this.scene.sys.add.graphics({x:0,y:0});return x.setDepth(Number.MAX_VALUE),this.debugGraphic=x,this.drawDebug=!0,x},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(x,C,P){return x===void 0&&(x=0),C===void 0&&(C=1),P===void 0&&(P=.001),this.localWorld.gravity.x=x,this.localWorld.gravity.y=C,this.localWorld.gravity.scale=P,this},create:function(x,C,P,M,w){var I=o.rectangle(x,C,P,M,w);return p.add(this.localWorld,I),I},add:function(x){return p.add(this.localWorld,x),this},remove:function(x,C){Array.isArray(x)||(x=[x]);for(var P=0;PM.deltaMax?M.deltaMax:C,M.delta=C),M.timeScalePrev=w.timeScale,M.frameCounter+=1,x-M.counterTimestamp>=1e3&&(M.fps=M.frameCounter*((x-M.counterTimestamp)/1e3),M.counterTimestamp=x,M.frameCounter=0),e.update(P,C)}},step:function(x){e.update(this.engine,x)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(x){var C=x.hasOwnProperty("body")?x.body:x;return n.get(this.localWorld,C.id,C.type)!==null},getAllBodies:function(){return n.allBodies(this.localWorld)},getAllConstraints:function(){return n.allConstraints(this.localWorld)},getAllComposites:function(){return n.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var x=this.debugConfig,C=this.engine,P=this.debugGraphic,M=n.allBodies(this.localWorld);this.debugGraphic.clear(),x.showBroadphase&&C.broadphase.controller&&this.renderGrid(C.broadphase,P,x.broadphaseColor,.5),x.showBounds&&this.renderBodyBounds(M,P,x.boundsColor,.5),(x.showBody||x.showStaticBody)&&this.renderBodies(M),x.showJoint&&this.renderJoints(),(x.showAxes||x.showAngleIndicator)&&this.renderBodyAxes(M,P,x.showAxes,x.angleColor,.5),x.showVelocity&&this.renderBodyVelocity(M,P,x.velocityColor,1,2),x.showSeparations&&this.renderSeparations(C.pairs.list,P,x.separationColor),x.showCollisions&&this.renderCollisions(C.pairs.list,P,x.collisionColor)}},renderGrid:function(x,C,P,M){C.lineStyle(1,P,M);for(var w=r.keys(x.buckets),I=0;I0){var V=G[0].vertex.x,K=G[0].vertex.y;G.length===2&&(V=(G[0].vertex.x+G[1].vertex.x)/2,K=(G[0].vertex.y+G[1].vertex.y)/2),N.bodyB===N.supports[0].body||N.bodyA.isStatic?C.lineBetween(V-N.normal.x*8,K-N.normal.y*8,V,K):C.lineBetween(V+N.normal.x*8,K+N.normal.y*8,V,K)}}return this},renderBodyBounds:function(x,C,P,M){C.lineStyle(1,P,M);for(var w=0;w1?1:0;N1?1:0;G1?1:0;G1&&this.renderConvexHull(Y,C,J,W)}}},renderBody:function(x,C,P,M,w,I,L,B){M===void 0&&(M=null),w===void 0&&(w=null),I===void 0&&(I=1),L===void 0&&(L=null),B===void 0&&(B=null);for(var N=this.debugConfig,G=N.sensorFillColor,V=N.sensorLineColor,K=x.parts,j=K.length,J=j>1?1:0;J1){var L=x.vertices;C.lineStyle(M,P),C.beginPath(),C.moveTo(L[0].x,L[0].y);for(var B=1;B0&&(C.fillStyle(L),C.fillCircle(K.x,K.y,B),C.fillCircle(j.x,j.y,B)),this},resetCollisionIDs:function(){return v._nextCollidingGroupId=1,v._nextNonCollidingGroupId=-1,v._nextCategory=1,this},shutdown:function(){u.off(this.engine),this.removeAllListeners(),p.clear(this.localWorld,!1),e.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});c.exports=y},70410:c=>{/** + */var o=t(66280),v=t(22562),a=t(83419),r=t(53402),n=t(69351),e=t(48413),i=t(50792),h=t(1121),s=t(95540),l=t(35154),f=t(22562),u=t(35810),d=t(73834),p=t(4372),g=t(31725),x=new a({Extends:i,initialize:function(C,P){i.call(this),this.scene=C,this.engine=e.create(P),this.localWorld=this.engine.world;var M=l(P,"gravity",null);M?this.setGravity(M.x,M.y,M.scale):M===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=l(P,"enabled",!0),this.getDelta=l(P,"getDelta",this.update60Hz);var w=s(P,"runner",{}),I=s(w,"fps",!1),L=s(w,"fps",60),B=s(w,"delta",1e3/L),N=s(w,"deltaMin",1e3/L),G=s(w,"deltaMax",1e3/(L*.5));I||(L=1e3/B),this.runner={fps:L,deltaSampleSize:s(w,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:s(w,"isFixed",!1),delta:B,deltaMin:N,deltaMax:G},this.autoUpdate=l(P,"autoUpdate",!0);var V=l(P,"debug",!1);if(this.drawDebug=typeof V=="object"?!0:V,this.debugGraphic,this.debugConfig={showAxes:s(V,"showAxes",!1),showAngleIndicator:s(V,"showAngleIndicator",!1),angleColor:s(V,"angleColor",15208787),showBroadphase:s(V,"showBroadphase",!1),broadphaseColor:s(V,"broadphaseColor",16757760),showBounds:s(V,"showBounds",!1),boundsColor:s(V,"boundsColor",16777215),showVelocity:s(V,"showVelocity",!1),velocityColor:s(V,"velocityColor",44783),showCollisions:s(V,"showCollisions",!1),collisionColor:s(V,"collisionColor",16094476),showSeparations:s(V,"showSeparations",!1),separationColor:s(V,"separationColor",16753920),showBody:s(V,"showBody",!0),showStaticBody:s(V,"showStaticBody",!0),showInternalEdges:s(V,"showInternalEdges",!1),renderFill:s(V,"renderFill",!1),renderLine:s(V,"renderLine",!0),fillColor:s(V,"fillColor",1075465),fillOpacity:s(V,"fillOpacity",1),lineColor:s(V,"lineColor",2678297),lineOpacity:s(V,"lineOpacity",1),lineThickness:s(V,"lineThickness",1),staticFillColor:s(V,"staticFillColor",857979),staticLineColor:s(V,"staticLineColor",1255396),showSleeping:s(V,"showSleeping",!1),staticBodySleepOpacity:s(V,"staticBodySleepOpacity",.7),sleepFillColor:s(V,"sleepFillColor",4605510),sleepLineColor:s(V,"sleepLineColor",10066585),showSensors:s(V,"showSensors",!0),sensorFillColor:s(V,"sensorFillColor",857979),sensorLineColor:s(V,"sensorLineColor",1255396),showPositions:s(V,"showPositions",!0),positionSize:s(V,"positionSize",4),positionColor:s(V,"positionColor",14697178),showJoint:s(V,"showJoint",!0),jointColor:s(V,"jointColor",14737474),jointLineOpacity:s(V,"jointLineOpacity",1),jointLineThickness:s(V,"jointLineThickness",2),pinSize:s(V,"pinSize",4),pinColor:s(V,"pinColor",4382944),springColor:s(V,"springColor",14697184),anchorColor:s(V,"anchorColor",15724527),anchorSize:s(V,"anchorSize",4),showConvexHulls:s(V,"showConvexHulls",!1),hullColor:s(V,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),s(P,"setBounds",!1)){var K=P.setBounds;if(typeof K=="boolean")this.setBounds();else{var j=s(K,"x",0),J=s(K,"y",0),X=s(K,"width",C.sys.scale.width),Y=s(K,"height",C.sys.scale.height),b=s(K,"thickness",64),z=s(K,"left",!0),W=s(K,"right",!0),H=s(K,"top",!0),Z=s(K,"bottom",!0);this.setBounds(j,J,X,Y,b,z,W,H,Z)}}},setCompositeRenderStyle:function(y){var C=y.bodies,P=y.constraints,M=y.composites,w,I,L;for(w=0;w0&&(I=w[0].bodyA,L=w[0].bodyB),y.emit(h.COLLISION_START,M,I,L)}),u.on(C,"collisionActive",function(M){var w=M.pairs,I,L;w.length>0&&(I=w[0].bodyA,L=w[0].bodyB),y.emit(h.COLLISION_ACTIVE,M,I,L)}),u.on(C,"collisionEnd",function(M){var w=M.pairs,I,L;w.length>0&&(I=w[0].bodyA,L=w[0].bodyB),y.emit(h.COLLISION_END,M,I,L)})},setBounds:function(y,C,P,M,w,I,L,B,N){return y===void 0&&(y=0),C===void 0&&(C=0),P===void 0&&(P=this.scene.sys.scale.width),M===void 0&&(M=this.scene.sys.scale.height),w===void 0&&(w=64),I===void 0&&(I=!0),L===void 0&&(L=!0),B===void 0&&(B=!0),N===void 0&&(N=!0),this.updateWall(I,"left",y-w,C-w,w,M+w*2),this.updateWall(L,"right",y+P,C-w,w,M+w*2),this.updateWall(B,"top",y,C-w,P,w),this.updateWall(N,"bottom",y,C+M,P,w),this},updateWall:function(y,C,P,M,w,I){var L=this.walls[C];y?(L&&p.remove(this.localWorld,L),P+=w/2,M+=I/2,this.walls[C]=this.create(P,M,w,I,{isStatic:!0,friction:0,frictionStatic:0})):(L&&p.remove(this.localWorld,L),this.walls[C]=null)},createDebugGraphic:function(){var y=this.scene.sys.add.graphics({x:0,y:0});return y.setDepth(Number.MAX_VALUE),this.debugGraphic=y,this.drawDebug=!0,y},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(y,C,P){return y===void 0&&(y=0),C===void 0&&(C=1),P===void 0&&(P=.001),this.localWorld.gravity.x=y,this.localWorld.gravity.y=C,this.localWorld.gravity.scale=P,this},create:function(y,C,P,M,w){var I=o.rectangle(y,C,P,M,w);return p.add(this.localWorld,I),I},add:function(y){return p.add(this.localWorld,y),this},remove:function(y,C){Array.isArray(y)||(y=[y]);for(var P=0;PM.deltaMax?M.deltaMax:C,M.delta=C),M.timeScalePrev=w.timeScale,M.frameCounter+=1,y-M.counterTimestamp>=1e3&&(M.fps=M.frameCounter*((y-M.counterTimestamp)/1e3),M.counterTimestamp=y,M.frameCounter=0),e.update(P,C)}},step:function(y){e.update(this.engine,y)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(y){var C=y.hasOwnProperty("body")?y.body:y;return n.get(this.localWorld,C.id,C.type)!==null},getAllBodies:function(){return n.allBodies(this.localWorld)},getAllConstraints:function(){return n.allConstraints(this.localWorld)},getAllComposites:function(){return n.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var y=this.debugConfig,C=this.engine,P=this.debugGraphic,M=n.allBodies(this.localWorld);this.debugGraphic.clear(),y.showBroadphase&&C.broadphase.controller&&this.renderGrid(C.broadphase,P,y.broadphaseColor,.5),y.showBounds&&this.renderBodyBounds(M,P,y.boundsColor,.5),(y.showBody||y.showStaticBody)&&this.renderBodies(M),y.showJoint&&this.renderJoints(),(y.showAxes||y.showAngleIndicator)&&this.renderBodyAxes(M,P,y.showAxes,y.angleColor,.5),y.showVelocity&&this.renderBodyVelocity(M,P,y.velocityColor,1,2),y.showSeparations&&this.renderSeparations(C.pairs.list,P,y.separationColor),y.showCollisions&&this.renderCollisions(C.pairs.list,P,y.collisionColor)}},renderGrid:function(y,C,P,M){C.lineStyle(1,P,M);for(var w=r.keys(y.buckets),I=0;I0){var V=G[0].vertex.x,K=G[0].vertex.y;G.length===2&&(V=(G[0].vertex.x+G[1].vertex.x)/2,K=(G[0].vertex.y+G[1].vertex.y)/2),N.bodyB===N.supports[0].body||N.bodyA.isStatic?C.lineBetween(V-N.normal.x*8,K-N.normal.y*8,V,K):C.lineBetween(V+N.normal.x*8,K+N.normal.y*8,V,K)}}return this},renderBodyBounds:function(y,C,P,M){C.lineStyle(1,P,M);for(var w=0;w1?1:0;N1?1:0;G1?1:0;G1&&this.renderConvexHull(Y,C,J,W)}}},renderBody:function(y,C,P,M,w,I,L,B){M===void 0&&(M=null),w===void 0&&(w=null),I===void 0&&(I=1),L===void 0&&(L=null),B===void 0&&(B=null);for(var N=this.debugConfig,G=N.sensorFillColor,V=N.sensorLineColor,K=y.parts,j=K.length,J=j>1?1:0;J1){var L=y.vertices;C.lineStyle(M,P),C.beginPath(),C.moveTo(L[0].x,L[0].y);for(var B=1;B0&&(C.fillStyle(L),C.fillCircle(K.x,K.y,B),C.fillCircle(j.x,j.y,B)),this},resetCollisionIDs:function(){return v._nextCollidingGroupId=1,v._nextNonCollidingGroupId=-1,v._nextCategory=1,this},shutdown:function(){u.off(this.engine),this.removeAllListeners(),p.clear(this.localWorld,!1),e.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});c.exports=x},70410:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4499,7 +4499,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(66280),v=t(22562),a=t(43855),r=t(95540),n=t(19496),e=t(85791),i=t(41598),h={setRectangle:function(s,l,f){return this.setBody({type:"rectangle",width:s,height:l},f)},setCircle:function(s,l){return this.setBody({type:"circle",radius:s},l)},setPolygon:function(s,l,f){return this.setBody({type:"polygon",sides:l,radius:s},f)},setTrapezoid:function(s,l,f,u){return this.setBody({type:"trapezoid",width:s,height:l,slope:f},u)},setExistingBody:function(s,l){l===void 0&&(l=!0),this.body&&this.world.remove(this.body,!0),this.body=s;for(var f=0;f{/** + */var o=t(66280),v=t(22562),a=t(43855),r=t(95540),n=t(19496),e=t(85791),i=t(41598),h={setRectangle:function(s,l,f){return this.setBody({type:"rectangle",width:s,height:l},f)},setCircle:function(s,l){return this.setBody({type:"circle",radius:s},l)},setPolygon:function(s,l,f){return this.setBody({type:"polygon",sides:l,radius:s},f)},setTrapezoid:function(s,l,f,u){return this.setBody({type:"trapezoid",width:s,height:l,slope:f},u)},setExistingBody:function(s,l){l===void 0&&(l=!0),this.body&&this.world.remove(this.body,!0),this.body=s;for(var f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4591,14 +4591,14 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={BodyBounds:t(68174),Components:t(31884),Events:t(1121),Factory:t(28137),MatterGameObject:t(75803),Image:t(23181),Matter:t(19933),MatterPhysics:t(42045),PolyDecomp:t(55973),Sprite:t(34803),TileBody:t(73834),PhysicsEditorParser:t(19496),PhysicsJSONParser:t(85791),PointerConstraint:t(98713),World:t(68243)}},22562:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(31725),r=t(53614),n=t(53402),e=t(15647),i=t(66615);(function(){o._timeCorrection=!0,o._inertiaScale=4,o._nextCollidingGroupId=1,o._nextNonCollidingGroupId=-1,o._nextCategory=1,o._baseDelta=16.666666666666668,o.create=function(s){var l={id:n.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:16.666666666666668,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:{}};!s.hasOwnProperty("position")&&s.hasOwnProperty("vertices")?s.position=v.centre(s.vertices):s.hasOwnProperty("vertices")||(l.vertices=v.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var f=n.extend(l,s);return h(f,s),f.setOnCollideWith=function(u,d){return d?this.onCollideWith[u.id]=d:delete this.onCollideWith[u.id],this},f},o.nextGroup=function(s){return s?o._nextNonCollidingGroupId--:o._nextCollidingGroupId++},o.nextCategory=function(){return o._nextCategory=o._nextCategory<<1,o._nextCategory};var h=function(s,l){if(l=l||{},o.set(s,{bounds:s.bounds||e.create(s.vertices),positionPrev:s.positionPrev||a.clone(s.position),anglePrev:s.anglePrev||s.angle,vertices:s.vertices,parts:s.parts||[s],isStatic:s.isStatic,isSleeping:s.isSleeping,parent:s.parent||s}),v.rotate(s.vertices,s.angle,s.position),i.rotate(s.axes,s.angle),e.update(s.bounds,s.vertices,s.velocity),o.set(s,{axes:l.axes||s.axes,area:l.area||s.area,mass:l.mass||s.mass,inertia:l.inertia||s.inertia}),s.parts.length===1){var f=s.bounds,u=s.centerOfMass,d=s.centerOffset,p=f.max.x-f.min.x,g=f.max.y-f.min.y;u.x=-(f.min.x-s.position.x)/p,u.y=-(f.min.y-s.position.y)/g,d.x=p*u.x,d.y=g*u.y}};o.set=function(s,l,f){var u;typeof l=="string"&&(u=l,l={},l[u]=f);for(u in l)if(Object.prototype.hasOwnProperty.call(l,u))switch(f=l[u],u){case"isStatic":o.setStatic(s,f);break;case"isSleeping":r.set(s,f);break;case"mass":o.setMass(s,f);break;case"density":o.setDensity(s,f);break;case"inertia":o.setInertia(s,f);break;case"vertices":o.setVertices(s,f);break;case"position":o.setPosition(s,f);break;case"angle":o.setAngle(s,f);break;case"velocity":o.setVelocity(s,f);break;case"angularVelocity":o.setAngularVelocity(s,f);break;case"speed":o.setSpeed(s,f);break;case"angularSpeed":o.setAngularSpeed(s,f);break;case"parts":o.setParts(s,f);break;case"centre":o.setCentre(s,f);break;default:s[u]=f}},o.setStatic=function(s,l){for(var f=0;f0&&a.rotateAbout(p.position,u,s.position,p.position)}},o.setVelocity=function(s,l){var f=s.deltaTime/o._baseDelta;s.positionPrev.x=s.position.x-l.x*f,s.positionPrev.y=s.position.y-l.y*f,s.velocity.x=(s.position.x-s.positionPrev.x)/f,s.velocity.y=(s.position.y-s.positionPrev.y)/f,s.speed=a.magnitude(s.velocity)},o.getVelocity=function(s){var l=o._baseDelta/s.deltaTime;return{x:(s.position.x-s.positionPrev.x)*l,y:(s.position.y-s.positionPrev.y)*l}},o.getSpeed=function(s){return a.magnitude(o.getVelocity(s))},o.setSpeed=function(s,l){o.setVelocity(s,a.mult(a.normalise(o.getVelocity(s)),l))},o.setAngularVelocity=function(s,l){var f=s.deltaTime/o._baseDelta;s.anglePrev=s.angle-l*f,s.angularVelocity=(s.angle-s.anglePrev)/f,s.angularSpeed=Math.abs(s.angularVelocity)},o.getAngularVelocity=function(s){return(s.angle-s.anglePrev)*o._baseDelta/s.deltaTime},o.getAngularSpeed=function(s){return Math.abs(o.getAngularVelocity(s))},o.setAngularSpeed=function(s,l){o.setAngularVelocity(s,n.sign(o.getAngularVelocity(s))*l)},o.translate=function(s,l,f){o.setPosition(s,a.add(s.position,l),f)},o.rotate=function(s,l,f,u){if(!f)o.setAngle(s,s.angle+l,u);else{var d=Math.cos(l),p=Math.sin(l),g=s.position.x-f.x,y=s.position.y-f.y;o.setPosition(s,{x:f.x+(g*d-y*p),y:f.y+(g*p+y*d)},u),o.setAngle(s,s.angle+l,u)}},o.scale=function(s,l,f,u){var d=0,p=0;u=u||s.position;for(var g=s.inertia===1/0,y=0;y0&&(d+=x.area,p+=x.inertia),x.position.x=u.x+(x.position.x-u.x)*l,x.position.y=u.y+(x.position.y-u.y)*f,e.update(x.bounds,x.vertices,s.velocity)}s.parts.length>1&&(s.area=d,s.isStatic||(o.setMass(s,s.density*d),o.setInertia(s,p))),s.circleRadius&&(l===f?s.circleRadius*=l:s.circleRadius=null),g&&o.setInertia(s,1/0)},o.update=function(s,l){l=(typeof l<"u"?l:16.666666666666668)*s.timeScale;var f=l*l,u=o._timeCorrection?l/(s.deltaTime||l):1,d=1-s.frictionAir*(l/n._baseDelta),p=(s.position.x-s.positionPrev.x)*u,g=(s.position.y-s.positionPrev.y)*u;s.velocity.x=p*d+s.force.x/s.mass*f,s.velocity.y=g*d+s.force.y/s.mass*f,s.positionPrev.x=s.position.x,s.positionPrev.y=s.position.y,s.position.x+=s.velocity.x,s.position.y+=s.velocity.y,s.deltaTime=l,s.angularVelocity=(s.angle-s.anglePrev)*d*u+s.torque/s.inertia*f,s.anglePrev=s.angle,s.angle+=s.angularVelocity,s.speed=a.magnitude(s.velocity),s.angularSpeed=Math.abs(s.angularVelocity);for(var y=0;y0&&(x.position.x+=s.velocity.x,x.position.y+=s.velocity.y),s.angularVelocity!==0&&(v.rotate(x.vertices,s.angularVelocity,s.position),i.rotate(x.axes,s.angularVelocity),y>0&&a.rotateAbout(x.position,s.angularVelocity,s.position,x.position)),e.update(x.bounds,x.vertices,s.velocity)}},o.updateVelocities=function(s){var l=o._baseDelta/s.deltaTime,f=s.velocity;f.x=(s.position.x-s.positionPrev.x)*l,f.y=(s.position.y-s.positionPrev.y)*l,s.speed=Math.sqrt(f.x*f.x+f.y*f.y),s.angularVelocity=(s.angle-s.anglePrev)*l,s.angularSpeed=Math.abs(s.angularVelocity)},o.applyForce=function(s,l,f){var u={x:l.x-s.position.x,y:l.y-s.position.y};s.force.x+=f.x,s.force.y+=f.y,s.torque+=u.x*f.y-u.y*f.x},o._totalProperties=function(s){for(var l={mass:0,area:0,inertia:0,centre:{x:0,y:0}},f=s.parts.length===1?0:1;f{var o={};c.exports=o;var v=t(35810),a=t(53402),r=t(15647),n=t(22562);(function(){o.create=function(e){return a.extend({id:a.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},e)},o.setModified=function(e,i,h,s){if(v.trigger(e,"compositeModified",e),e.isModified=i,i&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),h&&e.parent&&o.setModified(e.parent,i,h,s),s)for(var l=0;l{var o={};c.exports=o;var v=t(69351);(function(){o.create=v.create,o.add=v.add,o.remove=v.remove,o.clear=v.clear,o.addComposite=v.addComposite,o.addBody=v.addBody,o.addConstraint=v.addConstraint})()},52284:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(4506);(function(){var r=[],n={overlap:0,axis:null},e={overlap:0,axis:null};o.create=function(i,h){return{pair:null,collided:!1,bodyA:i,bodyB:h,parentA:i.parent,parentB:h.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},o.collides=function(i,h,s){if(o._overlapAxes(n,i.vertices,h.vertices,i.axes),n.overlap<=0||(o._overlapAxes(e,h.vertices,i.vertices,h.axes),e.overlap<=0))return null;var l=s&&s.table[a.id(i,h)],f;l?f=l.collision:(f=o.create(i,h),f.collided=!0,f.bodyA=i.idX?X=L:LY?Y=L:Lf?f=d:d{var m={};c.exports=m,function(){m.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}}()},81388:(c,m,t)=>{var o={};c.exports=o;var v=t(53402),a=t(52284);(function(){o.create=function(r){var n={bodies:[],pairs:null};return v.extend(n,r)},o.setBodies=function(r,n){r.bodies=n.slice(0)},o.clear=function(r){r.bodies=[]},o.collisions=function(r){var n=[],e=r.pairs,i=r.bodies,h=i.length,s=o.canCollide,l=a.collides,f,u;for(i.sort(o._compareBoundsX),f=0;fg)break;if(!(yI.max.y)&&!(C&&(w.isStatic||w.isSleeping))&&s(d.collisionFilter,w.collisionFilter)){var L=w.parts.length;if(M&&L===1){var B=l(d,w,e);B&&n.push(B)}else for(var N=P>1?1:0,G=L>1?1:0,V=N;VI.max.x||p.max.xI.max.y)){var B=l(K,J,e);B&&n.push(B)}}}}}return n},o.canCollide=function(r,n){return r.group===n.group&&r.group!==0?r.group>0:(r.mask&n.category)!==0&&(n.mask&r.category)!==0},o._compareBoundsX=function(r,n){return r.bounds.min.x-n.bounds.min.x}})()},4506:(c,m,t)=>{var o={};c.exports=o;var v=t(43424);(function(){o.create=function(a,r){var n=a.bodyA,e=a.bodyB,i={id:o.id(n,e),bodyA:n,bodyB:e,collision:a,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||e.isSensor,timeCreated:r,timeUpdated:r,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return o.update(i,a,r),i},o.update=function(a,r,n){var e=a.contacts,i=r.supports,h=a.activeContacts,s=r.parentA,l=r.parentB,f=s.vertices.length;a.isActive=!0,a.timeUpdated=n,a.collision=r,a.separation=r.depth,a.inverseMass=s.inverseMass+l.inverseMass,a.friction=s.frictionl.frictionStatic?s.frictionStatic:l.frictionStatic,a.restitution=s.restitution>l.restitution?s.restitution:l.restitution,a.slop=s.slop>l.slop?s.slop:l.slop,r.pair=a,h.length=0;for(var u=0;u{var o={};c.exports=o;var v=t(4506),a=t(53402);(function(){o.create=function(r){return a.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},r)},o.update=function(r,n,e){var i=r.list,h=i.length,s=r.table,l=n.length,f=r.collisionStart,u=r.collisionEnd,d=r.collisionActive,p,g,y,x;for(f.length=0,u.length=0,d.length=0,x=0;x{var o={};c.exports=o;var v=t(31725),a=t(52284),r=t(15647),n=t(66280),e=t(41598);(function(){o.collides=function(i,h){for(var s=[],l=h.length,f=i.bounds,u=a.collides,d=r.overlaps,p=0;p{var o={};c.exports=o;var v=t(41598),a=t(53402),r=t(15647);(function(){o._restingThresh=2,o._restingThreshTangent=Math.sqrt(6),o._positionDampen=.9,o._positionWarming=.8,o._frictionNormalMultiplier=5,o._frictionMaxStatic=Number.MAX_VALUE,o.preSolvePosition=function(n){var e,i,h,s=n.length;for(e=0;ect?(y=At>0?At:-At,g=P.friction*(At>0?1:-1)*s,g<-y?g=-y:g>y&&(g=y)):(g=At,y=d);var Ct=H*G-Z*N,pt=Q*G-k*N,wt=X/(Y+w.inverseInertia*Ct*Ct+I.inverseInertia*pt*pt),Bt=(1+P.restitution)*vt*wt;if(g*=wt,vt0&&(z.normalImpulse=0),Bt=z.normalImpulse-jt}if(At<-f||At>f)z.tangentImpulse=0;else{var zt=z.tangentImpulse;z.tangentImpulse+=g,z.tangentImpulse<-y&&(z.tangentImpulse=-y),z.tangentImpulse>y&&(z.tangentImpulse=y),g=z.tangentImpulse-zt}var Yt=N*Bt+V*g,bt=G*Bt+K*g;w.isStatic||w.isSleeping||(w.positionPrev.x+=Yt*w.inverseMass,w.positionPrev.y+=bt*w.inverseMass,w.anglePrev+=(H*bt-Z*Yt)*w.inverseInertia),I.isStatic||I.isSleeping||(I.positionPrev.x-=Yt*I.inverseMass,I.positionPrev.y-=bt*I.inverseMass,I.anglePrev-=(Q*bt-k*Yt)*I.inverseInertia)}}}}})()},48140:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(31725),r=t(53614),n=t(15647),e=t(66615),i=t(53402);(function(){o._warming=.4,o._torqueDampen=1,o._minLength=1e-6,o.create=function(h){var s=h;s.bodyA&&!s.pointA&&(s.pointA={x:0,y:0}),s.bodyB&&!s.pointB&&(s.pointB={x:0,y:0});var l=s.bodyA?a.add(s.bodyA.position,s.pointA):s.pointA,f=s.bodyB?a.add(s.bodyB.position,s.pointB):s.pointB,u=a.magnitude(a.sub(l,f));s.length=typeof s.length<"u"?s.length:u,s.id=s.id||i.nextId(),s.label=s.label||"Constraint",s.type="constraint",s.stiffness=s.stiffness||(s.length>0?1:.7),s.damping=s.damping||0,s.angularStiffness=s.angularStiffness||0,s.angleA=s.bodyA?s.bodyA.angle:s.angleA,s.angleB=s.bodyB?s.bodyB.angle:s.angleB,s.plugin={};var d={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return s.length===0&&s.stiffness>.1?(d.type="pin",d.anchors=!1):s.stiffness<.9&&(d.type="spring"),s.render=i.extend(d,s.render),s},o.preSolveAll=function(h){for(var s=0;s=1||h.length===0,M=P?h.stiffness*s:h.stiffness*s*s,w=h.damping*s,I=a.mult(y,C*M),L=(l?l.inverseMass:0)+(f?f.inverseMass:0),B=(l?l.inverseInertia:0)+(f?f.inverseInertia:0),N=L+B,G,V,K,j,J;if(w>0){var X=a.create();K=a.div(y,x),J=a.sub(f&&a.sub(f.position,f.positionPrev)||X,l&&a.sub(l.position,l.positionPrev)||X),j=a.dot(K,J)}l&&!l.isStatic&&(V=l.inverseMass/L,l.constraintImpulse.x-=I.x*V,l.constraintImpulse.y-=I.y*V,l.position.x-=I.x*V,l.position.y-=I.y*V,w>0&&(l.positionPrev.x-=w*K.x*j*V,l.positionPrev.y-=w*K.y*j*V),G=a.cross(u,I)/N*o._torqueDampen*l.inverseInertia*(1-h.angularStiffness),l.constraintImpulse.angle-=G,l.angle-=G),f&&!f.isStatic&&(V=f.inverseMass/L,f.constraintImpulse.x+=I.x*V,f.constraintImpulse.y+=I.y*V,f.position.x+=I.x*V,f.position.y+=I.y*V,w>0&&(f.positionPrev.x+=w*K.x*j*V,f.positionPrev.y+=w*K.y*j*V),G=a.cross(d,I)/N*o._torqueDampen*f.inverseInertia*(1-h.angularStiffness),f.constraintImpulse.angle+=G,f.angle+=G)}}},o.postSolveAll=function(h){for(var s=0;s0&&(d.position.x+=f.x,d.position.y+=f.y),f.angle!==0&&(v.rotate(d.vertices,f.angle,l.position),e.rotate(d.axes,f.angle),u>0&&a.rotateAbout(d.position,f.angle,l.position,d.position)),n.update(d.bounds,d.vertices,l.velocity)}f.angle*=o._warming,f.x*=o._warming,f.y*=o._warming}}},o.pointAWorld=function(h){return{x:(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),y:(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0)}},o.pointBWorld=function(h){return{x:(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),y:(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0)}},o.currentLength=function(h){var s=(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),l=(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0),f=(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),u=(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0),d=s-f,p=l-u;return Math.sqrt(d*d+p*p)}})()},53402:(c,m,t)=>{var o={};c.exports=o,function(){o._baseDelta=16.666666666666668,o._nextId=0,o._seed=0,o._nowStartTime=+new Date,o._warnedOnce={},o._decomp=null,o.extend=function(a,r){var n,e;typeof r=="boolean"?(n=2,e=r):(n=1,e=!0);for(var i=n;i0;r--){var n=Math.floor(o.random()*(r+1)),e=a[r];a[r]=a[n],a[n]=e}return a},o.choose=function(a){return a[Math.floor(o.random()*a.length)]},o.isElement=function(a){return typeof HTMLElement<"u"?a instanceof HTMLElement:!!(a&&a.nodeType&&a.nodeName)},o.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"},o.isFunction=function(a){return typeof a=="function"},o.isPlainObject=function(a){return typeof a=="object"&&a.constructor===Object},o.isString=function(a){return toString.call(a)==="[object String]"},o.clamp=function(a,r,n){return an?n:a},o.sign=function(a){return a<0?-1:1},o.now=function(){if(typeof window<"u"&&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-o._nowStartTime},o.random=function(a,r){return a=typeof a<"u"?a:0,r=typeof r<"u"?r:1,a+v()*(r-a)};var v=function(){return o._seed=(o._seed*9301+49297)%233280,o._seed/233280};o.colorToNumber=function(a){return a=a.replace("#",""),a.length==3&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)),parseInt(a,16)},o.logLevel=1,o.log=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.info=function(){console&&o.logLevel>0&&o.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warn=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warnOnce=function(){var a=Array.prototype.slice.call(arguments).join(" ");o._warnedOnce[a]||(o.warn(a),o._warnedOnce[a]=!0)},o.deprecated=function(a,r,n){a[r]=o.chain(function(){o.warnOnce("🔅 deprecated 🔅",n)},a[r])},o.nextId=function(){return o._nextId++},o.indexOf=function(a,r){if(a.indexOf)return a.indexOf(r);for(var n=0;n{var o={};c.exports=o;var v=t(53614),a=t(66272),r=t(81388),n=t(99561),e=t(35810),i=t(69351),h=t(48140),s=t(53402),l=t(22562);(function(){o.create=function(f){f=f||{};var u={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}},d=s.extend(u,f);return d.world=f.world||i.create({label:"World"}),d.pairs=f.pairs||n.create(),d.detector=f.detector||r.create(),d.grid={buckets:[]},d.world.gravity=d.gravity,d.broadphase=d.grid,d.metrics={},d},o.update=function(f,u){var d=s.now(),p=f.world,g=f.detector,y=f.pairs,x=f.timing,C=x.timestamp,P;u=typeof u<"u"?u:s._baseDelta,u*=x.timeScale,x.timestamp+=u,x.lastDelta=u;var M={timestamp:x.timestamp,delta:u};e.trigger(f,"beforeUpdate",M);var w=i.allBodies(p),I=i.allConstraints(p);for(p.isModified&&(r.setBodies(g,w),i.setModified(p,!1,!1,!0)),f.enableSleeping&&v.update(w,u),o._bodiesApplyGravity(w,f.gravity),u>0&&o._bodiesUpdate(w,u),e.trigger(f,"beforeSolve",M),h.preSolveAll(w),P=0;P0&&e.trigger(f,"collisionStart",{pairs:y.collisionStart,timestamp:x.timestamp,delta:u});var B=s.clamp(20/f.positionIterations,0,1);for(a.preSolvePosition(y.list),P=0;P0&&e.trigger(f,"collisionActive",{pairs:y.collisionActive,timestamp:x.timestamp,delta:u}),y.collisionEnd.length>0&&e.trigger(f,"collisionEnd",{pairs:y.collisionEnd,timestamp:x.timestamp,delta:u}),o._bodiesClearForces(w),e.trigger(f,"afterUpdate",M),f.timing.lastElapsed=s.now()-d,f},o.merge=function(f,u){if(s.extend(f,u),u.world){f.world=u.world,o.clear(f);for(var d=i.allBodies(f.world),p=0;p{var o={};c.exports=o;var v=t(53402);(function(){o.on=function(a,r,n){for(var e=r.split(" "),i,h=0;h0){n||(n={}),e=r.split(" ");for(var f=0;f{var o={};c.exports=o;var v=t(73832),a=t(53402);(function(){o.name="matter-js",o.version="0.19.0",o.uses=[],o.used=[],o.use=function(){v.use(o,Array.prototype.slice.call(arguments))},o.before=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathBefore(o,r,n)},o.after=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathAfter(o,r,n)}})()},73832:(c,m,t)=>{var o={};c.exports=o;var v=t(53402);(function(){o._registry={},o.register=function(a){if(o.isPlugin(a)||v.warn("Plugin.register:",o.toString(a),"does not implement all required fields."),a.name in o._registry){var r=o._registry[a.name],n=o.versionParse(a.version).number,e=o.versionParse(r.version).number;n>e?(v.warn("Plugin.register:",o.toString(r),"was upgraded to",o.toString(a)),o._registry[a.name]=a):n-1},o.isFor=function(a,r){var n=a.for&&o.dependencyParse(a.for);return!a.for||r.name===n.name&&o.versionSatisfies(r.version,n.range)},o.use=function(a,r){if(a.uses=(a.uses||[]).concat(r||[]),a.uses.length===0){v.warn("Plugin.use:",o.toString(a),"does not specify any dependencies to install.");return}for(var n=o.dependencies(a),e=v.topologicalSort(n),i=[],h=0;h0&&!s.silent&&v.info(i.join(" "))},o.dependencies=function(a,r){var n=o.dependencyParse(a),e=n.name;if(r=r||{},!(e in r)){a=o.resolve(a)||a,r[e]=v.map(a.uses||[],function(h){o.isPlugin(h)&&o.register(h);var s=o.dependencyParse(h),l=o.resolve(h);return l&&!o.versionSatisfies(l.version,s.range)?(v.warn("Plugin.dependencies:",o.toString(l),"does not satisfy",o.toString(s),"used by",o.toString(n)+"."),l._warned=!0,a._warned=!0):l||(v.warn("Plugin.dependencies:",o.toString(h),"used by",o.toString(n),"could not be resolved."),a._warned=!0),s.name});for(var i=0;i=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;r.test(a)||v.warn("Plugin.versionParse:",a,"is not a valid version or range.");var n=r.exec(a),e=Number(n[4]),i=Number(n[5]),h=Number(n[6]);return{isRange:!!(n[1]||n[2]),version:n[3],range:a,operator:n[1]||n[2]||"",major:e,minor:i,patch:h,parts:[e,i,h],prerelease:n[7],number:e*1e8+i*1e4+h}},o.versionSatisfies=function(a,r){r=r||"*";var n=o.versionParse(r),e=o.versionParse(a);if(n.isRange){if(n.operator==="*"||a==="*")return!0;if(n.operator===">")return e.number>n.number;if(n.operator===">=")return e.number>=n.number;if(n.operator==="~")return e.major===n.major&&e.minor===n.minor&&e.patch>=n.patch;if(n.operator==="^")return n.major>0?e.major===n.major&&e.number>=n.number:n.minor>0?e.minor===n.minor&&e.patch>=n.patch:e.patch===n.patch}return a===r||a==="*"}})()},53614:(c,m,t)=>{var o={};c.exports=o;var v=t(22562),a=t(35810),r=t(53402);(function(){o._motionWakeThreshold=.18,o._motionSleepThreshold=.08,o._minBias=.9,o.update=function(n,e){for(var i=e/r._baseDelta,h=o._motionSleepThreshold,s=0;s0&&l.motion=l.sleepThreshold/i&&o.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}},o.afterCollisions=function(n){for(var e=o._motionSleepThreshold,i=0;ie&&o.set(u,!1)}}}},o.set=function(n,e){var i=n.isSleeping;e?(n.isSleeping=!0,n.sleepCounter=n.sleepThreshold,n.positionImpulse.x=0,n.positionImpulse.y=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.speed=0,n.angularSpeed=0,n.motion=0,i||a.trigger(n,"sleepStart")):(n.isSleeping=!1,n.sleepCounter=0,i&&a.trigger(n,"sleepEnd"))}})()},66280:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(53402),r=t(22562),n=t(15647),e=t(31725);(function(){o.rectangle=function(i,h,s,l,f){f=f||{};var u={label:"Rectangle Body",position:{x:i,y:h},vertices:v.fromPath("L 0 0 L "+s+" 0 L "+s+" "+l+" L 0 "+l)};if(f.chamfer){var d=f.chamfer;u.vertices=v.chamfer(u.vertices,d.radius,d.quality,d.qualityMin,d.qualityMax),delete f.chamfer}return r.create(a.extend({},u,f))},o.trapezoid=function(i,h,s,l,f,u){u=u||{},f*=.5;var d=(1-f*2)*s,p=s*f,g=p+d,y=g+p,x;f<.5?x="L 0 0 L "+p+" "+-l+" L "+g+" "+-l+" L "+y+" 0":x="L 0 0 L "+g+" "+-l+" L "+y+" 0";var C={label:"Trapezoid Body",position:{x:i,y:h},vertices:v.fromPath(x)};if(u.chamfer){var P=u.chamfer;C.vertices=v.chamfer(C.vertices,P.radius,P.quality,P.qualityMin,P.qualityMax),delete u.chamfer}return r.create(a.extend({},C,u))},o.circle=function(i,h,s,l,f){l=l||{};var u={label:"Circle Body",circleRadius:s};f=f||25;var d=Math.ceil(Math.max(10,Math.min(f,s)));return d%2===1&&(d+=1),o.polygon(i,h,d,s,a.extend({},u,l))},o.polygon=function(i,h,s,l,f){if(f=f||{},s<3)return o.circle(i,h,l,f);for(var u=2*Math.PI/s,d="",p=u*.5,g=0;g0&&v.area(J)1?(x=r.create(a.extend({parts:C.slice(0)},l)),r.setPosition(x,{x:i,y:h}),x):C[0]},o.flagCoincidentParts=function(i,h){h===void 0&&(h=5);for(var s=0;s{var o={};c.exports=o;var v=t(69351),a=t(48140),r=t(53402),n=t(22562),e=t(66280);(function(){o.stack=function(i,h,s,l,f,u,d){for(var p=v.create({label:"Stack"}),g=i,y=h,x,C=0,P=0;PM&&(M=L),n.translate(I,{x:B*.5,y:L*.5}),g=I.bounds.max.x+f,v.addBody(p,I),x=I,C+=1}else g+=f}y+=M+u,g=i}return p},o.chain=function(i,h,s,l,f,u){for(var d=i.bodies,p=1;p0)for(p=0;p0&&(x=u[p-1+(d-1)*h],v.addConstraint(i,a.create(r.extend({bodyA:x,bodyB:y},f)))),l&&pM)){x=M-x;var I=x,L=s-1-x;if(!(yL)){P===1&&n.translate(C,{x:(y+(s%2===1?1:-1))*w,y:0});var B=C?y*w:0;return d(i+B+y*f,g,y,x,C,P)}}})},o.newtonsCradle=function(i,h,s,l,f){for(var u=v.create({label:"Newtons Cradle"}),d=0;d{var o={};c.exports=o;var v=t(31725),a=t(53402);(function(){o.fromVertices=function(r){for(var n={},e=0;e{var m={};c.exports=m,function(){m.create=function(t){var o={min:{x:0,y:0},max:{x:0,y:0}};return t&&m.update(o,t),o},m.update=function(t,o,v){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var a=0;at.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=v.x:t.min.x+=v.x,v.y>0?t.max.y+=v.y:t.min.y+=v.y)},m.contains=function(t,o){return o.x>=t.min.x&&o.x<=t.max.x&&o.y>=t.min.y&&o.y<=t.max.y},m.overlaps=function(t,o){return t.min.x<=o.max.x&&t.max.x>=o.min.x&&t.max.y>=o.min.y&&t.min.y<=o.max.y},m.translate=function(t,o){t.min.x+=o.x,t.max.x+=o.x,t.min.y+=o.y,t.max.y+=o.y},m.shift=function(t,o){var v=t.max.x-t.min.x,a=t.max.y-t.min.y;t.min.x=o.x,t.max.x=o.x+v,t.min.y=o.y,t.max.y=o.y+a}}()},74058:(c,m,t)=>{var o={};c.exports=o,t(15647);var v=t(53402);(function(){o.pathToVertices=function(a,r){typeof window<"u"&&!("SVGPathSeg"in window)&&v.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var n,e,i,h,s,l,f,u,d,p,g=[],y,x,C=0,P=0,M=0;r=r||15;var w=function(L,B,N){var G=N%2===1&&N>1;if(!d||L!=d.x||B!=d.y){d&&G?(y=d.x,x=d.y):(y=0,x=0);var V={x:y+L,y:x+B};(G||!d)&&(d=V),g.push(V),P=y+L,M=x+B}},I=function(L){var B=L.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":P=L.x,M=L.y;break;case"H":P=L.x;break;case"V":M=L.y;break}w(P,M,L.pathSegType)}};for(o._svgPathToAbsolute(a),i=a.getTotalLength(),l=[],n=0;n{var m={};c.exports=m,function(){m.create=function(t,o){return{x:t||0,y:o||0}},m.clone=function(t){return{x:t.x,y:t.y}},m.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},m.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},m.rotate=function(t,o,v){var a=Math.cos(o),r=Math.sin(o);v||(v={});var n=t.x*a-t.y*r;return v.y=t.x*r+t.y*a,v.x=n,v},m.rotateAbout=function(t,o,v,a){var r=Math.cos(o),n=Math.sin(o);a||(a={});var e=v.x+((t.x-v.x)*r-(t.y-v.y)*n);return a.y=v.y+((t.x-v.x)*n+(t.y-v.y)*r),a.x=e,a},m.normalise=function(t){var o=m.magnitude(t);return o===0?{x:0,y:0}:{x:t.x/o,y:t.y/o}},m.dot=function(t,o){return t.x*o.x+t.y*o.y},m.cross=function(t,o){return t.x*o.y-t.y*o.x},m.cross3=function(t,o,v){return(o.x-t.x)*(v.y-t.y)-(o.y-t.y)*(v.x-t.x)},m.add=function(t,o,v){return v||(v={}),v.x=t.x+o.x,v.y=t.y+o.y,v},m.sub=function(t,o,v){return v||(v={}),v.x=t.x-o.x,v.y=t.y-o.y,v},m.mult=function(t,o){return{x:t.x*o,y:t.y*o}},m.div=function(t,o){return{x:t.x/o,y:t.y/o}},m.perp=function(t,o){return o=o===!0?-1:1,{x:o*-t.y,y:o*t.x}},m.neg=function(t){return{x:-t.x,y:-t.y}},m.angle=function(t,o){return Math.atan2(o.y-t.y,o.x-t.x)},m._temp=[m.create(),m.create(),m.create(),m.create(),m.create(),m.create()]}()},41598:(c,m,t)=>{var o={};c.exports=o;var v=t(31725),a=t(53402);(function(){o.create=function(r,n){for(var e=[],i=0;i0)return!1;s=l}return!0},o.scale=function(r,n,e,i){if(n===1&&e===1)return r;i=i||o.centre(r);for(var h,s,l=0;l=0?l-1:r.length-1],u=r[l],d=r[(l+1)%r.length],p=n[l0&&(n|=2),n===3)return!1;return n!==0?!0:null},o.hull=function(r){var n=[],e=[],i,h;for(r=r.slice(0),r.sort(function(s,l){var f=s.x-l.x;return f!==0?f:s.y-l.y}),h=0;h=2&&v.cross3(e[e.length-2],e[e.length-1],i)<=0;)e.pop();e.push(i)}for(h=r.length-1;h>=0;h-=1){for(i=r[h];n.length>=2&&v.cross3(n[n.length-2],n[n.length-1],i)<=0;)n.pop();n.push(i)}return n.pop(),e.pop(),n.concat(e)}})()},18210:(c,m,t)=>{var o=t(19933),v={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(a){a.after("Body.create",function(){v.Body.init(this)}),a.before("Engine.update",function(r){v.Engine.update(r)})},Body:{init:function(a){a.plugin.attractors=a.plugin.attractors||[]}},Engine:{update:function(a){for(var r=o.Composite.allBodies(a.world),n=0;n0)for(var h=0;h{/** + */c.exports={BodyBounds:t(68174),Components:t(31884),Events:t(1121),Factory:t(28137),MatterGameObject:t(75803),Image:t(23181),Matter:t(19933),MatterPhysics:t(42045),PolyDecomp:t(55973),Sprite:t(34803),TileBody:t(73834),PhysicsEditorParser:t(19496),PhysicsJSONParser:t(85791),PointerConstraint:t(98713),World:t(68243)}},22562:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(31725),r=t(53614),n=t(53402),e=t(15647),i=t(66615);(function(){o._timeCorrection=!0,o._inertiaScale=4,o._nextCollidingGroupId=1,o._nextNonCollidingGroupId=-1,o._nextCategory=1,o._baseDelta=16.666666666666668,o.create=function(s){var l={id:n.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:16.666666666666668,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:{}};!s.hasOwnProperty("position")&&s.hasOwnProperty("vertices")?s.position=v.centre(s.vertices):s.hasOwnProperty("vertices")||(l.vertices=v.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var f=n.extend(l,s);return h(f,s),f.setOnCollideWith=function(u,d){return d?this.onCollideWith[u.id]=d:delete this.onCollideWith[u.id],this},f},o.nextGroup=function(s){return s?o._nextNonCollidingGroupId--:o._nextCollidingGroupId++},o.nextCategory=function(){return o._nextCategory=o._nextCategory<<1,o._nextCategory};var h=function(s,l){if(l=l||{},o.set(s,{bounds:s.bounds||e.create(s.vertices),positionPrev:s.positionPrev||a.clone(s.position),anglePrev:s.anglePrev||s.angle,vertices:s.vertices,parts:s.parts||[s],isStatic:s.isStatic,isSleeping:s.isSleeping,parent:s.parent||s}),v.rotate(s.vertices,s.angle,s.position),i.rotate(s.axes,s.angle),e.update(s.bounds,s.vertices,s.velocity),o.set(s,{axes:l.axes||s.axes,area:l.area||s.area,mass:l.mass||s.mass,inertia:l.inertia||s.inertia}),s.parts.length===1){var f=s.bounds,u=s.centerOfMass,d=s.centerOffset,p=f.max.x-f.min.x,g=f.max.y-f.min.y;u.x=-(f.min.x-s.position.x)/p,u.y=-(f.min.y-s.position.y)/g,d.x=p*u.x,d.y=g*u.y}};o.set=function(s,l,f){var u;typeof l=="string"&&(u=l,l={},l[u]=f);for(u in l)if(Object.prototype.hasOwnProperty.call(l,u))switch(f=l[u],u){case"isStatic":o.setStatic(s,f);break;case"isSleeping":r.set(s,f);break;case"mass":o.setMass(s,f);break;case"density":o.setDensity(s,f);break;case"inertia":o.setInertia(s,f);break;case"vertices":o.setVertices(s,f);break;case"position":o.setPosition(s,f);break;case"angle":o.setAngle(s,f);break;case"velocity":o.setVelocity(s,f);break;case"angularVelocity":o.setAngularVelocity(s,f);break;case"speed":o.setSpeed(s,f);break;case"angularSpeed":o.setAngularSpeed(s,f);break;case"parts":o.setParts(s,f);break;case"centre":o.setCentre(s,f);break;default:s[u]=f}},o.setStatic=function(s,l){for(var f=0;f0&&a.rotateAbout(p.position,u,s.position,p.position)}},o.setVelocity=function(s,l){var f=s.deltaTime/o._baseDelta;s.positionPrev.x=s.position.x-l.x*f,s.positionPrev.y=s.position.y-l.y*f,s.velocity.x=(s.position.x-s.positionPrev.x)/f,s.velocity.y=(s.position.y-s.positionPrev.y)/f,s.speed=a.magnitude(s.velocity)},o.getVelocity=function(s){var l=o._baseDelta/s.deltaTime;return{x:(s.position.x-s.positionPrev.x)*l,y:(s.position.y-s.positionPrev.y)*l}},o.getSpeed=function(s){return a.magnitude(o.getVelocity(s))},o.setSpeed=function(s,l){o.setVelocity(s,a.mult(a.normalise(o.getVelocity(s)),l))},o.setAngularVelocity=function(s,l){var f=s.deltaTime/o._baseDelta;s.anglePrev=s.angle-l*f,s.angularVelocity=(s.angle-s.anglePrev)/f,s.angularSpeed=Math.abs(s.angularVelocity)},o.getAngularVelocity=function(s){return(s.angle-s.anglePrev)*o._baseDelta/s.deltaTime},o.getAngularSpeed=function(s){return Math.abs(o.getAngularVelocity(s))},o.setAngularSpeed=function(s,l){o.setAngularVelocity(s,n.sign(o.getAngularVelocity(s))*l)},o.translate=function(s,l,f){o.setPosition(s,a.add(s.position,l),f)},o.rotate=function(s,l,f,u){if(!f)o.setAngle(s,s.angle+l,u);else{var d=Math.cos(l),p=Math.sin(l),g=s.position.x-f.x,x=s.position.y-f.y;o.setPosition(s,{x:f.x+(g*d-x*p),y:f.y+(g*p+x*d)},u),o.setAngle(s,s.angle+l,u)}},o.scale=function(s,l,f,u){var d=0,p=0;u=u||s.position;for(var g=s.inertia===1/0,x=0;x0&&(d+=y.area,p+=y.inertia),y.position.x=u.x+(y.position.x-u.x)*l,y.position.y=u.y+(y.position.y-u.y)*f,e.update(y.bounds,y.vertices,s.velocity)}s.parts.length>1&&(s.area=d,s.isStatic||(o.setMass(s,s.density*d),o.setInertia(s,p))),s.circleRadius&&(l===f?s.circleRadius*=l:s.circleRadius=null),g&&o.setInertia(s,1/0)},o.update=function(s,l){l=(typeof l<"u"?l:16.666666666666668)*s.timeScale;var f=l*l,u=o._timeCorrection?l/(s.deltaTime||l):1,d=1-s.frictionAir*(l/n._baseDelta),p=(s.position.x-s.positionPrev.x)*u,g=(s.position.y-s.positionPrev.y)*u;s.velocity.x=p*d+s.force.x/s.mass*f,s.velocity.y=g*d+s.force.y/s.mass*f,s.positionPrev.x=s.position.x,s.positionPrev.y=s.position.y,s.position.x+=s.velocity.x,s.position.y+=s.velocity.y,s.deltaTime=l,s.angularVelocity=(s.angle-s.anglePrev)*d*u+s.torque/s.inertia*f,s.anglePrev=s.angle,s.angle+=s.angularVelocity,s.speed=a.magnitude(s.velocity),s.angularSpeed=Math.abs(s.angularVelocity);for(var x=0;x0&&(y.position.x+=s.velocity.x,y.position.y+=s.velocity.y),s.angularVelocity!==0&&(v.rotate(y.vertices,s.angularVelocity,s.position),i.rotate(y.axes,s.angularVelocity),x>0&&a.rotateAbout(y.position,s.angularVelocity,s.position,y.position)),e.update(y.bounds,y.vertices,s.velocity)}},o.updateVelocities=function(s){var l=o._baseDelta/s.deltaTime,f=s.velocity;f.x=(s.position.x-s.positionPrev.x)*l,f.y=(s.position.y-s.positionPrev.y)*l,s.speed=Math.sqrt(f.x*f.x+f.y*f.y),s.angularVelocity=(s.angle-s.anglePrev)*l,s.angularSpeed=Math.abs(s.angularVelocity)},o.applyForce=function(s,l,f){var u={x:l.x-s.position.x,y:l.y-s.position.y};s.force.x+=f.x,s.force.y+=f.y,s.torque+=u.x*f.y-u.y*f.x},o._totalProperties=function(s){for(var l={mass:0,area:0,inertia:0,centre:{x:0,y:0}},f=s.parts.length===1?0:1;f{var o={};c.exports=o;var v=t(35810),a=t(53402),r=t(15647),n=t(22562);(function(){o.create=function(e){return a.extend({id:a.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},e)},o.setModified=function(e,i,h,s){if(v.trigger(e,"compositeModified",e),e.isModified=i,i&&e.cache&&(e.cache.allBodies=null,e.cache.allConstraints=null,e.cache.allComposites=null),h&&e.parent&&o.setModified(e.parent,i,h,s),s)for(var l=0;l{var o={};c.exports=o;var v=t(69351);(function(){o.create=v.create,o.add=v.add,o.remove=v.remove,o.clear=v.clear,o.addComposite=v.addComposite,o.addBody=v.addBody,o.addConstraint=v.addConstraint})()},52284:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(4506);(function(){var r=[],n={overlap:0,axis:null},e={overlap:0,axis:null};o.create=function(i,h){return{pair:null,collided:!1,bodyA:i,bodyB:h,parentA:i.parent,parentB:h.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},o.collides=function(i,h,s){if(o._overlapAxes(n,i.vertices,h.vertices,i.axes),n.overlap<=0||(o._overlapAxes(e,h.vertices,i.vertices,h.axes),e.overlap<=0))return null;var l=s&&s.table[a.id(i,h)],f;l?f=l.collision:(f=o.create(i,h),f.collided=!0,f.bodyA=i.idX?X=L:LY?Y=L:Lf?f=d:d{var m={};c.exports=m,function(){m.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}}()},81388:(c,m,t)=>{var o={};c.exports=o;var v=t(53402),a=t(52284);(function(){o.create=function(r){var n={bodies:[],pairs:null};return v.extend(n,r)},o.setBodies=function(r,n){r.bodies=n.slice(0)},o.clear=function(r){r.bodies=[]},o.collisions=function(r){var n=[],e=r.pairs,i=r.bodies,h=i.length,s=o.canCollide,l=a.collides,f,u;for(i.sort(o._compareBoundsX),f=0;fg)break;if(!(xI.max.y)&&!(C&&(w.isStatic||w.isSleeping))&&s(d.collisionFilter,w.collisionFilter)){var L=w.parts.length;if(M&&L===1){var B=l(d,w,e);B&&n.push(B)}else for(var N=P>1?1:0,G=L>1?1:0,V=N;VI.max.x||p.max.xI.max.y)){var B=l(K,J,e);B&&n.push(B)}}}}}return n},o.canCollide=function(r,n){return r.group===n.group&&r.group!==0?r.group>0:(r.mask&n.category)!==0&&(n.mask&r.category)!==0},o._compareBoundsX=function(r,n){return r.bounds.min.x-n.bounds.min.x}})()},4506:(c,m,t)=>{var o={};c.exports=o;var v=t(43424);(function(){o.create=function(a,r){var n=a.bodyA,e=a.bodyB,i={id:o.id(n,e),bodyA:n,bodyB:e,collision:a,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||e.isSensor,timeCreated:r,timeUpdated:r,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return o.update(i,a,r),i},o.update=function(a,r,n){var e=a.contacts,i=r.supports,h=a.activeContacts,s=r.parentA,l=r.parentB,f=s.vertices.length;a.isActive=!0,a.timeUpdated=n,a.collision=r,a.separation=r.depth,a.inverseMass=s.inverseMass+l.inverseMass,a.friction=s.frictionl.frictionStatic?s.frictionStatic:l.frictionStatic,a.restitution=s.restitution>l.restitution?s.restitution:l.restitution,a.slop=s.slop>l.slop?s.slop:l.slop,r.pair=a,h.length=0;for(var u=0;u{var o={};c.exports=o;var v=t(4506),a=t(53402);(function(){o.create=function(r){return a.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},r)},o.update=function(r,n,e){var i=r.list,h=i.length,s=r.table,l=n.length,f=r.collisionStart,u=r.collisionEnd,d=r.collisionActive,p,g,x,y;for(f.length=0,u.length=0,d.length=0,y=0;y{var o={};c.exports=o;var v=t(31725),a=t(52284),r=t(15647),n=t(66280),e=t(41598);(function(){o.collides=function(i,h){for(var s=[],l=h.length,f=i.bounds,u=a.collides,d=r.overlaps,p=0;p{var o={};c.exports=o;var v=t(41598),a=t(53402),r=t(15647);(function(){o._restingThresh=2,o._restingThreshTangent=Math.sqrt(6),o._positionDampen=.9,o._positionWarming=.8,o._frictionNormalMultiplier=5,o._frictionMaxStatic=Number.MAX_VALUE,o.preSolvePosition=function(n){var e,i,h,s=n.length;for(e=0;ect?(x=At>0?At:-At,g=P.friction*(At>0?1:-1)*s,g<-x?g=-x:g>x&&(g=x)):(g=At,x=d);var Ct=H*G-Z*N,pt=Q*G-k*N,wt=X/(Y+w.inverseInertia*Ct*Ct+I.inverseInertia*pt*pt),Bt=(1+P.restitution)*vt*wt;if(g*=wt,vt0&&(z.normalImpulse=0),Bt=z.normalImpulse-jt}if(At<-f||At>f)z.tangentImpulse=0;else{var zt=z.tangentImpulse;z.tangentImpulse+=g,z.tangentImpulse<-x&&(z.tangentImpulse=-x),z.tangentImpulse>x&&(z.tangentImpulse=x),g=z.tangentImpulse-zt}var Yt=N*Bt+V*g,bt=G*Bt+K*g;w.isStatic||w.isSleeping||(w.positionPrev.x+=Yt*w.inverseMass,w.positionPrev.y+=bt*w.inverseMass,w.anglePrev+=(H*bt-Z*Yt)*w.inverseInertia),I.isStatic||I.isSleeping||(I.positionPrev.x-=Yt*I.inverseMass,I.positionPrev.y-=bt*I.inverseMass,I.anglePrev-=(Q*bt-k*Yt)*I.inverseInertia)}}}}})()},48140:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(31725),r=t(53614),n=t(15647),e=t(66615),i=t(53402);(function(){o._warming=.4,o._torqueDampen=1,o._minLength=1e-6,o.create=function(h){var s=h;s.bodyA&&!s.pointA&&(s.pointA={x:0,y:0}),s.bodyB&&!s.pointB&&(s.pointB={x:0,y:0});var l=s.bodyA?a.add(s.bodyA.position,s.pointA):s.pointA,f=s.bodyB?a.add(s.bodyB.position,s.pointB):s.pointB,u=a.magnitude(a.sub(l,f));s.length=typeof s.length<"u"?s.length:u,s.id=s.id||i.nextId(),s.label=s.label||"Constraint",s.type="constraint",s.stiffness=s.stiffness||(s.length>0?1:.7),s.damping=s.damping||0,s.angularStiffness=s.angularStiffness||0,s.angleA=s.bodyA?s.bodyA.angle:s.angleA,s.angleB=s.bodyB?s.bodyB.angle:s.angleB,s.plugin={};var d={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return s.length===0&&s.stiffness>.1?(d.type="pin",d.anchors=!1):s.stiffness<.9&&(d.type="spring"),s.render=i.extend(d,s.render),s},o.preSolveAll=function(h){for(var s=0;s=1||h.length===0,M=P?h.stiffness*s:h.stiffness*s*s,w=h.damping*s,I=a.mult(x,C*M),L=(l?l.inverseMass:0)+(f?f.inverseMass:0),B=(l?l.inverseInertia:0)+(f?f.inverseInertia:0),N=L+B,G,V,K,j,J;if(w>0){var X=a.create();K=a.div(x,y),J=a.sub(f&&a.sub(f.position,f.positionPrev)||X,l&&a.sub(l.position,l.positionPrev)||X),j=a.dot(K,J)}l&&!l.isStatic&&(V=l.inverseMass/L,l.constraintImpulse.x-=I.x*V,l.constraintImpulse.y-=I.y*V,l.position.x-=I.x*V,l.position.y-=I.y*V,w>0&&(l.positionPrev.x-=w*K.x*j*V,l.positionPrev.y-=w*K.y*j*V),G=a.cross(u,I)/N*o._torqueDampen*l.inverseInertia*(1-h.angularStiffness),l.constraintImpulse.angle-=G,l.angle-=G),f&&!f.isStatic&&(V=f.inverseMass/L,f.constraintImpulse.x+=I.x*V,f.constraintImpulse.y+=I.y*V,f.position.x+=I.x*V,f.position.y+=I.y*V,w>0&&(f.positionPrev.x+=w*K.x*j*V,f.positionPrev.y+=w*K.y*j*V),G=a.cross(d,I)/N*o._torqueDampen*f.inverseInertia*(1-h.angularStiffness),f.constraintImpulse.angle+=G,f.angle+=G)}}},o.postSolveAll=function(h){for(var s=0;s0&&(d.position.x+=f.x,d.position.y+=f.y),f.angle!==0&&(v.rotate(d.vertices,f.angle,l.position),e.rotate(d.axes,f.angle),u>0&&a.rotateAbout(d.position,f.angle,l.position,d.position)),n.update(d.bounds,d.vertices,l.velocity)}f.angle*=o._warming,f.x*=o._warming,f.y*=o._warming}}},o.pointAWorld=function(h){return{x:(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),y:(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0)}},o.pointBWorld=function(h){return{x:(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),y:(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0)}},o.currentLength=function(h){var s=(h.bodyA?h.bodyA.position.x:0)+(h.pointA?h.pointA.x:0),l=(h.bodyA?h.bodyA.position.y:0)+(h.pointA?h.pointA.y:0),f=(h.bodyB?h.bodyB.position.x:0)+(h.pointB?h.pointB.x:0),u=(h.bodyB?h.bodyB.position.y:0)+(h.pointB?h.pointB.y:0),d=s-f,p=l-u;return Math.sqrt(d*d+p*p)}})()},53402:(c,m,t)=>{var o={};c.exports=o,function(){o._baseDelta=16.666666666666668,o._nextId=0,o._seed=0,o._nowStartTime=+new Date,o._warnedOnce={},o._decomp=null,o.extend=function(a,r){var n,e;typeof r=="boolean"?(n=2,e=r):(n=1,e=!0);for(var i=n;i0;r--){var n=Math.floor(o.random()*(r+1)),e=a[r];a[r]=a[n],a[n]=e}return a},o.choose=function(a){return a[Math.floor(o.random()*a.length)]},o.isElement=function(a){return typeof HTMLElement<"u"?a instanceof HTMLElement:!!(a&&a.nodeType&&a.nodeName)},o.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"},o.isFunction=function(a){return typeof a=="function"},o.isPlainObject=function(a){return typeof a=="object"&&a.constructor===Object},o.isString=function(a){return toString.call(a)==="[object String]"},o.clamp=function(a,r,n){return an?n:a},o.sign=function(a){return a<0?-1:1},o.now=function(){if(typeof window<"u"&&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-o._nowStartTime},o.random=function(a,r){return a=typeof a<"u"?a:0,r=typeof r<"u"?r:1,a+v()*(r-a)};var v=function(){return o._seed=(o._seed*9301+49297)%233280,o._seed/233280};o.colorToNumber=function(a){return a=a.replace("#",""),a.length==3&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)),parseInt(a,16)},o.logLevel=1,o.log=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.info=function(){console&&o.logLevel>0&&o.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warn=function(){console&&o.logLevel>0&&o.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},o.warnOnce=function(){var a=Array.prototype.slice.call(arguments).join(" ");o._warnedOnce[a]||(o.warn(a),o._warnedOnce[a]=!0)},o.deprecated=function(a,r,n){a[r]=o.chain(function(){o.warnOnce("🔅 deprecated 🔅",n)},a[r])},o.nextId=function(){return o._nextId++},o.indexOf=function(a,r){if(a.indexOf)return a.indexOf(r);for(var n=0;n{var o={};c.exports=o;var v=t(53614),a=t(66272),r=t(81388),n=t(99561),e=t(35810),i=t(69351),h=t(48140),s=t(53402),l=t(22562);(function(){o.create=function(f){f=f||{};var u={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}},d=s.extend(u,f);return d.world=f.world||i.create({label:"World"}),d.pairs=f.pairs||n.create(),d.detector=f.detector||r.create(),d.grid={buckets:[]},d.world.gravity=d.gravity,d.broadphase=d.grid,d.metrics={},d},o.update=function(f,u){var d=s.now(),p=f.world,g=f.detector,x=f.pairs,y=f.timing,C=y.timestamp,P;u=typeof u<"u"?u:s._baseDelta,u*=y.timeScale,y.timestamp+=u,y.lastDelta=u;var M={timestamp:y.timestamp,delta:u};e.trigger(f,"beforeUpdate",M);var w=i.allBodies(p),I=i.allConstraints(p);for(p.isModified&&(r.setBodies(g,w),i.setModified(p,!1,!1,!0)),f.enableSleeping&&v.update(w,u),o._bodiesApplyGravity(w,f.gravity),u>0&&o._bodiesUpdate(w,u),e.trigger(f,"beforeSolve",M),h.preSolveAll(w),P=0;P0&&e.trigger(f,"collisionStart",{pairs:x.collisionStart,timestamp:y.timestamp,delta:u});var B=s.clamp(20/f.positionIterations,0,1);for(a.preSolvePosition(x.list),P=0;P0&&e.trigger(f,"collisionActive",{pairs:x.collisionActive,timestamp:y.timestamp,delta:u}),x.collisionEnd.length>0&&e.trigger(f,"collisionEnd",{pairs:x.collisionEnd,timestamp:y.timestamp,delta:u}),o._bodiesClearForces(w),e.trigger(f,"afterUpdate",M),f.timing.lastElapsed=s.now()-d,f},o.merge=function(f,u){if(s.extend(f,u),u.world){f.world=u.world,o.clear(f);for(var d=i.allBodies(f.world),p=0;p{var o={};c.exports=o;var v=t(53402);(function(){o.on=function(a,r,n){for(var e=r.split(" "),i,h=0;h0){n||(n={}),e=r.split(" ");for(var f=0;f{var o={};c.exports=o;var v=t(73832),a=t(53402);(function(){o.name="matter-js",o.version="0.19.0",o.uses=[],o.used=[],o.use=function(){v.use(o,Array.prototype.slice.call(arguments))},o.before=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathBefore(o,r,n)},o.after=function(r,n){return r=r.replace(/^Matter./,""),a.chainPathAfter(o,r,n)}})()},73832:(c,m,t)=>{var o={};c.exports=o;var v=t(53402);(function(){o._registry={},o.register=function(a){if(o.isPlugin(a)||v.warn("Plugin.register:",o.toString(a),"does not implement all required fields."),a.name in o._registry){var r=o._registry[a.name],n=o.versionParse(a.version).number,e=o.versionParse(r.version).number;n>e?(v.warn("Plugin.register:",o.toString(r),"was upgraded to",o.toString(a)),o._registry[a.name]=a):n-1},o.isFor=function(a,r){var n=a.for&&o.dependencyParse(a.for);return!a.for||r.name===n.name&&o.versionSatisfies(r.version,n.range)},o.use=function(a,r){if(a.uses=(a.uses||[]).concat(r||[]),a.uses.length===0){v.warn("Plugin.use:",o.toString(a),"does not specify any dependencies to install.");return}for(var n=o.dependencies(a),e=v.topologicalSort(n),i=[],h=0;h0&&!s.silent&&v.info(i.join(" "))},o.dependencies=function(a,r){var n=o.dependencyParse(a),e=n.name;if(r=r||{},!(e in r)){a=o.resolve(a)||a,r[e]=v.map(a.uses||[],function(h){o.isPlugin(h)&&o.register(h);var s=o.dependencyParse(h),l=o.resolve(h);return l&&!o.versionSatisfies(l.version,s.range)?(v.warn("Plugin.dependencies:",o.toString(l),"does not satisfy",o.toString(s),"used by",o.toString(n)+"."),l._warned=!0,a._warned=!0):l||(v.warn("Plugin.dependencies:",o.toString(h),"used by",o.toString(n),"could not be resolved."),a._warned=!0),s.name});for(var i=0;i=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;r.test(a)||v.warn("Plugin.versionParse:",a,"is not a valid version or range.");var n=r.exec(a),e=Number(n[4]),i=Number(n[5]),h=Number(n[6]);return{isRange:!!(n[1]||n[2]),version:n[3],range:a,operator:n[1]||n[2]||"",major:e,minor:i,patch:h,parts:[e,i,h],prerelease:n[7],number:e*1e8+i*1e4+h}},o.versionSatisfies=function(a,r){r=r||"*";var n=o.versionParse(r),e=o.versionParse(a);if(n.isRange){if(n.operator==="*"||a==="*")return!0;if(n.operator===">")return e.number>n.number;if(n.operator===">=")return e.number>=n.number;if(n.operator==="~")return e.major===n.major&&e.minor===n.minor&&e.patch>=n.patch;if(n.operator==="^")return n.major>0?e.major===n.major&&e.number>=n.number:n.minor>0?e.minor===n.minor&&e.patch>=n.patch:e.patch===n.patch}return a===r||a==="*"}})()},53614:(c,m,t)=>{var o={};c.exports=o;var v=t(22562),a=t(35810),r=t(53402);(function(){o._motionWakeThreshold=.18,o._motionSleepThreshold=.08,o._minBias=.9,o.update=function(n,e){for(var i=e/r._baseDelta,h=o._motionSleepThreshold,s=0;s0&&l.motion=l.sleepThreshold/i&&o.set(l,!0)):l.sleepCounter>0&&(l.sleepCounter-=1)}},o.afterCollisions=function(n){for(var e=o._motionSleepThreshold,i=0;ie&&o.set(u,!1)}}}},o.set=function(n,e){var i=n.isSleeping;e?(n.isSleeping=!0,n.sleepCounter=n.sleepThreshold,n.positionImpulse.x=0,n.positionImpulse.y=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.speed=0,n.angularSpeed=0,n.motion=0,i||a.trigger(n,"sleepStart")):(n.isSleeping=!1,n.sleepCounter=0,i&&a.trigger(n,"sleepEnd"))}})()},66280:(c,m,t)=>{var o={};c.exports=o;var v=t(41598),a=t(53402),r=t(22562),n=t(15647),e=t(31725);(function(){o.rectangle=function(i,h,s,l,f){f=f||{};var u={label:"Rectangle Body",position:{x:i,y:h},vertices:v.fromPath("L 0 0 L "+s+" 0 L "+s+" "+l+" L 0 "+l)};if(f.chamfer){var d=f.chamfer;u.vertices=v.chamfer(u.vertices,d.radius,d.quality,d.qualityMin,d.qualityMax),delete f.chamfer}return r.create(a.extend({},u,f))},o.trapezoid=function(i,h,s,l,f,u){u=u||{},f*=.5;var d=(1-f*2)*s,p=s*f,g=p+d,x=g+p,y;f<.5?y="L 0 0 L "+p+" "+-l+" L "+g+" "+-l+" L "+x+" 0":y="L 0 0 L "+g+" "+-l+" L "+x+" 0";var C={label:"Trapezoid Body",position:{x:i,y:h},vertices:v.fromPath(y)};if(u.chamfer){var P=u.chamfer;C.vertices=v.chamfer(C.vertices,P.radius,P.quality,P.qualityMin,P.qualityMax),delete u.chamfer}return r.create(a.extend({},C,u))},o.circle=function(i,h,s,l,f){l=l||{};var u={label:"Circle Body",circleRadius:s};f=f||25;var d=Math.ceil(Math.max(10,Math.min(f,s)));return d%2===1&&(d+=1),o.polygon(i,h,d,s,a.extend({},u,l))},o.polygon=function(i,h,s,l,f){if(f=f||{},s<3)return o.circle(i,h,l,f);for(var u=2*Math.PI/s,d="",p=u*.5,g=0;g0&&v.area(J)1?(y=r.create(a.extend({parts:C.slice(0)},l)),r.setPosition(y,{x:i,y:h}),y):C[0]},o.flagCoincidentParts=function(i,h){h===void 0&&(h=5);for(var s=0;s{var o={};c.exports=o;var v=t(69351),a=t(48140),r=t(53402),n=t(22562),e=t(66280);(function(){o.stack=function(i,h,s,l,f,u,d){for(var p=v.create({label:"Stack"}),g=i,x=h,y,C=0,P=0;PM&&(M=L),n.translate(I,{x:B*.5,y:L*.5}),g=I.bounds.max.x+f,v.addBody(p,I),y=I,C+=1}else g+=f}x+=M+u,g=i}return p},o.chain=function(i,h,s,l,f,u){for(var d=i.bodies,p=1;p0)for(p=0;p0&&(y=u[p-1+(d-1)*h],v.addConstraint(i,a.create(r.extend({bodyA:y,bodyB:x},f)))),l&&pM)){y=M-y;var I=y,L=s-1-y;if(!(xL)){P===1&&n.translate(C,{x:(x+(s%2===1?1:-1))*w,y:0});var B=C?x*w:0;return d(i+B+x*f,g,x,y,C,P)}}})},o.newtonsCradle=function(i,h,s,l,f){for(var u=v.create({label:"Newtons Cradle"}),d=0;d{var o={};c.exports=o;var v=t(31725),a=t(53402);(function(){o.fromVertices=function(r){for(var n={},e=0;e{var m={};c.exports=m,function(){m.create=function(t){var o={min:{x:0,y:0},max:{x:0,y:0}};return t&&m.update(o,t),o},m.update=function(t,o,v){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var a=0;at.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=v.x:t.min.x+=v.x,v.y>0?t.max.y+=v.y:t.min.y+=v.y)},m.contains=function(t,o){return o.x>=t.min.x&&o.x<=t.max.x&&o.y>=t.min.y&&o.y<=t.max.y},m.overlaps=function(t,o){return t.min.x<=o.max.x&&t.max.x>=o.min.x&&t.max.y>=o.min.y&&t.min.y<=o.max.y},m.translate=function(t,o){t.min.x+=o.x,t.max.x+=o.x,t.min.y+=o.y,t.max.y+=o.y},m.shift=function(t,o){var v=t.max.x-t.min.x,a=t.max.y-t.min.y;t.min.x=o.x,t.max.x=o.x+v,t.min.y=o.y,t.max.y=o.y+a}}()},74058:(c,m,t)=>{var o={};c.exports=o,t(15647);var v=t(53402);(function(){o.pathToVertices=function(a,r){typeof window<"u"&&!("SVGPathSeg"in window)&&v.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var n,e,i,h,s,l,f,u,d,p,g=[],x,y,C=0,P=0,M=0;r=r||15;var w=function(L,B,N){var G=N%2===1&&N>1;if(!d||L!=d.x||B!=d.y){d&&G?(x=d.x,y=d.y):(x=0,y=0);var V={x:x+L,y:y+B};(G||!d)&&(d=V),g.push(V),P=x+L,M=y+B}},I=function(L){var B=L.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":P=L.x,M=L.y;break;case"H":P=L.x;break;case"V":M=L.y;break}w(P,M,L.pathSegType)}};for(o._svgPathToAbsolute(a),i=a.getTotalLength(),l=[],n=0;n{var m={};c.exports=m,function(){m.create=function(t,o){return{x:t||0,y:o||0}},m.clone=function(t){return{x:t.x,y:t.y}},m.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},m.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},m.rotate=function(t,o,v){var a=Math.cos(o),r=Math.sin(o);v||(v={});var n=t.x*a-t.y*r;return v.y=t.x*r+t.y*a,v.x=n,v},m.rotateAbout=function(t,o,v,a){var r=Math.cos(o),n=Math.sin(o);a||(a={});var e=v.x+((t.x-v.x)*r-(t.y-v.y)*n);return a.y=v.y+((t.x-v.x)*n+(t.y-v.y)*r),a.x=e,a},m.normalise=function(t){var o=m.magnitude(t);return o===0?{x:0,y:0}:{x:t.x/o,y:t.y/o}},m.dot=function(t,o){return t.x*o.x+t.y*o.y},m.cross=function(t,o){return t.x*o.y-t.y*o.x},m.cross3=function(t,o,v){return(o.x-t.x)*(v.y-t.y)-(o.y-t.y)*(v.x-t.x)},m.add=function(t,o,v){return v||(v={}),v.x=t.x+o.x,v.y=t.y+o.y,v},m.sub=function(t,o,v){return v||(v={}),v.x=t.x-o.x,v.y=t.y-o.y,v},m.mult=function(t,o){return{x:t.x*o,y:t.y*o}},m.div=function(t,o){return{x:t.x/o,y:t.y/o}},m.perp=function(t,o){return o=o===!0?-1:1,{x:o*-t.y,y:o*t.x}},m.neg=function(t){return{x:-t.x,y:-t.y}},m.angle=function(t,o){return Math.atan2(o.y-t.y,o.x-t.x)},m._temp=[m.create(),m.create(),m.create(),m.create(),m.create(),m.create()]}()},41598:(c,m,t)=>{var o={};c.exports=o;var v=t(31725),a=t(53402);(function(){o.create=function(r,n){for(var e=[],i=0;i0)return!1;s=l}return!0},o.scale=function(r,n,e,i){if(n===1&&e===1)return r;i=i||o.centre(r);for(var h,s,l=0;l=0?l-1:r.length-1],u=r[l],d=r[(l+1)%r.length],p=n[l0&&(n|=2),n===3)return!1;return n!==0?!0:null},o.hull=function(r){var n=[],e=[],i,h;for(r=r.slice(0),r.sort(function(s,l){var f=s.x-l.x;return f!==0?f:s.y-l.y}),h=0;h=2&&v.cross3(e[e.length-2],e[e.length-1],i)<=0;)e.pop();e.push(i)}for(h=r.length-1;h>=0;h-=1){for(i=r[h];n.length>=2&&v.cross3(n[n.length-2],n[n.length-1],i)<=0;)n.pop();n.push(i)}return n.pop(),e.pop(),n.concat(e)}})()},18210:(c,m,t)=>{var o=t(19933),v={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(a){a.after("Body.create",function(){v.Body.init(this)}),a.before("Engine.update",function(r){v.Engine.update(r)})},Body:{init:function(a){a.plugin.attractors=a.plugin.attractors||[]}},Engine:{update:function(a){for(var r=o.Composite.allBodies(a.world),n=0;n0)for(var h=0;h{/** * @author @dxu https://github.com/dxu/matter-collision-events * @author Richard Davey * @license {@link https://opensource.org/licenses/MIT|MIT License} */var m={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(o){o.pairs.map(function(v){var a=v.bodyA,r=v.bodyB;a.gameObject&&a.gameObject.emit("collide",a,r,v),r.gameObject&&r.gameObject.emit("collide",r,a,v),t.Events.trigger(a,"onCollide",{pair:v}),t.Events.trigger(r,"onCollide",{pair:v}),a.onCollideCallback&&a.onCollideCallback(v),r.onCollideCallback&&r.onCollideCallback(v),a.onCollideWith[r.id]&&a.onCollideWith[r.id](r,v),r.onCollideWith[a.id]&&r.onCollideWith[a.id](a,v)})}),t.Events.on(this,"collisionActive",function(o){o.pairs.map(function(v){var a=v.bodyA,r=v.bodyB;a.gameObject&&a.gameObject.emit("collideActive",a,r,v),r.gameObject&&r.gameObject.emit("collideActive",r,a,v),t.Events.trigger(a,"onCollideActive",{pair:v}),t.Events.trigger(r,"onCollideActive",{pair:v}),a.onCollideActiveCallback&&a.onCollideActiveCallback(v),r.onCollideActiveCallback&&r.onCollideActiveCallback(v)})}),t.Events.on(this,"collisionEnd",function(o){o.pairs.map(function(v){var a=v.bodyA,r=v.bodyB;a.gameObject&&a.gameObject.emit("collideEnd",a,r,v),r.gameObject&&r.gameObject.emit("collideEnd",r,a,v),t.Events.trigger(a,"onCollideEnd",{pair:v}),t.Events.trigger(r,"onCollideEnd",{pair:v}),a.onCollideEndCallback&&a.onCollideEndCallback(v),r.onCollideEndCallback&&r.onCollideEndCallback(v)})})})}};c.exports=m},74507:(c,m,t)=>{var o=t(19933),v={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(a){a.after("Engine.update",function(){v.Engine.update(this)})},Engine:{update:function(a){for(var r=a.world,n=o.Composite.allBodies(r),e=o.Composite.allComposites(r),i=0;ir.max.x?n=r.min.x-a.max.x:a.max.xr.max.y?e=r.min.y-a.max.y:a.max.y{/** * @author Stefan Hedman (http://steffe.se) * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={decomp:I,quickDecomp:G,isSimple:B,removeCollinearPoints:V,removeDuplicatePoints:K,makeCCW:d};function m(X,Y,b){b=b||0;var z=[0,0],W,H,Z,Q,k,et,st;return W=X[1][1]-X[0][1],H=X[0][0]-X[1][0],Z=W*X[0][0]+H*X[0][1],Q=Y[1][1]-Y[0][1],k=Y[0][0]-Y[1][0],et=Q*Y[0][0]+k*Y[0][1],st=W*k-Q*H,j(st,0,b)||(z[0]=(k*Z-H*et)/st,z[1]=(W*et-Q*Z)/st),z}function t(X,Y,b,z){var W=Y[0]-X[0],H=Y[1]-X[1],Z=z[0]-b[0],Q=z[1]-b[1];if(Z*H-Q*W===0)return!1;var k=(W*(b[1]-X[1])+H*(X[0]-b[0]))/(Z*H-Q*W),et=(Z*(X[1]-b[1])+Q*(b[0]-X[0]))/(Q*W-Z*H);return k>=0&&k<=1&&et>=0&&et<=1}function o(X,Y,b){return(Y[0]-X[0])*(b[1]-X[1])-(b[0]-X[0])*(Y[1]-X[1])}function v(X,Y,b){return o(X,Y,b)>0}function a(X,Y,b){return o(X,Y,b)>=0}function r(X,Y,b){return o(X,Y,b)<0}function n(X,Y,b){return o(X,Y,b)<=0}var e=[],i=[];function h(X,Y,b,z){if(z){var W=e,H=i;W[0]=Y[0]-X[0],W[1]=Y[1]-X[1],H[0]=b[0]-Y[0],H[1]=b[1]-Y[1];var Z=W[0]*H[0]+W[1]*H[1],Q=Math.sqrt(W[0]*W[0]+W[1]*W[1]),k=Math.sqrt(H[0]*H[0]+H[1]*H[1]),et=Math.acos(Z/(Q*k));return etb[Y][0])&&(Y=z);return v(l(X,Y-1),l(X,Y),l(X,Y+1))?!1:(p(X),!0)}function p(X){for(var Y=[],b=X.length,z=0;z!==b;z++)Y.push(X.pop());for(var z=0;z!==b;z++)X[z]=Y[z]}function g(X,Y){return r(l(X,Y-1),l(X,Y),l(X,Y+1))}var y=[],x=[];function C(X,Y,b){var z,W,H=y,Z=x;if(a(l(X,Y+1),l(X,Y),l(X,b))&&n(l(X,Y-1),l(X,Y),l(X,b)))return!1;W=s(l(X,Y),l(X,b));for(var Q=0;Q!==X.length;++Q)if(!((Q+1)%X.length===Y||Q===Y)&&a(l(X,Y),l(X,b),l(X,Q+1))&&n(l(X,Y),l(X,b),l(X,Q))&&(H[0]=l(X,Y),H[1]=l(X,b),Z[0]=l(X,Q),Z[1]=l(X,Q+1),z=m(H,Z),s(l(X,Y),z)0?L(X,Y):[X]}function L(X,Y){if(Y.length===0)return[X];if(Y instanceof Array&&Y.length&&Y[0]instanceof Array&&Y[0].length===2&&Y[0][0]instanceof Array){for(var b=[X],z=0;zH)return console.warn("quickDecomp: max level ("+H+") reached."),Y;for(var pt=0;ptat&&(at+=X.length),ft=Number.MAX_VALUE,at3&&z>=0;--z)h(l(X,z-1),l(X,z),l(X,z+1),Y)&&(X.splice(z%X.length,1),b++);return b}function K(X,Y){for(var b=X.length-1;b>=1;--b)for(var z=X[b],W=b-1;W>=0;--W)if(J(z,X[W],Y)){X.splice(b,1);continue}}function j(X,Y,b){return b=b||0,Math.abs(X-Y)<=b}function J(X,Y,b){return j(X[0],Y[0],b)&&j(X[1],Y[1],b)}},52018:(c,m,t)=>{/** + */c.exports={decomp:I,quickDecomp:G,isSimple:B,removeCollinearPoints:V,removeDuplicatePoints:K,makeCCW:d};function m(X,Y,b){b=b||0;var z=[0,0],W,H,Z,Q,k,et,st;return W=X[1][1]-X[0][1],H=X[0][0]-X[1][0],Z=W*X[0][0]+H*X[0][1],Q=Y[1][1]-Y[0][1],k=Y[0][0]-Y[1][0],et=Q*Y[0][0]+k*Y[0][1],st=W*k-Q*H,j(st,0,b)||(z[0]=(k*Z-H*et)/st,z[1]=(W*et-Q*Z)/st),z}function t(X,Y,b,z){var W=Y[0]-X[0],H=Y[1]-X[1],Z=z[0]-b[0],Q=z[1]-b[1];if(Z*H-Q*W===0)return!1;var k=(W*(b[1]-X[1])+H*(X[0]-b[0]))/(Z*H-Q*W),et=(Z*(X[1]-b[1])+Q*(b[0]-X[0]))/(Q*W-Z*H);return k>=0&&k<=1&&et>=0&&et<=1}function o(X,Y,b){return(Y[0]-X[0])*(b[1]-X[1])-(b[0]-X[0])*(Y[1]-X[1])}function v(X,Y,b){return o(X,Y,b)>0}function a(X,Y,b){return o(X,Y,b)>=0}function r(X,Y,b){return o(X,Y,b)<0}function n(X,Y,b){return o(X,Y,b)<=0}var e=[],i=[];function h(X,Y,b,z){if(z){var W=e,H=i;W[0]=Y[0]-X[0],W[1]=Y[1]-X[1],H[0]=b[0]-Y[0],H[1]=b[1]-Y[1];var Z=W[0]*H[0]+W[1]*H[1],Q=Math.sqrt(W[0]*W[0]+W[1]*W[1]),k=Math.sqrt(H[0]*H[0]+H[1]*H[1]),et=Math.acos(Z/(Q*k));return etb[Y][0])&&(Y=z);return v(l(X,Y-1),l(X,Y),l(X,Y+1))?!1:(p(X),!0)}function p(X){for(var Y=[],b=X.length,z=0;z!==b;z++)Y.push(X.pop());for(var z=0;z!==b;z++)X[z]=Y[z]}function g(X,Y){return r(l(X,Y-1),l(X,Y),l(X,Y+1))}var x=[],y=[];function C(X,Y,b){var z,W,H=x,Z=y;if(a(l(X,Y+1),l(X,Y),l(X,b))&&n(l(X,Y-1),l(X,Y),l(X,b)))return!1;W=s(l(X,Y),l(X,b));for(var Q=0;Q!==X.length;++Q)if(!((Q+1)%X.length===Y||Q===Y)&&a(l(X,Y),l(X,b),l(X,Q+1))&&n(l(X,Y),l(X,b),l(X,Q))&&(H[0]=l(X,Y),H[1]=l(X,b),Z[0]=l(X,Q),Z[1]=l(X,Q+1),z=m(H,Z),s(l(X,Y),z)0?L(X,Y):[X]}function L(X,Y){if(Y.length===0)return[X];if(Y instanceof Array&&Y.length&&Y[0]instanceof Array&&Y[0].length===2&&Y[0][0]instanceof Array){for(var b=[X],z=0;zH)return console.warn("quickDecomp: max level ("+H+") reached."),Y;for(var pt=0;ptat&&(at+=X.length),ft=Number.MAX_VALUE,at3&&z>=0;--z)h(l(X,z-1),l(X,z),l(X,z+1),Y)&&(X.splice(z%X.length,1),b++);return b}function K(X,Y){for(var b=X.length-1;b>=1;--b)for(var z=X[b],W=b-1;W>=0;--W)if(J(z,X[W],Y)){X.splice(b,1);continue}}function j(X,Y,b){return b=b||0,Math.abs(X-Y)<=b}function J(X,Y,b){return j(X[0],Y[0],b)&&j(X[1],Y[1],b)}},52018:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} @@ -4614,7 +4614,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(8443),a=t(50792),r=t(74099),n=t(44603),e=t(39429),i=t(95540),h=t(37277),s=t(72905),l=new o({Extends:a,initialize:function(u){a.call(this),this.game=u,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],u.isBooted?this.boot():u.events.once(v.BOOT,this.boot,this)},boot:function(){var f,u,d,p,g,y,x,C=this.game.config,P=C.installGlobalPlugins;for(P=P.concat(this._pendingGlobal),f=0;f{/** + */var o=t(83419),v=t(8443),a=t(50792),r=t(74099),n=t(44603),e=t(39429),i=t(95540),h=t(37277),s=t(72905),l=new o({Extends:a,initialize:function(u){a.call(this),this.game=u,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],u.isBooted?this.boot():u.events.once(v.BOOT,this.boot,this)},boot:function(){var f,u,d,p,g,x,y,C=this.game.config,P=C.installGlobalPlugins;for(P=P.concat(this._pendingGlobal),f=0;f{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} @@ -4635,7 +4635,7 @@ return new `+this.key+`(); * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(19715),v=t(32880),a=t(83419),r=t(8054),n=t(50792),e=t(92503),i=t(56373),h=t(97480),s=t(69442),l=t(61340),f=new a({Extends:n,initialize:function(d){n.call(this);var p=d.config;this.config={clearBeforeRender:p.clearBeforeRender,backgroundColor:p.backgroundColor,antialias:p.antialias,roundPixels:p.roundPixels},this.game=d,this.type=r.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=d.canvas;var g={alpha:d.config.transparent,desynchronized:d.config.desynchronized,willReadFrequently:!1};this.gameContext=p.context?p.context:this.gameCanvas.getContext("2d",g),this.currentContext=this.gameContext,this.antialias=d.config.antialias,this.blendModes=i(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(s.READY,this.boot,this)},boot:function(){var u=this.game,d=u.scale.baseSize;this.width=d.width,this.height=d.height,this.isBooted=!0,u.scale.on(h.RESIZE,this.onResize,this),this.resize(d.width,d.height)},onResize:function(u,d){(d.width!==this.width||d.height!==this.height)&&this.resize(d.width,d.height)},resize:function(u,d){this.width=u,this.height=d,this.emit(e.RESIZE,u,d)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(u){return this.currentContext.globalCompositeOperation=u,this},setContext:function(u){return this.currentContext=u||this.gameContext,this},setAlpha:function(u){return this.currentContext.globalAlpha=u,this},preRender:function(){var u=this.gameContext,d=this.config,p=this.width,g=this.height;u.globalAlpha=1,u.globalCompositeOperation="source-over",u.setTransform(1,0,0,1,0,0),d.clearBeforeRender&&(u.clearRect(0,0,p,g),d.transparent||(u.fillStyle=d.backgroundColor.rgba,u.fillRect(0,0,p,g))),u.save(),this.drawCount=0,this.emit(e.PRE_RENDER)},render:function(u,d,p){var g=d.length;this.emit(e.RENDER,u,p);var y=p.x,x=p.y,C=p.width,P=p.height,M=p.renderToTexture?p.context:u.sys.context;M.save(),this.game.scene.customViewports&&(M.beginPath(),M.rect(y,x,C,P),M.clip()),p.emit(o.PRE_RENDER,p),this.currentContext=M;var w=p.mask;w&&w.preRenderCanvas(this,null,p._maskCamera),p.transparent||(M.fillStyle=p.backgroundColor.rgba,M.fillRect(y,x,C,P)),M.globalAlpha=p.alpha,M.globalCompositeOperation="source-over",this.drawCount+=g,p.renderToTexture&&p.emit(o.PRE_RENDER,p),p.matrix.copyToContext(M);for(var I=0;I=0?j=-(j+L):j<0&&(j=Math.abs(j)-L)),u.flipY&&(J>=0?J=-(J+B):J<0&&(J=Math.abs(J)-B))}var Y=1,b=1;u.flipX&&(N||(j+=-d.realWidth+V*2),Y=-1),u.flipY&&(N||(J+=-d.realHeight+K*2),b=-1);var z=u.x,W=u.y;P.applyITRS(z,W,u.rotation,u.scaleX*Y,u.scaleY*b),C.copyFrom(p.matrix),g?(C.multiplyWithOffset(g,-p.scrollX*u.scrollFactorX,-p.scrollY*u.scrollFactorY),P.e=z,P.f=W):(P.e-=p.scrollX*u.scrollFactorX,P.f-=p.scrollY*u.scrollFactorY),C.multiply(P),p.roundPixels&&(C.e=Math.round(C.e),C.f=Math.round(C.f)),x.save(),C.setToContext(x),x.globalCompositeOperation=this.blendModes[u.blendMode],x.globalAlpha=y,x.imageSmoothingEnabled=!d.source.scaleMode,u.mask&&u.mask.preRenderCanvas(this,u,p),L>0&&B>0&&(p.roundPixels?x.drawImage(d.source.image,w,I,L,B,Math.round(j),Math.round(J),Math.round(L/G),Math.round(B/G)):x.drawImage(d.source.image,w,I,L,B,j,J,L/G,B/G)),u.mask&&u.mask.postRenderCanvas(this,u,p),x.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});c.exports=f},55830:(c,m,t)=>{/** + */var o=t(19715),v=t(32880),a=t(83419),r=t(8054),n=t(50792),e=t(92503),i=t(56373),h=t(97480),s=t(69442),l=t(61340),f=new a({Extends:n,initialize:function(d){n.call(this);var p=d.config;this.config={clearBeforeRender:p.clearBeforeRender,backgroundColor:p.backgroundColor,antialias:p.antialias,roundPixels:p.roundPixels},this.game=d,this.type=r.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=d.canvas;var g={alpha:d.config.transparent,desynchronized:d.config.desynchronized,willReadFrequently:!1};this.gameContext=p.context?p.context:this.gameCanvas.getContext("2d",g),this.currentContext=this.gameContext,this.antialias=d.config.antialias,this.blendModes=i(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(s.READY,this.boot,this)},boot:function(){var u=this.game,d=u.scale.baseSize;this.width=d.width,this.height=d.height,this.isBooted=!0,u.scale.on(h.RESIZE,this.onResize,this),this.resize(d.width,d.height)},onResize:function(u,d){(d.width!==this.width||d.height!==this.height)&&this.resize(d.width,d.height)},resize:function(u,d){this.width=u,this.height=d,this.emit(e.RESIZE,u,d)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(u){return this.currentContext.globalCompositeOperation=u,this},setContext:function(u){return this.currentContext=u||this.gameContext,this},setAlpha:function(u){return this.currentContext.globalAlpha=u,this},preRender:function(){var u=this.gameContext,d=this.config,p=this.width,g=this.height;u.globalAlpha=1,u.globalCompositeOperation="source-over",u.setTransform(1,0,0,1,0,0),d.clearBeforeRender&&(u.clearRect(0,0,p,g),d.transparent||(u.fillStyle=d.backgroundColor.rgba,u.fillRect(0,0,p,g))),u.save(),this.drawCount=0,this.emit(e.PRE_RENDER)},render:function(u,d,p){var g=d.length;this.emit(e.RENDER,u,p);var x=p.x,y=p.y,C=p.width,P=p.height,M=p.renderToTexture?p.context:u.sys.context;M.save(),this.game.scene.customViewports&&(M.beginPath(),M.rect(x,y,C,P),M.clip()),p.emit(o.PRE_RENDER,p),this.currentContext=M;var w=p.mask;w&&w.preRenderCanvas(this,null,p._maskCamera),p.transparent||(M.fillStyle=p.backgroundColor.rgba,M.fillRect(x,y,C,P)),M.globalAlpha=p.alpha,M.globalCompositeOperation="source-over",this.drawCount+=g,p.renderToTexture&&p.emit(o.PRE_RENDER,p),p.matrix.copyToContext(M);for(var I=0;I=0?j=-(j+L):j<0&&(j=Math.abs(j)-L)),u.flipY&&(J>=0?J=-(J+B):J<0&&(J=Math.abs(J)-B))}var Y=1,b=1;u.flipX&&(N||(j+=-d.realWidth+V*2),Y=-1),u.flipY&&(N||(J+=-d.realHeight+K*2),b=-1);var z=u.x,W=u.y;P.applyITRS(z,W,u.rotation,u.scaleX*Y,u.scaleY*b),C.copyFrom(p.matrix),g?(C.multiplyWithOffset(g,-p.scrollX*u.scrollFactorX,-p.scrollY*u.scrollFactorY),P.e=z,P.f=W):(P.e-=p.scrollX*u.scrollFactorX,P.f-=p.scrollY*u.scrollFactorY),C.multiply(P),p.roundPixels&&(C.e=Math.round(C.e),C.f=Math.round(C.f)),y.save(),C.setToContext(y),y.globalCompositeOperation=this.blendModes[u.blendMode],y.globalAlpha=x,y.imageSmoothingEnabled=!d.source.scaleMode,u.mask&&u.mask.preRenderCanvas(this,u,p),L>0&&B>0&&(p.roundPixels?y.drawImage(d.source.image,w,I,L,B,Math.round(j),Math.round(J),Math.round(L/G),Math.round(B/G)):y.drawImage(d.source.image,w,I,L,B,j,J,L/G,B/G)),u.mask&&u.mask.postRenderCanvas(this,u,p),y.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});c.exports=f},55830:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4683,11 +4683,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(27919),v=t(40987),a=t(95540),r=function(n,e){var i=a(e,"callback"),h=a(e,"type","image/png"),s=a(e,"encoder",.92),l=Math.abs(Math.round(a(e,"x",0))),f=Math.abs(Math.round(a(e,"y",0))),u=Math.floor(a(e,"width",n.width)),d=Math.floor(a(e,"height",n.height)),p=a(e,"getPixel",!1);if(p){var g=n.getContext("2d",{willReadFrequently:!1}),y=g.getImageData(l,f,1,1),x=y.data;i.call(null,new v(x[0],x[1],x[2],x[3]))}else if(l!==0||f!==0||u!==n.width||d!==n.height){var C=o.createWebGL(this,u,d),P=C.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&P.drawImage(n,l,f,u,d,0,0,u,d);var M=new Image;M.onerror=function(){i.call(null),o.remove(C)},M.onload=function(){i.call(null,M),o.remove(C)},M.src=C.toDataURL(h,s)}else{var w=new Image;w.onerror=function(){i.call(null)},w.onload=function(){i.call(null,w)},w.src=n.toDataURL(h,s)}};c.exports=r},88815:(c,m,t)=>{/** + */var o=t(27919),v=t(40987),a=t(95540),r=function(n,e){var i=a(e,"callback"),h=a(e,"type","image/png"),s=a(e,"encoder",.92),l=Math.abs(Math.round(a(e,"x",0))),f=Math.abs(Math.round(a(e,"y",0))),u=Math.floor(a(e,"width",n.width)),d=Math.floor(a(e,"height",n.height)),p=a(e,"getPixel",!1);if(p){var g=n.getContext("2d",{willReadFrequently:!1}),x=g.getImageData(l,f,1,1),y=x.data;i.call(null,new v(y[0],y[1],y[2],y[3]))}else if(l!==0||f!==0||u!==n.width||d!==n.height){var C=o.createWebGL(this,u,d),P=C.getContext("2d",{willReadFrequently:!0});u>0&&d>0&&P.drawImage(n,l,f,u,d,0,0,u,d);var M=new Image;M.onerror=function(){i.call(null),o.remove(C)},M.onload=function(){i.call(null,M),o.remove(C)},M.src=C.toDataURL(h,s)}else{var w=new Image;w.onerror=function(){i.call(null)},w.onload=function(){i.call(null,w)},w.src=n.toDataURL(h,s)}};c.exports=r},88815:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(27919),v=t(40987),a=t(95540),r=function(n,e){var i=n,h=a(e,"callback"),s=a(e,"type","image/png"),l=a(e,"encoder",.92),f=Math.abs(Math.round(a(e,"x",0))),u=Math.abs(Math.round(a(e,"y",0))),d=a(e,"getPixel",!1),p=a(e,"isFramebuffer",!1),g=p?a(e,"bufferWidth",1):i.drawingBufferWidth,y=p?a(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var x=new Uint8Array(4),C=p?u:y-u;i.readPixels(f,C,1,1,i.RGBA,i.UNSIGNED_BYTE,x),h.call(null,new v(x[0],x[1],x[2],x[3]))}else{var P=Math.floor(a(e,"width",g)),M=Math.floor(a(e,"height",y)),w=P*M*4,I=new Uint8Array(w);i.readPixels(f,y-u-M,P,M,i.RGBA,i.UNSIGNED_BYTE,I);for(var L=o.createWebGL(this,P,M),B=L.getContext("2d",{willReadFrequently:!0}),N=B.getImageData(0,0,P,M),G=N.data,V=0;V{/** + */var o=t(27919),v=t(40987),a=t(95540),r=function(n,e){var i=n,h=a(e,"callback"),s=a(e,"type","image/png"),l=a(e,"encoder",.92),f=Math.abs(Math.round(a(e,"x",0))),u=Math.abs(Math.round(a(e,"y",0))),d=a(e,"getPixel",!1),p=a(e,"isFramebuffer",!1),g=p?a(e,"bufferWidth",1):i.drawingBufferWidth,x=p?a(e,"bufferHeight",1):i.drawingBufferHeight;if(d){var y=new Uint8Array(4),C=p?u:x-u;i.readPixels(f,C,1,1,i.RGBA,i.UNSIGNED_BYTE,y),h.call(null,new v(y[0],y[1],y[2],y[3]))}else{var P=Math.floor(a(e,"width",g)),M=Math.floor(a(e,"height",x)),w=P*M*4,I=new Uint8Array(w);i.readPixels(f,x-u-M,P,M,i.RGBA,i.UNSIGNED_BYTE,I);for(var L=o.createWebGL(this,P,M),B=L.getContext("2d",{willReadFrequently:!0}),N=B.getImageData(0,0,P,M),G=N.data,V=0;V{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4695,7 +4695,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(36060),a=t(90330),r=t(82264),n=t(95540),e=t(32302),i=t(63448),h=t(31302),s=t(58918),l=t(14811),f=t(92651),u=t(96569),d=t(56527),p=t(57516),g=t(43439),y=t(81041),x=t(12385),C=t(7589),P=t(95428),M=t(72905),w=new o({initialize:function(L){this.game=L.game,this.renderer=L,this.classes=new a([[v.UTILITY_PIPELINE,C],[v.MULTI_PIPELINE,p],[v.BITMAPMASK_PIPELINE,h],[v.SINGLE_PIPELINE,x],[v.ROPE_PIPELINE,y],[v.LIGHT_PIPELINE,u],[v.POINTLIGHT_PIPELINE,g],[v.MOBILE_PIPELINE,d]]),this.postPipelineClasses=new a,this.pipelines=new a,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(I,L,B){var N=this.renderer,G=this.renderTargets;this.frameInc=Math.floor(n(I,"frameInc",32));var V=N.width,K=N.height,j=this.game.config.disablePreFX,J=this.game.config.disablePostFX;if(J||this.postPipelineClasses.setAll([[String(l.BARREL),s.Barrel],[String(l.BLOOM),s.Bloom],[String(l.BLUR),s.Blur],[String(l.BOKEH),s.Bokeh],[String(l.CIRCLE),s.Circle],[String(l.COLOR_MATRIX),s.ColorMatrix],[String(l.DISPLACEMENT),s.Displacement],[String(l.GLOW),s.Glow],[String(l.GRADIENT),s.Gradient],[String(l.PIXELATE),s.Pixelate],[String(l.SHADOW),s.Shadow],[String(l.SHINE),s.Shine],[String(l.VIGNETTE),s.Vignette],[String(l.WIPE),s.Wipe]]),!j){this.classes.set(v.FX_PIPELINE,f);for(var X=Math.min(V,K),Y=Math.ceil(X/this.frameInc),b=1;b=0;B--){var N=L[B];N.active&&N.preBatch(I)}}},postBatch:function(I){if(I.hasPostPipeline){this.flush();for(var L=I.postPipelines,B=0;B=0;B--){var N=L[B];N.active&&N.preBatch(I)}}},postBatchCamera:function(I){if(I.hasPostPipeline){this.flush();for(var L=I.postPipelines,B=0;Bthis.maxDimension)return this.targetIndex=L.length-B,L[this.targetIndex];var N=(i(I,this.frameInc,0,!0)-1)*B;return this.targetIndex=N,L[N]},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}});c.exports=w},32302:(c,m,t)=>{/** + */var o=t(83419),v=t(36060),a=t(90330),r=t(82264),n=t(95540),e=t(32302),i=t(63448),h=t(31302),s=t(58918),l=t(14811),f=t(92651),u=t(96569),d=t(56527),p=t(57516),g=t(43439),x=t(81041),y=t(12385),C=t(7589),P=t(95428),M=t(72905),w=new o({initialize:function(L){this.game=L.game,this.renderer=L,this.classes=new a([[v.UTILITY_PIPELINE,C],[v.MULTI_PIPELINE,p],[v.BITMAPMASK_PIPELINE,h],[v.SINGLE_PIPELINE,y],[v.ROPE_PIPELINE,x],[v.LIGHT_PIPELINE,u],[v.POINTLIGHT_PIPELINE,g],[v.MOBILE_PIPELINE,d]]),this.postPipelineClasses=new a,this.pipelines=new a,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(I,L,B){var N=this.renderer,G=this.renderTargets;this.frameInc=Math.floor(n(I,"frameInc",32));var V=N.width,K=N.height,j=this.game.config.disablePreFX,J=this.game.config.disablePostFX;if(J||this.postPipelineClasses.setAll([[String(l.BARREL),s.Barrel],[String(l.BLOOM),s.Bloom],[String(l.BLUR),s.Blur],[String(l.BOKEH),s.Bokeh],[String(l.CIRCLE),s.Circle],[String(l.COLOR_MATRIX),s.ColorMatrix],[String(l.DISPLACEMENT),s.Displacement],[String(l.GLOW),s.Glow],[String(l.GRADIENT),s.Gradient],[String(l.PIXELATE),s.Pixelate],[String(l.SHADOW),s.Shadow],[String(l.SHINE),s.Shine],[String(l.VIGNETTE),s.Vignette],[String(l.WIPE),s.Wipe]]),!j){this.classes.set(v.FX_PIPELINE,f);for(var X=Math.min(V,K),Y=Math.ceil(X/this.frameInc),b=1;b=0;B--){var N=L[B];N.active&&N.preBatch(I)}}},postBatch:function(I){if(I.hasPostPipeline){this.flush();for(var L=I.postPipelines,B=0;B=0;B--){var N=L[B];N.active&&N.preBatch(I)}}},postBatchCamera:function(I){if(I.hasPostPipeline){this.flush();for(var L=I.postPipelines,B=0;Bthis.maxDimension)return this.targetIndex=L.length-B,L[this.targetIndex];var N=(i(I,this.frameInc,0,!0)-1)*B;return this.targetIndex=N,L[N]},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}});c.exports=w},32302:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4713,17 +4713,17 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(62644),a=t(50792),r=t(77085),n=t(95540),e=t(37867),i=t(92503),h=t(32302),s=t(70554),l=t(38683),f=new o({Extends:a,initialize:function(d){a.call(this);var p=d.game,g=p.renderer,y=g.gl;this.name=n(d,"name","WebGLPipeline"),this.game=p,this.renderer=g,this.manager,this.gl=y,this.view=p.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=n(d,"topology",y.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=n(d,"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=d,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=n(d,"resizeUniform","")},boot:function(){var u,d=this.gl,p=this.config,g=this.renderer;this.isPostFX||(this.projectionMatrix=new e().identity());var y=this.renderTargets,x=n(p,"renderTarget",!1);typeof x=="boolean"&&x&&(x=1);var C=g.width,P=g.height;if(typeof x=="number")for(u=0;uV&&(V=G[u].vertexSize);var K=n(p,"batchSize",g.config.batchSize);this.vertexCapacity=K*6;var j=new ArrayBuffer(this.vertexCapacity*V);this.vertexData=j,this.bytes=new Uint8Array(j),this.vertexViewF32=new Float32Array(j),this.vertexViewU32=new Uint32Array(j);var J=n(p,"vertices",null);for(J?(this.vertexViewF32.set(J),this.vertexBuffer=g.createVertexBuffer(j,d.STATIC_DRAW)):this.vertexBuffer=g.createVertexBuffer(j.byteLength,d.DYNAMIC_DRAW),this.setVertexBuffer(),u=G.length-1;u>=0;u--)G[u].rebind();this.hasBooted=!0,g.on(i.RESIZE,this.resize,this),g.on(i.PRE_RENDER,this.onPreRender,this),g.on(i.RENDER,this.onRender,this),g.on(i.POST_RENDER,this.onPostRender,this),this.emit(r.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(u,d,p){var g=this.renderer;if(u!==this.currentShader||g.currentProgram!==this.currentShader.program){this.flush();var y=this.setVertexBuffer(p);y&&!d&&(d=!0),u.bind(d,!1),this.currentShader=u}return this},getShaderByName:function(u){for(var d=this.shaders,p=0;p-1&&(G=X.substring(20))}V&&K&&B.push(new l(this,G,V,K,v(j)))}this.shaders=B}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(u){return this.currentBatch={start:this.vertexCount,count:0,texture:[u],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=u,this.batch.push(this.currentBatch),0},addTextureToBatch:function(u){var d=this.currentBatch;d&&(d.texture.push(u),d.unit++,d.maxUnit++)},pushBatch:function(u){if(!this.currentBatch||this.forceZero&&u!==this.currentTexture)return this.createBatch(u);if(u===this.currentTexture)return this.currentUnit;var d=this.currentBatch,p=d.texture.indexOf(u);return p===-1?d.texture.length===this.renderer.maxTextures?this.createBatch(u):(d.unit++,d.maxUnit++,d.texture.push(u),this.currentUnit=d.unit,this.currentTexture=u,d.unit):(this.currentUnit=p,this.currentTexture=u,p)},setGameObject:function(u,d){return d===void 0&&(d=u.frame),this.pushBatch(d.source.glTexture)},shouldFlush:function(u){return u===void 0&&(u=0),this.vertexCount+u>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(u,d){(u!==this.width||d!==this.height)&&this.flush(),this.width=u,this.height=d;for(var p=this.renderTargets,g=0;g=0;p--){var g=d[p].rebind();(!u||g===u)&&(this.currentShader=g)}return this.activeTextures.length=0,this.emit(r.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var u=this.shaders,d=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,d&&this.setVertexBuffer();for(var p=0;p0){this.emit(r.BEFORE_FLUSH,this,u),this.onBeforeFlush(u);var d=this.gl,p=this.vertexCount,g=this.currentShader.vertexSize,y=this.topology;if(this.active){this.setVertexBuffer(),p===this.vertexCapacity?d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.DYNAMIC_DRAW):d.bufferSubData(d.ARRAY_BUFFER,0,this.bytes.subarray(0,p*g));var x,C,P,M=this.batch,w=this.activeTextures;if(this.forceZero)for(w[0]||d.activeTexture(d.TEXTURE0),x=0;x{/** + */var o=t(83419),v=t(62644),a=t(50792),r=t(77085),n=t(95540),e=t(37867),i=t(92503),h=t(32302),s=t(70554),l=t(38683),f=new o({Extends:a,initialize:function(d){a.call(this);var p=d.game,g=p.renderer,x=g.gl;this.name=n(d,"name","WebGLPipeline"),this.game=p,this.renderer=g,this.manager,this.gl=x,this.view=p.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=n(d,"topology",x.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=n(d,"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=d,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=n(d,"resizeUniform","")},boot:function(){var u,d=this.gl,p=this.config,g=this.renderer;this.isPostFX||(this.projectionMatrix=new e().identity());var x=this.renderTargets,y=n(p,"renderTarget",!1);typeof y=="boolean"&&y&&(y=1);var C=g.width,P=g.height;if(typeof y=="number")for(u=0;uV&&(V=G[u].vertexSize);var K=n(p,"batchSize",g.config.batchSize);this.vertexCapacity=K*6;var j=new ArrayBuffer(this.vertexCapacity*V);this.vertexData=j,this.bytes=new Uint8Array(j),this.vertexViewF32=new Float32Array(j),this.vertexViewU32=new Uint32Array(j);var J=n(p,"vertices",null);for(J?(this.vertexViewF32.set(J),this.vertexBuffer=g.createVertexBuffer(j,d.STATIC_DRAW)):this.vertexBuffer=g.createVertexBuffer(j.byteLength,d.DYNAMIC_DRAW),this.setVertexBuffer(),u=G.length-1;u>=0;u--)G[u].rebind();this.hasBooted=!0,g.on(i.RESIZE,this.resize,this),g.on(i.PRE_RENDER,this.onPreRender,this),g.on(i.RENDER,this.onRender,this),g.on(i.POST_RENDER,this.onPostRender,this),this.emit(r.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(u,d,p){var g=this.renderer;if(u!==this.currentShader||g.currentProgram!==this.currentShader.program){this.flush();var x=this.setVertexBuffer(p);x&&!d&&(d=!0),u.bind(d,!1),this.currentShader=u}return this},getShaderByName:function(u){for(var d=this.shaders,p=0;p-1&&(G=X.substring(20))}V&&K&&B.push(new l(this,G,V,K,v(j)))}this.shaders=B}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(u){return this.currentBatch={start:this.vertexCount,count:0,texture:[u],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=u,this.batch.push(this.currentBatch),0},addTextureToBatch:function(u){var d=this.currentBatch;d&&(d.texture.push(u),d.unit++,d.maxUnit++)},pushBatch:function(u){if(!this.currentBatch||this.forceZero&&u!==this.currentTexture)return this.createBatch(u);if(u===this.currentTexture)return this.currentUnit;var d=this.currentBatch,p=d.texture.indexOf(u);return p===-1?d.texture.length===this.renderer.maxTextures?this.createBatch(u):(d.unit++,d.maxUnit++,d.texture.push(u),this.currentUnit=d.unit,this.currentTexture=u,d.unit):(this.currentUnit=p,this.currentTexture=u,p)},setGameObject:function(u,d){return d===void 0&&(d=u.frame),this.pushBatch(d.source.glTexture)},shouldFlush:function(u){return u===void 0&&(u=0),this.vertexCount+u>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(u,d){(u!==this.width||d!==this.height)&&this.flush(),this.width=u,this.height=d;for(var p=this.renderTargets,g=0;g=0;p--){var g=d[p].rebind();(!u||g===u)&&(this.currentShader=g)}return this.activeTextures.length=0,this.emit(r.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var u=this.shaders,d=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,d&&this.setVertexBuffer();for(var p=0;p0){this.emit(r.BEFORE_FLUSH,this,u),this.onBeforeFlush(u);var d=this.gl,p=this.vertexCount,g=this.currentShader.vertexSize,x=this.topology;if(this.active){this.setVertexBuffer(),p===this.vertexCapacity?d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.DYNAMIC_DRAW):d.bufferSubData(d.ARRAY_BUFFER,0,this.bytes.subarray(0,p*g));var y,C,P,M=this.batch,w=this.activeTextures;if(this.forceZero)for(w[0]||d.activeTexture(d.TEXTURE0),y=0;y{/** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95428),v=t(72905),a=t(19715),r=t(83419),n=t(8054),e=t(50792),i=t(92503),h=t(50030),s=t(37867),l=t(29747),f=t(7530),u=t(32302),d=t(97480),p=t(69442),g=t(70554),y=t(88815),x=t(26128),C=t(1482),P=t(82751),M=t(84387),w=t(93567),I=t(57183),L=new r({Extends:e,initialize:function(N){e.call(this);var G=N.config,V={alpha:G.transparent,desynchronized:G.desynchronized,depth:!0,antialias:G.antialiasGL,premultipliedAlpha:G.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:G.failIfMajorPerformanceCaveat,powerPreference:G.powerPreference,preserveDrawingBuffer:G.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:G.clearBeforeRender,antialias:G.antialias,backgroundColor:G.backgroundColor,contextCreation:V,roundPixels:G.roundPixels,maxTextures:G.maxTextures,maxTextureSize:G.maxTextureSize,batchSize:G.batchSize,maxLights:G.maxLights,mipmapFilter:G.mipmapFilter},this.game=N,this.type=n.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=N.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=l,this.contextRestoredHandler=l,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(B){var N,G=this.game,V=this.canvas,K=B.backgroundColor;if(G.config.context?N=G.config.context:N=V.getContext("webgl",B.contextCreation)||V.getContext("experimental-webgl",B.contextCreation),!N||N.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=N;var j=this,J=function(){var b=N.getSupportedExtensions();j.supportedExtensions=b;var z="ANGLE_instanced_arrays";j.instancedArraysExtension=b.indexOf(z)>-1?N.getExtension(z):null;var W="OES_vertex_array_object";j.vaoExtension=b.indexOf(W)>-1?N.getExtension(W):null};J(),this.contextLostHandler=function(b){j.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),j.emit(i.LOSE_WEBGL,j),b.preventDefault()},V.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(b){if(N.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}j.currentProgram=null,j.currentFramebuffer=null,j.setBlendMode(n.BlendModes.NORMAL),N.disable(N.BLEND),N.disable(N.DEPTH_TEST),N.enable(N.CULL_FACE),j.compression=j.getCompressedTextures();var z=function(W){W.createResource()};o(j.glTextureWrappers,z),o(j.glBufferWrappers,z),o(j.glFramebufferWrappers,z),o(j.glProgramWrappers,z),o(j.glAttribLocationWrappers,z),o(j.glUniformLocationWrappers,z),j.createTemporaryTextures(),j.pipelines.restoreContext(),j.resize(j.game.scale.baseSize.width,j.game.scale.baseSize.height),J(),j.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),j.emit(i.RESTORE_WEBGL,j),b.preventDefault()},V.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),G.context=N;for(var X=0;X<=27;X++)this.blendModes.push({func:[N.ONE,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_ADD});this.blendModes[1].func=[N.ONE,N.DST_ALPHA],this.blendModes[2].func=[N.DST_COLOR,N.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[N.ONE,N.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[N.ZERO,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_REVERSE_SUBTRACT},this.glFormats=[N.BYTE,N.SHORT,N.UNSIGNED_BYTE,N.UNSIGNED_SHORT,N.FLOAT],this.glFuncMap={mat2:{func:N.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:N.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:N.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:N.uniform1f,length:1},"1fv":{func:N.uniform1fv,length:1},"1i":{func:N.uniform1i,length:1},"1iv":{func:N.uniform1iv,length:1},"2f":{func:N.uniform2f,length:2},"2fv":{func:N.uniform2fv,length:1},"2i":{func:N.uniform2i,length:2},"2iv":{func:N.uniform2iv,length:1},"3f":{func:N.uniform3f,length:3},"3fv":{func:N.uniform3fv,length:1},"3i":{func:N.uniform3i,length:3},"3iv":{func:N.uniform3iv,length:1},"4f":{func:N.uniform4f,length:4},"4fv":{func:N.uniform4fv,length:1},"4i":{func:N.uniform4i,length:4},"4iv":{func:N.uniform4iv,length:1}},(!B.maxTextures||B.maxTextures===-1)&&(B.maxTextures=N.getParameter(N.MAX_TEXTURE_IMAGE_UNITS)),B.maxTextureSize||(B.maxTextureSize=N.getParameter(N.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),N.disable(N.DEPTH_TEST),N.disable(N.CULL_FACE),N.enable(N.BLEND),N.clearColor(K.redGL,K.greenGL,K.blueGL,K.alphaGL);var Y=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return Y.indexOf(B.mipmapFilter)!==-1&&(this.mipmapFilter=N[B.mipmapFilter]),this.maxTextures=g.checkShaderMax(N,B.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(n.BlendModes.NORMAL),this.projectionMatrix=new s().identity(),G.textures.once(p.READY,this.boot,this),this},boot:function(){var B=this.game,N=this.pipelines,G=B.scale.baseSize,V=G.width,K=G.height;this.width=V,this.height=K,this.isBooted=!0,this.renderTarget=new u(this,V,K,1,0,!0,!0),this.maskTarget=new u(this,V,K,1,0,!0,!0),this.maskSource=new u(this,V,K,1,0,!0,!0);var j=B.config;N.boot(j.pipeline,j.defaultPipeline,j.autoMobilePipeline),this.blankTexture=B.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=B.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=B.textures.getFrame("__WHITE").glTexture;var J=this.gl;J.bindFramebuffer(J.FRAMEBUFFER,null),J.enable(J.SCISSOR_TEST),B.scale.on(d.RESIZE,this.onResize,this),this.resize(V,K)},createTemporaryTextures:function(){for(var B=this.gl,N=0;N0&&V>0;if(J&&X){var Y=J[0],b=J[1],z=J[2],W=J[3];X=Y!==B||b!==N||z!==G||W!==V}X&&(this.flush(),j.scissor(B,K-N-V,G,V))},resetScissor:function(){var B=this.gl;B.enable(B.SCISSOR_TEST);var N=this.currentScissor;if(N){var G=N[0],V=N[1],K=N[2],j=N[3];K>0&&j>0&&B.scissor(G,this.drawingBufferHeight-V-j,K,j)}},popScissor:function(){var B=this.scissorStack;B.pop();var N=B[B.length-1];N&&this.setScissor(N[0],N[1],N[2],N[3]),this.currentScissor=N},hasActiveStencilMask:function(){var B=this.currentMask.mask,N=this.currentCameraMask.mask;return B&&B.isStencil||N&&N.isStencil},resetViewport:function(){var B=this.gl;B.viewport(0,0,this.width,this.height),this.drawingBufferHeight=B.drawingBufferHeight},setBlendMode:function(B,N){N===void 0&&(N=!1);var G=this.gl,V=this.blendModes[B];return N||B!==n.BlendModes.SKIP_CHECK&&this.currentBlendMode!==B?(this.flush(),G.enable(G.BLEND),G.blendEquation(V.equation),V.func.length>2?G.blendFuncSeparate(V.func[0],V.func[1],V.func[2],V.func[3]):G.blendFunc(V.func[0],V.func[1]),this.currentBlendMode=B,!0):!1},addBlendMode:function(B,N){var G=this.blendModes.push({func:B,equation:N});return G-1},updateBlendMode:function(B,N,G){return this.blendModes[B]&&(this.blendModes[B].func=N,G&&(this.blendModes[B].equation=G)),this},removeBlendMode:function(B){return B>17&&this.blendModes[B]&&this.blendModes.splice(B,1),this},pushFramebuffer:function(B,N,G,V,K){return B===this.currentFramebuffer?this:(this.fboStack.push(B),this.setFramebuffer(B,N,G,V,K))},setFramebuffer:function(B,N,G,V,K){if(N===void 0&&(N=!1),G===void 0&&(G=!0),V===void 0&&(V=null),K===void 0&&(K=!1),B===this.currentFramebuffer)return this;var j=this.gl,J=this.width,X=this.height;return B&&B.renderTexture&&G?(J=B.renderTexture.width,X=B.renderTexture.height):this.flush(),B?j.bindFramebuffer(j.FRAMEBUFFER,B.webGLFramebuffer):j.bindFramebuffer(j.FRAMEBUFFER,null),G&&j.viewport(0,0,J,X),V&&j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_2D,V.webGLTexture,0),K&&(j.clearColor(0,0,0,0),j.clear(j.COLOR_BUFFER_BIT)),N&&(B?(this.drawingBufferHeight=X,this.pushScissor(0,0,J,X)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=B,this},popFramebuffer:function(B,N){B===void 0&&(B=!1),N===void 0&&(N=!0);var G=this.fboStack;G.pop();var V=G[G.length-1];return V||(V=null),this.setFramebuffer(V,B,N),V},restoreFramebuffer:function(B,N){B===void 0&&(B=!1),N===void 0&&(N=!0);var G=this.fboStack,V=G[G.length-1];V||(V=null),this.currentFramebuffer=null,this.setFramebuffer(V,B,N)},setProgram:function(B){return B!==this.currentProgram?(this.flush(),this.gl.useProgram(B.webGLProgram),this.currentProgram=B,!0):!1},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(B,N,G,V,K){K===void 0&&(K=!1);var j=this.gl,J=j.NEAREST,X=j.NEAREST,Y=j.CLAMP_TO_EDGE,b=null;N=B?B.width:N,G=B?B.height:G;var z=h(N,G);if(z&&!K&&(Y=j.REPEAT),V===n.ScaleModes.LINEAR&&this.config.antialias){var W=B&&B.compressed,H=!W&&z||W&&B.mipmaps.length>1;J=this.mipmapFilter&&H?this.mipmapFilter:j.LINEAR,X=j.LINEAR}return!B&&typeof N=="number"&&typeof G=="number"?b=this.createTexture2D(0,J,X,Y,Y,j.RGBA,null,N,G):b=this.createTexture2D(0,J,X,Y,Y,j.RGBA,B),b},createTexture2D:function(B,N,G,V,K,j,J,X,Y,b,z,W){typeof X!="number"&&(X=J?J.width:1),typeof Y!="number"&&(Y=J?J.height:1);var H=new P(this.gl,B,N,G,V,K,j,J,X,Y,b,z,W);return this.glTextureWrappers.push(H),H},createFramebuffer:function(B,N,G,V){this.currentFramebuffer=null;var K=new M(this.gl,B,N,G,V);return this.glFramebufferWrappers.push(K),K},beginBitmapMask:function(B,N){var G=this.gl;G&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==B&&(this.currentMask.mask=B,this.currentMask.camera=N))},drawBitmapMask:function(B,N,G){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),B.renderWebGL(this,B,N),this.maskSource.unbind(!0),this.maskTarget.unbind();var V=this.gl,K=this.getCurrentStencilMask();K?(V.enable(V.STENCIL_TEST),K.mask.applyStencil(this,K.camera,!0)):this.currentMask.mask=null,this.pipelines.set(G),V.activeTexture(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,this.maskTarget.texture.webGLTexture),V.activeTexture(V.TEXTURE1),V.bindTexture(V.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(B,N){var G=new C(this.gl,B,N);return this.glProgramWrappers.push(G),G},createVertexBuffer:function(B,N){var G=this.gl,V=new x(G,B,G.ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},createAttribLocation:function(B,N){var G=new w(this.gl,B,N);return this.glAttribLocationWrappers.push(G),G},createUniformLocation:function(B,N){var G=new I(this.gl,B,N);return this.glUniformLocationWrappers.push(G),G},createIndexBuffer:function(B,N){var G=this.gl,V=new x(G,B,G.ELEMENT_ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},deleteTexture:function(B){if(B)return v(this.glTextureWrappers,B),B.destroy(),this},deleteFramebuffer:function(B){return B?(v(this.fboStack,B),v(this.glFramebufferWrappers,B),B.destroy(),this):this},deleteProgram:function(B){return B&&(v(this.glProgramWrappers,B),B.destroy()),this},deleteAttribLocation:function(B){return B&&(v(this.glAttribLocationWrappers,B),B.destroy()),this},deleteUniformLocation:function(B){return B&&(v(this.glUniformLocationWrappers,B),B.destroy()),this},deleteBuffer:function(B){return B?(v(this.glBufferWrappers,B),B.destroy(),this):this},preRenderCamera:function(B){var N=B.x,G=B.y,V=B.width,K=B.height,j=B.backgroundColor;if(B.emit(a.PRE_RENDER,B),this.pipelines.preBatchCamera(B),this.pushScissor(N,G,V,K),B.mask&&(this.currentCameraMask.mask=B.mask,this.currentCameraMask.camera=B._maskCamera,B.mask.preRenderWebGL(this,B,B._maskCamera)),j.alphaGL>0){var J=this.pipelines.setMulti();J.drawFillRect(N,G,V,K,g.getTintFromFloats(j.blueGL,j.greenGL,j.redGL,1),j.alphaGL)}},getCurrentStencilMask:function(){var B=null,N=this.maskStack,G=this.currentCameraMask;return N.length>0?B=N[N.length-1]:G.mask&&G.mask.isStencil&&(B=G),B},postRenderCamera:function(B){var N=B.flashEffect,G=B.fadeEffect;if(N.isRunning||G.isRunning||G.isComplete){var V=this.pipelines.setMulti();N.postRenderWebGL(V,g.getTintFromFloats),G.postRenderWebGL(V,g.getTintFromFloats)}B.dirty=!1,this.popScissor(),B.mask&&(this.currentCameraMask.mask=null,B.mask.postRenderWebGL(this,B._maskCamera)),this.pipelines.postBatchCamera(B),B.emit(a.POST_RENDER,B)},preRender:function(){if(!this.contextLost){var B=this.gl;if(B.bindFramebuffer(B.FRAMEBUFFER,null),this.config.clearBeforeRender){var N=this.config.backgroundColor;B.clearColor(N.redGL,N.greenGL,N.blueGL,N.alphaGL),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT|B.STENCIL_BUFFER_BIT)}B.enable(B.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&B.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(i.PRE_RENDER)}},render:function(B,N,G){if(!this.contextLost){var V=N.length;if(this.emit(i.RENDER,B,G),this.preRenderCamera(G),V===0){this.setBlendMode(n.BlendModes.NORMAL),this.postRenderCamera(G);return}this.currentType="";for(var K=this.currentMask,j=0;j{/** + */var o=t(95428),v=t(72905),a=t(19715),r=t(83419),n=t(8054),e=t(50792),i=t(92503),h=t(50030),s=t(37867),l=t(29747),f=t(7530),u=t(32302),d=t(97480),p=t(69442),g=t(70554),x=t(88815),y=t(26128),C=t(1482),P=t(82751),M=t(84387),w=t(93567),I=t(57183),L=new r({Extends:e,initialize:function(N){e.call(this);var G=N.config,V={alpha:G.transparent,desynchronized:G.desynchronized,depth:!0,antialias:G.antialiasGL,premultipliedAlpha:G.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:G.failIfMajorPerformanceCaveat,powerPreference:G.powerPreference,preserveDrawingBuffer:G.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:G.clearBeforeRender,antialias:G.antialias,backgroundColor:G.backgroundColor,contextCreation:V,roundPixels:G.roundPixels,maxTextures:G.maxTextures,maxTextureSize:G.maxTextureSize,batchSize:G.batchSize,maxLights:G.maxLights,mipmapFilter:G.mipmapFilter},this.game=N,this.type=n.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=N.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=l,this.contextRestoredHandler=l,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(B){var N,G=this.game,V=this.canvas,K=B.backgroundColor;if(G.config.context?N=G.config.context:N=V.getContext("webgl",B.contextCreation)||V.getContext("experimental-webgl",B.contextCreation),!N||N.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=N;var j=this,J=function(){var b=N.getSupportedExtensions();j.supportedExtensions=b;var z="ANGLE_instanced_arrays";j.instancedArraysExtension=b.indexOf(z)>-1?N.getExtension(z):null;var W="OES_vertex_array_object";j.vaoExtension=b.indexOf(W)>-1?N.getExtension(W):null};J(),this.contextLostHandler=function(b){j.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),j.emit(i.LOSE_WEBGL,j),b.preventDefault()},V.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(b){if(N.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}j.currentProgram=null,j.currentFramebuffer=null,j.setBlendMode(n.BlendModes.NORMAL),N.disable(N.BLEND),N.disable(N.DEPTH_TEST),N.enable(N.CULL_FACE),j.compression=j.getCompressedTextures();var z=function(W){W.createResource()};o(j.glTextureWrappers,z),o(j.glBufferWrappers,z),o(j.glFramebufferWrappers,z),o(j.glProgramWrappers,z),o(j.glAttribLocationWrappers,z),o(j.glUniformLocationWrappers,z),j.createTemporaryTextures(),j.pipelines.restoreContext(),j.resize(j.game.scale.baseSize.width,j.game.scale.baseSize.height),J(),j.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),j.emit(i.RESTORE_WEBGL,j),b.preventDefault()},V.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),G.context=N;for(var X=0;X<=27;X++)this.blendModes.push({func:[N.ONE,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_ADD});this.blendModes[1].func=[N.ONE,N.DST_ALPHA],this.blendModes[2].func=[N.DST_COLOR,N.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[N.ONE,N.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[N.ZERO,N.ONE_MINUS_SRC_ALPHA],equation:N.FUNC_REVERSE_SUBTRACT},this.glFormats=[N.BYTE,N.SHORT,N.UNSIGNED_BYTE,N.UNSIGNED_SHORT,N.FLOAT],this.glFuncMap={mat2:{func:N.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:N.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:N.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:N.uniform1f,length:1},"1fv":{func:N.uniform1fv,length:1},"1i":{func:N.uniform1i,length:1},"1iv":{func:N.uniform1iv,length:1},"2f":{func:N.uniform2f,length:2},"2fv":{func:N.uniform2fv,length:1},"2i":{func:N.uniform2i,length:2},"2iv":{func:N.uniform2iv,length:1},"3f":{func:N.uniform3f,length:3},"3fv":{func:N.uniform3fv,length:1},"3i":{func:N.uniform3i,length:3},"3iv":{func:N.uniform3iv,length:1},"4f":{func:N.uniform4f,length:4},"4fv":{func:N.uniform4fv,length:1},"4i":{func:N.uniform4i,length:4},"4iv":{func:N.uniform4iv,length:1}},(!B.maxTextures||B.maxTextures===-1)&&(B.maxTextures=N.getParameter(N.MAX_TEXTURE_IMAGE_UNITS)),B.maxTextureSize||(B.maxTextureSize=N.getParameter(N.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),N.disable(N.DEPTH_TEST),N.disable(N.CULL_FACE),N.enable(N.BLEND),N.clearColor(K.redGL,K.greenGL,K.blueGL,K.alphaGL);var Y=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return Y.indexOf(B.mipmapFilter)!==-1&&(this.mipmapFilter=N[B.mipmapFilter]),this.maxTextures=g.checkShaderMax(N,B.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new f(this),this.setBlendMode(n.BlendModes.NORMAL),this.projectionMatrix=new s().identity(),G.textures.once(p.READY,this.boot,this),this},boot:function(){var B=this.game,N=this.pipelines,G=B.scale.baseSize,V=G.width,K=G.height;this.width=V,this.height=K,this.isBooted=!0,this.renderTarget=new u(this,V,K,1,0,!0,!0),this.maskTarget=new u(this,V,K,1,0,!0,!0),this.maskSource=new u(this,V,K,1,0,!0,!0);var j=B.config;N.boot(j.pipeline,j.defaultPipeline,j.autoMobilePipeline),this.blankTexture=B.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=B.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=B.textures.getFrame("__WHITE").glTexture;var J=this.gl;J.bindFramebuffer(J.FRAMEBUFFER,null),J.enable(J.SCISSOR_TEST),B.scale.on(d.RESIZE,this.onResize,this),this.resize(V,K)},createTemporaryTextures:function(){for(var B=this.gl,N=0;N0&&V>0;if(J&&X){var Y=J[0],b=J[1],z=J[2],W=J[3];X=Y!==B||b!==N||z!==G||W!==V}X&&(this.flush(),j.scissor(B,K-N-V,G,V))},resetScissor:function(){var B=this.gl;B.enable(B.SCISSOR_TEST);var N=this.currentScissor;if(N){var G=N[0],V=N[1],K=N[2],j=N[3];K>0&&j>0&&B.scissor(G,this.drawingBufferHeight-V-j,K,j)}},popScissor:function(){var B=this.scissorStack;B.pop();var N=B[B.length-1];N&&this.setScissor(N[0],N[1],N[2],N[3]),this.currentScissor=N},hasActiveStencilMask:function(){var B=this.currentMask.mask,N=this.currentCameraMask.mask;return B&&B.isStencil||N&&N.isStencil},resetViewport:function(){var B=this.gl;B.viewport(0,0,this.width,this.height),this.drawingBufferHeight=B.drawingBufferHeight},setBlendMode:function(B,N){N===void 0&&(N=!1);var G=this.gl,V=this.blendModes[B];return N||B!==n.BlendModes.SKIP_CHECK&&this.currentBlendMode!==B?(this.flush(),G.enable(G.BLEND),G.blendEquation(V.equation),V.func.length>2?G.blendFuncSeparate(V.func[0],V.func[1],V.func[2],V.func[3]):G.blendFunc(V.func[0],V.func[1]),this.currentBlendMode=B,!0):!1},addBlendMode:function(B,N){var G=this.blendModes.push({func:B,equation:N});return G-1},updateBlendMode:function(B,N,G){return this.blendModes[B]&&(this.blendModes[B].func=N,G&&(this.blendModes[B].equation=G)),this},removeBlendMode:function(B){return B>17&&this.blendModes[B]&&this.blendModes.splice(B,1),this},pushFramebuffer:function(B,N,G,V,K){return B===this.currentFramebuffer?this:(this.fboStack.push(B),this.setFramebuffer(B,N,G,V,K))},setFramebuffer:function(B,N,G,V,K){if(N===void 0&&(N=!1),G===void 0&&(G=!0),V===void 0&&(V=null),K===void 0&&(K=!1),B===this.currentFramebuffer)return this;var j=this.gl,J=this.width,X=this.height;return B&&B.renderTexture&&G?(J=B.renderTexture.width,X=B.renderTexture.height):this.flush(),B?j.bindFramebuffer(j.FRAMEBUFFER,B.webGLFramebuffer):j.bindFramebuffer(j.FRAMEBUFFER,null),G&&j.viewport(0,0,J,X),V&&j.framebufferTexture2D(j.FRAMEBUFFER,j.COLOR_ATTACHMENT0,j.TEXTURE_2D,V.webGLTexture,0),K&&(j.clearColor(0,0,0,0),j.clear(j.COLOR_BUFFER_BIT)),N&&(B?(this.drawingBufferHeight=X,this.pushScissor(0,0,J,X)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=B,this},popFramebuffer:function(B,N){B===void 0&&(B=!1),N===void 0&&(N=!0);var G=this.fboStack;G.pop();var V=G[G.length-1];return V||(V=null),this.setFramebuffer(V,B,N),V},restoreFramebuffer:function(B,N){B===void 0&&(B=!1),N===void 0&&(N=!0);var G=this.fboStack,V=G[G.length-1];V||(V=null),this.currentFramebuffer=null,this.setFramebuffer(V,B,N)},setProgram:function(B){return B!==this.currentProgram?(this.flush(),this.gl.useProgram(B.webGLProgram),this.currentProgram=B,!0):!1},resetProgram:function(){return this.gl.useProgram(this.currentProgram.webGLProgramWrapper),this},createTextureFromSource:function(B,N,G,V,K){K===void 0&&(K=!1);var j=this.gl,J=j.NEAREST,X=j.NEAREST,Y=j.CLAMP_TO_EDGE,b=null;N=B?B.width:N,G=B?B.height:G;var z=h(N,G);if(z&&!K&&(Y=j.REPEAT),V===n.ScaleModes.LINEAR&&this.config.antialias){var W=B&&B.compressed,H=!W&&z||W&&B.mipmaps.length>1;J=this.mipmapFilter&&H?this.mipmapFilter:j.LINEAR,X=j.LINEAR}return!B&&typeof N=="number"&&typeof G=="number"?b=this.createTexture2D(0,J,X,Y,Y,j.RGBA,null,N,G):b=this.createTexture2D(0,J,X,Y,Y,j.RGBA,B),b},createTexture2D:function(B,N,G,V,K,j,J,X,Y,b,z,W){typeof X!="number"&&(X=J?J.width:1),typeof Y!="number"&&(Y=J?J.height:1);var H=new P(this.gl,B,N,G,V,K,j,J,X,Y,b,z,W);return this.glTextureWrappers.push(H),H},createFramebuffer:function(B,N,G,V){this.currentFramebuffer=null;var K=new M(this.gl,B,N,G,V);return this.glFramebufferWrappers.push(K),K},beginBitmapMask:function(B,N){var G=this.gl;G&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==B&&(this.currentMask.mask=B,this.currentMask.camera=N))},drawBitmapMask:function(B,N,G){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),B.renderWebGL(this,B,N),this.maskSource.unbind(!0),this.maskTarget.unbind();var V=this.gl,K=this.getCurrentStencilMask();K?(V.enable(V.STENCIL_TEST),K.mask.applyStencil(this,K.camera,!0)):this.currentMask.mask=null,this.pipelines.set(G),V.activeTexture(V.TEXTURE0),V.bindTexture(V.TEXTURE_2D,this.maskTarget.texture.webGLTexture),V.activeTexture(V.TEXTURE1),V.bindTexture(V.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(B,N){var G=new C(this.gl,B,N);return this.glProgramWrappers.push(G),G},createVertexBuffer:function(B,N){var G=this.gl,V=new y(G,B,G.ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},createAttribLocation:function(B,N){var G=new w(this.gl,B,N);return this.glAttribLocationWrappers.push(G),G},createUniformLocation:function(B,N){var G=new I(this.gl,B,N);return this.glUniformLocationWrappers.push(G),G},createIndexBuffer:function(B,N){var G=this.gl,V=new y(G,B,G.ELEMENT_ARRAY_BUFFER,N);return this.glBufferWrappers.push(V),V},deleteTexture:function(B){if(B)return v(this.glTextureWrappers,B),B.destroy(),this},deleteFramebuffer:function(B){return B?(v(this.fboStack,B),v(this.glFramebufferWrappers,B),B.destroy(),this):this},deleteProgram:function(B){return B&&(v(this.glProgramWrappers,B),B.destroy()),this},deleteAttribLocation:function(B){return B&&(v(this.glAttribLocationWrappers,B),B.destroy()),this},deleteUniformLocation:function(B){return B&&(v(this.glUniformLocationWrappers,B),B.destroy()),this},deleteBuffer:function(B){return B?(v(this.glBufferWrappers,B),B.destroy(),this):this},preRenderCamera:function(B){var N=B.x,G=B.y,V=B.width,K=B.height,j=B.backgroundColor;if(B.emit(a.PRE_RENDER,B),this.pipelines.preBatchCamera(B),this.pushScissor(N,G,V,K),B.mask&&(this.currentCameraMask.mask=B.mask,this.currentCameraMask.camera=B._maskCamera,B.mask.preRenderWebGL(this,B,B._maskCamera)),j.alphaGL>0){var J=this.pipelines.setMulti();J.drawFillRect(N,G,V,K,g.getTintFromFloats(j.blueGL,j.greenGL,j.redGL,1),j.alphaGL)}},getCurrentStencilMask:function(){var B=null,N=this.maskStack,G=this.currentCameraMask;return N.length>0?B=N[N.length-1]:G.mask&&G.mask.isStencil&&(B=G),B},postRenderCamera:function(B){var N=B.flashEffect,G=B.fadeEffect;if(N.isRunning||G.isRunning||G.isComplete){var V=this.pipelines.setMulti();N.postRenderWebGL(V,g.getTintFromFloats),G.postRenderWebGL(V,g.getTintFromFloats)}B.dirty=!1,this.popScissor(),B.mask&&(this.currentCameraMask.mask=null,B.mask.postRenderWebGL(this,B._maskCamera)),this.pipelines.postBatchCamera(B),B.emit(a.POST_RENDER,B)},preRender:function(){if(!this.contextLost){var B=this.gl;if(B.bindFramebuffer(B.FRAMEBUFFER,null),this.config.clearBeforeRender){var N=this.config.backgroundColor;B.clearColor(N.redGL,N.greenGL,N.blueGL,N.alphaGL),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT|B.STENCIL_BUFFER_BIT)}B.enable(B.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&B.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.emit(i.PRE_RENDER)}},render:function(B,N,G){if(!this.contextLost){var V=N.length;if(this.emit(i.RENDER,B,G),this.preRenderCamera(G),V===0){this.setBlendMode(n.BlendModes.NORMAL),this.postRenderCamera(G);return}this.currentType="";for(var K=this.currentMask,j=0;j{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(95428),a=t(95540),r=t(14500),n=new o({initialize:function(i,h,s,l,f){this.pipeline=i,this.name=h,this.renderer=i.renderer,this.gl=this.renderer.gl,this.fragSrc=l,this.vertSrc=s,this.program=this.renderer.createProgram(s,l),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(f),this.createUniforms()},createAttributes:function(e){var i=0,h=0,s=[];this.vertexComponentCount=0;for(var l=0;l=0?(i.enableVertexAttribArray(M.webGLAttribLocation),i.vertexAttribPointer(M.webGLAttribLocation,p,g,P,s,y),d.enabled=!0,d.location=M):M.webGLAttribLocation!==-1&&i.disableVertexAttribArray(M.webGLAttribLocation)}else x?i.vertexAttribPointer(C.webGLAttribLocation,p,g,P,s,y):!x&&C!==-1&&C.webGLAttribLocation>-1&&(i.disableVertexAttribArray(C.webGLAttribLocation),d.location=-1)}return this},createUniforms:function(){var e=this.gl,i=this.program,h=this.uniforms,s,l,f,u=e.getProgramParameter(i.webGLProgram,e.ACTIVE_UNIFORMS);for(s=0;s0&&(l=l.substr(0,p),h.hasOwnProperty(l)||(f=this.renderer.createUniformLocation(i,l),f!==null&&(h[l]={name:l,location:f,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var e=this.gl;this.renderer.setProgram(this.program);for(var i in this.uniforms){var h=this.uniforms[i];h.setter&&h.setter.call(e,h.location.webGLUniformLocation,h.value1,h.value2,h.value3,h.value4)}},hasUniform:function(e){return this.uniforms.hasOwnProperty(e)},resetUniform:function(e){var i=this.uniforms[e];return i&&(i.value1=null,i.value2=null,i.value3=null,i.value4=null),this},setUniform1:function(e,i,h,s){var l=this.uniforms[i];return l?((s||l.value1!==h)&&(l.setter||(l.setter=e),l.value1=h,this.renderer.setProgram(this.program),e.call(this.gl,l.location.webGLUniformLocation,h),this.pipeline.currentShader=this),this):this},setUniform2:function(e,i,h,s,l){var f=this.uniforms[i];return f?((l||f.value1!==h||f.value2!==s)&&(f.setter||(f.setter=e),f.value1=h,f.value2=s,this.renderer.setProgram(this.program),e.call(this.gl,f.location.webGLUniformLocation,h,s),this.pipeline.currentShader=this),this):this},setUniform3:function(e,i,h,s,l,f){var u=this.uniforms[i];return u?((f||u.value1!==h||u.value2!==s||u.value3!==l)&&(u.setter||(u.setter=e),u.value1=h,u.value2=s,u.value3=l,this.renderer.setProgram(this.program),e.call(this.gl,u.location.webGLUniformLocation,h,s,l),this.pipeline.currentShader=this),this):this},setUniform4:function(e,i,h,s,l,f,u){var d=this.uniforms[i];return d?((u||d.value1!==h||d.value2!==s||d.value3!==l||d.value4!==f)&&(d.setter||(d.setter=e),d.value1=h,d.value2=s,d.value3=l,d.value4=f,this.renderer.setProgram(this.program),e.call(this.gl,d.location.webGLUniformLocation,h,s,l,f),this.pipeline.currentShader=this),this):this},setBoolean:function(e,i){return this.setUniform1(this.gl.uniform1i,e,Number(i))},set1f:function(e,i){return this.setUniform1(this.gl.uniform1f,e,i)},set2f:function(e,i,h){return this.setUniform2(this.gl.uniform2f,e,i,h)},set3f:function(e,i,h,s){return this.setUniform3(this.gl.uniform3f,e,i,h,s)},set4f:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4f,e,i,h,s,l)},set1fv:function(e,i){return this.setUniform1(this.gl.uniform1fv,e,i,!0)},set2fv:function(e,i){return this.setUniform1(this.gl.uniform2fv,e,i,!0)},set3fv:function(e,i){return this.setUniform1(this.gl.uniform3fv,e,i,!0)},set4fv:function(e,i){return this.setUniform1(this.gl.uniform4fv,e,i,!0)},set1iv:function(e,i){return this.setUniform1(this.gl.uniform1iv,e,i,!0)},set2iv:function(e,i){return this.setUniform1(this.gl.uniform2iv,e,i,!0)},set3iv:function(e,i){return this.setUniform1(this.gl.uniform3iv,e,i,!0)},set4iv:function(e,i){return this.setUniform1(this.gl.uniform4iv,e,i,!0)},set1i:function(e,i){return this.setUniform1(this.gl.uniform1i,e,i)},set2i:function(e,i,h){return this.setUniform2(this.gl.uniform2i,e,i,h)},set3i:function(e,i,h,s){return this.setUniform3(this.gl.uniform3i,e,i,h,s)},set4i:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4i,e,i,h,s,l)},setMatrix2fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix2fv,e,i,h,!0)},setMatrix3fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix3fv,e,i,h,!0)},setMatrix4fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix4fv,e,i,h,!0)},createProgram:function(e,i){return e===void 0&&(e=this.vertSrc),i===void 0&&(i=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=e,this.fragSrc=i,this.program=this.renderer.createProgram(e,i),this.createUniforms(),this.rebind()},destroy:function(){var e=this.renderer;v(this.uniforms,function(i){e.deleteUniformLocation(i.location)}),this.uniforms=null,v(this.attributes,function(i){e.deleteAttribLocation(i.location)}),this.attributes=null,e.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});c.exports=n},14500:c=>{/** + */var o=t(83419),v=t(95428),a=t(95540),r=t(14500),n=new o({initialize:function(i,h,s,l,f){this.pipeline=i,this.name=h,this.renderer=i.renderer,this.gl=this.renderer.gl,this.fragSrc=l,this.vertSrc=s,this.program=this.renderer.createProgram(s,l),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(f),this.createUniforms()},createAttributes:function(e){var i=0,h=0,s=[];this.vertexComponentCount=0;for(var l=0;l=0?(i.enableVertexAttribArray(M.webGLAttribLocation),i.vertexAttribPointer(M.webGLAttribLocation,p,g,P,s,x),d.enabled=!0,d.location=M):M.webGLAttribLocation!==-1&&i.disableVertexAttribArray(M.webGLAttribLocation)}else y?i.vertexAttribPointer(C.webGLAttribLocation,p,g,P,s,x):!y&&C!==-1&&C.webGLAttribLocation>-1&&(i.disableVertexAttribArray(C.webGLAttribLocation),d.location=-1)}return this},createUniforms:function(){var e=this.gl,i=this.program,h=this.uniforms,s,l,f,u=e.getProgramParameter(i.webGLProgram,e.ACTIVE_UNIFORMS);for(s=0;s0&&(l=l.substr(0,p),h.hasOwnProperty(l)||(f=this.renderer.createUniformLocation(i,l),f!==null&&(h[l]={name:l,location:f,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var e=this.gl;this.renderer.setProgram(this.program);for(var i in this.uniforms){var h=this.uniforms[i];h.setter&&h.setter.call(e,h.location.webGLUniformLocation,h.value1,h.value2,h.value3,h.value4)}},hasUniform:function(e){return this.uniforms.hasOwnProperty(e)},resetUniform:function(e){var i=this.uniforms[e];return i&&(i.value1=null,i.value2=null,i.value3=null,i.value4=null),this},setUniform1:function(e,i,h,s){var l=this.uniforms[i];return l?((s||l.value1!==h)&&(l.setter||(l.setter=e),l.value1=h,this.renderer.setProgram(this.program),e.call(this.gl,l.location.webGLUniformLocation,h),this.pipeline.currentShader=this),this):this},setUniform2:function(e,i,h,s,l){var f=this.uniforms[i];return f?((l||f.value1!==h||f.value2!==s)&&(f.setter||(f.setter=e),f.value1=h,f.value2=s,this.renderer.setProgram(this.program),e.call(this.gl,f.location.webGLUniformLocation,h,s),this.pipeline.currentShader=this),this):this},setUniform3:function(e,i,h,s,l,f){var u=this.uniforms[i];return u?((f||u.value1!==h||u.value2!==s||u.value3!==l)&&(u.setter||(u.setter=e),u.value1=h,u.value2=s,u.value3=l,this.renderer.setProgram(this.program),e.call(this.gl,u.location.webGLUniformLocation,h,s,l),this.pipeline.currentShader=this),this):this},setUniform4:function(e,i,h,s,l,f,u){var d=this.uniforms[i];return d?((u||d.value1!==h||d.value2!==s||d.value3!==l||d.value4!==f)&&(d.setter||(d.setter=e),d.value1=h,d.value2=s,d.value3=l,d.value4=f,this.renderer.setProgram(this.program),e.call(this.gl,d.location.webGLUniformLocation,h,s,l,f),this.pipeline.currentShader=this),this):this},setBoolean:function(e,i){return this.setUniform1(this.gl.uniform1i,e,Number(i))},set1f:function(e,i){return this.setUniform1(this.gl.uniform1f,e,i)},set2f:function(e,i,h){return this.setUniform2(this.gl.uniform2f,e,i,h)},set3f:function(e,i,h,s){return this.setUniform3(this.gl.uniform3f,e,i,h,s)},set4f:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4f,e,i,h,s,l)},set1fv:function(e,i){return this.setUniform1(this.gl.uniform1fv,e,i,!0)},set2fv:function(e,i){return this.setUniform1(this.gl.uniform2fv,e,i,!0)},set3fv:function(e,i){return this.setUniform1(this.gl.uniform3fv,e,i,!0)},set4fv:function(e,i){return this.setUniform1(this.gl.uniform4fv,e,i,!0)},set1iv:function(e,i){return this.setUniform1(this.gl.uniform1iv,e,i,!0)},set2iv:function(e,i){return this.setUniform1(this.gl.uniform2iv,e,i,!0)},set3iv:function(e,i){return this.setUniform1(this.gl.uniform3iv,e,i,!0)},set4iv:function(e,i){return this.setUniform1(this.gl.uniform4iv,e,i,!0)},set1i:function(e,i){return this.setUniform1(this.gl.uniform1i,e,i)},set2i:function(e,i,h){return this.setUniform2(this.gl.uniform2i,e,i,h)},set3i:function(e,i,h,s){return this.setUniform3(this.gl.uniform3i,e,i,h,s)},set4i:function(e,i,h,s,l){return this.setUniform4(this.gl.uniform4i,e,i,h,s,l)},setMatrix2fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix2fv,e,i,h,!0)},setMatrix3fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix3fv,e,i,h,!0)},setMatrix4fv:function(e,i,h){return this.setUniform2(this.gl.uniformMatrix4fv,e,i,h,!0)},createProgram:function(e,i){return e===void 0&&(e=this.vertSrc),i===void 0&&(i=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=e,this.fragSrc=i,this.program=this.renderer.createProgram(e,i),this.createUniforms(),this.rebind()},destroy:function(){var e=this.renderer;v(this.uniforms,function(i){e.deleteUniformLocation(i.location)}),this.uniforms=null,v(this.attributes,function(i){e.deleteAttribLocation(i.location)}),this.attributes=null,e.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});c.exports=n},14500:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4740,12 +4740,12 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(58918),a=t(14811),r=t(95540),n=t(43558),e=t(89350),i=t(70554),h=new o({Extends:n,initialize:function(l){l.shaders=[i.setGlowQuality(e.FXGlowFrag,l.game),e.FXShadowFrag,e.FXPixelateFrag,e.FXVignetteFrag,e.FXShineFrag,e.FXBlurLowFrag,e.FXBlurMedFrag,e.FXBlurHighFrag,e.FXGradientFrag,e.FXBloomFrag,e.ColorMatrixFrag,e.FXCircleFrag,e.FXBarrelFrag,e.FXDisplacementFrag,e.FXWipeFrag,e.FXBokehFrag],n.call(this,l);var f=this.game;this.glow=new v.Glow(f),this.shadow=new v.Shadow(f),this.pixelate=new v.Pixelate(f),this.vignette=new v.Vignette(f),this.shine=new v.Shine(f),this.gradient=new v.Gradient(f),this.circle=new v.Circle(f),this.barrel=new v.Barrel(f),this.wipe=new v.Wipe(f),this.bokeh=new v.Bokeh(f);var u=[];u[a.GLOW]=this.onGlow,u[a.SHADOW]=this.onShadow,u[a.PIXELATE]=this.onPixelate,u[a.VIGNETTE]=this.onVignette,u[a.SHINE]=this.onShine,u[a.BLUR]=this.onBlur,u[a.GRADIENT]=this.onGradient,u[a.BLOOM]=this.onBloom,u[a.COLOR_MATRIX]=this.onColorMatrix,u[a.CIRCLE]=this.onCircle,u[a.BARREL]=this.onBarrel,u[a.DISPLACEMENT]=this.onDisplacement,u[a.WIPE]=this.onWipe,u[a.BOKEH]=this.onBokeh,this.fxHandlers=u,this.source,this.target,this.swap},onDraw:function(s,l,f){this.source=s,this.target=l,this.swap=f;var u=s.width,d=s.height,p=this.tempSprite,g=this.fxHandlers;if(p&&p.preFX)for(var y=p.preFX.list,x=0;x{/** + */var o=t(83419),v=t(58918),a=t(14811),r=t(95540),n=t(43558),e=t(89350),i=t(70554),h=new o({Extends:n,initialize:function(l){l.shaders=[i.setGlowQuality(e.FXGlowFrag,l.game),e.FXShadowFrag,e.FXPixelateFrag,e.FXVignetteFrag,e.FXShineFrag,e.FXBlurLowFrag,e.FXBlurMedFrag,e.FXBlurHighFrag,e.FXGradientFrag,e.FXBloomFrag,e.ColorMatrixFrag,e.FXCircleFrag,e.FXBarrelFrag,e.FXDisplacementFrag,e.FXWipeFrag,e.FXBokehFrag],n.call(this,l);var f=this.game;this.glow=new v.Glow(f),this.shadow=new v.Shadow(f),this.pixelate=new v.Pixelate(f),this.vignette=new v.Vignette(f),this.shine=new v.Shine(f),this.gradient=new v.Gradient(f),this.circle=new v.Circle(f),this.barrel=new v.Barrel(f),this.wipe=new v.Wipe(f),this.bokeh=new v.Bokeh(f);var u=[];u[a.GLOW]=this.onGlow,u[a.SHADOW]=this.onShadow,u[a.PIXELATE]=this.onPixelate,u[a.VIGNETTE]=this.onVignette,u[a.SHINE]=this.onShine,u[a.BLUR]=this.onBlur,u[a.GRADIENT]=this.onGradient,u[a.BLOOM]=this.onBloom,u[a.COLOR_MATRIX]=this.onColorMatrix,u[a.CIRCLE]=this.onCircle,u[a.BARREL]=this.onBarrel,u[a.DISPLACEMENT]=this.onDisplacement,u[a.WIPE]=this.onWipe,u[a.BOKEH]=this.onBokeh,this.fxHandlers=u,this.source,this.target,this.swap},onDraw:function(s,l,f){this.source=s,this.target=l,this.swap=f;var u=s.width,d=s.height,p=this.tempSprite,g=this.fxHandlers;if(p&&p.preFX)for(var x=p.preFX.list,y=0;y{/** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(95540),a=t(31063),r=t(57516),n=t(61340),e=t(26099),i=t(29100),h=new o({Extends:r,initialize:function(l){var f=v(l,"fragShader",a);l.fragShader=f.replace("%LIGHT_COUNT%",l.game.renderer.config.maxLights),r.call(this,l),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new e,this._tempMatrix=new n,this._tempMatrix2=new n},boot:function(){i.prototype.boot.call(this)},onRender:function(s,l){var f=s.sys.lights;if(this.lightsActive=!1,!(!f||!f.active)){var u=f.getLights(l),d=u.length;this.lightsActive=!0;var p,g=this.renderer,y=g.height,x=l.matrix,C=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",l.x,l.y,l.rotation,l.zoom),this.set3f("uAmbientLightColor",f.ambientColor.r,f.ambientColor.g,f.ambientColor.b),this.set1i("uLightCount",d),p=0;p0&&this.flush();var l=this.inverseRotationMatrix;if(s){var f=-s,u=Math.cos(f),d=Math.sin(f);l[1]=d,l[3]=-d,l[0]=l[4]=u}else l[0]=l[4]=1,l[1]=l[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,l),this.currentNormalMapRotation=s}},setTexture2D:function(s,l){var f=this.renderer;s===void 0&&(s=f.whiteTexture);var u=this.getNormalMap(l);this.isNewNormalMap(s,u)&&(this.flush(),this.createBatch(s),this.addTextureToBatch(u),this.currentNormalMap=u);var d=0;if(l&&l.parentContainer){var p=l.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);d=p.rotationNormalized}else l&&(d=l.rotation);return this.setNormalMapRotation(d),0},setGameObject:function(s,l){l===void 0&&(l=s.frame);var f=l.glTexture,u=this.getNormalMap(s);if(this.isNewNormalMap(f,u)&&(this.flush(),this.createBatch(f),this.addTextureToBatch(u),this.currentNormalMap=u),s.parentContainer){var d=s.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(d.rotationNormalized)}else this.setNormalMapRotation(s.rotation);return 0},isNewNormalMap:function(s,l){return this.currentTexture!==s||this.currentNormalMap!==l},getNormalMap:function(s){var l;if(s)s.displayTexture?l=s.displayTexture.dataSource[s.displayFrame.sourceIndex]:s.texture?l=s.texture.dataSource[s.frame.sourceIndex]:s.tileset&&(Array.isArray(s.tileset)?l=s.tileset[0].image.dataSource[0]:l=s.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return l?l.glTexture:this.renderer.normalTexture},batchSprite:function(s,l,f){this.lightsActive&&r.prototype.batchSprite.call(this,s,l,f)},batchTexture:function(s,l,f,u,d,p,g,y,x,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et){this.lightsActive&&r.prototype.batchTexture.call(this,s,l,f,u,d,p,g,y,x,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et)},batchTextureFrame:function(s,l,f,u,d,p,g){this.lightsActive&&r.prototype.batchTextureFrame.call(this,s,l,f,u,d,p,g)}});c.exports=h},56527:(c,m,t)=>{/** + */var o=t(83419),v=t(95540),a=t(31063),r=t(57516),n=t(61340),e=t(26099),i=t(29100),h=new o({Extends:r,initialize:function(l){var f=v(l,"fragShader",a);l.fragShader=f.replace("%LIGHT_COUNT%",l.game.renderer.config.maxLights),r.call(this,l),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new e,this._tempMatrix=new n,this._tempMatrix2=new n},boot:function(){i.prototype.boot.call(this)},onRender:function(s,l){var f=s.sys.lights;if(this.lightsActive=!1,!(!f||!f.active)){var u=f.getLights(l),d=u.length;this.lightsActive=!0;var p,g=this.renderer,x=g.height,y=l.matrix,C=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",l.x,l.y,l.rotation,l.zoom),this.set3f("uAmbientLightColor",f.ambientColor.r,f.ambientColor.g,f.ambientColor.b),this.set1i("uLightCount",d),p=0;p0&&this.flush();var l=this.inverseRotationMatrix;if(s){var f=-s,u=Math.cos(f),d=Math.sin(f);l[1]=d,l[3]=-d,l[0]=l[4]=u}else l[0]=l[4]=1,l[1]=l[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,l),this.currentNormalMapRotation=s}},setTexture2D:function(s,l){var f=this.renderer;s===void 0&&(s=f.whiteTexture);var u=this.getNormalMap(l);this.isNewNormalMap(s,u)&&(this.flush(),this.createBatch(s),this.addTextureToBatch(u),this.currentNormalMap=u);var d=0;if(l&&l.parentContainer){var p=l.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);d=p.rotationNormalized}else l&&(d=l.rotation);return this.setNormalMapRotation(d),0},setGameObject:function(s,l){l===void 0&&(l=s.frame);var f=l.glTexture,u=this.getNormalMap(s);if(this.isNewNormalMap(f,u)&&(this.flush(),this.createBatch(f),this.addTextureToBatch(u),this.currentNormalMap=u),s.parentContainer){var d=s.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(d.rotationNormalized)}else this.setNormalMapRotation(s.rotation);return 0},isNewNormalMap:function(s,l){return this.currentTexture!==s||this.currentNormalMap!==l},getNormalMap:function(s){var l;if(s)s.displayTexture?l=s.displayTexture.dataSource[s.displayFrame.sourceIndex]:s.texture?l=s.texture.dataSource[s.frame.sourceIndex]:s.tileset&&(Array.isArray(s.tileset)?l=s.tileset[0].image.dataSource[0]:l=s.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return l?l.glTexture:this.renderer.normalTexture},batchSprite:function(s,l,f){this.lightsActive&&r.prototype.batchSprite.call(this,s,l,f)},batchTexture:function(s,l,f,u,d,p,g,x,y,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et){this.lightsActive&&r.prototype.batchTexture.call(this,s,l,f,u,d,p,g,x,y,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et)},batchTextureFrame:function(s,l,f,u,d,p,g){this.lightsActive&&r.prototype.batchTextureFrame.call(this,s,l,f,u,d,p,g)}});c.exports=h},56527:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4754,11 +4754,11 @@ return new `+this.key+`(); * @author Felipe Alfonso <@bitnenfer> * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(94811),a=t(95540),r=t(98840),n=t(44667),e=t(61340),i=t(70554),h=t(14500),s=t(29100),l=new o({Extends:s,initialize:function(u){var d=u.game.renderer,p=a(u,"fragShader",r);u.fragShader=i.parseFragmentShaderMaxTextures(p,d.maxTextures),u.vertShader=a(u,"vertShader",n),u.attributes=a(u,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),u.resizeUniform="uResolution",s.call(this,u),this._tempMatrix1=new e,this._tempMatrix2=new e,this._tempMatrix3=new e,this.calcMatrix=new e,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(){s.prototype.boot.call(this);var f=this.renderer;this.set1iv("uMainSampler",f.textureIndexes),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)},batchSprite:function(f,u,d){this.manager.set(this,f);var p=this._tempMatrix1,g=this._tempMatrix2,y=this._tempMatrix3,x=f.frame,C=x.glTexture,P=x.u0,M=x.v0,w=x.u1,I=x.v1,L=x.x,B=x.y,N=x.cutWidth,G=x.cutHeight,V=x.customPivot,K=f.displayOriginX,j=f.displayOriginY,J=-K+L,X=-j+B;if(f.isCropped){var Y=f._crop;(Y.flipX!==f.flipX||Y.flipY!==f.flipY)&&x.updateCropUVs(Y,f.flipX,f.flipY),P=Y.u0,M=Y.v0,w=Y.u1,I=Y.v1,N=Y.width,G=Y.height,L=Y.x,B=Y.y,J=-K+L,X=-j+B}var b=1,z=1;f.flipX&&(V||(J+=-x.realWidth+K*2),b=-1),f.flipY&&(V||(X+=-x.realHeight+j*2),z=-1);var W=f.x,H=f.y;g.applyITRS(W,H,f.rotation,f.scaleX*b,f.scaleY*z),p.copyFrom(u.matrix),d?(p.multiplyWithOffset(d,-u.scrollX*f.scrollFactorX,-u.scrollY*f.scrollFactorY),g.e=W,g.f=H):(g.e-=u.scrollX*f.scrollFactorX,g.f-=u.scrollY*f.scrollFactorY),p.multiply(g,y);var Z=y.setQuad(J,X,J+N,X+G),Q=i.getTintAppendFloatAlpha,k=u.alpha,et=Q(f.tintTopLeft,k*f._alphaTL),st=Q(f.tintTopRight,k*f._alphaTR),rt=Q(f.tintBottomLeft,k*f._alphaBL),ot=Q(f.tintBottomRight,k*f._alphaBR);this.shouldFlush(6)&&this.flush();var ft=this.setGameObject(f,x);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",u.roundPixels),this.batchQuad(f,Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],P,M,w,I,et,st,rt,ot,f.tintFill,C,ft),this.manager.postBatch(f)},batchTexture:function(f,u,d,p,g,y,x,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et,st,rt,ot){ot===void 0&&(ot=!1),this.manager.set(this,f);var ft=this._tempMatrix1,at=this._tempMatrix2,vt=this._tempMatrix3,At=K/d+Z,Et=j/p+Q,Pt=(K+J)/d+Z,ct=(j+X)/p+Q,Ct=x,pt=C,wt=-G,Bt=-V;if(f.isCropped){var jt=f._crop,zt=jt.width,Yt=jt.height;Ct=zt,pt=Yt,x=zt,C=Yt,K=jt.x,j=jt.y;var bt=K,ne=j;I&&(bt=J-jt.x-zt),L&&(ne=X-jt.y-Yt),At=bt/d+Z,Et=ne/p+Q,Pt=(bt+zt)/d+Z,ct=(ne+Yt)/p+Q,wt=-G+K,Bt=-V+j}L=L^(!st&&u.isRenderTexture?1:0),I&&(Ct*=-1,wt+=x),L&&(pt*=-1,Bt+=C),at.applyITRS(g,y,w,P,M),ft.copyFrom(k.matrix),et?(ft.multiplyWithOffset(et,-k.scrollX*B,-k.scrollY*N),at.e=g,at.f=y):(at.e-=k.scrollX*B,at.f-=k.scrollY*N),ft.multiply(at,vt);var Qt=vt.setQuad(wt,Bt,wt+Ct,Bt+pt);rt==null&&(rt=this.setTexture2D(u)),f&&!ot&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",k.roundPixels),this.batchQuad(f,Qt[0],Qt[1],Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7],At,Et,Pt,ct,Y,b,z,W,H,u,rt),f&&!ot&&this.manager.postBatch(f)},batchTextureFrame:function(f,u,d,p,g,y,x){this.manager.set(this);var C=this._tempMatrix1.copyFrom(y),P=this._tempMatrix2;x?C.multiply(x,P):P=C;var M=P.setQuad(u,d,u+f.width,d+f.height),w=this.setTexture2D(f.source.glTexture);p=i.getTintAppendFloatAlpha(p,g),this.batchQuad(null,M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],f.u0,f.v0,f.u1,f.v1,p,p,p,p,0,f.glTexture,w)},batchFillRect:function(f,u,d,p,g,y){this.renderer.pipelines.set(this);var x=this.calcMatrix;y&&y.multiply(g,x);var C=x.setQuad(f,u,f+d,u+p),P=this.fillTint;this.batchQuad(null,C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],0,0,1,1,P.TL,P.TR,P.BL,P.BR,2)},batchFillTriangle:function(f,u,d,p,g,y,x,C){this.renderer.pipelines.set(this);var P=this.calcMatrix;C&&C.multiply(x,P);var M=P.getX(f,u),w=P.getY(f,u),I=P.getX(d,p),L=P.getY(d,p),B=P.getX(g,y),N=P.getY(g,y),G=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,M,w,I,L,B,N,0,0,1,1,G.TL,G.TR,G.BL,2)},batchStrokeTriangle:function(f,u,d,p,g,y,x,C,P){var M=this.tempTriangle;M[0].x=f,M[0].y=u,M[0].width=x,M[1].x=d,M[1].y=p,M[1].width=x,M[2].x=g,M[2].y=y,M[2].width=x,M[3].x=f,M[3].y=u,M[3].width=x,this.batchStrokePath(M,x,!1,C,P)},batchFillPath:function(f,u,d){this.renderer.pipelines.set(this);var p=this.calcMatrix;d&&d.multiply(u,p);for(var g=f.length,y=this.polygonCache,x,C,P=this.fillTint.TL,M=this.fillTint.TR,w=this.fillTint.BL,I=0;I0&&Ct[4]?this.batchQuad(null,ft,at,et,st,Ct[0],Ct[1],Ct[2],Ct[3],0,0,1,1,At,Et,Pt,ct,2):(pt[0]=ft,pt[1]=at,pt[2]=et,pt[3]=st,pt[4]=1),P&&pt[4]?this.batchQuad(null,Q,k,rt,ot,pt[0],pt[1],pt[2],pt[3],0,0,1,1,At,Et,Pt,ct,2):(Ct[0]=Q,Ct[1]=k,Ct[2]=rt,Ct[3]=ot,Ct[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,s.prototype.destroy.call(this),this}});c.exports=l},43439:(c,m,t)=>{/** + */var o=t(83419),v=t(94811),a=t(95540),r=t(98840),n=t(44667),e=t(61340),i=t(70554),h=t(14500),s=t(29100),l=new o({Extends:s,initialize:function(u){var d=u.game.renderer,p=a(u,"fragShader",r);u.fragShader=i.parseFragmentShaderMaxTextures(p,d.maxTextures),u.vertShader=a(u,"vertShader",n),u.attributes=a(u,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),u.resizeUniform="uResolution",s.call(this,u),this._tempMatrix1=new e,this._tempMatrix2=new e,this._tempMatrix3=new e,this.calcMatrix=new e,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(){s.prototype.boot.call(this);var f=this.renderer;this.set1iv("uMainSampler",f.textureIndexes),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)},batchSprite:function(f,u,d){this.manager.set(this,f);var p=this._tempMatrix1,g=this._tempMatrix2,x=this._tempMatrix3,y=f.frame,C=y.glTexture,P=y.u0,M=y.v0,w=y.u1,I=y.v1,L=y.x,B=y.y,N=y.cutWidth,G=y.cutHeight,V=y.customPivot,K=f.displayOriginX,j=f.displayOriginY,J=-K+L,X=-j+B;if(f.isCropped){var Y=f._crop;(Y.flipX!==f.flipX||Y.flipY!==f.flipY)&&y.updateCropUVs(Y,f.flipX,f.flipY),P=Y.u0,M=Y.v0,w=Y.u1,I=Y.v1,N=Y.width,G=Y.height,L=Y.x,B=Y.y,J=-K+L,X=-j+B}var b=1,z=1;f.flipX&&(V||(J+=-y.realWidth+K*2),b=-1),f.flipY&&(V||(X+=-y.realHeight+j*2),z=-1);var W=f.x,H=f.y;g.applyITRS(W,H,f.rotation,f.scaleX*b,f.scaleY*z),p.copyFrom(u.matrix),d?(p.multiplyWithOffset(d,-u.scrollX*f.scrollFactorX,-u.scrollY*f.scrollFactorY),g.e=W,g.f=H):(g.e-=u.scrollX*f.scrollFactorX,g.f-=u.scrollY*f.scrollFactorY),p.multiply(g,x);var Z=x.setQuad(J,X,J+N,X+G),Q=i.getTintAppendFloatAlpha,k=u.alpha,et=Q(f.tintTopLeft,k*f._alphaTL),st=Q(f.tintTopRight,k*f._alphaTR),rt=Q(f.tintBottomLeft,k*f._alphaBL),ot=Q(f.tintBottomRight,k*f._alphaBR);this.shouldFlush(6)&&this.flush();var ft=this.setGameObject(f,y);this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",u.roundPixels),this.batchQuad(f,Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],P,M,w,I,et,st,rt,ot,f.tintFill,C,ft),this.manager.postBatch(f)},batchTexture:function(f,u,d,p,g,x,y,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y,b,z,W,H,Z,Q,k,et,st,rt,ot){ot===void 0&&(ot=!1),this.manager.set(this,f);var ft=this._tempMatrix1,at=this._tempMatrix2,vt=this._tempMatrix3,At=K/d+Z,Et=j/p+Q,Pt=(K+J)/d+Z,ct=(j+X)/p+Q,Ct=y,pt=C,wt=-G,Bt=-V;if(f.isCropped){var jt=f._crop,zt=jt.width,Yt=jt.height;Ct=zt,pt=Yt,y=zt,C=Yt,K=jt.x,j=jt.y;var bt=K,re=j;I&&(bt=J-jt.x-zt),L&&(re=X-jt.y-Yt),At=bt/d+Z,Et=re/p+Q,Pt=(bt+zt)/d+Z,ct=(re+Yt)/p+Q,wt=-G+K,Bt=-V+j}L=L^(!st&&u.isRenderTexture?1:0),I&&(Ct*=-1,wt+=y),L&&(pt*=-1,Bt+=C),at.applyITRS(g,x,w,P,M),ft.copyFrom(k.matrix),et?(ft.multiplyWithOffset(et,-k.scrollX*B,-k.scrollY*N),at.e=g,at.f=x):(at.e-=k.scrollX*B,at.f-=k.scrollY*N),ft.multiply(at,vt);var Qt=vt.setQuad(wt,Bt,wt+Ct,Bt+pt);rt==null&&(rt=this.setTexture2D(u)),f&&!ot&&this.manager.preBatch(f),this.currentShader.set1i("uRoundPixels",k.roundPixels),this.batchQuad(f,Qt[0],Qt[1],Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7],At,Et,Pt,ct,Y,b,z,W,H,u,rt),f&&!ot&&this.manager.postBatch(f)},batchTextureFrame:function(f,u,d,p,g,x,y){this.manager.set(this);var C=this._tempMatrix1.copyFrom(x),P=this._tempMatrix2;y?C.multiply(y,P):P=C;var M=P.setQuad(u,d,u+f.width,d+f.height),w=this.setTexture2D(f.source.glTexture);p=i.getTintAppendFloatAlpha(p,g),this.batchQuad(null,M[0],M[1],M[2],M[3],M[4],M[5],M[6],M[7],f.u0,f.v0,f.u1,f.v1,p,p,p,p,0,f.glTexture,w)},batchFillRect:function(f,u,d,p,g,x){this.renderer.pipelines.set(this);var y=this.calcMatrix;x&&x.multiply(g,y);var C=y.setQuad(f,u,f+d,u+p),P=this.fillTint;this.batchQuad(null,C[0],C[1],C[2],C[3],C[4],C[5],C[6],C[7],0,0,1,1,P.TL,P.TR,P.BL,P.BR,2)},batchFillTriangle:function(f,u,d,p,g,x,y,C){this.renderer.pipelines.set(this);var P=this.calcMatrix;C&&C.multiply(y,P);var M=P.getX(f,u),w=P.getY(f,u),I=P.getX(d,p),L=P.getY(d,p),B=P.getX(g,x),N=P.getY(g,x),G=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,M,w,I,L,B,N,0,0,1,1,G.TL,G.TR,G.BL,2)},batchStrokeTriangle:function(f,u,d,p,g,x,y,C,P){var M=this.tempTriangle;M[0].x=f,M[0].y=u,M[0].width=y,M[1].x=d,M[1].y=p,M[1].width=y,M[2].x=g,M[2].y=x,M[2].width=y,M[3].x=f,M[3].y=u,M[3].width=y,this.batchStrokePath(M,y,!1,C,P)},batchFillPath:function(f,u,d){this.renderer.pipelines.set(this);var p=this.calcMatrix;d&&d.multiply(u,p);for(var g=f.length,x=this.polygonCache,y,C,P=this.fillTint.TL,M=this.fillTint.TR,w=this.fillTint.BL,I=0;I0&&Ct[4]?this.batchQuad(null,ft,at,et,st,Ct[0],Ct[1],Ct[2],Ct[3],0,0,1,1,At,Et,Pt,ct,2):(pt[0]=ft,pt[1]=at,pt[2]=et,pt[3]=st,pt[4]=1),P&&pt[4]?this.batchQuad(null,Q,k,rt,ot,pt[0],pt[1],pt[2],pt[3],0,0,1,1,At,Et,Pt,ct,2):(Ct[0]=Q,Ct[1]=k,Ct[2]=rt,Ct[3]=ot,Ct[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,s.prototype.destroy.call(this),this}});c.exports=l},43439:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(95540),a=t(4127),r=t(89924),n=t(29100),e=new o({Extends:n,initialize:function(h){h.vertShader=v(h,"vertShader",r),h.fragShader=v(h,"fragShader",a),h.attributes=v(h,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),n.call(this,h)},onRender:function(i,h){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",h.zoom)},batchPointLight:function(i,h,s,l,f,u,d,p,g,y,x,C){var P=i.color,M=i.intensity,w=i.radius,I=i.attenuation,L=P.r*M,B=P.g*M,N=P.b*M,G=h.alpha*i.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(s,l,x,C,w,I,L,B,N,G),this.batchLightVert(f,u,x,C,w,I,L,B,N,G),this.batchLightVert(d,p,x,C,w,I,L,B,N,G),this.batchLightVert(s,l,x,C,w,I,L,B,N,G),this.batchLightVert(d,p,x,C,w,I,L,B,N,G),this.batchLightVert(g,y,x,C,w,I,L,B,N,G),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(i,h,s,l,f,u,d,p,g,y){var x=this.vertexViewF32,C=this.vertexCount*this.currentShader.vertexComponentCount-1;x[++C]=i,x[++C]=h,x[++C]=s,x[++C]=l,x[++C]=f,x[++C]=u,x[++C]=d,x[++C]=p,x[++C]=g,x[++C]=y,this.vertexCount++}});c.exports=e},84057:(c,m,t)=>{/** + */var o=t(83419),v=t(95540),a=t(4127),r=t(89924),n=t(29100),e=new o({Extends:n,initialize:function(h){h.vertShader=v(h,"vertShader",r),h.fragShader=v(h,"fragShader",a),h.attributes=v(h,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),n.call(this,h)},onRender:function(i,h){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",h.zoom)},batchPointLight:function(i,h,s,l,f,u,d,p,g,x,y,C){var P=i.color,M=i.intensity,w=i.radius,I=i.attenuation,L=P.r*M,B=P.g*M,N=P.b*M,G=h.alpha*i.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(s,l,y,C,w,I,L,B,N,G),this.batchLightVert(f,u,y,C,w,I,L,B,N,G),this.batchLightVert(d,p,y,C,w,I,L,B,N,G),this.batchLightVert(s,l,y,C,w,I,L,B,N,G),this.batchLightVert(d,p,y,C,w,I,L,B,N,G),this.batchLightVert(g,x,y,C,w,I,L,B,N,G),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(i,h,s,l,f,u,d,p,g,x){var y=this.vertexViewF32,C=this.vertexCount*this.currentShader.vertexComponentCount-1;y[++C]=i,y[++C]=h,y[++C]=s,y[++C]=l,y[++C]=f,y[++C]=u,y[++C]=d,y[++C]=p,y[++C]=g,y[++C]=x,this.vertexCount++}});c.exports=e},84057:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4766,7 +4766,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(10312),v=t(67502),a=t(83419),r=t(96293),n=t(95540),e=t(57516),i=t(27681),h=t(87841),s=t(32302),l=t(45561),f=t(60722),u=t(29100),d=new a({Extends:e,initialize:function(g){var y=n(g,"fragShader",i),x=n(g,"vertShader",f),C=n(g,"drawShader",i),P=[{name:"DrawSprite",fragShader:l,vertShader:f},{name:"CopySprite",fragShader:y,vertShader:x},{name:"DrawGame",fragShader:C,vertShader:f},{name:"ColorMatrix",fragShader:r}],M=n(g,"shaders",[]);g.shaders=P.concat(M),g.vertShader||(g.vertShader=x),g.batchSize=1,e.call(this,g),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new h,this.targetBounds=new h,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){u.prototype.boot.call(this);var p=this.shaders,g=this.renderer;this.drawSpriteShader=p[0],this.copyShader=p[1],this.gameShader=p[2],this.colorMatrixShader=p[3],this.fsTarget=new s(g,g.width,g.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var y=new ArrayBuffer(168);this.quadVertexData=y,this.quadVertexViewF32=new Float32Array(y),this.quadVertexBuffer=g.createVertexBuffer(y,this.gl.STATIC_DRAW),this.onResize(g.width,g.height),this.currentShader=this.copyShader,this.set2f("uResolution",g.width,g.height),this.set1i("uRoundPixels",g.config.roundPixels)},onResize:function(p,g){var y=this.quadVertexViewF32;y[1]=g,y[22]=g,y[14]=p,y[28]=p,y[35]=p,y[36]=g},batchQuad:function(p,g,y,x,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y){var b=Math.min(g,x,P,w),z=Math.min(y,C,M,I),W=Math.max(g,x,P,w),H=Math.max(y,C,M,I),Z=W-b,Q=H-z,k=this.spriteBounds.setTo(b,z,Z,Q),et=p?p.preFX.padding:0,st=Z+et*2,rt=Q+et*2,ot=Math.abs(Math.max(st,rt)),ft=this.manager.getRenderTarget(ot),at=this.targetBounds.setTo(0,0,ft.width,ft.height);v(at,k.centerX,k.centerY),this.tempSprite=p;var vt=this.gl,At=this.renderer;At.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",At.width,At.height),this.set1i("uRoundPixels",At.config.roundPixels),this.flipProjectionMatrix(!0),p&&(this.onDrawSprite(p,ft),p.preFX.onFX(this));var Et=this.fsTarget;return this.flush(),vt.viewport(0,0,At.width,At.height),vt.bindFramebuffer(vt.FRAMEBUFFER,Et.framebuffer.webGLFramebuffer),vt.framebufferTexture2D(vt.FRAMEBUFFER,vt.COLOR_ATTACHMENT0,vt.TEXTURE_2D,Et.texture.webGLTexture,0),vt.clearColor(0,0,0,0),vt.clear(vt.COLOR_BUFFER_BIT),this.setTexture2D(Y),this.batchVert(g,y,L,B,0,X,V),this.batchVert(x,C,L,G,0,X,j),this.batchVert(P,M,N,G,0,X,J),this.batchVert(g,y,L,B,0,X,V),this.batchVert(P,M,N,G,0,X,J),this.batchVert(w,I,N,B,0,X,K),this.flush(),this.flipProjectionMatrix(!1),vt.activeTexture(vt.TEXTURE0),vt.bindTexture(vt.TEXTURE_2D,ft.texture.webGLTexture),vt.copyTexSubImage2D(vt.TEXTURE_2D,0,0,0,at.x,at.y,at.width,at.height),vt.bindFramebuffer(vt.FRAMEBUFFER,null),vt.bindTexture(vt.TEXTURE_2D,null),this.onBatch(p),this.currentShader=this.copyShader,this.onDraw(ft,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(p,g,y,x,C,P,M){y===void 0&&(y=!0),x===void 0&&(x=!0),C===void 0&&(C=!1),M===void 0&&(M=this.copyShader);var w=this.gl,I=this.tempSprite;P&&(M=this.colorMatrixShader),this.currentShader=M;var L=this.setVertexBuffer(this.quadVertexBuffer);M.bind(L,!1);var B=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",B.width,B.height),this.set1i("uRoundPixels",B.config.roundPixels),I.preFX.onFXCopy(this),this.onCopySprite(p,g,I),P&&(this.set1fv("uColorMatrix",P.getData()),this.set1f("uAlpha",P.alpha)),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,p.texture.webGLTexture),p.height>g.height)w.viewport(0,0,p.width,p.height),this.setTargetUVs(p,g);else{var N=g.height-p.height;w.viewport(0,N,p.width,p.height),this.resetUVs()}if(w.bindFramebuffer(w.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,g.texture.webGLTexture,0),y&&(w.clearColor(0,0,0,+!x),w.clear(w.COLOR_BUFFER_BIT)),C){var G=this.renderer.currentBlendMode;this.renderer.setBlendMode(o.ERASE)}w.bufferData(w.ARRAY_BUFFER,this.quadVertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),C&&this.renderer.setBlendMode(G),w.bindFramebuffer(w.FRAMEBUFFER,null)},copy:function(p,g){var y=this.gl;this.set1i("uMainSampler",0),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,p.texture.webGLTexture),y.viewport(0,0,p.width,p.height),this.setUVs(0,0,0,1,1,1,1,0),y.bindFramebuffer(y.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,g.texture.webGLTexture,0),y.clearColor(0,0,0,0),y.clear(y.COLOR_BUFFER_BIT),y.bufferData(y.ARRAY_BUFFER,this.quadVertexData,y.STATIC_DRAW),y.drawArrays(y.TRIANGLES,0,6),y.bindFramebuffer(y.FRAMEBUFFER,null)},blendFrames:function(p,g,y,x,C){this.manager.blendFrames(p,g,y,x,C)},blendFramesAdditive:function(p,g,y,x,C){this.manager.blendFramesAdditive(p,g,y,x,C)},drawToGame:function(p){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(p)},copyToGame:function(p){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(p)},bindAndDraw:function(p){var g=this.gl,y=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(p.texture);var x=this._tempMatrix1.loadIdentity(),C=this.targetBounds.x,P=this.targetBounds.y,M=C+p.width,w=P+p.height,I=x.getX(C,P),L=x.getX(C,w),B=x.getX(M,w),N=x.getX(M,P),G=x.getY(C,P),V=x.getY(C,w),K=x.getY(M,w),j=x.getY(M,P),J=16777215;this.batchVert(I,G,0,0,0,0,J),this.batchVert(L,V,0,1,0,0,J),this.batchVert(B,K,1,1,0,0,J),this.batchVert(I,G,0,0,0,0,J),this.batchVert(B,K,1,1,0,0,J),this.batchVert(N,j,1,0,0,0,J),y.restoreFramebuffer(!1,!0),y.currentFramebuffer||g.viewport(0,0,y.width,y.height),y.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(p){this.drawToGame(p)},setUVs:function(p,g,y,x,C,P,M,w){var I=this.quadVertexViewF32;I[2]=p,I[3]=g,I[9]=y,I[10]=x,I[16]=C,I[17]=P,I[23]=p,I[24]=g,I[30]=C,I[31]=P,I[37]=M,I[38]=w},setTargetUVs:function(p,g){var y=g.height/p.height;y>.5?y=.5-(y-.5):y=.5+(.5-y),this.setUVs(0,y,0,1+y,1,1+y,1,y)},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,e.prototype.destroy.call(this),this}});c.exports=d},81041:(c,m,t)=>{/** + */var o=t(10312),v=t(67502),a=t(83419),r=t(96293),n=t(95540),e=t(57516),i=t(27681),h=t(87841),s=t(32302),l=t(45561),f=t(60722),u=t(29100),d=new a({Extends:e,initialize:function(g){var x=n(g,"fragShader",i),y=n(g,"vertShader",f),C=n(g,"drawShader",i),P=[{name:"DrawSprite",fragShader:l,vertShader:f},{name:"CopySprite",fragShader:x,vertShader:y},{name:"DrawGame",fragShader:C,vertShader:f},{name:"ColorMatrix",fragShader:r}],M=n(g,"shaders",[]);g.shaders=P.concat(M),g.vertShader||(g.vertShader=y),g.batchSize=1,e.call(this,g),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new h,this.targetBounds=new h,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){u.prototype.boot.call(this);var p=this.shaders,g=this.renderer;this.drawSpriteShader=p[0],this.copyShader=p[1],this.gameShader=p[2],this.colorMatrixShader=p[3],this.fsTarget=new s(g,g.width,g.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var x=new ArrayBuffer(168);this.quadVertexData=x,this.quadVertexViewF32=new Float32Array(x),this.quadVertexBuffer=g.createVertexBuffer(x,this.gl.STATIC_DRAW),this.onResize(g.width,g.height),this.currentShader=this.copyShader,this.set2f("uResolution",g.width,g.height),this.set1i("uRoundPixels",g.config.roundPixels)},onResize:function(p,g){var x=this.quadVertexViewF32;x[1]=g,x[22]=g,x[14]=p,x[28]=p,x[35]=p,x[36]=g},batchQuad:function(p,g,x,y,C,P,M,w,I,L,B,N,G,V,K,j,J,X,Y){var b=Math.min(g,y,P,w),z=Math.min(x,C,M,I),W=Math.max(g,y,P,w),H=Math.max(x,C,M,I),Z=W-b,Q=H-z,k=this.spriteBounds.setTo(b,z,Z,Q),et=p?p.preFX.padding:0,st=Z+et*2,rt=Q+et*2,ot=Math.abs(Math.max(st,rt)),ft=this.manager.getRenderTarget(ot),at=this.targetBounds.setTo(0,0,ft.width,ft.height);v(at,k.centerX,k.centerY),this.tempSprite=p;var vt=this.gl,At=this.renderer;At.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",At.width,At.height),this.set1i("uRoundPixels",At.config.roundPixels),this.flipProjectionMatrix(!0),p&&(this.onDrawSprite(p,ft),p.preFX.onFX(this));var Et=this.fsTarget;return this.flush(),vt.viewport(0,0,At.width,At.height),vt.bindFramebuffer(vt.FRAMEBUFFER,Et.framebuffer.webGLFramebuffer),vt.framebufferTexture2D(vt.FRAMEBUFFER,vt.COLOR_ATTACHMENT0,vt.TEXTURE_2D,Et.texture.webGLTexture,0),vt.clearColor(0,0,0,0),vt.clear(vt.COLOR_BUFFER_BIT),this.setTexture2D(Y),this.batchVert(g,x,L,B,0,X,V),this.batchVert(y,C,L,G,0,X,j),this.batchVert(P,M,N,G,0,X,J),this.batchVert(g,x,L,B,0,X,V),this.batchVert(P,M,N,G,0,X,J),this.batchVert(w,I,N,B,0,X,K),this.flush(),this.flipProjectionMatrix(!1),vt.activeTexture(vt.TEXTURE0),vt.bindTexture(vt.TEXTURE_2D,ft.texture.webGLTexture),vt.copyTexSubImage2D(vt.TEXTURE_2D,0,0,0,at.x,at.y,at.width,at.height),vt.bindFramebuffer(vt.FRAMEBUFFER,null),vt.bindTexture(vt.TEXTURE_2D,null),this.onBatch(p),this.currentShader=this.copyShader,this.onDraw(ft,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(p,g,x,y,C,P,M){x===void 0&&(x=!0),y===void 0&&(y=!0),C===void 0&&(C=!1),M===void 0&&(M=this.copyShader);var w=this.gl,I=this.tempSprite;P&&(M=this.colorMatrixShader),this.currentShader=M;var L=this.setVertexBuffer(this.quadVertexBuffer);M.bind(L,!1);var B=this.renderer;if(this.set1i("uMainSampler",0),this.set2f("uResolution",B.width,B.height),this.set1i("uRoundPixels",B.config.roundPixels),I.preFX.onFXCopy(this),this.onCopySprite(p,g,I),P&&(this.set1fv("uColorMatrix",P.getData()),this.set1f("uAlpha",P.alpha)),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,p.texture.webGLTexture),p.height>g.height)w.viewport(0,0,p.width,p.height),this.setTargetUVs(p,g);else{var N=g.height-p.height;w.viewport(0,N,p.width,p.height),this.resetUVs()}if(w.bindFramebuffer(w.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,g.texture.webGLTexture,0),x&&(w.clearColor(0,0,0,+!y),w.clear(w.COLOR_BUFFER_BIT)),C){var G=this.renderer.currentBlendMode;this.renderer.setBlendMode(o.ERASE)}w.bufferData(w.ARRAY_BUFFER,this.quadVertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),C&&this.renderer.setBlendMode(G),w.bindFramebuffer(w.FRAMEBUFFER,null)},copy:function(p,g){var x=this.gl;this.set1i("uMainSampler",0),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,p.texture.webGLTexture),x.viewport(0,0,p.width,p.height),this.setUVs(0,0,0,1,1,1,1,0),x.bindFramebuffer(x.FRAMEBUFFER,g.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,g.texture.webGLTexture,0),x.clearColor(0,0,0,0),x.clear(x.COLOR_BUFFER_BIT),x.bufferData(x.ARRAY_BUFFER,this.quadVertexData,x.STATIC_DRAW),x.drawArrays(x.TRIANGLES,0,6),x.bindFramebuffer(x.FRAMEBUFFER,null)},blendFrames:function(p,g,x,y,C){this.manager.blendFrames(p,g,x,y,C)},blendFramesAdditive:function(p,g,x,y,C){this.manager.blendFramesAdditive(p,g,x,y,C)},drawToGame:function(p){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(p)},copyToGame:function(p){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(p)},bindAndDraw:function(p){var g=this.gl,x=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(p.texture);var y=this._tempMatrix1.loadIdentity(),C=this.targetBounds.x,P=this.targetBounds.y,M=C+p.width,w=P+p.height,I=y.getX(C,P),L=y.getX(C,w),B=y.getX(M,w),N=y.getX(M,P),G=y.getY(C,P),V=y.getY(C,w),K=y.getY(M,w),j=y.getY(M,P),J=16777215;this.batchVert(I,G,0,0,0,0,J),this.batchVert(L,V,0,1,0,0,J),this.batchVert(B,K,1,1,0,0,J),this.batchVert(I,G,0,0,0,0,J),this.batchVert(B,K,1,1,0,0,J),this.batchVert(N,j,1,0,0,0,J),x.restoreFramebuffer(!1,!0),x.currentFramebuffer||g.viewport(0,0,x.width,x.height),x.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(p){this.drawToGame(p)},setUVs:function(p,g,x,y,C,P,M,w){var I=this.quadVertexViewF32;I[2]=p,I[3]=g,I[9]=x,I[10]=y,I[16]=C,I[17]=P,I[23]=p,I[24]=g,I[30]=C,I[31]=P,I[37]=M,I[38]=w},setTargetUVs:function(p,g){var x=g.height/p.height;x>.5?x=.5-(x-.5):x=.5+(.5-x),this.setUVs(0,x,0,1+x,1,1+x,1,x)},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,e.prototype.destroy.call(this),this}});c.exports=d},81041:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4778,7 +4778,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(35407),v=t(10312),a=t(83419),r=t(89422),n=t(96293),e=t(36682),i=t(95540),h=t(48247),s=t(49627),l=t(29100),f=new a({Extends:l,initialize:function(d){d.renderTarget=i(d,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),d.vertShader=i(d,"vertShader",s),d.shaders=i(d,"shaders",[{name:"Copy",fragShader:e},{name:"AddBlend",fragShader:o},{name:"LinearBlend",fragShader:h},{name:"ColorMatrix",fragShader:n}]),d.attributes=i(d,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),d.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],d.batchSize=1,l.call(this,d),this.colorMatrix=new r,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){l.prototype.boot.call(this);var u=this.shaders,d=this.renderTargets;this.copyShader=u[0],this.addShader=u[1],this.linearShader=u[2],this.colorMatrixShader=u[3],this.fullFrame1=d[0],this.fullFrame2=d[1],this.halfFrame1=d[2],this.halfFrame2=d[3]},copyFrame:function(u,d,p,g,y){p===void 0&&(p=1),g===void 0&&(g=!0),y===void 0&&(y=!0);var x=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,u.texture.webGLTexture),d?(x.viewport(0,0,d.width,d.height),x.bindFramebuffer(x.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,d.texture.webGLTexture,0)):x.viewport(0,0,u.width,u.height),g&&(y?x.clearColor(0,0,0,0):x.clearColor(0,0,0,1),x.clear(x.COLOR_BUFFER_BIT)),x.bufferData(x.ARRAY_BUFFER,this.vertexData,x.STATIC_DRAW),x.drawArrays(x.TRIANGLES,0,6),x.bindFramebuffer(x.FRAMEBUFFER,null),x.bindTexture(x.TEXTURE_2D,null)},blitFrame:function(u,d,p,g,y,x,C){p===void 0&&(p=1),g===void 0&&(g=!0),y===void 0&&(y=!0),x===void 0&&(x=!1),C===void 0&&(C=!1);var P=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),P.activeTexture(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,u.texture.webGLTexture),u.height>d.height)P.viewport(0,0,u.width,u.height),this.setTargetUVs(u,d);else{var M=d.height-u.height;P.viewport(0,M,u.width,u.height)}if(P.bindFramebuffer(P.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,d.texture.webGLTexture,0),g&&(y?P.clearColor(0,0,0,0):P.clearColor(0,0,0,1),P.clear(P.COLOR_BUFFER_BIT)),x){var w=this.renderer.currentBlendMode;this.renderer.setBlendMode(v.ERASE)}C&&this.flipY(),P.bufferData(P.ARRAY_BUFFER,this.vertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),x&&this.renderer.setBlendMode(w),P.bindFramebuffer(P.FRAMEBUFFER,null),P.bindTexture(P.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(u,d,p,g,y,x,C,P){C===void 0&&(C=!0),P===void 0&&(P=!0);var M=this.gl;M.bindFramebuffer(M.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,u.texture.webGLTexture,0),C&&(P?M.clearColor(0,0,0,0):M.clearColor(0,0,0,1),M.clear(M.COLOR_BUFFER_BIT)),M.activeTexture(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,d.texture.webGLTexture),M.copyTexSubImage2D(M.TEXTURE_2D,0,0,0,p,g,y,x),M.bindFramebuffer(M.FRAMEBUFFER,null),M.bindTexture(M.TEXTURE_2D,null)},copyToGame:function(u){var d=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,u.texture.webGLTexture),d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.STATIC_DRAW),d.drawArrays(d.TRIANGLES,0,6)},drawFrame:function(u,d,p,g){p===void 0&&(p=!0),g===void 0&&(g=this.colorMatrix);var y=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",g.getData()),this.set1f("uAlpha",g.alpha),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,u.texture.webGLTexture),d?(y.viewport(0,0,d.width,d.height),y.bindFramebuffer(y.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,d.texture.webGLTexture,0)):y.viewport(0,0,u.width,u.height),p?y.clearColor(0,0,0,0):y.clearColor(0,0,0,1),y.clear(y.COLOR_BUFFER_BIT),y.bufferData(y.ARRAY_BUFFER,this.vertexData,y.STATIC_DRAW),y.drawArrays(y.TRIANGLES,0,6),y.bindFramebuffer(y.FRAMEBUFFER,null),y.bindTexture(y.TEXTURE_2D,null)},blendFrames:function(u,d,p,g,y,x){g===void 0&&(g=1),y===void 0&&(y=!0),x===void 0&&(x=this.linearShader);var C=this.gl;this.setShader(x),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",g),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,u.texture.webGLTexture),C.activeTexture(C.TEXTURE1),C.bindTexture(C.TEXTURE_2D,d.texture.webGLTexture),p?(C.bindFramebuffer(C.FRAMEBUFFER,p.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,p.texture.webGLTexture,0),C.viewport(0,0,p.width,p.height)):C.viewport(0,0,u.width,u.height),y?C.clearColor(0,0,0,0):C.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT),C.bufferData(C.ARRAY_BUFFER,this.vertexData,C.STATIC_DRAW),C.drawArrays(C.TRIANGLES,0,6),C.bindFramebuffer(C.FRAMEBUFFER,null),C.bindTexture(C.TEXTURE_2D,null)},blendFramesAdditive:function(u,d,p,g,y){this.blendFrames(u,d,p,g,y,this.addShader)},clearFrame:function(u,d){d===void 0&&(d=!0);var p=this.gl;p.viewport(0,0,u.width,u.height),p.bindFramebuffer(p.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),d?p.clearColor(0,0,0,0):p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT);var g=this.renderer.currentFramebuffer;p.bindFramebuffer(p.FRAMEBUFFER,g.webGLFramebuffer)},setUVs:function(u,d,p,g,y,x,C,P){var M=this.vertexViewF32;M[2]=u,M[3]=d,M[6]=p,M[7]=g,M[10]=y,M[11]=x,M[14]=u,M[15]=d,M[18]=y,M[19]=x,M[22]=C,M[23]=P},setTargetUVs:function(u,d){var p=d.height/u.height;p>.5?p=.5-(p-.5):p=.5+(.5-p),this.setUVs(0,p,0,1+p,1,1+p,1,p)},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)}});c.exports=f},36060:c=>{/** + */var o=t(35407),v=t(10312),a=t(83419),r=t(89422),n=t(96293),e=t(36682),i=t(95540),h=t(48247),s=t(49627),l=t(29100),f=new a({Extends:l,initialize:function(d){d.renderTarget=i(d,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),d.vertShader=i(d,"vertShader",s),d.shaders=i(d,"shaders",[{name:"Copy",fragShader:e},{name:"AddBlend",fragShader:o},{name:"LinearBlend",fragShader:h},{name:"ColorMatrix",fragShader:n}]),d.attributes=i(d,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),d.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],d.batchSize=1,l.call(this,d),this.colorMatrix=new r,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){l.prototype.boot.call(this);var u=this.shaders,d=this.renderTargets;this.copyShader=u[0],this.addShader=u[1],this.linearShader=u[2],this.colorMatrixShader=u[3],this.fullFrame1=d[0],this.fullFrame2=d[1],this.halfFrame1=d[2],this.halfFrame2=d[3]},copyFrame:function(u,d,p,g,x){p===void 0&&(p=1),g===void 0&&(g=!0),x===void 0&&(x=!0);var y=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),y.activeTexture(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,u.texture.webGLTexture),d?(y.viewport(0,0,d.width,d.height),y.bindFramebuffer(y.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),y.framebufferTexture2D(y.FRAMEBUFFER,y.COLOR_ATTACHMENT0,y.TEXTURE_2D,d.texture.webGLTexture,0)):y.viewport(0,0,u.width,u.height),g&&(x?y.clearColor(0,0,0,0):y.clearColor(0,0,0,1),y.clear(y.COLOR_BUFFER_BIT)),y.bufferData(y.ARRAY_BUFFER,this.vertexData,y.STATIC_DRAW),y.drawArrays(y.TRIANGLES,0,6),y.bindFramebuffer(y.FRAMEBUFFER,null),y.bindTexture(y.TEXTURE_2D,null)},blitFrame:function(u,d,p,g,x,y,C){p===void 0&&(p=1),g===void 0&&(g=!0),x===void 0&&(x=!0),y===void 0&&(y=!1),C===void 0&&(C=!1);var P=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",p),P.activeTexture(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,u.texture.webGLTexture),u.height>d.height)P.viewport(0,0,u.width,u.height),this.setTargetUVs(u,d);else{var M=d.height-u.height;P.viewport(0,M,u.width,u.height)}if(P.bindFramebuffer(P.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,d.texture.webGLTexture,0),g&&(x?P.clearColor(0,0,0,0):P.clearColor(0,0,0,1),P.clear(P.COLOR_BUFFER_BIT)),y){var w=this.renderer.currentBlendMode;this.renderer.setBlendMode(v.ERASE)}C&&this.flipY(),P.bufferData(P.ARRAY_BUFFER,this.vertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),y&&this.renderer.setBlendMode(w),P.bindFramebuffer(P.FRAMEBUFFER,null),P.bindTexture(P.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(u,d,p,g,x,y,C,P){C===void 0&&(C=!0),P===void 0&&(P=!0);var M=this.gl;M.bindFramebuffer(M.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_2D,u.texture.webGLTexture,0),C&&(P?M.clearColor(0,0,0,0):M.clearColor(0,0,0,1),M.clear(M.COLOR_BUFFER_BIT)),M.activeTexture(M.TEXTURE0),M.bindTexture(M.TEXTURE_2D,d.texture.webGLTexture),M.copyTexSubImage2D(M.TEXTURE_2D,0,0,0,p,g,x,y),M.bindFramebuffer(M.FRAMEBUFFER,null),M.bindTexture(M.TEXTURE_2D,null)},copyToGame:function(u){var d=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,u.texture.webGLTexture),d.bufferData(d.ARRAY_BUFFER,this.vertexData,d.STATIC_DRAW),d.drawArrays(d.TRIANGLES,0,6)},drawFrame:function(u,d,p,g){p===void 0&&(p=!0),g===void 0&&(g=this.colorMatrix);var x=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",g.getData()),this.set1f("uAlpha",g.alpha),x.activeTexture(x.TEXTURE0),x.bindTexture(x.TEXTURE_2D,u.texture.webGLTexture),d?(x.viewport(0,0,d.width,d.height),x.bindFramebuffer(x.FRAMEBUFFER,d.framebuffer.webGLFramebuffer),x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,d.texture.webGLTexture,0)):x.viewport(0,0,u.width,u.height),p?x.clearColor(0,0,0,0):x.clearColor(0,0,0,1),x.clear(x.COLOR_BUFFER_BIT),x.bufferData(x.ARRAY_BUFFER,this.vertexData,x.STATIC_DRAW),x.drawArrays(x.TRIANGLES,0,6),x.bindFramebuffer(x.FRAMEBUFFER,null),x.bindTexture(x.TEXTURE_2D,null)},blendFrames:function(u,d,p,g,x,y){g===void 0&&(g=1),x===void 0&&(x=!0),y===void 0&&(y=this.linearShader);var C=this.gl;this.setShader(y),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",g),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,u.texture.webGLTexture),C.activeTexture(C.TEXTURE1),C.bindTexture(C.TEXTURE_2D,d.texture.webGLTexture),p?(C.bindFramebuffer(C.FRAMEBUFFER,p.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,p.texture.webGLTexture,0),C.viewport(0,0,p.width,p.height)):C.viewport(0,0,u.width,u.height),x?C.clearColor(0,0,0,0):C.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT),C.bufferData(C.ARRAY_BUFFER,this.vertexData,C.STATIC_DRAW),C.drawArrays(C.TRIANGLES,0,6),C.bindFramebuffer(C.FRAMEBUFFER,null),C.bindTexture(C.TEXTURE_2D,null)},blendFramesAdditive:function(u,d,p,g,x){this.blendFrames(u,d,p,g,x,this.addShader)},clearFrame:function(u,d){d===void 0&&(d=!0);var p=this.gl;p.viewport(0,0,u.width,u.height),p.bindFramebuffer(p.FRAMEBUFFER,u.framebuffer.webGLFramebuffer),d?p.clearColor(0,0,0,0):p.clearColor(0,0,0,1),p.clear(p.COLOR_BUFFER_BIT);var g=this.renderer.currentFramebuffer;p.bindFramebuffer(p.FRAMEBUFFER,g.webGLFramebuffer)},setUVs:function(u,d,p,g,x,y,C,P){var M=this.vertexViewF32;M[2]=u,M[3]=d,M[6]=p,M[7]=g,M[10]=x,M[11]=y,M[14]=u,M[15]=d,M[18]=x,M[19]=y,M[22]=C,M[23]=P},setTargetUVs:function(u,d){var p=d.height/u.height;p>.5?p=.5-(p-.5):p=.5+(.5-p),this.setUVs(0,p,0,1+p,1,1+p,1,p)},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)}});c.exports=f},36060:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4937,7 +4937,7 @@ return new `+this.key+`(); * @author Benjamin D. Richards * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(50030),a=new o({initialize:function(n,e,i,h,s,l,f,u,d,p,g,y,x){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=n,this.mipLevel=e,this.minFilter=i,this.magFilter=h,this.wrapT=s,this.wrapS=l,this.format=f,this.pixels=u,this.width=d,this.height=p,this.pma=g??!0,this.forceSize=!!y,this.flipY=!!x,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){if(this.pixels instanceof a){this.webGLTexture=this.pixels.webGLTexture;return}var n=r.createTexture();n.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=n,this._processTexture()}},update:function(r,n,e,i,h,s,l,f,u){if(!(n===0||e===0)){this.pixels=r,this.width=n,this.height=e,this.flipY=i,this.wrapS=h,this.wrapT=s,this.minFilter=l,this.magFilter=f,this.format=u;var d=this.gl;d.isContextLost()||this._processTexture()}},_processTexture:function(){var r=this.gl;r.activeTexture(r.TEXTURE0);var n=r.getParameter(r.TEXTURE_BINDING_2D);r.bindTexture(r.TEXTURE_2D,this.webGLTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.minFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.magFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this.wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this.wrapT),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flipY);var e=this.pixels,i=this.mipLevel,h=this.width,s=this.height,l=this.format,f=!1;if(e==null)r.texImage2D(r.TEXTURE_2D,i,l,h,s,0,l,r.UNSIGNED_BYTE,null),f=v(h,s);else if(e.compressed){h=e.width,s=e.height,f=e.generateMipmap;for(var u=0;u{/** + */var o=t(83419),v=t(50030),a=new o({initialize:function(n,e,i,h,s,l,f,u,d,p,g,x,y){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=n,this.mipLevel=e,this.minFilter=i,this.magFilter=h,this.wrapT=s,this.wrapS=l,this.format=f,this.pixels=u,this.width=d,this.height=p,this.pma=g??!0,this.forceSize=!!x,this.flipY=!!y,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var r=this.gl;if(!r.isContextLost()){if(this.pixels instanceof a){this.webGLTexture=this.pixels.webGLTexture;return}var n=r.createTexture();n.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=n,this._processTexture()}},update:function(r,n,e,i,h,s,l,f,u){if(!(n===0||e===0)){this.pixels=r,this.width=n,this.height=e,this.flipY=i,this.wrapS=h,this.wrapT=s,this.minFilter=l,this.magFilter=f,this.format=u;var d=this.gl;d.isContextLost()||this._processTexture()}},_processTexture:function(){var r=this.gl;r.activeTexture(r.TEXTURE0);var n=r.getParameter(r.TEXTURE_BINDING_2D);r.bindTexture(r.TEXTURE_2D,this.webGLTexture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,this.minFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,this.magFilter),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this.wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this.wrapT),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,this.flipY);var e=this.pixels,i=this.mipLevel,h=this.width,s=this.height,l=this.format,f=!1;if(e==null)r.texImage2D(r.TEXTURE_2D,i,l,h,s,0,l,r.UNSIGNED_BYTE,null),f=v(h,s);else if(e.compressed){h=e.width,s=e.height,f=e.generateMipmap;for(var u=0;u{/** * @author Benjamin D. Richards * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -4949,7 +4949,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(13560),v=t(83419),a=t(50792),r=t(97480),n=t(8443),e=t(57811),i=t(74403),h=t(45818),s=t(29747),l=t(87841),f=t(86555),u=t(56583),d=t(26099),p=t(38058),g=new v({Extends:a,initialize:function(x){a.call(this),this.game=x,this.canvas,this.canvasBounds=new l,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=o.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new d(1,1),this.autoRound=!1,this.autoCenter=o.CENTER.NO_CENTER,this.orientation=o.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:s,windowResize:s,fullScreenChange:s,fullScreenError:s}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(n.BOOT,this.boot,this)},boot:function(){var y=this.game;this.canvas=y.canvas,this.fullscreen=y.device.fullscreen,this.scaleMode!==o.SCALE_MODE.RESIZE&&this.scaleMode!==o.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===o.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()),y.events.on(n.PRE_STEP,this.step,this),y.events.once(n.READY,this.refresh,this),y.events.once(n.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(y){this.getParent(y),this.getParentBounds();var x=y.width,C=y.height,P=y.scaleMode,M=y.zoom,w=y.autoRound;if(typeof x=="string")if(x.substr(-1)!=="%")x=parseInt(x,10);else{var I=this.parentSize.width;I===0&&(I=window.innerWidth);var L=parseInt(x,10)/100;x=Math.floor(I*L)}if(typeof C=="string")if(C.substr(-1)!=="%")C=parseInt(C,10);else{var B=this.parentSize.height;B===0&&(B=window.innerHeight);var N=parseInt(C,10)/100;C=Math.floor(B*N)}this.scaleMode=P,this.autoRound=w,this.autoCenter=y.autoCenter,this.resizeInterval=y.resizeInterval,w&&(x=Math.floor(x),C=Math.floor(C)),this.gameSize.setSize(x,C),M===o.ZOOM.MAX_ZOOM&&(M=this.getMaxZoom()),this.zoom=M,M!==1&&(this._resetZoom=!0),this.baseSize.setSize(x,C),w&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),y.minWidth>0&&this.displaySize.setMin(y.minWidth*M,y.minHeight*M),y.maxWidth>0&&this.displaySize.setMax(y.maxWidth*M,y.maxHeight*M),this.displaySize.setSize(x,C),(y.snapWidth>0||y.snapHeight>0)&&this.displaySize.setSnap(y.snapWidth,y.snapHeight),this.orientation=h(x,C)},getParent:function(y){var x=y.parent;if(x!==null){if(this.parent=i(x),this.parentIsWindow=this.parent===document.body,y.expandParent&&y.scaleMode!==o.SCALE_MODE.NONE){var C=this.parent.getBoundingClientRect();(this.parentIsWindow||C.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",C=this.parent.getBoundingClientRect(),!this.parentIsWindow&&C.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}y.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=i(y.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var y=this.parentSize,x=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(x.height=e(!0));var C=x.width,P=x.height;if(y.width!==C||y.height!==P)return y.setSize(C,P),!0;if(this.canvas){var M=this.canvasBounds,w=this.canvas.getBoundingClientRect();if(w.x!==M.x||w.y!==M.y)return!0}return!1},lockOrientation:function(y){var x=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return x?x.call(screen,y):!1},setParentSize:function(y,x){return this.parentSize.setSize(y,x),this.refresh()},setGameSize:function(y,x){var C=this.autoRound;C&&(y=Math.floor(y),x=Math.floor(x));var P=this.width,M=this.height;return this.gameSize.resize(y,x),this.baseSize.resize(y,x),C&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(y/x),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(P,M)},resize:function(y,x){var C=this.zoom,P=this.autoRound;P&&(y=Math.floor(y),x=Math.floor(x));var M=this.width,w=this.height;this.gameSize.resize(y,x),this.baseSize.resize(y,x),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(y*C,x*C),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var I=this.canvas.style,L=y*C,B=x*C;return P&&(L=Math.floor(L),B=Math.floor(B)),(L!==y||B!==x)&&(I.width=L+"px",I.height=B+"px"),this.refresh(M,w)},setZoom:function(y){return this.zoom=y,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(y,x){return y===void 0&&(y=0),x===void 0&&(x=y),this.displaySize.setSnap(y,x),this.refresh()},refresh:function(y,x){y===void 0&&(y=this.width),x===void 0&&(x=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var C=this.game.domContainer;if(C){this.baseSize.setCSS(C);var P=this.canvas.style,M=C.style;M.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",M.marginLeft=P.marginLeft,M.marginTop=P.marginTop}return this.emit(r.RESIZE,this.gameSize,this.baseSize,this.displaySize,y,x),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var y=h(this.width,this.height);y!==this.orientation&&(this.orientation=y,this.emit(r.ORIENTATION_CHANGE,y))}},updateScale:function(){var y=this.canvas.style,x=this.gameSize.width,C=this.gameSize.height,P,M,w=this.zoom,I=this.autoRound;if(this.scaleMode===o.SCALE_MODE.NONE)this.displaySize.setSize(x*w,C*w),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),this._resetZoom&&(y.width=P+"px",y.height=M+"px",this._resetZoom=!1);else if(this.scaleMode===o.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),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),this.canvas.width=P,this.canvas.height=M;else if(this.scaleMode===o.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),y.width=P+"px",y.height=M+"px";var L=this.parentSize.width/this.gameSize.width,B=this.parentSize.height/this.gameSize.height;L=0?0:-(M.x*w.x),L=M.y>=0?0:-(M.y*w.y),B;P.width>=M.width?B=C.width:B=C.width-(M.width-P.width)*w.x;var N;return P.height>=M.height?N=C.height:N=C.height-(M.height-P.height)*w.y,x.setTo(I,L,B,N),y&&(x.width/=y.zoomX,x.height/=y.zoomY,x.centerX=y.centerX+y.scrollX,x.centerY=y.centerY+y.scrollY),x},step:function(y,x){this.parent&&(this._lastCheck+=x,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var y=this.domlisteners;window.removeEventListener("orientationchange",y.orientationChange,!1),window.removeEventListener("resize",y.windowResize,!1);var x=["webkit","moz",""];x.forEach(function(C){document.removeEventListener(C+"fullscreenchange",y.fullScreenChange,!1),document.removeEventListener(C+"fullscreenerror",y.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",y.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",y.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===o.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===o.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});c.exports=g},64743:c=>{/** + */var o=t(13560),v=t(83419),a=t(50792),r=t(97480),n=t(8443),e=t(57811),i=t(74403),h=t(45818),s=t(29747),l=t(87841),f=t(86555),u=t(56583),d=t(26099),p=t(38058),g=new v({Extends:a,initialize:function(y){a.call(this),this.game=y,this.canvas,this.canvasBounds=new l,this.parent=null,this.parentIsWindow=!1,this.parentSize=new f,this.gameSize=new f,this.baseSize=new f,this.displaySize=new f,this.scaleMode=o.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new d(1,1),this.autoRound=!1,this.autoCenter=o.CENTER.NO_CENTER,this.orientation=o.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:s,windowResize:s,fullScreenChange:s,fullScreenError:s}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(n.BOOT,this.boot,this)},boot:function(){var x=this.game;this.canvas=x.canvas,this.fullscreen=x.device.fullscreen,this.scaleMode!==o.SCALE_MODE.RESIZE&&this.scaleMode!==o.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===o.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()),x.events.on(n.PRE_STEP,this.step,this),x.events.once(n.READY,this.refresh,this),x.events.once(n.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(x){this.getParent(x),this.getParentBounds();var y=x.width,C=x.height,P=x.scaleMode,M=x.zoom,w=x.autoRound;if(typeof y=="string")if(y.substr(-1)!=="%")y=parseInt(y,10);else{var I=this.parentSize.width;I===0&&(I=window.innerWidth);var L=parseInt(y,10)/100;y=Math.floor(I*L)}if(typeof C=="string")if(C.substr(-1)!=="%")C=parseInt(C,10);else{var B=this.parentSize.height;B===0&&(B=window.innerHeight);var N=parseInt(C,10)/100;C=Math.floor(B*N)}this.scaleMode=P,this.autoRound=w,this.autoCenter=x.autoCenter,this.resizeInterval=x.resizeInterval,w&&(y=Math.floor(y),C=Math.floor(C)),this.gameSize.setSize(y,C),M===o.ZOOM.MAX_ZOOM&&(M=this.getMaxZoom()),this.zoom=M,M!==1&&(this._resetZoom=!0),this.baseSize.setSize(y,C),w&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),x.minWidth>0&&this.displaySize.setMin(x.minWidth*M,x.minHeight*M),x.maxWidth>0&&this.displaySize.setMax(x.maxWidth*M,x.maxHeight*M),this.displaySize.setSize(y,C),(x.snapWidth>0||x.snapHeight>0)&&this.displaySize.setSnap(x.snapWidth,x.snapHeight),this.orientation=h(y,C)},getParent:function(x){var y=x.parent;if(y!==null){if(this.parent=i(y),this.parentIsWindow=this.parent===document.body,x.expandParent&&x.scaleMode!==o.SCALE_MODE.NONE){var C=this.parent.getBoundingClientRect();(this.parentIsWindow||C.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",C=this.parent.getBoundingClientRect(),!this.parentIsWindow&&C.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}x.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=i(x.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var x=this.parentSize,y=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(y.height=e(!0));var C=y.width,P=y.height;if(x.width!==C||x.height!==P)return x.setSize(C,P),!0;if(this.canvas){var M=this.canvasBounds,w=this.canvas.getBoundingClientRect();if(w.x!==M.x||w.y!==M.y)return!0}return!1},lockOrientation:function(x){var y=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return y?y.call(screen,x):!1},setParentSize:function(x,y){return this.parentSize.setSize(x,y),this.refresh()},setGameSize:function(x,y){var C=this.autoRound;C&&(x=Math.floor(x),y=Math.floor(y));var P=this.width,M=this.height;return this.gameSize.resize(x,y),this.baseSize.resize(x,y),C&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(x/y),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(P,M)},resize:function(x,y){var C=this.zoom,P=this.autoRound;P&&(x=Math.floor(x),y=Math.floor(y));var M=this.width,w=this.height;this.gameSize.resize(x,y),this.baseSize.resize(x,y),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(x*C,y*C),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var I=this.canvas.style,L=x*C,B=y*C;return P&&(L=Math.floor(L),B=Math.floor(B)),(L!==x||B!==y)&&(I.width=L+"px",I.height=B+"px"),this.refresh(M,w)},setZoom:function(x){return this.zoom=x,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(x,y){return x===void 0&&(x=0),y===void 0&&(y=x),this.displaySize.setSnap(x,y),this.refresh()},refresh:function(x,y){x===void 0&&(x=this.width),y===void 0&&(y=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var C=this.game.domContainer;if(C){this.baseSize.setCSS(C);var P=this.canvas.style,M=C.style;M.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",M.marginLeft=P.marginLeft,M.marginTop=P.marginTop}return this.emit(r.RESIZE,this.gameSize,this.baseSize,this.displaySize,x,y),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var x=h(this.width,this.height);x!==this.orientation&&(this.orientation=x,this.emit(r.ORIENTATION_CHANGE,x))}},updateScale:function(){var x=this.canvas.style,y=this.gameSize.width,C=this.gameSize.height,P,M,w=this.zoom,I=this.autoRound;if(this.scaleMode===o.SCALE_MODE.NONE)this.displaySize.setSize(y*w,C*w),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),this._resetZoom&&(x.width=P+"px",x.height=M+"px",this._resetZoom=!1);else if(this.scaleMode===o.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),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),this.canvas.width=P,this.canvas.height=M;else if(this.scaleMode===o.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),P=this.displaySize.width,M=this.displaySize.height,I&&(P=Math.floor(P),M=Math.floor(M)),x.width=P+"px",x.height=M+"px";var L=this.parentSize.width/this.gameSize.width,B=this.parentSize.height/this.gameSize.height;L=0?0:-(M.x*w.x),L=M.y>=0?0:-(M.y*w.y),B;P.width>=M.width?B=C.width:B=C.width-(M.width-P.width)*w.x;var N;return P.height>=M.height?N=C.height:N=C.height-(M.height-P.height)*w.y,y.setTo(I,L,B,N),x&&(y.width/=x.zoomX,y.height/=x.zoomY,y.centerX=x.centerX+x.scrollX,y.centerY=x.centerY+x.scrollY),y},step:function(x,y){this.parent&&(this._lastCheck+=y,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var x=this.domlisteners;window.removeEventListener("orientationchange",x.orientationChange,!1),window.removeEventListener("resize",x.windowResize,!1);var y=["webkit","moz",""];y.forEach(function(C){document.removeEventListener(C+"fullscreenchange",x.fullScreenChange,!1),document.removeEventListener(C+"fullscreenerror",x.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",x.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",x.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===o.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===o.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});c.exports=g},64743:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5021,7 +5021,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(89993),a=t(44594),r=t(8443),n=t(35154),e=t(54899),i=t(29747),h=t(97482),s=t(2368),l=new o({initialize:function(u,d){if(this.game=u,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,d){Array.isArray(d)||(d=[d]);for(var p=0;p-1&&(delete this.keys[p],this.scenes.splice(d,1),this._start.indexOf(p)>-1&&(d=this._start.indexOf(p),this._start.splice(d,1)),u.sys.destroy())}return this},bootScene:function(f){var u=f.sys,d=u.settings;u.sceneUpdate=i,f.init&&(f.init.call(f,d.data),d.status=v.INIT,d.isTransition&&u.events.emit(a.TRANSITION_INIT,d.transitionFrom,d.transitionDuration));var p;u.load&&(p=u.load,p.reset()),p&&f.preload?(f.preload.call(f),d.status=v.LOADING,p.once(e.COMPLETE,this.loadComplete,this),p.start()):this.create(f)},loadComplete:function(f){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(f.scene)},payloadComplete:function(f){this.bootScene(f.scene)},update:function(f,u){this.processQueue(),this.isProcessing=!0;for(var d=this.scenes.length-1;d>=0;d--){var p=this.scenes[d].sys;p.settings.status>v.START&&p.settings.status<=v.RUNNING&&p.step(f,u),p.scenePlugin&&p.scenePlugin._target&&p.scenePlugin.step(f,u)}},render:function(f){for(var u=0;u=v.LOADING&&d.settings.status=v.START&&g<=v.CREATING)return this;if(g>=v.RUNNING&&g<=v.SLEEPING)p.shutdown(),p.sceneUpdate=i,p.start(u);else{p.sceneUpdate=i,p.start(u);var y;if(p.load&&(y=p.load),y&&p.settings.hasOwnProperty("pack")&&(y.reset(),y.addPack({payload:p.settings.pack})))return p.settings.status=v.LOADING,y.once(e.COMPLETE,this.payloadComplete,this),y.start(),this}return this.bootScene(d),this},stop:function(f,u){var d=this.getScene(f);if(d&&!d.sys.isTransitioning()&&d.sys.settings.status!==v.SHUTDOWN){var p=d.sys.load;p&&(p.off(e.COMPLETE,this.loadComplete,this),p.off(e.COMPLETE,this.payloadComplete,this)),d.sys.shutdown(u)}return this},switch:function(f,u){var d=this.getScene(f),p=this.getScene(u);return d&&p&&d!==p&&(this.sleep(f),this.isSleeping(u)?this.wake(u):this.start(u)),this},getAt:function(f){return this.scenes[f]},getIndex:function(f){var u=this.getScene(f);return this.scenes.indexOf(u)},bringToTop:function(f){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u!==-1&&u0){var d=this.getScene(f);this.scenes.splice(u,1),this.scenes.unshift(d)}}return this},moveDown:function(f){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u>0){var d=u-1,p=this.getScene(f),g=this.getAt(d);this.scenes[u]=g,this.scenes[d]=p}}return this},moveUp:function(f){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:f,keyB:null});else{var u=this.getIndex(f);if(ud),0,g)}}return this},moveBelow:function(f,u){if(f===u)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:f,keyB:u});else{var d=this.getIndex(f),p=this.getIndex(u);if(d!==-1&&p!==-1&&p>d){var g=this.getAt(p);this.scenes.splice(p,1),d===0?this.scenes.unshift(g):this.scenes.splice(d-(p-1&&(delete this.keys[p],this.scenes.splice(d,1),this._start.indexOf(p)>-1&&(d=this._start.indexOf(p),this._start.splice(d,1)),u.sys.destroy())}return this},bootScene:function(f){var u=f.sys,d=u.settings;u.sceneUpdate=i,f.init&&(f.init.call(f,d.data),d.status=v.INIT,d.isTransition&&u.events.emit(a.TRANSITION_INIT,d.transitionFrom,d.transitionDuration));var p;u.load&&(p=u.load,p.reset()),p&&f.preload?(f.preload.call(f),d.status=v.LOADING,p.once(e.COMPLETE,this.loadComplete,this),p.start()):this.create(f)},loadComplete:function(f){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(f.scene)},payloadComplete:function(f){this.bootScene(f.scene)},update:function(f,u){this.processQueue(),this.isProcessing=!0;for(var d=this.scenes.length-1;d>=0;d--){var p=this.scenes[d].sys;p.settings.status>v.START&&p.settings.status<=v.RUNNING&&p.step(f,u),p.scenePlugin&&p.scenePlugin._target&&p.scenePlugin.step(f,u)}},render:function(f){for(var u=0;u=v.LOADING&&d.settings.status=v.START&&g<=v.CREATING)return this;if(g>=v.RUNNING&&g<=v.SLEEPING)p.shutdown(),p.sceneUpdate=i,p.start(u);else{p.sceneUpdate=i,p.start(u);var x;if(p.load&&(x=p.load),x&&p.settings.hasOwnProperty("pack")&&(x.reset(),x.addPack({payload:p.settings.pack})))return p.settings.status=v.LOADING,x.once(e.COMPLETE,this.payloadComplete,this),x.start(),this}return this.bootScene(d),this},stop:function(f,u){var d=this.getScene(f);if(d&&!d.sys.isTransitioning()&&d.sys.settings.status!==v.SHUTDOWN){var p=d.sys.load;p&&(p.off(e.COMPLETE,this.loadComplete,this),p.off(e.COMPLETE,this.payloadComplete,this)),d.sys.shutdown(u)}return this},switch:function(f,u){var d=this.getScene(f),p=this.getScene(u);return d&&p&&d!==p&&(this.sleep(f),this.isSleeping(u)?this.wake(u):this.start(u)),this},getAt:function(f){return this.scenes[f]},getIndex:function(f){var u=this.getScene(f);return this.scenes.indexOf(u)},bringToTop:function(f){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u!==-1&&u0){var d=this.getScene(f);this.scenes.splice(u,1),this.scenes.unshift(d)}}return this},moveDown:function(f){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:f,keyB:null});else{var u=this.getIndex(f);if(u>0){var d=u-1,p=this.getScene(f),g=this.getAt(d);this.scenes[u]=g,this.scenes[d]=p}}return this},moveUp:function(f){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:f,keyB:null});else{var u=this.getIndex(f);if(ud),0,g)}}return this},moveBelow:function(f,u){if(f===u)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:f,keyB:u});else{var d=this.getIndex(f),p=this.getIndex(u);if(d!==-1&&p!==-1&&p>d){var g=this.getAt(p);this.scenes.splice(p,1),d===0?this.scenes.unshift(g):this.scenes.splice(d-(p{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. @@ -5144,7 +5144,7 @@ return new `+this.key+`(); * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(41786),a=t(50792),r=t(14463),n=t(8443),e=t(46710),i=t(58731),h=t(29747),s=t(26099),l=new o({Extends:a,initialize:function(u){a.call(this),this.game=u,this.jsonCache=u.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 s,u.events.on(n.BLUR,this.onGameBlur,this),u.events.on(n.FOCUS,this.onGameFocus,this),u.events.on(n.PRE_STEP,this.update,this),u.events.once(n.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(f,u){u===void 0&&(u={});var d=this.add(f,u);d.spritemap=this.jsonCache.get(f).spritemap;for(var p in d.spritemap)if(d.spritemap.hasOwnProperty(p)){var g=v(u),y=d.spritemap[p];g.loop=y.hasOwnProperty("loop")?y.loop:!1,d.addMarker({name:p,start:y.start,duration:y.end-y.start,config:g})}return d},get:function(f){return i(this.sounds,"key",f)},getAll:function(f){return f?e(this.sounds,"key",f):e(this.sounds)},getAllPlaying:function(){return e(this.sounds,"isPlaying",!0)},play:function(f,u){var d=this.add(f);return d.once(r.COMPLETE,d.destroy,d),u?u.name?(d.addMarker(u),d.play(u.name)):d.play(u):d.play()},playAudioSprite:function(f,u,d){var p=this.addAudioSprite(f);return p.once(r.COMPLETE,p.destroy,p),p.play(u,d)},remove:function(f){var u=this.sounds.indexOf(f);return u!==-1?(f.destroy(),this.sounds.splice(u,1),!0):!1},removeAll:function(){this.sounds.forEach(function(f){f.destroy()}),this.sounds.length=0},removeByKey:function(f){for(var u=0,d=this.sounds.length-1;d>=0;d--){var p=this.sounds[d];p.key===f&&(p.destroy(),this.sounds.splice(d,1),u++)}return u},pauseAll:function(){this.forEachActiveSound(function(f){f.pause()}),this.emit(r.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(f){f.resume()}),this.emit(r.RESUME_ALL,this)},setListenerPosition:h,stopAll:function(){this.forEachActiveSound(function(f){f.stop()}),this.emit(r.STOP_ALL,this)},stopByKey:function(f){var u=0;return this.getAll(f).forEach(function(d){d.stop()&&u++}),u},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(f,u){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(r.UNLOCKED,this));for(var d=this.sounds.length-1;d>=0;d--)this.sounds[d].pendingRemove&&this.sounds.splice(d,1);this.sounds.forEach(function(p){p.update(f,u)})},destroy:function(){this.game.events.off(n.BLUR,this.onGameBlur,this),this.game.events.off(n.FOCUS,this.onGameFocus,this),this.game.events.off(n.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(f,u){var d=this;this.sounds.forEach(function(p,g){p&&!p.pendingRemove&&f.call(u||d,p,g,d.sounds)})},setRate:function(f){return this.rate=f,this},rate:{get:function(){return this._rate},set:function(f){this._rate=f,this.forEachActiveSound(function(u){u.calculateRate()}),this.emit(r.GLOBAL_RATE,this,f)}},setDetune:function(f){return this.detune=f,this},detune:{get:function(){return this._detune},set:function(f){this._detune=f,this.forEachActiveSound(function(u){u.calculateRate()}),this.emit(r.GLOBAL_DETUNE,this,f)}}});c.exports=l},14747:(c,m,t)=>{/** + */var o=t(83419),v=t(41786),a=t(50792),r=t(14463),n=t(8443),e=t(46710),i=t(58731),h=t(29747),s=t(26099),l=new o({Extends:a,initialize:function(u){a.call(this),this.game=u,this.jsonCache=u.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 s,u.events.on(n.BLUR,this.onGameBlur,this),u.events.on(n.FOCUS,this.onGameFocus,this),u.events.on(n.PRE_STEP,this.update,this),u.events.once(n.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(f,u){u===void 0&&(u={});var d=this.add(f,u);d.spritemap=this.jsonCache.get(f).spritemap;for(var p in d.spritemap)if(d.spritemap.hasOwnProperty(p)){var g=v(u),x=d.spritemap[p];g.loop=x.hasOwnProperty("loop")?x.loop:!1,d.addMarker({name:p,start:x.start,duration:x.end-x.start,config:g})}return d},get:function(f){return i(this.sounds,"key",f)},getAll:function(f){return f?e(this.sounds,"key",f):e(this.sounds)},getAllPlaying:function(){return e(this.sounds,"isPlaying",!0)},play:function(f,u){var d=this.add(f);return d.once(r.COMPLETE,d.destroy,d),u?u.name?(d.addMarker(u),d.play(u.name)):d.play(u):d.play()},playAudioSprite:function(f,u,d){var p=this.addAudioSprite(f);return p.once(r.COMPLETE,p.destroy,p),p.play(u,d)},remove:function(f){var u=this.sounds.indexOf(f);return u!==-1?(f.destroy(),this.sounds.splice(u,1),!0):!1},removeAll:function(){this.sounds.forEach(function(f){f.destroy()}),this.sounds.length=0},removeByKey:function(f){for(var u=0,d=this.sounds.length-1;d>=0;d--){var p=this.sounds[d];p.key===f&&(p.destroy(),this.sounds.splice(d,1),u++)}return u},pauseAll:function(){this.forEachActiveSound(function(f){f.pause()}),this.emit(r.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(f){f.resume()}),this.emit(r.RESUME_ALL,this)},setListenerPosition:h,stopAll:function(){this.forEachActiveSound(function(f){f.stop()}),this.emit(r.STOP_ALL,this)},stopByKey:function(f){var u=0;return this.getAll(f).forEach(function(d){d.stop()&&u++}),u},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(f,u){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(r.UNLOCKED,this));for(var d=this.sounds.length-1;d>=0;d--)this.sounds[d].pendingRemove&&this.sounds.splice(d,1);this.sounds.forEach(function(p){p.update(f,u)})},destroy:function(){this.game.events.off(n.BLUR,this.onGameBlur,this),this.game.events.off(n.FOCUS,this.onGameFocus,this),this.game.events.off(n.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(f,u){var d=this;this.sounds.forEach(function(p,g){p&&!p.pendingRemove&&f.call(u||d,p,g,d.sounds)})},setRate:function(f){return this.rate=f,this},rate:{get:function(){return this._rate},set:function(f){this._rate=f,this.forEachActiveSound(function(u){u.calculateRate()}),this.emit(r.GLOBAL_RATE,this,f)}},setDetune:function(f){return this.detune=f,this},detune:{get:function(){return this._detune},set:function(f){this._detune=f,this.forEachActiveSound(function(u){u.calculateRate()}),this.emit(r.GLOBAL_DETUNE,this,f)}}});c.exports=l},14747:(c,m,t)=>{/** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2013-2024 Phaser Studio Inc. @@ -5284,7 +5284,7 @@ return new `+this.key+`(); * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(53134),v=t(85034),a=t(83419),r=t(14463),n=t(8443),e=t(71741),i=t(95540),h=new a({Extends:v,initialize:function(l){this.context=this.createAudioContext(l),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=this.context.state==="suspended"&&("ontouchstart"in window||"onclick"in window),v.call(this,l),this.locked&&l.isBooted?this.unlock():l.events.once(n.BOOT,this.unlock,this)},createAudioContext:function(s){var l=s.config.audio;if(l.context)return l.context.resume(),l.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(s){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=s,this.masterMuteNode=s.createGain(),this.masterVolumeNode=s.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(s.destination),this.destination=this.masterMuteNode,this},add:function(s,l){var f=new e(this,s,l);return this.sounds.push(f),f},decodeAudio:function(s,l){var f;Array.isArray(s)?f=s:f=[{key:s,data:l}];for(var u=this.game.cache.audio,d=f.length,p=0;p{/** + */var o=t(53134),v=t(85034),a=t(83419),r=t(14463),n=t(8443),e=t(71741),i=t(95540),h=new a({Extends:v,initialize:function(l){this.context=this.createAudioContext(l),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=this.context.state==="suspended"&&("ontouchstart"in window||"onclick"in window),v.call(this,l),this.locked&&l.isBooted?this.unlock():l.events.once(n.BOOT,this.unlock,this)},createAudioContext:function(s){var l=s.config.audio;if(l.context)return l.context.resume(),l.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(s){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=s,this.masterMuteNode=s.createGain(),this.masterVolumeNode=s.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(s.destination),this.destination=this.masterMuteNode,this},add:function(s,l){var f=new e(this,s,l);return this.sounds.push(f),f},decodeAudio:function(s,l){var f;Array.isArray(s)?f=s:f=[{key:s,data:l}];for(var u=this.game.cache.audio,d=f.length,p=0;p{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5301,7 +5301,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(43886);function v(x){if(!(this instanceof v))return new v(x);this._maxEntries=Math.max(4,x||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}v.prototype={all:function(){return this._all(this.data,[])},search:function(x){var C=this.data,P=[],M=this.toBBox;if(!p(x,C))return P;for(var w=[],I,L,B,N;C;){for(I=0,L=C.children.length;I=0&&I[C].children.length>this._maxEntries;)this._split(I,C),C--;this._adjustParentBBoxes(w,I,C)},_split:function(x,C){var P=x[C],M=P.children.length,w=this._minEntries;this._chooseSplitAxis(P,w,M);var I=this._chooseSplitIndex(P,w,M),L=g(P.children.splice(I,P.children.length-I));L.height=P.height,L.leaf=P.leaf,r(P,this.toBBox),r(L,this.toBBox),C?x[C-1].children.push(L):this._splitRoot(P,L)},_splitRoot:function(x,C){this.data=g([x,C]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(x,C,P){var M,w,I,L,B,N,G,V;for(N=G=1/0,M=C;M<=P-C;M++)w=n(x,0,M,this.toBBox),I=n(x,M,P,this.toBBox),L=u(w,I),B=s(w)+s(I),L=C;N--)G=x.children[N],e(L,x.leaf?w(G):G),B+=l(L);return B},_adjustParentBBoxes:function(x,C,P){for(var M=P;M>=0;M--)e(C[M],x)},_condense:function(x){for(var C=x.length-1,P;C>=0;C--)x[C].children.length===0?C>0?(P=x[C-1].children,P.splice(P.indexOf(x[C]),1)):this.clear():r(x[C],this.toBBox)},compareMinX:function(x,C){return x.left-C.left},compareMinY:function(x,C){return x.top-C.top},toBBox:function(x){return{minX:x.left,minY:x.top,maxX:x.right,maxY:x.bottom}}};function a(x,C,P){if(!P)return C.indexOf(x);for(var M=0;M=x.minX&&C.maxY>=x.minY}function g(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(x,C,P,M,w){for(var I=[C,P],L;I.length;)P=I.pop(),C=I.pop(),!(P-C<=M)&&(L=C+Math.ceil((P-C)/M/2)*M,o(x,L,C,P,w),I.push(C,L,L,P))}c.exports=v},35072:(c,m,t)=>{/** + */var o=t(43886);function v(y){if(!(this instanceof v))return new v(y);this._maxEntries=Math.max(4,y||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}v.prototype={all:function(){return this._all(this.data,[])},search:function(y){var C=this.data,P=[],M=this.toBBox;if(!p(y,C))return P;for(var w=[],I,L,B,N;C;){for(I=0,L=C.children.length;I=0&&I[C].children.length>this._maxEntries;)this._split(I,C),C--;this._adjustParentBBoxes(w,I,C)},_split:function(y,C){var P=y[C],M=P.children.length,w=this._minEntries;this._chooseSplitAxis(P,w,M);var I=this._chooseSplitIndex(P,w,M),L=g(P.children.splice(I,P.children.length-I));L.height=P.height,L.leaf=P.leaf,r(P,this.toBBox),r(L,this.toBBox),C?y[C-1].children.push(L):this._splitRoot(P,L)},_splitRoot:function(y,C){this.data=g([y,C]),this.data.height=y.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},_chooseSplitIndex:function(y,C,P){var M,w,I,L,B,N,G,V;for(N=G=1/0,M=C;M<=P-C;M++)w=n(y,0,M,this.toBBox),I=n(y,M,P,this.toBBox),L=u(w,I),B=s(w)+s(I),L=C;N--)G=y.children[N],e(L,y.leaf?w(G):G),B+=l(L);return B},_adjustParentBBoxes:function(y,C,P){for(var M=P;M>=0;M--)e(C[M],y)},_condense:function(y){for(var C=y.length-1,P;C>=0;C--)y[C].children.length===0?C>0?(P=y[C-1].children,P.splice(P.indexOf(y[C]),1)):this.clear():r(y[C],this.toBBox)},compareMinX:function(y,C){return y.left-C.left},compareMinY:function(y,C){return y.top-C.top},toBBox:function(y){return{minX:y.left,minY:y.top,maxX:y.right,maxY:y.bottom}}};function a(y,C,P){if(!P)return C.indexOf(y);for(var M=0;M=y.minX&&C.maxY>=y.minY}function g(y){return{children:y,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(y,C,P,M,w){for(var I=[C,P],L;I.length;)P=I.pop(),C=I.pop(),!(P-C<=M)&&(L=C+Math.ceil((P-C)/M/2)*M,o(y,L,C,P,w),I.push(C,L,L,P))}c.exports=v},35072:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5329,15 +5329,15 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(45319),a=t(40987),r=t(8054),n=t(50030),e=t(79237),i=new o({Extends:e,initialize:function(s,l,f,u,d){e.call(this,s,l,f,u,d),this.add("__BASE",0,0,0,u,d),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=u,this.height=d,this.imageData=this.context.getImageData(0,0,u,d),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===r.WEBGL&&this.refresh(),this},draw:function(h,s,l,f){return f===void 0&&(f=!0),this.context.drawImage(l,h,s),f&&this.update(),this},drawFrame:function(h,s,l,f,u){l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=!0);var d=this.manager.getFrame(h,s);if(d){var p=d.canvasData,g=d.cutWidth,y=d.cutHeight,x=d.source.resolution;this.context.drawImage(d.source.image,p.x,p.y,g,y,l,f,g/x,y/x),u&&this.update()}return this},setPixel:function(h,s,l,f,u,d){d===void 0&&(d=255),h=Math.abs(Math.floor(h)),s=Math.abs(Math.floor(s));var p=this.getIndex(h,s);if(p>-1){var g=this.context.getImageData(h,s,1,1);g.data[0]=l,g.data[1]=f,g.data[2]=u,g.data[3]=d,this.context.putImageData(g,h,s)}return this},putData:function(h,s,l,f,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=h.width),p===void 0&&(p=h.height),this.context.putImageData(h,s,l,f,u,d,p),this},getData:function(h,s,l,f){h=v(Math.floor(h),0,this.width-1),s=v(Math.floor(s),0,this.height-1),l=v(l,1,this.width-h),f=v(f,1,this.height-s);var u=this.context.getImageData(h,s,l,f);return u},getPixel:function(h,s,l){l||(l=new a);var f=this.getIndex(h,s);if(f>-1){var u=this.data,d=u[f+0],p=u[f+1],g=u[f+2],y=u[f+3];l.setTo(d,p,g,y)}return l},getPixels:function(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=this.width),f===void 0&&(f=l),h=Math.abs(Math.round(h)),s=Math.abs(Math.round(s));for(var u=v(h,0,this.width),d=v(h+l,0,this.width),p=v(s,0,this.height),g=v(s+f,0,this.height),y=new a,x=[],C=p;C{/** + */var o=t(83419),v=t(45319),a=t(40987),r=t(8054),n=t(50030),e=t(79237),i=new o({Extends:e,initialize:function(s,l,f,u,d){e.call(this,s,l,f,u,d),this.add("__BASE",0,0,0,u,d),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=u,this.height=d,this.imageData=this.context.getImageData(0,0,u,d),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===r.WEBGL&&this.refresh(),this},draw:function(h,s,l,f){return f===void 0&&(f=!0),this.context.drawImage(l,h,s),f&&this.update(),this},drawFrame:function(h,s,l,f,u){l===void 0&&(l=0),f===void 0&&(f=0),u===void 0&&(u=!0);var d=this.manager.getFrame(h,s);if(d){var p=d.canvasData,g=d.cutWidth,x=d.cutHeight,y=d.source.resolution;this.context.drawImage(d.source.image,p.x,p.y,g,x,l,f,g/y,x/y),u&&this.update()}return this},setPixel:function(h,s,l,f,u,d){d===void 0&&(d=255),h=Math.abs(Math.floor(h)),s=Math.abs(Math.floor(s));var p=this.getIndex(h,s);if(p>-1){var g=this.context.getImageData(h,s,1,1);g.data[0]=l,g.data[1]=f,g.data[2]=u,g.data[3]=d,this.context.putImageData(g,h,s)}return this},putData:function(h,s,l,f,u,d,p){return f===void 0&&(f=0),u===void 0&&(u=0),d===void 0&&(d=h.width),p===void 0&&(p=h.height),this.context.putImageData(h,s,l,f,u,d,p),this},getData:function(h,s,l,f){h=v(Math.floor(h),0,this.width-1),s=v(Math.floor(s),0,this.height-1),l=v(l,1,this.width-h),f=v(f,1,this.height-s);var u=this.context.getImageData(h,s,l,f);return u},getPixel:function(h,s,l){l||(l=new a);var f=this.getIndex(h,s);if(f>-1){var u=this.data,d=u[f+0],p=u[f+1],g=u[f+2],x=u[f+3];l.setTo(d,p,g,x)}return l},getPixels:function(h,s,l,f){h===void 0&&(h=0),s===void 0&&(s=0),l===void 0&&(l=this.width),f===void 0&&(f=l),h=Math.abs(Math.round(h)),s=Math.abs(Math.round(s));for(var u=v(h,0,this.width),d=v(h+l,0,this.width),p=v(s,0,this.height),g=v(s+f,0,this.height),x=new a,y=[],C=p;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(10312),v=t(71911),a=t(27919),r=t(83419),n=t(8054),e=t(4327),i=t(95540),h=t(36060),s=t(32302),l=t(79237),f=t(70554),u=new r({Extends:l,initialize:function(p,g,y,x){y===void 0&&(y=256),x===void 0&&(x=256),this.type="DynamicTexture";var C=p.game.renderer,P=C&&C.type===n.CANVAS,M=P?a.create2D(this,y,x):[this];l.call(this,p,g,M,y,x),this.add("__BASE",0,0,0,y,x),this.renderer=C,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=P?M:null,this.context=P?M.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new v(0,0,y,x).setScene(p.game.scene.systemScene,!1),this.renderTarget=P?null:new s(C,y,x,1,0,!1,!0,!0,!1),this.pipeline=P?null:C.pipelines.get(h.SINGLE_PIPELINE),this.setSize(y,x)},setSize:function(d,p){p===void 0&&(p=d);var g=this.get(),y=g.source;if(d!==this.width||p!==this.height){this.canvas&&(this.canvas.width=d,this.canvas.height=p);var x=this.renderTarget;x&&(x.willResize(d,p)&&x.resize(d,p),x.texture!==y.glTexture&&this.renderer.deleteTexture(y.glTexture),this.setFromRenderTarget()),this.camera.setSize(d,p),y.width=d,y.height=p,g.setSize(d,p),this.width=d,this.height=p}else{var C=this.getSourceImage();g.cutX+d>C.width&&(d=C.width-g.cutX),g.cutY+p>C.height&&(p=C.height-g.cutY),g.setSize(d,p,g.cutX,g.cutY)}return this},setFromRenderTarget:function(){var d=this.get(),p=d.source,g=this.renderTarget;return p.isRenderTexture=!0,p.isGLTexture=!0,p.glTexture=g.texture,this},setIsSpriteTexture:function(d){return this.isSpriteTexture=d,this},fill:function(d,p,g,y,x,C){var P=this.camera,M=this.renderer;p===void 0&&(p=1),g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=this.width),C===void 0&&(C=this.height);var w=d>>16&255,I=d>>8&255,L=d&255,B=this.renderTarget;if(P.preRender(),B){B.bind(!0);var N=this.pipeline.manager.set(this.pipeline),G=M.width/B.width,V=M.height/B.height,K=B.height-(y+C);N.drawFillRect(g*G,K*V,x*G,C*V,f.getTintFromFloats(L/255,I/255,w/255,1),p),B.unbind(!0)}else{var j=this.context;M.setContext(j),j.globalCompositeOperation="source-over",j.fillStyle="rgba("+w+","+I+","+L+","+p+")",j.fillRect(g,y,x,C),M.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var d=this.context,p=this.renderTarget;p?p.clear():d&&(d.save(),d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,this.width,this.height),d.restore()),this.dirty=!1}return this},stamp:function(d,p,g,y,x){g===void 0&&(g=0),y===void 0&&(y=0);var C=i(x,"alpha",1),P=i(x,"tint",16777215),M=i(x,"angle",0),w=i(x,"rotation",0),I=i(x,"scale",1),L=i(x,"scaleX",I),B=i(x,"scaleY",I),N=i(x,"originX",.5),G=i(x,"originY",.5),V=i(x,"blendMode",0),K=i(x,"erase",!1),j=i(x,"skipBatch",!1),J=this.manager.resetStamp(C,P);return J.setAngle(0),M!==0?J.setAngle(M):w!==0&&J.setRotation(w),J.setScale(L,B),J.setTexture(d,p),J.setOrigin(N,G),J.setBlendMode(V),K&&(this._eraseMode=!0),j?this.batchGameObject(J,g,y):this.draw(J,g,y),K&&(this._eraseMode=!1),this},erase:function(d,p,g){return this._eraseMode=!0,this.draw(d,p,g),this._eraseMode=!1,this},draw:function(d,p,g,y,x){return this.beginDraw(),this.batchDraw(d,p,g,y,x),this.endDraw(),this},drawFrame:function(d,p,g,y,x,C){return this.beginDraw(),this.batchDrawFrame(d,p,g,y,x,C),this.endDraw(),this},repeat:function(d,p,g,y,x,C,P,M,w){if(g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=this.width),C===void 0&&(C=this.height),P===void 0&&(P=1),M===void 0&&(M=16777215),w===void 0&&(w=!1),d instanceof e?p=d:p=this.manager.getFrame(d,p),!p)return this;var I=this.manager.resetStamp(P,M);I.setFrame(p),I.setOrigin(0);var L=p.width,B=p.height;x=Math.floor(x),C=Math.floor(C);var N=Math.ceil(x/L),G=Math.ceil(C/B),V=N*L-x,K=G*B-C;V>0&&(V=L-V),K>0&&(K=B-K),g<0&&(N+=Math.ceil(Math.abs(g)/L)),y<0&&(G+=Math.ceil(Math.abs(y)/B));var j=g,J=y,X=!1,Y=this.manager.stampCrop.setTo(0,0,L,B);w||this.beginDraw();for(var b=0;b0&&z===N-1&&(X=!0,Y.width=V),K>0&&b===G-1&&(X=!0,Y.height=K),X&&I.setCrop(Y),this.batchGameObject(I,j,J),I.isCropped=!1,Y.setTo(0,0,L,B),j+=L}j=g,J+=B}return w||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var d=this.camera,p=this.renderer,g=this.renderTarget;d.preRender(),g?p.beginCapture(g.width,g.height):p.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(d,p,g,y,x){return Array.isArray(d)||(d=[d]),this.batchList(d,p,g,y,x),this},batchDrawFrame:function(d,p,g,y,x,C){g===void 0&&(g=0),y===void 0&&(y=0),x===void 0&&(x=1),C===void 0&&(C=16777215);var P=this.manager.getFrame(d,p);return P&&(this.renderTarget?this.pipeline.batchTextureFrame(P,g,y,C,x,this.camera.matrix,null):this.batchTextureFrame(P,g,y,x,C)),this},endDraw:function(d){if(d===void 0&&(d=this._eraseMode),this.isDrawing){var p=this.renderer,g=this.renderTarget;if(g){var y=p.endCapture(),x=p.pipelines.setUtility();x.blitFrame(y,g,1,!1,!1,d,this.isSpriteTexture),p.resetScissor(),p.resetViewport()}else p.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(d,p,g,y,x){var C=d.length;if(C!==0)for(var P=0;P0&&w.height>0&&M.drawImage(I,w.x,w.y,w.width,w.height,p,g,w.width,w.height),M.restore()}},snapshotArea:function(d,p,g,y,x,C,P){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,x,!1,d,p,g,y,C,P):this.renderer.snapshotCanvas(this.canvas,x,!1,d,p,g,y,C,P),this},snapshot:function(d,p,g){return this.snapshotArea(0,0,this.width,this.height,d,p,g)},snapshotPixel:function(d,p,g){return this.snapshotArea(d,p,1,1,g,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(d,p,g,y){var x=this.manager.resetStamp();x.setTexture(this),x.setOrigin(0),x.renderWebGL(d,x,g,y)},renderCanvas:function(){},destroy:function(){var d=this.manager.stamp;d&&d.texture===this&&this.manager.resetStamp(),l.prototype.destroy.call(this),a.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});c.exports=u},4327:(c,m,t)=>{/** + */var o=t(10312),v=t(71911),a=t(27919),r=t(83419),n=t(8054),e=t(4327),i=t(95540),h=t(36060),s=t(32302),l=t(79237),f=t(70554),u=new r({Extends:l,initialize:function(p,g,x,y){x===void 0&&(x=256),y===void 0&&(y=256),this.type="DynamicTexture";var C=p.game.renderer,P=C&&C.type===n.CANVAS,M=P?a.create2D(this,x,y):[this];l.call(this,p,g,M,x,y),this.add("__BASE",0,0,0,x,y),this.renderer=C,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=P?M:null,this.context=P?M.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new v(0,0,x,y).setScene(p.game.scene.systemScene,!1),this.renderTarget=P?null:new s(C,x,y,1,0,!1,!0,!0,!1),this.pipeline=P?null:C.pipelines.get(h.SINGLE_PIPELINE),this.setSize(x,y)},setSize:function(d,p){p===void 0&&(p=d);var g=this.get(),x=g.source;if(d!==this.width||p!==this.height){this.canvas&&(this.canvas.width=d,this.canvas.height=p);var y=this.renderTarget;y&&(y.willResize(d,p)&&y.resize(d,p),y.texture!==x.glTexture&&this.renderer.deleteTexture(x.glTexture),this.setFromRenderTarget()),this.camera.setSize(d,p),x.width=d,x.height=p,g.setSize(d,p),this.width=d,this.height=p}else{var C=this.getSourceImage();g.cutX+d>C.width&&(d=C.width-g.cutX),g.cutY+p>C.height&&(p=C.height-g.cutY),g.setSize(d,p,g.cutX,g.cutY)}return this},setFromRenderTarget:function(){var d=this.get(),p=d.source,g=this.renderTarget;return p.isRenderTexture=!0,p.isGLTexture=!0,p.glTexture=g.texture,this},setIsSpriteTexture:function(d){return this.isSpriteTexture=d,this},fill:function(d,p,g,x,y,C){var P=this.camera,M=this.renderer;p===void 0&&(p=1),g===void 0&&(g=0),x===void 0&&(x=0),y===void 0&&(y=this.width),C===void 0&&(C=this.height);var w=d>>16&255,I=d>>8&255,L=d&255,B=this.renderTarget;if(P.preRender(),B){B.bind(!0);var N=this.pipeline.manager.set(this.pipeline),G=M.width/B.width,V=M.height/B.height,K=B.height-(x+C);N.drawFillRect(g*G,K*V,y*G,C*V,f.getTintFromFloats(L/255,I/255,w/255,1),p),B.unbind(!0)}else{var j=this.context;M.setContext(j),j.globalCompositeOperation="source-over",j.fillStyle="rgba("+w+","+I+","+L+","+p+")",j.fillRect(g,x,y,C),M.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var d=this.context,p=this.renderTarget;p?p.clear():d&&(d.save(),d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,this.width,this.height),d.restore()),this.dirty=!1}return this},stamp:function(d,p,g,x,y){g===void 0&&(g=0),x===void 0&&(x=0);var C=i(y,"alpha",1),P=i(y,"tint",16777215),M=i(y,"angle",0),w=i(y,"rotation",0),I=i(y,"scale",1),L=i(y,"scaleX",I),B=i(y,"scaleY",I),N=i(y,"originX",.5),G=i(y,"originY",.5),V=i(y,"blendMode",0),K=i(y,"erase",!1),j=i(y,"skipBatch",!1),J=this.manager.resetStamp(C,P);return J.setAngle(0),M!==0?J.setAngle(M):w!==0&&J.setRotation(w),J.setScale(L,B),J.setTexture(d,p),J.setOrigin(N,G),J.setBlendMode(V),K&&(this._eraseMode=!0),j?this.batchGameObject(J,g,x):this.draw(J,g,x),K&&(this._eraseMode=!1),this},erase:function(d,p,g){return this._eraseMode=!0,this.draw(d,p,g),this._eraseMode=!1,this},draw:function(d,p,g,x,y){return this.beginDraw(),this.batchDraw(d,p,g,x,y),this.endDraw(),this},drawFrame:function(d,p,g,x,y,C){return this.beginDraw(),this.batchDrawFrame(d,p,g,x,y,C),this.endDraw(),this},repeat:function(d,p,g,x,y,C,P,M,w){if(g===void 0&&(g=0),x===void 0&&(x=0),y===void 0&&(y=this.width),C===void 0&&(C=this.height),P===void 0&&(P=1),M===void 0&&(M=16777215),w===void 0&&(w=!1),d instanceof e?p=d:p=this.manager.getFrame(d,p),!p)return this;var I=this.manager.resetStamp(P,M);I.setFrame(p),I.setOrigin(0);var L=p.width,B=p.height;y=Math.floor(y),C=Math.floor(C);var N=Math.ceil(y/L),G=Math.ceil(C/B),V=N*L-y,K=G*B-C;V>0&&(V=L-V),K>0&&(K=B-K),g<0&&(N+=Math.ceil(Math.abs(g)/L)),x<0&&(G+=Math.ceil(Math.abs(x)/B));var j=g,J=x,X=!1,Y=this.manager.stampCrop.setTo(0,0,L,B);w||this.beginDraw();for(var b=0;b0&&z===N-1&&(X=!0,Y.width=V),K>0&&b===G-1&&(X=!0,Y.height=K),X&&I.setCrop(Y),this.batchGameObject(I,j,J),I.isCropped=!1,Y.setTo(0,0,L,B),j+=L}j=g,J+=B}return w||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var d=this.camera,p=this.renderer,g=this.renderTarget;d.preRender(),g?p.beginCapture(g.width,g.height):p.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(d,p,g,x,y){return Array.isArray(d)||(d=[d]),this.batchList(d,p,g,x,y),this},batchDrawFrame:function(d,p,g,x,y,C){g===void 0&&(g=0),x===void 0&&(x=0),y===void 0&&(y=1),C===void 0&&(C=16777215);var P=this.manager.getFrame(d,p);return P&&(this.renderTarget?this.pipeline.batchTextureFrame(P,g,x,C,y,this.camera.matrix,null):this.batchTextureFrame(P,g,x,y,C)),this},endDraw:function(d){if(d===void 0&&(d=this._eraseMode),this.isDrawing){var p=this.renderer,g=this.renderTarget;if(g){var x=p.endCapture(),y=p.pipelines.setUtility();y.blitFrame(x,g,1,!1,!1,d,this.isSpriteTexture),p.resetScissor(),p.resetViewport()}else p.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(d,p,g,x,y){var C=d.length;if(C!==0)for(var P=0;P0&&w.height>0&&M.drawImage(I,w.x,w.y,w.width,w.height,p,g,w.width,w.height),M.restore()}},snapshotArea:function(d,p,g,x,y,C,P){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,y,!1,d,p,g,x,C,P):this.renderer.snapshotCanvas(this.canvas,y,!1,d,p,g,x,C,P),this},snapshot:function(d,p,g){return this.snapshotArea(0,0,this.width,this.height,d,p,g)},snapshotPixel:function(d,p,g){return this.snapshotArea(d,p,1,1,g,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(d,p,g,x){var y=this.manager.resetStamp();y.setTexture(this),y.setOrigin(0),y.renderWebGL(d,y,g,x)},renderCanvas:function(){},destroy:function(){var d=this.manager.stamp;d&&d.texture===this&&this.manager.resetStamp(),l.prototype.destroy.call(this),a.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});c.exports=u},4327:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(45319),a=t(79291),r=new o({initialize:function(e,i,h,s,l,f,u){this.texture=e,this.name=i,this.source=e.source[h],this.sourceIndex=h,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(f,u,s,l)},setSize:function(n,e,i,h){i===void 0&&(i=0),h===void 0&&(h=0),this.cutX=i,this.cutY=h,this.cutWidth=n,this.cutHeight=e,this.width=n,this.height=e,this.halfWidth=Math.floor(n*.5),this.halfHeight=Math.floor(e*.5),this.centerX=Math.floor(n/2),this.centerY=Math.floor(e/2);var s=this.data,l=s.cut;l.x=i,l.y=h,l.w=n,l.h=e,l.r=i+n,l.b=h+e,s.sourceSize.w=n,s.sourceSize.h=e,s.spriteSourceSize.w=n,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(n*n+e*e);var f=s.drawImage;return f.x=i,f.y=h,f.width=n,f.height=e,this.updateUVs()},setTrim:function(n,e,i,h,s,l){var f=this.data,u=f.spriteSourceSize;return f.trim=!0,f.sourceSize.w=n,f.sourceSize.h=e,u.x=i,u.y=h,u.w=s,u.h=l,u.r=i+s,u.b=h+l,this.x=i,this.y=h,this.width=s,this.height=l,this.halfWidth=s*.5,this.halfHeight=l*.5,this.centerX=Math.floor(s/2),this.centerY=Math.floor(l/2),this.updateUVs()},setScale9:function(n,e,i,h){var s=this.data;return s.scale9=!0,s.is3Slice=e===0&&h===this.height,s.scale9Borders.x=n,s.scale9Borders.y=e,s.scale9Borders.w=i,s.scale9Borders.h=h,this},setCropUVs:function(n,e,i,h,s,l,f){var u=this.cutX,d=this.cutY,p=this.cutWidth,g=this.cutHeight,y=this.realWidth,x=this.realHeight;e=v(e,0,y),i=v(i,0,x),h=v(h,0,y-e),s=v(s,0,x-i);var C=u+e,P=d+i,M=h,w=s,I=this.data;if(I.trim){var L=I.spriteSourceSize;h=v(h,0,p-e),s=v(s,0,g-i);var B=e+h,N=i+s,G=!(L.rB||L.y>N);if(G){var V=Math.max(L.x,e),K=Math.max(L.y,i),j=Math.min(L.r,B)-V,J=Math.min(L.b,N)-K;M=j,w=J,l?C=u+(p-(V-L.x)-j):C=u+(V-L.x),f?P=d+(g-(K-L.y)-J):P=d+(K-L.y),e=V,i=K,h=j,s=J}else C=0,P=0,M=0,w=0}else l&&(C=u+(p-e-h)),f&&(P=d+(g-i-s));var X=this.source.width,Y=this.source.height;return n.u0=Math.max(0,C/X),n.v0=Math.max(0,P/Y),n.u1=Math.min(1,(C+M)/X),n.v1=Math.min(1,(P+w)/Y),n.x=e,n.y=i,n.cx=C,n.cy=P,n.cw=M,n.ch=w,n.width=h,n.height=s,n.flipX=l,n.flipY=f,n},updateCropUVs:function(n,e,i){return this.setCropUVs(n,n.x,n.y,n.width,n.height,e,i)},setUVs:function(n,e,i,h,s,l){var f=this.data.drawImage;return f.width=n,f.height=e,this.u0=i,this.v0=h,this.u1=s,this.v1=l,this},updateUVs:function(){var n=this.cutX,e=this.cutY,i=this.cutWidth,h=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=h;var l=this.source.width,f=this.source.height;return this.u0=n/l,this.v0=e/f,this.u1=(n+i)/l,this.v1=(e+h)/f,this},updateUVsInverted:function(){var n=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/n,this.v0=this.cutY/e,this.u1=this.cutX/n,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var n=new r(this.texture,this.name,this.sourceIndex);return n.cutX=this.cutX,n.cutY=this.cutY,n.cutWidth=this.cutWidth,n.cutHeight=this.cutHeight,n.x=this.x,n.y=this.y,n.width=this.width,n.height=this.height,n.halfWidth=this.halfWidth,n.halfHeight=this.halfHeight,n.centerX=this.centerX,n.centerY=this.centerY,n.rotated=this.rotated,n.data=a(!0,n.data,this.data),n.updateUVs(),n},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}}});c.exports=r},79237:(c,m,t)=>{/** + */var o=t(83419),v=t(45319),a=t(79291),r=new o({initialize:function(e,i,h,s,l,f,u){this.texture=e,this.name=i,this.source=e.source[h],this.sourceIndex=h,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(f,u,s,l)},setSize:function(n,e,i,h){i===void 0&&(i=0),h===void 0&&(h=0),this.cutX=i,this.cutY=h,this.cutWidth=n,this.cutHeight=e,this.width=n,this.height=e,this.halfWidth=Math.floor(n*.5),this.halfHeight=Math.floor(e*.5),this.centerX=Math.floor(n/2),this.centerY=Math.floor(e/2);var s=this.data,l=s.cut;l.x=i,l.y=h,l.w=n,l.h=e,l.r=i+n,l.b=h+e,s.sourceSize.w=n,s.sourceSize.h=e,s.spriteSourceSize.w=n,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(n*n+e*e);var f=s.drawImage;return f.x=i,f.y=h,f.width=n,f.height=e,this.updateUVs()},setTrim:function(n,e,i,h,s,l){var f=this.data,u=f.spriteSourceSize;return f.trim=!0,f.sourceSize.w=n,f.sourceSize.h=e,u.x=i,u.y=h,u.w=s,u.h=l,u.r=i+s,u.b=h+l,this.x=i,this.y=h,this.width=s,this.height=l,this.halfWidth=s*.5,this.halfHeight=l*.5,this.centerX=Math.floor(s/2),this.centerY=Math.floor(l/2),this.updateUVs()},setScale9:function(n,e,i,h){var s=this.data;return s.scale9=!0,s.is3Slice=e===0&&h===this.height,s.scale9Borders.x=n,s.scale9Borders.y=e,s.scale9Borders.w=i,s.scale9Borders.h=h,this},setCropUVs:function(n,e,i,h,s,l,f){var u=this.cutX,d=this.cutY,p=this.cutWidth,g=this.cutHeight,x=this.realWidth,y=this.realHeight;e=v(e,0,x),i=v(i,0,y),h=v(h,0,x-e),s=v(s,0,y-i);var C=u+e,P=d+i,M=h,w=s,I=this.data;if(I.trim){var L=I.spriteSourceSize;h=v(h,0,p-e),s=v(s,0,g-i);var B=e+h,N=i+s,G=!(L.rB||L.y>N);if(G){var V=Math.max(L.x,e),K=Math.max(L.y,i),j=Math.min(L.r,B)-V,J=Math.min(L.b,N)-K;M=j,w=J,l?C=u+(p-(V-L.x)-j):C=u+(V-L.x),f?P=d+(g-(K-L.y)-J):P=d+(K-L.y),e=V,i=K,h=j,s=J}else C=0,P=0,M=0,w=0}else l&&(C=u+(p-e-h)),f&&(P=d+(g-i-s));var X=this.source.width,Y=this.source.height;return n.u0=Math.max(0,C/X),n.v0=Math.max(0,P/Y),n.u1=Math.min(1,(C+M)/X),n.v1=Math.min(1,(P+w)/Y),n.x=e,n.y=i,n.cx=C,n.cy=P,n.cw=M,n.ch=w,n.width=h,n.height=s,n.flipX=l,n.flipY=f,n},updateCropUVs:function(n,e,i){return this.setCropUVs(n,n.x,n.y,n.width,n.height,e,i)},setUVs:function(n,e,i,h,s,l){var f=this.data.drawImage;return f.width=n,f.height=e,this.u0=i,this.v0=h,this.u1=s,this.v1=l,this},updateUVs:function(){var n=this.cutX,e=this.cutY,i=this.cutWidth,h=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=h;var l=this.source.width,f=this.source.height;return this.u0=n/l,this.v0=e/f,this.u1=(n+i)/l,this.v1=(e+h)/f,this},updateUVsInverted:function(){var n=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/n,this.v0=this.cutY/e,this.u1=this.cutX/n,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var n=new r(this.texture,this.name,this.sourceIndex);return n.cutX=this.cutX,n.cutY=this.cutY,n.cutWidth=this.cutWidth,n.cutHeight=this.cutHeight,n.x=this.x,n.y=this.y,n.width=this.width,n.height=this.height,n.halfWidth=this.halfWidth,n.halfHeight=this.halfHeight,n.centerX=this.centerX,n.centerY=this.centerY,n.rotated=this.rotated,n.data=a(!0,n.data,this.data),n.updateUVs(),n},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}}});c.exports=r},79237:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5345,7 +5345,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(27919),v=t(57382),a=t(83419),r=t(40987),n=t(8054),e=t(81320),i=t(50792),h=t(69442),s=t(4327),l=t(8443),f=t(99584),u=t(35154),d=t(88571),p=t(41212),g=t(61309),y=t(87841),x=t(79237),C=new a({Extends:i,initialize:function(M){i.call(this),this.game=M,this.name="TextureManager",this.list={},this._tempCanvas=o.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new y,this.silentWarnings=!1,M.events.once(l.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(h.LOAD,this.updatePending,this),this.on(h.ERROR,this.updatePending,this);var P=this.game.config;this.addBase64("__DEFAULT",P.defaultImage),this.addBase64("__MISSING",P.missingImage),this.addBase64("__WHITE",P.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(l.DESTROY,this.destroy,this),this.game.events.once(l.SYSTEM_READY,function(M){this.stamp=new d(M).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(h.LOAD),this.off(h.ERROR),this.emit(h.READY))},checkKey:function(P){return this.exists(P)?(this.silentWarnings||console.error("Texture key already in use: "+P),!1):!0},remove:function(P){if(typeof P=="string")if(this.exists(P))P=this.get(P);else return this.silentWarnings||console.warn("No texture found matching key: "+P),this;var M=P.key;return this.list.hasOwnProperty(M)&&(P.destroy(),this.emit(h.REMOVE,M),this.emit(h.REMOVE_KEY+M)),this},removeKey:function(P){return this.list.hasOwnProperty(P)&&delete this.list[P],this},addBase64:function(P,M){if(this.checkKey(P)){var w=this,I=new Image;I.onerror=function(){w.emit(h.ERROR,P)},I.onload=function(){var L=w.create(P,I);g.Image(L,0),w.emit(h.ADD,P,L),w.emit(h.ADD_KEY+P,L),w.emit(h.LOAD,P,L)},I.src=M}return this},getBase64:function(P,M,w,I){w===void 0&&(w="image/png"),I===void 0&&(I=.92);var L="",B=this.getFrame(P,M);if(B&&(B.source.isRenderTexture||B.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(B){var N=B.canvasData,G=o.create2D(this,N.width,N.height),V=G.getContext("2d",{willReadFrequently:!0});N.width>0&&N.height>0&&V.drawImage(B.source.image,N.x,N.y,N.width,N.height,0,0,N.width,N.height),L=G.toDataURL(w,I),o.remove(G)}return L},addImage:function(P,M,w){var I=null;return this.checkKey(P)&&(I=this.create(P,M),g.Image(I,0),w&&I.setDataSource(w),this.emit(h.ADD,P,I),this.emit(h.ADD_KEY+P,I)),I},addGLTexture:function(P,M){var w=null;if(this.checkKey(P)){var I=M.width,L=M.height;w=this.create(P,M,I,L),w.add("__BASE",0,0,0,I,L),this.emit(h.ADD,P,w),this.emit(h.ADD_KEY+P,w)}return w},addCompressedTexture:function(P,M,w){var I=null;if(this.checkKey(P)){if(I=this.create(P,M),I.add("__BASE",0,0,0,M.width,M.height),w){var L=function(N,G,V){Array.isArray(V.textures)||Array.isArray(V.frames)?g.JSONArray(N,G,V):g.JSONHash(N,G,V)};if(Array.isArray(w))for(var B=0;B=B.x&&P=B.y&&M=B.x&&P=B.y&&M{/** + */var o=t(27919),v=t(57382),a=t(83419),r=t(40987),n=t(8054),e=t(81320),i=t(50792),h=t(69442),s=t(4327),l=t(8443),f=t(99584),u=t(35154),d=t(88571),p=t(41212),g=t(61309),x=t(87841),y=t(79237),C=new a({Extends:i,initialize:function(M){i.call(this),this.game=M,this.name="TextureManager",this.list={},this._tempCanvas=o.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new x,this.silentWarnings=!1,M.events.once(l.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(h.LOAD,this.updatePending,this),this.on(h.ERROR,this.updatePending,this);var P=this.game.config;this.addBase64("__DEFAULT",P.defaultImage),this.addBase64("__MISSING",P.missingImage),this.addBase64("__WHITE",P.whiteImage),this.game.renderer&&this.game.renderer.gl&&this.addUint8Array("__NORMAL",new Uint8Array([127,127,255,255]),1,1),this.game.events.once(l.DESTROY,this.destroy,this),this.game.events.once(l.SYSTEM_READY,function(M){this.stamp=new d(M).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(h.LOAD),this.off(h.ERROR),this.emit(h.READY))},checkKey:function(P){return this.exists(P)?(this.silentWarnings||console.error("Texture key already in use: "+P),!1):!0},remove:function(P){if(typeof P=="string")if(this.exists(P))P=this.get(P);else return this.silentWarnings||console.warn("No texture found matching key: "+P),this;var M=P.key;return this.list.hasOwnProperty(M)&&(P.destroy(),this.emit(h.REMOVE,M),this.emit(h.REMOVE_KEY+M)),this},removeKey:function(P){return this.list.hasOwnProperty(P)&&delete this.list[P],this},addBase64:function(P,M){if(this.checkKey(P)){var w=this,I=new Image;I.onerror=function(){w.emit(h.ERROR,P)},I.onload=function(){var L=w.create(P,I);g.Image(L,0),w.emit(h.ADD,P,L),w.emit(h.ADD_KEY+P,L),w.emit(h.LOAD,P,L)},I.src=M}return this},getBase64:function(P,M,w,I){w===void 0&&(w="image/png"),I===void 0&&(I=.92);var L="",B=this.getFrame(P,M);if(B&&(B.source.isRenderTexture||B.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(B){var N=B.canvasData,G=o.create2D(this,N.width,N.height),V=G.getContext("2d",{willReadFrequently:!0});N.width>0&&N.height>0&&V.drawImage(B.source.image,N.x,N.y,N.width,N.height,0,0,N.width,N.height),L=G.toDataURL(w,I),o.remove(G)}return L},addImage:function(P,M,w){var I=null;return this.checkKey(P)&&(I=this.create(P,M),g.Image(I,0),w&&I.setDataSource(w),this.emit(h.ADD,P,I),this.emit(h.ADD_KEY+P,I)),I},addGLTexture:function(P,M){var w=null;if(this.checkKey(P)){var I=M.width,L=M.height;w=this.create(P,M,I,L),w.add("__BASE",0,0,0,I,L),this.emit(h.ADD,P,w),this.emit(h.ADD_KEY+P,w)}return w},addCompressedTexture:function(P,M,w){var I=null;if(this.checkKey(P)){if(I=this.create(P,M),I.add("__BASE",0,0,0,M.width,M.height),w){var L=function(N,G,V){Array.isArray(V.textures)||Array.isArray(V.frames)?g.JSONArray(N,G,V):g.JSONHash(N,G,V)};if(Array.isArray(w))for(var B=0;B=B.x&&P=B.y&&M=B.x&&P=B.y&&M{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5393,7 +5393,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o,v){if(!v.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var a=t.source[o];t.add("__BASE",o,0,0,a.width,a.height);for(var r=v.getElementsByTagName("SubTexture"),n,e=0;e{/** + */var m=function(t,o,v){if(!v.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var a=t.source[o];t.add("__BASE",o,0,0,a.width,a.height);for(var r=v.getElementsByTagName("SubTexture"),n,e=0;e{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5413,19 +5413,19 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2021 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t){var o=[171,75,84,88,32,49,49,187,13,10,26,10],v,a=new Uint8Array(t,0,12);for(v=0;v>1),y=Math.max(1,y>>1),p+=x}return{mipmaps:d,width:s,height:l,internalFormat:h,compressed:!0,generateMipmap:!1}};c.exports=m},82038:c=>{/** + */var m=function(t){var o=[171,75,84,88,32,49,49,187,13,10,26,10],v,a=new Uint8Array(t,0,12);for(v=0;v>1),x=Math.max(1,x>>1),p+=y}return{mipmaps:d,width:s,height:l,internalFormat:h,compressed:!0,generateMipmap:!1}};c.exports=m},82038:c=>{/** * @author Richard Davey * @copyright 2021 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(M,w,I,L,B,N,G){return G===void 0&&(G=16),Math.floor((M+I)/B)*Math.floor((w+L)/N)*G}function t(M,w){return M=Math.max(M,16),w=Math.max(w,8),M*w/4}function o(M,w){return M=Math.max(M,8),w=Math.max(w,8),M*w/2}function v(M,w){return Math.ceil(M/4)*Math.ceil(w/4)*16}function a(M,w){return m(M,w,3,3,4,4,8)}function r(M,w){return m(M,w,3,3,4,4)}function n(M,w){return m(M,w,4,3,5,4)}function e(M,w){return m(M,w,4,4,5,5)}function i(M,w){return m(M,w,5,4,6,5)}function h(M,w){return m(M,w,5,5,6,6)}function s(M,w){return m(M,w,7,4,8,5)}function l(M,w){return m(M,w,7,5,8,6)}function f(M,w){return m(M,w,7,7,8,8)}function u(M,w){return m(M,w,9,4,10,5)}function d(M,w){return m(M,w,9,5,10,6)}function p(M,w){return m(M,w,9,7,10,8)}function g(M,w){return m(M,w,9,9,10,10)}function y(M,w){return m(M,w,11,9,12,10)}function x(M,w){return m(M,w,11,11,12,12)}var C={0:{sizeFunc:t,glFormat:[35841]},1:{sizeFunc:t,glFormat:[35843]},2:{sizeFunc:o,glFormat:[35840]},3:{sizeFunc:o,glFormat:[35842]},6:{sizeFunc:a,glFormat:[36196]},7:{sizeFunc:a,glFormat:[33776,35916]},8:{sizeFunc:r,glFormat:[33777,35917]},9:{sizeFunc:r,glFormat:[33778,35918]},11:{sizeFunc:r,glFormat:[33779,35919]},14:{sizeFunc:v,glFormat:[36494,36495]},15:{sizeFunc:v,glFormat:[36492,36493]},22:{sizeFunc:a,glFormat:[37492,37493]},23:{sizeFunc:r,glFormat:[37496,37497]},24:{sizeFunc:a,glFormat:[37494,37495]},25:{sizeFunc:a,glFormat:[37488]},26:{sizeFunc:r,glFormat:[37490]},27:{sizeFunc:r,glFormat:[37808,37840]},28:{sizeFunc:n,glFormat:[37809,37841]},29:{sizeFunc:e,glFormat:[37810,37842]},30:{sizeFunc:i,glFormat:[37811,37843]},31:{sizeFunc:h,glFormat:[37812,37844]},32:{sizeFunc:s,glFormat:[37813,37845]},33:{sizeFunc:l,glFormat:[37814,37846]},34:{sizeFunc:f,glFormat:[37815,37847]},35:{sizeFunc:u,glFormat:[37816,37848]},36:{sizeFunc:d,glFormat:[37817,37849]},37:{sizeFunc:p,glFormat:[37818,37850]},38:{sizeFunc:g,glFormat:[37819,37851]},39:{sizeFunc:y,glFormat:[37820,37852]},40:{sizeFunc:x,glFormat:[37821,37853]}},P=function(M){for(var w=new Uint32Array(M,0,13),I=w[0],L=I===55727696,B=L?w[2]:w[3],N=w[4],G=C[B].glFormat[N],V=C[B].sizeFunc,K=w[11],j=w[7],J=w[6],X=52+w[12],Y=new Uint8Array(M,X),b=new Array(K),z=0,W=j,H=J,Z=0;Z>1),H=Math.max(1,H>>1),z+=Q}return{mipmaps:b,width:j,height:J,internalFormat:G,compressed:!0,generateMipmap:!1}};c.exports=P},75549:(c,m,t)=>{/** + */function m(M,w,I,L,B,N,G){return G===void 0&&(G=16),Math.floor((M+I)/B)*Math.floor((w+L)/N)*G}function t(M,w){return M=Math.max(M,16),w=Math.max(w,8),M*w/4}function o(M,w){return M=Math.max(M,8),w=Math.max(w,8),M*w/2}function v(M,w){return Math.ceil(M/4)*Math.ceil(w/4)*16}function a(M,w){return m(M,w,3,3,4,4,8)}function r(M,w){return m(M,w,3,3,4,4)}function n(M,w){return m(M,w,4,3,5,4)}function e(M,w){return m(M,w,4,4,5,5)}function i(M,w){return m(M,w,5,4,6,5)}function h(M,w){return m(M,w,5,5,6,6)}function s(M,w){return m(M,w,7,4,8,5)}function l(M,w){return m(M,w,7,5,8,6)}function f(M,w){return m(M,w,7,7,8,8)}function u(M,w){return m(M,w,9,4,10,5)}function d(M,w){return m(M,w,9,5,10,6)}function p(M,w){return m(M,w,9,7,10,8)}function g(M,w){return m(M,w,9,9,10,10)}function x(M,w){return m(M,w,11,9,12,10)}function y(M,w){return m(M,w,11,11,12,12)}var C={0:{sizeFunc:t,glFormat:[35841]},1:{sizeFunc:t,glFormat:[35843]},2:{sizeFunc:o,glFormat:[35840]},3:{sizeFunc:o,glFormat:[35842]},6:{sizeFunc:a,glFormat:[36196]},7:{sizeFunc:a,glFormat:[33776,35916]},8:{sizeFunc:r,glFormat:[33777,35917]},9:{sizeFunc:r,glFormat:[33778,35918]},11:{sizeFunc:r,glFormat:[33779,35919]},14:{sizeFunc:v,glFormat:[36494,36495]},15:{sizeFunc:v,glFormat:[36492,36493]},22:{sizeFunc:a,glFormat:[37492,37493]},23:{sizeFunc:r,glFormat:[37496,37497]},24:{sizeFunc:a,glFormat:[37494,37495]},25:{sizeFunc:a,glFormat:[37488]},26:{sizeFunc:r,glFormat:[37490]},27:{sizeFunc:r,glFormat:[37808,37840]},28:{sizeFunc:n,glFormat:[37809,37841]},29:{sizeFunc:e,glFormat:[37810,37842]},30:{sizeFunc:i,glFormat:[37811,37843]},31:{sizeFunc:h,glFormat:[37812,37844]},32:{sizeFunc:s,glFormat:[37813,37845]},33:{sizeFunc:l,glFormat:[37814,37846]},34:{sizeFunc:f,glFormat:[37815,37847]},35:{sizeFunc:u,glFormat:[37816,37848]},36:{sizeFunc:d,glFormat:[37817,37849]},37:{sizeFunc:p,glFormat:[37818,37850]},38:{sizeFunc:g,glFormat:[37819,37851]},39:{sizeFunc:x,glFormat:[37820,37852]},40:{sizeFunc:y,glFormat:[37821,37853]}},P=function(M){for(var w=new Uint32Array(M,0,13),I=w[0],L=I===55727696,B=L?w[2]:w[3],N=w[4],G=C[B].glFormat[N],V=C[B].sizeFunc,K=w[11],j=w[7],J=w[6],X=52+w[12],Y=new Uint8Array(M,X),b=new Array(K),z=0,W=j,H=J,Z=0;Z>1),H=Math.max(1,H>>1),z+=Q}return{mipmaps:b,width:j,height:J,internalFormat:G,compressed:!0,generateMipmap:!1}};c.exports=P},75549:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95540),v=function(a,r,n,e,i,h,s){var l=o(s,"frameWidth",null),f=o(s,"frameHeight",l);if(l===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=a.source[r];a.add("__BASE",r,0,0,u.width,u.height);var d=o(s,"startFrame",0),p=o(s,"endFrame",-1),g=o(s,"margin",0),y=o(s,"spacing",0),x=Math.floor((i-g+y)/(l+y)),C=Math.floor((h-g+y)/(f+y)),P=x*C;P===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",a.key),(d>P||d<-P)&&(d=0),d<0&&(d=P+d),(p===-1||p>P||pi&&(I=G-i),V>h&&(L=V-h),N>=d&&N<=p&&(a.add(B,r,n+M,e+w,l-I,f-L),B++),M+=l+y,M+l>i&&(M=g,w+=f+y)}return a};c.exports=v},47534:(c,m,t)=>{/** + */var o=t(95540),v=function(a,r,n,e,i,h,s){var l=o(s,"frameWidth",null),f=o(s,"frameHeight",l);if(l===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var u=a.source[r];a.add("__BASE",r,0,0,u.width,u.height);var d=o(s,"startFrame",0),p=o(s,"endFrame",-1),g=o(s,"margin",0),x=o(s,"spacing",0),y=Math.floor((i-g+x)/(l+x)),C=Math.floor((h-g+x)/(f+x)),P=y*C;P===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",a.key),(d>P||d<-P)&&(d=0),d<0&&(d=P+d),(p===-1||p>P||pi&&(I=G-i),V>h&&(L=V-h),N>=d&&N<=p&&(a.add(B,r,n+M,e+w,l-I,f-L),B++),M+=l+x,M+l>i&&(M=g,w+=f+x)}return a};c.exports=v},47534:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95540),v=function(a,r,n){var e=o(n,"frameWidth",null),i=o(n,"frameHeight",e);if(!e)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var h=a.source[0];a.add("__BASE",0,0,0,h.width,h.height),o(n,"startFrame",0),o(n,"endFrame",-1);for(var s=o(n,"margin",0),l=o(n,"spacing",0),f=r.cutX,u=r.cutY,d=r.cutWidth,p=r.cutHeight,g=r.realWidth,y=r.realHeight,x=Math.floor((g-s+l)/(e+l)),C=Math.floor((y-s+l)/(i+l)),P=r.x,M=e-P,w=e-(g-d-P),I=r.y,L=i-I,B=i-(y-p-I),N,G=s,V=s,K=0,j=0,J=0;J{/** + */var o=t(95540),v=function(a,r,n){var e=o(n,"frameWidth",null),i=o(n,"frameHeight",e);if(!e)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var h=a.source[0];a.add("__BASE",0,0,0,h.width,h.height),o(n,"startFrame",0),o(n,"endFrame",-1);for(var s=o(n,"margin",0),l=o(n,"spacing",0),f=r.cutX,u=r.cutY,d=r.cutWidth,p=r.cutHeight,g=r.realWidth,x=r.realHeight,y=Math.floor((g-s+l)/(e+l)),C=Math.floor((x-s+l)/(i+l)),P=r.x,M=e-P,w=e-(g-d-P),I=r.y,L=i-I,B=i-(x-p-I),N,G=s,V=s,K=0,j=0,J=0;J{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5454,7 +5454,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(80341),v=t(87010),a=t(46177),r=t(49075),n=function(e,i,h,s,l,f,u,d){h===void 0&&(h=32),s===void 0&&(s=32),l===void 0&&(l=10),f===void 0&&(f=10),d===void 0&&(d=!1);var p=null;if(Array.isArray(u)){var g=i!==void 0?i:"map";p=a(g,o.ARRAY_2D,u,h,s,d)}else if(i!==void 0){var y=e.cache.tilemap.get(i);y?p=a(i,y.format,y.data,h,s,d):console.warn("No map data found for key "+i)}return p===null&&(p=new v({tileWidth:h,tileHeight:s,width:l,height:f})),new r(e,p)};c.exports=n},23029:(c,m,t)=>{/** + */var o=t(80341),v=t(87010),a=t(46177),r=t(49075),n=function(e,i,h,s,l,f,u,d){h===void 0&&(h=32),s===void 0&&(s=32),l===void 0&&(l=10),f===void 0&&(f=10),d===void 0&&(d=!1);var p=null;if(Array.isArray(u)){var g=i!==void 0?i:"map";p=a(g,o.ARRAY_2D,u,h,s,d)}else if(i!==void 0){var x=e.cache.tilemap.get(i);x?p=a(i,x.format,x.data,h,s,d):console.warn("No map data found for key "+i)}return p===null&&(p=new v({tileWidth:h,tileHeight:s,width:l,height:f})),new r(e,p)};c.exports=n},23029:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5462,7 +5462,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(84101),v=t(83419),a=t(39506),r=t(80341),n=t(95540),e=t(14977),i=t(27462),h=t(91907),s=t(36305),l=t(19133),f=t(68287),u=t(23029),d=t(81086),p=t(20442),g=t(33629),y=new v({initialize:function(C,P){this.scene=C,this.tileWidth=P.tileWidth,this.tileHeight=P.tileHeight,this.width=P.width,this.height=P.height,this.orientation=P.orientation,this.renderOrder=P.renderOrder,this.format=P.format,this.version=P.version,this.properties=P.properties,this.widthInPixels=P.widthInPixels,this.heightInPixels=P.heightInPixels,this.imageCollections=P.imageCollections,this.images=P.images,this.layers=P.layers,this.tiles=P.tiles,this.tilesets=P.tilesets,this.objects=P.objects,this.currentLayerIndex=0,this.hexSideLength=P.hexSideLength;var M=this.orientation;this._convert={WorldToTileXY:d.GetWorldToTileXYFunction(M),WorldToTileX:d.GetWorldToTileXFunction(M),WorldToTileY:d.GetWorldToTileYFunction(M),TileToWorldXY:d.GetTileToWorldXYFunction(M),TileToWorldX:d.GetTileToWorldXFunction(M),TileToWorldY:d.GetTileToWorldYFunction(M),GetTileCorners:d.GetTileCornersFunction(M)}},setRenderOrder:function(x){var C=["right-down","left-down","right-up","left-up"];return typeof x=="number"&&(x=C[x]),C.indexOf(x)>-1&&(this.renderOrder=x),this},addTilesetImage:function(x,C,P,M,w,I,L,B){if(x===void 0)return null;C==null&&(C=x);var N=this.scene.sys.textures;if(!N.exists(C))return console.warn('Texture key "%s" not found',C),null;var G=N.get(C),V=this.getTilesetIndex(x);if(V===null&&this.format===r.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',x,this.tilesets),null;var K=this.tilesets[V];return K?(K.setTileSize(P,M),K.setSpacing(w,I),K.setImage(G),K):(P===void 0&&(P=this.tileWidth),M===void 0&&(M=this.tileHeight),w===void 0&&(w=0),I===void 0&&(I=0),L===void 0&&(L=0),B===void 0&&(B={x:0,y:0}),K=new g(x,L,P,M,w,I,void 0,void 0,B),K.setImage(G),this.tilesets.push(K),this.tiles=o(this),K)},copy:function(x,C,P,M,w,I,L,B){return B=this.getLayer(B),B!==null?(d.Copy(x,C,P,M,w,I,L,B),this):null},createBlankLayer:function(x,C,P,M,w,I,L,B){P===void 0&&(P=0),M===void 0&&(M=0),w===void 0&&(w=this.width),I===void 0&&(I=this.height),L===void 0&&(L=this.tileWidth),B===void 0&&(B=this.tileHeight);var N=this.getLayerIndex(x);if(N!==null)return console.warn("Invalid Tilemap Layer ID: "+x),null;for(var G=new e({name:x,tileWidth:L,tileHeight:B,width:w,height:I,orientation:this.orientation}),V,K=0;K-1&&this.putTileAt(C,I.x,I.y,P,I.tilemapLayer)}return M},removeTileAt:function(x,C,P,M,w){return P===void 0&&(P=!0),M===void 0&&(M=!0),w=this.getLayer(w),w===null?null:d.RemoveTileAt(x,C,P,M,w)},removeTileAtWorldXY:function(x,C,P,M,w,I){return P===void 0&&(P=!0),M===void 0&&(M=!0),I=this.getLayer(I),I===null?null:d.RemoveTileAtWorldXY(x,C,P,M,w,I)},renderDebug:function(x,C,P){return P=this.getLayer(P),P===null?null:(this.orientation===h.ORTHOGONAL&&d.RenderDebug(x,C,P),this)},renderDebugFull:function(x,C){for(var P=this.layers,M=0;M{/** + */var o=t(84101),v=t(83419),a=t(39506),r=t(80341),n=t(95540),e=t(14977),i=t(27462),h=t(91907),s=t(36305),l=t(19133),f=t(68287),u=t(23029),d=t(81086),p=t(20442),g=t(33629),x=new v({initialize:function(C,P){this.scene=C,this.tileWidth=P.tileWidth,this.tileHeight=P.tileHeight,this.width=P.width,this.height=P.height,this.orientation=P.orientation,this.renderOrder=P.renderOrder,this.format=P.format,this.version=P.version,this.properties=P.properties,this.widthInPixels=P.widthInPixels,this.heightInPixels=P.heightInPixels,this.imageCollections=P.imageCollections,this.images=P.images,this.layers=P.layers,this.tiles=P.tiles,this.tilesets=P.tilesets,this.objects=P.objects,this.currentLayerIndex=0,this.hexSideLength=P.hexSideLength;var M=this.orientation;this._convert={WorldToTileXY:d.GetWorldToTileXYFunction(M),WorldToTileX:d.GetWorldToTileXFunction(M),WorldToTileY:d.GetWorldToTileYFunction(M),TileToWorldXY:d.GetTileToWorldXYFunction(M),TileToWorldX:d.GetTileToWorldXFunction(M),TileToWorldY:d.GetTileToWorldYFunction(M),GetTileCorners:d.GetTileCornersFunction(M)}},setRenderOrder:function(y){var C=["right-down","left-down","right-up","left-up"];return typeof y=="number"&&(y=C[y]),C.indexOf(y)>-1&&(this.renderOrder=y),this},addTilesetImage:function(y,C,P,M,w,I,L,B){if(y===void 0)return null;C==null&&(C=y);var N=this.scene.sys.textures;if(!N.exists(C))return console.warn('Texture key "%s" not found',C),null;var G=N.get(C),V=this.getTilesetIndex(y);if(V===null&&this.format===r.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',y,this.tilesets),null;var K=this.tilesets[V];return K?(K.setTileSize(P,M),K.setSpacing(w,I),K.setImage(G),K):(P===void 0&&(P=this.tileWidth),M===void 0&&(M=this.tileHeight),w===void 0&&(w=0),I===void 0&&(I=0),L===void 0&&(L=0),B===void 0&&(B={x:0,y:0}),K=new g(y,L,P,M,w,I,void 0,void 0,B),K.setImage(G),this.tilesets.push(K),this.tiles=o(this),K)},copy:function(y,C,P,M,w,I,L,B){return B=this.getLayer(B),B!==null?(d.Copy(y,C,P,M,w,I,L,B),this):null},createBlankLayer:function(y,C,P,M,w,I,L,B){P===void 0&&(P=0),M===void 0&&(M=0),w===void 0&&(w=this.width),I===void 0&&(I=this.height),L===void 0&&(L=this.tileWidth),B===void 0&&(B=this.tileHeight);var N=this.getLayerIndex(y);if(N!==null)return console.warn("Invalid Tilemap Layer ID: "+y),null;for(var G=new e({name:y,tileWidth:L,tileHeight:B,width:w,height:I,orientation:this.orientation}),V,K=0;K-1&&this.putTileAt(C,I.x,I.y,P,I.tilemapLayer)}return M},removeTileAt:function(y,C,P,M,w){return P===void 0&&(P=!0),M===void 0&&(M=!0),w=this.getLayer(w),w===null?null:d.RemoveTileAt(y,C,P,M,w)},removeTileAtWorldXY:function(y,C,P,M,w,I){return P===void 0&&(P=!0),M===void 0&&(M=!0),I=this.getLayer(I),I===null?null:d.RemoveTileAtWorldXY(y,C,P,M,w,I)},renderDebug:function(y,C,P){return P=this.getLayer(P),P===null?null:(this.orientation===h.ORTHOGONAL&&d.RenderDebug(y,C,P),this)},renderDebugFull:function(y,C){for(var P=this.layers,M=0;M{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5474,11 +5474,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(83419),v=t(78389),a=t(31401),r=t(95643),n=t(81086),e=t(19218),i=t(26099),h=new o({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,v,e],initialize:function(l,f,u,d,p,g){r.call(this,l,"TilemapLayer"),this.isTilemap=!0,this.tilemap=f,this.layerIndex=u,this.layer=f.layers[u],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=n.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new i,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(d),this.setAlpha(this.layer.alpha),this.setPosition(p,g),this.setOrigin(0,0),this.setSize(f.tileWidth*this.layer.width,f.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(s){var l=[],f=[],u=this.tilemap;Array.isArray(s)||(s=[s]);for(var d=0;d=0&&s<4&&(this._renderOrder=s),this},calculateFacesAt:function(s,l){return n.CalculateFacesAt(s,l,this.layer),this},calculateFacesWithin:function(s,l,f,u){return n.CalculateFacesWithin(s,l,f,u,this.layer),this},createFromTiles:function(s,l,f,u,d){return n.CreateFromTiles(s,l,f,u,d,this.layer)},cull:function(s){return this.cullCallback(this.layer,s,this.culledTiles,this._renderOrder)},copy:function(s,l,f,u,d,p,g){return n.Copy(s,l,f,u,d,p,g,this.layer),this},fill:function(s,l,f,u,d,p){return n.Fill(s,l,f,u,d,p,this.layer),this},filterTiles:function(s,l,f,u,d,p,g){return n.FilterTiles(s,l,f,u,d,p,g,this.layer)},findByIndex:function(s,l,f){return n.FindByIndex(s,l,f,this.layer)},findTile:function(s,l,f,u,d,p,g){return n.FindTile(s,l,f,u,d,p,g,this.layer)},forEachTile:function(s,l,f,u,d,p,g){return n.ForEachTile(s,l,f,u,d,p,g,this.layer),this},setTint:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(y){y.tint=s,y.tintFill=!1};return this.forEachTile(g,this,l,f,u,d,p)},setTintFill:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(y){y.tint=s,y.tintFill=!0};return this.forEachTile(g,this,l,f,u,d,p)},getTileAt:function(s,l,f){return n.GetTileAt(s,l,f,this.layer)},getTileAtWorldXY:function(s,l,f,u){return n.GetTileAtWorldXY(s,l,f,u,this.layer)},getIsoTileAtWorldXY:function(s,l,f,u,d){f===void 0&&(f=!0);var p=this.tempVec;return n.IsometricWorldToTileXY(s,l,!0,p,d,this.layer,f),this.getTileAt(p.x,p.y,u)},getTilesWithin:function(s,l,f,u,d){return n.GetTilesWithin(s,l,f,u,d,this.layer)},getTilesWithinShape:function(s,l,f){return n.GetTilesWithinShape(s,l,f,this.layer)},getTilesWithinWorldXY:function(s,l,f,u,d,p){return n.GetTilesWithinWorldXY(s,l,f,u,d,p,this.layer)},hasTileAt:function(s,l){return n.HasTileAt(s,l,this.layer)},hasTileAtWorldXY:function(s,l,f){return n.HasTileAtWorldXY(s,l,f,this.layer)},putTileAt:function(s,l,f,u){return n.PutTileAt(s,l,f,u,this.layer)},putTileAtWorldXY:function(s,l,f,u,d){return n.PutTileAtWorldXY(s,l,f,u,d,this.layer)},putTilesAt:function(s,l,f,u){return n.PutTilesAt(s,l,f,u,this.layer),this},randomize:function(s,l,f,u,d){return n.Randomize(s,l,f,u,d,this.layer),this},removeTileAt:function(s,l,f,u){return n.RemoveTileAt(s,l,f,u,this.layer)},removeTileAtWorldXY:function(s,l,f,u,d){return n.RemoveTileAtWorldXY(s,l,f,u,d,this.layer)},renderDebug:function(s,l){return n.RenderDebug(s,l,this.layer),this},replaceByIndex:function(s,l,f,u,d,p){return n.ReplaceByIndex(s,l,f,u,d,p,this.layer),this},setSkipCull:function(s){return s===void 0&&(s=!0),this.skipCull=s,this},setCullPadding:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=1),this.cullPaddingX=s,this.cullPaddingY=l,this},setCollision:function(s,l,f,u){return n.SetCollision(s,l,f,this.layer,u),this},setCollisionBetween:function(s,l,f,u){return n.SetCollisionBetween(s,l,f,u,this.layer),this},setCollisionByProperty:function(s,l,f){return n.SetCollisionByProperty(s,l,f,this.layer),this},setCollisionByExclusion:function(s,l,f){return n.SetCollisionByExclusion(s,l,f,this.layer),this},setCollisionFromCollisionGroup:function(s,l){return n.SetCollisionFromCollisionGroup(s,l,this.layer),this},setTileIndexCallback:function(s,l,f){return n.SetTileIndexCallback(s,l,f,this.layer),this},setTileLocationCallback:function(s,l,f,u,d,p){return n.SetTileLocationCallback(s,l,f,u,d,p,this.layer),this},shuffle:function(s,l,f,u){return n.Shuffle(s,l,f,u,this.layer),this},swapByIndex:function(s,l,f,u,d,p){return n.SwapByIndex(s,l,f,u,d,p,this.layer),this},tileToWorldX:function(s,l){return this.tilemap.tileToWorldX(s,l,this)},tileToWorldY:function(s,l){return this.tilemap.tileToWorldY(s,l,this)},tileToWorldXY:function(s,l,f,u){return this.tilemap.tileToWorldXY(s,l,f,u,this)},getTileCorners:function(s,l,f){return this.tilemap.getTileCorners(s,l,f,this)},weightedRandomize:function(s,l,f,u,d){return n.WeightedRandomize(l,f,u,d,s,this.layer),this},worldToTileX:function(s,l,f){return this.tilemap.worldToTileX(s,l,f,this)},worldToTileY:function(s,l,f){return this.tilemap.worldToTileY(s,l,f,this)},worldToTileXY:function(s,l,f,u,d){return this.tilemap.worldToTileXY(s,l,f,u,d,this)},destroy:function(s){s===void 0&&(s=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),s&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});c.exports=h},16153:(c,m,t)=>{/** + */var o=t(83419),v=t(78389),a=t(31401),r=t(95643),n=t(81086),e=t(19218),i=t(26099),h=new o({Extends:r,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,v,e],initialize:function(l,f,u,d,p,g){r.call(this,l,"TilemapLayer"),this.isTilemap=!0,this.tilemap=f,this.layerIndex=u,this.layer=f.layers[u],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=n.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new i,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(d),this.setAlpha(this.layer.alpha),this.setPosition(p,g),this.setOrigin(0,0),this.setSize(f.tileWidth*this.layer.width,f.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(s){var l=[],f=[],u=this.tilemap;Array.isArray(s)||(s=[s]);for(var d=0;d=0&&s<4&&(this._renderOrder=s),this},calculateFacesAt:function(s,l){return n.CalculateFacesAt(s,l,this.layer),this},calculateFacesWithin:function(s,l,f,u){return n.CalculateFacesWithin(s,l,f,u,this.layer),this},createFromTiles:function(s,l,f,u,d){return n.CreateFromTiles(s,l,f,u,d,this.layer)},cull:function(s){return this.cullCallback(this.layer,s,this.culledTiles,this._renderOrder)},copy:function(s,l,f,u,d,p,g){return n.Copy(s,l,f,u,d,p,g,this.layer),this},fill:function(s,l,f,u,d,p){return n.Fill(s,l,f,u,d,p,this.layer),this},filterTiles:function(s,l,f,u,d,p,g){return n.FilterTiles(s,l,f,u,d,p,g,this.layer)},findByIndex:function(s,l,f){return n.FindByIndex(s,l,f,this.layer)},findTile:function(s,l,f,u,d,p,g){return n.FindTile(s,l,f,u,d,p,g,this.layer)},forEachTile:function(s,l,f,u,d,p,g){return n.ForEachTile(s,l,f,u,d,p,g,this.layer),this},setTint:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(x){x.tint=s,x.tintFill=!1};return this.forEachTile(g,this,l,f,u,d,p)},setTintFill:function(s,l,f,u,d,p){s===void 0&&(s=16777215);var g=function(x){x.tint=s,x.tintFill=!0};return this.forEachTile(g,this,l,f,u,d,p)},getTileAt:function(s,l,f){return n.GetTileAt(s,l,f,this.layer)},getTileAtWorldXY:function(s,l,f,u){return n.GetTileAtWorldXY(s,l,f,u,this.layer)},getIsoTileAtWorldXY:function(s,l,f,u,d){f===void 0&&(f=!0);var p=this.tempVec;return n.IsometricWorldToTileXY(s,l,!0,p,d,this.layer,f),this.getTileAt(p.x,p.y,u)},getTilesWithin:function(s,l,f,u,d){return n.GetTilesWithin(s,l,f,u,d,this.layer)},getTilesWithinShape:function(s,l,f){return n.GetTilesWithinShape(s,l,f,this.layer)},getTilesWithinWorldXY:function(s,l,f,u,d,p){return n.GetTilesWithinWorldXY(s,l,f,u,d,p,this.layer)},hasTileAt:function(s,l){return n.HasTileAt(s,l,this.layer)},hasTileAtWorldXY:function(s,l,f){return n.HasTileAtWorldXY(s,l,f,this.layer)},putTileAt:function(s,l,f,u){return n.PutTileAt(s,l,f,u,this.layer)},putTileAtWorldXY:function(s,l,f,u,d){return n.PutTileAtWorldXY(s,l,f,u,d,this.layer)},putTilesAt:function(s,l,f,u){return n.PutTilesAt(s,l,f,u,this.layer),this},randomize:function(s,l,f,u,d){return n.Randomize(s,l,f,u,d,this.layer),this},removeTileAt:function(s,l,f,u){return n.RemoveTileAt(s,l,f,u,this.layer)},removeTileAtWorldXY:function(s,l,f,u,d){return n.RemoveTileAtWorldXY(s,l,f,u,d,this.layer)},renderDebug:function(s,l){return n.RenderDebug(s,l,this.layer),this},replaceByIndex:function(s,l,f,u,d,p){return n.ReplaceByIndex(s,l,f,u,d,p,this.layer),this},setSkipCull:function(s){return s===void 0&&(s=!0),this.skipCull=s,this},setCullPadding:function(s,l){return s===void 0&&(s=1),l===void 0&&(l=1),this.cullPaddingX=s,this.cullPaddingY=l,this},setCollision:function(s,l,f,u){return n.SetCollision(s,l,f,this.layer,u),this},setCollisionBetween:function(s,l,f,u){return n.SetCollisionBetween(s,l,f,u,this.layer),this},setCollisionByProperty:function(s,l,f){return n.SetCollisionByProperty(s,l,f,this.layer),this},setCollisionByExclusion:function(s,l,f){return n.SetCollisionByExclusion(s,l,f,this.layer),this},setCollisionFromCollisionGroup:function(s,l){return n.SetCollisionFromCollisionGroup(s,l,this.layer),this},setTileIndexCallback:function(s,l,f){return n.SetTileIndexCallback(s,l,f,this.layer),this},setTileLocationCallback:function(s,l,f,u,d,p){return n.SetTileLocationCallback(s,l,f,u,d,p,this.layer),this},shuffle:function(s,l,f,u){return n.Shuffle(s,l,f,u,this.layer),this},swapByIndex:function(s,l,f,u,d,p){return n.SwapByIndex(s,l,f,u,d,p,this.layer),this},tileToWorldX:function(s,l){return this.tilemap.tileToWorldX(s,l,this)},tileToWorldY:function(s,l){return this.tilemap.tileToWorldY(s,l,this)},tileToWorldXY:function(s,l,f,u){return this.tilemap.tileToWorldXY(s,l,f,u,this)},getTileCorners:function(s,l,f){return this.tilemap.getTileCorners(s,l,f,this)},weightedRandomize:function(s,l,f,u,d){return n.WeightedRandomize(l,f,u,d,s,this.layer),this},worldToTileX:function(s,l,f){return this.tilemap.worldToTileX(s,l,f,this)},worldToTileY:function(s,l,f){return this.tilemap.worldToTileY(s,l,f,this)},worldToTileXY:function(s,l,f,u,d){return this.tilemap.worldToTileXY(s,l,f,u,d,this)},destroy:function(s){s===void 0&&(s=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),s&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],r.prototype.destroy.call(this))}});c.exports=h},16153:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(61340),v=new o,a=new o,r=new o,n=function(e,i,h,s){var l=i.cull(h),f=l.length,u=h.alpha*i.alpha;if(!(f===0||u<=0)){var d=v,p=a,g=r;p.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),d.copyFrom(h.matrix);var y=e.currentContext,x=i.gidMap;y.save(),s?(d.multiplyWithOffset(s,-h.scrollX*i.scrollFactorX,-h.scrollY*i.scrollFactorY),p.e=i.x,p.f=i.y,d.multiply(p,g),g.copyToContext(y)):(p.e-=h.scrollX*i.scrollFactorX,p.f-=h.scrollY*i.scrollFactorY,p.copyToContext(y)),(!e.antialias||i.scaleX>1||i.scaleY>1)&&(y.imageSmoothingEnabled=!1);for(var C=0;C{/** + */var o=t(61340),v=new o,a=new o,r=new o,n=function(e,i,h,s){var l=i.cull(h),f=l.length,u=h.alpha*i.alpha;if(!(f===0||u<=0)){var d=v,p=a,g=r;p.applyITRS(i.x,i.y,i.rotation,i.scaleX,i.scaleY),d.copyFrom(h.matrix);var x=e.currentContext,y=i.gidMap;x.save(),s?(d.multiplyWithOffset(s,-h.scrollX*i.scrollFactorX,-h.scrollY*i.scrollFactorY),p.e=i.x,p.f=i.y,d.multiply(p,g),g.copyToContext(x)):(p.e-=h.scrollX*i.scrollFactorX,p.f-=h.scrollY*i.scrollFactorY,p.copyToContext(x)),(!e.antialias||i.scaleX>1||i.scaleY>1)&&(x.imageSmoothingEnabled=!1);for(var C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5486,7 +5486,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70554),v=function(a,r,n){var e=r.cull(n),i=e.length,h=n.alpha*r.alpha;if(!(i===0||h<=0)){var s=r.gidMap,l=a.pipelines.set(r.pipeline,r),f=o.getTintAppendFloatAlpha,u=r.scrollFactorX,d=r.scrollFactorY,p=r.x,g=r.y,y=r.scaleX,x=r.scaleY;a.pipelines.preBatch(r);for(var C=0;C{/** + */var o=t(70554),v=function(a,r,n){var e=r.cull(n),i=e.length,h=n.alpha*r.alpha;if(!(i===0||h<=0)){var s=r.gidMap,l=a.pipelines.set(r.pipeline,r),f=o.getTintAppendFloatAlpha,u=r.scrollFactorX,d=r.scrollFactorY,p=r.x,g=r.y,x=r.scaleX,y=r.scaleY;a.pipelines.preBatch(r);for(var C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5506,11 +5506,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(42573),v=t(7386),a=t(62991),r=t(23029),n=function(e,i,h,s,l,f,u,d){u===void 0&&(u=!0);var p=v(e,i,h,s,null,d),g=[];p.forEach(function(I){var L=new r(I.layer,I.index,I.x,I.y,I.width,I.height,I.baseWidth,I.baseHeight);L.copy(I),g.push(L)});for(var y=l-e,x=f-i,C=0;C{/** + */var o=t(42573),v=t(7386),a=t(62991),r=t(23029),n=function(e,i,h,s,l,f,u,d){u===void 0&&(u=!0);var p=v(e,i,h,s,null,d),g=[];p.forEach(function(I){var L=new r(I.layer,I.index,I.x,I.y,I.width,I.height,I.baseWidth,I.baseHeight);L.copy(I),g.push(L)});for(var x=l-e,y=f-i,C=0;C{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(62644),v=t(7386),a=t(27987),r=function(n,e,i,h,s,l){i||(i={}),Array.isArray(n)||(n=[n]);var f=l.tilemapLayer;h||(h=f.scene),s||(s=h.cameras.main);var u=l.width,d=l.height,p=v(0,0,u,d,null,l),g=[],y,x=function(w,I,L){for(var B=0;B{/** + */var o=t(62644),v=t(7386),a=t(27987),r=function(n,e,i,h,s,l){i||(i={}),Array.isArray(n)||(n=[n]);var f=l.tilemapLayer;h||(h=f.scene),s||(s=h.cameras.main);var u=l.width,d=l.height,p=v(0,0,u,d,null,l),g=[],x,y=function(w,I,L){for(var B=0;B{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5578,11 +5578,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(55738),v=t(7386),a=t(91865),r=t(29747),n=t(26099),e=function(f,u){return a.RectangleToTriangle(u,f)},i=new n,h=new n,s=new n,l=function(f,u,d,p){if(f===void 0)return[];var g=r;f instanceof o.Circle?g=a.CircleToRectangle:f instanceof o.Rectangle?g=a.RectangleToRectangle:f instanceof o.Triangle?g=e:f instanceof o.Line&&(g=a.LineToRectangle),p.tilemapLayer.worldToTileXY(f.left,f.top,!0,h,d);var y=h.x,x=h.y;p.tilemapLayer.worldToTileXY(f.right,f.bottom,!1,s,d);var C=Math.ceil(s.x),P=Math.ceil(s.y),M=Math.max(C-y,1),w=Math.max(P-x,1),I=v(y,x,M,w,u,p),L=p.tileWidth,B=p.tileHeight;p.tilemapLayer&&(L*=p.tilemapLayer.scaleX,B*=p.tilemapLayer.scaleY);for(var N=[],G=new o.Rectangle(0,0,L,B),V=0;V{/** + */var o=t(55738),v=t(7386),a=t(91865),r=t(29747),n=t(26099),e=function(f,u){return a.RectangleToTriangle(u,f)},i=new n,h=new n,s=new n,l=function(f,u,d,p){if(f===void 0)return[];var g=r;f instanceof o.Circle?g=a.CircleToRectangle:f instanceof o.Rectangle?g=a.RectangleToRectangle:f instanceof o.Triangle?g=e:f instanceof o.Line&&(g=a.LineToRectangle),p.tilemapLayer.worldToTileXY(f.left,f.top,!0,h,d);var x=h.x,y=h.y;p.tilemapLayer.worldToTileXY(f.right,f.bottom,!1,s,d);var C=Math.ceil(s.x),P=Math.ceil(s.y),M=Math.max(C-x,1),w=Math.max(P-y,1),I=v(x,y,M,w,u,p),L=p.tileWidth,B=p.tileHeight;p.tilemapLayer&&(L*=p.tilemapLayer.scaleX,B*=p.tilemapLayer.scaleY);for(var N=[],G=new o.Rectangle(0,0,L,B),V=0;V{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(7386),v=t(26099),a=new v,r=new v,n=function(e,i,h,s,l,f,u){var d=u.tilemapLayer.tilemap._convert.WorldToTileXY;d(e,i,!0,a,f,u);var p=a.x,g=a.y;d(e+h,i+s,!1,r,f,u);var y=Math.ceil(r.x),x=Math.ceil(r.y);return o(p,g,y-p,x-g,l,u)};c.exports=n},96113:(c,m,t)=>{/** + */var o=t(7386),v=t(26099),a=new v,r=new v,n=function(e,i,h,s,l,f,u){var d=u.tilemapLayer.tilemap._convert.WorldToTileXY;d(e,i,!0,a,f,u);var p=a.x,g=a.y;d(e+h,i+s,!1,r,f,u);var x=Math.ceil(r.x),y=Math.ceil(r.y);return o(p,g,x-p,y-g,l,u)};c.exports=n},96113:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5606,7 +5606,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(63448),v=t(56583),a=function(r,n){var e=r.tilemapLayer.tilemap,i=r.tilemapLayer,h=Math.floor(e.tileWidth*i.scaleX),s=Math.floor(e.tileHeight*i.scaleY),l=r.hexSideLength,f,u,d,p;if(r.staggerAxis==="y"){var g=(s-l)/2+l;f=v(n.worldView.x-i.x,h,0,!0)-i.cullPaddingX,u=o(n.worldView.right-i.x,h,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,g,0,!0)-i.cullPaddingY,p=o(n.worldView.bottom-i.y,g,0,!0)+i.cullPaddingY}else{var y=(h-l)/2+l;f=v(n.worldView.x-i.x,y,0,!0)-i.cullPaddingX,u=o(n.worldView.right-i.x,y,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,s,0,!0)-i.cullPaddingY,p=o(n.worldView.bottom-i.y,s,0,!0)+i.cullPaddingY}return{left:f,right:u,top:d,bottom:p}};c.exports=a},9474:(c,m,t)=>{/** + */var o=t(63448),v=t(56583),a=function(r,n){var e=r.tilemapLayer.tilemap,i=r.tilemapLayer,h=Math.floor(e.tileWidth*i.scaleX),s=Math.floor(e.tileHeight*i.scaleY),l=r.hexSideLength,f,u,d,p;if(r.staggerAxis==="y"){var g=(s-l)/2+l;f=v(n.worldView.x-i.x,h,0,!0)-i.cullPaddingX,u=o(n.worldView.right-i.x,h,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,g,0,!0)-i.cullPaddingY,p=o(n.worldView.bottom-i.y,g,0,!0)+i.cullPaddingY}else{var x=(h-l)/2+l;f=v(n.worldView.x-i.x,x,0,!0)-i.cullPaddingX,u=o(n.worldView.right-i.x,x,0,!0)+i.cullPaddingX,d=v(n.worldView.y-i.y,s,0,!0)-i.cullPaddingY,p=o(n.worldView.bottom-i.y,s,0,!0)+i.cullPaddingY}return{left:f,right:u,top:d,bottom:p}};c.exports=a},9474:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5614,15 +5614,15 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(19951),v=t(26099),a=new v,r=function(n,e,i,h){var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(s*=f.scaleX,l*=f.scaleY);var u=o(n,e,a,i,h),d=[],p=.5773502691896257,g,y;h.staggerAxis==="y"?(g=p*s,y=l/2):(g=s/2,y=p*l);for(var x=0;x<6;x++){var C=2*Math.PI*(.5-x)/6;d.push(new v(u.x+g*Math.cos(C),u.y+y*Math.sin(C)))}return d};c.exports=r},19951:(c,m,t)=>{/** + */var o=t(19951),v=t(26099),a=new v,r=function(n,e,i,h){var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(s*=f.scaleX,l*=f.scaleY);var u=o(n,e,a,i,h),d=[],p=.5773502691896257,g,x;h.staggerAxis==="y"?(g=p*s,x=l/2):(g=s/2,x=p*l);for(var y=0;y<6;y++){var C=2*Math.PI*(.5-y)/6;d.push(new v(u.x+g*Math.cos(C),u.y+x*Math.sin(C)))}return d};c.exports=r},19951:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(26099),v=function(a,r,n,e,i){n||(n=new o);var h=i.baseTileWidth,s=i.baseTileHeight,l=i.tilemapLayer,f=0,u=0;l&&(e||(e=l.scene.cameras.main),f=l.x+e.scrollX*(1-l.scrollFactorX),u=l.y+e.scrollY*(1-l.scrollFactorY),h*=l.scaleX,s*=l.scaleY);var d=h/2,p=s/2,g,y;return i.staggerAxis==="y"?(g=f+h*a+h,y=u+1.5*r*p+p,r%2===0&&(this.staggerIndex==="odd"?g-=d:g+=d)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(g=f+1.5*a*d+d,y=u+s*a+s,a%2===0&&(this.staggerIndex==="odd"?y-=p:y+=p)),n.set(g,y)};c.exports=v},86625:(c,m,t)=>{/** + */var o=t(26099),v=function(a,r,n,e,i){n||(n=new o);var h=i.baseTileWidth,s=i.baseTileHeight,l=i.tilemapLayer,f=0,u=0;l&&(e||(e=l.scene.cameras.main),f=l.x+e.scrollX*(1-l.scrollFactorX),u=l.y+e.scrollY*(1-l.scrollFactorY),h*=l.scaleX,s*=l.scaleY);var d=h/2,p=s/2,g,x;return i.staggerAxis==="y"?(g=f+h*a+h,x=u+1.5*r*p+p,r%2===0&&(this.staggerIndex==="odd"?g-=d:g+=d)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(g=f+1.5*a*d+d,x=u+s*a+s,a%2===0&&(this.staggerIndex==="odd"?x-=p:x+=p)),n.set(g,x)};c.exports=v},86625:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(26099),v=function(a,r,n,e,i,h){e||(e=new o);var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(i||(i=f.scene.cameras.main),a=a-(f.x+i.scrollX*(1-f.scrollFactorX)),r=r-(f.y+i.scrollY*(1-f.scrollFactorY)),s*=f.scaleX,l*=f.scaleY);var u=.5773502691896257,d=-.3333333333333333,p=0,g=.6666666666666666,y=s/2,x=l/2,C,P,M,w,I;h.staggerAxis==="y"?(C=(a-y)/(u*s),P=(r-x)/x,M=u*C+d*P,w=p*C+g*P):(C=(a-y)/y,P=(r-x)/(u*l),M=d*C+u*P,w=g*C+p*P),I=-M-w;var L=Math.round(M),B=Math.round(w),N=Math.round(I),G=Math.abs(L-M),V=Math.abs(B-w),K=Math.abs(N-I);G>V&&G>K?L=-B-N:V>K&&(B=-L-N);var j,J=B;return h.staggerIndex==="odd"?j=J%2===0?B/2+L:B/2+L-.5:j=J%2===0?B/2+L:B/2+L+.5,e.set(j,J)};c.exports=v},62991:c=>{/** + */var o=t(26099),v=function(a,r,n,e,i,h){e||(e=new o);var s=h.baseTileWidth,l=h.baseTileHeight,f=h.tilemapLayer;f&&(i||(i=f.scene.cameras.main),a=a-(f.x+i.scrollX*(1-f.scrollFactorX)),r=r-(f.y+i.scrollY*(1-f.scrollFactorY)),s*=f.scaleX,l*=f.scaleY);var u=.5773502691896257,d=-.3333333333333333,p=0,g=.6666666666666666,x=s/2,y=l/2,C,P,M,w,I;h.staggerAxis==="y"?(C=(a-x)/(u*s),P=(r-y)/y,M=u*C+d*P,w=p*C+g*P):(C=(a-x)/x,P=(r-y)/(u*l),M=d*C+u*P,w=g*C+p*P),I=-M-w;var L=Math.round(M),B=Math.round(w),N=Math.round(I),G=Math.abs(L-M),V=Math.abs(B-w),K=Math.abs(N-I);G>V&&G>K?L=-B-N:V>K&&(B=-L-N);var j,J=B;return h.staggerIndex==="odd"?j=J%2===0?B/2+L:B/2+L-.5:j=J%2===0?B/2+L:B/2+L+.5,e.set(j,J)};c.exports=v},62991:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5630,7 +5630,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(33528),v=function(a,r,n,e){n===void 0&&(n=[]),e===void 0&&(e=0),n.length=0;var i=a.tilemapLayer,h=a.data,s=a.width,l=a.height,f=i.skipCull,u=0,d=s,p=0,g=l,y,x,C;if(e===0)for(x=p;x=u;y--)C=h[x][y],!(!C||C.index===-1||!C.visible||C.alpha===0)&&(!f&&!o(y,x,a,r)||n.push(C));else if(e===2)for(x=g;x>=p;x--)for(y=u;y=p;x--)for(y=d;y>=u;y--)C=h[x][y],!(!C||C.index===-1||!C.visible||C.alpha===0)&&(!f&&!o(y,x,a,r)||n.push(C));return i.tilesDrawn=n.length,i.tilesTotal=s*l,n};c.exports=v},14127:(c,m,t)=>{/** + */var o=t(33528),v=function(a,r,n,e){n===void 0&&(n=[]),e===void 0&&(e=0),n.length=0;var i=a.tilemapLayer,h=a.data,s=a.width,l=a.height,f=i.skipCull,u=0,d=s,p=0,g=l,x,y,C;if(e===0)for(y=p;y=u;x--)C=h[y][x],!(!C||C.index===-1||!C.visible||C.alpha===0)&&(!f&&!o(x,y,a,r)||n.push(C));else if(e===2)for(y=g;y>=p;y--)for(x=u;x=p;y--)for(x=d;x>=u;x--)C=h[y][x],!(!C||C.index===-1||!C.visible||C.alpha===0)&&(!f&&!o(x,y,a,r)||n.push(C));return i.tilesDrawn=n.length,i.tilesTotal=s*l,n};c.exports=v},14127:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5638,11 +5638,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(26099),v=function(a,r,n,e,i,h,s){e||(e=new o);var l=h.baseTileWidth,f=h.baseTileHeight,u=h.tilemapLayer;u&&(i||(i=u.scene.cameras.main),r=r-(u.y+i.scrollY*(1-u.scrollFactorY)),f*=u.scaleY,a=a-(u.x+i.scrollX*(1-u.scrollFactorX)),l*=u.scaleX);var d=l/2,p=f/2;a=a-d,s||(r=r-f);var g=.5*(a/d+r/p),y=.5*(-a/d+r/p);return n&&(g=Math.floor(g),y=Math.floor(y)),e.set(g,y)};c.exports=v},71558:(c,m,t)=>{/** + */var o=t(26099),v=function(a,r,n,e,i,h,s){e||(e=new o);var l=h.baseTileWidth,f=h.baseTileHeight,u=h.tilemapLayer;u&&(i||(i=u.scene.cameras.main),r=r-(u.y+i.scrollY*(1-u.scrollFactorY)),f*=u.scaleY,a=a-(u.x+i.scrollX*(1-u.scrollFactorX)),l*=u.scaleX);var d=l/2,p=f/2;a=a-d,s||(r=r-f);var g=.5*(a/d+r/p),x=.5*(-a/d+r/p);return n&&(g=Math.floor(g),x=Math.floor(x)),e.set(g,x)};c.exports=v},71558:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(23029),v=t(62991),a=t(72023),r=t(20576),n=function(e,i,h,s,l){if(s===void 0&&(s=!0),!v(i,h,l))return null;var f,u=l.data[h][i],d=u&&u.collides;e instanceof o?(l.data[h][i]===null&&(l.data[h][i]=new o(l,e.index,i,h,l.tileWidth,l.tileHeight)),l.data[h][i].copy(e)):(f=e,l.data[h][i]===null?l.data[h][i]=new o(l,f,i,h,l.tileWidth,l.tileHeight):l.data[h][i].index=f);var p=l.data[h][i],g=l.collideIndexes.indexOf(p.index)!==-1;if(f=e instanceof o?e.index:e,f===-1)p.width=l.tileWidth,p.height=l.tileHeight;else{var y=l.tilemapLayer.tilemap,x=y.tiles,C=x[f][2],P=y.tilesets[C];p.width=P.tileWidth,p.height=P.tileHeight}return r(p,g),s&&d!==p.collides&&a(i,h,l),p};c.exports=n},26303:(c,m,t)=>{/** + */var o=t(23029),v=t(62991),a=t(72023),r=t(20576),n=function(e,i,h,s,l){if(s===void 0&&(s=!0),!v(i,h,l))return null;var f,u=l.data[h][i],d=u&&u.collides;e instanceof o?(l.data[h][i]===null&&(l.data[h][i]=new o(l,e.index,i,h,l.tileWidth,l.tileHeight)),l.data[h][i].copy(e)):(f=e,l.data[h][i]===null?l.data[h][i]=new o(l,f,i,h,l.tileWidth,l.tileHeight):l.data[h][i].index=f);var p=l.data[h][i],g=l.collideIndexes.indexOf(p.index)!==-1;if(f=e instanceof o?e.index:e,f===-1)p.width=l.tileWidth,p.height=l.tileHeight;else{var x=l.tilemapLayer.tilemap,y=x.tiles,C=y[f][2],P=x.tilesets[C];p.width=P.tileWidth,p.height=P.tileHeight}return r(p,g),s&&d!==p.collides&&a(i,h,l),p};c.exports=n},26303:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5666,7 +5666,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(7386),v=t(3956),a=new v(105,210,231,150),r=new v(243,134,48,200),n=new v(40,39,37,150),e=function(i,h,s){h===void 0&&(h={});var l=h.tileColor!==void 0?h.tileColor:a,f=h.collidingTileColor!==void 0?h.collidingTileColor:r,u=h.faceColor!==void 0?h.faceColor:n,d=o(0,0,s.width,s.height,null,s);i.translateCanvas(s.tilemapLayer.x,s.tilemapLayer.y),i.scaleCanvas(s.tilemapLayer.scaleX,s.tilemapLayer.scaleY);for(var p=0;p{/** + */var o=t(7386),v=t(3956),a=new v(105,210,231,150),r=new v(243,134,48,200),n=new v(40,39,37,150),e=function(i,h,s){h===void 0&&(h={});var l=h.tileColor!==void 0?h.tileColor:a,f=h.collidingTileColor!==void 0?h.collidingTileColor:r,u=h.faceColor!==void 0?h.faceColor:n,d=o(0,0,s.width,s.height,null,s);i.translateCanvas(s.tilemapLayer.x,s.tilemapLayer.y),i.scaleCanvas(s.tilemapLayer.scaleX,s.tilemapLayer.scaleY);for(var p=0;p{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5758,7 +5758,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(7386),v=t(75508),a=function(r,n,e,i,h,s){if(h){var l,f=o(r,n,e,i,null,s),u=0;for(l=0;l{/** + */var o=t(7386),v=t(75508),a=function(r,n,e,i,h,s){if(h){var l,f=o(r,n,e,i,null,s),u=0;for(l=0;l{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5810,7 +5810,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(80341),v=t(14977),a=t(87010),r=t(23029),n=function(e,i,h,s,l){for(var f=new v({tileWidth:h,tileHeight:s}),u=new a({name:e,tileWidth:h,tileHeight:s,format:o.ARRAY_2D,layers:[f]}),d=[],p=i.length,g=0,y=0;y{/** + */var o=t(80341),v=t(14977),a=t(87010),r=t(23029),n=function(e,i,h,s,l){for(var f=new v({tileWidth:h,tileHeight:s}),u=new a({name:e,tileWidth:h,tileHeight:s,format:o.ARRAY_2D,layers:[f]}),d=[],p=i.length,g=0,x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5847,7 +5847,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(33629),v=function(a){var r,n,e=[];for(r=0;r{/** + */var o=t(33629),v=function(a){var r,n,e=[];for(r=0;r{/** * @author Seth Berrier * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5863,7 +5863,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(51233),v=t(84101),a=t(91907),r=t(62644),n=t(80341),e=t(6641),i=t(87010),h=t(12635),s=t(22611),l=t(28200),f=t(24619),u=function(d,p,g){var y=r(p),x=new i({width:y.width,height:y.height,name:d,tileWidth:y.tilewidth,tileHeight:y.tileheight,orientation:e(y.orientation),format:n.TILED_JSON,version:y.version,properties:y.properties,renderOrder:y.renderorder,infinite:y.infinite});x.orientation===a.HEXAGONAL&&(x.hexSideLength=y.hexsidelength,x.staggerAxis=y.staggeraxis,x.staggerIndex=y.staggerindex),x.layers=l(y,g),x.images=h(y);var C=f(y);return x.tilesets=C.tilesets,x.imageCollections=C.imageCollections,x.objects=s(y),x.tiles=v(x),o(x),x};c.exports=u},52205:(c,m,t)=>{/** + */var o=t(51233),v=t(84101),a=t(91907),r=t(62644),n=t(80341),e=t(6641),i=t(87010),h=t(12635),s=t(22611),l=t(28200),f=t(24619),u=function(d,p,g){var x=r(p),y=new i({width:x.width,height:x.height,name:d,tileWidth:x.tilewidth,tileHeight:x.tileheight,orientation:e(x.orientation),format:n.TILED_JSON,version:x.version,properties:x.properties,renderOrder:x.renderorder,infinite:x.infinite});y.orientation===a.HEXAGONAL&&(y.hexSideLength=x.hexsidelength,y.staggerAxis=x.staggeraxis,y.staggerIndex=x.staggerindex),y.layers=l(x,g),y.images=h(x);var C=f(x);return y.tilesets=C.tilesets,y.imageCollections=C.imageCollections,y.objects=s(x),y.tiles=v(y),o(y),y};c.exports=u},52205:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5871,19 +5871,19 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95540),v=t(52205),a=t(48700),r=t(79677),n=function(e){for(var i=[],h=[],s=r(e);s.i0;){if(s.i>=s.layers.length){if(h.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=h.pop();continue}var l=s.layers[s.i];if(s.i++,l.opacity*=s.opacity,l.visible=s.visible&&l.visible,l.type!=="objectgroup"){if(l.type==="group"){var f=r(e,l,s);h.push(s),s=f}continue}l.name=s.name+l.name;for(var u=s.x+o(l,"startx",0)+o(l,"offsetx",0),d=s.y+o(l,"starty",0)+o(l,"offsety",0),p=[],g=0;g{/** + */var o=t(95540),v=t(52205),a=t(48700),r=t(79677),n=function(e){for(var i=[],h=[],s=r(e);s.i0;){if(s.i>=s.layers.length){if(h.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=h.pop();continue}var l=s.layers[s.i];if(s.i++,l.opacity*=s.opacity,l.visible=s.visible&&l.visible,l.type!=="objectgroup"){if(l.type==="group"){var f=r(e,l,s);h.push(s),s=f}continue}l.name=s.name+l.name;for(var u=s.x+o(l,"startx",0)+o(l,"offsetx",0),d=s.y+o(l,"starty",0)+o(l,"offsety",0),p=[],g=0;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(41868),v=t(91907),a=t(79677),r=t(6641),n=t(95540),e=t(14977),i=t(29920),h=t(23029),s=function(l,f){for(var u=n(l,"infinite",!1),d=[],p=[],g=a(l);g.i0;){if(g.i>=g.layers.length){if(p.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}g=p.pop();continue}var y=g.layers[g.i];if(g.i++,y.type!=="tilelayer"){if(y.type==="group"){var x=a(l,y,g);p.push(g),g=x}continue}if(y.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+y.name+"'");continue}else if(y.encoding&&y.encoding==="base64"){if(y.chunks)for(var C=0;C0?(w=new h(P,M.gid,W,H,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,L[H][W]=w):(I=f?null:new h(P,-1,W,H,l.tilewidth,l.tileheight),L[H][W]=I),B++,B===j.width&&(Y++,B=0)}}else{P=new e({name:g.name+y.name,id:y.id,x:g.x+n(y,"offsetx",0)+y.x,y:g.y+n(y,"offsety",0)+y.y,width:y.width,height:y.height,tileWidth:l.tilewidth,tileHeight:l.tileheight,alpha:g.opacity*y.opacity,visible:g.visible&&y.visible,properties:n(y,"properties",[]),orientation:r(l.orientation)}),P.orientation===v.HEXAGONAL&&(P.hexSideLength=l.hexsidelength,P.staggerAxis=l.staggeraxis,P.staggerIndex=l.staggerindex);for(var Z=[],Q=0,k=y.data.length;Q0?(w=new h(P,M.gid,B,L.length,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,Z.push(w)):(I=f?null:new h(P,-1,B,L.length,l.tilewidth,l.tileheight),Z.push(I)),B++,B===y.width&&(L.push(Z),B=0,Z=[])}P.data=L,d.push(P)}return d};c.exports=s},24619:(c,m,t)=>{/** + */var o=t(41868),v=t(91907),a=t(79677),r=t(6641),n=t(95540),e=t(14977),i=t(29920),h=t(23029),s=function(l,f){for(var u=n(l,"infinite",!1),d=[],p=[],g=a(l);g.i0;){if(g.i>=g.layers.length){if(p.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}g=p.pop();continue}var x=g.layers[g.i];if(g.i++,x.type!=="tilelayer"){if(x.type==="group"){var y=a(l,x,g);p.push(g),g=y}continue}if(x.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+x.name+"'");continue}else if(x.encoding&&x.encoding==="base64"){if(x.chunks)for(var C=0;C0?(w=new h(P,M.gid,W,H,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,L[H][W]=w):(I=f?null:new h(P,-1,W,H,l.tilewidth,l.tileheight),L[H][W]=I),B++,B===j.width&&(Y++,B=0)}}else{P=new e({name:g.name+x.name,id:x.id,x:g.x+n(x,"offsetx",0)+x.x,y:g.y+n(x,"offsety",0)+x.y,width:x.width,height:x.height,tileWidth:l.tilewidth,tileHeight:l.tileheight,alpha:g.opacity*x.opacity,visible:g.visible&&x.visible,properties:n(x,"properties",[]),orientation:r(l.orientation)}),P.orientation===v.HEXAGONAL&&(P.hexSideLength=l.hexsidelength,P.staggerAxis=l.staggeraxis,P.staggerIndex=l.staggerindex);for(var Z=[],Q=0,k=x.data.length;Q0?(w=new h(P,M.gid,B,L.length,l.tilewidth,l.tileheight),w.rotation=M.rotation,w.flipX=M.flipped,Z.push(w)):(I=f?null:new h(P,-1,B,L.length,l.tilewidth,l.tileheight),Z.push(I)),B++,B===x.width&&(L.push(Z),B=0,Z=[])}P.data=L,d.push(P)}return d};c.exports=s},24619:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(33629),v=t(16536),a=t(52205),r=t(57880),n=function(e){for(var i=[],h=[],s=null,l,f=0;f1){var p=void 0,g=void 0;if(Array.isArray(u.tiles)){p=p||{},g=g||{};for(var y=0;y{/** + */var o=t(33629),v=t(16536),a=t(52205),r=t(57880),n=function(e){for(var i=[],h=[],s=null,l,f=0;f1){var p=void 0,g=void 0;if(Array.isArray(u.tiles)){p=p||{},g=g||{};for(var x=0;x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var m=function(t,o){for(var v=0;v0){var n={},e={},i,h,s;if(Array.isArray(a.edgecolors))for(i=0;i{/** + */var m=function(t,o){for(var v=0;v0){var n={},e={},i,h,s;if(Array.isArray(a.edgecolors))for(i=0;i{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5915,7 +5915,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(72905),v=t(83419),a=t(43491),r=t(88032),n=t(37277),e=t(44594),i=t(93109),h=t(86081),s=t(8357),l=t(43960),f=t(26012),u=new v({initialize:function(p){this.scene=p,this.events=p.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(e.BOOT,this.boot,this),this.events.on(e.START,this.start,this)},boot:function(){this.events.once(e.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(e.UPDATE,this.update,this),this.events.once(e.SHUTDOWN,this.shutdown,this)},create:function(d){Array.isArray(d)||(d=[d]);for(var p=[],g=0;g-1},existing:function(d){return this.has(d)||this.tweens.push(d.reset()),this},addCounter:function(d){var p=r(this,d);return this.tweens.push(p.reset()),p},stagger:function(d,p){return i(d,p)},setLagSmooth:function(d,p){return d===void 0&&(d=1/1e-8),p===void 0&&(p=0),this.maxLag=d,this.lagSkip=Math.min(p,this.maxLag),this},setFps:function(d){return d===void 0&&(d=240),this.gap=1e3/d,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(d){var p=Date.now()-this.prevTime;p>this.maxLag&&(this.startTime+=p-this.lagSkip),this.prevTime+=p;var g=this.prevTime-this.startTime,y=g-this.nextTime,x=g-this.time*1e3;return y>0||d?(g/=1e3,this.time=g,this.nextTime+=y+(y>=this.gap?4:this.gap-y)):x=0,x},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(d){d===void 0&&(d=!1);var p=this.getDelta(d);if(!(p<=0)){this.processing=!0;var g,y,x=[],C=this.tweens;for(g=0;g0){for(g=0;g-1&&(y.isPendingRemove()||y.isDestroyed())&&(C.splice(M,1),y.destroy())}x.length=0}this.processing=!1}},remove:function(d){return this.processing?d.setPendingRemoveState():(o(this.tweens,d),d.setRemovedState()),this},reset:function(d){return this.existing(d),d.seek(),d.setActiveState(),this},makeActive:function(d){return this.existing(d),d.setActiveState(),this},each:function(d,p){var g,y=[null];for(g=1;g{/** + */var o=t(72905),v=t(83419),a=t(43491),r=t(88032),n=t(37277),e=t(44594),i=t(93109),h=t(86081),s=t(8357),l=t(43960),f=t(26012),u=new v({initialize:function(p){this.scene=p,this.events=p.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(e.BOOT,this.boot,this),this.events.on(e.START,this.start,this)},boot:function(){this.events.once(e.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(e.UPDATE,this.update,this),this.events.once(e.SHUTDOWN,this.shutdown,this)},create:function(d){Array.isArray(d)||(d=[d]);for(var p=[],g=0;g-1},existing:function(d){return this.has(d)||this.tweens.push(d.reset()),this},addCounter:function(d){var p=r(this,d);return this.tweens.push(p.reset()),p},stagger:function(d,p){return i(d,p)},setLagSmooth:function(d,p){return d===void 0&&(d=1/1e-8),p===void 0&&(p=0),this.maxLag=d,this.lagSkip=Math.min(p,this.maxLag),this},setFps:function(d){return d===void 0&&(d=240),this.gap=1e3/d,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(d){var p=Date.now()-this.prevTime;p>this.maxLag&&(this.startTime+=p-this.lagSkip),this.prevTime+=p;var g=this.prevTime-this.startTime,x=g-this.nextTime,y=g-this.time*1e3;return x>0||d?(g/=1e3,this.time=g,this.nextTime+=x+(x>=this.gap?4:this.gap-x)):y=0,y},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(d){d===void 0&&(d=!1);var p=this.getDelta(d);if(!(p<=0)){this.processing=!0;var g,x,y=[],C=this.tweens;for(g=0;g0){for(g=0;g-1&&(x.isPendingRemove()||x.isDestroyed())&&(C.splice(M,1),x.destroy())}y.length=0}this.processing=!1}},remove:function(d){return this.processing?d.setPendingRemoveState():(o(this.tweens,d),d.setRemovedState()),this},reset:function(d){return this.existing(d),d.seek(),d.setActiveState(),this},makeActive:function(d){return this.existing(d),d.setActiveState(),this},each:function(d,p){var g,x=[null];for(g=1;g{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -5943,23 +5943,23 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(30976),v=t(99472);function a(h){return!!h.getActive&&typeof h.getActive=="function"}function r(h){return!!h.getStart&&typeof h.getStart=="function"}function n(h){return!!h.getEnd&&typeof h.getEnd=="function"}function e(h){return r(h)||n(h)||a(h)}var i=function(h,s){var l,f=function(j,J,X){return X},u=function(j,J,X){return X},d=null,p=typeof s;if(p==="number")f=function(){return s};else if(Array.isArray(s))u=function(){return s[0]},f=function(){return s[s.length-1]};else if(p==="string"){var g=s.toLowerCase(),y=g.substring(0,6)==="random",x=g.substring(0,3)==="int";if(y||x){var C=g.indexOf("("),P=g.indexOf(")"),M=g.indexOf(",");if(C&&P&&M){var w=parseFloat(g.substring(C+1,M)),I=parseFloat(g.substring(M+1,P));y?f=function(){return v(w,I)}:f=function(){return o(w,I)}}else throw new Error("invalid random() format")}else{g=g[0];var L=parseFloat(s.substr(2));switch(g){case"+":f=function(j,J,X){return X+L};break;case"-":f=function(j,J,X){return X-L};break;case"*":f=function(j,J,X){return X*L};break;case"/":f=function(j,J,X){return X/L};break;default:f=function(){return parseFloat(s)}}}}else if(p==="function")f=s;else if(p==="object")if(e(s))a(s)&&(d=s.getActive),n(s)&&(f=s.getEnd),r(s)&&(u=s.getStart);else if(s.hasOwnProperty("value"))l=i(h,s.value);else{var B=s.hasOwnProperty("to"),N=s.hasOwnProperty("from"),G=s.hasOwnProperty("start");if(B&&(N||G)){if(l=i(h,s.to),G){var V=i(h,s.start);l.getActive=V.getEnd}if(N){var K=i(h,s.from);l.getStart=K.getEnd}}}return l||(l={getActive:d,getEnd:f,getStart:u}),l};c.exports=i},88032:(c,m,t)=>{/** + */var o=t(30976),v=t(99472);function a(h){return!!h.getActive&&typeof h.getActive=="function"}function r(h){return!!h.getStart&&typeof h.getStart=="function"}function n(h){return!!h.getEnd&&typeof h.getEnd=="function"}function e(h){return r(h)||n(h)||a(h)}var i=function(h,s){var l,f=function(j,J,X){return X},u=function(j,J,X){return X},d=null,p=typeof s;if(p==="number")f=function(){return s};else if(Array.isArray(s))u=function(){return s[0]},f=function(){return s[s.length-1]};else if(p==="string"){var g=s.toLowerCase(),x=g.substring(0,6)==="random",y=g.substring(0,3)==="int";if(x||y){var C=g.indexOf("("),P=g.indexOf(")"),M=g.indexOf(",");if(C&&P&&M){var w=parseFloat(g.substring(C+1,M)),I=parseFloat(g.substring(M+1,P));x?f=function(){return v(w,I)}:f=function(){return o(w,I)}}else throw new Error("invalid random() format")}else{g=g[0];var L=parseFloat(s.substr(2));switch(g){case"+":f=function(j,J,X){return X+L};break;case"-":f=function(j,J,X){return X-L};break;case"*":f=function(j,J,X){return X*L};break;case"/":f=function(j,J,X){return X/L};break;default:f=function(){return parseFloat(s)}}}}else if(p==="function")f=s;else if(p==="object")if(e(s))a(s)&&(d=s.getActive),n(s)&&(f=s.getEnd),r(s)&&(u=s.getStart);else if(s.hasOwnProperty("value"))l=i(h,s.value);else{var B=s.hasOwnProperty("to"),N=s.hasOwnProperty("from"),G=s.hasOwnProperty("start");if(B&&(N||G)){if(l=i(h,s.to),G){var V=i(h,s.start);l.getActive=V.getEnd}if(N){var K=i(h,s.from);l.getStart=K.getEnd}}}return l||(l={getActive:d,getEnd:f,getStart:u}),l};c.exports=i},88032:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70402),v=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(55292),i=t(35154),h=t(17777),s=t(269),l=t(86081),f=function(u,d,p){if(d instanceof l)return d.parent=u,d;p===void 0?p=v:p=s(v,p);var g=i(d,"from",0),y=i(d,"to",1),x=[{value:g}],C=i(d,"delay",p.delay),P=i(d,"easeParams",p.easeParams),M=i(d,"ease",p.ease),w=h("value",y),I=new l(u,x),L=I.add(0,"value",w.getEnd,w.getStart,w.getActive,n(i(d,"ease",M),i(d,"easeParams",P)),e(d,"delay",C),i(d,"duration",p.duration),r(d,"yoyo",p.yoyo),i(d,"hold",p.hold),i(d,"repeat",p.repeat),i(d,"repeatDelay",p.repeatDelay),!1,!1);L.start=g,L.current=g,I.completeDelay=a(d,"completeDelay",0),I.loop=Math.round(a(d,"loop",0)),I.loopDelay=Math.round(a(d,"loopDelay",0)),I.paused=r(d,"paused",!1),I.persist=r(d,"persist",!1),I.callbackScope=i(d,"callbackScope",I);for(var B=o.TYPES,N=0;N{/** + */var o=t(70402),v=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(55292),i=t(35154),h=t(17777),s=t(269),l=t(86081),f=function(u,d,p){if(d instanceof l)return d.parent=u,d;p===void 0?p=v:p=s(v,p);var g=i(d,"from",0),x=i(d,"to",1),y=[{value:g}],C=i(d,"delay",p.delay),P=i(d,"easeParams",p.easeParams),M=i(d,"ease",p.ease),w=h("value",x),I=new l(u,y),L=I.add(0,"value",w.getEnd,w.getStart,w.getActive,n(i(d,"ease",M),i(d,"easeParams",P)),e(d,"delay",C),i(d,"duration",p.duration),r(d,"yoyo",p.yoyo),i(d,"hold",p.hold),i(d,"repeat",p.repeat),i(d,"repeatDelay",p.repeatDelay),!1,!1);L.start=g,L.current=g,I.completeDelay=a(d,"completeDelay",0),I.loop=Math.round(a(d,"loop",0)),I.loopDelay=Math.round(a(d,"loopDelay",0)),I.paused=r(d,"paused",!1),I.persist=r(d,"persist",!1),I.callbackScope=i(d,"callbackScope",I);for(var B=o.TYPES,N=0;N{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(6113),v=t(35154),a=t(36383),r=function(n,e){e===void 0&&(e={});var i,h=v(e,"start",0),s=v(e,"ease",null),l=v(e,"grid",null),f=v(e,"from",0),u=f==="first",d=f==="center",p=f==="last",g=typeof f=="number",y=Array.isArray(n),x=parseFloat(y?n[0]:n),C=y?parseFloat(n[1]):0,P=Math.max(x,C);if(y&&(h+=x),l){var M=l[0],w=l[1],I=0,L=0,B=0,N=0,G=[];p?(I=M-1,L=w-1):g?(I=f%M,L=Math.floor(f/M)):d&&(I=(M-1)/2,L=(w-1)/2);for(var V=a.MIN_SAFE_INTEGER,K=0;KV&&(V=J),G[K][j]=J}}}var X=s?o(s):null;return l?i=function(Y,b,z,W){var H=0,Z=W%M,Q=Math.floor(W/M);Z>=0&&Z=0&&Q{/** + */var o=t(6113),v=t(35154),a=t(36383),r=function(n,e){e===void 0&&(e={});var i,h=v(e,"start",0),s=v(e,"ease",null),l=v(e,"grid",null),f=v(e,"from",0),u=f==="first",d=f==="center",p=f==="last",g=typeof f=="number",x=Array.isArray(n),y=parseFloat(x?n[0]:n),C=x?parseFloat(n[1]):0,P=Math.max(y,C);if(x&&(h+=y),l){var M=l[0],w=l[1],I=0,L=0,B=0,N=0,G=[];p?(I=M-1,L=w-1):g?(I=f%M,L=Math.floor(f/M)):d&&(I=(M-1)/2,L=(w-1)/2);for(var V=a.MIN_SAFE_INTEGER,K=0;KV&&(V=J),G[K][j]=J}}}var X=s?o(s):null;return l?i=function(Y,b,z,W){var H=0,Z=W%M,Q=Math.floor(W/M);Z>=0&&Z=0&&Q{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70402),v=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(91389),i=t(55292),h=t(82985),s=t(62329),l=t(35154),f=t(17777),u=t(269),d=t(86081),p=function(g,y,x){if(y instanceof d)return y.parent=g,y;x===void 0?x=v:x=u(v,x);var C=s(y);!C&&x.targets&&(C=x.targets);for(var P=h(y),M=l(y,"delay",x.delay),w=l(y,"duration",x.duration),I=l(y,"easeParams",x.easeParams),L=l(y,"ease",x.ease),B=l(y,"hold",x.hold),N=l(y,"repeat",x.repeat),G=l(y,"repeatDelay",x.repeatDelay),V=r(y,"yoyo",x.yoyo),K=r(y,"flipX",x.flipX),j=r(y,"flipY",x.flipY),J=l(y,"interpolation",x.interpolation),X=function(rt,ot,ft,at){if(ft==="texture"){var vt=at,At=void 0;Array.isArray(at)?(vt=at[0],At=at[1]):at.hasOwnProperty("value")?(vt=at.value,Array.isArray(at.value)?(vt=at.value[0],At=at.value[1]):typeof at.value=="string"&&(vt=at.value)):typeof at=="string"&&(vt=at),rt.addFrame(ot,vt,At,i(at,"delay",M),l(at,"duration",w),l(at,"hold",B),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",K),r(at,"flipY",j))}else{var Et=f(ft,at),Pt=e(l(at,"interpolation",J));rt.add(ot,ft,Et.getEnd,Et.getStart,Et.getActive,n(l(at,"ease",L),l(at,"easeParams",I)),i(at,"delay",M),l(at,"duration",w),r(at,"yoyo",V),l(at,"hold",B),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",K),r(at,"flipY",j),Pt,Pt?at:null)}},Y=new d(g,C),b=0;b{/** + */var o=t(70402),v=t(69902),a=t(23568),r=t(57355),n=t(6113),e=t(91389),i=t(55292),h=t(82985),s=t(62329),l=t(35154),f=t(17777),u=t(269),d=t(86081),p=function(g,x,y){if(x instanceof d)return x.parent=g,x;y===void 0?y=v:y=u(v,y);var C=s(x);!C&&y.targets&&(C=y.targets);for(var P=h(x),M=l(x,"delay",y.delay),w=l(x,"duration",y.duration),I=l(x,"easeParams",y.easeParams),L=l(x,"ease",y.ease),B=l(x,"hold",y.hold),N=l(x,"repeat",y.repeat),G=l(x,"repeatDelay",y.repeatDelay),V=r(x,"yoyo",y.yoyo),K=r(x,"flipX",y.flipX),j=r(x,"flipY",y.flipY),J=l(x,"interpolation",y.interpolation),X=function(rt,ot,ft,at){if(ft==="texture"){var vt=at,At=void 0;Array.isArray(at)?(vt=at[0],At=at[1]):at.hasOwnProperty("value")?(vt=at.value,Array.isArray(at.value)?(vt=at.value[0],At=at.value[1]):typeof at.value=="string"&&(vt=at.value)):typeof at=="string"&&(vt=at),rt.addFrame(ot,vt,At,i(at,"delay",M),l(at,"duration",w),l(at,"hold",B),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",K),r(at,"flipY",j))}else{var Et=f(ft,at),Pt=e(l(at,"interpolation",J));rt.add(ot,ft,Et.getEnd,Et.getStart,Et.getActive,n(l(at,"ease",L),l(at,"easeParams",I)),i(at,"delay",M),l(at,"duration",w),r(at,"yoyo",V),l(at,"hold",B),l(at,"repeat",N),l(at,"repeatDelay",G),r(at,"flipX",K),r(at,"flipY",j),Pt,Pt?at:null)}},Y=new d(g,C),b=0;b{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70402),v=t(23568),a=t(57355),r=t(62329),n=t(35154),e=t(8357),i=t(43960),h=function(s,l){if(l instanceof i)return l.parent=s,l;var f=new i(s);f.startDelay=n(l,"delay",0),f.completeDelay=v(l,"completeDelay",0),f.loop=Math.round(v(l,"loop",n(l,"repeat",0))),f.loopDelay=Math.round(v(l,"loopDelay",n(l,"repeatDelay",0))),f.paused=a(l,"paused",!1),f.persist=a(l,"persist",!1),f.callbackScope=n(l,"callbackScope",f);var u,d=o.TYPES;for(u=0;u{/** + */var o=t(70402),v=t(23568),a=t(57355),r=t(62329),n=t(35154),e=t(8357),i=t(43960),h=function(s,l){if(l instanceof i)return l.parent=s,l;var f=new i(s);f.startDelay=n(l,"delay",0),f.completeDelay=v(l,"completeDelay",0),f.loop=Math.round(v(l,"loop",n(l,"repeat",0))),f.loopDelay=Math.round(v(l,"loopDelay",n(l,"repeatDelay",0))),f.paused=a(l,"paused",!1),f.persist=a(l,"persist",!1),f.callbackScope=n(l,"callbackScope",f);var u,d=o.TYPES;for(u=0;u{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6031,7 +6031,7 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(70402),v=t(83419),a=t(842),r=t(44603),n=t(39429),e=t(36383),i=t(86353),h=t(48177),s=t(42220),l=new v({Extends:o,initialize:function(u,d){o.call(this,u),this.targets=d,this.totalTargets=d.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(f,u,d,p,g,y,x,C,P,M,w,I,L,B,N,G){var V=new h(this,f,u,d,p,g,y,x,C,P,M,w,I,L,B,N,G);return this.totalData=this.data.push(V),V},addFrame:function(f,u,d,p,g,y,x,C,P,M){var w=new s(this,f,u,d,p,g,y,x,C,P,M);return this.totalData=this.data.push(w),w},getValue:function(f){f===void 0&&(f=0);var u=null;return this.data&&(u=this.data[f].current),u},hasTarget:function(f){return this.targets&&this.targets.indexOf(f)!==-1},updateTo:function(f,u,d){if(d===void 0&&(d=!1),f!=="texture")for(var p=0;p0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,o.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(f,u,d){if(f===void 0&&(f=0),u===void 0&&(u=16.6),d===void 0&&(d=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;d||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive");var p=this.paused;if(this.paused=!1,f>0){for(var g=Math.floor(f/u),y=f-g*u,x=0;x0&&this.update(y)}return this.paused=p,this.isSeeking=!1,this},initTweenData:function(f){f===void 0&&(f=!1),this.duration=0,this.startDelay=e.MAX_SAFE_INTEGER;for(var u=this.data,d=0;d0?this.totalDuration=p+g+(p+x)*y:this.totalDuration=p+g},reset:function(f){return f===void 0&&(f=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=i.MAX),f||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive")),this},update:function(f){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(f*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(f),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(f),!1;this.hasStarted||(this.startDelay-=f,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,"onStart"),f=0));var u=!1;if(this.isActive())for(var d=this.data,p=0;p{/** + */var o=t(70402),v=t(83419),a=t(842),r=t(44603),n=t(39429),e=t(36383),i=t(86353),h=t(48177),s=t(42220),l=new v({Extends:o,initialize:function(u,d){o.call(this,u),this.targets=d,this.totalTargets=d.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(f,u,d,p,g,x,y,C,P,M,w,I,L,B,N,G){var V=new h(this,f,u,d,p,g,x,y,C,P,M,w,I,L,B,N,G);return this.totalData=this.data.push(V),V},addFrame:function(f,u,d,p,g,x,y,C,P,M){var w=new s(this,f,u,d,p,g,x,y,C,P,M);return this.totalData=this.data.push(w),w},getValue:function(f){f===void 0&&(f=0);var u=null;return this.data&&(u=this.data[f].current),u},hasTarget:function(f){return this.targets&&this.targets.indexOf(f)!==-1},updateTo:function(f,u,d){if(d===void 0&&(d=!1),f!=="texture")for(var p=0;p0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(a.TWEEN_LOOP,"onLoop"));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},onCompleteHandler:function(){this.progress=1,this.totalProgress=1,o.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(f,u,d){if(f===void 0&&(f=0),u===void 0&&(u=16.6),d===void 0&&(d=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;d||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive");var p=this.paused;if(this.paused=!1,f>0){for(var g=Math.floor(f/u),x=f-g*u,y=0;y0&&this.update(x)}return this.paused=p,this.isSeeking=!1,this},initTweenData:function(f){f===void 0&&(f=!1),this.duration=0,this.startDelay=e.MAX_SAFE_INTEGER;for(var u=this.data,d=0;d0?this.totalDuration=p+g+(p+y)*x:this.totalDuration=p+g},reset:function(f){return f===void 0&&(f=!1),this.elapsed=0,this.totalElapsed=0,this.progress=0,this.totalProgress=0,this.loopCounter=this.loop,this.loop===-1&&(this.isInfinite=!0,this.loopCounter=i.MAX),f||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive")),this},update:function(f){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(f*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(f),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(f),!1;this.hasStarted||(this.startDelay-=f,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(a.TWEEN_START,"onStart"),f=0));var u=!1;if(this.isActive())for(var d=this.data,p=0;p{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6039,11 +6039,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95042),v=t(45319),a=t(83419),r=t(842),n=new a({Extends:o,initialize:function(i,h,s,l,f,u,d,p,g,y,x,C,P,M,w,I,L){o.call(this,i,h,p,g,y,x,C,P,M,w),this.key=s,this.getActiveValue=u,this.getEndValue=l,this.getStartValue=f,this.ease=d,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=I,this.interpolationData=L},reset:function(e){o.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex],h=this.key;e&&(i[h]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(i[h]=this.getActiveValue(i,h,0))},update:function(e){var i=this.tween,h=i.totalTargets,s=this.targetIndex,l=i.targets[s],f=this.key;if(!l)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(l,f,l[f],s,h,i),this.end=this.getEndValue(l,f,this.start,s,h,i),this.current=this.start,l[f]=this.start,this.setPlayingForwardState(),!0;var u=this.isPlayingForward(),d=this.isPlayingBackward();if(u||d){var p=this.elapsed,g=this.duration,y=0,x=!1;p+=e,p>=g?(y=p-g,p=g,x=!0):p<0&&(p=0);var C=v(p/g,0,1);if(this.elapsed=p,this.progress=C,this.previous=this.current,x)u?(this.current=this.end,l[f]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(y)):(this.current=this.start,l[f]=this.start,this.setStateFromStart(y));else{u||(C=1-C);var P=this.ease(C);this.interpolation?this.current=this.interpolation(this.interpolationData,P):this.current=this.start+(this.end-this.start)*P,l[f]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key,f=this.current,u=this.previous;h.emit(e,h,l,s,f,u);var d=h.callbacks[i];d&&d.func.apply(h.callbackScope,[h,s,l,f,u].concat(d.params))}},destroy:function(){o.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});c.exports=n},42220:(c,m,t)=>{/** + */var o=t(95042),v=t(45319),a=t(83419),r=t(842),n=new a({Extends:o,initialize:function(i,h,s,l,f,u,d,p,g,x,y,C,P,M,w,I,L){o.call(this,i,h,p,g,x,y,C,P,M,w),this.key=s,this.getActiveValue=u,this.getEndValue=l,this.getStartValue=f,this.ease=d,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=I,this.interpolationData=L},reset:function(e){o.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex],h=this.key;e&&(i[h]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(i[h]=this.getActiveValue(i,h,0))},update:function(e){var i=this.tween,h=i.totalTargets,s=this.targetIndex,l=i.targets[s],f=this.key;if(!l)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(l,f,l[f],s,h,i),this.end=this.getEndValue(l,f,this.start,s,h,i),this.current=this.start,l[f]=this.start,this.setPlayingForwardState(),!0;var u=this.isPlayingForward(),d=this.isPlayingBackward();if(u||d){var p=this.elapsed,g=this.duration,x=0,y=!1;p+=e,p>=g?(x=p-g,p=g,y=!0):p<0&&(p=0);var C=v(p/g,0,1);if(this.elapsed=p,this.progress=C,this.previous=this.current,y)u?(this.current=this.end,l[f]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(x)):(this.current=this.start,l[f]=this.start,this.setStateFromStart(x));else{u||(C=1-C);var P=this.ease(C);this.interpolation?this.current=this.interpolation(this.interpolationData,P):this.current=this.start+(this.end-this.start)*P,l[f]=this.current}this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key,f=this.current,u=this.previous;h.emit(e,h,l,s,f,u);var d=h.callbacks[i];d&&d.func.apply(h.callbackScope,[h,s,l,f,u].concat(d.params))}},destroy:function(){o.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});c.exports=n},42220:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(95042),v=t(45319),a=t(83419),r=t(842),n=new a({Extends:o,initialize:function(i,h,s,l,f,u,d,p,g,y,x){o.call(this,i,h,f,u,!1,d,p,g,y,x),this.key="texture",this.startTexture=null,this.endTexture=s,this.startFrame=null,this.endFrame=l,this.yoyo=p!==0},reset:function(e){o.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=i.texture.key,this.startFrame=i.frame.name),e&&i.setTexture(this.startTexture,this.startFrame)},update:function(e){var i=this.tween,h=this.targetIndex,s=i.targets[h];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var l=this.isPlayingForward(),f=this.isPlayingBackward();if(l||f){var u=this.elapsed,d=this.duration,p=0,g=!1;u+=e,u>=d?(p=u-d,u=d,g=!0):u<0&&(u=0);var y=v(u/d,0,1);this.elapsed=u,this.progress=y,g&&(l?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(p)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(p))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key;h.emit(e,h,l,s);var f=h.callbacks[i];f&&f.func.apply(h.callbackScope,[h,s,l].concat(f.params))}},destroy:function(){o.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});c.exports=n},86353:c=>{/** + */var o=t(95042),v=t(45319),a=t(83419),r=t(842),n=new a({Extends:o,initialize:function(i,h,s,l,f,u,d,p,g,x,y){o.call(this,i,h,f,u,!1,d,p,g,x,y),this.key="texture",this.startTexture=null,this.endTexture=s,this.startFrame=null,this.endFrame=l,this.yoyo=p!==0},reset:function(e){o.prototype.reset.call(this);var i=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=i.texture.key,this.startFrame=i.frame.name),e&&i.setTexture(this.startTexture,this.startFrame)},update:function(e){var i=this.tween,h=this.targetIndex,s=i.targets[h];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=e,this.elapsed<=0&&(this.elapsed=0,e=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(r.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var l=this.isPlayingForward(),f=this.isPlayingBackward();if(l||f){var u=this.elapsed,d=this.duration,p=0,g=!1;u+=e,u>=d?(p=u-d,u=d,g=!0):u<0&&(u=0);var x=v(u/d,0,1);this.elapsed=u,this.progress=x,g&&(l?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(p)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(p))),this.dispatchEvent(r.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(e,i){var h=this.tween;if(!h.isSeeking){var s=h.targets[this.targetIndex],l=this.key;h.emit(e,h,l,s);var f=h.callbacks[i];f&&f.func.apply(h.callbackScope,[h,s,l].concat(f.params))}},destroy:function(){o.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});c.exports=n},86353:c=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6135,11 +6135,11 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function m(v,a,r){var n=v[a];v[a]=v[r],v[r]=n}function t(v,a){return va?1:0}var o=function(v,a,r,n,e){for(r===void 0&&(r=0),n===void 0&&(n=v.length-1),e===void 0&&(e=t);n>r;){if(n-r>600){var i=n-r+1,h=a-r+1,s=Math.log(i),l=.5*Math.exp(2*s/3),f=.5*Math.sqrt(s*l*(i-l)/i)*(h-i/2<0?-1:1),u=Math.max(r,Math.floor(a-h*l/i+f)),d=Math.min(n,Math.floor(a+(i-h)*l/i+f));o(v,a,u,d,e)}var p=v[a],g=r,y=n;for(m(v,r,a),e(v[n],p)>0&&m(v,r,n);g0;)y--}e(v[r],p)===0?m(v,r,y):(y++,m(v,y,n)),y<=a&&(r=y+1),a<=y&&(n=y-1)}};c.exports=o},88492:(c,m,t)=>{/** + */function m(v,a,r){var n=v[a];v[a]=v[r],v[r]=n}function t(v,a){return va?1:0}var o=function(v,a,r,n,e){for(r===void 0&&(r=0),n===void 0&&(n=v.length-1),e===void 0&&(e=t);n>r;){if(n-r>600){var i=n-r+1,h=a-r+1,s=Math.log(i),l=.5*Math.exp(2*s/3),f=.5*Math.sqrt(s*l*(i-l)/i)*(h-i/2<0?-1:1),u=Math.max(r,Math.floor(a-h*l/i+f)),d=Math.min(n,Math.floor(a+(i-h)*l/i+f));o(v,a,u,d,e)}var p=v[a],g=r,x=n;for(m(v,r,a),e(v[n],p)>0&&m(v,r,n);g0;)x--}e(v[r],p)===0?m(v,r,x):(x++,m(v,x,n)),x<=a&&(r=x+1),a<=x&&(n=x-1)}};c.exports=o},88492:(c,m,t)=>{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(35154),v=t(33680),a=function(n,e,i){for(var h=[],s=0;s{/** + */var o=t(35154),v=t(33680),a=function(n,e,i){for(var h=[],s=0;s{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6196,7 +6196,7 @@ return new `+this.key+`(); * @author Angry Bytes (and contributors) * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var o=t(82264);function v(e,i){return String(e).localeCompare(i)}function a(e,i){var h=e.length;if(h<=1)return e;for(var s=new Array(h),l=1;ll&&(p=l),g>l&&(g=l),y=d,x=p;;)if(y{/** + */var o=t(82264);function v(e,i){return String(e).localeCompare(i)}function a(e,i){var h=e.length;if(h<=1)return e;for(var s=new Array(h),l=1;ll&&(p=l),g>l&&(g=l),x=d,y=p;;)if(x{/** * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} @@ -6360,28 +6360,28 @@ return new `+this.key+`(); * @author Richard Davey * @copyright 2013-2024 Phaser Studio Inc. * @license {@link https://opensource.org/licenses/MIT|MIT License} - */c.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},F={};function O(c){var m=F[c];if(m!==void 0)return m.exports;var t=F[c]={exports:{}};return E[c](t,t.exports,O),t.exports}O.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var D=O(85454);return D})())})(kf);var $r=kf.exports;const nn=Bf($r);var fT=Object.create,eh=Object.defineProperty,dT=Object.defineProperties,cT=Object.getOwnPropertyDescriptor,vT=Object.getOwnPropertyDescriptors,pT=Object.getOwnPropertyNames,rf=Object.getOwnPropertySymbols,gT=Object.getPrototypeOf,qf=Object.prototype.hasOwnProperty,mT=Object.prototype.propertyIsEnumerable,af=(S,T,E)=>T in S?eh(S,T,{enumerable:!0,configurable:!0,writable:!0,value:E}):S[T]=E,oe=(S,T)=>{for(var E in T||(T={}))qf.call(T,E)&&af(S,E,T[E]);if(rf)for(var E of rf(T))mT.call(T,E)&&af(S,E,T[E]);return S},Ki=(S,T)=>dT(S,vT(T)),Lt=(S,T)=>()=>(T||S((T={exports:{}}).exports,T),T.exports),xT=(S,T,E,F)=>{if(T&&typeof T=="object"||typeof T=="function")for(let O of pT(T))!qf.call(S,O)&&O!==E&&eh(S,O,{get:()=>T[O],enumerable:!(F=cT(T,O))||F.enumerable});return S},_f=(S,T,E)=>(E=S!=null?fT(gT(S)):{},xT(T||!S||!S.__esModule?eh(E,"default",{value:S,enumerable:!0}):E,S)),Zr=Lt(S=>{var T=function(D,c){return Dc?1:0},E=function(D,c){return Dc?-1:0};function F(D){return function(c,m){return D(m,c)}}function O(D){return D===2?function(c,m){return c[0]m[0]?1:c[1]m[1]?1:0}:function(c,m){for(var t=0;tm[t])return 1;t++}return 0}}S.DEFAULT_COMPARATOR=T,S.DEFAULT_REVERSE_COMPARATOR=E,S.reverseComparator=F,S.createTupleComparator=O}),yT=Lt(S=>{S.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",S.SYMBOL_SUPPORT=typeof Symbol<"u"}),ue=Lt((S,T)=>{var E=yT(),F=E.ARRAY_BUFFER_SUPPORT,O=E.SYMBOL_SUPPORT;T.exports=function(D,c){var m,t,o,v,a;if(!D)throw new Error("obliterator/forEach: invalid iterable.");if(typeof c!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(D)||F&&ArrayBuffer.isView(D)||typeof D=="string"||D.toString()==="[object Arguments]"){for(o=0,v=D.length;o{var E=Zr(),F=ue(),O=E.DEFAULT_COMPARATOR,D=E.reverseComparator;function c(i){if(this.clear(),this.comparator=i||O,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}c.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function m(i){return{item:i,degree:0}}function t(i,h){i.root?(h.right=i.root.right,h.left=i.root,i.root.right.left=h,i.root.right=h):i.root=h}c.prototype.push=function(i){var h=m(i);return h.left=h,h.right=h,t(this,h),(!this.min||this.comparator(h.item,this.min.item)<=0)&&(this.min=h),++this.size},c.prototype.peek=function(){return this.min?this.min.item:void 0};function o(i){for(var h=[],s=i,l=!1;!(s===i&&l);)s===i&&(l=!0),h.push(s),s=s.right;return h}function v(i,h){i.root===h&&(i.root=h.right),h.left.right=h.right,h.right.left=h.left}function a(i,h){i.child?(h.right=i.child.right,h.left=i.child,i.child.right.left=h,i.child.right=h):i.child=h}function r(i,h,s){v(i,h),h.left=h,h.right=h,a(s,h),s.degree++,h.parent=s}function n(i){var h=new Array(i.size),s=o(i.root),l,f,u,d,p,g;for(l=0,f=s.length;l0&&(g=u,u=d,d=g),r(i,d,u),h[p]=null,p++;h[p]=u}for(l=0;l{var T=Math.pow(2,8)-1,E=Math.pow(2,16)-1,F=Math.pow(2,32)-1,O=Math.pow(2,7)-1,D=Math.pow(2,15)-1,c=Math.pow(2,31)-1;S.getPointerArray=function(t){var o=t-1;if(o<=T)return Uint8Array;if(o<=E)return Uint16Array;if(o<=F)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},S.getSignedPointerArray=function(t){var o=t-1;return o<=O?Int8Array:o<=D?Int16Array:o<=c?Int32Array:Float64Array},S.getNumberType=function(t){return t===(t|0)?Math.sign(t)===-1?t<=127&&t>=-128?Int8Array:t<=32767&&t>=-32768?Int16Array:Int32Array:t<=255?Uint8Array:t<=65535?Uint16Array:Uint32Array:Float64Array};var m={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};S.getMinimalRepresentation=function(t,o){var v=null,a=0,r,n,e,i,h;for(i=0,h=t.length;ia&&(a=r,v=n);return v},S.isTypedArray=function(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(t)},S.concat=function(){var t=0,o,v,a;for(o=0,a=arguments.length;o{var T=ue(),E=Ge();function F(m){return Array.isArray(m)||E.isTypedArray(m)}function O(m){if(typeof m.length=="number")return m.length;if(typeof m.size=="number")return m.size}function D(m){var t=O(m),o=typeof t=="number"?new Array(t):[],v=0;return T(m,function(a){o[v++]=a}),o}function c(m){var t=O(m),o=typeof t=="number"?E.getPointerArray(t):Array,v=typeof t=="number"?new Array(t):[],a=typeof t=="number"?new o(t):[],r=0;return T(m,function(n){v[r]=n,a[r]=r++}),[v,a]}S.isArrayLike=F,S.guessLength=O,S.toArray=D,S.toArrayWithIndices=c}),sh=Lt((S,T)=>{var E=ue(),F=Zr(),O=Ke(),D=F.DEFAULT_COMPARATOR,c=F.reverseComparator;function m(f,u,d,p){for(var g=u[p],y,x;p>d;){if(y=p-1>>1,x=u[y],f(g,x)<0){u[p]=x,p=y;continue}break}u[p]=g}function t(f,u,d){for(var p=u.length,g=d,y=u[d],x=2*d+1,C;x=0&&(x=C),u[d]=u[x],d=x,x=2*d+1;u[d]=y,m(f,u,g,d)}function o(f,u,d){u.push(d),m(f,u,0,u.length-1)}function v(f,u){var d=u.pop();if(u.length!==0){var p=u[0];return u[0]=d,t(f,u,0),p}return d}function a(f,u,d){if(u.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var p=u[0];return u[0]=d,t(f,u,0),p}function r(f,u,d){var p;return u.length!==0&&f(u[0],d)<0&&(p=u[0],u[0]=d,d=p,t(f,u,0)),d}function n(f,u){for(var d=u.length,p=d>>1,g=p;--g>=0;)t(f,u,g)}function e(f,u){for(var d=u.length,p=0,g=new Array(d);p=d.length)return d.slice().sort(f);for(P=d.slice(0,u),n(p,P),g=u,y=d.length;g0&&a(p,P,d[g]);return P.sort(f)}var M=O.guessLength(d);return M!==null&&M0&&a(p,P,w)),g++}),P.length>g&&(P.length=g),P.sort(f)}function h(f,u,d){arguments.length===2&&(d=u,u=f,f=D);var p=c(f),g,y,x,C=-1/0,P;if(u===1){if(O.isArrayLike(d)){for(g=0,y=d.length;g0)&&(C=x);return P=new d.constructor(1),P[0]=C,P}return E(d,function(w){(C===-1/0||f(w,C)>0)&&(C=w)}),[C]}if(O.isArrayLike(d)){if(u>=d.length)return d.slice().sort(p);for(P=d.slice(0,u),n(f,P),g=u,y=d.length;g0&&a(f,P,d[g]);return P.sort(p)}var M=O.guessLength(d);return M!==null&&M0&&a(f,P,w)),g++}),P.length>g&&(P.length=g),P.sort(p)}function s(f){if(this.clear(),this.comparator=f||D,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}s.prototype.clear=function(){this.items=[],this.size=0},s.prototype.push=function(f){return o(this.comparator,this.items,f),++this.size},s.prototype.peek=function(){return this.items[0]},s.prototype.pop=function(){return this.size!==0&&this.size--,v(this.comparator,this.items)},s.prototype.replace=function(f){return a(this.comparator,this.items,f)},s.prototype.pushpop=function(f){return r(this.comparator,this.items,f)},s.prototype.consume=function(){return this.size=0,e(this.comparator,this.items)},s.prototype.toArray=function(){return e(this.comparator,this.items.slice())},s.prototype.inspect=function(){var f=this.toArray();return Object.defineProperty(f,"constructor",{value:s,enumerable:!1}),f},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect);function l(f){if(this.clear(),this.comparator=f||D,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=c(this.comparator)}l.prototype=s.prototype,s.from=function(f,u){var d=new s(u),p;return O.isArrayLike(f)?p=f.slice():p=O.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},l.from=function(f,u){var d=new l(u),p;return O.isArrayLike(f)?p=f.slice():p=O.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},s.siftUp=t,s.siftDown=m,s.push=o,s.pop=v,s.replace=a,s.pushpop=r,s.heapify=n,s.consume=e,s.nsmallest=i,s.nlargest=h,s.MinHeap=s,s.MaxHeap=l,T.exports=s}),TT=Lt((S,T)=>{var E="";function F(o,v,a){for(var r=v.length,n=[],e=r,i=-1,h,s=0,l;e--;)i=Math.max(o[v[e]+a],i);for(l=i>>24&&32||i>>16&&24||i>>8&&16||8;s>s&15].push(v[e]);for(h=0;h<16;h++)for(i=n[h].length;i--;)v[++e]=n[h][i]}}function O(o,v,a,r){return o[a]-o[r]||(a%3===2?o[a+1]-o[r+1]||v[a+2]-v[r+2]:v[a+1]-v[r+1])}function D(o,v){var a=[],r=[],n=2*v/3|0,e=v-n,i=n+1>>1,h=n,s=0,l,f=[],u=[];if(v===1)return[0];for(;h--;)a[h]=(h*3>>1)+1;for(h=3;h--;)F(o,a,h);for(s=r[(a[0]/3|0)+(a[0]%3===1?0:i)]=1,h=1;hthis.firstLength&&e>this.firstLength)){for(v=Math.min(this.length-n,this.length-e),r=0;ro.length&&(o=this.text.slice(n,n+v))}return o},t.prototype.toString=function(){return this.array.join(",")},t.prototype.toJSON=function(){return this.array},t.prototype.inspect=function(){for(var o=new Array(this.length),v=0;v{var E=ue();function F(o){this.size=0,this.items=new Map,this.inverse=o}function O(){this.size=0,this.items=new Map,this.inverse=new F(this)}function D(){this.size=0,this.items.clear(),this.inverse.items.clear()}O.prototype.clear=D,F.prototype.clear=D;function c(o,v){if(this.items.has(o)){var a=this.items.get(o);if(a===v)return this;this.inverse.items.delete(a)}if(this.inverse.items.has(v)){var r=this.inverse.items.get(v);if(r===o)return this;this.items.delete(r)}return this.items.set(o,v),this.inverse.items.set(v,o),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}O.prototype.set=c,F.prototype.set=c;function m(o){if(this.items.has(o)){var v=this.items.get(o);return this.items.delete(o),this.inverse.items.delete(v),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}O.prototype.delete=m,F.prototype.delete=m;var t=["has","get","forEach","keys","values","entries"];t.forEach(function(o){O.prototype[o]=F.prototype[o]=function(){return Map.prototype[o].apply(this.items,arguments)}}),typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.entries,F.prototype[Symbol.iterator]=F.prototype.entries),O.prototype.inspect=function(){var o={left:this.items,right:this.inverse.items};return Object.defineProperty(o,"constructor",{value:O,enumerable:!1}),o},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),F.prototype.inspect=function(){var o={left:this.inverse.items,right:this.items};return Object.defineProperty(o,"constructor",{value:F,enumerable:!1}),o},typeof Symbol<"u"&&(F.prototype[Symbol.for("nodejs.util.inspect.custom")]=F.prototype.inspect),O.from=function(o){var v=new O;return E(o,function(a,r){v.set(r,a)}),v},T.exports=O}),Me=Lt((S,T)=>{function E(F){if(typeof F!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=F}typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=function(){return this}),E.of=function(){var F=arguments,O=F.length,D=0;return new E(function(){return D>=O?{done:!0}:{done:!1,value:F[D++]}})},E.empty=function(){var F=new E(function(){return{done:!0}});return F},E.fromSequence=function(F){var O=0,D=F.length;return new E(function(){return O>=D?{done:!0}:{done:!1,value:F[O++]}})},E.is=function(F){return F instanceof E?!0:typeof F=="object"&&F!==null&&typeof F.next=="function"},T.exports=E}),td=Lt(S=>{function T(c){return c|=c>>1,c|=c>>2,c|=c>>4,c|=c>>8,c|=c>>16,c&~(c>>1)}S.msb32=T;function E(c){return c|=c>>1,c|=c>>2,c|=c>>4,c&~(c>>1)}S.msb8=E,S.test=function(c,m){return c>>m&1},S.criticalBit8=function(c,m){return E(c^m)},S.criticalBit8Mask=function(c,m){return~E(c^m)>>>0&255},S.testCriticalBit8=function(c,m){return 1+(c|m)>>8},S.criticalBit32Mask=function(c,m){return~T(c^m)>>>0&4294967295},S.popcount=function(c){return c-=c>>1&1431655765,c=(c&858993459)+(c>>2&858993459),c=c+(c>>4)&252645135,c+=c>>8,c+=c>>16,c&127};var F=new Uint8Array(Math.pow(2,8));for(O=0,D=F.length;O>8&255]+F[c>>16&255]+F[c>>24&255]}}),CT=Lt((S,T)=>{var E=Me(),F=td();function O(D){this.length=D,this.clear()}O.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},O.prototype.set=function(D,c){var m=D>>5,t=D&31,o=this.array[m],v;return c===0||c===!1?v=this.array[m]&=~(1<>>0,v>o?this.size++:v>5,m=D&31,t=this.array[c],o;return o=this.array[c]&=~(1<>5,m=D&31,t=this.array[c],o=this.array[c]^=1<>>0,o>t?this.size++:o>5,m=D&31;return this.array[c]>>m&1},O.prototype.test=function(D){return!!this.get(D)},O.prototype.rank=function(D){if(this.size===0)return 0;for(var c=D>>5,m=D&31,t=0,o=0;o=this.length)return-1;for(var c,m=32,t=0,o=0,v=0,a=this.array.length;v>r&1,o===D)return t}},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.length,t,o,v=32,a=0,r=this.array.length;a>n&1,D.call(c,o,a*32+n)}},O.prototype.values=function(){var D=this.length,c=!1,m,t,o=this.array,v=o.length,a=0,r=-1,n=32;return new E(function e(){if(!c){if(a>=v)return{done:!0};a===v-1&&(n=D%32||32),m=o[a++],c=!0,r=-1}return r++,r>=n?(c=!1,e()):(t=m>>r&1,{value:t})})},O.prototype.entries=function(){var D=this.length,c=!1,m,t,o=this.array,v,a=o.length,r=0,n=-1,e=32;return new E(function i(){if(!c){if(r>=a)return{done:!0};r===a-1&&(e=D%32||32),m=o[r++],c=!0,n=-1}return n++,v=~-r*32+n,n>=e?(c=!1,i()):(t=m>>n&1,{value:[v,t]})})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=new Uint8Array(this.length);return this.forEach(function(c,m){D[m]=c}),Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.prototype.toJSON=function(){return Array.from(this.array)},T.exports=O}),ET=Lt((S,T)=>{var E=Me(),F=td(),O=function(m){return Math.max(1,Math.ceil(m*1.5))};function D(m){return new Uint32Array(Math.ceil(m/32))}function c(m){var t=m||0,o=O;typeof m=="object"&&(t=m.initialLength||m.initialCapacity||0,o=m.policy||o),this.size=0,this.length=t,this.capacity=Math.ceil(this.length/32)*32,this.policy=o,this.array=D(this.capacity)}c.prototype.set=function(m,t){if(this.length>5,v=m&31,a=this.array[o],r;return t===0||t===!1?r=this.array[o]&=~(1<>>0,r>a?this.size++:r>5,o=m&31,v=this.array[t],a;return a=this.array[t]&=~(1<>5,o=m&31,v=this.array[t],a=this.array[t]^=1<>>0,a>v?this.size++:athis.array.length?(this.array=new Uint32Array(v),this.array.set(o,0)):this.array=o.slice(0,v),this.capacity=m,this)},c.prototype.grow=function(m){var t;if(typeof m=="number"){if(this.capacity>=m)return this;for(t=this.capacity;t>5,v=t&31;return this.array[o]|=1<>5,o=m&31;return this.array[t]>>o&1}},c.prototype.get=function(m){if(!(this.length>5,o=m&31;return this.array[t]>>o&1}},c.prototype.test=function(m){return this.length>5,o=m&31,v=0,a=0;a=this.length)return-1;for(var t,o=32,v=0,a=0,r=0,n=this.array.length;r>e&1,a===m)return v}},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;for(var o=this.length,v,a,r=32,n=0,e=this.array.length;n>i&1,m.call(t,a,n*32+i)}},c.prototype.values=function(){var m=this.length,t=!1,o,v,a=this.array,r=a.length,n=0,e=-1,i=32;return new E(function h(){if(!t){if(n>=r)return{done:!0};n===r-1&&(i=m%32||32),o=a[n++],t=!0,e=-1}return e++,e>=i?(t=!1,h()):(v=o>>e&1,{value:v})})},c.prototype.entries=function(){var m=this.length,t=!1,o,v,a=this.array,r,n=a.length,e=0,i=-1,h=32;return new E(function s(){if(!t){if(e>=n)return{done:!0};e===n-1&&(h=m%32||32),o=a[e++],t=!0,i=-1}return i++,r=~-e*32+i,i>=h?(t=!1,s()):(v=o>>i&1,{value:[r,v]})})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){var m=new Uint8Array(this.length);return this.forEach(function(t,o){m[o]=t}),Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},T.exports=c}),PT=Lt((S,T)=>{function E(D,c){return(D&65535)*c+(((D>>>16)*c&65535)<<16)&4294967295}function F(D,c){return(D&65535)+(c>>>16)+(((D>>>16)+c&65535)<<16)&4294967295}function O(D,c){return D<>>32-c}T.exports=function(D,c){var m=3432918353,t=461845907,o=15,v=13,a=5,r=1801774676,n=D,e,i,h;for(i=0,h=c.length-4;i<=h;i+=4)e=c[i]|c[i+1]<<8|c[i+2]<<16|c[i+3]<<24,e=E(e,m),e=O(e,o),e=E(e,t),n^=e,n=O(n,v),n=E(n,a),n=F(n,r);switch(e=0,c.length&3){case 3:e^=c[i+2]<<16;case 2:e^=c[i+1]<<8;case 1:e^=c[i],e=E(e,m),e=O(e,o),e=E(e,t),n^=e}return n^=c.length,n^=n>>>16,n=E(n,2246822507),n^=n>>>13,n=E(n,3266489909),n^=n>>>16,n>>>0}}),AT=Lt((S,T)=>{var E=PT(),F=ue(),O=Math.LN2*Math.LN2,D={errorRate:.005};function c(o){var v=new Uint16Array(o.length),a,r;for(a=0,r=o.length;a>3]|=e}return this},t.prototype.test=function(o){for(var v=c(o),a=0,r=this.hashFunctions;a>3]&1<<(7&n)))return!1}return!0},t.prototype.toJSON=function(){return this.data},t.from=function(o,v){if(!v&&(v=o.length||o.size,typeof v!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var a=new t(v);return F(o,function(r){a.add(r)}),a},T.exports=t}),MT=Lt((S,T)=>{var E=ue();function F(O){if(typeof O!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=O,this.clear()}F.prototype.add=function(O){if(!this.root)return this.root={item:O,children:{}},this.size++,this;for(var D=this.root,c;c=this.distance(O,D.item),!!D.children[c];)D=D.children[c];return D.children[c]={item:O,children:{}},this.size++,this},F.prototype.search=function(O,D){if(!this.root)return[];for(var c=[],m=[this.root],t,o,v,a,r;m.length;)for(t=m.pop(),v=this.distance(D,t.item),v<=O&&c.push({item:t.item,distance:v}),a=v-O,r=v+O+1;a{var E=Ke(),F=Me();function O(D,c){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=D,this.capacity=c,this.items=new D(this.capacity),this.clear()}O.prototype.clear=function(){this.start=0,this.size=0},O.prototype.push=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var c=this.start+this.size;return c>=this.capacity&&(c-=this.capacity),this.items[c]=D,++this.size},O.prototype.unshift=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var c=this.start-1;return this.start===0&&(c=this.capacity-1),this.items[c]=D,this.start=c,++this.size},O.prototype.pop=function(){if(this.size!==0){this.size--;var D=this.start+this.size;return D>=this.capacity&&(D-=this.capacity),this.items[D]}},O.prototype.shift=function(){if(this.size!==0){var D=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[D]}},O.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},O.prototype.peekLast=function(){if(this.size!==0){var D=this.start+this.size-1;return D>=this.capacity&&(D-=this.capacity),this.items[D]}},O.prototype.get=function(D){if(!(this.size===0||D>=this.capacity))return D=this.start+D,D>=this.capacity&&(D-=this.capacity),this.items[D]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.capacity,t=this.size,o=this.start,v=0;v=m)return{done:!0};var v=D[t];return t++,o++,t===c&&(t=0),{value:v,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.capacity,m=this.size,t=this.start,o=0;return new F(function(){if(o>=m)return{done:!0};var v=D[t];return t++,t===c&&(t=0),{value:[o++,v],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=this.toArray();return D.type=this.ArrayClass.name,D.capacity=this.capacity,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){if(arguments.length<3&&(m=E.guessLength(D),typeof m!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new O(c,m);if(E.isArrayLike(D)){var o,v;for(o=0,v=D.length;o{var E=Ke(),F=ed();function O(c,m){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof m!="number"||m<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=c,this.capacity=m,this.items=new c(this.capacity),this.clear()}function D(c){O.prototype[c]=F.prototype[c]}Object.keys(F.prototype).forEach(D),typeof Symbol<"u"&&Object.getOwnPropertySymbols(F.prototype).forEach(D),O.prototype.push=function(c){var m=this.start+this.size;return m>=this.capacity&&(m-=this.capacity),this.items[m]=c,this.size===this.capacity?(m++,m>=this.capacity?this.start=0:this.start=m,this.size):++this.size},O.prototype.unshift=function(c){var m=this.start-1;return this.start===0&&(m=this.capacity-1),this.items[m]=c,this.size===this.capacity?(this.start=m,this.size):(this.start=m,++this.size)},O.from=function(c,m,t){if(arguments.length<3&&(t=E.guessLength(c),typeof t!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var o=new O(m,t);if(E.isArrayLike(c)){var v,a;for(v=0,a=c.length;v{function E(F){if(typeof F!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=F,this.size=0}E.prototype.clear=function(){this.items.clear(),this.size=0},E.prototype.get=function(F){var O=this.items.get(F);return typeof O>"u"&&(O=this.factory(F,this.size),this.items.set(F,O),this.size++),O},E.prototype.peek=function(F){return this.items.get(F)},E.prototype.set=function(F,O){return this.items.set(F,O),this.size=this.items.size,this},E.prototype.has=function(F){return this.items.has(F)},E.prototype.delete=function(F){var O=this.items.delete(F);return this.size=this.items.size,O},E.prototype.forEach=function(F,O){O=arguments.length>1?O:this,this.items.forEach(F,O)},E.prototype.entries=function(){return this.items.entries()},E.prototype.keys=function(){return this.items.keys()},E.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.entries),E.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.autoIncrement=function(){var F=0;return function(){return F++}},T.exports=E}),FT=Lt((S,T)=>{function E(F){if(typeof F!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=F}E.prototype.clear=function(){this.items=new WeakMap},E.prototype.get=function(F){var O=this.items.get(F);return typeof O>"u"&&(O=this.factory(F),this.items.set(F,O)),O},E.prototype.peek=function(F){return this.items.get(F)},E.prototype.set=function(F,O){return this.items.set(F,O),this},E.prototype.has=function(F){return this.items.has(F)},E.prototype.delete=function(F){return this.items.delete(F)},E.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),T.exports=E}),LT=Lt((S,T)=>{var E=Ge();function F(O){var D=E.getPointerArray(O),c=E.getPointerArray(Math.log2(O));this.size=O,this.dimension=O,this.parents=new D(O),this.ranks=new c(O);for(var m=0;mo?this.parents[m]=c:(this.parents[m]=c,this.ranks[c]++),this},F.prototype.connected=function(O,D){var c=this.find(O);return c===this.find(D)},F.prototype.mapping=function(){for(var O=E.getPointerArray(this.dimension),D={},c=new O(this.size),m=0,t,o=0,v=this.parents.length;o"u"?(c[o]=m,D[t]=m++):c[o]=D[t];return c},F.prototype.compile=function(){for(var O={},D=new Array(this.dimension),c=0,m,t=0,o=this.parents.length;t"u"?(D[c]=[t],O[m]=c++):D[O[m]].push(t);return D},F.prototype.inspect=function(){var O=this.compile();return Object.defineProperty(O,"constructor",{value:F,enumerable:!1}),O},typeof Symbol<"u"&&(F.prototype[Symbol.for("nodejs.util.inspect.custom")]=F.prototype.inspect),T.exports=F}),nh=Lt((S,T)=>{var E=Zr(),F=sh(),O=E.DEFAULT_COMPARATOR,D=E.reverseComparator;function c(o,v,a,r){for(var n=a,e=r,i=v[r],h=2*r+1,s;h=0&&(h=s),v[r]=v[h],r=h,h=2*r+1;v[r]=i,F.siftDown(o,v,e,r)}function m(o,v,a,r){for(var n=r,e=n,i=new o(r),h,s;e>0;)h=a[--e],e!==0&&(s=a[0],a[0]=h,c(v,a,--r,0),h=s),i[e]=h;return i}function t(o,v,a){if(arguments.length===2&&(a=v,v=null),this.ArrayClass=o,this.capacity=a,this.items=new o(a),this.clear(),this.comparator=v||O,typeof a!="number"&&a<=0)throw new Error("mnemonist/FixedReverseHeap.constructor: capacity should be a number > 0.");if(typeof this.comparator!="function")throw new Error("mnemonist/FixedReverseHeap.constructor: given comparator should be a function.");this.comparator=D(this.comparator)}t.prototype.clear=function(){this.size=0},t.prototype.push=function(o){return this.size0&&F.replace(this.comparator,this.items,o),this.size},t.prototype.peek=function(){return this.items[0]},t.prototype.consume=function(){var o=m(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,o},t.prototype.toArray=function(){return m(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},t.prototype.inspect=function(){var o=this.toArray();return Object.defineProperty(o,"constructor",{value:t,enumerable:!1}),o},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),T.exports=t}),OT=Lt((S,T)=>{var E=ue(),F=function(D){return D};function O(D){if(this.items=new Map,this.clear(),Array.isArray(D)?(this.writeHashFunction=D[0],this.readHashFunction=D[1]):(this.writeHashFunction=D,this.readHashFunction=D),this.writeHashFunction||(this.writeHashFunction=F),this.readHashFunction||(this.readHashFunction=F),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.")}O.prototype.clear=function(){this.items.clear(),this.size=0},O.prototype.add=function(D){var c=this.writeHashFunction(D);return this.items.set(c,D),this.size=this.items.size,this},O.prototype.set=function(D,c){return D=this.writeHashFunction(D),this.items.set(D,c),this.size=this.items.size,this},O.prototype.get=function(D){return D=this.readHashFunction(D),this.items.get(D)},O.prototype.has=function(D){return D=this.readHashFunction(D),this.items.has(D)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this,this.items.forEach(function(m){D.call(c,m,m)})},O.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=Array.from(this.items.values());return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){var t=new O(c);return E(D,function(o,v){m?t.set(v,o):t.add(o)}),t},T.exports=O}),id=Lt((S,T)=>{var E=Me(),F=ue();function O(D){this.Container=D||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:O,enumerable:!1})}O.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},O.prototype.set=function(D,c){var m=this.items.get(D),t;return m||(this.dimension++,m=new this.Container,this.items.set(D,m)),this.Container===Set?(t=m.size,m.add(c),t"u"?0:this.Container===Set?c.size:c.length},O.prototype.count=O.prototype.multiplicity,O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;var m;function t(o){D.call(c,o,m)}this.items.forEach(function(o,v){m=v,o.forEach(t)})},O.prototype.forEachAssociation=function(D,c){c=arguments.length>1?c:this,this.items.forEach(D,c)},O.prototype.keys=function(){return this.items.keys()},O.prototype.values=function(){var D=this.items.values(),c=!1,m,t,o,v;return this.Container===Set?new E(function a(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,m=t.value.values()}return t=m.next(),t.done?(c=!1,a()):{done:!1,value:t.value}}):new E(function a(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,m=t.value,o=0,v=m.length}return o>=v?(c=!1,a()):{done:!1,value:m[o++]}})},O.prototype.entries=function(){var D=this.items.entries(),c=!1,m,t,o,v,a;return this.Container===Set?new E(function r(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,o=t.value[0],m=t.value[1].values()}return t=m.next(),t.done?(c=!1,r()):{done:!1,value:[o,t.value]}}):new E(function r(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,o=t.value[0],m=t.value[1],v=0,a=m.length}return v>=a?(c=!1,r()):{done:!1,value:[o,m[v++]]}})},O.prototype.containers=function(){return this.items.values()},O.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.entries),O.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.prototype.toJSON=function(){return this.items},O.from=function(D,c){var m=new O(c);return F(D,function(t,o){m.set(o,t)}),m},T.exports=O}),DT=Lt((S,T)=>{var E=id(),F=ue(),O=function(c){return c};function D(c,m){if(this.items=new E(m),this.clear(),Array.isArray(c)?(this.writeHashFunction=c[0],this.readHashFunction=c[1]):(this.writeHashFunction=c,this.readHashFunction=c),this.writeHashFunction||(this.writeHashFunction=O),this.readHashFunction||(this.readHashFunction=O),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.")}D.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},D.prototype.add=function(c){var m=this.writeHashFunction(c);return this.items.set(m,c),this.size=this.items.size,this.dimension=this.items.dimension,this},D.prototype.set=function(c,m){return c=this.writeHashFunction(c),this.items.set(c,m),this.size=this.items.size,this.dimension=this.items.dimension,this},D.prototype.get=function(c){return c=this.readHashFunction(c),this.items.get(c)},D.prototype.has=function(c){return c=this.readHashFunction(c),this.items.has(c)},D.prototype.forEach=function(c,m){m=arguments.length>1?m:this,this.items.forEach(function(t){c.call(m,t,t)})},D.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.values),D.prototype.inspect=function(){var c=Array.from(this);return Object.defineProperty(c,"constructor",{value:D,enumerable:!1}),c},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.from=function(c,m,t,o){arguments.length===3&&typeof t=="boolean"&&(o=t,t=Array);var v=new D(m,t);return F(c,function(a,r){o?v.set(r,a):v.add(a)}),v},T.exports=D}),IT=Lt((S,T)=>{var E=1024;function F(D){return(D&D-1)===0}function O(D,c){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var m=c||0,t=E,o=0;if(typeof c=="object"&&(m=c.initialCapacity||0,o=c.initialLength||0,t=c.blockSize||E),!t||!F(t))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var v=Math.max(o,m),a=Math.ceil(v/t);this.ArrayClass=D,this.length=o,this.capacity=a*t,this.blockSize=t,this.offsetMask=t-1,this.blockMask=Math.log2(t),this.blocks=new Array(a);for(var r=0;r>this.blockMask,t=D&this.offsetMask;return this.blocks[m][t]=c,this},O.prototype.get=function(D){if(!(this.length>this.blockMask,m=D&this.offsetMask;return this.blocks[c][m]}},O.prototype.grow=function(D){if(typeof D!="number"&&(D=this.capacity+this.blockSize),this.capacity>=D)return this;for(;this.capacity>this.blockMask,t=c&this.offsetMask;return this.blocks[m][t]=D,++this.length},O.prototype.pop=function(){if(this.length!==0){var D=this.blocks[this.blocks.length-1],c=--this.length&this.offsetMask;return D[c]}},O.prototype.inspect=function(){for(var D=new this.ArrayClass(this.length),c,m=0,t=this.length;m>this.blockMask,D[m]=this.blocks[c][m&this.offsetMask];return D.type=this.ArrayClass.name,D.items=this.length,D.capacity=this.capacity,D.blockSize=this.blockSize,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),T.exports=O}),sd=Lt((S,T)=>{var E=Me(),F=Ke();function O(D,c){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=c,this.ArrayClass=D,this.items=new this.ArrayClass(this.capacity),this.clear()}O.prototype.clear=function(){this.size=0},O.prototype.push=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=D,this.size},O.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},O.prototype.peek=function(){return this.items[this.size-1]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=D[c-m-1];return m++,{value:t,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.size,m=0;return new E(function(){if(m>=c)return{done:!0};var t=D[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return D.type=this.ArrayClass.name,D.capacity=this.capacity,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){if(arguments.length<3&&(m=F.guessLength(D),typeof m!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new O(c,m);if(F.isArrayLike(D)){var o,v;for(o=0,v=D.length;o{var E=Ke(),F=Ge(),O=sd();function D(m,t,o,v,a,r,n,e){var i=n+(e-n)/2|0,h=~-i,s=-~i,l=o[i];v[r]=l+1;var f=t?t(m[l]):m[l][1],u=r*2+1,d=r*2+2,p=-1/0,g=-1/0;n<=h&&(p=D(m,t,o,v,a,u,n,h)),s<=e&&(g=D(m,t,o,v,a,d,s,e));var y=Math.max(f,p,g),x=l;return y===p?x=a[v[u]-1]:y===g&&(x=a[v[d]-1]),a[l]=x,y}function c(m,t){this.size=m.length,this.intervals=m;var o=null,v=null;Array.isArray(t)&&(o=t[0],v=t[1]);var a=m.length,r=F.getPointerArray(a+1),n=new r(a),e;for(e=1;eu?1:0});var i=Math.ceil(Math.log2(a+1)),h=Math.pow(2,i)-1,s=new r(h),l=new r(a);D(m,v,n,s,l,0,0,a-1),n=null,this.height=i,this.tree=s,this.augmentations=l,this.startGetter=o,this.endGetter=v,this.stack=new O(r,this.height)}c.prototype.intervalsContainingPoint=function(m){var t=[],o=this.stack;o.clear(),o.push(0);for(var v=this.tree.length,a,r,n,e,i,h,s,l,f;o.size;)a=o.pop(),r=this.tree[a]-1,n=this.intervals[r],e=this.intervals[this.augmentations[r]],s=this.endGetter?this.endGetter(e):e[1],!(m>s)&&(l=a*2+1,l=i&&m<=h&&t.push(n),!(mf)&&(u=n*2+1,u=s&&t<=l&&v.push(i),!(o{S.search=function(T,E,F,O){var D=0;F=typeof F<"u"?F:0,O=typeof O<"u"?O:T.length,O--;for(var c;F<=O;)if(D=F+O>>>1,c=T[D],c>E)O=~-D;else if(c>>1,m=T(E[O],F),m>0)c=~-O;else if(m<0)D=-~O;else return O;return-1},S.lowerBound=function(T,E,F,O){var D=0;for(F=typeof F<"u"?F:0,O=typeof O<"u"?O:T.length;F>>1,E<=T[D]?O=D:F=-~D;return F},S.lowerBoundWithComparator=function(T,E,F){for(var O=0,D=0,c=E.length;D>>1,T(F,E[O])<=0?c=O:D=-~O;return D},S.lowerBoundIndices=function(T,E,F,O,D){var c=0;for(O=typeof O<"u"?O:0,D=typeof D<"u"?D:T.length;O>>1,F<=T[E[c]]?D=c:O=-~c;return O},S.upperBound=function(T,E,F,O){var D=0;for(F=typeof F<"u"?F:0,O=typeof O<"u"?O:T.length;F>>1,E>=T[D]?F=-~D:O=D;return F},S.upperBoundWithComparator=function(T,E,F){for(var O=0,D=0,c=E.length;D>>1,T(F,E[O])>=0?D=-~O:c=O;return D}}),bT=Lt(S=>{var T=Ge(),E=Ke().isArrayLike,F=nd(),O=ih();function D(o,v){if(o.length===0)return v.slice();if(v.length===0)return o.slice();var a;o[0]>v[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(r<=n)return T.isTypedArray(o)?T.concat(o,v):o.concat(v);var e=new o.constructor(o.length+v.length),i,h,s;for(i=0,h=o.length;iv[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(rv[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(ru?s=F.lowerBound(v,f,s+1):(e.push(f),i++,s++);return e};function m(o){var v=0,a=-1/0,r,n,e,i=[];for(n=0,e=o.length;na&&(a=r));if(i.length===0)return new o[0].constructor(0);if(i.length===1)return i[0].slice();if(i.length===2)return D(i[0],i[1]);o=i;var h=new o[0].constructor(v),s=T.getPointerArray(a),l=new s(o.length),f=new O(function(p,g){return p=o[p][l[p]],g=o[g][l[g]],pg?1:0});for(n=0;nv&&(v=a));if(e.length===0)return new o[0].constructor(0);if(e.length===1)return e[0].slice();if(e.length===2)return c(e[0],e[1]);o=e;var i=new o[0].constructor,h=T.getPointerArray(v),s=new h(o.length),l=new O(function(d,p){return d=o[d][s[d]],p=o[p][s[p]],dp?1:0});for(r=0;rv&&(v=r),na)return[];if(v===a)return[v];var s,l,f=o[0],u,d,p,g,y,x,C=v;for(i=1;ix?d=F.lowerBound(l,y,d+1):(f.push(y),u++,d++);if(f.length===0)return f;C=f[0]}return f},S.merge=function(){if(arguments.length===2){if(E(arguments[0]))return D(arguments[0],arguments[1])}else if(E(arguments[0]))return m(arguments);return null},S.unionUnique=function(){if(arguments.length===2){if(E(arguments[0]))return c(arguments[0],arguments[1])}else if(E(arguments[0]))return t(arguments);return null},S.intersectionUnique=function(){if(arguments.length===2){if(E(arguments[0]))return S.intersectionUniqueArrays(arguments[0],arguments[1])}else if(E(arguments[0]))return S.kWayIntersectionUniqueArrays(arguments);return null}}),NT=Lt((S,T)=>{var E=Me(),F=ue(),O=bT();function D(m){return m}function c(m){if(this.clear(),Array.isArray(m)?(this.documentTokenizer=m[0],this.queryTokenizer=m[1]):(this.documentTokenizer=m,this.queryTokenizer=m),this.documentTokenizer||(this.documentTokenizer=D),this.queryTokenizer||(this.queryTokenizer=D),typeof this.documentTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: document tokenizer is not a function.");if(typeof this.queryTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: query tokenizer is not a function.")}c.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},c.prototype.add=function(m){this.size++;var t=this.items.length;this.items.push(m);var o=this.documentTokenizer(m);if(!Array.isArray(o))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var v=new Set,a,r,n=0,e=o.length;n"u"||o.length===0)return[];if(t.length>1)for(a=1,r=t.length;a"u"||v.length===0)return[];o=O.intersectionUniqueArrays(o,v)}var n=new Array(o.length);for(a=0,r=n.length;a1?t:this;for(var o=0,v=this.documents.length;o=t)return{done:!0};var v=m[o++];return{value:v,done:!1}})},c.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.documents),c.prototype.inspect=function(){var m=this.items.slice();return Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(m,t){var o=new c(t);return F(m,function(v){o.add(v)}),o},T.exports=c}),rd=Lt(S=>{var T=new Float64Array(64),E=new Float64Array(64);function F(D,c,m){var t,o,v,a,r;for(T[0]=c,E[0]=m,o=0;o>=0;)if(v=T[o],a=E[o]-1,v=t&&vE[o-1]-T[o-1]&&(r=T[o],T[o]=T[o-1],T[o-1]=r,r=E[o],E[o]=E[o-1],E[o-1]=r)}else o--;return D}S.inplaceQuickSort=F;function O(D,c,m,t){var o,v,a,r,n,e;for(T[0]=m,E[0]=t,v=0;v>=0;)if(a=T[v],r=E[v]-1,a=o&&aE[v-1]-T[v-1]&&(e=T[v],T[v]=T[v-1],T[v-1]=e,e=E[v],E[v]=E[v-1],E[v-1]=e)}else v--;return c}S.inplaceQuickSortIndices=O}),GT=Lt((S,T)=>{var E=Ke(),F=Ge(),O=Zr().createTupleComparator,D=nh(),c=rd().inplaceQuickSortIndices;function m(n,e,i,h){var s,l=0,f;for(s=0;s>>1),P=i[C],f[L]=P,y>-1&&(x===0?u[y]=L+1:d[y]=L+1),I=(I+1)%n,C!==M&&C!==w-1&&p.push([I,C+1,w,L,1]),C!==M&&p.push([I,M,C,L,0]),L++;return{axes:e,labels:h,pivots:f,lefts:u,rights:d}}function v(n,e){this.dimensions=n,this.visited=0,this.axes=e.axes,this.labels=e.labels,this.pivots=e.pivots,this.lefts=e.lefts,this.rights=e.rights,this.size=this.labels.length}v.prototype.nearestNeighbor=function(n){var e=1/0,i=null,h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(g,y){d++;var x=f[y],C=u[y],P=l[y],M=m(h,s,P,n);if(!(M0?x!==0&&p(g,x-1):C!==0&&p(g,C-1),w*w0?C!==0&&p(g,C-1):x!==0&&p(g,x-1))}}return p(0,0),this.visited=d,this.labels[i]};var a=O(3),r=O(2);v.prototype.kNearestNeighbors=function(n,e){if(n<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(n=Math.min(n,this.size),n===1)return[this.nearestNeighbor(e)];var i=new D(Array,a,n),h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(x,C){var P=f[C],M=u[C],w=l[C],I=m(h,s,w,e);i.push([I,d++,w]);var L=e[x],B=s[x][w],N=L-B;x=(x+1)%h,L{var E=Me(),F=ue();function O(){this.clear()}O.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},O.prototype.first=function(){return this.head?this.head.item:void 0},O.prototype.peek=O.prototype.first,O.prototype.last=function(){return this.tail?this.tail.item:void 0},O.prototype.push=function(D){var c={item:D,next:null};return this.head?(this.tail.next=c,this.tail=c):(this.head=c,this.tail=c),this.size++,this.size},O.prototype.unshift=function(D){var c={item:D,next:null};return this.head?(this.head.next||(this.tail=this.head),c.next=this.head,this.head=c):(this.head=c,this.tail=c),this.size++,this.size},O.prototype.shift=function(){if(this.size){var D=this.head;return this.head=D.next,this.size--,D.item}},O.prototype.forEach=function(D,c){if(this.size){c=arguments.length>1?c:this;for(var m=this.head,t=0;m;)D.call(c,m.item,t,this),m=m.next,t++}},O.prototype.toArray=function(){if(!this.size)return[];for(var D=new Array(this.size),c=0,m=this.size,t=this.head;c{var E=Me(),F=ue(),O=Ge(),D=Ke();function c(m,t,o){if(arguments.length<2&&(o=m,m=null,t=null),this.capacity=o,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var v=O.getPointerArray(o);this.forward=new v(o),this.backward=new v(o),this.K=typeof m=="function"?new m(o):new Array(o),this.V=typeof t=="function"?new t(o):new Array(o),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(m){var t=this.head;if(this.head===m)return this;var o=this.backward[m],v=this.forward[m];return this.tail===m?this.tail=o:this.backward[v]=o,this.forward[o]=v,this.backward[t]=m,this.head=m,this.forward[m]=t,this},c.prototype.set=function(m,t){var o=this.items[m];if(typeof o<"u"){this.splayOnTop(o),this.V[o]=t;return}this.size1?t:this;for(var o=0,v=this.size,a=this.head,r=this.K,n=this.V,e=this.forward;o=t)return{done:!0};var r=v[o];return m++,m=t)return{done:!0};var r=v[o];return m++,m=t)return{done:!0};var n=v[o],e=a[o];return m++,m{var E=rh(),F=ue(),O=Ge(),D=Ke();function c(t,o,v){arguments.length<2?E.call(this,t):E.call(this,t,o,v);var a=O.getPointerArray(this.capacity);this.deleted=new a(this.capacity),this.deletedSize=0}for(m in E.prototype)c.prototype[m]=E.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=E.prototype[Symbol.iterator]),c.prototype.clear=function(){E.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,o){var v=this.items[t];if(typeof v<"u"){this.splayOnTop(v),this.V[v]=o;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],delete this.items[this.K[v]]),this.items[t]=v,this.K[v]=t,this.V[v]=o,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,o){var v=null,a=null,r=this.items[t];return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=o,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],a=this.K[r],delete this.items[a]),this.items[t]=r,this.K[r]=t,this.V[r]=o,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,a?{evicted:!0,key:a,value:v}:null)},c.prototype.delete=function(t){var o=this.items[t];if(typeof o>"u")return!1;if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[o],a=this.forward[o];return this.head===o&&(this.head=a),this.tail===o&&(this.tail=v),this.forward[v]=a,this.backward[a]=v,this.size--,this.deleted[this.deletedSize++]=o,!0},c.prototype.remove=function(t,o=void 0){var v=this.items[t];if(typeof v>"u")return o;var a=this.V[v];if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,a;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,a},c.from=function(t,o,v,a){if(arguments.length<2){if(a=D.guessLength(t),typeof a!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(a=o,o=null,v=null);var r=new c(o,v,a);return F(t,function(n,e){r.set(e,n)}),r},T.exports=c}),ad=Lt((S,T)=>{var E=rh(),F=ue(),O=Ge(),D=Ke();function c(m,t,o){if(arguments.length<2&&(o=m,m=null,t=null),this.capacity=o,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var v=O.getPointerArray(o);this.forward=new v(o),this.backward=new v(o),this.K=typeof m=="function"?new m(o):new Array(o),this.V=typeof t=="function"?new t(o):new Array(o),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(m,t){var o=this.items.get(m);if(typeof o<"u"){this.splayOnTop(o),this.V[o]=t;return}this.size{var E=ad(),F=ue(),O=Ge(),D=Ke();function c(t,o,v){arguments.length<2?E.call(this,t):E.call(this,t,o,v);var a=O.getPointerArray(this.capacity);this.deleted=new a(this.capacity),this.deletedSize=0}for(m in E.prototype)c.prototype[m]=E.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=E.prototype[Symbol.iterator]),c.prototype.clear=function(){E.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,o){var v=this.items.get(t);if(typeof v<"u"){this.splayOnTop(v),this.V[v]=o;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],this.items.delete(this.K[v])),this.items.set(t,v),this.K[v]=t,this.V[v]=o,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,o){var v=null,a=null,r=this.items.get(t);return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=o,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],a=this.K[r],this.items.delete(a)),this.items.set(t,r),this.K[r]=t,this.V[r]=o,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,a?{evicted:!0,key:a,value:v}:null)},c.prototype.delete=function(t){var o=this.items.get(t);if(typeof o>"u")return!1;if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[o],a=this.forward[o];return this.head===o&&(this.head=a),this.tail===o&&(this.tail=v),this.forward[v]=a,this.backward[a]=v,this.size--,this.deleted[this.deletedSize++]=o,!0},c.prototype.remove=function(t,o=void 0){var v=this.items.get(t);if(typeof v>"u")return o;var a=this.V[v];if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,a;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,a},c.from=function(t,o,v,a){if(arguments.length<2){if(a=D.guessLength(t),typeof a!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(a=o,o=null,v=null);var r=new c(o,v,a);return F(t,function(n,e){r.set(e,n)}),r},T.exports=c}),VT=Lt((S,T)=>{var E=Me(),F=ue(),O=nh(),D=function(m,t){return m[1]>t[1]?-1:m[1]"u"?0:t},c.prototype.get=c.prototype.multiplicity,c.prototype.count=c.prototype.multiplicity,c.prototype.frequency=function(m){if(this.size===0)return 0;var t=this.multiplicity(m);return t/this.size},c.prototype.top=function(m){if(typeof m!="number"||m<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var t=new O(Array,D,m),o=this.items.entries(),v;v=o.next(),!v.done;)t.push(v.value);return t.consume()},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;var o;this.items.forEach(function(v,a){for(o=0;o1?t:this,this.items.forEach(m,t)},c.prototype.keys=function(){return this.items.keys()},c.prototype.values=function(){var m=this.items.entries(),t=!1,o,v,a,r;return new E(function n(){if(!t){if(o=m.next(),o.done)return{done:!0};t=!0,v=o.value[0],a=o.value[1],r=0}return r>=a?(t=!1,n()):(r++,{done:!1,value:v})})},c.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return this.items},c.from=function(m){var t=new c;return F(m,function(o){t.add(o)}),t},c.isSubset=function(m,t){var o=m.multiplicities(),v,a,r;if(m===t)return!0;if(m.dimension>t.dimension)return!1;for(;v=o.next(),!v.done;)if(a=v.value[0],r=v.value[1],t.multiplicity(a){var E=Me(),F=ue();function O(n,e,i){return((Math.pow(n,2)-Math.pow(Math.abs(e-i),2))/2|0)+n+1}function D(n,e){for(var i=0,h=0,s=e+1;he.length?-1:n.lengthe?1:0}function m(n,e){var i=n+1,h=e/i|0,s=h+1,l,f,u=e-h*i,d=i-u,p=new Array(n+1);for(l=0;l 0");this.levenshtein=n,this.k=e,this.clear()}r.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},r.prototype.add=function(n){var e=n.length,i=this.size;this.strings.push(n),this.size++;var h=t(this.k,n),s=this.invertedIndices[e];typeof s>"u"&&(s={},this.invertedIndices[e]=s);var l,f,u,d,p;for(d=0,p=h.length;d"u"?(f=[i],s[u]=f):f.push(i);return this},r.prototype.search=function(n){var e=n.length,i=this.k,h=new Set,s,l,f,u,d,p,g,y,x,C,P,M,w,I,L;for(y=Math.max(0,e-i),x=e+i+1;y1?e:this;for(var i=0,h=this.strings.length;i=e)return{done:!0};var h=n[i];return i++,{value:h,done:!1}})},typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=r.prototype.values),r.prototype.inspect=function(){var n=this.strings.slice();return Object.defineProperty(n,"constructor",{value:r,enumerable:!1}),n},typeof Symbol<"u"&&(r.prototype[Symbol.for("nodejs.util.inspect.custom")]=r.prototype.inspect),r.from=function(n,e,i){var h=new r(e,i);return F(n,function(s){h.add(s)}),h},r.countKeys=D,r.comparator=c,r.partition=m,r.segments=t,r.segmentPos=o,r.multiMatchAwareInterval=v,r.multiMatchAwareSubstrings=a,T.exports=r}),YT=Lt((S,T)=>{var E=Me(),F=ue();function O(){this.clear()}O.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},O.prototype.enqueue=function(D){return this.items.push(D),++this.size},O.prototype.dequeue=function(){if(this.size){var D=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,D}},O.prototype.peek=function(){if(this.size)return this.items[this.offset]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.offset,t=0,o=this.items.length;m=D.length)return{done:!0};var m=D[c];return c++,{value:m,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.offset,m=0;return new E(function(){if(c>=D.length)return{done:!0};var t=D[c];return c++,{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D){var c=new O;return F(D,function(m){c.enqueue(m)}),c},O.of=function(){return O.from(arguments)},T.exports=O}),HT=Lt((S,T)=>{var E=Me(),F=ue();function O(){this.clear()}O.prototype.clear=function(){this.items=[],this.size=0},O.prototype.push=function(D){return this.items.push(D),++this.size},O.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},O.prototype.peek=function(){return this.items[this.size-1]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=D[c-m-1];return m++,{value:t,done:!1}})},O.prototype.entries=function(){var D=this.items,c=D.length,m=0;return new E(function(){if(m>=c)return{done:!0};var t=D[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D){var c=new O;return F(D,function(m){c.push(m)}),c},O.of=function(){return O.from(arguments)},T.exports=O}),KT=Lt(S=>{S.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var T=new Set,E=1/0,F=null,O,D,c=arguments.length;for(D=0;DE.size)return!1;for(;O=F.next(),!O.done;)if(!E.has(O.value))return!1;return!0},S.isSuperset=function(T,E){return S.isSubset(E,T)},S.add=function(T,E){for(var F=E.values(),O;O=F.next(),!O.done;)T.add(O.value)},S.subtract=function(T,E){for(var F=E.values(),O;O=F.next(),!O.done;)T.delete(O.value)},S.intersect=function(T,E){for(var F=T.values(),O;O=F.next(),!O.done;)E.has(O.value)||T.delete(O.value)},S.disjunct=function(T,E){for(var F=T.values(),O,D=[];O=F.next(),!O.done;)E.has(O.value)&&D.push(O.value);for(F=E.values();O=F.next(),!O.done;)T.has(O.value)||T.add(O.value);for(var c=0,m=D.length;cE.size&&(F=T,T=E,E=F),T.size===0)return 0;if(T===E)return T.size;for(var O=T.values(),D,c=0;D=O.next(),!D.done;)E.has(D.value)&&c++;return c},S.unionSize=function(T,E){var F=S.intersectionSize(T,E);return T.size+E.size-F},S.jaccard=function(T,E){var F=S.intersectionSize(T,E);if(F===0)return 0;var O=T.size+E.size-F;return F/O},S.overlap=function(T,E){var F=S.intersectionSize(T,E);return F===0?0:F/Math.min(T.size,E.size)}}),jT=Lt((S,T)=>{var E=Me(),F=Ge().getPointerArray;function O(D){var c=F(D);this.start=0,this.size=0,this.capacity=D,this.dense=new c(D),this.sparse=new c(D)}O.prototype.clear=function(){this.start=0,this.size=0},O.prototype.has=function(D){if(this.size===0)return!1;var c=this.sparse[D],m=c=this.start&&c=this.start&&c1?c:this;for(var m=this.capacity,t=this.size,o=this.start,v=0;v=m)return{done:!0};var v=D[t];return t++,o++,t===c&&(t=0),{value:v,done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=[];return this.forEach(function(c){D.push(c)}),Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D.capacity=this.capacity,D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),T.exports=O}),$T=Lt((S,T)=>{var E=Me(),F=Ge().getPointerArray;function O(D,c){arguments.length<2&&(c=D,D=Array);var m=F(c);this.size=0,this.length=c,this.dense=new m(c),this.sparse=new m(c),this.vals=new D(c)}O.prototype.clear=function(){this.size=0},O.prototype.has=function(D){var c=this.sparse[D];return c=this.size||this.dense[c]!==D?!1:(c=this.dense[this.size-1],this.dense[this.sparse[D]]=c,this.sparse[c]=this.sparse[D],this.size--,!0)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0;m{var E=Me(),F=Ge().getPointerArray;function O(D){var c=F(D);this.size=0,this.length=D,this.dense=new c(D),this.sparse=new c(D)}O.prototype.clear=function(){this.size=0},O.prototype.has=function(D){var c=this.sparse[D];return c=this.size||this.dense[c]!==D?!1:(c=this.dense[this.size-1],this.dense[this.sparse[D]]=c,this.sparse[c]=this.sparse[D],this.size--,!0)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m,t=0;t{var E=ue(),F=2,O=2,D=new Set([0,1,2]),c={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function m(e){var i=new Set;return typeof e=="number"&&i.add(e),{suggestions:i,count:0}}function t(e,i,h){return{term:e||"",distance:i||0,count:h||0}}function o(e,i,h,s){s=s||new Set,i++;var l,f=e.length,u;if(f>1)for(u=0;u0&&e[u].length-f.length>s.length-f.length&&(h.suggestions=new Set,h.count=0),(i===2||!h.suggestions.size||e[u].length-f.length>=s.length-f.length)&&h.suggestions.add(l)}function a(e,i){var h=e.length,s=i.length,l=[[]],f=h+s,u=new Map,d,p,g;for(l[0][0]=f,d=0;d<=h;d++)l[d+1]||(l[d+1]=[]),l[d+1][1]=d,l[d+1][0]=f;for(g=0;g<=s;g++)l[1][g+1]=g,l[0][g+1]=f;var y=e+i,x;for(d=0,p=y.length;dl)return[];for(var d=[f],p=new Set,g=new Set,y=[],x,C;d.length>0&&(x=d.shift(),!(h<2&&y.length>0&&u-x.length>y[0].distance));){if(C=e[x],C!==void 0){if(typeof C=="number"&&(C=m(C)),C.count>0&&!g.has(x)){g.add(x);var P=t(x,u-x.length,C.count);if(y.push(P),h<2&&u-x.length===0)break}C.suggestions.forEach(L=>{var B=i[L];if(!g.has(B)){g.add(B);var N=0;if(f!==B)if(B.length===x.length)N=u-x.length;else if(u===x.length)N=B.length-x.length;else{for(var G=0,V=0,K=B.length;G0||V>0?N=a(B.substr(G,K-G-V),f.substr(G,u-G-V)):N=a(B,f)}if(h<2&&y.length>0&&y[0].distance>N&&(y=[]),!(h<2&&y.length>0&&N>y[0].distance)&&N<=s){var j=e[B];j!==void 0&&y.push(t(B,N,j.count))}}})}if(u-x.length0&&u-x.length>=y[0].distance)continue;for(var M=0,w=x.length;Mthis.maxLength&&(this.maxLength=e.length)),i.count===1){var h=this.words.length;this.words.push(e);var s=o(e,0,this.maxDistance);s.forEach(l=>{var f=this.dictionary[l];f!==void 0?(typeof f=="number"&&(f=m(f),this.dictionary[l]=f),f.suggestions.has(h)||v(this.words,this.verbosity,f,e,h,l)):this.dictionary[l]=h})}return this.size++,this},n.prototype.search=function(e){return r(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,e)},n.prototype.inspect=function(){var e=[];e.size=this.size,e.maxDistance=this.maxDistance,e.verbosity=this.verbosity,e.behavior=c[this.verbosity];for(var i in this.dictionary)typeof this.dictionary[i]=="object"&&this.dictionary[i].count&&e.push([i,this.dictionary[i].count]);return Object.defineProperty(e,"constructor",{value:n,enumerable:!1}),e},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(e,i){var h=new n(i);return E(e,function(s){h.add(s)}),h},T.exports=n}),od=Lt((S,T)=>{var E=ue(),F=Me(),O="\0";function D(c){this.mode=c===Array?"array":"string",this.clear()}D.prototype.clear=function(){this.root={},this.size=0},D.prototype.set=function(c,m){for(var t=this.root,o,v=0,a=c.length;v"u")return;if(O in m)return m[O]},D.prototype.delete=function(c){var m=this.root,t=null,o=null,v,a,r,n;for(r=0,n=c.length;r"u")return!1;t!==null?Object.keys(m).length>1&&(t=null,o=null):Object.keys(m).length<2&&(t=v,o=a)}return O in m?(this.size--,t?delete t[o]:delete m[O],!0):!1},D.prototype.has=function(c){for(var m=this.root,t,o=0,v=c.length;o"u")return!1;return O in m},D.prototype.find=function(c){var m=typeof c=="string",t=this.root,o=[],v,a,r;for(a=0,r=c.length;a"u")return o;for(var n=[t],e=[c],i;n.length;){c=e.pop(),t=n.pop();for(i in t){if(i===O){o.push([c,t[O]]);continue}n.push(t[i]),e.push(m?c+i:c.concat(i))}}return o},D.prototype.values=function(c){var m=this.root,t=[],o,v,a;if(c){for(v=0,a=c.length;v"u")return F.empty()}return t.push(m),new F(function(){for(var r,n=!1,e;t.length;){r=t.pop();for(e in r){if(e===O){n=!0;continue}t.push(r[e])}if(n)return{done:!1,value:r[O]}}return{done:!0}})},D.prototype.prefixes=function(c){var m=this.root,t=[],o=[],v,a,r,n=this.mode==="string";if(c){for(a=0,r=c.length;a"u")return F.empty()}else c=n?"":[];return t.push(m),o.push(c),new F(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=o.pop();for(s in e){if(s===O){h=!0;continue}t.push(e[s]),o.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:i}}return{done:!0}})},D.prototype.keys=D.prototype.prefixes,D.prototype.entries=function(c){var m=this.root,t=[],o=[],v,a,r,n=this.mode==="string";if(c){for(a=0,r=c.length;a"u")return F.empty()}else c=n?"":[];return t.push(m),o.push(c),new F(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=o.pop();for(s in e){if(s===O){h=!0;continue}t.push(e[s]),o.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:[i,e[O]]}}return{done:!0}})},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.entries),D.prototype.inspect=function(){for(var c=new Array(this.size),m=this.entries(),t,o=0;t=m.next(),!t.done;)c[o++]=t.value;return Object.defineProperty(c,"constructor",{value:D,enumerable:!1}),c},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.prototype.toJSON=function(){return this.root},D.from=function(c){var m=new D;return E(c,function(t,o){m.set(o,t)}),m},D.SENTINEL=O,T.exports=D}),QT=Lt((S,T)=>{var E=ue(),F=od(),O="\0";function D(m){this.mode=m===Array?"array":"string",this.clear()}for(c in F.prototype)D.prototype[c]=F.prototype[c];var c;delete D.prototype.set,delete D.prototype.get,delete D.prototype.values,delete D.prototype.entries,D.prototype.add=function(m){for(var t=this.root,o,v=0,a=m.length;v"u")return v;for(var e=[o],i=[m],h;e.length;){m=i.pop(),o=e.pop();for(h in o){if(h===O){v.push(m);continue}e.push(o[h]),i.push(t?m+h:m.concat(h))}}return v},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.keys),D.prototype.inspect=function(){for(var m=new Set,t=this.keys(),o;o=t.next(),!o.done;)m.add(o.value);return Object.defineProperty(m,"constructor",{value:D,enumerable:!1}),m},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.prototype.toJSON=function(){return this.root},D.from=function(m){var t=new D;return E(m,function(o){t.add(o)}),t},D.SENTINEL=O,T.exports=D}),kT=Lt((S,T)=>{var E=Me(),F=ue(),O=Ke(),D=Ge(),c=function(v){return Math.max(1,Math.ceil(v*1.5))},m=function(v){var a=D.getPointerArray(v);return new a(v)};function t(v,a){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var r=a||0,n=c,e=0,i=!1;typeof a=="object"&&(r=a.initialCapacity||0,e=a.initialLength||0,n=a.policy||n,i=a.factory===!0),this.factory=i?v:null,this.ArrayClass=v,this.length=e,this.capacity=Math.max(e,r),this.policy=n,this.array=new v(this.capacity)}t.prototype.set=function(v,a){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(v):this.array=this.factory(v),D.isTypedArray(this.array))this.array.set(a,0);else for(var r=0,n=this.length;r=v)return this;for(a=this.capacity;a=a)return{done:!0};var n=v[r];return r++,{value:n,done:!1}})},t.prototype.entries=function(){var v=this.array,a=this.length,r=0;return new E(function(){if(r>=a)return{done:!0};var n=v[r];return{value:[r++,n],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var v=this.array.slice(0,this.length);return v.type=this.array.constructor.name,v.items=this.length,v.capacity=this.capacity,Object.defineProperty(v,"constructor",{value:t,enumerable:!1}),v},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(v,a,r){if(arguments.length<3&&(r=O.guessLength(v),typeof r!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var n=new t(a,r);return F(v,function(e){n.push(e)}),n};function o(v){var a=function(n){t.call(this,v,n)};for(var r in t.prototype)t.prototype.hasOwnProperty(r)&&(a.prototype[r]=t.prototype[r]);return a.from=function(n,e){return t.from(n,v,e)},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a}t.Int8Vector=o(Int8Array),t.Uint8Vector=o(Uint8Array),t.Uint8ClampedVector=o(Uint8ClampedArray),t.Int16Vector=o(Int16Array),t.Uint16Vector=o(Uint16Array),t.Int32Vector=o(Int32Array),t.Uint32Vector=o(Uint32Array),t.Float32Vector=o(Float32Array),t.Float64Vector=o(Float64Array),t.PointerVector=o(m),T.exports=t}),qT=Lt((S,T)=>{var E=Ke(),F=Ge(),O=rd().inplaceQuickSortIndices,D=nd().lowerBoundIndices,c=sh(),m=F.getPointerArray;function t(a,r){return a.distancer.distance?-1:0}function o(a,r,n){for(var e=n.length,i=m(e),h=0,s=new i(e),l=new i(e),f=new i(e),u=new Float64Array(e),d=[0,0,e],p=new Float64Array(e),g,y,x,C,P,M,w,I,L;d.length;)if(P=d.pop(),C=d.pop(),g=d.pop(),y=n[P-1],P--,L=P-C,s[g]=y,L!==0){if(L===1){w=a(r[y],r[n[C]]),u[g]=w,h++,f[g]=h,s[h]=n[C];continue}for(I=C;I0&&(h++,f[g]=h,d.push(h,M,P)),M-C>0&&(h++,l[g]=h,d.push(h,C,M))}return{nodes:s,lefts:l,rights:f,mus:u}}function v(a,r){if(typeof a!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!r)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=a,this.heap=new c(t),this.D=0;var n=E.toArrayWithIndices(r);this.items=n[0];var e=n[1];this.size=e.length;var i=o(a,this.items,e);this.nodes=i.nodes,this.lefts=i.lefts,this.rights=i.rights,this.mus=i.mus}v.prototype.nearestNeighbors=function(a,r){var n=this.heap,e=[0],i=1/0,h,s,l,f,u,d,p;for(this.D=0;e.length;)h=e.pop(),s=this.nodes[h],l=this.items[s],p=this.distance(l,r),this.D++,pa&&n.pop(),n.size>=a&&(i=n.peek().distance)),f=this.lefts[h],u=this.rights[h],!(!f&&!u)&&(d=this.mus[h],p=d-i&&e.push(u)):(u&&p>=d-i&&e.push(u),f&&p=0;y--)g[y]=n.pop();return g},v.prototype.neighbors=function(a,r){var n=[],e=[0],i,h,s,l,f,u,d;for(this.D=0;e.length;)i=e.pop(),h=this.nodes[i],s=this.items[h],d=this.distance(s,r),this.D++,d<=a&&n.push({distance:d,item:s}),l=this.lefts[i],f=this.rights[i],!(!l&&!f)&&(u=this.mus[i],d=u-a&&e.push(f)):(f&&d>=u-a&&e.push(f),l&&d{var E=sh(),F=ih(),O=TT();T.exports={BiMap:ST(),BitSet:CT(),BitVector:ET(),BloomFilter:AT(),BKTree:MT(),CircularBuffer:wT(),DefaultMap:RT(),DefaultWeakMap:FT(),FixedDeque:ed(),StaticDisjointSet:LT(),FibonacciHeap:F,MinFibonacciHeap:F.MinFibonacciHeap,MaxFibonacciHeap:F.MaxFibonacciHeap,FixedReverseHeap:nh(),FuzzyMap:OT(),FuzzyMultiMap:DT(),HashedArrayTree:IT(),Heap:E,MinHeap:E.MinHeap,MaxHeap:E.MaxHeap,StaticIntervalTree:BT(),InvertedIndex:NT(),KDTree:GT(),LinkedList:zT(),LRUCache:rh(),LRUCacheWithDelete:UT(),LRUMap:ad(),LRUMapWithDelete:XT(),MultiMap:id(),MultiSet:VT(),PassjoinIndex:WT(),Queue:YT(),FixedStack:sd(),Stack:HT(),SuffixArray:O,GeneralizedSuffixArray:O.GeneralizedSuffixArray,Set:KT(),SparseQueueSet:jT(),SparseMap:$T(),SparseSet:ZT(),SymSpell:JT(),Trie:QT(),TrieMap:od(),Vector:kT(),VPTree:qT()}}),ut=class ge{static get ZERO(){return new ge(0,0)}static get ONE(){return new ge(1,1)}static get UP(){return new ge(0,-1)}static get DOWN(){return new ge(0,1)}static get LEFT(){return new ge(-1,0)}static get RIGHT(){return new ge(1,0)}static get UP_LEFT(){return new ge(-1,-1)}static get UP_RIGHT(){return new ge(1,-1)}static get DOWN_RIGHT(){return new ge(1,1)}static get DOWN_LEFT(){return new ge(-1,1)}constructor(T,E){typeof T=="number"?(this.x=T,this.y=E||0):(this.x=T.x,this.y=T.y)}clone(){return new ge(this.x,this.y)}add(T){return new ge(this.x+T.x,this.y+T.y)}multiply(T){return new ge(this.x*T.x,this.y*T.y)}divide(T){return new ge(this.x/T.x,this.y/T.y)}subtract(T){return new ge(this.x-T.x,this.y-T.y)}equals(T){return this.x===T.x&&this.y===T.y}abs(){return new ge(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(T){return new ge(this.x%T.x,this.y%T.y)}scalarModulo(T){return new ge(this.x%T,this.y%T)}scalarMult(T){return new ge(this.x*T,this.y*T)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},Ut=class{static equal(S,T){return S.position.x===T.position.x&&S.position.y===T.position.y&&S.layer===T.layer}static copyOver(S,T){T.position.x=S.position.x,T.position.y=S.position.y,T.layer=S.layer}static clone(S){return{position:S.position.clone(),layer:S.layer}}static toString(S){return`${S.position.toString()}#${S.layer}`}static toInternal(S){return{position:new ut(S.position.x,S.position.y),layer:S.charLayer}}static fromInternal(S){return{position:S.position.toPosition(),charLayer:S.layer}}},tS=(S=>(S.NONE="none",S.LEFT="left",S.UP_LEFT="up-left",S.UP="up",S.UP_RIGHT="up-right",S.RIGHT="right",S.DOWN_RIGHT="down-right",S.DOWN="down",S.DOWN_LEFT="down-left",S))(tS||{}),eS={up:"down",down:"up",left:"right",right:"left",none:"none","up-left":"down-right","up-right":"down-left","down-right":"up-left","down-left":"up-right"},iS={up:ut.UP,down:ut.DOWN,left:ut.LEFT,right:ut.RIGHT,none:ut.ZERO,"up-left":ut.UP_LEFT,"up-right":ut.UP_RIGHT,"down-right":ut.DOWN_RIGHT,"down-left":ut.DOWN_LEFT},Cr={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},hd=["up","up-right","right","down-right","down","down-left","left","up-left"],sS=["down-left","down-right","up-right","up-left"];function ah(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function rn(S){return sS.includes(S)}function nS(S,T=1){return S==="none"?"none":hd[(Cr[S]+8-Math.abs(T)%8)%8]}function ld(S,T=1){return S==="none"?"none":hd[(Cr[S]+T)%8]}function ls(S){return iS[S]}function rS(S){return eS[S]}function ei(S,T){if(S.x===T.x){if(S.y>T.y)return"up";if(S.yT.x)return"left";if(S.xT.x){if(S.yT.y)return"up-left"}else if(S.xT.y)return"up-right"}return"none"}var aS=(S=>(S[S.FOUR=4]="FOUR",S[S.EIGHT=8]="EIGHT",S))(aS||{});function Ms(S){return typeof S=="string"&&ah().includes(S)}var Oo=function(S,T){return Oo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,F){E.__proto__=F}||function(E,F){for(var O in F)Object.prototype.hasOwnProperty.call(F,O)&&(E[O]=F[O])},Oo(S,T)};function gn(S,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");Oo(S,T);function E(){this.constructor=S}S.prototype=T===null?Object.create(T):(E.prototype=T.prototype,new E)}function oS(S,T,E,F){function O(D){return D instanceof E?D:new E(function(c){c(D)})}return new(E||(E=Promise))(function(D,c){function m(v){try{o(F.next(v))}catch(a){c(a)}}function t(v){try{o(F.throw(v))}catch(a){c(a)}}function o(v){v.done?D(v.value):O(v.value).then(m,t)}o((F=F.apply(S,T||[])).next())})}function ud(S,T){var E={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},F,O,D,c;return c={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function m(o){return function(v){return t([o,v])}}function t(o){if(F)throw new TypeError("Generator is already executing.");for(;c&&(c=0,o[0]&&(E=0)),E;)try{if(F=1,O&&(D=o[0]&2?O.return:o[0]?O.throw||((D=O.return)&&D.call(O),0):O.next)&&!(D=D.call(O,o[1])).done)return D;switch(O=0,D&&(o=[o[0]&2,D.value]),o[0]){case 0:case 1:D=o;break;case 4:return E.label++,{value:o[1],done:!1};case 5:E.label++,O=o[1],o=[0];continue;case 7:o=E.ops.pop(),E.trys.pop();continue;default:if(D=E.trys,!(D=D.length>0&&D[D.length-1])&&(o[0]===6||o[0]===2)){E=0;continue}if(o[0]===3&&(!D||o[1]>D[0]&&o[1]=S.length&&(S=void 0),{value:S&&S[F++],done:!S}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")}function un(S,T){var E=typeof Symbol=="function"&&S[Symbol.iterator];if(!E)return S;var F=E.call(S),O,D=[],c;try{for(;(T===void 0||T-- >0)&&!(O=F.next()).done;)D.push(O.value)}catch(m){c={error:m}}finally{try{O&&!O.done&&(E=F.return)&&E.call(F)}finally{if(c)throw c.error}}return D}function fn(S,T,E){if(E||arguments.length===2)for(var F=0,O=T.length,D;F1||m(r,n)})})}function m(r,n){try{t(F[r](n))}catch(e){a(D[0][3],e)}}function t(r){r.value instanceof Rs?Promise.resolve(r.value.v).then(o,v):a(D[0][2],r)}function o(r){m("next",r)}function v(r){m("throw",r)}function a(r,n){r(n),D.shift(),D.length&&m(D[0][0],D[0][1])}}function lS(S){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=S[Symbol.asyncIterator],E;return T?T.call(S):(S=typeof Os=="function"?Os(S):S[Symbol.iterator](),E={},F("next"),F("throw"),F("return"),E[Symbol.asyncIterator]=function(){return this},E);function F(D){E[D]=S[D]&&function(c){return new Promise(function(m,t){c=S[D](c),O(m,t,c.done,c.value)})}}function O(D,c,m,t){Promise.resolve(t).then(function(o){D({value:o,done:m})},c)}}function Te(S){return typeof S=="function"}function fd(S){var T=function(F){Error.call(F),F.stack=new Error().stack},E=S(T);return E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E}var xo=fd(function(S){return function(T){S(this),this.message=T?T.length+` errors occurred during unsubscription: -`+T.map(function(E,F){return F+1+") "+E.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=T}});function Do(S,T){if(S){var E=S.indexOf(T);0<=E&&S.splice(E,1)}}var Jr=function(){function S(T){this.initialTeardown=T,this.closed=!1,this._parentage=null,this._finalizers=null}return S.prototype.unsubscribe=function(){var T,E,F,O,D;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var m=Os(c),t=m.next();!t.done;t=m.next()){var o=t.value;o.remove(this)}}catch(i){T={error:i}}finally{try{t&&!t.done&&(E=m.return)&&E.call(m)}finally{if(T)throw T.error}}else c.remove(this);var v=this.initialTeardown;if(Te(v))try{v()}catch(i){D=i instanceof xo?i.errors:[i]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var r=Os(a),n=r.next();!n.done;n=r.next()){var e=n.value;try{of(e)}catch(i){D=D??[],i instanceof xo?D=fn(fn([],un(D)),un(i.errors)):D.push(i)}}}catch(i){F={error:i}}finally{try{n&&!n.done&&(O=r.return)&&O.call(r)}finally{if(F)throw F.error}}}if(D)throw new xo(D)}},S.prototype.add=function(T){var E;if(T&&T!==this)if(this.closed)of(T);else{if(T instanceof S){if(T.closed||T._hasParent(this))return;T._addParent(this)}(this._finalizers=(E=this._finalizers)!==null&&E!==void 0?E:[]).push(T)}},S.prototype._hasParent=function(T){var E=this._parentage;return E===T||Array.isArray(E)&&E.includes(T)},S.prototype._addParent=function(T){var E=this._parentage;this._parentage=Array.isArray(E)?(E.push(T),E):E?[E,T]:T},S.prototype._removeParent=function(T){var E=this._parentage;E===T?this._parentage=null:Array.isArray(E)&&Do(E,T)},S.prototype.remove=function(T){var E=this._finalizers;E&&Do(E,T),T instanceof S&&T._removeParent(this)},S.EMPTY=function(){var T=new S;return T.closed=!0,T}(),S}(),dd=Jr.EMPTY;function cd(S){return S instanceof Jr||S&&"closed"in S&&Te(S.remove)&&Te(S.add)&&Te(S.unsubscribe)}function of(S){Te(S)?S():S.unsubscribe()}var vd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},uS={setTimeout:function(S,T){for(var E=[],F=2;F0},enumerable:!1,configurable:!0}),T.prototype._trySubscribe=function(E){return this._throwIfClosed(),S.prototype._trySubscribe.call(this,E)},T.prototype._subscribe=function(E){return this._throwIfClosed(),this._checkFinalizedStatuses(E),this._innerSubscribe(E)},T.prototype._innerSubscribe=function(E){var F=this,O=this,D=O.hasError,c=O.isStopped,m=O.observers;return D||c?dd:(this.currentObservers=null,m.push(E),new Jr(function(){F.currentObservers=null,Do(m,E)}))},T.prototype._checkFinalizedStatuses=function(E){var F=this,O=F.hasError,D=F.thrownError,c=F.isStopped;O?E.error(D):c&&E.complete()},T.prototype.asObservable=function(){var E=new si;return E.source=this,E},T.create=function(E,F){return new lf(E,F)},T}(si),lf=function(S){gn(T,S);function T(E,F){var O=S.call(this)||this;return O.destination=E,O.source=F,O}return T.prototype.next=function(E){var F,O;(O=(F=this.destination)===null||F===void 0?void 0:F.next)===null||O===void 0||O.call(F,E)},T.prototype.error=function(E){var F,O;(O=(F=this.destination)===null||F===void 0?void 0:F.error)===null||O===void 0||O.call(F,E)},T.prototype.complete=function(){var E,F;(F=(E=this.destination)===null||E===void 0?void 0:E.complete)===null||F===void 0||F.call(E)},T.prototype._subscribe=function(E){var F,O;return(O=(F=this.source)===null||F===void 0?void 0:F.subscribe(E))!==null&&O!==void 0?O:dd},T}(le),xd=new si(function(S){return S.complete()});function SS(S){return S&&Te(S.schedule)}function yd(S){return S[S.length-1]}function Td(S){return SS(yd(S))?S.pop():void 0}function Sd(S,T){return typeof yd(S)=="number"?S.pop():T}var Cd=function(S){return S&&typeof S.length=="number"&&typeof S!="function"};function Ed(S){return Te(S?.then)}function Pd(S){return Te(S[hh])}function Ad(S){return Symbol.asyncIterator&&Te(S?.[Symbol.asyncIterator])}function Md(S){return new TypeError("You provided "+(S!==null&&typeof S=="object"?"an invalid object":"'"+S+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function CS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var wd=CS();function Rd(S){return Te(S?.[wd])}function Fd(S){return hS(this,arguments,function(){var T,E,F,O;return ud(this,function(D){switch(D.label){case 0:T=S.getReader(),D.label=1;case 1:D.trys.push([1,,9,10]),D.label=2;case 2:return[4,Rs(T.read())];case 3:return E=D.sent(),F=E.value,O=E.done,O?[4,Rs(void 0)]:[3,5];case 4:return[2,D.sent()];case 5:return[4,Rs(F)];case 6:return[4,D.sent()];case 7:return D.sent(),[3,2];case 8:return[3,10];case 9:return T.releaseLock(),[7];case 10:return[2]}})})}function Ld(S){return Te(S?.getReader)}function fs(S){if(S instanceof si)return S;if(S!=null){if(Pd(S))return ES(S);if(Cd(S))return PS(S);if(Ed(S))return AS(S);if(Ad(S))return Od(S);if(Rd(S))return MS(S);if(Ld(S))return wS(S)}throw Md(S)}function ES(S){return new si(function(T){var E=S[hh]();if(Te(E.subscribe))return E.subscribe(T);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function PS(S){return new si(function(T){for(var E=0;E{let O=this.tilePosInDirection(new ut(E,F),S);return this.tilemap.hasBlockingTile(O,T,rS(S),this.ignoreMissingTiles)})}isCharBlocking(S,T){return this.someCharTile((E,F)=>{let O=this.tilePosInDirection(new ut(E,F),S);return this.tilemap.hasBlockingChar(O,T,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(S){this.isMoving()||S!="none"&&this.changeFacingDirection(S)}changeFacingDirection(S){this.facingDirection!==S&&(this.facingDirection=S,this.directionChanged$.next(S))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(ls(this.facingDirection))}addCollisionGroup(S){this.collisionGroups.add(S)}setCollisionGroups(S){this.collisionGroups=new Set(S)}setIgnoreCollisionGroups(S){this.ignoreCollisionGroups=new Set(S)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(S){return this.collisionGroups.has(S)}removeCollisionGroup(S){this.collisionGroups.delete(S)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(S){for(let T of S)this.labels.add(T)}getLabels(){return[...this.labels.values()]}hasLabel(S){return this.labels.has(S)}clearLabels(){this.labels.clear()}removeLabels(S){for(let T of S)this.labels.delete(T)}getNumberOfDirections(){return this.numberOfDirections}movementStarted(){return this.movementStarted$}movementStopped(){return this.movementStopped$}directionChanged(){return this.directionChanged$}tilePositionSet(){return this.tilePositionSet$}positionChangeStarted(){return this.positionChangeStarted$}positionChangeFinished(){return this.positionChangeFinished$}autoMovementSet(){return this.autoMovementSet$}depthChanged(){return this.depthChanged$}getMovementProgress(){return this.movementProgress}setMovementProgress(S){let T=Math.max(0,Math.min(ns,S));this.movementProgress=T}hasWalkedHalfATile(){return this.movementProgress>ns/2}willCrossTileBorderThisUpdate(S){return this.movementProgress+this.maxProgressForDelta(S)>=ns}updateCharacterPosition(S){let T=this.willCrossTileBorderThisUpdate(S),E=1-(T?ns-this.movementProgress:this.maxProgressForDelta(S))/this.maxProgressForDelta(S);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(S),ns),T&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),E>0&&this.updateCharacterPosition(S*E)):this.stopMoving())}maxProgressForDelta(S){let T=S/1e3;return Math.floor(T*this.speed*ns)}get tilePos(){return Ut.clone(this._tilePos)}set tilePos(S){Ut.copyOver(S,this._tilePos)}startMoving(S){S!=="none"&&(S!=this.movementDirection&&this.movementStarted$.next(S),this.movementDirection=S,this.facingDirection=S,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(S,T){return S.add(ls(this.tilemap.toMapDirection(T)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let S=this.tilePos,T=this.getNextTilePos(),E=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(E),this.fire(this.positionChangeFinished$,S,T)}fire(S,{position:T,layer:E},{position:F,layer:O}){S.next({exitTile:T,enterTile:F,exitLayer:E,enterLayer:O})}someCharTile(S){let T=this.getNextTilePos().position;for(let E=T.x;Ethis.isLayerAlwaysOnTop(O));this.tilemap.layers.filter(O=>!this.isLayerAlwaysOnTop(O)).forEach(O=>{this.hasLayerProp(O,rs.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(O,E),T.push(O.tilemapLayer)):this.setDepth(O,++E)}),this.charLayerDepths.set(void 0,E),F.forEach((O,D)=>{O.tilemapLayer.setDepth(D+1+E)}),T.forEach(O=>O.destroy())}setDepth(T,E){T.tilemapLayer.setDepth(E),this.isCharLayer(T)&&this.charLayerDepths.set(this.getLayerProp(T,rs.CHAR_LAYER_PROP_NAME),E)}createHeightShiftLayers(T,E){let F=this.getLayerProp(T,rs.HEIGHT_SHIFT_PROP_NAME);isNaN(F)&&(F=0);let O=1;for(let D=0;DO.name==E);return F?.value}hasLayerProp(T,E){return this.getLayerProp(T,E)!=null}copyLayer(T,E){let F=`${T.name}#${E}`,O=this.tilemap.createBlankLayer(F,T.tilemapLayer.tileset);if(O){if(O.name=F,this.isIsometric())for(let D=E;D>=0;D--){let c=E-D;O.putTileAt(T.data[D][c],c,D)}else for(let D=0;Dm===this.charData.id)).subscribe(({direction:m})=>{var t;(t=this.animation)==null||t.setStandingFrame(m)}),this.sprite&&(this.sprite.setOrigin(0,0),this.resetAnimation(this.sprite),this.updateOverlaySprite(),this.updateGridChar())}destroy(){this.destroy$.next(),this.destroy$.complete(),this.newSpriteSet$.complete()}setSprite(S){S?(this.sprite&&(S.x=this.sprite.x,S.y=this.sprite.y),this.sprite=S,this.newSpriteSet$.next(),this.layerOverlaySprite=this.layerOverlaySprite?this.scene.add.sprite(0,0,this.sprite.texture):void 0,this.updateOverlaySprite(),this.resetAnimation(this.sprite),this.updateDepth()):(this.layerOverlaySprite=void 0,this.sprite=void 0)}getSprite(){return this.sprite}getLayerOverlaySprite(){return this.layerOverlaySprite}setContainer(S){var T;this.container=S,this.cachedContainerHeight=(T=S?.getBounds().height)!=null?T:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(S){this.customOffset.x=S}getOffsetY(){return this.customOffset.y}setOffsetY(S){this.customOffset.y=S}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(S){var T;this.geHeadless.isMoving(this.charData.id)||S!="none"&&(this.geHeadless.turnTowards(this.charData.id,S),(T=this.animation)==null||T.setStandingFrame(S))}getAnimation(){return this.animation}setAnimation(S){this.animation=S}update(S){this.updateGridChar()}getEngineOffset(){var S,T,E,F;if(!this.sprite)return ut.ZERO;let O=this.tilemap.getTileWidth()/2-Math.floor(((T=(S=this.sprite)==null?void 0:S.displayWidth)!=null?T:0)/2),D=-((F=(E=this.sprite)==null?void 0:E.displayHeight)!=null?F:0)+this.tilemap.getTileHeight();return new ut(O,D)}updatePixelPos(){let S=new ut(this.geHeadless.getPosition(this.charData.id)),T=this.geHeadless.getMovementProgress(this.charData.id)/1e3,E=this.tilemap.tilePosToPixelPos(S).add(this.getEngineOffset()).add(this.customOffset).add(ls(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(T))),F=this.getGameObj();F&&(F.x=Math.floor(E.x),F.y=Math.floor(E.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var S;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let T=this.geHeadless.getMovementProgress(this.charData.id)>ns/2;(S=this.getAnimation())==null||S.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),T,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(S){let T=new uf(this.walkingAnimationMapping,S.texture.source[0].width/S.width/uf.FRAMES_CHAR_ROW);this.setAnimation(T),T.frameChange().pipe(ti(this.newSpriteSet$)).subscribe(E=>{S?.setFrame(E)}),T.setIsEnabled(this.walkingAnimationMapping!==void 0),T.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let S=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-S),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let S=new ut(this.geHeadless.getPosition(this.charData.id)),T=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:S,layer:T}):this.sprite&&this.setSpriteDepth(this.sprite,{position:S,layer:T});let E=this.getLayerOverlaySprite();if(E){let F=new ut(Ki(oe({},S),{y:S.y-1}));this.setSpriteDepth(E,{position:F,layer:T})}}setSpriteDepth(S,T){S.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(T))+this.getPaddedPixelDepthSprite(S))}setContainerDepth(S,T){S.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(T))+this.getPaddedPixelDepthContainer(S))}getPaddedPixelDepthContainer(S){return No.shiftPad(S.y+this.cachedContainerHeight,zo.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(S){return No.shiftPad(S.y+S.displayHeight,zo.Z_INDEX_PADDING)}getTransitionLayer(S){if(S.layer)return this.geHeadless.getTransition(S.position,S.layer)||S.layer}},YS=(S=>(S.DONT_BLOCK="DONT_BLOCK",S.BLOCK_TWO_TILES="BLOCK_TWO_TILES",S.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",S.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",S))(YS||{}),zd=(S=>(S.STOP="STOP",S.CLOSEST_REACHABLE="CLOSEST_REACHABLE",S.RETRY="RETRY",S.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",S))(zd||{}),HS=class{distance(S,T){return fi.manhattanDistance(S,T)}direction(S,T){if(fi.equal(S,T))return"none";let E=S.clone().subtract(T);return Math.abs(E.x)>Math.abs(E.y)?E.x>0?"left":"right":E.y>0?"up":"down"}neighbors(S){return[new ut(S.x,S.y+1),new ut(S.x+1,S.y),new ut(S.x-1,S.y),new ut(S.x,S.y-1)]}getDirections(){return["up","right","down","left"]}},KS=class{distance(S,T){return fi.chebyshevDistance(S,T)}neighbors(S){let T=[new ut(S.x,S.y+1),new ut(S.x+1,S.y),new ut(S.x-1,S.y),new ut(S.x,S.y-1)],E=[new ut(S.x+1,S.y+1),new ut(S.x+1,S.y-1),new ut(S.x-1,S.y+1),new ut(S.x-1,S.y-1)];return[...T,...E]}direction(S,T){return T.x>S.x?T.y>S.y?"down-right":T.yS.y?"down-left":T.yS.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},dn=class{static create(S){switch(S){case 4:return new HS;case 8:return new KS}}},ff=class{constructor(S,T,E){this.backoffMs=S,this.maxRetries=T,this.onFinished=E,this.retries=0,this.elapsed=0}retry(S,T){this.shouldRetry()?(this.elapsed+=S,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,T())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(S.WAIT="WAIT",S.RETRY="RETRY",S.STOP="STOP",S))(Ud||{}),Qr=class{constructor(S,{shortestPathAlgorithm:T="BFS",pathWidth:E=1,pathHeight:F=1,numberOfDirections:O=4,isPositionAllowed:D=(i,h)=>!0,collisionGroups:c=[],ignoredChars:m=[],ignoreTiles:t=!1,ignoreMapBounds:o=!1,ignoreBlockedTarget:v=!1,maxPathLength:a=1/0,ignoreLayers:r=!1,considerCosts:n=!1,calculateClosestToTarget:e=!0}={}){this.gridTilemap=S,this.options={shortestPathAlgorithm:T,pathWidth:E,pathHeight:F,numberOfDirections:O,isPositionAllowed:D,collisionGroups:c,ignoredChars:m,ignoreTiles:t,ignoreMapBounds:o,ignoreBlockedTarget:v,maxPathLength:a,ignoreLayers:r,considerCosts:n,calculateClosestToTarget:e},this.ignoredCharsSet=new Set(m)}findShortestPath(S,T){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(S.layer),T.layer=S.layer);let E=this.findShortestPathImpl(S,T);return this.gridTilemap.unfixCacheLayers(),E}getNeighbors(S,T){var E;return dn.create((E=this.options.numberOfDirections)!=null?E:4).neighbors(S.position).map(F=>{let O=S.layer;return this.options.ignoreLayers||(O=this.gridTilemap.getTransition(F,S.layer)),{position:F,layer:O||S.layer}}).filter(F=>!this.isBlocking(S,F)||this.options.ignoreBlockedTarget&&Ut.equal(F,T))}getTransition(S,T){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(S,T)}getCosts(S,T){if(!this.options.considerCosts)return 1;let E=ei(T.position,S);return this.gridTilemap.getTileCosts(T,E)}isBlocking(S,T){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(T.position))||!this.options.isPositionAllowed(T.position,T.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(S,T,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(S,T,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(S,T){return(this.options.numberOfDirections===4?fi.manhattanDistance:fi.chebyshevDistance)(S,T)}getTilePosInDir(S,T){return this.options.ignoreLayers?{position:S.position.add(ls(this.gridTilemap.toMapDirection(T))),layer:S.layer}:this.gridTilemap.getTilePosInDirection(S,T)}getReverseNeighbors(S,T){var E;let F=dn.create((E=this.options.numberOfDirections)!=null?E:4).neighbors(S.position),O;if(!this.options.ignoreLayers){let D=this.gridTilemap.getReverseTransitions(S.position,S.layer);O=D?[...D]:void 0}return F.map(D=>O?O.map(c=>({position:D,layer:c||S.layer})):[{position:D,layer:S.layer}]).flat().filter(D=>!this.isBlocking(D,S)||this.options.ignoreBlockedTarget&&Ut.equal(S,T))}hasBlockingCharFrom(S,T,E,F,O,D,c){if(E===1&&F===1)return c.hasBlockingChar(T.position,T.layer,O,D);let m=o=>c.hasBlockingChar(o,T.layer,O,D),t=ei(S.position,T.position);return this.isBlockingMultiTile(S,t,E,F,m)}hasBlockingTileFrom(S,T,E,F,O,D){if(E===1&&F===1)return D.hasBlockingTile(T.position,T.layer,ei(T.position,S.position),O);let c=ei(S.position,T.position),m=t=>D.hasBlockingTile(t,T.layer,c,O);return this.isBlockingMultiTile(S,c,E,F,m)}isBlockingMultiTile(S,T,E,F,O){let D={src:new ut(S.position.x+E,S.position.y),dest:new ut(S.position.x+E,S.position.y+F-1)},c={src:new ut(S.position.x-1,S.position.y),dest:new ut(S.position.x-1,S.position.y+F-1)},m={src:new ut(S.position.x,S.position.y-1),dest:new ut(S.position.x+E-1,S.position.y-1)},t={src:new ut(S.position.x,S.position.y+F),dest:new ut(S.position.x+E-1,S.position.y+F)};switch(T){case"right":return this.checkLine(D,O);case"left":return this.checkLine(c,O);case"up":return this.checkLine(m,O);case"down":return this.checkLine(t,O);case"up-left":return this.checkLine({src:m.src,dest:new ut(m.dest.x-1,m.dest.y)},O)||this.checkLine({src:new ut(c.src.x,c.src.y-1),dest:new ut(c.dest.x,c.dest.y-1)},O);case"up-right":return this.checkLine({src:new ut(m.src.x+1,m.src.y),dest:m.dest},O)||this.checkLine({src:new ut(D.src.x,D.src.y-1),dest:new ut(D.dest.x,D.dest.y-1)},O);case"down-left":return this.checkLine({src:new ut(c.src.x,c.src.y+1),dest:new ut(c.dest.x,c.dest.y+1)},O)||this.checkLine({src:t.src,dest:new ut(t.dest.x-1,t.dest.y)},O);case"down-right":return this.checkLine({src:new ut(t.src.x+1,t.src.y),dest:t.dest},O)||this.checkLine({src:new ut(D.src.x,D.src.y+1),dest:new ut(D.dest.x,D.dest.y+1)},O)}return!1}checkLine(S,T){for(let E=S.src.x;E<=S.dest.x;E++)for(let F=S.src.y;F<=S.dest.y;F++)if(T(new ut(E,F)))return!0;return!1}},jS=_f(ih(),1),$S=class extends Qr{findShortestPathImpl(S,T){let E=this.shortestPathBfs(S,T);return{path:this.returnPath(E.previous,S,T),closestToTarget:E.closestToTarget,steps:E.steps,maxPathLengthReached:E.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(S,T){let E=new Map,F=new Map,O=new Map,D=new jS.MinFibonacciHeap((o,v)=>ks(O,o)-ks(O,v)),c=S,m=this.distance(S.position,T.position),t=0;for(D.push(S),F.set(Ut.toString(S),0),O.set(Ut.toString(S),this.distance(S.position,T.position));D.size>0;){let o=D.pop();if(!o)break;t++;let v=this.distance(o.position,T.position);if(vthis.options.maxPathLength)return{previous:new Map,closestToTarget:c,steps:t,maxPathLengthReached:!0};for(let a of this.getNeighbors(o,T)){let r=ks(F,o)+this.getCosts(o.position,a),n=Ut.toString(a);(!F.has(n)||r0;){let t=O.dequeue();if(m++,!t)break;let{node:o,dist:v}=t;if(v>this.options.maxPathLength)return{previous:new Map,closestToTarget:D,steps:m,maxPathLengthReached:!0};let a=this.distance(o.position,T.position);if(athis.lastDist)}step(S,T,E){var F;this.lastDist=E;for(let O of S){let D=Ut.toString(O);if(!this.visited.has(D)){this.previous.set(D,T),this.queue.enqueue({node:O,dist:E+1}),this.visited.set(D,E+1);let c=(F=this.otherBfs)==null?void 0:F.visited.get(D);c!==void 0&&c0,O.queue.size()>0);){let t=F.queue.dequeue();if(!t)break;let{node:o,dist:v}=t;if(v+1+(((E=O.queue.peek())==null?void 0:E.dist)||0)>this.options.maxPathLength)return{previous:F.previous,previous2:O.previous,closestToTarget:this.maybeClosestToTarget(c),steps:D,maxPathLengthReached:!0};let a=this.distance(o.position,T.position);if(aqs(this.f,O)-qs(this.f,D)),this.openSet.push(S);let F=Ut.toString(S);for(this.g.set(F,0),this.f.set(F,this.distance(S.position,T.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let O=this.openSet.pop();if(!O)break;if(this.steps++,Ut.equal(O,T))return{previous:E,closestToTarget:T,steps:this.steps,maxPathLengthReached:!1};if(qs(this.g,O)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(O,T);for(let D of this.getNeighborsInternal(O,E.get(Ut.toString(O)),T)){let c=Ut.toString(D.p),m=qs(this.g,O)+D.dist;(!this.g.has(c)||m({p:D,dist:1}));let F=this.prune(T,S).filter(D=>!this.isBlockingIgnoreTarget(S,D,E)).map(D=>{let c=this.getTransition(D.position,S.layer);return{position:D.position,layer:c||S.layer}}),O=[];for(let D of F)if(this.isHorizontal(S.position,D.position))O.push({p:D,dist:1});else{let c=this.jump(S,D,E,1,ei(S.position,D.position));c&&O.push(c)}return O}isBlockingIgnoreTarget(S,T,E){return this.isBlocking(S,T)&&!(this.options.ignoreBlockedTarget&&Ut.equal(T,E))}jump(S,T,E,F,O){if(!this.isBlockingIgnoreTarget(S,T,E))return Ut.equal(T,E)?{p:T,dist:F}:F>=this.maxJumpSize?{p:T,dist:F}:this.getTransition(T.position,S.layer)!==void 0?{p:T,dist:F}:this.hasForced(S,T)?{p:T,dist:F}:(this.updateClosestToTarget(T,E),this.jump(T,this.getTilePosInDir(T,O),E,F+1,O))}isHorizontal(S,T){return S.y===T.y}getForced(S,T,E,F,O,D){let c=[],m=S;return(this.blockOrTrans(m,E)||this.blockOrTrans(E,F))&&this.addIfNotBlocked(c,T,F),(this.blockOrTrans(m,O)||this.blockOrTrans(O,D))&&this.addIfNotBlocked(c,T,D),c}hasForced(S,T){let{topLeft:E,downLeft:F,top:O,bottom:D}=this.normalizedPositions(S,T);return!!((this.blockOrTrans(S,F)||this.blockOrTrans(F,D))&&!this.blockOrTrans(T,D)||(this.blockOrTrans(S,E)||this.blockOrTrans(E,O))&&!this.blockOrTrans(T,O))}prune(S,T){let{right:E,top:F,bottom:O,downLeft:D,topLeft:c}=this.normalizedPositions(S,T);return this.isHorizontal(S.position,T.position)?[E,F,O]:[E,...this.getForced(S,T,D,O,c,F)]}normalizedPositions(S,T){return S.position.xT.position.x?{topLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y),layer:T.layer}}:S.position.y1?this.fillPath(O,D,F):F.push(D),O=D}return F.reverse()}fillPath(S,T,E){let F=S;do{let O=ei(F.position,T.position);F=this.getTilePosInDir(F,O),E.push(F)}while(!fi.equal(F.position,T.position))}};function qs(S,T){var E;return(E=S.get(Ut.toString(T)))!=null?E:Number.MAX_VALUE}var JS=class{constructor(S,T,E,F={}){this.character=S,this.gridTilemap=T,this.charToFollow=E;let O={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:F.considerCosts||!1,facingDirection:"none"};this.options=oe(oe({},O),F),this.options.considerCosts&&this.options.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.options.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.options.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.character=S,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(ti(this.character.autoMovementSet().pipe(ji(D=>D!==this),Bs(1)))).subscribe(({enterTile:D,enterLayer:c})=>{this.updateTarget(D,c)})}update(S){var T;(T=this.targetMovement)==null||T.update(S)}getInfo(){return{type:"Follow",config:{charToFollow:this.charToFollow.getId(),distance:this.options.distance,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,facingDirection:this.options.facingDirection,shortestPathAlgorithm:this.options.shortestPathAlgorithm}}}getFacingPos(){let S=Cr[this.options.facingDirection]+Cr[this.charToFollow.getFacingDirection()],T=ld("up",S),E={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return T==="right"?E.x+=this.charToFollow.getTileWidth()-1:T==="down"?E.y+=this.charToFollow.getTileWidth()-1:T==="down-left"?E.y+=this.charToFollow.getTileWidth()-1:T==="down-right"?(E.y+=this.charToFollow.getTileWidth()-1,E.x+=this.charToFollow.getTileWidth()-1):T==="up-right"&&(E.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new ut(E),layer:this.charToFollow.getTilePos().layer},T).position}updateTarget(S,T){let E=this.options.facingDirection!=="none"&&this.options.distance===0;E&&(S=this.getFacingPos()),this.targetMovement=new jd(this.character,this.gridTilemap,{position:new ut(S),layer:T},{distance:E?0:this.options.distance+1,config:{algorithm:this.options.shortestPathAlgorithm,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,considerCosts:this.options.considerCosts,ignoredChars:[this.charToFollow.getId()]}})}},gf=class{static getRandomInt(S){return Math.floor(Math.random()*Math.floor(S))}},QS=class{constructor(S,T=0,E=-1){this.character=S,this.delay=T,this.radius=E,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=S.getNextTilePos().position.y,this.initialCol=S.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(ti(this.character.autoMovementSet().pipe(ji(F=>F!==this),Bs(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=dn.create(S.getNumberOfDirections())}update(S){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=S,this.delayLeft<=0){this.delayLeft=this.delay;let T=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(T),this.currentMovementDirection=T,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(S)).filter(S=>this.isWithinRadius(S))}isWithinRadius(S){return this.radius==-1?!0:this.getDist(S)<=this.radius}getDist(S){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(ls(S)),new ut(this.initialCol,this.initialRow))}getFreeRandomDirection(){let S=this.getFreeDirections();return S.length==0?"none":S[gf.getRandomInt(S.length)]}randomizeStepSize(){this.stepSize=gf.getRandomInt(this.radius)+1}};function kS(S,T){return S.filter(E=>{var F,O,D,c,m,t;return(F=T.labels)!=null&&F.withAllLabels?(O=T.labels)==null?void 0:O.withAllLabels.every(o=>E.hasLabel(o)):(D=T.labels)!=null&&D.withOneOfLabels?(c=T.labels)==null?void 0:c.withOneOfLabels.some(o=>E.hasLabel(o)):(m=T.labels)!=null&&m.withNoneLabels?!((t=T.labels)!=null&&t.withNoneLabels.some(o=>E.hasLabel(o))):!0})}var Wd="2.44.6",qS=class{constructor(S,T){this.collistionStrategy=S,this.collisionGroupRelation=T,this.tilePosToCharacters=new _S,this.charRemoved$=new le}isCharBlockingAt(S,T,E,F=new Set,O=new Set){if(E.length===0)return!1;let D=this.tilePosToCharacters.get(S,T);return!!(D&&D.size>0&&[...D].filter(c=>!F.has(c.getId())).filter(c=>!this.doIntersect(c.getCollisionGroups(),O)).some(c=>E.some(m=>c.getCollisionGroups().some(t=>this.collidesWith(m,t)))))}doIntersect(S,T){for(let E of S)if(T.has(E))return!0;return!1}collidesWith(S,T){return this.collisionGroupRelation?(this.collisionGroupRelation.get(S)||new Set).has(T):S===T}getCharactersAt(S,T){return this.tilePosToCharacters.get(S,T)||new Set}addCharacter(S){this.addTilePositions(S.getTilePos(),S),this.addTilePositions(S.getNextTilePos(),S),this.addPositionChangeSub(S),this.addPositionChangeFinishedSub(S),this.addTilePosSetSub(S)}removeCharacter(S){let T=S.getId();this.charRemoved$.next(T),this.deleteTilePositions(S.getTilePos(),S),this.deleteTilePositions(S.getNextTilePos(),S)}add(S,T,E){let F=this.tilePosToCharacters.get(S,T);F||this.tilePosToCharacters.set(S,T,new Set([E])),F?.add(E)}addTilePosSetSub(S){S.tilePositionSet().pipe(ti(this.charRemoved(S.getId()))).subscribe(T=>{this.deleteTilePositions(S.getNextTilePos(),S),this.addTilePositions(T,S)})}charRemoved(S){var T;return(T=this.charRemoved$)==null?void 0:T.pipe(Bs(1),ji(E=>E==S))}addPositionChangeSub(S){S.positionChangeStarted().pipe(ti(this.charRemoved(S.getId())),this.posChangeToLayerPos()).subscribe(T=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(T.exit,S),this.addTilePositions(T.enter,S)})}addPositionChangeFinishedSub(S){S.positionChangeFinished().pipe(ti(this.charRemoved(S.getId())),this.posChangeToLayerPos()).subscribe(T=>{this.deleteTilePositions(T.exit,S),this.addTilePositions(T.enter,S)})}addTilePositions(S,T){this.forEachCharTile(S,T,(E,F)=>{this.add(new ut(E,F),S.layer,T)})}deleteTilePositions(S,T){this.forEachCharTile(S,T,(E,F)=>{var O;(O=this.tilePosToCharacters.get(new ut(E,F),S.layer))==null||O.delete(T)})}forEachCharTile(S,T,E){let F=S.position;for(let O=F.x;O({enter:{position:new ut(S.enterTile),layer:S.enterLayer},exit:{position:new ut(S.exitTile),layer:S.exitLayer}})))}posToString(S,T){return`${S.x}#${S.y}#${T}`}},_S=class{constructor(){this.memo=new Map}set(S,T,E){let F=this.memo.get(S.x);F||(F=new Map,this.memo.set(S.x,F));let O=F.get(S.y);O||(O=new Map,F.set(S.y,O)),O.set(T,E)}get(S,T){let E=this.memo.get(S.x);if(!E)return;let F=E.get(S.y);if(F)return F.get(T)}},lh=class{constructor(S,T,E,F){this.x=S,this.y=T,this.width=E,this.height=F}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(S){return S.x>=this.x&&S.x=this.y&&S.yE.isCharLayer());for(let E of[...T,void 0]){let F=this.tileCollisionCache.get(E?.getName());if(F===void 0){F=new Array(this.tilemap.getWidth());for(let O=0;O>T&1)==1}var xf="ge_cost",Yd=class Hd{constructor(T,E,F,O=void 0,D=!1){this.tilemap=T,this.collisionTilePropertyName=E,this.useTileCollisionCache=D,this.characters=new Map,this.transitions=new Map,this.reverseTransitions=new Map,this.collidesPropNames=new Map,this.tileCostPropNames=new Map,this.collisionRelevantLayersFrameCache=new Map,this.charBlockCache=new qS(F,O);for(let c of ah())this.collidesPropNames.set(c,Hd.ONE_WAY_COLLIDE_PROP_PREFIX+c),this.tileCostPropNames.set(c,`${xf}_${c}`);this.useTileCollisionCache&&(this.tileCollisionCache=new e2(T,this),this.tileCollisionCache.rebuild())}fixCacheLayer(T){var E;(E=this.tileCollisionCache)==null||E.fixLayer(T)}unfixCacheLayers(){var T;(T=this.tileCollisionCache)==null||T.unfixLayers()}addCharacter(T){this.characters.set(T.getId(),T);let E=T.getNextTilePos().layer;E===void 0?T.setTilePosition(Ki(oe({},T.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(E)||console.warn(`Char layer '${E}' of character '${T.getId()}' is unknown.`),this.charBlockCache.addCharacter(T)}removeCharacter(T){let E=this.characters.get(T);E&&(this.charBlockCache.removeCharacter(E),this.characters.delete(T))}getCharacters(){return[...this.characters.values()]}getCharactersAt(T,E){return this.charBlockCache.getCharactersAt(T,E)}rebuildTileCollisionCache(T){var E;(E=this.tileCollisionCache)==null||E.rebuild(T)}hasBlockingTileUncached(T,E,F,O){if(!O&&this.hasNoTileUncached(T,E))return!0;let D=this.getCollisionRelevantLayers(E);for(let c of D)if(this.isLayerBlockingAt(c.getName(),T,F))return!0;return!1}hasBlockingTile(T,E,F,O){var D;let c=(D=this.tileCollisionCache)==null?void 0:D.isBlockingFrom(T.x,T.y,E,F,O);return c!==void 0?c:this.hasBlockingTileUncached(T,E,F,O)}getTransition(T,E){let F=this.transitions.get(T.toString());if(F)return F.get(E)}getReverseTransitions(T,E){let F=this.reverseTransitions.get(T.toString());if(F)return F.get(E)}setTransition(T,E,F){var O,D,c,m,t;this.transitions.has(T.toString())||this.transitions.set(T.toString(),new Map),this.reverseTransitions.has(T.toString())||this.reverseTransitions.set(T.toString(),new Map),(O=this.transitions.get(T.toString()))==null||O.set(E,F),(D=this.reverseTransitions.get(T.toString()))!=null&&D.has(F)||(c=this.reverseTransitions.get(T.toString()))==null||c.set(F,new Set),(t=(m=this.reverseTransitions.get(T.toString()))==null?void 0:m.get(F))==null||t.add(E)}getTransitions(){return new Map([...this.transitions].map(([T,E])=>[T,new Map(E)]))}getTileCosts(T,E){let F=this.getCollisionRelevantLayers(T.layer),O=1;for(let D of F)O=Math.max(O,this.getTileCostsForLayer(Ki(oe({},T),{layer:D.getName()}),E));return O}getTileCostsForLayer(T,E){let F=this.tilemap.getTileAt(T.position.x,T.position.y,T.layer);return E&&F?.getProperty(this.tileCostPropNames.get(E)||"")||F?.getProperty(xf)||1}hasNoTileUncached(T,E){return!this.getCollisionRelevantLayers(E).some(F=>this.tilemap.hasTileAt(T.x,T.y,F.getName()))}hasNoTile(T,E){var F;let O=(F=this.tileCollisionCache)==null?void 0:F.hasTileAt(T.x,T.y,E);return O!==void 0?O:this.hasNoTileUncached(T,E)}hasBlockingChar(T,E,F,O=new Set,D=new Set){return this.charBlockCache.isCharBlockingAt(T,E,F,O,D)}isInRange(T){return new lh(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(T)}toMapDirection(T){return this.isIsometric()?nS(T):T}fromMapDirection(T){return this.isIsometric()?ld(T):T}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(T,E){let F=T.position.add(ls(this.toMapDirection(E))),O=this.getTransition(F,T.layer)||T.layer;return{position:F,layer:O}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(T,E,F){let O=this.tilemap.getTileAt(E.x,E.y,T);return O?!!(O.getProperty(this.collisionTilePropertyName)||F&&O.getProperty(this.collidesPropNames.get(F)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((T,E)=>({layer:T,index:E})).filter(({layer:T})=>T.isCharLayer()).map(({index:T})=>T)}findPrevAndCharLayer(T){let E=this.getCharLayerIndexes(),F=this.tilemap.getLayers(),O=E.findIndex(D=>F[D].getProperty(pr)==T);return O==0?{prevIndex:-1,charLayerIndex:E[O]}:{prevIndex:E[O-1],charLayerIndex:E[O]}}getCollisionRelevantLayers(T){if(!T)return this.tilemap.getLayers();let E=this.collisionRelevantLayersFrameCache.get(T);if(E)return E;let{prevIndex:F,charLayerIndex:O}=this.findPrevAndCharLayer(T),D=this.tilemap.getLayers().slice(F+1,O+1);return this.collisionRelevantLayersFrameCache.set(T,D),D}getLowestCharLayer(){for(let T of this.tilemap.getLayers())if(T.isCharLayer())return T.getProperty(pr)}getCharLayerNames(){return this.tilemap.getLayers().filter(T=>T.isCharLayer()).map(T=>T.getProperty(pr)).filter(s2)}};Yd.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var i2=Yd;function s2(S){return S!=null}var n2=(S=>(S.REMOVED="REMOVED",S.ADDED="ADDED",S))(n2||{}),r2=(S=>(S.WAIT="WAIT",S.SKIP="SKIP",S.STOP="STOP",S))(r2||{}),a2=class{constructor(S,T){this.character=S,this.tilemap=T,this.queue=new Er,this.finished$=new le,this.pathBlockedWaitElapsed=0,this.distanceUtils=dn.create(S.getNumberOfDirections()),this.character.autoMovementSet().pipe(ji(E=>E!==this),Bs(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(S){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(S))&&this.queue.size()>0&&this.moveCharOnPath(S)}getInfo(){return{type:"Queue"}}enqueue(S,T={}){var E,F,O;let D={pathBlockedStrategy:(E=T.pathBlockedStrategy)!=null?E:"STOP",pathBlockedWaitTimeoutMs:T?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(F=T.ignoreInvalidPositions)!=null?F:!1,skipInvalidPositions:(O=T.skipInvalidPositions)!=null?O:!1};for(let c of S){let m={command:c,config:D};if(Ms(c)){this.queue.enqueue(m);continue}let t=this.queue.peekEnd(),o=t?.command;if(o||(o=this.character.getNextTilePos()),Ms(o)){this.queue.enqueue(m);continue}let v=this.distanceUtils.distance(o.position,c.position)===1;(!T.ignoreInvalidPositions||v)&&this.queue.enqueue(m)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(S){let T=this.queue.peek();if(!T)return;let E=T.command,F=T.config;if(Ms(E)&&(E=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),E)),F.skipInvalidPositions){if(E=this.getNextValidPosition(),!E){this.finishInvalidNextPos(E);return}}else if(!this.isNeighborPos(E)){this.finishInvalidNextPos(E);return}if(this.character.isBlockingDirection(ei(this.character.getNextTilePos().position,E.position))){if(F.pathBlockedStrategy==="STOP")this.finishPathBlocked(E);else if(F.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(S);return}else F.pathBlockedStrategy==="WAIT"&&F.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=S,this.pathBlockedWaitElapsed>=F.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(E,F.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,E.position)),this.isLastMovement()&&this.finish("SUCCESS","",E)}getNextValidPosition(){for(var S;this.queue.size()>0;){let T=(S=this.queue.peek())==null?void 0:S.command;if(Ms(T)&&(T=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),T)),T&&this.isNeighborPos(T))return T;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(S){let T=this.distanceUtils.distance(this.character.getNextTilePos().position,S.position)===1,E=this.tilemap.getTransition(S.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==S.layer)return T&&E===S.layer;let F=E!==void 0&&E!==S.layer;return T&&!F}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(S){S?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(S)} is not reachable from ${this.posToStr(this.character.getNextTilePos())}.`):this.finish("INVALID_NEXT_POS",`No enqueued position is reachable from ${this.posToStr(this.character.getNextTilePos())}.`)}finishPathBlocked(S){this.finish("PATH_BLOCKED",`Position ${this.posToStr(S)} is blocked.`)}finishBlockedWaitTimeout(S,T){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(S)} is blocked and the wait timeout of ${T} ms has been exceeded.`)}finish(S,T="",E=this.character.getNextTilePos()){this.queue=new Er,this.finished$.next({position:E.position,result:S,description:T,layer:E.layer})}getDir(S,T){return this.tilemap.fromMapDirection(ei(S,T))}posToStr(S){return`(${S.position.x}, ${S.position.y}, ${S.layer})`}},o2=class{constructor(S=!0){this.isCreatedInternal=!1,S&&console.log(`Using GridEngine v${Wd}`)}getCharLayer(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getTilePos().layer}getTransition(S,T){var E;return this.initGuard(),(E=this.gridTilemap)==null?void 0:E.getTransition(new ut(S),T)}setTransition(S,T,E){var F;return this.initGuard(),(F=this.gridTilemap)==null?void 0:F.setTransition(new ut(S),T,E)}create(S,T){this.isCreatedInternal=!0,this.gridCharacters=new Map;let E=this.setConfigDefaults(T);this.config=E,this.movementStopped$=new le,this.movementStarted$=new le,this.directionChanged$=new le,this.positionChangeStarted$=new le,this.positionChangeFinished$=new le,this.queueMovementFinished$=new le,this.charRemoved$=new le,this.charAdded$=new le,this.gridTilemap=new i2(S,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(S){return S?new Map(Object.entries(S).map(([T,E])=>[T,new Set(E)])):void 0}getPosition(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getTilePos().position}move(S,T){this.moveChar(S,T)}moveRandomly(S,T=0,E=-1){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(S);if(!O)throw this.createCharUnknownErr(S);let D=new QS(O,T,E);O.setMovement(D)}getMovement(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);let F=E.getMovement();return F?F.getInfo():{type:"None"}}moveTo(S,T,E){var F;let O=this.assembleMoveToConfig(E);this.initGuard();let D=(F=this.gridCharacters)==null?void 0:F.get(S);if(!D)throw this.createCharUnknownErr(S);if(!this.gridTilemap)throw this.createUninitializedErr();let c=new jd(D,this.gridTilemap,{position:new ut(T),layer:E?.targetLayer||D.getNextTilePos().layer},{distance:0,config:O});return D.setMovement(c),c.finishedObs().pipe(an(m=>({charId:S,position:m.position,result:m.result,description:m.description,layer:m.layer})))}stopMovement(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);E.setMovement(void 0)}setSpeed(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);F.setSpeed(T)}getSpeed(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getSpeed()}collidesWithTiles(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.collidesWithTiles()}update(S,T){var E;if(this.isCreatedInternal&&this.gridCharacters)for(let[F,O]of this.gridCharacters)O.update(T);(E=this.gridTilemap)==null||E.invalidateFrameCache()}addCharacter(S){var T,E,F,O,D;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let c={speed:S.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:S.charLayer,facingDirection:S.facingDirection,labels:S.labels,numberOfDirections:(T=S.numberOfDirections)!=null?T:this.config.numberOfDirections,tileWidth:S.tileWidth,tileHeight:S.tileHeight};typeof S.collides=="boolean"?S.collides===!1&&(c.collidesWithTiles=!1,c.collisionGroups=[]):S.collides!==void 0&&(S.collides.collidesWithTiles===!1&&(c.collidesWithTiles=!1),S.collides.collisionGroups&&(c.collisionGroups=S.collides.collisionGroups),S.collides.ignoreCollisionGroups&&(c.ignoreCollisionGroups=S.collides.ignoreCollisionGroups),c.ignoreMissingTiles=(F=(E=S.collides)==null?void 0:E.ignoreMissingTiles)!=null?F:!1);let m=new VS(S.id,c);S.startPosition&&m.setTilePosition({position:new ut(S.startPosition),layer:m.getTilePos().layer}),(O=this.gridCharacters)==null||O.set(S.id,m),this.gridTilemap.addCharacter(m);let t=m.getId();m.movementStopped().pipe(ti(this.charRemoved(t))).subscribe(o=>{var v;(v=this.movementStopped$)==null||v.next({charId:t,direction:o})}),m.movementStarted().pipe(ti(this.charRemoved(t))).subscribe(o=>{var v;(v=this.movementStarted$)==null||v.next({charId:t,direction:o})}),m.directionChanged().pipe(ti(this.charRemoved(t))).subscribe(o=>{var v;(v=this.directionChanged$)==null||v.next({charId:t,direction:o})}),m.positionChangeStarted().pipe(ti(this.charRemoved(t))).subscribe(o=>{var v;(v=this.positionChangeStarted$)==null||v.next(oe({charId:t},o))}),m.positionChangeFinished().pipe(ti(this.charRemoved(t))).subscribe(o=>{var v;(v=this.positionChangeFinished$)==null||v.next(oe({charId:t},o))}),(D=this.charAdded$)==null||D.next(t)}hasCharacter(S){var T;return this.initGuard(),!!((T=this.gridCharacters)!=null&&T.has(S))}removeCharacter(S){var T,E,F,O;if(this.initGuard(),!((T=this.gridCharacters)!=null&&T.get(S)))throw this.createCharUnknownErr(S);(E=this.gridTilemap)==null||E.removeCharacter(S),(F=this.gridCharacters)==null||F.delete(S),(O=this.charRemoved$)==null||O.next(S)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let S of this.gridCharacters.keys())this.removeCharacter(S)}getAllCharacters(S){if(this.initGuard(),!this.gridCharacters)return[];let T=[...this.gridCharacters.values()];return(S?kS(T,S):T).map(E=>E.getId())}getLabels(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getLabels()}addLabels(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);F.addLabels(T)}removeLabels(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);F.removeLabels(T)}clearLabels(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);E.clearLabels()}follow(S,T,E,F){var O,D,c,m,t,o;let v;E===void 0?v={distance:0,closestPointIfBlocked:!1}:typeof E=="number"?(v={distance:E,closestPointIfBlocked:!1},F&&(v.closestPointIfBlocked=!0)):v=E,this.initGuard();let a=(O=this.gridCharacters)==null?void 0:O.get(S),r=(D=this.gridCharacters)==null?void 0:D.get(T);if(!a)throw this.createCharUnknownErr(S);if(!r)throw this.createCharUnknownErr(T);if(!this.gridTilemap)throw this.createUninitializedErr();let n=new JS(a,this.gridTilemap,r,{distance:(c=v.distance)!=null?c:0,noPathFoundStrategy:v.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(m=v.maxPathLength)!=null?m:1/0,shortestPathAlgorithm:(t=v.algorithm)!=null?t:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!v.ignoreLayers,facingDirection:(o=v.facingDirection)!=null?o:"none"});a.setMovement(n)}isMoving(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.isMoving()}getFacingDirection(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getFacingDirection()}getFacingPosition(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);let F=E.getFacingPosition();return{x:F.x,y:F.y}}turnTowards(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);return F.turnTowards(T)}getCharactersAt(S,T){if(this.initGuard(),!this.gridTilemap)return[];let E=this.gridTilemap.getCharactersAt(new ut(S),T);return Array.from(E).map(F=>F.getId())}setPosition(S,T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(S);if(!O)throw this.createCharUnknownErr(S);E||O.setTilePosition({position:new ut(T),layer:O.getTilePos().layer}),O.setTilePosition({position:new ut(T),layer:E})}isBlocked(S,T,E=["geDefault"]){var F,O;this.initGuard();let D=new ut(S);return!!((F=this.gridTilemap)!=null&&F.hasBlockingTile(D,T)||(O=this.gridTilemap)!=null&&O.hasBlockingChar(D,T,E))}isTileBlocked(S,T){var E;return this.initGuard(),!!((E=this.gridTilemap)!=null&&E.hasBlockingTile(new ut(S),T))}getCollisionGroups(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getCollisionGroups()||[]}setCollisionGroups(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);F.setCollisionGroups(T)}getIgnoreCollisionGroups(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(S,T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(S);if(!F)throw this.createCharUnknownErr(S);F.setIgnoreCollisionGroups(T)}getTilePosInDirection(S,T,E){if(!this.gridTilemap)throw this.createUninitializedErr();let F=this.gridTilemap.getTilePosInDirection({position:new ut(S),layer:T},E);return{position:F.position.toPosition(),charLayer:F.layer}}findShortestPath(S,T,E={}){if(!this.gridTilemap)throw this.createUninitializedErr();let F=E.shortestPathAlgorithm||"BFS";E.considerCosts&&F!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${F}'. It can only be used with A* algorithm.`);let O=E.pathWidth!==void 0&&E.pathWidth!==1,D=E.pathHeight!==void 0&&E.pathHeight!==1;(O||D)&&F==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let c=new Kd(this.gridTilemap).findShortestPath(Ut.toInternal(S),Ut.toInternal(T),Ki(oe({},E),{shortestPathAlgorithm:F}));return{path:c.path.map(Ut.fromInternal),closestToTarget:c.closestToTarget?Ut.fromInternal(c.closestToTarget):void 0,reachedMaxPathLength:!1,steps:c.steps}}steppedOn(S,T,E){return this.positionChangeFinished().pipe(ji(F=>S.includes(F.charId)&&T.some(O=>O.x===F.enterTile.x&&O.y===F.enterTile.y)&&(E===void 0||E.includes(F.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(an(S=>({charId:S,action:"ADDED"})),XS(this.charRemoved$.pipe(an(S=>({charId:S,action:"REMOVED"})))))}movementStarted(){if(!this.movementStarted$)throw this.createUninitializedErr();return this.movementStarted$}movementStopped(){if(!this.movementStopped$)throw this.createUninitializedErr();return this.movementStopped$}directionChanged(){if(!this.directionChanged$)throw this.createUninitializedErr();return this.directionChanged$}positionChangeStarted(){if(!this.positionChangeStarted$)throw this.createUninitializedErr();return this.positionChangeStarted$}positionChangeFinished(){if(!this.positionChangeFinished$)throw this.createUninitializedErr();return this.positionChangeFinished$}getMovementProgress(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getMovementProgress()}rebuildTileCollisionCache(S,T,E,F){var O;(O=this.gridTilemap)==null||O.rebuildTileCollisionCache(new lh(S,T,E,F))}addQueueMovements(S,T,E){var F,O;this.initGuard();let D=(F=this.gridCharacters)==null?void 0:F.get(S);if(!D)throw this.createCharUnknownErr(S);if(!this.gridTilemap)throw this.createUninitializedErr();let c;((O=D?.getMovement())==null?void 0:O.getInfo().type)==="Queue"?c=D.getMovement():(c=new a2(D,this.gridTilemap),D.setMovement(c),c.finished().pipe(ti(NS(this.charRemoved(S),D.autoMovementSet()))).subscribe(m=>{var t;(t=this.queueMovementFinished$)==null||t.next(oe({charId:S},m))})),c.enqueue(T.map(m=>Ms(m)?m:{position:new ut(m.position),layer:m.charLayer}),E)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(S){var T,E;this.initGuard();let F=(T=this.gridCharacters)==null?void 0:T.get(S);if(!F)throw this.createCharUnknownErr(S);return((E=F.getMovement())==null?void 0:E.getInfo().type)==="Queue"?F.getMovement().peekAll().map(O=>({command:Ms(O.command)?O.command:Ut.fromInternal(O.command),config:O.config})):[]}clearEnqueuedMovements(S){var T,E;this.initGuard();let F=(T=this.gridCharacters)==null?void 0:T.get(S);if(!F)throw this.createCharUnknownErr(S);((E=F.getMovement())==null?void 0:E.getInfo().type)==="Queue"&&F.getMovement().clear()}getTileCost(S,T,E){var F,O;return this.initGuard(),(O=(F=this.gridTilemap)==null?void 0:F.getTileCosts({position:new ut(S),layer:T},E))!=null?O:1}getState(){let S=[];if(this.gridCharacters)for(let[T,E]of this.gridCharacters.entries())S.push({id:T,position:Ut.fromInternal(E.getTilePos()),facingDirection:E.getFacingDirection(),speed:E.getSpeed(),labels:E.getLabels(),movementProgress:E.getMovementProgress(),collisionConfig:{collisionGroups:E.getCollisionGroups(),ignoreCollisionGroups:E.getIgnoreCollisionGroups(),collidesWithTiles:E.collidesWithTiles(),ignoreMissingTiles:E.getIgnoreMissingTiles()}});return{characters:S}}setState(S){if(this.gridCharacters)for(let T of S.characters){let E=this.gridCharacters.get(T.id);if(E){let F=E.getTilePos();Ut.equal(F,Ut.toInternal(T.position))||E.setTilePosition(Ut.toInternal(T.position)),E.setSpeed(T.speed),E.turnTowards(T.facingDirection),T.collisionConfig.collisionGroups&&E.setCollisionGroups(T.collisionConfig.collisionGroups),T.collisionConfig.collidesWithTiles!==void 0&&E.setCollidesWithTiles(T.collisionConfig.collidesWithTiles),T.collisionConfig.ignoreMissingTiles!==void 0&&E.setIgnoreMissingTiles(T.collisionConfig.ignoreMissingTiles),E.setMovementProgress(T.movementProgress),E.clearLabels(),E.addLabels(T.labels)}}}charRemoved(S){var T;if(!this.charRemoved$)throw this.createUninitializedErr();return(T=this.charRemoved$)==null?void 0:T.pipe(Bs(1),ji(E=>E==S))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var S;(S=this.config)==null||S.characters.forEach(T=>this.addCharacter(T))}moveChar(S,T){var E,F,O;this.initGuard();let D=(E=this.gridCharacters)==null?void 0:E.get(S);if(!D)throw this.createCharUnknownErr(S);if(D.getNumberOfDirections()===4){if(!((F=this.gridTilemap)!=null&&F.isIsometric())&&rn(T)){console.warn(`GridEngine: Character '${S}' can't be moved '${T}' in 4 direction mode.`);return}else if((O=this.gridTilemap)!=null&&O.isIsometric()&&!rn(T)){console.warn(`GridEngine: Character '${S}' can't be moved '${T}' in 4 direction isometric mode.`);return}}D.move(T)}createCharUnknownErr(S){return new Error(`Character unknown: ${S}`)}assembleMoveToConfig(S={}){let T=Ki(oe({},S),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return S!=null&&S.noPathFoundStrategy&&(Object.values(zd).includes(S.noPathFoundStrategy)?T.noPathFoundStrategy=S.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${S.noPathFoundStrategy}'. Falling back to 'STOP'`)),S!=null&&S.pathBlockedStrategy&&(Object.values(Ud).includes(S.pathBlockedStrategy)?T.pathBlockedStrategy=S.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${S.pathBlockedStrategy}'. Falling back to 'WAIT'`)),T}setConfigDefaults(S){return oe({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},S)}},h2=class extends Vd{constructor(S,T={}){super(S,T),this.jumpCache=new yf}findShortestPathImpl(S,T){return this.jumpCache=new yf,super.findShortestPathImpl(S,T)}getNeighborsInternal(S,T,E){if(!T||S.layer!==T.layer)return this.getNeighbors(S,E).map(D=>({p:D,dist:1}));let F=this.prune(T,S).map(D=>{let c=this.getTransition(D.position,S.layer);return{position:D.position,layer:c||S.layer}}),O=[];for(let D of F){let c=this.jump(S,D,E,1,ei(S.position,D.position));c&&(c.dist=this.distance(S.position,c.p.position),O.push(c))}return O}getForced(S,T){let E=[],{topLeft:F,downLeft:O,top:D,bottom:c,topRight:m,downRight:t}=this.normalizedPositions(S,T),o=ei(S.position,T.position);return rn(o)?(this.blockOrTrans(S,F)&&(this.addIfNotBlocked(E,T,D),this.addIfNotBlocked(E,T,m),this.blockOrTrans(O,F)&&this.addIfNotBlocked(E,T,F)),this.blockOrTrans(S,O)&&(this.addIfNotBlocked(E,T,c),this.addIfNotBlocked(E,T,t),this.blockOrTrans(F,O)&&this.addIfNotBlocked(E,T,O)),this.blockOrTrans(F,D)&&this.addIfNotBlocked(E,T,D),this.blockOrTrans(O,c)&&this.addIfNotBlocked(E,T,c),this.blockOrTrans(F,m)&&this.addIfNotBlocked(E,T,m),this.blockOrTrans(O,t)&&this.addIfNotBlocked(E,T,t)):((this.blockOrTrans(S,D)||this.blockOrTrans(D,m))&&this.addIfNotBlocked(E,T,m),(this.blockOrTrans(S,c)||this.blockOrTrans(c,t))&&this.addIfNotBlocked(E,T,t),this.blockOrTrans(S,F)&&this.blockOrTrans(S,D)&&(this.addIfNotBlocked(E,T,D),this.addIfNotBlocked(E,T,F)),this.blockOrTrans(S,O)&&this.blockOrTrans(S,c)&&(this.addIfNotBlocked(E,T,c),this.addIfNotBlocked(E,T,O)),this.blockOrTrans(F,D)&&this.blockOrTrans(S,D)&&this.addIfNotBlocked(E,T,D),this.blockOrTrans(O,c)&&this.blockOrTrans(S,c)&&this.addIfNotBlocked(E,T,c)),E}hasForced(S,T){let{topLeft:E,downLeft:F,top:O,bottom:D,topRight:c,downRight:m}=this.normalizedPositions(S,T),t=ei(S.position,T.position);if(rn(t)){if(this.blockOrTrans(S,E)&&(!this.blockOrTrans(T,O)||!this.blockOrTrans(T,c)||this.blockOrTrans(F,E)&&!this.blockOrTrans(T,E))||this.blockOrTrans(S,F)&&(!this.blockOrTrans(T,D)||!this.blockOrTrans(T,m)||this.blockOrTrans(E,F)&&!this.blockOrTrans(T,F))||this.blockOrTrans(E,O)&&!this.blockOrTrans(T,O)||this.blockOrTrans(F,D)&&!this.blockOrTrans(T,D)||this.blockOrTrans(E,c)&&!this.blockOrTrans(T,c)||this.blockOrTrans(F,m)&&!this.blockOrTrans(T,m))return!0}else if((this.blockOrTrans(S,O)||this.blockOrTrans(O,c))&&!this.blockOrTrans(T,c)||(this.blockOrTrans(S,D)||this.blockOrTrans(D,m))&&!this.blockOrTrans(T,m)||this.blockOrTrans(S,E)&&this.blockOrTrans(S,O)&&(!this.blockOrTrans(T,O)||!this.blockOrTrans(T,E))||this.blockOrTrans(S,F)&&this.blockOrTrans(S,D)&&(!this.blockOrTrans(T,D)||!this.blockOrTrans(T,F))||this.blockOrTrans(E,O)&&this.blockOrTrans(S,O)&&!this.blockOrTrans(T,O)||this.blockOrTrans(F,D)&&this.blockOrTrans(S,D)&&!this.blockOrTrans(T,D))return!0;return!1}prune(S,T){let{top:E,right:F,topRight:O,downRight:D,bottom:c}=this.normalizedPositions(S,T),m=this.getForced(S,T),t=ei(S.position,T.position);return rn(t)?[E,F,O,D,c,...m]:[F,...m]}jump(S,T,E,F,O){let D=this.jumpCache.get(S,T);if(D!==null)return D;if(this.isBlocking(S,T)&&!(Ut.equal(T,E)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(S,T,void 0);return}if(Ut.equal(T,E))return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(F>=this.maxJumpSize)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.getTransition(T.position,S.layer)!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.hasForced(S,T))return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.updateClosestToTarget(T,E),O==="up-left"){if(this.jump(T,this.getTilePosInDir(T,"up"),E,F+1,"up")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"left"),E,F+1,"left")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="down-left"){if(this.jump(T,this.getTilePosInDir(T,"down"),E,F+1,"down")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"left"),E,F+1,"left")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="up-right"){if(this.jump(T,this.getTilePosInDir(T,"up"),E,F+1,"up")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"right"),E,F+1,"right")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="down-right"){if(this.jump(T,this.getTilePosInDir(T,"down"),E,F+1,"down")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"right"),E,F+1,"right")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}let c=this.jump(T,this.getTilePosInDir(T,O),E,F+1,O);return this.jumpCache.set(S,T,c),c}normalizedPositions(S,T){return S.position.xT.position.x&&S.position.y===T.position.y?{topLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y),layer:T.layer},topRight:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},downRight:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer}}:S.position.yT.position.y&&S.position.x===T.position.x?{topLeft:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},top:{position:new ut(T.position.x-1,T.position.y),layer:T.layer},bottom:{position:new ut(T.position.x+1,T.position.y),layer:T.layer},right:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},topRight:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer},downRight:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer}}:S.position.yT.position.x?{topLeft:{position:new ut(T.position.x+1,T.position.y),layer:T.layer},downLeft:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},topRight:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},downRight:{position:new ut(T.position.x-1,T.position.y),layer:T.layer}}:S.position.y>T.position.y&&S.position.x(S.SUCCESS="SUCCESS",S.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",S.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",S.PATH_BLOCKED="PATH_BLOCKED",S.NO_PATH_FOUND="NO_PATH_FOUND",S.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",S.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",S.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",S))(u2||{}),jd=class{constructor(S,T,E,{config:F,ignoreBlockedTarget:O=!1,distance:D=0}={}){this.character=S,this.tilemap=T,this.targetPos=E,this.shortestPath=[],this.distOffset=0,this.posOnPath=0,this.stopped=!1,this.pathBlockedWaitElapsed=0,this.isPositionAllowed=()=>!0,this.shortestPathAlgorithm="BIDIRECTIONAL_SEARCH",this.maxPathLength=1/0,this.considerCosts=!1,this.ignoredChars=[],this.isBlocking=(t,o)=>t?new Xd(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:t,layer:o}):!0;var c,m;this.shortestPathAlgorithm=(c=F?.algorithm)!=null?c:this.shortestPathAlgorithm,this.ignoreBlockedTarget=O,this.distance=D,this.noPathFoundStrategy=F?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=F?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new ff(F?.noPathFoundRetryBackoffMs||200,F?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new ff(F?.pathBlockedRetryBackoffMs||200,F?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),F!=null&&F.isPositionAllowedFn&&(this.isPositionAllowed=F.isPositionAllowedFn),F!=null&&F.maxPathLength&&(this.maxPathLength=F.maxPathLength),this.alternativeTargets=F?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=F?.noPathFoundAlternativeTargetsFallbackStrategy,F!=null&&F.considerCosts&&this.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.considerCosts=F?.considerCosts||!1,this.ignoreLayers=!!(F!=null&&F.ignoreLayers),this.distanceUtils=dn.create(S.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=F?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(m=F?.ignoredChars)!=null?m:[],this.finished$=new le,this.setCharacter(S)}setPathBlockedStrategy(S){this.pathBlockedStrategy=S}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(S){this.character=S,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(ji(T=>T!==this),Bs(1)).subscribe(()=>{this.stop("MOVEMENT_TERMINATED")})}getPathfindingOptions(){return{shortestPathAlgorithm:this.shortestPathAlgorithm,pathWidth:this.character.getTileWidth(),pathHeight:this.character.getTileHeight(),numberOfDirections:this.character.getNumberOfDirections(),isPositionAllowed:this.isPositionAllowed,collisionGroups:this.character.getCollisionGroups(),ignoredChars:[this.character.getId(),...this.ignoredChars],ignoreTiles:!this.character.collidesWithTiles(),ignoreMapBounds:this.character.getIgnoreMissingTiles(),ignoreBlockedTarget:this.ignoreBlockedTarget,maxPathLength:this.maxPathLength,ignoreLayers:this.ignoreLayers,considerCosts:this.considerCosts,calculateClosestToTarget:!0}}update(S){var T,E,F,O;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(S,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((T=this.nextTileOnPath())==null?void 0:T.position,(E=this.character)==null?void 0:E.getNextTilePos().layer)?this.applyPathBlockedStrategy(S):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((F=this.nextTileOnPath())==null?void 0:F.position,(O=this.character)==null?void 0:O.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(S=>Ut.fromInternal(S))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:Ut.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(S){switch(S){case"SUCCESS":return"Successfully arrived.";case"MOVEMENT_TERMINATED":return"Movement of character has been replaced before destination was reached.";case"PATH_BLOCKED":return"PathBlockedStrategy STOP: Path blocked.";case"NO_PATH_FOUND_MAX_RETRIES_EXCEEDED":return`NoPathFoundStrategy RETRY: Maximum retries of ${this.noPathFoundRetryable.getMaxRetries()} exceeded.`;case"NO_PATH_FOUND":return"NoPathFoundStrategy STOP: No path found.";case"PATH_BLOCKED_MAX_RETRIES_EXCEEDED":return`PathBlockedStrategy RETRY: Maximum retries of ${this.pathBlockedRetryable.getMaxRetries()} exceeded.`;case"PATH_BLOCKED_WAIT_TIMEOUT":return`PathBlockedStrategy WAIT: Wait timeout of ${this.pathBlockedWaitTimeoutMs}ms exceeded.`}}applyPathBlockedStrategy(S){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(S,()=>{let T=this.getShortestPath();T.path.length>0&&this.calcShortestPath(T)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=S,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let S=this.nextTileOnPath();if(!S)return;let T=this.getDir(this.character.getNextTilePos().position,S.position);this.character.move(T)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(S){this.finished$.next({position:this.character.getTilePos().position,result:S,description:this.resultToReason(S),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let S=this.shortestPath[this.posOnPath+1],T=this.getDir(this.character.getNextTilePos().position,S.position);this.character.turnTowards(T)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let S=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:D,distOffset:c}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:E,distOffset:0}}pathToAlternativeTarget(S,T){let E=T.findShortestPath(this.character.getNextTilePos(),S,this.getPathfindingOptions()).path,F=this.distanceUtils.distance(S.position,this.targetPos.position);return{path:E,distOffset:F}}getDir(S,T){return this.tilemap.fromMapDirection(this.distanceUtils.direction(S,T))}},f2=Object.create,$d=Object.defineProperty,d2=Object.getOwnPropertyDescriptor,c2=Object.getOwnPropertyNames,v2=Object.getPrototypeOf,p2=Object.prototype.hasOwnProperty,g2=(S,T)=>()=>(T||S((T={exports:{}}).exports,T),T.exports),m2=(S,T,E,F)=>{if(T&&typeof T=="object"||typeof T=="function")for(let O of c2(T))!p2.call(S,O)&&O!==E&&$d(S,O,{get:()=>T[O],enumerable:!(F=d2(T,O))||F.enumerable});return S},uh=(S,T,E)=>(E=S!=null?f2(v2(S)):{},m2(T||!S||!S.__esModule?$d(E,"default",{value:S,enumerable:!0}):E,S)),fh=g2((S,T)=>{(function(){var E,F="4.17.21",O=200,D="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",m="Invalid `variable` option passed into `_.template`",t="__lodash_hash_undefined__",o=500,v="__lodash_placeholder__",a=1,r=2,n=4,e=1,i=2,h=1,s=2,l=4,f=8,u=16,d=32,p=64,g=128,y=256,x=512,C=30,P="...",M=800,w=16,I=1,L=2,B=3,N=1/0,G=9007199254740991,V=17976931348623157e292,K=NaN,j=4294967295,J=j-1,X=j>>>1,Y=[["ary",g],["bind",h],["bindKey",s],["curry",f],["curryRight",u],["flip",x],["partial",d],["partialRight",p],["rearg",y]],b="[object Arguments]",z="[object Array]",W="[object AsyncFunction]",H="[object Boolean]",Z="[object Date]",Q="[object DOMException]",k="[object Error]",et="[object Function]",st="[object GeneratorFunction]",rt="[object Map]",ot="[object Number]",ft="[object Null]",at="[object Object]",vt="[object Promise]",At="[object Proxy]",Et="[object RegExp]",Pt="[object Set]",ct="[object String]",Ct="[object Symbol]",pt="[object Undefined]",wt="[object WeakMap]",Bt="[object WeakSet]",jt="[object ArrayBuffer]",zt="[object DataView]",Yt="[object Float32Array]",bt="[object Float64Array]",ne="[object Int8Array]",Qt="[object Int16Array]",fe="[object Int32Array]",ce="[object Uint8Array]",Pe="[object Uint8ClampedArray]",ri="[object Uint16Array]",ai="[object Uint32Array]",xi=/\b__p \+= '';/g,yi=/\b(__p \+=) '' \+/g,Ti=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xh=/&(?:amp|lt|gt|quot|#39);/g,yh=/[&<>"']/g,Oc=RegExp(xh.source),Dc=RegExp(yh.source),Ic=/<%-([\s\S]+?)%>/g,Bc=/<%([\s\S]+?)%>/g,Th=/<%=([\s\S]+?)%>/g,bc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nc=/^\w*$/,Gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sa=/[\\^$.*+?()[\]{}|]/g,zc=RegExp(sa.source),na=/^\s+/,Uc=/\s/,Xc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vc=/\{\n\/\* \[wrapped with (.+)\] \*/,Wc=/,? & /,Yc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Hc=/[()=,{}\[\]\/\s]/,Kc=/\\(\\)?/g,jc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sh=/\w*$/,$c=/^[-+]0x[0-9a-f]+$/i,Zc=/^0b[01]+$/i,Jc=/^\[object .+?Constructor\]$/,Qc=/^0o[0-7]+$/i,kc=/^(?:0|[1-9]\d*)$/,qc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Tn=/($^)/,_c=/['\n\r\u2028\u2029\\]/g,Sn="\\ud800-\\udfff",tv="\\u0300-\\u036f",ev="\\ufe20-\\ufe2f",iv="\\u20d0-\\u20ff",Ch=tv+ev+iv,Eh="\\u2700-\\u27bf",Ph="a-z\\xdf-\\xf6\\xf8-\\xff",sv="\\xac\\xb1\\xd7\\xf7",nv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",rv="\\u2000-\\u206f",av=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ah="A-Z\\xc0-\\xd6\\xd8-\\xde",Mh="\\ufe0e\\ufe0f",wh=sv+nv+rv+av,ra="['’]",ov="["+Sn+"]",Rh="["+wh+"]",Cn="["+Ch+"]",Fh="\\d+",hv="["+Eh+"]",Lh="["+Ph+"]",Oh="[^"+Sn+wh+Fh+Eh+Ph+Ah+"]",aa="\\ud83c[\\udffb-\\udfff]",lv="(?:"+Cn+"|"+aa+")",Dh="[^"+Sn+"]",oa="(?:\\ud83c[\\udde6-\\uddff]){2}",ha="[\\ud800-\\udbff][\\udc00-\\udfff]",ds="["+Ah+"]",Ih="\\u200d",Bh="(?:"+Lh+"|"+Oh+")",uv="(?:"+ds+"|"+Oh+")",bh="(?:"+ra+"(?:d|ll|m|re|s|t|ve))?",Nh="(?:"+ra+"(?:D|LL|M|RE|S|T|VE))?",Gh=lv+"?",zh="["+Mh+"]?",fv="(?:"+Ih+"(?:"+[Dh,oa,ha].join("|")+")"+zh+Gh+")*",dv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Uh=zh+Gh+fv,vv="(?:"+[hv,oa,ha].join("|")+")"+Uh,pv="(?:"+[Dh+Cn+"?",Cn,oa,ha,ov].join("|")+")",gv=RegExp(ra,"g"),mv=RegExp(Cn,"g"),la=RegExp(aa+"(?="+aa+")|"+pv+Uh,"g"),xv=RegExp([ds+"?"+Lh+"+"+bh+"(?="+[Rh,ds,"$"].join("|")+")",uv+"+"+Nh+"(?="+[Rh,ds+Bh,"$"].join("|")+")",ds+"?"+Bh+"+"+bh,ds+"+"+Nh,cv,dv,Fh,vv].join("|"),"g"),yv=RegExp("["+Ih+Sn+Ch+Mh+"]"),Tv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Cv=-1,re={};re[Yt]=re[bt]=re[ne]=re[Qt]=re[fe]=re[ce]=re[Pe]=re[ri]=re[ai]=!0,re[b]=re[z]=re[jt]=re[H]=re[zt]=re[Z]=re[k]=re[et]=re[rt]=re[ot]=re[at]=re[Et]=re[Pt]=re[ct]=re[wt]=!1;var se={};se[b]=se[z]=se[jt]=se[zt]=se[H]=se[Z]=se[Yt]=se[bt]=se[ne]=se[Qt]=se[fe]=se[rt]=se[ot]=se[at]=se[Et]=se[Pt]=se[ct]=se[Ct]=se[ce]=se[Pe]=se[ri]=se[ai]=!0,se[k]=se[et]=se[wt]=!1;var Ev={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Pv={"&":"&","<":"<",">":">",'"':""","'":"'"},Av={"&":"&","<":"<",">":">",""":'"',"'":"'"},Mv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},wv=parseFloat,Rv=parseInt,Xh=typeof global=="object"&&global&&global.Object===Object&&global,Fv=typeof self=="object"&&self&&self.Object===Object&&self,Se=Xh||Fv||Function("return this")(),ua=typeof S=="object"&&S&&!S.nodeType&&S,Zi=ua&&typeof T=="object"&&T&&!T.nodeType&&T,Vh=Zi&&Zi.exports===ua,fa=Vh&&Xh.process,je=function(){try{var ht=Zi&&Zi.require&&Zi.require("util").types;return ht||fa&&fa.binding&&fa.binding("util")}catch{}}(),Wh=je&&je.isArrayBuffer,Yh=je&&je.isDate,Hh=je&&je.isMap,Kh=je&&je.isRegExp,jh=je&&je.isSet,$h=je&&je.isTypedArray;function ze(ht,gt,dt){switch(dt.length){case 0:return ht.call(gt);case 1:return ht.call(gt,dt[0]);case 2:return ht.call(gt,dt[0],dt[1]);case 3:return ht.call(gt,dt[0],dt[1],dt[2])}return ht.apply(gt,dt)}function Lv(ht,gt,dt,Rt){for(var Nt=-1,kt=ht==null?0:ht.length;++Nt-1}function da(ht,gt,dt){for(var Rt=-1,Nt=ht==null?0:ht.length;++Rt-1;);return dt}function el(ht,gt){for(var dt=ht.length;dt--&&cs(gt,ht[dt],0)>-1;);return dt}function Uv(ht,gt){for(var dt=ht.length,Rt=0;dt--;)ht[dt]===gt&&++Rt;return Rt}var Xv=ga(Ev),Vv=ga(Pv);function Wv(ht){return"\\"+Mv[ht]}function Yv(ht,gt){return ht==null?E:ht[gt]}function vs(ht){return yv.test(ht)}function Hv(ht){return Tv.test(ht)}function Kv(ht){for(var gt,dt=[];!(gt=ht.next()).done;)dt.push(gt.value);return dt}function Ta(ht){var gt=-1,dt=Array(ht.size);return ht.forEach(function(Rt,Nt){dt[++gt]=[Nt,Rt]}),dt}function il(ht,gt){return function(dt){return ht(gt(dt))}}function Bi(ht,gt){for(var dt=-1,Rt=ht.length,Nt=0,kt=[];++dt-1}function Dp(A,R){var U=this.__data__,$=Xn(U,A);return $<0?(++this.size,U.push([A,R])):U[$][1]=R,this}Si.prototype.clear=Rp,Si.prototype.delete=Fp,Si.prototype.get=Lp,Si.prototype.has=Op,Si.prototype.set=Dp;function Ci(A){var R=-1,U=A==null?0:A.length;for(this.clear();++R=R?A:R)),A}function Qe(A,R,U,$,q,tt){var it,nt=R&a,lt=R&r,mt=R&n;if(U&&(it=q?U(A,$,q,tt):U(A)),it!==E)return it;if(!he(A))return A;var xt=Gt(A);if(xt){if(it=N0(A),!nt)return Ie(A,it)}else{var Tt=Re(A),Mt=Tt==et||Tt==st;if(Vi(A))return zl(A,nt);if(Tt==at||Tt==b||Mt&&!q){if(it=lt||Mt?{}:su(A),!nt)return lt?A0(A,Zp(it,A)):P0(A,vl(it,A))}else{if(!se[Tt])return q?A:{};it=G0(A,Tt,nt)}}tt||(tt=new hi);var Ft=tt.get(A);if(Ft)return Ft;tt.set(A,it),Du(A)?A.forEach(function(It){it.add(Qe(It,R,U,It,A,tt))}):Lu(A)&&A.forEach(function(It,Ht){it.set(Ht,Qe(It,R,U,Ht,A,tt))});var Dt=mt?lt?ja:Ka:lt?be:Ce,Vt=xt?E:Dt(A);return $e(Vt||A,function(It,Ht){Vt&&(Ht=It,It=A[Ht]),Ws(it,Ht,Qe(It,R,U,Ht,A,tt))}),it}function Jp(A){var R=Ce(A);return function(U){return pl(U,A,R)}}function pl(A,R,U){var $=U.length;if(A==null)return!$;for(A=ie(A);$--;){var q=U[$],tt=R[q],it=A[q];if(it===E&&!(q in A)||!tt(it))return!1}return!0}function gl(A,R,U){if(typeof A!="function")throw new Ze(c);return Js(function(){A.apply(E,U)},R)}function Ys(A,R,U,$){var q=-1,tt=En,it=!0,nt=A.length,lt=[],mt=R.length;if(!nt)return lt;U&&(R=ae(R,Ue(U))),$?(tt=da,it=!1):R.length>=O&&(tt=Ns,it=!1,R=new ki(R));t:for(;++qq?0:q+U),$=$===E||$>q?q:Xt($),$<0&&($+=q),$=U>$?0:Bu($);U<$;)A[U++]=R;return A}function xl(A,R){var U=[];return Gi(A,function($,q,tt){R($,q,tt)&&U.push($)}),U}function Ae(A,R,U,$,q){var tt=-1,it=A.length;for(U||(U=U0),q||(q=[]);++tt0&&U(nt)?R>1?Ae(nt,R-1,U,$,q):Ii(q,nt):$||(q[q.length]=nt)}return q}var wa=Hl(),yl=Hl(!0);function di(A,R){return A&&wa(A,R,Ce)}function Ra(A,R){return A&&yl(A,R,Ce)}function Wn(A,R){return Di(R,function(U){return wi(A[U])})}function _i(A,R){R=Ui(R,A);for(var U=0,$=R.length;A!=null&&U<$;)A=A[vi(R[U++])];return U&&U==$?A:E}function Tl(A,R,U){var $=R(A);return Gt(A)?$:Ii($,U(A))}function Le(A){return A==null?A===E?pt:ft:Ji&&Ji in ie(A)?I0(A):j0(A)}function Fa(A,R){return A>R}function qp(A,R){return A!=null&&_t.call(A,R)}function _p(A,R){return A!=null&&R in ie(A)}function t0(A,R,U){return A>=we(R,U)&&A=120&&xt.length>=120)?new ki(it&&xt):E}xt=A[0];var Tt=-1,Mt=nt[0];t:for(;++Tt-1;)nt!==A&&In.call(nt,lt,1),In.call(A,lt,1);return A}function Ll(A,R){for(var U=A?R.length:0,$=U-1;U--;){var q=R[U];if(U==$||q!==tt){var tt=q;Mi(q)?In.call(A,q,1):za(A,q)}}return A}function ba(A,R){return A+Nn(ul()*(R-A+1))}function c0(A,R,U,$){for(var q=-1,tt=ye(bn((R-A)/(U||1)),0),it=dt(tt);tt--;)it[$?tt:++q]=A,A+=U;return it}function Na(A,R){var U="";if(!A||R<1||R>G)return U;do R%2&&(U+=A),R=Nn(R/2),R&&(A+=A);while(R);return U}function Wt(A,R){return _a(au(A,R,Ne),A+"")}function v0(A){return cl(Ps(A))}function p0(A,R){var U=Ps(A);return _n(U,qi(R,0,U.length))}function js(A,R,U,$){if(!he(A))return A;R=Ui(R,A);for(var q=-1,tt=R.length,it=tt-1,nt=A;nt!=null&&++qq?0:q+R),U=U>q?q:U,U<0&&(U+=q),q=R>U?0:U-R>>>0,R>>>=0;for(var tt=dt(q);++$>>1,it=A[tt];it!==null&&!Ve(it)&&(U?it<=R:it=O){var mt=R?null:F0(A);if(mt)return An(mt);it=!1,q=Ns,lt=new ki}else lt=R?[]:nt;t:for(;++$=$?A:ke(A,R,U)}var Gl=ap||function(A){return Se.clearTimeout(A)};function zl(A,R){if(R)return A.slice();var U=A.length,$=rl?rl(U):new A.constructor(U);return A.copy($),$}function Wa(A){var R=new A.constructor(A.byteLength);return new On(R).set(new On(A)),R}function T0(A,R){var U=R?Wa(A.buffer):A.buffer;return new A.constructor(U,A.byteOffset,A.byteLength)}function S0(A){var R=new A.constructor(A.source,Sh.exec(A));return R.lastIndex=A.lastIndex,R}function C0(A){return Vs?ie(Vs.call(A)):{}}function Ul(A,R){var U=R?Wa(A.buffer):A.buffer;return new A.constructor(U,A.byteOffset,A.length)}function Xl(A,R){if(A!==R){var U=A!==E,$=A===null,q=A===A,tt=Ve(A),it=R!==E,nt=R===null,lt=R===R,mt=Ve(R);if(!nt&&!mt&&!tt&&A>R||tt&&it&<&&!nt&&!mt||$&&it&<||!U&<||!q)return 1;if(!$&&!tt&&!mt&&A=nt)return lt;var mt=U[$];return lt*(mt=="desc"?-1:1)}}return A.index-R.index}function Vl(A,R,U,$){for(var q=-1,tt=A.length,it=U.length,nt=-1,lt=R.length,mt=ye(tt-it,0),xt=dt(lt+mt),Tt=!$;++nt1?U[q-1]:E,it=q>2?U[2]:E;for(tt=A.length>3&&typeof tt=="function"?(q--,tt):E,it&&Oe(U[0],U[1],it)&&(tt=q<3?E:tt,q=1),R=ie(R);++$-1?q[tt?R[it]:it]:E}}function $l(A){return Ai(function(R){var U=R.length,$=U,q=Je.prototype.thru;for(A&&R.reverse();$--;){var tt=R[$];if(typeof tt!="function")throw new Ze(c);if(q&&!it&&kn(tt)=="wrapper")var it=new Je([],!0)}for($=it?$:U;++$1&&$t.reverse(),xt&<nt))return!1;var mt=tt.get(A),xt=tt.get(R);if(mt&&xt)return mt==R&&xt==A;var Tt=-1,Mt=!0,Ft=U&i?new ki:E;for(tt.set(A,R),tt.set(R,A);++Tt1?"& ":"")+R[$],R=R.join(U>2?", ":" "),A.replace(Xc,`{ -/* [wrapped with `+R+`] */ -`)}function U0(A){return Gt(A)||is(A)||!!(hl&&A&&A[hl])}function Mi(A,R){var U=typeof A;return R=R??G,!!R&&(U=="number"||U!="symbol"&&kc.test(A))&&A>-1&&A%1==0&&A0){if(++R>=M)return arguments[0]}else R=0;return A.apply(E,arguments)}}function _n(A,R){var U=-1,$=A.length,q=$-1;for(R=R===E?$:R;++U1?A[R-1]:E;return U=typeof U=="function"?(A.pop(),U):E,xu(A,U)});function yu(A){var R=_(A);return R.__chain__=!0,R}function Qg(A,R){return R(A),A}function tr(A,R){return R(A)}var kg=Ai(function(A){var R=A.length,U=R?A[0]:0,$=this.__wrapped__,q=function(tt){return Ma(tt,A)};return R>1||this.__actions__.length||!($ instanceof Kt)||!Mi(U)?this.thru(q):($=$.slice(U,+U+(R?1:0)),$.__actions__.push({func:tr,args:[q],thisArg:E}),new Je($,this.__chain__).thru(function(tt){return R&&!tt.length&&tt.push(E),tt}))});function qg(){return yu(this)}function _g(){return new Je(this.value(),this.__chain__)}function tm(){this.__values__===E&&(this.__values__=Iu(this.value()));var A=this.__index__>=this.__values__.length,R=A?E:this.__values__[this.__index__++];return{done:A,value:R}}function em(){return this}function im(A){for(var R,U=this;U instanceof Un;){var $=du(U);$.__index__=0,$.__values__=E,R?q.__wrapped__=$:R=$;var q=$;U=U.__wrapped__}return q.__wrapped__=A,R}function sm(){var A=this.__wrapped__;if(A instanceof Kt){var R=A;return this.__actions__.length&&(R=new Kt(this)),R=R.reverse(),R.__actions__.push({func:tr,args:[to],thisArg:E}),new Je(R,this.__chain__)}return this.thru(to)}function nm(){return bl(this.__wrapped__,this.__actions__)}var rm=jn(function(A,R,U){_t.call(A,U)?++A[U]:Ei(A,U,1)});function am(A,R,U){var $=Gt(A)?Zh:Qp;return U&&Oe(A,R,U)&&(R=E),$(A,Ot(R,3))}function om(A,R){var U=Gt(A)?Di:xl;return U(A,Ot(R,3))}var hm=jl(cu),lm=jl(vu);function um(A,R){return Ae(er(A,R),1)}function fm(A,R){return Ae(er(A,R),N)}function dm(A,R,U){return U=U===E?1:Xt(U),Ae(er(A,R),U)}function Tu(A,R){var U=Gt(A)?$e:Gi;return U(A,Ot(R,3))}function Su(A,R){var U=Gt(A)?Ov:ml;return U(A,Ot(R,3))}var cm=jn(function(A,R,U){_t.call(A,U)?A[U].push(R):Ei(A,U,[R])});function vm(A,R,U,$){A=Be(A)?A:Ps(A),U=U&&!$?Xt(U):0;var q=A.length;return U<0&&(U=ye(q+U,0)),ar(A)?U<=q&&A.indexOf(R,U)>-1:!!q&&cs(A,R,U)>-1}var pm=Wt(function(A,R,U){var $=-1,q=typeof R=="function",tt=Be(A)?dt(A.length):[];return Gi(A,function(it){tt[++$]=q?ze(R,it,U):Hs(it,R,U)}),tt}),gm=jn(function(A,R,U){Ei(A,U,R)});function er(A,R){var U=Gt(A)?ae:Pl;return U(A,Ot(R,3))}function mm(A,R,U,$){return A==null?[]:(Gt(R)||(R=R==null?[]:[R]),U=$?E:U,Gt(U)||(U=U==null?[]:[U]),Rl(A,R,U))}var xm=jn(function(A,R,U){A[U?0:1].push(R)},function(){return[[],[]]});function ym(A,R,U){var $=Gt(A)?ca:qh,q=arguments.length<3;return $(A,Ot(R,4),U,q,Gi)}function Tm(A,R,U){var $=Gt(A)?Dv:qh,q=arguments.length<3;return $(A,Ot(R,4),U,q,ml)}function Sm(A,R){var U=Gt(A)?Di:xl;return U(A,nr(Ot(R,3)))}function Cm(A){var R=Gt(A)?cl:v0;return R(A)}function Em(A,R,U){(U?Oe(A,R,U):R===E)?R=1:R=Xt(R);var $=Gt(A)?Kp:p0;return $(A,R)}function Pm(A){var R=Gt(A)?jp:m0;return R(A)}function Am(A){if(A==null)return 0;if(Be(A))return ar(A)?ps(A):A.length;var R=Re(A);return R==rt||R==Pt?A.size:Da(A).length}function Mm(A,R,U){var $=Gt(A)?va:x0;return U&&Oe(A,R,U)&&(R=E),$(A,Ot(R,3))}var wm=Wt(function(A,R){if(A==null)return[];var U=R.length;return U>1&&Oe(A,R[0],R[1])?R=[]:U>2&&Oe(R[0],R[1],R[2])&&(R=[R[0]]),Rl(A,Ae(R,1),[])}),ir=op||function(){return Se.Date.now()};function Rm(A,R){if(typeof R!="function")throw new Ze(c);return A=Xt(A),function(){if(--A<1)return R.apply(this,arguments)}}function Cu(A,R,U){return R=U?E:R,R=A&&R==null?A.length:R,Pi(A,g,E,E,E,E,R)}function Eu(A,R){var U;if(typeof R!="function")throw new Ze(c);return A=Xt(A),function(){return--A>0&&(U=R.apply(this,arguments)),A<=1&&(R=E),U}}var io=Wt(function(A,R,U){var $=h;if(U.length){var q=Bi(U,Cs(io));$|=d}return Pi(A,$,R,U,q)}),Pu=Wt(function(A,R,U){var $=h|s;if(U.length){var q=Bi(U,Cs(Pu));$|=d}return Pi(R,$,A,U,q)});function Au(A,R,U){R=U?E:R;var $=Pi(A,f,E,E,E,E,E,R);return $.placeholder=Au.placeholder,$}function Mu(A,R,U){R=U?E:R;var $=Pi(A,u,E,E,E,E,E,R);return $.placeholder=Mu.placeholder,$}function wu(A,R,U){var $,q,tt,it,nt,lt,mt=0,xt=!1,Tt=!1,Mt=!0;if(typeof A!="function")throw new Ze(c);R=_e(R)||0,he(U)&&(xt=!!U.leading,Tt="maxWait"in U,tt=Tt?ye(_e(U.maxWait)||0,R):tt,Mt="trailing"in U?!!U.trailing:Mt);function Ft(pe){var ui=$,Fi=q;return $=q=E,mt=pe,it=A.apply(Fi,ui),it}function Dt(pe){return mt=pe,nt=Js(Ht,R),xt?Ft(pe):it}function Vt(pe){var ui=pe-lt,Fi=pe-mt,ju=R-ui;return Tt?we(ju,tt-Fi):ju}function It(pe){var ui=pe-lt,Fi=pe-mt;return lt===E||ui>=R||ui<0||Tt&&Fi>=tt}function Ht(){var pe=ir();if(It(pe))return $t(pe);nt=Js(Ht,Vt(pe))}function $t(pe){return nt=E,Mt&&$?Ft(pe):($=q=E,it)}function We(){nt!==E&&Gl(nt),mt=0,$=lt=q=nt=E}function De(){return nt===E?it:$t(ir())}function Ye(){var pe=ir(),ui=It(pe);if($=arguments,q=this,lt=pe,ui){if(nt===E)return Dt(lt);if(Tt)return Gl(nt),nt=Js(Ht,R),Ft(lt)}return nt===E&&(nt=Js(Ht,R)),it}return Ye.cancel=We,Ye.flush=De,Ye}var Fm=Wt(function(A,R){return gl(A,1,R)}),Lm=Wt(function(A,R,U){return gl(A,_e(R)||0,U)});function Om(A){return Pi(A,x)}function sr(A,R){if(typeof A!="function"||R!=null&&typeof R!="function")throw new Ze(c);var U=function(){var $=arguments,q=R?R.apply(this,$):$[0],tt=U.cache;if(tt.has(q))return tt.get(q);var it=A.apply(this,$);return U.cache=tt.set(q,it)||tt,it};return U.cache=new(sr.Cache||Ci),U}sr.Cache=Ci;function nr(A){if(typeof A!="function")throw new Ze(c);return function(){var R=arguments;switch(R.length){case 0:return!A.call(this);case 1:return!A.call(this,R[0]);case 2:return!A.call(this,R[0],R[1]);case 3:return!A.call(this,R[0],R[1],R[2])}return!A.apply(this,R)}}function Dm(A){return Eu(2,A)}var Im=y0(function(A,R){R=R.length==1&&Gt(R[0])?ae(R[0],Ue(Ot())):ae(Ae(R,1),Ue(Ot()));var U=R.length;return Wt(function($){for(var q=-1,tt=we($.length,U);++q=R}),is=Sl(function(){return arguments}())?Sl:function(A){return de(A)&&_t.call(A,"callee")&&!ol.call(A,"callee")},Gt=dt.isArray,Zm=Wh?Ue(Wh):i0;function Be(A){return A!=null&&rr(A.length)&&!wi(A)}function ve(A){return de(A)&&Be(A)}function Jm(A){return A===!0||A===!1||de(A)&&Le(A)==H}var Vi=lp||po,Qm=Yh?Ue(Yh):s0;function km(A){return de(A)&&A.nodeType===1&&!Qs(A)}function qm(A){if(A==null)return!0;if(Be(A)&&(Gt(A)||typeof A=="string"||typeof A.splice=="function"||Vi(A)||Es(A)||is(A)))return!A.length;var R=Re(A);if(R==rt||R==Pt)return!A.size;if(Zs(A))return!Da(A).length;for(var U in A)if(_t.call(A,U))return!1;return!0}function _m(A,R){return Ks(A,R)}function tx(A,R,U){U=typeof U=="function"?U:E;var $=U?U(A,R):E;return $===E?Ks(A,R,E,U):!!$}function no(A){if(!de(A))return!1;var R=Le(A);return R==k||R==Q||typeof A.message=="string"&&typeof A.name=="string"&&!Qs(A)}function ex(A){return typeof A=="number"&&ll(A)}function wi(A){if(!he(A))return!1;var R=Le(A);return R==et||R==st||R==W||R==At}function Fu(A){return typeof A=="number"&&A==Xt(A)}function rr(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=G}function he(A){var R=typeof A;return A!=null&&(R=="object"||R=="function")}function de(A){return A!=null&&typeof A=="object"}var Lu=Hh?Ue(Hh):r0;function ix(A,R){return A===R||Oa(A,R,Za(R))}function sx(A,R,U){return U=typeof U=="function"?U:E,Oa(A,R,Za(R),U)}function nx(A){return Ou(A)&&A!=+A}function rx(A){if(W0(A))throw new Nt(D);return Cl(A)}function ax(A){return A===null}function ox(A){return A==null}function Ou(A){return typeof A=="number"||de(A)&&Le(A)==ot}function Qs(A){if(!de(A)||Le(A)!=at)return!1;var R=Dn(A);if(R===null)return!0;var U=_t.call(R,"constructor")&&R.constructor;return typeof U=="function"&&U instanceof U&&Rn.call(U)==sp}var ro=Kh?Ue(Kh):a0;function hx(A){return Fu(A)&&A>=-G&&A<=G}var Du=jh?Ue(jh):o0;function ar(A){return typeof A=="string"||!Gt(A)&&de(A)&&Le(A)==ct}function Ve(A){return typeof A=="symbol"||de(A)&&Le(A)==Ct}var Es=$h?Ue($h):h0;function lx(A){return A===E}function ux(A){return de(A)&&Re(A)==wt}function fx(A){return de(A)&&Le(A)==Bt}var dx=Qn(Ia),cx=Qn(function(A,R){return A<=R});function Iu(A){if(!A)return[];if(Be(A))return ar(A)?oi(A):Ie(A);if(Gs&&A[Gs])return Kv(A[Gs]());var R=Re(A),U=R==rt?Ta:R==Pt?An:Ps;return U(A)}function Ri(A){if(!A)return A===0?A:0;if(A=_e(A),A===N||A===-N){var R=A<0?-1:1;return R*V}return A===A?A:0}function Xt(A){var R=Ri(A),U=R%1;return R===R?U?R-U:R:0}function Bu(A){return A?qi(Xt(A),0,j):0}function _e(A){if(typeof A=="number")return A;if(Ve(A))return K;if(he(A)){var R=typeof A.valueOf=="function"?A.valueOf():A;A=he(R)?R+"":R}if(typeof A!="string")return A===0?A:+A;A=_h(A);var U=Zc.test(A);return U||Qc.test(A)?Rv(A.slice(2),U?2:8):$c.test(A)?K:+A}function bu(A){return ci(A,be(A))}function vx(A){return A?qi(Xt(A),-G,G):A===0?A:0}function qt(A){return A==null?"":Xe(A)}var px=Ts(function(A,R){if(Zs(R)||Be(R)){ci(R,Ce(R),A);return}for(var U in R)_t.call(R,U)&&Ws(A,U,R[U])}),Nu=Ts(function(A,R){ci(R,be(R),A)}),or=Ts(function(A,R,U,$){ci(R,be(R),A,$)}),gx=Ts(function(A,R,U,$){ci(R,Ce(R),A,$)}),mx=Ai(Ma);function xx(A,R){var U=ys(A);return R==null?U:vl(U,R)}var yx=Wt(function(A,R){A=ie(A);var U=-1,$=R.length,q=$>2?R[2]:E;for(q&&Oe(R[0],R[1],q)&&($=1);++U<$;)for(var tt=R[U],it=be(tt),nt=-1,lt=it.length;++nt1),tt}),ci(A,ja(A),U),$&&(U=Qe(U,a|r|n,L0));for(var q=R.length;q--;)za(U,R[q]);return U});function Gx(A,R){return zu(A,nr(Ot(R)))}var zx=Ai(function(A,R){return A==null?{}:f0(A,R)});function zu(A,R){if(A==null)return{};var U=ae(ja(A),function($){return[$]});return R=Ot(R),Fl(A,U,function($,q){return R($,q[0])})}function Ux(A,R,U){R=Ui(R,A);var $=-1,q=R.length;for(q||(q=1,A=E);++$R){var $=A;A=R,R=$}if(U||A%1||R%1){var q=ul();return we(A+q*(R-A+wv("1e-"+((q+"").length-1))),R)}return ba(A,R)}var Qx=Ss(function(A,R,U){return R=R.toLowerCase(),A+(U?Vu(R):R)});function Vu(A){return ho(qt(A).toLowerCase())}function Wu(A){return A=qt(A),A&&A.replace(qc,Xv).replace(mv,"")}function kx(A,R,U){A=qt(A),R=Xe(R);var $=A.length;U=U===E?$:qi(Xt(U),0,$);var q=U;return U-=R.length,U>=0&&A.slice(U,q)==R}function qx(A){return A=qt(A),A&&Dc.test(A)?A.replace(yh,Vv):A}function _x(A){return A=qt(A),A&&zc.test(A)?A.replace(sa,"\\$&"):A}var ty=Ss(function(A,R,U){return A+(U?"-":"")+R.toLowerCase()}),ey=Ss(function(A,R,U){return A+(U?" ":"")+R.toLowerCase()}),iy=Kl("toLowerCase");function sy(A,R,U){A=qt(A),R=Xt(R);var $=R?ps(A):0;if(!R||$>=R)return A;var q=(R-$)/2;return Jn(Nn(q),U)+A+Jn(bn(q),U)}function ny(A,R,U){A=qt(A),R=Xt(R);var $=R?ps(A):0;return R&&$>>0,U?(A=qt(A),A&&(typeof R=="string"||R!=null&&!ro(R))&&(R=Xe(R),!R&&vs(A))?Xi(oi(A),0,U):A.split(R,U)):[]}var fy=Ss(function(A,R,U){return A+(U?" ":"")+ho(R)});function dy(A,R,U){return A=qt(A),U=U==null?0:qi(Xt(U),0,A.length),R=Xe(R),A.slice(U,U+R.length)==R}function cy(A,R,U){var $=_.templateSettings;U&&Oe(A,R,U)&&(R=E),A=qt(A),R=or({},R,$,ql);var q=or({},R.imports,$.imports,ql),tt=Ce(q),it=ya(q,tt),nt,lt,mt=0,xt=R.interpolate||Tn,Tt="__p += '",Mt=Sa((R.escape||Tn).source+"|"+xt.source+"|"+(xt===Th?jc:Tn).source+"|"+(R.evaluate||Tn).source+"|$","g"),Ft="//# sourceURL="+(_t.call(R,"sourceURL")?(R.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Cv+"]")+` -`;A.replace(Mt,function(It,Ht,$t,We,De,Ye){return $t||($t=We),Tt+=A.slice(mt,Ye).replace(_c,Wv),Ht&&(nt=!0,Tt+=`' + + */c.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},R={};function O(c){var m=R[c];if(m!==void 0)return m.exports;var t=R[c]={exports:{}};return E[c](t,t.exports,O),t.exports}O.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var D=O(85454);return D})())})(qf);var $r=qf.exports;const on=bf($r);var dT=Object.create,th=Object.defineProperty,cT=Object.defineProperties,vT=Object.getOwnPropertyDescriptor,pT=Object.getOwnPropertyDescriptors,gT=Object.getOwnPropertyNames,rf=Object.getOwnPropertySymbols,mT=Object.getPrototypeOf,_f=Object.prototype.hasOwnProperty,yT=Object.prototype.propertyIsEnumerable,af=(S,T,E)=>T in S?th(S,T,{enumerable:!0,configurable:!0,writable:!0,value:E}):S[T]=E,he=(S,T)=>{for(var E in T||(T={}))_f.call(T,E)&&af(S,E,T[E]);if(rf)for(var E of rf(T))yT.call(T,E)&&af(S,E,T[E]);return S},Ji=(S,T)=>cT(S,pT(T)),Lt=(S,T)=>()=>(T||S((T={exports:{}}).exports,T),T.exports),xT=(S,T,E,R)=>{if(T&&typeof T=="object"||typeof T=="function")for(let O of gT(T))!_f.call(S,O)&&O!==E&&th(S,O,{get:()=>T[O],enumerable:!(R=vT(T,O))||R.enumerable});return S},td=(S,T,E)=>(E=S!=null?dT(mT(S)):{},xT(T||!S||!S.__esModule?th(E,"default",{value:S,enumerable:!0}):E,S)),Zr=Lt(S=>{var T=function(D,c){return Dc?1:0},E=function(D,c){return Dc?-1:0};function R(D){return function(c,m){return D(m,c)}}function O(D){return D===2?function(c,m){return c[0]m[0]?1:c[1]m[1]?1:0}:function(c,m){for(var t=0;tm[t])return 1;t++}return 0}}S.DEFAULT_COMPARATOR=T,S.DEFAULT_REVERSE_COMPARATOR=E,S.reverseComparator=R,S.createTupleComparator=O}),TT=Lt(S=>{S.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",S.SYMBOL_SUPPORT=typeof Symbol<"u"}),fe=Lt((S,T)=>{var E=TT(),R=E.ARRAY_BUFFER_SUPPORT,O=E.SYMBOL_SUPPORT;T.exports=function(D,c){var m,t,o,v,a;if(!D)throw new Error("obliterator/forEach: invalid iterable.");if(typeof c!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(D)||R&&ArrayBuffer.isView(D)||typeof D=="string"||D.toString()==="[object Arguments]"){for(o=0,v=D.length;o{var E=Zr(),R=fe(),O=E.DEFAULT_COMPARATOR,D=E.reverseComparator;function c(i){if(this.clear(),this.comparator=i||O,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}c.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function m(i){return{item:i,degree:0}}function t(i,h){i.root?(h.right=i.root.right,h.left=i.root,i.root.right.left=h,i.root.right=h):i.root=h}c.prototype.push=function(i){var h=m(i);return h.left=h,h.right=h,t(this,h),(!this.min||this.comparator(h.item,this.min.item)<=0)&&(this.min=h),++this.size},c.prototype.peek=function(){return this.min?this.min.item:void 0};function o(i){for(var h=[],s=i,l=!1;!(s===i&&l);)s===i&&(l=!0),h.push(s),s=s.right;return h}function v(i,h){i.root===h&&(i.root=h.right),h.left.right=h.right,h.right.left=h.left}function a(i,h){i.child?(h.right=i.child.right,h.left=i.child,i.child.right.left=h,i.child.right=h):i.child=h}function r(i,h,s){v(i,h),h.left=h,h.right=h,a(s,h),s.degree++,h.parent=s}function n(i){var h=new Array(i.size),s=o(i.root),l,f,u,d,p,g;for(l=0,f=s.length;l0&&(g=u,u=d,d=g),r(i,d,u),h[p]=null,p++;h[p]=u}for(l=0;l{var T=Math.pow(2,8)-1,E=Math.pow(2,16)-1,R=Math.pow(2,32)-1,O=Math.pow(2,7)-1,D=Math.pow(2,15)-1,c=Math.pow(2,31)-1;S.getPointerArray=function(t){var o=t-1;if(o<=T)return Uint8Array;if(o<=E)return Uint16Array;if(o<=R)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},S.getSignedPointerArray=function(t){var o=t-1;return o<=O?Int8Array:o<=D?Int16Array:o<=c?Int32Array:Float64Array},S.getNumberType=function(t){return t===(t|0)?Math.sign(t)===-1?t<=127&&t>=-128?Int8Array:t<=32767&&t>=-32768?Int16Array:Int32Array:t<=255?Uint8Array:t<=65535?Uint16Array:Uint32Array:Float64Array};var m={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};S.getMinimalRepresentation=function(t,o){var v=null,a=0,r,n,e,i,h;for(i=0,h=t.length;ia&&(a=r,v=n);return v},S.isTypedArray=function(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(t)},S.concat=function(){var t=0,o,v,a;for(o=0,a=arguments.length;o{var T=fe(),E=Xe();function R(m){return Array.isArray(m)||E.isTypedArray(m)}function O(m){if(typeof m.length=="number")return m.length;if(typeof m.size=="number")return m.size}function D(m){var t=O(m),o=typeof t=="number"?new Array(t):[],v=0;return T(m,function(a){o[v++]=a}),o}function c(m){var t=O(m),o=typeof t=="number"?E.getPointerArray(t):Array,v=typeof t=="number"?new Array(t):[],a=typeof t=="number"?new o(t):[],r=0;return T(m,function(n){v[r]=n,a[r]=r++}),[v,a]}S.isArrayLike=R,S.guessLength=O,S.toArray=D,S.toArrayWithIndices=c}),ih=Lt((S,T)=>{var E=fe(),R=Zr(),O=Ze(),D=R.DEFAULT_COMPARATOR,c=R.reverseComparator;function m(f,u,d,p){for(var g=u[p],x,y;p>d;){if(x=p-1>>1,y=u[x],f(g,y)<0){u[p]=y,p=x;continue}break}u[p]=g}function t(f,u,d){for(var p=u.length,g=d,x=u[d],y=2*d+1,C;y=0&&(y=C),u[d]=u[y],d=y,y=2*d+1;u[d]=x,m(f,u,g,d)}function o(f,u,d){u.push(d),m(f,u,0,u.length-1)}function v(f,u){var d=u.pop();if(u.length!==0){var p=u[0];return u[0]=d,t(f,u,0),p}return d}function a(f,u,d){if(u.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var p=u[0];return u[0]=d,t(f,u,0),p}function r(f,u,d){var p;return u.length!==0&&f(u[0],d)<0&&(p=u[0],u[0]=d,d=p,t(f,u,0)),d}function n(f,u){for(var d=u.length,p=d>>1,g=p;--g>=0;)t(f,u,g)}function e(f,u){for(var d=u.length,p=0,g=new Array(d);p=d.length)return d.slice().sort(f);for(P=d.slice(0,u),n(p,P),g=u,x=d.length;g0&&a(p,P,d[g]);return P.sort(f)}var M=O.guessLength(d);return M!==null&&M0&&a(p,P,w)),g++}),P.length>g&&(P.length=g),P.sort(f)}function h(f,u,d){arguments.length===2&&(d=u,u=f,f=D);var p=c(f),g,x,y,C=-1/0,P;if(u===1){if(O.isArrayLike(d)){for(g=0,x=d.length;g0)&&(C=y);return P=new d.constructor(1),P[0]=C,P}return E(d,function(w){(C===-1/0||f(w,C)>0)&&(C=w)}),[C]}if(O.isArrayLike(d)){if(u>=d.length)return d.slice().sort(p);for(P=d.slice(0,u),n(f,P),g=u,x=d.length;g0&&a(f,P,d[g]);return P.sort(p)}var M=O.guessLength(d);return M!==null&&M0&&a(f,P,w)),g++}),P.length>g&&(P.length=g),P.sort(p)}function s(f){if(this.clear(),this.comparator=f||D,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}s.prototype.clear=function(){this.items=[],this.size=0},s.prototype.push=function(f){return o(this.comparator,this.items,f),++this.size},s.prototype.peek=function(){return this.items[0]},s.prototype.pop=function(){return this.size!==0&&this.size--,v(this.comparator,this.items)},s.prototype.replace=function(f){return a(this.comparator,this.items,f)},s.prototype.pushpop=function(f){return r(this.comparator,this.items,f)},s.prototype.consume=function(){return this.size=0,e(this.comparator,this.items)},s.prototype.toArray=function(){return e(this.comparator,this.items.slice())},s.prototype.inspect=function(){var f=this.toArray();return Object.defineProperty(f,"constructor",{value:s,enumerable:!1}),f},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect);function l(f){if(this.clear(),this.comparator=f||D,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=c(this.comparator)}l.prototype=s.prototype,s.from=function(f,u){var d=new s(u),p;return O.isArrayLike(f)?p=f.slice():p=O.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},l.from=function(f,u){var d=new l(u),p;return O.isArrayLike(f)?p=f.slice():p=O.toArray(f),n(d.comparator,p),d.items=p,d.size=p.length,d},s.siftUp=t,s.siftDown=m,s.push=o,s.pop=v,s.replace=a,s.pushpop=r,s.heapify=n,s.consume=e,s.nsmallest=i,s.nlargest=h,s.MinHeap=s,s.MaxHeap=l,T.exports=s}),ST=Lt((S,T)=>{var E="";function R(o,v,a){for(var r=v.length,n=[],e=r,i=-1,h,s=0,l;e--;)i=Math.max(o[v[e]+a],i);for(l=i>>24&&32||i>>16&&24||i>>8&&16||8;s>s&15].push(v[e]);for(h=0;h<16;h++)for(i=n[h].length;i--;)v[++e]=n[h][i]}}function O(o,v,a,r){return o[a]-o[r]||(a%3===2?o[a+1]-o[r+1]||v[a+2]-v[r+2]:v[a+1]-v[r+1])}function D(o,v){var a=[],r=[],n=2*v/3|0,e=v-n,i=n+1>>1,h=n,s=0,l,f=[],u=[];if(v===1)return[0];for(;h--;)a[h]=(h*3>>1)+1;for(h=3;h--;)R(o,a,h);for(s=r[(a[0]/3|0)+(a[0]%3===1?0:i)]=1,h=1;hthis.firstLength&&e>this.firstLength)){for(v=Math.min(this.length-n,this.length-e),r=0;ro.length&&(o=this.text.slice(n,n+v))}return o},t.prototype.toString=function(){return this.array.join(",")},t.prototype.toJSON=function(){return this.array},t.prototype.inspect=function(){for(var o=new Array(this.length),v=0;v{var E=fe();function R(o){this.size=0,this.items=new Map,this.inverse=o}function O(){this.size=0,this.items=new Map,this.inverse=new R(this)}function D(){this.size=0,this.items.clear(),this.inverse.items.clear()}O.prototype.clear=D,R.prototype.clear=D;function c(o,v){if(this.items.has(o)){var a=this.items.get(o);if(a===v)return this;this.inverse.items.delete(a)}if(this.inverse.items.has(v)){var r=this.inverse.items.get(v);if(r===o)return this;this.items.delete(r)}return this.items.set(o,v),this.inverse.items.set(v,o),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}O.prototype.set=c,R.prototype.set=c;function m(o){if(this.items.has(o)){var v=this.items.get(o);return this.items.delete(o),this.inverse.items.delete(v),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}O.prototype.delete=m,R.prototype.delete=m;var t=["has","get","forEach","keys","values","entries"];t.forEach(function(o){O.prototype[o]=R.prototype[o]=function(){return Map.prototype[o].apply(this.items,arguments)}}),typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.entries,R.prototype[Symbol.iterator]=R.prototype.entries),O.prototype.inspect=function(){var o={left:this.items,right:this.inverse.items};return Object.defineProperty(o,"constructor",{value:O,enumerable:!1}),o},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),R.prototype.inspect=function(){var o={left:this.inverse.items,right:this.items};return Object.defineProperty(o,"constructor",{value:R,enumerable:!1}),o},typeof Symbol<"u"&&(R.prototype[Symbol.for("nodejs.util.inspect.custom")]=R.prototype.inspect),O.from=function(o){var v=new O;return E(o,function(a,r){v.set(r,a)}),v},T.exports=O}),we=Lt((S,T)=>{function E(R){if(typeof R!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=R}typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=function(){return this}),E.of=function(){var R=arguments,O=R.length,D=0;return new E(function(){return D>=O?{done:!0}:{done:!1,value:R[D++]}})},E.empty=function(){var R=new E(function(){return{done:!0}});return R},E.fromSequence=function(R){var O=0,D=R.length;return new E(function(){return O>=D?{done:!0}:{done:!1,value:R[O++]}})},E.is=function(R){return R instanceof E?!0:typeof R=="object"&&R!==null&&typeof R.next=="function"},T.exports=E}),ed=Lt(S=>{function T(c){return c|=c>>1,c|=c>>2,c|=c>>4,c|=c>>8,c|=c>>16,c&~(c>>1)}S.msb32=T;function E(c){return c|=c>>1,c|=c>>2,c|=c>>4,c&~(c>>1)}S.msb8=E,S.test=function(c,m){return c>>m&1},S.criticalBit8=function(c,m){return E(c^m)},S.criticalBit8Mask=function(c,m){return~E(c^m)>>>0&255},S.testCriticalBit8=function(c,m){return 1+(c|m)>>8},S.criticalBit32Mask=function(c,m){return~T(c^m)>>>0&4294967295},S.popcount=function(c){return c-=c>>1&1431655765,c=(c&858993459)+(c>>2&858993459),c=c+(c>>4)&252645135,c+=c>>8,c+=c>>16,c&127};var R=new Uint8Array(Math.pow(2,8));for(O=0,D=R.length;O>8&255]+R[c>>16&255]+R[c>>24&255]}}),ET=Lt((S,T)=>{var E=we(),R=ed();function O(D){this.length=D,this.clear()}O.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},O.prototype.set=function(D,c){var m=D>>5,t=D&31,o=this.array[m],v;return c===0||c===!1?v=this.array[m]&=~(1<>>0,v>o?this.size++:v>5,m=D&31,t=this.array[c],o;return o=this.array[c]&=~(1<>5,m=D&31,t=this.array[c],o=this.array[c]^=1<>>0,o>t?this.size++:o>5,m=D&31;return this.array[c]>>m&1},O.prototype.test=function(D){return!!this.get(D)},O.prototype.rank=function(D){if(this.size===0)return 0;for(var c=D>>5,m=D&31,t=0,o=0;o=this.length)return-1;for(var c,m=32,t=0,o=0,v=0,a=this.array.length;v>r&1,o===D)return t}},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.length,t,o,v=32,a=0,r=this.array.length;a>n&1,D.call(c,o,a*32+n)}},O.prototype.values=function(){var D=this.length,c=!1,m,t,o=this.array,v=o.length,a=0,r=-1,n=32;return new E(function e(){if(!c){if(a>=v)return{done:!0};a===v-1&&(n=D%32||32),m=o[a++],c=!0,r=-1}return r++,r>=n?(c=!1,e()):(t=m>>r&1,{value:t})})},O.prototype.entries=function(){var D=this.length,c=!1,m,t,o=this.array,v,a=o.length,r=0,n=-1,e=32;return new E(function i(){if(!c){if(r>=a)return{done:!0};r===a-1&&(e=D%32||32),m=o[r++],c=!0,n=-1}return n++,v=~-r*32+n,n>=e?(c=!1,i()):(t=m>>n&1,{value:[v,t]})})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=new Uint8Array(this.length);return this.forEach(function(c,m){D[m]=c}),Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.prototype.toJSON=function(){return Array.from(this.array)},T.exports=O}),PT=Lt((S,T)=>{var E=we(),R=ed(),O=function(m){return Math.max(1,Math.ceil(m*1.5))};function D(m){return new Uint32Array(Math.ceil(m/32))}function c(m){var t=m||0,o=O;typeof m=="object"&&(t=m.initialLength||m.initialCapacity||0,o=m.policy||o),this.size=0,this.length=t,this.capacity=Math.ceil(this.length/32)*32,this.policy=o,this.array=D(this.capacity)}c.prototype.set=function(m,t){if(this.length>5,v=m&31,a=this.array[o],r;return t===0||t===!1?r=this.array[o]&=~(1<>>0,r>a?this.size++:r>5,o=m&31,v=this.array[t],a;return a=this.array[t]&=~(1<>5,o=m&31,v=this.array[t],a=this.array[t]^=1<>>0,a>v?this.size++:athis.array.length?(this.array=new Uint32Array(v),this.array.set(o,0)):this.array=o.slice(0,v),this.capacity=m,this)},c.prototype.grow=function(m){var t;if(typeof m=="number"){if(this.capacity>=m)return this;for(t=this.capacity;t>5,v=t&31;return this.array[o]|=1<>5,o=m&31;return this.array[t]>>o&1}},c.prototype.get=function(m){if(!(this.length>5,o=m&31;return this.array[t]>>o&1}},c.prototype.test=function(m){return this.length>5,o=m&31,v=0,a=0;a=this.length)return-1;for(var t,o=32,v=0,a=0,r=0,n=this.array.length;r>e&1,a===m)return v}},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;for(var o=this.length,v,a,r=32,n=0,e=this.array.length;n>i&1,m.call(t,a,n*32+i)}},c.prototype.values=function(){var m=this.length,t=!1,o,v,a=this.array,r=a.length,n=0,e=-1,i=32;return new E(function h(){if(!t){if(n>=r)return{done:!0};n===r-1&&(i=m%32||32),o=a[n++],t=!0,e=-1}return e++,e>=i?(t=!1,h()):(v=o>>e&1,{value:v})})},c.prototype.entries=function(){var m=this.length,t=!1,o,v,a=this.array,r,n=a.length,e=0,i=-1,h=32;return new E(function s(){if(!t){if(e>=n)return{done:!0};e===n-1&&(h=m%32||32),o=a[e++],t=!0,i=-1}return i++,r=~-e*32+i,i>=h?(t=!1,s()):(v=o>>i&1,{value:[r,v]})})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){var m=new Uint8Array(this.length);return this.forEach(function(t,o){m[o]=t}),Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},T.exports=c}),AT=Lt((S,T)=>{function E(D,c){return(D&65535)*c+(((D>>>16)*c&65535)<<16)&4294967295}function R(D,c){return(D&65535)+(c>>>16)+(((D>>>16)+c&65535)<<16)&4294967295}function O(D,c){return D<>>32-c}T.exports=function(D,c){var m=3432918353,t=461845907,o=15,v=13,a=5,r=1801774676,n=D,e,i,h;for(i=0,h=c.length-4;i<=h;i+=4)e=c[i]|c[i+1]<<8|c[i+2]<<16|c[i+3]<<24,e=E(e,m),e=O(e,o),e=E(e,t),n^=e,n=O(n,v),n=E(n,a),n=R(n,r);switch(e=0,c.length&3){case 3:e^=c[i+2]<<16;case 2:e^=c[i+1]<<8;case 1:e^=c[i],e=E(e,m),e=O(e,o),e=E(e,t),n^=e}return n^=c.length,n^=n>>>16,n=E(n,2246822507),n^=n>>>13,n=E(n,3266489909),n^=n>>>16,n>>>0}}),MT=Lt((S,T)=>{var E=AT(),R=fe(),O=Math.LN2*Math.LN2,D={errorRate:.005};function c(o){var v=new Uint16Array(o.length),a,r;for(a=0,r=o.length;a>3]|=e}return this},t.prototype.test=function(o){for(var v=c(o),a=0,r=this.hashFunctions;a>3]&1<<(7&n)))return!1}return!0},t.prototype.toJSON=function(){return this.data},t.from=function(o,v){if(!v&&(v=o.length||o.size,typeof v!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var a=new t(v);return R(o,function(r){a.add(r)}),a},T.exports=t}),wT=Lt((S,T)=>{var E=fe();function R(O){if(typeof O!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=O,this.clear()}R.prototype.add=function(O){if(!this.root)return this.root={item:O,children:{}},this.size++,this;for(var D=this.root,c;c=this.distance(O,D.item),!!D.children[c];)D=D.children[c];return D.children[c]={item:O,children:{}},this.size++,this},R.prototype.search=function(O,D){if(!this.root)return[];for(var c=[],m=[this.root],t,o,v,a,r;m.length;)for(t=m.pop(),v=this.distance(D,t.item),v<=O&&c.push({item:t.item,distance:v}),a=v-O,r=v+O+1;a{var E=Ze(),R=we();function O(D,c){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=D,this.capacity=c,this.items=new D(this.capacity),this.clear()}O.prototype.clear=function(){this.start=0,this.size=0},O.prototype.push=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var c=this.start+this.size;return c>=this.capacity&&(c-=this.capacity),this.items[c]=D,++this.size},O.prototype.unshift=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var c=this.start-1;return this.start===0&&(c=this.capacity-1),this.items[c]=D,this.start=c,++this.size},O.prototype.pop=function(){if(this.size!==0){this.size--;var D=this.start+this.size;return D>=this.capacity&&(D-=this.capacity),this.items[D]}},O.prototype.shift=function(){if(this.size!==0){var D=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[D]}},O.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},O.prototype.peekLast=function(){if(this.size!==0){var D=this.start+this.size-1;return D>=this.capacity&&(D-=this.capacity),this.items[D]}},O.prototype.get=function(D){if(!(this.size===0||D>=this.capacity))return D=this.start+D,D>=this.capacity&&(D-=this.capacity),this.items[D]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.capacity,t=this.size,o=this.start,v=0;v=m)return{done:!0};var v=D[t];return t++,o++,t===c&&(t=0),{value:v,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.capacity,m=this.size,t=this.start,o=0;return new R(function(){if(o>=m)return{done:!0};var v=D[t];return t++,t===c&&(t=0),{value:[o++,v],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=this.toArray();return D.type=this.ArrayClass.name,D.capacity=this.capacity,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){if(arguments.length<3&&(m=E.guessLength(D),typeof m!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new O(c,m);if(E.isArrayLike(D)){var o,v;for(o=0,v=D.length;o{var E=Ze(),R=id();function O(c,m){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof m!="number"||m<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=c,this.capacity=m,this.items=new c(this.capacity),this.clear()}function D(c){O.prototype[c]=R.prototype[c]}Object.keys(R.prototype).forEach(D),typeof Symbol<"u"&&Object.getOwnPropertySymbols(R.prototype).forEach(D),O.prototype.push=function(c){var m=this.start+this.size;return m>=this.capacity&&(m-=this.capacity),this.items[m]=c,this.size===this.capacity?(m++,m>=this.capacity?this.start=0:this.start=m,this.size):++this.size},O.prototype.unshift=function(c){var m=this.start-1;return this.start===0&&(m=this.capacity-1),this.items[m]=c,this.size===this.capacity?(this.start=m,this.size):(this.start=m,++this.size)},O.from=function(c,m,t){if(arguments.length<3&&(t=E.guessLength(c),typeof t!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var o=new O(m,t);if(E.isArrayLike(c)){var v,a;for(v=0,a=c.length;v{function E(R){if(typeof R!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=R,this.size=0}E.prototype.clear=function(){this.items.clear(),this.size=0},E.prototype.get=function(R){var O=this.items.get(R);return typeof O>"u"&&(O=this.factory(R,this.size),this.items.set(R,O),this.size++),O},E.prototype.peek=function(R){return this.items.get(R)},E.prototype.set=function(R,O){return this.items.set(R,O),this.size=this.items.size,this},E.prototype.has=function(R){return this.items.has(R)},E.prototype.delete=function(R){var O=this.items.delete(R);return this.size=this.items.size,O},E.prototype.forEach=function(R,O){O=arguments.length>1?O:this,this.items.forEach(R,O)},E.prototype.entries=function(){return this.items.entries()},E.prototype.keys=function(){return this.items.keys()},E.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.entries),E.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.autoIncrement=function(){var R=0;return function(){return R++}},T.exports=E}),LT=Lt((S,T)=>{function E(R){if(typeof R!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=R}E.prototype.clear=function(){this.items=new WeakMap},E.prototype.get=function(R){var O=this.items.get(R);return typeof O>"u"&&(O=this.factory(R),this.items.set(R,O)),O},E.prototype.peek=function(R){return this.items.get(R)},E.prototype.set=function(R,O){return this.items.set(R,O),this},E.prototype.has=function(R){return this.items.has(R)},E.prototype.delete=function(R){return this.items.delete(R)},E.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),T.exports=E}),OT=Lt((S,T)=>{var E=Xe();function R(O){var D=E.getPointerArray(O),c=E.getPointerArray(Math.log2(O));this.size=O,this.dimension=O,this.parents=new D(O),this.ranks=new c(O);for(var m=0;mo?this.parents[m]=c:(this.parents[m]=c,this.ranks[c]++),this},R.prototype.connected=function(O,D){var c=this.find(O);return c===this.find(D)},R.prototype.mapping=function(){for(var O=E.getPointerArray(this.dimension),D={},c=new O(this.size),m=0,t,o=0,v=this.parents.length;o"u"?(c[o]=m,D[t]=m++):c[o]=D[t];return c},R.prototype.compile=function(){for(var O={},D=new Array(this.dimension),c=0,m,t=0,o=this.parents.length;t"u"?(D[c]=[t],O[m]=c++):D[O[m]].push(t);return D},R.prototype.inspect=function(){var O=this.compile();return Object.defineProperty(O,"constructor",{value:R,enumerable:!1}),O},typeof Symbol<"u"&&(R.prototype[Symbol.for("nodejs.util.inspect.custom")]=R.prototype.inspect),T.exports=R}),sh=Lt((S,T)=>{var E=Zr(),R=ih(),O=E.DEFAULT_COMPARATOR,D=E.reverseComparator;function c(o,v,a,r){for(var n=a,e=r,i=v[r],h=2*r+1,s;h=0&&(h=s),v[r]=v[h],r=h,h=2*r+1;v[r]=i,R.siftDown(o,v,e,r)}function m(o,v,a,r){for(var n=r,e=n,i=new o(r),h,s;e>0;)h=a[--e],e!==0&&(s=a[0],a[0]=h,c(v,a,--r,0),h=s),i[e]=h;return i}function t(o,v,a){if(arguments.length===2&&(a=v,v=null),this.ArrayClass=o,this.capacity=a,this.items=new o(a),this.clear(),this.comparator=v||O,typeof a!="number"&&a<=0)throw new Error("mnemonist/FixedReverseHeap.constructor: capacity should be a number > 0.");if(typeof this.comparator!="function")throw new Error("mnemonist/FixedReverseHeap.constructor: given comparator should be a function.");this.comparator=D(this.comparator)}t.prototype.clear=function(){this.size=0},t.prototype.push=function(o){return this.size0&&R.replace(this.comparator,this.items,o),this.size},t.prototype.peek=function(){return this.items[0]},t.prototype.consume=function(){var o=m(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,o},t.prototype.toArray=function(){return m(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},t.prototype.inspect=function(){var o=this.toArray();return Object.defineProperty(o,"constructor",{value:t,enumerable:!1}),o},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),T.exports=t}),DT=Lt((S,T)=>{var E=fe(),R=function(D){return D};function O(D){if(this.items=new Map,this.clear(),Array.isArray(D)?(this.writeHashFunction=D[0],this.readHashFunction=D[1]):(this.writeHashFunction=D,this.readHashFunction=D),this.writeHashFunction||(this.writeHashFunction=R),this.readHashFunction||(this.readHashFunction=R),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMap.constructor: invalid hash function given.")}O.prototype.clear=function(){this.items.clear(),this.size=0},O.prototype.add=function(D){var c=this.writeHashFunction(D);return this.items.set(c,D),this.size=this.items.size,this},O.prototype.set=function(D,c){return D=this.writeHashFunction(D),this.items.set(D,c),this.size=this.items.size,this},O.prototype.get=function(D){return D=this.readHashFunction(D),this.items.get(D)},O.prototype.has=function(D){return D=this.readHashFunction(D),this.items.has(D)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this,this.items.forEach(function(m){D.call(c,m,m)})},O.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=Array.from(this.items.values());return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){var t=new O(c);return E(D,function(o,v){m?t.set(v,o):t.add(o)}),t},T.exports=O}),sd=Lt((S,T)=>{var E=we(),R=fe();function O(D){this.Container=D||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:O,enumerable:!1})}O.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},O.prototype.set=function(D,c){var m=this.items.get(D),t;return m||(this.dimension++,m=new this.Container,this.items.set(D,m)),this.Container===Set?(t=m.size,m.add(c),t"u"?0:this.Container===Set?c.size:c.length},O.prototype.count=O.prototype.multiplicity,O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;var m;function t(o){D.call(c,o,m)}this.items.forEach(function(o,v){m=v,o.forEach(t)})},O.prototype.forEachAssociation=function(D,c){c=arguments.length>1?c:this,this.items.forEach(D,c)},O.prototype.keys=function(){return this.items.keys()},O.prototype.values=function(){var D=this.items.values(),c=!1,m,t,o,v;return this.Container===Set?new E(function a(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,m=t.value.values()}return t=m.next(),t.done?(c=!1,a()):{done:!1,value:t.value}}):new E(function a(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,m=t.value,o=0,v=m.length}return o>=v?(c=!1,a()):{done:!1,value:m[o++]}})},O.prototype.entries=function(){var D=this.items.entries(),c=!1,m,t,o,v,a;return this.Container===Set?new E(function r(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,o=t.value[0],m=t.value[1].values()}return t=m.next(),t.done?(c=!1,r()):{done:!1,value:[o,t.value]}}):new E(function r(){if(!c){if(t=D.next(),t.done)return{done:!0};c=!0,o=t.value[0],m=t.value[1],v=0,a=m.length}return v>=a?(c=!1,r()):{done:!1,value:[o,m[v++]]}})},O.prototype.containers=function(){return this.items.values()},O.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.entries),O.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.prototype.toJSON=function(){return this.items},O.from=function(D,c){var m=new O(c);return R(D,function(t,o){m.set(o,t)}),m},T.exports=O}),IT=Lt((S,T)=>{var E=sd(),R=fe(),O=function(c){return c};function D(c,m){if(this.items=new E(m),this.clear(),Array.isArray(c)?(this.writeHashFunction=c[0],this.readHashFunction=c[1]):(this.writeHashFunction=c,this.readHashFunction=c),this.writeHashFunction||(this.writeHashFunction=O),this.readHashFunction||(this.readHashFunction=O),typeof this.writeHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.");if(typeof this.readHashFunction!="function")throw new Error("mnemonist/FuzzyMultiMap.constructor: invalid hash function given.")}D.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},D.prototype.add=function(c){var m=this.writeHashFunction(c);return this.items.set(m,c),this.size=this.items.size,this.dimension=this.items.dimension,this},D.prototype.set=function(c,m){return c=this.writeHashFunction(c),this.items.set(c,m),this.size=this.items.size,this.dimension=this.items.dimension,this},D.prototype.get=function(c){return c=this.readHashFunction(c),this.items.get(c)},D.prototype.has=function(c){return c=this.readHashFunction(c),this.items.has(c)},D.prototype.forEach=function(c,m){m=arguments.length>1?m:this,this.items.forEach(function(t){c.call(m,t,t)})},D.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.values),D.prototype.inspect=function(){var c=Array.from(this);return Object.defineProperty(c,"constructor",{value:D,enumerable:!1}),c},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.from=function(c,m,t,o){arguments.length===3&&typeof t=="boolean"&&(o=t,t=Array);var v=new D(m,t);return R(c,function(a,r){o?v.set(r,a):v.add(a)}),v},T.exports=D}),BT=Lt((S,T)=>{var E=1024;function R(D){return(D&D-1)===0}function O(D,c){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var m=c||0,t=E,o=0;if(typeof c=="object"&&(m=c.initialCapacity||0,o=c.initialLength||0,t=c.blockSize||E),!t||!R(t))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var v=Math.max(o,m),a=Math.ceil(v/t);this.ArrayClass=D,this.length=o,this.capacity=a*t,this.blockSize=t,this.offsetMask=t-1,this.blockMask=Math.log2(t),this.blocks=new Array(a);for(var r=0;r>this.blockMask,t=D&this.offsetMask;return this.blocks[m][t]=c,this},O.prototype.get=function(D){if(!(this.length>this.blockMask,m=D&this.offsetMask;return this.blocks[c][m]}},O.prototype.grow=function(D){if(typeof D!="number"&&(D=this.capacity+this.blockSize),this.capacity>=D)return this;for(;this.capacity>this.blockMask,t=c&this.offsetMask;return this.blocks[m][t]=D,++this.length},O.prototype.pop=function(){if(this.length!==0){var D=this.blocks[this.blocks.length-1],c=--this.length&this.offsetMask;return D[c]}},O.prototype.inspect=function(){for(var D=new this.ArrayClass(this.length),c,m=0,t=this.length;m>this.blockMask,D[m]=this.blocks[c][m&this.offsetMask];return D.type=this.ArrayClass.name,D.items=this.length,D.capacity=this.capacity,D.blockSize=this.blockSize,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),T.exports=O}),nd=Lt((S,T)=>{var E=we(),R=Ze();function O(D,c){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof c!="number"||c<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=c,this.ArrayClass=D,this.items=new this.ArrayClass(this.capacity),this.clear()}O.prototype.clear=function(){this.size=0},O.prototype.push=function(D){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=D,this.size},O.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},O.prototype.peek=function(){return this.items[this.size-1]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=D[c-m-1];return m++,{value:t,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.size,m=0;return new E(function(){if(m>=c)return{done:!0};var t=D[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return D.type=this.ArrayClass.name,D.capacity=this.capacity,Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D,c,m){if(arguments.length<3&&(m=R.guessLength(D),typeof m!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new O(c,m);if(R.isArrayLike(D)){var o,v;for(o=0,v=D.length;o{var E=Ze(),R=Xe(),O=nd();function D(m,t,o,v,a,r,n,e){var i=n+(e-n)/2|0,h=~-i,s=-~i,l=o[i];v[r]=l+1;var f=t?t(m[l]):m[l][1],u=r*2+1,d=r*2+2,p=-1/0,g=-1/0;n<=h&&(p=D(m,t,o,v,a,u,n,h)),s<=e&&(g=D(m,t,o,v,a,d,s,e));var x=Math.max(f,p,g),y=l;return x===p?y=a[v[u]-1]:x===g&&(y=a[v[d]-1]),a[l]=y,x}function c(m,t){this.size=m.length,this.intervals=m;var o=null,v=null;Array.isArray(t)&&(o=t[0],v=t[1]);var a=m.length,r=R.getPointerArray(a+1),n=new r(a),e;for(e=1;eu?1:0});var i=Math.ceil(Math.log2(a+1)),h=Math.pow(2,i)-1,s=new r(h),l=new r(a);D(m,v,n,s,l,0,0,a-1),n=null,this.height=i,this.tree=s,this.augmentations=l,this.startGetter=o,this.endGetter=v,this.stack=new O(r,this.height)}c.prototype.intervalsContainingPoint=function(m){var t=[],o=this.stack;o.clear(),o.push(0);for(var v=this.tree.length,a,r,n,e,i,h,s,l,f;o.size;)a=o.pop(),r=this.tree[a]-1,n=this.intervals[r],e=this.intervals[this.augmentations[r]],s=this.endGetter?this.endGetter(e):e[1],!(m>s)&&(l=a*2+1,l=i&&m<=h&&t.push(n),!(mf)&&(u=n*2+1,u=s&&t<=l&&v.push(i),!(o{S.search=function(T,E,R,O){var D=0;R=typeof R<"u"?R:0,O=typeof O<"u"?O:T.length,O--;for(var c;R<=O;)if(D=R+O>>>1,c=T[D],c>E)O=~-D;else if(c>>1,m=T(E[O],R),m>0)c=~-O;else if(m<0)D=-~O;else return O;return-1},S.lowerBound=function(T,E,R,O){var D=0;for(R=typeof R<"u"?R:0,O=typeof O<"u"?O:T.length;R>>1,E<=T[D]?O=D:R=-~D;return R},S.lowerBoundWithComparator=function(T,E,R){for(var O=0,D=0,c=E.length;D>>1,T(R,E[O])<=0?c=O:D=-~O;return D},S.lowerBoundIndices=function(T,E,R,O,D){var c=0;for(O=typeof O<"u"?O:0,D=typeof D<"u"?D:T.length;O>>1,R<=T[E[c]]?D=c:O=-~c;return O},S.upperBound=function(T,E,R,O){var D=0;for(R=typeof R<"u"?R:0,O=typeof O<"u"?O:T.length;R>>1,E>=T[D]?R=-~D:O=D;return R},S.upperBoundWithComparator=function(T,E,R){for(var O=0,D=0,c=E.length;D>>1,T(R,E[O])>=0?D=-~O:c=O;return D}}),NT=Lt(S=>{var T=Xe(),E=Ze().isArrayLike,R=rd(),O=eh();function D(o,v){if(o.length===0)return v.slice();if(v.length===0)return o.slice();var a;o[0]>v[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(r<=n)return T.isTypedArray(o)?T.concat(o,v):o.concat(v);var e=new o.constructor(o.length+v.length),i,h,s;for(i=0,h=o.length;iv[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(rv[0]&&(a=o,o=v,v=a);var r=o[o.length-1],n=v[0];if(ru?s=R.lowerBound(v,f,s+1):(e.push(f),i++,s++);return e};function m(o){var v=0,a=-1/0,r,n,e,i=[];for(n=0,e=o.length;na&&(a=r));if(i.length===0)return new o[0].constructor(0);if(i.length===1)return i[0].slice();if(i.length===2)return D(i[0],i[1]);o=i;var h=new o[0].constructor(v),s=T.getPointerArray(a),l=new s(o.length),f=new O(function(p,g){return p=o[p][l[p]],g=o[g][l[g]],pg?1:0});for(n=0;nv&&(v=a));if(e.length===0)return new o[0].constructor(0);if(e.length===1)return e[0].slice();if(e.length===2)return c(e[0],e[1]);o=e;var i=new o[0].constructor,h=T.getPointerArray(v),s=new h(o.length),l=new O(function(d,p){return d=o[d][s[d]],p=o[p][s[p]],dp?1:0});for(r=0;rv&&(v=r),na)return[];if(v===a)return[v];var s,l,f=o[0],u,d,p,g,x,y,C=v;for(i=1;iy?d=R.lowerBound(l,x,d+1):(f.push(x),u++,d++);if(f.length===0)return f;C=f[0]}return f},S.merge=function(){if(arguments.length===2){if(E(arguments[0]))return D(arguments[0],arguments[1])}else if(E(arguments[0]))return m(arguments);return null},S.unionUnique=function(){if(arguments.length===2){if(E(arguments[0]))return c(arguments[0],arguments[1])}else if(E(arguments[0]))return t(arguments);return null},S.intersectionUnique=function(){if(arguments.length===2){if(E(arguments[0]))return S.intersectionUniqueArrays(arguments[0],arguments[1])}else if(E(arguments[0]))return S.kWayIntersectionUniqueArrays(arguments);return null}}),GT=Lt((S,T)=>{var E=we(),R=fe(),O=NT();function D(m){return m}function c(m){if(this.clear(),Array.isArray(m)?(this.documentTokenizer=m[0],this.queryTokenizer=m[1]):(this.documentTokenizer=m,this.queryTokenizer=m),this.documentTokenizer||(this.documentTokenizer=D),this.queryTokenizer||(this.queryTokenizer=D),typeof this.documentTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: document tokenizer is not a function.");if(typeof this.queryTokenizer!="function")throw new Error("mnemonist/InvertedIndex.constructor: query tokenizer is not a function.")}c.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},c.prototype.add=function(m){this.size++;var t=this.items.length;this.items.push(m);var o=this.documentTokenizer(m);if(!Array.isArray(o))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var v=new Set,a,r,n=0,e=o.length;n"u"||o.length===0)return[];if(t.length>1)for(a=1,r=t.length;a"u"||v.length===0)return[];o=O.intersectionUniqueArrays(o,v)}var n=new Array(o.length);for(a=0,r=n.length;a1?t:this;for(var o=0,v=this.documents.length;o=t)return{done:!0};var v=m[o++];return{value:v,done:!1}})},c.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.documents),c.prototype.inspect=function(){var m=this.items.slice();return Object.defineProperty(m,"constructor",{value:c,enumerable:!1}),m},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(m,t){var o=new c(t);return R(m,function(v){o.add(v)}),o},T.exports=c}),ad=Lt(S=>{var T=new Float64Array(64),E=new Float64Array(64);function R(D,c,m){var t,o,v,a,r;for(T[0]=c,E[0]=m,o=0;o>=0;)if(v=T[o],a=E[o]-1,v=t&&vE[o-1]-T[o-1]&&(r=T[o],T[o]=T[o-1],T[o-1]=r,r=E[o],E[o]=E[o-1],E[o-1]=r)}else o--;return D}S.inplaceQuickSort=R;function O(D,c,m,t){var o,v,a,r,n,e;for(T[0]=m,E[0]=t,v=0;v>=0;)if(a=T[v],r=E[v]-1,a=o&&aE[v-1]-T[v-1]&&(e=T[v],T[v]=T[v-1],T[v-1]=e,e=E[v],E[v]=E[v-1],E[v-1]=e)}else v--;return c}S.inplaceQuickSortIndices=O}),zT=Lt((S,T)=>{var E=Ze(),R=Xe(),O=Zr().createTupleComparator,D=sh(),c=ad().inplaceQuickSortIndices;function m(n,e,i,h){var s,l=0,f;for(s=0;s>>1),P=i[C],f[L]=P,x>-1&&(y===0?u[x]=L+1:d[x]=L+1),I=(I+1)%n,C!==M&&C!==w-1&&p.push([I,C+1,w,L,1]),C!==M&&p.push([I,M,C,L,0]),L++;return{axes:e,labels:h,pivots:f,lefts:u,rights:d}}function v(n,e){this.dimensions=n,this.visited=0,this.axes=e.axes,this.labels=e.labels,this.pivots=e.pivots,this.lefts=e.lefts,this.rights=e.rights,this.size=this.labels.length}v.prototype.nearestNeighbor=function(n){var e=1/0,i=null,h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(g,x){d++;var y=f[x],C=u[x],P=l[x],M=m(h,s,P,n);if(!(M0?y!==0&&p(g,y-1):C!==0&&p(g,C-1),w*w0?C!==0&&p(g,C-1):y!==0&&p(g,y-1))}}return p(0,0),this.visited=d,this.labels[i]};var a=O(3),r=O(2);v.prototype.kNearestNeighbors=function(n,e){if(n<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(n=Math.min(n,this.size),n===1)return[this.nearestNeighbor(e)];var i=new D(Array,a,n),h=this.dimensions,s=this.axes,l=this.pivots,f=this.lefts,u=this.rights,d=0;function p(y,C){var P=f[C],M=u[C],w=l[C],I=m(h,s,w,e);i.push([I,d++,w]);var L=e[y],B=s[y][w],N=L-B;y=(y+1)%h,L{var E=we(),R=fe();function O(){this.clear()}O.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},O.prototype.first=function(){return this.head?this.head.item:void 0},O.prototype.peek=O.prototype.first,O.prototype.last=function(){return this.tail?this.tail.item:void 0},O.prototype.push=function(D){var c={item:D,next:null};return this.head?(this.tail.next=c,this.tail=c):(this.head=c,this.tail=c),this.size++,this.size},O.prototype.unshift=function(D){var c={item:D,next:null};return this.head?(this.head.next||(this.tail=this.head),c.next=this.head,this.head=c):(this.head=c,this.tail=c),this.size++,this.size},O.prototype.shift=function(){if(this.size){var D=this.head;return this.head=D.next,this.size--,D.item}},O.prototype.forEach=function(D,c){if(this.size){c=arguments.length>1?c:this;for(var m=this.head,t=0;m;)D.call(c,m.item,t,this),m=m.next,t++}},O.prototype.toArray=function(){if(!this.size)return[];for(var D=new Array(this.size),c=0,m=this.size,t=this.head;c{var E=we(),R=fe(),O=Xe(),D=Ze();function c(m,t,o){if(arguments.length<2&&(o=m,m=null,t=null),this.capacity=o,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var v=O.getPointerArray(o);this.forward=new v(o),this.backward=new v(o),this.K=typeof m=="function"?new m(o):new Array(o),this.V=typeof t=="function"?new t(o):new Array(o),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(m){var t=this.head;if(this.head===m)return this;var o=this.backward[m],v=this.forward[m];return this.tail===m?this.tail=o:this.backward[v]=o,this.forward[o]=v,this.backward[t]=m,this.head=m,this.forward[m]=t,this},c.prototype.set=function(m,t){var o=this.items[m];if(typeof o<"u"){this.splayOnTop(o),this.V[o]=t;return}this.size1?t:this;for(var o=0,v=this.size,a=this.head,r=this.K,n=this.V,e=this.forward;o=t)return{done:!0};var r=v[o];return m++,m=t)return{done:!0};var r=v[o];return m++,m=t)return{done:!0};var n=v[o],e=a[o];return m++,m{var E=nh(),R=fe(),O=Xe(),D=Ze();function c(t,o,v){arguments.length<2?E.call(this,t):E.call(this,t,o,v);var a=O.getPointerArray(this.capacity);this.deleted=new a(this.capacity),this.deletedSize=0}for(m in E.prototype)c.prototype[m]=E.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=E.prototype[Symbol.iterator]),c.prototype.clear=function(){E.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,o){var v=this.items[t];if(typeof v<"u"){this.splayOnTop(v),this.V[v]=o;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],delete this.items[this.K[v]]),this.items[t]=v,this.K[v]=t,this.V[v]=o,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,o){var v=null,a=null,r=this.items[t];return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=o,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],a=this.K[r],delete this.items[a]),this.items[t]=r,this.K[r]=t,this.V[r]=o,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,a?{evicted:!0,key:a,value:v}:null)},c.prototype.delete=function(t){var o=this.items[t];if(typeof o>"u")return!1;if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[o],a=this.forward[o];return this.head===o&&(this.head=a),this.tail===o&&(this.tail=v),this.forward[v]=a,this.backward[a]=v,this.size--,this.deleted[this.deletedSize++]=o,!0},c.prototype.remove=function(t,o=void 0){var v=this.items[t];if(typeof v>"u")return o;var a=this.V[v];if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,a;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,a},c.from=function(t,o,v,a){if(arguments.length<2){if(a=D.guessLength(t),typeof a!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(a=o,o=null,v=null);var r=new c(o,v,a);return R(t,function(n,e){r.set(e,n)}),r},T.exports=c}),od=Lt((S,T)=>{var E=nh(),R=fe(),O=Xe(),D=Ze();function c(m,t,o){if(arguments.length<2&&(o=m,m=null,t=null),this.capacity=o,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var v=O.getPointerArray(o);this.forward=new v(o),this.backward=new v(o),this.K=typeof m=="function"?new m(o):new Array(o),this.V=typeof t=="function"?new t(o):new Array(o),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(m,t){var o=this.items.get(m);if(typeof o<"u"){this.splayOnTop(o),this.V[o]=t;return}this.size{var E=od(),R=fe(),O=Xe(),D=Ze();function c(t,o,v){arguments.length<2?E.call(this,t):E.call(this,t,o,v);var a=O.getPointerArray(this.capacity);this.deleted=new a(this.capacity),this.deletedSize=0}for(m in E.prototype)c.prototype[m]=E.prototype[m];var m;typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=E.prototype[Symbol.iterator]),c.prototype.clear=function(){E.prototype.clear.call(this),this.deletedSize=0},c.prototype.set=function(t,o){var v=this.items.get(t);if(typeof v<"u"){this.splayOnTop(v),this.V[v]=o;return}this.size0?v=this.deleted[--this.deletedSize]:v=this.size,this.size++):(v=this.tail,this.tail=this.backward[v],this.items.delete(this.K[v])),this.items.set(t,v),this.K[v]=t,this.V[v]=o,this.forward[v]=this.head,this.backward[this.head]=v,this.head=v},c.prototype.setpop=function(t,o){var v=null,a=null,r=this.items.get(t);return typeof r<"u"?(this.splayOnTop(r),v=this.V[r],this.V[r]=o,{evicted:!1,key:t,value:v}):(this.size0?r=this.deleted[--this.deletedSize]:r=this.size,this.size++):(r=this.tail,this.tail=this.backward[r],v=this.V[r],a=this.K[r],this.items.delete(a)),this.items.set(t,r),this.K[r]=t,this.V[r]=o,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r,a?{evicted:!0,key:a,value:v}:null)},c.prototype.delete=function(t){var o=this.items.get(t);if(typeof o>"u")return!1;if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var v=this.backward[o],a=this.forward[o];return this.head===o&&(this.head=a),this.tail===o&&(this.tail=v),this.forward[v]=a,this.backward[a]=v,this.size--,this.deleted[this.deletedSize++]=o,!0},c.prototype.remove=function(t,o=void 0){var v=this.items.get(t);if(typeof v>"u")return o;var a=this.V[v];if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,a;var r=this.backward[v],n=this.forward[v];return this.head===v&&(this.head=n),this.tail===v&&(this.tail=r),this.forward[r]=n,this.backward[n]=r,this.size--,this.deleted[this.deletedSize++]=v,a},c.from=function(t,o,v,a){if(arguments.length<2){if(a=D.guessLength(t),typeof a!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(a=o,o=null,v=null);var r=new c(o,v,a);return R(t,function(n,e){r.set(e,n)}),r},T.exports=c}),WT=Lt((S,T)=>{var E=we(),R=fe(),O=sh(),D=function(m,t){return m[1]>t[1]?-1:m[1]"u"?0:t},c.prototype.get=c.prototype.multiplicity,c.prototype.count=c.prototype.multiplicity,c.prototype.frequency=function(m){if(this.size===0)return 0;var t=this.multiplicity(m);return t/this.size},c.prototype.top=function(m){if(typeof m!="number"||m<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var t=new O(Array,D,m),o=this.items.entries(),v;v=o.next(),!v.done;)t.push(v.value);return t.consume()},c.prototype.forEach=function(m,t){t=arguments.length>1?t:this;var o;this.items.forEach(function(v,a){for(o=0;o1?t:this,this.items.forEach(m,t)},c.prototype.keys=function(){return this.items.keys()},c.prototype.values=function(){var m=this.items.entries(),t=!1,o,v,a,r;return new E(function n(){if(!t){if(o=m.next(),o.done)return{done:!0};t=!0,v=o.value[0],a=o.value[1],r=0}return r>=a?(t=!1,n()):(r++,{done:!1,value:v})})},c.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.values),c.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.prototype.toJSON=function(){return this.items},c.from=function(m){var t=new c;return R(m,function(o){t.add(o)}),t},c.isSubset=function(m,t){var o=m.multiplicities(),v,a,r;if(m===t)return!0;if(m.dimension>t.dimension)return!1;for(;v=o.next(),!v.done;)if(a=v.value[0],r=v.value[1],t.multiplicity(a){var E=we(),R=fe();function O(n,e,i){return((Math.pow(n,2)-Math.pow(Math.abs(e-i),2))/2|0)+n+1}function D(n,e){for(var i=0,h=0,s=e+1;he.length?-1:n.lengthe?1:0}function m(n,e){var i=n+1,h=e/i|0,s=h+1,l,f,u=e-h*i,d=i-u,p=new Array(n+1);for(l=0;l 0");this.levenshtein=n,this.k=e,this.clear()}r.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},r.prototype.add=function(n){var e=n.length,i=this.size;this.strings.push(n),this.size++;var h=t(this.k,n),s=this.invertedIndices[e];typeof s>"u"&&(s={},this.invertedIndices[e]=s);var l,f,u,d,p;for(d=0,p=h.length;d"u"?(f=[i],s[u]=f):f.push(i);return this},r.prototype.search=function(n){var e=n.length,i=this.k,h=new Set,s,l,f,u,d,p,g,x,y,C,P,M,w,I,L;for(x=Math.max(0,e-i),y=e+i+1;x1?e:this;for(var i=0,h=this.strings.length;i=e)return{done:!0};var h=n[i];return i++,{value:h,done:!1}})},typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=r.prototype.values),r.prototype.inspect=function(){var n=this.strings.slice();return Object.defineProperty(n,"constructor",{value:r,enumerable:!1}),n},typeof Symbol<"u"&&(r.prototype[Symbol.for("nodejs.util.inspect.custom")]=r.prototype.inspect),r.from=function(n,e,i){var h=new r(e,i);return R(n,function(s){h.add(s)}),h},r.countKeys=D,r.comparator=c,r.partition=m,r.segments=t,r.segmentPos=o,r.multiMatchAwareInterval=v,r.multiMatchAwareSubstrings=a,T.exports=r}),HT=Lt((S,T)=>{var E=we(),R=fe();function O(){this.clear()}O.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},O.prototype.enqueue=function(D){return this.items.push(D),++this.size},O.prototype.dequeue=function(){if(this.size){var D=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,D}},O.prototype.peek=function(){if(this.size)return this.items[this.offset]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=this.offset,t=0,o=this.items.length;m=D.length)return{done:!0};var m=D[c];return c++,{value:m,done:!1}})},O.prototype.entries=function(){var D=this.items,c=this.offset,m=0;return new E(function(){if(c>=D.length)return{done:!0};var t=D[c];return c++,{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D){var c=new O;return R(D,function(m){c.enqueue(m)}),c},O.of=function(){return O.from(arguments)},T.exports=O}),KT=Lt((S,T)=>{var E=we(),R=fe();function O(){this.clear()}O.prototype.clear=function(){this.items=[],this.size=0},O.prototype.push=function(D){return this.items.push(D),++this.size},O.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},O.prototype.peek=function(){return this.items[this.size-1]},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0,t=this.items.length;m=c)return{done:!0};var t=D[c-m-1];return m++,{value:t,done:!1}})},O.prototype.entries=function(){var D=this.items,c=D.length,m=0;return new E(function(){if(m>=c)return{done:!0};var t=D[c-m-1];return{value:[m++,t],done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.toString=function(){return this.toArray().join(",")},O.prototype.toJSON=function(){return this.toArray()},O.prototype.inspect=function(){var D=this.toArray();return Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),O.from=function(D){var c=new O;return R(D,function(m){c.push(m)}),c},O.of=function(){return O.from(arguments)},T.exports=O}),jT=Lt(S=>{S.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var T=new Set,E=1/0,R=null,O,D,c=arguments.length;for(D=0;DE.size)return!1;for(;O=R.next(),!O.done;)if(!E.has(O.value))return!1;return!0},S.isSuperset=function(T,E){return S.isSubset(E,T)},S.add=function(T,E){for(var R=E.values(),O;O=R.next(),!O.done;)T.add(O.value)},S.subtract=function(T,E){for(var R=E.values(),O;O=R.next(),!O.done;)T.delete(O.value)},S.intersect=function(T,E){for(var R=T.values(),O;O=R.next(),!O.done;)E.has(O.value)||T.delete(O.value)},S.disjunct=function(T,E){for(var R=T.values(),O,D=[];O=R.next(),!O.done;)E.has(O.value)&&D.push(O.value);for(R=E.values();O=R.next(),!O.done;)T.has(O.value)||T.add(O.value);for(var c=0,m=D.length;cE.size&&(R=T,T=E,E=R),T.size===0)return 0;if(T===E)return T.size;for(var O=T.values(),D,c=0;D=O.next(),!D.done;)E.has(D.value)&&c++;return c},S.unionSize=function(T,E){var R=S.intersectionSize(T,E);return T.size+E.size-R},S.jaccard=function(T,E){var R=S.intersectionSize(T,E);if(R===0)return 0;var O=T.size+E.size-R;return R/O},S.overlap=function(T,E){var R=S.intersectionSize(T,E);return R===0?0:R/Math.min(T.size,E.size)}}),$T=Lt((S,T)=>{var E=we(),R=Xe().getPointerArray;function O(D){var c=R(D);this.start=0,this.size=0,this.capacity=D,this.dense=new c(D),this.sparse=new c(D)}O.prototype.clear=function(){this.start=0,this.size=0},O.prototype.has=function(D){if(this.size===0)return!1;var c=this.sparse[D],m=c=this.start&&c=this.start&&c1?c:this;for(var m=this.capacity,t=this.size,o=this.start,v=0;v=m)return{done:!0};var v=D[t];return t++,o++,t===c&&(t=0),{value:v,done:!1}})},typeof Symbol<"u"&&(O.prototype[Symbol.iterator]=O.prototype.values),O.prototype.inspect=function(){var D=[];return this.forEach(function(c){D.push(c)}),Object.defineProperty(D,"constructor",{value:O,enumerable:!1}),D.capacity=this.capacity,D},typeof Symbol<"u"&&(O.prototype[Symbol.for("nodejs.util.inspect.custom")]=O.prototype.inspect),T.exports=O}),ZT=Lt((S,T)=>{var E=we(),R=Xe().getPointerArray;function O(D,c){arguments.length<2&&(c=D,D=Array);var m=R(c);this.size=0,this.length=c,this.dense=new m(c),this.sparse=new m(c),this.vals=new D(c)}O.prototype.clear=function(){this.size=0},O.prototype.has=function(D){var c=this.sparse[D];return c=this.size||this.dense[c]!==D?!1:(c=this.dense[this.size-1],this.dense[this.sparse[D]]=c,this.sparse[c]=this.sparse[D],this.size--,!0)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m=0;m{var E=we(),R=Xe().getPointerArray;function O(D){var c=R(D);this.size=0,this.length=D,this.dense=new c(D),this.sparse=new c(D)}O.prototype.clear=function(){this.size=0},O.prototype.has=function(D){var c=this.sparse[D];return c=this.size||this.dense[c]!==D?!1:(c=this.dense[this.size-1],this.dense[this.sparse[D]]=c,this.sparse[c]=this.sparse[D],this.size--,!0)},O.prototype.forEach=function(D,c){c=arguments.length>1?c:this;for(var m,t=0;t{var E=fe(),R=2,O=2,D=new Set([0,1,2]),c={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function m(e){var i=new Set;return typeof e=="number"&&i.add(e),{suggestions:i,count:0}}function t(e,i,h){return{term:e||"",distance:i||0,count:h||0}}function o(e,i,h,s){s=s||new Set,i++;var l,f=e.length,u;if(f>1)for(u=0;u0&&e[u].length-f.length>s.length-f.length&&(h.suggestions=new Set,h.count=0),(i===2||!h.suggestions.size||e[u].length-f.length>=s.length-f.length)&&h.suggestions.add(l)}function a(e,i){var h=e.length,s=i.length,l=[[]],f=h+s,u=new Map,d,p,g;for(l[0][0]=f,d=0;d<=h;d++)l[d+1]||(l[d+1]=[]),l[d+1][1]=d,l[d+1][0]=f;for(g=0;g<=s;g++)l[1][g+1]=g,l[0][g+1]=f;var x=e+i,y;for(d=0,p=x.length;dl)return[];for(var d=[f],p=new Set,g=new Set,x=[],y,C;d.length>0&&(y=d.shift(),!(h<2&&x.length>0&&u-y.length>x[0].distance));){if(C=e[y],C!==void 0){if(typeof C=="number"&&(C=m(C)),C.count>0&&!g.has(y)){g.add(y);var P=t(y,u-y.length,C.count);if(x.push(P),h<2&&u-y.length===0)break}C.suggestions.forEach(L=>{var B=i[L];if(!g.has(B)){g.add(B);var N=0;if(f!==B)if(B.length===y.length)N=u-y.length;else if(u===y.length)N=B.length-y.length;else{for(var G=0,V=0,K=B.length;G0||V>0?N=a(B.substr(G,K-G-V),f.substr(G,u-G-V)):N=a(B,f)}if(h<2&&x.length>0&&x[0].distance>N&&(x=[]),!(h<2&&x.length>0&&N>x[0].distance)&&N<=s){var j=e[B];j!==void 0&&x.push(t(B,N,j.count))}}})}if(u-y.length0&&u-y.length>=x[0].distance)continue;for(var M=0,w=y.length;Mthis.maxLength&&(this.maxLength=e.length)),i.count===1){var h=this.words.length;this.words.push(e);var s=o(e,0,this.maxDistance);s.forEach(l=>{var f=this.dictionary[l];f!==void 0?(typeof f=="number"&&(f=m(f),this.dictionary[l]=f),f.suggestions.has(h)||v(this.words,this.verbosity,f,e,h,l)):this.dictionary[l]=h})}return this.size++,this},n.prototype.search=function(e){return r(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,e)},n.prototype.inspect=function(){var e=[];e.size=this.size,e.maxDistance=this.maxDistance,e.verbosity=this.verbosity,e.behavior=c[this.verbosity];for(var i in this.dictionary)typeof this.dictionary[i]=="object"&&this.dictionary[i].count&&e.push([i,this.dictionary[i].count]);return Object.defineProperty(e,"constructor",{value:n,enumerable:!1}),e},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.from=function(e,i){var h=new n(i);return E(e,function(s){h.add(s)}),h},T.exports=n}),hd=Lt((S,T)=>{var E=fe(),R=we(),O="\0";function D(c){this.mode=c===Array?"array":"string",this.clear()}D.prototype.clear=function(){this.root={},this.size=0},D.prototype.set=function(c,m){for(var t=this.root,o,v=0,a=c.length;v"u")return;if(O in m)return m[O]},D.prototype.delete=function(c){var m=this.root,t=null,o=null,v,a,r,n;for(r=0,n=c.length;r"u")return!1;t!==null?Object.keys(m).length>1&&(t=null,o=null):Object.keys(m).length<2&&(t=v,o=a)}return O in m?(this.size--,t?delete t[o]:delete m[O],!0):!1},D.prototype.has=function(c){for(var m=this.root,t,o=0,v=c.length;o"u")return!1;return O in m},D.prototype.find=function(c){var m=typeof c=="string",t=this.root,o=[],v,a,r;for(a=0,r=c.length;a"u")return o;for(var n=[t],e=[c],i;n.length;){c=e.pop(),t=n.pop();for(i in t){if(i===O){o.push([c,t[O]]);continue}n.push(t[i]),e.push(m?c+i:c.concat(i))}}return o},D.prototype.values=function(c){var m=this.root,t=[],o,v,a;if(c){for(v=0,a=c.length;v"u")return R.empty()}return t.push(m),new R(function(){for(var r,n=!1,e;t.length;){r=t.pop();for(e in r){if(e===O){n=!0;continue}t.push(r[e])}if(n)return{done:!1,value:r[O]}}return{done:!0}})},D.prototype.prefixes=function(c){var m=this.root,t=[],o=[],v,a,r,n=this.mode==="string";if(c){for(a=0,r=c.length;a"u")return R.empty()}else c=n?"":[];return t.push(m),o.push(c),new R(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=o.pop();for(s in e){if(s===O){h=!0;continue}t.push(e[s]),o.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:i}}return{done:!0}})},D.prototype.keys=D.prototype.prefixes,D.prototype.entries=function(c){var m=this.root,t=[],o=[],v,a,r,n=this.mode==="string";if(c){for(a=0,r=c.length;a"u")return R.empty()}else c=n?"":[];return t.push(m),o.push(c),new R(function(){for(var e,i,h=!1,s;t.length;){e=t.pop(),i=o.pop();for(s in e){if(s===O){h=!0;continue}t.push(e[s]),o.push(n?i+s:i.concat(s))}if(h)return{done:!1,value:[i,e[O]]}}return{done:!0}})},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.entries),D.prototype.inspect=function(){for(var c=new Array(this.size),m=this.entries(),t,o=0;t=m.next(),!t.done;)c[o++]=t.value;return Object.defineProperty(c,"constructor",{value:D,enumerable:!1}),c},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.prototype.toJSON=function(){return this.root},D.from=function(c){var m=new D;return E(c,function(t,o){m.set(o,t)}),m},D.SENTINEL=O,T.exports=D}),kT=Lt((S,T)=>{var E=fe(),R=hd(),O="\0";function D(m){this.mode=m===Array?"array":"string",this.clear()}for(c in R.prototype)D.prototype[c]=R.prototype[c];var c;delete D.prototype.set,delete D.prototype.get,delete D.prototype.values,delete D.prototype.entries,D.prototype.add=function(m){for(var t=this.root,o,v=0,a=m.length;v"u")return v;for(var e=[o],i=[m],h;e.length;){m=i.pop(),o=e.pop();for(h in o){if(h===O){v.push(m);continue}e.push(o[h]),i.push(t?m+h:m.concat(h))}}return v},typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=D.prototype.keys),D.prototype.inspect=function(){for(var m=new Set,t=this.keys(),o;o=t.next(),!o.done;)m.add(o.value);return Object.defineProperty(m,"constructor",{value:D,enumerable:!1}),m},typeof Symbol<"u"&&(D.prototype[Symbol.for("nodejs.util.inspect.custom")]=D.prototype.inspect),D.prototype.toJSON=function(){return this.root},D.from=function(m){var t=new D;return E(m,function(o){t.add(o)}),t},D.SENTINEL=O,T.exports=D}),qT=Lt((S,T)=>{var E=we(),R=fe(),O=Ze(),D=Xe(),c=function(v){return Math.max(1,Math.ceil(v*1.5))},m=function(v){var a=D.getPointerArray(v);return new a(v)};function t(v,a){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var r=a||0,n=c,e=0,i=!1;typeof a=="object"&&(r=a.initialCapacity||0,e=a.initialLength||0,n=a.policy||n,i=a.factory===!0),this.factory=i?v:null,this.ArrayClass=v,this.length=e,this.capacity=Math.max(e,r),this.policy=n,this.array=new v(this.capacity)}t.prototype.set=function(v,a){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(v):this.array=this.factory(v),D.isTypedArray(this.array))this.array.set(a,0);else for(var r=0,n=this.length;r=v)return this;for(a=this.capacity;a=a)return{done:!0};var n=v[r];return r++,{value:n,done:!1}})},t.prototype.entries=function(){var v=this.array,a=this.length,r=0;return new E(function(){if(r>=a)return{done:!0};var n=v[r];return{value:[r++,n],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var v=this.array.slice(0,this.length);return v.type=this.array.constructor.name,v.items=this.length,v.capacity=this.capacity,Object.defineProperty(v,"constructor",{value:t,enumerable:!1}),v},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(v,a,r){if(arguments.length<3&&(r=O.guessLength(v),typeof r!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var n=new t(a,r);return R(v,function(e){n.push(e)}),n};function o(v){var a=function(n){t.call(this,v,n)};for(var r in t.prototype)t.prototype.hasOwnProperty(r)&&(a.prototype[r]=t.prototype[r]);return a.from=function(n,e){return t.from(n,v,e)},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a}t.Int8Vector=o(Int8Array),t.Uint8Vector=o(Uint8Array),t.Uint8ClampedVector=o(Uint8ClampedArray),t.Int16Vector=o(Int16Array),t.Uint16Vector=o(Uint16Array),t.Int32Vector=o(Int32Array),t.Uint32Vector=o(Uint32Array),t.Float32Vector=o(Float32Array),t.Float64Vector=o(Float64Array),t.PointerVector=o(m),T.exports=t}),_T=Lt((S,T)=>{var E=Ze(),R=Xe(),O=ad().inplaceQuickSortIndices,D=rd().lowerBoundIndices,c=ih(),m=R.getPointerArray;function t(a,r){return a.distancer.distance?-1:0}function o(a,r,n){for(var e=n.length,i=m(e),h=0,s=new i(e),l=new i(e),f=new i(e),u=new Float64Array(e),d=[0,0,e],p=new Float64Array(e),g,x,y,C,P,M,w,I,L;d.length;)if(P=d.pop(),C=d.pop(),g=d.pop(),x=n[P-1],P--,L=P-C,s[g]=x,L!==0){if(L===1){w=a(r[x],r[n[C]]),u[g]=w,h++,f[g]=h,s[h]=n[C];continue}for(I=C;I0&&(h++,f[g]=h,d.push(h,M,P)),M-C>0&&(h++,l[g]=h,d.push(h,C,M))}return{nodes:s,lefts:l,rights:f,mus:u}}function v(a,r){if(typeof a!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!r)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=a,this.heap=new c(t),this.D=0;var n=E.toArrayWithIndices(r);this.items=n[0];var e=n[1];this.size=e.length;var i=o(a,this.items,e);this.nodes=i.nodes,this.lefts=i.lefts,this.rights=i.rights,this.mus=i.mus}v.prototype.nearestNeighbors=function(a,r){var n=this.heap,e=[0],i=1/0,h,s,l,f,u,d,p;for(this.D=0;e.length;)h=e.pop(),s=this.nodes[h],l=this.items[s],p=this.distance(l,r),this.D++,pa&&n.pop(),n.size>=a&&(i=n.peek().distance)),f=this.lefts[h],u=this.rights[h],!(!f&&!u)&&(d=this.mus[h],p=d-i&&e.push(u)):(u&&p>=d-i&&e.push(u),f&&p=0;x--)g[x]=n.pop();return g},v.prototype.neighbors=function(a,r){var n=[],e=[0],i,h,s,l,f,u,d;for(this.D=0;e.length;)i=e.pop(),h=this.nodes[i],s=this.items[h],d=this.distance(s,r),this.D++,d<=a&&n.push({distance:d,item:s}),l=this.lefts[i],f=this.rights[i],!(!l&&!f)&&(u=this.mus[i],d=u-a&&e.push(f)):(f&&d>=u-a&&e.push(f),l&&d{var E=ih(),R=eh(),O=ST();T.exports={BiMap:CT(),BitSet:ET(),BitVector:PT(),BloomFilter:MT(),BKTree:wT(),CircularBuffer:RT(),DefaultMap:FT(),DefaultWeakMap:LT(),FixedDeque:id(),StaticDisjointSet:OT(),FibonacciHeap:R,MinFibonacciHeap:R.MinFibonacciHeap,MaxFibonacciHeap:R.MaxFibonacciHeap,FixedReverseHeap:sh(),FuzzyMap:DT(),FuzzyMultiMap:IT(),HashedArrayTree:BT(),Heap:E,MinHeap:E.MinHeap,MaxHeap:E.MaxHeap,StaticIntervalTree:bT(),InvertedIndex:GT(),KDTree:zT(),LinkedList:UT(),LRUCache:nh(),LRUCacheWithDelete:XT(),LRUMap:od(),LRUMapWithDelete:VT(),MultiMap:sd(),MultiSet:WT(),PassjoinIndex:YT(),Queue:HT(),FixedStack:nd(),Stack:KT(),SuffixArray:O,GeneralizedSuffixArray:O.GeneralizedSuffixArray,Set:jT(),SparseQueueSet:$T(),SparseMap:ZT(),SparseSet:JT(),SymSpell:QT(),Trie:kT(),TrieMap:hd(),Vector:qT(),VPTree:_T()}}),ut=class me{static get ZERO(){return new me(0,0)}static get ONE(){return new me(1,1)}static get UP(){return new me(0,-1)}static get DOWN(){return new me(0,1)}static get LEFT(){return new me(-1,0)}static get RIGHT(){return new me(1,0)}static get UP_LEFT(){return new me(-1,-1)}static get UP_RIGHT(){return new me(1,-1)}static get DOWN_RIGHT(){return new me(1,1)}static get DOWN_LEFT(){return new me(-1,1)}constructor(T,E){typeof T=="number"?(this.x=T,this.y=E||0):(this.x=T.x,this.y=T.y)}clone(){return new me(this.x,this.y)}add(T){return new me(this.x+T.x,this.y+T.y)}multiply(T){return new me(this.x*T.x,this.y*T.y)}divide(T){return new me(this.x/T.x,this.y/T.y)}subtract(T){return new me(this.x-T.x,this.y-T.y)}equals(T){return this.x===T.x&&this.y===T.y}abs(){return new me(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(T){return new me(this.x%T.x,this.y%T.y)}scalarModulo(T){return new me(this.x%T,this.y%T)}scalarMult(T){return new me(this.x*T,this.y*T)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},Ut=class{static equal(S,T){return S.position.x===T.position.x&&S.position.y===T.position.y&&S.layer===T.layer}static copyOver(S,T){T.position.x=S.position.x,T.position.y=S.position.y,T.layer=S.layer}static clone(S){return{position:S.position.clone(),layer:S.layer}}static toString(S){return`${S.position.toString()}#${S.layer}`}static toInternal(S){return{position:new ut(S.position.x,S.position.y),layer:S.charLayer}}static fromInternal(S){return{position:S.position.toPosition(),charLayer:S.layer}}},eS=(S=>(S.NONE="none",S.LEFT="left",S.UP_LEFT="up-left",S.UP="up",S.UP_RIGHT="up-right",S.RIGHT="right",S.DOWN_RIGHT="down-right",S.DOWN="down",S.DOWN_LEFT="down-left",S))(eS||{}),iS={up:"down",down:"up",left:"right",right:"left",none:"none","up-left":"down-right","up-right":"down-left","down-right":"up-left","down-left":"up-right"},sS={up:ut.UP,down:ut.DOWN,left:ut.LEFT,right:ut.RIGHT,none:ut.ZERO,"up-left":ut.UP_LEFT,"up-right":ut.UP_RIGHT,"down-right":ut.DOWN_RIGHT,"down-left":ut.DOWN_LEFT},Er={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},ld=["up","up-right","right","down-right","down","down-left","left","up-left"],nS=["down-left","down-right","up-right","up-left"];function rh(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function hn(S){return nS.includes(S)}function rS(S,T=1){return S==="none"?"none":ld[(Er[S]+8-Math.abs(T)%8)%8]}function ud(S,T=1){return S==="none"?"none":ld[(Er[S]+T)%8]}function cs(S){return sS[S]}function aS(S){return iS[S]}function ni(S,T){if(S.x===T.x){if(S.y>T.y)return"up";if(S.yT.x)return"left";if(S.xT.x){if(S.yT.y)return"up-left"}else if(S.xT.y)return"up-right"}return"none"}var oS=(S=>(S[S.FOUR=4]="FOUR",S[S.EIGHT=8]="EIGHT",S))(oS||{});function Ls(S){return typeof S=="string"&&rh().includes(S)}var Lo=function(S,T){return Lo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,R){E.__proto__=R}||function(E,R){for(var O in R)Object.prototype.hasOwnProperty.call(R,O)&&(E[O]=R[O])},Lo(S,T)};function mn(S,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");Lo(S,T);function E(){this.constructor=S}S.prototype=T===null?Object.create(T):(E.prototype=T.prototype,new E)}function hS(S,T,E,R){function O(D){return D instanceof E?D:new E(function(c){c(D)})}return new(E||(E=Promise))(function(D,c){function m(v){try{o(R.next(v))}catch(a){c(a)}}function t(v){try{o(R.throw(v))}catch(a){c(a)}}function o(v){v.done?D(v.value):O(v.value).then(m,t)}o((R=R.apply(S,T||[])).next())})}function fd(S,T){var E={label:0,sent:function(){if(D[0]&1)throw D[1];return D[1]},trys:[],ops:[]},R,O,D,c;return c={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function m(o){return function(v){return t([o,v])}}function t(o){if(R)throw new TypeError("Generator is already executing.");for(;c&&(c=0,o[0]&&(E=0)),E;)try{if(R=1,O&&(D=o[0]&2?O.return:o[0]?O.throw||((D=O.return)&&D.call(O),0):O.next)&&!(D=D.call(O,o[1])).done)return D;switch(O=0,D&&(o=[o[0]&2,D.value]),o[0]){case 0:case 1:D=o;break;case 4:return E.label++,{value:o[1],done:!1};case 5:E.label++,O=o[1],o=[0];continue;case 7:o=E.ops.pop(),E.trys.pop();continue;default:if(D=E.trys,!(D=D.length>0&&D[D.length-1])&&(o[0]===6||o[0]===2)){E=0;continue}if(o[0]===3&&(!D||o[1]>D[0]&&o[1]=S.length&&(S=void 0),{value:S&&S[R++],done:!S}}};throw new TypeError(T?"Object is not iterable.":"Symbol.iterator is not defined.")}function dn(S,T){var E=typeof Symbol=="function"&&S[Symbol.iterator];if(!E)return S;var R=E.call(S),O,D=[],c;try{for(;(T===void 0||T-- >0)&&!(O=R.next()).done;)D.push(O.value)}catch(m){c={error:m}}finally{try{O&&!O.done&&(E=R.return)&&E.call(R)}finally{if(c)throw c.error}}return D}function cn(S,T,E){if(E||arguments.length===2)for(var R=0,O=T.length,D;R1||m(r,n)})})}function m(r,n){try{t(R[r](n))}catch(e){a(D[0][3],e)}}function t(r){r.value instanceof Ds?Promise.resolve(r.value.v).then(o,v):a(D[0][2],r)}function o(r){m("next",r)}function v(r){m("throw",r)}function a(r,n){r(n),D.shift(),D.length&&m(D[0][0],D[0][1])}}function uS(S){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var T=S[Symbol.asyncIterator],E;return T?T.call(S):(S=typeof Ns=="function"?Ns(S):S[Symbol.iterator](),E={},R("next"),R("throw"),R("return"),E[Symbol.asyncIterator]=function(){return this},E);function R(D){E[D]=S[D]&&function(c){return new Promise(function(m,t){c=S[D](c),O(m,t,c.done,c.value)})}}function O(D,c,m,t){Promise.resolve(t).then(function(o){D({value:o,done:m})},c)}}function Se(S){return typeof S=="function"}function dd(S){var T=function(R){Error.call(R),R.stack=new Error().stack},E=S(T);return E.prototype=Object.create(Error.prototype),E.prototype.constructor=E,E}var mo=dd(function(S){return function(T){S(this),this.message=T?T.length+` errors occurred during unsubscription: +`+T.map(function(E,R){return R+1+") "+E.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=T}});function Oo(S,T){if(S){var E=S.indexOf(T);0<=E&&S.splice(E,1)}}var Jr=function(){function S(T){this.initialTeardown=T,this.closed=!1,this._parentage=null,this._finalizers=null}return S.prototype.unsubscribe=function(){var T,E,R,O,D;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var m=Ns(c),t=m.next();!t.done;t=m.next()){var o=t.value;o.remove(this)}}catch(i){T={error:i}}finally{try{t&&!t.done&&(E=m.return)&&E.call(m)}finally{if(T)throw T.error}}else c.remove(this);var v=this.initialTeardown;if(Se(v))try{v()}catch(i){D=i instanceof mo?i.errors:[i]}var a=this._finalizers;if(a){this._finalizers=null;try{for(var r=Ns(a),n=r.next();!n.done;n=r.next()){var e=n.value;try{of(e)}catch(i){D=D??[],i instanceof mo?D=cn(cn([],dn(D)),dn(i.errors)):D.push(i)}}}catch(i){R={error:i}}finally{try{n&&!n.done&&(O=r.return)&&O.call(r)}finally{if(R)throw R.error}}}if(D)throw new mo(D)}},S.prototype.add=function(T){var E;if(T&&T!==this)if(this.closed)of(T);else{if(T instanceof S){if(T.closed||T._hasParent(this))return;T._addParent(this)}(this._finalizers=(E=this._finalizers)!==null&&E!==void 0?E:[]).push(T)}},S.prototype._hasParent=function(T){var E=this._parentage;return E===T||Array.isArray(E)&&E.includes(T)},S.prototype._addParent=function(T){var E=this._parentage;this._parentage=Array.isArray(E)?(E.push(T),E):E?[E,T]:T},S.prototype._removeParent=function(T){var E=this._parentage;E===T?this._parentage=null:Array.isArray(E)&&Oo(E,T)},S.prototype.remove=function(T){var E=this._finalizers;E&&Oo(E,T),T instanceof S&&T._removeParent(this)},S.EMPTY=function(){var T=new S;return T.closed=!0,T}(),S}(),cd=Jr.EMPTY;function vd(S){return S instanceof Jr||S&&"closed"in S&&Se(S.remove)&&Se(S.add)&&Se(S.unsubscribe)}function of(S){Se(S)?S():S.unsubscribe()}var pd={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},fS={setTimeout:function(S,T){for(var E=[],R=2;R0},enumerable:!1,configurable:!0}),T.prototype._trySubscribe=function(E){return this._throwIfClosed(),S.prototype._trySubscribe.call(this,E)},T.prototype._subscribe=function(E){return this._throwIfClosed(),this._checkFinalizedStatuses(E),this._innerSubscribe(E)},T.prototype._innerSubscribe=function(E){var R=this,O=this,D=O.hasError,c=O.isStopped,m=O.observers;return D||c?cd:(this.currentObservers=null,m.push(E),new Jr(function(){R.currentObservers=null,Oo(m,E)}))},T.prototype._checkFinalizedStatuses=function(E){var R=this,O=R.hasError,D=R.thrownError,c=R.isStopped;O?E.error(D):c&&E.complete()},T.prototype.asObservable=function(){var E=new ai;return E.source=this,E},T.create=function(E,R){return new lf(E,R)},T}(ai),lf=function(S){mn(T,S);function T(E,R){var O=S.call(this)||this;return O.destination=E,O.source=R,O}return T.prototype.next=function(E){var R,O;(O=(R=this.destination)===null||R===void 0?void 0:R.next)===null||O===void 0||O.call(R,E)},T.prototype.error=function(E){var R,O;(O=(R=this.destination)===null||R===void 0?void 0:R.error)===null||O===void 0||O.call(R,E)},T.prototype.complete=function(){var E,R;(R=(E=this.destination)===null||E===void 0?void 0:E.complete)===null||R===void 0||R.call(E)},T.prototype._subscribe=function(E){var R,O;return(O=(R=this.source)===null||R===void 0?void 0:R.subscribe(E))!==null&&O!==void 0?O:cd},T}(ue),xd=new ai(function(S){return S.complete()});function CS(S){return S&&Se(S.schedule)}function Td(S){return S[S.length-1]}function Sd(S){return CS(Td(S))?S.pop():void 0}function Cd(S,T){return typeof Td(S)=="number"?S.pop():T}var Ed=function(S){return S&&typeof S.length=="number"&&typeof S!="function"};function Pd(S){return Se(S?.then)}function Ad(S){return Se(S[oh])}function Md(S){return Symbol.asyncIterator&&Se(S?.[Symbol.asyncIterator])}function wd(S){return new TypeError("You provided "+(S!==null&&typeof S=="object"?"an invalid object":"'"+S+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ES(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Rd=ES();function Fd(S){return Se(S?.[Rd])}function Ld(S){return lS(this,arguments,function(){var T,E,R,O;return fd(this,function(D){switch(D.label){case 0:T=S.getReader(),D.label=1;case 1:D.trys.push([1,,9,10]),D.label=2;case 2:return[4,Ds(T.read())];case 3:return E=D.sent(),R=E.value,O=E.done,O?[4,Ds(void 0)]:[3,5];case 4:return[2,D.sent()];case 5:return[4,Ds(R)];case 6:return[4,D.sent()];case 7:return D.sent(),[3,2];case 8:return[3,10];case 9:return T.releaseLock(),[7];case 10:return[2]}})})}function Od(S){return Se(S?.getReader)}function ps(S){if(S instanceof ai)return S;if(S!=null){if(Ad(S))return PS(S);if(Ed(S))return AS(S);if(Pd(S))return MS(S);if(Md(S))return Dd(S);if(Fd(S))return wS(S);if(Od(S))return RS(S)}throw wd(S)}function PS(S){return new ai(function(T){var E=S[oh]();if(Se(E.subscribe))return E.subscribe(T);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function AS(S){return new ai(function(T){for(var E=0;E{let O=this.tilePosInDirection(new ut(E,R),S);return this.tilemap.hasBlockingTile(O,T,aS(S),this.ignoreMissingTiles)})}isCharBlocking(S,T){return this.someCharTile((E,R)=>{let O=this.tilePosInDirection(new ut(E,R),S);return this.tilemap.hasBlockingChar(O,T,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(S){this.isMoving()||S!="none"&&this.changeFacingDirection(S)}changeFacingDirection(S){this.facingDirection!==S&&(this.facingDirection=S,this.directionChanged$.next(S))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(cs(this.facingDirection))}addCollisionGroup(S){this.collisionGroups.add(S)}setCollisionGroups(S){this.collisionGroups=new Set(S)}setIgnoreCollisionGroups(S){this.ignoreCollisionGroups=new Set(S)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(S){return this.collisionGroups.has(S)}removeCollisionGroup(S){this.collisionGroups.delete(S)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(S){for(let T of S)this.labels.add(T)}getLabels(){return[...this.labels.values()]}hasLabel(S){return this.labels.has(S)}clearLabels(){this.labels.clear()}removeLabels(S){for(let T of S)this.labels.delete(T)}getNumberOfDirections(){return this.numberOfDirections}movementStarted(){return this.movementStarted$}movementStopped(){return this.movementStopped$}directionChanged(){return this.directionChanged$}tilePositionSet(){return this.tilePositionSet$}positionChangeStarted(){return this.positionChangeStarted$}positionChangeFinished(){return this.positionChangeFinished$}autoMovementSet(){return this.autoMovementSet$}depthChanged(){return this.depthChanged$}getMovementProgress(){return this.movementProgress}setMovementProgress(S){let T=Math.max(0,Math.min(hs,S));this.movementProgress=T}hasWalkedHalfATile(){return this.movementProgress>hs/2}willCrossTileBorderThisUpdate(S){return this.movementProgress+this.maxProgressForDelta(S)>=hs}updateCharacterPosition(S){let T=this.willCrossTileBorderThisUpdate(S),E=1-(T?hs-this.movementProgress:this.maxProgressForDelta(S))/this.maxProgressForDelta(S);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(S),hs),T&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),E>0&&this.updateCharacterPosition(S*E)):this.stopMoving())}maxProgressForDelta(S){let T=S/1e3;return Math.floor(T*this.speed*hs)}get tilePos(){return Ut.clone(this._tilePos)}set tilePos(S){Ut.copyOver(S,this._tilePos)}startMoving(S){S!=="none"&&(S!=this.movementDirection&&this.movementStarted$.next(S),this.movementDirection=S,this.facingDirection=S,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(S,T){return S.add(cs(this.tilemap.toMapDirection(T)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let S=this.tilePos,T=this.getNextTilePos(),E=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(E),this.fire(this.positionChangeFinished$,S,T)}fire(S,{position:T,layer:E},{position:R,layer:O}){S.next({exitTile:T,enterTile:R,exitLayer:E,enterLayer:O})}someCharTile(S){let T=this.getNextTilePos().position;for(let E=T.x;Ethis.isLayerAlwaysOnTop(O));this.tilemap.layers.filter(O=>!this.isLayerAlwaysOnTop(O)).forEach(O=>{this.hasLayerProp(O,ls.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(O,E),T.push(O.tilemapLayer)):this.setDepth(O,++E)}),this.charLayerDepths.set(void 0,E),R.forEach((O,D)=>{O.tilemapLayer.setDepth(D+1+E)}),T.forEach(O=>O.destroy())}setDepth(T,E){T.tilemapLayer.setDepth(E),this.isCharLayer(T)&&this.charLayerDepths.set(this.getLayerProp(T,ls.CHAR_LAYER_PROP_NAME),E)}createHeightShiftLayers(T,E){let R=this.getLayerProp(T,ls.HEIGHT_SHIFT_PROP_NAME);isNaN(R)&&(R=0);let O=1;for(let D=0;DO.name==E);return R?.value}hasLayerProp(T,E){return this.getLayerProp(T,E)!=null}copyLayer(T,E){let R=`${T.name}#${E}`,O=this.tilemap.createBlankLayer(R,T.tilemapLayer.tileset);if(O){if(O.name=R,this.isIsometric())for(let D=E;D>=0;D--){let c=E-D;O.putTileAt(T.data[D][c],c,D)}else for(let D=0;Dm===this.charData.id)).subscribe(({direction:m})=>{var t;(t=this.animation)==null||t.setStandingFrame(m)}),this.sprite&&(this.sprite.setOrigin(0,0),this.resetAnimation(this.sprite),this.updateOverlaySprite(),this.updateGridChar())}destroy(){this.destroy$.next(),this.destroy$.complete(),this.newSpriteSet$.complete()}setSprite(S){S?(this.sprite&&(S.x=this.sprite.x,S.y=this.sprite.y),this.sprite=S,this.newSpriteSet$.next(),this.layerOverlaySprite=this.layerOverlaySprite?this.scene.add.sprite(0,0,this.sprite.texture):void 0,this.updateOverlaySprite(),this.resetAnimation(this.sprite),this.updateDepth()):(this.layerOverlaySprite=void 0,this.sprite=void 0)}getSprite(){return this.sprite}getLayerOverlaySprite(){return this.layerOverlaySprite}setContainer(S){var T;this.container=S,this.cachedContainerHeight=(T=S?.getBounds().height)!=null?T:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(S){this.customOffset.x=S}getOffsetY(){return this.customOffset.y}setOffsetY(S){this.customOffset.y=S}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(S){var T;this.geHeadless.isMoving(this.charData.id)||S!="none"&&(this.geHeadless.turnTowards(this.charData.id,S),(T=this.animation)==null||T.setStandingFrame(S))}getAnimation(){return this.animation}setAnimation(S){this.animation=S}update(S){this.updateGridChar()}getEngineOffset(){var S,T,E,R;if(!this.sprite)return ut.ZERO;let O=this.tilemap.getTileWidth()/2-Math.floor(((T=(S=this.sprite)==null?void 0:S.displayWidth)!=null?T:0)/2),D=-((R=(E=this.sprite)==null?void 0:E.displayHeight)!=null?R:0)+this.tilemap.getTileHeight();return new ut(O,D)}updatePixelPos(){let S=new ut(this.geHeadless.getPosition(this.charData.id)),T=this.geHeadless.getMovementProgress(this.charData.id)/1e3,E=this.tilemap.tilePosToPixelPos(S).add(this.getEngineOffset()).add(this.customOffset).add(cs(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(T))),R=this.getGameObj();R&&(R.x=Math.floor(E.x),R.y=Math.floor(E.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var S;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let T=this.geHeadless.getMovementProgress(this.charData.id)>hs/2;(S=this.getAnimation())==null||S.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),T,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(S){let T=new uf(this.walkingAnimationMapping,S.texture.source[0].width/S.width/uf.FRAMES_CHAR_ROW);this.setAnimation(T),T.frameChange().pipe(si(this.newSpriteSet$)).subscribe(E=>{S?.setFrame(E)}),T.setIsEnabled(this.walkingAnimationMapping!==void 0),T.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let S=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-S),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let S=new ut(this.geHeadless.getPosition(this.charData.id)),T=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:S,layer:T}):this.sprite&&this.setSpriteDepth(this.sprite,{position:S,layer:T});let E=this.getLayerOverlaySprite();if(E){let R=new ut(Ji(he({},S),{y:S.y-1}));this.setSpriteDepth(E,{position:R,layer:T})}}setSpriteDepth(S,T){S.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(T))+this.getPaddedPixelDepthSprite(S))}setContainerDepth(S,T){S.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(T))+this.getPaddedPixelDepthContainer(S))}getPaddedPixelDepthContainer(S){return bo.shiftPad(S.y+this.cachedContainerHeight,Go.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(S){return bo.shiftPad(S.y+S.displayHeight,Go.Z_INDEX_PADDING)}getTransitionLayer(S){if(S.layer)return this.geHeadless.getTransition(S.position,S.layer)||S.layer}},HS=(S=>(S.DONT_BLOCK="DONT_BLOCK",S.BLOCK_TWO_TILES="BLOCK_TWO_TILES",S.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",S.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",S))(HS||{}),Ud=(S=>(S.STOP="STOP",S.CLOSEST_REACHABLE="CLOSEST_REACHABLE",S.RETRY="RETRY",S.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",S))(Ud||{}),KS=class{distance(S,T){return vi.manhattanDistance(S,T)}direction(S,T){if(vi.equal(S,T))return"none";let E=S.clone().subtract(T);return Math.abs(E.x)>Math.abs(E.y)?E.x>0?"left":"right":E.y>0?"up":"down"}neighbors(S){return[new ut(S.x,S.y+1),new ut(S.x+1,S.y),new ut(S.x-1,S.y),new ut(S.x,S.y-1)]}getDirections(){return["up","right","down","left"]}},jS=class{distance(S,T){return vi.chebyshevDistance(S,T)}neighbors(S){let T=[new ut(S.x,S.y+1),new ut(S.x+1,S.y),new ut(S.x-1,S.y),new ut(S.x,S.y-1)],E=[new ut(S.x+1,S.y+1),new ut(S.x+1,S.y-1),new ut(S.x-1,S.y+1),new ut(S.x-1,S.y-1)];return[...T,...E]}direction(S,T){return T.x>S.x?T.y>S.y?"down-right":T.yS.y?"down-left":T.yS.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},vn=class{static create(S){switch(S){case 4:return new KS;case 8:return new jS}}},ff=class{constructor(S,T,E){this.backoffMs=S,this.maxRetries=T,this.onFinished=E,this.retries=0,this.elapsed=0}retry(S,T){this.shouldRetry()?(this.elapsed+=S,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,T())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(S.WAIT="WAIT",S.RETRY="RETRY",S.STOP="STOP",S))(Xd||{}),Qr=class{constructor(S,{shortestPathAlgorithm:T="BFS",pathWidth:E=1,pathHeight:R=1,numberOfDirections:O=4,isPositionAllowed:D=(i,h)=>!0,collisionGroups:c=[],ignoredChars:m=[],ignoreTiles:t=!1,ignoreMapBounds:o=!1,ignoreBlockedTarget:v=!1,maxPathLength:a=1/0,ignoreLayers:r=!1,considerCosts:n=!1,calculateClosestToTarget:e=!0}={}){this.gridTilemap=S,this.options={shortestPathAlgorithm:T,pathWidth:E,pathHeight:R,numberOfDirections:O,isPositionAllowed:D,collisionGroups:c,ignoredChars:m,ignoreTiles:t,ignoreMapBounds:o,ignoreBlockedTarget:v,maxPathLength:a,ignoreLayers:r,considerCosts:n,calculateClosestToTarget:e},this.ignoredCharsSet=new Set(m)}findShortestPath(S,T){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(S.layer),T.layer=S.layer);let E=this.findShortestPathImpl(S,T);return this.gridTilemap.unfixCacheLayers(),E}getNeighbors(S,T){var E;return vn.create((E=this.options.numberOfDirections)!=null?E:4).neighbors(S.position).map(R=>{let O=S.layer;return this.options.ignoreLayers||(O=this.gridTilemap.getTransition(R,S.layer)),{position:R,layer:O||S.layer}}).filter(R=>!this.isBlocking(S,R)||this.options.ignoreBlockedTarget&&Ut.equal(R,T))}getTransition(S,T){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(S,T)}getCosts(S,T){if(!this.options.considerCosts)return 1;let E=ni(T.position,S);return this.gridTilemap.getTileCosts(T,E)}isBlocking(S,T){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(T.position))||!this.options.isPositionAllowed(T.position,T.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(S,T,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(S,T,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(S,T){return(this.options.numberOfDirections===4?vi.manhattanDistance:vi.chebyshevDistance)(S,T)}getTilePosInDir(S,T){return this.options.ignoreLayers?{position:S.position.add(cs(this.gridTilemap.toMapDirection(T))),layer:S.layer}:this.gridTilemap.getTilePosInDirection(S,T)}getReverseNeighbors(S,T){var E;let R=vn.create((E=this.options.numberOfDirections)!=null?E:4).neighbors(S.position),O;if(!this.options.ignoreLayers){let D=this.gridTilemap.getReverseTransitions(S.position,S.layer);O=D?[...D]:void 0}return R.map(D=>O?O.map(c=>({position:D,layer:c||S.layer})):[{position:D,layer:S.layer}]).flat().filter(D=>!this.isBlocking(D,S)||this.options.ignoreBlockedTarget&&Ut.equal(S,T))}hasBlockingCharFrom(S,T,E,R,O,D,c){if(E===1&&R===1)return c.hasBlockingChar(T.position,T.layer,O,D);let m=o=>c.hasBlockingChar(o,T.layer,O,D),t=ni(S.position,T.position);return this.isBlockingMultiTile(S,t,E,R,m)}hasBlockingTileFrom(S,T,E,R,O,D){if(E===1&&R===1)return D.hasBlockingTile(T.position,T.layer,ni(T.position,S.position),O);let c=ni(S.position,T.position),m=t=>D.hasBlockingTile(t,T.layer,c,O);return this.isBlockingMultiTile(S,c,E,R,m)}isBlockingMultiTile(S,T,E,R,O){let D={src:new ut(S.position.x+E,S.position.y),dest:new ut(S.position.x+E,S.position.y+R-1)},c={src:new ut(S.position.x-1,S.position.y),dest:new ut(S.position.x-1,S.position.y+R-1)},m={src:new ut(S.position.x,S.position.y-1),dest:new ut(S.position.x+E-1,S.position.y-1)},t={src:new ut(S.position.x,S.position.y+R),dest:new ut(S.position.x+E-1,S.position.y+R)};switch(T){case"right":return this.checkLine(D,O);case"left":return this.checkLine(c,O);case"up":return this.checkLine(m,O);case"down":return this.checkLine(t,O);case"up-left":return this.checkLine({src:m.src,dest:new ut(m.dest.x-1,m.dest.y)},O)||this.checkLine({src:new ut(c.src.x,c.src.y-1),dest:new ut(c.dest.x,c.dest.y-1)},O);case"up-right":return this.checkLine({src:new ut(m.src.x+1,m.src.y),dest:m.dest},O)||this.checkLine({src:new ut(D.src.x,D.src.y-1),dest:new ut(D.dest.x,D.dest.y-1)},O);case"down-left":return this.checkLine({src:new ut(c.src.x,c.src.y+1),dest:new ut(c.dest.x,c.dest.y+1)},O)||this.checkLine({src:t.src,dest:new ut(t.dest.x-1,t.dest.y)},O);case"down-right":return this.checkLine({src:new ut(t.src.x+1,t.src.y),dest:t.dest},O)||this.checkLine({src:new ut(D.src.x,D.src.y+1),dest:new ut(D.dest.x,D.dest.y+1)},O)}return!1}checkLine(S,T){for(let E=S.src.x;E<=S.dest.x;E++)for(let R=S.src.y;R<=S.dest.y;R++)if(T(new ut(E,R)))return!0;return!1}},$S=td(eh(),1),ZS=class extends Qr{findShortestPathImpl(S,T){let E=this.shortestPathBfs(S,T);return{path:this.returnPath(E.previous,S,T),closestToTarget:E.closestToTarget,steps:E.steps,maxPathLengthReached:E.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(S,T){let E=new Map,R=new Map,O=new Map,D=new $S.MinFibonacciHeap((o,v)=>en(O,o)-en(O,v)),c=S,m=this.distance(S.position,T.position),t=0;for(D.push(S),R.set(Ut.toString(S),0),O.set(Ut.toString(S),this.distance(S.position,T.position));D.size>0;){let o=D.pop();if(!o)break;t++;let v=this.distance(o.position,T.position);if(vthis.options.maxPathLength)return{previous:new Map,closestToTarget:c,steps:t,maxPathLengthReached:!0};for(let a of this.getNeighbors(o,T)){let r=en(R,o)+this.getCosts(o.position,a),n=Ut.toString(a);(!R.has(n)||r0;){let t=O.dequeue();if(m++,!t)break;let{node:o,dist:v}=t;if(v>this.options.maxPathLength)return{previous:new Map,closestToTarget:D,steps:m,maxPathLengthReached:!0};let a=this.distance(o.position,T.position);if(athis.lastDist)}step(S,T,E){var R;this.lastDist=E;for(let O of S){let D=Ut.toString(O);if(!this.visited.has(D)){this.previous.set(D,T),this.queue.enqueue({node:O,dist:E+1}),this.visited.set(D,E+1);let c=(R=this.otherBfs)==null?void 0:R.visited.get(D);c!==void 0&&c0,O.queue.size()>0);){let t=R.queue.dequeue();if(!t)break;let{node:o,dist:v}=t;if(v+1+(((E=O.queue.peek())==null?void 0:E.dist)||0)>this.options.maxPathLength)return{previous:R.previous,previous2:O.previous,closestToTarget:this.maybeClosestToTarget(c),steps:D,maxPathLengthReached:!0};let a=this.distance(o.position,T.position);if(asn(this.f,O)-sn(this.f,D)),this.openSet.push(S);let R=Ut.toString(S);for(this.g.set(R,0),this.f.set(R,this.distance(S.position,T.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let O=this.openSet.pop();if(!O)break;if(this.steps++,Ut.equal(O,T))return{previous:E,closestToTarget:T,steps:this.steps,maxPathLengthReached:!1};if(sn(this.g,O)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(O,T);for(let D of this.getNeighborsInternal(O,E.get(Ut.toString(O)),T)){let c=Ut.toString(D.p),m=sn(this.g,O)+D.dist;(!this.g.has(c)||m({p:D,dist:1}));let R=this.prune(T,S).filter(D=>!this.isBlockingIgnoreTarget(S,D,E)).map(D=>{let c=this.getTransition(D.position,S.layer);return{position:D.position,layer:c||S.layer}}),O=[];for(let D of R)if(this.isHorizontal(S.position,D.position))O.push({p:D,dist:1});else{let c=this.jump(S,D,E,1,ni(S.position,D.position));c&&O.push(c)}return O}isBlockingIgnoreTarget(S,T,E){return this.isBlocking(S,T)&&!(this.options.ignoreBlockedTarget&&Ut.equal(T,E))}jump(S,T,E,R,O){if(!this.isBlockingIgnoreTarget(S,T,E))return Ut.equal(T,E)?{p:T,dist:R}:R>=this.maxJumpSize?{p:T,dist:R}:this.getTransition(T.position,S.layer)!==void 0?{p:T,dist:R}:this.hasForced(S,T)?{p:T,dist:R}:(this.updateClosestToTarget(T,E),this.jump(T,this.getTilePosInDir(T,O),E,R+1,O))}isHorizontal(S,T){return S.y===T.y}getForced(S,T,E,R,O,D){let c=[],m=S;return(this.blockOrTrans(m,E)||this.blockOrTrans(E,R))&&this.addIfNotBlocked(c,T,R),(this.blockOrTrans(m,O)||this.blockOrTrans(O,D))&&this.addIfNotBlocked(c,T,D),c}hasForced(S,T){let{topLeft:E,downLeft:R,top:O,bottom:D}=this.normalizedPositions(S,T);return!!((this.blockOrTrans(S,R)||this.blockOrTrans(R,D))&&!this.blockOrTrans(T,D)||(this.blockOrTrans(S,E)||this.blockOrTrans(E,O))&&!this.blockOrTrans(T,O))}prune(S,T){let{right:E,top:R,bottom:O,downLeft:D,topLeft:c}=this.normalizedPositions(S,T);return this.isHorizontal(S.position,T.position)?[E,R,O]:[E,...this.getForced(S,T,D,O,c,R)]}normalizedPositions(S,T){return S.position.xT.position.x?{topLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y),layer:T.layer}}:S.position.y1?this.fillPath(O,D,R):R.push(D),O=D}return R.reverse()}fillPath(S,T,E){let R=S;do{let O=ni(R.position,T.position);R=this.getTilePosInDir(R,O),E.push(R)}while(!vi.equal(R.position,T.position))}};function sn(S,T){var E;return(E=S.get(Ut.toString(T)))!=null?E:Number.MAX_VALUE}var QS=class{constructor(S,T,E,R={}){this.character=S,this.gridTilemap=T,this.charToFollow=E;let O={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:R.considerCosts||!1,facingDirection:"none"};this.options=he(he({},O),R),this.options.considerCosts&&this.options.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.options.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.options.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.character=S,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(si(this.character.autoMovementSet().pipe(Qi(D=>D!==this),zs(1)))).subscribe(({enterTile:D,enterLayer:c})=>{this.updateTarget(D,c)})}update(S){var T;(T=this.targetMovement)==null||T.update(S)}getInfo(){return{type:"Follow",config:{charToFollow:this.charToFollow.getId(),distance:this.options.distance,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,facingDirection:this.options.facingDirection,shortestPathAlgorithm:this.options.shortestPathAlgorithm}}}getFacingPos(){let S=Er[this.options.facingDirection]+Er[this.charToFollow.getFacingDirection()],T=ud("up",S),E={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return T==="right"?E.x+=this.charToFollow.getTileWidth()-1:T==="down"?E.y+=this.charToFollow.getTileWidth()-1:T==="down-left"?E.y+=this.charToFollow.getTileWidth()-1:T==="down-right"?(E.y+=this.charToFollow.getTileWidth()-1,E.x+=this.charToFollow.getTileWidth()-1):T==="up-right"&&(E.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new ut(E),layer:this.charToFollow.getTilePos().layer},T).position}updateTarget(S,T){let E=this.options.facingDirection!=="none"&&this.options.distance===0;E&&(S=this.getFacingPos()),this.targetMovement=new $d(this.character,this.gridTilemap,{position:new ut(S),layer:T},{distance:E?0:this.options.distance+1,config:{algorithm:this.options.shortestPathAlgorithm,noPathFoundStrategy:this.options.noPathFoundStrategy,maxPathLength:this.options.maxPathLength,ignoreLayers:this.options.ignoreLayers,considerCosts:this.options.considerCosts,ignoredChars:[this.charToFollow.getId()]}})}},gf=class{static getRandomInt(S){return Math.floor(Math.random()*Math.floor(S))}},kS=class{constructor(S,T=0,E=-1){this.character=S,this.delay=T,this.radius=E,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=S.getNextTilePos().position.y,this.initialCol=S.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(si(this.character.autoMovementSet().pipe(Qi(R=>R!==this),zs(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=vn.create(S.getNumberOfDirections())}update(S){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=S,this.delayLeft<=0){this.delayLeft=this.delay;let T=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(T),this.currentMovementDirection=T,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(S)).filter(S=>this.isWithinRadius(S))}isWithinRadius(S){return this.radius==-1?!0:this.getDist(S)<=this.radius}getDist(S){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(cs(S)),new ut(this.initialCol,this.initialRow))}getFreeRandomDirection(){let S=this.getFreeDirections();return S.length==0?"none":S[gf.getRandomInt(S.length)]}randomizeStepSize(){this.stepSize=gf.getRandomInt(this.radius)+1}};function qS(S,T){return S.filter(E=>{var R,O,D,c,m,t;return(R=T.labels)!=null&&R.withAllLabels?(O=T.labels)==null?void 0:O.withAllLabels.every(o=>E.hasLabel(o)):(D=T.labels)!=null&&D.withOneOfLabels?(c=T.labels)==null?void 0:c.withOneOfLabels.some(o=>E.hasLabel(o)):(m=T.labels)!=null&&m.withNoneLabels?!((t=T.labels)!=null&&t.withNoneLabels.some(o=>E.hasLabel(o))):!0})}var Yd="2.44.6",_S=class{constructor(S,T){this.collistionStrategy=S,this.collisionGroupRelation=T,this.tilePosToCharacters=new t2,this.charRemoved$=new ue}isCharBlockingAt(S,T,E,R=new Set,O=new Set){if(E.length===0)return!1;let D=this.tilePosToCharacters.get(S,T);return!!(D&&D.size>0&&[...D].filter(c=>!R.has(c.getId())).filter(c=>!this.doIntersect(c.getCollisionGroups(),O)).some(c=>E.some(m=>c.getCollisionGroups().some(t=>this.collidesWith(m,t)))))}doIntersect(S,T){for(let E of S)if(T.has(E))return!0;return!1}collidesWith(S,T){return this.collisionGroupRelation?(this.collisionGroupRelation.get(S)||new Set).has(T):S===T}getCharactersAt(S,T){return this.tilePosToCharacters.get(S,T)||new Set}addCharacter(S){this.addTilePositions(S.getTilePos(),S),this.addTilePositions(S.getNextTilePos(),S),this.addPositionChangeSub(S),this.addPositionChangeFinishedSub(S),this.addTilePosSetSub(S)}removeCharacter(S){let T=S.getId();this.charRemoved$.next(T),this.deleteTilePositions(S.getTilePos(),S),this.deleteTilePositions(S.getNextTilePos(),S)}add(S,T,E){let R=this.tilePosToCharacters.get(S,T);R||this.tilePosToCharacters.set(S,T,new Set([E])),R?.add(E)}addTilePosSetSub(S){S.tilePositionSet().pipe(si(this.charRemoved(S.getId()))).subscribe(T=>{this.deleteTilePositions(S.getNextTilePos(),S),this.addTilePositions(T,S)})}charRemoved(S){var T;return(T=this.charRemoved$)==null?void 0:T.pipe(zs(1),Qi(E=>E==S))}addPositionChangeSub(S){S.positionChangeStarted().pipe(si(this.charRemoved(S.getId())),this.posChangeToLayerPos()).subscribe(T=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(T.exit,S),this.addTilePositions(T.enter,S)})}addPositionChangeFinishedSub(S){S.positionChangeFinished().pipe(si(this.charRemoved(S.getId())),this.posChangeToLayerPos()).subscribe(T=>{this.deleteTilePositions(T.exit,S),this.addTilePositions(T.enter,S)})}addTilePositions(S,T){this.forEachCharTile(S,T,(E,R)=>{this.add(new ut(E,R),S.layer,T)})}deleteTilePositions(S,T){this.forEachCharTile(S,T,(E,R)=>{var O;(O=this.tilePosToCharacters.get(new ut(E,R),S.layer))==null||O.delete(T)})}forEachCharTile(S,T,E){let R=S.position;for(let O=R.x;O({enter:{position:new ut(S.enterTile),layer:S.enterLayer},exit:{position:new ut(S.exitTile),layer:S.exitLayer}})))}posToString(S,T){return`${S.x}#${S.y}#${T}`}},t2=class{constructor(){this.memo=new Map}set(S,T,E){let R=this.memo.get(S.x);R||(R=new Map,this.memo.set(S.x,R));let O=R.get(S.y);O||(O=new Map,R.set(S.y,O)),O.set(T,E)}get(S,T){let E=this.memo.get(S.x);if(!E)return;let R=E.get(S.y);if(R)return R.get(T)}},hh=class{constructor(S,T,E,R){this.x=S,this.y=T,this.width=E,this.height=R}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(S){return S.x>=this.x&&S.x=this.y&&S.yE.isCharLayer());for(let E of[...T,void 0]){let R=this.tileCollisionCache.get(E?.getName());if(R===void 0){R=new Array(this.tilemap.getWidth());for(let O=0;O>T&1)==1}var yf="ge_cost",Hd=class Kd{constructor(T,E,R,O=void 0,D=!1){this.tilemap=T,this.collisionTilePropertyName=E,this.useTileCollisionCache=D,this.characters=new Map,this.transitions=new Map,this.reverseTransitions=new Map,this.collidesPropNames=new Map,this.tileCostPropNames=new Map,this.collisionRelevantLayersFrameCache=new Map,this.charBlockCache=new _S(R,O);for(let c of rh())this.collidesPropNames.set(c,Kd.ONE_WAY_COLLIDE_PROP_PREFIX+c),this.tileCostPropNames.set(c,`${yf}_${c}`);this.useTileCollisionCache&&(this.tileCollisionCache=new i2(T,this),this.tileCollisionCache.rebuild())}fixCacheLayer(T){var E;(E=this.tileCollisionCache)==null||E.fixLayer(T)}unfixCacheLayers(){var T;(T=this.tileCollisionCache)==null||T.unfixLayers()}addCharacter(T){this.characters.set(T.getId(),T);let E=T.getNextTilePos().layer;E===void 0?T.setTilePosition(Ji(he({},T.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(E)||console.warn(`Char layer '${E}' of character '${T.getId()}' is unknown.`),this.charBlockCache.addCharacter(T)}removeCharacter(T){let E=this.characters.get(T);E&&(this.charBlockCache.removeCharacter(E),this.characters.delete(T))}getCharacters(){return[...this.characters.values()]}getCharactersAt(T,E){return this.charBlockCache.getCharactersAt(T,E)}rebuildTileCollisionCache(T){var E;(E=this.tileCollisionCache)==null||E.rebuild(T)}hasBlockingTileUncached(T,E,R,O){if(!O&&this.hasNoTileUncached(T,E))return!0;let D=this.getCollisionRelevantLayers(E);for(let c of D)if(this.isLayerBlockingAt(c.getName(),T,R))return!0;return!1}hasBlockingTile(T,E,R,O){var D;let c=(D=this.tileCollisionCache)==null?void 0:D.isBlockingFrom(T.x,T.y,E,R,O);return c!==void 0?c:this.hasBlockingTileUncached(T,E,R,O)}getTransition(T,E){let R=this.transitions.get(T.toString());if(R)return R.get(E)}getReverseTransitions(T,E){let R=this.reverseTransitions.get(T.toString());if(R)return R.get(E)}setTransition(T,E,R){var O,D,c,m,t;this.transitions.has(T.toString())||this.transitions.set(T.toString(),new Map),this.reverseTransitions.has(T.toString())||this.reverseTransitions.set(T.toString(),new Map),(O=this.transitions.get(T.toString()))==null||O.set(E,R),(D=this.reverseTransitions.get(T.toString()))!=null&&D.has(R)||(c=this.reverseTransitions.get(T.toString()))==null||c.set(R,new Set),(t=(m=this.reverseTransitions.get(T.toString()))==null?void 0:m.get(R))==null||t.add(E)}getTransitions(){return new Map([...this.transitions].map(([T,E])=>[T,new Map(E)]))}getTileCosts(T,E){let R=this.getCollisionRelevantLayers(T.layer),O=1;for(let D of R)O=Math.max(O,this.getTileCostsForLayer(Ji(he({},T),{layer:D.getName()}),E));return O}getTileCostsForLayer(T,E){let R=this.tilemap.getTileAt(T.position.x,T.position.y,T.layer);return E&&R?.getProperty(this.tileCostPropNames.get(E)||"")||R?.getProperty(yf)||1}hasNoTileUncached(T,E){return!this.getCollisionRelevantLayers(E).some(R=>this.tilemap.hasTileAt(T.x,T.y,R.getName()))}hasNoTile(T,E){var R;let O=(R=this.tileCollisionCache)==null?void 0:R.hasTileAt(T.x,T.y,E);return O!==void 0?O:this.hasNoTileUncached(T,E)}hasBlockingChar(T,E,R,O=new Set,D=new Set){return this.charBlockCache.isCharBlockingAt(T,E,R,O,D)}isInRange(T){return new hh(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(T)}toMapDirection(T){return this.isIsometric()?rS(T):T}fromMapDirection(T){return this.isIsometric()?ud(T):T}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(T,E){let R=T.position.add(cs(this.toMapDirection(E))),O=this.getTransition(R,T.layer)||T.layer;return{position:R,layer:O}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(T,E,R){let O=this.tilemap.getTileAt(E.x,E.y,T);return O?!!(O.getProperty(this.collisionTilePropertyName)||R&&O.getProperty(this.collidesPropNames.get(R)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((T,E)=>({layer:T,index:E})).filter(({layer:T})=>T.isCharLayer()).map(({index:T})=>T)}findPrevAndCharLayer(T){let E=this.getCharLayerIndexes(),R=this.tilemap.getLayers(),O=E.findIndex(D=>R[D].getProperty(gr)==T);return O==0?{prevIndex:-1,charLayerIndex:E[O]}:{prevIndex:E[O-1],charLayerIndex:E[O]}}getCollisionRelevantLayers(T){if(!T)return this.tilemap.getLayers();let E=this.collisionRelevantLayersFrameCache.get(T);if(E)return E;let{prevIndex:R,charLayerIndex:O}=this.findPrevAndCharLayer(T),D=this.tilemap.getLayers().slice(R+1,O+1);return this.collisionRelevantLayersFrameCache.set(T,D),D}getLowestCharLayer(){for(let T of this.tilemap.getLayers())if(T.isCharLayer())return T.getProperty(gr)}getCharLayerNames(){return this.tilemap.getLayers().filter(T=>T.isCharLayer()).map(T=>T.getProperty(gr)).filter(n2)}};Hd.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var s2=Hd;function n2(S){return S!=null}var r2=(S=>(S.REMOVED="REMOVED",S.ADDED="ADDED",S))(r2||{}),a2=(S=>(S.WAIT="WAIT",S.SKIP="SKIP",S.STOP="STOP",S))(a2||{}),o2=class{constructor(S,T){this.character=S,this.tilemap=T,this.queue=new Pr,this.finished$=new ue,this.pathBlockedWaitElapsed=0,this.distanceUtils=vn.create(S.getNumberOfDirections()),this.character.autoMovementSet().pipe(Qi(E=>E!==this),zs(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(S){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(S))&&this.queue.size()>0&&this.moveCharOnPath(S)}getInfo(){return{type:"Queue"}}enqueue(S,T={}){var E,R,O;let D={pathBlockedStrategy:(E=T.pathBlockedStrategy)!=null?E:"STOP",pathBlockedWaitTimeoutMs:T?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(R=T.ignoreInvalidPositions)!=null?R:!1,skipInvalidPositions:(O=T.skipInvalidPositions)!=null?O:!1};for(let c of S){let m={command:c,config:D};if(Ls(c)){this.queue.enqueue(m);continue}let t=this.queue.peekEnd(),o=t?.command;if(o||(o=this.character.getNextTilePos()),Ls(o)){this.queue.enqueue(m);continue}let v=this.distanceUtils.distance(o.position,c.position)===1;(!T.ignoreInvalidPositions||v)&&this.queue.enqueue(m)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(S){let T=this.queue.peek();if(!T)return;let E=T.command,R=T.config;if(Ls(E)&&(E=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),E)),R.skipInvalidPositions){if(E=this.getNextValidPosition(),!E){this.finishInvalidNextPos(E);return}}else if(!this.isNeighborPos(E)){this.finishInvalidNextPos(E);return}if(this.character.isBlockingDirection(ni(this.character.getNextTilePos().position,E.position))){if(R.pathBlockedStrategy==="STOP")this.finishPathBlocked(E);else if(R.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(S);return}else R.pathBlockedStrategy==="WAIT"&&R.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=S,this.pathBlockedWaitElapsed>=R.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(E,R.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,E.position)),this.isLastMovement()&&this.finish("SUCCESS","",E)}getNextValidPosition(){for(var S;this.queue.size()>0;){let T=(S=this.queue.peek())==null?void 0:S.command;if(Ls(T)&&(T=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),T)),T&&this.isNeighborPos(T))return T;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(S){let T=this.distanceUtils.distance(this.character.getNextTilePos().position,S.position)===1,E=this.tilemap.getTransition(S.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==S.layer)return T&&E===S.layer;let R=E!==void 0&&E!==S.layer;return T&&!R}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(S){S?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(S)} is not reachable from ${this.posToStr(this.character.getNextTilePos())}.`):this.finish("INVALID_NEXT_POS",`No enqueued position is reachable from ${this.posToStr(this.character.getNextTilePos())}.`)}finishPathBlocked(S){this.finish("PATH_BLOCKED",`Position ${this.posToStr(S)} is blocked.`)}finishBlockedWaitTimeout(S,T){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(S)} is blocked and the wait timeout of ${T} ms has been exceeded.`)}finish(S,T="",E=this.character.getNextTilePos()){this.queue=new Pr,this.finished$.next({position:E.position,result:S,description:T,layer:E.layer})}getDir(S,T){return this.tilemap.fromMapDirection(ni(S,T))}posToStr(S){return`(${S.position.x}, ${S.position.y}, ${S.layer})`}},h2=class{constructor(S=!0){this.isCreatedInternal=!1,S&&console.log(`Using GridEngine v${Yd}`)}getCharLayer(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getTilePos().layer}getTransition(S,T){var E;return this.initGuard(),(E=this.gridTilemap)==null?void 0:E.getTransition(new ut(S),T)}setTransition(S,T,E){var R;return this.initGuard(),(R=this.gridTilemap)==null?void 0:R.setTransition(new ut(S),T,E)}create(S,T){this.isCreatedInternal=!0,this.gridCharacters=new Map;let E=this.setConfigDefaults(T);this.config=E,this.movementStopped$=new ue,this.movementStarted$=new ue,this.directionChanged$=new ue,this.positionChangeStarted$=new ue,this.positionChangeFinished$=new ue,this.queueMovementFinished$=new ue,this.charRemoved$=new ue,this.charAdded$=new ue,this.gridTilemap=new s2(S,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(S){return S?new Map(Object.entries(S).map(([T,E])=>[T,new Set(E)])):void 0}getPosition(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getTilePos().position}move(S,T){this.moveChar(S,T)}moveRandomly(S,T=0,E=-1){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(S);if(!O)throw this.createCharUnknownErr(S);let D=new kS(O,T,E);O.setMovement(D)}getMovement(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);let R=E.getMovement();return R?R.getInfo():{type:"None"}}moveTo(S,T,E){var R;let O=this.assembleMoveToConfig(E);this.initGuard();let D=(R=this.gridCharacters)==null?void 0:R.get(S);if(!D)throw this.createCharUnknownErr(S);if(!this.gridTilemap)throw this.createUninitializedErr();let c=new $d(D,this.gridTilemap,{position:new ut(T),layer:E?.targetLayer||D.getNextTilePos().layer},{distance:0,config:O});return D.setMovement(c),c.finishedObs().pipe(ln(m=>({charId:S,position:m.position,result:m.result,description:m.description,layer:m.layer})))}stopMovement(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);E.setMovement(void 0)}setSpeed(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);R.setSpeed(T)}getSpeed(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getSpeed()}collidesWithTiles(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.collidesWithTiles()}update(S,T){var E;if(this.isCreatedInternal&&this.gridCharacters)for(let[R,O]of this.gridCharacters)O.update(T);(E=this.gridTilemap)==null||E.invalidateFrameCache()}addCharacter(S){var T,E,R,O,D;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let c={speed:S.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:S.charLayer,facingDirection:S.facingDirection,labels:S.labels,numberOfDirections:(T=S.numberOfDirections)!=null?T:this.config.numberOfDirections,tileWidth:S.tileWidth,tileHeight:S.tileHeight};typeof S.collides=="boolean"?S.collides===!1&&(c.collidesWithTiles=!1,c.collisionGroups=[]):S.collides!==void 0&&(S.collides.collidesWithTiles===!1&&(c.collidesWithTiles=!1),S.collides.collisionGroups&&(c.collisionGroups=S.collides.collisionGroups),S.collides.ignoreCollisionGroups&&(c.ignoreCollisionGroups=S.collides.ignoreCollisionGroups),c.ignoreMissingTiles=(R=(E=S.collides)==null?void 0:E.ignoreMissingTiles)!=null?R:!1);let m=new WS(S.id,c);S.startPosition&&m.setTilePosition({position:new ut(S.startPosition),layer:m.getTilePos().layer}),(O=this.gridCharacters)==null||O.set(S.id,m),this.gridTilemap.addCharacter(m);let t=m.getId();m.movementStopped().pipe(si(this.charRemoved(t))).subscribe(o=>{var v;(v=this.movementStopped$)==null||v.next({charId:t,direction:o})}),m.movementStarted().pipe(si(this.charRemoved(t))).subscribe(o=>{var v;(v=this.movementStarted$)==null||v.next({charId:t,direction:o})}),m.directionChanged().pipe(si(this.charRemoved(t))).subscribe(o=>{var v;(v=this.directionChanged$)==null||v.next({charId:t,direction:o})}),m.positionChangeStarted().pipe(si(this.charRemoved(t))).subscribe(o=>{var v;(v=this.positionChangeStarted$)==null||v.next(he({charId:t},o))}),m.positionChangeFinished().pipe(si(this.charRemoved(t))).subscribe(o=>{var v;(v=this.positionChangeFinished$)==null||v.next(he({charId:t},o))}),(D=this.charAdded$)==null||D.next(t)}hasCharacter(S){var T;return this.initGuard(),!!((T=this.gridCharacters)!=null&&T.has(S))}removeCharacter(S){var T,E,R,O;if(this.initGuard(),!((T=this.gridCharacters)!=null&&T.get(S)))throw this.createCharUnknownErr(S);(E=this.gridTilemap)==null||E.removeCharacter(S),(R=this.gridCharacters)==null||R.delete(S),(O=this.charRemoved$)==null||O.next(S)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let S of this.gridCharacters.keys())this.removeCharacter(S)}getAllCharacters(S){if(this.initGuard(),!this.gridCharacters)return[];let T=[...this.gridCharacters.values()];return(S?qS(T,S):T).map(E=>E.getId())}getLabels(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getLabels()}addLabels(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);R.addLabels(T)}removeLabels(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);R.removeLabels(T)}clearLabels(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);E.clearLabels()}follow(S,T,E,R){var O,D,c,m,t,o;let v;E===void 0?v={distance:0,closestPointIfBlocked:!1}:typeof E=="number"?(v={distance:E,closestPointIfBlocked:!1},R&&(v.closestPointIfBlocked=!0)):v=E,this.initGuard();let a=(O=this.gridCharacters)==null?void 0:O.get(S),r=(D=this.gridCharacters)==null?void 0:D.get(T);if(!a)throw this.createCharUnknownErr(S);if(!r)throw this.createCharUnknownErr(T);if(!this.gridTilemap)throw this.createUninitializedErr();let n=new QS(a,this.gridTilemap,r,{distance:(c=v.distance)!=null?c:0,noPathFoundStrategy:v.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(m=v.maxPathLength)!=null?m:1/0,shortestPathAlgorithm:(t=v.algorithm)!=null?t:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!v.ignoreLayers,facingDirection:(o=v.facingDirection)!=null?o:"none"});a.setMovement(n)}isMoving(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.isMoving()}getFacingDirection(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getFacingDirection()}getFacingPosition(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);let R=E.getFacingPosition();return{x:R.x,y:R.y}}turnTowards(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);return R.turnTowards(T)}getCharactersAt(S,T){if(this.initGuard(),!this.gridTilemap)return[];let E=this.gridTilemap.getCharactersAt(new ut(S),T);return Array.from(E).map(R=>R.getId())}setPosition(S,T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(S);if(!O)throw this.createCharUnknownErr(S);E||O.setTilePosition({position:new ut(T),layer:O.getTilePos().layer}),O.setTilePosition({position:new ut(T),layer:E})}isBlocked(S,T,E=["geDefault"]){var R,O;this.initGuard();let D=new ut(S);return!!((R=this.gridTilemap)!=null&&R.hasBlockingTile(D,T)||(O=this.gridTilemap)!=null&&O.hasBlockingChar(D,T,E))}isTileBlocked(S,T){var E;return this.initGuard(),!!((E=this.gridTilemap)!=null&&E.hasBlockingTile(new ut(S),T))}getCollisionGroups(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getCollisionGroups()||[]}setCollisionGroups(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);R.setCollisionGroups(T)}getIgnoreCollisionGroups(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(S,T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(S);if(!R)throw this.createCharUnknownErr(S);R.setIgnoreCollisionGroups(T)}getTilePosInDirection(S,T,E){if(!this.gridTilemap)throw this.createUninitializedErr();let R=this.gridTilemap.getTilePosInDirection({position:new ut(S),layer:T},E);return{position:R.position.toPosition(),charLayer:R.layer}}findShortestPath(S,T,E={}){if(!this.gridTilemap)throw this.createUninitializedErr();let R=E.shortestPathAlgorithm||"BFS";E.considerCosts&&R!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${R}'. It can only be used with A* algorithm.`);let O=E.pathWidth!==void 0&&E.pathWidth!==1,D=E.pathHeight!==void 0&&E.pathHeight!==1;(O||D)&&R==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let c=new jd(this.gridTilemap).findShortestPath(Ut.toInternal(S),Ut.toInternal(T),Ji(he({},E),{shortestPathAlgorithm:R}));return{path:c.path.map(Ut.fromInternal),closestToTarget:c.closestToTarget?Ut.fromInternal(c.closestToTarget):void 0,reachedMaxPathLength:!1,steps:c.steps}}steppedOn(S,T,E){return this.positionChangeFinished().pipe(Qi(R=>S.includes(R.charId)&&T.some(O=>O.x===R.enterTile.x&&O.y===R.enterTile.y)&&(E===void 0||E.includes(R.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(ln(S=>({charId:S,action:"ADDED"})),VS(this.charRemoved$.pipe(ln(S=>({charId:S,action:"REMOVED"})))))}movementStarted(){if(!this.movementStarted$)throw this.createUninitializedErr();return this.movementStarted$}movementStopped(){if(!this.movementStopped$)throw this.createUninitializedErr();return this.movementStopped$}directionChanged(){if(!this.directionChanged$)throw this.createUninitializedErr();return this.directionChanged$}positionChangeStarted(){if(!this.positionChangeStarted$)throw this.createUninitializedErr();return this.positionChangeStarted$}positionChangeFinished(){if(!this.positionChangeFinished$)throw this.createUninitializedErr();return this.positionChangeFinished$}getMovementProgress(S){var T;this.initGuard();let E=(T=this.gridCharacters)==null?void 0:T.get(S);if(!E)throw this.createCharUnknownErr(S);return E.getMovementProgress()}rebuildTileCollisionCache(S,T,E,R){var O;(O=this.gridTilemap)==null||O.rebuildTileCollisionCache(new hh(S,T,E,R))}addQueueMovements(S,T,E){var R,O;this.initGuard();let D=(R=this.gridCharacters)==null?void 0:R.get(S);if(!D)throw this.createCharUnknownErr(S);if(!this.gridTilemap)throw this.createUninitializedErr();let c;((O=D?.getMovement())==null?void 0:O.getInfo().type)==="Queue"?c=D.getMovement():(c=new o2(D,this.gridTilemap),D.setMovement(c),c.finished().pipe(si(GS(this.charRemoved(S),D.autoMovementSet()))).subscribe(m=>{var t;(t=this.queueMovementFinished$)==null||t.next(he({charId:S},m))})),c.enqueue(T.map(m=>Ls(m)?m:{position:new ut(m.position),layer:m.charLayer}),E)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(S){var T,E;this.initGuard();let R=(T=this.gridCharacters)==null?void 0:T.get(S);if(!R)throw this.createCharUnknownErr(S);return((E=R.getMovement())==null?void 0:E.getInfo().type)==="Queue"?R.getMovement().peekAll().map(O=>({command:Ls(O.command)?O.command:Ut.fromInternal(O.command),config:O.config})):[]}clearEnqueuedMovements(S){var T,E;this.initGuard();let R=(T=this.gridCharacters)==null?void 0:T.get(S);if(!R)throw this.createCharUnknownErr(S);((E=R.getMovement())==null?void 0:E.getInfo().type)==="Queue"&&R.getMovement().clear()}getTileCost(S,T,E){var R,O;return this.initGuard(),(O=(R=this.gridTilemap)==null?void 0:R.getTileCosts({position:new ut(S),layer:T},E))!=null?O:1}getState(){let S=[];if(this.gridCharacters)for(let[T,E]of this.gridCharacters.entries())S.push({id:T,position:Ut.fromInternal(E.getTilePos()),facingDirection:E.getFacingDirection(),speed:E.getSpeed(),labels:E.getLabels(),movementProgress:E.getMovementProgress(),collisionConfig:{collisionGroups:E.getCollisionGroups(),ignoreCollisionGroups:E.getIgnoreCollisionGroups(),collidesWithTiles:E.collidesWithTiles(),ignoreMissingTiles:E.getIgnoreMissingTiles()}});return{characters:S}}setState(S){if(this.gridCharacters)for(let T of S.characters){let E=this.gridCharacters.get(T.id);if(E){let R=E.getTilePos();Ut.equal(R,Ut.toInternal(T.position))||E.setTilePosition(Ut.toInternal(T.position)),E.setSpeed(T.speed),E.turnTowards(T.facingDirection),T.collisionConfig.collisionGroups&&E.setCollisionGroups(T.collisionConfig.collisionGroups),T.collisionConfig.collidesWithTiles!==void 0&&E.setCollidesWithTiles(T.collisionConfig.collidesWithTiles),T.collisionConfig.ignoreMissingTiles!==void 0&&E.setIgnoreMissingTiles(T.collisionConfig.ignoreMissingTiles),E.setMovementProgress(T.movementProgress),E.clearLabels(),E.addLabels(T.labels)}}}charRemoved(S){var T;if(!this.charRemoved$)throw this.createUninitializedErr();return(T=this.charRemoved$)==null?void 0:T.pipe(zs(1),Qi(E=>E==S))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var S;(S=this.config)==null||S.characters.forEach(T=>this.addCharacter(T))}moveChar(S,T){var E,R,O;this.initGuard();let D=(E=this.gridCharacters)==null?void 0:E.get(S);if(!D)throw this.createCharUnknownErr(S);if(D.getNumberOfDirections()===4){if(!((R=this.gridTilemap)!=null&&R.isIsometric())&&hn(T)){console.warn(`GridEngine: Character '${S}' can't be moved '${T}' in 4 direction mode.`);return}else if((O=this.gridTilemap)!=null&&O.isIsometric()&&!hn(T)){console.warn(`GridEngine: Character '${S}' can't be moved '${T}' in 4 direction isometric mode.`);return}}D.move(T)}createCharUnknownErr(S){return new Error(`Character unknown: ${S}`)}assembleMoveToConfig(S={}){let T=Ji(he({},S),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return S!=null&&S.noPathFoundStrategy&&(Object.values(Ud).includes(S.noPathFoundStrategy)?T.noPathFoundStrategy=S.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${S.noPathFoundStrategy}'. Falling back to 'STOP'`)),S!=null&&S.pathBlockedStrategy&&(Object.values(Xd).includes(S.pathBlockedStrategy)?T.pathBlockedStrategy=S.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${S.pathBlockedStrategy}'. Falling back to 'WAIT'`)),T}setConfigDefaults(S){return he({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},S)}},l2=class extends Wd{constructor(S,T={}){super(S,T),this.jumpCache=new xf}findShortestPathImpl(S,T){return this.jumpCache=new xf,super.findShortestPathImpl(S,T)}getNeighborsInternal(S,T,E){if(!T||S.layer!==T.layer)return this.getNeighbors(S,E).map(D=>({p:D,dist:1}));let R=this.prune(T,S).map(D=>{let c=this.getTransition(D.position,S.layer);return{position:D.position,layer:c||S.layer}}),O=[];for(let D of R){let c=this.jump(S,D,E,1,ni(S.position,D.position));c&&(c.dist=this.distance(S.position,c.p.position),O.push(c))}return O}getForced(S,T){let E=[],{topLeft:R,downLeft:O,top:D,bottom:c,topRight:m,downRight:t}=this.normalizedPositions(S,T),o=ni(S.position,T.position);return hn(o)?(this.blockOrTrans(S,R)&&(this.addIfNotBlocked(E,T,D),this.addIfNotBlocked(E,T,m),this.blockOrTrans(O,R)&&this.addIfNotBlocked(E,T,R)),this.blockOrTrans(S,O)&&(this.addIfNotBlocked(E,T,c),this.addIfNotBlocked(E,T,t),this.blockOrTrans(R,O)&&this.addIfNotBlocked(E,T,O)),this.blockOrTrans(R,D)&&this.addIfNotBlocked(E,T,D),this.blockOrTrans(O,c)&&this.addIfNotBlocked(E,T,c),this.blockOrTrans(R,m)&&this.addIfNotBlocked(E,T,m),this.blockOrTrans(O,t)&&this.addIfNotBlocked(E,T,t)):((this.blockOrTrans(S,D)||this.blockOrTrans(D,m))&&this.addIfNotBlocked(E,T,m),(this.blockOrTrans(S,c)||this.blockOrTrans(c,t))&&this.addIfNotBlocked(E,T,t),this.blockOrTrans(S,R)&&this.blockOrTrans(S,D)&&(this.addIfNotBlocked(E,T,D),this.addIfNotBlocked(E,T,R)),this.blockOrTrans(S,O)&&this.blockOrTrans(S,c)&&(this.addIfNotBlocked(E,T,c),this.addIfNotBlocked(E,T,O)),this.blockOrTrans(R,D)&&this.blockOrTrans(S,D)&&this.addIfNotBlocked(E,T,D),this.blockOrTrans(O,c)&&this.blockOrTrans(S,c)&&this.addIfNotBlocked(E,T,c)),E}hasForced(S,T){let{topLeft:E,downLeft:R,top:O,bottom:D,topRight:c,downRight:m}=this.normalizedPositions(S,T),t=ni(S.position,T.position);if(hn(t)){if(this.blockOrTrans(S,E)&&(!this.blockOrTrans(T,O)||!this.blockOrTrans(T,c)||this.blockOrTrans(R,E)&&!this.blockOrTrans(T,E))||this.blockOrTrans(S,R)&&(!this.blockOrTrans(T,D)||!this.blockOrTrans(T,m)||this.blockOrTrans(E,R)&&!this.blockOrTrans(T,R))||this.blockOrTrans(E,O)&&!this.blockOrTrans(T,O)||this.blockOrTrans(R,D)&&!this.blockOrTrans(T,D)||this.blockOrTrans(E,c)&&!this.blockOrTrans(T,c)||this.blockOrTrans(R,m)&&!this.blockOrTrans(T,m))return!0}else if((this.blockOrTrans(S,O)||this.blockOrTrans(O,c))&&!this.blockOrTrans(T,c)||(this.blockOrTrans(S,D)||this.blockOrTrans(D,m))&&!this.blockOrTrans(T,m)||this.blockOrTrans(S,E)&&this.blockOrTrans(S,O)&&(!this.blockOrTrans(T,O)||!this.blockOrTrans(T,E))||this.blockOrTrans(S,R)&&this.blockOrTrans(S,D)&&(!this.blockOrTrans(T,D)||!this.blockOrTrans(T,R))||this.blockOrTrans(E,O)&&this.blockOrTrans(S,O)&&!this.blockOrTrans(T,O)||this.blockOrTrans(R,D)&&this.blockOrTrans(S,D)&&!this.blockOrTrans(T,D))return!0;return!1}prune(S,T){let{top:E,right:R,topRight:O,downRight:D,bottom:c}=this.normalizedPositions(S,T),m=this.getForced(S,T),t=ni(S.position,T.position);return hn(t)?[E,R,O,D,c,...m]:[R,...m]}jump(S,T,E,R,O){let D=this.jumpCache.get(S,T);if(D!==null)return D;if(this.isBlocking(S,T)&&!(Ut.equal(T,E)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(S,T,void 0);return}if(Ut.equal(T,E))return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(R>=this.maxJumpSize)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.getTransition(T.position,S.layer)!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.hasForced(S,T))return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.updateClosestToTarget(T,E),O==="up-left"){if(this.jump(T,this.getTilePosInDir(T,"up"),E,R+1,"up")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"left"),E,R+1,"left")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="down-left"){if(this.jump(T,this.getTilePosInDir(T,"down"),E,R+1,"down")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"left"),E,R+1,"left")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="up-right"){if(this.jump(T,this.getTilePosInDir(T,"up"),E,R+1,"up")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"right"),E,R+1,"right")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}else if(O==="down-right"){if(this.jump(T,this.getTilePosInDir(T,"down"),E,R+1,"down")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0};if(this.jump(T,this.getTilePosInDir(T,"right"),E,R+1,"right")!==void 0)return this.jumpCache.set(S,T,{p:T,dist:0}),{p:T,dist:0}}let c=this.jump(T,this.getTilePosInDir(T,O),E,R+1,O);return this.jumpCache.set(S,T,c),c}normalizedPositions(S,T){return S.position.xT.position.x&&S.position.y===T.position.y?{topLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y),layer:T.layer},topRight:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},downRight:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer}}:S.position.yT.position.y&&S.position.x===T.position.x?{topLeft:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},downLeft:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},top:{position:new ut(T.position.x-1,T.position.y),layer:T.layer},bottom:{position:new ut(T.position.x+1,T.position.y),layer:T.layer},right:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},topRight:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer},downRight:{position:new ut(T.position.x+1,T.position.y-1),layer:T.layer}}:S.position.yT.position.x?{topLeft:{position:new ut(T.position.x+1,T.position.y),layer:T.layer},downLeft:{position:new ut(T.position.x,T.position.y-1),layer:T.layer},top:{position:new ut(T.position.x+1,T.position.y+1),layer:T.layer},bottom:{position:new ut(T.position.x-1,T.position.y-1),layer:T.layer},right:{position:new ut(T.position.x-1,T.position.y+1),layer:T.layer},topRight:{position:new ut(T.position.x,T.position.y+1),layer:T.layer},downRight:{position:new ut(T.position.x-1,T.position.y),layer:T.layer}}:S.position.y>T.position.y&&S.position.x(S.SUCCESS="SUCCESS",S.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",S.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",S.PATH_BLOCKED="PATH_BLOCKED",S.NO_PATH_FOUND="NO_PATH_FOUND",S.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",S.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",S.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",S))(f2||{}),$d=class{constructor(S,T,E,{config:R,ignoreBlockedTarget:O=!1,distance:D=0}={}){this.character=S,this.tilemap=T,this.targetPos=E,this.shortestPath=[],this.distOffset=0,this.posOnPath=0,this.stopped=!1,this.pathBlockedWaitElapsed=0,this.isPositionAllowed=()=>!0,this.shortestPathAlgorithm="BIDIRECTIONAL_SEARCH",this.maxPathLength=1/0,this.considerCosts=!1,this.ignoredChars=[],this.isBlocking=(t,o)=>t?new Vd(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:t,layer:o}):!0;var c,m;this.shortestPathAlgorithm=(c=R?.algorithm)!=null?c:this.shortestPathAlgorithm,this.ignoreBlockedTarget=O,this.distance=D,this.noPathFoundStrategy=R?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=R?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new ff(R?.noPathFoundRetryBackoffMs||200,R?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new ff(R?.pathBlockedRetryBackoffMs||200,R?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),R!=null&&R.isPositionAllowedFn&&(this.isPositionAllowed=R.isPositionAllowedFn),R!=null&&R.maxPathLength&&(this.maxPathLength=R.maxPathLength),this.alternativeTargets=R?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=R?.noPathFoundAlternativeTargetsFallbackStrategy,R!=null&&R.considerCosts&&this.shortestPathAlgorithm!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${this.shortestPathAlgorithm}'. It can only be used with A* algorithm.`),this.shortestPathAlgorithm==="JPS"&&(this.character.getTileWidth()>1||this.character.getTileHeight()>1)&&console.warn("GridEngine: Pathfinding algorithm 'JPS' can only be used for characters with 'tileWidth' and 'tileHeight' of 1"),this.considerCosts=R?.considerCosts||!1,this.ignoreLayers=!!(R!=null&&R.ignoreLayers),this.distanceUtils=vn.create(S.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=R?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(m=R?.ignoredChars)!=null?m:[],this.finished$=new ue,this.setCharacter(S)}setPathBlockedStrategy(S){this.pathBlockedStrategy=S}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(S){this.character=S,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(Qi(T=>T!==this),zs(1)).subscribe(()=>{this.stop("MOVEMENT_TERMINATED")})}getPathfindingOptions(){return{shortestPathAlgorithm:this.shortestPathAlgorithm,pathWidth:this.character.getTileWidth(),pathHeight:this.character.getTileHeight(),numberOfDirections:this.character.getNumberOfDirections(),isPositionAllowed:this.isPositionAllowed,collisionGroups:this.character.getCollisionGroups(),ignoredChars:[this.character.getId(),...this.ignoredChars],ignoreTiles:!this.character.collidesWithTiles(),ignoreMapBounds:this.character.getIgnoreMissingTiles(),ignoreBlockedTarget:this.ignoreBlockedTarget,maxPathLength:this.maxPathLength,ignoreLayers:this.ignoreLayers,considerCosts:this.considerCosts,calculateClosestToTarget:!0}}update(S){var T,E,R,O;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(S,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((T=this.nextTileOnPath())==null?void 0:T.position,(E=this.character)==null?void 0:E.getNextTilePos().layer)?this.applyPathBlockedStrategy(S):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((R=this.nextTileOnPath())==null?void 0:R.position,(O=this.character)==null?void 0:O.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(S=>Ut.fromInternal(S))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:Ut.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(S){switch(S){case"SUCCESS":return"Successfully arrived.";case"MOVEMENT_TERMINATED":return"Movement of character has been replaced before destination was reached.";case"PATH_BLOCKED":return"PathBlockedStrategy STOP: Path blocked.";case"NO_PATH_FOUND_MAX_RETRIES_EXCEEDED":return`NoPathFoundStrategy RETRY: Maximum retries of ${this.noPathFoundRetryable.getMaxRetries()} exceeded.`;case"NO_PATH_FOUND":return"NoPathFoundStrategy STOP: No path found.";case"PATH_BLOCKED_MAX_RETRIES_EXCEEDED":return`PathBlockedStrategy RETRY: Maximum retries of ${this.pathBlockedRetryable.getMaxRetries()} exceeded.`;case"PATH_BLOCKED_WAIT_TIMEOUT":return`PathBlockedStrategy WAIT: Wait timeout of ${this.pathBlockedWaitTimeoutMs}ms exceeded.`}}applyPathBlockedStrategy(S){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(S,()=>{let T=this.getShortestPath();T.path.length>0&&this.calcShortestPath(T)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=S,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let S=this.nextTileOnPath();if(!S)return;let T=this.getDir(this.character.getNextTilePos().position,S.position);this.character.move(T)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(S){this.finished$.next({position:this.character.getTilePos().position,result:S,description:this.resultToReason(S),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let S=this.shortestPath[this.posOnPath+1],T=this.getDir(this.character.getNextTilePos().position,S.position);this.character.turnTowards(T)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let S=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:D,distOffset:c}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:E,distOffset:0}}pathToAlternativeTarget(S,T){let E=T.findShortestPath(this.character.getNextTilePos(),S,this.getPathfindingOptions()).path,R=this.distanceUtils.distance(S.position,this.targetPos.position);return{path:E,distOffset:R}}getDir(S,T){return this.tilemap.fromMapDirection(this.distanceUtils.direction(S,T))}},d2=Object.create,Zd=Object.defineProperty,c2=Object.getOwnPropertyDescriptor,v2=Object.getOwnPropertyNames,p2=Object.getPrototypeOf,g2=Object.prototype.hasOwnProperty,m2=(S,T)=>()=>(T||S((T={exports:{}}).exports,T),T.exports),y2=(S,T,E,R)=>{if(T&&typeof T=="object"||typeof T=="function")for(let O of v2(T))!g2.call(S,O)&&O!==E&&Zd(S,O,{get:()=>T[O],enumerable:!(R=c2(T,O))||R.enumerable});return S},lh=(S,T,E)=>(E=S!=null?d2(p2(S)):{},y2(T||!S||!S.__esModule?Zd(E,"default",{value:S,enumerable:!0}):E,S)),uh=m2((S,T)=>{(function(){var E,R="4.17.21",O=200,D="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",m="Invalid `variable` option passed into `_.template`",t="__lodash_hash_undefined__",o=500,v="__lodash_placeholder__",a=1,r=2,n=4,e=1,i=2,h=1,s=2,l=4,f=8,u=16,d=32,p=64,g=128,x=256,y=512,C=30,P="...",M=800,w=16,I=1,L=2,B=3,N=1/0,G=9007199254740991,V=17976931348623157e292,K=NaN,j=4294967295,J=j-1,X=j>>>1,Y=[["ary",g],["bind",h],["bindKey",s],["curry",f],["curryRight",u],["flip",y],["partial",d],["partialRight",p],["rearg",x]],b="[object Arguments]",z="[object Array]",W="[object AsyncFunction]",H="[object Boolean]",Z="[object Date]",Q="[object DOMException]",k="[object Error]",et="[object Function]",st="[object GeneratorFunction]",rt="[object Map]",ot="[object Number]",ft="[object Null]",at="[object Object]",vt="[object Promise]",At="[object Proxy]",Et="[object RegExp]",Pt="[object Set]",ct="[object String]",Ct="[object Symbol]",pt="[object Undefined]",wt="[object WeakMap]",Bt="[object WeakSet]",jt="[object ArrayBuffer]",zt="[object DataView]",Yt="[object Float32Array]",bt="[object Float64Array]",re="[object Int8Array]",Qt="[object Int16Array]",de="[object Int32Array]",ve="[object Uint8Array]",Ae="[object Uint8ClampedArray]",hi="[object Uint16Array]",li="[object Uint32Array]",Si=/\b__p \+= '';/g,Ci=/\b(__p \+=) '' \+/g,Ei=/(__e\(.*?\)|\b__t\)) \+\n'';/g,yh=/&(?:amp|lt|gt|quot|#39);/g,xh=/[&<>"']/g,Dc=RegExp(yh.source),Ic=RegExp(xh.source),Bc=/<%-([\s\S]+?)%>/g,bc=/<%([\s\S]+?)%>/g,Th=/<%=([\s\S]+?)%>/g,Nc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gc=/^\w*$/,zc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ia=/[\\^$.*+?()[\]{}|]/g,Uc=RegExp(ia.source),sa=/^\s+/,Xc=/\s/,Vc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Wc=/\{\n\/\* \[wrapped with (.+)\] \*/,Yc=/,? & /,Hc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kc=/[()=,{}\[\]\/\s]/,jc=/\\(\\)?/g,$c=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sh=/\w*$/,Zc=/^[-+]0x[0-9a-f]+$/i,Jc=/^0b[01]+$/i,Qc=/^\[object .+?Constructor\]$/,kc=/^0o[0-7]+$/i,qc=/^(?:0|[1-9]\d*)$/,_c=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Sn=/($^)/,tv=/['\n\r\u2028\u2029\\]/g,Cn="\\ud800-\\udfff",ev="\\u0300-\\u036f",iv="\\ufe20-\\ufe2f",sv="\\u20d0-\\u20ff",Ch=ev+iv+sv,Eh="\\u2700-\\u27bf",Ph="a-z\\xdf-\\xf6\\xf8-\\xff",nv="\\xac\\xb1\\xd7\\xf7",rv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",av="\\u2000-\\u206f",ov=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ah="A-Z\\xc0-\\xd6\\xd8-\\xde",Mh="\\ufe0e\\ufe0f",wh=nv+rv+av+ov,na="['’]",hv="["+Cn+"]",Rh="["+wh+"]",En="["+Ch+"]",Fh="\\d+",lv="["+Eh+"]",Lh="["+Ph+"]",Oh="[^"+Cn+wh+Fh+Eh+Ph+Ah+"]",ra="\\ud83c[\\udffb-\\udfff]",uv="(?:"+En+"|"+ra+")",Dh="[^"+Cn+"]",aa="(?:\\ud83c[\\udde6-\\uddff]){2}",oa="[\\ud800-\\udbff][\\udc00-\\udfff]",gs="["+Ah+"]",Ih="\\u200d",Bh="(?:"+Lh+"|"+Oh+")",fv="(?:"+gs+"|"+Oh+")",bh="(?:"+na+"(?:d|ll|m|re|s|t|ve))?",Nh="(?:"+na+"(?:D|LL|M|RE|S|T|VE))?",Gh=uv+"?",zh="["+Mh+"]?",dv="(?:"+Ih+"(?:"+[Dh,aa,oa].join("|")+")"+zh+Gh+")*",cv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Uh=zh+Gh+dv,pv="(?:"+[lv,aa,oa].join("|")+")"+Uh,gv="(?:"+[Dh+En+"?",En,aa,oa,hv].join("|")+")",mv=RegExp(na,"g"),yv=RegExp(En,"g"),ha=RegExp(ra+"(?="+ra+")|"+gv+Uh,"g"),xv=RegExp([gs+"?"+Lh+"+"+bh+"(?="+[Rh,gs,"$"].join("|")+")",fv+"+"+Nh+"(?="+[Rh,gs+Bh,"$"].join("|")+")",gs+"?"+Bh+"+"+bh,gs+"+"+Nh,vv,cv,Fh,pv].join("|"),"g"),Tv=RegExp("["+Ih+Cn+Ch+Mh+"]"),Sv=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ev=-1,ae={};ae[Yt]=ae[bt]=ae[re]=ae[Qt]=ae[de]=ae[ve]=ae[Ae]=ae[hi]=ae[li]=!0,ae[b]=ae[z]=ae[jt]=ae[H]=ae[zt]=ae[Z]=ae[k]=ae[et]=ae[rt]=ae[ot]=ae[at]=ae[Et]=ae[Pt]=ae[ct]=ae[wt]=!1;var se={};se[b]=se[z]=se[jt]=se[zt]=se[H]=se[Z]=se[Yt]=se[bt]=se[re]=se[Qt]=se[de]=se[rt]=se[ot]=se[at]=se[Et]=se[Pt]=se[ct]=se[Ct]=se[ve]=se[Ae]=se[hi]=se[li]=!0,se[k]=se[et]=se[wt]=!1;var Pv={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Av={"&":"&","<":"<",">":">",'"':""","'":"'"},Mv={"&":"&","<":"<",">":">",""":'"',"'":"'"},wv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Rv=parseFloat,Fv=parseInt,Xh=typeof global=="object"&&global&&global.Object===Object&&global,Lv=typeof self=="object"&&self&&self.Object===Object&&self,Ce=Xh||Lv||Function("return this")(),la=typeof S=="object"&&S&&!S.nodeType&&S,qi=la&&typeof T=="object"&&T&&!T.nodeType&&T,Vh=qi&&qi.exports===la,ua=Vh&&Xh.process,Je=function(){try{var ht=qi&&qi.require&&qi.require("util").types;return ht||ua&&ua.binding&&ua.binding("util")}catch{}}(),Wh=Je&&Je.isArrayBuffer,Yh=Je&&Je.isDate,Hh=Je&&Je.isMap,Kh=Je&&Je.isRegExp,jh=Je&&Je.isSet,$h=Je&&Je.isTypedArray;function Ve(ht,gt,dt){switch(dt.length){case 0:return ht.call(gt);case 1:return ht.call(gt,dt[0]);case 2:return ht.call(gt,dt[0],dt[1]);case 3:return ht.call(gt,dt[0],dt[1],dt[2])}return ht.apply(gt,dt)}function Ov(ht,gt,dt,Rt){for(var Nt=-1,kt=ht==null?0:ht.length;++Nt-1}function fa(ht,gt,dt){for(var Rt=-1,Nt=ht==null?0:ht.length;++Rt-1;);return dt}function el(ht,gt){for(var dt=ht.length;dt--&&ms(gt,ht[dt],0)>-1;);return dt}function Xv(ht,gt){for(var dt=ht.length,Rt=0;dt--;)ht[dt]===gt&&++Rt;return Rt}var Vv=pa(Pv),Wv=pa(Av);function Yv(ht){return"\\"+wv[ht]}function Hv(ht,gt){return ht==null?E:ht[gt]}function ys(ht){return Tv.test(ht)}function Kv(ht){return Sv.test(ht)}function jv(ht){for(var gt,dt=[];!(gt=ht.next()).done;)dt.push(gt.value);return dt}function xa(ht){var gt=-1,dt=Array(ht.size);return ht.forEach(function(Rt,Nt){dt[++gt]=[Nt,Rt]}),dt}function il(ht,gt){return function(dt){return ht(gt(dt))}}function zi(ht,gt){for(var dt=-1,Rt=ht.length,Nt=0,kt=[];++dt-1}function Ip(A,F){var U=this.__data__,$=Vn(U,A);return $<0?(++this.size,U.push([A,F])):U[$][1]=F,this}Pi.prototype.clear=Fp,Pi.prototype.delete=Lp,Pi.prototype.get=Op,Pi.prototype.has=Dp,Pi.prototype.set=Ip;function Ai(A){var F=-1,U=A==null?0:A.length;for(this.clear();++F=F?A:F)),A}function _e(A,F,U,$,q,tt){var it,nt=F&a,lt=F&r,mt=F&n;if(U&&(it=q?U(A,$,q,tt):U(A)),it!==E)return it;if(!le(A))return A;var yt=Gt(A);if(yt){if(it=G0(A),!nt)return Ne(A,it)}else{var Tt=Fe(A),Mt=Tt==et||Tt==st;if(Ki(A))return zl(A,nt);if(Tt==at||Tt==b||Mt&&!q){if(it=lt||Mt?{}:su(A),!nt)return lt?M0(A,Jp(it,A)):A0(A,vl(it,A))}else{if(!se[Tt])return q?A:{};it=z0(A,Tt,nt)}}tt||(tt=new fi);var Ft=tt.get(A);if(Ft)return Ft;tt.set(A,it),Du(A)?A.forEach(function(It){it.add(_e(It,F,U,It,A,tt))}):Lu(A)&&A.forEach(function(It,Ht){it.set(Ht,_e(It,F,U,Ht,A,tt))});var Dt=mt?lt?Ka:Ha:lt?ze:Ee,Vt=yt?E:Dt(A);return Qe(Vt||A,function(It,Ht){Vt&&(Ht=It,It=A[Ht]),js(it,Ht,_e(It,F,U,Ht,A,tt))}),it}function Qp(A){var F=Ee(A);return function(U){return pl(U,A,F)}}function pl(A,F,U){var $=U.length;if(A==null)return!$;for(A=ie(A);$--;){var q=U[$],tt=F[q],it=A[q];if(it===E&&!(q in A)||!tt(it))return!1}return!0}function gl(A,F,U){if(typeof A!="function")throw new ke(c);return _s(function(){A.apply(E,U)},F)}function $s(A,F,U,$){var q=-1,tt=Pn,it=!0,nt=A.length,lt=[],mt=F.length;if(!nt)return lt;U&&(F=oe(F,We(U))),$?(tt=fa,it=!1):F.length>=O&&(tt=Xs,it=!1,F=new es(F));t:for(;++qq?0:q+U),$=$===E||$>q?q:Xt($),$<0&&($+=q),$=U>$?0:Bu($);U<$;)A[U++]=F;return A}function yl(A,F){var U=[];return Vi(A,function($,q,tt){F($,q,tt)&&U.push($)}),U}function Me(A,F,U,$,q){var tt=-1,it=A.length;for(U||(U=X0),q||(q=[]);++tt0&&U(nt)?F>1?Me(nt,F-1,U,$,q):Gi(q,nt):$||(q[q.length]=nt)}return q}var Ma=Hl(),xl=Hl(!0);function pi(A,F){return A&&Ma(A,F,Ee)}function wa(A,F){return A&&xl(A,F,Ee)}function Yn(A,F){return Ni(F,function(U){return Li(A[U])})}function ss(A,F){F=Yi(F,A);for(var U=0,$=F.length;A!=null&&U<$;)A=A[mi(F[U++])];return U&&U==$?A:E}function Tl(A,F,U){var $=F(A);return Gt(A)?$:Gi($,U(A))}function Ie(A){return A==null?A===E?pt:ft:_i&&_i in ie(A)?B0(A):$0(A)}function Ra(A,F){return A>F}function _p(A,F){return A!=null&&_t.call(A,F)}function t0(A,F){return A!=null&&F in ie(A)}function e0(A,F,U){return A>=Re(F,U)&&A=120&&yt.length>=120)?new es(it&&yt):E}yt=A[0];var Tt=-1,Mt=nt[0];t:for(;++Tt-1;)nt!==A&&Bn.call(nt,lt,1),Bn.call(A,lt,1);return A}function Ll(A,F){for(var U=A?F.length:0,$=U-1;U--;){var q=F[U];if(U==$||q!==tt){var tt=q;Fi(q)?Bn.call(A,q,1):Ga(A,q)}}return A}function Ba(A,F){return A+Gn(ul()*(F-A+1))}function v0(A,F,U,$){for(var q=-1,tt=Te(Nn((F-A)/(U||1)),0),it=dt(tt);tt--;)it[$?tt:++q]=A,A+=U;return it}function ba(A,F){var U="";if(!A||F<1||F>G)return U;do F%2&&(U+=A),F=Gn(F/2),F&&(A+=A);while(F);return U}function Wt(A,F){return qa(au(A,F,Ue),A+"")}function p0(A){return cl(Rs(A))}function g0(A,F){var U=Rs(A);return tr(U,is(F,0,U.length))}function Qs(A,F,U,$){if(!le(A))return A;F=Yi(F,A);for(var q=-1,tt=F.length,it=tt-1,nt=A;nt!=null&&++qq?0:q+F),U=U>q?q:U,U<0&&(U+=q),q=F>U?0:U-F>>>0,F>>>=0;for(var tt=dt(q);++$>>1,it=A[tt];it!==null&&!He(it)&&(U?it<=F:it=O){var mt=F?null:L0(A);if(mt)return Mn(mt);it=!1,q=Xs,lt=new es}else lt=F?[]:nt;t:for(;++$=$?A:ti(A,F,U)}var Gl=op||function(A){return Ce.clearTimeout(A)};function zl(A,F){if(F)return A.slice();var U=A.length,$=rl?rl(U):new A.constructor(U);return A.copy($),$}function Va(A){var F=new A.constructor(A.byteLength);return new Dn(F).set(new Dn(A)),F}function S0(A,F){var U=F?Va(A.buffer):A.buffer;return new A.constructor(U,A.byteOffset,A.byteLength)}function C0(A){var F=new A.constructor(A.source,Sh.exec(A));return F.lastIndex=A.lastIndex,F}function E0(A){return Ks?ie(Ks.call(A)):{}}function Ul(A,F){var U=F?Va(A.buffer):A.buffer;return new A.constructor(U,A.byteOffset,A.length)}function Xl(A,F){if(A!==F){var U=A!==E,$=A===null,q=A===A,tt=He(A),it=F!==E,nt=F===null,lt=F===F,mt=He(F);if(!nt&&!mt&&!tt&&A>F||tt&&it&<&&!nt&&!mt||$&&it&<||!U&<||!q)return 1;if(!$&&!tt&&!mt&&A=nt)return lt;var mt=U[$];return lt*(mt=="desc"?-1:1)}}return A.index-F.index}function Vl(A,F,U,$){for(var q=-1,tt=A.length,it=U.length,nt=-1,lt=F.length,mt=Te(tt-it,0),yt=dt(lt+mt),Tt=!$;++nt1?U[q-1]:E,it=q>2?U[2]:E;for(tt=A.length>3&&typeof tt=="function"?(q--,tt):E,it&&Be(U[0],U[1],it)&&(tt=q<3?E:tt,q=1),F=ie(F);++$-1?q[tt?F[it]:it]:E}}function $l(A){return Ri(function(F){var U=F.length,$=U,q=qe.prototype.thru;for(A&&F.reverse();$--;){var tt=F[$];if(typeof tt!="function")throw new ke(c);if(q&&!it&&qn(tt)=="wrapper")var it=new qe([],!0)}for($=it?$:U;++$1&&$t.reverse(),yt&<nt))return!1;var mt=tt.get(A),yt=tt.get(F);if(mt&&yt)return mt==F&&yt==A;var Tt=-1,Mt=!0,Ft=U&i?new es:E;for(tt.set(A,F),tt.set(F,A);++Tt1?"& ":"")+F[$],F=F.join(U>2?", ":" "),A.replace(Vc,`{ +/* [wrapped with `+F+`] */ +`)}function X0(A){return Gt(A)||as(A)||!!(hl&&A&&A[hl])}function Fi(A,F){var U=typeof A;return F=F??G,!!F&&(U=="number"||U!="symbol"&&qc.test(A))&&A>-1&&A%1==0&&A0){if(++F>=M)return arguments[0]}else F=0;return A.apply(E,arguments)}}function tr(A,F){var U=-1,$=A.length,q=$-1;for(F=F===E?$:F;++U1?A[F-1]:E;return U=typeof U=="function"?(A.pop(),U):E,yu(A,U)});function xu(A){var F=_(A);return F.__chain__=!0,F}function kg(A,F){return F(A),A}function er(A,F){return F(A)}var qg=Ri(function(A){var F=A.length,U=F?A[0]:0,$=this.__wrapped__,q=function(tt){return Aa(tt,A)};return F>1||this.__actions__.length||!($ instanceof Kt)||!Fi(U)?this.thru(q):($=$.slice(U,+U+(F?1:0)),$.__actions__.push({func:er,args:[q],thisArg:E}),new qe($,this.__chain__).thru(function(tt){return F&&!tt.length&&tt.push(E),tt}))});function _g(){return xu(this)}function tm(){return new qe(this.value(),this.__chain__)}function em(){this.__values__===E&&(this.__values__=Iu(this.value()));var A=this.__index__>=this.__values__.length,F=A?E:this.__values__[this.__index__++];return{done:A,value:F}}function im(){return this}function sm(A){for(var F,U=this;U instanceof Xn;){var $=du(U);$.__index__=0,$.__values__=E,F?q.__wrapped__=$:F=$;var q=$;U=U.__wrapped__}return q.__wrapped__=A,F}function nm(){var A=this.__wrapped__;if(A instanceof Kt){var F=A;return this.__actions__.length&&(F=new Kt(this)),F=F.reverse(),F.__actions__.push({func:er,args:[_a],thisArg:E}),new qe(F,this.__chain__)}return this.thru(_a)}function rm(){return bl(this.__wrapped__,this.__actions__)}var am=$n(function(A,F,U){_t.call(A,U)?++A[U]:Mi(A,U,1)});function om(A,F,U){var $=Gt(A)?Zh:kp;return U&&Be(A,F,U)&&(F=E),$(A,Ot(F,3))}function hm(A,F){var U=Gt(A)?Ni:yl;return U(A,Ot(F,3))}var lm=jl(cu),um=jl(vu);function fm(A,F){return Me(ir(A,F),1)}function dm(A,F){return Me(ir(A,F),N)}function cm(A,F,U){return U=U===E?1:Xt(U),Me(ir(A,F),U)}function Tu(A,F){var U=Gt(A)?Qe:Vi;return U(A,Ot(F,3))}function Su(A,F){var U=Gt(A)?Dv:ml;return U(A,Ot(F,3))}var vm=$n(function(A,F,U){_t.call(A,U)?A[U].push(F):Mi(A,U,[F])});function pm(A,F,U,$){A=Ge(A)?A:Rs(A),U=U&&!$?Xt(U):0;var q=A.length;return U<0&&(U=Te(q+U,0)),or(A)?U<=q&&A.indexOf(F,U)>-1:!!q&&ms(A,F,U)>-1}var gm=Wt(function(A,F,U){var $=-1,q=typeof F=="function",tt=Ge(A)?dt(A.length):[];return Vi(A,function(it){tt[++$]=q?Ve(F,it,U):Zs(it,F,U)}),tt}),mm=$n(function(A,F,U){Mi(A,U,F)});function ir(A,F){var U=Gt(A)?oe:Pl;return U(A,Ot(F,3))}function ym(A,F,U,$){return A==null?[]:(Gt(F)||(F=F==null?[]:[F]),U=$?E:U,Gt(U)||(U=U==null?[]:[U]),Rl(A,F,U))}var xm=$n(function(A,F,U){A[U?0:1].push(F)},function(){return[[],[]]});function Tm(A,F,U){var $=Gt(A)?da:qh,q=arguments.length<3;return $(A,Ot(F,4),U,q,Vi)}function Sm(A,F,U){var $=Gt(A)?Iv:qh,q=arguments.length<3;return $(A,Ot(F,4),U,q,ml)}function Cm(A,F){var U=Gt(A)?Ni:yl;return U(A,rr(Ot(F,3)))}function Em(A){var F=Gt(A)?cl:p0;return F(A)}function Pm(A,F,U){(U?Be(A,F,U):F===E)?F=1:F=Xt(F);var $=Gt(A)?jp:g0;return $(A,F)}function Am(A){var F=Gt(A)?$p:y0;return F(A)}function Mm(A){if(A==null)return 0;if(Ge(A))return or(A)?xs(A):A.length;var F=Fe(A);return F==rt||F==Pt?A.size:Oa(A).length}function wm(A,F,U){var $=Gt(A)?ca:x0;return U&&Be(A,F,U)&&(F=E),$(A,Ot(F,3))}var Rm=Wt(function(A,F){if(A==null)return[];var U=F.length;return U>1&&Be(A,F[0],F[1])?F=[]:U>2&&Be(F[0],F[1],F[2])&&(F=[F[0]]),Rl(A,Me(F,1),[])}),sr=hp||function(){return Ce.Date.now()};function Fm(A,F){if(typeof F!="function")throw new ke(c);return A=Xt(A),function(){if(--A<1)return F.apply(this,arguments)}}function Cu(A,F,U){return F=U?E:F,F=A&&F==null?A.length:F,wi(A,g,E,E,E,E,F)}function Eu(A,F){var U;if(typeof F!="function")throw new ke(c);return A=Xt(A),function(){return--A>0&&(U=F.apply(this,arguments)),A<=1&&(F=E),U}}var eo=Wt(function(A,F,U){var $=h;if(U.length){var q=zi(U,Ms(eo));$|=d}return wi(A,$,F,U,q)}),Pu=Wt(function(A,F,U){var $=h|s;if(U.length){var q=zi(U,Ms(Pu));$|=d}return wi(F,$,A,U,q)});function Au(A,F,U){F=U?E:F;var $=wi(A,f,E,E,E,E,E,F);return $.placeholder=Au.placeholder,$}function Mu(A,F,U){F=U?E:F;var $=wi(A,u,E,E,E,E,E,F);return $.placeholder=Mu.placeholder,$}function wu(A,F,U){var $,q,tt,it,nt,lt,mt=0,yt=!1,Tt=!1,Mt=!0;if(typeof A!="function")throw new ke(c);F=ii(F)||0,le(U)&&(yt=!!U.leading,Tt="maxWait"in U,tt=Tt?Te(ii(U.maxWait)||0,F):tt,Mt="trailing"in U?!!U.trailing:Mt);function Ft(ge){var ci=$,Di=q;return $=q=E,mt=ge,it=A.apply(Di,ci),it}function Dt(ge){return mt=ge,nt=_s(Ht,F),yt?Ft(ge):it}function Vt(ge){var ci=ge-lt,Di=ge-mt,ju=F-ci;return Tt?Re(ju,tt-Di):ju}function It(ge){var ci=ge-lt,Di=ge-mt;return lt===E||ci>=F||ci<0||Tt&&Di>=tt}function Ht(){var ge=sr();if(It(ge))return $t(ge);nt=_s(Ht,Vt(ge))}function $t(ge){return nt=E,Mt&&$?Ft(ge):($=q=E,it)}function Ke(){nt!==E&&Gl(nt),mt=0,$=lt=q=nt=E}function be(){return nt===E?it:$t(sr())}function je(){var ge=sr(),ci=It(ge);if($=arguments,q=this,lt=ge,ci){if(nt===E)return Dt(lt);if(Tt)return Gl(nt),nt=_s(Ht,F),Ft(lt)}return nt===E&&(nt=_s(Ht,F)),it}return je.cancel=Ke,je.flush=be,je}var Lm=Wt(function(A,F){return gl(A,1,F)}),Om=Wt(function(A,F,U){return gl(A,ii(F)||0,U)});function Dm(A){return wi(A,y)}function nr(A,F){if(typeof A!="function"||F!=null&&typeof F!="function")throw new ke(c);var U=function(){var $=arguments,q=F?F.apply(this,$):$[0],tt=U.cache;if(tt.has(q))return tt.get(q);var it=A.apply(this,$);return U.cache=tt.set(q,it)||tt,it};return U.cache=new(nr.Cache||Ai),U}nr.Cache=Ai;function rr(A){if(typeof A!="function")throw new ke(c);return function(){var F=arguments;switch(F.length){case 0:return!A.call(this);case 1:return!A.call(this,F[0]);case 2:return!A.call(this,F[0],F[1]);case 3:return!A.call(this,F[0],F[1],F[2])}return!A.apply(this,F)}}function Im(A){return Eu(2,A)}var Bm=T0(function(A,F){F=F.length==1&&Gt(F[0])?oe(F[0],We(Ot())):oe(Me(F,1),We(Ot()));var U=F.length;return Wt(function($){for(var q=-1,tt=Re($.length,U);++q=F}),as=Sl(function(){return arguments}())?Sl:function(A){return ce(A)&&_t.call(A,"callee")&&!ol.call(A,"callee")},Gt=dt.isArray,Jm=Wh?We(Wh):s0;function Ge(A){return A!=null&&ar(A.length)&&!Li(A)}function pe(A){return ce(A)&&Ge(A)}function Qm(A){return A===!0||A===!1||ce(A)&&Ie(A)==H}var Ki=up||vo,km=Yh?We(Yh):n0;function qm(A){return ce(A)&&A.nodeType===1&&!tn(A)}function _m(A){if(A==null)return!0;if(Ge(A)&&(Gt(A)||typeof A=="string"||typeof A.splice=="function"||Ki(A)||ws(A)||as(A)))return!A.length;var F=Fe(A);if(F==rt||F==Pt)return!A.size;if(qs(A))return!Oa(A).length;for(var U in A)if(_t.call(A,U))return!1;return!0}function ty(A,F){return Js(A,F)}function ey(A,F,U){U=typeof U=="function"?U:E;var $=U?U(A,F):E;return $===E?Js(A,F,E,U):!!$}function so(A){if(!ce(A))return!1;var F=Ie(A);return F==k||F==Q||typeof A.message=="string"&&typeof A.name=="string"&&!tn(A)}function iy(A){return typeof A=="number"&&ll(A)}function Li(A){if(!le(A))return!1;var F=Ie(A);return F==et||F==st||F==W||F==At}function Fu(A){return typeof A=="number"&&A==Xt(A)}function ar(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=G}function le(A){var F=typeof A;return A!=null&&(F=="object"||F=="function")}function ce(A){return A!=null&&typeof A=="object"}var Lu=Hh?We(Hh):a0;function sy(A,F){return A===F||La(A,F,$a(F))}function ny(A,F,U){return U=typeof U=="function"?U:E,La(A,F,$a(F),U)}function ry(A){return Ou(A)&&A!=+A}function ay(A){if(Y0(A))throw new Nt(D);return Cl(A)}function oy(A){return A===null}function hy(A){return A==null}function Ou(A){return typeof A=="number"||ce(A)&&Ie(A)==ot}function tn(A){if(!ce(A)||Ie(A)!=at)return!1;var F=In(A);if(F===null)return!0;var U=_t.call(F,"constructor")&&F.constructor;return typeof U=="function"&&U instanceof U&&Fn.call(U)==np}var no=Kh?We(Kh):o0;function ly(A){return Fu(A)&&A>=-G&&A<=G}var Du=jh?We(jh):h0;function or(A){return typeof A=="string"||!Gt(A)&&ce(A)&&Ie(A)==ct}function He(A){return typeof A=="symbol"||ce(A)&&Ie(A)==Ct}var ws=$h?We($h):l0;function uy(A){return A===E}function fy(A){return ce(A)&&Fe(A)==wt}function dy(A){return ce(A)&&Ie(A)==Bt}var cy=kn(Da),vy=kn(function(A,F){return A<=F});function Iu(A){if(!A)return[];if(Ge(A))return or(A)?ui(A):Ne(A);if(Vs&&A[Vs])return jv(A[Vs]());var F=Fe(A),U=F==rt?xa:F==Pt?Mn:Rs;return U(A)}function Oi(A){if(!A)return A===0?A:0;if(A=ii(A),A===N||A===-N){var F=A<0?-1:1;return F*V}return A===A?A:0}function Xt(A){var F=Oi(A),U=F%1;return F===F?U?F-U:F:0}function Bu(A){return A?is(Xt(A),0,j):0}function ii(A){if(typeof A=="number")return A;if(He(A))return K;if(le(A)){var F=typeof A.valueOf=="function"?A.valueOf():A;A=le(F)?F+"":F}if(typeof A!="string")return A===0?A:+A;A=_h(A);var U=Jc.test(A);return U||kc.test(A)?Fv(A.slice(2),U?2:8):Zc.test(A)?K:+A}function bu(A){return gi(A,ze(A))}function py(A){return A?is(Xt(A),-G,G):A===0?A:0}function qt(A){return A==null?"":Ye(A)}var gy=Ps(function(A,F){if(qs(F)||Ge(F)){gi(F,Ee(F),A);return}for(var U in F)_t.call(F,U)&&js(A,U,F[U])}),Nu=Ps(function(A,F){gi(F,ze(F),A)}),hr=Ps(function(A,F,U,$){gi(F,ze(F),A,$)}),my=Ps(function(A,F,U,$){gi(F,Ee(F),A,$)}),yy=Ri(Aa);function xy(A,F){var U=Es(A);return F==null?U:vl(U,F)}var Ty=Wt(function(A,F){A=ie(A);var U=-1,$=F.length,q=$>2?F[2]:E;for(q&&Be(F[0],F[1],q)&&($=1);++U<$;)for(var tt=F[U],it=ze(tt),nt=-1,lt=it.length;++nt1),tt}),gi(A,Ka(A),U),$&&(U=_e(U,a|r|n,O0));for(var q=F.length;q--;)Ga(U,F[q]);return U});function zy(A,F){return zu(A,rr(Ot(F)))}var Uy=Ri(function(A,F){return A==null?{}:d0(A,F)});function zu(A,F){if(A==null)return{};var U=oe(Ka(A),function($){return[$]});return F=Ot(F),Fl(A,U,function($,q){return F($,q[0])})}function Xy(A,F,U){F=Yi(F,A);var $=-1,q=F.length;for(q||(q=1,A=E);++$F){var $=A;A=F,F=$}if(U||A%1||F%1){var q=ul();return Re(A+q*(F-A+Rv("1e-"+((q+"").length-1))),F)}return Ba(A,F)}var ky=As(function(A,F,U){return F=F.toLowerCase(),A+(U?Vu(F):F)});function Vu(A){return oo(qt(A).toLowerCase())}function Wu(A){return A=qt(A),A&&A.replace(_c,Vv).replace(yv,"")}function qy(A,F,U){A=qt(A),F=Ye(F);var $=A.length;U=U===E?$:is(Xt(U),0,$);var q=U;return U-=F.length,U>=0&&A.slice(U,q)==F}function _y(A){return A=qt(A),A&&Ic.test(A)?A.replace(xh,Wv):A}function tx(A){return A=qt(A),A&&Uc.test(A)?A.replace(ia,"\\$&"):A}var ex=As(function(A,F,U){return A+(U?"-":"")+F.toLowerCase()}),ix=As(function(A,F,U){return A+(U?" ":"")+F.toLowerCase()}),sx=Kl("toLowerCase");function nx(A,F,U){A=qt(A),F=Xt(F);var $=F?xs(A):0;if(!F||$>=F)return A;var q=(F-$)/2;return Qn(Gn(q),U)+A+Qn(Nn(q),U)}function rx(A,F,U){A=qt(A),F=Xt(F);var $=F?xs(A):0;return F&&$>>0,U?(A=qt(A),A&&(typeof F=="string"||F!=null&&!no(F))&&(F=Ye(F),!F&&ys(A))?Hi(ui(A),0,U):A.split(F,U)):[]}var dx=As(function(A,F,U){return A+(U?" ":"")+oo(F)});function cx(A,F,U){return A=qt(A),U=U==null?0:is(Xt(U),0,A.length),F=Ye(F),A.slice(U,U+F.length)==F}function vx(A,F,U){var $=_.templateSettings;U&&Be(A,F,U)&&(F=E),A=qt(A),F=hr({},F,$,ql);var q=hr({},F.imports,$.imports,ql),tt=Ee(q),it=ya(q,tt),nt,lt,mt=0,yt=F.interpolate||Sn,Tt="__p += '",Mt=Ta((F.escape||Sn).source+"|"+yt.source+"|"+(yt===Th?$c:Sn).source+"|"+(F.evaluate||Sn).source+"|$","g"),Ft="//# sourceURL="+(_t.call(F,"sourceURL")?(F.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ev+"]")+` +`;A.replace(Mt,function(It,Ht,$t,Ke,be,je){return $t||($t=Ke),Tt+=A.slice(mt,je).replace(tv,Yv),Ht&&(nt=!0,Tt+=`' + __e(`+Ht+`) + -'`),De&&(lt=!0,Tt+=`'; -`+De+`; +'`),be&&(lt=!0,Tt+=`'; +`+be+`; __p += '`),$t&&(Tt+=`' + ((__t = (`+$t+`)) == null ? '' : __t) + -'`),mt=Ye+It.length,It}),Tt+=`'; -`;var Dt=_t.call(R,"variable")&&R.variable;if(!Dt)Tt=`with (obj) { +'`),mt=je+It.length,It}),Tt+=`'; +`;var Dt=_t.call(F,"variable")&&F.variable;if(!Dt)Tt=`with (obj) { `+Tt+` } -`;else if(Hc.test(Dt))throw new Nt(m);Tt=(lt?Tt.replace(xi,""):Tt).replace(yi,"$1").replace(Ti,"$1;"),Tt="function("+(Dt||"obj")+`) { +`;else if(Kc.test(Dt))throw new Nt(m);Tt=(lt?Tt.replace(Si,""):Tt).replace(Ci,"$1").replace(Ei,"$1;"),Tt="function("+(Dt||"obj")+`) { `+(Dt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(nt?", __e = _.escape":"")+(lt?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Tt+`return __p -}`;var Vt=Hu(function(){return kt(tt,Ft+"return "+Tt).apply(E,it)});if(Vt.source=Tt,no(Vt))throw Vt;return Vt}function vy(A){return qt(A).toLowerCase()}function py(A){return qt(A).toUpperCase()}function gy(A,R,U){if(A=qt(A),A&&(U||R===E))return _h(A);if(!A||!(R=Xe(R)))return A;var $=oi(A),q=oi(R),tt=tl($,q),it=el($,q)+1;return Xi($,tt,it).join("")}function my(A,R,U){if(A=qt(A),A&&(U||R===E))return A.slice(0,sl(A)+1);if(!A||!(R=Xe(R)))return A;var $=oi(A),q=el($,oi(R))+1;return Xi($,0,q).join("")}function xy(A,R,U){if(A=qt(A),A&&(U||R===E))return A.replace(na,"");if(!A||!(R=Xe(R)))return A;var $=oi(A),q=tl($,oi(R));return Xi($,q).join("")}function yy(A,R){var U=C,$=P;if(he(R)){var q="separator"in R?R.separator:q;U="length"in R?Xt(R.length):U,$="omission"in R?Xe(R.omission):$}A=qt(A);var tt=A.length;if(vs(A)){var it=oi(A);tt=it.length}if(U>=tt)return A;var nt=U-ps($);if(nt<1)return $;var lt=it?Xi(it,0,nt).join(""):A.slice(0,nt);if(q===E)return lt+$;if(it&&(nt+=lt.length-nt),ro(q)){if(A.slice(nt).search(q)){var mt,xt=lt;for(q.global||(q=Sa(q.source,qt(Sh.exec(q))+"g")),q.lastIndex=0;mt=q.exec(xt);)var Tt=mt.index;lt=lt.slice(0,Tt===E?nt:Tt)}}else if(A.indexOf(Xe(q),nt)!=nt){var Mt=lt.lastIndexOf(q);Mt>-1&&(lt=lt.slice(0,Mt))}return lt+$}function Ty(A){return A=qt(A),A&&Oc.test(A)?A.replace(xh,Jv):A}var Sy=Ss(function(A,R,U){return A+(U?" ":"")+R.toUpperCase()}),ho=Kl("toUpperCase");function Yu(A,R,U){return A=qt(A),R=U?E:R,R===E?Hv(A)?qv(A):bv(A):A.match(R)||[]}var Hu=Wt(function(A,R){try{return ze(A,E,R)}catch(U){return no(U)?U:new Nt(U)}}),Cy=Ai(function(A,R){return $e(R,function(U){U=vi(U),Ei(A,U,io(A[U],A))}),A});function Ey(A){var R=A==null?0:A.length,U=Ot();return A=R?ae(A,function($){if(typeof $[1]!="function")throw new Ze(c);return[U($[0]),$[1]]}):[],Wt(function($){for(var q=-1;++qG)return[];var U=j,$=we(A,j);R=Ot(R),A-=j;for(var q=xa($,R);++U0||R<0)?new Kt(U):(A<0?U=U.takeRight(-A):A&&(U=U.drop(A)),R!==E&&(R=Xt(R),U=R<0?U.dropRight(-R):U.take(R-A)),U)},Kt.prototype.takeRightWhile=function(A){return this.reverse().takeWhile(A).reverse()},Kt.prototype.toArray=function(){return this.take(j)},di(Kt.prototype,function(A,R){var U=/^(?:filter|find|map|reject)|While$/.test(R),$=/^(?:head|last)$/.test(R),q=_[$?"take"+(R=="last"?"Right":""):R],tt=$||/^find/.test(R);q&&(_.prototype[R]=function(){var it=this.__wrapped__,nt=$?[1]:arguments,lt=it instanceof Kt,mt=nt[0],xt=lt||Gt(it),Tt=function(Ht){var $t=q.apply(_,Ii([Ht],nt));return $&&Mt?$t[0]:$t};xt&&U&&typeof mt=="function"&&mt.length!=1&&(lt=xt=!1);var Mt=this.__chain__,Ft=!!this.__actions__.length,Dt=tt&&!Mt,Vt=lt&&!Ft;if(!tt&&xt){it=Vt?it:new Kt(this);var It=A.apply(it,nt);return It.__actions__.push({func:tr,args:[Tt],thisArg:E}),new Je(It,Mt)}return Dt&&Vt?A.apply(this,nt):(It=this.thru(Tt),Dt?$?It.value()[0]:It.value():It)})}),$e(["pop","push","shift","sort","splice","unshift"],function(A){var R=Mn[A],U=/^(?:push|sort|unshift)$/.test(A)?"tap":"thru",$=/^(?:pop|shift)$/.test(A);_.prototype[A]=function(){var q=arguments;if($&&!this.__chain__){var tt=this.value();return R.apply(Gt(tt)?tt:[],q)}return this[U](function(it){return R.apply(Gt(it)?it:[],q)})}}),di(Kt.prototype,function(A,R){var U=_[R];if(U){var $=U.name+"";_t.call(xs,$)||(xs[$]=[]),xs[$].push({name:R,func:U})}}),xs[$n(E,s).name]=[{name:"wrapper",func:E}],Kt.prototype.clone=Tp,Kt.prototype.reverse=Sp,Kt.prototype.value=Cp,_.prototype.at=kg,_.prototype.chain=qg,_.prototype.commit=_g,_.prototype.next=tm,_.prototype.plant=im,_.prototype.reverse=sm,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=nm,_.prototype.first=_.prototype.head,Gs&&(_.prototype[Gs]=em),_},bi=_v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Se._=bi,define(function(){return bi})):Zi?((Zi.exports=bi)._=bi,ua._=bi):Se._=bi}).call(S)}),Zd=class extends Set{constructor(S,T=!1){super(S),this.valuesAsFlags=T}};function on(S){if(S instanceof Map)return Object.fromEntries([...S.entries()].map(([T,E])=>[T,on(E)]));if(S instanceof Set)return Array.from(S.values()).map(on);if(S instanceof Zd)return{values:[...S.values()],valuesAsFlags:S.valuesAsFlags};if(typeof S=="object"){let T={};return Object.entries(S).forEach(([E,F])=>{T[E]=on(F)}),T}else return S}uh(fh(),1);var x2=uh(fh(),1);function as(S,T){if(typeof S!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(S)}`);if(typeof T!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(T)}`);let E=(0,x2.cloneDeep)(S);for(let[F,O]of Object.entries(T))typeof O!="object"||O instanceof Set||E[F]===void 0?E[F]=O:E[F]=as(E[F],O);return E}function Jd(S,T){if(!(S===void 0||typeof S!="object"))for(let E of Object.keys(S)){if(E===T)return S[E];let F=S[E];if(typeof F=="object"){let O=Jd(F,T);if(O!==void 0)return O}}}var Co="@composite:",y2="@inherit:",T2=class{constructor(S,T,E){this.tiledClassToMembersMap=S,this.enumNameToValuesMap=T,this.parserOptions=E,this.memoiser=new Map}flattenMembers(S,T){return this.memoiser.has(S)?{[S]:this.memoiser.get(S)}:(this.memoiser.set(S,T.reduce((E,F)=>oe(oe({},E),this.flattenMemberProperty(F)),{})),{[S]:this.memoiser.get(S)})}flattenMemberProperty(S){var T;let E=(T=S.propertyType)!=null?T:S.propertytype;if(S.type==="class"){if(!this.memoiser.has(E)){let D=this.tiledClassToMembersMap.get(E).reduce((c,m)=>as(this.flattenMemberProperty(m),c),{});this.memoiser.set(E,D)}let F=this.memoiser.get(E),O=as(F,this.flattenValue(S.value,F));return this.checkIfShouldFlatten(S.name)?O:{[S.name.replace(Co,"")]:O}}else return this.enumNameToValuesMap.has(E)?this.enumNameToValuesMap.get(E).valuesAsFlags?{[S.name]:new Set(S.value.split(",").filter(F=>F!==""))}:{[S.name]:S.value}:{[S.name]:S.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(S,T){return Object.entries(S).reduce((E,[F,O])=>{if(typeof O!="object")return Jd(T,F)instanceof Set?as({[F]:new Set(O.split(",").filter(D=>D!==""))},E):as({[F]:O},E);if(this.checkIfShouldFlatten(F))return as(this.flattenValue(O,T),E);{let D=F.replace(Co,"");return as({[D]:this.flattenValue(O,T)},E)}},{})}checkIfShouldFlatten(S){var T;return((T=this.parserOptions)==null?void 0:T.defaultComposite)===!0?S.startsWith(y2):!S.startsWith(Co)}},Tf=uh(fh(),1),S2=class{constructor(S){this.flattener=S}flattenPropertiesOnObject(S){var T,E,F,O;return Ki(oe(oe({},this.flattener.memoisedFlattenedProperties.get((T=S.class)!=null?T:S.type)),(E=S.properties)==null?void 0:E.reduce((D,c)=>oe(oe({},D),this.flattener.flattenMemberProperty(c)),{})),{name:S.name,id:S.id,class:(O=(F=S.class)!=null?F:S.type)!=null?O:null,x:S.x,y:S.y})}flattenPropertiesOnTile(S){var T,E,F,O;return Ki(oe(oe({},this.flattener.memoisedFlattenedProperties.get((T=S.class)!=null?T:S.type)),(E=S.properties)==null?void 0:E.reduce((D,c)=>oe(oe({},D),this.flattener.flattenMemberProperty(c)),{})),{id:S.id,class:(O=(F=S.class)!=null?F:S.type)!=null?O:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([S,T])=>[S,(0,Tf.cloneDeep)(T)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([S,T])=>[S,(0,Tf.cloneDeep)(T)]))}toJSON(){return JSON.stringify({customTypes:on(this.getCustomTypesMap()),enums:on(this.getEnumsMap())},null,4)}};function C2(S,T){let E=new Map(S.propertyTypes.filter(D=>D.type==="enum").map(D=>[D.name,new Zd(D.values,D.valuesAsFlags)])),F=new Map(S.propertyTypes.filter(D=>D.type==="class").map(D=>[D.name,D.members])),O=new T2(F,E,T);return F.forEach((D,c)=>{O.flattenMembers(c,D)}),new S2(O)}var E2={parse:C2},Qd=class{constructor(S,T){this.phaserTile=S,this.tiledProject=T}getProperty(S){var T,E;let F={};if(this.tiledProject){let O=E2.parse(this.tiledProject),D=this.getType();if(D){let c=(T=O.getCustomTypesMap())==null?void 0:T.get(D);if(c)for(let[m,t]of Object.entries(c))F[m]=t}}return(E=this.phaserTile.properties[S])!=null?E:F[S]}hasProperty(S){return this.getProperty(S)!=null}getType(){var S,T;return(T=(S=this.phaserTile.tileset)==null?void 0:S.tileData[this.phaserTile.index-1])==null?void 0:T.type}},P2=class{constructor(S,T){this.phaserTilemapLayer=S,this.tiledProject=T}getName(){return this.phaserTilemapLayer.layer.name}getProperty(S){let T=this.phaserTilemapLayer.layer.properties,E=T?.find(F=>F.name==S);return E?.value}hasProperty(S){return this.getProperty(S)!=null}isCharLayer(){return this.hasProperty(pr)}getData(){return this.phaserTilemapLayer.layer.data.map(S=>S.map(T=>new Qd(T,this.tiledProject)))}},A2=class{constructor(S,T){this.phaserTilemap=S,this.tiledProject=T;for(let E of this.phaserTilemap.layers)if(E.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${E.name}' has no 'tilemapLayer'. This can happen if you call 'createLayer' with the wrong layer ID.`)}getTileWidth(){return this.phaserTilemap.tileWidth}getTileHeight(){return this.phaserTilemap.tileHeight}getWidth(){return this.phaserTilemap.width}getHeight(){return this.phaserTilemap.height}getOrientation(){return this.phaserTilemap.orientation==Phaser.Tilemaps.Orientation.ISOMETRIC.toString()?"isometric":"orthogonal"}getLayers(){return this.phaserTilemap.layers.map(S=>new P2(S.tilemapLayer,this.tiledProject))}hasTileAt(S,T,E){return!!this.phaserTilemap.hasTileAt(S,T,E)}getTileAt(S,T,E){let F=this.phaserTilemap.getTileAt(S,T,!1,E);if(F)return new Qd(F,this.tiledProject)}},kd=class Uo{constructor(T){this.scene=T,this.geHeadless=new o2(!1),this.isCreatedInternal=!1,Uo.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${Wd}`),Uo.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(T){return this.geHeadless.getCharLayer(T)}getTransition(T,E){return this.geHeadless.getTransition(T,E)}setTransition(T,E,F){this.geHeadless.setTransition(T,E,F)}create(T,E){this.geHeadless.create(new A2(T,E.tiledProject),E),this.isCreatedInternal=!0,this.gridCharacters=new Map;let F=this.setConfigDefaults(E);this.config=F,this.gridTilemap=new zo(T),this.addCharacters()}getPosition(T){return this.geHeadless.getPosition(T)}move(T,E){this.geHeadless.move(T,E)}moveRandomly(T,E=0,F=-1){this.geHeadless.moveRandomly(T,E,F)}getMovement(T){return this.geHeadless.getMovement(T)}moveTo(T,E,F){return this.geHeadless.moveTo(T,E,F)}stopMovement(T){this.geHeadless.stopMovement(T)}setSpeed(T,E){this.geHeadless.setSpeed(T,E)}getSpeed(T){return this.geHeadless.getSpeed(T)}setContainer(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);O.setContainer(E)}getContainer(T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(T);if(!F)throw this.createCharUnknownErr(T);return F.getContainer()}getOffsetX(T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(T);if(!F)throw this.createCharUnknownErr(T);return F.getOffsetX()}setOffsetX(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);O.setOffsetX(E)}getOffsetY(T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(T);if(!F)throw this.createCharUnknownErr(T);return F.getOffsetY()}setOffsetY(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);O.setOffsetY(E)}collidesWithTiles(T){return this.geHeadless.collidesWithTiles(T)}getWalkingAnimationMapping(T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(T);if(!F)throw this.createCharUnknownErr(T);let O=F.getAnimation();return O?.getWalkingAnimationMapping()}hasLayerOverlay(){var T;return this.initGuard(),!!((T=this.config)!=null&&T.layerOverlay)}setWalkingAnimationMapping(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);let D=O.getAnimation();D?.setWalkingAnimationMapping(E)}update(T,E){if(this.isCreatedInternal&&this.gridCharacters)for(let[F,O]of this.gridCharacters)O.update(E);this.geHeadless.update(T,E)}addCharacter(T){this.geHeadless.addCharacter(T),this.addCharacterInternal(T)}hasCharacter(T){return this.geHeadless.hasCharacter(T)}removeCharacter(T){var E,F;this.initGuard();let O=(E=this.gridCharacters)==null?void 0:E.get(T);if(!O)throw this.createCharUnknownErr(T);O.destroy(),(F=this.gridCharacters)==null||F.delete(T),this.geHeadless.removeCharacter(T)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let T of this.gridCharacters.keys())this.removeCharacter(T);this.geHeadless.removeAllCharacters()}}getAllCharacters(T){return this.geHeadless.getAllCharacters(T)}getLabels(T){return this.geHeadless.getLabels(T)}addLabels(T,E){this.geHeadless.addLabels(T,E)}removeLabels(T,E){this.geHeadless.removeLabels(T,E)}clearLabels(T){this.geHeadless.clearLabels(T)}follow(T,E,F,O){let D;F===void 0?D={distance:0,closestPointIfBlocked:!1}:typeof F=="number"?(D={distance:F,closestPointIfBlocked:!1},O&&(D.closestPointIfBlocked=!0)):D=F,this.geHeadless.follow(T,E,D)}isMoving(T){return this.geHeadless.isMoving(T)}getFacingDirection(T){return this.geHeadless.getFacingDirection(T)}getFacingPosition(T){return this.geHeadless.getFacingPosition(T)}turnTowards(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);O.turnTowards(E),this.geHeadless.turnTowards(T,E)}getCharactersAt(T,E){return this.geHeadless.getCharactersAt(T,E)}setPosition(T,E,F){this.geHeadless.setPosition(T,E,F)}getSprite(T){var E;this.initGuard();let F=(E=this.gridCharacters)==null?void 0:E.get(T);if(!F)throw this.createCharUnknownErr(T);return F.getSprite()}setSprite(T,E){var F;this.initGuard();let O=(F=this.gridCharacters)==null?void 0:F.get(T);if(!O)throw this.createCharUnknownErr(T);E.setOrigin(0,0),O.setSprite(E)}isBlocked(T,E,F=["geDefault"]){return this.geHeadless.isBlocked(T,E,F)}isTileBlocked(T,E){return this.geHeadless.isTileBlocked(T,E)}getCollisionGroups(T){return this.geHeadless.getCollisionGroups(T)}setCollisionGroups(T,E){this.geHeadless.setCollisionGroups(T,E)}getIgnoreCollisionGroups(T){return this.geHeadless.getIgnoreCollisionGroups(T)}setIgnoreCollisionGroups(T,E){this.geHeadless.setIgnoreCollisionGroups(T,E)}getTilePosInDirection(T,E,F){return this.geHeadless.getTilePosInDirection(T,E,F)}findShortestPath(T,E,F={}){return this.geHeadless.findShortestPath(T,E,F)}steppedOn(T,E,F){return this.geHeadless.steppedOn(T,E,F)}characterShifted(){return this.geHeadless.characterShifted()}movementStarted(){return this.geHeadless.movementStarted()}movementStopped(){return this.geHeadless.movementStopped()}directionChanged(){return this.geHeadless.directionChanged()}positionChangeStarted(){return this.geHeadless.positionChangeStarted()}positionChangeFinished(){return this.geHeadless.positionChangeFinished()}getMovementProgress(T){return this.geHeadless.getMovementProgress(T)}rebuildTileCollisionCache(T,E,F,O){this.geHeadless.rebuildTileCollisionCache(T,E,F,O)}addQueueMovements(T,E,F){this.geHeadless.addQueueMovements(T,E,F)}getEnqueuedMovements(T){return this.geHeadless.getEnqueuedMovements(T)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(T){return this.geHeadless.clearEnqueuedMovements(T)}getState(){return{characters:this.geHeadless.getState().characters.map(T=>Ki(oe({},T),{offsetX:this.getOffsetX(T.id),offsetY:this.getOffsetY(T.id)}))}}setState(T){if(this.geHeadless.setState(T),this.gridCharacters)for(let E of T.characters){let F=this.gridCharacters.get(E.id);F&&(F.setOffsetX(E.offsetX),F.setOffsetY(E.offsetY))}}getTileCost(T,E,F){return this.initGuard(),this.geHeadless.getTileCost(T,E,F)}setConfigDefaults(T){return oe({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1},T)}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var T;(T=this.config)==null||T.characters.forEach(E=>this.addCharacterInternal(E))}createCharUnknownErr(T){return new Error(`Character unknown: ${T}`)}addCharacterInternal(T){var E;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let F=new WS(T,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(E=this.gridCharacters)==null||E.set(T.id,F)}};kd.welcomeMessagePrinted=!1;var M2=kd,w2=M2;/*! Bundled license information: +}`;var Vt=Hu(function(){return kt(tt,Ft+"return "+Tt).apply(E,it)});if(Vt.source=Tt,so(Vt))throw Vt;return Vt}function px(A){return qt(A).toLowerCase()}function gx(A){return qt(A).toUpperCase()}function mx(A,F,U){if(A=qt(A),A&&(U||F===E))return _h(A);if(!A||!(F=Ye(F)))return A;var $=ui(A),q=ui(F),tt=tl($,q),it=el($,q)+1;return Hi($,tt,it).join("")}function yx(A,F,U){if(A=qt(A),A&&(U||F===E))return A.slice(0,sl(A)+1);if(!A||!(F=Ye(F)))return A;var $=ui(A),q=el($,ui(F))+1;return Hi($,0,q).join("")}function xx(A,F,U){if(A=qt(A),A&&(U||F===E))return A.replace(sa,"");if(!A||!(F=Ye(F)))return A;var $=ui(A),q=tl($,ui(F));return Hi($,q).join("")}function Tx(A,F){var U=C,$=P;if(le(F)){var q="separator"in F?F.separator:q;U="length"in F?Xt(F.length):U,$="omission"in F?Ye(F.omission):$}A=qt(A);var tt=A.length;if(ys(A)){var it=ui(A);tt=it.length}if(U>=tt)return A;var nt=U-xs($);if(nt<1)return $;var lt=it?Hi(it,0,nt).join(""):A.slice(0,nt);if(q===E)return lt+$;if(it&&(nt+=lt.length-nt),no(q)){if(A.slice(nt).search(q)){var mt,yt=lt;for(q.global||(q=Ta(q.source,qt(Sh.exec(q))+"g")),q.lastIndex=0;mt=q.exec(yt);)var Tt=mt.index;lt=lt.slice(0,Tt===E?nt:Tt)}}else if(A.indexOf(Ye(q),nt)!=nt){var Mt=lt.lastIndexOf(q);Mt>-1&&(lt=lt.slice(0,Mt))}return lt+$}function Sx(A){return A=qt(A),A&&Dc.test(A)?A.replace(yh,Qv):A}var Cx=As(function(A,F,U){return A+(U?" ":"")+F.toUpperCase()}),oo=Kl("toUpperCase");function Yu(A,F,U){return A=qt(A),F=U?E:F,F===E?Kv(A)?_v(A):Nv(A):A.match(F)||[]}var Hu=Wt(function(A,F){try{return Ve(A,E,F)}catch(U){return so(U)?U:new Nt(U)}}),Ex=Ri(function(A,F){return Qe(F,function(U){U=mi(U),Mi(A,U,eo(A[U],A))}),A});function Px(A){var F=A==null?0:A.length,U=Ot();return A=F?oe(A,function($){if(typeof $[1]!="function")throw new ke(c);return[U($[0]),$[1]]}):[],Wt(function($){for(var q=-1;++qG)return[];var U=j,$=Re(A,j);F=Ot(F),A-=j;for(var q=ma($,F);++U0||F<0)?new Kt(U):(A<0?U=U.takeRight(-A):A&&(U=U.drop(A)),F!==E&&(F=Xt(F),U=F<0?U.dropRight(-F):U.take(F-A)),U)},Kt.prototype.takeRightWhile=function(A){return this.reverse().takeWhile(A).reverse()},Kt.prototype.toArray=function(){return this.take(j)},pi(Kt.prototype,function(A,F){var U=/^(?:filter|find|map|reject)|While$/.test(F),$=/^(?:head|last)$/.test(F),q=_[$?"take"+(F=="last"?"Right":""):F],tt=$||/^find/.test(F);q&&(_.prototype[F]=function(){var it=this.__wrapped__,nt=$?[1]:arguments,lt=it instanceof Kt,mt=nt[0],yt=lt||Gt(it),Tt=function(Ht){var $t=q.apply(_,Gi([Ht],nt));return $&&Mt?$t[0]:$t};yt&&U&&typeof mt=="function"&&mt.length!=1&&(lt=yt=!1);var Mt=this.__chain__,Ft=!!this.__actions__.length,Dt=tt&&!Mt,Vt=lt&&!Ft;if(!tt&&yt){it=Vt?it:new Kt(this);var It=A.apply(it,nt);return It.__actions__.push({func:er,args:[Tt],thisArg:E}),new qe(It,Mt)}return Dt&&Vt?A.apply(this,nt):(It=this.thru(Tt),Dt?$?It.value()[0]:It.value():It)})}),Qe(["pop","push","shift","sort","splice","unshift"],function(A){var F=wn[A],U=/^(?:push|sort|unshift)$/.test(A)?"tap":"thru",$=/^(?:pop|shift)$/.test(A);_.prototype[A]=function(){var q=arguments;if($&&!this.__chain__){var tt=this.value();return F.apply(Gt(tt)?tt:[],q)}return this[U](function(it){return F.apply(Gt(it)?it:[],q)})}}),pi(Kt.prototype,function(A,F){var U=_[F];if(U){var $=U.name+"";_t.call(Cs,$)||(Cs[$]=[]),Cs[$].push({name:F,func:U})}}),Cs[Zn(E,s).name]=[{name:"wrapper",func:E}],Kt.prototype.clone=Sp,Kt.prototype.reverse=Cp,Kt.prototype.value=Ep,_.prototype.at=qg,_.prototype.chain=_g,_.prototype.commit=tm,_.prototype.next=em,_.prototype.plant=sm,_.prototype.reverse=nm,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=rm,_.prototype.first=_.prototype.head,Vs&&(_.prototype[Vs]=im),_},Ui=tp();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Ce._=Ui,define(function(){return Ui})):qi?((qi.exports=Ui)._=Ui,la._=Ui):Ce._=Ui}).call(S)}),Jd=class extends Set{constructor(S,T=!1){super(S),this.valuesAsFlags=T}};function un(S){if(S instanceof Map)return Object.fromEntries([...S.entries()].map(([T,E])=>[T,un(E)]));if(S instanceof Set)return Array.from(S.values()).map(un);if(S instanceof Jd)return{values:[...S.values()],valuesAsFlags:S.valuesAsFlags};if(typeof S=="object"){let T={};return Object.entries(S).forEach(([E,R])=>{T[E]=un(R)}),T}else return S}lh(uh(),1);var x2=lh(uh(),1);function us(S,T){if(typeof S!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(S)}`);if(typeof T!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(T)}`);let E=(0,x2.cloneDeep)(S);for(let[R,O]of Object.entries(T))typeof O!="object"||O instanceof Set||E[R]===void 0?E[R]=O:E[R]=us(E[R],O);return E}function Qd(S,T){if(!(S===void 0||typeof S!="object"))for(let E of Object.keys(S)){if(E===T)return S[E];let R=S[E];if(typeof R=="object"){let O=Qd(R,T);if(O!==void 0)return O}}}var So="@composite:",T2="@inherit:",S2=class{constructor(S,T,E){this.tiledClassToMembersMap=S,this.enumNameToValuesMap=T,this.parserOptions=E,this.memoiser=new Map}flattenMembers(S,T){return this.memoiser.has(S)?{[S]:this.memoiser.get(S)}:(this.memoiser.set(S,T.reduce((E,R)=>he(he({},E),this.flattenMemberProperty(R)),{})),{[S]:this.memoiser.get(S)})}flattenMemberProperty(S){var T;let E=(T=S.propertyType)!=null?T:S.propertytype;if(S.type==="class"){if(!this.memoiser.has(E)){let D=this.tiledClassToMembersMap.get(E).reduce((c,m)=>us(this.flattenMemberProperty(m),c),{});this.memoiser.set(E,D)}let R=this.memoiser.get(E),O=us(R,this.flattenValue(S.value,R));return this.checkIfShouldFlatten(S.name)?O:{[S.name.replace(So,"")]:O}}else return this.enumNameToValuesMap.has(E)?this.enumNameToValuesMap.get(E).valuesAsFlags?{[S.name]:new Set(S.value.split(",").filter(R=>R!==""))}:{[S.name]:S.value}:{[S.name]:S.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(S,T){return Object.entries(S).reduce((E,[R,O])=>{if(typeof O!="object")return Qd(T,R)instanceof Set?us({[R]:new Set(O.split(",").filter(D=>D!==""))},E):us({[R]:O},E);if(this.checkIfShouldFlatten(R))return us(this.flattenValue(O,T),E);{let D=R.replace(So,"");return us({[D]:this.flattenValue(O,T)},E)}},{})}checkIfShouldFlatten(S){var T;return((T=this.parserOptions)==null?void 0:T.defaultComposite)===!0?S.startsWith(T2):!S.startsWith(So)}},Tf=lh(uh(),1),C2=class{constructor(S){this.flattener=S}flattenPropertiesOnObject(S){var T,E,R,O;return Ji(he(he({},this.flattener.memoisedFlattenedProperties.get((T=S.class)!=null?T:S.type)),(E=S.properties)==null?void 0:E.reduce((D,c)=>he(he({},D),this.flattener.flattenMemberProperty(c)),{})),{name:S.name,id:S.id,class:(O=(R=S.class)!=null?R:S.type)!=null?O:null,x:S.x,y:S.y})}flattenPropertiesOnTile(S){var T,E,R,O;return Ji(he(he({},this.flattener.memoisedFlattenedProperties.get((T=S.class)!=null?T:S.type)),(E=S.properties)==null?void 0:E.reduce((D,c)=>he(he({},D),this.flattener.flattenMemberProperty(c)),{})),{id:S.id,class:(O=(R=S.class)!=null?R:S.type)!=null?O:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([S,T])=>[S,(0,Tf.cloneDeep)(T)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([S,T])=>[S,(0,Tf.cloneDeep)(T)]))}toJSON(){return JSON.stringify({customTypes:un(this.getCustomTypesMap()),enums:un(this.getEnumsMap())},null,4)}};function E2(S,T){let E=new Map(S.propertyTypes.filter(D=>D.type==="enum").map(D=>[D.name,new Jd(D.values,D.valuesAsFlags)])),R=new Map(S.propertyTypes.filter(D=>D.type==="class").map(D=>[D.name,D.members])),O=new S2(R,E,T);return R.forEach((D,c)=>{O.flattenMembers(c,D)}),new C2(O)}var P2={parse:E2},kd=class{constructor(S,T){this.phaserTile=S,this.tiledProject=T}getProperty(S){var T,E;let R={};if(this.tiledProject){let O=P2.parse(this.tiledProject),D=this.getType();if(D){let c=(T=O.getCustomTypesMap())==null?void 0:T.get(D);if(c)for(let[m,t]of Object.entries(c))R[m]=t}}return(E=this.phaserTile.properties[S])!=null?E:R[S]}hasProperty(S){return this.getProperty(S)!=null}getType(){var S,T;return(T=(S=this.phaserTile.tileset)==null?void 0:S.tileData[this.phaserTile.index-1])==null?void 0:T.type}},A2=class{constructor(S,T){this.phaserTilemapLayer=S,this.tiledProject=T}getName(){return this.phaserTilemapLayer.layer.name}getProperty(S){let T=this.phaserTilemapLayer.layer.properties,E=T?.find(R=>R.name==S);return E?.value}hasProperty(S){return this.getProperty(S)!=null}isCharLayer(){return this.hasProperty(gr)}getData(){return this.phaserTilemapLayer.layer.data.map(S=>S.map(T=>new kd(T,this.tiledProject)))}},M2=class{constructor(S,T){this.phaserTilemap=S,this.tiledProject=T;for(let E of this.phaserTilemap.layers)if(E.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${E.name}' has no 'tilemapLayer'. This can happen if you call 'createLayer' with the wrong layer ID.`)}getTileWidth(){return this.phaserTilemap.tileWidth}getTileHeight(){return this.phaserTilemap.tileHeight}getWidth(){return this.phaserTilemap.width}getHeight(){return this.phaserTilemap.height}getOrientation(){return this.phaserTilemap.orientation==Phaser.Tilemaps.Orientation.ISOMETRIC.toString()?"isometric":"orthogonal"}getLayers(){return this.phaserTilemap.layers.map(S=>new A2(S.tilemapLayer,this.tiledProject))}hasTileAt(S,T,E){return!!this.phaserTilemap.hasTileAt(S,T,E)}getTileAt(S,T,E){let R=this.phaserTilemap.getTileAt(S,T,!1,E);if(R)return new kd(R,this.tiledProject)}},qd=class zo{constructor(T){this.scene=T,this.geHeadless=new h2(!1),this.isCreatedInternal=!1,zo.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${Yd}`),zo.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(T){return this.geHeadless.getCharLayer(T)}getTransition(T,E){return this.geHeadless.getTransition(T,E)}setTransition(T,E,R){this.geHeadless.setTransition(T,E,R)}create(T,E){this.geHeadless.create(new M2(T,E.tiledProject),E),this.isCreatedInternal=!0,this.gridCharacters=new Map;let R=this.setConfigDefaults(E);this.config=R,this.gridTilemap=new Go(T),this.addCharacters()}getPosition(T){return this.geHeadless.getPosition(T)}move(T,E){this.geHeadless.move(T,E)}moveRandomly(T,E=0,R=-1){this.geHeadless.moveRandomly(T,E,R)}getMovement(T){return this.geHeadless.getMovement(T)}moveTo(T,E,R){return this.geHeadless.moveTo(T,E,R)}stopMovement(T){this.geHeadless.stopMovement(T)}setSpeed(T,E){this.geHeadless.setSpeed(T,E)}getSpeed(T){return this.geHeadless.getSpeed(T)}setContainer(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);O.setContainer(E)}getContainer(T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(T);if(!R)throw this.createCharUnknownErr(T);return R.getContainer()}getOffsetX(T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(T);if(!R)throw this.createCharUnknownErr(T);return R.getOffsetX()}setOffsetX(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);O.setOffsetX(E)}getOffsetY(T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(T);if(!R)throw this.createCharUnknownErr(T);return R.getOffsetY()}setOffsetY(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);O.setOffsetY(E)}collidesWithTiles(T){return this.geHeadless.collidesWithTiles(T)}getWalkingAnimationMapping(T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(T);if(!R)throw this.createCharUnknownErr(T);let O=R.getAnimation();return O?.getWalkingAnimationMapping()}hasLayerOverlay(){var T;return this.initGuard(),!!((T=this.config)!=null&&T.layerOverlay)}setWalkingAnimationMapping(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);let D=O.getAnimation();D?.setWalkingAnimationMapping(E)}update(T,E){if(this.isCreatedInternal&&this.gridCharacters)for(let[R,O]of this.gridCharacters)O.update(E);this.geHeadless.update(T,E)}addCharacter(T){this.geHeadless.addCharacter(T),this.addCharacterInternal(T)}hasCharacter(T){return this.geHeadless.hasCharacter(T)}removeCharacter(T){var E,R;this.initGuard();let O=(E=this.gridCharacters)==null?void 0:E.get(T);if(!O)throw this.createCharUnknownErr(T);O.destroy(),(R=this.gridCharacters)==null||R.delete(T),this.geHeadless.removeCharacter(T)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let T of this.gridCharacters.keys())this.removeCharacter(T);this.geHeadless.removeAllCharacters()}}getAllCharacters(T){return this.geHeadless.getAllCharacters(T)}getLabels(T){return this.geHeadless.getLabels(T)}addLabels(T,E){this.geHeadless.addLabels(T,E)}removeLabels(T,E){this.geHeadless.removeLabels(T,E)}clearLabels(T){this.geHeadless.clearLabels(T)}follow(T,E,R,O){let D;R===void 0?D={distance:0,closestPointIfBlocked:!1}:typeof R=="number"?(D={distance:R,closestPointIfBlocked:!1},O&&(D.closestPointIfBlocked=!0)):D=R,this.geHeadless.follow(T,E,D)}isMoving(T){return this.geHeadless.isMoving(T)}getFacingDirection(T){return this.geHeadless.getFacingDirection(T)}getFacingPosition(T){return this.geHeadless.getFacingPosition(T)}turnTowards(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);O.turnTowards(E),this.geHeadless.turnTowards(T,E)}getCharactersAt(T,E){return this.geHeadless.getCharactersAt(T,E)}setPosition(T,E,R){this.geHeadless.setPosition(T,E,R)}getSprite(T){var E;this.initGuard();let R=(E=this.gridCharacters)==null?void 0:E.get(T);if(!R)throw this.createCharUnknownErr(T);return R.getSprite()}setSprite(T,E){var R;this.initGuard();let O=(R=this.gridCharacters)==null?void 0:R.get(T);if(!O)throw this.createCharUnknownErr(T);E.setOrigin(0,0),O.setSprite(E)}isBlocked(T,E,R=["geDefault"]){return this.geHeadless.isBlocked(T,E,R)}isTileBlocked(T,E){return this.geHeadless.isTileBlocked(T,E)}getCollisionGroups(T){return this.geHeadless.getCollisionGroups(T)}setCollisionGroups(T,E){this.geHeadless.setCollisionGroups(T,E)}getIgnoreCollisionGroups(T){return this.geHeadless.getIgnoreCollisionGroups(T)}setIgnoreCollisionGroups(T,E){this.geHeadless.setIgnoreCollisionGroups(T,E)}getTilePosInDirection(T,E,R){return this.geHeadless.getTilePosInDirection(T,E,R)}findShortestPath(T,E,R={}){return this.geHeadless.findShortestPath(T,E,R)}steppedOn(T,E,R){return this.geHeadless.steppedOn(T,E,R)}characterShifted(){return this.geHeadless.characterShifted()}movementStarted(){return this.geHeadless.movementStarted()}movementStopped(){return this.geHeadless.movementStopped()}directionChanged(){return this.geHeadless.directionChanged()}positionChangeStarted(){return this.geHeadless.positionChangeStarted()}positionChangeFinished(){return this.geHeadless.positionChangeFinished()}getMovementProgress(T){return this.geHeadless.getMovementProgress(T)}rebuildTileCollisionCache(T,E,R,O){this.geHeadless.rebuildTileCollisionCache(T,E,R,O)}addQueueMovements(T,E,R){this.geHeadless.addQueueMovements(T,E,R)}getEnqueuedMovements(T){return this.geHeadless.getEnqueuedMovements(T)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(T){return this.geHeadless.clearEnqueuedMovements(T)}getState(){return{characters:this.geHeadless.getState().characters.map(T=>Ji(he({},T),{offsetX:this.getOffsetX(T.id),offsetY:this.getOffsetY(T.id)}))}}setState(T){if(this.geHeadless.setState(T),this.gridCharacters)for(let E of T.characters){let R=this.gridCharacters.get(E.id);R&&(R.setOffsetX(E.offsetX),R.setOffsetY(E.offsetY))}}getTileCost(T,E,R){return this.initGuard(),this.geHeadless.getTileCost(T,E,R)}setConfigDefaults(T){return he({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1},T)}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var T;(T=this.config)==null||T.characters.forEach(E=>this.addCharacterInternal(E))}createCharUnknownErr(T){return new Error(`Character unknown: ${T}`)}addCharacterInternal(T){var E;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let R=new YS(T,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(E=this.gridCharacters)==null||E.set(T.id,R)}};qd.welcomeMessagePrinted=!1;var w2=qd,R2=w2;/*! Bundled license information: tiled-property-flattener/dist/tiled_property_flattener.min.js: (*! Bundled license information: @@ -6396,14 +6396,14 @@ tiled-property-flattener/dist/tiled_property_flattener.min.js: * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) *) -*/class os{constructor(T,E=4){this.bounds=T,this.capacity=E,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:T,yMin:E,xMax:F,yMax:O}=this.bounds,D=(F-T)/2,c=(O-E)/2,m=T,t=E;this.northeast=new os({xMin:m+D,xMax:m+2*D,yMin:E,yMax:t+c},this.capacity),this.northwest=new os({xMin:T,xMax:m+D,yMin:E,yMax:t+c},this.capacity),this.southeast=new os({xMin:m+D,xMax:m+2*D,yMin:t+c,yMax:t+2*c},this.capacity),this.southwest=new os({xMin:T,xMax:m+D,yMin:t+c,yMax:t+2*c},this.capacity),this.divided=!0}insert(T){return this.contains(T.bounds)?this.points.length=E&&T.xMax<=O&&T.yMin>=F&&T.yMax<=D}generateCacheKey(T){const{xMin:E,xMax:F,yMin:O,yMax:D}=T;return`${E},${F},${O},${D}`}queryRange(T,E=[]){if(!this.intersects(T))return E;for(const F of this.points)this.isWithinBounds(F.bounds,T)&&E.push(F);return this.divided&&(this.northwest?.queryRange(T,E),this.northeast?.queryRange(T,E),this.southwest?.queryRange(T,E),this.southeast?.queryRange(T,E)),E}query(T,E=[]){const F=`${T.x},${T.y}`,O=this.cache.get(F);if(O)return O;if(!this.intersects({xMin:T.x,xMax:T.x,yMin:T.y,yMax:T.y}))return E;for(const D of this.points)this.isWithinRange(T,D.bounds)&&E.push(D);return this.divided&&(this.northwest?.query(T,E),this.northeast?.query(T,E),this.southwest?.query(T,E),this.southeast?.query(T,E)),this.cache.set(F,E),E}intersects(T){const{xMin:E,yMin:F,xMax:O,yMax:D}=this.bounds;return!(T.xMin>O||T.xMaxD||T.yMax=E.xMin&&T.xMin<=E.xMax&&T.yMax>=E.yMin&&T.yMin<=E.yMax}isWithinRange(T,E){return T.x>=E.xMin&&T.x<=E.xMax&&T.y>=E.yMin&&T.y<=E.yMax}}class R2{constructor(){this.events={}}on(T,E){this.events[T]||(this.events[T]=[]),this.events[T]?.push(E)}off(T,E){this.events[T]&&(this.events[T]=this.events[T]?.filter(F=>F!==E))}emit(T,E){this.events[T]&&this.events[T]?.forEach(F=>F(E))}}const Jt=new R2;function F2(S,T,E){let F=new Set([...T,void 0]);return S.listen((O,D)=>{F.has(D)&&E(O,D)})}function qd(S,T){return function(){return S.apply(T,arguments)}}const{toString:L2}=Object.prototype,{getPrototypeOf:dh}=Object,kr=(S=>T=>{const E=L2.call(T);return S[E]||(S[E]=E.slice(8,-1).toLowerCase())})(Object.create(null)),mi=S=>(S=S.toLowerCase(),T=>kr(T)===S),qr=S=>T=>typeof T===S,{isArray:bs}=Array,cn=qr("undefined");function O2(S){return S!==null&&!cn(S)&&S.constructor!==null&&!cn(S.constructor)&&ii(S.constructor.isBuffer)&&S.constructor.isBuffer(S)}const _d=mi("ArrayBuffer");function D2(S){let T;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?T=ArrayBuffer.isView(S):T=S&&S.buffer&&_d(S.buffer),T}const I2=qr("string"),ii=qr("function"),tc=qr("number"),_r=S=>S!==null&&typeof S=="object",B2=S=>S===!0||S===!1,gr=S=>{if(kr(S)!=="object")return!1;const T=dh(S);return(T===null||T===Object.prototype||Object.getPrototypeOf(T)===null)&&!(Symbol.toStringTag in S)&&!(Symbol.iterator in S)},b2=mi("Date"),N2=mi("File"),G2=mi("Blob"),z2=mi("FileList"),U2=S=>_r(S)&&ii(S.pipe),X2=S=>{let T;return S&&(typeof FormData=="function"&&S instanceof FormData||ii(S.append)&&((T=kr(S))==="formdata"||T==="object"&&ii(S.toString)&&S.toString()==="[object FormData]"))},V2=mi("URLSearchParams"),W2=S=>S.trim?S.trim():S.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mn(S,T,{allOwnKeys:E=!1}={}){if(S===null||typeof S>"u")return;let F,O;if(typeof S!="object"&&(S=[S]),bs(S))for(F=0,O=S.length;F0;)if(O=E[F],T===O.toLowerCase())return O;return null}const ic=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sc=S=>!cn(S)&&S!==ic;function Xo(){const{caseless:S}=sc(this)&&this||{},T={},E=(F,O)=>{const D=S&&ec(T,O)||O;gr(T[D])&&gr(F)?T[D]=Xo(T[D],F):gr(F)?T[D]=Xo({},F):bs(F)?T[D]=F.slice():T[D]=F};for(let F=0,O=arguments.length;F(mn(T,(O,D)=>{E&&ii(O)?S[D]=qd(O,E):S[D]=O},{allOwnKeys:F}),S),H2=S=>(S.charCodeAt(0)===65279&&(S=S.slice(1)),S),K2=(S,T,E,F)=>{S.prototype=Object.create(T.prototype,F),S.prototype.constructor=S,Object.defineProperty(S,"super",{value:T.prototype}),E&&Object.assign(S.prototype,E)},j2=(S,T,E,F)=>{let O,D,c;const m={};if(T=T||{},S==null)return T;do{for(O=Object.getOwnPropertyNames(S),D=O.length;D-- >0;)c=O[D],(!F||F(c,S,T))&&!m[c]&&(T[c]=S[c],m[c]=!0);S=E!==!1&&dh(S)}while(S&&(!E||E(S,T))&&S!==Object.prototype);return T},$2=(S,T,E)=>{S=String(S),(E===void 0||E>S.length)&&(E=S.length),E-=T.length;const F=S.indexOf(T,E);return F!==-1&&F===E},Z2=S=>{if(!S)return null;if(bs(S))return S;let T=S.length;if(!tc(T))return null;const E=new Array(T);for(;T-- >0;)E[T]=S[T];return E},J2=(S=>T=>S&&T instanceof S)(typeof Uint8Array<"u"&&dh(Uint8Array)),Q2=(S,T)=>{const F=(S&&S[Symbol.iterator]).call(S);let O;for(;(O=F.next())&&!O.done;){const D=O.value;T.call(S,D[0],D[1])}},k2=(S,T)=>{let E;const F=[];for(;(E=S.exec(T))!==null;)F.push(E);return F},q2=mi("HTMLFormElement"),_2=S=>S.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(E,F,O){return F.toUpperCase()+O}),Sf=(({hasOwnProperty:S})=>(T,E)=>S.call(T,E))(Object.prototype),tC=mi("RegExp"),nc=(S,T)=>{const E=Object.getOwnPropertyDescriptors(S),F={};mn(E,(O,D)=>{let c;(c=T(O,D,S))!==!1&&(F[D]=c||O)}),Object.defineProperties(S,F)},eC=S=>{nc(S,(T,E)=>{if(ii(S)&&["arguments","caller","callee"].indexOf(E)!==-1)return!1;const F=S[E];if(ii(F)){if(T.enumerable=!1,"writable"in T){T.writable=!1;return}T.set||(T.set=()=>{throw Error("Can not rewrite read-only method '"+E+"'")})}})},iC=(S,T)=>{const E={},F=O=>{O.forEach(D=>{E[D]=!0})};return bs(S)?F(S):F(String(S).split(T)),E},sC=()=>{},nC=(S,T)=>(S=+S,Number.isFinite(S)?S:T),Eo="abcdefghijklmnopqrstuvwxyz",Cf="0123456789",rc={DIGIT:Cf,ALPHA:Eo,ALPHA_DIGIT:Eo+Eo.toUpperCase()+Cf},rC=(S=16,T=rc.ALPHA_DIGIT)=>{let E="";const{length:F}=T;for(;S--;)E+=T[Math.random()*F|0];return E};function aC(S){return!!(S&&ii(S.append)&&S[Symbol.toStringTag]==="FormData"&&S[Symbol.iterator])}const oC=S=>{const T=new Array(10),E=(F,O)=>{if(_r(F)){if(T.indexOf(F)>=0)return;if(!("toJSON"in F)){T[O]=F;const D=bs(F)?[]:{};return mn(F,(c,m)=>{const t=E(c,O+1);!cn(t)&&(D[m]=t)}),T[O]=void 0,D}}return F};return E(S,0)},hC=mi("AsyncFunction"),lC=S=>S&&(_r(S)||ii(S))&&ii(S.then)&&ii(S.catch),yt={isArray:bs,isArrayBuffer:_d,isBuffer:O2,isFormData:X2,isArrayBufferView:D2,isString:I2,isNumber:tc,isBoolean:B2,isObject:_r,isPlainObject:gr,isUndefined:cn,isDate:b2,isFile:N2,isBlob:G2,isRegExp:tC,isFunction:ii,isStream:U2,isURLSearchParams:V2,isTypedArray:J2,isFileList:z2,forEach:mn,merge:Xo,extend:Y2,trim:W2,stripBOM:H2,inherits:K2,toFlatObject:j2,kindOf:kr,kindOfTest:mi,endsWith:$2,toArray:Z2,forEachEntry:Q2,matchAll:k2,isHTMLForm:q2,hasOwnProperty:Sf,hasOwnProp:Sf,reduceDescriptors:nc,freezeMethods:eC,toObjectSet:iC,toCamelCase:_2,noop:sC,toFiniteNumber:nC,findKey:ec,global:ic,isContextDefined:sc,ALPHABET:rc,generateString:rC,isSpecCompliantForm:aC,toJSONObject:oC,isAsyncFn:hC,isThenable:lC};function Zt(S,T,E,F,O){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=S,this.name="AxiosError",T&&(this.code=T),E&&(this.config=E),F&&(this.request=F),O&&(this.response=O)}yt.inherits(Zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:yt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const ac=Zt.prototype,oc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(S=>{oc[S]={value:S}});Object.defineProperties(Zt,oc);Object.defineProperty(ac,"isAxiosError",{value:!0});Zt.from=(S,T,E,F,O,D)=>{const c=Object.create(ac);return yt.toFlatObject(S,c,function(t){return t!==Error.prototype},m=>m!=="isAxiosError"),Zt.call(c,S.message,T,E,F,O),c.cause=S,c.name=S.name,D&&Object.assign(c,D),c};const uC=null;function Vo(S){return yt.isPlainObject(S)||yt.isArray(S)}function hc(S){return yt.endsWith(S,"[]")?S.slice(0,-2):S}function Ef(S,T,E){return S?S.concat(T).map(function(O,D){return O=hc(O),!E&&D?"["+O+"]":O}).join(E?".":""):T}function fC(S){return yt.isArray(S)&&!S.some(Vo)}const dC=yt.toFlatObject(yt,{},null,function(T){return/^is[A-Z]/.test(T)});function ta(S,T,E){if(!yt.isObject(S))throw new TypeError("target must be an object");T=T||new FormData,E=yt.toFlatObject(E,{metaTokens:!0,dots:!1,indexes:!1},!1,function(i,h){return!yt.isUndefined(h[i])});const F=E.metaTokens,O=E.visitor||v,D=E.dots,c=E.indexes,t=(E.Blob||typeof Blob<"u"&&Blob)&&yt.isSpecCompliantForm(T);if(!yt.isFunction(O))throw new TypeError("visitor must be a function");function o(e){if(e===null)return"";if(yt.isDate(e))return e.toISOString();if(!t&&yt.isBlob(e))throw new Zt("Blob is not supported. Use a Buffer instead.");return yt.isArrayBuffer(e)||yt.isTypedArray(e)?t&&typeof Blob=="function"?new Blob([e]):Buffer.from(e):e}function v(e,i,h){let s=e;if(e&&!h&&typeof e=="object"){if(yt.endsWith(i,"{}"))i=F?i:i.slice(0,-2),e=JSON.stringify(e);else if(yt.isArray(e)&&fC(e)||(yt.isFileList(e)||yt.endsWith(i,"[]"))&&(s=yt.toArray(e)))return i=hc(i),s.forEach(function(f,u){!(yt.isUndefined(f)||f===null)&&T.append(c===!0?Ef([i],u,D):c===null?i:i+"[]",o(f))}),!1}return Vo(e)?!0:(T.append(Ef(h,i,D),o(e)),!1)}const a=[],r=Object.assign(dC,{defaultVisitor:v,convertValue:o,isVisitable:Vo});function n(e,i){if(!yt.isUndefined(e)){if(a.indexOf(e)!==-1)throw Error("Circular reference detected in "+i.join("."));a.push(e),yt.forEach(e,function(s,l){(!(yt.isUndefined(s)||s===null)&&O.call(T,s,yt.isString(l)?l.trim():l,i,r))===!0&&n(s,i?i.concat(l):[l])}),a.pop()}}if(!yt.isObject(S))throw new TypeError("data must be an object");return n(S),T}function Pf(S){const T={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(S).replace(/[!'()~]|%20|%00/g,function(F){return T[F]})}function ch(S,T){this._pairs=[],S&&ta(S,this,T)}const lc=ch.prototype;lc.append=function(T,E){this._pairs.push([T,E])};lc.toString=function(T){const E=T?function(F){return T.call(this,F,Pf)}:Pf;return this._pairs.map(function(O){return E(O[0])+"="+E(O[1])},"").join("&")};function cC(S){return encodeURIComponent(S).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function uc(S,T,E){if(!T)return S;const F=E&&E.encode||cC,O=E&&E.serialize;let D;if(O?D=O(T,E):D=yt.isURLSearchParams(T)?T.toString():new ch(T,E).toString(F),D){const c=S.indexOf("#");c!==-1&&(S=S.slice(0,c)),S+=(S.indexOf("?")===-1?"?":"&")+D}return S}class Af{constructor(){this.handlers=[]}use(T,E,F){return this.handlers.push({fulfilled:T,rejected:E,synchronous:F?F.synchronous:!1,runWhen:F?F.runWhen:null}),this.handlers.length-1}eject(T){this.handlers[T]&&(this.handlers[T]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(T){yt.forEach(this.handlers,function(F){F!==null&&T(F)})}}const fc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vC=typeof URLSearchParams<"u"?URLSearchParams:ch,pC=typeof FormData<"u"?FormData:null,gC=typeof Blob<"u"?Blob:null,mC={isBrowser:!0,classes:{URLSearchParams:vC,FormData:pC,Blob:gC},protocols:["http","https","file","blob","url","data"]},dc=typeof window<"u"&&typeof document<"u",xC=(S=>dc&&["ReactNative","NativeScript","NS"].indexOf(S)<0)(typeof navigator<"u"&&navigator.product),yC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:dc,hasStandardBrowserEnv:xC,hasStandardBrowserWebWorkerEnv:yC},Symbol.toStringTag,{value:"Module"})),gi={...TC,...mC};function SC(S,T){return ta(S,new gi.classes.URLSearchParams,Object.assign({visitor:function(E,F,O,D){return gi.isNode&&yt.isBuffer(E)?(this.append(F,E.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)}},T))}function CC(S){return yt.matchAll(/\w+|\[(\w*)]/g,S).map(T=>T[0]==="[]"?"":T[1]||T[0])}function EC(S){const T={},E=Object.keys(S);let F;const O=E.length;let D;for(F=0;F=E.length;return c=!c&&yt.isArray(O)?O.length:c,t?(yt.hasOwnProp(O,c)?O[c]=[O[c],F]:O[c]=F,!m):((!O[c]||!yt.isObject(O[c]))&&(O[c]=[]),T(E,F,O[c],D)&&yt.isArray(O[c])&&(O[c]=EC(O[c])),!m)}if(yt.isFormData(S)&&yt.isFunction(S.entries)){const E={};return yt.forEachEntry(S,(F,O)=>{T(CC(F),O,E,0)}),E}return null}function PC(S,T,E){if(yt.isString(S))try{return(T||JSON.parse)(S),yt.trim(S)}catch(F){if(F.name!=="SyntaxError")throw F}return(E||JSON.stringify)(S)}const vh={transitional:fc,adapter:["xhr","http"],transformRequest:[function(T,E){const F=E.getContentType()||"",O=F.indexOf("application/json")>-1,D=yt.isObject(T);if(D&&yt.isHTMLForm(T)&&(T=new FormData(T)),yt.isFormData(T))return O?JSON.stringify(cc(T)):T;if(yt.isArrayBuffer(T)||yt.isBuffer(T)||yt.isStream(T)||yt.isFile(T)||yt.isBlob(T))return T;if(yt.isArrayBufferView(T))return T.buffer;if(yt.isURLSearchParams(T))return E.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),T.toString();let m;if(D){if(F.indexOf("application/x-www-form-urlencoded")>-1)return SC(T,this.formSerializer).toString();if((m=yt.isFileList(T))||F.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ta(m?{"files[]":T}:T,t&&new t,this.formSerializer)}}return D||O?(E.setContentType("application/json",!1),PC(T)):T}],transformResponse:[function(T){const E=this.transitional||vh.transitional,F=E&&E.forcedJSONParsing,O=this.responseType==="json";if(T&&yt.isString(T)&&(F&&!this.responseType||O)){const c=!(E&&E.silentJSONParsing)&&O;try{return JSON.parse(T)}catch(m){if(c)throw m.name==="SyntaxError"?Zt.from(m,Zt.ERR_BAD_RESPONSE,this,null,this.response):m}}return T}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gi.classes.FormData,Blob:gi.classes.Blob},validateStatus:function(T){return T>=200&&T<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yt.forEach(["delete","get","head","post","put","patch"],S=>{vh.headers[S]={}});const ph=vh,AC=yt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),MC=S=>{const T={};let E,F,O;return S&&S.split(` -`).forEach(function(c){O=c.indexOf(":"),E=c.substring(0,O).trim().toLowerCase(),F=c.substring(O+1).trim(),!(!E||T[E]&&AC[E])&&(E==="set-cookie"?T[E]?T[E].push(F):T[E]=[F]:T[E]=T[E]?T[E]+", "+F:F)}),T},Mf=Symbol("internals");function _s(S){return S&&String(S).trim().toLowerCase()}function mr(S){return S===!1||S==null?S:yt.isArray(S)?S.map(mr):String(S)}function wC(S){const T=Object.create(null),E=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let F;for(;F=E.exec(S);)T[F[1]]=F[2];return T}const RC=S=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(S.trim());function Po(S,T,E,F,O){if(yt.isFunction(F))return F.call(this,T,E);if(O&&(T=E),!!yt.isString(T)){if(yt.isString(F))return T.indexOf(F)!==-1;if(yt.isRegExp(F))return F.test(T)}}function FC(S){return S.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(T,E,F)=>E.toUpperCase()+F)}function LC(S,T){const E=yt.toCamelCase(" "+T);["get","set","has"].forEach(F=>{Object.defineProperty(S,F+E,{value:function(O,D,c){return this[F].call(this,T,O,D,c)},configurable:!0})})}class ea{constructor(T){T&&this.set(T)}set(T,E,F){const O=this;function D(m,t,o){const v=_s(t);if(!v)throw new Error("header name must be a non-empty string");const a=yt.findKey(O,v);(!a||O[a]===void 0||o===!0||o===void 0&&O[a]!==!1)&&(O[a||t]=mr(m))}const c=(m,t)=>yt.forEach(m,(o,v)=>D(o,v,t));return yt.isPlainObject(T)||T instanceof this.constructor?c(T,E):yt.isString(T)&&(T=T.trim())&&!RC(T)?c(MC(T),E):T!=null&&D(E,T,F),this}get(T,E){if(T=_s(T),T){const F=yt.findKey(this,T);if(F){const O=this[F];if(!E)return O;if(E===!0)return wC(O);if(yt.isFunction(E))return E.call(this,O,F);if(yt.isRegExp(E))return E.exec(O);throw new TypeError("parser must be boolean|regexp|function")}}}has(T,E){if(T=_s(T),T){const F=yt.findKey(this,T);return!!(F&&this[F]!==void 0&&(!E||Po(this,this[F],F,E)))}return!1}delete(T,E){const F=this;let O=!1;function D(c){if(c=_s(c),c){const m=yt.findKey(F,c);m&&(!E||Po(F,F[m],m,E))&&(delete F[m],O=!0)}}return yt.isArray(T)?T.forEach(D):D(T),O}clear(T){const E=Object.keys(this);let F=E.length,O=!1;for(;F--;){const D=E[F];(!T||Po(this,this[D],D,T,!0))&&(delete this[D],O=!0)}return O}normalize(T){const E=this,F={};return yt.forEach(this,(O,D)=>{const c=yt.findKey(F,D);if(c){E[c]=mr(O),delete E[D];return}const m=T?FC(D):String(D).trim();m!==D&&delete E[D],E[m]=mr(O),F[m]=!0}),this}concat(...T){return this.constructor.concat(this,...T)}toJSON(T){const E=Object.create(null);return yt.forEach(this,(F,O)=>{F!=null&&F!==!1&&(E[O]=T&&yt.isArray(F)?F.join(", "):F)}),E}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([T,E])=>T+": "+E).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(T){return T instanceof this?T:new this(T)}static concat(T,...E){const F=new this(T);return E.forEach(O=>F.set(O)),F}static accessor(T){const F=(this[Mf]=this[Mf]={accessors:{}}).accessors,O=this.prototype;function D(c){const m=_s(c);F[m]||(LC(O,c),F[m]=!0)}return yt.isArray(T)?T.forEach(D):D(T),this}}ea.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);yt.reduceDescriptors(ea.prototype,({value:S},T)=>{let E=T[0].toUpperCase()+T.slice(1);return{get:()=>S,set(F){this[E]=F}}});yt.freezeMethods(ea);const Oi=ea;function Ao(S,T){const E=this||ph,F=T||E,O=Oi.from(F.headers);let D=F.data;return yt.forEach(S,function(m){D=m.call(E,D,O.normalize(),T?T.status:void 0)}),O.normalize(),D}function vc(S){return!!(S&&S.__CANCEL__)}function xn(S,T,E){Zt.call(this,S??"canceled",Zt.ERR_CANCELED,T,E),this.name="CanceledError"}yt.inherits(xn,Zt,{__CANCEL__:!0});function OC(S,T,E){const F=E.config.validateStatus;!E.status||!F||F(E.status)?S(E):T(new Zt("Request failed with status code "+E.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(E.status/100)-4],E.config,E.request,E))}const DC=gi.hasStandardBrowserEnv?{write(S,T,E,F,O,D){const c=[S+"="+encodeURIComponent(T)];yt.isNumber(E)&&c.push("expires="+new Date(E).toGMTString()),yt.isString(F)&&c.push("path="+F),yt.isString(O)&&c.push("domain="+O),D===!0&&c.push("secure"),document.cookie=c.join("; ")},read(S){const T=document.cookie.match(new RegExp("(^|;\\s*)("+S+")=([^;]*)"));return T?decodeURIComponent(T[3]):null},remove(S){this.write(S,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function IC(S){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(S)}function BC(S,T){return T?S.replace(/\/?\/$/,"")+"/"+T.replace(/^\/+/,""):S}function pc(S,T){return S&&!IC(T)?BC(S,T):T}const bC=gi.hasStandardBrowserEnv?function(){const T=/(msie|trident)/i.test(navigator.userAgent),E=document.createElement("a");let F;function O(D){let c=D;return T&&(E.setAttribute("href",c),c=E.href),E.setAttribute("href",c),{href:E.href,protocol:E.protocol?E.protocol.replace(/:$/,""):"",host:E.host,search:E.search?E.search.replace(/^\?/,""):"",hash:E.hash?E.hash.replace(/^#/,""):"",hostname:E.hostname,port:E.port,pathname:E.pathname.charAt(0)==="/"?E.pathname:"/"+E.pathname}}return F=O(window.location.href),function(c){const m=yt.isString(c)?O(c):c;return m.protocol===F.protocol&&m.host===F.host}}():function(){return function(){return!0}}();function NC(S){const T=/^([-+\w]{1,25})(:?\/\/|:)/.exec(S);return T&&T[1]||""}function GC(S,T){S=S||10;const E=new Array(S),F=new Array(S);let O=0,D=0,c;return T=T!==void 0?T:1e3,function(t){const o=Date.now(),v=F[D];c||(c=o),E[O]=t,F[O]=o;let a=D,r=0;for(;a!==O;)r+=E[a++],a=a%S;if(O=(O+1)%S,O===D&&(D=(D+1)%S),o-c{const D=O.loaded,c=O.lengthComputable?O.total:void 0,m=D-E,t=F(m),o=D<=c;E=D;const v={loaded:D,total:c,progress:c?D/c:void 0,bytes:m,rate:t||void 0,estimated:t&&c&&o?(c-D)/t:void 0,event:O};v[T?"download":"upload"]=!0,S(v)}}const zC=typeof XMLHttpRequest<"u",UC=zC&&function(S){return new Promise(function(E,F){let O=S.data;const D=Oi.from(S.headers).normalize();let{responseType:c,withXSRFToken:m}=S,t;function o(){S.cancelToken&&S.cancelToken.unsubscribe(t),S.signal&&S.signal.removeEventListener("abort",t)}let v;if(yt.isFormData(O)){if(gi.hasStandardBrowserEnv||gi.hasStandardBrowserWebWorkerEnv)D.setContentType(!1);else if((v=D.getContentType())!==!1){const[i,...h]=v?v.split(";").map(s=>s.trim()).filter(Boolean):[];D.setContentType([i||"multipart/form-data",...h].join("; "))}}let a=new XMLHttpRequest;if(S.auth){const i=S.auth.username||"",h=S.auth.password?unescape(encodeURIComponent(S.auth.password)):"";D.set("Authorization","Basic "+btoa(i+":"+h))}const r=pc(S.baseURL,S.url);a.open(S.method.toUpperCase(),uc(r,S.params,S.paramsSerializer),!0),a.timeout=S.timeout;function n(){if(!a)return;const i=Oi.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),s={data:!c||c==="text"||c==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:i,config:S,request:a};OC(function(f){E(f),o()},function(f){F(f),o()},s),a=null}if("onloadend"in a?a.onloadend=n:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(n)},a.onabort=function(){a&&(F(new Zt("Request aborted",Zt.ECONNABORTED,S,a)),a=null)},a.onerror=function(){F(new Zt("Network Error",Zt.ERR_NETWORK,S,a)),a=null},a.ontimeout=function(){let h=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded";const s=S.transitional||fc;S.timeoutErrorMessage&&(h=S.timeoutErrorMessage),F(new Zt(h,s.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,S,a)),a=null},gi.hasStandardBrowserEnv&&(m&&yt.isFunction(m)&&(m=m(S)),m||m!==!1&&bC(r))){const i=S.xsrfHeaderName&&S.xsrfCookieName&&DC.read(S.xsrfCookieName);i&&D.set(S.xsrfHeaderName,i)}O===void 0&&D.setContentType(null),"setRequestHeader"in a&&yt.forEach(D.toJSON(),function(h,s){a.setRequestHeader(s,h)}),yt.isUndefined(S.withCredentials)||(a.withCredentials=!!S.withCredentials),c&&c!=="json"&&(a.responseType=S.responseType),typeof S.onDownloadProgress=="function"&&a.addEventListener("progress",wf(S.onDownloadProgress,!0)),typeof S.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",wf(S.onUploadProgress)),(S.cancelToken||S.signal)&&(t=i=>{a&&(F(!i||i.type?new xn(null,S,a):i),a.abort(),a=null)},S.cancelToken&&S.cancelToken.subscribe(t),S.signal&&(S.signal.aborted?t():S.signal.addEventListener("abort",t)));const e=NC(r);if(e&&gi.protocols.indexOf(e)===-1){F(new Zt("Unsupported protocol "+e+":",Zt.ERR_BAD_REQUEST,S));return}a.send(O||null)})},Wo={http:uC,xhr:UC};yt.forEach(Wo,(S,T)=>{if(S){try{Object.defineProperty(S,"name",{value:T})}catch{}Object.defineProperty(S,"adapterName",{value:T})}});const Rf=S=>`- ${S}`,XC=S=>yt.isFunction(S)||S===null||S===!1,gc={getAdapter:S=>{S=yt.isArray(S)?S:[S];const{length:T}=S;let E,F;const O={};for(let D=0;D`adapter ${m} `+(t===!1?"is not supported by the environment":"is not available in the build"));let c=T?D.length>1?`since : +*/class fs{constructor(T,E=4){this.bounds=T,this.capacity=E,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:T,yMin:E,xMax:R,yMax:O}=this.bounds,D=(R-T)/2,c=(O-E)/2,m=T,t=E;this.northeast=new fs({xMin:m+D,xMax:m+2*D,yMin:E,yMax:t+c},this.capacity),this.northwest=new fs({xMin:T,xMax:m+D,yMin:E,yMax:t+c},this.capacity),this.southeast=new fs({xMin:m+D,xMax:m+2*D,yMin:t+c,yMax:t+2*c},this.capacity),this.southwest=new fs({xMin:T,xMax:m+D,yMin:t+c,yMax:t+2*c},this.capacity),this.divided=!0}insert(T){return this.contains(T.bounds)?this.points.length=E&&T.xMax<=O&&T.yMin>=R&&T.yMax<=D}generateCacheKey(T){const{xMin:E,xMax:R,yMin:O,yMax:D}=T;return`${E},${R},${O},${D}`}queryRange(T,E=[]){if(!this.intersects(T))return E;for(const R of this.points)this.isWithinBounds(R.bounds,T)&&E.push(R);return this.divided&&(this.northwest?.queryRange(T,E),this.northeast?.queryRange(T,E),this.southwest?.queryRange(T,E),this.southeast?.queryRange(T,E)),E}query(T,E=[]){const R=`${T.x},${T.y}`,O=this.cache.get(R);if(O)return O;if(!this.intersects({xMin:T.x,xMax:T.x,yMin:T.y,yMax:T.y}))return E;for(const D of this.points)this.isWithinRange(T,D.bounds)&&E.push(D);return this.divided&&(this.northwest?.query(T,E),this.northeast?.query(T,E),this.southwest?.query(T,E),this.southeast?.query(T,E)),this.cache.set(R,E),E}intersects(T){const{xMin:E,yMin:R,xMax:O,yMax:D}=this.bounds;return!(T.xMin>O||T.xMaxD||T.yMax=E.xMin&&T.xMin<=E.xMax&&T.yMax>=E.yMin&&T.yMin<=E.yMax}isWithinRange(T,E){return T.x>=E.xMin&&T.x<=E.xMax&&T.y>=E.yMin&&T.y<=E.yMax}}class F2{constructor(){this.events={}}on(T,E){this.events[T]||(this.events[T]=[]),this.events[T]?.push(E)}off(T,E){this.events[T]&&(this.events[T]=this.events[T]?.filter(R=>R!==E))}emit(T,E){this.events[T]&&this.events[T]?.forEach(R=>R(E))}}const Zt=new F2;function L2(S,T,E){let R=new Set([...T,void 0]);return S.listen((O,D)=>{R.has(D)&&E(O,D)})}function _d(S,T){return function(){return S.apply(T,arguments)}}const{toString:O2}=Object.prototype,{getPrototypeOf:fh}=Object,kr=(S=>T=>{const E=O2.call(T);return S[E]||(S[E]=E.slice(8,-1).toLowerCase())})(Object.create(null)),Ti=S=>(S=S.toLowerCase(),T=>kr(T)===S),qr=S=>T=>typeof T===S,{isArray:Us}=Array,pn=qr("undefined");function D2(S){return S!==null&&!pn(S)&&S.constructor!==null&&!pn(S.constructor)&&ri(S.constructor.isBuffer)&&S.constructor.isBuffer(S)}const tc=Ti("ArrayBuffer");function I2(S){let T;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?T=ArrayBuffer.isView(S):T=S&&S.buffer&&tc(S.buffer),T}const B2=qr("string"),ri=qr("function"),ec=qr("number"),_r=S=>S!==null&&typeof S=="object",b2=S=>S===!0||S===!1,mr=S=>{if(kr(S)!=="object")return!1;const T=fh(S);return(T===null||T===Object.prototype||Object.getPrototypeOf(T)===null)&&!(Symbol.toStringTag in S)&&!(Symbol.iterator in S)},N2=Ti("Date"),G2=Ti("File"),z2=Ti("Blob"),U2=Ti("FileList"),X2=S=>_r(S)&&ri(S.pipe),V2=S=>{let T;return S&&(typeof FormData=="function"&&S instanceof FormData||ri(S.append)&&((T=kr(S))==="formdata"||T==="object"&&ri(S.toString)&&S.toString()==="[object FormData]"))},W2=Ti("URLSearchParams"),Y2=S=>S.trim?S.trim():S.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function yn(S,T,{allOwnKeys:E=!1}={}){if(S===null||typeof S>"u")return;let R,O;if(typeof S!="object"&&(S=[S]),Us(S))for(R=0,O=S.length;R0;)if(O=E[R],T===O.toLowerCase())return O;return null}const sc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nc=S=>!pn(S)&&S!==sc;function Uo(){const{caseless:S}=nc(this)&&this||{},T={},E=(R,O)=>{const D=S&&ic(T,O)||O;mr(T[D])&&mr(R)?T[D]=Uo(T[D],R):mr(R)?T[D]=Uo({},R):Us(R)?T[D]=R.slice():T[D]=R};for(let R=0,O=arguments.length;R(yn(T,(O,D)=>{E&&ri(O)?S[D]=_d(O,E):S[D]=O},{allOwnKeys:R}),S),K2=S=>(S.charCodeAt(0)===65279&&(S=S.slice(1)),S),j2=(S,T,E,R)=>{S.prototype=Object.create(T.prototype,R),S.prototype.constructor=S,Object.defineProperty(S,"super",{value:T.prototype}),E&&Object.assign(S.prototype,E)},$2=(S,T,E,R)=>{let O,D,c;const m={};if(T=T||{},S==null)return T;do{for(O=Object.getOwnPropertyNames(S),D=O.length;D-- >0;)c=O[D],(!R||R(c,S,T))&&!m[c]&&(T[c]=S[c],m[c]=!0);S=E!==!1&&fh(S)}while(S&&(!E||E(S,T))&&S!==Object.prototype);return T},Z2=(S,T,E)=>{S=String(S),(E===void 0||E>S.length)&&(E=S.length),E-=T.length;const R=S.indexOf(T,E);return R!==-1&&R===E},J2=S=>{if(!S)return null;if(Us(S))return S;let T=S.length;if(!ec(T))return null;const E=new Array(T);for(;T-- >0;)E[T]=S[T];return E},Q2=(S=>T=>S&&T instanceof S)(typeof Uint8Array<"u"&&fh(Uint8Array)),k2=(S,T)=>{const R=(S&&S[Symbol.iterator]).call(S);let O;for(;(O=R.next())&&!O.done;){const D=O.value;T.call(S,D[0],D[1])}},q2=(S,T)=>{let E;const R=[];for(;(E=S.exec(T))!==null;)R.push(E);return R},_2=Ti("HTMLFormElement"),tC=S=>S.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(E,R,O){return R.toUpperCase()+O}),Sf=(({hasOwnProperty:S})=>(T,E)=>S.call(T,E))(Object.prototype),eC=Ti("RegExp"),rc=(S,T)=>{const E=Object.getOwnPropertyDescriptors(S),R={};yn(E,(O,D)=>{let c;(c=T(O,D,S))!==!1&&(R[D]=c||O)}),Object.defineProperties(S,R)},iC=S=>{rc(S,(T,E)=>{if(ri(S)&&["arguments","caller","callee"].indexOf(E)!==-1)return!1;const R=S[E];if(ri(R)){if(T.enumerable=!1,"writable"in T){T.writable=!1;return}T.set||(T.set=()=>{throw Error("Can not rewrite read-only method '"+E+"'")})}})},sC=(S,T)=>{const E={},R=O=>{O.forEach(D=>{E[D]=!0})};return Us(S)?R(S):R(String(S).split(T)),E},nC=()=>{},rC=(S,T)=>(S=+S,Number.isFinite(S)?S:T),Co="abcdefghijklmnopqrstuvwxyz",Cf="0123456789",ac={DIGIT:Cf,ALPHA:Co,ALPHA_DIGIT:Co+Co.toUpperCase()+Cf},aC=(S=16,T=ac.ALPHA_DIGIT)=>{let E="";const{length:R}=T;for(;S--;)E+=T[Math.random()*R|0];return E};function oC(S){return!!(S&&ri(S.append)&&S[Symbol.toStringTag]==="FormData"&&S[Symbol.iterator])}const hC=S=>{const T=new Array(10),E=(R,O)=>{if(_r(R)){if(T.indexOf(R)>=0)return;if(!("toJSON"in R)){T[O]=R;const D=Us(R)?[]:{};return yn(R,(c,m)=>{const t=E(c,O+1);!pn(t)&&(D[m]=t)}),T[O]=void 0,D}}return R};return E(S,0)},lC=Ti("AsyncFunction"),uC=S=>S&&(_r(S)||ri(S))&&ri(S.then)&&ri(S.catch),xt={isArray:Us,isArrayBuffer:tc,isBuffer:D2,isFormData:V2,isArrayBufferView:I2,isString:B2,isNumber:ec,isBoolean:b2,isObject:_r,isPlainObject:mr,isUndefined:pn,isDate:N2,isFile:G2,isBlob:z2,isRegExp:eC,isFunction:ri,isStream:X2,isURLSearchParams:W2,isTypedArray:Q2,isFileList:U2,forEach:yn,merge:Uo,extend:H2,trim:Y2,stripBOM:K2,inherits:j2,toFlatObject:$2,kindOf:kr,kindOfTest:Ti,endsWith:Z2,toArray:J2,forEachEntry:k2,matchAll:q2,isHTMLForm:_2,hasOwnProperty:Sf,hasOwnProp:Sf,reduceDescriptors:rc,freezeMethods:iC,toObjectSet:sC,toCamelCase:tC,noop:nC,toFiniteNumber:rC,findKey:ic,global:sc,isContextDefined:nc,ALPHABET:ac,generateString:aC,isSpecCompliantForm:oC,toJSONObject:hC,isAsyncFn:lC,isThenable:uC};function Jt(S,T,E,R,O){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=S,this.name="AxiosError",T&&(this.code=T),E&&(this.config=E),R&&(this.request=R),O&&(this.response=O)}xt.inherits(Jt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const oc=Jt.prototype,hc={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(S=>{hc[S]={value:S}});Object.defineProperties(Jt,hc);Object.defineProperty(oc,"isAxiosError",{value:!0});Jt.from=(S,T,E,R,O,D)=>{const c=Object.create(oc);return xt.toFlatObject(S,c,function(t){return t!==Error.prototype},m=>m!=="isAxiosError"),Jt.call(c,S.message,T,E,R,O),c.cause=S,c.name=S.name,D&&Object.assign(c,D),c};const fC=null;function Xo(S){return xt.isPlainObject(S)||xt.isArray(S)}function lc(S){return xt.endsWith(S,"[]")?S.slice(0,-2):S}function Ef(S,T,E){return S?S.concat(T).map(function(O,D){return O=lc(O),!E&&D?"["+O+"]":O}).join(E?".":""):T}function dC(S){return xt.isArray(S)&&!S.some(Xo)}const cC=xt.toFlatObject(xt,{},null,function(T){return/^is[A-Z]/.test(T)});function ta(S,T,E){if(!xt.isObject(S))throw new TypeError("target must be an object");T=T||new FormData,E=xt.toFlatObject(E,{metaTokens:!0,dots:!1,indexes:!1},!1,function(i,h){return!xt.isUndefined(h[i])});const R=E.metaTokens,O=E.visitor||v,D=E.dots,c=E.indexes,t=(E.Blob||typeof Blob<"u"&&Blob)&&xt.isSpecCompliantForm(T);if(!xt.isFunction(O))throw new TypeError("visitor must be a function");function o(e){if(e===null)return"";if(xt.isDate(e))return e.toISOString();if(!t&&xt.isBlob(e))throw new Jt("Blob is not supported. Use a Buffer instead.");return xt.isArrayBuffer(e)||xt.isTypedArray(e)?t&&typeof Blob=="function"?new Blob([e]):Buffer.from(e):e}function v(e,i,h){let s=e;if(e&&!h&&typeof e=="object"){if(xt.endsWith(i,"{}"))i=R?i:i.slice(0,-2),e=JSON.stringify(e);else if(xt.isArray(e)&&dC(e)||(xt.isFileList(e)||xt.endsWith(i,"[]"))&&(s=xt.toArray(e)))return i=lc(i),s.forEach(function(f,u){!(xt.isUndefined(f)||f===null)&&T.append(c===!0?Ef([i],u,D):c===null?i:i+"[]",o(f))}),!1}return Xo(e)?!0:(T.append(Ef(h,i,D),o(e)),!1)}const a=[],r=Object.assign(cC,{defaultVisitor:v,convertValue:o,isVisitable:Xo});function n(e,i){if(!xt.isUndefined(e)){if(a.indexOf(e)!==-1)throw Error("Circular reference detected in "+i.join("."));a.push(e),xt.forEach(e,function(s,l){(!(xt.isUndefined(s)||s===null)&&O.call(T,s,xt.isString(l)?l.trim():l,i,r))===!0&&n(s,i?i.concat(l):[l])}),a.pop()}}if(!xt.isObject(S))throw new TypeError("data must be an object");return n(S),T}function Pf(S){const T={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(S).replace(/[!'()~]|%20|%00/g,function(R){return T[R]})}function dh(S,T){this._pairs=[],S&&ta(S,this,T)}const uc=dh.prototype;uc.append=function(T,E){this._pairs.push([T,E])};uc.toString=function(T){const E=T?function(R){return T.call(this,R,Pf)}:Pf;return this._pairs.map(function(O){return E(O[0])+"="+E(O[1])},"").join("&")};function vC(S){return encodeURIComponent(S).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fc(S,T,E){if(!T)return S;const R=E&&E.encode||vC,O=E&&E.serialize;let D;if(O?D=O(T,E):D=xt.isURLSearchParams(T)?T.toString():new dh(T,E).toString(R),D){const c=S.indexOf("#");c!==-1&&(S=S.slice(0,c)),S+=(S.indexOf("?")===-1?"?":"&")+D}return S}class Af{constructor(){this.handlers=[]}use(T,E,R){return this.handlers.push({fulfilled:T,rejected:E,synchronous:R?R.synchronous:!1,runWhen:R?R.runWhen:null}),this.handlers.length-1}eject(T){this.handlers[T]&&(this.handlers[T]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(T){xt.forEach(this.handlers,function(R){R!==null&&T(R)})}}const dc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pC=typeof URLSearchParams<"u"?URLSearchParams:dh,gC=typeof FormData<"u"?FormData:null,mC=typeof Blob<"u"?Blob:null,yC={isBrowser:!0,classes:{URLSearchParams:pC,FormData:gC,Blob:mC},protocols:["http","https","file","blob","url","data"]},cc=typeof window<"u"&&typeof document<"u",xC=(S=>cc&&["ReactNative","NativeScript","NS"].indexOf(S)<0)(typeof navigator<"u"&&navigator.product),TC=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",SC=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cc,hasStandardBrowserEnv:xC,hasStandardBrowserWebWorkerEnv:TC},Symbol.toStringTag,{value:"Module"})),xi={...SC,...yC};function CC(S,T){return ta(S,new xi.classes.URLSearchParams,Object.assign({visitor:function(E,R,O,D){return xi.isNode&&xt.isBuffer(E)?(this.append(R,E.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)}},T))}function EC(S){return xt.matchAll(/\w+|\[(\w*)]/g,S).map(T=>T[0]==="[]"?"":T[1]||T[0])}function PC(S){const T={},E=Object.keys(S);let R;const O=E.length;let D;for(R=0;R=E.length;return c=!c&&xt.isArray(O)?O.length:c,t?(xt.hasOwnProp(O,c)?O[c]=[O[c],R]:O[c]=R,!m):((!O[c]||!xt.isObject(O[c]))&&(O[c]=[]),T(E,R,O[c],D)&&xt.isArray(O[c])&&(O[c]=PC(O[c])),!m)}if(xt.isFormData(S)&&xt.isFunction(S.entries)){const E={};return xt.forEachEntry(S,(R,O)=>{T(EC(R),O,E,0)}),E}return null}function AC(S,T,E){if(xt.isString(S))try{return(T||JSON.parse)(S),xt.trim(S)}catch(R){if(R.name!=="SyntaxError")throw R}return(E||JSON.stringify)(S)}const ch={transitional:dc,adapter:["xhr","http"],transformRequest:[function(T,E){const R=E.getContentType()||"",O=R.indexOf("application/json")>-1,D=xt.isObject(T);if(D&&xt.isHTMLForm(T)&&(T=new FormData(T)),xt.isFormData(T))return O?JSON.stringify(vc(T)):T;if(xt.isArrayBuffer(T)||xt.isBuffer(T)||xt.isStream(T)||xt.isFile(T)||xt.isBlob(T))return T;if(xt.isArrayBufferView(T))return T.buffer;if(xt.isURLSearchParams(T))return E.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),T.toString();let m;if(D){if(R.indexOf("application/x-www-form-urlencoded")>-1)return CC(T,this.formSerializer).toString();if((m=xt.isFileList(T))||R.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ta(m?{"files[]":T}:T,t&&new t,this.formSerializer)}}return D||O?(E.setContentType("application/json",!1),AC(T)):T}],transformResponse:[function(T){const E=this.transitional||ch.transitional,R=E&&E.forcedJSONParsing,O=this.responseType==="json";if(T&&xt.isString(T)&&(R&&!this.responseType||O)){const c=!(E&&E.silentJSONParsing)&&O;try{return JSON.parse(T)}catch(m){if(c)throw m.name==="SyntaxError"?Jt.from(m,Jt.ERR_BAD_RESPONSE,this,null,this.response):m}}return T}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xi.classes.FormData,Blob:xi.classes.Blob},validateStatus:function(T){return T>=200&&T<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xt.forEach(["delete","get","head","post","put","patch"],S=>{ch.headers[S]={}});const vh=ch,MC=xt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wC=S=>{const T={};let E,R,O;return S&&S.split(` +`).forEach(function(c){O=c.indexOf(":"),E=c.substring(0,O).trim().toLowerCase(),R=c.substring(O+1).trim(),!(!E||T[E]&&MC[E])&&(E==="set-cookie"?T[E]?T[E].push(R):T[E]=[R]:T[E]=T[E]?T[E]+", "+R:R)}),T},Mf=Symbol("internals");function nn(S){return S&&String(S).trim().toLowerCase()}function yr(S){return S===!1||S==null?S:xt.isArray(S)?S.map(yr):String(S)}function RC(S){const T=Object.create(null),E=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let R;for(;R=E.exec(S);)T[R[1]]=R[2];return T}const FC=S=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(S.trim());function Eo(S,T,E,R,O){if(xt.isFunction(R))return R.call(this,T,E);if(O&&(T=E),!!xt.isString(T)){if(xt.isString(R))return T.indexOf(R)!==-1;if(xt.isRegExp(R))return R.test(T)}}function LC(S){return S.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(T,E,R)=>E.toUpperCase()+R)}function OC(S,T){const E=xt.toCamelCase(" "+T);["get","set","has"].forEach(R=>{Object.defineProperty(S,R+E,{value:function(O,D,c){return this[R].call(this,T,O,D,c)},configurable:!0})})}class ea{constructor(T){T&&this.set(T)}set(T,E,R){const O=this;function D(m,t,o){const v=nn(t);if(!v)throw new Error("header name must be a non-empty string");const a=xt.findKey(O,v);(!a||O[a]===void 0||o===!0||o===void 0&&O[a]!==!1)&&(O[a||t]=yr(m))}const c=(m,t)=>xt.forEach(m,(o,v)=>D(o,v,t));return xt.isPlainObject(T)||T instanceof this.constructor?c(T,E):xt.isString(T)&&(T=T.trim())&&!FC(T)?c(wC(T),E):T!=null&&D(E,T,R),this}get(T,E){if(T=nn(T),T){const R=xt.findKey(this,T);if(R){const O=this[R];if(!E)return O;if(E===!0)return RC(O);if(xt.isFunction(E))return E.call(this,O,R);if(xt.isRegExp(E))return E.exec(O);throw new TypeError("parser must be boolean|regexp|function")}}}has(T,E){if(T=nn(T),T){const R=xt.findKey(this,T);return!!(R&&this[R]!==void 0&&(!E||Eo(this,this[R],R,E)))}return!1}delete(T,E){const R=this;let O=!1;function D(c){if(c=nn(c),c){const m=xt.findKey(R,c);m&&(!E||Eo(R,R[m],m,E))&&(delete R[m],O=!0)}}return xt.isArray(T)?T.forEach(D):D(T),O}clear(T){const E=Object.keys(this);let R=E.length,O=!1;for(;R--;){const D=E[R];(!T||Eo(this,this[D],D,T,!0))&&(delete this[D],O=!0)}return O}normalize(T){const E=this,R={};return xt.forEach(this,(O,D)=>{const c=xt.findKey(R,D);if(c){E[c]=yr(O),delete E[D];return}const m=T?LC(D):String(D).trim();m!==D&&delete E[D],E[m]=yr(O),R[m]=!0}),this}concat(...T){return this.constructor.concat(this,...T)}toJSON(T){const E=Object.create(null);return xt.forEach(this,(R,O)=>{R!=null&&R!==!1&&(E[O]=T&&xt.isArray(R)?R.join(", "):R)}),E}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([T,E])=>T+": "+E).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(T){return T instanceof this?T:new this(T)}static concat(T,...E){const R=new this(T);return E.forEach(O=>R.set(O)),R}static accessor(T){const R=(this[Mf]=this[Mf]={accessors:{}}).accessors,O=this.prototype;function D(c){const m=nn(c);R[m]||(OC(O,c),R[m]=!0)}return xt.isArray(T)?T.forEach(D):D(T),this}}ea.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);xt.reduceDescriptors(ea.prototype,({value:S},T)=>{let E=T[0].toUpperCase()+T.slice(1);return{get:()=>S,set(R){this[E]=R}}});xt.freezeMethods(ea);const bi=ea;function Po(S,T){const E=this||vh,R=T||E,O=bi.from(R.headers);let D=R.data;return xt.forEach(S,function(m){D=m.call(E,D,O.normalize(),T?T.status:void 0)}),O.normalize(),D}function pc(S){return!!(S&&S.__CANCEL__)}function xn(S,T,E){Jt.call(this,S??"canceled",Jt.ERR_CANCELED,T,E),this.name="CanceledError"}xt.inherits(xn,Jt,{__CANCEL__:!0});function DC(S,T,E){const R=E.config.validateStatus;!E.status||!R||R(E.status)?S(E):T(new Jt("Request failed with status code "+E.status,[Jt.ERR_BAD_REQUEST,Jt.ERR_BAD_RESPONSE][Math.floor(E.status/100)-4],E.config,E.request,E))}const IC=xi.hasStandardBrowserEnv?{write(S,T,E,R,O,D){const c=[S+"="+encodeURIComponent(T)];xt.isNumber(E)&&c.push("expires="+new Date(E).toGMTString()),xt.isString(R)&&c.push("path="+R),xt.isString(O)&&c.push("domain="+O),D===!0&&c.push("secure"),document.cookie=c.join("; ")},read(S){const T=document.cookie.match(new RegExp("(^|;\\s*)("+S+")=([^;]*)"));return T?decodeURIComponent(T[3]):null},remove(S){this.write(S,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function BC(S){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(S)}function bC(S,T){return T?S.replace(/\/?\/$/,"")+"/"+T.replace(/^\/+/,""):S}function gc(S,T){return S&&!BC(T)?bC(S,T):T}const NC=xi.hasStandardBrowserEnv?function(){const T=/(msie|trident)/i.test(navigator.userAgent),E=document.createElement("a");let R;function O(D){let c=D;return T&&(E.setAttribute("href",c),c=E.href),E.setAttribute("href",c),{href:E.href,protocol:E.protocol?E.protocol.replace(/:$/,""):"",host:E.host,search:E.search?E.search.replace(/^\?/,""):"",hash:E.hash?E.hash.replace(/^#/,""):"",hostname:E.hostname,port:E.port,pathname:E.pathname.charAt(0)==="/"?E.pathname:"/"+E.pathname}}return R=O(window.location.href),function(c){const m=xt.isString(c)?O(c):c;return m.protocol===R.protocol&&m.host===R.host}}():function(){return function(){return!0}}();function GC(S){const T=/^([-+\w]{1,25})(:?\/\/|:)/.exec(S);return T&&T[1]||""}function zC(S,T){S=S||10;const E=new Array(S),R=new Array(S);let O=0,D=0,c;return T=T!==void 0?T:1e3,function(t){const o=Date.now(),v=R[D];c||(c=o),E[O]=t,R[O]=o;let a=D,r=0;for(;a!==O;)r+=E[a++],a=a%S;if(O=(O+1)%S,O===D&&(D=(D+1)%S),o-c{const D=O.loaded,c=O.lengthComputable?O.total:void 0,m=D-E,t=R(m),o=D<=c;E=D;const v={loaded:D,total:c,progress:c?D/c:void 0,bytes:m,rate:t||void 0,estimated:t&&c&&o?(c-D)/t:void 0,event:O};v[T?"download":"upload"]=!0,S(v)}}const UC=typeof XMLHttpRequest<"u",XC=UC&&function(S){return new Promise(function(E,R){let O=S.data;const D=bi.from(S.headers).normalize();let{responseType:c,withXSRFToken:m}=S,t;function o(){S.cancelToken&&S.cancelToken.unsubscribe(t),S.signal&&S.signal.removeEventListener("abort",t)}let v;if(xt.isFormData(O)){if(xi.hasStandardBrowserEnv||xi.hasStandardBrowserWebWorkerEnv)D.setContentType(!1);else if((v=D.getContentType())!==!1){const[i,...h]=v?v.split(";").map(s=>s.trim()).filter(Boolean):[];D.setContentType([i||"multipart/form-data",...h].join("; "))}}let a=new XMLHttpRequest;if(S.auth){const i=S.auth.username||"",h=S.auth.password?unescape(encodeURIComponent(S.auth.password)):"";D.set("Authorization","Basic "+btoa(i+":"+h))}const r=gc(S.baseURL,S.url);a.open(S.method.toUpperCase(),fc(r,S.params,S.paramsSerializer),!0),a.timeout=S.timeout;function n(){if(!a)return;const i=bi.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),s={data:!c||c==="text"||c==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:i,config:S,request:a};DC(function(f){E(f),o()},function(f){R(f),o()},s),a=null}if("onloadend"in a?a.onloadend=n:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(n)},a.onabort=function(){a&&(R(new Jt("Request aborted",Jt.ECONNABORTED,S,a)),a=null)},a.onerror=function(){R(new Jt("Network Error",Jt.ERR_NETWORK,S,a)),a=null},a.ontimeout=function(){let h=S.timeout?"timeout of "+S.timeout+"ms exceeded":"timeout exceeded";const s=S.transitional||dc;S.timeoutErrorMessage&&(h=S.timeoutErrorMessage),R(new Jt(h,s.clarifyTimeoutError?Jt.ETIMEDOUT:Jt.ECONNABORTED,S,a)),a=null},xi.hasStandardBrowserEnv&&(m&&xt.isFunction(m)&&(m=m(S)),m||m!==!1&&NC(r))){const i=S.xsrfHeaderName&&S.xsrfCookieName&&IC.read(S.xsrfCookieName);i&&D.set(S.xsrfHeaderName,i)}O===void 0&&D.setContentType(null),"setRequestHeader"in a&&xt.forEach(D.toJSON(),function(h,s){a.setRequestHeader(s,h)}),xt.isUndefined(S.withCredentials)||(a.withCredentials=!!S.withCredentials),c&&c!=="json"&&(a.responseType=S.responseType),typeof S.onDownloadProgress=="function"&&a.addEventListener("progress",wf(S.onDownloadProgress,!0)),typeof S.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",wf(S.onUploadProgress)),(S.cancelToken||S.signal)&&(t=i=>{a&&(R(!i||i.type?new xn(null,S,a):i),a.abort(),a=null)},S.cancelToken&&S.cancelToken.subscribe(t),S.signal&&(S.signal.aborted?t():S.signal.addEventListener("abort",t)));const e=GC(r);if(e&&xi.protocols.indexOf(e)===-1){R(new Jt("Unsupported protocol "+e+":",Jt.ERR_BAD_REQUEST,S));return}a.send(O||null)})},Vo={http:fC,xhr:XC};xt.forEach(Vo,(S,T)=>{if(S){try{Object.defineProperty(S,"name",{value:T})}catch{}Object.defineProperty(S,"adapterName",{value:T})}});const Rf=S=>`- ${S}`,VC=S=>xt.isFunction(S)||S===null||S===!1,mc={getAdapter:S=>{S=xt.isArray(S)?S:[S];const{length:T}=S;let E,R;const O={};for(let D=0;D`adapter ${m} `+(t===!1?"is not supported by the environment":"is not available in the build"));let c=T?D.length>1?`since : `+D.map(Rf).join(` -`):" "+Rf(D[0]):"as no adapter specified";throw new Zt("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return F},adapters:Wo};function Mo(S){if(S.cancelToken&&S.cancelToken.throwIfRequested(),S.signal&&S.signal.aborted)throw new xn(null,S)}function Ff(S){return Mo(S),S.headers=Oi.from(S.headers),S.data=Ao.call(S,S.transformRequest),["post","put","patch"].indexOf(S.method)!==-1&&S.headers.setContentType("application/x-www-form-urlencoded",!1),gc.getAdapter(S.adapter||ph.adapter)(S).then(function(F){return Mo(S),F.data=Ao.call(S,S.transformResponse,F),F.headers=Oi.from(F.headers),F},function(F){return vc(F)||(Mo(S),F&&F.response&&(F.response.data=Ao.call(S,S.transformResponse,F.response),F.response.headers=Oi.from(F.response.headers))),Promise.reject(F)})}const Lf=S=>S instanceof Oi?S.toJSON():S;function Ds(S,T){T=T||{};const E={};function F(o,v,a){return yt.isPlainObject(o)&&yt.isPlainObject(v)?yt.merge.call({caseless:a},o,v):yt.isPlainObject(v)?yt.merge({},v):yt.isArray(v)?v.slice():v}function O(o,v,a){if(yt.isUndefined(v)){if(!yt.isUndefined(o))return F(void 0,o,a)}else return F(o,v,a)}function D(o,v){if(!yt.isUndefined(v))return F(void 0,v)}function c(o,v){if(yt.isUndefined(v)){if(!yt.isUndefined(o))return F(void 0,o)}else return F(void 0,v)}function m(o,v,a){if(a in T)return F(o,v);if(a in S)return F(void 0,o)}const t={url:D,method:D,data:D,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:m,headers:(o,v)=>O(Lf(o),Lf(v),!0)};return yt.forEach(Object.keys(Object.assign({},S,T)),function(v){const a=t[v]||O,r=a(S[v],T[v],v);yt.isUndefined(r)&&a!==m||(E[v]=r)}),E}const mc="1.6.7",gh={};["object","boolean","number","function","string","symbol"].forEach((S,T)=>{gh[S]=function(F){return typeof F===S||"a"+(T<1?"n ":" ")+S}});const Of={};gh.transitional=function(T,E,F){function O(D,c){return"[Axios v"+mc+"] Transitional option '"+D+"'"+c+(F?". "+F:"")}return(D,c,m)=>{if(T===!1)throw new Zt(O(c," has been removed"+(E?" in "+E:"")),Zt.ERR_DEPRECATED);return E&&!Of[c]&&(Of[c]=!0,console.warn(O(c," has been deprecated since v"+E+" and will be removed in the near future"))),T?T(D,c,m):!0}};function VC(S,T,E){if(typeof S!="object")throw new Zt("options must be an object",Zt.ERR_BAD_OPTION_VALUE);const F=Object.keys(S);let O=F.length;for(;O-- >0;){const D=F[O],c=T[D];if(c){const m=S[D],t=m===void 0||c(m,D,S);if(t!==!0)throw new Zt("option "+D+" must be "+t,Zt.ERR_BAD_OPTION_VALUE);continue}if(E!==!0)throw new Zt("Unknown option "+D,Zt.ERR_BAD_OPTION)}}const Yo={assertOptions:VC,validators:gh},Wi=Yo.validators;class Pr{constructor(T){this.defaults=T,this.interceptors={request:new Af,response:new Af}}async request(T,E){try{return await this._request(T,E)}catch(F){if(F instanceof Error){let O;Error.captureStackTrace?Error.captureStackTrace(O={}):O=new Error;const D=O.stack?O.stack.replace(/^.+\n/,""):"";F.stack?D&&!String(F.stack).endsWith(D.replace(/^.+\n.+\n/,""))&&(F.stack+=` -`+D):F.stack=D}throw F}}_request(T,E){typeof T=="string"?(E=E||{},E.url=T):E=T||{},E=Ds(this.defaults,E);const{transitional:F,paramsSerializer:O,headers:D}=E;F!==void 0&&Yo.assertOptions(F,{silentJSONParsing:Wi.transitional(Wi.boolean),forcedJSONParsing:Wi.transitional(Wi.boolean),clarifyTimeoutError:Wi.transitional(Wi.boolean)},!1),O!=null&&(yt.isFunction(O)?E.paramsSerializer={serialize:O}:Yo.assertOptions(O,{encode:Wi.function,serialize:Wi.function},!0)),E.method=(E.method||this.defaults.method||"get").toLowerCase();let c=D&&yt.merge(D.common,D[E.method]);D&&yt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete D[e]}),E.headers=Oi.concat(c,D);const m=[];let t=!0;this.interceptors.request.forEach(function(i){typeof i.runWhen=="function"&&i.runWhen(E)===!1||(t=t&&i.synchronous,m.unshift(i.fulfilled,i.rejected))});const o=[];this.interceptors.response.forEach(function(i){o.push(i.fulfilled,i.rejected)});let v,a=0,r;if(!t){const e=[Ff.bind(this),void 0];for(e.unshift.apply(e,m),e.push.apply(e,o),r=e.length,v=Promise.resolve(E);a{if(!F._listeners)return;let D=F._listeners.length;for(;D-- >0;)F._listeners[D](O);F._listeners=null}),this.promise.then=O=>{let D;const c=new Promise(m=>{F.subscribe(m),D=m}).then(O);return c.cancel=function(){F.unsubscribe(D)},c},T(function(D,c,m){F.reason||(F.reason=new xn(D,c,m),E(F.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(T){if(this.reason){T(this.reason);return}this._listeners?this._listeners.push(T):this._listeners=[T]}unsubscribe(T){if(!this._listeners)return;const E=this._listeners.indexOf(T);E!==-1&&this._listeners.splice(E,1)}static source(){let T;return{token:new mh(function(O){T=O}),cancel:T}}}const WC=mh;function YC(S){return function(E){return S.apply(null,E)}}function HC(S){return yt.isObject(S)&&S.isAxiosError===!0}const Ho={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ho).forEach(([S,T])=>{Ho[T]=S});const KC=Ho;function xc(S){const T=new xr(S),E=qd(xr.prototype.request,T);return yt.extend(E,xr.prototype,T,{allOwnKeys:!0}),yt.extend(E,T,null,{allOwnKeys:!0}),E.create=function(O){return xc(Ds(S,O))},E}const me=xc(ph);me.Axios=xr;me.CanceledError=xn;me.CancelToken=WC;me.isCancel=vc;me.VERSION=mc;me.toFormData=ta;me.AxiosError=Zt;me.Cancel=me.CanceledError;me.all=function(T){return Promise.all(T)};me.spread=YC;me.isAxiosError=HC;me.mergeConfig=Ds;me.AxiosHeaders=Oi;me.formToJSON=S=>cc(yt.isHTMLForm(S)?new FormData(S):S);me.getAdapter=gc.getAdapter;me.HttpStatusCode=KC;me.default=me;const jC={username:"Guest",health:"100",mana:"100",energy:"100",maxHealth:"100",maxMana:"100",maxEnergy:"100",armour:"0",agility:"0",strength:"0",intelligence:"0",experience:"0",reputation:"0",faith:"0"},$C={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},ZC={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},JC={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},yc={},QC={stats:jC,inventory:JC,state:$C},kC=S=>{vn(async()=>{Ar.set({...Ar.get(),[S.id]:S})})};function yn(S,T){return h1(S,T,{encode(E){return JSON.stringify(E)},decode(E){try{return JSON.parse(E)}catch{return T}}})}const Is=yn("playerData",QC),qC=yn("quest",ZC),Ar=yn("items",yc),ss=yn("notifications",[]),Tc=yn("itemDB",yc),_C=()=>{vn(async()=>{try{const T=(await me.get("https://kbve.com/api/itemdb.json")).data,E={};Object.keys(T.key).forEach(F=>{const O=T.key[F];E[O.id]=O,E[O.name]=O}),Tc.set(E)}catch(S){console.error("Failed to reload item database:",S)}})},tE=S=>Tc.get()[S],eE=S=>{vn(async()=>{const T=Is.get();T.inventory.backpack.push(S),Is.set({...T})})},ia=S=>{const E=Ar.get()[S];if(E)return E;console.warn(`Item with ID ${S} not found.`)},iE=S=>{vn(async()=>{const T=Sc(),E={...S,id:T};kC(E),eE(E.id),Jt.emit("notification",{title:"Success",message:`You got a ${E.name}, verified by E Corp ID ${E.id}`,notificationType:hn.success})})},sE=S=>{vn(async()=>{const T=Is.get(),E=parseInt(T.stats.health,10),F=Math.max(E-S,0);T.stats={...T.stats,health:F.toString()},Is.set({...T})})},hn={caution:{type:"caution",color:"bg-yellow-200 border-yellow-300 text-yellow-700",imgUrl:"/assets/icons/notification.svg"},warning:{type:"warning",color:"bg-orange-200 border-orange-300 text-orange-700",imgUrl:"/assets/icons/notification.svg"},danger:{type:"danger",color:"bg-red-200 border-red-300 text-red-700",imgUrl:"/assets/icons/notification.svg"},success:{type:"success",color:"bg-green-200 border-green-300 text-green-700",imgUrl:"/assets/icons/notification.svg"},info:{type:"info",color:"bg-blue-200 border-blue-300 text-blue-700",imgUrl:"/assets/icons/notification.svg"}},ws="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function nE(S,T,E){for(;S.length=0;F--){const O=S%ws.length;E=ws.charAt(O)+E,S=Math.floor(S/ws.length)}return nE(E,T,ws[0])}function Sc(){const S=Date.now(),T=oE(S,10),E=aE(16);return T+E}class Cc{constructor(T,E,F){this.scene=T,this.gridEngine=E,this.quadtree=F,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers()}initializeWASDKeys(){const T=this.scene.input.keyboard;T&&(this.wasdKeys={W:T.addKey(Phaser.Input.Keyboard.KeyCodes.W),A:T.addKey(Phaser.Input.Keyboard.KeyCodes.A),S:T.addKey(Phaser.Input.Keyboard.KeyCodes.S),D:T.addKey(Phaser.Input.Keyboard.KeyCodes.D)})}registerEventHandlers(){//! Broken -Jt.on("playerMove",this.handlePlayerMove.bind(this)),Jt.on("playerSteal",this.handlePlayerSteal.bind(this)),Jt.on("playerReward",this.handlePlayerReward.bind(this)),Jt.on("playerDamage",this.handlePlayerCombatDamage.bind(this))}handlePlayerReward(T){console.log("Rewarding the player"),T&&(Jt.emit("notification",{title:"Success",message:T.message,notificationType:hn.success}),iE(T.item))}handlePlayerCombatDamage(T){T&&(sE(parseInt(T.damage)),Jt.emit("notification",{title:"Danger",message:`You taken ${T.damage} points of damage!`,notificationType:hn.danger}))}handlePlayerSteal(T){if(T)if(Math.random()>.5){const E=tE("Salmon");E?Jt.emit("playerReward",{message:`You stole a ${E.name}!`,item:E}):console.warn("Item not found in ItemDB")}else Jt.emit("notification",{title:"Danger",message:`You failed to steal from ${T.npcName}!`,notificationType:hn.danger}),Jt.emit("playerDamage",{damage:"1"})}handlePlayerMove(T){T&&this.gridEngine.moveTo("player",{x:T.x,y:T.y})}handleMovement(){if(!this.cursor)return;const T=this.cursor,E=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const F=this.gridEngine.getPosition("player"),O=this.quadtree.query(F);for(const D of O)D.action()}(T.left.isDown||E.A.isDown)&&(T.up.isDown||E.W.isDown)?this.gridEngine.move("player","up-left"):(T.left.isDown||E.A.isDown)&&(T.down.isDown||E.S.isDown)?this.gridEngine.move("player","down-left"):(T.right.isDown||E.D.isDown)&&(T.up.isDown||E.W.isDown)?this.gridEngine.move("player","up-right"):(T.right.isDown||E.D.isDown)&&(T.down.isDown||E.S.isDown)?this.gridEngine.move("player","down-right"):T.left.isDown||E.A.isDown?this.gridEngine.move("player","left"):T.right.isDown||E.D.isDown?this.gridEngine.move("player","right"):T.up.isDown||E.W.isDown?this.gridEngine.move("player","up"):(T.down.isDown||E.S.isDown)&&this.gridEngine.move("player","down")}}class Ec extends Phaser.GameObjects.Container{constructor(T,E,F,O){const D=E.x,c=E.y-E.height+10;super(T,D,c),this.sprite=E;const m=150,t=40+O.length*20;this.background=T.add.rectangle(0,0,m,t,0,.7),this.text=T.add.text(0,-t/2+10,F,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=O.map((o,v)=>{const a=T.add.text(0,-t/2+30+v*20,o.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return a.setInteractive({useHandCursor:!0}),a.on("pointerdown",o.callback),a}),this.add(this.background),this.add(this.text),this.buttons.forEach(o=>this.add(o)),this.scene.add.existing(this)}updatePosition(){this.setPosition(this.sprite.x-30,this.sprite.y-this.sprite.height-this.background.height/2+100)}static attachToSprite(T,E,F,O){E.setInteractive(),E.on("pointerover",()=>{const D={npcId:E.name,npcName:F,actions:O.map(m=>m.label)};if(Jt.emit("npcInteraction",D),!E.getData("tooltipMenu")){const m=new Ec(T,E,F,O);E.setData("tooltipMenu",m)}const c=E.getData("tooltipMenu");c.setVisible(!0),c.updatePosition()}),E.on("pointerout",()=>{const D=E.getData("tooltipMenu");D&&D.setVisible(!1)})}static updateAllTooltipPositions(T){T.children.list.forEach(E=>{if(E instanceof Phaser.GameObjects.Sprite){const F=E.getData("tooltipMenu");F&&F.updatePosition()}})}}let LE=class extends Phaser.GameObjects.Sprite{};function hE(S,T,E,F){const m=S.add.graphics();m.fillStyle(16777215,1),m.fillRoundedRect(0,0,200,60,16),m.setDepth(99);const t=S.add.text(100,30,E,{fontFamily:"Arial",fontSize:16,color:"#000000"});t.setOrigin(.5),t.setWordWrapWidth(200-10*2),t.setDepth(100);const o=S.add.container(0,0,[m,t]);return o.setDepth(100),T.messageBubble=o,uE(T),S.time.addEvent({delay:F,callback:()=>{o.destroy(),T.messageBubble===o&&(T.messageBubble=void 0)},callbackScope:S}),o}function lE(S,T,E){const c=S.add.graphics();c.fillStyle(16777215,1),c.fillRoundedRect(0,0,200,60,16),c.setDepth(99);const m=S.add.text(100,30,E,{fontFamily:"Arial",fontSize:16,color:"#000000"});m.setOrigin(.5),m.setWordWrapWidth(200-10*2),m.setDepth(100);const t=S.add.container(0,0,[c,m]);return t.setDepth(100),T.textBubble=t,Ko(T),t}function Ko(S){const T=S.textBubble;T&&(T.x=S.x,T.y=S.y-S.height-T.height/2)}function uE(S){const T=S.messageBubble;T&&(T.x=S.x,T.y=S.y-S.height-T.height/2)}class fE{constructor(){this.actionHandlers={Talk:this.talkToNPC.bind(this),Trade:this.tradeWithNPC.bind(this),"Move to":this.moveToNPC.bind(this),Steal:this.stealFromNPC.bind(this),Combat:this.startCombat.bind(this),"Check Fish":this.checkFish.bind(this)}}getActionHandler(T){return this.actionHandlers[T]}talkToNPC(T){console.log(`Talking to NPC with ID: ${T.npcId}`)}tradeWithNPC(T){console.log(`Trading with NPC with ID: ${T.npcId}`)}moveToNPC(T){const F=T.data?.coords||{x:10,y:15};Jt.emit("playerMove",F)}stealFromNPC(T){console.log(`Attempting to steal from NPC with ID: ${T.npcId}`);const E={npcId:T.npcId,npcName:T.npcName,data:T.data};Jt.emit("playerSteal",E)}startCombat(T){console.log(`Starting combat with NPC with ID: ${T.npcId}`)}checkFish(T){console.log(`Checking fish for NPC with ID: ${T.npcId}`)}attachNPCEvent(T,E,F,O){T.setInteractive(),T.on("pointerover",()=>{const D={npcId:T.name||"",npcName:E,actions:F.map(c=>c.label),data:O||{}};Jt.emit("npcInteraction",D)}),T.on("pointerout",()=>{})}}const Pc=new fE;function Ac(S){return+S[S.length-1]}function Mc(S){return S.startsWith("monster_bird_")&&!S.startsWith("monster_bird_shadow")}function wc(S,T,E,F,O){const D=[];for(let c=0;c<10;c++){const m=S.add.sprite(0,0,"monster_bird");m.setCrop(T,E,F,O),m.scale=3,D.push(m)}return D}function Rc(S){return wc(S,0,0,61,47)}function Fc(S){return wc(S,22,47,16,10)}function Lc(S){S.anims.create({key:"bird",frames:S.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class dE extends $r.Scene{mainMenuButtonImage;mainMenuButtonText;constructor(){super("Preloader")}preload(){this.load.image("mainBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.image("scroll","https://kbve.com/assets/img/fishchip/scroll.webp"),this.load.audio("music","https://kbve.com/assets/img/fishchip/bg.ogg"),this.load.image("creditsBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.audio("type","https://kbve.com/assets/img/fishchip/type.mp3"),this.load.spritesheet("fishing","https://kbve.com/assets/img/fishchip/animate.png",{frameWidth:800,frameHeight:600}),this.load.image("fish","https://kbve.com/assets/img/letter_logo.png"),this.load.image("background","https://kbve.com/assets/img/fishchip/scaled_fish_menu_minigame.webp"),this.load.image("tiles","https://kbve.com/assets/img/fishchip/desert_tileset_1.png"),this.load.image("cloud-city-tiles","/assets/map/cloud_tileset.png"),this.load.tilemapTiledJSON("cloud-city-map-large","/assets/map/cloud_city_large.json"),this.load.tilemapTiledJSON("cloud-city-map","https://kbve.com/assets/img/fishchip/cloud_city.json"),this.load.spritesheet("player","https://kbve.com/assets/img/fishchip/chip_charactersheet_warmer.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("knights","/assets/entity/knights.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("jacko","/assets/entity/jacko.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("monks","/assets/entity/monks.png",{frameWidth:52,frameHeight:72}),_C()}create(){this.sound.get("music")?.isPlaying||this.sound.add("music",{loop:!0,volume:.1}).play(),this.add.image(480,480,"mainBg").setScale(.1),this.mainMenuButtonImage=this.add.image(480,480,"scroll").setAlpha(.9).setScale(.7,.2).setInteractive({useHandCursor:!0}),this.mainMenuButtonText=this.add.text(480,480,"Start Game",{fontFamily:"Arial Black",fontSize:50,color:"#ffffff",stroke:"#000000",strokeThickness:6}).setOrigin(.5).setInteractive({useHandCursor:!0}),this.mainMenuButtonText.on("pointerdown",()=>{this.scene.start("SandCity")},this)}}let DE=class extends nn.GameObjects.Sprite{textBubble;tooltip};class cE extends $r.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"SandCity"});const T={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new os(T)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),Jt.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${Sc()}`,notificationType:hn.success})}create(){const T=this.make.tilemap({key:"cloud-city-map"});T.addTilesetImage("Cloud City","tiles");for(let D=0;D({id:"monster_bird_"+c,sprite:D,startPosition:{x:7,y:7+c},speed:5,collides:!1})),...this.monsterBirdShadows.map((D,c)=>({id:"monster_bird_shadow_"+c,sprite:D,startPosition:{x:7,y:7+c},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(T,F),this.loadRanges(),this.playerController=new Cc(this,this.gridEngine,this.quadtree),hE(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!",3e3),this.gridEngine.moveRandomly("npc",1500,3),this.gridEngine.moveRandomly("fishNpc",1500,3);for(let D=0;D<10;D++)this.gridEngine.moveRandomly("monster_bird_"+D,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:D,exitTile:c,enterTile:m})=>{Mc(D)&&this.gridEngine.moveTo("monster_bird_shadow_"+Ac(D),{x:m.x,y:m.y})});const O=(D,c,m)=>{const t=this.gridEngine.getPosition(D.name);Pc.attachNPCEvent(D,c,m,{coords:t})};O(this.npcSprite,"FisherMan",[{label:"Talk"},{label:"Trade"},{label:"Move to"},{label:"Steal"},{label:"Combat"}]),O(this.fishNpcSprite,"Fish NPC Actions",[{label:"Check Fish"},{label:"Move to"}]),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const T=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const E={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Jt.emit("charEvent",E)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const E={message:"Sign does not have much to say.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Jt.emit("charEvent",E)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const E={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Jt.emit("charEvent",E)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const E={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Jt.emit("charEvent",E)}}];for(const E of T)this.quadtree.insert(E)}update(){this.playerController?.handleMovement()}}class BE extends nn.GameObjects.Sprite{textBubble}class vE extends $r.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"CloudCity"});const T={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new os(T)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57})}create(){const T=this.make.tilemap({key:"cloud-city-map-large"});T.addTilesetImage("cloud_tileset","cloud-city-tiles");for(let O=0;O({id:"monster_bird_"+D,sprite:O,startPosition:{x:7,y:7+D},speed:5,collides:!1})),...this.monsterBirdShadows.map((O,D)=>({id:"monster_bird_shadow_"+D,sprite:O,startPosition:{x:7,y:7+D},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(T,F),this.loadRanges(),this.playerController=new Cc(this,this.gridEngine,this.quadtree),lE(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let O=0;O<10;O++)this.gridEngine.moveRandomly("monster_bird_"+O,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:O,exitTile:D,enterTile:c})=>{Mc(O)&&this.gridEngine.moveTo("monster_bird_shadow_"+Ac(O),{x:c.x,y:c.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const T=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const E={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Jt.emit("charEvent",E)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const O={message:`The Database Response time: ${(await(await fetch("https://api.cryptothrone.com/api/v1/speed")).json()).message.time_ms} ms`,character_name:"Planets Be Scalin",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Jt.emit("charEvent",O)}catch(E){console.error("Error fetching data:",E);const F={message:"Sign does not have much to say. Failed to fetch response time.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Jt.emit("charEvent",F)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const E={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Jt.emit("charEvent",E)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const E={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Jt.emit("charEvent",E)}}];for(const E of T)this.quadtree.insert(E)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&Ko(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&Ko(this.fishNpcSprite)}}const pE=Sr.div` +`):" "+Rf(D[0]):"as no adapter specified";throw new Jt("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return R},adapters:Vo};function Ao(S){if(S.cancelToken&&S.cancelToken.throwIfRequested(),S.signal&&S.signal.aborted)throw new xn(null,S)}function Ff(S){return Ao(S),S.headers=bi.from(S.headers),S.data=Po.call(S,S.transformRequest),["post","put","patch"].indexOf(S.method)!==-1&&S.headers.setContentType("application/x-www-form-urlencoded",!1),mc.getAdapter(S.adapter||vh.adapter)(S).then(function(R){return Ao(S),R.data=Po.call(S,S.transformResponse,R),R.headers=bi.from(R.headers),R},function(R){return pc(R)||(Ao(S),R&&R.response&&(R.response.data=Po.call(S,S.transformResponse,R.response),R.response.headers=bi.from(R.response.headers))),Promise.reject(R)})}const Lf=S=>S instanceof bi?S.toJSON():S;function Gs(S,T){T=T||{};const E={};function R(o,v,a){return xt.isPlainObject(o)&&xt.isPlainObject(v)?xt.merge.call({caseless:a},o,v):xt.isPlainObject(v)?xt.merge({},v):xt.isArray(v)?v.slice():v}function O(o,v,a){if(xt.isUndefined(v)){if(!xt.isUndefined(o))return R(void 0,o,a)}else return R(o,v,a)}function D(o,v){if(!xt.isUndefined(v))return R(void 0,v)}function c(o,v){if(xt.isUndefined(v)){if(!xt.isUndefined(o))return R(void 0,o)}else return R(void 0,v)}function m(o,v,a){if(a in T)return R(o,v);if(a in S)return R(void 0,o)}const t={url:D,method:D,data:D,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:m,headers:(o,v)=>O(Lf(o),Lf(v),!0)};return xt.forEach(Object.keys(Object.assign({},S,T)),function(v){const a=t[v]||O,r=a(S[v],T[v],v);xt.isUndefined(r)&&a!==m||(E[v]=r)}),E}const yc="1.6.7",ph={};["object","boolean","number","function","string","symbol"].forEach((S,T)=>{ph[S]=function(R){return typeof R===S||"a"+(T<1?"n ":" ")+S}});const Of={};ph.transitional=function(T,E,R){function O(D,c){return"[Axios v"+yc+"] Transitional option '"+D+"'"+c+(R?". "+R:"")}return(D,c,m)=>{if(T===!1)throw new Jt(O(c," has been removed"+(E?" in "+E:"")),Jt.ERR_DEPRECATED);return E&&!Of[c]&&(Of[c]=!0,console.warn(O(c," has been deprecated since v"+E+" and will be removed in the near future"))),T?T(D,c,m):!0}};function WC(S,T,E){if(typeof S!="object")throw new Jt("options must be an object",Jt.ERR_BAD_OPTION_VALUE);const R=Object.keys(S);let O=R.length;for(;O-- >0;){const D=R[O],c=T[D];if(c){const m=S[D],t=m===void 0||c(m,D,S);if(t!==!0)throw new Jt("option "+D+" must be "+t,Jt.ERR_BAD_OPTION_VALUE);continue}if(E!==!0)throw new Jt("Unknown option "+D,Jt.ERR_BAD_OPTION)}}const Wo={assertOptions:WC,validators:ph},ji=Wo.validators;class Ar{constructor(T){this.defaults=T,this.interceptors={request:new Af,response:new Af}}async request(T,E){try{return await this._request(T,E)}catch(R){if(R instanceof Error){let O;Error.captureStackTrace?Error.captureStackTrace(O={}):O=new Error;const D=O.stack?O.stack.replace(/^.+\n/,""):"";R.stack?D&&!String(R.stack).endsWith(D.replace(/^.+\n.+\n/,""))&&(R.stack+=` +`+D):R.stack=D}throw R}}_request(T,E){typeof T=="string"?(E=E||{},E.url=T):E=T||{},E=Gs(this.defaults,E);const{transitional:R,paramsSerializer:O,headers:D}=E;R!==void 0&&Wo.assertOptions(R,{silentJSONParsing:ji.transitional(ji.boolean),forcedJSONParsing:ji.transitional(ji.boolean),clarifyTimeoutError:ji.transitional(ji.boolean)},!1),O!=null&&(xt.isFunction(O)?E.paramsSerializer={serialize:O}:Wo.assertOptions(O,{encode:ji.function,serialize:ji.function},!0)),E.method=(E.method||this.defaults.method||"get").toLowerCase();let c=D&&xt.merge(D.common,D[E.method]);D&&xt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete D[e]}),E.headers=bi.concat(c,D);const m=[];let t=!0;this.interceptors.request.forEach(function(i){typeof i.runWhen=="function"&&i.runWhen(E)===!1||(t=t&&i.synchronous,m.unshift(i.fulfilled,i.rejected))});const o=[];this.interceptors.response.forEach(function(i){o.push(i.fulfilled,i.rejected)});let v,a=0,r;if(!t){const e=[Ff.bind(this),void 0];for(e.unshift.apply(e,m),e.push.apply(e,o),r=e.length,v=Promise.resolve(E);a{if(!R._listeners)return;let D=R._listeners.length;for(;D-- >0;)R._listeners[D](O);R._listeners=null}),this.promise.then=O=>{let D;const c=new Promise(m=>{R.subscribe(m),D=m}).then(O);return c.cancel=function(){R.unsubscribe(D)},c},T(function(D,c,m){R.reason||(R.reason=new xn(D,c,m),E(R.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(T){if(this.reason){T(this.reason);return}this._listeners?this._listeners.push(T):this._listeners=[T]}unsubscribe(T){if(!this._listeners)return;const E=this._listeners.indexOf(T);E!==-1&&this._listeners.splice(E,1)}static source(){let T;return{token:new gh(function(O){T=O}),cancel:T}}}const YC=gh;function HC(S){return function(E){return S.apply(null,E)}}function KC(S){return xt.isObject(S)&&S.isAxiosError===!0}const Yo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yo).forEach(([S,T])=>{Yo[T]=S});const jC=Yo;function xc(S){const T=new xr(S),E=_d(xr.prototype.request,T);return xt.extend(E,xr.prototype,T,{allOwnKeys:!0}),xt.extend(E,T,null,{allOwnKeys:!0}),E.create=function(O){return xc(Gs(S,O))},E}const ye=xc(vh);ye.Axios=xr;ye.CanceledError=xn;ye.CancelToken=YC;ye.isCancel=pc;ye.VERSION=yc;ye.toFormData=ta;ye.AxiosError=Jt;ye.Cancel=ye.CanceledError;ye.all=function(T){return Promise.all(T)};ye.spread=HC;ye.isAxiosError=KC;ye.mergeConfig=Gs;ye.AxiosHeaders=bi;ye.formToJSON=S=>vc(xt.isHTMLForm(S)?new FormData(S):S);ye.getAdapter=mc.getAdapter;ye.HttpStatusCode=jC;ye.default=ye;const $C={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},ZC={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},Tc={},JC={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},QC={username:"Guest",health:"100",mana:"100",energy:"100",maxHealth:"100",maxMana:"100",maxEnergy:"100",armour:"0",agility:"0",strength:"0",intelligence:"0",experience:"0",reputation:"0",faith:"0"},kC={stats:QC,inventory:ZC,state:JC},qC=S=>{De(async()=>{Le.set({...Le.get(),[S.id]:S})})},_C=S=>{De(async()=>{const T=Le.get(),{[S]:E,...R}=T;Le.set(R)})};function Tn(S,T){return l1(S,T,{encode(E){return JSON.stringify(E)},decode(E){try{return JSON.parse(E)}catch{return T}}})}const ne=Tn("playerData",kC),tE=Tn("quest",$C),Le=Tn("items",Tc),os=Tn("notifications",[]),Sc=Tn("itemDB",Tc),eE=()=>{De(async()=>{try{const T=(await ye.get("https://kbve.com/api/itemdb.json")).data,E={};Object.keys(T.key).forEach(R=>{const O=T.key[R];E[O.id]=O,E[O.name]=O}),Sc.set(E)}catch(S){console.error("Failed to reload item database:",S)}})},iE=S=>Sc.get()[S],sE=S=>{De(async()=>{const T=ne.get();T.inventory.backpack.push(S),ne.set({...T})})},Bi=S=>{const E=Le.get()[S];if(E)return E;console.warn(`Item with ID ${S} not found.`)},nE=S=>{De(async()=>{const T=mh(),E={...S,id:T};qC(E),sE(E.id),Zt.emit("notification",{title:"Success",message:`You got a ${E.name}, verified by E Corp ID ${E.id}`,notificationType:Is.success})})},rE=(S,T)=>{De(async()=>{const E=ne.get(),R=Le.get()[T];if(R){const O=E.inventory.equipment[S];if(O){const D=Le.get()[O];D.equipped=!1,Le.set({...Le.get(),[D.id]:D})}R.equipped=!0,Le.set({...Le.get(),[R.id]:R}),E.inventory.equipment[S]=T,ne.set({...E})}})},aE=S=>{De(async()=>{const T=ne.get(),E=T.inventory.equipment[S];if(E){const R=Le.get()[E];R&&(R.equipped=!1,Le.set({...Le.get(),[R.id]:R}),T.inventory.equipment[S]=null,ne.set({...T}))}})},Df=S=>{De(async()=>{const T=ne.get(),E=Le.get()[S];E&&!E.equipped?(T.inventory.backpack=T.inventory.backpack.filter(R=>R!==S),ne.set({...T}),_C(S)):Zt.emit("notification",{title:"Warning",message:"Cannot remove item that is currently equipped.",notificationType:Is.warning})})},Cc=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.health,10),R=Math.max(E-S,0);T.stats={...T.stats,health:R.toString()},ne.set({...T})})},oE=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.health,10),R=parseInt(T.stats.maxHealth,10),O=Math.min(E+S,R);T.stats={...T.stats,health:O.toString()},ne.set({...T})})},hE=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.mana,10),R=Math.max(E-S,0);T.stats={...T.stats,mana:R.toString()},ne.set({...T})})},lE=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.mana,10),R=parseInt(T.stats.maxMana,10),O=Math.min(E+S,R);T.stats={...T.stats,mana:O.toString()},ne.set({...T})})},uE=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.energy,10),R=Math.max(E-S,0);T.stats={...T.stats,energy:R.toString()},ne.set({...T})})},fE=S=>{De(async()=>{const T=ne.get(),E=parseInt(T.stats.energy,10),R=parseInt(T.stats.maxEnergy,10),O=Math.min(E+S,R);T.stats={...T.stats,energy:O.toString()},ne.set({...T})})},dE=S=>{if(S.health!==void 0){const T=parseInt(S.health,10);T>0?oE(T):Cc(Math.abs(T))}if(S.mana!==void 0){const T=parseInt(S.mana,10);T>0?lE(T):hE(Math.abs(T))}if(S.energy!==void 0){const T=parseInt(S.energy,10);T>0?fE(T):uE(Math.abs(T))}},cE=async S=>{const T=mh();De(async()=>{const E=ne.get();E.state.activeBoosts[T]={...S,expiry:Date.now()+S.duration*1e3},ne.set({...E})})},vE=S=>{De(async()=>{const T=ne.get(),E=S.bonuses,R={health:E?.health!==void 0?E.health.toString():void 0,mana:E?.mana!==void 0?E.mana.toString():void 0,energy:E?.energy!==void 0?E.energy.toString():void 0};dE(R),S.boost&&cE(S.boost),S.action&&console.log(`Action: ${S.action}`),ne.set({...T})})},pE=S=>{const T=Bi(S);if(!T)return[];const E=["view","discard"];return T.consumable&&E.push("consume"),T.equipped?E.push("unequip"):T.consumable||E.push("equip"),E},Is={caution:{type:"caution",color:"bg-yellow-200 border-yellow-300 text-yellow-700",imgUrl:"/assets/icons/notification.svg"},warning:{type:"warning",color:"bg-orange-200 border-orange-300 text-orange-700",imgUrl:"/assets/icons/notification.svg"},danger:{type:"danger",color:"bg-red-200 border-red-300 text-red-700",imgUrl:"/assets/icons/notification.svg"},success:{type:"success",color:"bg-green-200 border-green-300 text-green-700",imgUrl:"/assets/icons/notification.svg"},info:{type:"info",color:"bg-blue-200 border-blue-300 text-blue-700",imgUrl:"/assets/icons/notification.svg"}},Os="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function gE(S,T,E){for(;S.length=0;R--){const O=S%Os.length;E=Os.charAt(O)+E,S=Math.floor(S/Os.length)}return gE(E,T,Os[0])}function mh(){const S=Date.now(),T=xE(S,10),E=yE(16);return T+E}class Ec{constructor(T,E,R){this.scene=T,this.gridEngine=E,this.quadtree=R,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers()}initializeWASDKeys(){const T=this.scene.input.keyboard;T&&(this.wasdKeys={W:T.addKey(Phaser.Input.Keyboard.KeyCodes.W),A:T.addKey(Phaser.Input.Keyboard.KeyCodes.A),S:T.addKey(Phaser.Input.Keyboard.KeyCodes.S),D:T.addKey(Phaser.Input.Keyboard.KeyCodes.D)})}handleConsume(T){const E=Bi(T);E&&E.consumable?(console.log(`Consuming item: ${E.name}`),vE(E),Df(E.id)):console.log(`Item ${T} is not consumable`)}handleEquip(T){const E=Bi(T);E&&(console.log(`Equipping item: ${E.name}`),rE("weapon",E.id))}handleUnequip(T){const E=Bi(T);E&&(console.log(`Unequipping item: ${E.name}`),aE("weapon"))}handleDiscard(T){console.log(`Discarding item: ${T}`),Df(T)}handleView(T){const E=Bi(T);if(E&&(console.log(`Viewing item: ${E.name} with ${E.slug}`),E.slug)){const R=`https://kbve.com/${E.slug}`;window.open(R,"_blank")}}registerEventHandlers(){Zt.on("itemAction",this.handleItemAction.bind(this));//! Broken +Zt.on("playerMove",this.handlePlayerMove.bind(this)),Zt.on("playerSteal",this.handlePlayerSteal.bind(this)),Zt.on("playerReward",this.handlePlayerReward.bind(this)),Zt.on("playerDamage",this.handlePlayerCombatDamage.bind(this))}handleItemAction(T){if(T)switch(console.log(`Preparing Action: ${T.itemId} with ${T.action}`),T.action){case"consume":this.handleConsume(T.itemId);break;case"equip":this.handleEquip(T.itemId);break;case"unequip":this.handleUnequip(T.itemId);break;case"discard":this.handleDiscard(T.itemId);break;case"view":this.handleView(T.itemId);break;default:console.log(`Unknown action: ${T.action}`)}}handlePlayerReward(T){console.log("Rewarding the player"),T&&(Zt.emit("notification",{title:"Success",message:T.message,notificationType:Is.success}),nE(T.item))}handlePlayerCombatDamage(T){T&&(Cc(parseInt(T.damage)),Zt.emit("notification",{title:"Danger",message:`You taken ${T.damage} points of damage!`,notificationType:Is.danger}))}handlePlayerSteal(T){if(T)if(Math.random()>.5){const E=iE("Salmon");E?Zt.emit("playerReward",{message:`You stole a ${E.name}!`,item:E}):console.warn("Item not found in ItemDB")}else Zt.emit("notification",{title:"Danger",message:`You failed to steal from ${T.npcName}!`,notificationType:Is.danger}),Zt.emit("playerDamage",{damage:"1"})}handlePlayerMove(T){T&&this.gridEngine.moveTo("player",{x:T.x,y:T.y})}handleMovement(){if(!this.cursor)return;const T=this.cursor,E=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const R=this.gridEngine.getPosition("player"),O=this.quadtree.query(R);for(const D of O)D.action()}(T.left.isDown||E.A.isDown)&&(T.up.isDown||E.W.isDown)?this.gridEngine.move("player","up-left"):(T.left.isDown||E.A.isDown)&&(T.down.isDown||E.S.isDown)?this.gridEngine.move("player","down-left"):(T.right.isDown||E.D.isDown)&&(T.up.isDown||E.W.isDown)?this.gridEngine.move("player","up-right"):(T.right.isDown||E.D.isDown)&&(T.down.isDown||E.S.isDown)?this.gridEngine.move("player","down-right"):T.left.isDown||E.A.isDown?this.gridEngine.move("player","left"):T.right.isDown||E.D.isDown?this.gridEngine.move("player","right"):T.up.isDown||E.W.isDown?this.gridEngine.move("player","up"):(T.down.isDown||E.S.isDown)&&this.gridEngine.move("player","down")}}class Pc extends Phaser.GameObjects.Container{constructor(T,E,R,O){const D=E.x,c=E.y-E.height+10;super(T,D,c),this.sprite=E;const m=150,t=40+O.length*20;this.background=T.add.rectangle(0,0,m,t,0,.7),this.text=T.add.text(0,-t/2+10,R,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=O.map((o,v)=>{const a=T.add.text(0,-t/2+30+v*20,o.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return a.setInteractive({useHandCursor:!0}),a.on("pointerdown",o.callback),a}),this.add(this.background),this.add(this.text),this.buttons.forEach(o=>this.add(o)),this.scene.add.existing(this)}updatePosition(){this.setPosition(this.sprite.x-30,this.sprite.y-this.sprite.height-this.background.height/2+100)}static attachToSprite(T,E,R,O){E.setInteractive(),E.on("pointerover",()=>{const D={npcId:E.name,npcName:R,actions:O.map(m=>m.label)};if(Zt.emit("npcInteraction",D),!E.getData("tooltipMenu")){const m=new Pc(T,E,R,O);E.setData("tooltipMenu",m)}const c=E.getData("tooltipMenu");c.setVisible(!0),c.updatePosition()}),E.on("pointerout",()=>{const D=E.getData("tooltipMenu");D&&D.setVisible(!1)})}static updateAllTooltipPositions(T){T.children.list.forEach(E=>{if(E instanceof Phaser.GameObjects.Sprite){const R=E.getData("tooltipMenu");R&&R.updatePosition()}})}}let YE=class extends Phaser.GameObjects.Sprite{};function TE(S,T,E,R){const m=S.add.graphics();m.fillStyle(16777215,1),m.fillRoundedRect(0,0,200,60,16),m.setDepth(99);const t=S.add.text(100,30,E,{fontFamily:"Arial",fontSize:16,color:"#000000"});t.setOrigin(.5),t.setWordWrapWidth(200-10*2),t.setDepth(100);const o=S.add.container(0,0,[m,t]);return o.setDepth(100),T.messageBubble=o,CE(T),S.time.addEvent({delay:R,callback:()=>{o.destroy(),T.messageBubble===o&&(T.messageBubble=void 0)},callbackScope:S}),o}function SE(S,T,E){const c=S.add.graphics();c.fillStyle(16777215,1),c.fillRoundedRect(0,0,200,60,16),c.setDepth(99);const m=S.add.text(100,30,E,{fontFamily:"Arial",fontSize:16,color:"#000000"});m.setOrigin(.5),m.setWordWrapWidth(200-10*2),m.setDepth(100);const t=S.add.container(0,0,[c,m]);return t.setDepth(100),T.textBubble=t,Ho(T),t}function Ho(S){const T=S.textBubble;T&&(T.x=S.x,T.y=S.y-S.height-T.height/2)}function CE(S){const T=S.messageBubble;T&&(T.x=S.x,T.y=S.y-S.height-T.height/2)}class EE{constructor(){this.actionHandlers={Talk:this.talkToNPC.bind(this),Trade:this.tradeWithNPC.bind(this),"Move to":this.moveToNPC.bind(this),Steal:this.stealFromNPC.bind(this),Combat:this.startCombat.bind(this),"Check Fish":this.checkFish.bind(this)}}getActionHandler(T){return this.actionHandlers[T]}talkToNPC(T){console.log(`Talking to NPC with ID: ${T.npcId}`)}tradeWithNPC(T){console.log(`Trading with NPC with ID: ${T.npcId}`)}moveToNPC(T){const R=T.data?.coords||{x:10,y:15};Zt.emit("playerMove",R)}stealFromNPC(T){console.log(`Attempting to steal from NPC with ID: ${T.npcId}`);const E={npcId:T.npcId,npcName:T.npcName,data:T.data};Zt.emit("playerSteal",E)}startCombat(T){console.log(`Starting combat with NPC with ID: ${T.npcId}`)}checkFish(T){console.log(`Checking fish for NPC with ID: ${T.npcId}`)}attachNPCEvent(T,E,R,O){T.setInteractive(),T.on("pointerover",()=>{const D={npcId:T.name||"",npcName:E,actions:R.map(c=>c.label),data:O||{}};Zt.emit("npcInteraction",D)}),T.on("pointerout",()=>{})}}const Ac=new EE;function Mc(S){return+S[S.length-1]}function wc(S){return S.startsWith("monster_bird_")&&!S.startsWith("monster_bird_shadow")}function Rc(S,T,E,R,O){const D=[];for(let c=0;c<10;c++){const m=S.add.sprite(0,0,"monster_bird");m.setCrop(T,E,R,O),m.scale=3,D.push(m)}return D}function Fc(S){return Rc(S,0,0,61,47)}function Lc(S){return Rc(S,22,47,16,10)}function Oc(S){S.anims.create({key:"bird",frames:S.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class PE extends $r.Scene{mainMenuButtonImage;mainMenuButtonText;constructor(){super("Preloader")}preload(){this.load.image("mainBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.image("scroll","https://kbve.com/assets/img/fishchip/scroll.webp"),this.load.audio("music","https://kbve.com/assets/img/fishchip/bg.ogg"),this.load.image("creditsBg","https://utfs.io/f/2c17f660-7f39-4edf-b83e-122a71014d99-6gflls.webp"),this.load.audio("type","https://kbve.com/assets/img/fishchip/type.mp3"),this.load.spritesheet("fishing","https://kbve.com/assets/img/fishchip/animate.png",{frameWidth:800,frameHeight:600}),this.load.image("fish","https://kbve.com/assets/img/letter_logo.png"),this.load.image("background","https://kbve.com/assets/img/fishchip/scaled_fish_menu_minigame.webp"),this.load.image("tiles","https://kbve.com/assets/img/fishchip/desert_tileset_1.png"),this.load.image("cloud-city-tiles","/assets/map/cloud_tileset.png"),this.load.tilemapTiledJSON("cloud-city-map-large","/assets/map/cloud_city_large.json"),this.load.tilemapTiledJSON("cloud-city-map","https://kbve.com/assets/img/fishchip/cloud_city.json"),this.load.spritesheet("player","https://kbve.com/assets/img/fishchip/chip_charactersheet_warmer.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("knights","/assets/entity/knights.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("jacko","/assets/entity/jacko.png",{frameWidth:52,frameHeight:72}),this.load.spritesheet("monks","/assets/entity/monks.png",{frameWidth:52,frameHeight:72}),eE()}create(){this.sound.get("music")?.isPlaying||this.sound.add("music",{loop:!0,volume:.1}).play(),this.add.image(480,480,"mainBg").setScale(.1),this.mainMenuButtonImage=this.add.image(480,480,"scroll").setAlpha(.9).setScale(.7,.2).setInteractive({useHandCursor:!0}),this.mainMenuButtonText=this.add.text(480,480,"Start Game",{fontFamily:"Arial Black",fontSize:50,color:"#ffffff",stroke:"#000000",strokeThickness:6}).setOrigin(.5).setInteractive({useHandCursor:!0}),this.mainMenuButtonText.on("pointerdown",()=>{this.scene.start("SandCity")},this)}}let KE=class extends on.GameObjects.Sprite{textBubble;tooltip};class AE extends $r.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"SandCity"});const T={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new fs(T)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),Zt.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${mh()}`,notificationType:Is.success})}create(){const T=this.make.tilemap({key:"cloud-city-map"});T.addTilesetImage("Cloud City","tiles");for(let D=0;D({id:"monster_bird_"+c,sprite:D,startPosition:{x:7,y:7+c},speed:5,collides:!1})),...this.monsterBirdShadows.map((D,c)=>({id:"monster_bird_shadow_"+c,sprite:D,startPosition:{x:7,y:7+c},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(T,R),this.loadRanges(),this.playerController=new Ec(this,this.gridEngine,this.quadtree),TE(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!",3e3),this.gridEngine.moveRandomly("npc",1500,3),this.gridEngine.moveRandomly("fishNpc",1500,3);for(let D=0;D<10;D++)this.gridEngine.moveRandomly("monster_bird_"+D,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:D,exitTile:c,enterTile:m})=>{wc(D)&&this.gridEngine.moveTo("monster_bird_shadow_"+Mc(D),{x:m.x,y:m.y})});const O=(D,c,m)=>{const t=this.gridEngine.getPosition(D.name);Ac.attachNPCEvent(D,c,m,{coords:t})};O(this.npcSprite,"FisherMan",[{label:"Talk"},{label:"Trade"},{label:"Move to"},{label:"Steal"},{label:"Combat"}]),O(this.fishNpcSprite,"Fish NPC Actions",[{label:"Check Fish"},{label:"Move to"}]),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const T=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const E={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Zt.emit("charEvent",E)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const E={message:"Sign does not have much to say.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Zt.emit("charEvent",E)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const E={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Zt.emit("charEvent",E)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const E={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Zt.emit("charEvent",E)}}];for(const E of T)this.quadtree.insert(E)}update(){this.playerController?.handleMovement()}}class $E extends on.GameObjects.Sprite{textBubble}class ME extends $r.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"CloudCity"});const T={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new fs(T)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57})}create(){const T=this.make.tilemap({key:"cloud-city-map-large"});T.addTilesetImage("cloud_tileset","cloud-city-tiles");for(let O=0;O({id:"monster_bird_"+D,sprite:O,startPosition:{x:7,y:7+D},speed:5,collides:!1})),...this.monsterBirdShadows.map((O,D)=>({id:"monster_bird_shadow_"+D,sprite:O,startPosition:{x:7,y:7+D},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(T,R),this.loadRanges(),this.playerController=new Ec(this,this.gridEngine,this.quadtree),SE(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let O=0;O<10;O++)this.gridEngine.moveRandomly("monster_bird_"+O,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:O,exitTile:D,enterTile:c})=>{wc(O)&&this.gridEngine.moveTo("monster_bird_shadow_"+Mc(O),{x:c.x,y:c.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const T=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const E={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Zt.emit("charEvent",E)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const O={message:`The Database Response time: ${(await(await fetch("https://api.cryptothrone.com/api/v1/speed")).json()).message.time_ms} ms`,character_name:"Planets Be Scalin",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Zt.emit("charEvent",O)}catch(E){console.error("Error fetching data:",E);const R={message:"Sign does not have much to say. Failed to fetch response time.",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/woodensign.webp"};Zt.emit("charEvent",R)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const E={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Zt.emit("charEvent",E)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const E={message:"Samson the Great was an amazing sailer, died drinking dat drank.",character_name:"Samson Statue",character_image:"/assets/npc/samson.png",background_image:"/assets/background/animetombstone.webp"};Zt.emit("charEvent",E)}}];for(const E of T)this.quadtree.insert(E)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&Ho(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&Ho(this.fishNpcSprite)}}const wE=Cr.div` // Your style here -`;function gE(){const S=Fe.useRef(null);return Fe.useEffect(()=>{if(S.current){const T=S.current,F={...{title:"CryptoThrone",render:{antialias:!1},scale:{mode:nn.Scale.RESIZE,min:{width:1024,height:768},max:{width:1600,height:1200},zoom:1},type:nn.AUTO,transparent:!0,width:800,height:600,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:w2,mapping:"gridEngine"}]},scene:[dE,cE,vE],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!1}}},parent:T},O=new nn.Game(F);return()=>{O.destroy(!0)}}},[]),St.jsx(pE,{children:St.jsx("div",{ref:S})})}function hs(S,T={}){let E=Fe.useCallback(O=>T.keys?F2(S,T.keys,O):S.listen(O),[T.keys,S]),F=S.get.bind(S);return Fe.useSyncExternalStore(E,F,F)}const Df=bf({message:""}),mE=()=>{const S=hs(Df);Fe.useEffect(()=>{const E=F=>{if(F){Df.set(F);const O=document.querySelector("#hs-stacked-overlays");O&&(O.classList.remove("hidden"),O.classList.add("open"))}};return Jt.on("charEvent",E),()=>{Jt.off("charEvent",E)}},[]);const T=()=>{const E=document.querySelector("#hs-stacked-overlays");E&&(E.classList.add("hidden"),E.classList.remove("open"))};return St.jsx(St.Fragment,{children:St.jsx("div",{id:"hs-stacked-overlays",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 hidden size-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:St.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto",children:St.jsxs("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover",style:{backgroundImage:`url(${S.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[St.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[St.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${S.character_name||"NPC"}`}),St.jsx("img",{src:S.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),St.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[St.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[St.jsx("h3",{className:"font-bold text-yellow-400",children:""}),St.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:T,children:[St.jsx("span",{className:"sr-only",children:"Close"}),St.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[St.jsx("path",{d:"M18 6 6 18"}),St.jsx("path",{d:"m6 6 12 12"})]})]})]}),St.jsx("div",{className:"p-4 overflow-y-auto",children:St.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:S.message||"No Message"})}),St.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:St.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:T,children:[St.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),St.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},xE=(S,T)=>{const E=ia(S);return E?St.jsxs("div",{style:{top:T.y,left:T.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[St.jsx("p",{className:"text-sm font-semibold",children:E.name}),St.jsxs("p",{className:"text-xs",children:["Type: ",E.type]}),St.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(E.bonuses)]}),St.jsxs("p",{className:"text-xs",children:["Durability: ",E.durability]}),St.jsxs("p",{className:"text-xs",children:["Weight: ",E.weight]})]}):null},yE=(S,T,E,F)=>St.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(S).map(O=>{const D=S[O];return TE(D,T,E,F)})}),TE=(S,T,E,F)=>{if(!S)return St.jsx("li",{className:"text-sm relative flex items-center justify-center border border-gray-500 bg-gray-200",style:{width:"32px",height:"32px"}},`empty-${Math.random()}`);const O=ia(S);return O?St.jsxs("li",{className:"text-sm relative",onMouseEnter:D=>T(O.id,D),onMouseLeave:E,onClick:D=>F(O.id,D),children:[O.name," (",O.type,") - Bonuses: ",JSON.stringify(O.bonuses)," - Durability: ",O.durability," - Weight: ",O.weight]},O.id):null},SE=(S,T,E,F)=>St.jsx("ul",{className:"grid grid-cols-8 gap-1",children:S.map((O,D)=>{const c=ia(O);return c?St.jsx("li",{className:"text-sm relative",onMouseEnter:m=>T(c.id,m),onMouseLeave:E,onClick:m=>F(c.id,m),children:St.jsx("img",{src:c.img,alt:c.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},D):null})}),tn=(S,T)=>{const E=ia(S);E&&Jt.emit("itemAction",{itemId:E.id,action:T})},CE=()=>{const S=hs(Is);hs(qC),hs(Ar);const[T,E]=Fe.useState(null),[F,O]=Fe.useState({x:0,y:0}),[D,c]=Fe.useState(null),[m,t]=Fe.useState({x:0,y:0});Fe.useEffect(()=>{const n=e=>{};return Jt.on("playerEvent",n),()=>{Jt.off("playerEvent",n)}},[]);const o=(n,e)=>{E(n),O({x:e.clientX+10,y:e.clientY-100})},v=()=>{E(null)},a=(n,e)=>{c(n),t({x:e.clientX,y:e.clientY-100})},r=()=>{c(null)};return!S||!S.stats?null:St.jsxs("div",{className:"transition transform ease-in-out duration-500 opacity-50 hover:opacity-100 fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20",children:[St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),St.jsx("p",{className:"text-sm text-green-400",children:`HP: ${S.stats.health||"0"} / ${S.stats.maxHealth}`}),St.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${S.stats.mana||"0"} / ${S.stats.maxMana}`}),St.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${S.stats.energy||"0"} / ${S.stats.maxEnergy}`})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),St.jsx("p",{className:"text-sm",children:S.stats.username||"Guest"})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),St.jsx("p",{className:"text-sm",children:""})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),SE(S.inventory.backpack,o,v,a)]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),yE(S.inventory.equipment,o,v,a)]}),T&&xE(T,F),D&&St.jsxs("div",{style:{top:m.y,left:m.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[St.jsx("button",{onClick:r,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),St.jsx("p",{className:"text-sm strong",children:"Actions:"}),St.jsxs("ul",{className:"text-xs",children:[St.jsx("li",{onClick:()=>tn(D,"consume"),className:"cursor-pointer hover:bg-gray-600",children:"Consume"}),St.jsx("li",{onClick:()=>tn(D,"equip"),className:"cursor-pointer hover:bg-gray-600",children:"Equip"}),St.jsx("li",{onClick:()=>tn(D,"unequip"),className:"cursor-pointer hover:bg-gray-600",children:"Unequip"}),St.jsx("li",{onClick:()=>tn(D,"discard"),className:"cursor-pointer hover:bg-gray-600",children:"Discard"}),St.jsx("li",{onClick:()=>tn(D,"view"),className:"cursor-pointer hover:bg-gray-600",children:"View"}),St.jsx("li",{onClick:r,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})},If=bf(null),EE=()=>{const S=hs(If);hs(Is),Fe.useEffect(()=>{const E=F=>{F&&If.set(F)};return Jt.on("npcInteraction",E),()=>{Jt.off("npcInteraction",E)}},[]);const T=E=>{if(S){const F=Pc.getActionHandler(E);F&&F(S)}};return St.jsx("div",{className:"transition ease-in-out duration-500 opacity-50 hover:opacity-100 fixed top-12 right-0 transform translate-y-12 -translate-x-10 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-50",children:St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Actions"}),S&&S.npcName?St.jsxs("div",{className:"mb-4",children:[St.jsx("h3",{className:"text-md font-semibold",children:`Actions for ${S.npcName}`}),S.actions.map((E,F)=>St.jsxs("button",{className:"relative w-full m-1 p-2 px-5 py-3 overflow-hidden font-medium text-yellow-600 bg-yellow-100 border border-yellow-100 rounded-lg shadow-inner group",onClick:()=>T(E),children:[St.jsx("span",{className:"absolute top-0 left-0 w-0 h-0 transition-all duration-200 border-t-2 border-yellow-600 group-hover:w-full ease"}),St.jsx("span",{className:"absolute bottom-0 right-0 w-0 h-0 transition-all duration-200 border-b-2 border-yellow-600 group-hover:w-full ease"}),St.jsx("span",{className:"absolute top-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-yellow-600 group-hover:h-full ease"}),St.jsx("span",{className:"absolute bottom-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-yellow-600 group-hover:h-full ease"}),St.jsx("span",{className:"absolute inset-0 w-full h-full duration-300 delay-300 bg-yellow-900 opacity-0 group-hover:opacity-100"}),St.jsx("span",{className:"relative transition-colors duration-300 delay-200 group-hover:text-white ease",children:E})]},F))]}):St.jsx("div",{children:St.jsx("p",{children:"No actions available"})})]})})},PE=()=>{const S=hs(ss);Fe.useEffect(()=>{const E=F=>{if(F){const O=Date.now()+Math.random();ss.set([...ss.get(),{id:O,...F}]),setTimeout(()=>{ss.set(ss.get().filter(D=>D.id!==O))},5e3)}};return Jt.on("notification",E),()=>{Jt.off("notification",E)}},[]);const T=E=>{ss.set(ss.get().filter(F=>F.id!==E))};return St.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(S)&&S.map(E=>St.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${E.notificationType.color}`,role:"alert",children:St.jsxs("div",{className:"flex p-4",children:[St.jsx("img",{src:E.notificationType.imgUrl,alt:E.notificationType.type,className:"flex-shrink-0 size-4"}),St.jsxs("div",{className:"ms-2",children:[St.jsx("h3",{className:"text-sm font-bold",children:E.title}),St.jsx("p",{className:"text-sm",children:E.message})]}),St.jsx("div",{className:"ms-auto",children:St.jsxs("button",{type:"button",className:"inline-flex flex-shrink-0 justify-center items-center size-5 rounded-lg text-gray-800 opacity-50 hover:opacity-100 focus:outline-none focus:opacity-100 dark:text-white",onClick:()=>T(E.id),children:[St.jsx("span",{className:"sr-only",children:"Close"}),St.jsxs("svg",{className:"flex-shrink-0 size-4 bg-zinc-900",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[St.jsx("path",{d:"M18 6 6 18"}),St.jsx("path",{d:"m6 6 12 12"})]})]})})]})},E.id))})},AE=Sr.div` +`;function RE(){const S=Oe.useRef(null);return Oe.useEffect(()=>{if(S.current){const T=S.current,R={...{title:"CryptoThrone",render:{antialias:!1},scale:{mode:on.Scale.RESIZE,min:{width:1024,height:768},max:{width:1600,height:1200},zoom:1},type:on.AUTO,transparent:!0,width:800,height:600,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:R2,mapping:"gridEngine"}]},scene:[PE,AE,ME],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!1}}},parent:T},O=new on.Game(R);return()=>{O.destroy(!0)}}},[]),St.jsx(wE,{children:St.jsx("div",{ref:S})})}function ds(S,T={}){let E=Oe.useCallback(O=>T.keys?L2(S,T.keys,O):S.listen(O),[T.keys,S]),R=S.get.bind(S);return Oe.useSyncExternalStore(E,R,R)}const If=Nf({message:""}),FE=()=>{const S=ds(If);Oe.useEffect(()=>{const E=R=>{if(R){If.set(R);const O=document.querySelector("#hs-stacked-overlays");O&&(O.classList.remove("hidden"),O.classList.add("open"))}};return Zt.on("charEvent",E),()=>{Zt.off("charEvent",E)}},[]);const T=()=>{const E=document.querySelector("#hs-stacked-overlays");E&&(E.classList.add("hidden"),E.classList.remove("open"))};return St.jsx(St.Fragment,{children:St.jsx("div",{id:"hs-stacked-overlays",className:"hs-overlay hs-overlay-backdrop-open:bg-gray-900/50 hidden size-full fixed top-0 start-0 z-[60] overflow-x-hidden overflow-y-auto pointer-events-none [--overlay-backdrop:static]","data-hs-overlay-keyboard":"false",children:St.jsx("div",{className:"hs-overlay-open:mt-7 hs-overlay-open:opacity-100 hs-overlay-open:duration-500 mt-0 opacity-0 ease-out transition-all sm:max-w-lg sm:w-full m-3 sm:mx-auto",children:St.jsxs("div",{className:"flex flex-col lg:flex-row bg-zinc-950 border border-yellow-500 shadow-sm rounded-xl pointer-events-auto bg-cover",style:{backgroundImage:`url(${S.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[St.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[St.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${S.character_name||"NPC"}`}),St.jsx("img",{src:S.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),St.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[St.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[St.jsx("h3",{className:"font-bold text-yellow-400",children:""}),St.jsxs("button",{type:"button",className:"flex justify-center items-center size-7 text-sm font-semibold rounded-full border border-transparent text-yellow-400 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:T,children:[St.jsx("span",{className:"sr-only",children:"Close"}),St.jsxs("svg",{className:"flex-shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[St.jsx("path",{d:"M18 6 6 18"}),St.jsx("path",{d:"m6 6 12 12"})]})]})]}),St.jsx("div",{className:"p-4 overflow-y-auto",children:St.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:S.message||"No Message"})}),St.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:St.jsxs("button",{className:"relative rounded px-5 py-2.5 overflow-hidden group bg-yellow-500 relative hover:bg-gradient-to-r hover:from-yellow-500 hover:to-yellow-400 text-white hover:ring-2 hover:ring-offset-2 hover:ring-yellow-400 transition-all ease-out duration-300 disabled:pointer-events-none","data-hs-overlay":"#hs-stacked-overlays",onClick:T,children:[St.jsx("span",{className:"absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"}),St.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},LE=(S,T)=>{const E=Bi(S);return E?St.jsxs("div",{style:{top:T.y,left:T.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[St.jsx("p",{className:"text-sm font-semibold",children:E.name}),St.jsxs("p",{className:"text-xs",children:["Type: ",E.type]}),St.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(E.bonuses)]}),St.jsxs("p",{className:"text-xs",children:["Durability: ",E.durability]}),St.jsxs("p",{className:"text-xs",children:["Weight: ",E.weight]})]}):null},OE=(S,T,E,R)=>St.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(S).map(O=>{const D=S[O];return DE(D,T,E,R)})}),DE=(S,T,E,R)=>{if(!S)return St.jsx("li",{className:"text-sm relative flex items-center justify-center border border-gray-500 bg-gray-200",style:{width:"32px",height:"32px"}},`empty-${Math.random()}`);const O=Bi(S);return O?St.jsxs("li",{className:"text-sm relative",onMouseEnter:D=>T(O.id,D),onMouseLeave:E,onClick:D=>R(O.id,D),children:[O.name," (",O.type,") - Bonuses: ",JSON.stringify(O.bonuses)," - Durability: ",O.durability," - Weight: ",O.weight]},O.id):null},IE=(S,T,E,R)=>St.jsx("ul",{className:"grid grid-cols-8 gap-1",children:S.map((O,D)=>{const c=Bi(O);return c?St.jsx("li",{className:"text-sm relative",onMouseEnter:m=>T(c.id,m),onMouseLeave:E,onClick:m=>R(c.id,m),children:St.jsx("img",{src:c.img,alt:c.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},D):null})}),BE=(S,T)=>{const E=Bi(S);if(E){const R={itemId:E.id,action:T};Zt.emit("itemAction",R)}},bE=()=>{const S=ds(ne);ds(tE),ds(Le);const[T,E]=Oe.useState(null),[R,O]=Oe.useState({x:0,y:0}),[D,c]=Oe.useState(null),[m,t]=Oe.useState({x:0,y:0});Oe.useEffect(()=>{const e=i=>{};return Zt.on("playerEvent",e),()=>{Zt.off("playerEvent",e)}},[]);const o=(e,i)=>{E(e),O({x:i.clientX+10,y:i.clientY-100})},v=()=>{E(null)},a=(e,i)=>{c(e),t({x:i.clientX,y:i.clientY-100})},r=()=>{c(null)};if(!S||!S.stats)return null;const n=D?pE(D):[];return St.jsxs("div",{className:"transition transform ease-in-out duration-500 opacity-50 hover:opacity-100 fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20",children:[St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),St.jsx("p",{className:"text-sm text-green-400",children:`HP: ${S.stats.health||"0"} / ${S.stats.maxHealth}`}),St.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${S.stats.mana||"0"} / ${S.stats.maxMana}`}),St.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${S.stats.energy||"0"} / ${S.stats.maxEnergy}`})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),St.jsx("p",{className:"text-sm",children:S.stats.username||"Guest"})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),St.jsx("p",{className:"text-sm",children:""})]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),IE(S.inventory.backpack,o,v,a)]}),St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),OE(S.inventory.equipment,o,v,a)]}),T&&LE(T,R),D&&St.jsxs("div",{style:{top:m.y,left:m.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[St.jsx("button",{onClick:r,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),St.jsx("p",{className:"text-sm strong",children:"Actions:"}),St.jsxs("ul",{className:"text-xs",children:[n.map(e=>St.jsx("li",{onClick:()=>BE(D,e),className:"cursor-pointer hover:bg-gray-600",children:e.charAt(0).toUpperCase()+e.slice(1)},e)),St.jsx("li",{onClick:r,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})},Bf=Nf(null),NE=()=>{const S=ds(Bf);ds(ne),Oe.useEffect(()=>{const E=R=>{R&&Bf.set(R)};return Zt.on("npcInteraction",E),()=>{Zt.off("npcInteraction",E)}},[]);const T=E=>{if(S){const R=Ac.getActionHandler(E);R&&R(S)}};return St.jsx("div",{className:"transition ease-in-out duration-500 opacity-50 hover:opacity-100 fixed top-12 right-0 transform translate-y-12 -translate-x-10 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-50",children:St.jsxs("div",{className:"mb-4",children:[St.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Actions"}),S&&S.npcName?St.jsxs("div",{className:"mb-4",children:[St.jsx("h3",{className:"text-md font-semibold",children:`Actions for ${S.npcName}`}),S.actions.map((E,R)=>St.jsxs("button",{className:"relative w-full m-1 p-2 px-5 py-3 overflow-hidden font-medium text-yellow-600 bg-yellow-100 border border-yellow-100 rounded-lg shadow-inner group",onClick:()=>T(E),children:[St.jsx("span",{className:"absolute top-0 left-0 w-0 h-0 transition-all duration-200 border-t-2 border-yellow-600 group-hover:w-full ease"}),St.jsx("span",{className:"absolute bottom-0 right-0 w-0 h-0 transition-all duration-200 border-b-2 border-yellow-600 group-hover:w-full ease"}),St.jsx("span",{className:"absolute top-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-yellow-600 group-hover:h-full ease"}),St.jsx("span",{className:"absolute bottom-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-yellow-600 group-hover:h-full ease"}),St.jsx("span",{className:"absolute inset-0 w-full h-full duration-300 delay-300 bg-yellow-900 opacity-0 group-hover:opacity-100"}),St.jsx("span",{className:"relative transition-colors duration-300 delay-200 group-hover:text-white ease",children:E})]},R))]}):St.jsx("div",{children:St.jsx("p",{children:"No actions available"})})]})})},GE=()=>{const S=ds(os);Oe.useEffect(()=>{const E=R=>{if(R){const O=Date.now()+Math.random();os.set([...os.get(),{id:O,...R}]),setTimeout(()=>{os.set(os.get().filter(D=>D.id!==O))},5e3)}};return Zt.on("notification",E),()=>{Zt.off("notification",E)}},[]);const T=E=>{os.set(os.get().filter(R=>R.id!==E))};return St.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(S)&&S.map(E=>St.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${E.notificationType.color}`,role:"alert",children:St.jsxs("div",{className:"flex p-4",children:[St.jsx("img",{src:E.notificationType.imgUrl,alt:E.notificationType.type,className:"flex-shrink-0 size-4"}),St.jsxs("div",{className:"ms-2",children:[St.jsx("h3",{className:"text-sm font-bold",children:E.title}),St.jsx("p",{className:"text-sm",children:E.message})]}),St.jsx("div",{className:"ms-auto",children:St.jsxs("button",{type:"button",className:"inline-flex flex-shrink-0 justify-center items-center size-5 rounded-lg text-gray-800 opacity-50 hover:opacity-100 focus:outline-none focus:opacity-100 dark:text-white",onClick:()=>T(E.id),children:[St.jsx("span",{className:"sr-only",children:"Close"}),St.jsxs("svg",{className:"flex-shrink-0 size-4 bg-zinc-900",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[St.jsx("path",{d:"M18 6 6 18"}),St.jsx("path",{d:"m6 6 12 12"})]})]})})]})},E.id))})},zE=Cr.div` // Your style here -`;function bE(){return St.jsxs(AE,{children:[St.jsx(CE,{}),St.jsx("div",{className:"flex justify-center items-center h-screen",children:St.jsxs("div",{className:"border-4 border-yellow-500 rounded-xl",children:[St.jsx(gE,{}),St.jsx(PE,{})]})}),St.jsx(EE,{}),St.jsx(mE,{})]})}export{bE as default}; +`;function ZE(){return St.jsxs(zE,{children:[St.jsx(bE,{}),St.jsx("div",{className:"flex justify-center items-center h-screen",children:St.jsxs("div",{className:"border-4 border-yellow-500 rounded-xl",children:[St.jsx(RE,{}),St.jsx(GE,{})]})}),St.jsx(NE,{}),St.jsx(FE,{})]})}export{ZE as default}; diff --git a/docs/index.html b/docs/index.html index 772b2e1..071a56b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,7 @@ Team Account Log in -