diff --git a/docs/_astro/App.BGEdSnm-.js b/docs/_astro/App.BGEdSnm-.js new file mode 100644 index 0000000..2db7c63 --- /dev/null +++ b/docs/_astro/App.BGEdSnm-.js @@ -0,0 +1,10216 @@ +import{j as he}from"./jsx-runtime.BFYNFNPI.js";import{g as Wd,r as Am,a as Pe,c as py}from"./index.DIpCM_17.js";import{p as CL,a as Rx}from"./index.DxhZiom7.js";import{t as Dr}from"./index.BH1EYZ08.js";var TM={exports:{}},on={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bx=Symbol.for("react.element"),Lx=Symbol.for("react.portal"),Pm=Symbol.for("react.fragment"),Rm=Symbol.for("react.strict_mode"),bm=Symbol.for("react.profiler"),Lm=Symbol.for("react.provider"),Fm=Symbol.for("react.context"),wL=Symbol.for("react.server_context"),Om=Symbol.for("react.forward_ref"),Dm=Symbol.for("react.suspense"),Im=Symbol.for("react.suspense_list"),Nm=Symbol.for("react.memo"),Bm=Symbol.for("react.lazy"),AL=Symbol.for("react.offscreen"),EM;EM=Symbol.for("react.module.reference");function Aa(g){if(typeof g=="object"&&g!==null){var t=g.$$typeof;switch(t){case bx:switch(g=g.type,g){case Pm:case bm:case Rm:case Dm:case Im:return g;default:switch(g=g&&g.$$typeof,g){case wL:case Fm:case Om:case Bm:case Nm:case Lm:return g;default:return t}}case Lx:return t}}}on.ContextConsumer=Fm;on.ContextProvider=Lm;on.Element=bx;on.ForwardRef=Om;on.Fragment=Pm;on.Lazy=Bm;on.Memo=Nm;on.Portal=Lx;on.Profiler=bm;on.StrictMode=Rm;on.Suspense=Dm;on.SuspenseList=Im;on.isAsyncMode=function(){return!1};on.isConcurrentMode=function(){return!1};on.isContextConsumer=function(g){return Aa(g)===Fm};on.isContextProvider=function(g){return Aa(g)===Lm};on.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===bx};on.isForwardRef=function(g){return Aa(g)===Om};on.isFragment=function(g){return Aa(g)===Pm};on.isLazy=function(g){return Aa(g)===Bm};on.isMemo=function(g){return Aa(g)===Nm};on.isPortal=function(g){return Aa(g)===Lx};on.isProfiler=function(g){return Aa(g)===bm};on.isStrictMode=function(g){return Aa(g)===Rm};on.isSuspense=function(g){return Aa(g)===Dm};on.isSuspenseList=function(g){return Aa(g)===Im};on.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===Pm||g===bm||g===Rm||g===Dm||g===Im||g===AL||typeof g=="object"&&g!==null&&(g.$$typeof===Bm||g.$$typeof===Nm||g.$$typeof===Lm||g.$$typeof===Fm||g.$$typeof===Om||g.$$typeof===EM||g.getModuleId!==void 0)};on.typeOf=Aa;TM.exports=on;var MM=TM.exports;function PL(g){function t(tt,Y,Z,U,H){for(var J=0,_=0,q=0,at=0,ot,rt,gt=0,yt=0,Et,At=Et=ot=0,Pt=0,Vt=0,dt=0,ut=0,Rt=Z.length,Dt=Rt-1,Ht,Bt="",ne="",oe="",ge="",xe;Ptot)&&(ut=(Bt=Bt.replace(" ",":")).length),0U&&(U=(Y=Y.trim()).charCodeAt(0)),U){case 38:return Y.replace(o,"$1"+tt.trim());case 58:return tt.trim()+Y.replace(o,"$1"+tt.trim());default:if(0<1*Z&&0_.charCodeAt(8))break;case 115:H=H.replace(_,"-webkit-"+_)+";"+H;break;case 207:case 102:H=H.replace(_,"-webkit-"+(102Z.charCodeAt(0)&&(Z=Z.trim()),Q=Z,Z=[Q],01?t-1:0),x=1;x0?" Args: "+i.join(", "):""))}var jL=function(){function g(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var t=g.prototype;return t.indexOfGroup=function(i){for(var x=0,T=0;T=this.groupSizes.length){for(var T=this.groupSizes,E=T.length,s=E;i>=s;)(s<<=1)<0&&Xd(16,""+i);this.groupSizes=new Uint32Array(s),this.groupSizes.set(T),this.length=s;for(var y=E;y=this.length||this.groupSizes[i]===0)return x;for(var T=this.groupSizes[i],E=this.indexOfGroup(i),s=E+T,y=E;y=rd&&(rd=t+1),Zv.set(g,t),fm.set(t,g)},$L="style["+Yf+'][data-styled-version="5.3.6"]',QL=new RegExp("^"+Yf+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),_L=function(g,t,i){for(var x,T=i.split(","),E=0,s=T.length;E=0;r--){var p=e[r];if(p&&p.nodeType===1&&p.hasAttribute(Yf))return p}}(i),E=T!==void 0?T.nextSibling:null;x.setAttribute(Yf,"active"),x.setAttribute("data-styled-version","5.3.6");var s=tF();return s&&x.setAttribute("nonce",s),i.insertBefore(x,E),x},eF=function(){function g(i){var x=this.element=RM(i);x.appendChild(document.createTextNode("")),this.sheet=function(T){if(T.sheet)return T.sheet;for(var E=document.styleSheets,s=0,y=E.length;s=0){var T=document.createTextNode(x),E=this.nodes[i];return this.element.insertBefore(T,E||null),this.length++,!0}return!1},t.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},t.getRule=function(i){return i0&&(h+=a+",")}),E+=""+r+p+'{content:"'+h+`"}/*!sc*/ +`}}}return E}(this)},g}(),sF=/(a)(d)/gi,YS=function(g){return String.fromCharCode(g+(g>25?39:97))};function my(g){var t,i="";for(t=Math.abs(g);t>52;t=t/52|0)i=YS(t%52)+i;return(YS(t%52)+i).replace(sF,"$1-$2")}var Df=function(g,t){for(var i=t.length;i;)g=33*g^t.charCodeAt(--i);return g},LM=function(g){return Df(5381,g)};function aF(g){for(var t=0;t>>0);if(!i.hasNameForId(T,y)){var e=x(s,"."+y,void 0,T);i.insertRules(T,y,e)}E.push(y),this.staticRulesId=y}else{for(var r=this.rules.length,p=Df(this.baseHash,x.hash),h="",a=0;a>>0);if(!i.hasNameForId(T,f)){var o=x(h,"."+f,void 0,T);i.insertRules(T,f,o)}E.push(f)}}return E.join(" ")},g}(),hF=/^\s*\/\/.*$/gm,uF=[":","[",".","#"];function fF(g){var t,i,x,T,E=g===void 0?lh:g,s=E.options,y=s===void 0?lh:s,e=E.plugins,r=e===void 0?um:e,p=new PL(y),h=[],a=function(u){function f(o){if(o)try{u(o+"}")}catch{}}return function(o,c,d,v,m,S,M,w,C,A){switch(o){case 1:if(C===0&&c.charCodeAt(0)===64)return u(c+";"),"";break;case 2:if(w===0)return c+"/*|*/";break;case 3:switch(w){case 102:case 112:return u(d[0]+c),"";default:return c+(A===0?"/*|*/":"")}case-2:c.split("/*|*/}").forEach(f)}}}(function(u){h.push(u)}),l=function(u,f,o){return f===0&&uF.indexOf(o[i.length])!==-1||o.match(T)?u:"."+t};function n(u,f,o,c){c===void 0&&(c="&");var d=u.replace(hF,""),v=f&&o?o+" "+f+" { "+d+" }":d;return t=c,i=f,x=new RegExp("\\"+i+"\\b","g"),T=new RegExp("(\\"+i+"\\b){2,}"),p(o||!f?"":f,v)}return p.use([].concat(r,[function(u,f,o){u===2&&o.length&&o[0].lastIndexOf(i)>0&&(o[0]=o[0].replace(x,l))},a,function(u){if(u===-2){var f=h;return h=[],f}}])),n.hash=r.length?r.reduce(function(u,f){return f.name||Xd(15),Df(u,f.name)},5381).toString():"",n}var FM=Am.createContext();FM.Consumer;var OM=Am.createContext(),cF=(OM.Consumer,new bM),gy=fF();function dF(){return Pe.useContext(FM)||cF}function pF(){return Pe.useContext(OM)||gy}var vF=function(){function g(t,i){var x=this;this.inject=function(T,E){E===void 0&&(E=gy);var s=x.name+E.hash;T.hasNameForId(x.id,s)||T.insertRules(x.id,s,E(x.rules,s,"@keyframes"))},this.toString=function(){return Xd(12,String(x.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=i}return g.prototype.getName=function(t){return t===void 0&&(t=gy),this.name+t.hash},g}(),mF=/([A-Z])/,gF=/([A-Z])/g,yF=/^ms-/,xF=function(g){return"-"+g.toLowerCase()};function kS(g){return mF.test(g)?g.replace(gF,xF).replace(yF,"-ms-"):g}var KS=function(g){return g==null||g===!1||g===""};function kf(g,t,i,x){if(Array.isArray(g)){for(var T,E=[],s=0,y=g.length;s1?t-1:0),x=1;x?@[\\\]^`{|}~-]+/g,MF=/(^-|-$)/g;function l0(g){return g.replace(EF,"-").replace(MF,"")}var CF=function(g){return my(LM(g)>>>0)};function _p(g){return typeof g=="string"&&!0}var yy=function(g){return typeof g=="function"||typeof g=="object"&&g!==null&&!Array.isArray(g)},wF=function(g){return g!=="__proto__"&&g!=="constructor"&&g!=="prototype"};function AF(g,t,i){var x=g[i];yy(t)&&yy(x)?DM(x,t):g[i]=t}function DM(g){for(var t=arguments.length,i=new Array(t>1?t-1:0),x=1;x=0||(A[w]=S[w]);return A}(t,["componentId"]),m=d&&d+"-"+(_p(c)?c:l0(WS(c)));return NM(c,gl({},v,{attrs:a,componentId:m}),i)},Object.defineProperty(n,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(c){this._foldedDefaultProps=x?DM({},g.defaultProps,c):c}}),n.toString=function(){return"."+n.styledComponentId},T&&kL(n,g,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),n}var cm=function(g){return function t(i,x,T){if(T===void 0&&(T=lh),!MM.isValidElementType(x))return Xd(1,String(x));var E=function(){return i(x,T,SF.apply(void 0,arguments))};return E.withConfig=function(s){return t(i,x,gl({},T,{},s))},E.attrs=function(s){return t(i,x,gl({},T,{attrs:Array.prototype.concat(T.attrs,s).filter(Boolean)}))},E}(NM,g)};["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(g){cm[g]=cm(g)});var BM={exports:{}};(function(g,t){(function(x,T){g.exports=T()})(py,()=>(()=>{var i={50792:s=>{var y=Object.prototype.hasOwnProperty,e="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(e=!1));function p(n,u,f){this.fn=n,this.context=u,this.once=f||!1}function h(n,u,f,o,c){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new p(f,o||n,c),v=e?e+u:u;return n._events[v]?n._events[v].fn?n._events[v]=[n._events[v],d]:n._events[v].push(d):(n._events[v]=d,n._eventsCount++),n}function a(n,u){--n._eventsCount===0?n._events=new r:delete n._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,o;if(this._eventsCount===0)return u;for(o in f=this._events)y.call(f,o)&&u.push(e?o.slice(1):o);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=e?e+u:u,o=this._events[f];if(!o)return[];if(o.fn)return[o.fn];for(var c=0,d=o.length,v=new Array(d);c{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38829),p=function(h,a,l,n){for(var u=h[0],f=1;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"angle",a,l,n,u)};s.exports=p},60757:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=0);for(var h=p;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=0);for(var h=e.length-1;h>=p;h--){var a=e[h],l=!0;for(var n in r)a[n]!==r[n]&&(l=!1);if(l)return a}return null};s.exports=y},94420:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(11879),p=e(60461),h=e(95540),a=e(29747),l=e(41481),n=new l({sys:{queueDepthSort:a,events:{once:a}}},0,0,1,1).setOrigin(0,0),u=function(f,o){o===void 0&&(o={});var c=o.hasOwnProperty("width"),d=o.hasOwnProperty("height"),v=h(o,"width",-1),m=h(o,"height",-1),S=h(o,"cellWidth",1),M=h(o,"cellHeight",S),w=h(o,"position",p.TOP_LEFT),C=h(o,"x",0),A=h(o,"y",0),P=0,b=0,O=v*S,I=m*M;n.setPosition(C,A),n.setSize(S,M);for(var D=0;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"alpha",a,l,n,u)};s.exports=p},67285:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"x",a,l,n,u)};s.exports=p},9074:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"x",a,n,f,o),r(h,"y",l,u,f,o)};s.exports=p},75222:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"y",a,l,n,u)};s.exports=p},22983:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var a=p,l=(h-p)/e.length,n=r.x,u=r.y,f=r.radius,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var a=p,l=(h-p)/e.length,n=r.width/2,u=r.height/2,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15258),p=e(26708),h=function(a,l,n){var u;n?u=p(l,n,a.length):u=r(l,a.length);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14649),p=e(86003),h=e(49498),a=function(l,n,u){u===void 0&&(u=0);var f=r(n,!1,l.length);u>0?p(f,u):u<0&&h(f,Math.abs(u));for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84993),p=function(h,a,l){var n=r({x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},l),u=r({x1:a.x2,y1:a.y2,x2:a.x3,y2:a.y3},l),f=r({x1:a.x3,y1:a.y3,x2:a.x1,y2:a.y1},l);n.pop(),u.pop(),f.pop(),n=n.concat(u,f);for(var o=n.length/h.length,c=0,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=1);var n,u=0,f=e.length;if(l===1)for(n=a;n=0;n--)e[n][r]+=p+u*h,u++;return e};s.exports=y},43967:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=1);var n,u=0,f=e.length;if(l===1)for(n=a;n=0;n--)e[n][r]=p+u*h,u++;return e};s.exports=y},88926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28176),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(24820),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65822),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26597),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90260),p=function(h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"rotation",a,l,n,u)};s.exports=p},91051:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1163),p=e(20339),h=function(a,l,n){for(var u=l.x,f=l.y,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1163),p=function(h,a,l,n){var u=a.x,f=a.y;if(n===0)return h;for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"scaleX",a,l,n,u)};s.exports=p},94868:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scaleX",a,n,f,o),r(h,"scaleY",l,u,f,o)};s.exports=p},95532:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66979),p=function(h,a,l,n,u){return r(h,"scaleY",a,l,n,u)};s.exports=p},8689:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"alpha",a,l,n,u)};s.exports=p},2645:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n){return r(h,"blendMode",a,0,l,n)};s.exports=p},32372:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"depth",a,l,n,u)};s.exports=p},85373:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"originX",a,n,f,o),r(h,"originY",l,u,f,o),h.forEach(function(c){c.updateDisplayOrigin()}),h};s.exports=p},79939:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"rotation",a,l,n,u)};s.exports=p},2699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scaleX",a,n,f,o),r(h,"scaleY",l,u,f,o)};s.exports=p},98739:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scaleX",a,l,n,u)};s.exports=p},98476:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scaleY",a,l,n,u)};s.exports=p},6207:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"scrollFactorX",a,n,f,o),r(h,"scrollFactorY",l,u,f,o)};s.exports=p},6607:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scrollFactorX",a,l,n,u)};s.exports=p},72248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"scrollFactorY",a,l,n,u)};s.exports=p},14036:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n){return r(h,"visible",a,0,l,n)};s.exports=p},77597:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"x",a,l,n,u)};s.exports=p},83194:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u,f,o){return l==null&&(l=a),r(h,"x",a,n,f,o),r(h,"y",l,u,f,o)};s.exports=p},67678:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43967),p=function(h,a,l,n,u){return r(h,"y",a,l,n,u)};s.exports=p},35850:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=new r);var f,o,c=h.length;if(c===1)f=h[0].x,o=h[0].y,h[0].x=a,h[0].y=l;else{var d=1,v=0;n===0&&(v=c-1,d=c-2),f=h[v].x,o=h[v].y,h[v].x=a,h[v].y=l;for(var m=0;m=c||d===-1)){var S=h[d],M=S.x,w=S.y;S.x=f,S.y=o,f=M,o=w,n===0?d--:d++}}return u.x=f,u.y=o,u};s.exports=p},8628:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33680),p=function(h){return r(h)};s.exports=p},21837:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7602),p=function(h,a,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,o;if(u)for(o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54261),p=function(h,a,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,o;if(u)for(o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){if(a===void 0&&(a=!1),e.length===0)return e;if(e.length===1)return a?e[0][r]+=(h+p)/2:e[0][r]=(h+p)/2,e;var l=Math.abs(h-p)/(e.length-1),n;if(a)for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0;r{/** + * @author Richard Davey + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h,a,l){l===void 0&&(l=0);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AlignTo:e(11517),Angle:e(80318),Call:e(60757),GetFirst:e(69927),GetLast:e(32265),GridAlign:e(94420),IncAlpha:e(41721),IncX:e(67285),IncXY:e(9074),IncY:e(75222),PlaceOnCircle:e(22983),PlaceOnEllipse:e(95253),PlaceOnLine:e(88505),PlaceOnRectangle:e(41346),PlaceOnTriangle:e(11575),PlayAnimation:e(29953),PropertyValueInc:e(66979),PropertyValueSet:e(43967),RandomCircle:e(88926),RandomEllipse:e(33286),RandomLine:e(96e3),RandomRectangle:e(28789),RandomTriangle:e(97154),Rotate:e(20510),RotateAround:e(91051),RotateAroundDistance:e(76332),ScaleX:e(61619),ScaleXY:e(94868),ScaleY:e(95532),SetAlpha:e(8689),SetBlendMode:e(2645),SetDepth:e(32372),SetHitArea:e(85373),SetOrigin:e(81583),SetRotation:e(79939),SetScale:e(2699),SetScaleX:e(98739),SetScaleY:e(98476),SetScrollFactor:e(6207),SetScrollFactorX:e(6607),SetScrollFactorY:e(72248),SetTint:e(14036),SetVisible:e(50159),SetX:e(77597),SetXY:e(83194),SetY:e(67678),ShiftPosition:e(35850),Shuffle:e(8628),SmootherStep:e(21910),SmoothStep:e(21837),Spread:e(62054),ToggleVisible:e(79815),WrapInRectangle:e(39665)}},42099:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(74943),a=e(81957),l=e(41138),n=e(35154),u=e(90126),f=new p({initialize:function(c,d,v){this.manager=c,this.key=d,this.type="frame",this.frames=this.getFrames(c.textureManager,n(v,"frames",[]),n(v,"defaultTextureKey",null),n(v,"sortFrames",!0)),this.frameRate=n(v,"frameRate",null),this.duration=n(v,"duration",null),this.msPerFrame,this.skipMissedFrames=n(v,"skipMissedFrames",!0),this.delay=n(v,"delay",0),this.repeat=n(v,"repeat",0),this.repeatDelay=n(v,"repeatDelay",0),this.yoyo=n(v,"yoyo",!1),this.showBeforeDelay=n(v,"showBeforeDelay",!1),this.showOnStart=n(v,"showOnStart",!1),this.hideOnComplete=n(v,"hideOnComplete",!1),this.randomFrame=n(v,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(h.PAUSE_ALL,this.pause,this),this.manager.on(h.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(o,c,d,v){d===null&&v===null?(o.frameRate=24,o.duration=24/c*1e3):d&&v===null?(o.duration=d,o.frameRate=c/(d/1e3)):(o.frameRate=v,o.duration=c/v*1e3),o.msPerFrame=1e3/o.frameRate},addFrame:function(o){return this.addFrameAt(this.frames.length,o)},addFrameAt:function(o,c){var d=this.getFrames(this.manager.textureManager,c);if(d.length>0){if(o===0)this.frames=d.concat(this.frames);else if(o===this.frames.length)this.frames=this.frames.concat(d);else{var v=this.frames.slice(0,o),m=this.frames.slice(o);this.frames=v.concat(d,m)}this.updateFrameSequence()}return this},checkFrame:function(o){return o>=0&&o0){M.isLast=!0,M.nextFrame=m[0],m[0].prevFrame=M;var G=1/(m.length-1);for(C=0;C0?o.inReverse&&o.forward?o.forward=!1:this.repeatAnimation(o):o.complete():this.updateAndGetNextTick(o,c.nextFrame)},handleYoyoFrame:function(o,c){if(c||(c=!1),o.inReverse===!c&&o.repeatCounter>0){(o.repeatDelay===0||o.pendingRepeat)&&(o.forward=c),this.repeatAnimation(o);return}if(o.inReverse!==c&&o.repeatCounter===0){o.complete();return}o.forward=c;var d=c?o.currentFrame.nextFrame:o.currentFrame.prevFrame;this.updateAndGetNextTick(o,d)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(o){var c=o.currentFrame;c.isFirst?o.yoyo?this.handleYoyoFrame(o,!0):o.repeatCounter>0?o.inReverse&&!o.forward?this.repeatAnimation(o):(o.forward=!0,this.repeatAnimation(o)):o.complete():this.updateAndGetNextTick(o,c.prevFrame)},updateAndGetNextTick:function(o,c){o.setCurrentFrame(c),this.getNextTick(o)},removeFrame:function(o){var c=this.frames.indexOf(o);return c!==-1&&this.removeFrameAt(c),this},removeFrameAt:function(o){return this.frames.splice(o,1),this.updateFrameSequence(),this},repeatAnimation:function(o){if(o._pendingStop===2){if(o._pendingStopValue===0)return o.stop();o._pendingStopValue--}o.repeatDelay>0&&!o.pendingRepeat?(o.pendingRepeat=!0,o.accumulator-=o.nextTick,o.nextTick+=o.repeatDelay):(o.repeatCounter--,o.forward?o.setCurrentFrame(o.currentFrame.nextFrame):o.setCurrentFrame(o.currentFrame.prevFrame),o.isPlaying&&(this.getNextTick(o),o.handleRepeat()))},toJSON:function(){var o={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(c){o.frames.push(c.toJSON())}),o},updateFrameSequence:function(){for(var o=this.frames.length,c=1/(o-1),d,v=0;v1?(d.isLast=!0,d.prevFrame=this.frames[o-2],d.nextFrame=this.frames[0]):o>1&&(d.prevFrame=this.frames[v-1],d.nextFrame=this.frames[v+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(h.PAUSE_ALL,this.pause,this),this.manager.off(h.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f){f===void 0&&(f=!1),this.textureKey=a,this.textureFrame=l,this.index=n,this.frame=u,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=f},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});s.exports=p},60848:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42099),p=e(83419),h=e(90330),a=e(50792),l=e(74943),n=e(8443),u=e(95540),f=e(35154),o=e(36383),c=e(20283),d=e(41836),v=new p({Extends:a,initialize:function(S){a.call(this),this.game=S,this.textureManager=null,this.globalTimeScale=1,this.anims=new h,this.mixes=new h,this.paused=!1,this.name="AnimationManager",S.events.once(n.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(n.DESTROY,this.destroy,this)},addMix:function(m,S,M){var w=this.anims,C=this.mixes,A=typeof m=="string"?m:m.key,P=typeof S=="string"?S:S.key;if(w.has(A)&&w.has(P)){var b=C.get(A);b||(b={}),b[P]=M,C.set(A,b)}return this},removeMix:function(m,S){var M=this.mixes,w=typeof m=="string"?m:m.key,C=M.get(w);if(C)if(S){var A=typeof S=="string"?S:S.key;C.hasOwnProperty(A)&&delete C[A]}else S||M.delete(w);return this},getMix:function(m,S){var M=this.mixes,w=typeof m=="string"?m:m.key,C=typeof S=="string"?S:S.key,A=M.get(w);return A&&A.hasOwnProperty(C)?A[C]:0},add:function(m,S){return this.anims.has(m)?(console.warn("Animation key exists: "+m),this):(S.key=m,this.anims.set(m,S),this.emit(l.ADD_ANIMATION,m,S),this)},exists:function(m){return this.anims.has(m)},createFromAseprite:function(m,S,M){var w=[],C=this.game.cache.json.get(m);if(!C)return console.warn("No Aseprite data found for: "+m),w;var A=this,P=f(C,"meta",null),b=f(C,"frames",null);if(P&&b){var O=f(P,"frameTags",[]);O.forEach(function(I){var D=[],B=u(I,"name",null),G=u(I,"from",0),z=u(I,"to",0),X=u(I,"direction","forward");if(B&&(!S||S&&S.indexOf(B)>-1)){for(var K=0,Q=G;Q<=z;Q++){var tt=Q.toString(),Y=b[tt];if(Y){var Z=u(Y,"duration",o.MAX_SAFE_INTEGER);D.push({key:m,frame:tt,duration:Z}),K+=Z}}X==="reverse"&&(D=D.reverse());var U={key:B,frames:D,duration:K,yoyo:X==="pingpong"},H;M?M.anims&&(H=M.anims.create(U)):H=A.create(U),H&&w.push(H)}})}return w},create:function(m){var S=m.key,M=!1;return S&&(M=this.get(S),M?console.warn("AnimationManager key already exists: "+S):(M=new r(this,S,m),this.anims.set(S,M),this.emit(l.ADD_ANIMATION,S,M))),M},fromJSON:function(m,S){S===void 0&&(S=!1),S&&this.anims.clear(),typeof m=="string"&&(m=JSON.parse(m));var M=[];if(m.hasOwnProperty("anims")&&Array.isArray(m.anims)){for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42099),p=e(30976),h=e(83419),a=e(90330),l=e(74943),n=e(95540),u=new h({initialize:function(o){this.parent=o,this.animationManager=o.scene.sys.anims,this.animationManager.on(l.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(f){var o=this.parent;if(f===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,o;Array.isArray(f)||(f=[f]);for(var c=0;cv&&(M=0),this.randomFrame&&(M=p(0,v-1));var w=d.frames[M];M===0&&!this.forward&&(w=d.getLastFrame()),this.currentFrame=w}return this.parent},pause:function(f){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),f!==void 0&&this.setCurrentFrame(f),this.parent},resume:function(f){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),f!==void 0&&this.setCurrentFrame(f),this.parent},playAfterDelay:function(f,o){if(!this.isPlaying)this.delayCounter=o,this.play(f,!0);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.nextAnim=f,this._pendingStop=1,this._pendingStopValue=o}return this.parent},playAfterRepeat:function(f,o){if(o===void 0&&(o=1),!this.isPlaying)this.play(f);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.repeatCounter!==-1&&o>this.repeatCounter&&(o=this.repeatCounter),this.nextAnim=f,this._pendingStop=2,this._pendingStopValue=o}return this.parent},play:function(f,o){o===void 0&&(o=!1);var c=this.currentAnim,d=this.parent,v=typeof f=="string"?f:f.key;if(o&&this.isPlaying&&c.key===v)return d;if(c&&this.isPlaying){var m=this.animationManager.getMix(c.key,f);if(m>0)return this.playAfterDelay(f,m)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f)},playReverse:function(f,o){o===void 0&&(o=!1);var c=typeof f=="string"?f:f.key;return o&&this.isPlaying&&this.currentAnim.key===c?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f))},startAnimation:function(f){this.load(f);var o=this.currentAnim,c=this.parent;return o&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat,o.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)),c},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(l.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(l.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(l.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(l.ANIMATION_COMPLETE,l.ANIMATION_COMPLETE_KEY)},emitEvents:function(f,o){var c=this.currentAnim;if(c){var d=this.currentFrame,v=this.parent,m=d.textureFrame;v.emit(f,c,d,v,m),o&&v.emit(o+c.key,c,d,v,m)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var f=this.currentFrame;if(!f)return 0;var o=f.progress;return this.inReverse&&(o*=-1),o},setProgress:function(f){return this.forward||(f=1-f),this.setCurrentFrame(this.currentAnim.getFrameByProgress(f)),this.parent},setRepeat:function(f){return this.repeatCounter=f===-1?Number.MAX_VALUE:f,this.parent},globalRemove:function(f,o){o===void 0&&(o=this.currentAnim),this.isPlaying&&o.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(f,o){f===void 0&&(f=!1),o===void 0&&(o=!1);var c=this.currentAnim,d=this.parent;return c?(o&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),c.getFirstTick(this),this.emitEvents(l.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!f,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(c.frames[0]),this.parent):d},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(f)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(f)}return this.parent},stopAfterDelay:function(f){return this._pendingStop=1,this._pendingStopValue=f,this.parent},stopAfterRepeat:function(f){return f===void 0&&(f=1),this.repeatCounter!==-1&&f>this.repeatCounter&&(f=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=f,this.parent},stopOnFrame:function(f){return this._pendingStop=3,this._pendingStopValue=f,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(f,o){var c=this.currentAnim;if(!(!this.isPlaying||!c||c.paused)){if(this.accumulator+=o*this.timeScale*this.animationManager.globalTimeScale,this._pendingStop===1&&(this._pendingStopValue-=o,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?c.nextFrame(this):c.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var d=0;do this.forward?c.nextFrame(this):c.previousFrame(this),d++;while(this.isPlaying&&this.accumulator>this.nextTick&&d<60)}}},setCurrentFrame:function(f){var o=this.parent;return this.currentFrame=f,o.texture=f.frame.texture,o.frame=f.frame,o.isCropped&&o.frame.updateCropUVs(o._crop,o.flipX,o.flipY),f.setAlpha&&(o.alpha=f.alpha),o.setSizeToFrame(),o._originComponent&&(f.frame.customPivot?o.setOrigin(f.frame.pivotX,f.frame.pivotY):o.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(l.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===f&&this.stop()),o},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(f){return this.anims?this.anims.get(f):null},exists:function(f){return this.anims?this.anims.has(f):!1},create:function(f){var o=f.key,c=!1;return o&&(c=this.get(o),c?console.warn("Animation key already exists: "+o):(c=new r(this,o,f),this.anims||(this.anims=new a),this.anims.set(o,c))),c},createFromAseprite:function(f,o){return this.animationManager.createFromAseprite(f,o,this.parent)},generateFrameNames:function(f,o){return this.animationManager.generateFrameNames(f,o)},generateFrameNumbers:function(f,o){return this.animationManager.generateFrameNumbers(f,o)},remove:function(f){var o=this.get(f);return o&&(this.currentAnim===o&&this.stop(),this.anims.delete(f)),o},destroy:function(){this.animationManager.off(l.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}}});s.exports=u},57090:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},25312:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationcomplete"},89580:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationcomplete-"},52860:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationrepeat"},63850:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationrestart"},99085:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationstart"},28087:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationstop"},1794:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="animationupdate"},52562:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pauseall"},57953:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},68339:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resumeall"},74943:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD_ANIMATION:e(57090),ANIMATION_COMPLETE:e(25312),ANIMATION_COMPLETE_KEY:e(89580),ANIMATION_REPEAT:e(52860),ANIMATION_RESTART:e(63850),ANIMATION_START:e(99085),ANIMATION_STOP:e(28087),ANIMATION_UPDATE:e(1794),PAUSE_ALL:e(52562),REMOVE_ANIMATION:e(57953),RESUME_ALL:e(68339)}},60421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Animation:e(42099),AnimationFrame:e(41138),AnimationManager:e(60848),AnimationState:e(9674),Events:e(74943)}},2161:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(90330),h=e(50792),a=e(24736),l=new r({initialize:function(){this.entries=new p,this.events=new h},add:function(n,u){return this.entries.set(n,u),this.events.emit(a.ADD,this,n,u),this},has:function(n){return this.entries.has(n)},exists:function(n){return this.entries.has(n)},get:function(n){return this.entries.get(n)},remove:function(n){var u=this.get(n);return u&&(this.entries.delete(n),this.events.emit(a.REMOVE,this,n,u.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});s.exports=l},24047:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2161),p=e(83419),h=e(8443),a=new p({initialize:function(n){this.game=n,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.obj=new r,this.tilemap=new r,this.xml=new r,this.custom={},this.game.events.once(h.DESTROY,this.destroy,this)},addCustom:function(l){return this.custom.hasOwnProperty(l)||(this.custom[l]=new r),this.custom[l]},destroy:function(){for(var l=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},59261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},24736:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(51464),REMOVE:e(59261)}},83388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BaseCache:e(2161),CacheManager:e(24047),Events:e(24736)}},71911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(39506),a=e(50792),l=e(19715),n=e(87841),u=e(61340),f=e(80333),o=e(26099),c=new r({Extends:a,Mixins:[p.AlphaSingle,p.Visible],initialize:function(v,m,S,M){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),a.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new n,this.dirty=!0,this._x=v,this._y=m,this._width=S,this._height=M,this._bounds=new n,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new u,this.transparent=!0,this.backgroundColor=f("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new o(S/2,M/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(d){this.renderList.push(d)},setOrigin:function(d,v){return d===void 0&&(d=.5),v===void 0&&(v=d),this.originX=d,this.originY=v,this},getScroll:function(d,v,m){m===void 0&&(m=new o);var S=this.width*.5,M=this.height*.5;return m.x=d-S,m.y=v-M,this.useBounds&&(m.x=this.clampX(m.x),m.y=this.clampY(m.y)),m},centerOnX:function(d){var v=this.width*.5;return this.midPoint.x=d,this.scrollX=d-v,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(d){var v=this.height*.5;return this.midPoint.y=d,this.scrollY=d-v,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(d,v){return this.centerOnX(d),this.centerOnY(v),this},centerToBounds:function(){if(this.useBounds){var d=this._bounds,v=this.width*.5,m=this.height*.5;this.midPoint.set(d.centerX,d.centerY),this.scrollX=d.centerX-v,this.scrollY=d.centerY-m}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(d){if(this.disableCull)return d;var v=this.matrix.matrix,m=v[0],S=v[1],M=v[2],w=v[3],C=m*w-S*M;if(!C)return d;var A=v[4],P=v[5],b=this.scrollX,O=this.scrollY,I=this.width,D=this.height,B=this.y,G=B+D,z=this.x,X=z+I,K=this.culledObjects,Q=d.length;C=1/C,K.length=0;for(var tt=0;ttz&&_B&&qM&&(d=M),d},clampY:function(d){var v=this._bounds,m=this.displayHeight,S=v.y+(m-this.height)/2,M=Math.max(S,S+v.height-m);return dM&&(d=M),d},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(d){return d===void 0&&(d=0),this.rotation=h(d),this},setBackgroundColor:function(d){return d===void 0&&(d="rgba(0,0,0,0)"),this.backgroundColor=f(d),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(d,v,m,S,M){return M===void 0&&(M=!1),this._bounds.setTo(d,v,m,S),this.dirty=!0,this.useBounds=!0,M?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(d){d===void 0&&(d=new n);var v=this._bounds;return d.setTo(v.x,v.y,v.width,v.height),d},setName:function(d){return d===void 0&&(d=""),this.name=d,this},setPosition:function(d,v){return v===void 0&&(v=d),this.x=d,this.y=v,this},setRotation:function(d){return d===void 0&&(d=0),this.rotation=d,this},setRoundPixels:function(d){return this.roundPixels=d,this},setScene:function(d,v){v===void 0&&(v=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=d,this.isSceneCamera=v;var m=d.sys;return this.sceneManager=m.game.scene,this.scaleManager=m.scale,this.cameraManager=m.cameras,this.updateSystem(),this},setScroll:function(d,v){return v===void 0&&(v=d),this.scrollX=d,this.scrollY=v,this},setSize:function(d,v){return v===void 0&&(v=d),this.width=d,this.height=v,this},setViewport:function(d,v,m,S){return this.x=d,this.y=v,this.width=m,this.height=S,this},setZoom:function(d,v){return d===void 0&&(d=1),v===void 0&&(v=d),d===0&&(d=.001),v===0&&(v=.001),this.zoomX=d,this.zoomY=v,this},setMask:function(d,v){return v===void 0&&(v=!0),this.mask=d,this._maskCamera=v?this.cameraManager.default:this,this},clearMask:function(d){return d===void 0&&(d=!1),d&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var d={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&&(d.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),d},update:function(){},setIsSceneCamera:function(d){return this.isSceneCamera=d,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var d=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,v=this.sceneManager;d&&!this._customViewport?v.customViewports++:!d&&this._customViewport&&v.customViewports--,this.dirty=!0,this._customViewport=d}},destroy:function(){this.emit(l.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(d){this._x=d,this.updateSystem()}},y:{get:function(){return this._y},set:function(d){this._y=d,this.updateSystem()}},width:{get:function(){return this._width},set:function(d){this._width=d,this.updateSystem()}},height:{get:function(){return this._height},set:function(d){this._height=d,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(d){d!==this._scrollX&&(this._scrollX=d,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(d){d!==this._scrollY&&(this._scrollY=d,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(d){this._zoomX=d,this._zoomY=d,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(d){this._zoomX=d,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(d){this._zoomY=d,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(d){this._rotation=d,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}}});s.exports=c},38058:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71911),p=e(67502),h=e(45319),a=e(83419),l=e(31401),n=e(20052),u=e(19715),f=e(28915),o=e(87841),c=e(26099),d=new a({Extends:r,Mixins:[l.PostPipeline],initialize:function(m,S,M,w){r.call(this,m,S,M,w),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new n.Fade(this),this.flashEffect=new n.Flash(this),this.shakeEffect=new n.Shake(this),this.panEffect=new n.Pan(this),this.rotateToEffect=new n.RotateTo(this),this.zoomEffect=new n.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(v,m){if(v===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=v,this.deadzone.height=m):this.deadzone=new o(0,0,v,m),this._follow){var S=this.width/2,M=this.height/2,w=this._follow.x-this.followOffset.x,C=this._follow.y-this.followOffset.y;this.midPoint.set(w,C),this.scrollX=w-S,this.scrollY=C-M}p(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(v,m,S,M,w,C){return this.fadeEffect.start(!1,v,m,S,M,!0,w,C)},fadeOut:function(v,m,S,M,w,C){return this.fadeEffect.start(!0,v,m,S,M,!0,w,C)},fadeFrom:function(v,m,S,M,w,C,A){return this.fadeEffect.start(!1,v,m,S,M,w,C,A)},fade:function(v,m,S,M,w,C,A){return this.fadeEffect.start(!0,v,m,S,M,w,C,A)},flash:function(v,m,S,M,w,C,A){return this.flashEffect.start(v,m,S,M,w,C,A)},shake:function(v,m,S,M,w){return this.shakeEffect.start(v,m,S,M,w)},pan:function(v,m,S,M,w,C,A){return this.panEffect.start(v,m,S,M,w,C,A)},rotateTo:function(v,m,S,M,w,C,A){return this.rotateToEffect.start(v,m,S,M,w,C,A)},zoomTo:function(v,m,S,M,w,C){return this.zoomEffect.start(v,m,S,M,w,C)},preRender:function(){this.renderList.length=0;var v=this.width,m=this.height,S=v*.5,M=m*.5,w=this.zoom,C=this.matrix,A=v*this.originX,P=m*this.originY,b=this._follow,O=this.deadzone,I=this.scrollX,D=this.scrollY;O&&p(O,this.midPoint.x,this.midPoint.y);var B=!1;if(b&&!this.panEffect.isRunning){var G=this.lerp,z=b.x-this.followOffset.x,X=b.y-this.followOffset.y;O?(zO.right&&(I=f(I,I+(z-O.right),G.x)),XO.bottom&&(D=f(D,D+(X-O.bottom),G.y))):(I=f(I,z-A,G.x),D=f(D,X-P,G.y)),B=!0}this.useBounds&&(I=this.clampX(I),D=this.clampY(D)),this.scrollX=I,this.scrollY=D;var K=I+S,Q=D+M;this.midPoint.set(K,Q);var tt=v/w,Y=m/w,Z=Math.floor(K-tt/2),U=Math.floor(Q-Y/2);this.worldView.setTo(Z,U,tt,Y),C.applyITRS(Math.floor(this.x+A),Math.floor(this.y+P),this.rotation,w,w),C.translate(-A,-P),this.shakeEffect.preRender(),B&&this.emit(u.FOLLOW_UPDATE,this,b)},setLerp:function(v,m){return v===void 0&&(v=1),m===void 0&&(m=v),this.lerp.set(v,m),this},setFollowOffset:function(v,m){return v===void 0&&(v=0),m===void 0&&(m=0),this.followOffset.set(v,m),this},startFollow:function(v,m,S,M,w,C){m===void 0&&(m=!1),S===void 0&&(S=1),M===void 0&&(M=S),w===void 0&&(w=0),C===void 0&&(C=w),this._follow=v,this.roundPixels=m,S=h(S,0,1),M=h(M,0,1),this.lerp.set(S,M),this.followOffset.set(w,C);var A=this.width/2,P=this.height/2,b=v.x-w,O=v.y-C;return this.midPoint.set(b,O),this.scrollX=b-A,this.scrollY=O-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(v,m){this.visible&&(this.rotateToEffect.update(v,m),this.panEffect.update(v,m),this.zoomEffect.update(v,m),this.shakeEffect.update(v,m),this.flashEffect.update(v,m),this.fadeEffect.update(v,m))},destroy:function(){this.resetFX(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});s.exports=d},32743:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38058),p=e(83419),h=e(95540),a=e(37277),l=e(37303),n=e(97480),u=e(44594),f=new p({initialize:function(c){this.scene=c,this.systems=c.sys,this.roundPixels=c.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,c.sys.events.once(u.BOOT,this.boot,this),c.sys.events.on(u.START,this.start,this)},boot:function(){var o=this.systems;o.settings.cameras?this.fromJSON(o.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new r(0,0,o.scale.width,o.scale.height).setScene(this.scene),o.game.scale.on(n.RESIZE,this.onResize,this),this.systems.events.once(u.DESTROY,this.destroy,this)},start:function(){if(!this.main){var o=this.systems;o.settings.cameras?this.fromJSON(o.settings.cameras):this.add(),this.main=this.cameras[0]}var c=this.systems.events;c.on(u.UPDATE,this.update,this),c.once(u.SHUTDOWN,this.shutdown,this)},add:function(o,c,d,v,m,S){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),m===void 0&&(m=!1),S===void 0&&(S="");var M=new r(o,c,d,v);return M.setName(S),M.setScene(this.scene),M.setRoundPixels(this.roundPixels),M.id=this.getNextID(),this.cameras.push(M),m&&(this.main=M),M},addExisting:function(o,c){c===void 0&&(c=!1);var d=this.cameras.indexOf(o);return d===-1?(o.id=this.getNextID(),o.setRoundPixels(this.roundPixels),this.cameras.push(o),c&&(this.main=o),o):null},getNextID:function(){for(var o=this.cameras,c=1,d=0;d<32;d++){for(var v=!1,m=0;m0){S.preRender();var M=this.getVisibleChildren(c.getChildren(),S);o.render(d,M,S)}}},getVisibleChildren:function(o,c){return o.filter(function(d){return d.willRender(c)})},resetAll:function(){for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=new p({initialize:function(n){this.camera=n,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(l,n,u,f,o,c,d,v){if(l===void 0&&(l=!0),n===void 0&&(n=1e3),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),!c&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=n,this.direction=l,this.progress=0,this.red=u,this.green=f,this.blue=o,this.alpha=l?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v;var m=l?h.FADE_OUT_START:h.FADE_IN_START;return this.camera.emit(m,this.camera,this,n,u,f,o),this.camera},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=new p({initialize:function(n){this.camera=n,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(l,n,u,f,o,c,d){return l===void 0&&(l=250),n===void 0&&(n=255),u===void 0&&(u=255),f===void 0&&(f=255),o===void 0&&(o=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene),!o&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=l,this.progress=0,this.red=n,this.green=u,this.blue=f,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(h.FLASH_START,this.camera,this,l,n,u,f),this.camera)},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(62640),a=e(19715),l=e(26099),n=new p({initialize:function(f){this.camera=f,this.isRunning=!1,this.duration=0,this.source=new l,this.current=new l,this.destination=new l,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(u,f,o,c,d,v,m){o===void 0&&(o=1e3),c===void 0&&(c=h.Linear),d===void 0&&(d=!1),v===void 0&&(v=null),m===void 0&&(m=this.camera.scene);var S=this.camera;return!d&&this.isRunning||(this.isRunning=!0,this.duration=o,this.progress=0,this.source.set(S.scrollX,S.scrollY),this.destination.set(u,f),S.getScroll(u,f,this.current),typeof c=="string"&&h.hasOwnProperty(c)?this.ease=h[c]:typeof c=="function"&&(this.ease=c),this._elapsed=0,this._onUpdate=v,this._onUpdateScope=m,this.camera.emit(a.PAN_START,this.camera,this,o,u,f)),S},update:function(u,f){if(this.isRunning){this._elapsed+=f;var o=r(this._elapsed/this.duration,0,1);this.progress=o;var c=this.camera;if(this._elapsed{/** + * @author Jason Nicholls + * @copyright 2018 Photon Storm Ltd. + * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=e(62640),l=new p({initialize:function(u){this.camera=u,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(n,u,f,o,c,d,v){f===void 0&&(f=1e3),o===void 0&&(o=a.Linear),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),u===void 0&&(u=!1),this.shortestPath=u;var m=n;n<0?(m=-1*n,this.clockwise=!1):this.clockwise=!0;var S=360*Math.PI/180;m=m-Math.floor(m/S)*S;var M=this.camera;if(!c&&this.isRunning)return M;if(this.isRunning=!0,this.duration=f,this.progress=0,this.source=M.rotation,this.destination=m,typeof o=="string"&&a.hasOwnProperty(o)?this.ease=a[o]:typeof o=="function"&&(this.ease=o),this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v,this.shortestPath){var w=0,C=0;this.destination>this.source?w=Math.abs(this.destination-this.source):w=Math.abs(this.destination+S)-this.source,this.source>this.destination?C=Math.abs(this.source-this.destination):C=Math.abs(this.source+S)-this.destination,wC&&(this.clockwise=!1)}return this.camera.emit(h.ROTATE_START,this.camera,this,f,m),M},update:function(n,u){if(this.isRunning){this._elapsed+=u;var f=r(this._elapsed/this.duration,0,1);this.progress=f;var o=this.camera;if(this._elapsed=S?d=Math.abs(m-S):d=Math.abs(m+v)-S;var M=0;this.clockwise?M=o.rotation+d*c:M=o.rotation-d*c,o.rotation=M,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,o,f,M)}else o.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,o,f,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(h.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}});s.exports=l},30330:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(19715),a=e(26099),l=new p({initialize:function(u){this.camera=u,this.isRunning=!1,this.duration=0,this.intensity=new a,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(n,u,f,o,c){return n===void 0&&(n=100),u===void 0&&(u=.05),f===void 0&&(f=!1),o===void 0&&(o=null),c===void 0&&(c=this.camera.scene),!f&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=n,this.progress=0,typeof u=="number"?this.intensity.set(u):this.intensity.set(u.x,u.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=o,this._onUpdateScope=c,this.camera.emit(h.SHAKE_START,this.camera,this,n,u),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(n,u){if(this.isRunning)if(this._elapsed+=u,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(62640),a=e(19715),l=new p({initialize:function(u){this.camera=u,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(n,u,f,o,c,d){u===void 0&&(u=1e3),f===void 0&&(f=h.Linear),o===void 0&&(o=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene);var v=this.camera;return!o&&this.isRunning||(this.isRunning=!0,this.duration=u,this.progress=0,this.source=v.zoom,this.destination=n,typeof f=="string"&&h.hasOwnProperty(f)?this.ease=h[f]:typeof f=="function"&&(this.ease=f),this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(a.ZOOM_START,this.camera,this,u,n)),v},update:function(n,u){this.isRunning&&(this._elapsed+=u,this.progress=r(this._elapsed/this.duration,0,1),this._elapsed{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Fade:e(5020),Flash:e(10662),Pan:e(20359),Shake:e(30330),RotateTo:e(34208),Zoom:e(45641)}},16438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameradestroy"},32726:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeincomplete"},87807:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeinstart"},45917:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeoutcomplete"},95666:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerafadeoutstart"},47056:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameraflashcomplete"},91261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="cameraflashstart"},45047:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="followupdate"},81927:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerapancomplete"},74264:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerapanstart"},54419:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},79330:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},93183:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerarotatecomplete"},80112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerarotatestart"},62252:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerashakecomplete"},86017:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerashakestart"},539:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerazoomcomplete"},51892:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="camerazoomstart"},19715:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DESTROY:e(16438),FADE_IN_COMPLETE:e(32726),FADE_IN_START:e(87807),FADE_OUT_COMPLETE:e(45917),FADE_OUT_START:e(95666),FLASH_COMPLETE:e(47056),FLASH_START:e(91261),FOLLOW_UPDATE:e(45047),PAN_COMPLETE:e(81927),PAN_START:e(74264),POST_RENDER:e(54419),PRE_RENDER:e(79330),ROTATE_COMPLETE:e(93183),ROTATE_START:e(80112),SHAKE_COMPLETE:e(62252),SHAKE_START:e(86017),ZOOM_COMPLETE:e(539),ZOOM_START:e(51892)}},87969:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Camera:e(38058),BaseCamera:e(71911),CameraManager:e(32743),Effects:e(20052),Events:e(19715)}},63091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.speedX=0,this.speedY=0;var n=p(l,"speed",null);typeof n=="number"?(this.speedX=n,this.speedY=n):(this.speedX=p(l,"speed.x",0),this.speedY=p(l,"speed.y",0)),this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(a){return this.camera=a,this},update:function(a){if(this.active){a===void 0&&(a=1);var l=this.camera;this.up&&this.up.isDown?l.scrollY-=this.speedY*a|0:this.down&&this.down.isDown&&(l.scrollY+=this.speedY*a|0),this.left&&this.left.isDown?l.scrollX-=this.speedX*a|0:this.right&&this.right.isDown&&(l.scrollX+=this.speedX*a|0),this.zoomIn&&this.zoomIn.isDown?(l.zoom-=this.zoomSpeed,l.zoomthis.maxZoom&&(l.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});s.exports=h},58818:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.accelX=0,this.accelY=0;var n=p(l,"acceleration",null);typeof n=="number"?(this.accelX=n,this.accelY=n):(this.accelX=p(l,"acceleration.x",0),this.accelY=p(l,"acceleration.y",0)),this.dragX=0,this.dragY=0;var u=p(l,"drag",null);typeof u=="number"?(this.dragX=u,this.dragY=u):(this.dragX=p(l,"drag.x",0),this.dragY=p(l,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var f=p(l,"maxSpeed",null);typeof f=="number"?(this.maxSpeedX=f,this.maxSpeedY=f):(this.maxSpeedX=p(l,"maxSpeed.x",0),this.maxSpeedY=p(l,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(a){return this.camera=a,this},update:function(a){if(this.active){a===void 0&&(a=1);var l=this.camera;this._speedX>0?(this._speedX-=this.dragX*a,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*a,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*a,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*a,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,this._speedX!==0&&(l.scrollX-=this._speedX*a|0),this._speedY!==0&&(l.scrollY-=this._speedY*a|0),this._zoom!==0&&(l.zoom+=this._zoom,l.zoomthis.maxZoom&&(l.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});s.exports=h},38865:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={FixedKeyControl:e(63091),SmoothedKeyControl:e(58818)}},26638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Controls:e(38865),Scene2D:e(87969)}},8054:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={VERSION:"3.80.1",BlendModes:e(10312),ScaleModes:e(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};s.exports=r},69547:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8054),h=e(42363),a=e(82264),l=e(95540),n=e(35154),u=e(41212),f=e(29747),o=e(75508),c=e(36060),d=e(80333),v=new r({initialize:function(S){S===void 0&&(S={});var M=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],w="#ffffff",C=n(S,"scale",null);this.width=n(C,"width",1024,S),this.height=n(C,"height",768,S),this.zoom=n(C,"zoom",1,S),this.parent=n(C,"parent",void 0,S),this.scaleMode=n(C,C?"mode":"scaleMode",0,S),this.expandParent=n(C,"expandParent",!0,S),this.autoRound=n(C,"autoRound",!1,S),this.autoCenter=n(C,"autoCenter",0,S),this.resizeInterval=n(C,"resizeInterval",500,S),this.fullscreenTarget=n(C,"fullscreenTarget",null,S),this.minWidth=n(C,"min.width",0,S),this.maxWidth=n(C,"max.width",0,S),this.minHeight=n(C,"min.height",0,S),this.maxHeight=n(C,"max.height",0,S),this.snapWidth=n(C,"snap.width",0,S),this.snapHeight=n(C,"snap.height",0,S),this.renderType=n(S,"type",p.AUTO),this.canvas=n(S,"canvas",null),this.context=n(S,"context",null),this.canvasStyle=n(S,"canvasStyle",null),this.customEnvironment=n(S,"customEnvironment",!1),this.sceneConfig=n(S,"scene",null),this.seed=n(S,"seed",[(Date.now()*Math.random()).toString()]),o.RND=new o.RandomDataGenerator(this.seed),this.gameTitle=n(S,"title",""),this.gameURL=n(S,"url","https://phaser.io"),this.gameVersion=n(S,"version",""),this.autoFocus=n(S,"autoFocus",!0),this.stableSort=n(S,"stableSort",-1),this.stableSort===-1&&(this.stableSort=a.browser.es2019?1:0),a.features.stableSort=this.stableSort,this.domCreateContainer=n(S,"dom.createContainer",!1),this.domPointerEvents=n(S,"dom.pointerEvents","none"),this.inputKeyboard=n(S,"input.keyboard",!0),this.inputKeyboardEventTarget=n(S,"input.keyboard.target",window),this.inputKeyboardCapture=n(S,"input.keyboard.capture",[]),this.inputMouse=n(S,"input.mouse",!0),this.inputMouseEventTarget=n(S,"input.mouse.target",null),this.inputMousePreventDefaultDown=n(S,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=n(S,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=n(S,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=n(S,"input.mouse.preventDefaultWheel",!0),this.inputTouch=n(S,"input.touch",a.input.touch),this.inputTouchEventTarget=n(S,"input.touch.target",null),this.inputTouchCapture=n(S,"input.touch.capture",!0),this.inputActivePointers=n(S,"input.activePointers",1),this.inputSmoothFactor=n(S,"input.smoothFactor",0),this.inputWindowEvents=n(S,"input.windowEvents",!0),this.inputGamepad=n(S,"input.gamepad",!1),this.inputGamepadEventTarget=n(S,"input.gamepad.target",window),this.disableContextMenu=n(S,"disableContextMenu",!1),this.audio=n(S,"audio",{}),this.hideBanner=n(S,"banner",null)===!1,this.hidePhaser=n(S,"banner.hidePhaser",!1),this.bannerTextColor=n(S,"banner.text",w),this.bannerBackgroundColor=n(S,"banner.background",M),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=n(S,"fps",null),this.disablePreFX=n(S,"disablePreFX",!1),this.disablePostFX=n(S,"disablePostFX",!1);var A=n(S,"render",null);this.pipeline=n(A,"pipeline",null,S),this.autoMobilePipeline=n(A,"autoMobilePipeline",!0,S),this.defaultPipeline=n(A,"defaultPipeline",c.MULTI_PIPELINE,S),this.antialias=n(A,"antialias",!0,S),this.antialiasGL=n(A,"antialiasGL",!0,S),this.mipmapFilter=n(A,"mipmapFilter","",S),this.desynchronized=n(A,"desynchronized",!1,S),this.roundPixels=n(A,"roundPixels",!0,S),this.pixelArt=n(A,"pixelArt",this.zoom!==1,S),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=n(A,"transparent",!1,S),this.clearBeforeRender=n(A,"clearBeforeRender",!0,S),this.preserveDrawingBuffer=n(A,"preserveDrawingBuffer",!1,S),this.premultipliedAlpha=n(A,"premultipliedAlpha",!0,S),this.failIfMajorPerformanceCaveat=n(A,"failIfMajorPerformanceCaveat",!1,S),this.powerPreference=n(A,"powerPreference","default",S),this.batchSize=n(A,"batchSize",4096,S),this.maxTextures=n(A,"maxTextures",-1,S),this.maxLights=n(A,"maxLights",10,S);var P=n(S,"backgroundColor",0);this.backgroundColor=d(P),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=n(S,"callbacks.preBoot",f),this.postBoot=n(S,"callbacks.postBoot",f),this.physics=n(S,"physics",{}),this.defaultPhysicsSystem=n(this.physics,"default",!1),this.loaderBaseURL=n(S,"loader.baseURL",""),this.loaderPath=n(S,"loader.path",""),this.loaderMaxParallelDownloads=n(S,"loader.maxParallelDownloads",a.os.android?6:32),this.loaderCrossOrigin=n(S,"loader.crossOrigin",void 0),this.loaderResponseType=n(S,"loader.responseType",""),this.loaderAsync=n(S,"loader.async",!0),this.loaderUser=n(S,"loader.user",""),this.loaderPassword=n(S,"loader.password",""),this.loaderTimeout=n(S,"loader.timeout",0),this.loaderWithCredentials=n(S,"loader.withCredentials",!1),this.loaderImageLoadType=n(S,"loader.imageLoadType","XHR"),this.loaderLocalScheme=n(S,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=n(S,"fx.glow.quality",.1),this.glowFXDistance=n(S,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var b=n(S,"plugins",null),O=h.DefaultScene;b&&(Array.isArray(b)?this.defaultPlugins=b:u(b)&&(this.installGlobalPlugins=l(b,"global",[]),this.installScenePlugins=l(b,"scene",[]),Array.isArray(b.default)?O=b.default:Array.isArray(b.defaultMerge)&&(O=O.concat(b.defaultMerge)))),this.defaultPlugins=O;var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=n(S,"images.default",I+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=n(S,"images.missing",I+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=n(S,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=p.WEBGL:window.FORCE_CANVAS&&(this.renderType=p.CANVAS))}});s.exports=v},86054:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20623),p=e(27919),h=e(8054),a=e(89357),l=function(n){var u=n.config;if((u.customEnvironment||u.canvas)&&u.renderType===h.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!u.customEnvironment&&!u.canvas&&u.renderType!==h.HEADLESS)if(u.renderType===h.AUTO&&(u.renderType=a.webGL?h.WEBGL:h.CANVAS),u.renderType===h.WEBGL){if(!a.webGL)throw new Error("Cannot create WebGL context, aborting.")}else if(u.renderType===h.CANVAS){if(!a.canvas)throw new Error("Cannot create Canvas context, aborting.")}else throw new Error("Unknown value for renderer type: "+u.renderType);u.antialias||p.disableSmoothing();var f=n.scale.baseSize,o=f.width,c=f.height;if(u.canvas?(n.canvas=u.canvas,n.canvas.width=o,n.canvas.height=c):n.canvas=p.create(n,o,c,u.renderType),u.canvasStyle&&(n.canvas.style=u.canvasStyle),u.antialias||r.setCrisp(n.canvas),u.renderType!==h.HEADLESS){var d,v;d=e(68627),v=e(74797),u.renderType===h.WEBGL?n.renderer=new v(n):(n.renderer=new d(n),n.context=n.renderer.gameContext)}};s.exports=l},96391:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8054),p=function(h){var a=h.config;if(!a.hideBanner){var l="WebGL";a.renderType===r.CANVAS?l="Canvas":a.renderType===r.HEADLESS&&(l="Headless");var n=a.audio,u=h.device.audio,f;if(u.webAudio&&!n.disableWebAudio?f="Web Audio":n.noAudio||!u.webAudio&&!u.audioData?f="No Audio":f="HTML5 Audio",h.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var o="",c=[o];if(Array.isArray(a.bannerBackgroundColor)){var d;a.bannerBackgroundColor.forEach(function(m){o=o.concat("%c "),c.push("background: "+m),d=m}),c[c.length-1]="color: "+a.bannerTextColor+"; background: "+d}else o=o.concat("%c "),c.push("color: "+a.bannerTextColor+"; background: "+a.bannerBackgroundColor);c.push("background: transparent"),a.gameTitle&&(o=o.concat(a.gameTitle),a.gameVersion&&(o=o.concat(" v"+a.gameVersion)),a.hidePhaser||(o=o.concat(" / ")));var v="";a.hidePhaser||(o=o.concat("Phaser v"+r.VERSION+v+" ("+l+" | "+f+")")),o=o.concat(" %c "+a.gameURL),c[0]=o,console.log.apply(console,c)}}};s.exports=p},50127:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=e(60848),h=e(24047),a=e(27919),l=e(83419),n=e(69547),u=e(83719),f=e(86054),o=e(45893),c=e(96391),d=e(82264),v=e(57264),m=e(50792),S=e(8443),M=e(7003),w=e(37277),C=e(77332),A=e(76531),P=e(60903),b=e(69442),O=e(17130),I=e(65898),D=e(51085),B=e(14747),G=new l({initialize:function(X){this.config=new n(X),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new p(this),this.textures=new O(this),this.cache=new h(this),this.registry=new o(this,new m),this.input=new M(this,this.config),this.scene=new P(this,this.config.sceneConfig),this.device=d,this.scale=new A(this,this.config),this.sound=null,this.sound=B.create(this),this.loop=new I(this,this.config.fps),this.plugins=new C(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,v(this.boot.bind(this))},boot:function(){if(!w.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),f(this),u(this),c(this),r(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(S.BOOT)},texturesReady:function(){this.events.emit(S.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)),D(this);var z=this.events;z.on(S.HIDDEN,this.onHidden,this),z.on(S.VISIBLE,this.onVisible,this),z.on(S.BLUR,this.onBlur,this),z.on(S.FOCUS,this.onFocus,this)},step:function(z,X){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(S.PRE_STEP,z,X),K.emit(S.STEP,z,X),this.scene.update(z,X),K.emit(S.POST_STEP,z,X);var Q=this.renderer;Q.preRender(),K.emit(S.PRE_RENDER,Q,z,X),this.scene.render(Q),Q.postRender(),K.emit(S.POST_RENDER,Q,z,X)}},headlessStep:function(z,X){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var K=this.events;K.emit(S.PRE_STEP,z,X),K.emit(S.STEP,z,X),this.scene.update(z,X),K.emit(S.POST_STEP,z,X),this.scene.isProcessing=!1,K.emit(S.PRE_RENDER,null,z,X),K.emit(S.POST_RENDER,null,z,X)}},onHidden:function(){this.loop.pause(),this.events.emit(S.PAUSE)},pause:function(){var z=this.isPaused;this.isPaused=!0,z||this.events.emit(S.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(S.RESUME)},resume:function(){var z=this.isPaused;this.isPaused=!1,z&&this.events.emit(S.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(z,X){X===void 0&&(X=!1),this.pendingDestroy=!0,this.removeCanvas=z,this.noReturn=X},runDestroy:function(){this.scene.destroy(),this.events.emit(S.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(a.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}});s.exports=G},65898:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(35154),h=e(29747),a=e(43092),l=new r({initialize:function(u,f){this.game=u,this.raf=new a,this.started=!1,this.running=!1,this.minFps=p(f,"min",5),this.targetFps=p(f,"target",60),this.fpsLimit=p(f,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=h,this.forceSetTimeOut=p(f,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=p(f,"deltaHistory",10),this.panicMax=p(f,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=p(f,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var n=window.performance.now();this.time=n,this.lastTime=n,this.nextFpsUpdate=n+1e3,this.framesThisSecond=0;for(var u=0;u0||!this.inFocus)&&(this._coolDown--,n=Math.min(n,this._target)),n>this._min&&(n=f[u],n=Math.min(n,this._min)),f[u]=n,this.deltaIndex++,this.deltaIndex>=o&&(this.deltaIndex=0);for(var c=0,d=0;d=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(n,this.delta),this.delta=0),this.lastTime=n,this.frame++},step:function(n){this.now=n;var u=Math.max(0,n-this.lastTime);this.rawDelta=u,this.time+=this.rawDelta,this.smoothStep&&(u=this.smoothDelta(u)),this.delta=u,n>=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.callback(n,u),this.lastTime=n,this.frame++},tick:function(){var n=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(n):this.step(n)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(n){n===void 0&&(n=!1);var u=window.performance.now();if(!this.running){n&&(this.startTime+=-this.lastTime+(this.lastTime+u));var f=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(f,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=u+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});s.exports=l},51085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8443),p=function(h){var a,l=h.events;if(document.hidden!==void 0)a="visibilitychange";else{var n=["webkit","moz","ms"];n.forEach(function(f){document[f+"Hidden"]!==void 0&&(document.hidden=function(){return document[f+"Hidden"]},a=f+"visibilitychange")})}var u=function(f){document.hidden||f.type==="pause"?l.emit(r.HIDDEN):l.emit(r.VISIBLE)};a&&document.addEventListener(a,u,!1),window.onblur=function(){l.emit(r.BLUR)},window.onfocus=function(){l.emit(r.FOCUS)},window.focus&&h.config.autoFocus&&window.focus()};s.exports=p},97217:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="blur"},47548:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},19814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="contextlost"},68446:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},41700:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="focus"},25432:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="hidden"},65942:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},59211:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},47789:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="poststep"},39066:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},460:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prestep"},16175:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},42331:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},11966:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="step"},32969:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="systemready"},94830:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="visible"},8443:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BLUR:e(97217),BOOT:e(47548),CONTEXT_LOST:e(19814),DESTROY:e(68446),FOCUS:e(41700),HIDDEN:e(25432),PAUSE:e(65942),POST_RENDER:e(59211),POST_STEP:e(47789),PRE_RENDER:e(39066),PRE_STEP:e(460),READY:e(16175),RESUME:e(42331),STEP:e(11966),SYSTEM_READY:e(32969),VISIBLE:e(94830)}},42857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Config:e(69547),CreateRenderer:e(86054),DebugHeader:e(96391),Events:e(8443),TimeStep:e(65898),VisibilityHandler:e(51085)}},99584:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(5290),p=e(27919),h=e(35154),a=function(l){var n=h(l,"data",[]),u=h(l,"canvas",null),f=h(l,"palette",r),o=h(l,"pixelWidth",1),c=h(l,"pixelHeight",o),d=h(l,"resizeCanvas",!0),v=h(l,"clearCanvas",!0),m=h(l,"preRender",null),S=h(l,"postRender",null),M=Math.floor(Math.abs(n[0].length*o)),w=Math.floor(Math.abs(n.length*c));u||(u=p.create2D(this,M,w),d=!1,v=!1),d&&(u.width=M,u.height=w);var C=u.getContext("2d",{willReadFrequently:!0});v&&C.clearRect(0,0,M,w),m&&m(u,C);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GenerateTexture:e(99584),Palettes:e(57763)}},5290:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},23816:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},9866:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},77552:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},92259:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},57763:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ARNE16:e(5290),C64:e(23816),CGA:e(9866),JMP:e(77552),MSX:e(92259)}},46728:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36316),h=e(80021),a=e(26099),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,"CubicBezierCurve"),Array.isArray(u)&&(c=new a(u[6],u[7]),o=new a(u[4],u[5]),f=new a(u[2],u[3]),u=new a(u[0],u[1])),this.p0=u,this.p1=f,this.p2=o,this.p3=c},getStartPoint:function(n){return n===void 0&&(n=new a),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new a);var f=this.p0,o=this.p1,c=this.p2,d=this.p3;return u.set(p(n,f.x,o.x,c.x,d.x),p(n,f.y,o.y,c.y,d.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var o=1;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(19217),h=e(87841),a=e(26099),l=new r({initialize:function(u){this.type=u,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new a,this._tmpVec2B=new a},draw:function(n,u){return u===void 0&&(u=32),n.strokePoints(this.getPoints(u))},getBounds:function(n,u){n||(n=new h),u===void 0&&(u=16);var f=this.getLength();u>f&&(u=f/2);var o=Math.max(1,Math.round(f/u));return p(this.getSpacedPoints(o),n)},getDistancePoints:function(n){var u=this.getLength(),f=Math.max(1,u/n);return this.getSpacedPoints(f)},getEndPoint:function(n){return n===void 0&&(n=new a),this.getPointAt(1,n)},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){if(n===void 0&&(n=this.arcLengthDivisions),this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var u=[],f,o=this.getPoint(0,this._tmpVec2A),c=0;u.push(0);for(var d=1;d<=n;d++)f=this.getPoint(d/n,this._tmpVec2B),c+=f.distance(o),u.push(c),o.copy(f);return this.cacheArcLengths=u,u},getPointAt:function(n,u){var f=this.getUtoTmapping(n);return this.getPoint(f,u)},getPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var o=0;o<=n;o++)f.push(this.getPoint(o/n));return f},getRandomPoint:function(n){return n===void 0&&(n=new a),this.getPoint(Math.random(),n)},getSpacedPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var o=0;o<=n;o++){var c=this.getUtoTmapping(o/n,null,n);f.push(this.getPoint(c))}return f},getStartPoint:function(n){return n===void 0&&(n=new a),this.getPointAt(0,n)},getTangent:function(n,u){u===void 0&&(u=new a);var f=1e-4,o=n-f,c=n+f;return o<0&&(o=0),c>1&&(c=1),this.getPoint(o,this._tmpVec2A),this.getPoint(c,u),u.subtract(this._tmpVec2A).normalize()},getTangentAt:function(n,u){var f=this.getUtoTmapping(n);return this.getTangent(f,u)},getTFromDistance:function(n,u){return n<=0?0:this.getUtoTmapping(0,n,u)},getUtoTmapping:function(n,u,f){var o=this.getLengths(f),c=0,d=o.length,v;u?v=Math.min(u,o[d-1]):v=n*o[d-1];for(var m=0,S=d-1,M;m<=S;)if(c=Math.floor(m+(S-m)/2),M=o[c]-v,M<0)m=c+1;else if(M>0)S=c-1;else{S=c;break}if(c=S,o[c]===v)return c/(d-1);var w=o[c],C=o[c+1],A=C-w,P=(v-w)/A;return(c+P)/(d-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});s.exports=l},73825:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(39506),a=e(35154),l=e(43396),n=e(26099),u=new r({Extends:p,initialize:function(o,c,d,v,m,S,M,w){if(typeof o=="object"){var C=o;o=a(C,"x",0),c=a(C,"y",0),d=a(C,"xRadius",0),v=a(C,"yRadius",d),m=a(C,"startAngle",0),S=a(C,"endAngle",360),M=a(C,"clockwise",!1),w=a(C,"rotation",0)}else v===void 0&&(v=d),m===void 0&&(m=0),S===void 0&&(S=360),M===void 0&&(M=!1),w===void 0&&(w=0);p.call(this,"EllipseCurve"),this.p0=new n(o,c),this._xRadius=d,this._yRadius=v,this._startAngle=h(m),this._endAngle=h(S),this._clockwise=M,this._rotation=h(w)},getStartPoint:function(f){return f===void 0&&(f=new n),this.getPoint(0,f)},getResolution:function(f){return f*2},getPoint:function(f,o){o===void 0&&(o=new n);for(var c=Math.PI*2,d=this._endAngle-this._startAngle,v=Math.abs(d)c;)d-=c;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(19217),a=e(87841),l=e(26099),n=new r({Extends:p,initialize:function(f,o){p.call(this,"LineCurve"),Array.isArray(f)&&(o=new l(f[2],f[3]),f=new l(f[0],f[1])),this.p0=f,this.p1=o,this.arcLengthDivisions=1},getBounds:function(u){return u===void 0&&(u=new a),h([this.p0,this.p1],u)},getStartPoint:function(u){return u===void 0&&(u=new l),u.copy(this.p0)},getResolution:function(u){return u===void 0&&(u=1),u},getPoint:function(u,f){return f===void 0&&(f=new l),u===1?f.copy(this.p1):(f.copy(this.p1).subtract(this.p0).scale(u).add(this.p0),f)},getPointAt:function(u,f){return this.getPoint(u,f)},getTangent:function(u,f){return f===void 0&&(f=new l),f.copy(this.p1).subtract(this.p0).normalize(),f},getUtoTmapping:function(u,f,o){var c;if(f){var d=this.getLengths(o),v=d[d.length-1],m=Math.min(f,v);c=m/v}else c=u;return c},draw:function(u){return u.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),u},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});n.fromJSON=function(u){var f=u.points,o=new l(f[0],f[1]),c=new l(f[2],f[3]);return new n(o,c)},s.exports=n},14744:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(80021),h=e(32112),a=e(26099),l=new r({Extends:p,initialize:function(u,f,o){p.call(this,"QuadraticBezierCurve"),Array.isArray(u)&&(o=new a(u[4],u[5]),f=new a(u[2],u[3]),u=new a(u[0],u[1])),this.p0=u,this.p1=f,this.p2=o},getStartPoint:function(n){return n===void 0&&(n=new a),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new a);var f=this.p0,o=this.p1,c=this.p2;return u.set(h(n,f.x,o.x,c.x),h(n,f.y,o.y,c.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var o=1;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87842),p=e(83419),h=e(80021),a=e(26099),l=new p({Extends:h,initialize:function(u){u===void 0&&(u=[]),h.call(this,"SplineCurve"),this.points=[],this.addPoints(u)},addPoints:function(n){for(var u=0;uf.length-2?f.length-1:c+1],M=f[c>f.length-3?f.length-1:c+2];return u.set(r(d,v.x,m.x,S.x,M.x),r(d,v.y,m.y,S.y,M.y))},toJSON:function(){for(var n=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Path:e(46669),MoveTo:e(68618),CubicBezier:e(46728),Curve:e(80021),Ellipse:e(73825),Line:e(33951),QuadraticBezier:e(14744),Spline:e(42534)}},68618:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l,n){this.active=!1,this.p0=new p(l,n)},getPoint:function(a,l){return l===void 0&&(l=new p),l.copy(this.p0)},getPointAt:function(a,l){return this.getPoint(a,l)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});s.exports=h},46669:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(46728),h=e(73825),a=e(39429),l=e(33951),n=e(68618),u=e(14744),f=e(87841),o=e(42534),c=e(26099),d=e(36383),v=new r({initialize:function(S,M){S===void 0&&(S=0),M===void 0&&(M=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new c,this._tmpVec2A=new c,this._tmpVec2B=new c,typeof S=="object"?this.fromJSON(S):this.startPoint.set(S,M)},add:function(m){return this.curves.push(m),this},circleTo:function(m,S,M){return S===void 0&&(S=!1),this.ellipseTo(m,m,0,360,S,M)},closePath:function(){var m=this.curves[0].getPoint(0),S=this.curves[this.curves.length-1].getPoint(1);return m.equals(S)||this.curves.push(new l(S,m)),this},cubicBezierTo:function(m,S,M,w,C,A){var P=this.getEndPoint(),b,O,I;return m instanceof c?(b=m,O=S,I=M):(b=new c(M,w),O=new c(C,A),I=new c(m,S)),this.add(new p(P,b,O,I))},quadraticBezierTo:function(m,S,M,w){var C=this.getEndPoint(),A,P;return m instanceof c?(A=m,P=S):(A=new c(M,w),P=new c(m,S)),this.add(new u(C,A,P))},draw:function(m,S){for(var M=0;M=S)return this.curves[w];w++}return null},getEndPoint:function(m){return m===void 0&&(m=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,m):m.copy(this.startPoint),m},getLength:function(){var m=this.getCurveLengths();return m[m.length-1]},getPoint:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),w=this.getCurveLengths(),C=0;C=M){var A=w[C]-M,P=this.curves[C],b=P.getLength(),O=b===0?0:1-A/b;return P.getPointAt(O,S)}C++}return null},getPoints:function(m,S){!m&&!S&&(m=this.defaultDivisions);for(var M=[],w,C=0;C1&&!M[M.length-1].equals(M[0])&&M.push(M[0]),M},getRandomPoint:function(m){return m===void 0&&(m=new c),this.getPoint(Math.random(),m)},getSpacedPoints:function(m){m===void 0&&(m=40);for(var S=[],M=0;M<=m;M++)S.push(this.getPoint(M/m));return this.autoClose&&S.push(S[0]),S},getStartPoint:function(m){return m===void 0&&(m=new c),m.copy(this.startPoint)},getTangent:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),w=this.getCurveLengths(),C=0;C=M){var A=w[C]-M,P=this.curves[C],b=P.getLength(),O=b===0?0:1-A/b;return P.getTangentAt(O,S)}C++}return null},lineTo:function(m,S){m instanceof c?this._tmpVec2B.copy(m):typeof m=="object"?this._tmpVec2B.setFromObject(m):this._tmpVec2B.set(m,S);var M=this.getEndPoint(this._tmpVec2A);return this.add(new l([M.x,M.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(m){return m.unshift(this.getEndPoint()),this.add(new o(m))},moveTo:function(m,S){return m instanceof c?this.add(new n(m.x,m.y)):this.add(new n(m,S))},toJSON:function(){for(var m=[],S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(24882),h=new r({initialize:function(l,n){this.parent=l,this.events=n,n||(this.events=l.events?l.events:l),this.list={},this.values={},this._frozen=!1,!l.hasOwnProperty("sys")&&this.events&&this.events.once(p.DESTROY,this.destroy,this)},get:function(a){var l=this.list;if(Array.isArray(a)){for(var n=[],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45893),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){p.call(this,u,u.sys.events),this.scene=u,this.systems=u.sys,u.sys.events.once(a.BOOT,this.boot,this),u.sys.events.on(a.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(a.DESTROY,this.destroy,this)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){p.prototype.destroy.call(this),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});h.register("DataManagerPlugin",l,"data"),s.exports=l},10700:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="changedata"},93608:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="changedata-"},60883:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},69780:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedata"},22166:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="setdata"},24882:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CHANGE_DATA:e(10700),CHANGE_DATA_KEY:e(93608),DESTROY:e(60883),REMOVE_DATA:e(69780),SET_DATA:e(22166)}},44965:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DataManager:e(45893),DataManagerPlugin:e(63646),Events:e(24882)}},7098:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84148),p={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};function h(){if(typeof importScripts=="function")return p;p.audioData=!!window.Audio,p.webAudio=!!(window.AudioContext||window.webkitAudioContext);var a=document.createElement("audio"),l=!!a.canPlayType;try{if(l){var n=function(o,c){var d=a.canPlayType("audio/"+o).replace(/^no$/,"");return c?!!(d||a.canPlayType("audio/"+c).replace(/^no$/,"")):!!d};if(p.ogg=n('ogg; codecs="vorbis"'),p.opus=n('ogg; codecs="opus"',"opus"),p.mp3=n("mpeg"),p.wav=n("wav"),p.m4a=n("x-m4a"),p.aac=n("aac"),p.flac=n("flac","x-flac"),p.webm=n('webm; codecs="vorbis"'),a.canPlayType('audio/mp4; codecs="ec-3"')!==""){if(r.edge)p.dolby=!0;else if(r.safari&&r.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var u=parseInt(RegExp.$1,10),f=parseInt(RegExp.$2,10);(u===10&&f>=11||u>10)&&(p.dolby=!0)}}}}catch{}return p}s.exports=h()},84148:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};function h(){var a=navigator.userAgent;return/Edg\/\d+/.test(a)?(p.edge=!0,p.es2019=!0):/OPR/.test(a)?(p.opera=!0,p.es2019=!0):/Chrome\/(\d+)/.test(a)&&!r.windowsPhone?(p.chrome=!0,p.chromeVersion=parseInt(RegExp.$1,10),p.es2019=p.chromeVersion>69):/Firefox\D+(\d+)/.test(a)?(p.firefox=!0,p.firefoxVersion=parseInt(RegExp.$1,10),p.es2019=p.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(a)&&r.iOS?(p.mobileSafari=!0,p.es2019=!0):/MSIE (\d+\.\d+);/.test(a)?(p.ie=!0,p.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(a)&&!r.windowsPhone?(p.safari=!0,p.safariVersion=parseInt(RegExp.$1,10),p.es2019=p.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(a)&&(p.ie=!0,p.trident=!0,p.tridentVersion=parseInt(RegExp.$1,10),p.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(a)&&(p.silk=!0),p}s.exports=h()},89289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p={supportInverseAlpha:!1,supportNewBlendModes:!1};function h(){var n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",u="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",f=new Image;return f.onload=function(){var o=new Image;o.onload=function(){var c=r.create2D(o,6),d=c.getContext("2d",{willReadFrequently:!0});if(d.globalCompositeOperation="multiply",d.drawImage(f,0,0),d.drawImage(o,2,0),!d.getImageData(2,0,1,1))return!1;var v=d.getImageData(2,0,1,1).data;r.remove(o),p.supportNewBlendModes=v[0]===255&&v[1]===0&&v[2]===0},o.src=n+"/wCKxvRF"+u},f.src=n+"AP804Oa6"+u,!1}function a(){var n=r.create2D(this,2),u=n.getContext("2d",{willReadFrequently:!0});u.fillStyle="rgba(10, 20, 30, 0.5)",u.fillRect(0,0,1,1);var f=u.getImageData(0,0,1,1);if(f===null)return!1;u.putImageData(f,1,0);var o=u.getImageData(1,0,1,1),c=o.data[0]===f.data[0]&&o.data[1]===f.data[1]&&o.data[2]===f.data[2]&&o.data[3]===f.data[3];return r.remove(this),c}function l(){return typeof importScripts!="function"&&document!==void 0&&(p.supportNewBlendModes=h(),p.supportInverseAlpha=a()),p}s.exports=l()},89357:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p=e(84148),h=e(27919),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};function l(){var u=new ArrayBuffer(4),f=new Uint8Array(u),o=new Uint32Array(u);return f[0]=161,f[1]=178,f[2]=195,f[3]=212,o[0]===3569595041?!0:o[0]===2712847316?!1:null}function n(){if(typeof importScripts=="function")return a;a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch{a.localStorage=!1}a.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob,a.fileSystem=!!window.requestFileSystem;var u=!1,f=function(){if(window.WebGLRenderingContext)try{var o=h.createWebGL(this),c=o.getContext("webgl")||o.getContext("experimental-webgl"),d=h.create2D(this),v=d.getContext("2d",{willReadFrequently:!0}),m=v.createImageData(1,1);return u=m.data instanceof Uint8ClampedArray,h.remove(o),h.remove(d),!!c}catch{return!1}return!1};return a.webGL=f(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,p.firefox&&p.firefoxVersion<21&&(a.getUserMedia=!1),!r.iOS&&(p.ie||p.firefox||p.chrome)&&(a.canvasBitBltShift=!0),(p.safari||p.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint32Array<"u"&&(a.littleEndian=l()),a.support32bit=typeof ArrayBuffer<"u"&&typeof Uint8ClampedArray<"u"&&typeof Int32Array<"u"&&a.littleEndian!==null&&u,a}s.exports=n()},91639:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={available:!1,cancel:"",keyboard:!1,request:""};function e(){if(typeof importScripts=="function")return y;var r,p="Fullscreen",h="FullScreen",a=["request"+p,"request"+h,"webkitRequest"+p,"webkitRequest"+h,"msRequest"+p,"msRequest"+h,"mozRequest"+h,"mozRequest"+p];for(r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84148),p={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};function h(){return typeof importScripts=="function"||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(p.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(p.mspointer=!0),navigator.getGamepads&&(p.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?p.wheelEvent="wheel":"onmousewheel"in window?p.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(p.wheelEvent="DOMMouseScroll")),p}s.exports=h()},25892:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};function e(){if(typeof importScripts=="function")return y;var r=navigator.userAgent;/Windows/.test(r)?y.windows=!0:/Mac OS/.test(r)&&!/like Mac OS/.test(r)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(y.iOS=!0,y.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),y.iOSVersion=parseInt(RegExp.$1,10)):y.macOS=!0:/Android/.test(r)?y.android=!0:/Linux/.test(r)?y.linux=!0:/iP[ao]d|iPhone/i.test(r)?(y.iOS=!0,navigator.appVersion.match(/OS (\d+)/),y.iOSVersion=parseInt(RegExp.$1,10),y.iPhone=r.toLowerCase().indexOf("iphone")!==-1,y.iPad=r.toLowerCase().indexOf("ipad")!==-1):/Kindle/.test(r)||/\bKF[A-Z][A-Z]+/.test(r)||/Silk.*Mobile Safari/.test(r)?y.kindle=!0:/CrOS/.test(r)&&(y.chromeOS=!0),(/Windows Phone/i.test(r)||/IEMobile/i.test(r))&&(y.android=!1,y.iOS=!1,y.macOS=!1,y.windows=!0,y.windowsPhone=!0);var p=/Silk/.test(r);return(y.windows||y.macOS||y.linux&&!p||y.chromeOS)&&(y.desktop=!0),(y.windowsPhone||/Windows NT/i.test(r)&&/Touch/i.test(r))&&(y.desktop=!1),navigator.standalone&&(y.webApp=!0),typeof importScripts!="function"&&(window.cordova!==void 0&&(y.cordova=!0),window.ejecta!==void 0&&(y.ejecta=!0)),typeof process<"u"&&process.versions&&process.versions.node&&(y.node=!0),y.node&&typeof process.versions=="object"&&(y.nodeWebkit=!!process.versions["node-webkit"],y.electron=!!process.versions.electron),/Crosswalk/.test(r)&&(y.crosswalk=!0),y.pixelRatio=window.devicePixelRatio||1,y}s.exports=e()},43267:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};function h(){if(typeof importScripts=="function")return p;var a=document.createElement("video"),l=!!a.canPlayType,n=/^no$/;try{l&&(a.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(p.ogg=!0),a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(p.h264=!0,p.mp4=!0),a.canPlayType("video/x-m4v").replace(n,"")&&(p.m4v=!0),a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(p.webm=!0),a.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(p.vp9=!0),a.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(p.hls=!0))}catch{}return a.parentNode&&a.parentNode.removeChild(a),p.getVideoURL=function(u){Array.isArray(u)||(u=[u]);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={os:e(25892),browser:e(84148),features:e(89357),input:e(31784),audio:e(7098),video:e(43267),fullscreen:e(91639),canvasFeatures:e(89289)}},89422:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new Float32Array(20),h=new r({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(a){return this._matrix.set(a),this._dirty=!0,this},reset:function(){var a=this._matrix;return a.fill(0),a[0]=1,a[6]=1,a[12]=1,a[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var a=this._data;return this._dirty&&(a.set(this._matrix),a[4]/=255,a[9]/=255,a[14]/=255,a[19]/=255,this._dirty=!1),a},brightness:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a;return this.multiply([n,0,0,0,0,0,n,0,0,0,0,0,n,0,0,0,0,0,1,0],l)},saturate:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a*2/3+1,u=(n-1)*-.5;return this.multiply([n,u,u,0,0,u,n,u,0,0,u,u,n,0,0,0,0,0,1,0],l)},desaturate:function(a){return a===void 0&&(a=!1),this.saturate(-1,a)},hue:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1),a=a/180*Math.PI;var n=Math.cos(a),u=Math.sin(a),f=.213,o=.715,c=.072;return this.multiply([f+n*(1-f)+u*-f,o+n*-o+u*-o,c+n*-c+u*(1-c),0,0,f+n*-f+u*.143,o+n*(1-o)+u*.14,c+n*-c+u*-.283,0,0,f+n*-f+u*-(1-f),o+n*-o+u*o,c+n*(1-c)+u*c,0,0,0,0,0,1,0],l)},grayscale:function(a,l){return a===void 0&&(a=1),l===void 0&&(l=!1),this.saturate(-a,l)},blackWhite:function(a){return a===void 0&&(a=!1),this.multiply(h.BLACK_WHITE,a)},contrast:function(a,l){a===void 0&&(a=0),l===void 0&&(l=!1);var n=a+1,u=-.5*(n-1);return this.multiply([n,0,0,0,u,0,n,0,0,u,0,0,n,0,u,0,0,0,1,0],l)},negative:function(a){return a===void 0&&(a=!1),this.multiply(h.NEGATIVE,a)},desaturateLuminance:function(a){return a===void 0&&(a=!1),this.multiply(h.DESATURATE_LUMINANCE,a)},sepia:function(a){return a===void 0&&(a=!1),this.multiply(h.SEPIA,a)},night:function(a,l){return a===void 0&&(a=.1),l===void 0&&(l=!1),this.multiply([a*-2,-a,0,0,0,-a,0,a,0,0,0,a,a*2,0,0,0,0,0,1,0],l)},lsd:function(a){return a===void 0&&(a=!1),this.multiply(h.LSD,a)},brown:function(a){return a===void 0&&(a=!1),this.multiply(h.BROWN,a)},vintagePinhole:function(a){return a===void 0&&(a=!1),this.multiply(h.VINTAGE,a)},kodachrome:function(a){return a===void 0&&(a=!1),this.multiply(h.KODACHROME,a)},technicolor:function(a){return a===void 0&&(a=!1),this.multiply(h.TECHNICOLOR,a)},polaroid:function(a){return a===void 0&&(a=!1),this.multiply(h.POLAROID,a)},shiftToBGR:function(a){return a===void 0&&(a=!1),this.multiply(h.SHIFT_BGR,a)},multiply:function(a,l){l===void 0&&(l=!1),l||this.reset();var n=this._matrix,u=p;return u.set(n),n.set([u[0]*a[0]+u[1]*a[5]+u[2]*a[10]+u[3]*a[15],u[0]*a[1]+u[1]*a[6]+u[2]*a[11]+u[3]*a[16],u[0]*a[2]+u[1]*a[7]+u[2]*a[12]+u[3]*a[17],u[0]*a[3]+u[1]*a[8]+u[2]*a[13]+u[3]*a[18],u[0]*a[4]+u[1]*a[9]+u[2]*a[14]+u[3]*a[19]+u[4],u[5]*a[0]+u[6]*a[5]+u[7]*a[10]+u[8]*a[15],u[5]*a[1]+u[6]*a[6]+u[7]*a[11]+u[8]*a[16],u[5]*a[2]+u[6]*a[7]+u[7]*a[12]+u[8]*a[17],u[5]*a[3]+u[6]*a[8]+u[7]*a[13]+u[8]*a[18],u[5]*a[4]+u[6]*a[9]+u[7]*a[14]+u[8]*a[19]+u[9],u[10]*a[0]+u[11]*a[5]+u[12]*a[10]+u[13]*a[15],u[10]*a[1]+u[11]*a[6]+u[12]*a[11]+u[13]*a[16],u[10]*a[2]+u[11]*a[7]+u[12]*a[12]+u[13]*a[17],u[10]*a[3]+u[11]*a[8]+u[12]*a[13]+u[13]*a[18],u[10]*a[4]+u[11]*a[9]+u[12]*a[14]+u[13]*a[19]+u[14],u[15]*a[0]+u[16]*a[5]+u[17]*a[10]+u[18]*a[15],u[15]*a[1]+u[16]*a[6]+u[17]*a[11]+u[18]*a[16],u[15]*a[2]+u[16]*a[7]+u[17]*a[12]+u[18]*a[17],u[15]*a[3]+u[16]*a[8]+u[17]*a[13]+u[18]*a[18],u[15]*a[4]+u[16]*a[9]+u[17]*a[14]+u[18]*a[19]+u[19]]),this._dirty=!0,this}});h.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],h.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],h.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],h.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],h.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],h.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],h.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],h.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],h.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],h.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],h.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],s.exports=h},51767:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(29747),h=new r({initialize:function(l,n,u){this._rgb=[0,0,0],this.onChangeCallback=p,this.dirty=!1,this.set(l,n,u)},set:function(a,l,n){return a===void 0&&(a=0),l===void 0&&(l=0),n===void 0&&(n=0),this._rgb=[a,l,n],this.onChange(),this},equals:function(a,l,n){var u=this._rgb;return u[0]===a&&u[1]===l&&u[2]===n},onChange:function(){this.dirty=!0;var a=this._rgb;this.onChangeCallback.call(this,a[0],a[1],a[2])},r:{get:function(){return this._rgb[0]},set:function(a){this._rgb[0]=a,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(a){this._rgb[1]=a,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(a){this._rgb[2]=a,this.onChange()}},destroy:function(){this.onChangeCallback=null}});s.exports=h},60461:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12};s.exports=y},54312:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(35893),h=e(86327),a=e(88417),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},46768:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},35827:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},46871:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66786),p=e(35893),h=e(7702),a=function(l,n,u,f){return u===void 0&&(u=0),f===void 0&&(f=0),r(l,p(n)+u,h(n)+f),l};s.exports=a},5198:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(26541),h=e(20786),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},11879:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=[];p[r.BOTTOM_CENTER]=e(54312),p[r.BOTTOM_LEFT]=e(46768),p[r.BOTTOM_RIGHT]=e(35827),p[r.CENTER]=e(46871),p[r.LEFT_CENTER]=e(5198),p[r.RIGHT_CENTER]=e(80503),p[r.TOP_CENTER]=e(89698),p[r.TOP_LEFT]=e(922),p[r.TOP_RIGHT]=e(21373),p[r.LEFT_BOTTOM]=p[r.BOTTOM_LEFT],p[r.LEFT_TOP]=p[r.TOP_LEFT],p[r.RIGHT_BOTTOM]=p[r.BOTTOM_RIGHT],p[r.RIGHT_TOP]=p[r.TOP_RIGHT];var h=function(a,l,n,u,f){return p[n](a,l,u,f)};s.exports=h},80503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(54380),h=e(20786),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},89698:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35893),p=e(17717),h=e(88417),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)-f),a(n,p(u)-o),n};s.exports=l},21373:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},91660:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BottomCenter:e(54312),BottomLeft:e(46768),BottomRight:e(35827),Center:e(46871),LeftCenter:e(5198),QuickSet:e(11879),RightCenter:e(80503),TopCenter:e(89698),TopLeft:e(922),TopRight:e(21373)}},71926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=e(79291),h={In:e(91660),To:e(16694)};h=p(!1,h,r),s.exports=h},21578:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(35893),h=e(88417),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)+f),a(n,r(u)+o),n};s.exports=l},10210:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)-f),a(n,r(u)+o),n};s.exports=l},82341:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,p(u)+f),a(n,r(u)+o),n};s.exports=l},87958:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},40080:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(26541),h=e(20786),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)-f),h(n,r(u)+o),n};s.exports=l},88466:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(40136),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)-f),a(n,p(u)-o),n};s.exports=l},38829:(s,y,e)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=[];p[r.BOTTOM_CENTER]=e(21578),p[r.BOTTOM_LEFT]=e(10210),p[r.BOTTOM_RIGHT]=e(82341),p[r.LEFT_BOTTOM]=e(87958),p[r.LEFT_CENTER]=e(40080),p[r.LEFT_TOP]=e(88466),p[r.RIGHT_BOTTOM]=e(19211),p[r.RIGHT_CENTER]=e(34609),p[r.RIGHT_TOP]=e(48741),p[r.TOP_CENTER]=e(49440),p[r.TOP_LEFT]=e(81288),p[r.TOP_RIGHT]=e(61323);var h=function(a,l,n,u,f){return p[n](a,l,u,f)};s.exports=h},19211:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(54380),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},34609:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7702),p=e(54380),h=e(20786),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,p(u)+f),h(n,r(u)+o),n};s.exports=l},48741:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(385),a=e(66737),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),h(n,r(u)+f),a(n,p(u)-o),n};s.exports=l},49440:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35893),p=e(17717),h=e(86327),a=e(88417),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)+f),h(n,p(u)-o),n};s.exports=l},81288:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26541),p=e(17717),h=e(86327),a=e(385),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)-f),h(n,p(u)-o),n};s.exports=l},61323:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54380),p=e(17717),h=e(86327),a=e(40136),l=function(n,u,f,o){return f===void 0&&(f=0),o===void 0&&(o=0),a(n,r(u)+f),h(n,p(u)-o),n};s.exports=l},16694:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BottomCenter:e(21578),BottomLeft:e(10210),BottomRight:e(82341),LeftBottom:e(87958),LeftCenter:e(40080),LeftTop:e(88466),QuickSet:e(38829),RightBottom:e(19211),RightCenter:e(34609),RightTop:e(48741),TopCenter:e(49440),TopLeft:e(81288),TopRight:e(61323)}},66786:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(88417),p=e(20786),h=function(a,l,n){return r(a,l),p(a,n)};s.exports=h},62235:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y+e.height-e.height*e.originY};s.exports=y},72873:(s,y,e)=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62235),p=e(26541),h=e(54380),a=e(17717),l=e(87841),n=function(u,f){f===void 0&&(f=new l);var o=p(u),c=a(u);return f.x=o,f.y=c,f.width=h(u)-o,f.height=r(u)-c,f};s.exports=n},35893:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x-e.width*e.originX+e.width*.5};s.exports=y},7702:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y-e.height*e.originY+e.height*.5};s.exports=y},26541:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x-e.width*e.originX};s.exports=y},87431:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.width*e.originX};s.exports=y},46928:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.height*e.originY};s.exports=y},54380:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x+e.width-e.width*e.originX};s.exports=y},17717:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.y-e.height*e.originY};s.exports=y},86327:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.y=r-e.height+e.height*e.originY,e};s.exports=y},88417:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.width*e.originX;return e.x=r+p-e.width*.5,e};s.exports=y},20786:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.height*e.originY;return e.y=r+p-e.height*.5,e};s.exports=y},385:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x=r+e.width*e.originX,e};s.exports=y},40136:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x=r-e.width+e.width*e.originX,e};s.exports=y},66737:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.y=r+e.height*e.originY,e};s.exports=y},58724:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CenterOn:e(66786),GetBottom:e(62235),GetBounds:e(72873),GetCenterX:e(35893),GetCenterY:e(7702),GetLeft:e(26541),GetOffsetX:e(87431),GetOffsetY:e(46928),GetRight:e(54380),GetTop:e(17717),SetBottom:e(86327),SetCenterX:e(88417),SetCenterY:e(20786),SetLeft:e(385),SetRight:e(40136),SetTop:e(66737)}},20623:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setCrisp:function(e){var r=["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"];return r.forEach(function(p){e.style["image-rendering"]=p}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(e){return e.style["image-rendering"]="auto",e.style.msInterpolationMode="bicubic",e}};s.exports=y},27919:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8054),p=e(68703),h=[],a=!1,l=function(){var n=function(M,w,C,A,P){w===void 0&&(w=1),C===void 0&&(C=1),A===void 0&&(A=r.CANVAS),P===void 0&&(P=!1);var b,O=o(A);return O===null?(O={parent:M,canvas:document.createElement("canvas"),type:A},A===r.CANVAS&&h.push(O),b=O.canvas):(O.parent=M,b=O.canvas),P&&(O.parent=b),b.width=w,b.height=C,a&&A===r.CANVAS&&p.disable(b.getContext("2d",{willReadFrequently:!1})),b},u=function(M,w,C){return n(M,w,C,r.CANVAS)},f=function(M,w,C){return n(M,w,C,r.WEBGL)},o=function(M){if(M===void 0&&(M=r.CANVAS),M===r.WEBGL)return null;for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y="",e=function(){var r=function(l){for(var n=["i","webkitI","msI","mozI","oI"],u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r="none"),e.style.msTouchAction=r,e.style["ms-touch-action"]=r,e.style["touch-action"]=r,e};s.exports=y},91610:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r="none");var p=["-webkit-","-khtml-","-moz-","-ms-",""];return p.forEach(function(h){e.style[h+"user-select"]=r}),e.style["-webkit-touch-callout"]=r,e.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",e};s.exports=y},26253:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CanvasInterpolation:e(20623),CanvasPool:e(27919),Smoothing:e(68703),TouchAction:e(65208),UserSelect:e(91610)}},40987:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37589),h=e(1e3),a=e(7537),l=e(87837),n=new r({initialize:function(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(f,o,c,d)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(u,f,o,c,d){return c===void 0&&(c=255),d===void 0&&(d=!0),this._locked=!0,this.red=u,this.green=f,this.blue=o,this.alpha=c,this._locked=!1,this.update(d)},setGLTo:function(u,f,o,c){return c===void 0&&(c=1),this._locked=!0,this.redGL=u,this.greenGL=f,this.blueGL=o,this.alphaGL=c,this._locked=!1,this.update(!0)},setFromRGB:function(u){return this._locked=!0,this.red=u.r,this.green=u.g,this.blue=u.b,u.hasOwnProperty("a")&&(this.alpha=u.a),this._locked=!1,this.update(!0)},setFromHSV:function(u,f,o){return a(u,f,o,this)},update:function(u){if(u===void 0&&(u=!1),this._locked)return this;var f=this.r,o=this.g,c=this.b,d=this.a;return this._color=p(f,o,c),this._color32=h(f,o,c,d),this._rgba="rgba("+f+","+o+","+c+","+d/255+")",u&&l(f,o,c,this),this},updateHSV:function(){var u=this.r,f=this.g,o=this.b;return l(u,f,o,this),this},clone:function(){return new n(this.r,this.g,this.b,this.a)},gray:function(u){return this.setTo(u,u,u)},random:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var o=Math.floor(u+Math.random()*(f-u)),c=Math.floor(u+Math.random()*(f-u)),d=Math.floor(u+Math.random()*(f-u));return this.setTo(o,c,d)},randomGray:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var o=Math.floor(u+Math.random()*(f-u));return this.setTo(o,o,o)},saturate:function(u){return this.s+=u/100,this},desaturate:function(u){return this.s-=u/100,this},lighten:function(u){return this.v+=u/100,this},darken:function(u){return this.v-=u/100,this},brighten:function(u){var f=this.r,o=this.g,c=this.b;return f=Math.max(0,Math.min(255,f-Math.round(255*-(u/100)))),o=Math.max(0,Math.min(255,o-Math.round(255*-(u/100)))),c=Math.max(0,Math.min(255,c-Math.round(255*-(u/100)))),this.setTo(f,o,c)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(u){this.gl[0]=Math.min(Math.abs(u),1),this.r=Math.floor(this.gl[0]*255),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(u){this.gl[1]=Math.min(Math.abs(u),1),this.g=Math.floor(this.gl[1]*255),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(u){this.gl[2]=Math.min(Math.abs(u),1),this.b=Math.floor(this.gl[2]*255),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(u){this.gl[3]=Math.min(Math.abs(u),1),this.a=Math.floor(this.gl[3]*255),this.update()}},red:{get:function(){return this.r},set:function(u){u=Math.floor(Math.abs(u)),this.r=Math.min(u,255),this.gl[0]=u/255,this.update(!0)}},green:{get:function(){return this.g},set:function(u){u=Math.floor(Math.abs(u)),this.g=Math.min(u,255),this.gl[1]=u/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(u){u=Math.floor(Math.abs(u)),this.b=Math.min(u,255),this.gl[2]=u/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(u){u=Math.floor(Math.abs(u)),this.a=Math.min(u,255),this.gl[3]=u/255,this.update()}},h:{get:function(){return this._h},set:function(u){this._h=u,a(u,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(u){this._s=u,a(this._h,u,this._v,this)}},v:{get:function(){return this._v},set:function(u){this._v=u,a(this._h,this._s,u,this)}}});s.exports=n},92728:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589),p=function(h){h===void 0&&(h=1024);var a=[],l=255,n,u=255,f=0,o=0;for(n=0;n<=l;n++)a.push({r:u,g:n,b:o,color:r(u,n,o)});for(f=255,n=l;n>=0;n--)a.push({r:n,g:f,b:o,color:r(n,f,o)});for(u=0,n=0;n<=l;n++,f--)a.push({r:u,g:f,b:n,color:r(u,f,n)});for(f=0,o=255,n=0;n<=l;n++,o--,u++)a.push({r:u,g:f,b:o,color:r(u,f,o)});if(h===1024)return a;var c=[],d=0,v=1024/h;for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={r:e>>16&255,g:e>>8&255,b:e&255,a:255};return e>16777215&&(r.a=e>>>24),r};s.exports=y},62957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.toString(16);return r.length===1?"0"+r:r};s.exports=y},37589:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e<<16|r<<8|p};s.exports=y},1e3:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return h<<24|e<<16|r<<8|p};s.exports=y},62183:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=e(89528),h=function(a,l,n){var u=n,f=n,o=n;if(l!==0){var c=n<.5?n*(1+l):n+l-n*l,d=2*n-c;u=p(d,c,a+1/3),f=p(d,c,a),o=p(d,c,a-1/3)}var v=new r;return v.setGLTo(u,f,o,1)};s.exports=h},27939:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7537),p=function(h,a){h===void 0&&(h=1),a===void 0&&(a=1);for(var l=[],n=0;n<=359;n++)l.push(r(n/359,h,a));return l};s.exports=p},7537:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589);function p(a,l,n,u){var f=(a+l*6)%6,o=Math.min(f,4-f,1);return Math.round(255*(u-u*n*Math.max(0,o)))}var h=function(a,l,n,u){l===void 0&&(l=1),n===void 0&&(n=1);var f=p(5,a,l,n),o=p(3,a,l,n),c=p(1,a,l,n);return u?u.setTo?u.setTo(f,o,c,u.alpha,!0):(u.r=f,u.g=o,u.b=c,u.color=r(f,o,c),u):{r:f,g:o,b:c,color:r(f,o,c)}};s.exports=h},70238:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){var a=new r;h=h.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(o,c,d,v){return c+c+d+d+v+v});var l=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);if(l){var n=parseInt(l[1],16),u=parseInt(l[2],16),f=parseInt(l[3],16);a.setTo(n,u,f)}return a};s.exports=p},89528:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?e+(r-e)*6*p:p<.5?r:p<.6666666666666666?e+(r-e)*(.6666666666666666-p)*6:e};s.exports=y},30100:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=e(90664),h=function(a){var l=p(a);return new r(l.r,l.g,l.b,l.a)};s.exports=h},90664:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>16777215?{a:e>>>24,r:e>>16&255,g:e>>8&255,b:e&255}:{a:255,r:e>>16&255,g:e>>8&255,b:e&255}};s.exports=y},13699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28915),p=function(l,n,u,f,o,c,d,v){d===void 0&&(d=100),v===void 0&&(v=0);var m=v/d;return{r:r(l,f,m),g:r(n,o,m),b:r(u,c,m)}},h=function(l,n,u,f){return u===void 0&&(u=100),f===void 0&&(f=0),p(l.r,l.g,l.b,n.r,n.g,n.b,u,f)},a=function(l,n,u,f,o,c){return o===void 0&&(o=100),c===void 0&&(c=0),p(l.r,l.g,l.b,n,u,f,o,c)};s.exports={RGBWithRGB:p,ColorWithRGB:a,ColorWithColor:h}},68957:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){return new r(h.r,h.g,h.b,h.a)};s.exports=p},87388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987),p=function(h){var a=new r,l=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(h.toLowerCase());if(l){var n=parseInt(l[1],10),u=parseInt(l[2],10),f=parseInt(l[3],10),o=l[4]!==void 0?parseFloat(l[4]):1;a.setTo(n,u,f,o*255)}return a};s.exports=p},87837:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){h===void 0&&(h={h:0,s:0,v:0}),e/=255,r/=255,p/=255;var a=Math.min(e,r,p),l=Math.max(e,r,p),n=l-a,u=0,f=l===0?0:n/l,o=l;return l!==a&&(l===e?u=(r-p)/n+(r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62957),p=function(h,a,l,n,u){return n===void 0&&(n=255),u===void 0&&(u="#"),u==="#"?"#"+((1<<24)+(h<<16)+(a<<8)+l).toString(16).slice(1,7):"0x"+r(n)+r(h)+r(a)+r(l)};s.exports=p},85386:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(40987),h=function(a,l){return a===void 0&&(a=0),l===void 0&&(l=255),new p(r(a,l),r(a,l),r(a,l))};s.exports=h},80333:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70238),p=e(30100),h=e(68957),a=e(87388),l=function(n){var u=typeof n;switch(u){case"string":return n.substr(0,3).toLowerCase()==="rgb"?a(n):r(n);case"number":return p(n);case"object":return h(n)}};s.exports=l},3956:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40987);r.ColorSpectrum=e(92728),r.ColorToRGBA=e(91588),r.ComponentToHex=e(62957),r.GetColor=e(37589),r.GetColor32=e(1e3),r.HexStringToColor=e(70238),r.HSLToColor=e(62183),r.HSVColorWheel=e(27939),r.HSVToRGB=e(7537),r.HueToComponent=e(89528),r.IntegerToColor=e(30100),r.IntegerToRGB=e(90664),r.Interpolate=e(13699),r.ObjectToColor=e(68957),r.RandomRGB=e(85386),r.RGBStringToColor=e(87388),r.RGBToHSV=e(87837),r.RGBToString=e(75723),r.ValueToColor=e(80333),s.exports=r},27460:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Align:e(71926),BaseShader:e(73894),Bounds:e(58724),Canvas:e(26253),Color:e(3956),ColorMatrix:e(89422),Masks:e(69781),RGB:e(51767)}},6858:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39429),h=new r({initialize:function(l,n,u,f,o,c){n||(n=l.sys.make.image({x:u,y:f,key:o,frame:c,add:!1})),this.bitmapMask=n,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(a){this.bitmapMask=a},preRenderWebGL:function(a,l,n){a.pipelines.BITMAPMASK_PIPELINE.beginMask(this,l,n)},postRenderWebGL:function(a,l,n){a.pipelines.BITMAPMASK_PIPELINE.endMask(this,l,n)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});p.register("bitmapMask",function(a,l,n,u,f){return new h(this.scene,a,l,n,u,f)}),s.exports=h},80661:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.geometryMask=l,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(h){return this.geometryMask=h,this},setInvertAlpha:function(h){return h===void 0&&(h=!0),this.invertAlpha=h,this},preRenderWebGL:function(h,a,l){var n=h.gl;h.flush(),h.maskStack.length===0&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),h.maskCount=0),h.currentCameraMask.mask!==this&&(h.currentMask.mask=this),h.maskStack.push({mask:this,camera:l}),this.applyStencil(h,l,!0),h.maskCount++},applyStencil:function(h,a,l){var n=h.gl,u=this.geometryMask,f=h.maskCount,o=255;n.colorMask(!1,!1,!1,!1),l?(n.stencilFunc(n.EQUAL,f,o),n.stencilOp(n.KEEP,n.KEEP,n.INCR),f++):(n.stencilFunc(n.EQUAL,f+1,o),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=f,u.renderWebGL(h,u,a),h.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,f,o):n.stencilFunc(n.EQUAL,f,o)},postRenderWebGL:function(h){var a=h.gl;h.maskStack.pop(),h.maskCount--,h.flush();var l=h.currentMask;if(h.maskStack.length===0)l.mask=null,a.disable(a.STENCIL_TEST);else{var n=h.maskStack[h.maskStack.length-1];n.mask.applyStencil(h,n.camera,!1),h.currentCameraMask.mask!==n.mask?(l.mask=n.mask,l.camera=n.camera):l.mask=null}},preRenderCanvas:function(h,a,l){var n=this.geometryMask;h.currentContext.save(),n.renderCanvas(h,n,l,null,null,!0),h.currentContext.clip()},postRenderCanvas:function(h){h.currentContext.restore()},destroy:function(){this.geometryMask=null}});s.exports=p},69781:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BitmapMask:e(6858),GeometryMask:e(80661)}},73894:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){(!l||l==="")&&(l=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join(` +`)),(!n||n==="")&&(n=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join(` +`)),u===void 0&&(u=null),this.key=a,this.fragmentSrc=l,this.vertexSrc=n,this.uniforms=u}});s.exports=p},40366:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p;if(r)typeof r=="string"?p=document.getElementById(r):typeof r=="object"&&r.nodeType===1&&(p=r);else if(e.parentElement||r===null)return e;return p||(p=document.body),p.appendChild(e),e};s.exports=y},83719:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=function(h){var a=h.config;if(!(!a.parent||!a.domCreateContainer)){var l=document.createElement("div");l.style.cssText=["display: block;","width: "+h.scale.width+"px;","height: "+h.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+a.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),h.domContainer=l,r(l,a.parent)}};s.exports=p},57264:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25892),p=function(h){if(document.readyState==="complete"||document.readyState==="interactive"){h();return}var a=function(){document.removeEventListener("deviceready",a,!0),document.removeEventListener("DOMContentLoaded",a,!0),window.removeEventListener("load",a,!0),h()};document.body?r.cordova?document.addEventListener("deviceready",a,!1):(document.addEventListener("DOMContentLoaded",a,!0),window.addEventListener("load",a,!0)):window.setTimeout(a,20)};s.exports=p},57811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!e)return window.innerHeight;var r=Math.abs(window.orientation),p={w:0,h:0},h=document.createElement("div");return h.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(h),p.w=r===90?h.offsetHeight:window.innerWidth,p.h=r===90?window.innerWidth:h.offsetHeight,document.documentElement.removeChild(h),h=null,Math.abs(window.orientation)!==90?p.h:p.w};s.exports=y},45818:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13560),p=function(h,a){var l=window.screen,n=l?l.orientation||l.mozOrientation||l.msOrientation:!1;if(n&&typeof n.type=="string")return n.type;if(typeof n=="string")return n;if(typeof window.orientation=="number")return window.orientation===0||window.orientation===180?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return r.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return r.ORIENTATION.LANDSCAPE}else return a>h?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE};s.exports=p},74403:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r;return e!==""&&(typeof e=="string"?r=document.getElementById(e):e&&e.nodeType===1&&(r=e)),r||(r=document.body),r};s.exports=y},56836:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r="";try{if(window.DOMParser){var p=new DOMParser;r=p.parseFromString(e,"text/xml")}else r=new ActiveXObject("Microsoft.XMLDOM"),r.loadXML(e)}catch{r=null}return!r||!r.documentElement||r.getElementsByTagName("parsererror").length?null:r};s.exports=y},35846:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){e.parentNode&&e.parentNode.removeChild(e)};s.exports=y},43092:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(29747),h=new r({initialize:function(){this.isRunning=!1,this.callback=p,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var l=this;this.step=function n(u){l.callback(u),l.isRunning&&(l.timeOutID=window.requestAnimationFrame(n))},this.stepTimeout=function n(){l.isRunning&&(l.timeOutID=window.setTimeout(n,l.delay)),l.callback(window.performance.now())}},start:function(a,l,n){this.isRunning||(this.callback=a,this.isSetTimeOut=l,this.delay=n,this.isRunning=!0,this.timeOutID=l?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=p}});s.exports=h},84902:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={AddToDOM:e(40366),DOMContentLoaded:e(57264),GetInnerHeight:e(57811),GetScreenOrientation:e(45818),GetTarget:e(74403),ParseXML:e(56836),RemoveFromDOM:e(35846),RequestAnimationFrame:e(43092)};s.exports=r},47565:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(37277),a=new r({Extends:p,initialize:function(){p.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});h.register("EventEmitter",a,"events"),s.exports=a},93055:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={EventEmitter:e(47565)}},20122:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.BARREL,n),this.amount=u}});s.exports=a},32251:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v){f===void 0&&(f=1),o===void 0&&(o=1),c===void 0&&(c=1),d===void 0&&(d=1),v===void 0&&(v=4),p.call(this,h.BLOOM,n),this.steps=v,this.offsetX=f,this.offsetY=o,this.blurStrength=c,this.strength=d,this.glcolor=[1,1,1],u!=null&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},9047:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v){u===void 0&&(u=0),f===void 0&&(f=2),o===void 0&&(o=2),c===void 0&&(c=1),v===void 0&&(v=4),p.call(this,h.BLUR,n),this.quality=u,this.x=f,this.y=o,this.steps=v,this.strength=c,this.glcolor=[1,1,1],d!=null&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},27885:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=.5),f===void 0&&(f=1),o===void 0&&(o=.2),c===void 0&&(c=!1),d===void 0&&(d=1),v===void 0&&(v=1),m===void 0&&(m=1),p.call(this,h.BOKEH,n),this.radius=u,this.amount=f,this.contrast=o,this.isTiltShift=c,this.strength=m,this.blurX=d,this.blurY=v}});s.exports=a},12578:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d){u===void 0&&(u=8),c===void 0&&(c=1),d===void 0&&(d=.005),p.call(this,h.CIRCLE,n),this.scale=c,this.feather=d,this.thickness=u,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],f!=null&&(this.color=f),o!=null&&(this.backgroundColor=o)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundColor:{get:function(){var l=this.glcolor2;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor2;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(l){this.glcolor2[3]=l}}});s.exports=a},15802:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89422),h=e(14811),a=new r({Extends:p,initialize:function(n){p.call(this),this.type=h.COLOR_MATRIX,this.gameObject=n,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});s.exports=a},72898:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.type=a,this.gameObject=l,this.active=!0},setActive:function(h){return this.active=h,this},destroy:function(){this.gameObject=null,this.active=!1}});s.exports=p},44553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o){u===void 0&&(u="__WHITE"),f===void 0&&(f=.005),o===void 0&&(o=.005),p.call(this,h.DISPLACEMENT,n),this.x=f,this.y=o,this.glTexture,this.setTexture(u)},setTexture:function(l){var n=this.gameObject.scene.sys.textures.getFrame(l);return n&&(this.glTexture=n.glTexture),this}});s.exports=a},68531:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){f===void 0&&(f=4),o===void 0&&(o=0),c===void 0&&(c=!1),p.call(this,h.GLOW,n),this.outerStrength=f,this.innerStrength=o,this.knockout=c,this.glcolor=[1,1,1,1],u!==void 0&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},37102:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m,S){o===void 0&&(o=.2),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=1),S===void 0&&(S=0),p.call(this,h.GRADIENT,n),this.alpha=o,this.size=S,this.fromX=c,this.fromY=d,this.toX=v,this.toY=m,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],u!=null&&(this.color1=u),f!=null&&(this.color2=f)},color1:{get:function(){var l=this.glcolor1;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor1;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}},color2:{get:function(){var l=this.glcolor2;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor2;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}}});s.exports=a},86886:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.PIXELATE,n),this.amount=u}});s.exports=a},92322:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=.1),c===void 0&&(c=1),v===void 0&&(v=6),m===void 0&&(m=1),p.call(this,h.SHADOW,n),this.x=u,this.y=f,this.decay=o,this.power=c,this.glcolor=[0,0,0,1],this.samples=v,this.intensity=m,d!==void 0&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});s.exports=a},39563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.5),f===void 0&&(f=.5),o===void 0&&(o=3),c===void 0&&(c=!1),p.call(this,h.SHINE,n),this.speed=u,this.lineWidth=f,this.gradient=o,this.reveal=c}});s.exports=a},56448:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.5),f===void 0&&(f=.5),o===void 0&&(o=.5),c===void 0&&(c=.5),p.call(this,h.VIGNETTE,n),this.x=u,this.y=f,this.radius=o,this.strength=c}});s.exports=a},38433:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72898),h=e(14811),a=new r({Extends:p,initialize:function(n,u,f,o,c){u===void 0&&(u=.1),f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=!1),p.call(this,h.WIPE,n),this.progress=0,this.wipeWidth=u,this.direction=f,this.axis=o,this.reveal=c}});s.exports=a},14811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19};s.exports=y},66064:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(14811),h={Barrel:e(20122),Controller:e(72898),Bloom:e(32251),Blur:e(9047),Bokeh:e(27885),Circle:e(12578),ColorMatrix:e(15802),Displacement:e(44553),Glow:e(68531),Gradient:e(37102),Pixelate:e(86886),Shadow:e(92322),Shine:e(39563),Vignette:e(56448),Wipe:e(38433)};h=r(!1,h,p),s.exports=h},25305:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(23568),h=function(a,l,n){l.x=p(n,"x",0),l.y=p(n,"y",0),l.depth=p(n,"depth",0),l.flipX=p(n,"flipX",!1),l.flipY=p(n,"flipY",!1);var u=p(n,"scale",null);typeof u=="number"?l.setScale(u):u!==null&&(l.scaleX=p(u,"x",1),l.scaleY=p(u,"y",1));var f=p(n,"scrollFactor",null);typeof f=="number"?l.setScrollFactor(f):f!==null&&(l.scrollFactorX=p(f,"x",1),l.scrollFactorY=p(f,"y",1)),l.rotation=p(n,"rotation",0);var o=p(n,"angle",null);o!==null&&(l.angle=o),l.alpha=p(n,"alpha",1);var c=p(n,"origin",null);if(typeof c=="number")l.setOrigin(c);else if(c!==null){var d=p(c,"x",.5),v=p(c,"y",.5);l.setOrigin(d,v)}l.blendMode=p(n,"blendMode",r.NORMAL),l.visible=p(n,"visible",!0);var m=p(n,"add",!0);return m&&a.sys.displayList.add(l),l.preUpdate&&a.sys.updateList.add(l),l};s.exports=h},13059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23568),p=function(h,a){var l=r(a,"anims",null);if(l===null)return h;if(typeof l=="string")h.anims.play(l);else if(typeof l=="object"){var n=h.anims,u=r(l,"key",void 0);if(u){var f=r(l,"startFrame",void 0),o=r(l,"delay",0),c=r(l,"repeat",0),d=r(l,"repeatDelay",0),v=r(l,"yoyo",!1),m=r(l,"play",!1),S=r(l,"delayedPlay",0),M={key:u,delay:o,repeat:c,repeatDelay:d,yoyo:v,startFrame:f};m?n.play(M):S>0?n.playAfterDelay(M,S):n.load(M)}}return h};s.exports=p},8050:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(73162),h=e(37277),a=e(51708),l=e(44594),n=e(19186),u=new r({Extends:p,initialize:function(o){p.call(this,o),this.sortChildrenFlag=!1,this.scene=o,this.systems=o.sys,this.events=o.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(l.BOOT,this.boot,this),this.events.on(l.START,this.start,this)},boot:function(){this.events.once(l.DESTROY,this.destroy,this)},addChildCallback:function(f){f.displayList&&f.displayList!==this&&f.removeFromDisplayList(),f.parentContainer&&f.parentContainer.remove(f),f.displayList||(this.queueDepthSort(),f.displayList=this,f.emit(a.ADDED_TO_SCENE,f,this.scene),this.events.emit(l.ADDED_TO_SCENE,f,this.scene))},removeChildCallback:function(f){this.queueDepthSort(),f.displayList=null,f.emit(a.REMOVED_FROM_SCENE,f,this.scene),this.events.emit(l.REMOVED_FROM_SCENE,f,this.scene)},start:function(){this.events.once(l.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(n(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(f,o){return f._depth-o._depth},getChildren:function(){return this.list},shutdown:function(){for(var f=this.list;f.length;)f[0].destroy(!0);this.events.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(l.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});h.register("DisplayList",u,"displayList"),s.exports=u},95643:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(53774),h=e(45893),a=e(50792),l=e(51708),n=e(44594),u=new r({Extends:a,initialize:function(o,c){a.call(this),this.scene=o,this.displayList=null,this.type=c,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(l.ADDED_TO_SCENE,this.addedToScene,this),this.on(l.REMOVED_FROM_SCENE,this.removedFromScene,this),o.sys.queueDepthSort()},setActive:function(f){return this.active=f,this},setName:function(f){return this.name=f,this},setState:function(f){return this.state=f,this},setDataEnabled:function(){return this.data||(this.data=new h(this)),this},setData:function(f,o){return this.data||(this.data=new h(this)),this.data.set(f,o),this},incData:function(f,o){return this.data||(this.data=new h(this)),this.data.inc(f,o),this},toggleData:function(f){return this.data||(this.data=new h(this)),this.data.toggle(f),this},getData:function(f){return this.data||(this.data=new h(this)),this.data.get(f)},setInteractive:function(f,o,c){return this.scene.sys.input.enable(this,f,o,c),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return p(this)},willRender:function(f){var o=this.displayList&&this.displayList.active?this.displayList.willRender(f):!0;return!(!o||u.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&f.id)},getIndexList:function(){for(var f=this,o=this.parentContainer,c=[];o&&(c.unshift(o.getIndex(f)),f=o,o.parentContainer);)o=o.parentContainer;return this.displayList?c.unshift(this.displayList.getIndex(f)):c.unshift(this.scene.sys.displayList.getIndex(f)),c},addToDisplayList:function(f){return f===void 0&&(f=this.scene.sys.displayList),this.displayList&&this.displayList!==f&&this.removeFromDisplayList(),f.exists(this)||(this.displayList=f,f.add(this,!0),f.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),f.events.emit(n.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var f=this.displayList||this.scene.sys.displayList;return f&&f.exists(this)&&(f.remove(this,!0),f.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),f.events.emit(n.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(f){!this.scene||this.ignoreDestroy||(f===void 0&&(f=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(l.DESTROY,this,f),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,s.exports=u},44603:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(l,n){a.prototype.hasOwnProperty(l)||(a.prototype[l]=n)},a.remove=function(l){a.prototype.hasOwnProperty(l)&&delete a.prototype[l]},p.register("GameObjectCreator",a,"make"),s.exports=a},39429:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},existing:function(l){return(l.renderCanvas||l.renderWebGL)&&this.displayList.add(l),l.preUpdate&&this.updateList.add(l),l},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});a.register=function(l,n){a.prototype.hasOwnProperty(l)||(a.prototype[l]=n)},a.remove=function(l){a.prototype.hasOwnProperty(l)&&delete a.prototype[l]},p.register("GameObjectFactory",a,"add"),s.exports=a},91296:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=new r,h=new r,a=new r,l={camera:p,sprite:h,calc:a},n=function(u,f,o){var c=p,d=h,v=a;return d.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),c.copyFrom(f.matrix),o?(c.multiplyWithOffset(o,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),d.e=u.x,d.f=u.y):(d.e-=f.scrollX*u.scrollFactorX,d.f-=f.scrollY*u.scrollFactorY),c.multiply(d,v),l};s.exports=n},45027:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(25774),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){p.call(this),this.checkQueue=!0,this.scene=u,this.systems=u.sys,u.sys.events.once(a.BOOT,this.boot,this),u.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var n=this.systems.events;n.on(a.PRE_UPDATE,this.update,this),n.on(a.UPDATE,this.sceneUpdate,this),n.once(a.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(n,u){for(var f=this._active,o=f.length,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l,n,u,f,o,c,d,v,m,S){var M=p.x-r.displayOriginX+a,w=p.y-r.displayOriginY+l,C=M+p.w,A=w+p.h,P=n.getXRound(M,w,u),b=n.getYRound(M,w,u),O=n.getXRound(M,A,u),I=n.getYRound(M,A,u),D=n.getXRound(C,A,u),B=n.getYRound(C,A,u),G=n.getXRound(C,w,u),z=n.getYRound(C,w,u);e.batchQuad(r,P,b,O,I,D,B,G,z,h.u0,h.v0,h.u1,h.v1,f,o,c,d,v,m,S)};s.exports=y},53048:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(p===void 0&&(p=!1),h===void 0)return h={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},h;var a=e.text,l=a.length,n=e.maxWidth,u=e.wordWrapCharCode,f=Number.MAX_VALUE,o=Number.MAX_VALUE,c=0,d=0,v=e.fontData.chars,m=e.fontData.lineHeight,S=e.letterSpacing,M=e.lineSpacing,w=0,C=0,A=0,P=null,b=e._align,O=0,I=0,D=e.fontSize/e.fontData.size,B=D*e.scaleX,G=D*e.scaleY,z=null,X=0,K=[],Q=Number.MAX_VALUE,tt=0,Y=0,Z=0,U,H=[],J=[],_=null;if(n>0){for(U=0;Un||Vt>n?(rt.push(gt.i-1),gt.cr?(rt.push(gt.i+gt.word.length),ot=0,at=null):at=gt):gt.cr&&(rt.push(gt.i+gt.word.length),ot=0,at=null)}var dt=function(Oe,Be,Le){return Oe.substr(0,Be)+Le+Oe.substr(Be+1)};for(U=rt.length-1;U>=0;U--)a=dt(a,rt[U],` +`);h.wrappedText=a,l=a.length,H=[],_=null}var ut=0;for(U=0;Utt&&(tt=Z),ZO&&(f=O),o>I&&(o=I);var Dt=O+P.xAdvance,Ht=I+m;ctt&&(tt=Z),Z0)for(var ne=0;ne{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21859),p=function(h,a,l,n,u,f,o){var c=h.sys.textures.get(l),d=c.get(n),v=h.sys.cache.xml.get(u);if(d&&v){var m=r(v,d,f,o,c);return h.sys.cache.bitmapFont.add(a,{data:m,texture:l,frame:n,fromAtlas:!0}),!0}else return!1};s.exports=p},6925:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=function(h,a){var l=a.width,n=a.height,u=Math.floor(l/2),f=Math.floor(n/2),o=r(a,"chars","");if(o!==""){var c=r(a,"image",""),d=h.sys.textures.getFrame(c),v=d.cutX,m=d.cutY,S=d.source.width,M=d.source.height,w=r(a,"offset.x",0),C=r(a,"offset.y",0),A=r(a,"spacing.x",0),P=r(a,"spacing.y",0),b=r(a,"lineSpacing",0),O=r(a,"charsPerRow",null);O===null&&(O=S/l,O>o.length&&(O=o.length));for(var I=w,D=C,B={retroFont:!0,font:c,size:l,lineHeight:n+b,chars:{}},G=0,z=0;z{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(r,p){return parseInt(r.getAttribute(p),10)}var e=function(r,p,h,a,l){h===void 0&&(h=0),a===void 0&&(a=0);var n=p.cutX,u=p.cutY,f=p.source.width,o=p.source.height,c=p.sourceIndex,d={},v=r.getElementsByTagName("info")[0],m=r.getElementsByTagName("common")[0];d.font=v.getAttribute("face"),d.size=y(v,"size"),d.lineHeight=y(m,"lineHeight")+a,d.chars={};var S=r.getElementsByTagName("char"),M=p!==void 0&&p.trimmed;if(M)var w=p.height,C=p.width;for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87662),p=e(79291),h={Parse:e(6925)};h=p(!1,h,r),s.exports=h},87662:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ`,TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:`ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' `,TEXT_SET7:`AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39`,TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:`ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!`,TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:`ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789`};s.exports=y},2638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(83419),h=e(12310),a=new p({Extends:r,Mixins:[h],initialize:function(n,u,f,o,c,d,v){r.call(this,n,u,f,o,c,d,v),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(l,n){return this.cropWidth=l,this.cropHeight=n,this},setDisplayCallback:function(l){return this.displayCallback=l,this},setScrollX:function(l){return this.scrollX=l,this},setScrollY:function(l){return this.scrollY=l,this}});s.exports=a},86741:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20926),p=function(h,a,l,n){var u=a._text,f=u.length,o=h.currentContext;if(!(f===0||!r(h,o,a,l,n))){l.addToRenderList(a);var c=a.fromAtlas?a.frame:a.texture.frames.__BASE,d=a.displayCallback,v=a.callbackData,m=a.fontData.chars,S=a.fontData.lineHeight,M=a._letterSpacing,w=0,C=0,A=0,P=null,b=0,O=0,I=0,D=0,B=0,G=0,z=null,X=0,K=a.frame.source.image,Q=c.cutX,tt=c.cutY,Y=0,Z=0,U=a._fontSize/a.fontData.size,H=a._align,J=0,_=0;a.getTextBounds(!1);var q=a._bounds.lines;H===1?_=(q.longest-q.lengths[0])/2:H===2&&(_=q.longest-q.lengths[0]),o.translate(-a.displayOriginX,-a.displayOriginY);var at=l.roundPixels;a.cropWidth>0&&a.cropHeight>0&&(o.beginPath(),o.rect(0,0,a.cropWidth,a.cropHeight),o.clip());for(var ot=0;ot{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2638),p=e(25305),h=e(44603),a=e(23568);h.register("dynamicBitmapText",function(l,n){l===void 0&&(l={});var u=a(l,"font",""),f=a(l,"text",""),o=a(l,"size",!1),c=new r(this.scene,0,0,u,f,o);return n!==void 0&&(l.add=n),p(this.scene,c,l),c})},72566:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2638),p=e(39429);p.register("dynamicBitmapText",function(h,a,l,n,u){return this.displayList.add(new r(this.scene,h,a,l,n,u))})},12310:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(73482),h=e(86741),s.exports={renderWebGL:p,renderCanvas:h}},73482:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(61340),h=e(70554),a=new p,l=function(n,u,f,o){var c=u.text,d=c.length;if(d!==0){f.addToRenderList(u);var v=n.pipelines.set(u.pipeline,u),m=r(u,f,o);n.pipelines.preBatch(u);var S=m.sprite,M=m.calc,w=a,C=u.cropWidth>0||u.cropHeight>0;C&&(v.flush(),n.pushScissor(M.tx,M.ty,u.cropWidth*M.scaleX,u.cropHeight*M.scaleY));var A=u.frame,P=A.glTexture,b=u.tintFill,O=h.getTintAppendFloatAlpha(u.tintTopLeft,f.alpha*u._alphaTL),I=h.getTintAppendFloatAlpha(u.tintTopRight,f.alpha*u._alphaTR),D=h.getTintAppendFloatAlpha(u.tintBottomLeft,f.alpha*u._alphaBL),B=h.getTintAppendFloatAlpha(u.tintBottomRight,f.alpha*u._alphaBR),G=v.setGameObject(u),z=0,X=0,K=0,Q=0,tt=u.letterSpacing,Y,Z=0,U=0,H,J=u.scrollX,_=u.scrollY,q=u.fontData,at=q.chars,ot=q.lineHeight,rt=u.fontSize/q.size,gt=0,yt=u._align,Et=0,At=0,Pt=u.getTextBounds(!1);u.maxWidth>0&&(c=Pt.wrappedText,d=c.length);var Vt=u._bounds.lines;yt===1?At=(Vt.longest-Vt.lengths[0])/2:yt===2&&(At=Vt.longest-Vt.lengths[0]);for(var dt=f.roundPixels,ut=u.displayCallback,Rt=u.callbackData,Dt=0;Dt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(31401),a=e(95643),l=e(53048),n=e(61327),u=e(21859),f=e(87841),o=e(18658),c=new r({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Texture,h.Tint,h.Transform,h.Visible,o],initialize:function(v,m,S,M,w,C,A){w===void 0&&(w=""),A===void 0&&(A=0),a.call(this,v,"BitmapText"),this.font=M;var P=this.scene.sys.cache.bitmapFont.get(M);P||console.warn("Invalid BitmapText key: "+M),this.fontData=P.data,this._text="",this._fontSize=C||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=A,this._bounds=l(),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(m,S),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(w)},setLeftAlign:function(){return this._align=c.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=c.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=c.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(d){return this._fontSize=d,this._dirty=!0,this},setLetterSpacing:function(d){return d===void 0&&(d=0),this._letterSpacing=d,this._dirty=!0,this},setLineSpacing:function(d){return d===void 0&&(d=0),this.lineSpacing=d,this},setText:function(d){return!d&&d!==0&&(d=""),Array.isArray(d)&&(d=d.join(` +`)),d!==this.text&&(this._text=d.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=.5),this.dropShadowX=d,this.dropShadowY=v,this.dropShadowColor=m,this.dropShadowAlpha=S,this},setCharacterTint:function(d,v,m,S,M,w,C){d===void 0&&(d=0),v===void 0&&(v=1),m===void 0&&(m=!1),S===void 0&&(S=-1),M===void 0&&(M=S,w=S,C=S);var A=this.text.length;v===-1&&(v=A),d<0&&(d=A+d),d=p(d,0,A-1);for(var P=p(d+v,d,A),b=this.charColors,O=d;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20926),p=function(h,a,l,n){var u=a._text,f=u.length,o=h.currentContext;if(!(f===0||!r(h,o,a,l,n))){l.addToRenderList(a);var c=a.fromAtlas?a.frame:a.texture.frames.__BASE,d=a.fontData.chars,v=a.fontData.lineHeight,m=a._letterSpacing,S=a._lineSpacing,M=0,w=0,C=0,A=null,P=0,b=0,O=0,I=0,D=0,B=0,G=null,z=0,X=c.source.image,K=c.cutX,Q=c.cutY,tt=a._fontSize/a.fontData.size,Y=a._align,Z=0,U=0,H=a.getTextBounds(!1);a.maxWidth>0&&(u=H.wrappedText,f=u.length);var J=a._bounds.lines;Y===1?U=(J.longest-J.lengths[0])/2:Y===2&&(U=J.longest-J.lengths[0]),o.translate(-a.displayOriginX,-a.displayOriginY);for(var _=l.roundPixels,q=0;q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(25305),h=e(44603),a=e(23568),l=e(35154);h.register("bitmapText",function(n,u){n===void 0&&(n={});var f=l(n,"font",""),o=a(n,"text",""),c=a(n,"size",!1),d=l(n,"align",0),v=new r(this.scene,0,0,f,o,c,d);return u!==void 0&&(n.add=u),p(this.scene,v,n),v})},34914:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22186),p=e(39429);p.register("bitmapText",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},18658:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(33590),h=e(37289),s.exports={renderWebGL:p,renderCanvas:h}},33590:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3217),p=e(91296),h=e(70554),a=function(l,n,u,f){var o=n._text,c=o.length;if(c!==0){u.addToRenderList(n);var d=l.pipelines.set(n.pipeline,n),v=p(n,u,f).calc;l.pipelines.preBatch(n);var m=u.roundPixels,S=u.alpha,M=n.charColors,w=n.tintFill,C=h.getTintAppendFloatAlpha,A=C(n.tintTopLeft,S*n._alphaTL),P=C(n.tintTopRight,S*n._alphaTR),b=C(n.tintBottomLeft,S*n._alphaBL),O=C(n.tintBottomRight,S*n._alphaBR),I=n.frame.glTexture,D=d.setGameObject(n),B=n.getTextBounds(!1),G,z,X,K=B.characters,Q=n.dropShadowX,tt=n.dropShadowY,Y=Q!==0||tt!==0;if(Y){var Z=n.dropShadowColor,U=n.dropShadowAlpha,H=C(Z,S*U*n._alphaTL),J=C(Z,S*U*n._alphaTR),_=C(Z,S*U*n._alphaBL),q=C(Z,S*U*n._alphaBR);for(G=0;G{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(48011),p=e(46590),h=e(83419),a=e(31401),l=e(4327),n=e(95643),u=e(73162),f=new h({Extends:n,Mixins:[a.Alpha,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.ScrollFactor,a.Size,a.Texture,a.Transform,a.Visible,r],initialize:function(c,d,v,m,S){n.call(this,c,"Blitter"),this.setTexture(m,S),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(),this.children=new u,this.renderList=[],this.dirty=!1},create:function(o,c,d,v,m){v===void 0&&(v=!0),m===void 0&&(m=this.children.length),d===void 0?d=this.frame:d instanceof l||(d=this.texture.get(d));var S=new p(this,o,c,d,v);return this.children.addAt(S,m,!1),this.dirty=!0,S},createFromCallback:function(o,c,d,v){for(var m=this.createMultiple(c,d,v),S=0;S0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});s.exports=f},72396:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=r.getRenderList();if(a.length!==0){var l=e.currentContext,n=p.alpha*r.alpha;if(n!==0){p.addToRenderList(r),l.globalCompositeOperation=e.blendModes[r.blendMode],l.imageSmoothingEnabled=!r.frame.source.scaleMode;var u=r.x-p.scrollX*r.scrollFactorX,f=r.y-p.scrollY*r.scrollFactorY;l.save(),h&&h.copyToContext(l);for(var o=p.roundPixels,c=0;c0&&S.height>0&&(l.save(),l.translate(d.x+u,d.y+f),l.scale(C,A),l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M,w,S.width,S.height),l.restore())):(o&&(M=Math.round(M),w=Math.round(w)),S.width>0&&S.height>0&&l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M+d.x+u,w+d.y+f,S.width,S.height)))}l.restore()}}};s.exports=y},9403:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6107),p=e(25305),h=e(44603),a=e(23568);h.register("blitter",function(l,n){l===void 0&&(l={});var u=a(l,"key",null),f=a(l,"frame",null),o=new r(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),p(this.scene,o,l),o})},12709:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6107),p=e(39429);p.register("blitter",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},48011:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99485),h=e(72396),s.exports={renderWebGL:p,renderCanvas:h}},99485:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=e(70554),h=new r,a=function(l,n,u,f){var o=n.getRenderList(),c=u.alpha*n.alpha;if(!(o.length===0||c===0)){u.addToRenderList(n);var d=l.pipelines.set(this.pipeline,n),v=u.scrollX*n.scrollFactorX,m=u.scrollY*n.scrollFactorY,S=h.copyFrom(u.matrix);f&&(S.multiplyWithOffset(f,-v,-m),v=0,m=0);var M=n.x-v,w=n.y-m,C=-1,A=!1;l.pipelines.preBatch(n);for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(4327),h=new r({initialize:function(l,n,u,f,o){this.parent=l,this.x=n,this.y=u,this.frame=f,this.data={},this.tint=16777215,this._visible=o,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(a){return a===void 0?this.frame=this.parent.frame:a instanceof p&&a.texture===this.parent.texture?this.frame=a:this.frame=this.parent.texture.get(a),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(a,l,n){return this.x=a,this.y=l,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,n&&this.setFrame(n),this},setPosition:function(a,l){return this.x=a,this.y=l,this},setFlipX:function(a){return this.flipX=a,this},setFlipY:function(a){return this.flipY=a,this},setFlip:function(a,l){return this.flipX=a,this.flipY=l,this},setVisible:function(a){return this.visible=a,this},setAlpha:function(a){return this.alpha=a,this},setTint:function(a){return this.tint=a,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(a){this.parent.dirty|=this._visible!==a,this._visible=a}},alpha:{get:function(){return this._alpha},set:function(a){this.parent.dirty|=this._alpha>0!=a>0,this._alpha=a}}});s.exports=h},16005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=2,h={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(a,l,n,u){return a===void 0&&(a=1),l===void 0?this.alpha=a:(this._alphaTL=r(a,0,1),this._alphaTR=r(l,0,1),this._alphaBL=r(n,0,1),this._alphaBR=r(u,0,1)),this},alpha:{get:function(){return this._alpha},set:function(a){var l=r(a,0,1);this._alpha=l,this._alphaTL=l,this._alphaTR=l,this._alphaBL=l,this._alphaBR=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(a){var l=r(a,0,1);this._alphaTL=l,l!==0&&(this.renderFlags|=p)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(a){var l=r(a,0,1);this._alphaTR=l,l!==0&&(this.renderFlags|=p)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(a){var l=r(a,0,1);this._alphaBL=l,l!==0&&(this.renderFlags|=p)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(a){var l=r(a,0,1);this._alphaBR=l,l!==0&&(this.renderFlags|=p)}}};s.exports=h},88509:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=2,h={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(a){return a===void 0&&(a=1),this.alpha=a,this},alpha:{get:function(){return this._alpha},set:function(a){var l=r(a,0,1);this._alpha=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}}};s.exports=h},90065:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(h){typeof h=="string"&&(h=r[h]),h|=0,h>=-1&&(this._blendMode=h)}},setBlendMode:function(h){return this.blendMode=h,this}};s.exports=p},94215:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(e){this.scaleX=e/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(e){this.scaleY=e/this.height}},setSize:function(e,r){return this.width=e,this.height=r,this},setDisplaySize:function(e,r){return this.displayWidth=e,this.displayHeight=r,this}};s.exports=y},61683:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={texture:null,frame:null,isCropped:!1,setCrop:function(e,r,p,h){if(e===void 0)this.isCropped=!1;else if(this.frame){if(typeof e=="number")this.frame.setCropUVs(this._crop,e,r,p,h,this.flipX,this.flipY);else{var a=e;this.frame.setCropUVs(this._crop,a.x,a.y,a.width,a.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};s.exports=y},89272:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_depth:0,depth:{get:function(){return this._depth},set:function(e){this.displayList&&this.displayList.queueDepthSort(),this._depth=e}},setDepth:function(e){return e===void 0&&(e=0),this.depth=e,this}};s.exports=y},47059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(66064),h=e(19133),a=new r({initialize:function(n,u){this.gameObject=n,this.isPost=u,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(l){return l===void 0&&(l=0),this.padding=l,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(l){if(!this.isPost){var n=this.gameObject.scene.sys.renderer;n&&n.pipelines?(this.gameObject.pipeline=n.pipelines.FX_PIPELINE,l!==void 0&&(this.padding=l),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var l=this.list,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(e){return this.flipX=e,this},setFlipY:function(e){return this.flipY=e,this},setFlip:function(e,r){return this.flipX=e,this.flipY=r,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}};s.exports=y},8004:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(11520),h=e(26099),a={prepareBoundsOutput:function(l,n){if(n===void 0&&(n=!1),this.rotation!==0&&p(l,this.x,this.y,this.rotation),n&&this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();u.transformPoint(l.x,l.y,l)}return l},getCenter:function(l,n){return l===void 0&&(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getTopLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getLeftCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getRightCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getBottomLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBounds:function(l){l===void 0&&(l=new r);var n,u,f,o,c,d,v,m;if(this.parentContainer){var S=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(l),S.transformPoint(l.x,l.y,l),n=l.x,u=l.y,this.getTopRight(l),S.transformPoint(l.x,l.y,l),f=l.x,o=l.y,this.getBottomLeft(l),S.transformPoint(l.x,l.y,l),c=l.x,d=l.y,this.getBottomRight(l),S.transformPoint(l.x,l.y,l),v=l.x,m=l.y}else this.getTopLeft(l),n=l.x,u=l.y,this.getTopRight(l),f=l.x,o=l.y,this.getBottomLeft(l),c=l.x,d=l.y,this.getBottomRight(l),v=l.x,m=l.y;return l.x=Math.min(n,f,c,v),l.y=Math.min(u,o,d,m),l.width=Math.max(n,f,c,v)-l.x,l.height=Math.max(u,o,d,m)-l.y,l}};s.exports=a},8573:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6858),p=e(80661),h={mask:null,setMask:function(a){return this.mask=a,this},clearMask:function(a){return a===void 0&&(a=!1),a&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(a,l,n,u,f){return a===void 0&&(this.texture||this.shader||this.geom)&&(a=this),new r(this.scene,a,l,n,u,f)},createGeometryMask:function(a){return a===void 0&&(this.type==="Graphics"||this.geom)&&(a=this),new p(this.scene,a)}};s.exports=h},27387:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(e){this._displayOriginX=e,this.originX=e/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(e){this._displayOriginY=e,this.originY=e/this.height}},setOrigin:function(e,r){return e===void 0&&(e=.5),r===void 0&&(r=e),this.originX=e,this.originY=r,this.updateDisplayOrigin()},setOriginFromFrame:function(){return!this.frame||!this.frame.customPivot?this.setOrigin():(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin())},setDisplayOrigin:function(e,r){return e===void 0&&(e=0),r===void 0&&(r=e),this.displayOriginX=e,this.displayOriginY=r,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};s.exports=y},37640:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39506),p=e(57355),h=e(35154),a=e(86353),l=e(26099),n={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:a.PLAYING_FORWARD,setPath:function(u,f){f===void 0&&(f=this.pathConfig);var o=this.pathTween;return o&&o.isPlaying()&&o.stop(),this.path=u,f&&this.startFollow(f),this},setRotateToPath:function(u,f){return f===void 0&&(f=0),this.rotateToPath=u,this.pathRotationOffset=f,this},isFollowing:function(){var u=this.pathTween;return u&&u.isPlaying()},startFollow:function(u,f){u===void 0&&(u={}),f===void 0&&(f=0);var o=this.pathTween;o&&o.isPlaying()&&o.stop(),typeof u=="number"&&(u={duration:u}),u.from=h(u,"from",0),u.to=h(u,"to",1);var c=p(u,"positionOnPath",!1);this.rotateToPath=p(u,"rotateToPath",!1),this.pathRotationOffset=h(u,"rotationOffset",0);var d=h(u,"startAt",f);if(d&&(u.onStart=function(m){var S=m.data[0];S.progress=d,S.elapsed=S.duration*d;var M=S.ease(S.progress);S.current=S.start+(S.end-S.start)*M,S.setTargetValue()}),this.pathOffset||(this.pathOffset=new l(this.x,this.y)),this.pathVector||(this.pathVector=new l),this.pathDelta||(this.pathDelta=new l),this.pathDelta.reset(),u.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(u),this.path.getStartPoint(this.pathOffset),c&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=a.PLAYING_FORWARD,this.rotateToPath){var v=this.path.getPoint(.1);this.rotation=Math.atan2(v.y-this.y,v.x-this.x)+r(this.pathRotationOffset)}return this.pathConfig=u,this},pauseFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.pause(),this},resumeFollow:function(){var u=this.pathTween;return u&&u.isPaused()&&u.resume(),this},stopFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.stop(),this},pathUpdate:function(){var u=this.pathTween;if(u&&u.data){var f=u.data[0],o=this.pathDelta,c=this.pathVector;if(o.copy(c).negate(),f.state===a.COMPLETE){this.path.getPoint(f.end,c),o.add(c),c.add(this.pathOffset),this.setPosition(c.x,c.y);return}else if(f.state!==a.PLAYING_FORWARD&&f.state!==a.PLAYING_BACKWARD)return;this.path.getPoint(u.getValue(),c),o.add(c),c.add(this.pathOffset);var d=this.x,v=this.y;this.setPosition(c.x,c.y);var m=this.x-d,S=this.y-v;if(m===0&&S===0)return;if(f.state!==this._prevDirection){this._prevDirection=f.state;return}this.rotateToPath&&(this.rotation=Math.atan2(S,m)+r(this.pathRotationOffset))}}};s.exports=n},72699:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(h){this.pipelineData={};var a=this.scene.sys.renderer;if(!a)return!1;var l=a.pipelines;if(l){h===void 0&&(h=l.default);var n=l.get(h);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(h,a,l){var n=this.scene.sys.renderer;if(!n)return this;var u=n.pipelines;if(u){var f=u.get(h);f&&(this.pipeline=f),a&&(this.pipelineData=l?r(a):a)}return this},setPipelineData:function(h,a){var l=this.pipelineData;return a===void 0?delete l[h]:l[h]=a,this},resetPipeline:function(h){return h===void 0&&(h=!1),this.pipeline=this.defaultPipeline,h&&(this.pipelineData={}),this.pipeline!==null},getPipelineName:function(){return this.pipeline.name}};s.exports=p},17581:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p=e(47059),h=e(19133),a={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(l){this.postPipelines=[],this.postPipelineData={},this.postFX=new p(this,!0),l&&(this.preFX=new p(this,!1))},setPostPipeline:function(l,n,u){var f=this.scene.sys.renderer;if(!f)return this;var o=f.pipelines;if(o){Array.isArray(l)||(l=[l]);for(var c=0;c0,this},setPostPipelineData:function(l,n){var u=this.postPipelineData;return n===void 0?delete u[l]:u[l]=n,this},getPostPipeline:function(l){for(var n=typeof l=="string",u=this.postPipelines,f=[],o=0;o=0;f--){var o=u[f];(n&&o.name===l||!n&&o===l)&&(o.destroy(),h(u,f))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};s.exports=a},80227:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(e,r){return r===void 0&&(r=e),this.scrollFactorX=e,this.scrollFactorY=r,this}};s.exports=y},16736:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(e){this.scaleX=e/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(e){this.scaleY=e/this.frame.realHeight}},setSizeToFrame:function(e){e||(e=this.frame),this.width=e.realWidth,this.height=e.realHeight;var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=this.width,r.hitArea.height=this.height),this},setSize:function(e,r){return this.width=e,this.height=r,this},setDisplaySize:function(e,r){return this.displayWidth=e,this.displayHeight=r,this}};s.exports=y},37726:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4327),p=8,h={texture:null,frame:null,isCropped:!1,setTexture:function(a,l,n,u){return this.texture=this.scene.sys.textures.get(a),this.setFrame(l,n,u)},setFrame:function(a,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),a instanceof r?(this.texture=this.scene.sys.textures.get(a.texture.key),this.frame=a):this.frame=this.texture.get(a),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};s.exports=h},79812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4327),p=8,h={texture:null,frame:null,isCropped:!1,setCrop:function(a,l,n,u){if(a===void 0)this.isCropped=!1;else if(this.frame){if(typeof a=="number")this.frame.setCropUVs(this._crop,a,l,n,u,this.flipX,this.flipY);else{var f=a;this.frame.setCropUVs(this._crop,f.x,f.y,f.width,f.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(a,l){return this.texture=this.scene.sys.textures.get(a),this.setFrame(l)},setFrame:function(a,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),a instanceof r?(this.texture=this.scene.sys.textures.get(a.texture.key),this.frame=a):this.frame=this.texture.get(a),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};s.exports=h},27472:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(e,r,p,h){return e===void 0&&(e=16777215),r===void 0&&(r=e,p=e,h=e),this.tintTopLeft=e,this.tintTopRight=r,this.tintBottomLeft=p,this.tintBottomRight=h,this.tintFill=!1,this},setTintFill:function(e,r,p,h){return this.setTint(e,r,p,h),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(e){this.setTint(e,e,e,e)}},isTinted:{get:function(){var e=16777215;return this.tintFill||this.tintTopLeft!==e||this.tintTopRight!==e||this.tintBottomLeft!==e||this.tintBottomRight!==e}}};s.exports=y},53774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={name:e.name,type:e.type,x:e.x,y:e.y,depth:e.depth,scale:{x:e.scaleX,y:e.scaleY},origin:{x:e.originX,y:e.originY},flipX:e.flipX,flipY:e.flipY,rotation:e.rotation,alpha:e.alpha,visible:e.visible,blendMode:e.blendMode,textureKey:"",frameKey:"",data:{}};return e.texture&&(r.textureKey=e.texture.key,r.frameKey=e.frame.name),r};s.exports=y},16901:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(61340),h=e(85955),a=e(86554),l=e(30954),n=e(26099),u=4,f={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(o){this._scaleX=o,this._scaleY=o,o===0?this.renderFlags&=~u:this.renderFlags|=u}},scaleX:{get:function(){return this._scaleX},set:function(o){this._scaleX=o,o===0?this.renderFlags&=~u:this._scaleY!==0&&(this.renderFlags|=u)}},scaleY:{get:function(){return this._scaleY},set:function(o){this._scaleY=o,o===0?this.renderFlags&=~u:this._scaleX!==0&&(this.renderFlags|=u)}},angle:{get:function(){return l(this._rotation*r.RAD_TO_DEG)},set:function(o){this.rotation=l(o)*r.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(o){this._rotation=a(o)}},setPosition:function(o,c,d,v){return o===void 0&&(o=0),c===void 0&&(c=o),d===void 0&&(d=0),v===void 0&&(v=0),this.x=o,this.y=c,this.z=d,this.w=v,this},copyPosition:function(o){return o.x!==void 0&&(this.x=o.x),o.y!==void 0&&(this.y=o.y),o.z!==void 0&&(this.z=o.z),o.w!==void 0&&(this.w=o.w),this},setRandomPosition:function(o,c,d,v){return o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),this.x=o+Math.random()*d,this.y=c+Math.random()*v,this},setRotation:function(o){return o===void 0&&(o=0),this.rotation=o,this},setAngle:function(o){return o===void 0&&(o=0),this.angle=o,this},setScale:function(o,c){return o===void 0&&(o=1),c===void 0&&(c=o),this.scaleX=o,this.scaleY=c,this},setX:function(o){return o===void 0&&(o=0),this.x=o,this},setY:function(o){return o===void 0&&(o=0),this.y=o,this},setZ:function(o){return o===void 0&&(o=0),this.z=o,this},setW:function(o){return o===void 0&&(o=0),this.w=o,this},getLocalTransformMatrix:function(o){return o===void 0&&(o=new p),o.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(o,c){o===void 0&&(o=new p);var d=this.parentContainer;if(!d)return this.getLocalTransformMatrix(o);for(c||(c=new p),o.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);d;)c.applyITRS(d.x,d.y,d._rotation,d._scaleX,d._scaleY),c.multiply(o,o),d=d.parentContainer;return o},getLocalPoint:function(o,c,d,v){d||(d=new n),v||(v=this.scene.sys.cameras.main);var m=v.scrollX,S=v.scrollY,M=o+m*this.scrollFactorX-m,w=c+S*this.scrollFactorY-S;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(M,w,d):h(M,w,this.x,this.y,this.rotation,this.scaleX,this.scaleY,d),this._originComponent&&(d.x+=this._displayOriginX,d.y+=this._displayOriginY),d},getParentRotation:function(){for(var o=0,c=this.parentContainer;c;)o+=c.rotation,c=c.parentContainer;return o}};s.exports=f},61340:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36383),h=e(26099),a=new r({initialize:function(n,u,f,o,c,d){n===void 0&&(n=1),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=1),c===void 0&&(c=0),d===void 0&&(d=0),this.matrix=new Float32Array([n,u,f,o,c,d,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(l){this.matrix[0]=l}},b:{get:function(){return this.matrix[1]},set:function(l){this.matrix[1]=l}},c:{get:function(){return this.matrix[2]},set:function(l){this.matrix[2]=l}},d:{get:function(){return this.matrix[3]},set:function(l){this.matrix[3]=l}},e:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},f:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},tx:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},ty:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],o=l[3];return n||u?u>0?Math.acos(n/this.scaleX):-Math.acos(n/this.scaleX):f||o?p.TAU-(o>0?Math.acos(-f/this.scaleY):-Math.acos(f/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 l=this.matrix;return l[0]=1,l[1]=0,l[2]=0,l[3]=1,l[4]=0,l[5]=0,this},translate:function(l,n){var u=this.matrix;return u[4]=u[0]*l+u[2]*n+u[4],u[5]=u[1]*l+u[3]*n+u[5],this},scale:function(l,n){var u=this.matrix;return u[0]*=l,u[1]*=l,u[2]*=n,u[3]*=n,this},rotate:function(l){var n=Math.sin(l),u=Math.cos(l),f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3];return f[0]=o*u+d*n,f[1]=c*u+v*n,f[2]=o*-n+d*u,f[3]=c*-n+v*u,this},multiply:function(l,n){var u=this.matrix,f=l.matrix,o=u[0],c=u[1],d=u[2],v=u[3],m=u[4],S=u[5],M=f[0],w=f[1],C=f[2],A=f[3],P=f[4],b=f[5],O=n===void 0?u:n.matrix;return O[0]=M*o+w*d,O[1]=M*c+w*v,O[2]=C*o+A*d,O[3]=C*c+A*v,O[4]=P*o+b*d+m,O[5]=P*c+b*v+S,O},multiplyWithOffset:function(l,n,u){var f=this.matrix,o=l.matrix,c=f[0],d=f[1],v=f[2],m=f[3],S=f[4],M=f[5],w=n*c+u*v+S,C=n*d+u*m+M,A=o[0],P=o[1],b=o[2],O=o[3],I=o[4],D=o[5];return f[0]=A*c+P*v,f[1]=A*d+P*m,f[2]=b*c+O*v,f[3]=b*d+O*m,f[4]=I*c+D*v+w,f[5]=I*d+D*m+C,this},transform:function(l,n,u,f,o,c){var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5];return d[0]=l*v+n*S,d[1]=l*m+n*M,d[2]=u*v+f*S,d[3]=u*m+f*M,d[4]=o*v+c*S+w,d[5]=o*m+c*M+C,this},transformPoint:function(l,n,u){u===void 0&&(u={x:0,y:0});var f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5];return u.x=l*o+n*d+m,u.y=l*c+n*v+S,u},invert:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],o=l[3],c=l[4],d=l[5],v=n*o-u*f;return l[0]=o/v,l[1]=-u/v,l[2]=-f/v,l[3]=n/v,l[4]=(f*d-o*c)/v,l[5]=-(n*d-u*c)/v,this},copyFrom:function(l){var n=this.matrix;return n[0]=l.a,n[1]=l.b,n[2]=l.c,n[3]=l.d,n[4]=l.e,n[5]=l.f,this},copyFromArray:function(l){var n=this.matrix;return n[0]=l[0],n[1]=l[1],n[2]=l[2],n[3]=l[3],n[4]=l[4],n[5]=l[5],this},copyToContext:function(l){var n=this.matrix;return l.transform(n[0],n[1],n[2],n[3],n[4],n[5]),l},setToContext:function(l){return l.setTransform(this),l},copyToArray:function(l){var n=this.matrix;return l===void 0?l=[n[0],n[1],n[2],n[3],n[4],n[5]]:(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3],l[4]=n[4],l[5]=n[5]),l},setTransform:function(l,n,u,f,o,c){var d=this.matrix;return d[0]=l,d[1]=n,d[2]=u,d[3]=f,d[4]=o,d[5]=c,this},decomposeMatrix:function(){var l=this.decomposedMatrix,n=this.matrix,u=n[0],f=n[1],o=n[2],c=n[3],d=u*c-f*o;if(l.translateX=n[4],l.translateY=n[5],u||f){var v=Math.sqrt(u*u+f*f);l.rotation=f>0?Math.acos(u/v):-Math.acos(u/v),l.scaleX=v,l.scaleY=d/v}else if(o||c){var m=Math.sqrt(o*o+c*c);l.rotation=Math.PI*.5-(c>0?Math.acos(-o/m):-Math.acos(o/m)),l.scaleX=d/m,l.scaleY=m}else l.rotation=0,l.scaleX=0,l.scaleY=0;return l},applyITRS:function(l,n,u,f,o){var c=this.matrix,d=Math.sin(u),v=Math.cos(u);return c[4]=l,c[5]=n,c[0]=v*f,c[1]=d*f,c[2]=-d*o,c[3]=v*o,this},applyInverse:function(l,n,u){u===void 0&&(u=new h);var f=this.matrix,o=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5],M=1/(o*v+d*-c);return u.x=v*M*l+-d*M*n+(S*d-m*v)*M,u.y=o*M*n+-c*M*l+(-S*o+m*c)*M,u},setQuad:function(l,n,u,f,o,c){o===void 0&&(o=!1),c===void 0&&(c=this.quad);var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5];return o?(c[0]=Math.round(l*v+n*S+w),c[1]=Math.round(l*m+n*M+C),c[2]=Math.round(l*v+f*S+w),c[3]=Math.round(l*m+f*M+C),c[4]=Math.round(u*v+f*S+w),c[5]=Math.round(u*m+f*M+C),c[6]=Math.round(u*v+n*S+w),c[7]=Math.round(u*m+n*M+C)):(c[0]=l*v+n*S+w,c[1]=l*m+n*M+C,c[2]=l*v+f*S+w,c[3]=l*m+f*M+C,c[4]=u*v+f*S+w,c[5]=u*m+f*M+C,c[6]=u*v+n*S+w,c[7]=u*m+n*M+C),c},getX:function(l,n){return l*this.a+n*this.c+this.e},getY:function(l,n){return l*this.b+n*this.d+this.f},getXRound:function(l,n,u){var f=this.getX(l,n);return u&&(f=Math.round(f)),f},getYRound:function(l,n,u){var f=this.getY(l,n);return u&&(f=Math.round(f)),f},getCSSMatrix:function(){var l=this.matrix;return"matrix("+l[0]+","+l[1]+","+l[2]+","+l[3]+","+l[4]+","+l[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});s.exports=a},59715:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=1,e={_visible:!0,visible:{get:function(){return this._visible},set:function(r){r?(this._visible=!0,this.renderFlags|=y):(this._visible=!1,this.renderFlags&=~y)}},setVisible:function(r){return this.visible=r,this}};s.exports=e},31401:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Alpha:e(16005),AlphaSingle:e(88509),BlendMode:e(90065),ComputedSize:e(94215),Crop:e(61683),Depth:e(89272),Flip:e(54434),FX:e(47059),GetBounds:e(8004),Mask:e(8573),Origin:e(27387),PathFollower:e(37640),Pipeline:e(72699),PostPipeline:e(17581),ScrollFactor:e(80227),Size:e(16736),Texture:e(37726),TextureCrop:e(79812),Tint:e(27472),ToJSON:e(53774),Transform:e(16901),TransformMatrix:e(61340),Visible:e(59715)}},31559:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37105),p=e(10312),h=e(83419),a=e(31401),l=e(51708),n=e(95643),u=e(87841),f=e(29959),o=e(36899),c=e(26099),d=new h({Extends:n,Mixins:[a.AlphaSingle,a.BlendMode,a.ComputedSize,a.Depth,a.Mask,a.PostPipeline,a.Transform,a.Visible,f],initialize:function(m,S,M,w){n.call(this,m,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new a.TransformMatrix,this.tempTransformMatrix=new a.TransformMatrix,this._sortKey="",this._sysEvents=m.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(S,M),this.setBlendMode(p.SKIP_CHECK),w&&this.add(w)},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(v){return v===void 0&&(v=!0),this.exclusive=v,this},getBounds:function(v){if(v===void 0&&(v=new u),v.setTo(this.x,this.y,0,0),this.parentContainer){var m=this.parentContainer.getBoundsTransformMatrix(),S=m.transformPoint(this.x,this.y);v.setTo(S.x,S.y,0,0)}if(this.list.length>0){var M=this.list,w=new u,C=!1;v.setEmpty();for(var A=0;A-1},setAll:function(v,m,S,M){return r.SetAll(this.list,v,m,S,M),this},each:function(v,m){var S=[null],M,w=this.list.slice(),C=w.length;for(M=2;M0?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(v){r.Remove(this.list,v),this.exclusive&&(v.parentContainer=null,v.removedFromScene())}});s.exports=d},53584:s=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r);var a=r.list;if(a.length!==0){var l=r.localTransform;h?(l.loadIdentity(),l.multiply(h),l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.scaleX,r.scaleY)):l.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY);var n=r.blendMode!==-1;n||e.setBlendMode(0);var u=r._alpha,f=r.scrollFactorX,o=r.scrollFactorY;r.mask&&r.mask.preRenderCanvas(e,null,p);for(var c=0;c{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(31559),h=e(44603),a=e(23568),l=e(95540);h.register("container",function(n,u){n===void 0&&(n={});var f=a(n,"x",0),o=a(n,"y",0),c=l(n,"children",null),d=new p(this.scene,f,o,c);return u!==void 0&&(n.add=u),r(this.scene,d,n),d})},24961:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31559),p=e(39429);p.register("container",function(h,a,l){return this.displayList.add(new r(this.scene,h,a,l))})},29959:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(72249),h=e(53584),s.exports={renderWebGL:p,renderCanvas:h}},72249:s=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r);var a=r.list,l=a.length;if(l!==0){var n=r.localTransform;h?(n.loadIdentity(),n.multiply(h),n.translate(r.x,r.y),n.rotate(r.rotation),n.scale(r.scaleX,r.scaleY)):n.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY),e.pipelines.preBatch(r);var u=r.blendMode!==-1;u||e.setBlendMode(0);for(var f=r.alpha,o=r.scrollFactorX,c=r.scrollFactorY,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(441),a=e(95643),l=e(41212),n=e(35846),u=e(44594),f=e(61369),o=new r({Extends:a,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Origin,p.ScrollFactor,p.Transform,p.Visible,h],initialize:function(d,v,m,S,M,w){a.call(this,d,"DOMElement"),this.parent=d.sys.game.domContainer,this.cache=d.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new f,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(v,m),typeof S=="string"?S[0]==="#"?this.setElement(S.substr(1),M,w):this.createElement(S,M,w):S&&this.setElement(S,M,w),d.sys.events.on(u.SLEEP,this.handleSceneEvent,this),d.sys.events.on(u.WAKE,this.handleSceneEvent,this),d.sys.events.on(u.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(c){var d=this.node,v=d.style;d&&(v.display=c.settings.visible?"block":"none")},setSkew:function(c,d){return c===void 0&&(c=0),d===void 0&&(d=c),this.skewX=c,this.skewY=d,this},setPerspective:function(c){return this.parent.style.perspective=c+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(c){this.parent.style.perspective=c+"px"}},addListener:function(c){if(this.node){c=c.split(" ");for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(47407),p=e(95643),h=e(61340),a=new h,l=new h,n=new h,u=function(f,o,c,d){if(o.node){var v=o.node.style,m=o.scene.sys.settings;if(!v||!m.visible||p.RENDER_MASK!==o.renderFlags||o.cameraFilter!==0&&o.cameraFilter&c.id||o.parentContainer&&!o.parentContainer.willRender()){v.display="none";return}var S=o.parentContainer,M=c.alpha*o.alpha;S&&(M*=S.alpha);var w=a,C=l,A=n,P=0,b=0,O="0%",I="0%";d?(P=o.width*o.scaleX*o.originX,b=o.height*o.scaleY*o.originY,C.applyITRS(o.x-P,o.y-b,o.rotation,o.scaleX,o.scaleY),w.copyFrom(c.matrix),w.multiplyWithOffset(d,-c.scrollX*o.scrollFactorX,-c.scrollY*o.scrollFactorY),C.e=o.x-P,C.f=o.y-b,w.multiply(C,A)):(P=o.width*o.originX,b=o.height*o.originY,C.applyITRS(o.x-P,o.y-b,o.rotation,o.scaleX,o.scaleY),w.copyFrom(c.matrix),O=100*o.originX+"%",I=100*o.originY+"%",C.e-=c.scrollX*o.scrollFactorX,C.f-=c.scrollY*o.scrollFactorY,w.multiply(C,A)),o.transformOnly||(v.display="block",v.opacity=M,v.zIndex=o._depth,v.pointerEvents=o.pointerEvents,v.mixBlendMode=r[o._blendMode]),v.transform=A.getCSSMatrix()+" skew("+o.skewX+"rad, "+o.skewY+"rad) rotate3d("+o.rotate3d.x+","+o.rotate3d.y+","+o.rotate3d.z+","+o.rotate3d.w+o.rotate3dAngle+")",v.transformOrigin=O+" "+I}};s.exports=u},2611:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3069),p=e(39429);p.register("dom",function(h,a,l,n,u){var f=new r(this.scene,h,a,l,n,u);return this.displayList.add(f),f})},441:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(49381),h=e(49381),s.exports={renderWebGL:p,renderCanvas:h}},62980:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addedtoscene"},41337:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},44947:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedfromscene"},49358:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},35163:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="created"},97249:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="error"},19483:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="locked"},56059:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},26772:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="metadata"},64437:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="playing"},83411:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="play"},75780:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seeked"},67799:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seeking"},63500:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stalled"},55541:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},53208:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="textureready"},4992:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unlocked"},12:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unsupported"},51708:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADDED_TO_SCENE:e(62980),DESTROY:e(41337),REMOVED_FROM_SCENE:e(44947),VIDEO_COMPLETE:e(49358),VIDEO_CREATED:e(35163),VIDEO_ERROR:e(97249),VIDEO_LOCKED:e(19483),VIDEO_LOOP:e(56059),VIDEO_METADATA:e(26772),VIDEO_PLAY:e(83411),VIDEO_PLAYING:e(64437),VIDEO_SEEKED:e(75780),VIDEO_SEEKING:e(67799),VIDEO_STALLED:e(63500),VIDEO_STOP:e(55541),VIDEO_TEXTURE:e(53208),VIDEO_UNLOCKED:e(4992),VIDEO_UNSUPPORTED:e(12)}},42421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(64993),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.Origin,p.ScrollFactor,p.Size,p.Texture,p.Tint,p.Transform,p.Visible,a],initialize:function(u){h.call(this,u,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});s.exports=l},70217:()=>{},56315:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42421),p=e(39429);p.register("extern",function(){var h=new r(this.scene);return this.displayList.add(h),h})},64993:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(80287),h=e(70217),s.exports={renderWebGL:p,renderCanvas:h}},80287:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){h.pipelines.clear();var u=r(a,l,n).calc;a.render.call(a,h,l,u),h.pipelines.rebind()};s.exports=p},85592:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},43831:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71911),p=e(83419),h=e(85592),a=e(31401),l=e(8497),n=e(95643),u=e(95540),f=e(35154),o=e(36383),c=e(84503),d=new p({Extends:n,Mixins:[a.AlphaSingle,a.BlendMode,a.Depth,a.Mask,a.Pipeline,a.PostPipeline,a.Transform,a.Visible,a.ScrollFactor,c],initialize:function(m,S){var M=f(S,"x",0),w=f(S,"y",0);n.call(this,m,"Graphics"),this.setPosition(M,w),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(S)},setDefaultStyles:function(v){return f(v,"lineStyle",null)&&(this.defaultStrokeWidth=f(v,"lineStyle.width",1),this.defaultStrokeColor=f(v,"lineStyle.color",16777215),this.defaultStrokeAlpha=f(v,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),f(v,"fillStyle",null)&&(this.defaultFillColor=f(v,"fillStyle.color",16777215),this.defaultFillAlpha=f(v,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(v,m,S){return S===void 0&&(S=1),this.commandBuffer.push(h.LINE_STYLE,v,m,S),this._lineWidth=v,this},fillStyle:function(v,m){return m===void 0&&(m=1),this.commandBuffer.push(h.FILL_STYLE,v,m),this},fillGradientStyle:function(v,m,S,M,w,C,A,P){return w===void 0&&(w=1),C===void 0&&(C=w),A===void 0&&(A=w),P===void 0&&(P=w),this.commandBuffer.push(h.GRADIENT_FILL_STYLE,w,C,A,P,v,m,S,M),this},lineGradientStyle:function(v,m,S,M,w,C){return C===void 0&&(C=1),this.commandBuffer.push(h.GRADIENT_LINE_STYLE,v,C,m,S,M,w),this},beginPath:function(){return this.commandBuffer.push(h.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(h.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(h.FILL_PATH),this},fill:function(){return this.commandBuffer.push(h.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(h.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(h.STROKE_PATH),this},fillCircleShape:function(v){return this.fillCircle(v.x,v.y,v.radius)},strokeCircleShape:function(v){return this.strokeCircle(v.x,v.y,v.radius)},fillCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,o.PI2),this.fillPath(),this},strokeCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,o.PI2),this.strokePath(),this},fillRectShape:function(v){return this.fillRect(v.x,v.y,v.width,v.height)},strokeRectShape:function(v){return this.strokeRect(v.x,v.y,v.width,v.height)},fillRect:function(v,m,S,M){return this.commandBuffer.push(h.FILL_RECT,v,m,S,M),this},strokeRect:function(v,m,S,M){var w=this._lineWidth/2,C=v-w,A=v+w;return this.beginPath(),this.moveTo(v,m),this.lineTo(v,m+M),this.strokePath(),this.beginPath(),this.moveTo(v+S,m),this.lineTo(v+S,m+M),this.strokePath(),this.beginPath(),this.moveTo(C,m),this.lineTo(A+S,m),this.strokePath(),this.beginPath(),this.moveTo(C,m+M),this.lineTo(A+S,m+M),this.strokePath(),this},fillRoundedRect:function(v,m,S,M,w){w===void 0&&(w=20);var C=w,A=w,P=w,b=w;typeof w!="number"&&(C=u(w,"tl",20),A=u(w,"tr",20),P=u(w,"bl",20),b=u(w,"br",20));var O=C>=0,I=A>=0,D=P>=0,B=b>=0;return C=Math.abs(C),A=Math.abs(A),P=Math.abs(P),b=Math.abs(b),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-A,m),I?this.arc(v+S-A,m+A,A,-o.TAU,0):this.arc(v+S,m,A,Math.PI,o.TAU,!0),this.lineTo(v+S,m+M-b),B?this.arc(v+S-b,m+M-b,b,0,o.TAU):this.arc(v+S,m+M,b,-o.TAU,Math.PI,!0),this.lineTo(v+P,m+M),D?this.arc(v+P,m+M-P,P,o.TAU,Math.PI):this.arc(v,m+M,P,0,-o.TAU,!0),this.lineTo(v,m+C),O?this.arc(v+C,m+C,C,-Math.PI,-o.TAU):this.arc(v,m,C,o.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(v,m,S,M,w){w===void 0&&(w=20);var C=w,A=w,P=w,b=w,O=Math.min(S,M)/2;typeof w!="number"&&(C=u(w,"tl",20),A=u(w,"tr",20),P=u(w,"bl",20),b=u(w,"br",20));var I=C>=0,D=A>=0,B=P>=0,G=b>=0;return C=Math.min(Math.abs(C),O),A=Math.min(Math.abs(A),O),P=Math.min(Math.abs(P),O),b=Math.min(Math.abs(b),O),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-A,m),this.moveTo(v+S-A,m),D?this.arc(v+S-A,m+A,A,-o.TAU,0):this.arc(v+S,m,A,Math.PI,o.TAU,!0),this.lineTo(v+S,m+M-b),this.moveTo(v+S,m+M-b),G?this.arc(v+S-b,m+M-b,b,0,o.TAU):this.arc(v+S,m+M,b,-o.TAU,Math.PI,!0),this.lineTo(v+P,m+M),this.moveTo(v+P,m+M),B?this.arc(v+P,m+M-P,P,o.TAU,Math.PI):this.arc(v,m+M,P,0,-o.TAU,!0),this.lineTo(v,m+C),this.moveTo(v,m+C),I?this.arc(v+C,m+C,C,-Math.PI,-o.TAU):this.arc(v,m,C,o.TAU,0,!0),this.strokePath(),this},fillPointShape:function(v,m){return this.fillPoint(v.x,v.y,m)},fillPoint:function(v,m,S){return!S||S<1?S=1:(v-=S/2,m-=S/2),this.commandBuffer.push(h.FILL_RECT,v,m,S,S),this},fillTriangleShape:function(v){return this.fillTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},strokeTriangleShape:function(v){return this.strokeTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},fillTriangle:function(v,m,S,M,w,C){return this.commandBuffer.push(h.FILL_TRIANGLE,v,m,S,M,w,C),this},strokeTriangle:function(v,m,S,M,w,C){return this.commandBuffer.push(h.STROKE_TRIANGLE,v,m,S,M,w,C),this},strokeLineShape:function(v){return this.lineBetween(v.x1,v.y1,v.x2,v.y2)},lineBetween:function(v,m,S,M){return this.beginPath(),this.moveTo(v,m),this.lineTo(S,M),this.strokePath(),this},lineTo:function(v,m){return this.commandBuffer.push(h.LINE_TO,v,m),this},moveTo:function(v,m){return this.commandBuffer.push(h.MOVE_TO,v,m),this},strokePoints:function(v,m,S,M){m===void 0&&(m=!1),S===void 0&&(S=!1),M===void 0&&(M=v.length),this.beginPath(),this.moveTo(v[0].x,v[0].y);for(var w=1;w-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(v,m,S){var M=this.scene.sys,w=M.game.renderer;m===void 0&&(m=M.scale.width),S===void 0&&(S=M.scale.height),d.TargetCamera.setScene(this.scene),d.TargetCamera.setViewport(0,0,m,S),d.TargetCamera.scrollX=this.x,d.TargetCamera.scrollY=this.y;var C,A,P={willReadFrequently:!0};if(typeof v=="string")if(M.textures.exists(v)){C=M.textures.get(v);var b=C.getSourceImage();b instanceof HTMLCanvasElement&&(A=b.getContext("2d",P))}else C=M.textures.createCanvas(v,m,S),A=C.getSourceImage().getContext("2d",P);else v instanceof HTMLCanvasElement&&(A=v.getContext("2d",P));return A&&(this.renderCanvas(w,this,d.TargetCamera,null,A,!1),C&&C.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});d.TargetCamera=new r,s.exports=d},32768:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85592),p=e(20926),h=function(a,l,n,u,f,o){var c=l.commandBuffer,d=c.length,v=f||a.currentContext;if(!(d===0||!p(a,v,l,n,u))){n.addToRenderList(l);var m=1,S=1,M=0,w=0,C=1,A=0,P=0,b=0;v.beginPath();for(var O=0;O>>16,P=(M&65280)>>>8,b=M&255,v.strokeStyle="rgba("+A+","+P+","+b+","+m+")",v.lineWidth=C,O+=3;break;case r.FILL_STYLE:w=c[O+1],S=c[O+2],A=(w&16711680)>>>16,P=(w&65280)>>>8,b=w&255,v.fillStyle="rgba("+A+","+P+","+b+","+S+")",O+=2;break;case r.BEGIN_PATH:v.beginPath();break;case r.CLOSE_PATH:v.closePath();break;case r.FILL_PATH:o||v.fill();break;case r.STROKE_PATH:o||v.stroke();break;case r.FILL_RECT:o?v.rect(c[O+1],c[O+2],c[O+3],c[O+4]):v.fillRect(c[O+1],c[O+2],c[O+3],c[O+4]),O+=4;break;case r.FILL_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),o||v.fill(),O+=6;break;case r.STROKE_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),o||v.stroke(),O+=6;break;case r.LINE_TO:v.lineTo(c[O+1],c[O+2]),O+=2;break;case r.MOVE_TO:v.moveTo(c[O+1],c[O+2]),O+=2;break;case r.LINE_FX_TO:v.lineTo(c[O+1],c[O+2]),O+=5;break;case r.MOVE_FX_TO:v.moveTo(c[O+1],c[O+2]),O+=5;break;case r.SAVE:v.save();break;case r.RESTORE:v.restore();break;case r.TRANSLATE:v.translate(c[O+1],c[O+2]),O+=2;break;case r.SCALE:v.scale(c[O+1],c[O+2]),O+=2;break;case r.ROTATE:v.rotate(c[O+1]),O+=1;break;case r.GRADIENT_FILL_STYLE:O+=5;break;case r.GRADIENT_LINE_STYLE:O+=6;break}}v.restore()}};s.exports=h},87079:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(43831);r.register("graphics",function(h,a){h===void 0&&(h={}),a!==void 0&&(h.add=a);var l=new p(this.scene,h);return h.add&&this.scene.sys.displayList.add(l),l})},1201:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43831),p=e(39429);p.register("graphics",function(h){return this.displayList.add(new r(this.scene,h))})},84503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(77545),h=e(32768),h=e(32768),s.exports={renderWebGL:p,renderCanvas:h}},77545:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85592),p=e(91296),h=e(61340),a=e(70554),l=function(c,d,v){this.x=c,this.y=d,this.width=v},n=function(c,d,v){this.points=[],this.pointsLength=1,this.points[0]=new l(c,d,v)},u=[],f=new h,o=function(c,d,v,m){if(d.commandBuffer.length!==0){v.addToRenderList(d);var S=c.pipelines.set(d.pipeline,d);c.pipelines.preBatch(d);for(var M=p(d,v,m).calc,w=f.loadIdentity(),C=d.commandBuffer,A=v.alpha*d.alpha,P=1,b=S.fillTint,O=S.strokeTint,I=0,D=0,B=0,G=.01,z=Math.PI*2,X,K=[],Q=0,tt=!0,Y=null,Z=a.getTintAppendFloatAlpha,U=0;U0&&(Dt=-z+Dt%z):Dt>z?Dt=z:Dt<0&&(Dt=z+Dt%z),Y===null&&(Y=new n(Vt+Math.cos(Rt)*ut,dt+Math.sin(Rt)*ut,P),K.push(Y),Pt+=G);Pt<1+Bt;)B=Dt*Pt+Rt,I=Vt+Math.cos(B)*ut,D=dt+Math.sin(B)*ut,Y.points.push(new l(I,D,P)),Pt+=G;B=Dt+Rt,I=Vt+Math.cos(B)*ut,D=dt+Math.sin(B)*ut,Y.points.push(new l(I,D,P));break}case r.FILL_RECT:{S.batchFillRect(C[++U],C[++U],C[++U],C[++U],w,M);break}case r.FILL_TRIANGLE:{S.batchFillTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],w,M);break}case r.STROKE_TRIANGLE:{S.batchStrokeTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],P,w,M);break}case r.LINE_TO:{Y!==null?Y.points.push(new l(C[++U],C[++U],P)):(Y=new n(C[++U],C[++U],P),K.push(Y));break}case r.MOVE_TO:{Y=new n(C[++U],C[++U],P),K.push(Y);break}case r.SAVE:{u.push(w.copyToArray());break}case r.RESTORE:{w.copyFromArray(u.pop());break}case r.TRANSLATE:{Vt=C[++U],dt=C[++U],w.translate(Vt,dt);break}case r.SCALE:{Vt=C[++U],dt=C[++U],w.scale(Vt,dt);break}case r.ROTATE:{w.rotate(C[++U]);break}}c.pipelines.postBatch(d)}};s.exports=o},26479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61061),p=e(83419),h=e(51708),a=e(50792),l=e(46710),n=e(95540),u=e(35154),f=e(97022),o=e(41212),c=e(88492),d=e(35072),v=e(68287),m=new p({Extends:a,initialize:function(M,w,C){a.call(this),C?w&&!Array.isArray(w)&&(w=[w]):Array.isArray(w)?o(w[0])&&(C=w,w=null):o(w)&&(C=w,w=null),this.scene=M,this.children=new d,this.isParent=!0,this.type="Group",this.classType=n(C,"classType",v),this.name=n(C,"name",""),this.active=n(C,"active",!0),this.maxSize=n(C,"maxSize",-1),this.defaultKey=n(C,"defaultKey",null),this.defaultFrame=n(C,"defaultFrame",null),this.runChildUpdate=n(C,"runChildUpdate",!1),this.createCallback=n(C,"createCallback",null),this.removeCallback=n(C,"removeCallback",null),this.createMultipleCallback=n(C,"createMultipleCallback",null),this.internalCreateCallback=n(C,"internalCreateCallback",null),this.internalRemoveCallback=n(C,"internalRemoveCallback",null),w&&this.addMultiple(w),C&&this.createMultiple(C),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(S,M,w,C,A,P){if(S===void 0&&(S=0),M===void 0&&(M=0),w===void 0&&(w=this.defaultKey),C===void 0&&(C=this.defaultFrame),A===void 0&&(A=!0),P===void 0&&(P=!0),this.isFull())return null;var b=new this.classType(this.scene,S,M,w,C);return b.addToDisplayList(this.scene.sys.displayList),b.addToUpdateList(),b.visible=A,b.setActive(P),this.add(b),b},createMultiple:function(S){if(this.isFull())return[];Array.isArray(S)||(S=[S]);var M=[];if(S[0].key)for(var w=0;w=0;B--)if(D=z[B],D.active===w){if(G++,G===M)break}else D=null;return D?(typeof A=="number"&&(D.x=A),typeof P=="number"&&(D.y=P),D):C?this.create(A,P,b,O,I):null},get:function(S,M,w,C,A){return this.getFirst(!1,!0,S,M,w,C,A)},getFirstAlive:function(S,M,w,C,A,P){return this.getFirst(!0,S,M,w,C,A,P)},getFirstDead:function(S,M,w,C,A,P){return this.getFirst(!1,S,M,w,C,A,P)},playAnimation:function(S,M){return r.PlayAnimation(this.children.entries,S,M),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(S){S===void 0&&(S=!0);for(var M=0,w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(26479);r.register("group",function(h){return new p(this.scene,null,h)})},3385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26479),p=e(39429);p.register("group",function(h,a){return this.updateList.add(new r(this.scene,h,a))})},88571:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(59819),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.TextureCrop,p.Tint,p.Transform,p.Visible,a],initialize:function(u,f,o,c,d){h.call(this,u,"Image"),this._crop=this.resetCropObject(),this.setTexture(c,d),this.setPosition(f,o),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=l},40652:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},82459:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(88571);p.register("image",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"frame",null),o=new a(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,o,l),o})},2117:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(88571),p=e(39429);p.register("image",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},59819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99517),h=e(40652),s.exports={renderWebGL:p,renderCanvas:h}},99517:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),this.pipeline.batchSprite(r,p,h)};s.exports=y},77856:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Events:e(51708),DisplayList:e(8050),GameObjectCreator:e(44603),GameObjectFactory:e(39429),UpdateList:e(45027),Components:e(31401),GetCalcMatrix:e(91296),BuildGameObject:e(25305),BuildGameObjectAnimation:e(13059),GameObject:e(95643),BitmapText:e(22186),Blitter:e(6107),Bob:e(46590),Container:e(31559),DOMElement:e(3069),DynamicBitmapText:e(2638),Extern:e(42421),Graphics:e(43831),Group:e(26479),Image:e(88571),Layer:e(93595),Particles:e(18404),PathFollower:e(1159),RenderTexture:e(591),RetroFont:e(196),Rope:e(77757),Sprite:e(68287),Text:e(50171),GetTextSize:e(14220),MeasureText:e(79557),TextStyle:e(35762),TileSprite:e(20839),Zone:e(41481),Video:e(18471),Shape:e(17803),Arc:e(23629),Curve:e(89),Ellipse:e(19921),Grid:e(30479),IsoBox:e(61475),IsoTriangle:e(16933),Line:e(57847),Polygon:e(24949),Rectangle:e(74561),Star:e(55911),Triangle:e(36931),Factories:{Blitter:e(12709),Container:e(24961),DOMElement:e(2611),DynamicBitmapText:e(72566),Extern:e(56315),Graphics:e(1201),Group:e(3385),Image:e(2117),Layer:e(20005),Particles:e(676),PathFollower:e(90145),RenderTexture:e(60505),Rope:e(96819),Sprite:e(46409),StaticBitmapText:e(34914),Text:e(68005),TileSprite:e(91681),Zone:e(84175),Video:e(89025),Arc:e(42563),Curve:e(40511),Ellipse:e(1543),Grid:e(34137),IsoBox:e(3933),IsoTriangle:e(49803),Line:e(2481),Polygon:e(64827),Rectangle:e(87959),Star:e(93697),Triangle:e(45245)},Creators:{Blitter:e(9403),Container:e(77143),DynamicBitmapText:e(11164),Graphics:e(87079),Group:e(94975),Image:e(82459),Layer:e(25179),Particles:e(92730),RenderTexture:e(34495),Rope:e(26209),Sprite:e(15567),StaticBitmapText:e(57336),Text:e(71259),TileSprite:e(14167),Zone:e(95261),Video:e(11511)}};r.Shader=e(20071),r.Mesh=e(4703),r.NineSlice=e(28103),r.PointLight=e(80321),r.Plane=e(33663),r.Factories.Shader=e(74177),r.Factories.Mesh=e(9225),r.Factories.NineSlice=e(47521),r.Factories.PointLight=e(71255),r.Factories.Plane=e(30985),r.Creators.Shader=e(54935),r.Creators.Mesh=e(20527),r.Creators.NineSlice=e(28279),r.Creators.PointLight=e(39829),r.Creators.Plane=e(56015),r.Light=e(41432),r.LightsManager=e(61356),r.LightsPlugin=e(88992),s.exports=r},93595:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(83419),h=e(31401),a=e(53774),l=e(45893),n=e(50792),u=e(51708),f=e(73162),o=e(33963),c=e(44594),d=e(19186),v=new p({Extends:f,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Mask,h.PostPipeline,h.Visible,n,o],initialize:function(S,M){f.call(this,S),n.call(this),this.scene=S,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=S.sys,this.events=S.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),M&&this.add(M),S.sys.queueDepthSort()},setActive:function(m){return this.active=m,this},setName:function(m){return this.name=m,this},setState:function(m){return this.state=m,this},setDataEnabled:function(){return this.data||(this.data=new l(this)),this},setData:function(m,S){return this.data||(this.data=new l(this)),this.data.set(m,S),this},incData:function(m,S){return this.data||(this.data=new l(this)),this.data.inc(m,S),this},toggleData:function(m){return this.data||(this.data=new l(this)),this.data.toggle(m),this},getData:function(m){return this.data||(this.data=new l(this)),this.data.get(m)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return a(this)},willRender:function(m){return!(this.renderFlags!==15||this.list.length===0||this.cameraFilter!==0&&this.cameraFilter&m.id)},getIndexList:function(){for(var m=this,S=this.parentContainer,M=[];S&&(M.unshift(S.getIndex(m)),m=S,S.parentContainer);)S=S.parentContainer;return M.unshift(this.displayList.getIndex(m)),M},addChildCallback:function(m){var S=m.displayList;S&&S!==this&&m.removeFromDisplayList(),m.displayList||(this.queueDepthSort(),m.displayList=this,m.emit(u.ADDED_TO_SCENE,m,this.scene),this.events.emit(c.ADDED_TO_SCENE,m,this.scene))},removeChildCallback:function(m){this.queueDepthSort(),m.displayList=null,m.emit(u.REMOVED_FROM_SCENE,m,this.scene),this.events.emit(c.REMOVED_FROM_SCENE,m,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(d(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(m,S){return m._depth-S._depth},getChildren:function(){return this.list},addToDisplayList:function(m){return m===void 0&&(m=this.scene.sys.displayList),this.displayList&&this.displayList!==m&&this.removeFromDisplayList(),m.exists(this)||(this.displayList=m,m.add(this,!0),m.queueDepthSort(),this.emit(u.ADDED_TO_SCENE,this,this.scene),m.events.emit(c.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var m=this.displayList||this.scene.sys.displayList;return m.exists(this)&&(m.remove(this,!0),m.queueDepthSort(),this.displayList=null,this.emit(u.REMOVED_FROM_SCENE,this,this.scene),m.events.emit(c.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(m){if(!(!this.scene||this.ignoreDestroy)){this.emit(u.DESTROY,this);for(var S=this.list;S.length;)S[0].destroy(m);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0,!1),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});s.exports=v},2956:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r.list;if(h.length!==0){r.depthSort();var a=r.blendMode!==-1;a||e.setBlendMode(0);var l=r._alpha;r.mask&&r.mask.preRenderCanvas(e,null,p);for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(93595),h=e(44603),a=e(23568);h.register("layer",function(l,n){l===void 0&&(l={});var u=a(l,"children",null),f=new p(this.scene,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},20005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(93595),p=e(39429);p.register("layer",function(h){return this.displayList.add(new r(this.scene,h))})},33963:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(15869),h=e(2956),s.exports={renderWebGL:p,renderCanvas:h}},15869:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r.list,a=h.length;if(a!==0){r.depthSort(),e.pipelines.preBatch(r);var l=r.blendMode!==-1;l||e.setBlendMode(0);for(var n=r.alpha,u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=e(83419),h=e(31401),a=e(51767),l=e(70554),n=new p({Extends:r,Mixins:[h.Origin,h.ScrollFactor,h.Visible],initialize:function(f,o,c,d,v,m,S){r.call(this,f,o,c),this.color=new a(d,v,m),this.intensity=S,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(c)},displayWidth:{get:function(){return this.diameter},set:function(u){this.diameter=u}},displayHeight:{get:function(){return this.diameter},set:function(u){this.diameter=u}},width:{get:function(){return this.diameter},set:function(u){this.diameter=u}},height:{get:function(){return this.diameter},set:function(u){this.diameter=u}},willRender:function(u){return!(n.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setColor:function(u){var f=l.getFloatsFromUintRGB(u);return this.color.set(f[0],f[1],f[2]),this},setIntensity:function(u){return this.intensity=u,this},setRadius:function(u){return this.radius=u,this}});n.RENDER_MASK=15,s.exports=n},61356:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81491),p=e(83419),h=e(20339),a=e(41432),l=e(80321),n=e(51767),u=e(19133),f=e(19186),o=e(70554),c=new p({initialize:function(){this.lights=[],this.ambientColor=new n(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(d,v,m,S,M,w){return this.systems.displayList.add(new l(this.scene,d,v,m,S,M,w))},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(d){for(var v=this.lights,m=d.worldView,S=[],M=0;Mthis.maxLights&&(f(S,this.sortByDistance),S=S.slice(0,this.maxLights)),this.visibleLights=S.length,S},sortByDistance:function(d,v){return d.distance>=v.distance},setAmbientColor:function(d){var v=o.getFloatsFromUintRGB(d);return this.ambientColor.set(v[0],v[1],v[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=16777215),M===void 0&&(M=1);var w=o.getFloatsFromUintRGB(S),C=new a(d,v,m,w[0],w[1],w[2],M);return this.lights.push(C),C},removeLight:function(d){var v=this.lights.indexOf(d);return v>=0&&u(this.lights,v),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});s.exports=c},88992:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(61356),h=e(37277),a=e(44594),l=new r({Extends:p,initialize:function(u){this.scene=u,this.systems=u.sys,u.sys.settings.isBooted||u.sys.events.once(a.BOOT,this.boot,this),p.call(this)},boot:function(){var n=this.systems.events;n.on(a.SHUTDOWN,this.shutdown,this),n.on(a.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});h.register("LightsPlugin",l,"lights"),s.exports=l},4703:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(39506),a=e(83997),l=e(95643),n=e(34684),u=e(92515),f=e(91296),o=e(37867),c=e(29807),d=e(43396),v=e(19186),m=e(25836),S=e(39318),M=new r({Extends:l,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.Texture,p.Transform,p.Visible,c],initialize:function(C,A,P,b,O,I,D,B,G,z,X,K){A===void 0&&(A=0),P===void 0&&(P=0),b===void 0&&(b="__WHITE"),l.call(this,C,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new m,this.modelScale=new m(1,1,1),this.modelRotation=new m,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new o,this.viewPosition=new m,this.viewMatrix=new o,this.projectionMatrix=new o,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1,this.fov,this.displayOriginX=0,this.displayOriginY=0;var Q=C.sys.renderer;this.setPosition(A,P),this.setTexture(b,O),this.setSize(Q.width,Q.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(Q.width,Q.height),I&&this.addVertices(I,D,B,G,z,X,K)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(w){return this.viewPosition.addScale(m.LEFT,w),this.dirtyCache[10]=1,this},panY:function(w){return this.viewPosition.y+=m.DOWN.y*w,this.dirtyCache[10]=1,this},panZ:function(w){return this.viewPosition.z+=w,this.dirtyCache[10]=1,this},setPerspective:function(w,C,A,P,b){return A===void 0&&(A=45),P===void 0&&(P=.01),b===void 0&&(b=1e3),this.fov=A,this.projectionMatrix.perspective(h(A),w/C,P,b),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(w,C,A,P){return w===void 0&&(w=this.scene.sys.renderer.getAspectRatio()),C===void 0&&(C=1),A===void 0&&(A=-1e3),P===void 0&&(P=1e3),this.fov=0,this.projectionMatrix.ortho(-w,w,-C,C,A,P),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(w){w.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(w,C,A,P,b,O,I,D,B){var G=this.scene.sys.cache.obj.get(w),z;return G&&(z=n(G,this,C,A,P,b,O,I,D,B)),(!z||z.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",w),this},sortByDepth:function(w,C){return w.depth-C.depth},depthSort:function(){return v(this.faces,this.sortByDepth),this},addVertex:function(w,C,A,P,b,O,I){var D=new S(w,C,A,P,b,O,I);return this.vertices.push(D),D},addFace:function(w,C,A){var P=new a(w,C,A);return this.faces.push(P),this.dirtyCache[9]=-1,P},addVertices:function(w,C,A,P,b,O,I){var D=u(w,C,A,P,b,O,I);return D?(this.faces=this.faces.concat(D.faces),this.vertices=this.vertices.concat(D.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(w){return this.faces[w]},hasFaceAt:function(w,C,A){A===void 0&&(A=this.scene.sys.cameras.main);for(var P=f(this,A).calc,b=this.faces,O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},20527:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(4703);p.register("mesh",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=a(n,"vertices",[]),d=a(n,"uvs",[]),v=a(n,"indicies",[]),m=a(n,"containsZ",!1),S=a(n,"normals",[]),M=a(n,"colors",16777215),w=a(n,"alphas",1),C=new l(this.scene,0,0,f,o,c,d,v,m,S,M,w);return u!==void 0&&(n.add=u),r(this.scene,C,n),C})},9225:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4703),p=e(39429);p.register("mesh",function(h,a,l,n,u,f,o,c,d,v,m){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c,d,v,m))})},29807:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(48833),h=e(36488),s.exports={renderWebGL:p,renderCanvas:h}},48833:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){var u=a.faces,f=u.length;if(f!==0){l.addToRenderList(a);var o=h.pipelines.set(a.pipeline,a),c=r(a,l,n).calc;h.pipelines.preBatch(a);for(var d=o.setGameObject(a),v=o.vertexViewF32,m=o.vertexViewU32,S=o.vertexCount*o.currentShader.vertexComponentCount-1,M=a.tintFill,w=[],C=a.debugCallback,A=c.a,P=c.b,b=c.c,O=c.d,I=c.e,D=c.f,B=a.viewPosition.z,G=a.hideCCW,z=l.roundPixels,X=l.alpha*a.alpha,K=0,Q=0;Q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(78023),l=e(39318),n=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,a],initialize:function(f,o,c,d,v,m,S,M,w,C,A){h.call(this,f,"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=f.textures.getFrame(d,v);this.is3Slice=!C&&!A,P.scale9&&(this.is3Slice=P.is3Slice);for(var b=this.is3Slice?18:54,O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(28103);p.register("nineslice",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=a(n,"width",256),d=a(n,"height",256),v=a(n,"leftWidth",10),m=a(n,"rightWidth",10),S=a(n,"topHeight",0),M=a(n,"bottomHeight",0),w=new l(this.scene,0,0,f,o,c,d,v,m,S,M);return u!==void 0&&(n.add=u),r(this.scene,w,n),w})},47521:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28103),p=e(39429);p.register("nineslice",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c,d,v))})},78023:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(52230),s.exports={renderWebGL:p,renderCanvas:h}},52230:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){var f=l.vertices,o=f.length;if(o!==0){n.addToRenderList(l);var c=a.pipelines.set(l.pipeline,l),d=r(l,n,u,!1).calc;a.pipelines.preBatch(l);var v=c.setGameObject(l),m=c.vertexViewF32,S=c.vertexViewU32,M=c.vertexCount*c.currentShader.vertexComponentCount-1,w=n.roundPixels,C=l.tintFill,A=n.alpha*l.alpha,P=p.getTintAppendFloatAlpha(l.tint,A),b=c.vertexAvailable(),O=-1;b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(44777),h=e(37589),a=e(6113),l=e(91389),n=e(90664),u=new r({Extends:p,initialize:function(o){p.call(this,o,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return this.propertyValue===null?0:9},setMethods:function(){var f=this.propertyValue,o=f,c=this.defaultEmit,d=this.defaultUpdate;if(this.method===9){this.start=f[0],this.ease=a("Linear"),this.interpolation=l("linear"),c=this.easedValueEmit,d=this.easeValueUpdate,o=f[0],this.active=!0;for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(45319),h=e(83419),a=e(99472),l=e(6113),n=e(95540),u=e(91389),f=e(77720),o=e(15994),c=new h({initialize:function(v,m,S){S===void 0&&(S=!1),this.propertyKey=v,this.propertyValue=m,this.defaultValue=m,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=S,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(d,v){d===void 0&&(d={}),v&&(this.propertyKey=v),this.propertyValue=n(d,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(d){var v;switch(this.method){case 1:case 3:case 8:v=d;break;case 2:this.propertyValue.indexOf(d)>=0&&(v=d);break;case 4:var m=(this.end-this.start)/this.steps;v=f(d,m),this.counter=v;break;case 5:case 6:case 7:v=p(d,this.start,this.end);break;case 9:v=this.start[0];break}return this.current=v,this},getMethod:function(){var d=this.propertyValue;if(d===null)return 0;var v=typeof d;if(v==="number")return 1;if(Array.isArray(d))return 2;if(v==="function")return 3;if(v==="object"){if(this.hasBoth(d,"start","end"))return this.has(d,"steps")?4:5;if(this.hasBoth(d,"min","max"))return 6;if(this.has(d,"random"))return 7;if(this.hasEither(d,"onEmit","onUpdate"))return 8;if(this.hasEither(d,"values","interpolation"))return 9}return 0},setMethods:function(){var d=this.propertyValue,v=d,m=this.defaultEmit,S=this.defaultUpdate;switch(this.method){case 1:m=this.staticValueEmit;break;case 2:m=this.randomStaticValueEmit,v=d[0];break;case 3:this._onEmit=d,m=this.proxyEmit;break;case 4:this.start=d.start,this.end=d.end,this.steps=d.steps,this.counter=this.start,this.yoyo=this.has(d,"yoyo")?d.yoyo:!1,this.direction=0,m=this.steppedEmit,v=this.start;break;case 5:this.start=d.start,this.end=d.end;var M=this.has(d,"ease")?d.ease:"Linear";this.ease=l(M,d.easeParams),m=this.has(d,"random")&&d.random?this.randomRangedValueEmit:this.easedValueEmit,S=this.easeValueUpdate,v=this.start;break;case 6:this.start=d.min,this.end=d.max,m=this.has(d,"int")&&d.int?this.randomRangedIntEmit:this.randomRangedValueEmit,v=this.start;break;case 7:var w=d.random;Array.isArray(w)&&(this.start=w[0],this.end=w[1]),m=this.randomRangedIntEmit,v=this.start;break;case 8:this._onEmit=this.has(d,"onEmit")?d.onEmit:this.defaultEmit,this._onUpdate=this.has(d,"onUpdate")?d.onUpdate:this.defaultUpdate,m=this.proxyEmit,S=this.proxyUpdate;break;case 9:this.start=d.values;var C=this.has(d,"ease")?d.ease:"Linear";this.ease=l(C,d.easeParams),this.interpolation=u(d.interpolation),m=this.easedValueEmit,S=this.easeValueUpdate,v=this.start[0];break}return this.onEmit=m,this.onUpdate=S,this.current=v,this},has:function(d,v){return d.hasOwnProperty(v)},hasBoth:function(d,v,m){return d.hasOwnProperty(v)&&d.hasOwnProperty(m)},hasEither:function(d,v,m){return d.hasOwnProperty(v)||d.hasOwnProperty(m)},defaultEmit:function(d,v,m){return m},defaultUpdate:function(d,v,m,S){return S},proxyEmit:function(d,v,m){var S=this._onEmit(d,v,m);return this.current=S,S},proxyUpdate:function(d,v,m,S){var M=this._onUpdate(d,v,m,S);return this.current=M,M},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var d=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[d],this.current},randomRangedValueEmit:function(d,v){var m=a(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},randomRangedIntEmit:function(d,v){var m=r(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},steppedEmit:function(){var d=this.counter,v=d,m=(this.end-this.start)/this.steps;if(this.yoyo){var S;this.direction===0?(v+=m,v>=this.end&&(S=v-this.end,v=this.end-S,this.direction=1)):(v-=m,v<=this.start&&(S=this.start-v,v=this.start+S,this.direction=0)),this.counter=v}else this.counter=o(v+m,this.start,this.end);return this.current=d,d},easedValueEmit:function(d,v){if(d&&d.data[v]){var m=d.data[v];m.min=this.start,m.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(d,v,m){var S=d.data[v],M,w=this.ease(m);return this.interpolation?M=this.interpolation(this.start,w):M=(S.max-S.min)*w+S.min,this.current=M,M},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});s.exports=c},24502:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(20286),a=new r({Extends:h,initialize:function(n,u,f,o,c){if(typeof n=="object"){var d=n;n=p(d,"x",0),u=p(d,"y",0),f=p(d,"power",0),o=p(d,"epsilon",100),c=p(d,"gravity",50)}else n===void 0&&(n=0),u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=100),c===void 0&&(c=50);h.call(this,n,u,!0),this._gravity=c,this._power=f*c,this._epsilon=o*o},update:function(l,n){var u=this.x-l.x,f=this.y-l.y,o=u*u+f*f;if(o!==0){var c=Math.sqrt(o);o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(45319),h=e(83419),a=e(39506),l=e(87841),n=e(11520),u=e(26099),f=new h({initialize:function(c){this.emitter=c,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new u,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=c.scene,this.anims=new r(this),this.bounds=new l},emit:function(o,c,d,v,m,S){return this.emitter.emit(o,c,d,v,m,S)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(o,c){o===void 0&&(o=0),c===void 0&&(c=0),this.x=o,this.y=c},fire:function(o,c){var d=this.emitter,v=d.ops,m=d.getAnim();if(m?this.anims.play(m):(this.frame=d.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(d.getEmitZone(this),o===void 0?this.x+=v.x.onEmit(this,"x"):v.x.steps>0?this.x+=o+v.x.onEmit(this,"x"):this.x+=o,c===void 0?this.y+=v.y.onEmit(this,"y"):v.y.steps>0?this.y+=c+v.y.onEmit(this,"y"):this.y+=c,this.life=v.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=v.delay.onEmit(this,"delay"),this.holdCurrent=v.hold.onEmit(this,"hold"),this.scaleX=v.scaleX.onEmit(this,"scaleX"),this.scaleY=v.scaleY.active?v.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=v.rotate.onEmit(this,"rotate"),this.rotation=a(this.angle),d.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&d.getDeathZone(this))return this.lifeCurrent=0,!1;var S=v.speedX.onEmit(this,"speedX"),M=v.speedY.active?v.speedY.onEmit(this,"speedY"):S;if(d.radial){var w=a(v.angle.onEmit(this,"angle"));this.velocityX=Math.cos(w)*Math.abs(S),this.velocityY=Math.sin(w)*Math.abs(M)}else if(d.moveTo){var C=v.moveToX.onEmit(this,"moveToX"),A=v.moveToY.onEmit(this,"moveToY"),P=this.life/1e3;this.velocityX=(C-this.x)/P,this.velocityY=(A-this.y)/P}else this.velocityX=S,this.velocityY=M;return d.acceleration&&(this.accelerationX=v.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=v.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=v.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=v.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=v.bounce.onEmit(this,"bounce"),this.alpha=v.alpha.onEmit(this,"alpha"),v.color.active?this.tint=v.color.onEmit(this,"tint"):this.tint=v.tint.onEmit(this,"tint"),!0},update:function(o,c,d){if(this.lifeCurrent<=0)return this.holdCurrent>0?(this.holdCurrent-=o,this.holdCurrent<=0):!0;if(this.delayCurrent>0)return this.delayCurrent-=o,!1;this.anims.update(0,o);var v=this.emitter,m=v.ops,S=1-this.lifeCurrent/this.life;if(this.lifeT=S,this.x=m.x.onUpdate(this,"x",S,this.x),this.y=m.y.onUpdate(this,"y",S,this.y),v.moveTo){var M=m.moveToX.onUpdate(this,"moveToX",S,v.moveToX),w=m.moveToY.onUpdate(this,"moveToY",S,v.moveToY),C=this.lifeCurrent/1e3;this.velocityX=(M-this.x)/C,this.velocityY=(w-this.y)/C}return this.computeVelocity(v,o,c,d,S),this.scaleX=m.scaleX.onUpdate(this,"scaleX",S,this.scaleX),m.scaleY.active?this.scaleY=m.scaleY.onUpdate(this,"scaleY",S,this.scaleY):this.scaleY=this.scaleX,this.angle=m.rotate.onUpdate(this,"rotate",S,this.angle),this.rotation=a(this.angle),v.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=p(m.alpha.onUpdate(this,"alpha",S,this.alpha),0,1),m.color.active?this.tint=m.color.onUpdate(this,"color",S,this.tint):this.tint=m.tint.onUpdate(this,"tint",S,this.tint),this.lifeCurrent-=o,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(o,c,d,v,m){var S=o.ops,M=this.velocityX,w=this.velocityY,C=S.accelerationX.onUpdate(this,"accelerationX",m,this.accelerationX),A=S.accelerationY.onUpdate(this,"accelerationY",m,this.accelerationY),P=S.maxVelocityX.onUpdate(this,"maxVelocityX",m,this.maxVelocityX),b=S.maxVelocityY.onUpdate(this,"maxVelocityY",m,this.maxVelocityY);this.bounce=S.bounce.onUpdate(this,"bounce",m,this.bounce),M+=o.gravityX*d+C*d,w+=o.gravityY*d+A*d,M=p(M,-P,P),w=p(w,-b,b),this.velocityX=M,this.velocityY=w,this.x+=M*d,this.y+=w*d,o.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(20286),h=e(87841),a=new r({Extends:p,initialize:function(n,u,f,o,c,d,v,m){c===void 0&&(c=!0),d===void 0&&(d=!0),v===void 0&&(v=!0),m===void 0&&(m=!0),p.call(this,n,u,!0),this.bounds=new h(n,u,f,o),this.collideLeft=c,this.collideRight=d,this.collideTop=v,this.collideBottom=m},update:function(l){var n=this.bounds,u=-l.bounce,f=l.worldPosition;f.xn.right&&this.collideRight&&(l.x-=f.x-n.right,l.velocityX*=u),f.yn.bottom&&this.collideBottom&&(l.y-=f.y-n.bottom,l.velocityY*=u)}});s.exports=a},31600:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(53774),a=e(43459),l=e(26388),n=e(19909),u=e(76472),f=e(44777),o=e(20696),c=e(95643),d=e(95540),v=e(26546),m=e(24502),S=e(1985),M=e(97022),w=e(86091),C=e(73162),A=e(20074),P=e(56480),b=e(68875),O=e(87841),I=e(59996),D=e(72905),B=e(90668),G=e(19186),z=e(61340),X=e(26099),K=e(15994),Q=e(69601),tt=["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"],Y=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],Z=new r({Extends:c,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,B],initialize:function(H,J,_,q,at){c.call(this,H,"ParticleEmitter"),this.particleClass=P,this.ops={accelerationX:new f("accelerationX",0),accelerationY:new f("accelerationY",0),alpha:new f("alpha",1),angle:new f("angle",{min:0,max:360},!0),bounce:new f("bounce",0),color:new u("color"),delay:new f("delay",0,!0),hold:new f("hold",0,!0),lifespan:new f("lifespan",1e3,!0),maxVelocityX:new f("maxVelocityX",1e4),maxVelocityY:new f("maxVelocityY",1e4),moveToX:new f("moveToX",0),moveToY:new f("moveToY",0),quantity:new f("quantity",1,!0),rotate:new f("rotate",0),scaleX:new f("scaleX",1),scaleY:new f("scaleY",1),speedX:new f("speedX",0,!0),speedY:new f("speedY",0,!0),tint:new f("tint",16777215),x:new f("x",0),y:new f("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 X,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 z,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new C(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(J,_),this.setTexture(q),at&&this.setConfig(at)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(U){if(!U)return this;var H=0,J="",_=this.ops;for(H=0;H=this.animQuantity&&(this.animCounter=0,this.currentAnim=K(this.currentAnim+1,0,H)),J},setAnim:function(U,H,J){H===void 0&&(H=!0),J===void 0&&(J=1),this.randomAnim=H,this.animQuantity=J,this.currentAnim=0;var _=typeof U;if(this.anims.length=0,Array.isArray(U))this.anims=this.anims.concat(U);else if(_==="string")this.anims.push(U);else if(_==="object"){var q=U;U=d(q,"anims",null),U&&(this.anims=this.anims.concat(U));var at=d(q,"cycle",!1);this.randomAnim=!at,this.animQuantity=d(q,"quantity",J)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(U){return U===void 0&&(U=!0),this.radial=U,this},addParticleBounds:function(U,H,J,_,q,at,ot,rt){if(typeof U=="object"){var gt=U;U=gt.x,H=gt.y,J=M(gt,"w")?gt.w:gt.width,_=M(gt,"h")?gt.h:gt.height}return this.addParticleProcessor(new Q(U,H,J,_,q,at,ot,rt))},setParticleSpeed:function(U,H){return H===void 0&&(H=U),this.ops.speedX.onChange(U),U===H?this.ops.speedY.active=!1:this.ops.speedY.onChange(H),this.radial=!0,this},setParticleScale:function(U,H){return U===void 0&&(U=1),H===void 0&&(H=U),this.ops.scaleX.onChange(U),this.ops.scaleY.onChange(H),this},setParticleGravity:function(U,H){return this.gravityX=U,this.gravityY=H,this},setParticleAlpha:function(U){return this.ops.alpha.onChange(U),this},setParticleTint:function(U){return this.ops.tint.onChange(U),this},setEmitterAngle:function(U){return this.ops.angle.onChange(U),this},setParticleLifespan:function(U){return this.ops.lifespan.onChange(U),this},setQuantity:function(U){return this.quantity=U,this},setFrequency:function(U,H){return this.frequency=U,this.flowCounter=U>0?U:0,H&&(this.quantity=H),this},addDeathZone:function(U){Array.isArray(U)||(U=[U]);for(var H,J=[],_=0;_-1&&(this.zoneTotal++,this.zoneTotal===_.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===J&&(this.zoneIndex=0)))}},getDeathZone:function(U){for(var H=this.deathZones,J=0;J=0&&(this.zoneIndex=H),this},addParticleProcessor:function(U){return this.processors.exists(U)||(U.emitter&&U.emitter.removeParticleProcessor(U),this.processors.add(U),U.emitter=this),U},removeParticleProcessor:function(U){return this.processors.exists(U)&&(this.processors.remove(U,!0),U.emitter=null),U},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(U){return this.addParticleProcessor(new m(U))},reserve:function(U){var H=this.dead;if(this.maxParticles>0){var J=this.getParticleCount();J+U>this.maxParticles&&(U=this.maxParticles-(J+U))}for(var _=0;_0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(U,H){return U===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof U=="function"&&(this.emitCallback=U,H&&(this.emitCallbackScope=H)),this},onParticleDeath:function(U,H){return U===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof U=="function"&&(this.deathCallback=U,H&&(this.deathCallbackScope=H)),this},killAll:function(){for(var U=this.dead,H=this.alive;H.length>0;)U.push(H.pop());return this},forEachAlive:function(U,H){for(var J=this.alive,_=J.length,q=0;q<_;q++)U.call(H,J[q],this);return this},forEachDead:function(U,H){for(var J=this.dead,_=J.length,q=0;q<_;q++)U.call(H,J[q],this);return this},start:function(U,H){return U===void 0&&(U=0),this.emitting||(U>0&&this.fastForward(U),this.emitting=!0,this.resetCounters(this.frequency,!0),H!==void 0&&(this.duration=Math.abs(H)),this.emit(o.START,this)),this},stop:function(U){return U===void 0&&(U=!1),this.emitting&&(this.emitting=!1,U&&this.killAll(),this.emit(o.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(U,H){return U===void 0&&(U=""),H===void 0&&(H=this.true),this.sortProperty=U,this.sortOrderAsc=H,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(U){return this.sortProperty!==""?U=this.depthSortCallback:U=null,this.sortCallback=U,this},depthSort:function(){return G(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(U,H){var J=this.sortProperty;return this.sortOrderAsc?U[J]-H[J]:H[J]-U[J]},flow:function(U,H,J){return H===void 0&&(H=1),this.emitting=!1,this.frequency=U,this.quantity=H,J!==void 0&&(this.stopAfter=J),this.start()},explode:function(U,H,J){this.frequency=-1,this.resetCounters(-1,!0);var _=this.emitParticle(U,H,J);return this.emit(o.EXPLODE,this,_),_},emitParticleAt:function(U,H,J){return this.emitParticle(J,U,H)},emitParticle:function(U,H,J){if(!this.atLimit()){U===void 0&&(U=this.ops.quantity.onEmit());for(var _=this.dead,q=this.stopAfter,at=this.follow?this.follow.x+this.followOffset.x:H,ot=this.follow?this.follow.y+this.followOffset.y:J,rt=0;rt0&&(this.stopCounter++,this.stopCounter>=q)||this.atLimit())break}return gt}},fastForward:function(U,H){H===void 0&&(H=1e3/60);var J=0;for(this.skipping=!0;J0){var Et=this.deathCallback,At=this.deathCallbackScope;for(ot=gt-1;ot>=0;ot--){var Pt=rt[ot];q.splice(Pt.index,1),at.push(Pt.particle),Et&&Et.call(At,Pt.particle),Pt.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&q.length===0&&(this.completeFlag=0,this.emit(o.COMPLETE,this));return}if(this.frequency===0)this.emitParticle();else if(this.frequency>0)for(this.flowCounter-=H;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=H,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(U){for(var H=this.getWorldTransformMatrix(),J=this.alive,_=J.length,q=[],at=0;at<_;at++){var ot=J[at];I(U,ot.getBounds(H))&&q.push(ot)}return q},getBounds:function(U,H,J,_){U===void 0&&(U=0),H===void 0&&(H=0),J===void 0&&(J=1e3/60),_===void 0&&(_=new O);var q=this.getWorldTransformMatrix(),at,ot,rt=this.alive,gt=!1;if(_.setTo(0,0,0,0),H>0){var yt=0;for(this.skipping=!0;yt0&&w(_,U,U),_},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(U){this.ops.x.onChange(U)}},particleY:{get:function(){return this.ops.y.current},set:function(U){this.ops.y.onChange(U)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(U){this.ops.accelerationX.onChange(U)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(U){this.ops.accelerationY.onChange(U)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(U){this.ops.maxVelocityX.onChange(U)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(U){this.ops.maxVelocityY.onChange(U)}},speed:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U),this.ops.speedY.onChange(U)}},speedX:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U)}},speedY:{get:function(){return this.ops.speedY.current},set:function(U){this.ops.speedY.onChange(U)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(U){this.ops.moveToX.onChange(U)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(U){this.ops.moveToY.onChange(U)}},bounce:{get:function(){return this.ops.bounce.current},set:function(U){this.ops.bounce.onChange(U)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(U){this.ops.scaleX.onChange(U)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(U){this.ops.scaleY.onChange(U)}},particleColor:{get:function(){return this.ops.color.current},set:function(U){this.ops.color.onChange(U)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(U){this.ops.color.setEase(U)}},particleTint:{get:function(){return this.ops.tint.current},set:function(U){this.ops.tint.onChange(U)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(U){this.ops.alpha.onChange(U)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(U){this.ops.lifespan.onChange(U)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(U){this.ops.angle.onChange(U)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(U){this.ops.rotate.onChange(U)}},quantity:{get:function(){return this.ops.quantity.current},set:function(U){this.ops.quantity.onChange(U)}},delay:{get:function(){return this.ops.delay.current},set:function(U){this.ops.delay.onChange(U)}},hold:{get:function(){return this.ops.hold.current},set:function(U){this.ops.hold.onChange(U)}},flowCounter:{get:function(){return this.counters[0]},set:function(U){this.counters[0]=U}},frameCounter:{get:function(){return this.counters[1]},set:function(U){this.counters[1]=U}},animCounter:{get:function(){return this.counters[2]},set:function(U){this.counters[2]=U}},elapsed:{get:function(){return this.counters[3]},set:function(U){this.counters[3]=U}},stopCounter:{get:function(){return this.counters[4]},set:function(U){this.counters[4]=U}},completeFlag:{get:function(){return this.counters[5]},set:function(U){this.counters[5]=U}},zoneIndex:{get:function(){return this.counters[6]},set:function(U){this.counters[6]=U}},zoneTotal:{get:function(){return this.counters[7]},set:function(U){this.counters[7]=U}},currentFrame:{get:function(){return this.counters[8]},set:function(U){this.counters[8]=U}},currentAnim:{get:function(){return this.counters[9]},set:function(U){this.counters[9]=U}},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 U,H=this.ops;for(U=0;U{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(59996),p=e(61340),h=new p,a=new p,l=new p,n=new p,u=function(f,o,c,d){var v=h,m=a,S=l,M=n;d?(M.loadIdentity(),M.multiply(d),M.translate(o.x,o.y),M.rotate(o.rotation),M.scale(o.scaleX,o.scaleY)):M.applyITRS(o.x,o.y,o.rotation,o.scaleX,o.scaleY);var w=f.currentContext,C=c.roundPixels,A=c.alpha,P=o.alpha,b=o.alive,O=b.length,I=o.viewBounds;if(!(!o.visible||O===0||I&&!r(I,c.worldView))){o.sortCallback&&o.depthSort(),c.addToRenderList(o);var D=o.scrollFactorX,B=o.scrollFactorY;w.save(),w.globalCompositeOperation=f.blendModes[o.blendMode];for(var G=0;G0&&Q.height>0){var tt=-K.halfWidth,Y=-K.halfHeight;w.globalAlpha=X,w.save(),m.setToContext(w),C&&(tt=Math.round(tt),Y=Math.round(Y)),w.imageSmoothingEnabled=!K.source.scaleMode,w.drawImage(K.source.image,Q.x,Q.y,Q.width,Q.height,tt,Y,Q.width,Q.height),w.restore()}}}w.restore()}};s.exports=u},92730:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(95540),l=e(31600);p.register("particles",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=a(n,"config",null),c=new l(this.scene,0,0,f);return u!==void 0&&(n.add=u),r(this.scene,c,n),o&&c.setConfig(o),c})},676:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(31600);r.register("particles",function(h,a,l,n){return h!==void 0&&typeof h=="string"&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new p(this.scene,h,a,l,n))})},90668:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(21188),h=e(9871),s.exports={renderWebGL:p,renderCanvas:h}},21188:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(59996),p=e(61340),h=e(70554),a=new p,l=new p,n=new p,u=new p,f=function(o,c,d,v){var m=o.pipelines.set(c.pipeline),S=a,M=l,w=n,C=u;v?(C.loadIdentity(),C.multiply(v),C.translate(c.x,c.y),C.rotate(c.rotation),C.scale(c.scaleX,c.scaleY)):C.applyITRS(c.x,c.y,c.rotation,c.scaleX,c.scaleY);var A=h.getTintAppendFloatAlpha,P=d.alpha,b=c.alpha;o.pipelines.preBatch(c);var O=c.alive,I=O.length,D=c.viewBounds;if(!(I===0||D&&!r(D,d.worldView))){c.sortCallback&&c.depthSort(),d.addToRenderList(c),S.copyFrom(d.matrix),S.multiplyWithOffset(C,-d.scrollX*c.scrollFactorX,-d.scrollY*c.scrollFactorY),o.setBlendMode(c.blendMode),c.mask&&(c.mask.preRenderWebGL(o,c,d),o.pipelines.set(c.pipeline));for(var B=c.tintFill,G,z,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){a===void 0&&(a=0),l===void 0&&(l=0),n===void 0&&(n=!0),this.emitter,this.x=a,this.y=l,this.active=n},update:function(){},destroy:function(){this.emitter=null}});s.exports=p},9774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},812:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="deathzone"},30522:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="explode"},96695:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},18677:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},20696:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(9774),DEATH_ZONE:e(812),EXPLODE:e(30522),START:e(96695),STOP:e(18677)}},18404:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={EmitterColorOp:e(76472),EmitterOp:e(44777),Events:e(20696),GravityWell:e(24502),Particle:e(56480),ParticleBounds:e(69601),ParticleEmitter:e(31600),ParticleProcessor:e(20286),Zones:e(21024)}},26388:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.source=a,this.killOnEnter=l},willKill:function(h){var a=h.worldPosition,l=this.source.contains(a.x,a.y);return l&&this.killOnEnter||!l&&!this.killOnEnter}});s.exports=p},19909:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o){u===void 0&&(u=!1),f===void 0&&(f=!0),o===void 0&&(o=-1),this.source=a,this.points=[],this.quantity=l,this.stepRate=n,this.yoyo=u,this.counter=-1,this.seamless=f,this._length=0,this._direction=0,this.total=o,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var h=this.points[0],a=this.points[this.points.length-1];h.x===a.x&&h.y===a.y&&this.points.pop()}var l=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(h){return this.source=h,this.updateSource()},getPoint:function(h){this._direction===0?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,this.counter===-1&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var a=this.points[this.counter];a&&(h.x=a.x,h.y=a.y)}});s.exports=p},68875:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l){this.source=l,this._tempVec=new p,this.total=-1},getPoint:function(a){var l=this._tempVec;this.source.getRandomPoint(l),a.x=l.x,a.y=l.y}});s.exports=h},21024:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DeathZone:e(26388),EdgeZone:e(19909),RandomZone:e(68875)}},1159:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(68287),a=new r({Extends:h,Mixins:[p.PathFollower],initialize:function(n,u,f,o,c,d){h.call(this,n,f,o,c,d),this.path=u},preUpdate:function(l,n){this.anims.update(l,n),this.pathUpdate(l)}});s.exports=a},90145:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(1159);r.register("follower",function(h,a,l,n,u){var f=new p(this.scene,h,a,l,n,u);return this.displayList.add(f),this.updateList.add(f),f})},33663:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(48803),a=e(90664),l=e(4703),n=e(45650),u=new p({Extends:l,initialize:function(o,c,d,v,m,S,M,w){v||(v="__DEFAULT"),l.call(this,o,c,d,v,m),this.type="Plane",this.anims=new r(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(S,M,w),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(f,o,c){f===void 0&&(f=8),o===void 0&&(o=8),c===void 0&&(c=!1);var d=!1;return c&&(d=!0),this.gridWidth=f,this.gridHeight=o,this.isTiled=c,this.clear(),h({mesh:this,widthSegments:f,heightSegments:o,isOrtho:!1,tile:c,flipY:d}),this},setSizeToFrame:function(f){f===void 0&&(f=!0);var o=this.frame;if(this.setPerspective(this.width/o.width,this.height/o.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!f)return this;var c=this.gridWidth,d=this.gridHeight,v=this.vertices,m=o.u0,S=o.u1,M=o.v0,w=o.v1,C,A,P=0;if(this.isTiled)for(M=o.v1,w=o.v0,A=0;A7&&C>7?M.push(m.r,m.g,m.b,c):M.push(S.r,S.g,S.b,d);var A=this.scene.sys.textures.addUint8Array(n(),new Uint8Array(M),16,16);return this.removeCheckerboard(),this.setTexture(A),this.setSizeToFrame(),this.setViewHeight(v),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(f,o){return this.anims.play(f,o)},playReverse:function(f,o){return this.anims.playReverse(f,o)},playAfterDelay:function(f,o){return this.anims.playAfterDelay(f,o)},playAfterRepeat:function(f,o){return this.anims.playAfterRepeat(f,o)},stop:function(){return this.anims.stop()},stopAfterDelay:function(f){return this.anims.stopAfterDelay(f)},stopAfterRepeat:function(f){return this.anims.stopAfterRepeat(f)},stopOnFrame:function(f){return this.anims.stopOnFrame(f)},preUpdate:function(f,o){l.prototype.preUpdate.call(this,f,o),this.anims.update(f,o)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});s.exports=u},56015:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(13059),h=e(44603),a=e(23568),l=e(35154),n=e(33663);h.register("plane",function(u,f){u===void 0&&(u={});var o=a(u,"key",null),c=a(u,"frame",null),d=l(u,"width",8),v=l(u,"height",8),m=l(u,"tile",!1),S=new n(this.scene,0,0,o,c,d,v,m);f!==void 0&&(u.add=f);var M=l(u,"checkerboard",null);if(M){var w=l(M,"color1",16777215),C=l(M,"color2",255),A=l(M,"alpha1",255),P=l(M,"alpha2",255),b=l(M,"height",128);S.createCheckerboard(w,C,A,P,b)}return r(this.scene,S,u),p(S,u),S})},30985:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33663),p=e(39429);p.register("plane",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},80321:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(30100),l=e(36060),n=e(67277),u=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible,n],initialize:function(o,c,d,v,m,S,M){v===void 0&&(v=16777215),m===void 0&&(m=128),S===void 0&&(S=1),M===void 0&&(M=.1),h.call(this,o,"PointLight"),this.initPipeline(l.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(c,d),this.color=a(v),this.intensity=S,this.attenuation=M,this.width=m*2,this.height=m*2,this._radius=m},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this.width=f*2,this.height=f*2}},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});s.exports=u},39829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(80321);p.register("pointlight",function(l,n){l===void 0&&(l={});var u=h(l,"color",16777215),f=h(l,"radius",128),o=h(l,"intensity",1),c=h(l,"attenuation",.1),d=new a(this.scene,0,0,u,f,o,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},71255:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(80321);r.register("pointlight",function(h,a,l,n,u,f){return this.displayList.add(new p(this.scene,h,a,l,n,u,f))})},67277:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(57787),s.exports={renderWebGL:p,renderCanvas:h}},57787:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){l.addToRenderList(a);var u=h.pipelines.set(a.pipeline),f=r(a,l,n).calc,o=a.width,c=a.height,d=-a._radius,v=-a._radius,m=d+o,S=v+c,M=f.getX(0,0),w=f.getY(0,0),C=f.getX(d,v),A=f.getY(d,v),P=f.getX(d,S),b=f.getY(d,S),O=f.getX(m,S),I=f.getY(m,S),D=f.getX(m,v),B=f.getY(m,v);h.pipelines.preBatch(a),u.batchPointLight(a,l,C,A,P,b,O,I,D,B,M,w),h.pipelines.postBatch(a)};s.exports=p},591:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(81320),h=e(88571),a=new r({Extends:h,initialize:function(n,u,f,o,c){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=32),c===void 0&&(c=32);var d=new p(n.sys.textures,"",o,c);h.call(this,n,u,f,d),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(l,n){this.width=l,this.height=n,this.texture.setSize(l,n),this.updateDisplayOrigin();var u=this.input;return u&&!u.customHitArea&&(u.hitArea.width=l,u.hitArea.height=n),this},resize:function(l,n){return this.setSize(l,n),this},saveTexture:function(l){var n=this.texture;return n.key=l,n.manager.addDynamicTexture(n)&&(this._saved=!0),n},fill:function(l,n,u,f,o,c){return this.texture.fill(l,n,u,f,o,c),this},clear:function(){return this.texture.clear(),this},stamp:function(l,n,u,f,o){return this.texture.stamp(l,n,u,f,o),this},erase:function(l,n,u){return this.texture.erase(l,n,u),this},draw:function(l,n,u,f,o){return this.texture.draw(l,n,u,f,o),this},drawFrame:function(l,n,u,f,o,c){return this.texture.drawFrame(l,n,u,f,o,c),this},repeat:function(l,n,u,f,o,c,d,v,m){return this.texture.repeat(l,n,u,f,o,c,d,v,m),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(l,n,u,f,o){return this.texture.batchDraw(l,n,u,f,o),this},batchDrawFrame:function(l,n,u,f,o,c){return this.texture.batchDrawFrame(l,n,u,f,o,c),this},endDraw:function(l){return this.texture.endDraw(l),this},snapshotArea:function(l,n,u,f,o,c,d){return this.texture.snapshotArea(l,n,u,f,o,c,d),this},snapshot:function(l,n,u){return this.snapshotArea(0,0,this.width,this.height,l,n,u)},snapshotPixel:function(l,n,u){return this.snapshotArea(l,n,1,1,u,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});s.exports=a},34495:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(591);p.register("renderTexture",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),o=h(l,"width",32),c=h(l,"height",32),d=new a(this.scene,u,f,o,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},60505:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(591);r.register("renderTexture",function(h,a,l,n){return this.displayList.add(new p(this.scene,h,a,l,n))})},77757:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31401),a=e(95643),l=e(36060),n=e(38745),u=e(26099),f=new p({Extends:a,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Flip,h.Mask,h.Pipeline,h.PostPipeline,h.Size,h.Texture,h.Transform,h.Visible,h.ScrollFactor,n],initialize:function(c,d,v,m,S,M,w,C,A){m===void 0&&(m="__DEFAULT"),M===void 0&&(M=2),w===void 0&&(w=!0),a.call(this,c,"Rope"),this.anims=new r(this),this.points=M,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=m==="__DEFAULT",this.dirty=!1,this.horizontal=w,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(m,S),this.setPosition(d,v),this.setSizeToFrame(),this.initPipeline(l.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(M)&&this.resizeArrays(M.length),this.setPoints(M,C,A),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(o,c){var d=this.anims.currentFrame;this.anims.update(o,c),this.anims.currentFrame!==d&&(this.updateUVs(),this.updateVertices())},play:function(o,c,d){return this.anims.play(o,c,d),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(o,c,d){return o===void 0&&(o=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(o,c,d))},setVertical:function(o,c,d){return o===void 0&&(o=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(o,c,d)):this},setTintFill:function(o){return o===void 0&&(o=!1),this.tintFill=o,this},setAlphas:function(o,c){var d=this.points.length;if(d<1)return this;var v=this.alphas;o===void 0?o=[1]:!Array.isArray(o)&&c===void 0&&(o=[o]);var m,S=0;if(c!==void 0)for(m=0;mS&&(M=o[S]),v[S]=M,o.length>S+1&&(M=o[S+1]),v[S+1]=M}return this},setColors:function(o){var c=this.points.length;if(c<1)return this;var d=this.colors;o===void 0?o=[16777215]:Array.isArray(o)||(o=[o]);var v,m=0;if(o.length===c)for(v=0;vm&&(S=o[m]),d[m]=S,o.length>m+1&&(S=o[m+1]),d[m+1]=S}return this},setPoints:function(o,c,d){if(o===void 0&&(o=2),typeof o=="number"){var v=o;v<2&&(v=2),o=[];var m,S,M;if(this.horizontal)for(M=-this.frame.halfWidth,S=this.frame.width/(v-1),m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},26209:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(35154),l=e(77757);p.register("rope",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),o=h(n,"frame",null),c=h(n,"horizontal",!0),d=a(n,"points",void 0),v=a(n,"colors",void 0),m=a(n,"alphas",void 0),S=new l(this.scene,0,0,f,o,d,c,v,m);return u!==void 0&&(n.add=u),r(this.scene,S,n),S})},96819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(77757),p=e(39429);p.register("rope",function(h,a,l,n,u,f,o,c){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c))})},38745:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(20439),h=e(95262),s.exports={renderWebGL:p,renderCanvas:h}},20439:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline,l),o=r(l,n,u).calc,c=l.vertices,d=l.uv,v=l.colors,m=l.alphas,S=l.alpha,M=p.getTintAppendFloatAlpha,w=n.roundPixels,C=c.length,A=Math.floor(C*.5);f.flush(),a.pipelines.preBatch(l);var P=f.setGameObject(l),b=f.vertexViewF32,O=f.vertexViewU32,I=f.vertexCount*f.currentShader.vertexComponentCount-1,D=0,B=l.tintFill;l.dirty&&l.updateVertices();for(var G=l.debugCallback,z=[],X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(95540),l=e(79291),n=e(61622),u=e(25479),f=e(61340),o=e(95428),c=e(92503),d=new r({Extends:h,Mixins:[p.ComputedSize,p.Depth,p.GetBounds,p.Mask,p.Origin,p.ScrollFactor,p.Transform,p.Visible,u],initialize:function(m,S,M,w,C,A,P,b){M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=128),A===void 0&&(A=128),h.call(this,m,"Shader"),this.blendMode=-1,this.shader;var O=m.sys.renderer;this.renderer=O,this.gl=O.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=O.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 f,this._tempMatrix2=new f,this._tempMatrix3=new f,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=O.width,this._rendererHeight=O.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(M,w),this.setSize(C,A),this.setOrigin(.5,.5),this.setShader(S,P,b),this.renderer.on(c.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(v){return this.renderToTexture?!0:!(h.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&v.id)},setRenderToTexture:function(v,m){if(!this.renderToTexture){var S=this.width,M=this.height,w=this.renderer;this.glTexture=w.createTextureFromSource(null,S,M,0),this.framebuffer=w.createFramebuffer(S,M,this.glTexture,!1),this._rendererWidth=S,this._rendererHeight=M,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),v&&(this.texture=this.scene.sys.textures.addGLTexture(v,this.glTexture))}return this.shader&&(w.pipelines.clear(),this.load(),this.flush(),w.pipelines.rebind()),this},setShader:function(v,m,S){if(this.renderer.contextLost)return this._deferSetShader={key:v,textures:m,textureData:S},this;if(m===void 0&&(m=[]),typeof v=="string"){var M=this.scene.sys.cache.shader;if(!M.has(v))return console.warn("Shader missing: "+v),this;this.shader=M.get(v)}else this.shader=v;var w=this.gl,C=this.renderer;this.program&&C.deleteProgram(this.program);var A=C.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);w.uniformMatrix4fv(w.getUniformLocation(A.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),w.uniformMatrix4fv(w.getUniformLocation(A.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),w.uniform2f(w.getUniformLocation(A.webGLProgram,"uResolution"),this.width,this.height),this.program=A;var P=new Date,b={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=l(!0,{},this.shader.uniforms,b):this.uniforms=b;for(var O=0;O<4;O++)m[O]&&this.setSampler2D("iChannel"+O,m[O],O,S);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(v){return this.pointer=v,this},projOrtho:function(v,m,S,M){if(this.renderer.contextLost){this._deferProjOrtho={left:v,right:m,bottom:S,top:M};return}var w=-1e3,C=1e3,A=1/(v-m),P=1/(S-M),b=1/(w-C),O=this.projectionMatrix;O[0]=-2*A,O[5]=-2*P,O[10]=2*b,O[12]=(v+m)*A,O[13]=(M+S)*P,O[14]=(C+w)*b;var I=this.program,D=this.gl,B=this.renderer;B.setProgram(I),D.uniformMatrix4fv(D.getUniformLocation(I.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=m,this._rendererHeight=S},initUniforms:function(){var v=this.renderer.glFuncMap,m=this.program;this._textureCount=0;for(var S in this.uniforms){var M=this.uniforms[S],w=M.type,C=v[w];M.uniformLocation=this.renderer.createUniformLocation(m,S),w!=="sampler2D"&&(M.glMatrix=C.matrix,M.glValueLength=C.length,M.glFunc=C.func)}},setSampler2DBuffer:function(v,m,S,M,w,C){w===void 0&&(w=0),C===void 0&&(C={});var A=this.uniforms[v];return A.value=m,C.width=S,C.height=M,A.textureData=C,this._textureCount=w,this.initSampler2D(A),this},setSampler2D:function(v,m,S,M){S===void 0&&(S=0);var w=this.scene.sys.textures;if(w.exists(m)){var C=w.getFrame(m);if(C.glTexture&&C.glTexture.isRenderTexture)return this.setSampler2DBuffer(v,C.glTexture,C.width,C.height,S,M);var A=this.uniforms[v],P=C.source;A.textureKey=m,A.source=P.image,A.value=C.glTexture,P.isGLTexture&&(M||(M={}),M.width=P.width,M.height=P.height),M&&(A.textureData=M),this._textureCount=S,this.initSampler2D(A)}return this},setUniform:function(v,m){return n(this.uniforms,v,m),this},getUniform:function(v){return a(this.uniforms,v,null)},setChannel0:function(v,m){return this.setSampler2D("iChannel0",v,0,m)},setChannel1:function(v,m){return this.setSampler2D("iChannel1",v,1,m)},setChannel2:function(v,m){return this.setSampler2D("iChannel2",v,2,m)},setChannel3:function(v,m){return this.setSampler2D("iChannel3",v,3,m)},initSampler2D:function(v){if(v.value){var m=v.textureData;if(m&&!v.value.isRenderTexture){var S=this.gl,M=v.value,w=S[a(m,"magFilter","linear").toUpperCase()],C=S[a(m,"minFilter","linear").toUpperCase()],A=S[a(m,"wrapS","repeat").toUpperCase()],P=S[a(m,"wrapT","repeat").toUpperCase()],b=S[a(m,"format","rgba").toUpperCase()],O=a(m,"flipY",!1),I=a(m,"width",M.width),D=a(m,"height",M.height),B=a(m,"source",M.pixels);m.repeat&&(A=S.REPEAT,P=S.REPEAT),m.width&&(B=null),M.update(B,I,D,O,A,P,C,w,b)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var v=this.gl,m=this.uniforms,S,M,w,C,A,P=0;for(var b in m)S=m[b],w=S.glFunc,M=S.glValueLength,C=S.uniformLocation,A=S.value,A!==null&&(M===1?S.glMatrix?w.call(v,C.webGLUniformLocation,S.transpose,A):w.call(v,C.webGLUniformLocation,A):M===2?w.call(v,C.webGLUniformLocation,A.x,A.y):M===3?w.call(v,C.webGLUniformLocation,A.x,A.y,A.z):M===4?w.call(v,C.webGLUniformLocation,A.x,A.y,A.z,A.w):S.type==="sampler2D"&&(v.activeTexture(v.TEXTURE0+P),v.bindTexture(v.TEXTURE_2D,A.webGLTexture),v.uniform1i(C.webGLUniformLocation,P),P++))},load:function(v){var m=this.gl,S=this.width,M=this.height,w=this.renderer,C=this.program,A=this.viewMatrix;if(!this.renderToTexture){var P=-this._displayOriginX,b=-this._displayOriginY;A[0]=v[0],A[1]=v[1],A[4]=v[2],A[5]=v[3],A[8]=v[4],A[9]=v[5],A[12]=A[0]*P+A[4]*b,A[13]=A[1]*P+A[5]*b}m.useProgram(C.webGLProgram),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uViewMatrix"),!1,A),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),m.uniform2f(m.getUniformLocation(C.webGLProgram,"uResolution"),this.width,this.height);var O=this.uniforms,I=O.resolution;I.value.x=S,I.value.y=M,O.time.value=w.game.loop.getDuration();var D=this.pointer;if(D){var B=O.mouse,G=D.x/S,z=1-D.y/M;B.value.x=G.toFixed(2),B.value.y=z.toFixed(2)}this.syncUniforms()},flush:function(){var v=this.width,m=this.height,S=this.program,M=this.gl,w=this.vertexBuffer,C=this.renderer,A=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(C.setFramebuffer(this.framebuffer),M.clearColor(0,0,0,0),M.clear(M.COLOR_BUFFER_BIT)),M.bindBuffer(M.ARRAY_BUFFER,w.webGLBuffer);var P=M.getAttribLocation(S.webGLProgram,"inPosition");P!==-1&&(M.enableVertexAttribArray(P),M.vertexAttribPointer(P,2,M.FLOAT,!1,A,0));var b=this.vertexViewF32;b[3]=m,b[4]=v,b[5]=m,b[8]=v,b[9]=m,b[10]=v;var O=6;M.bufferSubData(M.ARRAY_BUFFER,0,this.bytes.subarray(0,O*A)),M.drawArrays(M.TRIANGLES,0,O),this.renderToTexture&&C.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var v=this._deferSetShader.key,m=this._deferSetShader.textures,S=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(v,m,S)}if(this._deferProjOrtho!==null){var M=this._deferProjOrtho.left,w=this._deferProjOrtho.right,C=this._deferProjOrtho.bottom,A=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(M,w,C,A)}},preDestroy:function(){var v=this.renderer;v.off(c.RESTORE_WEBGL,this.onContextRestored,this),v.deleteProgram(this.program),v.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(v.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),o(this.uniforms,function(m){v.deleteUniformLocation(m.uniformLocation),m.uniformLocation=null})}});s.exports=d},80464:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},54935:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(20071);p.register("shader",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"x",0),o=h(l,"y",0),c=h(l,"width",128),d=h(l,"height",128),v=new a(this.scene,u,f,o,c,d);return n!==void 0&&(l.add=n),r(this.scene,v,l),v})},74177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20071),p=e(39429);p.register("shader",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},25479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(19257),h=e(80464),s.exports={renderWebGL:p,renderCanvas:h}},19257:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n){if(a.shader){if(l.addToRenderList(a),h.pipelines.clear(),a.renderToTexture)a.load(),a.flush();else{var u=r(a,l,n).calc;(h.width!==a._rendererWidth||h.height!==a._rendererHeight)&&a.projOrtho(0,h.width,h.height,0),a.load(u.matrix),a.flush()}h.pipelines.rebind()}};s.exports=p},10441:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n,u,f){for(var o=r.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*n),c=l.pathData,d=l.pathIndexes,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=p||r.fillColor,l=h||r.fillAlpha,n=(a&16711680)>>>16,u=(a&65280)>>>8,f=a&255;e.fillStyle="rgba("+n+","+u+","+f+","+l+")"};s.exports=y},75177:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=p||r.strokeColor,l=h||r.strokeAlpha,n=(a&16711680)>>>16,u=(a&65280)>>>8,f=a&255;e.strokeStyle="rgba("+n+","+u+","+f+","+l+")",e.lineWidth=r.lineWidth};s.exports=y},17803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(95643),a=e(23031),l=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible],initialize:function(u,f,o){f===void 0&&(f="Shape"),h.call(this,u,f),this.geom=o,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new a,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(n,u){return u===void 0&&(u=1),n===void 0?this.isFilled=!1:(this.fillColor=n,this.fillAlpha=u,this.isFilled=!0),this},setStrokeStyle:function(n,u,f){return f===void 0&&(f=1),n===void 0?this.isStroked=!1:(this.lineWidth=n,this.strokeColor=u,this.strokeAlpha=f,this.isStroked=!0),this},setClosePath:function(n){return this.closePath=n,this},setSize:function(n,u){return this.width=n,this.height=u,this},setDisplaySize:function(n,u){return this.displayWidth=n,this.displayHeight=u,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(n){this.scaleX=n/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(n){this.scaleY=n/this.height}}});s.exports=l},34682:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n,u){var f=h.strokeTint,o=r.getTintAppendFloatAlpha(a.strokeColor,a.strokeAlpha*l);f.TL=o,f.TR=o,f.BL=o,f.BR=o;var c=a.pathData,d=c.length-1,v=a.lineWidth,m=v/2,S=c[0]-n,M=c[1]-u;a.closePath||(d-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13609),p=e(83419),h=e(39506),a=e(94811),l=e(96503),n=e(36383),u=e(17803),f=new p({Extends:u,Mixins:[r],initialize:function(c,d,v,m,S,M,w,C,A){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=0),M===void 0&&(M=360),w===void 0&&(w=!1),u.call(this,c,"Arc",new l(0,0,m)),this._startAngle=S,this._endAngle=M,this._anticlockwise=w,this._iterations=.01,this.setPosition(d,v);var P=this.geom.radius*2;this.setSize(P,P),C!==void 0&&this.setFillStyle(C,A),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(o){this._iterations=o,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(o){this.geom.radius=o;var c=o*2;this.setSize(c,c),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(o){this._startAngle=o,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(o){this._endAngle=o,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(o){this._anticlockwise=o,this.updateData()}},setRadius:function(o){return this.radius=o,this},setIterations:function(o){return o===void 0&&(o=.01),this.iterations=o,this},setStartAngle:function(o,c){return this._startAngle=o,c!==void 0&&(this._anticlockwise=c),this.updateData()},setEndAngle:function(o,c){return this._endAngle=o,c!==void 0&&(this._anticlockwise=c),this.updateData()},updateData:function(){var o=this._iterations,c=o,d=this.geom.radius,v=h(this._startAngle),m=h(this._endAngle),S=this._anticlockwise,M=d,w=d;m-=v,S?m<-n.PI2?m=-n.PI2:m>0&&(m=-n.PI2+m%n.PI2):m>n.PI2?m=n.PI2:m<0&&(m=n.PI2+m%n.PI2);for(var C=[M+Math.cos(v)*d,w+Math.sin(v)*d],A;c<1;)A=m*c+v,C.push(M+Math.cos(A)*d,w+Math.sin(A)*d),c+=o;return A=m+v,C.push(M+Math.cos(A)*d,w+Math.sin(A)*d),C.push(M+Math.cos(v)*d,w+Math.sin(v)*d),this.pathIndexes=a(C),this.pathData=C,this}});s.exports=f},42542:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39506),p=e(65960),h=e(75177),a=e(20926),l=function(n,u,f,o){f.addToRenderList(u);var c=n.currentContext;if(a(n,c,u,f,o)){var d=u.radius;c.beginPath(),c.arc(d-u.originX*(d*2),d-u.originY*(d*2),d,r(u._startAngle),r(u._endAngle),u.anticlockwise),u.closePath&&c.closePath(),u.isFilled&&(p(c,u),c.fill()),u.isStroked&&(h(c,u),c.stroke()),c.restore()}};s.exports=l},42563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23629),p=e(39429);p.register("arc",function(h,a,l,n,u,f,o,c){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o,c))}),p.register("circle",function(h,a,l,n,u){return this.displayList.add(new r(this.scene,h,a,l,0,360,!1,n,u))})},13609:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(41447),h=e(42542),s.exports={renderWebGL:p,renderCanvas:h}},41447:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(10441),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&p(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},89:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(33141),h=e(94811),a=e(87841),l=e(17803),n=new r({Extends:l,Mixins:[p],initialize:function(f,o,c,d,v,m){o===void 0&&(o=0),c===void 0&&(c=0),l.call(this,f,"Curve",d),this._smoothness=32,this._curveBounds=new a,this.closePath=!1,this.setPosition(o,c),v!==void 0&&this.setFillStyle(v,m),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){var u=this._curveBounds,f=this._smoothness;this.geom.getBounds(u,f),this.setSize(u.width,u.height),this.updateDisplayOrigin();for(var o=[],c=this.geom.getPoints(f),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX+n._curveBounds.x,d=n._displayOriginY+n._curveBounds.y,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(89);r.register("curve",function(h,a,l,n,u){return this.displayList.add(new p(this.scene,h,a,l,n,u))})},33141:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(53987),h=e(3170),s.exports={renderWebGL:p,renderCanvas:h}},53987:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX+n._curveBounds.x,m=n._displayOriginY+n._curveBounds.y,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},19921:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94811),h=e(54205),a=e(8497),l=e(17803),n=new r({Extends:l,Mixins:[h],initialize:function(f,o,c,d,v,m,S){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=128),l.call(this,f,"Ellipse",new a(d/2,v/2,d,v)),this._smoothness=64,this.setPosition(o,c),this.width=d,this.height=v,m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSize:function(u,f){return this.width=u,this.height=f,this.geom.setPosition(u/2,f/2),this.geom.setSize(u,f),this.updateData()},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){for(var u=[],f=this.geom.getPoints(this._smoothness),o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19921),p=e(39429);p.register("ellipse",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},54205:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(19467),h=e(7930),s.exports={renderWebGL:p,renderCanvas:h}},19467:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},30479:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(26015),a=new r({Extends:p,Mixins:[h],initialize:function(n,u,f,o,c,d,v,m,S,M,w){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=128),c===void 0&&(c=128),d===void 0&&(d=32),v===void 0&&(v=32),p.call(this,n,"Grid",null),this.cellWidth=d,this.cellHeight=v,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(u,f),this.setSize(o,c),this.setFillStyle(m,S),M!==void 0&&this.setOutlineStyle(M,w),this.updateDisplayOrigin()},setFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showCells=!1:(this.fillColor=l,this.fillAlpha=n,this.showCells=!0),this},setAltFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showAltCells=!1:(this.altFillColor=l,this.altFillAlpha=n,this.showAltCells=!0),this},setOutlineStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showOutline=!1:(this.outlineFillColor=l,this.outlineFillAlpha=n,this.showOutline=!0),this}});s.exports=a},49912:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=-n._displayOriginX,d=-n._displayOriginY,v=u.alpha*n.alpha,m=n.width,S=n.height,M=n.cellWidth,w=n.cellHeight,C=Math.ceil(m/M),A=Math.ceil(S/w),P=M,b=w,O=M-(C*M-m),I=w-(A*w-S),D=n.showCells,B=n.showAltCells,G=n.showOutline,z=0,X=0,K=0,Q=0,tt=0;if(G&&(P--,b--,O===M&&O--,I===w&&I--),D&&n.fillAlpha>0)for(r(o,n),X=0;X0)for(r(o,n,n.altFillColor,n.altFillAlpha*v),X=0;X0){for(p(o,n,n.outlineFillColor,n.outlineFillAlpha*v),z=1;z{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(30479);r.register("grid",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c,d,v))})},26015:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(46161),h=e(49912),s.exports={renderWebGL:p,renderCanvas:h}},46161:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc);c.translate(-l._displayOriginX,-l._displayOriginY);var d=n.alpha*l.alpha,v=l.width,m=l.height,S=l.cellWidth,M=l.cellHeight,w=Math.ceil(v/S),C=Math.ceil(m/M),A=S,P=M,b=S-(w*S-v),O=M-(C*M-m),I,D,B=l.showCells,G=l.showAltCells,z=l.showOutline,X=0,K=0,Q=0,tt=0,Y=0;if(z&&(A--,P--,b===S&&b--,O===M&&O--),a.pipelines.preBatch(l),B&&l.fillAlpha>0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,K=0;K0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.altFillColor,l.altFillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,K=0;K0){var Z=f.strokeTint,U=p.getTintAppendFloatAlpha(l.outlineFillColor,l.outlineFillAlpha*d);for(Z.TL=U,Z.TR=U,Z.BL=U,Z.BR=U,X=1;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99651),p=e(83419),h=e(17803),a=new p({Extends:h,Mixins:[r],initialize:function(n,u,f,o,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=48),c===void 0&&(c=32),d===void 0&&(d=15658734),v===void 0&&(v=10066329),m===void 0&&(m=13421772),h.call(this,n,"IsoBox",null),this.projection=4,this.fillTop=d,this.fillLeft=v,this.fillRight=m,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(u,f),this.setSize(o,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});s.exports=a},11508:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)&&l.isFilled){var o=l.width,c=l.height,d=o/2,v=o/l.projection;l.showTop&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(d,-1),f.lineTo(0,v-1),f.lineTo(-d,-1),f.lineTo(-d,-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(-d,-c),f.lineTo(-d,0),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(d,-c),f.lineTo(d,0),f.fill()),f.restore()}};s.exports=h},3933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(61475);r.register("isobox",function(h,a,l,n,u,f,o){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o))})},99651:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(68149),h=e(11508),s.exports={renderWebGL:p,renderCanvas:h}},68149:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=n.alpha*l.alpha;if(l.isFilled){var w,C,A,P,b,O,I,D,B;a.pipelines.preBatch(l),l.showTop&&(w=p.getTintAppendFloatAlpha(l.fillTop,M),C=c.getX(-m,-v),A=c.getY(-m,-v),P=c.getX(0,-S-v),b=c.getY(0,-S-v),O=c.getX(m,-v),I=c.getY(m,-v),D=c.getX(0,S-v),B=c.getY(0,S-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),l.showLeft&&(w=p.getTintAppendFloatAlpha(l.fillLeft,M),C=c.getX(-m,0),A=c.getY(-m,0),P=c.getX(0,S),b=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(-m,-v),B=c.getY(-m,-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),l.showRight&&(w=p.getTintAppendFloatAlpha(l.fillRight,M),C=c.getX(m,0),A=c.getY(m,0),P=c.getX(0,S),b=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(m,-v),B=c.getY(m,-v),f.batchQuad(l,C,A,P,b,O,I,D,B,0,0,1,1,w,w,w,w,2)),a.pipelines.postBatch(l)}};s.exports=h},16933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(60561),h=e(17803),a=new r({Extends:h,Mixins:[p],initialize:function(n,u,f,o,c,d,v,m,S){u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o=48),c===void 0&&(c=32),d===void 0&&(d=!1),v===void 0&&(v=15658734),m===void 0&&(m=10066329),S===void 0&&(S=13421772),h.call(this,n,"IsoTriangle",null),this.projection=4,this.fillTop=v,this.fillLeft=m,this.fillRight=S,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=d,this.isFilled=!0,this.setPosition(u,f),this.setSize(o,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setReversed:function(l){return this.isReversed=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});s.exports=a},79590:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)&&l.isFilled){var o=l.width,c=l.height,d=o/2,v=o/l.projection,m=l.isReversed;l.showTop&&m&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(0,v-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),m?(f.moveTo(-d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),m?(f.moveTo(d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),f.restore()}};s.exports=h},49803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(16933);r.register("isotriangle",function(h,a,l,n,u,f,o,c){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c))})},60561:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(51503),h=e(79590),s.exports={renderWebGL:p,renderCanvas:h}},51503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u),c=f.calcMatrix.copyFrom(o.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=l.isReversed,w=n.alpha*l.alpha;if(l.isFilled){a.pipelines.preBatch(l);var C,A,P,b,O,I,D;if(l.showTop&&M){C=p.getTintAppendFloatAlpha(l.fillTop,w),A=c.getX(-m,-v),P=c.getY(-m,-v),b=c.getX(0,-S-v),O=c.getY(0,-S-v),I=c.getX(m,-v),D=c.getY(m,-v);var B=c.getX(0,S-v),G=c.getY(0,S-v);f.batchQuad(l,A,P,b,O,I,D,B,G,0,0,1,1,C,C,C,C,2)}l.showLeft&&(C=p.getTintAppendFloatAlpha(l.fillLeft,w),M?(A=c.getX(-m,-v),P=c.getY(-m,-v),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(A=c.getX(-m,0),P=c.getY(-m,0),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,A,P,b,O,I,D,0,0,1,1,C,C,C,2)),l.showRight&&(C=p.getTintAppendFloatAlpha(l.fillRight,w),M?(A=c.getX(m,-v),P=c.getY(m,-v),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(A=c.getX(m,0),P=c.getY(m,0),b=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,A,P,b,O,I,D,0,0,1,1,C,C,C,2)),a.pipelines.postBatch(l)}};s.exports=h},57847:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(23031),a=e(36823),l=new r({Extends:p,Mixins:[a],initialize:function(u,f,o,c,d,v,m,S,M){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=128),m===void 0&&(m=0),p.call(this,u,"Line",new h(c,d,v,m));var w=Math.max(1,this.geom.right-this.geom.left),C=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(f,o),this.setSize(w,C),S!==void 0&&this.setStrokeStyle(1,S,M),this.updateDisplayOrigin()},setLineWidth:function(n,u){return u===void 0&&(u=n),this._startWidth=n,this._endWidth=u,this.lineWidth=n,this},setTo:function(n,u,f,o){return this.geom.setTo(n,u,f,o),this}});s.exports=l},17440:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(75177),p=e(20926),h=function(a,l,n,u){n.addToRenderList(l);var f=a.currentContext;if(p(a,f,l,n,u)){var o=l._displayOriginX,c=l._displayOriginY;l.isStroked&&(r(f,l),f.beginPath(),f.moveTo(l.geom.x1-o,l.geom.y1-c),f.lineTo(l.geom.x2-o,l.geom.y2-c),f.stroke()),f.restore()}};s.exports=h},2481:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(57847);r.register("line",function(h,a,l,n,u,f,o,c){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c))})},36823:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(77385),h=e(17440),s.exports={renderWebGL:p,renderCanvas:h}},77385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(70554),h=function(a,l,n,u){n.addToRenderList(l);var f=a.pipelines.set(l.pipeline),o=r(l,n,u);f.calcMatrix.copyFrom(o.calc);var c=l._displayOriginX,d=l._displayOriginY,v=n.alpha*l.alpha;if(a.pipelines.preBatch(l),l.isStroked){var m=f.strokeTint,S=p.getTintAppendFloatAlpha(l.strokeColor,l.strokeAlpha*v);m.TL=S,m.TR=S,m.BL=S,m.BR=S,f.batchLine(l.geom.x1-c,l.geom.y1-d,l.geom.x2-c,l.geom.y2-d,l._startWidth/2,l._endWidth/2,1,0,!1,o.sprite,o.camera)}a.pipelines.postBatch(l)};s.exports=h},24949:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90273),p=e(83419),h=e(94811),a=e(13829),l=e(25717),n=e(17803),u=e(5469),f=new p({Extends:n,Mixins:[r],initialize:function(c,d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),n.call(this,c,"Polygon",new l(m));var w=a(this.geom);this.setPosition(d,v),this.setSize(w.width,w.height),S!==void 0&&this.setFillStyle(S,M),this.updateDisplayOrigin(),this.updateData()},smooth:function(o){o===void 0&&(o=1);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(24949);r.register("polygon",function(h,a,l,n,u){return this.displayList.add(new p(this.scene,h,a,l,n,u))})},90273:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(73695),h=e(38710),s.exports={renderWebGL:p,renderCanvas:h}},73695:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},74561:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87841),h=e(17803),a=e(95597),l=new r({Extends:h,Mixins:[a],initialize:function(u,f,o,c,d,v,m){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=128),d===void 0&&(d=128),h.call(this,u,"Rectangle",new p(0,0,c,d)),this.setPosition(f,o),this.setSize(c,d),v!==void 0&&this.setFillStyle(v,m),this.updateDisplayOrigin(),this.updateData()},setSize:function(n,u){this.width=n,this.height=u,this.geom.setSize(n,u),this.updateData(),this.updateDisplayOrigin();var f=this.input;return f&&!f.customHitArea&&(f.hitArea.width=n,f.hitArea.height=u),this},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),u.getLineD(f),n.push(f.x2,f.y2),this.pathData=n,this}});s.exports=l},48682:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY;n.isFilled&&(r(o,n),o.fillRect(-c,-d,n.width,n.height)),n.isStroked&&(p(o,n),o.beginPath(),o.rect(-c,-d,n.width,n.height),o.stroke()),o.restore()}};s.exports=a},87959:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(74561);r.register("rectangle",function(h,a,l,n,u,f){return this.displayList.add(new p(this.scene,h,a,l,n,u,f))})},95597:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(52059),h=e(48682),s.exports={renderWebGL:p,renderCanvas:h}},52059:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(34682),h=e(70554),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f);o.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=o.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M,o.batchFillRect(-d,-v,n.width,n.height)}n.isStroked&&p(o,n,m,d,v),l.pipelines.postBatch(n)};s.exports=a},55911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81991),p=e(83419),h=e(94811),a=e(17803),l=new p({Extends:a,Mixins:[r],initialize:function(u,f,o,c,d,v,m,S){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=5),d===void 0&&(d=32),v===void 0&&(v=64),a.call(this,u,"Star",null),this._points=c,this._innerRadius=d,this._outerRadius=v,this.setPosition(f,o),this.setSize(v*2,v*2),m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},setPoints:function(n){return this._points=n,this.updateData()},setInnerRadius:function(n){return this._innerRadius=n,this.updateData()},setOuterRadius:function(n){return this._outerRadius=n,this.updateData()},points:{get:function(){return this._points},set:function(n){this._points=n,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this.updateData()}},updateData:function(){var n=[],u=this._points,f=this._innerRadius,o=this._outerRadius,c=Math.PI/2*3,d=Math.PI/u,v=o,m=o;n.push(v,m+-o);for(var S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;o.beginPath(),o.moveTo(S,M),n.closePath||(m-=2);for(var w=2;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55911),p=e(39429);p.register("star",function(h,a,l,n,u,f,o){return this.displayList.add(new r(this.scene,h,a,l,n,u,f,o))})},81991:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(57017),h=e(64272),s.exports={renderWebGL:p,renderCanvas:h}},57017:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10441),p=e(91296),h=e(34682),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=p(n,u,f),d=o.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(o,d,n,S,v,m),n.isStroked&&h(o,n,S,v,m),l.pipelines.postBatch(n)};s.exports=a},36931:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(17803),h=e(16483),a=e(96195),l=new r({Extends:p,Mixins:[a],initialize:function(u,f,o,c,d,v,m,S,M,w,C){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=64),m===void 0&&(m=0),S===void 0&&(S=128),M===void 0&&(M=128),p.call(this,u,"Triangle",new h(c,d,v,m,S,M));var A=this.geom.right-this.geom.left,P=this.geom.bottom-this.geom.top;this.setPosition(f,o),this.setSize(A,P),w!==void 0&&this.setFillStyle(w,C),this.updateDisplayOrigin(),this.updateData()},setTo:function(n,u,f,o,c,d){return this.geom.setTo(n,u,f,o,c,d),this.updateData()},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),this.pathData=n,this}});s.exports=l},85172:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(65960),p=e(75177),h=e(20926),a=function(l,n,u,f){u.addToRenderList(n);var o=l.currentContext;if(h(l,o,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.geom.x1-c,m=n.geom.y1-d,S=n.geom.x2-c,M=n.geom.y2-d,w=n.geom.x3-c,C=n.geom.y3-d;o.beginPath(),o.moveTo(v,m),o.lineTo(S,M),o.lineTo(w,C),o.closePath(),n.isFilled&&(r(o,n),o.fill()),n.isStroked&&(p(o,n),o.stroke()),o.restore()}};s.exports=a},45245:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(36931);r.register("triangle",function(h,a,l,n,u,f,o,c,d,v){return this.displayList.add(new p(this.scene,h,a,l,n,u,f,o,c,d,v))})},96195:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(83253),h=e(85172),s.exports={renderWebGL:p,renderCanvas:h}},83253:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=e(34682),h=e(70554),a=function(l,n,u,f){u.addToRenderList(n);var o=l.pipelines.set(n.pipeline),c=r(n,u,f);o.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=o.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M;var w=n.geom.x1-d,C=n.geom.y1-v,A=n.geom.x2-d,P=n.geom.y2-v,b=n.geom.x3-d,O=n.geom.y3-v;o.batchFillTriangle(w,C,A,P,b,O,c.sprite,c.camera)}n.isStroked&&p(o,n,m,d,v),l.pipelines.postBatch(n)};s.exports=a},68287:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31401),a=e(95643),l=e(92751),n=new p({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Size,h.TextureCrop,h.Tint,h.Transform,h.Visible,l],initialize:function(f,o,c,d,v){a.call(this,f,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(d,v),this.setPosition(o,c),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(u,f){this.anims.update(u,f)},play:function(u,f){return this.anims.play(u,f)},playReverse:function(u,f){return this.anims.playReverse(u,f)},playAfterDelay:function(u,f){return this.anims.playAfterDelay(u,f)},playAfterRepeat:function(u,f){return this.anims.playAfterRepeat(u,f)},chain:function(u){return this.anims.chain(u)},stop:function(){return this.anims.stop()},stopAfterDelay:function(u){return this.anims.stopAfterDelay(u)},stopAfterRepeat:function(u){return this.anims.stopAfterRepeat(u)},stopOnFrame:function(u){return this.anims.stopOnFrame(u)},toJSON:function(){return h.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});s.exports=n},76552:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},15567:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(13059),h=e(44603),a=e(23568),l=e(68287);h.register("sprite",function(n,u){n===void 0&&(n={});var f=a(n,"key",null),o=a(n,"frame",null),c=new l(this.scene,0,0,f,o);return u!==void 0&&(n.add=u),r(this.scene,c,n),p(c,n),c})},46409:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(68287);r.register("sprite",function(h,a,l,n){return this.displayList.add(new p(this.scene,h,a,l,n))})},92751:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(9409),h=e(76552),s.exports={renderWebGL:p,renderCanvas:h}},9409:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p.addToRenderList(r),r.pipeline.batchSprite(r,p,h)};s.exports=y},14220:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.canvas,a=e.context,l=e.style,n=[],u=0,f=p.length;l.maxLines>0&&l.maxLines1&&(c+=e.letterSpacing*(p[o].length-1)),l.wordWrap&&(c-=a.measureText(" ").width),n[o]=Math.ceil(c),u=Math.max(u,n[o])}var d=r.fontSize+l.strokeThickness,v=d*f,m=e.lineSpacing;return f>1&&(v+=m*(f-1)),{width:u,height:v,lines:f,lineWidths:n,lineSpacing:m,lineHeight:d}};s.exports=y},79557:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=function(h){var a=r.create(this),l=a.getContext("2d",{willReadFrequently:!0});h.syncFont(a,l);var n=l.measureText(h.testString);if("actualBoundingBoxAscent"in n){var u=n.actualBoundingBoxAscent,f=n.actualBoundingBoxDescent;return r.remove(a),{ascent:u,descent:f,fontSize:u+f}}var o=Math.ceil(n.width*h.baselineX),c=o,d=2*c;c=c*h.baselineY|0,a.width=o,a.height=d,l.fillStyle="#f00",l.fillRect(0,0,o,d),l.font=h._font,l.textBaseline="alphabetic",l.fillStyle="#000",l.fillText(h.testString,0,c);var v={ascent:0,descent:0,fontSize:0},m=l.getImageData(0,0,o,d);if(!m)return v.ascent=c,v.descent=c+6,v.fontSize=v.ascent+v.descent,r.remove(a),v;var S=m.data,M=S.length,w=o*4,C,A,P=0,b=!1;for(C=0;Cc;C--){for(A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(40366),p=e(27919),h=e(83419),a=e(31401),l=e(95643),n=e(14220),u=e(35154),f=e(35846),o=e(61771),c=e(35762),d=e(45650),v=new h({Extends:l,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,o],initialize:function(S,M,w,C,A){M===void 0&&(M=0),w===void 0&&(w=0),l.call(this,S,"Text"),this.renderer=S.sys.renderer,this.setPosition(M,w),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=p.create(this),this.context,this.style=new c(this,A),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=d(),this.texture=S.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(C),A&&A.padding&&this.setPadding(A.padding),A&&A.lineSpacing&&this.setLineSpacing(A.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",r(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(m){var S=this.style;if(S.wordWrapCallback){var M=S.wordWrapCallback.call(S.wordWrapCallbackScope,m,this);return Array.isArray(M)&&(M=M.join(` +`)),M}else return S.wordWrapWidth?S.wordWrapUseAdvanced?this.advancedWordWrap(m,this.context,this.style.wordWrapWidth):this.basicWordWrap(m,this.context,this.style.wordWrapWidth):m},advancedWordWrap:function(m,S,M){for(var w="",C=m.replace(/ +/gi," ").split(this.splitRegExp),A=C.length,P=0;PD){if(G===0){for(var Q=X;Q.length&&(Q=Q.slice(0,-1),K=S.measureText(Q).width,!(K<=D)););if(!Q.length)throw new Error("wordWrapWidth < a single character");var tt=z.substr(Q.length);B[G]=tt,O+=Q}var Y=B[G].length?G:G+1,Z=B.slice(Y).join(" ").replace(/[ \n]*$/gi,"");C.splice(P+1,0,Z),A=C.length;break}else O+=X,D-=K}w+=O.replace(/[ \n]*$/gi,"")+` +`}return w=w.replace(/[\s|\n]*$/gi,""),w},basicWordWrap:function(m,S,M){for(var w="",C=m.split(this.splitRegExp),A=C.length-1,P=S.measureText(" ").width,b=0;b<=A;b++){for(var O=M,I=C[b].split(" "),D=I.length-1,B=0;B<=D;B++){var G=I[B],z=S.measureText(G).width,X=z;BO&&B>0&&(w+=` +`,O=M),w+=G,B0&&(z+=b.lineSpacing*X),M.rtl)G=D-G-O.left-O.right;else if(M.align==="right")G+=I-b.lineWidths[X];else if(M.align==="center")G+=(I-b.lineWidths[X])/2;else if(M.align==="justify"){var K=.85;if(b.lineWidths[X]/b.width>=K){var Q=b.width-b.lineWidths[X],tt=S.measureText(" ").width,Y=P[X].trim(),Z=Y.split(" ");Q+=(P[X].length-Y.length)*tt;for(var U=Math.floor(Q/tt),H=0;U>0;)Z[H]+=" ",H=(H+1)%(Z.length-1||1),--U;P[X]=Z.join(" ")}}if(this.autoRound&&(G=Math.round(G),z=Math.round(z)),M.strokeThickness&&(M.syncShadow(S,M.shadowStroke),S.strokeText(P[X],G,z)),M.color){M.syncShadow(S,M.shadowFill);var J=this.letterSpacing;if(J!==0)for(var _=0,q=P[X].split(""),at=0;at{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.width===0||r.height===0||(p.addToRenderList(r),e.batchSprite(r,r.frame,p,h))};s.exports=y},71259:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(50171);p.register("text",function(l,n){l===void 0&&(l={});var u=h(l,"text",""),f=h(l,"style",null),o=h(l,"padding",null);o!==null&&(f.padding=o);var c=new a(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,c,l),c.autoRound=h(l,"autoRound",!0),c.resolution=h(l,"resolution",1),c})},68005:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(50171),p=e(39429);p.register("text",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},61771:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(34397),h=e(79724),s.exports={renderWebGL:p,renderCanvas:h}},35762:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23568),h=e(35154),a=e(79557),l={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},n=new r({initialize:function(f,o){this.parent=f,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(o,!1,!0)},setStyle:function(u,f,o){f===void 0&&(f=!0),o===void 0&&(o=!1),u&&u.hasOwnProperty("fontSize")&&typeof u.fontSize=="number"&&(u.fontSize=u.fontSize.toString()+"px");for(var c in l){var d=o?l[c][1]:this[c];c==="wordWrapCallback"||c==="wordWrapCallbackScope"?this[c]=h(u,l[c][0],d):this[c]=p(u,l[c][0],d)}var v=h(u,"font",null);v!==null&&this.setFont(v,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var m=h(u,"fill",null);m!==null&&(this.color=m);var S=h(u,"metrics",!1);return S?this.metrics={ascent:h(S,"ascent",0),descent:h(S,"descent",0),fontSize:h(S,"fontSize",0)}:(f||!this.metrics)&&(this.metrics=a(this)),f?this.parent.updateText():this.parent},syncFont:function(u,f){f.font=this._font},syncStyle:function(u,f){f.textBaseline="alphabetic",f.fillStyle=this.color,f.strokeStyle=this.stroke,f.lineWidth=this.strokeThickness,f.lineCap="round",f.lineJoin="round"},syncShadow:function(u,f){f?(u.shadowOffsetX=this.shadowOffsetX,u.shadowOffsetY=this.shadowOffsetY,u.shadowColor=this.shadowColor,u.shadowBlur=this.shadowBlur):(u.shadowOffsetX=0,u.shadowOffsetY=0,u.shadowColor=0,u.shadowBlur=0)},update:function(u){return u&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=a(this)),this.parent.updateText()},setFont:function(u,f){f===void 0&&(f=!0);var o=u,c="",d="";if(typeof u!="string")o=h(u,"fontFamily","Courier"),c=h(u,"fontSize","16px"),d=h(u,"fontStyle","");else{var v=u.split(" "),m=0;d=v.length>2?v[m++]:"",c=v[m++]||"16px",o=v[m++]||"Courier"}return(o!==this.fontFamily||c!==this.fontSize||d!==this.fontStyle)&&(this.fontFamily=o,this.fontSize=c,this.fontStyle=d,f&&this.update(!0)),this.parent},setFontFamily:function(u){return this.fontFamily!==u&&(this.fontFamily=u,this.update(!0)),this.parent},setFontStyle:function(u){return this.fontStyle!==u&&(this.fontStyle=u,this.update(!0)),this.parent},setFontSize:function(u){return typeof u=="number"&&(u=u.toString()+"px"),this.fontSize!==u&&(this.fontSize=u,this.update(!0)),this.parent},setTestString:function(u){return this.testString=u,this.update(!0)},setFixedSize:function(u,f){return this.fixedWidth=u,this.fixedHeight=f,u&&(this.parent.width=u),f&&(this.parent.height=f),this.update(!1)},setBackgroundColor:function(u){return this.backgroundColor=u,this.update(!1)},setFill:function(u){return this.color=u,this.update(!1)},setColor:function(u){return this.color=u,this.update(!1)},setResolution:function(u){return this.resolution=u,this.update(!1)},setStroke:function(u,f){return f===void 0&&(f=this.strokeThickness),u===void 0&&this.strokeThickness!==0?(this.strokeThickness=0,this.update(!0)):(this.stroke!==u||this.strokeThickness!==f)&&(this.stroke=u,this.strokeThickness=f,this.update(!0)),this.parent},setShadow:function(u,f,o,c,d,v){return u===void 0&&(u=0),f===void 0&&(f=0),o===void 0&&(o="#000"),c===void 0&&(c=0),d===void 0&&(d=!1),v===void 0&&(v=!0),this.shadowOffsetX=u,this.shadowOffsetY=f,this.shadowColor=o,this.shadowBlur=c,this.shadowStroke=d,this.shadowFill=v,this.update(!1)},setShadowOffset:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this.shadowOffsetX=u,this.shadowOffsetY=f,this.update(!1)},setShadowColor:function(u){return u===void 0&&(u="#000"),this.shadowColor=u,this.update(!1)},setShadowBlur:function(u){return u===void 0&&(u=0),this.shadowBlur=u,this.update(!1)},setShadowStroke:function(u){return this.shadowStroke=u,this.update(!1)},setShadowFill:function(u){return this.shadowFill=u,this.update(!1)},setWordWrapWidth:function(u,f){return f===void 0&&(f=!1),this.wordWrapWidth=u,this.wordWrapUseAdvanced=f,this.update(!1)},setWordWrapCallback:function(u,f){return f===void 0&&(f=null),this.wordWrapCallback=u,this.wordWrapCallbackScope=f,this.update(!1)},setAlign:function(u){return u===void 0&&(u="left"),this.align=u,this.update(!1)},setMaxLines:function(u){return u===void 0&&(u=0),this.maxLines=u,this.update(!1)},getTextMetrics:function(){var u=this.metrics;return{ascent:u.ascent,descent:u.descent,fontSize:u.fontSize}},toJSON:function(){var u={};for(var f in l)u[f]=this[f];return u.metrics=this.getTextMetrics(),u},destroy:function(){this.parent=void 0}});s.exports=n},34397:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n){if(!(a.width===0||a.height===0)){l.addToRenderList(a);var u=a.frame,f=u.width,o=u.height,c=r.getTintAppendFloatAlpha,d=h.pipelines.set(a.pipeline,a),v=d.setTexture2D(u.glTexture,a);d.batchTexture(a,u.glTexture,f,o,a.x,a.y,f/a.style.resolution,o/a.style.resolution,a.scaleX,a.scaleY,a.rotation,a.flipX,a.flipY,a.scrollFactorX,a.scrollFactorY,a.displayOriginX,a.displayOriginY,0,0,f,o,c(a.tintTopLeft,l.alpha*a._alphaTL),c(a.tintTopRight,l.alpha*a._alphaTR),c(a.tintBottomLeft,l.alpha*a._alphaBL),c(a.tintBottomRight,l.alpha*a._alphaBR),a.tintFill,0,0,l,n,!1,v)}};s.exports=p},20839:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(83419),h=e(31401),a=e(95643),l=e(98439),n=e(68703),u=e(56295),f=e(45650),o=e(26099),c=8,d=new p({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Crop,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Tint,h.Transform,h.Visible,u],initialize:function(m,S,M,w,C,A,P){var b=m.sys.renderer;a.call(this,m,"TileSprite");var O=m.sys.textures.get(A),I=O.get(P);I.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),O.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),!w||!C?(w=I.width,C=I.height):(w=Math.floor(w),C=Math.floor(C)),this._tilePosition=new o,this._tileScale=new o(1,1),this.dirty=!1,this.renderer=b,this.canvas=r.create(this,w,C),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=O,this.displayFrame=I,this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=m.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=l(I.width),this.potHeight=l(I.height),this.fillCanvas=r.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(S,M),this.setSize(w,C),this.setFrame(P),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(v,m){return this.displayTexture=this.scene.sys.textures.get(v),this.setFrame(m)},setFrame:function(v){var m=this.displayTexture.get(v);return this.potWidth=l(m.width),this.potHeight=l(m.height),this.canvas.width=0,!m.cutWidth||!m.cutHeight?this.renderFlags&=~c:this.renderFlags|=c,this.displayFrame=m,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(v,m){return v!==void 0&&(this.tilePositionX=v),m!==void 0&&(this.tilePositionY=m),this},setTileScale:function(v,m){return v===void 0&&(v=this.tileScaleX),m===void 0&&(m=v),this.tileScaleX=v,this.tileScaleY=m,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var v=this.displayFrame;if(v.source.isRenderTexture||v.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var m=this.fillContext,S=this.fillCanvas,M=this.potWidth,w=this.potHeight;(!this.renderer||!this.renderer.gl)&&(M=v.cutWidth,w=v.cutHeight),m.clearRect(0,0,M,w),S.width=M,S.height=w,m.drawImage(v.source.image,v.cutX,v.cutY,v.cutWidth,v.cutHeight,0,0,M,w),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(S,this.fillPattern):this.fillPattern=m.createPattern(S,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var v=this.canvas;if((v.width!==this.width||v.height!==this.height)&&(v.width=this.width,v.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 m=this.context;this.scene.sys.game.config.antialias||n.disable(m);var S=this._tileScale.x,M=this._tileScale.y,w=this._tilePosition.x,C=this._tilePosition.y;m.clearRect(0,0,this.width,this.height),m.save(),m.scale(S,M),m.translate(-w,-C),m.fillStyle=this.fillPattern,m.fillRect(w,C,this.width/S,this.height/M),m.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),r.remove(this.canvas),r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var v=this.texture;v&&v.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(v){this._tilePosition.x=v,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(v){this._tilePosition.y=v,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(v){this._tileScale.x=v,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(v){this._tileScale.y=v,this.dirty=!0}}});s.exports=d},46992:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.updateCanvas(),p.addToRenderList(r),e.batchSprite(r,r.frame,p,h)};s.exports=y},14167:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(20839);p.register("tileSprite",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),o=h(l,"width",512),c=h(l,"height",512),d=h(l,"key",""),v=h(l,"frame",""),m=new a(this.scene,u,f,o,c,d,v);return n!==void 0&&(l.add=n),r(this.scene,m,l),m})},91681:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20839),p=e(39429);p.register("tileSprite",function(h,a,l,n,u,f){return this.displayList.add(new r(this.scene,h,a,l,n,u,f))})},56295:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(18553),h=e(46992),s.exports={renderWebGL:p,renderCanvas:h}},18553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l,n){a.updateCanvas();var u=a.width,f=a.height;if(!(u===0||f===0)){l.addToRenderList(a);var o=r.getTintAppendFloatAlpha,c=h.pipelines.set(a.pipeline,a),d=c.setTexture2D(a.fillPattern,a);c.batchTexture(a,a.fillPattern,a.displayFrame.width*a.tileScaleX,a.displayFrame.height*a.tileScaleY,a.x,a.y,u,f,a.scaleX,a.scaleY,a.rotation,a.flipX,a.flipY,a.scrollFactorX,a.scrollFactorY,a.originX*u,a.originY*f,0,0,u,f,o(a.tintTopLeft,l.alpha*a._alphaTL),o(a.tintTopRight,l.alpha*a._alphaTR),o(a.tintBottomLeft,l.alpha*a._alphaBL),o(a.tintBottomRight,l.alpha*a._alphaBR),a.tintFill,a.tilePositionX%a.displayFrame.width/a.displayFrame.width,a.tilePositionY%a.displayFrame.height/a.displayFrame.height,l,n,!1,d)}};s.exports=p},18471:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(31401),a=e(51708),l=e(8443),n=e(95643),u=e(36383),f=e(14463),o=e(45650),c=e(10247),d=new p({Extends:n,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.TextureCrop,h.Tint,h.Transform,h.Visible,c],initialize:function(m,S,M,w){n.call(this,m,"Video"),this.video,this.videoTexture,this.videoTextureSource,this.snapshotTexture,this.flipY=!1,this._key=o(),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 C=m.sys.game;this._device=C.device.video,this.setPosition(S,M),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),C.events.on(l.PAUSE,this.globalPause,this),C.events.on(l.RESUME,this.globalResume,this);var A=m.sys.sound;A&&A.on(f.GLOBAL_MUTE,this.globalMute,this),w&&this.load(w)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(v){var m=this.scene.sys.cache.video.get(v);return m?(this.cacheKey=v,this.loadHandler(m.url,m.noAudio,m.crossOrigin)):console.warn("No video in cache for key: "+v),this},changeSource:function(v,m,S,M,w){m===void 0&&(m=!0),S===void 0&&(S=!1),this.cacheKey!==v&&(this.load(v),m&&this.play(S,M,w))},getVideoKey:function(){return this.cacheKey},loadURL:function(v,m,S){m===void 0&&(m=!1);var M=this._device.getVideoURL(v);return M?(this.cacheKey="",this.loadHandler(M.url,m,S)):console.warn("No supported video format found for "+v),this},loadMediaStream:function(v,m,S){return this.loadHandler(null,m,S,v)},loadHandler:function(v,m,S,M){m||(m=!1);var w=this.video;if(w?(this.removeLoadEventHandlers(),this.stop()):(w=document.createElement("video"),w.controls=!1,w.setAttribute("playsinline","playsinline"),w.setAttribute("preload","auto"),w.setAttribute("disablePictureInPicture","true")),m?(w.muted=!0,w.defaultMuted=!0,w.setAttribute("autoplay","autoplay")):(w.muted=!1,w.defaultMuted=!1,w.removeAttribute("autoplay")),S?w.setAttribute("crossorigin",S):w.removeAttribute("crossorigin"),M)if("srcObject"in w)try{w.srcObject=M}catch(A){if(A.name!=="TypeError")throw A;w.src=URL.createObjectURL(M)}else w.src=URL.createObjectURL(M);else w.src=v;this.retry=0,this.video=w,this._playCalled=!1,w.load(),this.addLoadEventHandlers();var C=this.scene.sys.textures.get(this._key);return this.setTexture(C),this},requestVideoFrame:function(v,m){var S=this.video;if(S){var M=m.width,w=m.height,C=this.videoTexture,A=this.videoTextureSource,P=!C||A.source!==S;P?(this._codePaused=S.paused,this._codeMuted=S.muted,C?(A.source=S,A.width=M,A.height=w,C.get().setSize(M,w)):(C=this.scene.sys.textures.create(this._key,S,M,w),C.add("__BASE",0,0,0,M,w),this.setTexture(C),this.videoTexture=C,this.videoTextureSource=C.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(a.VIDEO_TEXTURE,this,C)),this.setSizeToFrame(),this.updateDisplayOrigin()):A.update(),this.isStalled=!1,this.metadata=m;var b=m.mediaTime;P&&(this._lastUpdate=b,this.emit(a.VIDEO_CREATED,this,M,w),this.frameReady||(this.frameReady=!0,this.emit(a.VIDEO_PLAY,this))),this._playingMarker?b>=this._markerOut&&(S.loop?(S.currentTime=this._markerIn,this.emit(a.VIDEO_LOOP,this)):(this.stop(!1),this.emit(a.VIDEO_COMPLETE,this))):b-1&&S>m&&S=0&&!isNaN(S)&&S>m&&(this.markers[v]=[m,S]),this},playMarker:function(v,m){var S=this.markers[v];return S&&this.play(m,S[0],S[1]),this},removeMarker:function(v){return delete this.markers[v],this},snapshot:function(v,m){return v===void 0&&(v=this.width),m===void 0&&(m=this.height),this.snapshotArea(0,0,this.width,this.height,v,m)},snapshotArea:function(v,m,S,M,w,C){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=this.width),M===void 0&&(M=this.height),w===void 0&&(w=S),C===void 0&&(C=M);var A=this.video,P=this.snapshotTexture;return P?(P.setSize(w,C),A&&P.context.drawImage(A,v,m,S,M,0,0,w,C)):(P=this.scene.sys.textures.createCanvas(o(),w,C),this.snapshotTexture=P,A&&P.context.drawImage(A,v,m,S,M,0,0,w,C)),P.update()},saveSnapshotTexture:function(v){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,v):this.snapshotTexture=this.scene.sys.textures.createCanvas(v,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(a.VIDEO_UNLOCKED,this));var v=this.scene.sys.sound;v&&v.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(v){var m=v.name;m==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(a.VIDEO_LOCKED,this)):m==="NotSupportedError"?(this.stop(!1),this.emit(a.VIDEO_UNSUPPORTED,this,v)):(this.stop(!1),this.emit(a.VIDEO_ERROR,this,v))},legacyPlayHandler:function(){var v=this.video;v&&(this.playSuccess(),v.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(a.VIDEO_PLAYING,this)},loadErrorHandler:function(v){this.stop(!1),this.emit(a.VIDEO_ERROR,this,v)},metadataHandler:function(v){this.emit(a.VIDEO_METADATA,this,v)},setSizeToFrame:function(v){v||(v=this.frame),this.width=v.realWidth,this.height=v.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var m=this.input;return m&&!m.customHitArea&&(m.hitArea.width=this.width,m.hitArea.height=this.height),this},stalledHandler:function(v){this.isStalled=!0,this.emit(a.VIDEO_STALLED,this,v)},completeHandler:function(){this._playCalled=!1,this.emit(a.VIDEO_COMPLETE,this)},preUpdate:function(v,m){var S=this.video;!S||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=m,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(v){var m=this.video;if(m){var S=m.duration;if(S!==1/0&&!isNaN(S)){var M=S*v;this.setCurrentTime(M)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(v){var m=this.video;if(m){if(typeof v=="string"){var S=v[0],M=parseFloat(v.substr(1));S==="+"?v=m.currentTime+M:S==="-"&&(v=m.currentTime-M)}m.currentTime=v}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(a.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(a.VIDEO_SEEKED,this)},getProgress:function(){var v=this.video;if(v){var m=v.duration;if(m!==1/0&&!isNaN(m))return v.currentTime/m}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(v){v===void 0&&(v=!0),this._codeMuted=v;var m=this.video;return m&&(m.muted=this._systemMuted?!0:v),this},isMuted:function(){return this._codeMuted},globalMute:function(v,m){this._systemMuted=m;var S=this.video;S&&(S.muted=this._codeMuted?!0:m)},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(v){v===void 0&&(v=!0);var m=this.video;return this._codePaused=v,m&&!m.ended&&(v?m.paused||(this.removeEventHandlers(),m.pause()):v||(this._playCalled?m.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(v){return v===void 0&&(v=1),this.video&&(this.video.volume=r(v,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(v){return this.video&&(this.video.playbackRate=v),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(v){return v===void 0&&(v=!0),this.video&&(this.video.loop=v),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(v,m){return m===void 0&&(m=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,v),this.videoTextureSource.setFlipY(m)),this._key=v,this.flipY=m,!!this.videoTexture},stop:function(v){v===void 0&&(v=!0);var m=this.video;return m&&(this.removeEventHandlers(),m.cancelVideoFrameCallback(this._rfvCallbackId),m.pause()),this.retry=0,this._playCalled=!1,v&&this.emit(a.VIDEO_STOP,this),this},removeVideoElement:function(){var v=this.video;if(v){for(v.parentNode&&v.parentNode.removeChild(v);v.hasChildNodes();)v.removeChild(v.firstChild);v.removeAttribute("autoplay"),v.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var v=this.scene.sys.game.events;v.off(l.PAUSE,this.globalPause,this),v.off(l.RESUME,this.globalResume,this);var m=this.scene.sys.sound;m&&m.off(f.GLOBAL_MUTE,this.globalMute,this)}});s.exports=d},58352:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.videoTexture&&(p.addToRenderList(r),e.batchSprite(r,r.frame,p,h))};s.exports=y},11511:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25305),p=e(44603),h=e(23568),a=e(18471);p.register("video",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=new a(this.scene,0,0,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},89025:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(18471),p=e(39429);p.register("video",function(h,a,l){return this.displayList.add(new r(this.scene,h,a,l))})},10247:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(29849),h=e(58352),s.exports={renderWebGL:p,renderCanvas:h}},29849:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r.videoTexture&&(p.addToRenderList(r),r.pipeline.batchSprite(r,p,h))};s.exports=y},41481:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(96503),h=e(87902),a=e(83419),l=e(31401),n=e(95643),u=e(87841),f=e(37303),o=new a({Extends:n,Mixins:[l.Depth,l.GetBounds,l.Origin,l.Transform,l.ScrollFactor,l.Visible],initialize:function(d,v,m,S,M){S===void 0&&(S=1),M===void 0&&(M=S),n.call(this,d,"Zone"),this.setPosition(v,m),this.width=S,this.height=M,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(c){this.scaleX=c/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(c){this.scaleY=c/this.height}},setSize:function(c,d,v){v===void 0&&(v=!0),this.width=c,this.height=d,this.updateDisplayOrigin();var m=this.input;return v&&m&&!m.customHitArea&&(m.hitArea.width=c,m.hitArea.height=d),this},setDisplaySize:function(c,d){return this.displayWidth=c,this.displayHeight=d,this},setCircleDropZone:function(c){return this.setDropZone(new p(0,0,c),h)},setRectangleDropZone:function(c,d){return this.setDropZone(new u(0,0,c,d),f)},setDropZone:function(c,d){return this.input||this.setInteractive(c,d,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(c,d,v){v.addToRenderList(d)},renderWebGL:function(c,d,v){v.addToRenderList(d)}});s.exports=o},95261:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(23568),h=e(41481);r.register("zone",function(a){var l=p(a,"x",0),n=p(a,"y",0),u=p(a,"width",1),f=p(a,"height",u);return new h(this.scene,l,n,u,f)})},84175:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41481),p=e(39429);p.register("zone",function(h,a,l,n){return this.displayList.add(new r(this.scene,h,a,l,n))})},95166:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.radius>0?Math.PI*e.radius*e.radius:0};s.exports=y},96503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87902),h=e(26241),a=e(79124),l=e(23777),n=e(28176),u=new r({initialize:function(o,c,d){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),this.type=l.CIRCLE,this.x=o,this.y=c,this._radius=d,this._diameter=d*2},contains:function(f,o){return p(this,f,o)},getPoint:function(f,o){return h(this,f,o)},getPoints:function(f,o,c){return a(this,f,o,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,o,c){return this.x=f,this.y=o,this._radius=c,this._diameter=c*2,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(f,o){return o===void 0&&(o=f),this.x=f,this.y=o,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this._diameter=f*2}},diameter:{get:function(){return this._diameter},set:function(f){this._diameter=f,this._radius=f*.5}},left:{get:function(){return this.x-this._radius},set:function(f){this.x=f+this._radius}},right:{get:function(){return this.x+this._radius},set:function(f){this.x=f-this._radius}},top:{get:function(){return this.y-this._radius},set:function(f){this.y=f+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(f){this.y=f-this._radius}}});s.exports=u},71562:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 2*(Math.PI*e.radius)};s.exports=y},92110:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){return l===void 0&&(l=new r),l.x=h.x+h.radius*Math.cos(a),l.y=h.y+h.radius*Math.sin(a),l};s.exports=p},42250:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=function(h){return new r(h.x,h.y,h.radius)};s.exports=p},87902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(e.radius>0&&r>=e.left&&r<=e.right&&p>=e.top&&p<=e.bottom){var h=(e.x-r)*(e.x-r),a=(e.y-p)*(e.y-p);return h+a<=e.radius*e.radius}else return!1};s.exports=y},5698:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},70588:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=function(h,a){return r(h,a.x,a.y)&&r(h,a.right,a.y)&&r(h,a.x,a.bottom)&&r(h,a.right,a.bottom)};s.exports=p},26394:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.radius)};s.exports=y},76278:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.radius===r.radius};s.exports=y},2074:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){return a===void 0&&(a=new r),a.x=h.left,a.y=h.top,a.width=h.diameter,a.height=h.diameter,a};s.exports=p},26241:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(92110),p=e(62945),h=e(36383),a=e(2141),l=function(n,u,f){f===void 0&&(f=new a);var o=p(u,0,h.PI2);return r(n,o,f)};s.exports=l},79124:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71562),p=e(92110),h=e(62945),a=e(36383),l=function(n,u,f,o){o===void 0&&(o=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},39212:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},28176:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=2*Math.PI*Math.random(),n=Math.random()+Math.random(),u=n>1?2-n:n,f=u*Math.cos(l),o=u*Math.sin(l);return a.x=h.x+f*h.radius,a.y=h.y+o*h.radius,a};s.exports=p},88911:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503);r.Area=e(95166),r.Circumference=e(71562),r.CircumferencePoint=e(92110),r.Clone=e(42250),r.Contains=e(87902),r.ContainsPoint=e(5698),r.ContainsRect=e(70588),r.CopyFrom=e(26394),r.Equals=e(76278),r.GetBounds=e(2074),r.GetPoint=e(26241),r.GetPoints=e(79124),r.Offset=e(50884),r.OffsetPoint=e(39212),r.Random=e(28176),s.exports=r},23777:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6};s.exports=y},78874:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.isEmpty()?0:e.getMajorRadius()*e.getMinorRadius()*Math.PI};s.exports=y},92990:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.width/2,p=e.height/2,h=Math.pow(r-p,2)/Math.pow(r+p,2);return Math.PI*(r+p)*(1+3*h/(10+Math.sqrt(4-3*h)))};s.exports=y},79522:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.width/2,u=h.height/2;return l.x=h.x+n*Math.cos(a),l.y=h.y+u*Math.sin(a),l};s.exports=p},58102:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8497),p=function(h){return new r(h.x,h.y,h.width,h.height)};s.exports=p},81154:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(e.width<=0||e.height<=0)return!1;var h=(r-e.x)/e.width,a=(p-e.y)/e.height;return h*=h,a*=a,h+a<.25};s.exports=y},46662:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81154),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},1632:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81154),p=function(h,a){return r(h,a.x,a.y)&&r(h,a.right,a.y)&&r(h,a.x,a.bottom)&&r(h,a.right,a.bottom)};s.exports=p},65534:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.width,e.height)};s.exports=y},8497:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(81154),h=e(90549),a=e(48320),l=e(23777),n=e(24820),u=new r({initialize:function(o,c,d,v){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=l.ELLIPSE,this.x=o,this.y=c,this.width=d,this.height=v},contains:function(f,o){return p(this,f,o)},getPoint:function(f,o){return h(this,f,o)},getPoints:function(f,o,c){return a(this,f,o,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,o,c,d){return this.x=f,this.y=o,this.width=c,this.height=d,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(f,o){return o===void 0&&(o=f),this.x=f,this.y=o,this},setSize:function(f,o){return o===void 0&&(o=f),this.width=f,this.height=o,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(f){this.x=f+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(f){this.x=f-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(f){this.y=f+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(f){this.y=f-this.height/2}}});s.exports=u},36146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height};s.exports=y},23694:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){return a===void 0&&(a=new r),a.x=h.left,a.y=h.top,a.width=h.width,a.height=h.height,a};s.exports=p},90549:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79522),p=e(62945),h=e(36383),a=e(2141),l=function(n,u,f){f===void 0&&(f=new a);var o=p(u,0,h.PI2);return r(n,o,f)};s.exports=l},48320:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(92990),p=e(79522),h=e(62945),a=e(36383),l=function(n,u,f,o){o===void 0&&(o=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},44808:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},24820:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return a.x=h.x+n*Math.cos(l)*h.width/2,a.y=h.y+n*Math.sin(l)*h.height/2,a};s.exports=p},49203:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8497);r.Area=e(78874),r.Circumference=e(92990),r.CircumferencePoint=e(79522),r.Clone=e(58102),r.Contains=e(81154),r.ContainsPoint=e(46662),r.ContainsRect=e(1632),r.CopyFrom=e(65534),r.Equals=e(36146),r.GetBounds=e(23694),r.GetPoint=e(90549),r.GetPoints=e(48320),r.Offset=e(73424),r.OffsetPoint=e(44808),r.Random=e(24820),s.exports=r},55738:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23777),p=e(79291),h={Circle:e(88911),Ellipse:e(49203),Intersects:e(91865),Line:e(2529),Mesh:e(73090),Point:e(43711),Polygon:e(58423),Rectangle:e(93232),Triangle:e(84435)};h=p(!1,h,r),s.exports=h},2044:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20339),p=function(h,a){return r(h.x,h.y,a.x,a.y)<=h.radius+a.radius};s.exports=p},81491:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=r.width/2,h=r.height/2,a=Math.abs(e.x-r.x-p),l=Math.abs(e.y-r.y-h),n=p+e.radius,u=h+e.radius;if(a>n||l>u)return!1;if(a<=p||l<=h)return!0;var f=a-p,o=l-h,c=f*f,d=o*o,v=e.radius*e.radius;return c+d<=v};s.exports=y},63376:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(2044),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.x,f=a.y,o=a.radius,c=l.x,d=l.y,v=l.radius,m,S,M,w,C;if(f===d)C=(v*v-o*o-c*c+u*u)/(2*(u-c)),m=1,S=-2*d,M=c*c+C*C-2*c*C+d*d-v*v,w=S*S-4*m*M,w===0?n.push(new r(C,-S/(2*m))):w>0&&(n.push(new r(C,(-S+Math.sqrt(w))/(2*m))),n.push(new r(C,(-S-Math.sqrt(w))/(2*m))));else{var A=(u-c)/(f-d),P=(v*v-o*o-c*c+u*u-d*d+f*f)/(2*(f-d));m=A*A+1,S=2*f*A-2*P*A-2*u,M=u*u+f*f+P*P-o*o-2*f*P,w=S*S-4*m*M,w===0?(C=-S/(2*m),n.push(new r(C,P-C*A))):w>0&&(C=(-S+Math.sqrt(w))/(2*m),n.push(new r(C,P-C*A)),C=(-S-Math.sqrt(w))/(2*m),n.push(new r(C,P-C*A)))}}return n};s.exports=h},97439:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4042),p=e(81491),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC(),c=l.getLineD();r(u,a,n),r(f,a,n),r(o,a,n),r(c,a,n)}return n};s.exports=h},4042:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(80462),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.x1,f=a.y1,o=a.x2,c=a.y2,d=l.x,v=l.y,m=l.radius,S=o-u,M=c-f,w=u-d,C=f-v,A=S*S+M*M,P=2*(S*w+M*C),b=w*w+C*C-m*m,O=P*P-4*A*b,I,D;if(O===0){var B=-P/(2*A);I=u+B*S,D=f+B*M,B>=0&&B<=1&&n.push(new r(I,D))}else if(O>0){var G=(-P-Math.sqrt(O))/(2*A);I=u+G*S,D=f+G*M,G>=0&&G<=1&&n.push(new r(I,D));var z=(-P+Math.sqrt(O))/(2*A);I=u+z*S,D=f+z*M,z>=0&&z<=1&&n.push(new r(I,D))}}return n};s.exports=h},36100:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=function(h,a,l,n){l===void 0&&(l=!1);var u=h.x1,f=h.y1,o=h.x2,c=h.y2,d=a.x1,v=a.y1,m=a.x2,S=a.y2,M=o-u,w=c-f,C=m-d,A=S-v,P=M*A-w*C;if(P===0)return null;var b,O,I;if(l){if(b=(M*(v-f)+w*(u-d))/(C*w-A*M),O=(d+C*b-u)/M,O<0||b<0||b>1)return null;I=O}else{if(b=((d-u)*A-(v-f)*C)/P,O=((f-v)*M-(u-d)*w)/P,b<0||b>1||O<0||O>1)return null;I=b}return n===void 0&&(n=new r),n.set(u+M*I,f+w*I,I)};s.exports=p},3073:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36100),p=e(23031),h=e(25836),a=new p,l=new h,n=function(u,f,o,c){o===void 0&&(o=!1),c===void 0&&(c=new h);var d=!1;c.set(),l.set();for(var v=f[f.length-1],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=e(61369),h=e(3073),a=new r,l=function(n,u,f,o){o===void 0&&(o=new p),Array.isArray(u)||(u=[u]);var c=!1;o.set(),a.set();for(var d=0;d{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(76112),h=e(92773),a=function(l,n,u){if(u===void 0&&(u=[]),h(l,n))for(var f=n.getLineA(),o=n.getLineB(),c=n.getLineC(),d=n.getLineD(),v=[new r,new r,new r,new r],m=[p(f,l,v[0]),p(o,l,v[1]),p(c,l,v[2]),p(d,l,v[3])],S=0;S<4;S++)m[S]&&u.push(v[S]);return u};s.exports=a},71147:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61369),p=e(56362),h=e(23031),a=new h;function l(f,o,c,d,v){var m=Math.cos(f),S=Math.sin(f);a.setTo(o,c,o+m,c+S);var M=p(a,d,!0);M&&v.push(new r(M.x,M.y,f,M.w))}function n(f,o){return f.z-o.z}var u=function(f,o,c){Array.isArray(c)||(c=[c]);for(var d=[],v=[],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(59996),h=function(a,l,n){return n===void 0&&(n=new r),p(a,l)&&(n.x=Math.max(a.x,l.x),n.y=Math.max(a.y,l.y),n.width=Math.min(a.right,l.right)-n.x,n.height=Math.min(a.bottom,l.bottom)-n.y),n};s.exports=h},52784:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60646),p=e(59996),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.getLineA(),f=a.getLineB(),o=a.getLineC(),c=a.getLineD();r(u,l,n),r(f,l,n),r(o,l,n),r(c,l,n)}return n};s.exports=h},26341:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89265),p=e(60646),h=function(a,l,n){if(n===void 0&&(n=[]),r(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC();p(u,a,n),p(f,a,n),p(o,a,n)}return n};s.exports=h},38720:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(4042),p=e(67636),h=function(a,l,n){if(n===void 0&&(n=[]),p(a,l)){var u=a.getLineA(),f=a.getLineB(),o=a.getLineC();r(u,l,n),r(f,l,n),r(o,l,n)}return n};s.exports=h},13882:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(2822),h=e(76112),a=function(l,n,u){if(u===void 0&&(u=[]),p(l,n))for(var f=l.getLineA(),o=l.getLineB(),c=l.getLineC(),d=[new r,new r,new r],v=[h(f,n,d[0]),h(o,n,d[1]),h(c,n,d[2])],m=0;m<3;m++)v[m]&&u.push(d[m]);return u};s.exports=a},75636:(s,y,e)=>{/** + * @author Florian Vazelle + * @author Geoffrey Glaive + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82944),p=e(13882),h=function(a,l,n){if(n===void 0&&(n=[]),r(a,l)){var u=l.getLineA(),f=l.getLineB(),o=l.getLineC();p(a,u,n),p(a,f,n),p(a,o,n)}return n};s.exports=h},80462:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=e(2141),h=new p,a=function(l,n,u){if(u===void 0&&(u=h),r(n,l.x1,l.y1))return u.x=l.x1,u.y=l.y1,!0;if(r(n,l.x2,l.y2))return u.x=l.x2,u.y=l.y2,!0;var f=l.x2-l.x1,o=l.y2-l.y1,c=n.x-l.x1,d=n.y-l.y1,v=f*f+o*o,m=f,S=o;if(v>0){var M=(c*f+d*o)/v;m*=M,S*=M}u.x=l.x1+m,u.y=l.y1+S;var w=m*m+S*S;return w<=v&&m*f+S*o>=0&&r(n,u.x,u.y)};s.exports=a},76112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.x1,a=e.y1,l=e.x2,n=e.y2,u=r.x1,f=r.y1,o=r.x2,c=r.y2;if(h===l&&a===n||u===o&&f===c)return!1;var d=(c-f)*(l-h)-(o-u)*(n-a);if(d===0)return!1;var v=((o-u)*(a-f)-(c-f)*(h-u))/d,m=((l-h)*(a-f)-(n-a)*(h-u))/d;return v<0||v>1||m<0||m>1?!1:(p&&(p.x=h+v*(l-h),p.y=a+v*(n-a)),!0)};s.exports=y},92773:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x1,h=e.y1,a=e.x2,l=e.y2,n=r.x,u=r.y,f=r.right,o=r.bottom,c=0;if(p>=n&&p<=f&&h>=u&&h<=o||a>=n&&a<=f&&l>=u&&l<=o)return!0;if(p=n){if(c=h+(l-h)*(n-p)/(a-p),c>u&&c<=o)return!0}else if(p>f&&a<=f&&(c=h+(l-h)*(f-p)/(a-p),c>=u&&c<=o))return!0;if(h=u){if(c=p+(a-p)*(u-h)/(l-h),c>=n&&c<=f)return!0}else if(h>o&&l<=o&&(c=p+(a-p)*(o-h)/(l-h),c>=n&&c<=f))return!0;return!1};s.exports=y},16204:s=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){p===void 0&&(p=1);var h=r.x1,a=r.y1,l=r.x2,n=r.y2,u=e.x,f=e.y,o=(l-h)*(l-h)+(n-a)*(n-a);if(o===0)return!1;var c=((u-h)*(l-h)+(f-a)*(n-a))/o;if(c<0)return Math.sqrt((h-u)*(h-u)+(a-f)*(a-f))<=p;if(c>=0&&c<=1){var d=((a-f)*(l-h)-(h-u)*(n-a))/o;return Math.abs(d)*Math.sqrt(o)<=p}else return Math.sqrt((l-u)*(l-u)+(n-f)*(n-f))<=p};s.exports=y},14199:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16204),p=function(h,a){if(!r(h,a))return!1;var l=Math.min(a.x1,a.x2),n=Math.max(a.x1,a.x2),u=Math.min(a.y1,a.y2),f=Math.max(a.y1,a.y2);return h.x>=l&&h.x<=n&&h.y>=u&&h.y<=f};s.exports=p},59996:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.width<=0||e.height<=0||r.width<=0||r.height<=0?!1:!(e.rightr.right||e.y>r.bottom)};s.exports=y},89265:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(76112),p=e(37303),h=e(48653),a=e(77493),l=function(n,u){if(u.left>n.right||u.rightn.bottom||u.bottom0};s.exports=l},84411:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){return l===void 0&&(l=0),!(r>e.right+l||pe.bottom+l||a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80462),p=e(10690),h=function(a,l){return a.left>l.right||a.rightl.bottom||a.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(76112),p=function(h,a){return!!(h.contains(a.x1,a.y1)||h.contains(a.x2,a.y2)||r(h.getLineA(),a)||r(h.getLineB(),a)||r(h.getLineC(),a))};s.exports=p},82944:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(48653),p=e(71694),h=e(76112),a=function(l,n){if(l.left>n.right||l.rightn.bottom||l.bottom0||(m=p(n),S=r(l,m,!0),S.length>0)};s.exports=a},91865:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CircleToCircle:e(2044),CircleToRectangle:e(81491),GetCircleToCircle:e(63376),GetCircleToRectangle:e(97439),GetLineToCircle:e(4042),GetLineToLine:e(36100),GetLineToPoints:e(3073),GetLineToPolygon:e(56362),GetLineToRectangle:e(60646),GetRaysFromPointToPolygon:e(71147),GetRectangleIntersection:e(68389),GetRectangleToRectangle:e(52784),GetRectangleToTriangle:e(26341),GetTriangleToCircle:e(38720),GetTriangleToLine:e(13882),GetTriangleToTriangle:e(75636),LineToCircle:e(80462),LineToLine:e(76112),LineToRectangle:e(92773),PointToLine:e(16204),PointToLineSegment:e(14199),RectangleToRectangle:e(59996),RectangleToTriangle:e(89265),RectangleToValues:e(84411),TriangleToCircle:e(67636),TriangleToLine:e(2822),TriangleToTriangle:e(82944)}},91938:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.atan2(e.y2-e.y1,e.x2-e.x1)};s.exports=y},84993:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=1),p===void 0&&(p=[]);var h=Math.round(e.x1),a=Math.round(e.y1),l=Math.round(e.x2),n=Math.round(e.y2),u=Math.abs(l-h),f=Math.abs(n-a),o=h-f&&(d-=f,h+=o),m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=r-(e.x1+e.x2)/2,a=p-(e.y1+e.y2)/2;return e.x1+=h,e.y1+=a,e.x2+=h,e.y2+=a,e};s.exports=y},31116:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23031),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2)};s.exports=p},59944:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x1,e.y1,e.x2,e.y2)};s.exports=y},59220:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x1===r.x1&&e.y1===r.y1&&e.x2===r.x2&&e.y2===r.y2};s.exports=y},78177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=function(h,a,l){l===void 0&&(l=a);var n=r(h),u=h.x2-h.x1,f=h.y2-h.y1;return a&&(h.x1=h.x1-u/n*a,h.y1=h.y1-f/n*a),l&&(h.x2=h.x2+u/n*l,h.y2=h.y2+f/n*l),h};s.exports=p},26708:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(52816),p=e(6113),h=e(2141),a=function(l,n,u,f,o){f===void 0&&(f=0),o===void 0&&(o=[]);var c=[],d=l.x1,v=l.y1,m=l.x2-d,S=l.y2-v,M=p(n,o),w,C,A=u-1;for(w=0;w0){var P=c[0],b=[P];for(w=1;w=f&&(b.push(O),P=O)}var I=c[c.length-1];return r(P,I){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=(h.x1+h.x2)/2,a.y=(h.y1+h.y2)/2,a};s.exports=p},99569:(s,y,e)=>{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.x1,u=h.y1,f=h.x2,o=h.y2,c=(f-n)*(f-n)+(o-u)*(o-u);if(c===0)return l;var d=((a.x-n)*(f-n)+(a.y-u)*(o-u))/c;return l.x=n+d*(f-n),l.y=u+d*(o-u),l};s.exports=p},34638:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=e(2141),a=function(l,n){n===void 0&&(n=new h);var u=p(l)-r.TAU;return n.x=Math.cos(u),n.y=Math.sin(u),n};s.exports=a},13151:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){return l===void 0&&(l=new r),l.x=h.x1+(h.x2-h.x1)*a,l.y=h.y1+(h.y2-h.y1)*a,l};s.exports=p},15258:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(2141),h=function(a,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=r(a)/n);for(var f=a.x1,o=a.y1,c=a.x2,d=a.y2,v=0;v{/** + * @author Richard Davey + * @author Florian Mertens + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x1,h=e.y1,a=e.x2,l=e.y2,n=(a-p)*(a-p)+(l-h)*(l-h);if(n===0)return!1;var u=((h-r.y)*(a-p)-(p-r.x)*(l-h))/n;return Math.abs(u)*Math.sqrt(n)};s.exports=y},98770:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.abs(e.y1-e.y2)};s.exports=y},35001:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt((e.x2-e.x1)*(e.x2-e.x1)+(e.y2-e.y1)*(e.y2-e.y1))};s.exports=y},23031:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(13151),h=e(15258),a=e(23777),l=e(65822),n=e(26099),u=new r({initialize:function(o,c,d,v){o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=a.LINE,this.x1=o,this.y1=c,this.x2=d,this.y2=v},getPoint:function(f,o){return p(this,f,o)},getPoints:function(f,o,c){return h(this,f,o,c)},getRandomPoint:function(f){return l(this,f)},setTo:function(f,o,c,d){return f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),this.x1=f,this.y1=o,this.x2=c,this.y2=d,this},setFromObjects:function(f,o){return this.x1=f.x,this.y1=f.y,this.x2=o.x,this.y2=o.y,this},getPointA:function(f){return f===void 0&&(f=new n),f.set(this.x1,this.y1),f},getPointB:function(f){return f===void 0&&(f=new n),f.set(this.x2,this.y2),f},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(f){this.x1<=this.x2?this.x1=f:this.x2=f}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(f){this.x1>this.x2?this.x1=f:this.x2=f}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(f){this.y1<=this.y2?this.y1=f:this.y2=f}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(f){this.y1>this.y2?this.y1=f:this.y2=f}}});s.exports=u},64795:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(15994),h=e(91938),a=function(l){var n=h(l)-r.TAU;return p(n,-Math.PI,Math.PI)};s.exports=a},52616:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=function(a){return Math.cos(p(a)-r.TAU)};s.exports=h},87231:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(91938),h=function(a){return Math.sin(p(a)-r.TAU)};s.exports=h},89662:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x1+=r,e.y1+=p,e.x2+=r,e.y2+=p,e};s.exports=y},71165:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return-((e.x2-e.x1)/(e.y2-e.y1))};s.exports=y},65822:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=Math.random();return a.x=h.x1+l*(h.x2-h.x1),a.y=h.y1+l*(h.y2-h.y1),a};s.exports=p},69777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91938),p=e(64795),h=function(a,l){return 2*p(l)-Math.PI-r(a)};s.exports=h},39706:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64400),p=function(h,a){var l=(h.x1+h.x2)/2,n=(h.y1+h.y2)/2;return r(h,l,n,a)};s.exports=p},82585:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64400),p=function(h,a,l){return r(h,a.x,a.y,l)};s.exports=p},64400:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x1-r,u=e.y1-p;return e.x1=n*a-u*l+r,e.y1=n*l+u*a+p,n=e.x2-r,u=e.y2-p,e.x2=n*a-u*l+r,e.y2=n*l+u*a+p,e};s.exports=y},62377:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return e.x1=r,e.y1=p,e.x2=r+Math.cos(h)*a,e.y2=p+Math.sin(h)*a,e};s.exports=y},71366:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e.y2-e.y1)/(e.x2-e.x1)};s.exports=y},10809:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.abs(e.x1-e.x2)};s.exports=y},2529:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23031);r.Angle=e(91938),r.BresenhamPoints=e(84993),r.CenterOn=e(36469),r.Clone=e(31116),r.CopyFrom=e(59944),r.Equals=e(59220),r.Extend=e(78177),r.GetEasedPoints=e(26708),r.GetMidPoint=e(32125),r.GetNearestPoint=e(99569),r.GetNormal=e(34638),r.GetPoint=e(13151),r.GetPoints=e(15258),r.GetShortestDistance=e(26408),r.Height=e(98770),r.Length=e(35001),r.NormalAngle=e(64795),r.NormalX=e(52616),r.NormalY=e(87231),r.Offset=e(89662),r.PerpSlope=e(71165),r.Random=e(65822),r.ReflectAngle=e(69777),r.Rotate=e(39706),r.RotateAroundPoint=e(82585),r.RotateAroundXY=e(64400),r.SetToAngle=e(62377),r.Slope=e(71366),r.Width=e(10809),s.exports=r},83997:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(87841),h=e(26099);function a(n,u,f,o){var c=n-f,d=u-o,v=c*c+d*d;return Math.sqrt(v)}var l=new r({initialize:function(u,f,o){this.vertex1=u,this.vertex2=f,this.vertex3=o,this.bounds=new p,this._inCenter=new h},getInCenter:function(n){n===void 0&&(n=!0);var u=this.vertex1,f=this.vertex2,o=this.vertex3,c,d,v,m,S,M;n?(c=u.x,d=u.y,v=f.x,m=f.y,S=o.x,M=o.y):(c=u.vx,d=u.vy,v=f.vx,m=f.vy,S=o.vx,M=o.vy);var w=a(S,M,v,m),C=a(c,d,S,M),A=a(v,m,c,d),P=w+C+A;return this._inCenter.set((c*w+v*C+S*A)/P,(d*w+m*C+M*A)/P)},contains:function(n,u,f){var o=this.vertex1,c=this.vertex2,d=this.vertex3,v=o.vx,m=o.vy,S=c.vx,M=c.vy,w=d.vx,C=d.vy;if(f){var A=f.a,P=f.b,b=f.c,O=f.d,I=f.e,D=f.f;v=o.vx*A+o.vy*b+I,m=o.vx*P+o.vy*O+D,S=c.vx*A+c.vy*b+I,M=c.vx*P+c.vy*O+D,w=d.vx*A+d.vy*b+I,C=d.vx*P+d.vy*O+D}var B=w-v,G=C-m,z=S-v,X=M-m,K=n-v,Q=u-m,tt=B*B+G*G,Y=B*z+G*X,Z=B*K+G*Q,U=z*z+X*X,H=z*K+X*Q,J=tt*U-Y*Y,_=J===0?0:1/J,q=(U*Z-Y*H)*_,at=(tt*H-Y*Z)*_;return q>=0&&at>=0&&q+at<1},isCounterClockwise:function(n){var u=this.vertex1,f=this.vertex2,o=this.vertex3,c=(f.vx-u.vx)*(o.vy-u.vy)-(f.vy-u.vy)*(o.vx-u.vx);return n<=0?c>=0:c<0},load:function(n,u,f,o,c){return f=this.vertex1.load(n,u,f,o,c),f=this.vertex2.load(n,u,f,o,c),f=this.vertex3.load(n,u,f,o,c),f},transformCoordinatesLocal:function(n,u,f,o){return this.vertex1.transformCoordinatesLocal(n,u,f,o),this.vertex2.transformCoordinatesLocal(n,u,f,o),this.vertex3.transformCoordinatesLocal(n,u,f,o),this},updateBounds:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3,o=this.bounds;return o.x=Math.min(n.vx,u.vx,f.vx),o.y=Math.min(n.vy,u.vy,f.vy),o.width=Math.max(n.vx,u.vx,f.vx)-o.x,o.height=Math.max(n.vy,u.vy,f.vy)-o.y,this},isInView:function(n,u,f,o,c,d,v,m,S,M,w){this.update(o,c,d,v,m,S,M,w);var C=this.vertex1,A=this.vertex2,P=this.vertex3;if(C.ta<=0&&A.ta<=0&&P.ta<=0||u&&!this.isCounterClockwise(f))return!1;var b=this.bounds;b.x=Math.min(C.tx,A.tx,P.tx),b.y=Math.min(C.ty,A.ty,P.ty),b.width=Math.max(C.tx,A.tx,P.tx)-b.x,b.height=Math.max(C.ty,A.ty,P.ty)-b.y;var O=n.x+n.width,I=n.y+n.height;return b.width<=0||b.height<=0||n.width<=0||n.height<=0?!1:!(b.rightO||b.y>I)},scrollUV:function(n,u){return this.vertex1.scrollUV(n,u),this.vertex2.scrollUV(n,u),this.vertex3.scrollUV(n,u),this},scaleUV:function(n,u){return this.vertex1.scaleUV(n,u),this.vertex2.scaleUV(n,u),this.vertex3.scaleUV(n,u),this},setColor:function(n){return this.vertex1.color=n,this.vertex2.color=n,this.vertex3.color=n,this},update:function(n,u,f,o,c,d,v,m){return this.vertex1.update(u,f,o,c,d,v,m,n),this.vertex2.update(u,f,o,c,d,v,m,n),this.vertex3.update(u,f,o,c,d,v,m,n),this},translate:function(n,u){u===void 0&&(u=0);var f=this.vertex1,o=this.vertex2,c=this.vertex3;return f.x+=n,f.y+=u,o.x+=n,o.y+=u,c.x+=n,c.y+=u,this},x:{get:function(){return this.getInCenter().x},set:function(n){var u=this.getInCenter();this.translate(n-u.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(n){var u=this.getInCenter();this.translate(0,n-u.y)}},alpha:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.alpha+u.alpha+f.alpha)/3},set:function(n){this.vertex1.alpha=n,this.vertex2.alpha=n,this.vertex3.alpha=n}},depth:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.vz+u.vz+f.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});s.exports=l},48803:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(95540),h=e(37867),a=e(25836),l=e(39318),n=new a,u=new a,f=new h,o=function(c){var d=p(c,"mesh"),v=p(c,"texture",null),m=p(c,"frame"),S=p(c,"width",1),M=p(c,"height",S),w=p(c,"widthSegments",1),C=p(c,"heightSegments",w),A=p(c,"x",0),P=p(c,"y",0),b=p(c,"z",0),O=p(c,"rotateX",0),I=p(c,"rotateY",0),D=p(c,"rotateZ",0),B=p(c,"zIsUp",!0),G=p(c,"isOrtho",d?d.dirtyCache[11]:!1),z=p(c,"colors",[16777215]),X=p(c,"alphas",[1]),K=p(c,"tile",!1),Q=p(c,"flipY",!1),tt=p(c,"width",null),Y={faces:[],verts:[]};n.set(A,P,b),u.set(O,I,D),f.fromRotationXYTranslation(u,n,B);var Z;if(!v&&d)v=d.texture,m||(Z=d.frame);else if(d&&typeof v=="string")v=d.scene.sys.textures.get(v);else if(!v)return Y;Z||(Z=v.get(m)),!tt&&G&&v&&d&&(S=Z.width/d.height,M=Z.height/d.height);var U=S/2,H=M/2,J=Math.floor(w),_=Math.floor(C),q=J+1,at=_+1,ot=S/J,rt=M/_,gt=[],yt=[],Et,At,Pt=0,Vt=1,dt=0,ut=1;Z&&(Pt=Z.u0,Vt=Z.u1,Q?(dt=Z.v1,ut=Z.v0):(dt=Z.v0,ut=Z.v1));var Rt=Vt-Pt,Dt=ut-dt;for(At=0;At{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(37867),h=e(25836),a=e(39318),l=new h,n=new h,u=new p,f=function(o,c,d,v,m,S,M,w,C,A){d===void 0&&(d=1),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=0),A===void 0&&(A=!0);var P={faces:[],verts:[]},b=o.materials;l.set(v,m,S),n.set(M,w,C),u.fromRotationXYTranslation(n,l,A);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83997),p=e(39318),h=function(a,l,n,u,f,o,c,d){if(u===void 0&&(u=!1),o===void 0&&(o=16777215),c===void 0&&(c=1),d===void 0&&(d=!1),a.length!==l.length&&!u){console.warn("GenerateVerts: vertices and uvs count not equal");return}var v={faces:[],vertices:[]},m,S,M,w,C,A,P,b,O,I,D,B=u?3:2,G=Array.isArray(o),z=Array.isArray(c);if(Array.isArray(n)&&n.length>0)for(m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=!0,e="untitled",r="",p="";function h(S){var M=S.indexOf("#");return M>-1?S.substring(0,M):S}function a(S){return S.models.length===0&&S.models.push({faces:[],name:e,textureCoords:[],vertexNormals:[],vertices:[]}),r="",S.models[S.models.length-1]}function l(S,M){var w=S.length>=2?S[1]:e;M.models.push({faces:[],name:w,textureCoords:[],vertexNormals:[],vertices:[]}),r=""}function n(S){S.length===2&&(r=S[1])}function u(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;a(M).vertices.push({x:C,y:A,z:P})}function f(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;isNaN(C)&&(C=0),isNaN(A)&&(A=0),isNaN(P)&&(P=0),y&&(A=1-A),a(M).textureCoords.push({u:C,v:A,w:P})}function o(S,M){var w=S.length,C=w>=2?parseFloat(S[1]):0,A=w>=3?parseFloat(S[2]):0,P=w>=4?parseFloat(S[3]):0;a(M).vertexNormals.push({x:C,y:A,z:P})}function c(S,M){var w=S.length-1;if(!(w<3)){for(var C={group:r,material:p,vertices:[]},A=0;A3)){var I=0,D=0,B=0;I=parseInt(b[0],10),O>1&&b[1]!==""&&(D=parseInt(b[1],10)),O>2&&(B=parseInt(b[2],10)),I!==0&&(I<0&&(I=a(M).vertices.length+1+I),D-=1,I-=1,B-=1,C.vertices.push({textureCoordsIndex:D,vertexIndex:I,vertexNormalIndex:B}))}}a(M).faces.push(C)}}function d(S,M){S.length>=2&&M.materialLibraries.push(S[1])}function v(S){S.length>=2&&(p=S[1])}var m=function(S,M){M===void 0&&(M=!0),y=M;var w={materials:{},materialLibraries:[],models:[]};r="",p="";for(var C=S.split(` +`),A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37589),p=function(h){for(var a={},l=h.split(` +`),n="",u=0;u=2?Math.floor(o[2]*255):c,v=o.length>=3?Math.floor(o[3]*255):c;a[n]=r(c,d,v);break}}}}return a};s.exports=p},92570:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a,l;if(p===void 0&&h===void 0){var n=e.getInCenter();a=n.x,l=n.y}var u=Math.cos(r),f=Math.sin(r),o=e.vertex1,c=e.vertex2,d=e.vertex3,v=o.x-a,m=o.y-l;o.set(v*u-m*f+a,v*f+m*u+l),v=c.x-a,m=c.y-l,c.set(v*u-m*f+a,v*f+m*u+l),v=d.x-a,m=d.y-l,d.set(v*u-m*f+a,v*f+m*u+l)};s.exports=y},39318:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(70554),h=e(25836),a=new r({Extends:h,initialize:function(n,u,f,o,c,d,v,m,S,M){d===void 0&&(d=16777215),v===void 0&&(v=1),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),h.call(this,n,u,f),this.vx=0,this.vy=0,this.vz=0,this.nx=m,this.ny=S,this.nz=M,this.u=o,this.v=c,this.color=d,this.alpha=v,this.tx=0,this.ty=0,this.ta=0,this.tu=o,this.tv=c},setUVs:function(l,n){return this.u=l,this.v=n,this.tu=l,this.tv=n,this},scrollUV:function(l,n){return this.tu+=l,this.tv+=n,this},scaleUV:function(l,n){return this.tu=this.u*l,this.tv=this.v*n,this},transformCoordinatesLocal:function(l,n,u,f){var o=this.x,c=this.y,d=this.z,v=l.val,m=o*v[0]+c*v[4]+d*v[8]+v[12],S=o*v[1]+c*v[5]+d*v[9]+v[13],M=o*v[2]+c*v[6]+d*v[10]+v[14],w=o*v[3]+c*v[7]+d*v[11]+v[15];this.vx=m/w*n,this.vy=-(S/w)*u,f<=0?this.vz=M/w:this.vz=-(M/w)},resize:function(l,n,u,f,o,c){return this.x=l,this.y=n,this.vx=this.x*u,this.vy=-this.y*f,this.vz=0,o<.5?this.vx+=u*(.5-o):o>.5&&(this.vx-=u*(o-.5)),c<.5?this.vy+=f*(.5-c):c>.5&&(this.vy-=f*(c-.5)),this},update:function(l,n,u,f,o,c,d,v){var m=this.vx*l+this.vy*u+o,S=this.vx*n+this.vy*f+c;return d&&(m=Math.round(m),S=Math.round(S)),this.tx=m,this.ty=S,this.ta=this.alpha*v,this},load:function(l,n,u,f,o){return l[++u]=this.tx,l[++u]=this.ty,l[++u]=this.tu,l[++u]=this.tv,l[++u]=f,l[++u]=o,n[++u]=p.getTintAppendFloatAlpha(this.color,this.ta),u}});s.exports=a},73090:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Face:e(83997),GenerateGridVerts:e(48803),GenerateObjVerts:e(34684),GenerateVerts:e(92515),ParseObj:e(85048),ParseObjMaterial:e(61485),RotateFace:e(92570),Vertex:e(39318)};s.exports=r},96550:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(Math.ceil(e.x),Math.ceil(e.y))};s.exports=y},99706:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h){return new r(h.x,h.y)};s.exports=p},68010:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y)};s.exports=y},27814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y};s.exports=y},73565:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(Math.floor(e.x),Math.floor(e.y))};s.exports=y},87555:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){if(a===void 0&&(a=new r),!Array.isArray(h))throw new Error("GetCentroid points argument must be an array");var l=h.length;if(l<1)throw new Error("GetCentroid points array must not be empty");if(l===1)a.x=h[0].x,a.y=h[0].y;else{for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)};s.exports=y},44405:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x*e.x+e.y*e.y};s.exports=y},20873:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){a===void 0&&(a=new r);for(var l=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,o=0;ol&&(l=c.x),c.xu&&(u=c.y),c.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l,n){return l===void 0&&(l=0),n===void 0&&(n=new r),n.x=h.x+(a.x-h.x)*l,n.y=h.y+(a.y-h.y)*l,n};s.exports=p},55767:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.setTo(e.y,e.x)};s.exports=y},79432:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.setTo(-h.x,-h.y)};s.exports=p},2141:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23777),h=new r({initialize:function(l,n){l===void 0&&(l=0),n===void 0&&(n=l),this.type=p.POINT,this.x=l,this.y=n},setTo:function(a,l){return a===void 0&&(a=0),l===void 0&&(l=a),this.x=a,this.y=l,this}});s.exports=h},72930:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(44405),h=function(a,l,n){n===void 0&&(n=new r);var u=a.x*l.x+a.y*l.y,f=u/p(l);return f!==0&&(n.x=f*l.x,n.y=f*l.y),n};s.exports=h},62880:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a,l){l===void 0&&(l=new r);var n=h.x*a.x+h.y*a.y;return n!==0&&(l.x=n*a.x,l.y=n*a.y),l};s.exports=p},15093:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28793),p=function(h,a){if(h.x!==0||h.y!==0){var l=r(h);h.x/=l,h.y/=l}return h.x*=a,h.y*=a,h};s.exports=p},43711:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141);r.Ceil=e(96550),r.Clone=e(99706),r.CopyFrom=e(68010),r.Equals=e(27814),r.Floor=e(73565),r.GetCentroid=e(87555),r.GetMagnitude=e(28793),r.GetMagnitudeSq=e(44405),r.GetRectangleFromPoints=e(20873),r.Interpolate=e(26152),r.Invert=e(55767),r.Negative=e(79432),r.Project=e(72930),r.ProjectUnit=e(62880),r.SetMagnitude=e(15093),s.exports=r},12306:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25717),p=function(h){return new r(h.points)};s.exports=p},63814:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=!1,a=-1,l=e.points.length-1;++a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63814),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},94811:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(Y,Z,U){U=U||2;var H=Z&&Z.length,J=H?Z[0]*U:Y.length,_=e(Y,0,J,U,!0),q=[];if(!_||_.next===_.prev)return q;var at,ot,rt,gt,yt,Et,At;if(H&&(_=u(Y,Z,_,U)),Y.length>80*U){at=rt=Y[0],ot=gt=Y[1];for(var Pt=U;Ptrt&&(rt=yt),Et>gt&&(gt=Et);At=Math.max(rt-at,gt-ot),At=At!==0?32767/At:0}return p(_,q,U,at,ot,At,0),q}function e(Y,Z,U,H,J){var _,q;if(J===tt(Y,Z,U,H)>0)for(_=Z;_=Z;_-=H)q=X(_,Y[_],Y[_+1],q);return q&&P(q,q.next)&&(K(q),q=q.next),q}function r(Y,Z){if(!Y)return Y;Z||(Z=Y);var U=Y,H;do if(H=!1,!U.steiner&&(P(U,U.next)||A(U.prev,U,U.next)===0)){if(K(U),U=Z=U.prev,U===U.next)break;H=!0}else U=U.next;while(H||U!==Z);return Z}function p(Y,Z,U,H,J,_,q){if(Y){!q&&_&&v(Y,H,J,_);for(var at=Y,ot,rt;Y.prev!==Y.next;){if(ot=Y.prev,rt=Y.next,_?a(Y,H,J,_):h(Y)){Z.push(ot.i/U|0),Z.push(Y.i/U|0),Z.push(rt.i/U|0),K(Y),Y=rt.next,at=rt.next;continue}if(Y=rt,Y===at){q?q===1?(Y=l(r(Y),Z,U),p(Y,Z,U,H,J,_,2)):q===2&&n(Y,Z,U,H,J,_):p(r(Y),Z,U,H,J,_,1);break}}}}function h(Y){var Z=Y.prev,U=Y,H=Y.next;if(A(Z,U,H)>=0)return!1;for(var J=Z.x,_=U.x,q=H.x,at=Z.y,ot=U.y,rt=H.y,gt=J<_?J_?J>q?J:q:_>q?_:q,At=at>ot?at>rt?at:rt:ot>rt?ot:rt,Pt=H.next;Pt!==Z;){if(Pt.x>=gt&&Pt.x<=Et&&Pt.y>=yt&&Pt.y<=At&&w(J,at,_,ot,q,rt,Pt.x,Pt.y)&&A(Pt.prev,Pt,Pt.next)>=0)return!1;Pt=Pt.next}return!0}function a(Y,Z,U,H){var J=Y.prev,_=Y,q=Y.next;if(A(J,_,q)>=0)return!1;for(var at=J.x,ot=_.x,rt=q.x,gt=J.y,yt=_.y,Et=q.y,At=atot?at>rt?at:rt:ot>rt?ot:rt,dt=gt>yt?gt>Et?gt:Et:yt>Et?yt:Et,ut=S(At,Pt,Z,U,H),Rt=S(Vt,dt,Z,U,H),Dt=Y.prevZ,Ht=Y.nextZ;Dt&&Dt.z>=ut&&Ht&&Ht.z<=Rt;){if(Dt.x>=At&&Dt.x<=Vt&&Dt.y>=Pt&&Dt.y<=dt&&Dt!==J&&Dt!==q&&w(at,gt,ot,yt,rt,Et,Dt.x,Dt.y)&&A(Dt.prev,Dt,Dt.next)>=0||(Dt=Dt.prevZ,Ht.x>=At&&Ht.x<=Vt&&Ht.y>=Pt&&Ht.y<=dt&&Ht!==J&&Ht!==q&&w(at,gt,ot,yt,rt,Et,Ht.x,Ht.y)&&A(Ht.prev,Ht,Ht.next)>=0))return!1;Ht=Ht.nextZ}for(;Dt&&Dt.z>=ut;){if(Dt.x>=At&&Dt.x<=Vt&&Dt.y>=Pt&&Dt.y<=dt&&Dt!==J&&Dt!==q&&w(at,gt,ot,yt,rt,Et,Dt.x,Dt.y)&&A(Dt.prev,Dt,Dt.next)>=0)return!1;Dt=Dt.prevZ}for(;Ht&&Ht.z<=Rt;){if(Ht.x>=At&&Ht.x<=Vt&&Ht.y>=Pt&&Ht.y<=dt&&Ht!==J&&Ht!==q&&w(at,gt,ot,yt,rt,Et,Ht.x,Ht.y)&&A(Ht.prev,Ht,Ht.next)>=0)return!1;Ht=Ht.nextZ}return!0}function l(Y,Z,U){var H=Y;do{var J=H.prev,_=H.next.next;!P(J,_)&&b(J,H,H.next,_)&&B(J,_)&&B(_,J)&&(Z.push(J.i/U|0),Z.push(H.i/U|0),Z.push(_.i/U|0),K(H),K(H.next),H=Y=_),H=H.next}while(H!==Y);return r(H)}function n(Y,Z,U,H,J,_){var q=Y;do{for(var at=q.next.next;at!==q.prev;){if(q.i!==at.i&&C(q,at)){var ot=z(q,at);q=r(q,q.next),ot=r(ot,ot.next),p(q,Z,U,H,J,_,0),p(ot,Z,U,H,J,_,0);return}at=at.next}q=q.next}while(q!==Y)}function u(Y,Z,U,H){var J=[],_,q,at,ot,rt;for(_=0,q=Z.length;_=U.next.y&&U.next.y!==U.y){var at=U.x+(J-U.y)*(U.next.x-U.x)/(U.next.y-U.y);if(at<=H&&at>_&&(_=at,q=U.x=U.x&&U.x>=rt&&H!==U.x&&w(Jq.x||U.x===q.x&&d(q,U)))&&(q=U,yt=Et)),U=U.next;while(U!==ot);return q}function d(Y,Z){return A(Y.prev,Y,Z.prev)<0&&A(Z.next,Y,Y.next)<0}function v(Y,Z,U,H){var J=Y;do J.z===0&&(J.z=S(J.x,J.y,Z,U,H)),J.prevZ=J.prev,J.nextZ=J.next,J=J.next;while(J!==Y);J.prevZ.nextZ=null,J.prevZ=null,m(J)}function m(Y){var Z,U,H,J,_,q,at,ot,rt=1;do{for(U=Y,Y=null,_=null,q=0;U;){for(q++,H=U,at=0,Z=0;Z0||ot>0&&H;)at!==0&&(ot===0||!H||U.z<=H.z)?(J=U,U=U.nextZ,at--):(J=H,H=H.nextZ,ot--),_?_.nextZ=J:Y=J,J.prevZ=_,_=J;U=H}_.nextZ=null,rt*=2}while(q>1);return Y}function S(Y,Z,U,H,J){return Y=(Y-U)*J|0,Z=(Z-H)*J|0,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,Z=(Z|Z<<8)&16711935,Z=(Z|Z<<4)&252645135,Z=(Z|Z<<2)&858993459,Z=(Z|Z<<1)&1431655765,Y|Z<<1}function M(Y){var Z=Y,U=Y;do(Z.x=(Y-q)*(_-at)&&(Y-q)*(H-at)>=(U-q)*(Z-at)&&(U-q)*(_-at)>=(J-q)*(H-at)}function C(Y,Z){return Y.next.i!==Z.i&&Y.prev.i!==Z.i&&!D(Y,Z)&&(B(Y,Z)&&B(Z,Y)&&G(Y,Z)&&(A(Y.prev,Y,Z.prev)||A(Y,Z.prev,Z))||P(Y,Z)&&A(Y.prev,Y,Y.next)>0&&A(Z.prev,Z,Z.next)>0)}function A(Y,Z,U){return(Z.y-Y.y)*(U.x-Z.x)-(Z.x-Y.x)*(U.y-Z.y)}function P(Y,Z){return Y.x===Z.x&&Y.y===Z.y}function b(Y,Z,U,H){var J=I(A(Y,Z,U)),_=I(A(Y,Z,H)),q=I(A(U,H,Y)),at=I(A(U,H,Z));return!!(J!==_&&q!==at||J===0&&O(Y,U,Z)||_===0&&O(Y,H,Z)||q===0&&O(U,Y,H)||at===0&&O(U,Z,H))}function O(Y,Z,U){return Z.x<=Math.max(Y.x,U.x)&&Z.x>=Math.min(Y.x,U.x)&&Z.y<=Math.max(Y.y,U.y)&&Z.y>=Math.min(Y.y,U.y)}function I(Y){return Y>0?1:Y<0?-1:0}function D(Y,Z){var U=Y;do{if(U.i!==Y.i&&U.next.i!==Y.i&&U.i!==Z.i&&U.next.i!==Z.i&&b(U,U.next,Y,Z))return!0;U=U.next}while(U!==Y);return!1}function B(Y,Z){return A(Y.prev,Y,Y.next)<0?A(Y,Z,Y.next)>=0&&A(Y,Y.prev,Z)>=0:A(Y,Z,Y.prev)<0||A(Y,Y.next,Z)<0}function G(Y,Z){var U=Y,H=!1,J=(Y.x+Z.x)/2,_=(Y.y+Z.y)/2;do U.y>_!=U.next.y>_&&U.next.y!==U.y&&J<(U.next.x-U.x)*(_-U.y)/(U.next.y-U.y)+U.x&&(H=!H),U=U.next;while(U!==Y);return H}function z(Y,Z){var U=new Q(Y.i,Y.x,Y.y),H=new Q(Z.i,Z.x,Z.y),J=Y.next,_=Z.prev;return Y.next=Z,Z.prev=Y,U.next=J,J.prev=U,H.next=U,U.prev=H,_.next=H,H.prev=_,H}function X(Y,Z,U,H){var J=new Q(Y,Z,U);return H?(J.next=H.next,J.prev=H,H.next.prev=J,H.next=J):(J.prev=J,J.next=J),J}function K(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function Q(Y,Z,U){this.i=Y,this.x=Z,this.y=U,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}y.deviation=function(Y,Z,U,H){var J=Z&&Z.length,_=J?Z[0]*U:Y.length,q=Math.abs(tt(Y,0,_,U));if(J)for(var at=0,ot=Z.length;at0&&(H+=Y[J-1].length,U.holes.push(H))}return U},s.exports=y},13829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a){a===void 0&&(a=new r);for(var l=1/0,n=1/0,u=-l,f=-n,o,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=[]);for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(23031),h=e(30052),a=function(l,n,u,f){f===void 0&&(f=[]);var o=l.points,c=h(l);!n&&u>0&&(n=c/u);for(var d=0;dm+A){m+=A;continue}var P=C.getPoint((v-m)/A);f.push(P);break}return f};s.exports=a},30052:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(23031),h=function(a){for(var l=a.points,n=0,u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(63814),h=e(9564),a=e(23777),l=new r({initialize:function(u){this.type=a.POLYGON,this.area=0,this.points=[],u&&this.setTo(u)},contains:function(n,u){return p(this,n,u)},setTo:function(n){if(this.area=0,this.points=[],typeof n=="string"&&(n=n.split(" ")),!Array.isArray(n))return this;for(var u,f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.points.reverse(),e};s.exports=y},29524:s=>{function y(l,n){var u=l.x-n.x,f=l.y-n.y;return u*u+f*f}function e(l,n,u){var f=n.x,o=n.y,c=u.x-f,d=u.y-o;if(c!==0||d!==0){var v=((l.x-f)*c+(l.y-o)*d)/(c*c+d*d);v>1?(f=u.x,o=u.y):v>0&&(f+=c*v,o+=d*v)}return c=l.x-f,d=l.y-o,c*c+d*d}function r(l,n){for(var u=l[0],f=[u],o,c=1,d=l.length;cn&&(f.push(o),u=o);return u!==o&&f.push(o),f}function p(l,n,u,f,o){for(var c=f,d,v=n+1;vc&&(d=v,c=m)}c>f&&(d-n>1&&p(l,n,d,f,o),o.push(l[d]),u-d>1&&p(l,d,u,f,o))}function h(l,n){var u=l.length-1,f=[l[0]];return p(l,0,u,n,f),f.push(l[u]),f}var a=function(l,n,u){n===void 0&&(n=1),u===void 0&&(u=!1);var f=l.points;if(f.length>2){var o=n*n;u||(f=r(f,o)),l.setTo(h(f,o))}return l};s.exports=a},5469:s=>{/** + * @author Richard Davey + * @author Igor Ognichenko + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(r,p){return r[0]=p[0],r[1]=p[1],r},e=function(r){var p,h=[],a=r.points;for(p=0;p0&&l.push(y([0,0],h[0])),p=0;p1&&l.push(y([0,0],h[h.length-1])),r.setTo(l)};s.exports=e},24709:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){for(var h=e.points,a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25717);r.Clone=e(12306),r.Contains=e(63814),r.ContainsPoint=e(99338),r.Earcut=e(94811),r.GetAABB=e(13829),r.GetNumberArray=e(26173),r.GetPoints=e(9564),r.Perimeter=e(30052),r.Reverse=e(8133),r.Simplify=e(29524),r.Smooth=e(5469),r.Translate=e(24709),s.exports=r},62224:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.width*e.height};s.exports=y},98615:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e};s.exports=y},31688:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.ceil(e.x),e.y=Math.ceil(e.y),e.width=Math.ceil(e.width),e.height=Math.ceil(e.height),e};s.exports=y},67502:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x=r-e.width/2,e.y=p-e.height/2,e};s.exports=y},65085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h){return new r(h.x,h.y,h.width,h.height)};s.exports=p},37303:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.width<=0||e.height<=0?!1:e.x<=r&&e.x+e.width>=r&&e.y<=p&&e.y+e.height>=p};s.exports=y},96553:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37303),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},70273:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.width*r.height>e.width*e.height?!1:r.x>e.x&&r.xe.x&&r.righte.y&&r.ye.y&&r.bottom{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x,e.y,e.width,e.height)};s.exports=y},77493:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=[]),r.push({x:e.x,y:e.y}),r.push({x:e.right,y:e.y}),r.push({x:e.right,y:e.bottom}),r.push({x:e.x,y:e.bottom}),r};s.exports=y},9219:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height};s.exports=y},53751:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8249),p=function(h,a){var l=r(h);return l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(8249),p=function(h,a){var l=r(h);return l>r(a)?h.setSize(a.height*l,a.height):h.setSize(a.width,a.width/l),h.setPosition(a.centerX-h.width/2,a.centerY-h.height/2)};s.exports=p},80774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.floor(e.x),e.y=Math.floor(e.y),e};s.exports=y},83859:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height),e};s.exports=y},19217:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(36383),h=function(a,l){if(l===void 0&&(l=new r),a.length===0)return l;for(var n=Number.MAX_VALUE,u=Number.MAX_VALUE,f=p.MIN_SAFE_INTEGER,o=p.MIN_SAFE_INTEGER,c,d,v,m=0;m{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a,l,n,u){return u===void 0&&(u=new r),u.setTo(Math.min(h,l),Math.min(a,n),Math.abs(h-l),Math.abs(a-n))};s.exports=p},8249:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.height===0?NaN:e.width/e.height};s.exports=y},27165:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.centerX,a.y=h.centerY,a};s.exports=p},20812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13019),p=e(2141),h=function(a,l,n){if(n===void 0&&(n=new p),l<=0||l>=1)return n.x=a.x,n.y=a.y,n;var u=r(a)*l;return l>.5?(u-=a.width+a.height,u<=a.width?(n.x=a.right-u,n.y=a.bottom):(n.x=a.x,n.y=a.bottom-(u-a.width))):u<=a.width?(n.x=a.x+u,n.y=a.y):(n.x=a.right,n.y=a.y+(u-a.width)),n};s.exports=h},34819:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20812),p=e(13019),h=function(a,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=p(a)/n);for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.width,a.y=h.height,a};s.exports=p},86091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(67502),p=function(h,a,l){var n=h.centerX,u=h.centerY;return h.setSize(h.width+a*2,h.height+l*2),r(h,n,u)};s.exports=p},53951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(59996),h=function(a,l,n){return n===void 0&&(n=new r),p(a,l)?(n.x=Math.max(a.x,l.x),n.y=Math.max(a.y,l.y),n.width=Math.min(a.right,l.right)-n.x,n.height=Math.min(a.bottom,l.bottom)-n.y):n.setEmpty(),n};s.exports=h},14649:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13019),p=e(2141),h=function(a,l,n,u){if(u===void 0&&(u=[]),!l&&!n)return u;l?n=Math.round(r(a)/l):l=r(a)/n;for(var f=a.x,o=a.y,c=0,d=0;d=a.right&&(c=1,o+=f-a.right,f=a.right);break;case 1:o+=l,o>=a.bottom&&(c=2,f-=o-a.bottom,o=a.bottom);break;case 2:f-=l,f<=a.left&&(c=3,o-=a.left-f,f=a.left);break;case 3:o-=l,o<=a.top&&(c=0,o=a.top);break}return u};s.exports=h},33595:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=e.x,h=e.right,a=e.y,l=e.bottom,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=Math.min(e.x,r.x),h=Math.max(e.right,r.right);e.x=p,e.width=h-p;var a=Math.min(e.y,r.y),l=Math.max(e.bottom,r.bottom);return e.y=a,e.height=l-a,e};s.exports=y},92171:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=Math.min(e.x,r),a=Math.max(e.right,r);e.x=h,e.width=a-h;var l=Math.min(e.y,p),n=Math.max(e.bottom,p);return e.y=l,e.height=n-l,e};s.exports=y},42981:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x+=r,e.y+=p,e};s.exports=y},46907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x+=r.x,e.y+=r.y,e};s.exports=y},60170:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.xr.x&&e.yr.y};s.exports=y},13019:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 2*(e.width+e.height)};s.exports=y},85133:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(39506),h=function(a,l,n){n===void 0&&(n=new r),l=p(l);var u=Math.sin(l),f=Math.cos(l),o=f>0?a.width/2:a.width/-2,c=u>0?a.height/2:a.height/-2;return Math.abs(o*u){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=h.x+Math.random()*h.width,a.y=h.y+Math.random()*h.height,a};s.exports=p},86470:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(70273),h=e(2141),a=function(l,n,u){if(u===void 0&&(u=new h),p(l,n))switch(r(0,3)){case 0:u.x=l.x+Math.random()*(n.right-l.x),u.y=l.y+Math.random()*(n.top-l.y);break;case 1:u.x=n.x+Math.random()*(l.right-n.x),u.y=n.bottom+Math.random()*(l.bottom-n.bottom);break;case 2:u.x=l.x+Math.random()*(n.x-l.x),u.y=n.y+Math.random()*(l.bottom-n.y);break;case 3:u.x=n.right+Math.random()*(l.right-n.right),u.y=l.y+Math.random()*(n.bottom-l.y);break}return u};s.exports=a},87841:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37303),h=e(20812),a=e(34819),l=e(23777),n=e(23031),u=e(26597),f=new r({initialize:function(c,d,v,m){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),this.type=l.RECTANGLE,this.x=c,this.y=d,this.width=v,this.height=m},contains:function(o,c){return p(this,o,c)},getPoint:function(o,c){return h(this,o,c)},getPoints:function(o,c,d){return a(this,o,c,d)},getRandomPoint:function(o){return u(this,o)},setTo:function(o,c,d,v){return this.x=o,this.y=c,this.width=d,this.height=v,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(o,c){return c===void 0&&(c=o),this.x=o,this.y=c,this},setSize:function(o,c){return c===void 0&&(c=o),this.width=o,this.height=c,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(o){return o===void 0&&(o=new n),o.setTo(this.x,this.y,this.right,this.y),o},getLineB:function(o){return o===void 0&&(o=new n),o.setTo(this.right,this.y,this.right,this.bottom),o},getLineC:function(o){return o===void 0&&(o=new n),o.setTo(this.right,this.bottom,this.x,this.bottom),o},getLineD:function(o){return o===void 0&&(o=new n),o.setTo(this.x,this.bottom,this.x,this.y),o},left:{get:function(){return this.x},set:function(o){o>=this.right?this.width=0:this.width=this.right-o,this.x=o}},right:{get:function(){return this.x+this.width},set:function(o){o<=this.x?this.width=0:this.width=o-this.x}},top:{get:function(){return this.y},set:function(o){o>=this.bottom?this.height=0:this.height=this.bottom-o,this.y=o}},bottom:{get:function(){return this.y+this.height},set:function(o){o<=this.y?this.height=0:this.height=o-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(o){this.x=o-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(o){this.y=o-this.height/2}}});s.exports=f},94845:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.width===r.width&&e.height===r.height};s.exports=y},31730:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=r),e.width*=r,e.height*=p,e};s.exports=y},36899:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=function(h,a,l){l===void 0&&(l=new r);var n=Math.min(h.x,a.x),u=Math.min(h.y,a.y),f=Math.max(h.right,a.right)-n,o=Math.max(h.bottom,a.bottom)-u;return l.setTo(n,u,f,o)};s.exports=p},93232:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841);r.Area=e(62224),r.Ceil=e(98615),r.CeilAll=e(31688),r.CenterOn=e(67502),r.Clone=e(65085),r.Contains=e(37303),r.ContainsPoint=e(96553),r.ContainsRect=e(70273),r.CopyFrom=e(43459),r.Decompose=e(77493),r.Equals=e(9219),r.FitInside=e(53751),r.FitOutside=e(16088),r.Floor=e(80774),r.FloorAll=e(83859),r.FromPoints=e(19217),r.FromXY=e(9477),r.GetAspectRatio=e(8249),r.GetCenter=e(27165),r.GetPoint=e(20812),r.GetPoints=e(34819),r.GetSize=e(51313),r.Inflate=e(86091),r.Intersection=e(53951),r.MarchingAnts=e(14649),r.MergePoints=e(33595),r.MergeRect=e(20074),r.MergeXY=e(92171),r.Offset=e(42981),r.OffsetPoint=e(46907),r.Overlaps=e(60170),r.Perimeter=e(13019),r.PerimeterPoint=e(85133),r.Random=e(26597),r.RandomOutside=e(86470),r.SameDimensions=e(94845),r.Scale=e(31730),r.Union=e(36899),s.exports=r},41658:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.x1,p=e.y1,h=e.x2,a=e.y2,l=e.x3,n=e.y3;return Math.abs(((l-r)*(a-p)-(h-r)*(n-p))/2)};s.exports=y},39208:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h,a,l){var n=l*(Math.sqrt(3)/2),u=h,f=a,o=h+l/2,c=a+n,d=h-l/2,v=a+n;return new r(u,f,o,c,d,v)};s.exports=p},39545:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(94811),p=e(16483),h=function(a,l,n,u,f){l===void 0&&(l=null),n===void 0&&(n=1),u===void 0&&(u=1),f===void 0&&(f=[]);for(var o=r(a,l),c,d,v,m,S,M,w,C,A,P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h,a,l,n){n===void 0&&(n=l);var u=h,f=a,o=h,c=a-n,d=h+l,v=a;return new r(u,f,o,c,d,v)};s.exports=p},23707:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97523),p=e(13584),h=function(a,l,n,u){u===void 0&&(u=r);var f=u(a),o=l-f.x,c=n-f.y;return p(a,o,c)};s.exports=h},97523:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){return a===void 0&&(a=new r),a.x=(h.x1+h.x2+h.x3)/3,a.y=(h.y1+h.y2+h.y3)/3,a};s.exports=p},24951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099);function p(a,l,n,u){return a*u-l*n}var h=function(a,l){l===void 0&&(l=new r);var n=a.x3,u=a.y3,f=a.x1-n,o=a.y1-u,c=a.x2-n,d=a.y2-u,v=2*p(f,o,c,d),m=p(o,f*f+o*o,d,c*c+d*d),S=p(f,f*f+o*o,c,c*c+d*d);return l.x=n-m/v,l.y=u+S/v,l};s.exports=h},85614:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=function(h,a){a===void 0&&(a=new r);var l=h.x1,n=h.y1,u=h.x2,f=h.y2,o=h.x3,c=h.y3,d=u-l,v=f-n,m=o-l,S=c-n,M=d*(l+u)+v*(n+f),w=m*(l+o)+S*(n+c),C=2*(d*(c-f)-v*(o-u)),A,P;if(Math.abs(C)<1e-6){var b=Math.min(l,u,o),O=Math.min(n,f,c);A=(Math.max(l,u,o)-b)*.5,P=(Math.max(n,f,c)-O)*.5,a.x=b+A,a.y=O+P,a.radius=Math.sqrt(A*A+P*P)}else a.x=(S*M-v*w)/C,a.y=(d*w-m*M)/C,A=a.x-l,P=a.y-n,a.radius=Math.sqrt(A*A+P*P);return a};s.exports=p},74422:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2,h.x3,h.y3)};s.exports=p},10690:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.x3-e.x1,a=e.y3-e.y1,l=e.x2-e.x1,n=e.y2-e.y1,u=r-e.x1,f=p-e.y1,o=h*h+a*a,c=h*l+a*n,d=h*u+a*f,v=l*l+n*n,m=l*u+n*f,S=o*v-c*c,M=S===0?0:1/S,w=(v*d-c*m)*M,C=(o*m-c*d)*M;return w>=0&&C>=0&&w+C<1};s.exports=y},48653:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=!1),h===void 0&&(h=[]);for(var a=e.x3-e.x1,l=e.y3-e.y1,n=e.x2-e.x1,u=e.y2-e.y1,f=a*a+l*l,o=a*n+l*u,c=n*n+u*u,d=f*c-o*o,v=d===0?0:1/d,m,S,M,w,C,A,P=e.x1,b=e.y1,O=0;O=0&&S>=0&&m+S<1&&(h.push({x:r[O].x,y:r[O].y}),p)));O++);return h};s.exports=y},96006:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10690),p=function(h,a){return r(h,a.x,a.y)};s.exports=p},71326:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.setTo(e.x1,e.y1,e.x2,e.y2,e.x3,e.y3)};s.exports=y},71694:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=[]),r.push({x:e.x1,y:e.y1}),r.push({x:e.x2,y:e.y2}),r.push({x:e.x3,y:e.y3}),r};s.exports=y},33522:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.x1===r.x1&&e.y1===r.y1&&e.x2===r.x2&&e.y2===r.y2&&e.x3===r.x3&&e.y3===r.y3};s.exports=y},20437:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=e(35001),h=function(a,l,n){n===void 0&&(n=new r);var u=a.getLineA(),f=a.getLineB(),o=a.getLineC();if(l<=0||l>=1)return n.x=u.x1,n.y=u.y1,n;var c=p(u),d=p(f),v=p(o),m=c+d+v,S=m*l,M=0;return Sc+d?(S-=c+d,M=S/v,n.x=o.x1+(o.x2-o.x1)*M,n.y=o.y1+(o.y2-o.y1)*M):(S-=c,M=S/d,n.x=f.x1+(f.x2-f.x1)*M,n.y=f.y1+(f.y2-f.y1)*M),n};s.exports=h},80672:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=e(2141),h=function(a,l,n,u){u===void 0&&(u=[]);var f=a.getLineA(),o=a.getLineB(),c=a.getLineC(),d=r(f),v=r(o),m=r(c),S=d+v+m;!l&&n>0&&(l=S/n);for(var M=0;Md+v?(w-=d+v,C=w/m,A.x=c.x1+(c.x2-c.x1)*C,A.y=c.y1+(c.y2-c.y1)*C):(w-=d,C=w/v,A.x=o.x1+(o.x2-o.x1)*C,A.y=o.y1+(o.y2-o.y1)*C),u.push(A)}return u};s.exports=h},39757:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141);function p(a,l,n,u){var f=a-n,o=l-u,c=f*f+o*o;return Math.sqrt(c)}var h=function(a,l){l===void 0&&(l=new r);var n=a.x1,u=a.y1,f=a.x2,o=a.y2,c=a.x3,d=a.y3,v=p(c,d,f,o),m=p(n,u,c,d),S=p(f,o,n,u),M=v+m+S;return l.x=(n*v+f*m+c*S)/M,l.y=(u*v+o*m+d*S)/M,l};s.exports=h},13584:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e.x1+=r,e.y1+=p,e.x2+=r,e.y2+=p,e.x3+=r,e.y3+=p,e};s.exports=y},1376:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35001),p=function(h){var a=h.getLineA(),l=h.getLineB(),n=h.getLineC();return r(a)+r(l)+r(n)};s.exports=p},90260:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2141),p=function(h,a){a===void 0&&(a=new r);var l=h.x2-h.x1,n=h.y2-h.y1,u=h.x3-h.x1,f=h.y3-h.y1,o=Math.random(),c=Math.random();return o+c>=1&&(o=1-o,c=1-c),a.x=h.x1+(l*o+u*c),a.y=h.y1+(n*o+f*c),a};s.exports=p},52172:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99614),p=e(39757),h=function(a,l){var n=p(a);return r(a,n.x,n.y,l)};s.exports=h},49907:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99614),p=function(h,a,l){return r(h,a.x,a.y,l)};s.exports=p},99614:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x1-r,u=e.y1-p;return e.x1=n*a-u*l+r,e.y1=n*l+u*a+p,n=e.x2-r,u=e.y2-p,e.x2=n*a-u*l+r,e.y2=n*l+u*a+p,n=e.x3-r,u=e.y3-p,e.x3=n*a-u*l+r,e.y3=n*l+u*a+p,e};s.exports=y},16483:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(10690),h=e(20437),a=e(80672),l=e(23777),n=e(23031),u=e(90260),f=new r({initialize:function(c,d,v,m,S,M){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),this.type=l.TRIANGLE,this.x1=c,this.y1=d,this.x2=v,this.y2=m,this.x3=S,this.y3=M},contains:function(o,c){return p(this,o,c)},getPoint:function(o,c){return h(this,o,c)},getPoints:function(o,c,d){return a(this,o,c,d)},getRandomPoint:function(o){return u(this,o)},setTo:function(o,c,d,v,m,S){return o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),this.x1=o,this.y1=c,this.x2=d,this.y2=v,this.x3=m,this.y3=S,this},getLineA:function(o){return o===void 0&&(o=new n),o.setTo(this.x1,this.y1,this.x2,this.y2),o},getLineB:function(o){return o===void 0&&(o=new n),o.setTo(this.x2,this.y2,this.x3,this.y3),o},getLineC:function(o){return o===void 0&&(o=new n),o.setTo(this.x3,this.y3,this.x1,this.y1),o},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(o){var c=0;this.x1<=this.x2&&this.x1<=this.x3?c=this.x1-o:this.x2<=this.x1&&this.x2<=this.x3?c=this.x2-o:c=this.x3-o,this.x1-=c,this.x2-=c,this.x3-=c}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(o){var c=0;this.x1>=this.x2&&this.x1>=this.x3?c=this.x1-o:this.x2>=this.x1&&this.x2>=this.x3?c=this.x2-o:c=this.x3-o,this.x1-=c,this.x2-=c,this.x3-=c}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(o){var c=0;this.y1<=this.y2&&this.y1<=this.y3?c=this.y1-o:this.y2<=this.y1&&this.y2<=this.y3?c=this.y2-o:c=this.y3-o,this.y1-=c,this.y2-=c,this.y3-=c}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(o){var c=0;this.y1>=this.y2&&this.y1>=this.y3?c=this.y1-o:this.y2>=this.y1&&this.y2>=this.y3?c=this.y2-o:c=this.y3-o,this.y1-=c,this.y2-=c,this.y3-=c}}});s.exports=f},84435:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(16483);r.Area=e(41658),r.BuildEquilateral=e(39208),r.BuildFromPolygon=e(39545),r.BuildRight=e(90301),r.CenterOn=e(23707),r.Centroid=e(97523),r.CircumCenter=e(24951),r.CircumCircle=e(85614),r.Clone=e(74422),r.Contains=e(10690),r.ContainsArray=e(48653),r.ContainsPoint=e(96006),r.CopyFrom=e(71326),r.Decompose=e(71694),r.Equals=e(33522),r.GetPoint=e(20437),r.GetPoints=e(80672),r.InCenter=e(39757),r.Perimeter=e(1376),r.Offset=e(13584),r.Random=e(90260),r.Rotate=e(52172),r.RotateAroundPoint=e(49907),r.RotateAroundXY=e(99614),s.exports=r},74457:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return{gameObject:e,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:r,hitAreaCallback:p,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}};s.exports=y},84409:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return function(p,h,a,l){var n=e.getPixelAlpha(h,a,l.texture.key,l.frame.name);return n&&n>=r}};s.exports=y},7003:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(93301),h=e(50792),a=e(8214),l=e(8443),n=e(78970),u=e(85098),f=e(42515),o=e(36210),c=e(61340),d=e(85955),v=new r({initialize:function(S,M){this.game=S,this.scaleManager,this.canvas,this.config=M,this.enabled=!0,this.events=new h,this.isOver=!0,this.defaultCursor="",this.keyboard=M.inputKeyboard?new n(this):null,this.mouse=M.inputMouse?new u(this):null,this.touch=M.inputTouch?new o(this):null,this.pointers=[],this.pointersTotal=M.inputActivePointers,M.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var w=0;w<=this.pointersTotal;w++){var C=new f(this,w);C.smoothFactor=M.inputSmoothFactor,this.pointers.push(C)}this.mousePointer=M.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 c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],S.events.once(l.BOOT,this.boot,this)},boot:function(){var m=this.game,S=m.events;this.canvas=m.canvas,this.scaleManager=m.scale,this.events.emit(a.MANAGER_BOOT),S.on(l.PRE_RENDER,this.preRender,this),S.once(l.DESTROY,this.destroy,this)},setCanvasOver:function(m){this.isOver=!0,this.events.emit(a.GAME_OVER,m)},setCanvasOut:function(m){this.isOver=!1,this.events.emit(a.GAME_OUT,m)},preRender:function(){var m=this.game.loop.now,S=this.game.loop.delta,M=this.game.scene.getScenes(!0,!0);this.time=m,this.events.emit(a.MANAGER_UPDATE);for(var w=0;w10&&(m=10-this.pointersTotal);for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(96503),p=e(87902),h=e(83419),a=e(93301),l=e(74457),n=e(84409),u=e(20339),f=e(8497),o=e(81154),c=e(8214),d=e(50792),v=e(95540),m=e(23777),S=e(89639),M=e(41212),w=e(37277),C=e(87841),A=e(37303),P=e(44594),b=e(16483),O=e(10690),I=new h({Extends:d,initialize:function(B){d.call(this),this.scene=B,this.systems=B.sys,this.settings=B.sys.settings,this.manager=B.sys.game.input,this.pluginEvents=new d,this.enabled=!0,this.displayList,this.cameras,S.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var G={cancelled:!1};this._eventContainer={stopPropagation:function(){G.cancelled=!0}},this._eventData=G,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(c.BOOT)},start:function(){var D=this.systems.events;D.on(P.TRANSITION_START,this.transitionIn,this),D.on(P.TRANSITION_OUT,this.transitionOut,this),D.on(P.TRANSITION_COMPLETE,this.transitionComplete,this),D.on(P.PRE_UPDATE,this.preUpdate,this),D.once(P.SHUTDOWN,this.shutdown,this),this.manager.events.on(c.GAME_OUT,this.onGameOut,this),this.manager.events.on(c.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(c.START)},onGameOver:function(D){this.isActive()&&this.emit(c.GAME_OVER,D.timeStamp,D)},onGameOut:function(D){this.isActive()&&this.emit(c.GAME_OUT,D.timeStamp,D)},preUpdate:function(){this.pluginEvents.emit(c.PRE_UPDATE);var D=this._pendingRemoval,B=this._pendingInsertion,G=D.length,z=B.length;if(!(G===0&&z===0)){for(var X=this._list,K=0;K-1&&(X.splice(tt,1),this.clear(Q,!0))}this._pendingRemoval.length=0,this._list=X.concat(B.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(D,B){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,D,B),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var G,z=this.manager,X=z.pointers,K=z.pointersTotal;for(G=0;G0)if(this._pollTimer-=B,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var tt=!1;for(G=0;G0&&(tt=!0)}return tt},update:function(D,B){if(!this.isActive())return!1;for(var G=B.length,z=!1,X=0;X0&&(z=!0)}return this._updatedThisFrame=!0,z},clear:function(D,B){B===void 0&&(B=!1),this.disable(D);var G=D.input;G&&(this.removeDebug(D),this.manager.resetCursor(G),G.gameObject=void 0,G.target=void 0,G.hitArea=void 0,G.hitAreaCallback=void 0,G.callbackContext=void 0,D.input=null),B||this.queueForRemoval(D);var z=this._draggable.indexOf(D);return z>-1&&this._draggable.splice(z,1),D},disable:function(D){var B=D.input;B&&(B.enabled=!1,B.dragState=0);for(var G=this._drag,z=this._over,X=this.manager,K=0,Q;K-1&&G[K].splice(Q,1),Q=z[K].indexOf(D),Q>-1&&z[K].splice(Q,1);return this},enable:function(D,B,G,z){return z===void 0&&(z=!1),D.input?D.input.enabled=!0:this.setHitArea(D,B,G),D.input&&z&&!D.input.dropZone&&(D.input.dropZone=z),this},hitTestPointer:function(D){for(var B=this.cameras.getCamerasBelowPointer(D),G=0;G0)return D.camera=z,X}return D.camera=B[0],[]},processDownEvents:function(D){var B=0,G=this._temp,z=this._eventData,X=this._eventContainer;z.cancelled=!1;for(var K=!1,Q=0;Q0&&u(D.x,D.y,D.downX,D.downY)>=X||z>0&&B>=D.downTime+z)&&(G=!0),G)return this.setDragState(D,3),this.processDragStartList(D)},processDragStartList:function(D){if(this.getDragState(D)!==3)return 0;for(var B=this._drag[D.id],G=0;G1&&(this.sortGameObjects(G,D),this.topOnly&&G.splice(1)),this._drag[D.id]=G,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(D,3),this.processDragStartList(D)):(this.setDragState(D,2),0))},processDragMoveEvent:function(D){if(this.getDragState(D)===2&&this.processDragThresholdEvent(D,this.manager.game.loop.now),this.getDragState(D)!==4)return 0;for(var B=this._tempZones,G=this._drag[D.id],z=0;z0?(X.emit(c.GAMEOBJECT_DRAG_LEAVE,D,Q),this.emit(c.DRAG_LEAVE,D,X,Q),K.target=B[0],Q=K.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q)):(X.emit(c.GAMEOBJECT_DRAG_LEAVE,D,Q),this.emit(c.DRAG_LEAVE,D,X,Q),B[0]?(K.target=B[0],Q=K.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q)):K.target=null)}else!Q&&B[0]&&(K.target=B[0],Q=K.target,X.emit(c.GAMEOBJECT_DRAG_ENTER,D,Q),this.emit(c.DRAG_ENTER,D,X,Q));var Y,Z;if(!X.parentContainer)Y=D.worldX-K.dragX,Z=D.worldY-K.dragY;else{var U=D.worldX-K.dragStartXGlobal,H=D.worldY-K.dragStartYGlobal,J=X.getParentRotation(),_=U*Math.cos(J)+H*Math.sin(J),q=H*Math.cos(J)-U*Math.sin(J);_*=1/X.parentContainer.scaleX,q*=1/X.parentContainer.scaleY,Y=_+K.dragStartX,Z=q+K.dragStartY}X.emit(c.GAMEOBJECT_DRAG,D,Y,Z),this.emit(c.DRAG,D,X,Y,Z)}return G.length},processDragUpEvent:function(D){for(var B=this._drag[D.id],G=0;G0){var K=this.manager,Q=this._eventData,tt=this._eventContainer;Q.cancelled=!1;for(var Y=!1,Z=0;Z0){var X=this.manager,K=this._eventData,Q=this._eventContainer;K.cancelled=!1;var tt=!1;this.sortGameObjects(B,D);for(var Y=0;Y0){for(this.sortGameObjects(X,D),G=0;G0){for(this.sortGameObjects(K,D),G=0;G-1&&this._draggable.splice(X,1)}return this},makePixelPerfect:function(D){D===void 0&&(D=1);var B=this.systems.textures;return n(B,D)},setHitArea:function(D,B,G){if(B===void 0)return this.setHitAreaFromTexture(D);Array.isArray(D)||(D=[D]);var z=!1,X=!1,K=!1,Q=!1,tt=!1,Y=!0;if(M(B)&&Object.keys(B).length){var Z=B,U=D.some(function(at){return at.hasOwnProperty("faces")});if(!U){B=v(Z,"hitArea",null),G=v(Z,"hitAreaCallback",null),tt=v(Z,"pixelPerfect",!1);var H=v(Z,"alphaTolerance",1);tt&&(B={},G=this.makePixelPerfect(H))}z=v(Z,"draggable",!1),X=v(Z,"dropZone",!1),K=v(Z,"cursor",!1),Q=v(Z,"useHandCursor",!1),(!B||!G)&&(this.setHitAreaFromTexture(D),Y=!1)}else typeof B=="function"&&!G&&(G=B,B={});for(var J=0;J{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p={},h={};h.register=function(a,l,n,u,f){p[a]={plugin:l,mapping:n,settingsKey:u,configKey:f}},h.getPlugin=function(a){return p[a]},h.install=function(a){var l=a.scene.sys,n=l.settings.input,u=l.game.config;for(var f in p){var o=p[f].plugin,c=p[f].mapping,d=p[f].settingsKey,v=p[f].configKey;r(n,d,u[v])&&(a[c]=new o(a))}},h.remove=function(a){p.hasOwnProperty(a)&&delete p[a]},s.exports=h},42515:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31040),p=e(83419),h=e(20339),a=e(43855),l=e(47235),n=e(26099),u=e(25892),f=new p({initialize:function(c,d){this.manager=c,this.id=d,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new n,this.prevPosition=new n,this.midPoint=new n(-1,-1),this.velocity=new n,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=d===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(o){var c=o.getWorldPoint(this.x,this.y);return this.worldX=c.x,this.worldY=c.y,this},positionToCamera:function(o,c){return o.getWorldPoint(this.x,this.y,c)},updateMotion:function(){var o=this.position.x,c=this.position.y,d=this.midPoint.x,v=this.midPoint.y;if(!(o===d&&c===v)){var m=l(this.motionFactor,d,o),S=l(this.motionFactor,v,c);a(m,o,.1)&&(m=o),a(S,c,.1)&&(S=c),this.midPoint.set(m,S);var M=o-m,w=c-S;this.velocity.set(M,w),this.angle=r(m,S,o,c),this.distance=Math.sqrt(M*M+w*w)}},up:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.button=o.button,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),o.button===0&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),this.buttons===0&&(this.isDown=!1,this.upTime=o.timeStamp,this.wasTouch=!1)},down:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.button=o.button,this.downElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),o.button===0&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),u.macOS&&o.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=o.timeStamp),this.wasTouch=!1},move:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.manager.transformPointer(this,o.pageX,o.pageY,!0),this.locked&&(this.movementX=o.movementX||o.mozMovementX||o.webkitMovementX||0,this.movementY=o.movementY||o.mozMovementY||o.webkitMovementY||0),this.moveTime=o.timeStamp,this.wasTouch=!1},wheel:function(o){"buttons"in o&&(this.buttons=o.buttons),this.event=o,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.deltaX=o.deltaX,this.deltaY=o.deltaY,this.deltaZ=o.deltaZ,this.wasTouch=!1},touchstart:function(o,c){o.pointerId&&(this.pointerId=o.pointerId),this.identifier=o.identifier,this.target=o.target,this.active=!0,this.buttons=1,this.event=c,this.downElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=c.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(o,c){this.event=c,this.manager.transformPointer(this,o.pageX,o.pageY,!0),this.moveTime=c.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(o,c){this.buttons=0,this.event=c,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=c.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(o,c){this.buttons=0,this.event=c,this.upElement=o.target,this.manager.transformPointer(this,o.pageX,o.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=c.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?h(this.downX,this.downY,this.x,this.y):h(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?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(o,c){o===void 0&&(o=10),c===void 0&&(c=[]);for(var d=this.prevPosition.x,v=this.prevPosition.y,m=this.position.x,S=this.position.y,M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8};s.exports=y},7179:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},85375:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},39843:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},23388:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragenter"},16133:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},27829:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragleave"},53904:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragover"},56058:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},2642:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drop"},88171:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectdown"},36147:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},71692:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragenter"},96149:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},81285:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragleave"},74048:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragover"},21322:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},49378:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drop"},86754:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectmove"},86433:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectout"},60709:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectover"},24081:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdown"},11172:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointermove"},18907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerout"},95579:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerover"},35368:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerup"},26972:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wheel"},47078:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectup"},73802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameobjectwheel"},56718:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameout"},25936:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="gameover"},27503:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},50852:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="process"},96438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},59152:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerlockchange"},47777:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdown"},27957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerdownoutside"},19444:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointermove"},54251:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerout"},18667:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerover"},27192:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerup"},24652:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pointerupoutside"},45132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wheel"},44512:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="preupdate"},15757:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="shutdown"},41637:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},93802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},8214:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BOOT:e(7179),DESTROY:e(85375),DRAG_END:e(39843),DRAG_ENTER:e(23388),DRAG:e(16133),DRAG_LEAVE:e(27829),DRAG_OVER:e(53904),DRAG_START:e(56058),DROP:e(2642),GAME_OUT:e(56718),GAME_OVER:e(25936),GAMEOBJECT_DOWN:e(88171),GAMEOBJECT_DRAG_END:e(36147),GAMEOBJECT_DRAG_ENTER:e(71692),GAMEOBJECT_DRAG:e(96149),GAMEOBJECT_DRAG_LEAVE:e(81285),GAMEOBJECT_DRAG_OVER:e(74048),GAMEOBJECT_DRAG_START:e(21322),GAMEOBJECT_DROP:e(49378),GAMEOBJECT_MOVE:e(86754),GAMEOBJECT_OUT:e(86433),GAMEOBJECT_OVER:e(60709),GAMEOBJECT_POINTER_DOWN:e(24081),GAMEOBJECT_POINTER_MOVE:e(11172),GAMEOBJECT_POINTER_OUT:e(18907),GAMEOBJECT_POINTER_OVER:e(95579),GAMEOBJECT_POINTER_UP:e(35368),GAMEOBJECT_POINTER_WHEEL:e(26972),GAMEOBJECT_UP:e(47078),GAMEOBJECT_WHEEL:e(73802),MANAGER_BOOT:e(27503),MANAGER_PROCESS:e(50852),MANAGER_UPDATE:e(96438),POINTER_DOWN:e(47777),POINTER_DOWN_OUTSIDE:e(27957),POINTER_MOVE:e(19444),POINTER_OUT:e(54251),POINTER_OVER:e(18667),POINTER_UP:e(27192),POINTER_UP_OUTSIDE:e(24652),POINTER_WHEEL:e(45132),POINTERLOCK_CHANGE:e(59152),PRE_UPDATE:e(44512),SHUTDOWN:e(15757),START:e(41637),UPDATE:e(93802)}},97421:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l){this.pad=a,this.events=a.events,this.index=l,this.value=0,this.threshold=.1},update:function(h){this.value=h},getValue:function(){return Math.abs(this.value){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92734),h=new r({initialize:function(l,n){this.pad=l,this.events=l.manager,this.index=n,this.value=0,this.threshold=1,this.pressed=!1},update:function(a){this.value=a;var l=this.pad,n=this.index;a>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(p.BUTTON_DOWN,l,this,a),this.pad.emit(p.GAMEPAD_BUTTON_DOWN,n,a,this)):this.pressed&&(this.pressed=!1,this.events.emit(p.BUTTON_UP,l,this,a),this.pad.emit(p.GAMEPAD_BUTTON_UP,n,a,this))},destroy:function(){this.pad=null,this.events=null}});s.exports=h},99125:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97421),p=e(28884),h=e(83419),a=e(50792),l=e(26099),n=new h({Extends:a,initialize:function(f,o){a.call(this),this.manager=f,this.pad=o,this.id=o.id,this.index=o.index;for(var c=[],d=0;d=2&&(this.leftStick.set(v[0].getValue(),v[1].getValue()),d>=4&&this.rightStick.set(v[2].getValue(),v[3].getValue()))}},destroy:function(){this.removeAllListeners(),this.manager=null,this.pad=null;var u;for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(92734),a=e(99125),l=e(35154),n=e(89639),u=e(8214),f=new r({Extends:p,initialize:function(c){p.call(this),this.scene=c.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=c,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,c.pluginEvents.once(u.BOOT,this.boot,this),c.pluginEvents.on(u.START,this.start,this)},boot:function(){var o=this.scene.sys.game,c=this.settings.input,d=o.config;this.enabled=l(c,"gamepad",d.inputGamepad)&&o.device.input.gamepads,this.target=l(c,"gamepad.target",d.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(u.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(u.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var o=this,c=this.target,d=function(v){v.defaultPrevented||!o.isActive()||(o.refreshPads(),o.queue.push(v))};this.onGamepadHandler=d,c.addEventListener("gamepadconnected",d,!1),c.addEventListener("gamepaddisconnected",d,!1),this.sceneInputPlugin.pluginEvents.on(u.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(u.UPDATE,this.update);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},65294:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},90089:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},64894:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={DUALSHOCK_4:e(65294),SNES_USB:e(89651),XBOX_360:e(90089)}},46008:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},7629:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},42206:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="connected"},86544:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="disconnected"},94784:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},14325:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},92734:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BUTTON_DOWN:e(46008),BUTTON_UP:e(7629),CONNECTED:e(42206),DISCONNECTED:e(86544),GAMEPAD_BUTTON_DOWN:e(94784),GAMEPAD_BUTTON_UP:e(14325)}},48646:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Axis:e(97421),Button:e(28884),Events:e(92734),Gamepad:e(99125),GamepadPlugin:e(56654),Configs:e(64894)}},14350:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(93301),p=e(79291),h={CreatePixelPerfectHandler:e(84409),CreateInteractiveObject:e(74457),Events:e(8214),Gamepad:e(48646),InputManager:e(7003),InputPlugin:e(48205),InputPluginCache:e(89639),Keyboard:e(51442),Mouse:e(87078),Pointer:e(42515),Touch:e(95618)};h=p(!1,h,r),s.exports=h},78970:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(83419),h=e(8443),a=e(8214),l=e(46032),n=e(29747),u=new p({initialize:function(o){this.manager=o,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=n,this.onKeyUp=n,o.events.once(a.MANAGER_BOOT,this.boot,this)},boot:function(){var f=this.manager.config;this.enabled=f.inputKeyboard,this.target=f.inputKeyboardEventTarget,this.addCapture(f.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(h.POST_STEP,this.postUpdate,this)},startListeners:function(){var f=this;this.onKeyDown=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(a.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}},this.onKeyUp=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(a.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}};var o=this.target;o&&(o.addEventListener("keydown",this.onKeyDown,!1),o.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var f=this.target;f.removeEventListener("keydown",this.onKeyDown,!1),f.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var o=this.captures,c=0;c0},removeCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var o=this.captures,c=0;c0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(h.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});s.exports=u},28846:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(95922),a=e(8443),l=e(35154),n=e(8214),u=e(89639),f=e(30472),o=e(46032),c=e(87960),d=e(74600),v=e(44594),m=e(56583),S=new r({Extends:p,initialize:function(w){p.call(this),this.game=w.systems.game,this.scene=w.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=w,this.manager=w.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,w.pluginEvents.once(n.BOOT,this.boot,this),w.pluginEvents.on(n.START,this.start,this)},boot:function(){var M=this.settings.input;this.enabled=l(M,"keyboard",!0);var w=l(M,"keyboard.capture",null);w&&this.addCaptures(w),this.sceneInputPlugin.pluginEvents.once(n.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(n.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(n.SHUTDOWN,this.shutdown,this),this.game.events.on(a.BLUR,this.resetKeys,this),this.scene.sys.events.on(v.PAUSE,this.resetKeys,this),this.scene.sys.events.on(v.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(M){return this.manager.addCapture(M),this},removeCapture:function(M){return this.manager.removeCapture(M),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:o.UP,down:o.DOWN,left:o.LEFT,right:o.RIGHT,space:o.SPACE,shift:o.SHIFT})},addKeys:function(M,w,C){w===void 0&&(w=!0),C===void 0&&(C=!1);var A={};if(typeof M=="string"){M=M.split(",");for(var P=0;P-1?A[P]=M:A[M.keyCode]=M,w&&this.addCapture(M.keyCode),M.setEmitOnRepeat(C),M}return typeof M=="string"&&(M=o[M.toUpperCase()]),A[M]||(A[M]=new f(this,M),w&&this.addCapture(M),A[M].setEmitOnRepeat(C)),A[M]},removeKey:function(M,w,C){w===void 0&&(w=!1),C===void 0&&(C=!1);var A=this.keys,P;if(M instanceof f){var b=A.indexOf(M);b>-1&&(P=this.keys[b],this.keys[b]=void 0)}else typeof M=="string"&&(M=o[M.toUpperCase()]);return A[M]&&(P=A[M],A[M]=void 0),P&&(P.plugin=null,C&&this.removeCapture(P.keyCode),w&&P.destroy()),this},removeAllKeys:function(M,w){M===void 0&&(M=!1),w===void 0&&(w=!1);for(var C=this.keys,A=0;AM._tick)return M._tick=C,!0}return!1},update:function(){var M=this.manager.queue,w=M.length;if(!(!this.isActive()||w===0))for(var C=this.keys,A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r.timeLastMatched=e.timeStamp,r.index++,r.index===r.size?!0:(r.current=r.keyCodes[r.index],!1)};s.exports=y},87960:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95922),h=e(95540),a=e(68769),l=e(92803),n=new r({initialize:function(f,o,c){if(c===void 0&&(c={}),o.length<2)return!1;this.manager=f,this.enabled=!0,this.keyCodes=[];for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66970),p=function(h,a){if(a.matched)return!0;var l=!1,n=!1;if(h.keyCode===a.current)if(a.index>0&&a.maxKeyDelay>0){var u=a.timeLastMatched+a.maxKeyDelay;h.timeStamp<=u&&(n=!0,l=r(h,a))}else n=!0,l=r(h,a);return!n&&a.resetOnWrongKey&&(a.index=0,a.current=a.keyCodes[0]),l&&(a.timeLastMatched=h.timeStamp,a.matched=!0,a.timeMatched=h.timeStamp),l};s.exports=p},92803:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.current=e.keyCodes[0],e.index=0,e.timeLastMatched=0,e.matched=!1,e.timeMatched=0,e};s.exports=y},92612:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keydown"},23345:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keyup"},21957:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keycombomatch"},44743:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="down"},3771:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keydown-"},46358:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="keyup-"},75674:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="up"},95922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ANY_KEY_DOWN:e(92612),ANY_KEY_UP:e(23345),COMBO_MATCH:e(21957),DOWN:e(44743),KEY_DOWN:e(3771),KEY_UP:e(46358),UP:e(75674)}},51442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(95922),KeyboardManager:e(78970),KeyboardPlugin:e(28846),Key:e(30472),KeyCodes:e(46032),KeyCombo:e(87960),AdvanceKeyCombo:e(66970),ProcessKeyCombo:e(68769),ResetKeyCombo:e(92803),JustDown:e(90229),JustUp:e(38796),DownDuration:e(37015),UpDuration:e(41170)}},37015:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=50);var p=e.plugin.game.loop.time-e.timeDown;return e.isDown&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e._justDown?(e._justDown=!1,!0):!1};s.exports=y},38796:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e._justUp?(e._justUp=!1,!0):!1};s.exports=y},30472:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(95922),a=new r({Extends:p,initialize:function(n,u){p.call(this),this.plugin=n,this.keyCode=u,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(l){return this.emitOnRepeat=l,this},onDown:function(l){this.originalEvent=l,this.enabled&&(this.altKey=l.altKey,this.ctrlKey=l.ctrlKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.location=l.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(h.DOWN,this,l):(this.isDown=!0,this.isUp=!1,this.timeDown=l.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(h.DOWN,this,l)))},onUp:function(l){this.originalEvent=l,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=l.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(h.UP,this,l))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});s.exports=a},46032:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175};s.exports=y},74600:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(46032),p={};for(var h in r)p[r[h]]=h;s.exports=p},41170:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=50);var p=e.plugin.game.loop.time-e.timeUp;return e.isUp&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89357),h=e(8214),a=e(29747),l=new r({initialize:function(u){this.manager=u,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=a,this.onMouseDown=a,this.onMouseUp=a,this.onMouseDownWindow=a,this.onMouseUpWindow=a,this.onMouseOver=a,this.onMouseOut=a,this.onMouseWheel=a,this.pointerLockChange=a,this.isTop=!0,u.events.once(h.MANAGER_BOOT,this.boot,this)},boot:function(){var n=this.manager.config;this.enabled=n.inputMouse,this.target=n.inputMouseEventTarget,this.passive=n.inputMousePassive,this.preventDefaultDown=n.inputMousePreventDefaultDown,this.preventDefaultUp=n.inputMousePreventDefaultUp,this.preventDefaultMove=n.inputMousePreventDefaultMove,this.preventDefaultWheel=n.inputMousePreventDefaultWheel,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,n.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(n){return n.preventDefault(),!1}),this},requestPointerLock:function(){if(p.pointerLock){var n=this.target;n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock,n.requestPointerLock()}},releasePointerLock:function(){p.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var n=this.target;if(n){var u=this,f=this.manager,o=f.canvas,c=window&&window.focus&&f.game.config.autoFocus;this.onMouseMove=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseMove(v),u.preventDefaultMove&&v.preventDefault())},this.onMouseDown=function(v){c&&window.focus(),!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseDown(v),u.preventDefaultDown&&v.target===o&&v.preventDefault())},this.onMouseDownWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==o&&f.onMouseDown(v)},this.onMouseUp=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseUp(v),u.preventDefaultUp&&v.target===o&&v.preventDefault())},this.onMouseUpWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==o&&f.onMouseUp(v)},this.onMouseOver=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOver(v)},this.onMouseOut=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOut(v)},this.onMouseWheel=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.onMouseWheel(v),u.preventDefaultWheel&&v.target===o&&v.preventDefault()};var d={passive:!0};if(n.addEventListener("mousemove",this.onMouseMove),n.addEventListener("mousedown",this.onMouseDown),n.addEventListener("mouseup",this.onMouseUp),n.addEventListener("mouseover",this.onMouseOver,d),n.addEventListener("mouseout",this.onMouseOut,d),this.preventDefaultWheel?n.addEventListener("wheel",this.onMouseWheel,{passive:!1}):n.addEventListener("wheel",this.onMouseWheel,d),window&&f.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,d),window.top.addEventListener("mouseup",this.onMouseUpWindow,d)}catch{window.addEventListener("mousedown",this.onMouseDownWindow,d),window.addEventListener("mouseup",this.onMouseUpWindow,d),this.isTop=!1}p.pointerLock&&(this.pointerLockChange=function(v){var m=u.target;u.locked=document.pointerLockElement===m||document.mozPointerLockElement===m||document.webkitPointerLockElement===m,f.onPointerLockChange(v)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var n=this.target;n.removeEventListener("mousemove",this.onMouseMove),n.removeEventListener("mousedown",this.onMouseDown),n.removeEventListener("mouseup",this.onMouseUp),n.removeEventListener("mouseover",this.onMouseOver),n.removeEventListener("mouseout",this.onMouseOut),window&&(n=this.isTop?window.top:window,n.removeEventListener("mousedown",this.onMouseDownWindow),n.removeEventListener("mouseup",this.onMouseUpWindow)),p.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});s.exports=l},87078:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={MouseManager:e(85098)}},36210:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8214),h=e(29747),a=new r({initialize:function(n){this.manager=n,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=h,this.onTouchStartWindow=h,this.onTouchMove=h,this.onTouchEnd=h,this.onTouchEndWindow=h,this.onTouchCancel=h,this.onTouchCancelWindow=h,this.isTop=!0,n.events.once(p.MANAGER_BOOT,this.boot,this)},boot:function(){var l=this.manager.config;this.enabled=l.inputTouch,this.target=l.inputTouchEventTarget,this.capture=l.inputTouchCapture,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,l.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(l){return l.preventDefault(),!1}),this},startListeners:function(){var l=this.target;if(l){var n=this,u=this.manager,f=u.canvas,o=window&&window.focus&&u.game.config.autoFocus;this.onTouchMove=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchMove(m),n.capture&&m.cancelable&&m.preventDefault())},this.onTouchStart=function(m){o&&window.focus(),!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchStart(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchStartWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchStart(m)},this.onTouchEnd=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchEnd(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchEndWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchEnd(m)},this.onTouchCancel=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchCancel(m),n.capture&&m.preventDefault())},this.onTouchCancelWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&u.onTouchCancel(m)};var c=this.capture,d={passive:!0},v={passive:!1};if(l.addEventListener("touchstart",this.onTouchStart,c?v:d),l.addEventListener("touchmove",this.onTouchMove,c?v:d),l.addEventListener("touchend",this.onTouchEnd,c?v:d),l.addEventListener("touchcancel",this.onTouchCancel,c?v:d),window&&u.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,v),window.top.addEventListener("touchend",this.onTouchEndWindow,v),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,v)}catch{window.addEventListener("touchstart",this.onTouchStartWindow,v),window.addEventListener("touchend",this.onTouchEndWindow,v),window.addEventListener("touchcancel",this.onTouchCancelWindow,v),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var l=this.target;l.removeEventListener("touchstart",this.onTouchStart),l.removeEventListener("touchmove",this.onTouchMove),l.removeEventListener("touchend",this.onTouchEnd),l.removeEventListener("touchcancel",this.onTouchCancel),window&&(l=this.isTop?window.top:window,l.removeEventListener("touchstart",this.onTouchStartWindow),l.removeEventListener("touchend",this.onTouchEndWindow),l.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});s.exports=a},95618:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={TouchManager:e(36210)}},41299:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(54899),a=e(95540),l=e(98356),n=e(3374),u=e(84376),f=e(92638),o=new r({initialize:function(d,v){if(this.loader=d,this.cache=a(v,"cache",!1),this.type=a(v,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=a(v,"key",!1);var m=this.key;if(d.prefix&&d.prefix!==""&&(this.key=d.prefix+m),!this.key)throw new Error("Invalid File key: "+this.key);var S=a(v,"url");S===void 0?S=d.path+m+"."+a(v,"extension",""):typeof S=="string"&&!S.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)&&(S=d.path+S),this.url=S,this.src="",this.xhrSettings=f(a(v,"responseType",void 0)),a(v,"xhrSettings",!1)&&(this.xhrSettings=n(this.xhrSettings,a(v,"xhrSettings",{}))),this.xhrLoader=null,this.state=typeof this.url=="function"?p.FILE_POPULATED:p.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(v,"config",{}),this.multiFile,this.linkFile,this.base64=typeof S=="string"&&S.indexOf("data:")===0},setLink:function(c){this.linkFile=c,c.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===p.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=p.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.src.indexOf("data:")===0&&(this.base64=!0),this.xhrLoader=u(this,this.loader.xhr))},onLoad:function(c,d){var v=c.responseURL&&this.loader.localSchemes.some(function(M){return c.responseURL.indexOf(M)===0}),m=v&&d.target.status===0,S=!(d.target&&d.target.status!==200)||m;c.readyState===4&&c.status>=400&&c.status<=599&&(S=!1),this.state=p.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,S)},onBase64Load:function(c){this.xhrLoader=c,this.state=p.FILE_LOADED,this.percentComplete=1,this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(c){c.lengthComputable&&(this.bytesLoaded=c.loaded,this.bytesTotal=c.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=p.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=p.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=p.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(c){if(this.state!==p.FILE_PENDING_DESTROY){c===void 0&&(c=this.data);var d=this.key,v=this.type;this.loader.emit(h.FILE_COMPLETE,d,v,c),this.loader.emit(h.FILE_KEY_COMPLETE+v+"-"+d,d,v,c),this.loader.flagForRemoval(this),this.state=p.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});o.createObjectURL=function(c,d,v){if(typeof URL=="function")c.src=URL.createObjectURL(d);else{var m=new FileReader;m.onload=function(){c.removeAttribute("crossOrigin"),c.src="data:"+(d.type||v)+";base64,"+m.result.split(",")[1]},m.onerror=c.onerror,m.readAsDataURL(d)}},o.revokeObjectURL=function(c){typeof URL=="function"&&URL.revokeObjectURL(c.src)},s.exports=o},74099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={},e={install:function(r){for(var p in y)r[p]=y[p]},register:function(r,p){y[r]=p},destroy:function(){y={}}};s.exports=e},98356:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.url?e.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?e.url:r+e.url:!1};s.exports=y},74261:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(35072),a=e(50792),l=e(54899),n=e(74099),u=e(95540),f=e(35154),o=e(37277),c=e(44594),d=e(92638),v=new r({Extends:a,initialize:function(S){a.call(this);var M=S.sys.game.config,w=S.sys.settings.loader;this.scene=S,this.systems=S.sys,this.cacheManager=S.sys.cache,this.textureManager=S.sys.textures,this.sceneManager=S.sys.game.scene,n.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(u(w,"baseURL",M.loaderBaseURL)),this.setPath(u(w,"path",M.loaderPath)),this.setPrefix(u(w,"prefix",M.loaderPrefix)),this.maxParallelDownloads=u(w,"maxParallelDownloads",M.loaderMaxParallelDownloads),this.xhr=d(u(w,"responseType",M.loaderResponseType),u(w,"async",M.loaderAsync),u(w,"user",M.loaderUser),u(w,"password",M.loaderPassword),u(w,"timeout",M.loaderTimeout),u(w,"withCredentials",M.loaderWithCredentials)),this.crossOrigin=u(w,"crossOrigin",M.loaderCrossOrigin),this.imageLoadType=u(w,"imageLoadType",M.loaderImageLoadType),this.localSchemes=u(w,"localScheme",M.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new h,this.inflight=new h,this.queue=new h,this._deleteQueue=new h,this.totalFailed=0,this.totalComplete=0,this.state=p.LOADER_IDLE,this.multiKeyIndex=0,S.sys.events.once(c.BOOT,this.boot,this),S.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.baseURL=m,this},setPath:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.path=m,this},setPrefix:function(m){return m===void 0&&(m=""),this.prefix=m,this},setCORS:function(m){return this.crossOrigin=m,this},addFile:function(m){Array.isArray(m)||(m=[m]);for(var S=0;S0},isLoading:function(){return this.state===p.LOADER_LOADING||this.state===p.LOADER_PROCESSING},isReady:function(){return this.state===p.LOADER_IDLE||this.state===p.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(l.START,this),this.list.size===0?this.loadComplete():(this.state=p.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(l.PROGRESS,this.progress)},update:function(){this.state===p.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} + */var r=e(79291),p=e(92638),h=function(a,l){var n=a===void 0?p():r({},a);if(l)for(var u in l)l[u]!==void 0&&(n[u]=l[u]);return n};s.exports=h},26430:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(54899),a=new r({initialize:function(n,u,f,o){var c=[];o.forEach(function(m){m&&c.push(m)}),this.loader=n,this.type=u,this.key=f;var d=this.key;n.prefix&&n.prefix!==""&&(this.key=n.prefix+d),this.multiKeyIndex=n.multiKeyIndex++,this.files=c,this.state=p.FILE_PENDING,this.complete=!1,this.pending=c.length,this.failed=0,this.config={},this.baseURL=n.baseURL,this.path=n.path,this.prefix=n.prefix;for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(3374),p=function(h,a){var l=r(a,h.xhrSettings);if(h.base64){var n=h.url.split(";base64,").pop()||h.url.split(",").pop(),u={responseText:atob(n)};h.onBase64Load(u);return}var f=new XMLHttpRequest;if(f.open("GET",h.src,l.async,l.user,l.password),f.responseType=h.xhrSettings.responseType,f.timeout=l.timeout,l.headers)for(var o in l.headers)f.setRequestHeader(o,l.headers[o]);return l.header&&l.headerValue&&f.setRequestHeader(l.header,l.headerValue),l.requestedWith&&f.setRequestHeader("X-Requested-With",l.requestedWith),l.overrideMimeType&&f.overrideMimeType(l.overrideMimeType),l.withCredentials&&(f.withCredentials=!0),f.onload=h.onLoad.bind(h,f),f.onerror=h.onError.bind(h,f),f.onprogress=h.onProgress.bind(h),f.ontimeout=h.onError.bind(h,f),f.send(),f};s.exports=p},92638:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){return e===void 0&&(e=""),r===void 0&&(r=!0),p===void 0&&(p=""),h===void 0&&(h=""),a===void 0&&(a=0),l===void 0&&(l=!1),{responseType:e,async:r,user:p,password:h,timeout:a,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:l}};s.exports=y},23906:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20};s.exports=y},42155:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addfile"},38991:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},27540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="filecomplete"},87464:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="filecomplete-"},94486:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loaderror"},13035:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="load"},38144:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fileprogress"},97520:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postprocess"},85595:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="progress"},55680:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},54899:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(42155),COMPLETE:e(38991),FILE_COMPLETE:e(27540),FILE_KEY_COMPLETE:e(87464),FILE_LOAD_ERROR:e(94486),FILE_LOAD:e(13035),FILE_PROGRESS:e(38144),POST_PROCESS:e(97520),PROGRESS:e(85595),START:e(55680)}},14135:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(518),a=e(54899),l=new r({Extends:h,initialize:function(u,f,o,c,d){h.call(this,u,f,o,c,d),this.type="animationJSON"},onProcess:function(){this.loader.once(a.POST_PROCESS,this.onLoadComplete,this),h.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});p.register("animation",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new n(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","json"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new n(c,d,m,M);w.linkFile?u.call(this,c,"atlasjson",d,[w,C,w.linkFile]):u.call(this,c,"atlasjson",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(o.key,o.data,c.data,d),c.addToCache(),this.complete=!0}}});p.register("aseprite",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new n(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","json"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new n(c,d,m,M);w.linkFile?u.call(this,c,"atlasjson",d,[w,C,w.linkFile]):u.call(this,c,"atlasjson",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(o.key,o.data,c.data,d),this.complete=!0}}});p.register("atlas",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(57318),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new u(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","xml"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new u(c,d,m,M);w.linkFile?n.call(this,c,"atlasxml",d,[w,C,w.linkFile]):n.call(this,c,"atlasxml",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(o.key,o.data,c.data,d),this.complete=!0}}});p.register("atlasXML",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(89749),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){if(u(d)){var M=d;d=l(M,"key"),m=l(M,"xhrSettings"),S=l(M,"context",S)}var w={type:"audio",cache:c.cacheManager.audio,extension:v.type,responseType:"arraybuffer",key:d,url:v.url,xhrSettings:m,config:{context:S}};h.call(this,c,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var o=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(c){o.data=c,o.onProcessComplete()},function(c){console.error("Error decoding audio: "+o.key+" - ",c?c.message:null),o.onProcessError()}),this.config.context=null}});f.create=function(o,c,d,v,m){var S=o.systems.game,M=S.config.audio,w=S.device.audio;u(c)&&(d=l(c,"url",[]),v=l(c,"config",{}));var C=f.getAudioURL(S,d);return C?w.webAudio&&!M.disableWebAudio?new f(o,c,C,m,S.sound.context):new n(o,c,C,v):(console.warn('No audio URLs for "%s" matched this device',c),null)},f.getAudioURL=function(o,c){Array.isArray(c)||(c=[c]);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21097),p=e(83419),h=e(74099),a=e(95540),l=e(41212),n=e(518),u=e(26430),f=new p({Extends:u,initialize:function(c,d,v,m,S,M,w){if(l(d)){var C=d;d=a(C,"key"),v=a(C,"jsonURL"),m=a(C,"audioURL"),S=a(C,"audioConfig"),M=a(C,"audioXhrSettings"),w=a(C,"jsonXhrSettings")}var A;if(!m)A=new n(c,d,v,w),u.call(this,c,"audiosprite",d,[A]),this.config.resourceLoad=!0,this.config.audioConfig=S,this.config.audioXhrSettings=M;else{var P=r.create(c,d,m,S,M);P&&(A=new n(c,d,v,w),u.call(this,c,"audiosprite",d,[P,A]),this.config.resourceLoad=!1)}},onFileComplete:function(o){var c=this.files.indexOf(o);if(c!==-1&&(this.pending--,this.config.resourceLoad&&o.type==="json"&&o.data.hasOwnProperty("resources"))){var d=o.data.resources,v=a(this.config,"audioConfig"),m=a(this.config,"audioXhrSettings"),S=r.create(this.loader,o.key,d,v,m);S&&(this.addToMultiFile(S),this.loader.addFile(S))}},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1];o.addToCache(),c.addToCache(),this.complete=!0}}});h.register("audioSprite",function(o,c,d,v,m,S){var M=this.systems.game,w=M.config.audio,C=M.device.audio;if(w&&w.noAudio||!C.webAudio&&!C.audioData)return this;var A;if(Array.isArray(o))for(var P=0;P{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="bin";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"xhrSettings"),S=l(M,"extension",S),m=l(M,"dataType",m)}var w={type:"binary",cache:o.cacheManager.binary,extension:S,responseType:"arraybuffer",key:c,url:d,xhrSettings:v,config:{dataType:m}};h.call(this,o,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.dataType;this.data=f?new f(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});a.register("binary",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(21859),f=e(57318),o=new r({Extends:n,initialize:function(d,v,m,S,M,w){var C,A;if(l(v)){var P=v;v=h(P,"key"),C=new a(d,{key:v,url:h(P,"textureURL"),extension:h(P,"textureExtension","png"),normalMap:h(P,"normalMap"),xhrSettings:h(P,"textureXhrSettings")}),A=new f(d,{key:v,url:h(P,"fontDataURL"),extension:h(P,"fontDataExtension","xml"),xhrSettings:h(P,"fontDataXhrSettings")})}else C=new a(d,v,m,M),A=new f(d,v,S,w);C.linkFile?n.call(this,d,"bitmapfont",v,[C,A,C.linkFile]):n.call(this,d,"bitmapfont",v,[C,A])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1];c.addToCache();var v=c.cache.get(c.key),m=u(d.data,c.cache.getFrame(c.key),0,0,v);this.loader.cacheManager.bitmapFont.add(c.key,{data:m,texture:c.key,frame:null}),this.complete=!0}}});p.register("bitmapFont",function(c,d,v,m,S){var M;if(Array.isArray(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 r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="css";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"script",cache:!1,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});a.register("css",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(38734),p=e(85722),h=e(83419),a=e(74099),l=e(95540),n=e(19550),u=e(41212),f=e(518),o=e(31403),c=e(46975),d=e(59327),v=e(26430),m=e(82038),S=e(55222),M=new h({Extends:v,initialize:function(C,A,P,b){if(P.multiAtlasURL){var O=new f(C,{key:A,url:P.multiAtlasURL,xhrSettings:b,config:P});v.call(this,C,"texture",A,[O])}else{var I=P.textureURL.substr(P.textureURL.length-3);P.type||(P.type=I.toLowerCase()==="ktx"?"KTX":"PVR");var D=new p(C,{key:A,url:P.textureURL,extension:I,xhrSettings:b,config:P});if(P.atlasURL){var B=new f(C,{key:A,url:P.atlasURL,xhrSettings:b,config:P});v.call(this,C,"texture",A,[D,B])}else v.call(this,C,"texture",A,[D])}this.config=P},onFileComplete:function(w){var C=this.files.indexOf(w);if(C!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(w.type==="json"&&w.data.hasOwnProperty("textures")){var A=w.data.textures,P=this.config,b=this.loader,O=b.baseURL,I=b.path,D=b.prefix,B=l(P,"multiBaseURL",this.baseURL),G=l(P,"multiPath",this.path),z=l(P,"prefix",this.prefix),X=l(P,"textureXhrSettings");B&&b.setBaseURL(B),G&&b.setPath(G),z&&b.setPrefix(z);for(var K=0;K{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(73894),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="glsl";if(n(d)){var w=d;d=l(w,"key"),v=l(w,"url"),m=l(w,"shaderType","fragment"),S=l(w,"xhrSettings"),M=l(w,"extension",M)}else m===void 0&&(m="fragment");var C={type:"glsl",cache:c.cacheManager.shader,extension:M,responseType:"text",key:d,url:v,config:{shaderType:m},xhrSettings:S};h.call(this,c,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var o=this.data.split(` +`),c=this.extractBlock(o,0);if(c)for(;c;){var d=this.getShaderName(c.header),v=this.getShaderType(c.header),m=this.getShaderUniforms(c.header),S=c.shader;if(this.cache.has(d)){var M=this.cache.get(d);v==="fragment"?M.fragmentSrc=S:M.vertexSrc=S,M.uniforms||(M.uniforms=m)}else v==="fragment"?this.cache.add(d,new u(d,S,"",m)):this.cache.add(d,new u(d,"",S,m));c=this.extractBlock(o,c.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new u(this.key,this.data)):this.cache.add(this.key,new u(this.key,"",this.data))},getShaderName:function(o){for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(54899),h=e(41299),a=e(95540),l=e(98356),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){if(n(c)){var m=c;c=a(m,"key"),v=a(m,"config",v)}var S={type:"audio",cache:o.cacheManager.audio,extension:d.type,key:c,url:d.url,config:v};h.call(this,o,S),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="html";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",cache:o.cacheManager.html,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("html",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){v===void 0&&(v=512),m===void 0&&(m=512);var M="html";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"width",v),m=l(w,"height",m)}var C={type:"html",cache:o.textureManager,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{width:v,height:m}};h.call(this,o,C)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.width,o=this.config.height,c=[];c.push(''),c.push(''),c.push(''),c.push(this.xhrLoader.responseText),c.push(""),c.push(""),c.push("");var d=[c.join(` +`)],v=this;try{var m=new window.Blob(d,{type:"image/svg+xml;charset=utf-8"})}catch{v.state=p.FILE_ERRORED,v.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){h.revokeObjectURL(v.data),v.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(v.data),v.onProcessError()},h.createObjectURL(this.data,m,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("htmlTexture",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(98356),f=new r({Extends:h,initialize:function o(c,d,v,m,S){var M="png",w;if(n(d)){var C=d;d=l(C,"key"),v=l(C,"url"),w=l(C,"normalMap"),m=l(C,"xhrSettings"),M=l(C,"extension",M),S=l(C,"frameConfig")}Array.isArray(v)&&(w=v[1],v=v[0]);var A={type:"image",cache:c.textureManager,extension:M,responseType:"blob",key:d,url:v,xhrSettings:m,config:S};if(h.call(this,c,A),w){var P=new o(c,this.key,w,m,S);P.type="normalMap",this.setLink(P),c.addFile(P)}this.useImageElementLoad=c.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var o=this;this.data.onload=function(){h.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(o.data),o.onProcessError()},h.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var o=this.state;this.state=p.FILE_PROCESSING,o===p.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=p.FILE_LOADING,this.src=u(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var o=this;this.data.onload=function(){o.state=p.FILE_LOADED,o.loader.nextFile(o,!0)},this.data.onerror=function(){o.loader.nextFile(o,!1)},this.data.src=this.src},addToCache:function(){var o=this.linkFile;o?o.state>=p.FILE_COMPLETE&&(o.type==="spritesheet"?o.addToCache():this.type==="normalMap"?this.cache.addImage(this.key,o.data,this.data):this.cache.addImage(this.key,this.data,o.data)):this.cache.addImage(this.key,this.data)}});a.register("image",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(35154),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="json";if(u(d)){var w=d;d=l(w,"key"),v=l(w,"url"),m=l(w,"xhrSettings"),M=l(w,"extension",M),S=l(w,"dataKey",S)}var C={type:"json",cache:c.cacheManager.json,extension:M,responseType:"text",key:d,url:v,xhrSettings:m,config:S};h.call(this,c,C),u(v)&&(S?this.data=n(v,S):this.data=v,this.state=p.FILE_POPULATED)},onProcess:function(){if(this.state!==p.FILE_POPULATED){this.state=p.FILE_PROCESSING;try{var o=JSON.parse(this.xhrLoader.responseText)}catch(d){throw this.onProcessError(),d}var c=this.config;typeof c=="string"?this.data=n(o,c,o):this.data=o}this.onProcessComplete()}});a.register("json",function(o,c,d,v){if(Array.isArray(o))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(518),u=e(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M,w){if(l(d)){var C=d;d=h(C,"key"),h(C,"url",!1)?v=h(C,"url"):v=h(C,"atlasURL"),M=h(C,"xhrSettings"),m=h(C,"path"),S=h(C,"baseURL"),w=h(C,"textureXhrSettings")}var A=new n(c,d,v,M);u.call(this,c,"multiatlas",d,[A]),this.config.path=m,this.config.baseURL=S,this.config.textureXhrSettings=w},onFileComplete:function(o){var c=this.files.indexOf(o);if(c!==-1&&(this.pending--,o.type==="json"&&o.data.hasOwnProperty("textures"))){var d=o.data.textures,v=this.config,m=this.loader,S=m.baseURL,M=m.path,w=m.prefix,C=h(v,"baseURL",this.baseURL),A=h(v,"path",this.path),P=h(v,"prefix",this.prefix),b=h(v,"textureXhrSettings");m.setBaseURL(C),m.setPath(A),m.setPrefix(P);for(var O=0;O{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(41212),l=e(26430),n=e(34328),u=new r({Extends:l,initialize:function(o,c,d,v){var m="js",S=[];if(a(c)){var M=c;c=h(M,"key"),d=h(M,"url"),v=h(M,"xhrSettings"),m=h(M,"extension",m)}Array.isArray(d)||(d=[d]);for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(41212),l=e(26430),n=e(85048),u=e(61485),f=e(78776),o=new r({Extends:l,initialize:function(d,v,m,S,M,w){var C,A,P=d.cacheManager.obj;if(a(v)){var b=v;v=h(b,"key"),C=new f(d,{key:v,type:"obj",cache:P,url:h(b,"url"),extension:h(b,"extension","obj"),xhrSettings:h(b,"xhrSettings"),config:{flipUV:h(b,"flipUV",M)}}),S=h(b,"matURL"),S&&(A=new f(d,{key:v,type:"mat",cache:P,url:S,extension:h(b,"matExtension","mat"),xhrSettings:h(b,"xhrSettings")}))}else C=new f(d,{key:v,url:m,type:"obj",cache:P,extension:"obj",xhrSettings:w,config:{flipUV:M}}),S&&(A=new f(d,{key:v,url:S,type:"mat",cache:P,extension:"mat",xhrSettings:w}));l.call(this,d,"obj",v,[C,A])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1],v=n(c.data,c.config.flipUV);d&&(v.materials=u(d.data)),c.cache.add(c.key,v),this.complete=!0}}});p.register("obj",function(c,d,v,m,S){var M;if(Array.isArray(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 r=e(83419),p=e(23906),h=e(74099),a=e(518),l=new r({Extends:a,initialize:function(u,f,o,c,d){a.call(this,u,f,o,c,d),this.type="packfile"},onProcess:function(){if(this.state!==p.FILE_POPULATED&&(this.state=p.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var n={};n[this.config]=this.data,this.data=n}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});h.register("pack",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){var M="js";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"start"),m=l(w,"mapping")}var C={type:"plugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{start:v,mapping:m}};h.call(this,o,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,o=this.config,c=l(o,"start",!1),d=l(o,"mapping",null);if(this.state===p.FILE_POPULATED)f.install(this.key,this.data,c,d);else{this.state=p.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 v=f.install(this.key,window[this.key],c,d);(c||d)&&(this.loader.systems[d]=v,this.loader.scene[d]=v)}this.onProcessComplete()}});a.register("plugin",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="svg";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"svgConfig",{}),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"svg",cache:o.textureManager,extension:S,responseType:"text",key:c,url:d,xhrSettings:m,config:{width:l(v,"width"),height:l(v,"height"),scale:l(v,"scale")}};h.call(this,o,w)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.xhrLoader.responseText,o=[f],c=this.config.width,d=this.config.height,v=this.config.scale;t:if(c&&d||v){var m=null,S=new DOMParser;m=S.parseFromString(f,"text/xml");var M=m.getElementsByTagName("svg")[0],w=M.hasAttribute("viewBox"),C=parseFloat(M.getAttribute("width")),A=parseFloat(M.getAttribute("height"));if(!w&&C&&A)M.setAttribute("viewBox","0 0 "+C+" "+A);else if(w&&!C&&!A){var P=M.getAttribute("viewBox").split(/\s+|,/);C=P[2],A=P[3]}if(v)if(C&&A)c=C*v,d=A*v;else break t;M.setAttribute("width",c.toString()+"px"),M.setAttribute("height",d.toString()+"px"),o=[new XMLSerializer().serializeToString(M)]}try{var b=new window.Blob(o,{type:"image/svg+xml;charset=utf-8"})}catch{this.onProcessError();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var O=this,I=!1;this.data.onload=function(){I||h.revokeObjectURL(O.data),O.onProcessComplete()},this.data.onerror=function(){I?O.onProcessError():(I=!0,h.revokeObjectURL(O.data),O.data.src="data:image/svg+xml,"+encodeURIComponent(o.join("")))},h.createObjectURL(this.data,b,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});a.register("svg",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="js";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var f=this.data.concat(`(function(){ +return new `+this.key+`(); +}).call(this);`),o=eval;this.loader.sceneManager.add(this.key,o(f)),this.complete=!0}});a.register("sceneFile",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m,S){var M="js";if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),S=l(w,"xhrSettings"),M=l(w,"extension",M),v=l(w,"systemKey"),m=l(w,"sceneKey")}var C={type:"scenePlugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{systemKey:v,sceneKey:m}};h.call(this,o,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,o=this.config,c=this.key,d=l(o,"systemKey",c),v=l(o,"sceneKey",c);this.state===p.FILE_POPULATED?f.installScenePlugin(d,this.data,v,this.loader.scene,!0):(this.state=p.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),f.installScenePlugin(d,window[this.key],v,this.loader.scene,!0)),this.onProcessComplete()}});a.register("scenePlugin",function(f,o,c,d,v){if(Array.isArray(f))for(var m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v,m){var S="js";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"type","script"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}else v===void 0&&(v="script");var w={type:v,cache:!1,extension:S,responseType:"text",key:c,url:d,xhrSettings:m};h.call(this,o,w)},onProcess:function(){this.state=p.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()}});a.register("script",function(f,o,c,d){if(Array.isArray(f))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(74099),a=e(19550),l=new r({Extends:a,initialize:function(u,f,o,c,d){a.call(this,u,f,o,d,c),this.type="spritesheet"},addToCache:function(){var n=this.linkFile;n?n.state>=p.FILE_COMPLETE&&(this.type==="normalMap"?this.cache.addSpriteSheet(this.key,n.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,n.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});h.register("spritesheet",function(n,u,f,o){if(Array.isArray(n))for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=new r({Extends:h,initialize:function(o,c,d,v){var m="text",S="txt",M=o.cacheManager.text;if(n(c)){var w=c;c=l(w,"key"),d=l(w,"url"),v=l(w,"xhrSettings"),S=l(w,"extension",S),m=l(w,"type",m),M=l(w,"cache",M)}var C={type:m,cache:M,extension:S,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,o,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",function(f,o,c){if(Array.isArray(f))for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(80341),f=new r({Extends:h,initialize:function(c,d,v,m){var S="csv";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"tilemapCSV",cache:c.cacheManager.tilemap,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,w),this.tilemapFormat=u.CSV},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var o={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,o)}});a.register("tilemapCSV",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(518),a=e(80341),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,u,f,o,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:a.WELTMEISTER,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapImpact",function(n,u,f){if(Array.isArray(n))for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(518),a=e(80341),l=new r({Extends:h,initialize:function(u,f,o,c){h.call(this,u,f,o,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:a.TILED_JSON,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapTiledJSON",function(n,u,f){if(Array.isArray(n))for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(74099),h=e(95540),a=e(19550),l=e(41212),n=e(26430),u=e(78776),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var w,C;if(l(d)){var A=d;d=h(A,"key"),w=new a(c,{key:d,url:h(A,"textureURL"),extension:h(A,"textureExtension","png"),normalMap:h(A,"normalMap"),xhrSettings:h(A,"textureXhrSettings")}),C=new u(c,{key:d,url:h(A,"atlasURL"),extension:h(A,"atlasExtension","txt"),xhrSettings:h(A,"atlasXhrSettings")})}else w=new a(c,d,v,S),C=new u(c,d,m,M);w.linkFile?n.call(this,c,"unityatlas",d,[w,C,w.linkFile]):n.call(this,c,"unityatlas",d,[w,C])},addToCache:function(){if(this.isReadyToProcess()){var o=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(o.key,o.data,c.data,d),this.complete=!0}}});p.register("unityAtlas",function(o,c,d,v,m){var S;if(Array.isArray(o))for(var M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(98356),n=e(95540),u=e(41212),f=new r({Extends:h,initialize:function(c,d,v,m){if(m===void 0&&(m=!1),u(d)){var S=d;d=n(S,"key"),v=n(S,"url",[]),m=n(S,"noAudio",!1)}var M=c.systems.game.device.video.getVideoURL(v);M||console.warn("VideoFile: No supported format for "+d);var w={type:"video",cache:c.cacheManager.video,extension:M.type,key:d,url:M.url,config:{noAudio:m}};h.call(this,c,w)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=l(this,this.loader.baseURL),this.state=p.FILE_LOADED,this.loader.nextFile(this,!0)}});a.register("video",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(23906),h=e(41299),a=e(74099),l=e(95540),n=e(41212),u=e(56836),f=new r({Extends:h,initialize:function(c,d,v,m){var S="xml";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var w={type:"xml",cache:c.cacheManager.xml,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,w)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=u(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});a.register("xml",function(o,c,d){if(Array.isArray(o))for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AnimationJSONFile:e(14135),AsepriteFile:e(76272),AtlasJSONFile:e(38734),AtlasXMLFile:e(74599),AudioFile:e(21097),AudioSpriteFile:e(89524),BinaryFile:e(85722),BitmapFontFile:e(97025),CompressedTextureFile:e(69559),CSSFile:e(16024),GLSLFile:e(47931),HTML5AudioFile:e(89749),HTMLFile:e(88470),HTMLTextureFile:e(14643),ImageFile:e(19550),JSONFile:e(518),MultiAtlasFile:e(59327),MultiScriptFile:e(99297),OBJFile:e(41846),PackFile:e(58610),PluginFile:e(48988),SceneFile:e(88423),ScenePluginFile:e(56812),ScriptFile:e(34328),SpriteSheetFile:e(85035),SVGFile:e(67397),TextFile:e(78776),TilemapCSVFile:e(49477),TilemapImpactFile:e(40807),TilemapJSONFile:e(56775),UnityAtlasFile:e(25771),VideoFile:e(33720),XMLFile:e(57318)}},57777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23906),p=e(79291),h={Events:e(54899),FileTypes:e(64589),File:e(41299),FileTypesManager:e(74099),GetURL:e(98356),LoaderPlugin:e(74261),MergeXHRSettings:e(3374),MultiFile:e(26430),XHRLoader:e(84376),XHRSettings:e(92638)};h=p(!1,h,r),s.exports=h},53307:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0,p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6411),p=function(h,a){return r(h)/r(a)/r(h-a)};s.exports=p},30976:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.floor(Math.random()*(r-e+1)+e)};s.exports=y},87842:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){var l=(h-r)*.5,n=(a-p)*.5,u=e*e,f=e*u;return(2*p-2*h+l+n)*f+(-3*p+3*h-2*l-n)*u+l*e+p};s.exports=y},26302:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.ceil(e*h)/h};s.exports=y},45319:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.max(r,Math.min(p,e))};s.exports=y},39506:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h*r.DEG_TO_RAD};s.exports=p},61241:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.abs(e-r)};s.exports=y},38857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(37867),a=e(29747),l=new h,n=new p({initialize:function u(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d=u.DefaultOrder),this._x=f,this._y=o,this._z=c,this._order=d,this.onChangeCallback=a},x:{get:function(){return this._x},set:function(u){this._x=u,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(u){this._y=u,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(u){this._z=u,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(u){this._order=u,this.onChangeCallback(this)}},set:function(u,f,o,c){return c===void 0&&(c=this._order),this._x=u,this._y=f,this._z=o,this._order=c,this.onChangeCallback(this),this},copy:function(u){return this.set(u.x,u.y,u.z,u.order)},setFromQuaternion:function(u,f,o){return f===void 0&&(f=this._order),o===void 0&&(o=!1),l.fromQuat(u),this.setFromRotationMatrix(l,f,o)},setFromRotationMatrix:function(u,f,o){f===void 0&&(f=this._order),o===void 0&&(o=!1);var c=u.val,d=c[0],v=c[4],m=c[8],S=c[1],M=c[5],w=c[9],C=c[2],A=c[6],P=c[10],b=0,O=0,I=0,D=.99999;switch(f){case"XYZ":{O=Math.asin(r(m,-1,1)),Math.abs(m){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(e===0)return 1;for(var r=e;--e;)r*=e;return r};s.exports=y},99472:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.random()*(r-e)+e};s.exports=y},77623:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.floor(e*h)/h};s.exports=y},62945:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=function(h,a,l){return h=r(h,0,1),(l-a)*h+a};s.exports=p},38265:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e/r/1e3};s.exports=y},78702:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e==parseFloat(e)?!(e%2):void 0};s.exports=y},94883:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===parseFloat(e)?!(e%2):void 0};s.exports=y},28915:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return(r-e)*p+e};s.exports=y},94908:s=>{/** + * @author Greg McLean + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=0),e.clone().lerp(r,p)};s.exports=y},94434:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){this.val=new Float32Array(9),a?this.copy(a):this.identity()},clone:function(){return new p(this)},set:function(h){return this.copy(h)},copy:function(h){var a=this.val,l=h.val;return a[0]=l[0],a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=l[6],a[7]=l[7],a[8]=l[8],this},fromMat4:function(h){var a=h.val,l=this.val;return l[0]=a[0],l[1]=a[1],l[2]=a[2],l[3]=a[4],l[4]=a[5],l[5]=a[6],l[6]=a[8],l[7]=a[9],l[8]=a[10],this},fromArray:function(h){var a=this.val;return a[0]=h[0],a[1]=h[1],a[2]=h[2],a[3]=h[3],a[4]=h[4],a[5]=h[5],a[6]=h[6],a[7]=h[7],a[8]=h[8],this},identity:function(){var h=this.val;return h[0]=1,h[1]=0,h[2]=0,h[3]=0,h[4]=1,h[5]=0,h[6]=0,h[7]=0,h[8]=1,this},transpose:function(){var h=this.val,a=h[1],l=h[2],n=h[5];return h[1]=h[3],h[2]=h[6],h[3]=a,h[5]=h[7],h[6]=l,h[7]=n,this},invert:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8],m=v*f-o*d,S=-v*u+o*c,M=d*u-f*c,w=a*m+l*S+n*M;return w?(w=1/w,h[0]=m*w,h[1]=(-v*l+n*d)*w,h[2]=(o*l-n*f)*w,h[3]=S*w,h[4]=(v*a-n*c)*w,h[5]=(-o*a+n*u)*w,h[6]=M*w,h[7]=(-d*a+l*c)*w,h[8]=(f*a-l*u)*w,this):null},adjoint:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8];return h[0]=f*v-o*d,h[1]=n*d-l*v,h[2]=l*o-n*f,h[3]=o*c-u*v,h[4]=a*v-n*c,h[5]=n*u-a*o,h[6]=u*d-f*c,h[7]=l*c-a*d,h[8]=a*f-l*u,this},determinant:function(){var h=this.val,a=h[0],l=h[1],n=h[2],u=h[3],f=h[4],o=h[5],c=h[6],d=h[7],v=h[8];return a*(v*f-o*d)+l*(-v*u+o*c)+n*(d*u-f*c)},multiply:function(h){var a=this.val,l=a[0],n=a[1],u=a[2],f=a[3],o=a[4],c=a[5],d=a[6],v=a[7],m=a[8],S=h.val,M=S[0],w=S[1],C=S[2],A=S[3],P=S[4],b=S[5],O=S[6],I=S[7],D=S[8];return a[0]=M*l+w*f+C*d,a[1]=M*n+w*o+C*v,a[2]=M*u+w*c+C*m,a[3]=A*l+P*f+b*d,a[4]=A*n+P*o+b*v,a[5]=A*u+P*c+b*m,a[6]=O*l+I*f+D*d,a[7]=O*n+I*o+D*v,a[8]=O*u+I*c+D*m,this},translate:function(h){var a=this.val,l=h.x,n=h.y;return a[6]=l*a[0]+n*a[3]+a[6],a[7]=l*a[1]+n*a[4]+a[7],a[8]=l*a[2]+n*a[5]+a[8],this},rotate:function(h){var a=this.val,l=a[0],n=a[1],u=a[2],f=a[3],o=a[4],c=a[5],d=Math.sin(h),v=Math.cos(h);return a[0]=v*l+d*f,a[1]=v*n+d*o,a[2]=v*u+d*c,a[3]=v*f-d*l,a[4]=v*o-d*n,a[5]=v*c-d*u,this},scale:function(h){var a=this.val,l=h.x,n=h.y;return a[0]=l*a[0],a[1]=l*a[1],a[2]=l*a[2],a[3]=n*a[3],a[4]=n*a[4],a[5]=n*a[5],this},fromQuat:function(h){var a=h.x,l=h.y,n=h.z,u=h.w,f=a+a,o=l+l,c=n+n,d=a*f,v=a*o,m=a*c,S=l*o,M=l*c,w=n*c,C=u*f,A=u*o,P=u*c,b=this.val;return b[0]=1-(S+w),b[3]=v+P,b[6]=m-A,b[1]=v-P,b[4]=1-(d+w),b[7]=M+C,b[2]=m+A,b[5]=M-C,b[8]=1-(d+S),this},normalFromMat4:function(h){var a=h.val,l=this.val,n=a[0],u=a[1],f=a[2],o=a[3],c=a[4],d=a[5],v=a[6],m=a[7],S=a[8],M=a[9],w=a[10],C=a[11],A=a[12],P=a[13],b=a[14],O=a[15],I=n*d-u*c,D=n*v-f*c,B=n*m-o*c,G=u*v-f*d,z=u*m-o*d,X=f*m-o*v,K=S*P-M*A,Q=S*b-w*A,tt=S*O-C*A,Y=M*b-w*P,Z=M*O-C*P,U=w*O-C*b,H=I*U-D*Z+B*Y+G*tt-z*Q+X*K;return H?(H=1/H,l[0]=(d*U-v*Z+m*Y)*H,l[1]=(v*tt-c*U-m*Q)*H,l[2]=(c*Z-d*tt+m*K)*H,l[3]=(f*Z-u*U-o*Y)*H,l[4]=(n*U-f*tt+o*Q)*H,l[5]=(u*tt-n*Z-o*K)*H,l[6]=(P*X-b*z+O*G)*H,l[7]=(b*B-A*X-O*D)*H,l[8]=(A*z-P*B+O*I)*H,this):null}});s.exports=p},37867:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(25836),h=1e-6,a=new r({initialize:function(d){this.val=new Float32Array(16),d?this.copy(d):this.identity()},clone:function(){return new a(this)},set:function(c){return this.copy(c)},setValues:function(c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G){var z=this.val;return z[0]=c,z[1]=d,z[2]=v,z[3]=m,z[4]=S,z[5]=M,z[6]=w,z[7]=C,z[8]=A,z[9]=P,z[10]=b,z[11]=O,z[12]=I,z[13]=D,z[14]=B,z[15]=G,this},copy:function(c){var d=c.val;return this.setValues(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15])},fromArray:function(c){return this.setValues(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(c,d,v){var m=l.fromQuat(v),S=m.val,M=d.x,w=d.y,C=d.z;return this.setValues(S[0]*M,S[1]*M,S[2]*M,0,S[4]*w,S[5]*w,S[6]*w,0,S[8]*C,S[9]*C,S[10]*C,0,c.x,c.y,c.z,1)},xyz:function(c,d,v){this.identity();var m=this.val;return m[12]=c,m[13]=d,m[14]=v,this},scaling:function(c,d,v){this.zero();var m=this.val;return m[0]=c,m[5]=d,m[10]=v,m[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 c=this.val,d=c[1],v=c[2],m=c[3],S=c[6],M=c[7],w=c[11];return c[1]=c[4],c[2]=c[8],c[3]=c[12],c[4]=d,c[6]=c[9],c[7]=c[13],c[8]=v,c[9]=S,c[11]=c[14],c[12]=m,c[13]=M,c[14]=w,this},getInverse:function(c){return this.copy(c),this.invert()},invert:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],X=d*w-v*M,K=d*C-m*M,Q=d*A-S*M,tt=v*C-m*w,Y=v*A-S*w,Z=m*A-S*C,U=P*B-b*D,H=P*G-O*D,J=P*z-I*D,_=b*G-O*B,q=b*z-I*B,at=O*z-I*G,ot=X*at-K*q+Q*_+tt*J-Y*H+Z*U;return ot?(ot=1/ot,this.setValues((w*at-C*q+A*_)*ot,(m*q-v*at-S*_)*ot,(B*Z-G*Y+z*tt)*ot,(O*Y-b*Z-I*tt)*ot,(C*J-M*at-A*H)*ot,(d*at-m*J+S*H)*ot,(G*Q-D*Z-z*K)*ot,(P*Z-O*Q+I*K)*ot,(M*q-w*J+A*U)*ot,(v*J-d*q-S*U)*ot,(D*Y-B*Q+z*X)*ot,(b*Q-P*Y-I*X)*ot,(w*H-M*_-C*U)*ot,(d*_-v*H+m*U)*ot,(B*K-D*tt-G*X)*ot,(P*tt-b*K+O*X)*ot)):this},adjoint:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15];return this.setValues(w*(O*z-I*G)-b*(C*z-A*G)+B*(C*I-A*O),-(v*(O*z-I*G)-b*(m*z-S*G)+B*(m*I-S*O)),v*(C*z-A*G)-w*(m*z-S*G)+B*(m*A-S*C),-(v*(C*I-A*O)-w*(m*I-S*O)+b*(m*A-S*C)),-(M*(O*z-I*G)-P*(C*z-A*G)+D*(C*I-A*O)),d*(O*z-I*G)-P*(m*z-S*G)+D*(m*I-S*O),-(d*(C*z-A*G)-M*(m*z-S*G)+D*(m*A-S*C)),d*(C*I-A*O)-M*(m*I-S*O)+P*(m*A-S*C),M*(b*z-I*B)-P*(w*z-A*B)+D*(w*I-A*b),-(d*(b*z-I*B)-P*(v*z-S*B)+D*(v*I-S*b)),d*(w*z-A*B)-M*(v*z-S*B)+D*(v*A-S*w),-(d*(w*I-A*b)-M*(v*I-S*b)+P*(v*A-S*w)),-(M*(b*G-O*B)-P*(w*G-C*B)+D*(w*O-C*b)),d*(b*G-O*B)-P*(v*G-m*B)+D*(v*O-m*b),-(d*(w*G-C*B)-M*(v*G-m*B)+D*(v*C-m*w)),d*(w*O-C*b)-M*(v*O-m*b)+P*(v*C-m*w))},determinant:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],w=c[5],C=c[6],A=c[7],P=c[8],b=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],X=d*w-v*M,K=d*C-m*M,Q=d*A-S*M,tt=v*C-m*w,Y=v*A-S*w,Z=m*A-S*C,U=P*B-b*D,H=P*G-O*D,J=P*z-I*D,_=b*G-O*B,q=b*z-I*B,at=O*z-I*G;return X*at-K*q+Q*_+tt*J-Y*H+Z*U},multiply:function(c){var d=this.val,v=d[0],m=d[1],S=d[2],M=d[3],w=d[4],C=d[5],A=d[6],P=d[7],b=d[8],O=d[9],I=d[10],D=d[11],B=d[12],G=d[13],z=d[14],X=d[15],K=c.val,Q=K[0],tt=K[1],Y=K[2],Z=K[3];return d[0]=Q*v+tt*w+Y*b+Z*B,d[1]=Q*m+tt*C+Y*O+Z*G,d[2]=Q*S+tt*A+Y*I+Z*z,d[3]=Q*M+tt*P+Y*D+Z*X,Q=K[4],tt=K[5],Y=K[6],Z=K[7],d[4]=Q*v+tt*w+Y*b+Z*B,d[5]=Q*m+tt*C+Y*O+Z*G,d[6]=Q*S+tt*A+Y*I+Z*z,d[7]=Q*M+tt*P+Y*D+Z*X,Q=K[8],tt=K[9],Y=K[10],Z=K[11],d[8]=Q*v+tt*w+Y*b+Z*B,d[9]=Q*m+tt*C+Y*O+Z*G,d[10]=Q*S+tt*A+Y*I+Z*z,d[11]=Q*M+tt*P+Y*D+Z*X,Q=K[12],tt=K[13],Y=K[14],Z=K[15],d[12]=Q*v+tt*w+Y*b+Z*B,d[13]=Q*m+tt*C+Y*O+Z*G,d[14]=Q*S+tt*A+Y*I+Z*z,d[15]=Q*M+tt*P+Y*D+Z*X,this},multiplyLocal:function(c){var d=this.val,v=c.val;return this.setValues(d[0]*v[0]+d[1]*v[4]+d[2]*v[8]+d[3]*v[12],d[0]*v[1]+d[1]*v[5]+d[2]*v[9]+d[3]*v[13],d[0]*v[2]+d[1]*v[6]+d[2]*v[10]+d[3]*v[14],d[0]*v[3]+d[1]*v[7]+d[2]*v[11]+d[3]*v[15],d[4]*v[0]+d[5]*v[4]+d[6]*v[8]+d[7]*v[12],d[4]*v[1]+d[5]*v[5]+d[6]*v[9]+d[7]*v[13],d[4]*v[2]+d[5]*v[6]+d[6]*v[10]+d[7]*v[14],d[4]*v[3]+d[5]*v[7]+d[6]*v[11]+d[7]*v[15],d[8]*v[0]+d[9]*v[4]+d[10]*v[8]+d[11]*v[12],d[8]*v[1]+d[9]*v[5]+d[10]*v[9]+d[11]*v[13],d[8]*v[2]+d[9]*v[6]+d[10]*v[10]+d[11]*v[14],d[8]*v[3]+d[9]*v[7]+d[10]*v[11]+d[11]*v[15],d[12]*v[0]+d[13]*v[4]+d[14]*v[8]+d[15]*v[12],d[12]*v[1]+d[13]*v[5]+d[14]*v[9]+d[15]*v[13],d[12]*v[2]+d[13]*v[6]+d[14]*v[10]+d[15]*v[14],d[12]*v[3]+d[13]*v[7]+d[14]*v[11]+d[15]*v[15])},premultiply:function(c){return this.multiplyMatrices(c,this)},multiplyMatrices:function(c,d){var v=c.val,m=d.val,S=v[0],M=v[4],w=v[8],C=v[12],A=v[1],P=v[5],b=v[9],O=v[13],I=v[2],D=v[6],B=v[10],G=v[14],z=v[3],X=v[7],K=v[11],Q=v[15],tt=m[0],Y=m[4],Z=m[8],U=m[12],H=m[1],J=m[5],_=m[9],q=m[13],at=m[2],ot=m[6],rt=m[10],gt=m[14],yt=m[3],Et=m[7],At=m[11],Pt=m[15];return this.setValues(S*tt+M*H+w*at+C*yt,A*tt+P*H+b*at+O*yt,I*tt+D*H+B*at+G*yt,z*tt+X*H+K*at+Q*yt,S*Y+M*J+w*ot+C*Et,A*Y+P*J+b*ot+O*Et,I*Y+D*J+B*ot+G*Et,z*Y+X*J+K*ot+Q*Et,S*Z+M*_+w*rt+C*At,A*Z+P*_+b*rt+O*At,I*Z+D*_+B*rt+G*At,z*Z+X*_+K*rt+Q*At,S*U+M*q+w*gt+C*Pt,A*U+P*q+b*gt+O*Pt,I*U+D*q+B*gt+G*Pt,z*U+X*q+K*gt+Q*Pt)},translate:function(c){return this.translateXYZ(c.x,c.y,c.z)},translateXYZ:function(c,d,v){var m=this.val;return m[12]=m[0]*c+m[4]*d+m[8]*v+m[12],m[13]=m[1]*c+m[5]*d+m[9]*v+m[13],m[14]=m[2]*c+m[6]*d+m[10]*v+m[14],m[15]=m[3]*c+m[7]*d+m[11]*v+m[15],this},scale:function(c){return this.scaleXYZ(c.x,c.y,c.z)},scaleXYZ:function(c,d,v){var m=this.val;return m[0]=m[0]*c,m[1]=m[1]*c,m[2]=m[2]*c,m[3]=m[3]*c,m[4]=m[4]*d,m[5]=m[5]*d,m[6]=m[6]*d,m[7]=m[7]*d,m[8]=m[8]*v,m[9]=m[9]*v,m[10]=m[10]*v,m[11]=m[11]*v,this},makeRotationAxis:function(c,d){var v=Math.cos(d),m=Math.sin(d),S=1-v,M=c.x,w=c.y,C=c.z,A=S*M,P=S*w;return this.setValues(A*M+v,A*w-m*C,A*C+m*w,0,A*w+m*C,P*w+v,P*C-m*M,0,A*C-m*w,P*C+m*M,S*C*C+v,0,0,0,0,1)},rotate:function(c,d){var v=this.val,m=d.x,S=d.y,M=d.z,w=Math.sqrt(m*m+S*S+M*M);if(Math.abs(w){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.min(e+r,p)};s.exports=y},50040:s=>{/** + * @author Vladislav Forsh + * @copyright 2021 RoboWhale + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=e.length;if(r===0)return 0;e.sort(function(h,a){return h-a});var p=Math.floor(r/2);return r%2===0?(e[p]+e[p-1])/2:e[p]};s.exports=y},37204:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.max(e-r,p)};s.exports=y},65201:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){p===void 0&&(p=r+1);var a=(e-r)/(p-r);return a>1?h!==void 0?(a=(h-e)/(h-p),a<0&&(a=0)):a=1:a<0&&(a=0),a};s.exports=y},15746:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94434),h=e(29747),a=e(25836),l=1e-6,n=new Int8Array([1,2,0]),u=new Float32Array([0,0,0]),f=new a(1,0,0),o=new a(0,1,0),c=new a,d=new p,v=new r({initialize:function(S,M,w,C){this.onChangeCallback=h,this.set(S,M,w,C)},x:{get:function(){return this._x},set:function(m){this._x=m,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(m){this._y=m,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(m){this._z=m,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(m){this._w=m,this.onChangeCallback(this)}},copy:function(m){return this.set(m)},set:function(m,S,M,w,C){return C===void 0&&(C=!0),typeof m=="object"?(this._x=m.x||0,this._y=m.y||0,this._z=m.z||0,this._w=m.w||0):(this._x=m||0,this._y=S||0,this._z=M||0,this._w=w||0),C&&this.onChangeCallback(this),this},add:function(m){return this._x+=m.x,this._y+=m.y,this._z+=m.z,this._w+=m.w,this.onChangeCallback(this),this},subtract:function(m){return this._x-=m.x,this._y-=m.y,this._z-=m.z,this._w-=m.w,this.onChangeCallback(this),this},scale:function(m){return this._x*=m,this._y*=m,this._z*=m,this._w*=m,this.onChangeCallback(this),this},length:function(){var m=this.x,S=this.y,M=this.z,w=this.w;return Math.sqrt(m*m+S*S+M*M+w*w)},lengthSq:function(){var m=this.x,S=this.y,M=this.z,w=this.w;return m*m+S*S+M*M+w*w},normalize:function(){var m=this.x,S=this.y,M=this.z,w=this.w,C=m*m+S*S+M*M+w*w;return C>0&&(C=1/Math.sqrt(C),this._x=m*C,this._y=S*C,this._z=M*C,this._w=w*C),this.onChangeCallback(this),this},dot:function(m){return this.x*m.x+this.y*m.y+this.z*m.z+this.w*m.w},lerp:function(m,S){S===void 0&&(S=0);var M=this.x,w=this.y,C=this.z,A=this.w;return this.set(M+S*(m.x-M),w+S*(m.y-w),C+S*(m.z-C),A+S*(m.w-A))},rotationTo:function(m,S){var M=m.x*S.x+m.y*S.y+m.z*S.z;return M<-.999999?(c.copy(f).cross(m).length().999999?this.set(0,0,0,1):(c.copy(m).cross(S),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+M,this.normalize())},setAxes:function(m,S,M){var w=d.val;return w[0]=S.x,w[3]=S.y,w[6]=S.z,w[1]=M.x,w[4]=M.y,w[7]=M.z,w[2]=-m.x,w[5]=-m.y,w[8]=-m.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(m,S){S=S*.5;var M=Math.sin(S);return this.set(M*m.x,M*m.y,M*m.z,Math.cos(S))},multiply:function(m){var S=this.x,M=this.y,w=this.z,C=this.w,A=m.x,P=m.y,b=m.z,O=m.w;return this.set(S*O+C*A+M*b-w*P,M*O+C*P+w*A-S*b,w*O+C*b+S*P-M*A,C*O-S*A-M*P-w*b)},slerp:function(m,S){var M=this.x,w=this.y,C=this.z,A=this.w,P=m.x,b=m.y,O=m.z,I=m.w,D=M*P+w*b+C*O+A*I;D<0&&(D=-D,P=-P,b=-b,O=-O,I=-I);var B=1-S,G=S;if(1-D>l){var z=Math.acos(D),X=Math.sin(z);B=Math.sin((1-S)*z)/X,G=Math.sin(S*z)/X}return this.set(B*M+G*P,B*w+G*b,B*C+G*O,B*A+G*I)},invert:function(){var m=this.x,S=this.y,M=this.z,w=this.w,C=m*m+S*S+M*M+w*w,A=C?1/C:0;return this.set(-m*A,-S*A,-M*A,w*A)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P+C*A,M*P+w*A,w*P-M*A,C*P-S*A)},rotateY:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P-w*A,M*P+C*A,w*P+S*A,C*P-M*A)},rotateZ:function(m){m*=.5;var S=this.x,M=this.y,w=this.z,C=this.w,A=Math.sin(m),P=Math.cos(m);return this.set(S*P+M*A,M*P-S*A,w*P+C*A,C*P-w*A)},calculateW:function(){var m=this.x,S=this.y,M=this.z;return this.w=-Math.sqrt(1-m*m-S*S-M*M),this},setFromEuler:function(m,S){var M=m.x/2,w=m.y/2,C=m.z/2,A=Math.cos(M),P=Math.cos(w),b=Math.cos(C),O=Math.sin(M),I=Math.sin(w),D=Math.sin(C);switch(m.order){case"XYZ":{this.set(O*P*b+A*I*D,A*I*b-O*P*D,A*P*D+O*I*b,A*P*b-O*I*D,S);break}case"YXZ":{this.set(O*P*b+A*I*D,A*I*b-O*P*D,A*P*D-O*I*b,A*P*b+O*I*D,S);break}case"ZXY":{this.set(O*P*b-A*I*D,A*I*b+O*P*D,A*P*D+O*I*b,A*P*b-O*I*D,S);break}case"ZYX":{this.set(O*P*b-A*I*D,A*I*b+O*P*D,A*P*D-O*I*b,A*P*b+O*I*D,S);break}case"YZX":{this.set(O*P*b+A*I*D,A*I*b+O*P*D,A*P*D-O*I*b,A*P*b-O*I*D,S);break}case"XZY":{this.set(O*P*b-A*I*D,A*I*b-O*P*D,A*P*D+O*I*b,A*P*b+O*I*D,S);break}}return this},setFromRotationMatrix:function(m){var S=m.val,M=S[0],w=S[4],C=S[8],A=S[1],P=S[5],b=S[9],O=S[2],I=S[6],D=S[10],B=M+P+D,G;return B>0?(G=.5/Math.sqrt(B+1),this.set((I-b)*G,(C-O)*G,(A-w)*G,.25/G)):M>P&&M>D?(G=2*Math.sqrt(1+M-P-D),this.set(.25*G,(w+A)/G,(C+O)/G,(I-b)/G)):P>D?(G=2*Math.sqrt(1+P-M-D),this.set((w+A)/G,.25*G,(b+I)/G,(C-O)/G)):(G=2*Math.sqrt(1+D-M-P),this.set((C+O)/G,(b+I)/G,.25*G,(A-w)/G)),this},fromMat3:function(m){var S=m.val,M=S[0]+S[4]+S[8],w;if(M>0)w=Math.sqrt(M+1),this.w=.5*w,w=.5/w,this._x=(S[7]-S[5])*w,this._y=(S[2]-S[6])*w,this._z=(S[3]-S[1])*w;else{var C=0;S[4]>S[0]&&(C=1),S[8]>S[C*3+C]&&(C=2);var A=n[C],P=n[A];w=Math.sqrt(S[C*3+C]-S[A*3+A]-S[P*3+P]+1),u[C]=.5*w,w=.5/w,u[A]=(S[A*3+C]+S[C*3+A])*w,u[P]=(S[P*3+C]+S[C*3+P])*w,this._x=u[0],this._y=u[1],this._z=u[2],this._w=(S[P*3+A]-S[A*3+P])*w}return this.onChangeCallback(this),this}});s.exports=v},43396:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h*r.RAD_TO_DEG};s.exports=p},74362:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI;return e.x=Math.cos(p)*r,e.y=Math.sin(p)*r,e};s.exports=y},60706:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI,h=Math.random()*2-1,a=Math.sqrt(1-h*h)*r;return e.x=Math.cos(p)*a,e.y=Math.sin(p)*a,e.z=h*r,e};s.exports=y},67421:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1),e.x=(Math.random()*2-1)*r,e.y=(Math.random()*2-1)*r,e.z=(Math.random()*2-1)*r,e.w=(Math.random()*2-1)*r,e};s.exports=y},36305:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x,h=e.y;return e.x=p*Math.cos(r)-h*Math.sin(r),e.y=p*Math.sin(r)+h*Math.cos(r),e};s.exports=y},11520:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=Math.cos(h),l=Math.sin(h),n=e.x-r,u=e.y-p;return e.x=n*a-u*l+r,e.y=n*l+u*a+p,e};s.exports=y},1163:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){var l=h+Math.atan2(e.y-p,e.x-r);return e.x=r+a*Math.cos(l),e.y=p+a*Math.sin(l),e};s.exports=y},70336:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return e.x=r+a*Math.cos(h),e.y=p+a*Math.sin(h),e};s.exports=y},72678:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(25836),p=e(37867),h=e(15746),a=new p,l=new h,n=new r,u=function(f,o,c){return l.setAxisAngle(o,c),a.fromRotationTranslation(l,n.set(0,0,0)),f.transformMat4(a)};s.exports=u},2284:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>0?Math.ceil(e):Math.floor(e)};s.exports=y},41013:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.round(e*h)/h};s.exports=y},16922:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=1),p===void 0&&(p=1),h===void 0&&(h=1),h*=Math.PI/e;for(var a=[],l=[],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e<=r?0:e>=p?1:(e=(e-r)/(p-r),e*e*(3-2*e))};s.exports=y},54261:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e=Math.max(0,Math.min(1,(e-r)/(p-r))),e*e*e*(e*(e*6-15)+10)};s.exports=y},44408:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n){n===void 0&&(n=new r);var u=0,f=0,o=a*l;return h>0&&h<=o&&(h>a-1?(f=Math.floor(h/a),u=h-f*a):u=h),n.set(u,f)};s.exports=p},85955:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f,o,c){c===void 0&&(c=new r);var d=Math.sin(u),v=Math.cos(u),m=v*f,S=d*f,M=-d*o,w=v*o,C=1/(m*w+M*-S);return c.x=w*C*h+-M*C*a+(n*M-l*w)*C,c.y=m*C*a+-S*C*h+(-n*m+l*S)*C,c};s.exports=p},26099:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(43855),h=new r({initialize:function(l,n){this.x=0,this.y=0,typeof l=="object"?(this.x=l.x||0,this.y=l.y||0):(n===void 0&&(n=l),this.x=l||0,this.y=n||0)},clone:function(){return new h(this.x,this.y)},copy:function(a){return this.x=a.x||0,this.y=a.y||0,this},setFromObject:function(a){return this.x=a.x||0,this.y=a.y||0,this},set:function(a,l){return l===void 0&&(l=a),this.x=a,this.y=l,this},setTo:function(a,l){return this.set(a,l)},setToPolar:function(a,l){return l==null&&(l=1),this.x=Math.cos(a)*l,this.y=Math.sin(a)*l,this},equals:function(a){return this.x===a.x&&this.y===a.y},fuzzyEquals:function(a,l){return p(this.x,a.x,l)&&p(this.y,a.y,l)},angle:function(){var a=Math.atan2(this.y,this.x);return a<0&&(a+=2*Math.PI),a},setAngle:function(a){return this.setToPolar(a,this.length())},add:function(a){return this.x+=a.x,this.y+=a.y,this},subtract:function(a){return this.x-=a.x,this.y-=a.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},scale:function(a){return isFinite(a)?(this.x*=a,this.y*=a):(this.x=0,this.y=0),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(a){var l=a.x-this.x,n=a.y-this.y;return Math.sqrt(l*l+n*n)},distanceSq:function(a){var l=a.x-this.x,n=a.y-this.y;return l*l+n*n},length:function(){var a=this.x,l=this.y;return Math.sqrt(a*a+l*l)},setLength:function(a){return this.normalize().scale(a)},lengthSq:function(){var a=this.x,l=this.y;return a*a+l*l},normalize:function(){var a=this.x,l=this.y,n=a*a+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=a*n,this.y=l*n),this},normalizeRightHand:function(){var a=this.x;return this.x=this.y*-1,this.y=a,this},normalizeLeftHand:function(){var a=this.x;return this.x=this.y,this.y=a*-1,this},dot:function(a){return this.x*a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lerp:function(a,l){l===void 0&&(l=0);var n=this.x,u=this.y;return this.x=n+l*(a.x-n),this.y=u+l*(a.y-u),this},transformMat3:function(a){var l=this.x,n=this.y,u=a.val;return this.x=u[0]*l+u[3]*n+u[6],this.y=u[1]*l+u[4]*n+u[7],this},transformMat4:function(a){var l=this.x,n=this.y,u=a.val;return this.x=u[0]*l+u[4]*n+u[12],this.y=u[1]*l+u[5]*n+u[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(a){var l=this.length();return l&&l>a&&this.scale(a/l),this},reflect:function(a){return a=a.clone().normalize(),this.subtract(a.scale(2*this.dot(a)))},mirror:function(a){return this.reflect(a).negate()},rotate:function(a){var l=Math.cos(a),n=Math.sin(a);return this.set(l*this.x-n*this.y,n*this.x+l*this.y)},project:function(a){var l=this.dot(a)/a.dot(a);return this.copy(a).scale(l)}});h.ZERO=new h,h.RIGHT=new h(1,0),h.LEFT=new h(-1,0),h.UP=new h(0,-1),h.DOWN=new h(0,1),h.ONE=new h(1,1),s.exports=h},25836:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.x=0,this.y=0,this.z=0,typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0):(this.x=a||0,this.y=l||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(h){return this.x=Math.min(this.x,h.x),this.y=Math.min(this.y,h.y),this.z=Math.min(this.z,h.z),this},max:function(h){return this.x=Math.max(this.x,h.x),this.y=Math.max(this.y,h.y),this.z=Math.max(this.z,h.z),this},clone:function(){return new p(this.x,this.y,this.z)},addVectors:function(h,a){return this.x=h.x+a.x,this.y=h.y+a.y,this.z=h.z+a.z,this},crossVectors:function(h,a){var l=h.x,n=h.y,u=h.z,f=a.x,o=a.y,c=a.z;return this.x=n*c-u*o,this.y=u*f-l*c,this.z=l*o-n*f,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this},set:function(h,a,l){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0):(this.x=h||0,this.y=a||0,this.z=l||0),this},setFromMatrixPosition:function(h){return this.fromArray(h.val,12)},setFromMatrixColumn:function(h,a){return this.fromArray(h.val,a*4)},fromArray:function(h,a){return a===void 0&&(a=0),this.x=h[a],this.y=h[a+1],this.z=h[a+2],this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this},addScalar:function(h){return this.x+=h,this.y+=h,this.z+=h,this},addScale:function(h,a){return this.x+=h.x*a,this.y+=h.y*a,this.z+=h.z*a||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this},scale:function(h){return isFinite(h)?(this.x*=h,this.y*=h,this.z*=h):(this.x=0,this.y=0,this.z=0),this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return Math.sqrt(a*a+l*l+n*n)},distanceSq:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return a*a+l*l+n*n},length:function(){var h=this.x,a=this.y,l=this.z;return Math.sqrt(h*h+a*a+l*l)},lengthSq:function(){var h=this.x,a=this.y,l=this.z;return h*h+a*a+l*l},normalize:function(){var h=this.x,a=this.y,l=this.z,n=h*h+a*a+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=h*n,this.y=a*n,this.z=l*n),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z},cross:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z;return this.x=l*o-n*f,this.y=n*u-a*o,this.z=a*f-l*u,this},lerp:function(h,a){a===void 0&&(a=0);var l=this.x,n=this.y,u=this.z;return this.x=l+a*(h.x-l),this.y=n+a*(h.y-n),this.z=u+a*(h.z-u),this},applyMatrix3:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*a+u[3]*l+u[6]*n,this.y=u[1]*a+u[4]*l+u[7]*n,this.z=u[2]*a+u[5]*l+u[8]*n,this},applyMatrix4:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=1/(u[3]*a+u[7]*l+u[11]*n+u[15]);return this.x=(u[0]*a+u[4]*l+u[8]*n+u[12])*f,this.y=(u[1]*a+u[5]*l+u[9]*n+u[13])*f,this.z=(u[2]*a+u[6]*l+u[10]*n+u[14])*f,this},transformMat3:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=a*u[0]+l*u[3]+n*u[6],this.y=a*u[1]+l*u[4]+n*u[7],this.z=a*u[2]+l*u[5]+n*u[8],this},transformMat4:function(h){var a=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*a+u[4]*l+u[8]*n+u[12],this.y=u[1]*a+u[5]*l+u[9]*n+u[13],this.z=u[2]*a+u[6]*l+u[10]*n+u[14],this},transformCoordinates:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=a*u[0]+l*u[4]+n*u[8]+u[12],o=a*u[1]+l*u[5]+n*u[9]+u[13],c=a*u[2]+l*u[6]+n*u[10]+u[14],d=a*u[3]+l*u[7]+n*u[11]+u[15];return this.x=f/d,this.y=o/d,this.z=c/d,this},transformQuat:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z,c=h.w,d=c*a+f*n-o*l,v=c*l+o*a-u*n,m=c*n+u*l-f*a,S=-u*a-f*l-o*n;return this.x=d*c+S*-u+v*-o-m*-f,this.y=v*c+S*-f+m*-u-d*-o,this.z=m*c+S*-o+d*-f-v*-u,this},project:function(h){var a=this.x,l=this.y,n=this.z,u=h.val,f=u[0],o=u[1],c=u[2],d=u[3],v=u[4],m=u[5],S=u[6],M=u[7],w=u[8],C=u[9],A=u[10],P=u[11],b=u[12],O=u[13],I=u[14],D=u[15],B=1/(a*d+l*M+n*P+D);return this.x=(a*f+l*v+n*w+b)*B,this.y=(a*o+l*m+n*C+O)*B,this.z=(a*c+l*S+n*A+I)*B,this},projectViewMatrix:function(h,a){return this.applyMatrix4(h).applyMatrix4(a)},unprojectViewMatrix:function(h,a){return this.applyMatrix4(h).applyMatrix4(a)},unproject:function(h,a){var l=h.x,n=h.y,u=h.z,f=h.w,o=this.x-l,c=f-this.y-1-n,d=this.z;return this.x=2*o/u-1,this.y=2*c/f-1,this.z=2*d-1,this.project(a)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});p.ZERO=new p,p.RIGHT=new p(1,0,0),p.LEFT=new p(-1,0,0),p.UP=new p(0,-1,0),p.DOWN=new p(0,1,0),p.FORWARD=new p(0,0,1),p.BACK=new p(0,0,-1),p.ONE=new p(1,1,1),s.exports=p},61369:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){this.x=0,this.y=0,this.z=0,this.w=0,typeof a=="object"?(this.x=a.x||0,this.y=a.y||0,this.z=a.z||0,this.w=a.w||0):(this.x=a||0,this.y=l||0,this.z=n||0,this.w=u||0)},clone:function(){return new p(this.x,this.y,this.z,this.w)},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this.w=h.w||0,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z&&this.w===h.w},set:function(h,a,l,n){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0,this.w=h.w||0):(this.x=h||0,this.y=a||0,this.z=l||0,this.w=n||0),this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this.w+=h.w||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this.w-=h.w||0,this},scale:function(h){return this.x*=h,this.y*=h,this.z*=h,this.w*=h,this},length:function(){var h=this.x,a=this.y,l=this.z,n=this.w;return Math.sqrt(h*h+a*a+l*l+n*n)},lengthSq:function(){var h=this.x,a=this.y,l=this.z,n=this.w;return h*h+a*a+l*l+n*n},normalize:function(){var h=this.x,a=this.y,l=this.z,n=this.w,u=h*h+a*a+l*l+n*n;return u>0&&(u=1/Math.sqrt(u),this.x=h*u,this.y=a*u,this.z=l*u,this.w=n*u),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z+this.w*h.w},lerp:function(h,a){a===void 0&&(a=0);var l=this.x,n=this.y,u=this.z,f=this.w;return this.x=l+a*(h.x-l),this.y=n+a*(h.y-n),this.z=u+a*(h.z-u),this.w=f+a*(h.w-f),this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this.w*=h.w||1,this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this.w/=h.w||1,this},distance:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return Math.sqrt(a*a+l*l+n*n+u*u)},distanceSq:function(h){var a=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return a*a+l*l+n*n+u*u},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(h){var a=this.x,l=this.y,n=this.z,u=this.w,f=h.val;return this.x=f[0]*a+f[4]*l+f[8]*n+f[12]*u,this.y=f[1]*a+f[5]*l+f[9]*n+f[13]*u,this.z=f[2]*a+f[6]*l+f[10]*n+f[14]*u,this.w=f[3]*a+f[7]*l+f[11]*n+f[15]*u,this},transformQuat:function(h){var a=this.x,l=this.y,n=this.z,u=h.x,f=h.y,o=h.z,c=h.w,d=c*a+f*n-o*l,v=c*l+o*a-u*n,m=c*n+u*l-f*a,S=-u*a-f*l-o*n;return this.x=d*c+S*-u+v*-o-m*-f,this.y=v*c+S*-f+m*-u-d*-o,this.z=m*c+S*-o+d*-f-v*-u,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});p.prototype.sub=p.prototype.subtract,p.prototype.mul=p.prototype.multiply,p.prototype.div=p.prototype.divide,p.prototype.dist=p.prototype.distance,p.prototype.distSq=p.prototype.distanceSq,p.prototype.len=p.prototype.length,p.prototype.lenSq=p.prototype.lengthSq,s.exports=p},60417:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return Math.abs(e-r)<=p};s.exports=y},15994:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p-r;return r+((e-r)%h+h)%h};s.exports=y},31040:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.atan2(h-r,p-e)};s.exports=y},55495:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.atan2(r.y-e.y,r.x-e.x)};s.exports=y},128:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return Math.atan2(r.x-e.x,r.y-e.y)};s.exports=y},41273:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.atan2(p-e,h-r)};s.exports=y},1432:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h){return h>Math.PI&&(h-=r.PI2),Math.abs(((h+r.TAU)%r.PI2-r.PI2)%r.PI2)};s.exports=p},12407:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e=e%(2*Math.PI),e>=0?e:e+2*Math.PI};s.exports=y},53993:(s,y,e)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99472),p=function(){return r(-Math.PI,Math.PI)};s.exports=p},86564:(s,y,e)=>{/** + * @author Richard Davey + * @author @samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(99472),p=function(){return r(-180,180)};s.exports=p},90154:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(12407),p=function(h){return r(h+Math.PI)};s.exports=p},48736:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=function(h,a,l){return l===void 0&&(l=.05),h===a||(Math.abs(a-h)<=l||Math.abs(a-h)>=r.PI2-l?h=a:(Math.abs(a-h)>Math.PI&&(ah?h+=l:a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=r-e;if(p===0)return 0;var h=Math.floor((p- -180)/360);return p-h*360};s.exports=y},86554:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h){return r(h,-Math.PI,Math.PI)};s.exports=p},30954:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15994),p=function(h){return r(h,-180,180)};s.exports=p},25588:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Between:e(31040),BetweenPoints:e(55495),BetweenPointsY:e(128),BetweenY:e(41273),CounterClockwise:e(1432),Normalize:e(12407),Random:e(53993),RandomDegrees:e(86564),Reverse:e(90154),RotateTo:e(48736),ShortestBetween:e(61430),Wrap:e(86554),WrapDegrees:e(30954)}},36383:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={PI2:Math.PI*2,TAU:Math.PI*.5,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};s.exports=y},20339:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e-p,l=r-h;return Math.sqrt(a*a+l*l)};s.exports=y},52816:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x-r.x,h=e.y-r.y;return Math.sqrt(p*p+h*h)};s.exports=y},64559:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.x-r.x,h=e.y-r.y;return p*p+h*h};s.exports=y},82340:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.max(Math.abs(e-p),Math.abs(r-h))};s.exports=y},14390:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){return a===void 0&&(a=2),Math.sqrt(Math.pow(p-e,a)+Math.pow(h-r,a))};s.exports=y},2243:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return Math.abs(e-p)+Math.abs(r-h)};s.exports=y},89774:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e-p,l=r-h;return a*a+l*l};s.exports=y},50994:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Between:e(20339),BetweenPoints:e(52816),BetweenPointsSquared:e(64559),Chebyshev:e(82340),Power:e(14390),Snake:e(2243),Squared:e(89774)}},62640:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54178),p=e(41521),h=e(79980),a=e(85433),l=e(99140),n=e(48857),u=e(81596),f=e(59133),o=e(98516),c=e(35248),d=e(82500),v=e(49752);s.exports={Power0:u,Power1:f.Out,Power2:a.Out,Power3:o.Out,Power4:c.Out,Linear:u,Quad:f.Out,Cubic:a.Out,Quart:o.Out,Quint:c.Out,Sine:d.Out,Expo:n.Out,Circ:h.Out,Elastic:l.Out,Back:r.Out,Bounce:p.Out,Stepped:v,"Quad.easeIn":f.In,"Cubic.easeIn":a.In,"Quart.easeIn":o.In,"Quint.easeIn":c.In,"Sine.easeIn":d.In,"Expo.easeIn":n.In,"Circ.easeIn":h.In,"Elastic.easeIn":l.In,"Back.easeIn":r.In,"Bounce.easeIn":p.In,"Quad.easeOut":f.Out,"Cubic.easeOut":a.Out,"Quart.easeOut":o.Out,"Quint.easeOut":c.Out,"Sine.easeOut":d.Out,"Expo.easeOut":n.Out,"Circ.easeOut":h.Out,"Elastic.easeOut":l.Out,"Back.easeOut":r.Out,"Bounce.easeOut":p.Out,"Quad.easeInOut":f.InOut,"Cubic.easeInOut":a.InOut,"Quart.easeInOut":o.InOut,"Quint.easeInOut":c.InOut,"Sine.easeInOut":d.InOut,"Expo.easeInOut":n.InOut,"Circ.easeInOut":h.InOut,"Elastic.easeInOut":l.InOut,"Back.easeInOut":r.InOut,"Bounce.easeInOut":p.InOut}},1639:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1.70158),e*e*((r+1)*e-r)};s.exports=y},50099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1.70158);var p=r*1.525;return(e*=2)<1?.5*(e*e*((p+1)*e-p)):.5*((e-=2)*e*((p+1)*e+p)+2)};s.exports=y},41286:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1.70158),--e*e*((r+1)*e+r)+1};s.exports=y},54178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(1639),Out:e(41286),InOut:e(50099)}},59590:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e=1-e,e<.36363636363636365?1-7.5625*e*e:e<.7272727272727273?1-(7.5625*(e-=.5454545454545454)*e+.75):e<.9090909090909091?1-(7.5625*(e-=.8181818181818182)*e+.9375):1-(7.5625*(e-=.9545454545454546)*e+.984375)};s.exports=y},41788:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=!1;return e<.5?(e=1-e*2,r=!0):e=e*2-1,e<.36363636363636365?e=7.5625*e*e:e<.7272727272727273?e=7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?e=7.5625*(e-=.8181818181818182)*e+.9375:e=7.5625*(e-=.9545454545454546)*e+.984375,r?(1-e)*.5:e*.5+.5};s.exports=y},69905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375};s.exports=y},41521:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(59590),Out:e(69905),InOut:e(41788)}},91861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1-Math.sqrt(1-e*e)};s.exports=y},4177:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)};s.exports=y},57512:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.sqrt(1- --e*e)};s.exports=y},79980:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(91861),Out:e(57512),InOut:e(4177)}},51150:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e};s.exports=y},82820:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)};s.exports=y},35033:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return--e*e*e+1};s.exports=y},85433:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(51150),Out:e(35033),InOut:e(82820)}},69965:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p))};s.exports=y},50665:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-h)*(2*Math.PI)/p)*.5+1};s.exports=y},7744:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),e===0)return 0;if(e===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-h)*(2*Math.PI)/p)+1};s.exports=y},99140:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(69965),Out:e(7744),InOut:e(50665)}},24590:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return Math.pow(2,10*(e-1))-.001};s.exports=y},87844:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))};s.exports=y},89433:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1-Math.pow(2,-10*e)};s.exports=y},48857:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(24590),Out:e(89433),InOut:e(87844)}},48820:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Back:e(54178),Bounce:e(41521),Circular:e(79980),Cubic:e(85433),Elastic:e(99140),Expo:e(48857),Linear:e(81596),Quadratic:e(59133),Quartic:e(98516),Quintic:e(35248),Sine:e(82500),Stepped:e(49752)}},7147:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e};s.exports=y},81596:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=e(7147)},34826:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e};s.exports=y},20544:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)};s.exports=y},92029:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*(2-e)};s.exports=y},59133:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(34826),Out:e(92029),InOut:e(20544)}},64413:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e*e};s.exports=y},78137:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)};s.exports=y},45840:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return 1- --e*e*e*e};s.exports=y},98516:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(64413),Out:e(45840),InOut:e(78137)}},87745:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e*e*e*e*e};s.exports=y},16509:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)};s.exports=y},17868:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return--e*e*e*e*e+1};s.exports=y},35248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(87745),Out:e(17868),InOut:e(16509)}},80461:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:1-Math.cos(e*Math.PI/2)};s.exports=y},34025:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:.5*(1-Math.cos(Math.PI*e))};s.exports=y},52768:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e===0?0:e===1?1:Math.sin(e*Math.PI/2)};s.exports=y},82500:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={In:e(80461),Out:e(52768),InOut:e(34025)}},72251:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1),e<=0?0:e>=1?1:((r*e|0)+1)*(1/r)};s.exports=y},49752:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=e(72251)},75698:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1e-4),Math.ceil(e-r)};s.exports=y},43855:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),Math.abs(e-r){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r=1e-4),Math.floor(e+r)};s.exports=y},5470:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),e>r-p};s.exports=y},94977:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return p===void 0&&(p=1e-4),e{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Ceil:e(75698),Equal:e(43855),Floor:e(25777),GreaterThan:e(5470),LessThan:e(94977)}},75508:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36383),p=e(79291),h={Angle:e(25588),Distance:e(50994),Easing:e(48820),Fuzzy:e(48379),Interpolation:e(38289),Pow2:e(49001),Snap:e(73697),RandomDataGenerator:e(28453),Average:e(53307),Bernstein:e(85710),Between:e(30976),CatmullRom:e(87842),CeilTo:e(26302),Clamp:e(45319),DegToRad:e(39506),Difference:e(61241),Euler:e(38857),Factorial:e(6411),FloatBetween:e(99472),FloorTo:e(77623),FromPercent:e(62945),GetSpeed:e(38265),IsEven:e(78702),IsEvenStrict:e(94883),Linear:e(28915),LinearXY:e(94908),MaxAdd:e(86883),Median:e(50040),MinSub:e(37204),Percent:e(65201),RadToDeg:e(43396),RandomXY:e(74362),RandomXYZ:e(60706),RandomXYZW:e(67421),Rotate:e(36305),RotateAround:e(11520),RotateAroundDistance:e(1163),RotateTo:e(70336),RoundAwayFromZero:e(2284),RoundTo:e(41013),SinCosTableGenerator:e(16922),SmootherStep:e(54261),SmoothStep:e(7602),ToXY:e(44408),TransformXY:e(85955),Within:e(60417),Wrap:e(15994),Vector2:e(26099),Vector3:e(25836),Vector4:e(61369),Matrix3:e(94434),Matrix4:e(37867),Quaternion:e(15746),RotateVec3:e(72678)};h=p(!1,h,r),s.exports=h},89318:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85710),p=function(h,a){for(var l=0,n=h.length-1,u=0;u<=n;u++)l+=Math.pow(1-a,n-u)*Math.pow(a,u)*h[u]*r(n,u);return l};s.exports=p},77259:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87842),p=function(h,a){var l=h.length-1,n=l*a,u=Math.floor(n);return h[0]===h[l]?(a<0&&(u=Math.floor(n=l*(1+a))),r(n-u,h[(u-1+l)%l],h[u],h[(u+1)%l],h[(u+2)%l])):a<0?h[0]-(r(-n,h[0],h[0],h[1],h[1])-h[0]):a>1?h[l]-(r(n-l,h[l],h[l],h[l-1],h[l-1])-h[l]):r(n-u,h[u?u-1:0],h[u],h[l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(a,l){var n=1-a;return n*n*n*l}function e(a,l){var n=1-a;return 3*n*n*a*l}function r(a,l){return 3*(1-a)*a*a*l}function p(a,l){return a*a*a*l}var h=function(a,l,n,u,f){return y(a,l)+e(a,n)+r(a,u)+p(a,f)};s.exports=h},28392:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(28915),p=function(h,a){var l=h.length-1,n=l*a,u=Math.floor(n);return a<0?r(h[0],h[1],n):a>1?r(h[l],h[l-1],l-n):r(h[u],h[u+1>l?l:u+1],n-u)};s.exports=p},32112:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(h,a){var l=1-h;return l*l*a}function e(h,a){return 2*(1-h)*h*a}function r(h,a){return h*h*a}var p=function(h,a,l,n){return y(h,a)+e(h,l)+r(h,n)};s.exports=p},47235:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7602),p=function(h,a,l){return a+(l-a)*r(h,0,1)};s.exports=p},50178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(54261),p=function(h,a,l){return a+(l-a)*r(h,0,1)};s.exports=p},38289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Bezier:e(89318),CatmullRom:e(77259),CubicBezier:e(36316),Linear:e(28392),QuadraticBezier:e(32112),SmoothStep:e(47235),SmootherStep:e(50178)}},98439:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=Math.log(e)/.6931471805599453;return 1<{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e>0&&(e&e-1)===0&&r>0&&(r&r-1)===0};s.exports=y},81230:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e>0&&(e&e-1)===0};s.exports=y},49001:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GetNext:e(98439),IsSize:e(50030),IsValue:e(81230)}},28453:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){a===void 0&&(a=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],a&&this.init(a)},rnd:function(){var h=2091639*this.s0+this.c*23283064365386963e-26;return this.c=h|0,this.s0=this.s1,this.s1=this.s2,this.s2=h-this.c,this.s2},hash:function(h){var a,l=this.n;h=h.toString();for(var n=0;n>>0,a-=l,a*=l,l=a>>>0,a-=l,l+=a*4294967296;return this.n=l,(l>>>0)*23283064365386963e-26},init:function(h){typeof h=="string"?this.state(h):this.sow(h)},sow:function(h){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,!!h)for(var a=0;a0;l--){var n=Math.floor(this.frac()*(l+1)),u=h[n];h[n]=h[l],h[l]=u}return h}});s.exports=p},63448:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.ceil(e/r),h?(p+e)/r:p+e)};s.exports=y},56583:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.floor(e/r),h?(p+e)/r:p+e)};s.exports=y},77720:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){return p===void 0&&(p=0),r===0?e:(e-=p,e=r*Math.round(e/r),h?(p+e)/r:p+e)};s.exports=y},73697:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Ceil:e(63448),Floor:e(56583),To:e(77720)}},85454:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */e(63595);var r=e(8054),p=e(79291),h={Actions:e(61061),Animations:e(60421),BlendModes:e(10312),Cache:e(83388),Cameras:e(26638),Core:e(42857),Class:e(83419),Create:e(15822),Curves:e(25410),Data:e(44965),Display:e(27460),DOM:e(84902),Events:e(93055),FX:e(66064),Game:e(50127),GameObjects:e(77856),Geom:e(55738),Input:e(14350),Loader:e(57777),Math:e(75508),Physics:e(44563),Plugins:e(18922),Renderer:e(36909),Scale:e(93364),ScaleModes:e(29795),Scene:e(97482),Scenes:e(62194),Structs:e(41392),Textures:e(27458),Tilemaps:e(62501),Time:e(90291),Tweens:e(43066),Utils:e(91799)};h.Sound=e(23717),h=p(!1,h,r),s.exports=h,e.g.Phaser=h},71289:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92209),h=e(88571),a=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,o,c){h.call(this,n,u,f,o,c),this.body=null}});s.exports=a},86689:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39506),h=e(20339),a=e(89774),l=e(66022),n=e(95540),u=e(46975),f=e(72441),o=e(47956),c=e(37277),d=e(44594),v=e(26099),m=e(82248),S=new r({initialize:function(w){this.scene=w,this.systems=w.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,w.sys.events.once(d.BOOT,this.boot,this),w.sys.events.on(d.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new l(this.world),this.systems.events.once(d.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new l(this.world));var M=this.systems.events;n(this.config,"customUpdate",!1)||M.on(d.UPDATE,this.world.update,this.world),M.on(d.POST_UPDATE,this.world.postUpdate,this.world),M.once(d.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(d.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(d.UPDATE,this.world.update,this.world)},getConfig:function(){var M=this.systems.game.config.physics,w=this.systems.settings.physics,C=u(n(w,"arcade",{}),n(M,"arcade",{}));return C},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(M,w,C,A,P){return C===void 0&&(C=null),A===void 0&&(A=null),P===void 0&&(P=C),this.world.collideObjects(M,w,C,A,P,!0)},collide:function(M,w,C,A,P){return C===void 0&&(C=null),A===void 0&&(A=null),P===void 0&&(P=C),this.world.collideObjects(M,w,C,A,P,!1)},collideTiles:function(M,w,C,A,P){return this.world.collideTiles(M,w,C,A,P)},overlapTiles:function(M,w,C,A,P){return this.world.overlapTiles(M,w,C,A,P)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(M,w,C,A,P,b){A===void 0&&(A=60);var O=Math.atan2(C-M.y,w-M.x);return M.body.acceleration.setToPolar(O,A),P!==void 0&&b!==void 0&&M.body.maxVelocity.set(P,b),O},accelerateToObject:function(M,w,C,A,P){return this.accelerateTo(M,w.x,w.y,C,A,P)},closest:function(M,w){w||(w=this.world.bodies.entries);for(var C=Number.MAX_VALUE,A=null,P=M.x,b=M.y,O=w.length,I=0;IC&&(A=D,C=G)}}return A},moveTo:function(M,w,C,A,P){A===void 0&&(A=60),P===void 0&&(P=0);var b=Math.atan2(C-M.y,w-M.x);return P>0&&(A=h(M.x,M.y,w,C)/(P/1e3)),M.body.velocity.setToPolar(b,A),b},moveToObject:function(M,w,C,A){return this.moveTo(M,w.x,w.y,C,A)},velocityFromAngle:function(M,w,C){return w===void 0&&(w=60),C===void 0&&(C=new v),C.setToPolar(p(M),w)},velocityFromRotation:function(M,w,C){return w===void 0&&(w=60),C===void 0&&(C=new v),C.setToPolar(M,w)},overlapRect:function(M,w,C,A,P,b){return o(this.world,M,w,C,A,P,b)},overlapCirc:function(M,w,C,A,P){return f(this.world,M,w,C,A,P)},shutdown:function(){if(this.world){var M=this.systems.events;M.off(d.UPDATE,this.world.update,this.world),M.off(d.POST_UPDATE,this.world.postUpdate,this.world),M.off(d.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(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",S,"arcadePhysics"),s.exports=S},13759:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92209),h=e(68287),a=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,o,c){h.call(this,n,u,f,o,c),this.body=null}});s.exports=a},37742:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(78389),h=e(37747),a=e(63012),l=e(43396),n=e(87841),u=e(37303),f=e(95829),o=e(26099),c=new r({Mixins:[p],initialize:function(v,m){var S=64,M=64,w={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},C=m!==void 0;C&&m.displayWidth&&(S=m.displayWidth,M=m.displayHeight),C||(m=w),this.world=v,this.gameObject=C?m:void 0,this.isBody=!0,this.transform={x:m.x,y:m.y,rotation:m.angle,scaleX:m.scaleX,scaleY:m.scaleY,displayOriginX:m.displayOriginX,displayOriginY:m.displayOriginY},this.debugShowBody=v.defaults.debugShowBody,this.debugShowVelocity=v.defaults.debugShowVelocity,this.debugBodyColor=v.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new o,this.position=new o(m.x-m.scaleX*m.displayOriginX,m.y-m.scaleY*m.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=m.angle,this.preRotation=m.angle,this.width=S,this.height=M,this.sourceWidth=S,this.sourceHeight=M,m.frame&&(this.sourceWidth=m.frame.realWidth,this.sourceHeight=m.frame.realHeight),this.halfWidth=Math.abs(S/2),this.halfHeight=Math.abs(M/2),this.center=new o(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new o,this.newVelocity=new o,this.deltaMax=new o,this.acceleration=new o,this.allowDrag=!0,this.drag=new o,this.allowGravity=!0,this.gravity=new o,this.bounce=new o,this.worldBounce=null,this.customBoundsRectangle=v.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new o(1e4,1e4),this.maxSpeed=-1,this.friction=new o(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=h.FACING_NONE,this.immovable=!1,this.pushable=!0,this.slideFactor=new o(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=f(!1),this.touching=f(!0),this.wasTouching=f(!0),this.blocked=f(!0),this.syncBounds=!1,this.physicsType=h.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=m.scaleX,this._sy=m.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new n,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var d=this.gameObject,v=this.transform;if(d.parentContainer){var m=d.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);v.x=m.tx,v.y=m.ty,v.rotation=l(m.rotation),v.scaleX=m.scaleX,v.scaleY=m.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY}else v.x=d.x,v.y=d.y,v.rotation=d.angle,v.scaleX=d.scaleX,v.scaleY=d.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY;var S=!1;if(this.syncBounds){var M=d.getBounds(this._bounds);this.width=M.width,this.height=M.height,S=!0}else{var w=Math.abs(v.scaleX),C=Math.abs(v.scaleY);(this._sx!==w||this._sy!==C)&&(this.width=this.sourceWidth*w,this.height=this.sourceHeight*C,this._sx=w,this._sy=C,S=!0)}S&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var d=this.transform;this.position.x=d.x+d.scaleX*(this.offset.x-d.displayOriginX),this.position.y=d.y+d.scaleY*(this.offset.y-d.displayOriginY),this.updateCenter()},resetFlags:function(d){d===void 0&&(d=!1);var v=this.wasTouching,m=this.touching,S=this.blocked;d?f(!0,v):(v.none=m.none,v.up=m.up,v.down=m.down,v.left=m.left,v.right=m.right),f(!0,m),f(!0,S),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(d,v){if(d&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var m=this.position;this.prev.x=m.x,this.prev.y=m.y,this.prevFrame.x=m.x,this.prevFrame.y=m.y}d&&this.update(v)},update:function(d){var v=this.prev,m=this.position,S=this.velocity;if(v.set(m.x,m.y),!this.moves){this._dx=m.x-v.x,this._dy=m.y-v.y;return}if(this.directControl){var M=this.autoFrame;S.set((m.x-M.x)/d,(m.y-M.y)/d),this.world.updateMotion(this,d),this._dx=m.x-M.x,this._dy=m.y-M.y}else this.world.updateMotion(this,d),this.newVelocity.set(S.x*d,S.y*d),m.add(this.newVelocity),this._dx=m.x-v.x,this._dy=m.y-v.y;var w=S.x,C=S.y;if(this.updateCenter(),this.angle=Math.atan2(C,w),this.speed=Math.sqrt(w*w+C*C),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var A=this.blocked;this.world.emit(a.WORLD_BOUNDS,this,A.up,A.down,A.left,A.right)}},postUpdate:function(){var d=this.position,v=d.x-this.prevFrame.x,m=d.y-this.prevFrame.y,S=this.gameObject;if(this.moves){var M=this.deltaMax.x,w=this.deltaMax.y;M!==0&&v!==0&&(v<0&&v<-M?v=-M:v>0&&v>M&&(v=M)),w!==0&&m!==0&&(m<0&&m<-w?m=-w:m>0&&m>w&&(m=w)),S&&(S.x+=v,S.y+=m)}v<0?this.facing=h.FACING_LEFT:v>0&&(this.facing=h.FACING_RIGHT),m<0?this.facing=h.FACING_UP:m>0&&(this.facing=h.FACING_DOWN),this.allowRotation&&S&&(S.angle+=this.deltaZ()),this._tx=v,this._ty=m,this.autoFrame.set(d.x,d.y)},setBoundsRectangle:function(d){return this.customBoundsRectangle=d||this.world.bounds,this},checkWorldBounds:function(){var d=this.position,v=this.velocity,m=this.blocked,S=this.customBoundsRectangle,M=this.world.checkCollision,w=this.worldBounce?-this.worldBounce.x:-this.bounce.x,C=this.worldBounce?-this.worldBounce.y:-this.bounce.y,A=!1;return d.xS.right&&M.right&&(d.x=S.right-this.width,v.x*=w,m.right=!0,A=!0),d.yS.bottom&&M.down&&(d.y=S.bottom-this.height,v.y*=C,m.down=!0,A=!0),A&&(this.blocked.none=!1,this.updateCenter()),A},setOffset:function(d,v){return v===void 0&&(v=d),this.offset.set(d,v),this},setGameObject:function(d,v){return v===void 0&&(v=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=d,d.body&&(d.body=this),this.setSize(),this.world.add(this),this.enable=v,this},setSize:function(d,v,m){m===void 0&&(m=!0);var S=this.gameObject;if(S&&(!d&&S.frame&&(d=S.frame.realWidth),!v&&S.frame&&(v=S.frame.realHeight)),this.sourceWidth=d,this.sourceHeight=v,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(),m&&S&&S.getCenter){var M=(S.width-d)/2,w=(S.height-v)/2;this.offset.set(M,w)}return this.isCircle=!1,this.radius=0,this},setCircle:function(d,v,m){return v===void 0&&(v=this.offset.x),m===void 0&&(m=this.offset.y),d>0?(this.isCircle=!0,this.radius=d,this.sourceWidth=d*2,this.sourceHeight=d*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(v,m),this.updateCenter()):this.isCircle=!1,this},reset:function(d,v){this.stop();var m=this.gameObject;m&&(m.setPosition(d,v),this.rotation=m.angle,this.preRotation=m.angle);var S=this.position;m&&m.getTopLeft?m.getTopLeft(S):S.set(d,v),this.prev.copy(S),this.prevFrame.copy(S),this.autoFrame.copy(S),m&&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(d){return d.x=this.x,d.y=this.y,d.right=this.right,d.bottom=this.bottom,d},hitTest:function(d,v){if(!this.isCircle)return u(this,d,v);if(this.radius>0&&d>=this.left&&d<=this.right&&v>=this.top&&v<=this.bottom){var m=(this.center.x-d)*(this.center.x-d),S=(this.center.y-v)*(this.center.y-v);return m+S<=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(d){var v=this.position,m=v.x+this.halfWidth,S=v.y+this.halfHeight;this.debugShowBody&&(d.lineStyle(d.defaultStrokeWidth,this.debugBodyColor),this.isCircle?d.strokeCircle(m,S,this.width/2):(this.checkCollision.up&&d.lineBetween(v.x,v.y,v.x+this.width,v.y),this.checkCollision.right&&d.lineBetween(v.x+this.width,v.y,v.x+this.width,v.y+this.height),this.checkCollision.down&&d.lineBetween(v.x,v.y+this.height,v.x+this.width,v.y+this.height),this.checkCollision.left&&d.lineBetween(v.x,v.y,v.x,v.y+this.height))),this.debugShowVelocity&&(d.lineStyle(d.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),d.lineBetween(m,S,m+this.velocity.x/2,S+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(d){return d===void 0&&(d=!0),this.directControl=d,this},setCollideWorldBounds:function(d,v,m,S){d===void 0&&(d=!0),this.collideWorldBounds=d;var M=v!==void 0,w=m!==void 0;return(M||w)&&(this.worldBounce||(this.worldBounce=new o),M&&(this.worldBounce.x=v),w&&(this.worldBounce.y=m)),S!==void 0&&(this.onWorldBounds=S),this},setVelocity:function(d,v){return this.velocity.set(d,v),d=this.velocity.x,v=this.velocity.y,this.speed=Math.sqrt(d*d+v*v),this},setVelocityX:function(d){return this.setVelocity(d,this.velocity.y)},setVelocityY:function(d){return this.setVelocity(this.velocity.x,d)},setMaxVelocity:function(d,v){return this.maxVelocity.set(d,v),this},setMaxVelocityX:function(d){return this.maxVelocity.x=d,this},setMaxVelocityY:function(d){return this.maxVelocity.y=d,this},setMaxSpeed:function(d){return this.maxSpeed=d,this},setSlideFactor:function(d,v){return this.slideFactor.set(d,v),this},setBounce:function(d,v){return this.bounce.set(d,v),this},setBounceX:function(d){return this.bounce.x=d,this},setBounceY:function(d){return this.bounce.y=d,this},setAcceleration:function(d,v){return this.acceleration.set(d,v),this},setAccelerationX:function(d){return this.acceleration.x=d,this},setAccelerationY:function(d){return this.acceleration.y=d,this},setAllowDrag:function(d){return d===void 0&&(d=!0),this.allowDrag=d,this},setAllowGravity:function(d){return d===void 0&&(d=!0),this.allowGravity=d,this},setAllowRotation:function(d){return d===void 0&&(d=!0),this.allowRotation=d,this},setDrag:function(d,v){return this.drag.set(d,v),this},setDamping:function(d){return this.useDamping=d,this},setDragX:function(d){return this.drag.x=d,this},setDragY:function(d){return this.drag.y=d,this},setGravity:function(d,v){return this.gravity.set(d,v),this},setGravityX:function(d){return this.gravity.x=d,this},setGravityY:function(d){return this.gravity.y=d,this},setFriction:function(d,v){return this.friction.set(d,v),this},setFrictionX:function(d){return this.friction.x=d,this},setFrictionY:function(d){return this.friction.y=d,this},setAngularVelocity:function(d){return this.angularVelocity=d,this},setAngularAcceleration:function(d){return this.angularAcceleration=d,this},setAngularDrag:function(d){return this.angularDrag=d,this},setMass:function(d){return this.mass=d,this},setImmovable:function(d){return d===void 0&&(d=!0),this.immovable=d,this},setEnable:function(d){return d===void 0&&(d=!0),this.enable=d,this},processX:function(d,v,m,S){this.x+=d,this.updateCenter(),v!==null&&(this.velocity.x=v*this.slideFactor.x);var M=this.blocked;m&&(M.left=!0,M.none=!1),S&&(M.right=!0,M.none=!1)},processY:function(d,v,m,S){this.y+=d,this.updateCenter(),v!==null&&(this.velocity.y=v*this.slideFactor.y);var M=this.blocked;m&&(M.up=!0,M.none=!1),S&&(M.down=!0,M.none=!1)},x:{get:function(){return this.position.x},set:function(d){this.position.x=d}},y:{get:function(){return this.position.y},set:function(d){this.position.y=d}},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}}});s.exports=c},79342:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o,c){this.world=a,this.name="",this.active=!0,this.overlapOnly=l,this.object1=n,this.object2=u,this.collideCallback=f,this.processCallback=o,this.callbackContext=c},setName:function(h){return this.name=h,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});s.exports=p},66022:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71289),p=e(13759),h=e(37742),a=e(83419),l=e(37747),n=e(60758),u=e(72624),f=e(71464),o=new a({initialize:function(d){this.world=d,this.scene=d.scene,this.sys=d.scene.sys},collider:function(c,d,v,m,S){return this.world.addCollider(c,d,v,m,S)},overlap:function(c,d,v,m,S){return this.world.addOverlap(c,d,v,m,S)},existing:function(c,d){var v=d?l.STATIC_BODY:l.DYNAMIC_BODY;return this.world.enableBody(c,v),c},staticImage:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},image:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticSprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},sprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticGroup:function(c,d){return this.sys.updateList.add(new f(this.world,this.world.scene,c,d))},group:function(c,d){return this.sys.updateList.add(new n(this.world,this.world.scene,c,d))},body:function(c,d,v,m){var S=new h(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.DYNAMIC_BODY),S},staticBody:function(c,d,v,m){var S=new u(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.STATIC_BODY),S},destroy:function(){this.world=null,this.scene=null,this.sys=null}});s.exports=o},79599:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=0;if(!Array.isArray(e))r=e;else for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=function(h,a,l,n){var u=0,f=h.deltaAbsX()+a.deltaAbsX()+n;return h._dx===0&&a._dx===0?(h.embedded=!0,a.embedded=!0):h._dx>a._dx?(u=h.right-a.x,u>f&&!l||h.checkCollision.right===!1||a.checkCollision.left===!1?u=0:(h.touching.none=!1,h.touching.right=!0,a.touching.none=!1,a.touching.left=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.right=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.left=!0))):h._dxf&&!l||h.checkCollision.left===!1||a.checkCollision.right===!1?u=0:(h.touching.none=!1,h.touching.left=!0,a.touching.none=!1,a.touching.right=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.left=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.right=!0))),h.overlapX=u,a.overlapX=u,u};s.exports=p},45170:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=function(h,a,l,n){var u=0,f=h.deltaAbsY()+a.deltaAbsY()+n;return h._dy===0&&a._dy===0?(h.embedded=!0,a.embedded=!0):h._dy>a._dy?(u=h.bottom-a.y,u>f&&!l||h.checkCollision.down===!1||a.checkCollision.up===!1?u=0:(h.touching.none=!1,h.touching.down=!0,a.touching.none=!1,a.touching.up=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.down=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.up=!0))):h._dyf&&!l||h.checkCollision.up===!1||a.checkCollision.down===!1?u=0:(h.touching.none=!1,h.touching.up=!0,a.touching.none=!1,a.touching.down=!0,a.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.up=!0),h.physicsType===r.STATIC_BODY&&!l&&(a.blocked.none=!1,a.blocked.down=!0))),h.overlapY=u,a.overlapY=u,u};s.exports=p},60758:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13759),p=e(83419),h=e(78389),a=e(37747),l=e(95540),n=e(26479),u=e(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){if(!v&&!m)m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else if(u(v))m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(v)&&u(v[0])){var S=this;v.forEach(function(M){M.internalCreateCallback=S.createCallbackHandler,M.internalRemoveCallback=S.removeCallbackHandler,M.classType=l(M,"classType",r)}),m=null}else m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=c,m&&(m.classType=l(m,"classType",r)),this.physicsType=a.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:l(m,"collideWorldBounds",!1),setBoundsRectangle:l(m,"customBoundsRectangle",null),setAccelerationX:l(m,"accelerationX",0),setAccelerationY:l(m,"accelerationY",0),setAllowDrag:l(m,"allowDrag",!0),setAllowGravity:l(m,"allowGravity",!0),setAllowRotation:l(m,"allowRotation",!0),setDamping:l(m,"useDamping",!1),setBounceX:l(m,"bounceX",0),setBounceY:l(m,"bounceY",0),setDragX:l(m,"dragX",0),setDragY:l(m,"dragY",0),setEnable:l(m,"enable",!0),setGravityX:l(m,"gravityX",0),setGravityY:l(m,"gravityY",0),setFrictionX:l(m,"frictionX",0),setFrictionY:l(m,"frictionY",0),setMaxSpeed:l(m,"maxSpeed",-1),setMaxVelocityX:l(m,"maxVelocityX",1e4),setMaxVelocityY:l(m,"maxVelocityY",1e4),setVelocityX:l(m,"velocityX",0),setVelocityY:l(m,"velocityY",0),setAngularVelocity:l(m,"angularVelocity",0),setAngularAcceleration:l(m,"angularAcceleration",0),setAngularDrag:l(m,"angularDrag",0),setMass:l(m,"mass",1),setImmovable:l(m,"immovable",!1)},n.call(this,d,v,m),this.type="PhysicsGroup"},createCallbackHandler:function(o){o.body||this.world.enableBody(o,a.DYNAMIC_BODY);var c=o.body;for(var d in this.defaults)c[d](this.defaults[d])},removeCallbackHandler:function(o){o.body&&this.world.disableBody(o)},setVelocity:function(o,c,d){d===void 0&&(d=0);for(var v=this.getChildren(),m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y,e,r,p,h,a,l,n,u,f,o,c,d,v,m,S,M,w=function(I,D,B){y=I,e=D;var G=y.velocity.x,z=e.velocity.x;return r=y.pushable,u=y._dx<0,f=y._dx>0,o=y._dx===0,m=Math.abs(y.right-e.x)<=Math.abs(e.right-y.x),l=z-G*y.bounce.x,p=e.pushable,c=e._dx<0,d=e._dx>0,v=e._dx===0,S=!m,n=G-z*e.bounce.x,M=Math.abs(B),C()},C=function(){return f&&m&&e.blocked.right?(y.processX(-M,l,!1,!0),1):u&&S&&e.blocked.left?(y.processX(M,l,!0),1):d&&S&&y.blocked.right?(e.processX(-M,n,!1,!0),2):c&&m&&y.blocked.left?(e.processX(M,n,!0),2):0},A=function(){var I=y.velocity.x,D=e.velocity.x,B=Math.sqrt(D*D*e.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/e.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.x,a=z+G*e.bounce.x,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processX(M,h),e.processX(-M,a)):(y.processX(-M,h),e.processX(M,a));else if(r&&!p)I===0||I===3?y.processX(M,l,!0):y.processX(-M,l,!1,!0);else if(!r&&p)I===0||I===3?e.processX(-M,n,!1,!0):e.processX(M,n,!0);else{var D=M*.5;I===0?v?(y.processX(M,0,!0),e.processX(0,null,!1,!0)):d?(y.processX(D,0,!0),e.processX(-D,0,!1,!0)):(y.processX(D,e.velocity.x,!0),e.processX(-D,null,!1,!0)):I===1?o?(y.processX(0,null,!1,!0),e.processX(M,0,!0)):f?(y.processX(-D,0,!1,!0),e.processX(D,0,!0)):(y.processX(-D,null,!1,!0),e.processX(D,y.velocity.x,!0)):I===2?v?(y.processX(-M,0,!1,!0),e.processX(0,null,!0)):c?(y.processX(-D,0,!1,!0),e.processX(D,0,!0)):(y.processX(-D,e.velocity.x,!1,!0),e.processX(D,null,!0)):I===3&&(o?(y.processX(0,null,!0),e.processX(-M,0,!1,!0)):u?(y.processX(D,0,!0),e.processX(-D,0,!1,!0)):(y.processX(D,e.velocity.y,!0),e.processX(-D,null,!1,!0)))}return!0},b=function(I){I===1?e.velocity.x=0:m?e.processX(M,n,!0):e.processX(-M,n,!1,!0),y.moves&&(e.y+=(y.y-y.prev.y)*y.friction.y,e._dy=e.y-e.prev.y)},O=function(I){I===2?y.velocity.x=0:S?y.processX(M,l,!0):y.processX(-M,l,!1,!0),e.moves&&(y.y+=(e.y-e.prev.y)*e.friction.y,y._dy=y.y-y.prev.y)};s.exports={BlockCheck:C,Check:A,Set:w,Run:P,RunImmovableBody1:b,RunImmovableBody2:O}},47962:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y,e,r,p,h,a,l,n,u,f,o,c,d,v,m,S,M,w=function(I,D,B){y=I,e=D;var G=y.velocity.y,z=e.velocity.y;return r=y.pushable,u=y._dy<0,f=y._dy>0,o=y._dy===0,m=Math.abs(y.bottom-e.y)<=Math.abs(e.bottom-y.y),l=z-G*y.bounce.y,p=e.pushable,c=e._dy<0,d=e._dy>0,v=e._dy===0,S=!m,n=G-z*e.bounce.y,M=Math.abs(B),C()},C=function(){return f&&m&&e.blocked.down?(y.processY(-M,l,!1,!0),1):u&&S&&e.blocked.up?(y.processY(M,l,!0),1):d&&S&&y.blocked.down?(e.processY(-M,n,!1,!0),2):c&&m&&y.blocked.up?(e.processY(M,n,!0),2):0},A=function(){var I=y.velocity.y,D=e.velocity.y,B=Math.sqrt(D*D*e.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/e.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.y,a=z+G*e.bounce.y,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processY(M,h),e.processY(-M,a)):(y.processY(-M,h),e.processY(M,a));else if(r&&!p)I===0||I===3?y.processY(M,l,!0):y.processY(-M,l,!1,!0);else if(!r&&p)I===0||I===3?e.processY(-M,n,!1,!0):e.processY(M,n,!0);else{var D=M*.5;I===0?v?(y.processY(M,0,!0),e.processY(0,null,!1,!0)):d?(y.processY(D,0,!0),e.processY(-D,0,!1,!0)):(y.processY(D,e.velocity.y,!0),e.processY(-D,null,!1,!0)):I===1?o?(y.processY(0,null,!1,!0),e.processY(M,0,!0)):f?(y.processY(-D,0,!1,!0),e.processY(D,0,!0)):(y.processY(-D,null,!1,!0),e.processY(D,y.velocity.y,!0)):I===2?v?(y.processY(-M,0,!1,!0),e.processY(0,null,!0)):c?(y.processY(-D,0,!1,!0),e.processY(D,0,!0)):(y.processY(-D,e.velocity.y,!1,!0),e.processY(D,null,!0)):I===3&&(o?(y.processY(0,null,!0),e.processY(-M,0,!1,!0)):u?(y.processY(D,0,!0),e.processY(-D,0,!1,!0)):(y.processY(D,e.velocity.y,!0),e.processY(-D,null,!1,!0)))}return!0},b=function(I){I===1?e.velocity.y=0:m?e.processY(M,n,!0):e.processY(-M,n,!1,!0),y.moves&&(e.x+=(y.x-y.prev.x)*y.friction.x,e._dx=e.x-e.prev.x)},O=function(I){I===2?y.velocity.y=0:S?y.processY(M,l,!0):y.processY(-M,l,!1,!0),e.moves&&(y.x+=(e.x-e.prev.x)*e.friction.x,y._dx=y.x-y.prev.x)};s.exports={BlockCheck:C,Check:A,Set:w,Run:P,RunImmovableBody1:b,RunImmovableBody2:O}},14087:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(64897),p=e(3017),h=function(a,l,n,u,f){f===void 0&&(f=r(a,l,n,u));var o=a.immovable,c=l.immovable;if(n||f===0||o&&c||a.customSeparateX||l.customSeparateX)return f!==0||a.embedded&&l.embedded;var d=p.Set(a,l,f);return!o&&!c?d>0?!0:p.Check():(o?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};s.exports=h},89936:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45170),p=e(47962),h=function(a,l,n,u,f){f===void 0&&(f=r(a,l,n,u));var o=a.immovable,c=l.immovable;if(n||f===0||o&&c||a.customSeparateY||l.customSeparateY)return f!==0||a.embedded&&l.embedded;var d=p.Set(a,l,f);return!o&&!c?d>0?!0:p.Check():(o?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};s.exports=h},95829:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===void 0&&(r={}),r.none=e,r.up=!1,r.down=!1,r.left=!1,r.right=!1,e||(r.up=!0,r.down=!0,r.left=!0,r.right=!0),r};s.exports=y},72624:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87902),p=e(83419),h=e(78389),a=e(37747),l=e(37303),n=e(95829),u=e(26099),f=new p({Mixins:[h],initialize:function(c,d){var v=64,m=64,S={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},M=d!==void 0;M&&d.displayWidth&&(v=d.displayWidth,m=d.displayHeight),M||(d=S),this.world=c,this.gameObject=M?d:void 0,this.isBody=!0,this.debugShowBody=c.defaults.debugShowStaticBody,this.debugBodyColor=c.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new u,this.position=new u(d.x-v*d.originX,d.y-m*d.originY),this.width=v,this.height=m,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new u(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=u.ZERO,this.allowGravity=!1,this.gravity=u.ZERO,this.bounce=u.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=n(!1),this.touching=n(!0),this.wasTouching=n(!0),this.blocked=n(!0),this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(o,c){return o&&o!==this.gameObject&&(this.gameObject.body=null,o.body=this,this.gameObject=o),c&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var o=this.gameObject;return o.getTopLeft(this.position),this.width=o.displayWidth,this.height=o.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(o,c){return c===void 0&&(c=o),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(o,c),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(o,c,d){d===void 0&&(d=!0);var v=this.gameObject;if(v&&v.frame&&(o||(o=v.frame.realWidth),c||(c=v.frame.realHeight)),this.world.staticTree.remove(this),this.width=o,this.height=c,this.halfWidth=Math.floor(o/2),this.halfHeight=Math.floor(c/2),d&&v&&v.getCenter){var m=v.displayWidth/2,S=v.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(m-this.halfWidth,S-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(o,c,d){return c===void 0&&(c=this.offset.x),d===void 0&&(d=this.offset.y),o>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=o,this.width=o*2,this.height=o*2,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(c,d),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(o,c){var d=this.gameObject;o===void 0&&(o=d.x),c===void 0&&(c=d.y),this.world.staticTree.remove(this),d.setPosition(o,c),d.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(o){return o.x=this.x,o.y=this.y,o.right=this.right,o.bottom=this.bottom,o},hitTest:function(o,c){return this.isCircle?r(this,o,c):l(this,o,c)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(o){var c=this.position,d=c.x+this.halfWidth,v=c.y+this.halfHeight;this.debugShowBody&&(o.lineStyle(o.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?o.strokeCircle(d,v,this.width/2):o.strokeRect(c.x,c.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(o){return o<=0&&(o=.1),this.mass=o,this},x:{get:function(){return this.position.x},set:function(o){this.world.staticTree.remove(this),this.position.x=o,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(o){this.world.staticTree.remove(this),this.position.y=o,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});s.exports=f},71464:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13759),p=e(83419),h=e(78389),a=e(37747),l=e(95540),n=e(26479),u=e(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){!v&&!m?m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r}:u(v)?(m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler,m.createMultipleCallback=this.createMultipleCallbackHandler,m.classType=l(m,"classType",r)):Array.isArray(v)&&u(v[0])?(m=v,v=null,m.forEach(function(S){S.internalCreateCallback=this.createCallbackHandler,S.internalRemoveCallback=this.removeCallbackHandler,S.createMultipleCallback=this.createMultipleCallbackHandler,S.classType=l(S,"classType",r)})):m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler},this.world=c,this.physicsType=a.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,n.call(this,d,v,m),this.type="StaticPhysicsGroup"},createCallbackHandler:function(o){o.body||this.world.enableBody(o,a.STATIC_BODY)},removeCallbackHandler:function(o){o.body&&this.world.disableBody(o)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var o=this.children.entries,c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55495),p=e(37742),h=e(45319),a=e(83419),l=e(79342),n=e(37747),u=e(20339),f=e(52816),o=e(50792),c=e(63012),d=e(43855),v=e(5470),m=e(94977),S=e(64897),M=e(45170),w=e(96523),C=e(35154),A=e(36383),P=e(25774),b=e(96602),O=e(87841),I=e(59542),D=e(40012),B=e(14087),G=e(89936),z=e(35072),X=e(72624),K=e(2483),Q=e(61340),tt=e(26099),Y=e(15994),Z=new a({Extends:o,initialize:function(H,J){o.call(this),this.scene=H,this.bodies=new z,this.staticBodies=new z,this.pendingDestroy=new z,this.colliders=new P,this.gravity=new tt(C(J,"gravity.x",0),C(J,"gravity.y",0)),this.bounds=new O(C(J,"x",0),C(J,"y",0),C(J,"width",H.sys.scale.width),C(J,"height",H.sys.scale.height)),this.checkCollision={up:C(J,"checkCollision.up",!0),down:C(J,"checkCollision.down",!0),left:C(J,"checkCollision.left",!0),right:C(J,"checkCollision.right",!0)},this.fps=C(J,"fps",60),this.fixedStep=C(J,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=C(J,"timeScale",1),this.OVERLAP_BIAS=C(J,"overlapBias",4),this.TILE_BIAS=C(J,"tileBias",16),this.forceX=C(J,"forceX",!1),this.isPaused=C(J,"isPaused",!1),this._total=0,this.drawDebug=C(J,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:C(J,"debugShowBody",!0),debugShowStaticBody:C(J,"debugShowStaticBody",!0),debugShowVelocity:C(J,"debugShowVelocity",!0),bodyDebugColor:C(J,"debugBodyColor",16711935),staticBodyDebugColor:C(J,"debugStaticBodyColor",255),velocityDebugColor:C(J,"debugVelocityColor",65280)},this.maxEntries=C(J,"maxEntries",16),this.useTree=C(J,"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 Q,this._tempMatrix2=new Q,this.tileFilterOptions={isColliding:!0,isNotEmpty:!0,hasInterestingFace:!0},this.drawDebug&&this.createDebugGraphic()},enable:function(U,H){H===void 0&&(H=n.DYNAMIC_BODY),Array.isArray(U)||(U=[U]);for(var J=0;J=q;for(this.fixedStep||(_=H*.001,rt=!0,this._elapsed=0),J=0;J=q;)this._elapsed-=q,this.step(_)}},step:function(U){var H,J,_=this.bodies.entries,q=_.length;for(H=0;H0){var gt=this.tree,yt=this.staticTree;for(J=rt.entries,_=J.length,U=0;U<_;U++)H=J[U],H.physicsType===n.DYNAMIC_BODY?(gt.remove(H),q.delete(H)):H.physicsType===n.STATIC_BODY&&(yt.remove(H),at.delete(H)),H.world=void 0,H.gameObject=void 0;rt.clear()}},updateMotion:function(U,H){U.allowRotation&&this.computeAngularVelocity(U,H),this.computeVelocity(U,H)},computeAngularVelocity:function(U,H){var J=U.angularVelocity,_=U.angularAcceleration,q=U.angularDrag,at=U.maxAngular;_?J+=_*H:U.allowDrag&&q&&(q*=H,v(J-q,0,.1)?J-=q:m(J+q,0,.1)?J+=q:J=0),J=h(J,-at,at);var ot=J-U.angularVelocity;U.angularVelocity+=ot,U.rotation+=U.angularVelocity*H},computeVelocity:function(U,H){var J=U.velocity.x,_=U.acceleration.x,q=U.drag.x,at=U.maxVelocity.x,ot=U.velocity.y,rt=U.acceleration.y,gt=U.drag.y,yt=U.maxVelocity.y,Et=U.speed,At=U.maxSpeed,Pt=U.allowDrag,Vt=U.useDamping;U.allowGravity&&(J+=(this.gravity.x+U.gravity.x)*H,ot+=(this.gravity.y+U.gravity.y)*H),_?J+=_*H:Pt&&q&&(Vt?(q=Math.pow(q,H),J*=q,Et=Math.sqrt(J*J+ot*ot),d(Et,0,.001)&&(J=0)):(q*=H,v(J-q,0,.01)?J-=q:m(J+q,0,.01)?J+=q:J=0)),rt?ot+=rt*H:Pt&>&&(Vt?(gt=Math.pow(gt,H),ot*=gt,Et=Math.sqrt(J*J+ot*ot),d(Et,0,.001)&&(ot=0)):(gt*=H,v(ot-gt,0,.01)?ot-=gt:m(ot+gt,0,.01)?ot+=gt:ot=0)),J=h(J,-at,at),ot=h(ot,-yt,yt),U.velocity.set(J,ot),At>-1&&U.velocity.length()>At&&(U.velocity.normalize().scale(At),Et=At),U.speed=Et},separate:function(U,H,J,_,q){var at,ot,rt=!1,gt=!0;if(!U.enable||!H.enable||U.checkCollision.none||H.checkCollision.none||!this.intersects(U,H)||J&&J.call(_,U.gameObject,H.gameObject)===!1)return rt;if(U.isCircle||H.isCircle){var yt=this.separateCircle(U,H,q);yt.result?(rt=!0,gt=!1):(at=yt.x,ot=yt.y,gt=!0)}if(gt){var Et=!1,At=!1,Pt=this.OVERLAP_BIAS;q?(Et=B(U,H,q,Pt,at),At=G(U,H,q,Pt,ot)):this.forceX||Math.abs(this.gravity.y+U.gravity.y)Ht&&(At=u(Vt,dt,Ht,Dt)-ut):dt>Bt&&(VtHt&&(At=u(Vt,dt,Ht,Bt)-ut)),At*=-1}else At=U.halfWidth+H.halfWidth-f(at,ot);U.overlapR=At,H.overlapR=At;var ne=r(at,ot),oe=(At+A.EPSILON)*Math.cos(ne),ge=(At+A.EPSILON)*Math.sin(ne),xe={overlap:At,result:!1,x:oe,y:ge};if(J&&(!Pt||Pt&&At!==0))return xe.result=!0,xe;if(!Pt&&At===0||rt&>||U.customSeparateX||H.customSeparateX)return xe.x=void 0,xe.y=void 0,xe;var Ae=!U.pushable&&!H.pushable;if(Pt){var qt=at.x-ot.x,Ge=at.y-ot.y,Oe=Math.sqrt(Math.pow(qt,2)+Math.pow(Ge,2)),Be=(ot.x-at.x)/Oe||0,Le=(ot.y-at.y)/Oe||0,ie=2*(yt.x*Be+yt.y*Le-Et.x*Be-Et.y*Le)/(U.mass+H.mass);(rt||gt)&&(ie*=2),rt||(yt.x=yt.x-ie/U.mass*Be,yt.y=yt.y-ie/U.mass*Le,yt.multiply(U.bounce)),gt||(Et.x=Et.x+ie/H.mass*Be,Et.y=Et.y+ie/H.mass*Le,Et.multiply(H.bounce)),!rt&&!gt&&(oe*=.5,ge*=.5),rt||(U.x-=oe,U.y-=ge,U.updateCenter()),gt||(H.x+=oe,H.y+=ge,H.updateCenter()),xe.result=!0}else!rt||U.pushable||Ae?(U.x-=oe,U.y-=ge,U.updateCenter()):(!gt||H.pushable||Ae)&&(H.x+=oe,H.y+=ge,H.updateCenter()),xe.x=void 0,xe.y=void 0;return xe},intersects:function(U,H){return U===H?!1:!U.isCircle&&!H.isCircle?!(U.right<=H.left||U.bottom<=H.top||U.left>=H.right||U.top>=H.bottom):U.isCircle?H.isCircle?f(U.center,H.center)<=U.halfWidth+H.halfWidth:this.circleBodyIntersects(U,H):this.circleBodyIntersects(H,U)},circleBodyIntersects:function(U,H){var J=h(U.center.x,H.left,H.right),_=h(U.center.y,H.top,H.bottom),q=(U.center.x-J)*(U.center.x-J),at=(U.center.y-_)*(U.center.y-_);return q+at<=U.halfWidth*U.halfWidth},overlap:function(U,H,J,_,q){return J===void 0&&(J=null),_===void 0&&(_=null),q===void 0&&(q=J),this.collideObjects(U,H,J,_,q,!0)},collide:function(U,H,J,_,q){return J===void 0&&(J=null),_===void 0&&(_=null),q===void 0&&(q=J),this.collideObjects(U,H,J,_,q,!1)},collideObjects:function(U,H,J,_,q,at){var ot,rt;U.isParent&&(U.physicsType===void 0||H===void 0||U===H)&&(U=U.children.entries),H&&H.isParent&&H.physicsType===void 0&&(H=H.children.entries);var gt=Array.isArray(U),yt=Array.isArray(H);if(this._total=0,!gt&&!yt)this.collideHandler(U,H,J,_,q,at);else if(!gt&&yt)for(ot=0;ot0},collideHandler:function(U,H,J,_,q,at){if(H===void 0&&U.isParent)return this.collideGroupVsGroup(U,U,J,_,q,at);if(!U||!H)return!1;if(U.body||U.isBody){if(H.body||H.isBody)return this.collideSpriteVsSprite(U,H,J,_,q,at);if(H.isParent)return this.collideSpriteVsGroup(U,H,J,_,q,at);if(H.isTilemap)return this.collideSpriteVsTilemapLayer(U,H,J,_,q,at)}else if(U.isParent){if(H.body||H.isBody)return this.collideSpriteVsGroup(H,U,J,_,q,at);if(H.isParent)return this.collideGroupVsGroup(U,H,J,_,q,at);if(H.isTilemap)return this.collideGroupVsTilemapLayer(U,H,J,_,q,at)}else if(U.isTilemap){if(H.body||H.isBody)return this.collideSpriteVsTilemapLayer(H,U,J,_,q,at);if(H.isParent)return this.collideGroupVsTilemapLayer(H,U,J,_,q,at)}},canCollide:function(U,H){return U&&H&&(U.collisionMask&H.collisionCategory)!==0&&(H.collisionMask&U.collisionCategory)!==0},collideSpriteVsSprite:function(U,H,J,_,q,at){var ot=U.isBody?U:U.body,rt=H.isBody?H:H.body;return this.canCollide(ot,rt)?(this.separate(ot,rt,_,q,at)&&(J&&J.call(q,U,H),this._total++),!0):!1},collideSpriteVsGroup:function(U,H,J,_,q,at){var ot=U.isBody?U:U.body;if(!(H.length===0||!ot||!ot.enable||ot.checkCollision.none||!this.canCollide(ot,H))){var rt,gt,yt;if(this.useTree||H.physicsType===n.STATIC_BODY){var Et=this.treeMinMax;Et.minX=ot.left,Et.minY=ot.top,Et.maxX=ot.right,Et.maxY=ot.bottom;var At=H.physicsType===n.DYNAMIC_BODY?this.tree.search(Et):this.staticTree.search(Et);for(gt=At.length,rt=0;rt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setAcceleration:function(e,r){return this.body.acceleration.set(e,r),this},setAccelerationX:function(e){return this.body.acceleration.x=e,this},setAccelerationY:function(e){return this.body.acceleration.y=e,this}};s.exports=y},59023:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setAngularVelocity:function(e){return this.body.angularVelocity=e,this},setAngularAcceleration:function(e){return this.body.angularAcceleration=e,this},setAngularDrag:function(e){return this.body.angularDrag=e,this}};s.exports=y},62069:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setBounce:function(e,r){return this.body.bounce.set(e,r),this},setBounceX:function(e){return this.body.bounce.x=e,this},setBounceY:function(e){return this.body.bounce.y=e,this},setCollideWorldBounds:function(e,r,p,h){return this.body.setCollideWorldBounds(e,r,p,h),this}};s.exports=y},78389:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79599),p={setCollisionCategory:function(h){var a=this.body?this.body:this;return a.collisionCategory=h,this},willCollideWith:function(h){var a=this.body?this.body:this;return(a.collisionMask&h)!==0},addCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=a.collisionMask|h,this},removeCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=a.collisionMask&~h,this},setCollidesWith:function(h){var a=this.body?this.body:this;return a.collisionMask=r(h),this},resetCollisionCategory:function(){var h=this.body?this.body:this;return h.collisionCategory=1,h.collisionMask=1,this}};s.exports=p},87118:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDebug:function(e,r,p){return this.debugShowBody=e,this.debugShowVelocity=r,this.debugBodyColor=p,this},setDebugBodyColor:function(e){return this.body.debugBodyColor=e,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(e){this.body.debugShowBody=e}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(e){this.body.debugShowVelocity=e}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(e){this.body.debugBodyColor=e}}};s.exports=y},52819:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDrag:function(e,r){return this.body.drag.set(e,r),this},setDragX:function(e){return this.body.drag.x=e,this},setDragY:function(e){return this.body.drag.y=e,this},setDamping:function(e){return this.body.useDamping=e,this}};s.exports=y},4074:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setDirectControl:function(e){return this.body.setDirectControl(e),this},enableBody:function(e,r,p,h,a){return e&&this.body.reset(r,p),h&&(this.body.gameObject.active=!0),a&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(e,r){return e===void 0&&(e=!1),r===void 0&&(r=!1),this.body.stop(),this.body.enable=!1,e&&(this.body.gameObject.active=!1),r&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};s.exports=y},40831:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setFriction:function(e,r){return this.body.friction.set(e,r),this},setFrictionX:function(e){return this.body.friction.x=e,this},setFrictionY:function(e){return this.body.friction.y=e,this}};s.exports=y},26775:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setGravity:function(e,r){return this.body.gravity.set(e,r),this},setGravityX:function(e){return this.body.gravity.x=e,this},setGravityY:function(e){return this.body.gravity.y=e,this}};s.exports=y},9437:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setImmovable:function(e){return e===void 0&&(e=!0),this.body.immovable=e,this}};s.exports=y},30621:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setMass:function(e){return this.body.mass=e,this}};s.exports=y},72441:(s,y,e)=>{var r=e(47956),p=e(96503),h=e(2044),a=e(81491),l=function(n,u,f,o,c,d){var v=r(n,u-o,f-o,2*o,2*o,c,d);if(v.length===0)return v;for(var m=new p(u,f,o),S=new p,M=[],w=0;w{var y=function(e,r,p,h,a,l,n){l===void 0&&(l=!0),n===void 0&&(n=!1);var u=[],f=[],o=e.treeMinMax;if(o.minX=r,o.minY=p,o.maxX=r+h,o.maxY=p+a,n&&(f=e.staticTree.search(o)),l&&e.useTree)u=e.tree.search(o);else if(l){var c=e.bodies,d={position:{x:r,y:p},left:r,top:p,right:r+h,bottom:p+a,isCircle:!1},v=e.intersects;c.iterate(function(m){v(m,d)&&u.push(m)})}return f.concat(u)};s.exports=y},62121:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setPushable:function(e){return e===void 0&&(e=!0),this.body.pushable=e,this}};s.exports=y},29384:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setOffset:function(e,r){return this.body.setOffset(e,r),this},setSize:function(e,r,p){return this.body.setSize(e,r,p),this},setBodySize:function(e,r,p){return this.body.setSize(e,r,p),this},setCircle:function(e,r,p){return this.body.setCircle(e,r,p),this}};s.exports=y},15098:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setVelocity:function(e,r){return this.body.setVelocity(e,r),this},setVelocityX:function(e){return this.body.setVelocityX(e),this},setVelocityY:function(e){return this.body.setVelocityY(e),this},setMaxVelocity:function(e,r){return this.body.maxVelocity.set(e,r),this}};s.exports=y},92209:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Acceleration:e(1093),Angular:e(59023),Bounce:e(62069),Collision:e(78389),Debug:e(87118),Drag:e(52819),Enable:e(4074),Friction:e(40831),Gravity:e(26775),Immovable:e(9437),Mass:e(30621),OverlapCirc:e(72441),OverlapRect:e(47956),Pushable:e(62121),Size:e(29384),Velocity:e(15098)}},37747:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14};s.exports=y},20009:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collide"},36768:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="overlap"},60473:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},89954:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},61804:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="tilecollide"},7161:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="tileoverlap"},34689:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="worldbounds"},16006:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="worldstep"},63012:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COLLIDE:e(20009),OVERLAP:e(36768),PAUSE:e(60473),RESUME:e(89954),TILE_COLLIDE:e(61804),TILE_OVERLAP:e(7161),WORLD_BOUNDS:e(34689),WORLD_STEP:e(16006)}},27064:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37747),p=e(79291),h={ArcadePhysics:e(86689),Body:e(37742),Collider:e(79342),Components:e(92209),Events:e(63012),Factory:e(66022),GetCollidesWith:e(79599),GetOverlapX:e(64897),GetOverlapY:e(45170),SeparateX:e(14087),SeparateY:e(89936),Group:e(60758),Image:e(71289),Sprite:e(13759),StaticBody:e(72624),StaticGroup:e(71464),Tilemap:e(55173),World:e(82248)};h=p(!1,h,r),s.exports=h},96602:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.collisionCallback?!e.collisionCallback.call(e.collisionCallbackContext,r,e):e.layer.callbacks[e.index]?!e.layer.callbacks[e.index].callback.call(e.layer.callbacks[e.index].callbackContext,r,e):!0};s.exports=y},36294:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r<0?(e.blocked.none=!1,e.blocked.left=!0):r>0&&(e.blocked.none=!1,e.blocked.right=!0),e.position.x-=r,e.updateCenter(),e.bounce.x===0?e.velocity.x=0:e.velocity.x=-e.velocity.x*e.bounce.x};s.exports=y},67013:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r<0?(e.blocked.none=!1,e.blocked.up=!0):r>0&&(e.blocked.none=!1,e.blocked.down=!0),e.position.y-=r,e.updateCenter(),e.bounce.y===0?e.velocity.y=0:e.velocity.y=-e.velocity.y*e.bounce.y};s.exports=y},40012:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(21329),p=e(53442),h=e(2483),a=function(l,n,u,f,o,c,d){var v=f.left,m=f.top,S=f.right,M=f.bottom,w=u.faceLeft||u.faceRight,C=u.faceTop||u.faceBottom;if(d||(w=!0,C=!0),!w&&!C)return!1;var A=0,P=0,b=0,O=1;if(n.deltaAbsX()>n.deltaAbsY()?b=-1:n.deltaAbsX(){/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36294),p=function(h,a,l,n,u,f){var o=0,c=a.faceLeft,d=a.faceRight,v=a.collideLeft,m=a.collideRight;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaX()<0&&m&&h.checkCollision.left?d&&h.x0&&v&&h.checkCollision.right&&c&&h.right>l&&(o=h.right-l,o>u&&(o=0)),o!==0&&(h.customSeparateX?h.overlapX=o:r(h,o)),o};s.exports=p},53442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(67013),p=function(h,a,l,n,u,f){var o=0,c=a.faceTop,d=a.faceBottom,v=a.collideUp,m=a.collideDown;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaY()<0&&m&&h.checkCollision.up?d&&h.y0&&v&&h.checkCollision.down&&c&&h.bottom>l&&(o=h.bottom-l,o>u&&(o=0)),o!==0&&(h.customSeparateY?h.overlapY=o:r(h,o)),o};s.exports=p},2483:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return!(r.right<=e.left||r.bottom<=e.top||r.position.x>=e.right||r.position.y>=e.bottom)};s.exports=y},55173:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={ProcessTileCallbacks:e(96602),ProcessTileSeparationX:e(36294),ProcessTileSeparationY:e(67013),SeparateTile:e(40012),TileCheckX:e(21329),TileCheckY:e(53442),TileIntersectsBody:e(2483)};s.exports=r},44563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Arcade:e(27064),Matter:e(3875)}},68174:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(){this.boundsCenter=new p,this.centerDiff=new p},parseBody:function(a){if(a=a.hasOwnProperty("body")?a.body:a,!a.hasOwnProperty("bounds")||!a.hasOwnProperty("centerOfMass"))return!1;var l=this.boundsCenter,n=this.centerDiff,u=a.bounds.max.x-a.bounds.min.x,f=a.bounds.max.y-a.bounds.min.y,o=u*a.centerOfMass.x,c=f*a.centerOfMass.y;return l.set(u/2,f/2),n.set(o-l.x,c-l.y),!0},getTopLeft:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+u.y+f.y)}return!1},getTopCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n+u.y+f.y)}return!1},getTopRight:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+u.y+f.y)}return!1},getLeftCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+f.y)}return!1},getCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.centerDiff;return new p(l+u.x,n+u.y)}return!1},getRightCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+f.y)}return!1},getBottomLeft:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n-(u.y-f.y))}return!1},getBottomCenter:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n-(u.y-f.y))}return!1},getBottomRight:function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(a)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n-(u.y-f.y))}return!1}});s.exports=h},19933:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6790);r.Body=e(22562),r.Composite=e(69351),r.World=e(4372),r.Collision=e(52284),r.Detector=e(81388),r.Pairs=e(99561),r.Pair=e(4506),r.Query=e(73296),r.Resolver=e(66272),r.Constraint=e(48140),r.Common=e(53402),r.Engine=e(48413),r.Events=e(35810),r.Sleeping=e(53614),r.Plugin=e(73832),r.Bodies=e(66280),r.Composites=e(74116),r.Axes=e(66615),r.Bounds=e(15647),r.Svg=e(74058),r.Vector=e(31725),r.Vertices=e(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,s.exports=r},28137:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(83419),h=e(74116),a=e(48140),l=e(74058),n=e(75803),u=e(23181),f=e(34803),o=e(73834),c=e(19496),d=e(85791),v=e(98713),m=e(41598),S=new p({initialize:function(w){this.world=w,this.scene=w.scene,this.sys=w.scene.sys},rectangle:function(M,w,C,A,P){var b=r.rectangle(M,w,C,A,P);return this.world.add(b),b},trapezoid:function(M,w,C,A,P,b){var O=r.trapezoid(M,w,C,A,P,b);return this.world.add(O),O},circle:function(M,w,C,A,P){var b=r.circle(M,w,C,A,P);return this.world.add(b),b},polygon:function(M,w,C,A,P){var b=r.polygon(M,w,C,A,P);return this.world.add(b),b},fromVertices:function(M,w,C,A,P,b,O){typeof C=="string"&&(C=m.fromPath(C));var I=r.fromVertices(M,w,C,A,P,b,O);return this.world.add(I),I},fromPhysicsEditor:function(M,w,C,A,P){P===void 0&&(P=!0);var b=c.parseBody(M,w,C,A);return P&&!this.world.has(b)&&this.world.add(b),b},fromSVG:function(M,w,C,A,P,b){A===void 0&&(A=1),P===void 0&&(P={}),b===void 0&&(b=!0);for(var O=C.getElementsByTagName("path"),I=[],D=0;D{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(31884),p=e(95540),h=e(26099);function a(n){return!!n.get&&typeof n.get=="function"||!!n.set&&typeof n.set=="function"}var l=function(n,u,f,o){f===void 0&&(f={}),o===void 0&&(o=!0);var c=u.x,d=u.y;u.body={temp:!0,position:{x:c,y:d}};var v=[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity];if(v.forEach(function(S){for(var M in S)a(S[M])?Object.defineProperty(u,M,{get:S[M].get,set:S[M].set}):Object.defineProperty(u,M,{value:S[M]})}),u.world=n,u._tempVec2=new h(c,d),f.hasOwnProperty("type")&&f.type==="body")u.setExistingBody(f,o);else{var m=p(f,"shape",null);m||(m="rectangle"),f.addToWorld=o,u.setBody(m,f)}return u};s.exports=l},23181:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31884),h=e(95643),a=e(95540),l=e(88571),n=e(72699),u=e(26099),f=new r({Extends:l,Mixins:[p.Bounce,p.Collision,p.Force,p.Friction,p.Gravity,p.Mass,p.Sensor,p.SetBody,p.Sleep,p.Static,p.Transform,p.Velocity,n],initialize:function(c,d,v,m,S,M){h.call(this,c.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(m,S),this.setSizeToFrame(),this.setOrigin(),this.world=c,this._tempVec2=new u(d,v);var w=a(M,"shape",null);w?this.setBody(w,M):this.setRectangle(this.width,this.height,M),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=f},42045:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(60461),p=e(66615),h=e(66280),a=e(22562),l=e(68174),n=e(15647),u=e(83419),f=e(52284),o=e(53402),c=e(69351),d=e(74116),v=e(48140),m=e(81388),S=e(20339),M=e(28137),w=e(95540),C=e(35154),A=e(18210),P=e(40178),b=e(6790),O=e(74507),I=e(46975),D=e(4506),B=e(99561),G=e(73832),z=e(37277),X=e(73296),K=e(66272),Q=e(44594),tt=e(74058),Y=e(31725),Z=e(41598),U=e(68243);o.setDecomp(e(55973));var H=new u({initialize:function(_){this.scene=_,this.systems=_.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=a,this.composite=c,this.collision=f,this.detector=m,this.pair=D,this.pairs=B,this.query=X,this.resolver=K,this.constraint=v,this.bodies=h,this.composites=d,this.axes=p,this.bounds=n,this.svg=tt,this.vector=Y,this.vertices=Z,this.verts=Z,this._tempVec2=Y.create(),C(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),C(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),C(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),K._restingThresh=C(this.config,"restingThresh",4),K._restingThreshTangent=C(this.config,"restingThreshTangent",6),K._positionDampen=C(this.config,"positionDampen",.9),K._positionWarming=C(this.config,"positionWarming",.8),K._frictionNormalMultiplier=C(this.config,"frictionNormalMultiplier",5),_.sys.events.once(Q.BOOT,this.boot,this),_.sys.events.on(Q.START,this.start,this)},boot:function(){this.world=new U(this.scene,this.config),this.add=new M(this.world),this.bodyBounds=new l,this.systems.events.once(Q.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new U(this.scene,this.config),this.add=new M(this.world));var J=this.systems.events;J.on(Q.UPDATE,this.world.update,this.world),J.on(Q.POST_UPDATE,this.world.postUpdate,this.world),J.once(Q.SHUTDOWN,this.shutdown,this)},getConfig:function(){var J=this.systems.game.config.physics,_=this.systems.settings.physics,q=I(w(_,"matter",{}),w(J,"matter",{}));return q},enableAttractorPlugin:function(){return G.register(A),G.use(b,A),this},enableWrapPlugin:function(){return G.register(O),G.use(b,O),this},enableCollisionEventsPlugin:function(){return G.register(P),G.use(b,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(J,_){this.world.step(J,_)},containsPoint:function(J,_,q){J=this.getMatterBodies(J);var at=Y.create(_,q),ot=X.point(J,at);return ot.length>0},intersectPoint:function(J,_,q){q=this.getMatterBodies(q);var at=Y.create(J,_),ot=[],rt=X.point(q,at);return rt.forEach(function(gt){ot.indexOf(gt)===-1&&ot.push(gt)}),ot},intersectRect:function(J,_,q,at,ot,rt){ot===void 0&&(ot=!1),rt=this.getMatterBodies(rt);var gt={min:{x:J,y:_},max:{x:J+q,y:_+at}},yt=[],Et=X.region(rt,gt,ot);return Et.forEach(function(At){yt.indexOf(At)===-1&&yt.push(At)}),yt},intersectRay:function(J,_,q,at,ot,rt){ot===void 0&&(ot=1),rt=this.getMatterBodies(rt);for(var gt=[],yt=X.ray(rt,Y.create(J,_),Y.create(q,at),ot),Et=0;Et{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(9674),p=e(83419),h=e(31884),a=e(95643),l=e(95540),n=e(72699),u=e(68287),f=e(26099),o=new p({Extends:u,Mixins:[h.Bounce,h.Collision,h.Force,h.Friction,h.Gravity,h.Mass,h.Sensor,h.SetBody,h.Sleep,h.Static,h.Transform,h.Velocity,n],initialize:function(d,v,m,S,M,w){a.call(this,d.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(S,M),this.setSizeToFrame(),this.setOrigin(),this.world=d,this._tempVec2=new f(v,m);var C=l(w,"shape",null);C?this.setBody(C,w):this.setRectangle(this.width,this.height,w),this.setPosition(v,m),this.initPipeline(),this.initPostPipeline(!0)}});s.exports=o},73834:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(83419),a=e(31884),l=e(62644),n=e(50792),u=e(95540),f=e(97022),o=e(41598),c=new h({Extends:n,Mixins:[a.Bounce,a.Collision,a.Friction,a.Gravity,a.Mass,a.Sensor,a.Sleep,a.Static],initialize:function(v,m,S){n.call(this),this.tile=m,this.world=v,m.physics.matterBody&&m.physics.matterBody.destroy(),m.physics.matterBody=this;var M=u(S,"body",null),w=u(S,"addToWorld",!0);if(M)this.setBody(M,w);else{var C=m.getCollisionGroup(),A=u(C,"objects",[]);A.length>0?this.setFromTileCollision(S):this.setFromTileRectangle(S)}if(m.flipX||m.flipY){var P={x:m.getCenterX(),y:m.getCenterY()},b=m.flipX?-1:1,O=m.flipY?-1:1;p.scale(M,b,O,P)}},setFromTileRectangle:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);var v=this.tile.getBounds(),m=v.x+v.width/2,S=v.y+v.height/2,M=r.rectangle(m,S,v.width,v.height,d);return this.setBody(M,d.addToWorld),this},setFromTileCollision:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);for(var v=this.tile.tilemapLayer.scaleX,m=this.tile.tilemapLayer.scaleY,S=this.tile.getLeft(),M=this.tile.getTop(),w=this.tile.getCollisionGroup(),C=u(w,"objects",[]),A=[],P=0;P1){var tt=l(d);tt.parts=A,this.setBody(p.create(tt),tt.addToWorld)}return this},setBody:function(d,v){return v===void 0&&(v=!0),this.body&&this.removeBody(),this.body=d,this.body.gameObject=this,v&&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()}});s.exports=c},19496:(s,y,e)=>{/** + * @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 r=e(66280),p=e(22562),h=e(53402),a=e(95540),l=e(41598),n={parseBody:function(u,f,o,c){c===void 0&&(c={});for(var d=a(o,"fixtures",[]),v=[],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h={parseBody:function(a,l,n,u){u===void 0&&(u={});var f,o=n.vertices;if(o.length===1)u.vertices=o[0],f=p.create(u),r.flagCoincidentParts(f.parts);else{for(var c=[],d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(15647),p=e(83419),h=e(69351),a=e(48140),l=e(81388),n=e(1121),u=e(8214),f=e(46975),o=e(53614),c=e(26099),d=e(41598),v=new p({initialize:function(S,M,w){w===void 0&&(w={});var C={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=S,this.world=M,this.camera=null,this.pointer=null,this.active=!0,this.position=new c,this.body=null,this.part=null,this.constraint=a.create(f(w,C)),this.world.on(n.BEFORE_UPDATE,this.update,this),S.sys.input.on(u.POINTER_DOWN,this.onDown,this),S.sys.input.on(u.POINTER_UP,this.onUp,this)},onDown:function(m){this.pointer||(this.pointer=m,this.camera=m.camera)},onUp:function(m){m===this.pointer&&(this.pointer=null)},getBody:function(m){var S=this.position,M=this.constraint;this.camera.getWorldPoint(m.x,m.y,S);for(var w=h.allBodies(this.world.localWorld),C=0;C1?1:0,A=C;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(83419),a=e(53402),l=e(69351),n=e(48413),u=e(50792),f=e(1121),o=e(95540),c=e(35154),d=e(22562),v=e(35810),m=e(73834),S=e(4372),M=e(31725),w=new h({Extends:u,initialize:function(A,P){u.call(this),this.scene=A,this.engine=n.create(P),this.localWorld=this.engine.world;var b=c(P,"gravity",null);b?this.setGravity(b.x,b.y,b.scale):b===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=c(P,"enabled",!0),this.getDelta=c(P,"getDelta",this.update60Hz);var O=o(P,"runner",{}),I=o(O,"fps",!1),D=o(O,"fps",60),B=o(O,"delta",1e3/D),G=o(O,"deltaMin",1e3/D),z=o(O,"deltaMax",1e3/(D*.5));I||(D=1e3/B),this.runner={fps:D,deltaSampleSize:o(O,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:o(O,"isFixed",!1),delta:B,deltaMin:G,deltaMax:z},this.autoUpdate=c(P,"autoUpdate",!0);var X=c(P,"debug",!1);if(this.drawDebug=typeof X=="object"?!0:X,this.debugGraphic,this.debugConfig={showAxes:o(X,"showAxes",!1),showAngleIndicator:o(X,"showAngleIndicator",!1),angleColor:o(X,"angleColor",15208787),showBroadphase:o(X,"showBroadphase",!1),broadphaseColor:o(X,"broadphaseColor",16757760),showBounds:o(X,"showBounds",!1),boundsColor:o(X,"boundsColor",16777215),showVelocity:o(X,"showVelocity",!1),velocityColor:o(X,"velocityColor",44783),showCollisions:o(X,"showCollisions",!1),collisionColor:o(X,"collisionColor",16094476),showSeparations:o(X,"showSeparations",!1),separationColor:o(X,"separationColor",16753920),showBody:o(X,"showBody",!0),showStaticBody:o(X,"showStaticBody",!0),showInternalEdges:o(X,"showInternalEdges",!1),renderFill:o(X,"renderFill",!1),renderLine:o(X,"renderLine",!0),fillColor:o(X,"fillColor",1075465),fillOpacity:o(X,"fillOpacity",1),lineColor:o(X,"lineColor",2678297),lineOpacity:o(X,"lineOpacity",1),lineThickness:o(X,"lineThickness",1),staticFillColor:o(X,"staticFillColor",857979),staticLineColor:o(X,"staticLineColor",1255396),showSleeping:o(X,"showSleeping",!1),staticBodySleepOpacity:o(X,"staticBodySleepOpacity",.7),sleepFillColor:o(X,"sleepFillColor",4605510),sleepLineColor:o(X,"sleepLineColor",10066585),showSensors:o(X,"showSensors",!0),sensorFillColor:o(X,"sensorFillColor",857979),sensorLineColor:o(X,"sensorLineColor",1255396),showPositions:o(X,"showPositions",!0),positionSize:o(X,"positionSize",4),positionColor:o(X,"positionColor",14697178),showJoint:o(X,"showJoint",!0),jointColor:o(X,"jointColor",14737474),jointLineOpacity:o(X,"jointLineOpacity",1),jointLineThickness:o(X,"jointLineThickness",2),pinSize:o(X,"pinSize",4),pinColor:o(X,"pinColor",4382944),springColor:o(X,"springColor",14697184),anchorColor:o(X,"anchorColor",15724527),anchorSize:o(X,"anchorSize",4),showConvexHulls:o(X,"showConvexHulls",!1),hullColor:o(X,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),o(P,"setBounds",!1)){var K=P.setBounds;if(typeof K=="boolean")this.setBounds();else{var Q=o(K,"x",0),tt=o(K,"y",0),Y=o(K,"width",A.sys.scale.width),Z=o(K,"height",A.sys.scale.height),U=o(K,"thickness",64),H=o(K,"left",!0),J=o(K,"right",!0),_=o(K,"top",!0),q=o(K,"bottom",!0);this.setBounds(Q,tt,Y,Z,U,H,J,_,q)}}},setCompositeRenderStyle:function(C){var A=C.bodies,P=C.constraints,b=C.composites,O,I,D;for(O=0;O0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_START,b,I,D)}),v.on(A,"collisionActive",function(b){var O=b.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_ACTIVE,b,I,D)}),v.on(A,"collisionEnd",function(b){var O=b.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_END,b,I,D)})},setBounds:function(C,A,P,b,O,I,D,B,G){return C===void 0&&(C=0),A===void 0&&(A=0),P===void 0&&(P=this.scene.sys.scale.width),b===void 0&&(b=this.scene.sys.scale.height),O===void 0&&(O=64),I===void 0&&(I=!0),D===void 0&&(D=!0),B===void 0&&(B=!0),G===void 0&&(G=!0),this.updateWall(I,"left",C-O,A-O,O,b+O*2),this.updateWall(D,"right",C+P,A-O,O,b+O*2),this.updateWall(B,"top",C,A-O,P,O),this.updateWall(G,"bottom",C,A+b,P,O),this},updateWall:function(C,A,P,b,O,I){var D=this.walls[A];C?(D&&S.remove(this.localWorld,D),P+=O/2,b+=I/2,this.walls[A]=this.create(P,b,O,I,{isStatic:!0,friction:0,frictionStatic:0})):(D&&S.remove(this.localWorld,D),this.walls[A]=null)},createDebugGraphic:function(){var C=this.scene.sys.add.graphics({x:0,y:0});return C.setDepth(Number.MAX_VALUE),this.debugGraphic=C,this.drawDebug=!0,C},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(C,A,P){return C===void 0&&(C=0),A===void 0&&(A=1),P===void 0&&(P=.001),this.localWorld.gravity.x=C,this.localWorld.gravity.y=A,this.localWorld.gravity.scale=P,this},create:function(C,A,P,b,O){var I=r.rectangle(C,A,P,b,O);return S.add(this.localWorld,I),I},add:function(C){return S.add(this.localWorld,C),this},remove:function(C,A){Array.isArray(C)||(C=[C]);for(var P=0;Pb.deltaMax?b.deltaMax:A,b.delta=A),b.timeScalePrev=O.timeScale,b.frameCounter+=1,C-b.counterTimestamp>=1e3&&(b.fps=b.frameCounter*((C-b.counterTimestamp)/1e3),b.counterTimestamp=C,b.frameCounter=0),n.update(P,A)}},step:function(C){n.update(this.engine,C)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(C){var A=C.hasOwnProperty("body")?C.body:C;return l.get(this.localWorld,A.id,A.type)!==null},getAllBodies:function(){return l.allBodies(this.localWorld)},getAllConstraints:function(){return l.allConstraints(this.localWorld)},getAllComposites:function(){return l.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var C=this.debugConfig,A=this.engine,P=this.debugGraphic,b=l.allBodies(this.localWorld);this.debugGraphic.clear(),C.showBroadphase&&A.broadphase.controller&&this.renderGrid(A.broadphase,P,C.broadphaseColor,.5),C.showBounds&&this.renderBodyBounds(b,P,C.boundsColor,.5),(C.showBody||C.showStaticBody)&&this.renderBodies(b),C.showJoint&&this.renderJoints(),(C.showAxes||C.showAngleIndicator)&&this.renderBodyAxes(b,P,C.showAxes,C.angleColor,.5),C.showVelocity&&this.renderBodyVelocity(b,P,C.velocityColor,1,2),C.showSeparations&&this.renderSeparations(A.pairs.list,P,C.separationColor),C.showCollisions&&this.renderCollisions(A.pairs.list,P,C.collisionColor)}},renderGrid:function(C,A,P,b){A.lineStyle(1,P,b);for(var O=a.keys(C.buckets),I=0;I0){var X=z[0].vertex.x,K=z[0].vertex.y;z.length===2&&(X=(z[0].vertex.x+z[1].vertex.x)/2,K=(z[0].vertex.y+z[1].vertex.y)/2),G.bodyB===G.supports[0].body||G.bodyA.isStatic?A.lineBetween(X-G.normal.x*8,K-G.normal.y*8,X,K):A.lineBetween(X+G.normal.x*8,K+G.normal.y*8,X,K)}}return this},renderBodyBounds:function(C,A,P,b){A.lineStyle(1,P,b);for(var O=0;O1?1:0;G1?1:0;z1?1:0;z1&&this.renderConvexHull(Z,A,tt,J)}}},renderBody:function(C,A,P,b,O,I,D,B){b===void 0&&(b=null),O===void 0&&(O=null),I===void 0&&(I=1),D===void 0&&(D=null),B===void 0&&(B=null);for(var G=this.debugConfig,z=G.sensorFillColor,X=G.sensorLineColor,K=C.parts,Q=K.length,tt=Q>1?1:0;tt1){var D=C.vertices;A.lineStyle(b,P),A.beginPath(),A.moveTo(D[0].x,D[0].y);for(var B=1;B0&&(A.fillStyle(D),A.fillCircle(K.x,K.y,B),A.fillCircle(Q.x,Q.y,B)),this},resetCollisionIDs:function(){return p._nextCollidingGroupId=1,p._nextNonCollidingGroupId=-1,p._nextCategory=1,this},shutdown:function(){v.off(this.engine),this.removeAllListeners(),S.clear(this.localWorld,!1),n.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});s.exports=w},70410:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setBounce:function(e){return this.body.restitution=e,this}};s.exports=y},66968:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setCollisionCategory:function(e){return this.body.collisionFilter.category=e,this},setCollisionGroup:function(e){return this.body.collisionFilter.group=e,this},setCollidesWith:function(e){var r=0;if(!Array.isArray(e))r=e;else for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={applyForce:function(h){return this._tempVec2.set(this.body.position.x,this.body.position.y),r.applyForce(this.body,this._tempVec2,h),this},applyForceFrom:function(h,a){return r.applyForce(this.body,h,a),this},thrust:function(h){var a=this.body.angle;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(h){var a=this.body.angle-Math.PI/2;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(h){var a=this.body.angle+Math.PI/2;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(h){var a=this.body.angle-Math.PI;return this._tempVec2.set(h*Math.cos(a),h*Math.sin(a)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};s.exports=p},5436:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setFriction:function(e,r,p){return this.body.friction=e,r!==void 0&&(this.body.frictionAir=r),p!==void 0&&(this.body.frictionStatic=p),this},setFrictionAir:function(e){return this.body.frictionAir=e,this},setFrictionStatic:function(e){return this.body.frictionStatic=e,this}};s.exports=y},39858:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setIgnoreGravity:function(e){return this.body.ignoreGravity=e,this}};s.exports=y},37302:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p=e(26099),h={setMass:function(a){return r.setMass(this.body,a),this},setDensity:function(a){return r.setDensity(this.body,a),this},centerOfMass:{get:function(){return new p(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};s.exports=h},39132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={setSensor:function(e){return this.body.isSensor=e,this},isSensor:function(){return this.body.isSensor}};s.exports=y},57772:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(66280),p=e(22562),h=e(43855),a=e(95540),l=e(19496),n=e(85791),u=e(41598),f={setRectangle:function(o,c,d){return this.setBody({type:"rectangle",width:o,height:c},d)},setCircle:function(o,c){return this.setBody({type:"circle",radius:o},c)},setPolygon:function(o,c,d){return this.setBody({type:"polygon",sides:c,radius:o},d)},setTrapezoid:function(o,c,d,v){return this.setBody({type:"trapezoid",width:o,height:c,slope:d},v)},setExistingBody:function(o,c){c===void 0&&(c=!0),this.body&&this.world.remove(this.body,!0),this.body=o;for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(1121),p=e(53614),h=e(35810),a={setToSleep:function(){return p.set(this.body,!0),this},setAwake:function(){return p.set(this.body,!1),this},setSleepThreshold:function(l){return l===void 0&&(l=60),this.body.sleepThreshold=l,this},setSleepEvents:function(l,n){return this.setSleepStartEvent(l),this.setSleepEndEvent(n),this},setSleepStartEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepStart",function(u){n.emit(r.SLEEP_START,u,this)})}else h.off(this.body,"sleepStart");return this},setSleepEndEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepEnd",function(u){n.emit(r.SLEEP_END,u,this)})}else h.off(this.body,"sleepEnd");return this}};s.exports=a},90556:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={setStatic:function(h){return r.setStatic(this.body,h),this},isStatic:function(){return this.body.isStatic}};s.exports=p},85436:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p=e(36383),h=e(86554),a=e(30954),l=4,n={x:{get:function(){return this.body.position.x},set:function(u){this._tempVec2.set(u,this.y),r.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(u){this._tempVec2.set(this.x,u),r.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(u){var f=1/this._scaleX,o=1/this._scaleY;this._scaleX=u,this._scaleX===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,o),r.scale(this.body,u,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(u){var f=1/this._scaleX,o=1/this._scaleY;this._scaleY=u,this._scaleY===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,o),r.scale(this.body,this._scaleX,u)}},angle:{get:function(){return a(this.body.angle*p.RAD_TO_DEG)},set:function(u){this.rotation=a(u)*p.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(u){this._rotation=h(u),r.setAngle(this.body,this._rotation)}},setPosition:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this._tempVec2.set(u,f),r.setPosition(this.body,this._tempVec2),this},setRotation:function(u){return u===void 0&&(u=0),this._rotation=h(u),r.setAngle(this.body,u),this},setFixedRotation:function(){return r.setInertia(this.body,1/0),this},setAngle:function(u){return u===void 0&&(u=0),this.angle=u,r.setAngle(this.body,this.rotation),this},setScale:function(u,f,o){u===void 0&&(u=1),f===void 0&&(f=u);var c=1/this._scaleX,d=1/this._scaleY;return this._scaleX=u,this._scaleY=f,r.scale(this.body,c,d,o),r.scale(this.body,u,f,o),this}};s.exports=n},42081:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(22562),p={setVelocityX:function(h){return this._tempVec2.set(h,this.body.velocity.y),r.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(h){return this._tempVec2.set(this.body.velocity.x,h),r.setVelocity(this.body,this._tempVec2),this},setVelocity:function(h,a){return this._tempVec2.set(h,a),r.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return r.getVelocity(this.body)},setAngularVelocity:function(h){return r.setAngularVelocity(this.body,h),this},getAngularVelocity:function(){return r.getAngularVelocity(this.body)},setAngularSpeed:function(h){return r.setAngularSpeed(this.body,h),this},getAngularSpeed:function(){return r.getAngularSpeed(this.body)}};s.exports=p},31884:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Bounce:e(70410),Collision:e(66968),Force:e(51607),Friction:e(5436),Gravity:e(39858),Mass:e(37302),Sensor:e(39132),SetBody:e(57772),Sleep:e(38083),Static:e(90556),Transform:e(85436),Velocity:e(42081)}},85608:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afteradd"},1213:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afterremove"},25968:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="afterupdate"},67205:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeadd"},39438:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeremove"},44823:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="beforeupdate"},92593:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionactive"},60128:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionend"},76861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="collisionstart"},92362:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragend"},76408:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="drag"},93971:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="dragstart"},5656:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},47861:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},79099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleepend"},35906:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleepstart"},1121:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AFTER_ADD:e(85608),AFTER_REMOVE:e(1213),AFTER_UPDATE:e(25968),BEFORE_ADD:e(67205),BEFORE_REMOVE:e(39438),BEFORE_UPDATE:e(44823),COLLISION_ACTIVE:e(92593),COLLISION_END:e(60128),COLLISION_START:e(76861),DRAG_END:e(92362),DRAG:e(76408),DRAG_START:e(93971),PAUSE:e(5656),RESUME:e(47861),SLEEP_END:e(79099),SLEEP_START:e(35906)}},3875:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BodyBounds:e(68174),Components:e(31884),Events:e(1121),Factory:e(28137),MatterGameObject:e(75803),Image:e(23181),Matter:e(19933),MatterPhysics:e(42045),PolyDecomp:e(55973),Sprite:e(34803),TileBody:e(73834),PhysicsEditorParser:e(19496),PhysicsJSONParser:e(85791),PointerConstraint:e(98713),World:e(68243)}},22562:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(31725),a=e(53614),l=e(53402),n=e(15647),u=e(66615);(function(){r._timeCorrection=!0,r._inertiaScale=4,r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,r._baseDelta=16.666666666666668,r.create=function(o){var c={id:l.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:{}};!o.hasOwnProperty("position")&&o.hasOwnProperty("vertices")?o.position=p.centre(o.vertices):o.hasOwnProperty("vertices")||(c.vertices=p.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var d=l.extend(c,o);return f(d,o),d.setOnCollideWith=function(v,m){return m?this.onCollideWith[v.id]=m:delete this.onCollideWith[v.id],this},d},r.nextGroup=function(o){return o?r._nextNonCollidingGroupId--:r._nextCollidingGroupId++},r.nextCategory=function(){return r._nextCategory=r._nextCategory<<1,r._nextCategory};var f=function(o,c){if(c=c||{},r.set(o,{bounds:o.bounds||n.create(o.vertices),positionPrev:o.positionPrev||h.clone(o.position),anglePrev:o.anglePrev||o.angle,vertices:o.vertices,parts:o.parts||[o],isStatic:o.isStatic,isSleeping:o.isSleeping,parent:o.parent||o}),p.rotate(o.vertices,o.angle,o.position),u.rotate(o.axes,o.angle),n.update(o.bounds,o.vertices,o.velocity),r.set(o,{axes:c.axes||o.axes,area:c.area||o.area,mass:c.mass||o.mass,inertia:c.inertia||o.inertia}),o.parts.length===1){var d=o.bounds,v=o.centerOfMass,m=o.centerOffset,S=d.max.x-d.min.x,M=d.max.y-d.min.y;v.x=-(d.min.x-o.position.x)/S,v.y=-(d.min.y-o.position.y)/M,m.x=S*v.x,m.y=M*v.y}};r.set=function(o,c,d){var v;typeof c=="string"&&(v=c,c={},c[v]=d);for(v in c)if(Object.prototype.hasOwnProperty.call(c,v))switch(d=c[v],v){case"isStatic":r.setStatic(o,d);break;case"isSleeping":a.set(o,d);break;case"mass":r.setMass(o,d);break;case"density":r.setDensity(o,d);break;case"inertia":r.setInertia(o,d);break;case"vertices":r.setVertices(o,d);break;case"position":r.setPosition(o,d);break;case"angle":r.setAngle(o,d);break;case"velocity":r.setVelocity(o,d);break;case"angularVelocity":r.setAngularVelocity(o,d);break;case"speed":r.setSpeed(o,d);break;case"angularSpeed":r.setAngularSpeed(o,d);break;case"parts":r.setParts(o,d);break;case"centre":r.setCentre(o,d);break;default:o[v]=d}},r.setStatic=function(o,c){for(var d=0;d0&&h.rotateAbout(S.position,v,o.position,S.position)}},r.setVelocity=function(o,c){var d=o.deltaTime/r._baseDelta;o.positionPrev.x=o.position.x-c.x*d,o.positionPrev.y=o.position.y-c.y*d,o.velocity.x=(o.position.x-o.positionPrev.x)/d,o.velocity.y=(o.position.y-o.positionPrev.y)/d,o.speed=h.magnitude(o.velocity)},r.getVelocity=function(o){var c=r._baseDelta/o.deltaTime;return{x:(o.position.x-o.positionPrev.x)*c,y:(o.position.y-o.positionPrev.y)*c}},r.getSpeed=function(o){return h.magnitude(r.getVelocity(o))},r.setSpeed=function(o,c){r.setVelocity(o,h.mult(h.normalise(r.getVelocity(o)),c))},r.setAngularVelocity=function(o,c){var d=o.deltaTime/r._baseDelta;o.anglePrev=o.angle-c*d,o.angularVelocity=(o.angle-o.anglePrev)/d,o.angularSpeed=Math.abs(o.angularVelocity)},r.getAngularVelocity=function(o){return(o.angle-o.anglePrev)*r._baseDelta/o.deltaTime},r.getAngularSpeed=function(o){return Math.abs(r.getAngularVelocity(o))},r.setAngularSpeed=function(o,c){r.setAngularVelocity(o,l.sign(r.getAngularVelocity(o))*c)},r.translate=function(o,c,d){r.setPosition(o,h.add(o.position,c),d)},r.rotate=function(o,c,d,v){if(!d)r.setAngle(o,o.angle+c,v);else{var m=Math.cos(c),S=Math.sin(c),M=o.position.x-d.x,w=o.position.y-d.y;r.setPosition(o,{x:d.x+(M*m-w*S),y:d.y+(M*S+w*m)},v),r.setAngle(o,o.angle+c,v)}},r.scale=function(o,c,d,v){var m=0,S=0;v=v||o.position;for(var M=o.inertia===1/0,w=0;w0&&(m+=C.area,S+=C.inertia),C.position.x=v.x+(C.position.x-v.x)*c,C.position.y=v.y+(C.position.y-v.y)*d,n.update(C.bounds,C.vertices,o.velocity)}o.parts.length>1&&(o.area=m,o.isStatic||(r.setMass(o,o.density*m),r.setInertia(o,S))),o.circleRadius&&(c===d?o.circleRadius*=c:o.circleRadius=null),M&&r.setInertia(o,1/0)},r.update=function(o,c){c=(typeof c<"u"?c:16.666666666666668)*o.timeScale;var d=c*c,v=r._timeCorrection?c/(o.deltaTime||c):1,m=1-o.frictionAir*(c/l._baseDelta),S=(o.position.x-o.positionPrev.x)*v,M=(o.position.y-o.positionPrev.y)*v;o.velocity.x=S*m+o.force.x/o.mass*d,o.velocity.y=M*m+o.force.y/o.mass*d,o.positionPrev.x=o.position.x,o.positionPrev.y=o.position.y,o.position.x+=o.velocity.x,o.position.y+=o.velocity.y,o.deltaTime=c,o.angularVelocity=(o.angle-o.anglePrev)*m*v+o.torque/o.inertia*d,o.anglePrev=o.angle,o.angle+=o.angularVelocity,o.speed=h.magnitude(o.velocity),o.angularSpeed=Math.abs(o.angularVelocity);for(var w=0;w0&&(C.position.x+=o.velocity.x,C.position.y+=o.velocity.y),o.angularVelocity!==0&&(p.rotate(C.vertices,o.angularVelocity,o.position),u.rotate(C.axes,o.angularVelocity),w>0&&h.rotateAbout(C.position,o.angularVelocity,o.position,C.position)),n.update(C.bounds,C.vertices,o.velocity)}},r.updateVelocities=function(o){var c=r._baseDelta/o.deltaTime,d=o.velocity;d.x=(o.position.x-o.positionPrev.x)*c,d.y=(o.position.y-o.positionPrev.y)*c,o.speed=Math.sqrt(d.x*d.x+d.y*d.y),o.angularVelocity=(o.angle-o.anglePrev)*c,o.angularSpeed=Math.abs(o.angularVelocity)},r.applyForce=function(o,c,d){var v={x:c.x-o.position.x,y:c.y-o.position.y};o.force.x+=d.x,o.force.y+=d.y,o.torque+=v.x*d.y-v.y*d.x},r._totalProperties=function(o){for(var c={mass:0,area:0,inertia:0,centre:{x:0,y:0}},d=o.parts.length===1?0:1;d{var r={};s.exports=r;var p=e(35810),h=e(53402),a=e(15647),l=e(22562);(function(){r.create=function(n){return h.extend({id:h.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},n)},r.setModified=function(n,u,f,o){if(p.trigger(n,"compositeModified",n),n.isModified=u,u&&n.cache&&(n.cache.allBodies=null,n.cache.allConstraints=null,n.cache.allComposites=null),f&&n.parent&&r.setModified(n.parent,u,f,o),o)for(var c=0;c{var r={};s.exports=r;var p=e(69351);(function(){r.create=p.create,r.add=p.add,r.remove=p.remove,r.clear=p.clear,r.addComposite=p.addComposite,r.addBody=p.addBody,r.addConstraint=p.addConstraint})()},52284:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(4506);(function(){var a=[],l={overlap:0,axis:null},n={overlap:0,axis:null};r.create=function(u,f){return{pair:null,collided:!1,bodyA:u,bodyB:f,parentA:u.parent,parentB:f.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},r.collides=function(u,f,o){if(r._overlapAxes(l,u.vertices,f.vertices,u.axes),l.overlap<=0||(r._overlapAxes(n,f.vertices,u.vertices,f.axes),n.overlap<=0))return null;var c=o&&o.table[h.id(u,f)],d;c?d=c.collision:(d=r.create(u,f),d.collided=!0,d.bodyA=u.idY?Y=D:DZ?Z=D:Dd?d=m:m{var y={};s.exports=y,function(){y.create=function(e){return{vertex:e,normalImpulse:0,tangentImpulse:0}}}()},81388:(s,y,e)=>{var r={};s.exports=r;var p=e(53402),h=e(52284);(function(){r.create=function(a){var l={bodies:[],pairs:null};return p.extend(l,a)},r.setBodies=function(a,l){a.bodies=l.slice(0)},r.clear=function(a){a.bodies=[]},r.collisions=function(a){var l=[],n=a.pairs,u=a.bodies,f=u.length,o=r.canCollide,c=h.collides,d,v;for(u.sort(r._compareBoundsX),d=0;dM)break;if(!(wI.max.y)&&!(A&&(O.isStatic||O.isSleeping))&&o(m.collisionFilter,O.collisionFilter)){var D=O.parts.length;if(b&&D===1){var B=c(m,O,n);B&&l.push(B)}else for(var G=P>1?1:0,z=D>1?1:0,X=G;XI.max.x||S.max.xI.max.y)){var B=c(K,tt,n);B&&l.push(B)}}}}}return l},r.canCollide=function(a,l){return a.group===l.group&&a.group!==0?a.group>0:(a.mask&l.category)!==0&&(l.mask&a.category)!==0},r._compareBoundsX=function(a,l){return a.bounds.min.x-l.bounds.min.x}})()},4506:(s,y,e)=>{var r={};s.exports=r;var p=e(43424);(function(){r.create=function(h,a){var l=h.bodyA,n=h.bodyB,u={id:r.id(l,n),bodyA:l,bodyB:n,collision:h,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:l.isSensor||n.isSensor,timeCreated:a,timeUpdated:a,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(u,h,a),u},r.update=function(h,a,l){var n=h.contacts,u=a.supports,f=h.activeContacts,o=a.parentA,c=a.parentB,d=o.vertices.length;h.isActive=!0,h.timeUpdated=l,h.collision=a,h.separation=a.depth,h.inverseMass=o.inverseMass+c.inverseMass,h.friction=o.frictionc.frictionStatic?o.frictionStatic:c.frictionStatic,h.restitution=o.restitution>c.restitution?o.restitution:c.restitution,h.slop=o.slop>c.slop?o.slop:c.slop,a.pair=h,f.length=0;for(var v=0;v{var r={};s.exports=r;var p=e(4506),h=e(53402);(function(){r.create=function(a){return h.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},a)},r.update=function(a,l,n){var u=a.list,f=u.length,o=a.table,c=l.length,d=a.collisionStart,v=a.collisionEnd,m=a.collisionActive,S,M,w,C;for(d.length=0,v.length=0,m.length=0,C=0;C{var r={};s.exports=r;var p=e(31725),h=e(52284),a=e(15647),l=e(66280),n=e(41598);(function(){r.collides=function(u,f){for(var o=[],c=f.length,d=u.bounds,v=h.collides,m=a.overlaps,S=0;S{var r={};s.exports=r;var p=e(41598),h=e(53402),a=e(15647);(function(){r._restingThresh=2,r._restingThreshTangent=Math.sqrt(6),r._positionDampen=.9,r._positionWarming=.8,r._frictionNormalMultiplier=5,r._frictionMaxStatic=Number.MAX_VALUE,r.preSolvePosition=function(l){var n,u,f,o=l.length;for(n=0;nDt?(w=dt>0?dt:-dt,M=P.friction*(dt>0?1:-1)*o,M<-w?M=-w:M>w&&(M=w)):(M=dt,w=m);var Ht=_*z-q*G,Bt=at*z-ot*G,ne=Y/(Z+O.inverseInertia*Ht*Ht+I.inverseInertia*Bt*Bt),oe=(1+P.restitution)*Vt*ne;if(M*=ne,Vt0&&(H.normalImpulse=0),oe=H.normalImpulse-ge}if(dt<-d||dt>d)H.tangentImpulse=0;else{var xe=H.tangentImpulse;H.tangentImpulse+=M,H.tangentImpulse<-w&&(H.tangentImpulse=-w),H.tangentImpulse>w&&(H.tangentImpulse=w),M=H.tangentImpulse-xe}var Ae=G*oe+X*M,qt=z*oe+K*M;O.isStatic||O.isSleeping||(O.positionPrev.x+=Ae*O.inverseMass,O.positionPrev.y+=qt*O.inverseMass,O.anglePrev+=(_*qt-q*Ae)*O.inverseInertia),I.isStatic||I.isSleeping||(I.positionPrev.x-=Ae*I.inverseMass,I.positionPrev.y-=qt*I.inverseMass,I.anglePrev-=(at*qt-ot*Ae)*I.inverseInertia)}}}}})()},48140:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(31725),a=e(53614),l=e(15647),n=e(66615),u=e(53402);(function(){r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(f){var o=f;o.bodyA&&!o.pointA&&(o.pointA={x:0,y:0}),o.bodyB&&!o.pointB&&(o.pointB={x:0,y:0});var c=o.bodyA?h.add(o.bodyA.position,o.pointA):o.pointA,d=o.bodyB?h.add(o.bodyB.position,o.pointB):o.pointB,v=h.magnitude(h.sub(c,d));o.length=typeof o.length<"u"?o.length:v,o.id=o.id||u.nextId(),o.label=o.label||"Constraint",o.type="constraint",o.stiffness=o.stiffness||(o.length>0?1:.7),o.damping=o.damping||0,o.angularStiffness=o.angularStiffness||0,o.angleA=o.bodyA?o.bodyA.angle:o.angleA,o.angleB=o.bodyB?o.bodyB.angle:o.angleB,o.plugin={};var m={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return o.length===0&&o.stiffness>.1?(m.type="pin",m.anchors=!1):o.stiffness<.9&&(m.type="spring"),o.render=u.extend(m,o.render),o},r.preSolveAll=function(f){for(var o=0;o=1||f.length===0,b=P?f.stiffness*o:f.stiffness*o*o,O=f.damping*o,I=h.mult(w,A*b),D=(c?c.inverseMass:0)+(d?d.inverseMass:0),B=(c?c.inverseInertia:0)+(d?d.inverseInertia:0),G=D+B,z,X,K,Q,tt;if(O>0){var Y=h.create();K=h.div(w,C),tt=h.sub(d&&h.sub(d.position,d.positionPrev)||Y,c&&h.sub(c.position,c.positionPrev)||Y),Q=h.dot(K,tt)}c&&!c.isStatic&&(X=c.inverseMass/D,c.constraintImpulse.x-=I.x*X,c.constraintImpulse.y-=I.y*X,c.position.x-=I.x*X,c.position.y-=I.y*X,O>0&&(c.positionPrev.x-=O*K.x*Q*X,c.positionPrev.y-=O*K.y*Q*X),z=h.cross(v,I)/G*r._torqueDampen*c.inverseInertia*(1-f.angularStiffness),c.constraintImpulse.angle-=z,c.angle-=z),d&&!d.isStatic&&(X=d.inverseMass/D,d.constraintImpulse.x+=I.x*X,d.constraintImpulse.y+=I.y*X,d.position.x+=I.x*X,d.position.y+=I.y*X,O>0&&(d.positionPrev.x+=O*K.x*Q*X,d.positionPrev.y+=O*K.y*Q*X),z=h.cross(m,I)/G*r._torqueDampen*d.inverseInertia*(1-f.angularStiffness),d.constraintImpulse.angle+=z,d.angle+=z)}}},r.postSolveAll=function(f){for(var o=0;o0&&(m.position.x+=d.x,m.position.y+=d.y),d.angle!==0&&(p.rotate(m.vertices,d.angle,c.position),n.rotate(m.axes,d.angle),v>0&&h.rotateAbout(m.position,d.angle,c.position,m.position)),l.update(m.bounds,m.vertices,c.velocity)}d.angle*=r._warming,d.x*=r._warming,d.y*=r._warming}}},r.pointAWorld=function(f){return{x:(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),y:(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0)}},r.pointBWorld=function(f){return{x:(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),y:(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0)}},r.currentLength=function(f){var o=(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),c=(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0),d=(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),v=(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0),m=o-d,S=c-v;return Math.sqrt(m*m+S*S)}})()},53402:(s,y,e)=>{var r={};s.exports=r,function(){r._baseDelta=16.666666666666668,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(h,a){var l,n;typeof a=="boolean"?(l=2,n=a):(l=1,n=!0);for(var u=l;u0;a--){var l=Math.floor(r.random()*(a+1)),n=h[a];h[a]=h[l],h[l]=n}return h},r.choose=function(h){return h[Math.floor(r.random()*h.length)]},r.isElement=function(h){return typeof HTMLElement<"u"?h instanceof HTMLElement:!!(h&&h.nodeType&&h.nodeName)},r.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"},r.isFunction=function(h){return typeof h=="function"},r.isPlainObject=function(h){return typeof h=="object"&&h.constructor===Object},r.isString=function(h){return toString.call(h)==="[object String]"},r.clamp=function(h,a,l){return hl?l:h},r.sign=function(h){return h<0?-1:1},r.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-r._nowStartTime},r.random=function(h,a){return h=typeof h<"u"?h:0,a=typeof a<"u"?a:1,h+p()*(a-h)};var p=function(){return r._seed=(r._seed*9301+49297)%233280,r._seed/233280};r.colorToNumber=function(h){return h=h.replace("#",""),h.length==3&&(h=h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2)),parseInt(h,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var h=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[h]||(r.warn(h),r._warnedOnce[h]=!0)},r.deprecated=function(h,a,l){h[a]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",l)},h[a])},r.nextId=function(){return r._nextId++},r.indexOf=function(h,a){if(h.indexOf)return h.indexOf(a);for(var l=0;l{var r={};s.exports=r;var p=e(53614),h=e(66272),a=e(81388),l=e(99561),n=e(35810),u=e(69351),f=e(48140),o=e(53402),c=e(22562);(function(){r.create=function(d){d=d||{};var v={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}},m=o.extend(v,d);return m.world=d.world||u.create({label:"World"}),m.pairs=d.pairs||l.create(),m.detector=d.detector||a.create(),m.grid={buckets:[]},m.world.gravity=m.gravity,m.broadphase=m.grid,m.metrics={},m},r.update=function(d,v){var m=o.now(),S=d.world,M=d.detector,w=d.pairs,C=d.timing,A=C.timestamp,P;v=typeof v<"u"?v:o._baseDelta,v*=C.timeScale,C.timestamp+=v,C.lastDelta=v;var b={timestamp:C.timestamp,delta:v};n.trigger(d,"beforeUpdate",b);var O=u.allBodies(S),I=u.allConstraints(S);for(S.isModified&&(a.setBodies(M,O),u.setModified(S,!1,!1,!0)),d.enableSleeping&&p.update(O,v),r._bodiesApplyGravity(O,d.gravity),v>0&&r._bodiesUpdate(O,v),n.trigger(d,"beforeSolve",b),f.preSolveAll(O),P=0;P0&&n.trigger(d,"collisionStart",{pairs:w.collisionStart,timestamp:C.timestamp,delta:v});var B=o.clamp(20/d.positionIterations,0,1);for(h.preSolvePosition(w.list),P=0;P0&&n.trigger(d,"collisionActive",{pairs:w.collisionActive,timestamp:C.timestamp,delta:v}),w.collisionEnd.length>0&&n.trigger(d,"collisionEnd",{pairs:w.collisionEnd,timestamp:C.timestamp,delta:v}),r._bodiesClearForces(O),n.trigger(d,"afterUpdate",b),d.timing.lastElapsed=o.now()-m,d},r.merge=function(d,v){if(o.extend(d,v),v.world){d.world=v.world,r.clear(d);for(var m=u.allBodies(d.world),S=0;S{var r={};s.exports=r;var p=e(53402);(function(){r.on=function(h,a,l){for(var n=a.split(" "),u,f=0;f0){l||(l={}),n=a.split(" ");for(var d=0;d{var r={};s.exports=r;var p=e(73832),h=e(53402);(function(){r.name="matter-js",r.version="0.19.0",r.uses=[],r.used=[],r.use=function(){p.use(r,Array.prototype.slice.call(arguments))},r.before=function(a,l){return a=a.replace(/^Matter./,""),h.chainPathBefore(r,a,l)},r.after=function(a,l){return a=a.replace(/^Matter./,""),h.chainPathAfter(r,a,l)}})()},73832:(s,y,e)=>{var r={};s.exports=r;var p=e(53402);(function(){r._registry={},r.register=function(h){if(r.isPlugin(h)||p.warn("Plugin.register:",r.toString(h),"does not implement all required fields."),h.name in r._registry){var a=r._registry[h.name],l=r.versionParse(h.version).number,n=r.versionParse(a.version).number;l>n?(p.warn("Plugin.register:",r.toString(a),"was upgraded to",r.toString(h)),r._registry[h.name]=h):l-1},r.isFor=function(h,a){var l=h.for&&r.dependencyParse(h.for);return!h.for||a.name===l.name&&r.versionSatisfies(a.version,l.range)},r.use=function(h,a){if(h.uses=(h.uses||[]).concat(a||[]),h.uses.length===0){p.warn("Plugin.use:",r.toString(h),"does not specify any dependencies to install.");return}for(var l=r.dependencies(h),n=p.topologicalSort(l),u=[],f=0;f0&&!o.silent&&p.info(u.join(" "))},r.dependencies=function(h,a){var l=r.dependencyParse(h),n=l.name;if(a=a||{},!(n in a)){h=r.resolve(h)||h,a[n]=p.map(h.uses||[],function(f){r.isPlugin(f)&&r.register(f);var o=r.dependencyParse(f),c=r.resolve(f);return c&&!r.versionSatisfies(c.version,o.range)?(p.warn("Plugin.dependencies:",r.toString(c),"does not satisfy",r.toString(o),"used by",r.toString(l)+"."),c._warned=!0,h._warned=!0):c||(p.warn("Plugin.dependencies:",r.toString(f),"used by",r.toString(l),"could not be resolved."),h._warned=!0),o.name});for(var u=0;u=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;a.test(h)||p.warn("Plugin.versionParse:",h,"is not a valid version or range.");var l=a.exec(h),n=Number(l[4]),u=Number(l[5]),f=Number(l[6]);return{isRange:!!(l[1]||l[2]),version:l[3],range:h,operator:l[1]||l[2]||"",major:n,minor:u,patch:f,parts:[n,u,f],prerelease:l[7],number:n*1e8+u*1e4+f}},r.versionSatisfies=function(h,a){a=a||"*";var l=r.versionParse(a),n=r.versionParse(h);if(l.isRange){if(l.operator==="*"||h==="*")return!0;if(l.operator===">")return n.number>l.number;if(l.operator===">=")return n.number>=l.number;if(l.operator==="~")return n.major===l.major&&n.minor===l.minor&&n.patch>=l.patch;if(l.operator==="^")return l.major>0?n.major===l.major&&n.number>=l.number:l.minor>0?n.minor===l.minor&&n.patch>=l.patch:n.patch===l.patch}return h===a||h==="*"}})()},53614:(s,y,e)=>{var r={};s.exports=r;var p=e(22562),h=e(35810),a=e(53402);(function(){r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(l,n){for(var u=n/a._baseDelta,f=r._motionSleepThreshold,o=0;o0&&c.motion=c.sleepThreshold/u&&r.set(c,!0)):c.sleepCounter>0&&(c.sleepCounter-=1)}},r.afterCollisions=function(l){for(var n=r._motionSleepThreshold,u=0;un&&r.set(v,!1)}}}},r.set=function(l,n){var u=l.isSleeping;n?(l.isSleeping=!0,l.sleepCounter=l.sleepThreshold,l.positionImpulse.x=0,l.positionImpulse.y=0,l.positionPrev.x=l.position.x,l.positionPrev.y=l.position.y,l.anglePrev=l.angle,l.speed=0,l.angularSpeed=0,l.motion=0,u||h.trigger(l,"sleepStart")):(l.isSleeping=!1,l.sleepCounter=0,u&&h.trigger(l,"sleepEnd"))}})()},66280:(s,y,e)=>{var r={};s.exports=r;var p=e(41598),h=e(53402),a=e(22562),l=e(15647),n=e(31725);(function(){r.rectangle=function(u,f,o,c,d){d=d||{};var v={label:"Rectangle Body",position:{x:u,y:f},vertices:p.fromPath("L 0 0 L "+o+" 0 L "+o+" "+c+" L 0 "+c)};if(d.chamfer){var m=d.chamfer;v.vertices=p.chamfer(v.vertices,m.radius,m.quality,m.qualityMin,m.qualityMax),delete d.chamfer}return a.create(h.extend({},v,d))},r.trapezoid=function(u,f,o,c,d,v){v=v||{},d*=.5;var m=(1-d*2)*o,S=o*d,M=S+m,w=M+S,C;d<.5?C="L 0 0 L "+S+" "+-c+" L "+M+" "+-c+" L "+w+" 0":C="L 0 0 L "+M+" "+-c+" L "+w+" 0";var A={label:"Trapezoid Body",position:{x:u,y:f},vertices:p.fromPath(C)};if(v.chamfer){var P=v.chamfer;A.vertices=p.chamfer(A.vertices,P.radius,P.quality,P.qualityMin,P.qualityMax),delete v.chamfer}return a.create(h.extend({},A,v))},r.circle=function(u,f,o,c,d){c=c||{};var v={label:"Circle Body",circleRadius:o};d=d||25;var m=Math.ceil(Math.max(10,Math.min(d,o)));return m%2===1&&(m+=1),r.polygon(u,f,m,o,h.extend({},v,c))},r.polygon=function(u,f,o,c,d){if(d=d||{},o<3)return r.circle(u,f,c,d);for(var v=2*Math.PI/o,m="",S=v*.5,M=0;M0&&p.area(tt)1?(C=a.create(h.extend({parts:A.slice(0)},c)),a.setPosition(C,{x:u,y:f}),C):A[0]},r.flagCoincidentParts=function(u,f){f===void 0&&(f=5);for(var o=0;o{var r={};s.exports=r;var p=e(69351),h=e(48140),a=e(53402),l=e(22562),n=e(66280);(function(){r.stack=function(u,f,o,c,d,v,m){for(var S=p.create({label:"Stack"}),M=u,w=f,C,A=0,P=0;Pb&&(b=D),l.translate(I,{x:B*.5,y:D*.5}),M=I.bounds.max.x+d,p.addBody(S,I),C=I,A+=1}else M+=d}w+=b+v,M=u}return S},r.chain=function(u,f,o,c,d,v){for(var m=u.bodies,S=1;S0)for(S=0;S0&&(C=v[S-1+(m-1)*f],p.addConstraint(u,h.create(a.extend({bodyA:C,bodyB:w},d)))),c&&Sb)){C=b-C;var I=C,D=o-1-C;if(!(wD)){P===1&&l.translate(A,{x:(w+(o%2===1?1:-1))*O,y:0});var B=A?w*O:0;return m(u+B+w*d,M,w,C,A,P)}}})},r.newtonsCradle=function(u,f,o,c,d){for(var v=p.create({label:"Newtons Cradle"}),m=0;m{var r={};s.exports=r;var p=e(31725),h=e(53402);(function(){r.fromVertices=function(a){for(var l={},n=0;n{var y={};s.exports=y,function(){y.create=function(e){var r={min:{x:0,y:0},max:{x:0,y:0}};return e&&y.update(r,e),r},y.update=function(e,r,p){e.min.x=1/0,e.max.x=-1/0,e.min.y=1/0,e.max.y=-1/0;for(var h=0;he.max.x&&(e.max.x=a.x),a.xe.max.y&&(e.max.y=a.y),a.y0?e.max.x+=p.x:e.min.x+=p.x,p.y>0?e.max.y+=p.y:e.min.y+=p.y)},y.contains=function(e,r){return r.x>=e.min.x&&r.x<=e.max.x&&r.y>=e.min.y&&r.y<=e.max.y},y.overlaps=function(e,r){return e.min.x<=r.max.x&&e.max.x>=r.min.x&&e.max.y>=r.min.y&&e.min.y<=r.max.y},y.translate=function(e,r){e.min.x+=r.x,e.max.x+=r.x,e.min.y+=r.y,e.max.y+=r.y},y.shift=function(e,r){var p=e.max.x-e.min.x,h=e.max.y-e.min.y;e.min.x=r.x,e.max.x=r.x+p,e.min.y=r.y,e.max.y=r.y+h}}()},74058:(s,y,e)=>{var r={};s.exports=r,e(15647);var p=e(53402);(function(){r.pathToVertices=function(h,a){typeof window<"u"&&!("SVGPathSeg"in window)&&p.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var l,n,u,f,o,c,d,v,m,S,M=[],w,C,A=0,P=0,b=0;a=a||15;var O=function(D,B,G){var z=G%2===1&&G>1;if(!m||D!=m.x||B!=m.y){m&&z?(w=m.x,C=m.y):(w=0,C=0);var X={x:w+D,y:C+B};(z||!m)&&(m=X),M.push(X),P=w+D,b=C+B}},I=function(D){var B=D.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":P=D.x,b=D.y;break;case"H":P=D.x;break;case"V":b=D.y;break}O(P,b,D.pathSegType)}};for(r._svgPathToAbsolute(h),u=h.getTotalLength(),c=[],l=0;l{var y={};s.exports=y,function(){y.create=function(e,r){return{x:e||0,y:r||0}},y.clone=function(e){return{x:e.x,y:e.y}},y.magnitude=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},y.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},y.rotate=function(e,r,p){var h=Math.cos(r),a=Math.sin(r);p||(p={});var l=e.x*h-e.y*a;return p.y=e.x*a+e.y*h,p.x=l,p},y.rotateAbout=function(e,r,p,h){var a=Math.cos(r),l=Math.sin(r);h||(h={});var n=p.x+((e.x-p.x)*a-(e.y-p.y)*l);return h.y=p.y+((e.x-p.x)*l+(e.y-p.y)*a),h.x=n,h},y.normalise=function(e){var r=y.magnitude(e);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},y.dot=function(e,r){return e.x*r.x+e.y*r.y},y.cross=function(e,r){return e.x*r.y-e.y*r.x},y.cross3=function(e,r,p){return(r.x-e.x)*(p.y-e.y)-(r.y-e.y)*(p.x-e.x)},y.add=function(e,r,p){return p||(p={}),p.x=e.x+r.x,p.y=e.y+r.y,p},y.sub=function(e,r,p){return p||(p={}),p.x=e.x-r.x,p.y=e.y-r.y,p},y.mult=function(e,r){return{x:e.x*r,y:e.y*r}},y.div=function(e,r){return{x:e.x/r,y:e.y/r}},y.perp=function(e,r){return r=r===!0?-1:1,{x:r*-e.y,y:r*e.x}},y.neg=function(e){return{x:-e.x,y:-e.y}},y.angle=function(e,r){return Math.atan2(r.y-e.y,r.x-e.x)},y._temp=[y.create(),y.create(),y.create(),y.create(),y.create(),y.create()]}()},41598:(s,y,e)=>{var r={};s.exports=r;var p=e(31725),h=e(53402);(function(){r.create=function(a,l){for(var n=[],u=0;u0)return!1;o=c}return!0},r.scale=function(a,l,n,u){if(l===1&&n===1)return a;u=u||r.centre(a);for(var f,o,c=0;c=0?c-1:a.length-1],v=a[c],m=a[(c+1)%a.length],S=l[c0&&(l|=2),l===3)return!1;return l!==0?!0:null},r.hull=function(a){var l=[],n=[],u,f;for(a=a.slice(0),a.sort(function(o,c){var d=o.x-c.x;return d!==0?d:o.y-c.y}),f=0;f=2&&p.cross3(n[n.length-2],n[n.length-1],u)<=0;)n.pop();n.push(u)}for(f=a.length-1;f>=0;f-=1){for(u=a[f];l.length>=2&&p.cross3(l[l.length-2],l[l.length-1],u)<=0;)l.pop();l.push(u)}return l.pop(),n.pop(),l.concat(n)}})()},18210:(s,y,e)=>{var r=e(19933),p={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Body.create",function(){p.Body.init(this)}),h.before("Engine.update",function(a){p.Engine.update(a)})},Body:{init:function(h){h.plugin.attractors=h.plugin.attractors||[]}},Engine:{update:function(h){for(var a=r.Composite.allBodies(h.world),l=0;l0)for(var f=0;f{/** + * @author @dxu https://github.com/dxu/matter-collision-events + * @author Richard Davey + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.19.0",silent:!0,install:function(e){e.after("Engine.create",function(){e.Events.on(this,"collisionStart",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collide",h,a,p),a.gameObject&&a.gameObject.emit("collide",a,h,p),e.Events.trigger(h,"onCollide",{pair:p}),e.Events.trigger(a,"onCollide",{pair:p}),h.onCollideCallback&&h.onCollideCallback(p),a.onCollideCallback&&a.onCollideCallback(p),h.onCollideWith[a.id]&&h.onCollideWith[a.id](a,p),a.onCollideWith[h.id]&&a.onCollideWith[h.id](h,p)})}),e.Events.on(this,"collisionActive",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collideActive",h,a,p),a.gameObject&&a.gameObject.emit("collideActive",a,h,p),e.Events.trigger(h,"onCollideActive",{pair:p}),e.Events.trigger(a,"onCollideActive",{pair:p}),h.onCollideActiveCallback&&h.onCollideActiveCallback(p),a.onCollideActiveCallback&&a.onCollideActiveCallback(p)})}),e.Events.on(this,"collisionEnd",function(r){r.pairs.map(function(p){var h=p.bodyA,a=p.bodyB;h.gameObject&&h.gameObject.emit("collideEnd",h,a,p),a.gameObject&&a.gameObject.emit("collideEnd",a,h,p),e.Events.trigger(h,"onCollideEnd",{pair:p}),e.Events.trigger(a,"onCollideEnd",{pair:p}),h.onCollideEndCallback&&h.onCollideEndCallback(p),a.onCollideEndCallback&&a.onCollideEndCallback(p)})})})}};s.exports=y},74507:(s,y,e)=>{var r=e(19933),p={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Engine.update",function(){p.Engine.update(this)})},Engine:{update:function(h){for(var a=h.world,l=r.Composite.allBodies(a),n=r.Composite.allComposites(a),u=0;ua.max.x?l=a.min.x-h.max.x:h.max.xa.max.y?n=a.min.y-h.max.y:h.max.y{/** + * @author Stefan Hedman (http://steffe.se) + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={decomp:I,quickDecomp:z,isSimple:B,removeCollinearPoints:X,removeDuplicatePoints:K,makeCCW:m};function y(Y,Z,U){U=U||0;var H=[0,0],J,_,q,at,ot,rt,gt;return J=Y[1][1]-Y[0][1],_=Y[0][0]-Y[1][0],q=J*Y[0][0]+_*Y[0][1],at=Z[1][1]-Z[0][1],ot=Z[0][0]-Z[1][0],rt=at*Z[0][0]+ot*Z[0][1],gt=J*ot-at*_,Q(gt,0,U)||(H[0]=(ot*q-_*rt)/gt,H[1]=(J*rt-at*q)/gt),H}function e(Y,Z,U,H){var J=Z[0]-Y[0],_=Z[1]-Y[1],q=H[0]-U[0],at=H[1]-U[1];if(q*_-at*J===0)return!1;var ot=(J*(U[1]-Y[1])+_*(Y[0]-U[0]))/(q*_-at*J),rt=(q*(Y[1]-U[1])+at*(U[0]-Y[0]))/(at*J-q*_);return ot>=0&&ot<=1&&rt>=0&&rt<=1}function r(Y,Z,U){return(Z[0]-Y[0])*(U[1]-Y[1])-(U[0]-Y[0])*(Z[1]-Y[1])}function p(Y,Z,U){return r(Y,Z,U)>0}function h(Y,Z,U){return r(Y,Z,U)>=0}function a(Y,Z,U){return r(Y,Z,U)<0}function l(Y,Z,U){return r(Y,Z,U)<=0}var n=[],u=[];function f(Y,Z,U,H){if(H){var J=n,_=u;J[0]=Z[0]-Y[0],J[1]=Z[1]-Y[1],_[0]=U[0]-Z[0],_[1]=U[1]-Z[1];var q=J[0]*_[0]+J[1]*_[1],at=Math.sqrt(J[0]*J[0]+J[1]*J[1]),ot=Math.sqrt(_[0]*_[0]+_[1]*_[1]),rt=Math.acos(q/(at*ot));return rtU[Z][0])&&(Z=H);return p(c(Y,Z-1),c(Y,Z),c(Y,Z+1))?!1:(S(Y),!0)}function S(Y){for(var Z=[],U=Y.length,H=0;H!==U;H++)Z.push(Y.pop());for(var H=0;H!==U;H++)Y[H]=Z[H]}function M(Y,Z){return a(c(Y,Z-1),c(Y,Z),c(Y,Z+1))}var w=[],C=[];function A(Y,Z,U){var H,J,_=w,q=C;if(h(c(Y,Z+1),c(Y,Z),c(Y,U))&&l(c(Y,Z-1),c(Y,Z),c(Y,U)))return!1;J=o(c(Y,Z),c(Y,U));for(var at=0;at!==Y.length;++at)if(!((at+1)%Y.length===Z||at===Z)&&h(c(Y,Z),c(Y,U),c(Y,at+1))&&l(c(Y,Z),c(Y,U),c(Y,at))&&(_[0]=c(Y,Z),_[1]=c(Y,U),q[0]=c(Y,at),q[1]=c(Y,at+1),H=y(_,q),o(c(Y,Z),H)0?D(Y,Z):[Y]}function D(Y,Z){if(Z.length===0)return[Y];if(Z instanceof Array&&Z.length&&Z[0]instanceof Array&&Z[0].length===2&&Z[0][0]instanceof Array){for(var U=[Y],H=0;H_)return console.warn("quickDecomp: max level ("+_+") reached."),Z;for(var Bt=0;BtPt&&(Pt+=Y.length),At=Number.MAX_VALUE,Pt3&&H>=0;--H)f(c(Y,H-1),c(Y,H),c(Y,H+1),Z)&&(Y.splice(H%Y.length,1),U++);return U}function K(Y,Z){for(var U=Y.length-1;U>=1;--U)for(var H=Y[U],J=U-1;J>=0;--J)if(tt(H,Y[J],Z)){Y.splice(U,1);continue}}function Q(Y,Z,U){return U=U||0,Math.abs(Y-Z)<=U}function tt(Y,Z,U){return Q(Y[0],Z[0],U)&&Q(Y[1],Z[1],U)}},52018:(s,y,e)=>{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var r=e(83419),p=new r({initialize:function(a){this.pluginManager=a,this.game=a.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});s.exports=p},42363:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};s.exports=y},37277:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={},e={},r={};r.register=function(p,h,a,l){l===void 0&&(l=!1),y[p]={plugin:h,mapping:a,custom:l}},r.registerCustom=function(p,h,a,l){e[p]={plugin:h,mapping:a,data:l}},r.hasCore=function(p){return y.hasOwnProperty(p)},r.hasCustom=function(p){return e.hasOwnProperty(p)},r.getCore=function(p){return y[p]},r.getCustom=function(p){return e[p]},r.getCustomClass=function(p){return e.hasOwnProperty(p)?e[p].plugin:null},r.remove=function(p){y.hasOwnProperty(p)&&delete y[p]},r.removeCustom=function(p){e.hasOwnProperty(p)&&delete e[p]},r.destroyCorePlugins=function(){for(var p in y)y.hasOwnProperty(p)&&delete y[p]},r.destroyCustomPlugins=function(){for(var p in e)e.hasOwnProperty(p)&&delete e[p]},s.exports=r},77332:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(8443),h=e(50792),a=e(74099),l=e(44603),n=e(39429),u=e(95540),f=e(37277),o=e(72905),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],v.isBooted?this.boot():v.events.once(p.BOOT,this.boot,this)},boot:function(){var d,v,m,S,M,w,C,A=this.game.config,P=A.installGlobalPlugins;for(P=P.concat(this._pendingGlobal),d=0;d{/** +* @author Richard Davey +* @copyright 2013-2024 Phaser Studio Inc. +* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} +*/var r=e(52018),p=e(83419),h=e(44594),a=new p({Extends:r,initialize:function(n,u,f){r.call(this,u),this.scene=n,this.systems=n.sys,this.pluginKey=f,n.sys.events.once(h.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});s.exports=a},18922:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={BasePlugin:e(52018),DefaultPlugins:e(42363),PluginCache:e(37277),PluginManager:e(77332),ScenePlugin:e(45145)}},63595:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(s){const y=performance.now(),e=this.getVideoPlaybackQuality(),r=this.mozPresentedFrames||this.mozPaintedFrames||e.totalVideoFrames-e.droppedVideoFrames,p=(h,a)=>{const l=this.getVideoPlaybackQuality(),n=this.mozPresentedFrames||this.mozPaintedFrames||l.totalVideoFrames-l.droppedVideoFrames;if(n>r){const u=this.mozFrameDelay||l.totalFrameDelay-e.totalFrameDelay||0,f=a-h;s(a,{presentationTime:a+u*1e3,expectedDisplayTime:a+f,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+f/1e3,presentedFrames:n,processingDuration:u}),delete this._rvfcpolyfillmap[y]}else this._rvfcpolyfillmap[y]=requestAnimationFrame(u=>p(a,u))};return this._rvfcpolyfillmap[y]=requestAnimationFrame(h=>p(y,h)),y},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(s){cancelAnimationFrame(this._rvfcpolyfillmap[s]),delete this._rvfcpolyfillmap[s]})},10312:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={DEFAULT:0,LINEAR:0,NEAREST:1};s.exports=y},68627:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19715),p=e(32880),h=e(83419),a=e(8054),l=e(50792),n=e(92503),u=e(56373),f=e(97480),o=e(69442),c=e(61340),d=new h({Extends:l,initialize:function(m){l.call(this);var S=m.config;this.config={clearBeforeRender:S.clearBeforeRender,backgroundColor:S.backgroundColor,antialias:S.antialias,roundPixels:S.roundPixels},this.game=m,this.type=a.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=m.canvas;var M={alpha:m.config.transparent,desynchronized:m.config.desynchronized,willReadFrequently:!1};this.gameContext=S.context?S.context:this.gameCanvas.getContext("2d",M),this.currentContext=this.gameContext,this.antialias=m.config.antialias,this.blendModes=u(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(o.READY,this.boot,this)},boot:function(){var v=this.game,m=v.scale.baseSize;this.width=m.width,this.height=m.height,this.isBooted=!0,v.scale.on(f.RESIZE,this.onResize,this),this.resize(m.width,m.height)},onResize:function(v,m){(m.width!==this.width||m.height!==this.height)&&this.resize(m.width,m.height)},resize:function(v,m){this.width=v,this.height=m,this.emit(n.RESIZE,v,m)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(v){return this.currentContext.globalCompositeOperation=v,this},setContext:function(v){return this.currentContext=v||this.gameContext,this},setAlpha:function(v){return this.currentContext.globalAlpha=v,this},preRender:function(){var v=this.gameContext,m=this.config,S=this.width,M=this.height;v.globalAlpha=1,v.globalCompositeOperation="source-over",v.setTransform(1,0,0,1,0,0),m.clearBeforeRender&&(v.clearRect(0,0,S,M),m.transparent||(v.fillStyle=m.backgroundColor.rgba,v.fillRect(0,0,S,M))),v.save(),this.drawCount=0,this.emit(n.PRE_RENDER)},render:function(v,m,S){var M=m.length;this.emit(n.RENDER,v,S);var w=S.x,C=S.y,A=S.width,P=S.height,b=S.renderToTexture?S.context:v.sys.context;b.save(),this.game.scene.customViewports&&(b.beginPath(),b.rect(w,C,A,P),b.clip()),S.emit(r.PRE_RENDER,S),this.currentContext=b;var O=S.mask;O&&O.preRenderCanvas(this,null,S._maskCamera),S.transparent||(b.fillStyle=S.backgroundColor.rgba,b.fillRect(w,C,A,P)),b.globalAlpha=S.alpha,b.globalCompositeOperation="source-over",this.drawCount+=M,S.renderToTexture&&S.emit(r.PRE_RENDER,S),S.matrix.copyToContext(b);for(var I=0;I=0?Q=-(Q+D):Q<0&&(Q=Math.abs(Q)-D)),v.flipY&&(tt>=0?tt=-(tt+B):tt<0&&(tt=Math.abs(tt)-B))}var Z=1,U=1;v.flipX&&(G||(Q+=-m.realWidth+X*2),Z=-1),v.flipY&&(G||(tt+=-m.realHeight+K*2),U=-1);var H=v.x,J=v.y;P.applyITRS(H,J,v.rotation,v.scaleX*Z,v.scaleY*U),A.copyFrom(S.matrix),M?(A.multiplyWithOffset(M,-S.scrollX*v.scrollFactorX,-S.scrollY*v.scrollFactorY),P.e=H,P.f=J):(P.e-=S.scrollX*v.scrollFactorX,P.f-=S.scrollY*v.scrollFactorY),A.multiply(P),S.roundPixels&&(A.e=Math.round(A.e),A.f=Math.round(A.f)),C.save(),A.setToContext(C),C.globalCompositeOperation=this.blendModes[v.blendMode],C.globalAlpha=w,C.imageSmoothingEnabled=!m.source.scaleMode,v.mask&&v.mask.preRenderCanvas(this,v,S),D>0&&B>0&&(S.roundPixels?C.drawImage(m.source.image,O,I,D,B,Math.round(Q),Math.round(tt),Math.round(D/z),Math.round(B/z)):C.drawImage(m.source.image,O,I,D,B,Q,tt,D/z,B/z)),v.mask&&v.mask.postRenderCanvas(this,v,S),C.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});s.exports=d},55830:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CanvasRenderer:e(68627),GetBlendModes:e(56373),SetTransform:e(20926)}},56373:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(89289),h=function(){var a=[],l=p.supportNewBlendModes,n="source-over";return a[r.NORMAL]=n,a[r.ADD]="lighter",a[r.MULTIPLY]=l?"multiply":n,a[r.SCREEN]=l?"screen":n,a[r.OVERLAY]=l?"overlay":n,a[r.DARKEN]=l?"darken":n,a[r.LIGHTEN]=l?"lighten":n,a[r.COLOR_DODGE]=l?"color-dodge":n,a[r.COLOR_BURN]=l?"color-burn":n,a[r.HARD_LIGHT]=l?"hard-light":n,a[r.SOFT_LIGHT]=l?"soft-light":n,a[r.DIFFERENCE]=l?"difference":n,a[r.EXCLUSION]=l?"exclusion":n,a[r.HUE]=l?"hue":n,a[r.SATURATION]=l?"saturation":n,a[r.COLOR]=l?"color":n,a[r.LUMINOSITY]=l?"luminosity":n,a[r.ERASE]="destination-out",a[r.SOURCE_IN]="source-in",a[r.SOURCE_OUT]="source-out",a[r.SOURCE_ATOP]="source-atop",a[r.DESTINATION_OVER]="destination-over",a[r.DESTINATION_IN]="destination-in",a[r.DESTINATION_OUT]="destination-out",a[r.DESTINATION_ATOP]="destination-atop",a[r.LIGHTER]="lighter",a[r.COPY]="copy",a[r.XOR]="xor",a};s.exports=h},20926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91296),p=function(h,a,l,n,u){var f=n.alpha*l.alpha;if(f<=0)return!1;var o=r(l,n,u).calc;return a.globalCompositeOperation=h.blendModes[l.blendMode],a.globalAlpha=f,a.save(),o.setToContext(a),a.imageSmoothingEnabled=l.frame?!l.frame.source.scaleMode:h.antialias,!0};s.exports=p},63899:s=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="losewebgl"},6119:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postrender"},48070:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},15640:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="render"},8912:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resize"},87124:s=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="restorewebgl"},92503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={LOSE_WEBGL:e(63899),POST_RENDER:e(6119),PRE_RENDER:e(48070),RENDER:e(15640),RESIZE:e(8912),RESTORE_WEBGL:e(87124)}},36909:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(92503),Snapshot:e(89966)},s.exports.Canvas=e(55830),s.exports.WebGL=e(4159)},32880:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(40987),h=e(95540),a=function(l,n){var u=h(n,"callback"),f=h(n,"type","image/png"),o=h(n,"encoder",.92),c=Math.abs(Math.round(h(n,"x",0))),d=Math.abs(Math.round(h(n,"y",0))),v=Math.floor(h(n,"width",l.width)),m=Math.floor(h(n,"height",l.height)),S=h(n,"getPixel",!1);if(S){var M=l.getContext("2d",{willReadFrequently:!1}),w=M.getImageData(c,d,1,1),C=w.data;u.call(null,new p(C[0],C[1],C[2],C[3]))}else if(c!==0||d!==0||v!==l.width||m!==l.height){var A=r.createWebGL(this,v,m),P=A.getContext("2d",{willReadFrequently:!0});v>0&&m>0&&P.drawImage(l,c,d,v,m,0,0,v,m);var b=new Image;b.onerror=function(){u.call(null),r.remove(A)},b.onload=function(){u.call(null,b),r.remove(A)},b.src=A.toDataURL(f,o)}else{var O=new Image;O.onerror=function(){u.call(null)},O.onload=function(){u.call(null,O)},O.src=l.toDataURL(f,o)}};s.exports=a},88815:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(40987),h=e(95540),a=function(l,n){var u=l,f=h(n,"callback"),o=h(n,"type","image/png"),c=h(n,"encoder",.92),d=Math.abs(Math.round(h(n,"x",0))),v=Math.abs(Math.round(h(n,"y",0))),m=h(n,"getPixel",!1),S=h(n,"isFramebuffer",!1),M=S?h(n,"bufferWidth",1):u.drawingBufferWidth,w=S?h(n,"bufferHeight",1):u.drawingBufferHeight;if(m){var C=new Uint8Array(4),A=S?v:w-v;u.readPixels(d,A,1,1,u.RGBA,u.UNSIGNED_BYTE,C),f.call(null,new p(C[0],C[1],C[2],C[3]))}else{var P=Math.floor(h(n,"width",M)),b=Math.floor(h(n,"height",w)),O=P*b*4,I=new Uint8Array(O);u.readPixels(d,w-v-b,P,b,u.RGBA,u.UNSIGNED_BYTE,I);for(var D=r.createWebGL(this,P,b),B=D.getContext("2d",{willReadFrequently:!0}),G=B.getImageData(0,0,P,b),z=G.data,X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Canvas:e(32880),WebGL:e(88815)}},7530:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(36060),h=e(90330),a=e(82264),l=e(95540),n=e(32302),u=e(63448),f=e(31302),o=e(58918),c=e(14811),d=e(92651),v=e(96569),m=e(56527),S=e(57516),M=e(43439),w=e(81041),C=e(12385),A=e(7589),P=e(95428),b=e(72905),O=new r({initialize:function(D){this.game=D.game,this.renderer=D,this.classes=new h([[p.UTILITY_PIPELINE,A],[p.MULTI_PIPELINE,S],[p.BITMAPMASK_PIPELINE,f],[p.SINGLE_PIPELINE,C],[p.ROPE_PIPELINE,w],[p.LIGHT_PIPELINE,v],[p.POINTLIGHT_PIPELINE,M],[p.MOBILE_PIPELINE,m]]),this.postPipelineClasses=new h,this.pipelines=new h,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,D,B){var G=this.renderer,z=this.renderTargets;this.frameInc=Math.floor(l(I,"frameInc",32));var X=G.width,K=G.height,Q=this.game.config.disablePreFX,tt=this.game.config.disablePostFX;if(tt||this.postPipelineClasses.setAll([[String(c.BARREL),o.Barrel],[String(c.BLOOM),o.Bloom],[String(c.BLUR),o.Blur],[String(c.BOKEH),o.Bokeh],[String(c.CIRCLE),o.Circle],[String(c.COLOR_MATRIX),o.ColorMatrix],[String(c.DISPLACEMENT),o.Displacement],[String(c.GLOW),o.Glow],[String(c.GRADIENT),o.Gradient],[String(c.PIXELATE),o.Pixelate],[String(c.SHADOW),o.Shadow],[String(c.SHINE),o.Shine],[String(c.VIGNETTE),o.Vignette],[String(c.WIPE),o.Wipe]]),!Q){this.classes.set(p.FX_PIPELINE,d);for(var Y=Math.min(X,K),Z=Math.ceil(Y/this.frameInc),U=1;U=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatch:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;B=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatchCamera:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;Bthis.maxDimension)return this.targetIndex=D.length-B,D[this.targetIndex];var G=(u(I,this.frameInc,0,!0)-1)*B;return this.targetIndex=G,D[G]},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}});s.exports=O},32302:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92503),h=new r({initialize:function(l,n,u,f,o,c,d,v,m){f===void 0&&(f=1),o===void 0&&(o=0),c===void 0&&(c=!0),d===void 0&&(d=!1),v===void 0&&(v=!0),m===void 0&&(m=!0),this.renderer=l,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=f,this.minFilter=o,this.autoClear=c,this.autoResize=!0,this.hasDepthBuffer=v,this.forceClamp=m,this.resize(n,u),d?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(a){return a&&!this.autoResize?(this.renderer.on(p.RESIZE,this.resize,this),this.autoResize=!0):!a&&this.autoResize&&(this.renderer.off(p.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(a,l){if(a=Math.round(a*this.scale),l=Math.round(l*this.scale),a<=0&&(a=1),l<=0&&(l=1),this.autoResize&&(a!==this.width||l!==this.height)){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),this.texture=n.createTextureFromSource(null,a,l,this.minFilter,this.forceClamp),this.framebuffer=n.createFramebuffer(a,l,this.texture,this.hasDepthBuffer),this.width=a,this.height=l}return this},willResize:function(a,l){return a=Math.round(a*this.scale),l=Math.round(l*this.scale),a<=0&&(a=1),l<=0&&(l=1),a!==this.width||l!==this.height},bind:function(a,l,n){a===void 0&&(a=!1);var u=this.renderer;if(a&&u.flush(),l&&n&&this.resize(l,n),u.pushFramebuffer(this.framebuffer,!1,!1),a&&this.adjustViewport(),this.autoClear){var f=this.renderer.gl;f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT)}u.clearStencilMask()},adjustViewport:function(){var a=this.renderer.gl;a.viewport(0,0,this.width,this.height),a.disable(a.SCISSOR_TEST)},clear:function(){var a=this.renderer,l=a.gl;a.pushFramebuffer(this.framebuffer),l.disable(l.SCISSOR_TEST),l.clearColor(0,0,0,0),l.clear(l.COLOR_BUFFER_BIT),a.popFramebuffer(),a.resetScissor()},unbind:function(a){a===void 0&&(a=!1);var l=this.renderer;return a&&l.flush(),l.popFramebuffer()},destroy:function(){var a=this.renderer;a.off(p.RESIZE,this.resize,this),a.deleteFramebuffer(this.framebuffer),a.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});s.exports=h},70554:s=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @author Matthew Groves <@doormat> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={getTintFromFloats:function(y,e,r,p){var h=(y*255|0)&255,a=(e*255|0)&255,l=(r*255|0)&255,n=(p*255|0)&255;return(n<<24|h<<16|a<<8|l)>>>0},getTintAppendFloatAlpha:function(y,e){var r=(e*255|0)&255;return(r<<24|y)>>>0},getTintAppendFloatAlphaAndSwap:function(y,e){var r=(y>>16|0)&255,p=(y>>8|0)&255,h=(y|0)&255,a=(e*255|0)&255;return(a<<24|h<<16|p<<8|r)>>>0},getFloatsFromUintRGB:function(y){var e=(y>>16|0)&255,r=(y>>8|0)&255,p=(y|0)&255;return[e/255,r/255,p/255]},checkShaderMax:function(y,e){var r=Math.min(16,y.getParameter(y.MAX_TEXTURE_IMAGE_UNITS));return!e||e===-1?r:Math.min(r,e)},parseFragmentShaderMaxTextures:function(y,e){if(!y)return"";for(var r="",p=0;p0&&(r+=` + else `),p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(62644),h=e(50792),a=e(77085),l=e(95540),n=e(37867),u=e(92503),f=e(32302),o=e(70554),c=e(38683),d=new r({Extends:h,initialize:function(m){h.call(this);var S=m.game,M=S.renderer,w=M.gl;this.name=l(m,"name","WebGLPipeline"),this.game=S,this.renderer=M,this.manager,this.gl=w,this.view=S.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=l(m,"topology",w.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=l(m,"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=m,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=l(m,"resizeUniform","")},boot:function(){var v,m=this.gl,S=this.config,M=this.renderer;this.isPostFX||(this.projectionMatrix=new n().identity());var w=this.renderTargets,C=l(S,"renderTarget",!1);typeof C=="boolean"&&C&&(C=1);var A=M.width,P=M.height;if(typeof C=="number")for(v=0;vX&&(X=z[v].vertexSize);var K=l(S,"batchSize",M.config.batchSize);this.vertexCapacity=K*6;var Q=new ArrayBuffer(this.vertexCapacity*X);this.vertexData=Q,this.bytes=new Uint8Array(Q),this.vertexViewF32=new Float32Array(Q),this.vertexViewU32=new Uint32Array(Q);var tt=l(S,"vertices",null);for(tt?(this.vertexViewF32.set(tt),this.vertexBuffer=M.createVertexBuffer(Q,m.STATIC_DRAW)):this.vertexBuffer=M.createVertexBuffer(Q.byteLength,m.DYNAMIC_DRAW),this.setVertexBuffer(),v=z.length-1;v>=0;v--)z[v].rebind();this.hasBooted=!0,M.on(u.RESIZE,this.resize,this),M.on(u.PRE_RENDER,this.onPreRender,this),M.on(u.RENDER,this.onRender,this),M.on(u.POST_RENDER,this.onPostRender,this),this.emit(a.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(v,m,S){var M=this.renderer;if(v!==this.currentShader||M.currentProgram!==this.currentShader.program){this.flush();var w=this.setVertexBuffer(S);w&&!m&&(m=!0),v.bind(m,!1),this.currentShader=v}return this},getShaderByName:function(v){for(var m=this.shaders,S=0;S-1&&(z=Y.substring(20))}X&&K&&B.push(new c(this,z,X,K,p(Q)))}this.shaders=B}return this.shaders.length===0?console.warn("Pipeline: "+this.name+" - Invalid shader config"):this.currentShader=this.shaders[0],this},createBatch:function(v){return this.currentBatch={start:this.vertexCount,count:0,texture:[v],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=v,this.batch.push(this.currentBatch),0},addTextureToBatch:function(v){var m=this.currentBatch;m&&(m.texture.push(v),m.unit++,m.maxUnit++)},pushBatch:function(v){if(!this.currentBatch||this.forceZero&&v!==this.currentTexture)return this.createBatch(v);if(v===this.currentTexture)return this.currentUnit;var m=this.currentBatch,S=m.texture.indexOf(v);return S===-1?m.texture.length===this.renderer.maxTextures?this.createBatch(v):(m.unit++,m.maxUnit++,m.texture.push(v),this.currentUnit=m.unit,this.currentTexture=v,m.unit):(this.currentUnit=S,this.currentTexture=v,S)},setGameObject:function(v,m){return m===void 0&&(m=v.frame),this.pushBatch(m.source.glTexture)},shouldFlush:function(v){return v===void 0&&(v=0),this.vertexCount+v>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(v,m){(v!==this.width||m!==this.height)&&this.flush(),this.width=v,this.height=m;for(var S=this.renderTargets,M=0;M=0;S--){var M=m[S].rebind();(!v||M===v)&&(this.currentShader=M)}return this.activeTextures.length=0,this.emit(a.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var v=this.shaders,m=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,m&&this.setVertexBuffer();for(var S=0;S0){this.emit(a.BEFORE_FLUSH,this,v),this.onBeforeFlush(v);var m=this.gl,S=this.vertexCount,M=this.currentShader.vertexSize,w=this.topology;if(this.active){this.setVertexBuffer(),S===this.vertexCapacity?m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.DYNAMIC_DRAW):m.bufferSubData(m.ARRAY_BUFFER,0,this.bytes.subarray(0,S*M));var C,A,P,b=this.batch,O=this.activeTextures;if(this.forceZero)for(O[0]||m.activeTexture(m.TEXTURE0),C=0;C{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95428),p=e(72905),h=e(19715),a=e(83419),l=e(8054),n=e(50792),u=e(92503),f=e(50030),o=e(37867),c=e(29747),d=e(7530),v=e(32302),m=e(97480),S=e(69442),M=e(70554),w=e(88815),C=e(26128),A=e(1482),P=e(82751),b=e(84387),O=e(93567),I=e(57183),D=new a({Extends:n,initialize:function(G){n.call(this);var z=G.config,X={alpha:z.transparent,desynchronized:z.desynchronized,depth:!0,antialias:z.antialiasGL,premultipliedAlpha:z.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:z.failIfMajorPerformanceCaveat,powerPreference:z.powerPreference,preserveDrawingBuffer:z.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:z.clearBeforeRender,antialias:z.antialias,backgroundColor:z.backgroundColor,contextCreation:X,roundPixels:z.roundPixels,maxTextures:z.maxTextures,maxTextureSize:z.maxTextureSize,batchSize:z.batchSize,maxLights:z.maxLights,mipmapFilter:z.mipmapFilter},this.game=G,this.type=l.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=G.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=c,this.contextRestoredHandler=c,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.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 G,z=this.game,X=this.canvas,K=B.backgroundColor;if(z.config.context?G=z.config.context:G=X.getContext("webgl",B.contextCreation)||X.getContext("experimental-webgl",B.contextCreation),!G||G.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=G;var Q=this,tt=function(){var U=G.getSupportedExtensions();Q.supportedExtensions=U;var H="ANGLE_instanced_arrays";Q.instancedArraysExtension=U.indexOf(H)>-1?G.getExtension(H):null;var J="OES_vertex_array_object";Q.vaoExtension=U.indexOf(J)>-1?G.getExtension(J):null};tt(),this.contextLostHandler=function(U){Q.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),Q.emit(u.LOSE_WEBGL,Q),U.preventDefault()},X.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(U){if(G.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}Q.currentProgram=null,Q.currentFramebuffer=null,Q.setBlendMode(l.BlendModes.NORMAL),G.disable(G.BLEND),G.disable(G.DEPTH_TEST),G.enable(G.CULL_FACE),Q.compression=Q.getCompressedTextures();var H=function(J){J.createResource()};r(Q.glTextureWrappers,H),r(Q.glBufferWrappers,H),r(Q.glFramebufferWrappers,H),r(Q.glProgramWrappers,H),r(Q.glAttribLocationWrappers,H),r(Q.glUniformLocationWrappers,H),Q.createTemporaryTextures(),Q.pipelines.restoreContext(),Q.resize(Q.game.scale.baseSize.width,Q.game.scale.baseSize.height),tt(),Q.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),Q.emit(u.RESTORE_WEBGL,Q),U.preventDefault()},X.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),z.context=G;for(var Y=0;Y<=27;Y++)this.blendModes.push({func:[G.ONE,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_ADD});this.blendModes[1].func=[G.ONE,G.DST_ALPHA],this.blendModes[2].func=[G.DST_COLOR,G.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[G.ONE,G.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[G.ZERO,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_REVERSE_SUBTRACT},this.glFormats=[G.BYTE,G.SHORT,G.UNSIGNED_BYTE,G.UNSIGNED_SHORT,G.FLOAT],this.glFuncMap={mat2:{func:G.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:G.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:G.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:G.uniform1f,length:1},"1fv":{func:G.uniform1fv,length:1},"1i":{func:G.uniform1i,length:1},"1iv":{func:G.uniform1iv,length:1},"2f":{func:G.uniform2f,length:2},"2fv":{func:G.uniform2fv,length:1},"2i":{func:G.uniform2i,length:2},"2iv":{func:G.uniform2iv,length:1},"3f":{func:G.uniform3f,length:3},"3fv":{func:G.uniform3fv,length:1},"3i":{func:G.uniform3i,length:3},"3iv":{func:G.uniform3iv,length:1},"4f":{func:G.uniform4f,length:4},"4fv":{func:G.uniform4fv,length:1},"4i":{func:G.uniform4i,length:4},"4iv":{func:G.uniform4iv,length:1}},(!B.maxTextures||B.maxTextures===-1)&&(B.maxTextures=G.getParameter(G.MAX_TEXTURE_IMAGE_UNITS)),B.maxTextureSize||(B.maxTextureSize=G.getParameter(G.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),G.disable(G.DEPTH_TEST),G.disable(G.CULL_FACE),G.enable(G.BLEND),G.clearColor(K.redGL,K.greenGL,K.blueGL,K.alphaGL);var Z=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return Z.indexOf(B.mipmapFilter)!==-1&&(this.mipmapFilter=G[B.mipmapFilter]),this.maxTextures=M.checkShaderMax(G,B.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new d(this),this.setBlendMode(l.BlendModes.NORMAL),this.projectionMatrix=new o().identity(),z.textures.once(S.READY,this.boot,this),this},boot:function(){var B=this.game,G=this.pipelines,z=B.scale.baseSize,X=z.width,K=z.height;this.width=X,this.height=K,this.isBooted=!0,this.renderTarget=new v(this,X,K,1,0,!0,!0),this.maskTarget=new v(this,X,K,1,0,!0,!0),this.maskSource=new v(this,X,K,1,0,!0,!0);var Q=B.config;G.boot(Q.pipeline,Q.defaultPipeline,Q.autoMobilePipeline),this.blankTexture=B.textures.getFrame("__DEFAULT").glTexture,this.normalTexture=B.textures.getFrame("__NORMAL").glTexture,this.whiteTexture=B.textures.getFrame("__WHITE").glTexture;var tt=this.gl;tt.bindFramebuffer(tt.FRAMEBUFFER,null),tt.enable(tt.SCISSOR_TEST),B.scale.on(m.RESIZE,this.onResize,this),this.resize(X,K)},createTemporaryTextures:function(){for(var B=this.gl,G=0;G0&&X>0;if(tt&&Y){var Z=tt[0],U=tt[1],H=tt[2],J=tt[3];Y=Z!==B||U!==G||H!==z||J!==X}Y&&(this.flush(),Q.scissor(B,K-G-X,z,X))},resetScissor:function(){var B=this.gl;B.enable(B.SCISSOR_TEST);var G=this.currentScissor;if(G){var z=G[0],X=G[1],K=G[2],Q=G[3];K>0&&Q>0&&B.scissor(z,this.drawingBufferHeight-X-Q,K,Q)}},popScissor:function(){var B=this.scissorStack;B.pop();var G=B[B.length-1];G&&this.setScissor(G[0],G[1],G[2],G[3]),this.currentScissor=G},hasActiveStencilMask:function(){var B=this.currentMask.mask,G=this.currentCameraMask.mask;return B&&B.isStencil||G&&G.isStencil},resetViewport:function(){var B=this.gl;B.viewport(0,0,this.width,this.height),this.drawingBufferHeight=B.drawingBufferHeight},setBlendMode:function(B,G){G===void 0&&(G=!1);var z=this.gl,X=this.blendModes[B];return G||B!==l.BlendModes.SKIP_CHECK&&this.currentBlendMode!==B?(this.flush(),z.enable(z.BLEND),z.blendEquation(X.equation),X.func.length>2?z.blendFuncSeparate(X.func[0],X.func[1],X.func[2],X.func[3]):z.blendFunc(X.func[0],X.func[1]),this.currentBlendMode=B,!0):!1},addBlendMode:function(B,G){var z=this.blendModes.push({func:B,equation:G});return z-1},updateBlendMode:function(B,G,z){return this.blendModes[B]&&(this.blendModes[B].func=G,z&&(this.blendModes[B].equation=z)),this},removeBlendMode:function(B){return B>17&&this.blendModes[B]&&this.blendModes.splice(B,1),this},pushFramebuffer:function(B,G,z,X,K){return B===this.currentFramebuffer?this:(this.fboStack.push(B),this.setFramebuffer(B,G,z,X,K))},setFramebuffer:function(B,G,z,X,K){if(G===void 0&&(G=!1),z===void 0&&(z=!0),X===void 0&&(X=null),K===void 0&&(K=!1),B===this.currentFramebuffer)return this;var Q=this.gl,tt=this.width,Y=this.height;return B&&B.renderTexture&&z?(tt=B.renderTexture.width,Y=B.renderTexture.height):this.flush(),B?Q.bindFramebuffer(Q.FRAMEBUFFER,B.webGLFramebuffer):Q.bindFramebuffer(Q.FRAMEBUFFER,null),z&&Q.viewport(0,0,tt,Y),X&&Q.framebufferTexture2D(Q.FRAMEBUFFER,Q.COLOR_ATTACHMENT0,Q.TEXTURE_2D,X.webGLTexture,0),K&&(Q.clearColor(0,0,0,0),Q.clear(Q.COLOR_BUFFER_BIT)),G&&(B?(this.drawingBufferHeight=Y,this.pushScissor(0,0,tt,Y)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=B,this},popFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack;z.pop();var X=z[z.length-1];return X||(X=null),this.setFramebuffer(X,B,G),X},restoreFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack,X=z[z.length-1];X||(X=null),this.currentFramebuffer=null,this.setFramebuffer(X,B,G)},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,G,z,X,K){K===void 0&&(K=!1);var Q=this.gl,tt=Q.NEAREST,Y=Q.NEAREST,Z=Q.CLAMP_TO_EDGE,U=null;G=B?B.width:G,z=B?B.height:z;var H=f(G,z);if(H&&!K&&(Z=Q.REPEAT),X===l.ScaleModes.LINEAR&&this.config.antialias){var J=B&&B.compressed,_=!J&&H||J&&B.mipmaps.length>1;tt=this.mipmapFilter&&_?this.mipmapFilter:Q.LINEAR,Y=Q.LINEAR}return!B&&typeof G=="number"&&typeof z=="number"?U=this.createTexture2D(0,tt,Y,Z,Z,Q.RGBA,null,G,z):U=this.createTexture2D(0,tt,Y,Z,Z,Q.RGBA,B),U},createTexture2D:function(B,G,z,X,K,Q,tt,Y,Z,U,H,J){typeof Y!="number"&&(Y=tt?tt.width:1),typeof Z!="number"&&(Z=tt?tt.height:1);var _=new P(this.gl,B,G,z,X,K,Q,tt,Y,Z,U,H,J);return this.glTextureWrappers.push(_),_},createFramebuffer:function(B,G,z,X){this.currentFramebuffer=null;var K=new b(this.gl,B,G,z,X);return this.glFramebufferWrappers.push(K),K},beginBitmapMask:function(B,G){var z=this.gl;z&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==B&&(this.currentMask.mask=B,this.currentMask.camera=G))},drawBitmapMask:function(B,G,z){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),B.renderWebGL(this,B,G),this.maskSource.unbind(!0),this.maskTarget.unbind();var X=this.gl,K=this.getCurrentStencilMask();K?(X.enable(X.STENCIL_TEST),K.mask.applyStencil(this,K.camera,!0)):this.currentMask.mask=null,this.pipelines.set(z),X.activeTexture(X.TEXTURE0),X.bindTexture(X.TEXTURE_2D,this.maskTarget.texture.webGLTexture),X.activeTexture(X.TEXTURE1),X.bindTexture(X.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(B,G){var z=new A(this.gl,B,G);return this.glProgramWrappers.push(z),z},createVertexBuffer:function(B,G){var z=this.gl,X=new C(z,B,z.ARRAY_BUFFER,G);return this.glBufferWrappers.push(X),X},createAttribLocation:function(B,G){var z=new O(this.gl,B,G);return this.glAttribLocationWrappers.push(z),z},createUniformLocation:function(B,G){var z=new I(this.gl,B,G);return this.glUniformLocationWrappers.push(z),z},createIndexBuffer:function(B,G){var z=this.gl,X=new C(z,B,z.ELEMENT_ARRAY_BUFFER,G);return this.glBufferWrappers.push(X),X},deleteTexture:function(B){if(B)return p(this.glTextureWrappers,B),B.destroy(),this},deleteFramebuffer:function(B){return B?(p(this.fboStack,B),p(this.glFramebufferWrappers,B),B.destroy(),this):this},deleteProgram:function(B){return B&&(p(this.glProgramWrappers,B),B.destroy()),this},deleteAttribLocation:function(B){return B&&(p(this.glAttribLocationWrappers,B),B.destroy()),this},deleteUniformLocation:function(B){return B&&(p(this.glUniformLocationWrappers,B),B.destroy()),this},deleteBuffer:function(B){return B?(p(this.glBufferWrappers,B),B.destroy(),this):this},preRenderCamera:function(B){var G=B.x,z=B.y,X=B.width,K=B.height,Q=B.backgroundColor;if(B.emit(h.PRE_RENDER,B),this.pipelines.preBatchCamera(B),this.pushScissor(G,z,X,K),B.mask&&(this.currentCameraMask.mask=B.mask,this.currentCameraMask.camera=B._maskCamera,B.mask.preRenderWebGL(this,B,B._maskCamera)),Q.alphaGL>0){var tt=this.pipelines.setMulti();tt.drawFillRect(G,z,X,K,M.getTintFromFloats(Q.blueGL,Q.greenGL,Q.redGL,1),Q.alphaGL)}},getCurrentStencilMask:function(){var B=null,G=this.maskStack,z=this.currentCameraMask;return G.length>0?B=G[G.length-1]:z.mask&&z.mask.isStencil&&(B=z),B},postRenderCamera:function(B){var G=B.flashEffect,z=B.fadeEffect;if(G.isRunning||z.isRunning||z.isComplete){var X=this.pipelines.setMulti();G.postRenderWebGL(X,M.getTintFromFloats),z.postRenderWebGL(X,M.getTintFromFloats)}B.dirty=!1,this.popScissor(),B.mask&&(this.currentCameraMask.mask=null,B.mask.postRenderWebGL(this,B._maskCamera)),this.pipelines.postBatchCamera(B),B.emit(h.POST_RENDER,B)},preRender:function(){if(!this.contextLost){var B=this.gl;if(B.bindFramebuffer(B.FRAMEBUFFER,null),this.config.clearBeforeRender){var G=this.config.backgroundColor;B.clearColor(G.redGL,G.greenGL,G.blueGL,G.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(u.PRE_RENDER)}},render:function(B,G,z){if(!this.contextLost){var X=G.length;if(this.emit(u.RENDER,B,z),this.preRenderCamera(z),X===0){this.setBlendMode(l.BlendModes.NORMAL),this.postRenderCamera(z);return}this.currentType="";for(var K=this.currentMask,Q=0;Q{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95428),h=e(95540),a=e(14500),l=new r({initialize:function(u,f,o,c,d){this.pipeline=u,this.name=f,this.renderer=u.renderer,this.gl=this.renderer.gl,this.fragSrc=c,this.vertSrc=o,this.program=this.renderer.createProgram(o,c),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(d),this.createUniforms()},createAttributes:function(n){var u=0,f=0,o=[];this.vertexComponentCount=0;for(var c=0;c=0?(u.enableVertexAttribArray(b.webGLAttribLocation),u.vertexAttribPointer(b.webGLAttribLocation,S,M,P,o,w),m.enabled=!0,m.location=b):b.webGLAttribLocation!==-1&&u.disableVertexAttribArray(b.webGLAttribLocation)}else C?u.vertexAttribPointer(A.webGLAttribLocation,S,M,P,o,w):!C&&A!==-1&&A.webGLAttribLocation>-1&&(u.disableVertexAttribArray(A.webGLAttribLocation),m.location=-1)}return this},createUniforms:function(){var n=this.gl,u=this.program,f=this.uniforms,o,c,d,v=n.getProgramParameter(u.webGLProgram,n.ACTIVE_UNIFORMS);for(o=0;o0&&(c=c.substr(0,S),f.hasOwnProperty(c)||(d=this.renderer.createUniformLocation(u,c),d!==null&&(f[c]={name:c,location:d,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var n=this.gl;this.renderer.setProgram(this.program);for(var u in this.uniforms){var f=this.uniforms[u];f.setter&&f.setter.call(n,f.location.webGLUniformLocation,f.value1,f.value2,f.value3,f.value4)}},hasUniform:function(n){return this.uniforms.hasOwnProperty(n)},resetUniform:function(n){var u=this.uniforms[n];return u&&(u.value1=null,u.value2=null,u.value3=null,u.value4=null),this},setUniform1:function(n,u,f,o){var c=this.uniforms[u];return c?((o||c.value1!==f)&&(c.setter||(c.setter=n),c.value1=f,this.renderer.setProgram(this.program),n.call(this.gl,c.location.webGLUniformLocation,f),this.pipeline.currentShader=this),this):this},setUniform2:function(n,u,f,o,c){var d=this.uniforms[u];return d?((c||d.value1!==f||d.value2!==o)&&(d.setter||(d.setter=n),d.value1=f,d.value2=o,this.renderer.setProgram(this.program),n.call(this.gl,d.location.webGLUniformLocation,f,o),this.pipeline.currentShader=this),this):this},setUniform3:function(n,u,f,o,c,d){var v=this.uniforms[u];return v?((d||v.value1!==f||v.value2!==o||v.value3!==c)&&(v.setter||(v.setter=n),v.value1=f,v.value2=o,v.value3=c,this.renderer.setProgram(this.program),n.call(this.gl,v.location.webGLUniformLocation,f,o,c),this.pipeline.currentShader=this),this):this},setUniform4:function(n,u,f,o,c,d,v){var m=this.uniforms[u];return m?((v||m.value1!==f||m.value2!==o||m.value3!==c||m.value4!==d)&&(m.setter||(m.setter=n),m.value1=f,m.value2=o,m.value3=c,m.value4=d,this.renderer.setProgram(this.program),n.call(this.gl,m.location.webGLUniformLocation,f,o,c,d),this.pipeline.currentShader=this),this):this},setBoolean:function(n,u){return this.setUniform1(this.gl.uniform1i,n,Number(u))},set1f:function(n,u){return this.setUniform1(this.gl.uniform1f,n,u)},set2f:function(n,u,f){return this.setUniform2(this.gl.uniform2f,n,u,f)},set3f:function(n,u,f,o){return this.setUniform3(this.gl.uniform3f,n,u,f,o)},set4f:function(n,u,f,o,c){return this.setUniform4(this.gl.uniform4f,n,u,f,o,c)},set1fv:function(n,u){return this.setUniform1(this.gl.uniform1fv,n,u,!0)},set2fv:function(n,u){return this.setUniform1(this.gl.uniform2fv,n,u,!0)},set3fv:function(n,u){return this.setUniform1(this.gl.uniform3fv,n,u,!0)},set4fv:function(n,u){return this.setUniform1(this.gl.uniform4fv,n,u,!0)},set1iv:function(n,u){return this.setUniform1(this.gl.uniform1iv,n,u,!0)},set2iv:function(n,u){return this.setUniform1(this.gl.uniform2iv,n,u,!0)},set3iv:function(n,u){return this.setUniform1(this.gl.uniform3iv,n,u,!0)},set4iv:function(n,u){return this.setUniform1(this.gl.uniform4iv,n,u,!0)},set1i:function(n,u){return this.setUniform1(this.gl.uniform1i,n,u)},set2i:function(n,u,f){return this.setUniform2(this.gl.uniform2i,n,u,f)},set3i:function(n,u,f,o){return this.setUniform3(this.gl.uniform3i,n,u,f,o)},set4i:function(n,u,f,o,c){return this.setUniform4(this.gl.uniform4i,n,u,f,o,c)},setMatrix2fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix2fv,n,u,f,!0)},setMatrix3fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix3fv,n,u,f,!0)},setMatrix4fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix4fv,n,u,f,!0)},createProgram:function(n,u){return n===void 0&&(n=this.vertSrc),u===void 0&&(u=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=n,this.fragSrc=u,this.program=this.renderer.createProgram(n,u),this.createUniforms(),this.rebind()},destroy:function(){var n=this.renderer;p(this.uniforms,function(u){n.deleteUniformLocation(u.location)}),this.uniforms=null,p(this.attributes,function(u){n.deleteAttribLocation(u.location)}),this.attributes=null,n.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});s.exports=l},14500:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}};s.exports=y},4159:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14500),p=e(79291),h={PipelineManager:e(7530),Pipelines:e(96615),RenderTarget:e(32302),Utils:e(70554),WebGLPipeline:e(29100),WebGLRenderer:e(74797),WebGLShader:e(38683),Wrappers:e(9503)};h=p(!1,h,r),s.exports=h},31302:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(78908),a=e(85191),l=e(14500),n=e(29100),u=new r({Extends:n,initialize:function(o){o.fragShader=p(o,"fragShader",h),o.vertShader=p(o,"vertShader",a),o.batchSize=p(o,"batchSize",1),o.vertices=p(o,"vertices",[-1,1,-1,-7,7,1]),o.attributes=p(o,"attributes",[{name:"inPosition",size:2,type:l.FLOAT}]),n.call(this,o)},boot:function(){n.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(f,o){n.prototype.resize.call(this,f,o),this.set2f("uResolution",f,o)},beginMask:function(f,o,c){this.renderer.beginBitmapMask(f,c)},endMask:function(f,o,c){var d=this.gl,v=this.renderer,m=f.bitmapMask;m&&d&&(v.drawBitmapMask(m,o,this),c&&this.set2f("uResolution",c.width,c.height),this.set1i("uInvertMaskAlpha",f.invertAlpha),d.drawArrays(this.topology,0,3),c&&this.set2f("uResolution",this.width,this.height),d.bindTexture(d.TEXTURE_2D,null))}});s.exports=u},92651:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(58918),h=e(14811),a=e(95540),l=e(43558),n=e(89350),u=e(70554),f=new r({Extends:l,initialize:function(c){c.shaders=[u.setGlowQuality(n.FXGlowFrag,c.game),n.FXShadowFrag,n.FXPixelateFrag,n.FXVignetteFrag,n.FXShineFrag,n.FXBlurLowFrag,n.FXBlurMedFrag,n.FXBlurHighFrag,n.FXGradientFrag,n.FXBloomFrag,n.ColorMatrixFrag,n.FXCircleFrag,n.FXBarrelFrag,n.FXDisplacementFrag,n.FXWipeFrag,n.FXBokehFrag],l.call(this,c);var d=this.game;this.glow=new p.Glow(d),this.shadow=new p.Shadow(d),this.pixelate=new p.Pixelate(d),this.vignette=new p.Vignette(d),this.shine=new p.Shine(d),this.gradient=new p.Gradient(d),this.circle=new p.Circle(d),this.barrel=new p.Barrel(d),this.wipe=new p.Wipe(d),this.bokeh=new p.Bokeh(d);var v=[];v[h.GLOW]=this.onGlow,v[h.SHADOW]=this.onShadow,v[h.PIXELATE]=this.onPixelate,v[h.VIGNETTE]=this.onVignette,v[h.SHINE]=this.onShine,v[h.BLUR]=this.onBlur,v[h.GRADIENT]=this.onGradient,v[h.BLOOM]=this.onBloom,v[h.COLOR_MATRIX]=this.onColorMatrix,v[h.CIRCLE]=this.onCircle,v[h.BARREL]=this.onBarrel,v[h.DISPLACEMENT]=this.onDisplacement,v[h.WIPE]=this.onWipe,v[h.BOKEH]=this.onBokeh,this.fxHandlers=v,this.source,this.target,this.swap},onDraw:function(o,c,d){this.source=o,this.target=c,this.swap=d;var v=o.width,m=o.height,S=this.tempSprite,M=this.fxHandlers;if(S&&S.preFX)for(var w=S.preFX.list,C=0;C{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(31063),a=e(57516),l=e(61340),n=e(26099),u=e(29100),f=new r({Extends:a,initialize:function(c){var d=p(c,"fragShader",h);c.fragShader=d.replace("%LIGHT_COUNT%",c.game.renderer.config.maxLights),a.call(this,c),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new n,this._tempMatrix=new l,this._tempMatrix2=new l},boot:function(){u.prototype.boot.call(this)},onRender:function(o,c){var d=o.sys.lights;if(this.lightsActive=!1,!(!d||!d.active)){var v=d.getLights(c),m=v.length;this.lightsActive=!0;var S,M=this.renderer,w=M.height,C=c.matrix,A=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",c.x,c.y,c.rotation,c.zoom),this.set3f("uAmbientLightColor",d.ambientColor.r,d.ambientColor.g,d.ambientColor.b),this.set1i("uLightCount",m),S=0;S0&&this.flush();var c=this.inverseRotationMatrix;if(o){var d=-o,v=Math.cos(d),m=Math.sin(d);c[1]=m,c[3]=-m,c[0]=c[4]=v}else c[0]=c[4]=1,c[1]=c[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,c),this.currentNormalMapRotation=o}},setTexture2D:function(o,c){var d=this.renderer;o===void 0&&(o=d.whiteTexture);var v=this.getNormalMap(c);this.isNewNormalMap(o,v)&&(this.flush(),this.createBatch(o),this.addTextureToBatch(v),this.currentNormalMap=v);var m=0;if(c&&c.parentContainer){var S=c.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);m=S.rotationNormalized}else c&&(m=c.rotation);return this.setNormalMapRotation(m),0},setGameObject:function(o,c){c===void 0&&(c=o.frame);var d=c.glTexture,v=this.getNormalMap(o);if(this.isNewNormalMap(d,v)&&(this.flush(),this.createBatch(d),this.addTextureToBatch(v),this.currentNormalMap=v),o.parentContainer){var m=o.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(m.rotationNormalized)}else this.setNormalMapRotation(o.rotation);return 0},isNewNormalMap:function(o,c){return this.currentTexture!==o||this.currentNormalMap!==c},getNormalMap:function(o){var c;if(o)o.displayTexture?c=o.displayTexture.dataSource[o.displayFrame.sourceIndex]:o.texture?c=o.texture.dataSource[o.frame.sourceIndex]:o.tileset&&(Array.isArray(o.tileset)?c=o.tileset[0].image.dataSource[0]:c=o.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return c?c.glTexture:this.renderer.normalTexture},batchSprite:function(o,c,d){this.lightsActive&&a.prototype.batchSprite.call(this,o,c,d)},batchTexture:function(o,c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,K,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt){this.lightsActive&&a.prototype.batchTexture.call(this,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,K,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt)},batchTextureFrame:function(o,c,d,v,m,S,M){this.lightsActive&&a.prototype.batchTextureFrame.call(this,o,c,d,v,m,S,M)}});s.exports=f},56527:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=e(45561),l=e(60722),n=e(14500),u=e(29100),f=new r({Extends:h,initialize:function(c){c.fragShader=p(c,"fragShader",a),c.vertShader=p(c,"vertShader",l),c.attributes=p(c,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:n.UNSIGNED_BYTE,normalized:!0}]),c.forceZero=!0,c.resizeUniform="uResolution",h.call(this,c)},boot:function(){u.prototype.boot.call(this);var o=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",o.width,o.height),this.set1i("uRoundPixels",o.config.roundPixels)}});s.exports=f},57516:(s,y,e)=>{/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(94811),h=e(95540),a=e(98840),l=e(44667),n=e(61340),u=e(70554),f=e(14500),o=e(29100),c=new r({Extends:o,initialize:function(v){var m=v.game.renderer,S=h(v,"fragShader",a);v.fragShader=u.parseFragmentShaderMaxTextures(S,m.maxTextures),v.vertShader=h(v,"vertShader",l),v.attributes=h(v,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]),v.resizeUniform="uResolution",o.call(this,v),this._tempMatrix1=new n,this._tempMatrix2=new n,this._tempMatrix3=new n,this.calcMatrix=new n,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(){o.prototype.boot.call(this);var d=this.renderer;this.set1iv("uMainSampler",d.textureIndexes),this.set2f("uResolution",d.width,d.height),this.set1i("uRoundPixels",d.config.roundPixels)},batchSprite:function(d,v,m){this.manager.set(this,d);var S=this._tempMatrix1,M=this._tempMatrix2,w=this._tempMatrix3,C=d.frame,A=C.glTexture,P=C.u0,b=C.v0,O=C.u1,I=C.v1,D=C.x,B=C.y,G=C.cutWidth,z=C.cutHeight,X=C.customPivot,K=d.displayOriginX,Q=d.displayOriginY,tt=-K+D,Y=-Q+B;if(d.isCropped){var Z=d._crop;(Z.flipX!==d.flipX||Z.flipY!==d.flipY)&&C.updateCropUVs(Z,d.flipX,d.flipY),P=Z.u0,b=Z.v0,O=Z.u1,I=Z.v1,G=Z.width,z=Z.height,D=Z.x,B=Z.y,tt=-K+D,Y=-Q+B}var U=1,H=1;d.flipX&&(X||(tt+=-C.realWidth+K*2),U=-1),d.flipY&&(X||(Y+=-C.realHeight+Q*2),H=-1);var J=d.x,_=d.y;M.applyITRS(J,_,d.rotation,d.scaleX*U,d.scaleY*H),S.copyFrom(v.matrix),m?(S.multiplyWithOffset(m,-v.scrollX*d.scrollFactorX,-v.scrollY*d.scrollFactorY),M.e=J,M.f=_):(M.e-=v.scrollX*d.scrollFactorX,M.f-=v.scrollY*d.scrollFactorY),S.multiply(M,w);var q=w.setQuad(tt,Y,tt+G,Y+z),at=u.getTintAppendFloatAlpha,ot=v.alpha,rt=at(d.tintTopLeft,ot*d._alphaTL),gt=at(d.tintTopRight,ot*d._alphaTR),yt=at(d.tintBottomLeft,ot*d._alphaBL),Et=at(d.tintBottomRight,ot*d._alphaBR);this.shouldFlush(6)&&this.flush();var At=this.setGameObject(d,C);this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",v.roundPixels),this.batchQuad(d,q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],P,b,O,I,rt,gt,yt,Et,d.tintFill,A,At),this.manager.postBatch(d)},batchTexture:function(d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z,X,K,Q,tt,Y,Z,U,H,J,_,q,at,ot,rt,gt,yt,Et){Et===void 0&&(Et=!1),this.manager.set(this,d);var At=this._tempMatrix1,Pt=this._tempMatrix2,Vt=this._tempMatrix3,dt=K/m+q,ut=Q/S+at,Rt=(K+tt)/m+q,Dt=(Q+Y)/S+at,Ht=C,Bt=A,ne=-z,oe=-X;if(d.isCropped){var ge=d._crop,xe=ge.width,Ae=ge.height;Ht=xe,Bt=Ae,C=xe,A=Ae,K=ge.x,Q=ge.y;var qt=K,Ge=Q;I&&(qt=tt-ge.x-xe),D&&(Ge=Y-ge.y-Ae),dt=qt/m+q,ut=Ge/S+at,Rt=(qt+xe)/m+q,Dt=(Ge+Ae)/S+at,ne=-z+K,oe=-X+Q}D=D^(!gt&&v.isRenderTexture?1:0),I&&(Ht*=-1,ne+=C),D&&(Bt*=-1,oe+=A),Pt.applyITRS(M,w,O,P,b),At.copyFrom(ot.matrix),rt?(At.multiplyWithOffset(rt,-ot.scrollX*B,-ot.scrollY*G),Pt.e=M,Pt.f=w):(Pt.e-=ot.scrollX*B,Pt.f-=ot.scrollY*G),At.multiply(Pt,Vt);var Oe=Vt.setQuad(ne,oe,ne+Ht,oe+Bt);yt==null&&(yt=this.setTexture2D(v)),d&&!Et&&this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",ot.roundPixels),this.batchQuad(d,Oe[0],Oe[1],Oe[2],Oe[3],Oe[4],Oe[5],Oe[6],Oe[7],dt,ut,Rt,Dt,Z,U,H,J,_,v,yt),d&&!Et&&this.manager.postBatch(d)},batchTextureFrame:function(d,v,m,S,M,w,C){this.manager.set(this);var A=this._tempMatrix1.copyFrom(w),P=this._tempMatrix2;C?A.multiply(C,P):P=A;var b=P.setQuad(v,m,v+d.width,m+d.height),O=this.setTexture2D(d.source.glTexture);S=u.getTintAppendFloatAlpha(S,M),this.batchQuad(null,b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],d.u0,d.v0,d.u1,d.v1,S,S,S,S,0,d.glTexture,O)},batchFillRect:function(d,v,m,S,M,w){this.renderer.pipelines.set(this);var C=this.calcMatrix;w&&w.multiply(M,C);var A=C.setQuad(d,v,d+m,v+S),P=this.fillTint;this.batchQuad(null,A[0],A[1],A[2],A[3],A[4],A[5],A[6],A[7],0,0,1,1,P.TL,P.TR,P.BL,P.BR,2)},batchFillTriangle:function(d,v,m,S,M,w,C,A){this.renderer.pipelines.set(this);var P=this.calcMatrix;A&&A.multiply(C,P);var b=P.getX(d,v),O=P.getY(d,v),I=P.getX(m,S),D=P.getY(m,S),B=P.getX(M,w),G=P.getY(M,w),z=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,b,O,I,D,B,G,0,0,1,1,z.TL,z.TR,z.BL,2)},batchStrokeTriangle:function(d,v,m,S,M,w,C,A,P){var b=this.tempTriangle;b[0].x=d,b[0].y=v,b[0].width=C,b[1].x=m,b[1].y=S,b[1].width=C,b[2].x=M,b[2].y=w,b[2].width=C,b[3].x=d,b[3].y=v,b[3].width=C,this.batchStrokePath(b,C,!1,A,P)},batchFillPath:function(d,v,m){this.renderer.pipelines.set(this);var S=this.calcMatrix;m&&m.multiply(v,S);for(var M=d.length,w=this.polygonCache,C,A,P=this.fillTint.TL,b=this.fillTint.TR,O=this.fillTint.BL,I=0;I0&&Ht[4]?this.batchQuad(null,At,Pt,rt,gt,Ht[0],Ht[1],Ht[2],Ht[3],0,0,1,1,dt,ut,Rt,Dt,2):(Bt[0]=At,Bt[1]=Pt,Bt[2]=rt,Bt[3]=gt,Bt[4]=1),P&&Bt[4]?this.batchQuad(null,at,ot,yt,Et,Bt[0],Bt[1],Bt[2],Bt[3],0,0,1,1,dt,ut,Rt,Dt,2):(Ht[0]=at,Ht[1]=ot,Ht[2]=yt,Ht[3]=Et,Ht[4]=1)}}},destroy:function(){return this._tempMatrix1.destroy(),this._tempMatrix2.destroy(),this._tempMatrix3.destroy(),this._tempMatrix1=null,this._tempMatrix1=null,this._tempMatrix1=null,o.prototype.destroy.call(this),this}});s.exports=c},43439:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(4127),a=e(89924),l=e(29100),n=new r({Extends:l,initialize:function(f){f.vertShader=p(f,"vertShader",a),f.fragShader=p(f,"fragShader",h),f.attributes=p(f,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),l.call(this,f)},onRender:function(u,f){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",f.zoom)},batchPointLight:function(u,f,o,c,d,v,m,S,M,w,C,A){var P=u.color,b=u.intensity,O=u.radius,I=u.attenuation,D=P.r*b,B=P.g*b,G=P.b*b,z=f.alpha*u.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(o,c,C,A,O,I,D,B,G,z),this.batchLightVert(d,v,C,A,O,I,D,B,G,z),this.batchLightVert(m,S,C,A,O,I,D,B,G,z),this.batchLightVert(o,c,C,A,O,I,D,B,G,z),this.batchLightVert(m,S,C,A,O,I,D,B,G,z),this.batchLightVert(M,w,C,A,O,I,D,B,G,z),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(u,f,o,c,d,v,m,S,M,w){var C=this.vertexViewF32,A=this.vertexCount*this.currentShader.vertexComponentCount-1;C[++A]=u,C[++A]=f,C[++A]=o,C[++A]=c,C[++A]=d,C[++A]=v,C[++A]=m,C[++A]=S,C[++A]=M,C[++A]=w,this.vertexCount++}});s.exports=n},84057:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89422),h=e(95540),a=e(27681),l=e(49627),n=e(29100),u=new r({Extends:n,initialize:function(o){o.renderTarget=h(o,"renderTarget",1),o.fragShader=h(o,"fragShader",a),o.vertShader=h(o,"vertShader",l),o.attributes=h(o,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),o.batchSize=1,o.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],n.call(this,o),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new p,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){n.prototype.boot.call(this);var f=this.manager.UTILITY_PIPELINE;this.fullFrame1=f.fullFrame1,this.fullFrame2=f.fullFrame2,this.halfFrame1=f.halfFrame1,this.halfFrame2=f.halfFrame2;var o=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",o.width,o.height),this.set1i("uRoundPixels",o.config.roundPixels);for(var c=this.renderTargets,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(67502),h=e(83419),a=e(96293),l=e(95540),n=e(57516),u=e(27681),f=e(87841),o=e(32302),c=e(45561),d=e(60722),v=e(29100),m=new h({Extends:n,initialize:function(M){var w=l(M,"fragShader",u),C=l(M,"vertShader",d),A=l(M,"drawShader",u),P=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:w,vertShader:C},{name:"DrawGame",fragShader:A,vertShader:d},{name:"ColorMatrix",fragShader:a}],b=l(M,"shaders",[]);M.shaders=P.concat(b),M.vertShader||(M.vertShader=C),M.batchSize=1,n.call(this,M),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new f,this.targetBounds=new f,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var S=this.shaders,M=this.renderer;this.drawSpriteShader=S[0],this.copyShader=S[1],this.gameShader=S[2],this.colorMatrixShader=S[3],this.fsTarget=new o(M,M.width,M.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var w=new ArrayBuffer(168);this.quadVertexData=w,this.quadVertexViewF32=new Float32Array(w),this.quadVertexBuffer=M.createVertexBuffer(w,this.gl.STATIC_DRAW),this.onResize(M.width,M.height),this.currentShader=this.copyShader,this.set2f("uResolution",M.width,M.height),this.set1i("uRoundPixels",M.config.roundPixels)},onResize:function(S,M){var w=this.quadVertexViewF32;w[1]=M,w[22]=M,w[14]=S,w[28]=S,w[35]=S,w[36]=M},batchQuad:function(S,M,w,C,A,P,b,O,I,D,B,G,z,X,K,Q,tt,Y,Z){var U=Math.min(M,C,P,O),H=Math.min(w,A,b,I),J=Math.max(M,C,P,O),_=Math.max(w,A,b,I),q=J-U,at=_-H,ot=this.spriteBounds.setTo(U,H,q,at),rt=S?S.preFX.padding:0,gt=q+rt*2,yt=at+rt*2,Et=Math.abs(Math.max(gt,yt)),At=this.manager.getRenderTarget(Et),Pt=this.targetBounds.setTo(0,0,At.width,At.height);p(Pt,ot.centerX,ot.centerY),this.tempSprite=S;var Vt=this.gl,dt=this.renderer;dt.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",dt.width,dt.height),this.set1i("uRoundPixels",dt.config.roundPixels),this.flipProjectionMatrix(!0),S&&(this.onDrawSprite(S,At),S.preFX.onFX(this));var ut=this.fsTarget;return this.flush(),Vt.viewport(0,0,dt.width,dt.height),Vt.bindFramebuffer(Vt.FRAMEBUFFER,ut.framebuffer.webGLFramebuffer),Vt.framebufferTexture2D(Vt.FRAMEBUFFER,Vt.COLOR_ATTACHMENT0,Vt.TEXTURE_2D,ut.texture.webGLTexture,0),Vt.clearColor(0,0,0,0),Vt.clear(Vt.COLOR_BUFFER_BIT),this.setTexture2D(Z),this.batchVert(M,w,D,B,0,Y,X),this.batchVert(C,A,D,z,0,Y,Q),this.batchVert(P,b,G,z,0,Y,tt),this.batchVert(M,w,D,B,0,Y,X),this.batchVert(P,b,G,z,0,Y,tt),this.batchVert(O,I,G,B,0,Y,K),this.flush(),this.flipProjectionMatrix(!1),Vt.activeTexture(Vt.TEXTURE0),Vt.bindTexture(Vt.TEXTURE_2D,At.texture.webGLTexture),Vt.copyTexSubImage2D(Vt.TEXTURE_2D,0,0,0,Pt.x,Pt.y,Pt.width,Pt.height),Vt.bindFramebuffer(Vt.FRAMEBUFFER,null),Vt.bindTexture(Vt.TEXTURE_2D,null),this.onBatch(S),this.currentShader=this.copyShader,this.onDraw(At,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(S,M,w,C,A,P,b){w===void 0&&(w=!0),C===void 0&&(C=!0),A===void 0&&(A=!1),b===void 0&&(b=this.copyShader);var O=this.gl,I=this.tempSprite;P&&(b=this.colorMatrixShader),this.currentShader=b;var D=this.setVertexBuffer(this.quadVertexBuffer);b.bind(D,!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(S,M,I),P&&(this.set1fv("uColorMatrix",P.getData()),this.set1f("uAlpha",P.alpha)),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,S.texture.webGLTexture),S.height>M.height)O.viewport(0,0,S.width,S.height),this.setTargetUVs(S,M);else{var G=M.height-S.height;O.viewport(0,G,S.width,S.height),this.resetUVs()}if(O.bindFramebuffer(O.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,M.texture.webGLTexture,0),w&&(O.clearColor(0,0,0,+!C),O.clear(O.COLOR_BUFFER_BIT)),A){var z=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}O.bufferData(O.ARRAY_BUFFER,this.quadVertexData,O.STATIC_DRAW),O.drawArrays(O.TRIANGLES,0,6),A&&this.renderer.setBlendMode(z),O.bindFramebuffer(O.FRAMEBUFFER,null)},copy:function(S,M){var w=this.gl;this.set1i("uMainSampler",0),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,S.texture.webGLTexture),w.viewport(0,0,S.width,S.height),this.setUVs(0,0,0,1,1,1,1,0),w.bindFramebuffer(w.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,M.texture.webGLTexture,0),w.clearColor(0,0,0,0),w.clear(w.COLOR_BUFFER_BIT),w.bufferData(w.ARRAY_BUFFER,this.quadVertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),w.bindFramebuffer(w.FRAMEBUFFER,null)},blendFrames:function(S,M,w,C,A){this.manager.blendFrames(S,M,w,C,A)},blendFramesAdditive:function(S,M,w,C,A){this.manager.blendFramesAdditive(S,M,w,C,A)},drawToGame:function(S){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(S)},copyToGame:function(S){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(S)},bindAndDraw:function(S){var M=this.gl,w=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(S.texture);var C=this._tempMatrix1.loadIdentity(),A=this.targetBounds.x,P=this.targetBounds.y,b=A+S.width,O=P+S.height,I=C.getX(A,P),D=C.getX(A,O),B=C.getX(b,O),G=C.getX(b,P),z=C.getY(A,P),X=C.getY(A,O),K=C.getY(b,O),Q=C.getY(b,P),tt=16777215;this.batchVert(I,z,0,0,0,0,tt),this.batchVert(D,X,0,1,0,0,tt),this.batchVert(B,K,1,1,0,0,tt),this.batchVert(I,z,0,0,0,0,tt),this.batchVert(B,K,1,1,0,0,tt),this.batchVert(G,Q,1,0,0,0,tt),w.restoreFramebuffer(!1,!0),w.currentFramebuffer||M.viewport(0,0,w.width,w.height),w.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(S){this.drawToGame(S)},setUVs:function(S,M,w,C,A,P,b,O){var I=this.quadVertexViewF32;I[2]=S,I[3]=M,I[9]=w,I[10]=C,I[16]=A,I[17]=P,I[23]=S,I[24]=M,I[30]=A,I[31]=P,I[37]=b,I[38]=O},setTargetUVs:function(S,M){var w=M.height/S.height;w>.5?w=.5-(w-.5):w=.5+(.5-w),this.setUVs(0,w,0,1+w,1,1+w,1,w)},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,n.prototype.destroy.call(this),this}});s.exports=m},81041:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=new r({Extends:h,initialize:function(n){n.topology=5,n.batchSize=p(n,"batchSize",256),h.call(this,n)}});s.exports=a},12385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(57516),a=e(45561),l=e(60722),n=e(29100),u=new r({Extends:h,initialize:function(o){o.fragShader=p(o,"fragShader",a),o.vertShader=p(o,"vertShader",l),o.forceZero=!0,h.call(this,o)},boot:function(){n.prototype.boot.call(this);var f=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)}});s.exports=u},7589:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35407),p=e(10312),h=e(83419),a=e(89422),l=e(96293),n=e(36682),u=e(95540),f=e(48247),o=e(49627),c=e(29100),d=new h({Extends:c,initialize:function(m){m.renderTarget=u(m,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),m.vertShader=u(m,"vertShader",o),m.shaders=u(m,"shaders",[{name:"Copy",fragShader:n},{name:"AddBlend",fragShader:r},{name:"LinearBlend",fragShader:f},{name:"ColorMatrix",fragShader:l}]),m.attributes=u(m,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),m.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],m.batchSize=1,c.call(this,m),this.colorMatrix=new a,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){c.prototype.boot.call(this);var v=this.shaders,m=this.renderTargets;this.copyShader=v[0],this.addShader=v[1],this.linearShader=v[2],this.colorMatrixShader=v[3],this.fullFrame1=m[0],this.fullFrame2=m[1],this.halfFrame1=m[2],this.halfFrame2=m[3]},copyFrame:function(v,m,S,M,w){S===void 0&&(S=1),M===void 0&&(M=!0),w===void 0&&(w=!0);var C=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,v.texture.webGLTexture),m?(C.viewport(0,0,m.width,m.height),C.bindFramebuffer(C.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,m.texture.webGLTexture,0)):C.viewport(0,0,v.width,v.height),M&&(w?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)},blitFrame:function(v,m,S,M,w,C,A){S===void 0&&(S=1),M===void 0&&(M=!0),w===void 0&&(w=!0),C===void 0&&(C=!1),A===void 0&&(A=!1);var P=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),P.activeTexture(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,v.texture.webGLTexture),v.height>m.height)P.viewport(0,0,v.width,v.height),this.setTargetUVs(v,m);else{var b=m.height-v.height;P.viewport(0,b,v.width,v.height)}if(P.bindFramebuffer(P.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,m.texture.webGLTexture,0),M&&(w?P.clearColor(0,0,0,0):P.clearColor(0,0,0,1),P.clear(P.COLOR_BUFFER_BIT)),C){var O=this.renderer.currentBlendMode;this.renderer.setBlendMode(p.ERASE)}A&&this.flipY(),P.bufferData(P.ARRAY_BUFFER,this.vertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),C&&this.renderer.setBlendMode(O),P.bindFramebuffer(P.FRAMEBUFFER,null),P.bindTexture(P.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(v,m,S,M,w,C,A,P){A===void 0&&(A=!0),P===void 0&&(P=!0);var b=this.gl;b.bindFramebuffer(b.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_2D,v.texture.webGLTexture,0),A&&(P?b.clearColor(0,0,0,0):b.clearColor(0,0,0,1),b.clear(b.COLOR_BUFFER_BIT)),b.activeTexture(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,m.texture.webGLTexture),b.copyTexSubImage2D(b.TEXTURE_2D,0,0,0,S,M,w,C),b.bindFramebuffer(b.FRAMEBUFFER,null),b.bindTexture(b.TEXTURE_2D,null)},copyToGame:function(v){var m=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,v.texture.webGLTexture),m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.STATIC_DRAW),m.drawArrays(m.TRIANGLES,0,6)},drawFrame:function(v,m,S,M){S===void 0&&(S=!0),M===void 0&&(M=this.colorMatrix);var w=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",M.getData()),this.set1f("uAlpha",M.alpha),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,v.texture.webGLTexture),m?(w.viewport(0,0,m.width,m.height),w.bindFramebuffer(w.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,m.texture.webGLTexture,0)):w.viewport(0,0,v.width,v.height),S?w.clearColor(0,0,0,0):w.clearColor(0,0,0,1),w.clear(w.COLOR_BUFFER_BIT),w.bufferData(w.ARRAY_BUFFER,this.vertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),w.bindFramebuffer(w.FRAMEBUFFER,null),w.bindTexture(w.TEXTURE_2D,null)},blendFrames:function(v,m,S,M,w,C){M===void 0&&(M=1),w===void 0&&(w=!0),C===void 0&&(C=this.linearShader);var A=this.gl;this.setShader(C),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",M),A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,v.texture.webGLTexture),A.activeTexture(A.TEXTURE1),A.bindTexture(A.TEXTURE_2D,m.texture.webGLTexture),S?(A.bindFramebuffer(A.FRAMEBUFFER,S.framebuffer.webGLFramebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,S.texture.webGLTexture,0),A.viewport(0,0,S.width,S.height)):A.viewport(0,0,v.width,v.height),w?A.clearColor(0,0,0,0):A.clearColor(0,0,0,1),A.clear(A.COLOR_BUFFER_BIT),A.bufferData(A.ARRAY_BUFFER,this.vertexData,A.STATIC_DRAW),A.drawArrays(A.TRIANGLES,0,6),A.bindFramebuffer(A.FRAMEBUFFER,null),A.bindTexture(A.TEXTURE_2D,null)},blendFramesAdditive:function(v,m,S,M,w){this.blendFrames(v,m,S,M,w,this.addShader)},clearFrame:function(v,m){m===void 0&&(m=!0);var S=this.gl;S.viewport(0,0,v.width,v.height),S.bindFramebuffer(S.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),m?S.clearColor(0,0,0,0):S.clearColor(0,0,0,1),S.clear(S.COLOR_BUFFER_BIT);var M=this.renderer.currentFramebuffer;S.bindFramebuffer(S.FRAMEBUFFER,M.webGLFramebuffer)},setUVs:function(v,m,S,M,w,C,A,P){var b=this.vertexViewF32;b[2]=v,b[3]=m,b[6]=S,b[7]=M,b[10]=w,b[11]=C,b[14]=v,b[15]=m,b[18]=w,b[19]=C,b[22]=A,b[23]=P},setTargetUVs:function(v,m){var S=m.height/v.height;S>.5?S=.5-(S-.5):S=.5+(.5-S),this.setUVs(0,S,0,1+S,1,1+S,1,S)},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)}});s.exports=d},36060:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"};s.exports=y},84817:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineafterflush"},36712:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinebeforeflush"},40285:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinebind"},65918:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineboot"},92852:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinedestroy"},56072:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelinerebind"},57566:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pipelineresize"},77085:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AFTER_FLUSH:e(84817),BEFORE_FLUSH:e(36712),BIND:e(40285),BOOT:e(65918),DESTROY:e(92852),REBIND:e(56072),RESIZE:e(57566)}},54812:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(99155),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n){l=this.getController(l),this.set1f("amount",l.amount,n)}});s.exports=a},67329:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(24400),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(l){l=this.getController(l),this.set1f("strength",l.blurStrength),this.set3fv("color",l.glcolor)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1,f=this.fullFrame2;this.copyFrame(l,f);for(var o=2/l.width*n.offsetX,c=2/l.height*n.offsetY,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(41514),h=e(51078),a=e(94328),l=e(84057),n=new r({Extends:l,initialize:function(f){l.call(this,{game:f,shaders:[{name:"Gaussian5",fragShader:p},{name:"Gaussian9",fragShader:h},{name:"Gaussian13",fragShader:a}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(u){var f=this.getController(),o=this.gl,c=this.fullFrame1,d=o.getParameter(o.FRAMEBUFFER_BINDING);this.bind(this.shaders[f.quality]),o.activeTexture(o.TEXTURE0),o.viewport(0,0,u.width,u.height),this.set1i("uMainSampler",0),this.set2f("resolution",u.width,u.height),this.set1f("strength",f.strength),this.set3fv("color",f.glcolor);for(var v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(90610),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("amount",l.amount,n),this.set1f("contrast",l.contrast,n),this.set1f("strength",l.strength,n),this.set2f("blur",l.blurX,l.blurY,n),this.setBoolean("isTiltShift",l.isTiltShift,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},89428:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91899),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("scale",l.scale,n),this.set1f("feather",l.feather,n),this.set1f("thickness",l.thickness,n),this.set3fv("color",l.glcolor,n),this.set4fv("backgroundColor",l.glcolor2,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},88904:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(84057),h=new r({Extends:p,initialize:function(l){p.call(this,{game:l})},onDraw:function(a){var l=this.fullFrame1;this.controller?this.manager.drawFrame(a,l,!0,this.controller):this.drawFrame(a,l),this.copyToGame(l)}});s.exports=h},63563:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(47838),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(l){var n=this.game.textures.getFrame(l);n&&(this.glTexture=n.glTexture)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",n.x,n.y),this.bindTexture(n.glTexture,1),this.copySprite(l,u),this.copyToGame(u)}});s.exports=a},94045:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=e(98656),a=e(84057),l=e(70554),n=new r({Extends:a,initialize:function(f,o){var c=p(o,"quality",.1),d=p(o,"distance",10);a.call(this,{game:f,fragShader:l.setGlowQuality(h,f,c,d)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(u,f,o,c){u=this.getController(u),this.set1f("outerStrength",u.outerStrength,f),this.set1f("innerStrength",u.innerStrength,f),this.set4fv("glowColor",u.glcolor,f),this.setBoolean("knockout",u.knockout,f),o&&c&&this.set2f("resolution",o,c,f)},onDraw:function(u){this.set2f("resolution",u.width,u.height),this.bindAndDraw(u)}});s.exports=n},74088:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(70463),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(l,n){l=this.getController(l),this.set1f("alpha",l.alpha,n),this.set1i("size",l.size,n),this.set3fv("color1",l.glcolor1,n),this.set3fv("color2",l.glcolor2,n),this.set2f("positionFrom",l.fromX,l.fromY,n),this.set2f("positionTo",l.toX,l.toY,n)}});s.exports=a},99636:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50831),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("amount",l.amount,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},34700:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(92595),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(l,n){l=this.getController(l);var u=l.samples;this.set1i("samples",u,n),this.set1f("intensity",l.intensity,n),this.set1f("decay",l.decay,n),this.set1f("power",l.power/u,n),this.set2f("lightPosition",l.x,l.y,n),this.set4fv("color",l.glcolor,n)}});s.exports=a},91157:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(72464),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(l,n,u,f){l=this.getController(l),this.setTime("time",n),this.set1f("speed",l.speed,n),this.set1f("lineWidth",l.lineWidth,n),this.set1f("gradient",l.gradient,n),this.setBoolean("reveal",l.reveal,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});s.exports=a},27797:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(39249),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(l,n){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("strength",l.strength,n),this.set2f("position",l.x,l.y,n)}});s.exports=a},67603:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(2878),h=e(84057),a=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(l,n){l=this.getController(l);var u=l.progress,f=l.wipeWidth,o=l.direction,c=l.axis;this.set4f("config",u,f,o,c,n),this.setBoolean("reveal",l.reveal,n)}});s.exports=a},58918:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={Barrel:e(54812),Bloom:e(67329),Blur:e(8861),Bokeh:e(51051),Circle:e(89428),ColorMatrix:e(88904),Displacement:e(63563),Glow:e(94045),Gradient:e(74088),Pixelate:e(99636),Shadow:e(34700),Shine:e(91157),Vignette:e(27797),Wipe:e(67603)};s.exports=r},96615:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(36060),p=e(79291),h={FX:e(58918),BitmapMaskPipeline:e(31302),Events:e(77085),FXPipeline:e(92651),LightPipeline:e(96569),MobilePipeline:e(56527),MultiPipeline:e(57516),PointLightPipeline:e(43439),PostFXPipeline:e(84057),PreFXPipeline:e(43558),RopePipeline:e(81041),SinglePipeline:e(12385),UtilityPipeline:e(7589)};h=p(!1,h,r),s.exports=h},35407:s=>{s.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = frame1 + frame2 * uStrength;","}"].join(` +`)},78908:s=>{s.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","precision mediump float;","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join(` +`)},85191:s=>{s.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","precision mediump float;","attribute vec2 inPosition;","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}"].join(` +`)},96293:s=>{s.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join(` +`)},36682:s=>{s.exports=["#define SHADER_NAME PHASER_COPY_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uBrightness;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}"].join(` +`)},99155:s=>{s.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join(` +`)},24400:s=>{s.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join(` +`)},94328:s=>{s.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},41514:s=>{s.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},51078:s=>{s.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` +`)},90610:s=>{s.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join(` +`)},91899:s=>{s.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join(` +`)},47838:s=>{s.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join(` +`)},98656:s=>{s.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join(` +`)},70463:s=>{s.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join(` +`)},50831:s=>{s.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join(` +`)},92595:s=>{s.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join(` +`)},72464:s=>{s.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join(` +`)},39249:s=>{s.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," col = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join(` +`)},2878:s=>{s.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join(` +`)},31063:s=>{s.exports=["#define SHADER_NAME PHASER_LIGHT_FS","precision mediump float;","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = %LIGHT_COUNT%;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}"].join(` +`)},48247:s=>{s.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}"].join(` +`)},41214:s=>{s.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join(` +`)},39653:s=>{s.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join(` +`)},62143:s=>{s.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},47940:s=>{s.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},98840:s=>{s.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler[%count%];","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture;"," %forloop%"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},44667:s=>{s.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},4127:s=>{s.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","precision mediump float;","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join(` +`)},89924:s=>{s.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}"].join(` +`)},27681:s=>{s.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join(` +`)},49627:s=>{s.exports=["#define SHADER_NAME PHASER_QUAD_VS","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join(` +`)},45561:s=>{s.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` +`)},60722:s=>{s.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` +`)},89350:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AddBlendFrag:e(35407),BitmapMaskFrag:e(78908),BitmapMaskVert:e(85191),ColorMatrixFrag:e(96293),CopyFrag:e(36682),FXBarrelFrag:e(99155),FXBloomFrag:e(24400),FXBlurHighFrag:e(94328),FXBlurLowFrag:e(41514),FXBlurMedFrag:e(51078),FXBokehFrag:e(90610),FXCircleFrag:e(91899),FXDisplacementFrag:e(47838),FXGlowFrag:e(98656),FXGradientFrag:e(70463),FXPixelateFrag:e(50831),FXShadowFrag:e(92595),FXShineFrag:e(72464),FXVignetteFrag:e(39249),FXWipeFrag:e(2878),LightFrag:e(31063),LinearBlendFrag:e(48247),MeshFrag:e(41214),MeshVert:e(39653),MobileFrag:e(62143),MobileVert:e(47940),MultiFrag:e(98840),MultiVert:e(44667),PointLightFrag:e(4127),PointLightVert:e(89924),PostFXFrag:e(27681),QuadVert:e(49627),SingleFrag:e(45561),SingleVert:e(60722)}},93567:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLAttribLocation=-1,this.gl=a,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLAttribLocation=-1;return}var h=this.gl;h.isContextLost()||(this.webGLAttribLocation=h.getAttribLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});s.exports=p},26128:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u){this.webGLBuffer=null,this.gl=a,this.initialDataOrSize=l,this.bufferType=n,this.bufferUsage=u,this.createResource()},createResource:function(){if(this.initialDataOrSize!==null){var h=this.gl;if(!h.isContextLost()){var a=this.bufferType,l=h.createBuffer();this.webGLBuffer=l,h.bindBuffer(a,this.webGLBuffer),h.bufferData(a,this.initialDataOrSize,this.bufferUsage),h.bindBuffer(a,null)}}},destroy:function(){var h=this.gl;h.isContextLost()||h.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});s.exports=p},84387:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},h=new r({initialize:function(l,n,u,f,o){this.webGLFramebuffer=null,this.gl=l,this.width=n,this.height=u,this.renderTexture=f,this.addDepthStencilBuffer=!!o,this.createResource()},createResource:function(){var a=this.gl;if(!a.isContextLost()){var l=this.renderTexture,n=0,u=a.createFramebuffer();if(this.webGLFramebuffer=u,a.bindFramebuffer(a.FRAMEBUFFER,u),l.isRenderTexture=!0,l.isAlphaPremultiplied=!1,a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,l.webGLTexture,0),n=a.checkFramebufferStatus(a.FRAMEBUFFER),n!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(p[n]||n));if(this.addDepthStencilBuffer){var f=a.createRenderbuffer();a.bindRenderbuffer(a.RENDERBUFFER,f),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,this.width,this.height),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,f)}a.bindFramebuffer(a.FRAMEBUFFER,null)}},destroy:function(){if(this.webGLFramebuffer!==null){var a=this.gl;if(!a.isContextLost()){a.bindFramebuffer(a.FRAMEBUFFER,this.webGLFramebuffer);var l=a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);l!==null&&(a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,null,0),a.deleteTexture(l));var n=a.getFramebufferAttachmentParameter(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);n!==null&&a.deleteRenderbuffer(n),a.bindFramebuffer(a.FRAMEBUFFER,null),a.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});s.exports=h},1482:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLProgram=null,this.gl=a,this.vertexSource=l,this.fragmentSource=n,this.createResource()},createResource:function(){var h=this.gl;if(!h.isContextLost()){var a=h.createProgram(),l=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(l,this.vertexSource),h.shaderSource(n,this.fragmentSource),h.compileShader(l),h.compileShader(n);var u=`Shader failed: +`;if(!h.getShaderParameter(l,h.COMPILE_STATUS))throw new Error("Vertex "+u+h.getShaderInfoLog(l));if(!h.getShaderParameter(n,h.COMPILE_STATUS))throw new Error("Fragment "+u+h.getShaderInfoLog(n));if(h.attachShader(a,l),h.attachShader(a,n),h.linkProgram(a),!h.getProgramParameter(a,h.LINK_STATUS))throw new Error("Link "+u+h.getProgramInfoLog(a));h.useProgram(a),this.webGLProgram=a}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});s.exports=p},82751:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50030),h=new r({initialize:function(l,n,u,f,o,c,d,v,m,S,M,w,C){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=l,this.mipLevel=n,this.minFilter=u,this.magFilter=f,this.wrapT=o,this.wrapS=c,this.format=d,this.pixels=v,this.width=m,this.height=S,this.pma=M??!0,this.forceSize=!!w,this.flipY=!!C,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var a=this.gl;if(!a.isContextLost()){if(this.pixels instanceof h){this.webGLTexture=this.pixels.webGLTexture;return}var l=a.createTexture();l.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=l,this._processTexture()}},update:function(a,l,n,u,f,o,c,d,v){if(!(l===0||n===0)){this.pixels=a,this.width=l,this.height=n,this.flipY=u,this.wrapS=f,this.wrapT=o,this.minFilter=c,this.magFilter=d,this.format=v;var m=this.gl;m.isContextLost()||this._processTexture()}},_processTexture:function(){var a=this.gl;a.activeTexture(a.TEXTURE0);var l=a.getParameter(a.TEXTURE_BINDING_2D);a.bindTexture(a.TEXTURE_2D,this.webGLTexture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,this.minFilter),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,this.magFilter),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,this.wrapS),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,this.wrapT),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,this.flipY);var n=this.pixels,u=this.mipLevel,f=this.width,o=this.height,c=this.format,d=!1;if(n==null)a.texImage2D(a.TEXTURE_2D,u,c,f,o,0,c,a.UNSIGNED_BYTE,null),d=p(f,o);else if(n.compressed){f=n.width,o=n.height,d=n.generateMipmap;for(var v=0;v{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n){this.webGLUniformLocation=null,this.gl=a,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLUniformLocation=null;return}var h=this.gl;h.isContextLost()||(this.webGLUniformLocation=h.getUniformLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});s.exports=p},9503:(s,y,e)=>{/** + * @author Benjamin D. Richards + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={WebGLAttribLocationWrapper:e(93567),WebGLBufferWrapper:e(26128),WebGLProgramWrapper:e(1482),WebGLTextureWrapper:e(82751),WebGLFramebufferWrapper:e(84387),WebGLUniformLocationWrapper:e(57183)};s.exports=r},76531:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(13560),p=e(83419),h=e(50792),a=e(97480),l=e(8443),n=e(57811),u=e(74403),f=e(45818),o=e(29747),c=e(87841),d=e(86555),v=e(56583),m=e(26099),S=e(38058),M=new p({Extends:h,initialize:function(C){h.call(this),this.game=C,this.canvas,this.canvasBounds=new c,this.parent=null,this.parentIsWindow=!1,this.parentSize=new d,this.gameSize=new d,this.baseSize=new d,this.displaySize=new d,this.scaleMode=r.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=r.CENTER.NO_CENTER,this.orientation=r.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:o,windowResize:o,fullScreenChange:o,fullScreenError:o}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(l.BOOT,this.boot,this)},boot:function(){var w=this.game;this.canvas=w.canvas,this.fullscreen=w.device.fullscreen,this.scaleMode!==r.SCALE_MODE.RESIZE&&this.scaleMode!==r.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===r.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()),w.events.on(l.PRE_STEP,this.step,this),w.events.once(l.READY,this.refresh,this),w.events.once(l.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(w){this.getParent(w),this.getParentBounds();var C=w.width,A=w.height,P=w.scaleMode,b=w.zoom,O=w.autoRound;if(typeof C=="string")if(C.substr(-1)!=="%")C=parseInt(C,10);else{var I=this.parentSize.width;I===0&&(I=window.innerWidth);var D=parseInt(C,10)/100;C=Math.floor(I*D)}if(typeof A=="string")if(A.substr(-1)!=="%")A=parseInt(A,10);else{var B=this.parentSize.height;B===0&&(B=window.innerHeight);var G=parseInt(A,10)/100;A=Math.floor(B*G)}this.scaleMode=P,this.autoRound=O,this.autoCenter=w.autoCenter,this.resizeInterval=w.resizeInterval,O&&(C=Math.floor(C),A=Math.floor(A)),this.gameSize.setSize(C,A),b===r.ZOOM.MAX_ZOOM&&(b=this.getMaxZoom()),this.zoom=b,b!==1&&(this._resetZoom=!0),this.baseSize.setSize(C,A),O&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),w.minWidth>0&&this.displaySize.setMin(w.minWidth*b,w.minHeight*b),w.maxWidth>0&&this.displaySize.setMax(w.maxWidth*b,w.maxHeight*b),this.displaySize.setSize(C,A),(w.snapWidth>0||w.snapHeight>0)&&this.displaySize.setSnap(w.snapWidth,w.snapHeight),this.orientation=f(C,A)},getParent:function(w){var C=w.parent;if(C!==null){if(this.parent=u(C),this.parentIsWindow=this.parent===document.body,w.expandParent&&w.scaleMode!==r.SCALE_MODE.NONE){var A=this.parent.getBoundingClientRect();(this.parentIsWindow||A.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",A=this.parent.getBoundingClientRect(),!this.parentIsWindow&&A.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}w.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(w.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var w=this.parentSize,C=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(C.height=n(!0));var A=C.width,P=C.height;if(w.width!==A||w.height!==P)return w.setSize(A,P),!0;if(this.canvas){var b=this.canvasBounds,O=this.canvas.getBoundingClientRect();if(O.x!==b.x||O.y!==b.y)return!0}return!1},lockOrientation:function(w){var C=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return C?C.call(screen,w):!1},setParentSize:function(w,C){return this.parentSize.setSize(w,C),this.refresh()},setGameSize:function(w,C){var A=this.autoRound;A&&(w=Math.floor(w),C=Math.floor(C));var P=this.width,b=this.height;return this.gameSize.resize(w,C),this.baseSize.resize(w,C),A&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(w/C),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(P,b)},resize:function(w,C){var A=this.zoom,P=this.autoRound;P&&(w=Math.floor(w),C=Math.floor(C));var b=this.width,O=this.height;this.gameSize.resize(w,C),this.baseSize.resize(w,C),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(w*A,C*A),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var I=this.canvas.style,D=w*A,B=C*A;return P&&(D=Math.floor(D),B=Math.floor(B)),(D!==w||B!==C)&&(I.width=D+"px",I.height=B+"px"),this.refresh(b,O)},setZoom:function(w){return this.zoom=w,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(w,C){return w===void 0&&(w=0),C===void 0&&(C=w),this.displaySize.setSnap(w,C),this.refresh()},refresh:function(w,C){w===void 0&&(w=this.width),C===void 0&&(C=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var A=this.game.domContainer;if(A){this.baseSize.setCSS(A);var P=this.canvas.style,b=A.style;b.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",b.marginLeft=P.marginLeft,b.marginTop=P.marginTop}return this.emit(a.RESIZE,this.gameSize,this.baseSize,this.displaySize,w,C),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var w=f(this.width,this.height);w!==this.orientation&&(this.orientation=w,this.emit(a.ORIENTATION_CHANGE,w))}},updateScale:function(){var w=this.canvas.style,C=this.gameSize.width,A=this.gameSize.height,P,b,O=this.zoom,I=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(C*O,A*O),P=this.displaySize.width,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),this._resetZoom&&(w.width=P+"px",w.height=b+"px",this._resetZoom=!1);else if(this.scaleMode===r.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,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),this.canvas.width=P,this.canvas.height=b;else if(this.scaleMode===r.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),P=this.displaySize.width,b=this.displaySize.height,I&&(P=Math.floor(P),b=Math.floor(b)),w.width=P+"px",w.height=b+"px";var D=this.parentSize.width/this.gameSize.width,B=this.parentSize.height/this.gameSize.height;D=0?0:-(b.x*O.x),D=b.y>=0?0:-(b.y*O.y),B;P.width>=b.width?B=A.width:B=A.width-(b.width-P.width)*O.x;var G;return P.height>=b.height?G=A.height:G=A.height-(b.height-P.height)*O.y,C.setTo(I,D,B,G),w&&(C.width/=w.zoomX,C.height/=w.zoomY,C.centerX=w.centerX+w.scrollX,C.centerY=w.centerY+w.scrollY),C},step:function(w,C){this.parent&&(this._lastCheck+=C,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var w=this.domlisteners;window.removeEventListener("orientationchange",w.orientationChange,!1),window.removeEventListener("resize",w.windowResize,!1);var C=["webkit","moz",""];C.forEach(function(A){document.removeEventListener(A+"fullscreenchange",w.fullScreenChange,!1),document.removeEventListener(A+"fullscreenerror",w.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",w.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",w.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===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});s.exports=M},64743:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={CENTER:e(64743),ORIENTATION:e(39218),SCALE_MODE:e(81050),ZOOM:e(80805)};s.exports=r},56139:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="enterfullscreen"},2336:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fullscreenfailed"},47412:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="fullscreenunsupported"},51452:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="leavefullscreen"},20666:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="orientationchange"},47945:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resize"},97480:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ENTER_FULLSCREEN:e(56139),FULLSCREEN_FAILED:e(2336),FULLSCREEN_UNSUPPORTED:e(47412),LEAVE_FULLSCREEN:e(51452),ORIENTATION_CHANGE:e(20666),RESIZE:e(47945)}},93364:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(13560),h={Center:e(64743),Events:e(97480),Orientation:e(39218),ScaleManager:e(76531),ScaleModes:e(81050),Zoom:e(80805)};h=r(!1,h,p.CENTER),h=r(!1,h,p.ORIENTATION),h=r(!1,h,p.SCALE_MODE),h=r(!1,h,p.ZOOM),s.exports=h},27397:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(35355),h=function(a){var l=a.game.config.defaultPhysicsSystem,n=r(a.settings,"physics",!1);if(!(!l&&!n)){var u=[];if(l&&u.push(p(l+"Physics")),n)for(var f in n)f=p(f.concat("Physics")),u.indexOf(f)===-1&&u.push(f);return u}};s.exports=h},52106:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h){var a=h.plugins.getDefaultScenePlugins(),l=r(h.settings,"plugins",!1);return Array.isArray(l)?l:a||[]};s.exports=p},87033:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"};s.exports=y},97482:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(2368),h=new r({initialize:function(l){this.sys=new p(this,l),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});s.exports=h},60903:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89993),h=e(44594),a=e(8443),l=e(35154),n=e(54899),u=e(29747),f=e(97482),o=e(2368),c=new r({initialize:function(v,m){if(this.game=v,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,m){Array.isArray(m)||(m=[m]);for(var S=0;S-1&&(delete this.keys[S],this.scenes.splice(m,1),this._start.indexOf(S)>-1&&(m=this._start.indexOf(S),this._start.splice(m,1)),v.sys.destroy())}return this},bootScene:function(d){var v=d.sys,m=v.settings;v.sceneUpdate=u,d.init&&(d.init.call(d,m.data),m.status=p.INIT,m.isTransition&&v.events.emit(h.TRANSITION_INIT,m.transitionFrom,m.transitionDuration));var S;v.load&&(S=v.load,S.reset()),S&&d.preload?(d.preload.call(d),m.status=p.LOADING,S.once(n.COMPLETE,this.loadComplete,this),S.start()):this.create(d)},loadComplete:function(d){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(d.scene)},payloadComplete:function(d){this.bootScene(d.scene)},update:function(d,v){this.processQueue(),this.isProcessing=!0;for(var m=this.scenes.length-1;m>=0;m--){var S=this.scenes[m].sys;S.settings.status>p.START&&S.settings.status<=p.RUNNING&&S.step(d,v),S.scenePlugin&&S.scenePlugin._target&&S.scenePlugin.step(d,v)}},render:function(d){for(var v=0;v=p.LOADING&&m.settings.status=p.START&&M<=p.CREATING)return this;if(M>=p.RUNNING&&M<=p.SLEEPING)S.shutdown(),S.sceneUpdate=u,S.start(v);else{S.sceneUpdate=u,S.start(v);var w;if(S.load&&(w=S.load),w&&S.settings.hasOwnProperty("pack")&&(w.reset(),w.addPack({payload:S.settings.pack})))return S.settings.status=p.LOADING,w.once(n.COMPLETE,this.payloadComplete,this),w.start(),this}return this.bootScene(m),this},stop:function(d,v){var m=this.getScene(d);if(m&&!m.sys.isTransitioning()&&m.sys.settings.status!==p.SHUTDOWN){var S=m.sys.load;S&&(S.off(n.COMPLETE,this.loadComplete,this),S.off(n.COMPLETE,this.payloadComplete,this)),m.sys.shutdown(v)}return this},switch:function(d,v){var m=this.getScene(d),S=this.getScene(v);return m&&S&&m!==S&&(this.sleep(d),this.isSleeping(v)?this.wake(v):this.start(v)),this},getAt:function(d){return this.scenes[d]},getIndex:function(d){var v=this.getScene(d);return this.scenes.indexOf(v)},bringToTop:function(d){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v!==-1&&v0){var m=this.getScene(d);this.scenes.splice(v,1),this.scenes.unshift(m)}}return this},moveDown:function(d){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v>0){var m=v-1,S=this.getScene(d),M=this.getAt(m);this.scenes[v]=M,this.scenes[m]=S}}return this},moveUp:function(d){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:d,keyB:null});else{var v=this.getIndex(d);if(vm),0,M)}}return this},moveBelow:function(d,v){if(d===v)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:d,keyB:v});else{var m=this.getIndex(d),S=this.getIndex(v);if(m!==-1&&S!==-1&&S>m){var M=this.getAt(S);this.scenes.splice(S,1),m===0?this.scenes.unshift(M):this.scenes.splice(m-(S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(44594),a=e(95540),l=e(37277),n=new p({initialize:function(f){this.scene=f,this.systems=f.sys,this.settings=f.sys.settings,this.key=f.sys.settings.key,this.manager=f.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.pluginStart,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(h.SHUTDOWN,this.shutdown,this)},start:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",u,f),this},restart:function(u){var f=this.key;return this.manager.queueOp("stop",f),this.manager.queueOp("start",f,u),this},transition:function(u){u===void 0&&(u={});var f=a(u,"target",!1),o=this.manager.getScene(f);if(!f||!this.checkValidTransition(o))return!1;var c=a(u,"duration",1e3);this._elapsed=0,this._target=o,this._duration=c,this._willSleep=a(u,"sleep",!1),this._willRemove=a(u,"remove",!1);var d=a(u,"onUpdate",null);d&&(this._onUpdate=d,this._onUpdateScope=a(u,"onUpdateScope",this.scene));var v=a(u,"allowInput",!1);this.settings.transitionAllowInput=v;var m=o.sys.settings;m.isTransition=!0,m.transitionFrom=this.scene,m.transitionDuration=c,m.transitionAllowInput=v,a(u,"moveAbove",!1)?this.manager.moveAbove(this.key,f):a(u,"moveBelow",!1)&&this.manager.moveBelow(this.key,f),o.sys.isSleeping()?o.sys.wake(a(u,"data")):this.manager.start(f,a(u,"data"));var S=a(u,"onStart",null),M=a(u,"onStartScope",this.scene);return S&&S.call(M,this.scene,o,c),this.systems.events.emit(h.TRANSITION_OUT,o,c),!0},checkValidTransition:function(u){return!(!u||u.sys.isActive()||u.sys.isTransitioning()||u===this.scene||this.systems.isTransitioning())},step:function(u,f){this._elapsed+=f,this.transitionProgress=r(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var u=this._target.sys,f=this._target.sys.settings;u.events.emit(h.TRANSITION_COMPLETE,this.scene),f.isTransition=!1,f.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(u,f,o,c){return this.manager.add(u,f,o,c)},launch:function(u,f){return u&&u!==this.key&&this.manager.queueOp("start",u,f),this},run:function(u,f){return u&&u!==this.key&&this.manager.queueOp("run",u,f),this},pause:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("pause",u,f),this},resume:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("resume",u,f),this},sleep:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("sleep",u,f),this},wake:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("wake",u,f),this},switch:function(u){return u!==this.key&&this.manager.queueOp("switch",this.key,u),this},stop:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",u,f),this},setActive:function(u,f,o){f===void 0&&(f=this.key);var c=this.manager.getScene(f);return c&&c.sys.setActive(u,o),this},setVisible:function(u,f){f===void 0&&(f=this.key);var o=this.manager.getScene(f);return o&&o.sys.setVisible(u),this},isSleeping:function(u){return u===void 0&&(u=this.key),this.manager.isSleeping(u)},isActive:function(u){return u===void 0&&(u=this.key),this.manager.isActive(u)},isPaused:function(u){return u===void 0&&(u=this.key),this.manager.isPaused(u)},isVisible:function(u){return u===void 0&&(u=this.key),this.manager.isVisible(u)},swapPosition:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.swapPosition(u,f),this},moveAbove:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveAbove(u,f),this},moveBelow:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveBelow(u,f),this},remove:function(u){return u===void 0&&(u=this.key),this.manager.remove(u),this},moveUp:function(u){return u===void 0&&(u=this.key),this.manager.moveUp(u),this},moveDown:function(u){return u===void 0&&(u=this.key),this.manager.moveDown(u),this},bringToTop:function(u){return u===void 0&&(u=this.key),this.manager.bringToTop(u),this},sendToBack:function(u){return u===void 0&&(u=this.key),this.manager.sendToBack(u),this},get:function(u){return this.manager.getScene(u)},getStatus:function(u){var f=this.manager.getScene(u);if(f)return f.sys.getStatus()},getIndex:function(u){return u===void 0&&(u=this.key),this.manager.getIndex(u)},shutdown:function(){var u=this.systems.events;u.off(h.SHUTDOWN,this.shutdown,this),u.off(h.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});l.register("ScenePlugin",n,"scenePlugin"),s.exports=n},55681:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89993),p=e(35154),h=e(46975),a=e(87033),l={create:function(n){return typeof n=="string"?n={key:n}:n===void 0&&(n={}),{status:r.PENDING,key:p(n,"key",""),active:p(n,"active",!1),visible:p(n,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:p(n,"pack",!1),cameras:p(n,"cameras",null),map:p(n,"map",h(a,p(n,"mapAdd",{}))),physics:p(n,"physics",{}),loader:p(n,"loader",{}),plugins:p(n,"plugins",!1),input:p(n,"input",{})}}};s.exports=l},2368:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(89993),h=e(42363),a=e(44594),l=e(27397),n=e(52106),u=e(29747),f=e(55681),o=new r({initialize:function(d,v){this.scene=d,this.game,this.renderer,this.config=v,this.settings=f.create(v),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(c){this.settings.status=p.INIT,this.sceneUpdate=u,this.game=c,this.renderer=c.renderer,this.canvas=c.canvas,this.context=c.context;var d=c.plugins;this.plugins=d,d.addToScene(this,h.Global,[h.CoreScene,n(this),l(this)]),this.events.emit(a.BOOT,this),this.settings.isBooted=!0},step:function(c,d){var v=this.events;v.emit(a.PRE_UPDATE,c,d),v.emit(a.UPDATE,c,d),this.sceneUpdate.call(this.scene,c,d),v.emit(a.POST_UPDATE,c,d)},render:function(c){var d=this.displayList;d.depthSort(),this.events.emit(a.PRE_RENDER,c),this.cameras.render(c,d),this.events.emit(a.RENDER,c)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot pause non-running Scene",d.key):this.settings.active&&(d.status=p.PAUSED,d.active=!1,this.events.emit(a.PAUSE,this,c)),this},resume:function(c){var d=this.events,v=this.settings;return this.settings.active||(v.status=p.RUNNING,v.active=!0,d.emit(a.RESUME,this,c)),this},sleep:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot sleep non-running Scene",d.key):(d.status=p.SLEEPING,d.active=!1,d.visible=!1,this.events.emit(a.SLEEP,this,c)),this},wake:function(c){var d=this.events,v=this.settings;return v.status=p.RUNNING,v.active=!0,v.visible=!0,d.emit(a.WAKE,this,c),v.isTransition&&d.emit(a.TRANSITION_WAKE,v.transitionFrom,v.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var c=this.settings.status;return c>p.PENDING&&c<=p.RUNNING},isSleeping:function(){return this.settings.status===p.SLEEPING},isActive:function(){return this.settings.status===p.RUNNING},isPaused:function(){return this.settings.status===p.PAUSED},isTransitioning:function(){return this.settings.isTransition||this.scenePlugin._target!==null},isTransitionOut:function(){return this.scenePlugin._target!==null&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(c){return this.settings.visible=c,this},setActive:function(c,d){return c?this.resume(d):this.pause(d)},start:function(c){var d=this.events,v=this.settings;c&&(v.data=c),v.status=p.START,v.active=!0,v.visible=!0,d.emit(a.START,this),d.emit(a.READY,this,c)},shutdown:function(c){var d=this.events,v=this.settings;d.off(a.TRANSITION_INIT),d.off(a.TRANSITION_START),d.off(a.TRANSITION_COMPLETE),d.off(a.TRANSITION_OUT),v.status=p.SHUTDOWN,v.active=!1,v.visible=!1,d.emit(a.SHUTDOWN,this,c)},destroy:function(){var c=this.events,d=this.settings;d.status=p.DESTROYED,d.active=!1,d.visible=!1,c.emit(a.DESTROY,this),c.removeAllListeners();for(var v=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],m=0;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9};s.exports=y},69830:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addedtoscene"},7919:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="boot"},46763:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="create"},11763:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},71555:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},36735:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="postupdate"},3809:s=>{/** + * @author samme + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="prerender"},90716:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="preupdate"},58262:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},91633:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removedfromscene"},10319:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="render"},87132:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},81961:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="shutdown"},90194:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="sleep"},6265:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},33178:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitioncomplete"},43063:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitioninit"},11259:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionout"},61611:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionstart"},45209:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="transitionwake"},22966:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},21747:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="wake"},44594:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADDED_TO_SCENE:e(69830),BOOT:e(7919),CREATE:e(46763),DESTROY:e(11763),PAUSE:e(71555),POST_UPDATE:e(36735),PRE_RENDER:e(3809),PRE_UPDATE:e(90716),READY:e(58262),REMOVED_FROM_SCENE:e(91633),RENDER:e(10319),RESUME:e(87132),SHUTDOWN:e(81961),SLEEP:e(90194),START:e(6265),TRANSITION_COMPLETE:e(33178),TRANSITION_INIT:e(43063),TRANSITION_OUT:e(11259),TRANSITION_START:e(61611),TRANSITION_WAKE:e(45209),UPDATE:e(22966),WAKE:e(21747)}},62194:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89993),p=e(79291),h={Events:e(44594),GetPhysicsPlugins:e(27397),GetScenePlugins:e(52106),SceneManager:e(60903),ScenePlugin:e(52209),Settings:e(55681),Systems:e(2368)};h=p(!1,h,r),s.exports=h},30341:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(14463),a=e(79291),l=e(29747),n=new r({Extends:p,initialize:function(f,o,c){p.call(this),this.manager=f,this.key=o,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=a(this.config,c),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(console.error("addMarker "+u.name+" already exists in Sound"),!1):(u=a(!0,{name:"",start:0,duration:this.totalDuration-(u.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},u),this.markers[u.name]=u,!0)},updateMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(this.markers[u.name]=a(!0,this.markers[u.name],u),!0):(console.warn("Audio Marker: "+u.name+" missing in Sound: "+this.key),!1)},removeMarker:function(u){var f=this.markers[u];return f?(this.markers[u]=null,f):null},play:function(u,f){if(u===void 0&&(u=""),typeof u=="object"&&(f=u,u=""),typeof u!="string")return!1;if(!u)this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;else{if(!this.markers[u])return console.warn("Marker: "+u+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[u],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}return this.resetConfig(),this.currentConfig=a(this.currentConfig,f),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return this.isPaused||!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!this.isPaused||this.isPlaying?!1:(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!this.isPaused&&!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:l,calculateRate:function(){var u=1.0005777895065548,f=this.currentConfig.detune+this.manager.detune,o=Math.pow(u,f);this.totalRate=this.currentConfig.rate*this.manager.rate*o},destroy:function(){this.pendingRemove||(this.stop(),this.emit(h.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});s.exports=n},85034:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(41786),h=e(50792),a=e(14463),l=e(8443),n=e(46710),u=e(58731),f=e(29747),o=e(26099),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.jsonCache=v.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 o,v.events.on(l.BLUR,this.onGameBlur,this),v.events.on(l.FOCUS,this.onGameFocus,this),v.events.on(l.PRE_STEP,this.update,this),v.events.once(l.DESTROY,this.destroy,this)},add:f,addAudioSprite:function(d,v){v===void 0&&(v={});var m=this.add(d,v);m.spritemap=this.jsonCache.get(d).spritemap;for(var S in m.spritemap)if(m.spritemap.hasOwnProperty(S)){var M=p(v),w=m.spritemap[S];M.loop=w.hasOwnProperty("loop")?w.loop:!1,m.addMarker({name:S,start:w.start,duration:w.end-w.start,config:M})}return m},get:function(d){return u(this.sounds,"key",d)},getAll:function(d){return d?n(this.sounds,"key",d):n(this.sounds)},getAllPlaying:function(){return n(this.sounds,"isPlaying",!0)},play:function(d,v){var m=this.add(d);return m.once(a.COMPLETE,m.destroy,m),v?v.name?(m.addMarker(v),m.play(v.name)):m.play(v):m.play()},playAudioSprite:function(d,v,m){var S=this.addAudioSprite(d);return S.once(a.COMPLETE,S.destroy,S),S.play(v,m)},remove:function(d){var v=this.sounds.indexOf(d);return v!==-1?(d.destroy(),this.sounds.splice(v,1),!0):!1},removeAll:function(){this.sounds.forEach(function(d){d.destroy()}),this.sounds.length=0},removeByKey:function(d){for(var v=0,m=this.sounds.length-1;m>=0;m--){var S=this.sounds[m];S.key===d&&(S.destroy(),this.sounds.splice(m,1),v++)}return v},pauseAll:function(){this.forEachActiveSound(function(d){d.pause()}),this.emit(a.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(d){d.resume()}),this.emit(a.RESUME_ALL,this)},setListenerPosition:f,stopAll:function(){this.forEachActiveSound(function(d){d.stop()}),this.emit(a.STOP_ALL,this)},stopByKey:function(d){var v=0;return this.getAll(d).forEach(function(m){m.stop()&&v++}),v},unlock:f,onBlur:f,onFocus:f,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(d,v){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(a.UNLOCKED,this));for(var m=this.sounds.length-1;m>=0;m--)this.sounds[m].pendingRemove&&this.sounds.splice(m,1);this.sounds.forEach(function(S){S.update(d,v)})},destroy:function(){this.game.events.off(l.BLUR,this.onGameBlur,this),this.game.events.off(l.FOCUS,this.onGameFocus,this),this.game.events.off(l.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(d,v){var m=this;this.sounds.forEach(function(S,M){S&&!S.pendingRemove&&d.call(v||m,S,M,m.sounds)})},setRate:function(d){return this.rate=d,this},rate:{get:function(){return this._rate},set:function(d){this._rate=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(a.GLOBAL_RATE,this,d)}},setDetune:function(d){return this.detune=d,this},detune:{get:function(){return this._detune},set:function(d){this._detune=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(a.GLOBAL_DETUNE,this,d)}}});s.exports=c},14747:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33684),p=e(25960),h=e(57490),a={create:function(l){var n=l.config.audio,u=l.device.audio;return n.noAudio||!u.webAudio&&!u.audioData?new p(l):u.webAudio&&!n.disableWebAudio?new h(l):new r(l)}};s.exports=a},19723:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},98882:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="decodedall"},57506:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="decoded"},73146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="destroy"},11305:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="detune"},40577:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="detune"},30333:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="mute"},20394:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="rate"},21802:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="volume"},1299:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="looped"},99190:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},97125:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="mute"},89259:s=>{/** + * @author pi-kei + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pan"},79986:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pauseall"},17586:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},19618:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="play"},42306:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="rate"},10387:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resumeall"},48959:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},9960:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="seek"},19180:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stopall"},98328:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},50401:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="unlocked"},52498:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="volume"},14463:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(19723),DECODED:e(57506),DECODED_ALL:e(98882),DESTROY:e(73146),DETUNE:e(11305),GLOBAL_DETUNE:e(40577),GLOBAL_MUTE:e(30333),GLOBAL_RATE:e(20394),GLOBAL_VOLUME:e(21802),LOOP:e(99190),LOOPED:e(1299),MUTE:e(97125),PAN:e(89259),PAUSE_ALL:e(79986),PAUSE:e(17586),PLAY:e(19618),RATE:e(42306),RESUME_ALL:e(10387),RESUME:e(48959),SEEK:e(9960),STOP_ALL:e(19180),STOP:e(98328),UNLOCKED:e(50401),VOLUME:e(52498)}},64895:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30341),p=e(83419),h=e(14463),a=e(45319),l=new p({Extends:r,initialize:function(u,f,o){if(o===void 0&&(o={}),this.tags=u.game.cache.audio.get(f),!this.tags)throw new Error('No cached audio asset with key "'+f);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,u,f,o)},play:function(n,u){return this.manager.isLocked(this,"play",[n,u])||!r.prototype.play.call(this,n,u)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.PLAY,this),!0)},pause:function(){return this.manager.isLocked(this,"pause")||this.startTime>0||!r.prototype.pause.call(this)?!1:(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(h.PAUSE,this),!0)},resume:function(){return this.manager.isLocked(this,"resume")||this.startTime>0||!r.prototype.resume.call(this)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.RESUME,this),!0)},stop:function(){return this.manager.isLocked(this,"stop")||!r.prototype.stop.call(this)?!1:(this.stopAndReleaseAudioTag(),this.emit(h.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var n=this.currentConfig.seek,u=this.currentConfig.delay,f=(this.currentMarker?this.currentMarker.start:0)+n;return this.previousTime=f,this.audio.currentTime=f,this.applyConfig(),u===0?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+u*1e3,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var n=0;n0){this.startTime=f-this.manager.loopEndOffset?(this.audio.currentTime=u+Math.max(0,o-f),o=this.audio.currentTime):o=f){this.reset(),this.stopAndReleaseAudioTag(),this.emit(h.COMPLETE,this);return}this.previousTime=o}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=a(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(n){this.currentConfig.mute=n,!this.manager.isLocked(this,"mute",n)&&(this.updateMute(),this.emit(h.MUTE,this,n))}},setMute:function(n){return this.mute=n,this},volume:{get:function(){return this.currentConfig.volume},set:function(n){this.currentConfig.volume=n,!this.manager.isLocked(this,"volume",n)&&(this.updateVolume(),this.emit(h.VOLUME,this,n))}},setVolume:function(n){return this.volume=n,this},rate:{get:function(){return this.currentConfig.rate},set:function(n){this.currentConfig.rate=n,!this.manager.isLocked(this,h.RATE,n)&&(this.calculateRate(),this.emit(h.RATE,this,n))}},setRate:function(n){return this.rate=n,this},detune:{get:function(){return this.currentConfig.detune},set:function(n){this.currentConfig.detune=n,!this.manager.isLocked(this,h.DETUNE,n)&&(this.calculateRate(),this.emit(h.DETUNE,this,n))}},setDetune:function(n){return this.detune=n,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(n){this.manager.isLocked(this,"seek",n)||this.startTime>0||(this.isPlaying||this.isPaused)&&(n=Math.min(Math.max(0,n),this.duration),this.isPlaying?(this.previousTime=n,this.audio.currentTime=n):this.isPaused&&(this.currentConfig.seek=n),this.emit(h.SEEK,this,n))}},setSeek:function(n){return this.seek=n,this},loop:{get:function(){return this.currentConfig.loop},set:function(n){this.currentConfig.loop=n,!this.manager.isLocked(this,"loop",n)&&(this.audio&&(this.audio.loop=n),this.emit(h.LOOP,this,n))}},setLoop:function(n){return this.loop=n,this},pan:{get:function(){return this.currentConfig.pan},set:function(n){this.currentConfig.pan=n,this.emit(h.PAN,this,n)}},setPan:function(n){return this.pan=n,this}});s.exports=l},33684:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85034),p=e(83419),h=e(14463),a=e(64895),l=new p({Extends:r,initialize:function(u){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,u)},add:function(n,u){var f=new a(this,n,u);return this.sounds.push(f),f},unlock:function(){this.locked=!1;var n=this;if(this.game.cache.audio.entries.each(function(c,d){for(var v=0;v{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={SoundManagerCreator:e(14747),Events:e(14463),BaseSound:e(30341),BaseSoundManager:e(85034),WebAudioSound:e(71741),WebAudioSoundManager:e(57490),HTML5AudioSound:e(64895),HTML5AudioSoundManager:e(33684),NoAudioSound:e(4603),NoAudioSoundManager:e(25960)}},4603:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30341),p=e(83419),h=e(50792),a=e(79291),l=e(29747),n=function(){return!1},u=function(){return null},f=function(){return this},o=new p({Extends:h,initialize:function(d,v,m){m===void 0&&(m={}),h.call(this),this.manager=d,this.key=v,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=a({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},m),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:n,updateMarker:n,removeMarker:u,play:n,pause:n,resume:n,stop:n,setMute:f,setVolume:f,setRate:f,setDetune:f,setSeek:f,setLoop:f,setPan:f,applyConfig:u,resetConfig:u,update:l,calculateRate:u,destroy:function(){r.prototype.destroy.call(this)}});s.exports=o},25960:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85034),p=e(83419),h=e(50792),a=e(4603),l=e(29747),n=new p({Extends:h,initialize:function(f){h.call(this),this.game=f,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(u,f){var o=new a(this,u,f);return this.sounds.push(o),o},addAudioSprite:function(u,f){var o=this.add(u,f);return o.spritemap={},o},get:function(u){return r.prototype.get.call(this,u)},getAll:function(u){return r.prototype.getAll.call(this,u)},play:function(u,f){return!1},playAudioSprite:function(u,f,o){return!1},remove:function(u){return r.prototype.remove.call(this,u)},removeAll:function(){return r.prototype.removeAll.call(this)},removeByKey:function(u){return r.prototype.removeByKey.call(this,u)},stopByKey:function(u){return r.prototype.stopByKey.call(this,u)},onBlur:l,onFocus:l,onGameBlur:l,onGameFocus:l,pauseAll:l,resumeAll:l,stopAll:l,update:l,setRate:l,setDetune:l,setMute:l,setVolume:l,unlock:l,forEachActiveSound:function(u,f){r.prototype.forEachActiveSound.call(this,u,f)},destroy:function(){r.prototype.destroy.call(this)}});s.exports=n},71741:(s,y,e)=>{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30341),p=e(83419),h=e(14463),a=e(95540),l=new p({Extends:r,initialize:function(u,f,o){if(o===void 0&&(o={}),this.audioBuffer=u.game.cache.audio.get(f),!this.audioBuffer)throw new Error('Audio key "'+f+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=u.context.createGain(),this.volumeNode=u.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),u.context.createPanner&&(this.spatialNode=u.context.createPanner(),this.volumeNode.connect(this.spatialNode)),u.context.createStereoPanner?(this.pannerNode=u.context.createStereoPanner(),u.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(u.destination)):u.context.createPanner?this.spatialNode.connect(u.destination):this.volumeNode.connect(u.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,r.call(this,u,f,o)},play:function(n,u){return r.prototype.play.call(this,n,u)?(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(h.PLAY,this),!0):!1},pause:function(){return this.manager.context.currentTime{/** + * @author Richard Davey + * @author Pavle Goloskokovic (http://prunegames.com) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(53134),p=e(85034),h=e(83419),a=e(14463),l=e(8443),n=e(71741),u=e(95540),f=new h({Extends:p,initialize:function(c){this.context=this.createAudioContext(c),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),p.call(this,c),this.locked&&c.isBooted?this.unlock():c.events.once(l.BOOT,this.unlock,this)},createAudioContext:function(o){var c=o.config.audio;if(c.context)return c.context.resume(),c.context;if(window.hasOwnProperty("AudioContext"))return new AudioContext;if(window.hasOwnProperty("webkitAudioContext"))return new window.webkitAudioContext},setAudioContext:function(o){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=o,this.masterMuteNode=o.createGain(),this.masterVolumeNode=o.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(o.destination),this.destination=this.masterMuteNode,this},add:function(o,c){var d=new n(this,o,c);return this.sounds.push(d),d},decodeAudio:function(o,c){var d;Array.isArray(o)?d=o:d=[{key:o,data:c}];for(var v=this.game.cache.audio,m=d.length,S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37105),p=e(83419),h=e(29747),a=e(19186),l=new p({initialize:function(u){this.parent=u,this.list=[],this.position=0,this.addCallback=h,this.removeCallback=h,this._sortKey=""},add:function(n,u){return u?r.Add(this.list,n):r.Add(this.list,n,0,this.addCallback,this)},addAt:function(n,u,f){return f?r.AddAt(this.list,n,u):r.AddAt(this.list,n,u,0,this.addCallback,this)},getAt:function(n){return this.list[n]},getIndex:function(n){return this.list.indexOf(n)},sort:function(n,u){return n?(u===void 0&&(u=function(f,o){return f[n]-o[n]}),a(this.list,u),this):this},getByName:function(n){return r.GetFirst(this.list,"name",n)},getRandom:function(n,u){return r.GetRandom(this.list,n,u)},getFirst:function(n,u,f,o){return r.GetFirst(this.list,n,u,f,o)},getAll:function(n,u,f,o){return r.GetAll(this.list,n,u,f,o)},count:function(n,u){return r.CountAllMatching(this.list,n,u)},swap:function(n,u){r.Swap(this.list,n,u)},moveTo:function(n,u){return r.MoveTo(this.list,n,u)},moveAbove:function(n,u){return r.MoveAbove(this.list,n,u)},moveBelow:function(n,u){return r.MoveBelow(this.list,n,u)},remove:function(n,u){return u?r.Remove(this.list,n):r.Remove(this.list,n,this.removeCallback,this)},removeAt:function(n,u){return u?r.RemoveAt(this.list,n):r.RemoveAt(this.list,n,this.removeCallback,this)},removeBetween:function(n,u,f){return f?r.RemoveBetween(this.list,n,u):r.RemoveBetween(this.list,n,u,this.removeCallback,this)},removeAll:function(n){for(var u=this.list.length;u--;)this.remove(this.list[u],n);return this},bringToTop:function(n){return r.BringToTop(this.list,n)},sendToBack:function(n){return r.SendToBack(this.list,n)},moveUp:function(n){return r.MoveUp(this.list,n),n},moveDown:function(n){return r.MoveDown(this.list,n),n},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(n,u){return r.Replace(this.list,n,u)},exists:function(n){return this.list.indexOf(n)>-1},setAll:function(n,u,f,o){return r.SetAll(this.list,n,u,f,o),this},each:function(n,u){for(var f=[null],o=2;o0?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}}});s.exports=l},90330:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){this.entries={},this.size=0,this.setAll(a)},setAll:function(h){if(Array.isArray(h))for(var a=0;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(82348),a=new r({Extends:p,initialize:function(){p.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(l){return this._active.indexOf(l)>-1},isPending:function(l){return this._toProcess>0&&this._pending.indexOf(l)>-1},isDestroying:function(l){return this._destroy.indexOf(l)>-1},add:function(l){return this.checkQueue&&this.isActive(l)&&!this.isDestroying(l)||this.isPending(l)||(this._pending.push(l),this._toProcess++),l},remove:function(l){if(this.isPending(l)){var n=this._pending,u=n.indexOf(l);u!==-1&&n.splice(u,1)}else this.isActive(l)&&(this._destroy.push(l),this._toProcess++);return l},removeAll:function(){for(var l=this._active,n=this._destroy,u=l.length;u--;)n.push(l[u]),this._toProcess++;return this},update:function(){if(this._toProcess===0)return this._active;var l=this._destroy,n=this._active,u,f;for(u=0;u{/** + * @author Vladimir Agafonkin + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(43886);function p(C){if(!(this instanceof p))return new p(C);this._maxEntries=Math.max(4,C||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}p.prototype={all:function(){return this._all(this.data,[])},search:function(C){var A=this.data,P=[],b=this.toBBox;if(!S(C,A))return P;for(var O=[],I,D,B,G;A;){for(I=0,D=A.children.length;I=0&&I[A].children.length>this._maxEntries;)this._split(I,A),A--;this._adjustParentBBoxes(O,I,A)},_split:function(C,A){var P=C[A],b=P.children.length,O=this._minEntries;this._chooseSplitAxis(P,O,b);var I=this._chooseSplitIndex(P,O,b),D=M(P.children.splice(I,P.children.length-I));D.height=P.height,D.leaf=P.leaf,a(P,this.toBBox),a(D,this.toBBox),A?C[A-1].children.push(D):this._splitRoot(P,D)},_splitRoot:function(C,A){this.data=M([C,A]),this.data.height=C.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(C,A,P){var b,O,I,D,B,G,z,X;for(G=z=1/0,b=A;b<=P-A;b++)O=l(C,0,b,this.toBBox),I=l(C,b,P,this.toBBox),D=v(O,I),B=o(O)+o(I),D=A;G--)z=C.children[G],n(D,C.leaf?O(z):z),B+=c(D);return B},_adjustParentBBoxes:function(C,A,P){for(var b=P;b>=0;b--)n(A[b],C)},_condense:function(C){for(var A=C.length-1,P;A>=0;A--)C[A].children.length===0?A>0?(P=C[A-1].children,P.splice(P.indexOf(C[A]),1)):this.clear():a(C[A],this.toBBox)},compareMinX:function(C,A){return C.left-A.left},compareMinY:function(C,A){return C.top-A.top},toBBox:function(C){return{minX:C.left,minY:C.top,maxX:C.right,maxY:C.bottom}}};function h(C,A,P){if(!P)return A.indexOf(C);for(var b=0;b=C.minX&&A.maxY>=C.minY}function M(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function w(C,A,P,b,O){for(var I=[A,P],D;I.length;)P=I.pop(),A=I.pop(),!(P-A<=b)&&(D=A+Math.ceil((P-A)/b/2)*b,r(C,D,A,P,O),I.push(A,D,D,P))}s.exports=p},35072:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){if(this.entries=[],Array.isArray(a))for(var l=0;l-1&&this.entries.splice(a,1),this},dump:function(){console.group("Set");for(var h=0;h-1},union:function(h){var a=new p;return h.entries.forEach(function(l){a.set(l)}),this.entries.forEach(function(l){a.set(l)}),a},intersect:function(h){var a=new p;return this.entries.forEach(function(l){h.contains(l)&&a.set(l)}),a},difference:function(h){var a=new p;return this.entries.forEach(function(l){h.contains(l)||a.set(l)}),a},size:{get:function(){return this.entries.length},set:function(h){return h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45319),p=e(83419),h=e(56583),a=e(26099),l=new p({initialize:function(u,f,o,c){u===void 0&&(u=0),f===void 0&&(f=u),o===void 0&&(o=0),c===void 0&&(c=null),this._width=u,this._height=f,this._parent=c,this.aspectMode=o,this.aspectRatio=f===0?1:u/f,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new a},setAspectMode:function(n){return n===void 0&&(n=0),this.aspectMode=n,this.setSize(this._width,this._height)},setSnap:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.snapTo.set(n,u),this.setSize(this._width,this._height)},setParent:function(n){return this._parent=n,this.setSize(this._width,this._height)},setMin:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.minWidth=r(n,0,this.maxWidth),this.minHeight=r(u,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(n,u){return n===void 0&&(n=Number.MAX_VALUE),u===void 0&&(u=n),this.maxWidth=r(n,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(u,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(n,u){switch(n===void 0&&(n=0),u===void 0&&(u=n),this.aspectMode){case l.NONE:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height;break;case l.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case l.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(h(u,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case l.FIT:this.constrain(n,u,!0);break;case l.ENVELOP:this.constrain(n,u,!1);break}return this},setAspectRatio:function(n){return this.aspectRatio=n,this.setSize(this._width,this._height)},resize:function(n,u){return this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height,this},getNewWidth:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minWidth,this.maxWidth),u&&this._parent&&n>this._parent.width&&(n=Math.max(this.minWidth,this._parent.width)),n},getNewHeight:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minHeight,this.maxHeight),u&&this._parent&&n>this._parent.height&&(n=Math.max(this.minHeight,this._parent.height)),n},constrain:function(n,u,f){n===void 0&&(n=0),u===void 0&&(u=n),f===void 0&&(f=!0),n=this.getNewWidth(n),u=this.getNewHeight(u);var o=this.snapTo,c=u===0?1:n/u;return f&&this.aspectRatio>c||!f&&this.aspectRatio0&&(u=h(u,o.y),n=u*this.aspectRatio)):(f&&this.aspectRatioc)&&(u=h(u,o.y),n=u*this.aspectRatio,o.x>0&&(n=h(n,o.x),u=n*(1/this.aspectRatio))),this._width=n,this._height=u,this},fitTo:function(n,u){return this.constrain(n,u,!0)},envelop:function(n,u){return this.constrain(n,u,!1)},setWidth:function(n){return this.setSize(n,this._height)},setHeight:function(n){return this.setSize(this._width,n)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(n){n&&n.style&&(n.style.width=this._width+"px",n.style.height=this._height+"px")},copy:function(n){return n.setAspectMode(this.aspectMode),n.aspectRatio=this.aspectRatio,n.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(n){this.setSize(n,this._height)}},height:{get:function(){return this._height},set:function(n){this.setSize(this._width,n)}}});l.NONE=0,l.WIDTH_CONTROLS_HEIGHT=1,l.HEIGHT_CONTROLS_WIDTH=2,l.FIT=3,l.ENVELOP=4,s.exports=l},15238:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="add"},56187:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="remove"},82348:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={PROCESS_QUEUE_ADD:e(15238),PROCESS_QUEUE_REMOVE:e(56187)}},41392:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Events:e(82348),List:e(73162),Map:e(90330),ProcessQueue:e(25774),RTree:e(59542),Set:e(35072),Size:e(86555)}},57382:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(40987),a=e(8054),l=e(50030),n=e(79237),u=new r({Extends:n,initialize:function(o,c,d,v,m){n.call(this,o,c,d,v,m),this.add("__BASE",0,0,0,v,m),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=v,this.height=m,this.imageData=this.context.getImageData(0,0,v,m),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===a.WEBGL&&this.refresh(),this},draw:function(f,o,c,d){return d===void 0&&(d=!0),this.context.drawImage(c,f,o),d&&this.update(),this},drawFrame:function(f,o,c,d,v){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=!0);var m=this.manager.getFrame(f,o);if(m){var S=m.canvasData,M=m.cutWidth,w=m.cutHeight,C=m.source.resolution;this.context.drawImage(m.source.image,S.x,S.y,M,w,c,d,M/C,w/C),v&&this.update()}return this},setPixel:function(f,o,c,d,v,m){m===void 0&&(m=255),f=Math.abs(Math.floor(f)),o=Math.abs(Math.floor(o));var S=this.getIndex(f,o);if(S>-1){var M=this.context.getImageData(f,o,1,1);M.data[0]=c,M.data[1]=d,M.data[2]=v,M.data[3]=m,this.context.putImageData(M,f,o)}return this},putData:function(f,o,c,d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=f.width),S===void 0&&(S=f.height),this.context.putImageData(f,o,c,d,v,m,S),this},getData:function(f,o,c,d){f=p(Math.floor(f),0,this.width-1),o=p(Math.floor(o),0,this.height-1),c=p(c,1,this.width-f),d=p(d,1,this.height-o);var v=this.context.getImageData(f,o,c,d);return v},getPixel:function(f,o,c){c||(c=new h);var d=this.getIndex(f,o);if(d>-1){var v=this.data,m=v[d+0],S=v[d+1],M=v[d+2],w=v[d+3];c.setTo(m,S,M,w)}return c},getPixels:function(f,o,c,d){f===void 0&&(f=0),o===void 0&&(o=0),c===void 0&&(c=this.width),d===void 0&&(d=c),f=Math.abs(Math.round(f)),o=Math.abs(Math.round(o));for(var v=p(f,0,this.width),m=p(f+c,0,this.width),S=p(o,0,this.height),M=p(o+d,0,this.height),w=new h,C=[],A=S;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(10312),p=e(71911),h=e(27919),a=e(83419),l=e(8054),n=e(4327),u=e(95540),f=e(36060),o=e(32302),c=e(79237),d=e(70554),v=new a({Extends:c,initialize:function(S,M,w,C){w===void 0&&(w=256),C===void 0&&(C=256),this.type="DynamicTexture";var A=S.game.renderer,P=A&&A.type===l.CANVAS,b=P?h.create2D(this,w,C):[this];c.call(this,S,M,b,w,C),this.add("__BASE",0,0,0,w,C),this.renderer=A,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=P?b:null,this.context=P?b.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new p(0,0,w,C).setScene(S.game.scene.systemScene,!1),this.renderTarget=P?null:new o(A,w,C,1,0,!1,!0,!0,!1),this.pipeline=P?null:A.pipelines.get(f.SINGLE_PIPELINE),this.setSize(w,C)},setSize:function(m,S){S===void 0&&(S=m);var M=this.get(),w=M.source;if(m!==this.width||S!==this.height){this.canvas&&(this.canvas.width=m,this.canvas.height=S);var C=this.renderTarget;C&&(C.willResize(m,S)&&C.resize(m,S),C.texture!==w.glTexture&&this.renderer.deleteTexture(w.glTexture),this.setFromRenderTarget()),this.camera.setSize(m,S),w.width=m,w.height=S,M.setSize(m,S),this.width=m,this.height=S}else{var A=this.getSourceImage();M.cutX+m>A.width&&(m=A.width-M.cutX),M.cutY+S>A.height&&(S=A.height-M.cutY),M.setSize(m,S,M.cutX,M.cutY)}return this},setFromRenderTarget:function(){var m=this.get(),S=m.source,M=this.renderTarget;return S.isRenderTexture=!0,S.isGLTexture=!0,S.glTexture=M.texture,this},setIsSpriteTexture:function(m){return this.isSpriteTexture=m,this},fill:function(m,S,M,w,C,A){var P=this.camera,b=this.renderer;S===void 0&&(S=1),M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=this.width),A===void 0&&(A=this.height);var O=m>>16&255,I=m>>8&255,D=m&255,B=this.renderTarget;if(P.preRender(),B){B.bind(!0);var G=this.pipeline.manager.set(this.pipeline),z=b.width/B.width,X=b.height/B.height,K=B.height-(w+A);G.drawFillRect(M*z,K*X,C*z,A*X,d.getTintFromFloats(D/255,I/255,O/255,1),S),B.unbind(!0)}else{var Q=this.context;b.setContext(Q),Q.globalCompositeOperation="source-over",Q.fillStyle="rgba("+O+","+I+","+D+","+S+")",Q.fillRect(M,w,C,A),b.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var m=this.context,S=this.renderTarget;S?S.clear():m&&(m.save(),m.setTransform(1,0,0,1,0,0),m.clearRect(0,0,this.width,this.height),m.restore()),this.dirty=!1}return this},stamp:function(m,S,M,w,C){M===void 0&&(M=0),w===void 0&&(w=0);var A=u(C,"alpha",1),P=u(C,"tint",16777215),b=u(C,"angle",0),O=u(C,"rotation",0),I=u(C,"scale",1),D=u(C,"scaleX",I),B=u(C,"scaleY",I),G=u(C,"originX",.5),z=u(C,"originY",.5),X=u(C,"blendMode",0),K=u(C,"erase",!1),Q=u(C,"skipBatch",!1),tt=this.manager.resetStamp(A,P);return tt.setAngle(0),b!==0?tt.setAngle(b):O!==0&&tt.setRotation(O),tt.setScale(D,B),tt.setTexture(m,S),tt.setOrigin(G,z),tt.setBlendMode(X),K&&(this._eraseMode=!0),Q?this.batchGameObject(tt,M,w):this.draw(tt,M,w),K&&(this._eraseMode=!1),this},erase:function(m,S,M){return this._eraseMode=!0,this.draw(m,S,M),this._eraseMode=!1,this},draw:function(m,S,M,w,C){return this.beginDraw(),this.batchDraw(m,S,M,w,C),this.endDraw(),this},drawFrame:function(m,S,M,w,C,A){return this.beginDraw(),this.batchDrawFrame(m,S,M,w,C,A),this.endDraw(),this},repeat:function(m,S,M,w,C,A,P,b,O){if(M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=this.width),A===void 0&&(A=this.height),P===void 0&&(P=1),b===void 0&&(b=16777215),O===void 0&&(O=!1),m instanceof n?S=m:S=this.manager.getFrame(m,S),!S)return this;var I=this.manager.resetStamp(P,b);I.setFrame(S),I.setOrigin(0);var D=S.width,B=S.height;C=Math.floor(C),A=Math.floor(A);var G=Math.ceil(C/D),z=Math.ceil(A/B),X=G*D-C,K=z*B-A;X>0&&(X=D-X),K>0&&(K=B-K),M<0&&(G+=Math.ceil(Math.abs(M)/D)),w<0&&(z+=Math.ceil(Math.abs(w)/B));var Q=M,tt=w,Y=!1,Z=this.manager.stampCrop.setTo(0,0,D,B);O||this.beginDraw();for(var U=0;U0&&H===G-1&&(Y=!0,Z.width=X),K>0&&U===z-1&&(Y=!0,Z.height=K),Y&&I.setCrop(Z),this.batchGameObject(I,Q,tt),I.isCropped=!1,Z.setTo(0,0,D,B),Q+=D}Q=M,tt+=B}return O||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var m=this.camera,S=this.renderer,M=this.renderTarget;m.preRender(),M?S.beginCapture(M.width,M.height):S.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(m,S,M,w,C){return Array.isArray(m)||(m=[m]),this.batchList(m,S,M,w,C),this},batchDrawFrame:function(m,S,M,w,C,A){M===void 0&&(M=0),w===void 0&&(w=0),C===void 0&&(C=1),A===void 0&&(A=16777215);var P=this.manager.getFrame(m,S);return P&&(this.renderTarget?this.pipeline.batchTextureFrame(P,M,w,A,C,this.camera.matrix,null):this.batchTextureFrame(P,M,w,C,A)),this},endDraw:function(m){if(m===void 0&&(m=this._eraseMode),this.isDrawing){var S=this.renderer,M=this.renderTarget;if(M){var w=S.endCapture(),C=S.pipelines.setUtility();C.blitFrame(w,M,1,!1,!1,m,this.isSpriteTexture),S.resetScissor(),S.resetViewport()}else S.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(m,S,M,w,C){var A=m.length;if(A!==0)for(var P=0;P0&&O.height>0&&b.drawImage(I,O.x,O.y,O.width,O.height,S,M,O.width,O.height),b.restore()}},snapshotArea:function(m,S,M,w,C,A,P){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,C,!1,m,S,M,w,A,P):this.renderer.snapshotCanvas(this.canvas,C,!1,m,S,M,w,A,P),this},snapshot:function(m,S,M){return this.snapshotArea(0,0,this.width,this.height,m,S,M)},snapshotPixel:function(m,S,M){return this.snapshotArea(m,S,1,1,M,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(m,S,M,w){var C=this.manager.resetStamp();C.setTexture(this),C.setOrigin(0),C.renderWebGL(m,C,M,w)},renderCanvas:function(){},destroy:function(){var m=this.manager.stamp;m&&m.texture===this&&this.manager.resetStamp(),c.prototype.destroy.call(this),h.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});s.exports=v},4327:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(45319),h=e(79291),a=new r({initialize:function(n,u,f,o,c,d,v){this.texture=n,this.name=u,this.source=n.source[f],this.sourceIndex=f,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(d,v,o,c)},setSize:function(l,n,u,f){u===void 0&&(u=0),f===void 0&&(f=0),this.cutX=u,this.cutY=f,this.cutWidth=l,this.cutHeight=n,this.width=l,this.height=n,this.halfWidth=Math.floor(l*.5),this.halfHeight=Math.floor(n*.5),this.centerX=Math.floor(l/2),this.centerY=Math.floor(n/2);var o=this.data,c=o.cut;c.x=u,c.y=f,c.w=l,c.h=n,c.r=u+l,c.b=f+n,o.sourceSize.w=l,o.sourceSize.h=n,o.spriteSourceSize.w=l,o.spriteSourceSize.h=n,o.radius=.5*Math.sqrt(l*l+n*n);var d=o.drawImage;return d.x=u,d.y=f,d.width=l,d.height=n,this.updateUVs()},setTrim:function(l,n,u,f,o,c){var d=this.data,v=d.spriteSourceSize;return d.trim=!0,d.sourceSize.w=l,d.sourceSize.h=n,v.x=u,v.y=f,v.w=o,v.h=c,v.r=u+o,v.b=f+c,this.x=u,this.y=f,this.width=o,this.height=c,this.halfWidth=o*.5,this.halfHeight=c*.5,this.centerX=Math.floor(o/2),this.centerY=Math.floor(c/2),this.updateUVs()},setScale9:function(l,n,u,f){var o=this.data;return o.scale9=!0,o.is3Slice=n===0&&f===this.height,o.scale9Borders.x=l,o.scale9Borders.y=n,o.scale9Borders.w=u,o.scale9Borders.h=f,this},setCropUVs:function(l,n,u,f,o,c,d){var v=this.cutX,m=this.cutY,S=this.cutWidth,M=this.cutHeight,w=this.realWidth,C=this.realHeight;n=p(n,0,w),u=p(u,0,C),f=p(f,0,w-n),o=p(o,0,C-u);var A=v+n,P=m+u,b=f,O=o,I=this.data;if(I.trim){var D=I.spriteSourceSize;f=p(f,0,S-n),o=p(o,0,M-u);var B=n+f,G=u+o,z=!(D.rB||D.y>G);if(z){var X=Math.max(D.x,n),K=Math.max(D.y,u),Q=Math.min(D.r,B)-X,tt=Math.min(D.b,G)-K;b=Q,O=tt,c?A=v+(S-(X-D.x)-Q):A=v+(X-D.x),d?P=m+(M-(K-D.y)-tt):P=m+(K-D.y),n=X,u=K,f=Q,o=tt}else A=0,P=0,b=0,O=0}else c&&(A=v+(S-n-f)),d&&(P=m+(M-u-o));var Y=this.source.width,Z=this.source.height;return l.u0=Math.max(0,A/Y),l.v0=Math.max(0,P/Z),l.u1=Math.min(1,(A+b)/Y),l.v1=Math.min(1,(P+O)/Z),l.x=n,l.y=u,l.cx=A,l.cy=P,l.cw=b,l.ch=O,l.width=f,l.height=o,l.flipX=c,l.flipY=d,l},updateCropUVs:function(l,n,u){return this.setCropUVs(l,l.x,l.y,l.width,l.height,n,u)},setUVs:function(l,n,u,f,o,c){var d=this.data.drawImage;return d.width=l,d.height=n,this.u0=u,this.v0=f,this.u1=o,this.v1=c,this},updateUVs:function(){var l=this.cutX,n=this.cutY,u=this.cutWidth,f=this.cutHeight,o=this.data.drawImage;o.width=u,o.height=f;var c=this.source.width,d=this.source.height;return this.u0=l/c,this.v0=n/d,this.u1=(l+u)/c,this.v1=(n+f)/d,this},updateUVsInverted:function(){var l=this.source.width,n=this.source.height;return this.u0=(this.cutX+this.cutHeight)/l,this.v0=this.cutY/n,this.u1=this.cutX/l,this.v1=(this.cutY+this.cutWidth)/n,this},clone:function(){var l=new a(this.texture,this.name,this.sourceIndex);return l.cutX=this.cutX,l.cutY=this.cutY,l.cutWidth=this.cutWidth,l.cutHeight=this.cutHeight,l.x=this.x,l.y=this.y,l.width=this.width,l.height=this.height,l.halfWidth=this.halfWidth,l.halfHeight=this.halfHeight,l.centerX=this.centerX,l.centerY=this.centerY,l.rotated=this.rotated,l.data=h(!0,l.data,this.data),l.updateUVs(),l},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}}});s.exports=a},79237:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(4327),h=e(11876),a='Texture "%s" has no frame "%s"',l=new r({initialize:function(u,f,o,c,d){Array.isArray(o)||(o=[o]),this.manager=u,this.key=f,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var v=0;vc&&(c=m.cutX+m.cutWidth),m.cutY+m.cutHeight>d&&(d=m.cutY+m.cutHeight)}return{x:f,y:o,width:c-f,height:d-o}},getFrameNames:function(n){n===void 0&&(n=!1);var u=Object.keys(this.frames);if(!n){var f=u.indexOf("__BASE");f!==-1&&u.splice(f,1)}return u},getSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n];return u?u.source.image:(console.warn(a,this.key,n),this.frames.__BASE.source.image)},getDataSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n],f;return u?f=u.sourceIndex:(console.warn(a,this.key,n),f=this.frames.__BASE.sourceIndex),this.dataSource[f].image},setDataSource:function(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(57382),h=e(83419),a=e(40987),l=e(8054),n=e(81320),u=e(50792),f=e(69442),o=e(4327),c=e(8443),d=e(99584),v=e(35154),m=e(88571),S=e(41212),M=e(61309),w=e(87841),C=e(79237),A=new h({Extends:u,initialize:function(b){u.call(this),this.game=b,this.name="TextureManager",this.list={},this._tempCanvas=r.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new w,this.silentWarnings=!1,b.events.once(c.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(f.LOAD,this.updatePending,this),this.on(f.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(c.DESTROY,this.destroy,this),this.game.events.once(c.SYSTEM_READY,function(b){this.stamp=new m(b).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(f.LOAD),this.off(f.ERROR),this.emit(f.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 b=P.key;return this.list.hasOwnProperty(b)&&(P.destroy(),this.emit(f.REMOVE,b),this.emit(f.REMOVE_KEY+b)),this},removeKey:function(P){return this.list.hasOwnProperty(P)&&delete this.list[P],this},addBase64:function(P,b){if(this.checkKey(P)){var O=this,I=new Image;I.onerror=function(){O.emit(f.ERROR,P)},I.onload=function(){var D=O.create(P,I);M.Image(D,0),O.emit(f.ADD,P,D),O.emit(f.ADD_KEY+P,D),O.emit(f.LOAD,P,D)},I.src=b}return this},getBase64:function(P,b,O,I){O===void 0&&(O="image/png"),I===void 0&&(I=.92);var D="",B=this.getFrame(P,b);if(B&&(B.source.isRenderTexture||B.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(B){var G=B.canvasData,z=r.create2D(this,G.width,G.height),X=z.getContext("2d",{willReadFrequently:!0});G.width>0&&G.height>0&&X.drawImage(B.source.image,G.x,G.y,G.width,G.height,0,0,G.width,G.height),D=z.toDataURL(O,I),r.remove(z)}return D},addImage:function(P,b,O){var I=null;return this.checkKey(P)&&(I=this.create(P,b),M.Image(I,0),O&&I.setDataSource(O),this.emit(f.ADD,P,I),this.emit(f.ADD_KEY+P,I)),I},addGLTexture:function(P,b){var O=null;if(this.checkKey(P)){var I=b.width,D=b.height;O=this.create(P,b,I,D),O.add("__BASE",0,0,0,I,D),this.emit(f.ADD,P,O),this.emit(f.ADD_KEY+P,O)}return O},addCompressedTexture:function(P,b,O){var I=null;if(this.checkKey(P)){if(I=this.create(P,b),I.add("__BASE",0,0,0,b.width,b.height),O){var D=function(G,z,X){Array.isArray(X.textures)||Array.isArray(X.frames)?M.JSONArray(G,z,X):M.JSONHash(G,z,X)};if(Array.isArray(O))for(var B=0;B=B.x&&P=B.y&&b=B.x&&P=B.y&&b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(27919),p=e(83419),h=e(50030),a=e(29795),l=e(82751),n=new p({initialize:function(f,o,c,d,v){v===void 0&&(v=!1);var m=f.manager.game;this.renderer=m.renderer,this.texture=f,this.source=o,this.image=o.compressed?null:o,this.compressionAlgorithm=o.compressed?o.format:null,this.resolution=1,this.width=c||o.naturalWidth||o.videoWidth||o.width||0,this.height=d||o.naturalHeight||o.videoHeight||o.height||0,this.scaleMode=a.DEFAULT,this.isCanvas=o instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&o instanceof HTMLVideoElement,this.isRenderTexture=o.type==="RenderTexture"||o.type==="DynamicTexture",this.isGLTexture=o instanceof l,this.isPowerOf2=h(this.width,this.height),this.glTexture=null,this.flipY=v,this.init(m)},init:function(u){var f=this.renderer;if(f){var o=this.source;if(f.gl){var c=this.image,d=this.flipY,v=this.width,m=this.height,S=this.scaleMode;this.isCanvas?this.glTexture=f.createCanvasTexture(c,!1,d):this.isVideo?this.glTexture=f.createVideoTexture(c,!1,d):this.isRenderTexture?this.glTexture=f.createTextureFromSource(null,v,m,S):this.isGLTexture?this.glTexture=o:this.compressionAlgorithm?this.glTexture=f.createTextureFromSource(o,void 0,void 0,S):o instanceof Uint8Array?this.glTexture=f.createUint8ArrayTexture(o,v,m,S):this.glTexture=f.createTextureFromSource(c,v,m,S)}else this.isRenderTexture&&(this.image=o.canvas)}u.config.antialias||this.setFilter(1)},setFilter:function(u){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,u),this.scaleMode=u},setFlipY:function(u){return u===void 0&&(u=!0),u===this.flipY?this:(this.flipY=u,this.update(),this)},update:function(){var u=this.renderer,f=this.image,o=this.flipY,c=u.gl;c&&this.isCanvas?u.updateCanvasTexture(f,this.glTexture,o):c&&this.isVideo&&u.updateVideoTexture(f,this.glTexture,o)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&r.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});s.exports=n},19673:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={LINEAR:0,NEAREST:1};s.exports=y},44538:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addtexture"},63486:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="addtexture-"},94851:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="onerror"},29099:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="onload"},8678:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="ready"},86415:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removetexture"},30879:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="removetexture-"},69442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ADD:e(44538),ADD_KEY:e(63486),ERROR:e(94851),LOAD:e(29099),READY:e(8678),REMOVE:e(86415),REMOVE_KEY:e(30879)}},27458:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(19673),h={CanvasTexture:e(57382),DynamicTexture:e(81320),Events:e(69442),FilterMode:p,Frame:e(4327),Parsers:e(61309),Texture:e(79237),TextureManager:e(17130),TextureSource:e(11876)};h=r(!1,h,p),s.exports=h},89905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(!p.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var h=e.source[r];e.add("__BASE",r,0,0,h.width,h.height);for(var a=p.getElementsByTagName("SubTexture"),l,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.source[r];return e.add("__BASE",r,0,0,p.width,p.height),e};s.exports=y},4832:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.source[r];return e.add("__BASE",r,0,0,p.width,p.height),e};s.exports=y},78566:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a,l){if(!l.frames&&!l.textures){console.warn("Invalid Texture Atlas JSON Array");return}var n=h.source[a];h.add("__BASE",a,0,0,n.width,n.height);for(var u=Array.isArray(l.textures)?l.textures[a].frames:l.frames,f,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a,l){if(!l.frames){console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object");return}var n=h.source[a];h.add("__BASE",a,0,0,n.width,n.height);var u=l.frames,f;for(var o in u)if(u.hasOwnProperty(o)){var c=u[o];if(f=h.add(o,a,c.frame.x,c.frame.y,c.frame.w,c.frame.h),!f){console.warn("Invalid atlas json, frame already exists: "+o);continue}c.trimmed&&f.setTrim(c.sourceSize.w,c.sourceSize.h,c.spriteSourceSize.x,c.spriteSourceSize.y,c.spriteSourceSize.w,c.spriteSourceSize.h),c.rotated&&(f.rotated=!0,f.updateUVsInverted());var d=c.anchor||c.pivot;d&&(f.customPivot=!0,f.pivotX=d.x,f.pivotY=d.y),c.scale9Borders&&f.setScale9(c.scale9Borders.x,c.scale9Borders.y,c.scale9Borders.w,c.scale9Borders.h),f.customData=r(c)}for(var v in l)v!=="frames"&&(Array.isArray(l[v])?h.customData[v]=l[v].slice(0):h.customData[v]=l[v]);return h};s.exports=p},31403:s=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=[171,75,84,88,32,49,49,187,13,10,26,10],p,h=new Uint8Array(e,0,12);for(p=0;p>1),w=Math.max(1,w>>1),S+=C}return{mipmaps:m,width:o,height:c,internalFormat:f,compressed:!0,generateMipmap:!1}};s.exports=y},82038:s=>{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(b,O,I,D,B,G,z){return z===void 0&&(z=16),Math.floor((b+I)/B)*Math.floor((O+D)/G)*z}function e(b,O){return b=Math.max(b,16),O=Math.max(O,8),b*O/4}function r(b,O){return b=Math.max(b,8),O=Math.max(O,8),b*O/2}function p(b,O){return Math.ceil(b/4)*Math.ceil(O/4)*16}function h(b,O){return y(b,O,3,3,4,4,8)}function a(b,O){return y(b,O,3,3,4,4)}function l(b,O){return y(b,O,4,3,5,4)}function n(b,O){return y(b,O,4,4,5,5)}function u(b,O){return y(b,O,5,4,6,5)}function f(b,O){return y(b,O,5,5,6,6)}function o(b,O){return y(b,O,7,4,8,5)}function c(b,O){return y(b,O,7,5,8,6)}function d(b,O){return y(b,O,7,7,8,8)}function v(b,O){return y(b,O,9,4,10,5)}function m(b,O){return y(b,O,9,5,10,6)}function S(b,O){return y(b,O,9,7,10,8)}function M(b,O){return y(b,O,9,9,10,10)}function w(b,O){return y(b,O,11,9,12,10)}function C(b,O){return y(b,O,11,11,12,12)}var A={0:{sizeFunc:e,glFormat:[35841]},1:{sizeFunc:e,glFormat:[35843]},2:{sizeFunc:r,glFormat:[35840]},3:{sizeFunc:r,glFormat:[35842]},6:{sizeFunc:h,glFormat:[36196]},7:{sizeFunc:h,glFormat:[33776,35916]},8:{sizeFunc:a,glFormat:[33777,35917]},9:{sizeFunc:a,glFormat:[33778,35918]},11:{sizeFunc:a,glFormat:[33779,35919]},14:{sizeFunc:p,glFormat:[36494,36495]},15:{sizeFunc:p,glFormat:[36492,36493]},22:{sizeFunc:h,glFormat:[37492,37493]},23:{sizeFunc:a,glFormat:[37496,37497]},24:{sizeFunc:h,glFormat:[37494,37495]},25:{sizeFunc:h,glFormat:[37488]},26:{sizeFunc:a,glFormat:[37490]},27:{sizeFunc:a,glFormat:[37808,37840]},28:{sizeFunc:l,glFormat:[37809,37841]},29:{sizeFunc:n,glFormat:[37810,37842]},30:{sizeFunc:u,glFormat:[37811,37843]},31:{sizeFunc:f,glFormat:[37812,37844]},32:{sizeFunc:o,glFormat:[37813,37845]},33:{sizeFunc:c,glFormat:[37814,37846]},34:{sizeFunc:d,glFormat:[37815,37847]},35:{sizeFunc:v,glFormat:[37816,37848]},36:{sizeFunc:m,glFormat:[37817,37849]},37:{sizeFunc:S,glFormat:[37818,37850]},38:{sizeFunc:M,glFormat:[37819,37851]},39:{sizeFunc:w,glFormat:[37820,37852]},40:{sizeFunc:C,glFormat:[37821,37853]}},P=function(b){for(var O=new Uint32Array(b,0,13),I=O[0],D=I===55727696,B=D?O[2]:O[3],G=O[4],z=A[B].glFormat[G],X=A[B].sizeFunc,K=O[11],Q=O[7],tt=O[6],Y=52+O[12],Z=new Uint8Array(b,Y),U=new Array(K),H=0,J=Q,_=tt,q=0;q>1),_=Math.max(1,_>>1),H+=at}return{mipmaps:U,width:Q,height:tt,internalFormat:z,compressed:!0,generateMipmap:!1}};s.exports=P},75549:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l,n,u,f,o){var c=r(o,"frameWidth",null),d=r(o,"frameHeight",c);if(c===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var v=h.source[a];h.add("__BASE",a,0,0,v.width,v.height);var m=r(o,"startFrame",0),S=r(o,"endFrame",-1),M=r(o,"margin",0),w=r(o,"spacing",0),C=Math.floor((u-M+w)/(c+w)),A=Math.floor((f-M+w)/(d+w)),P=C*A;P===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",h.key),(m>P||m<-P)&&(m=0),m<0&&(m=P+m),(S===-1||S>P||Su&&(I=z-u),X>f&&(D=X-f),G>=m&&G<=S&&(h.add(B,a,l+b,n+O,c-I,d-D),B++),b+=c+w,b+c>u&&(b=M,O+=d+w)}return h};s.exports=p},47534:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l){var n=r(l,"frameWidth",null),u=r(l,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var f=h.source[0];h.add("__BASE",0,0,0,f.width,f.height),r(l,"startFrame",0),r(l,"endFrame",-1);for(var o=r(l,"margin",0),c=r(l,"spacing",0),d=a.cutX,v=a.cutY,m=a.cutWidth,S=a.cutHeight,M=a.realWidth,w=a.realHeight,C=Math.floor((M-o+c)/(n+c)),A=Math.floor((w-o+c)/(u+c)),P=a.x,b=n-P,O=n-(M-m-P),I=a.y,D=u-I,B=u-(w-S-I),G,z=o,X=o,K=0,Q=0,tt=0;tt{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=0,e=function(p,h,a,l){var n=y-l.y-l.height;p.add(a,h,l.x,n,l.width,l.height)},r=function(p,h,a){var l=p.source[h];p.add("__BASE",h,0,0,l.width,l.height),y=l.height;for(var n=a.split(` +`),u=/^[ ]*(- )*(\w+)+[: ]+(.*)/,f="",o="",c={x:0,y:0,width:0,height:0},d=0;d{/** + * @author Ben Richards + * @copyright 2024 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(50030),p=function(f){for(var o=f.mipmaps,c=1;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AtlasXML:e(89905),Canvas:e(72893),Image:e(4832),JSONArray:e(78566),JSONHash:e(39711),KTXParser:e(31403),PVRParser:e(82038),SpriteSheet:e(75549),SpriteSheetFromAtlas:e(47534),UnityYAML:e(86147)}},80341:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a,l,n,u,f,o,c){(n===void 0||n<=0)&&(n=32),(u===void 0||u<=0)&&(u=32),f===void 0&&(f=0),o===void 0&&(o=0),this.name=a,this.firstgid=l|0,this.imageWidth=n|0,this.imageHeight=u|0,this.imageMargin=f|0,this.imageSpacing=o|0,this.properties=c||{},this.images=[],this.total=0},containsImageIndex:function(h){return h>=this.firstgid&&h{/** + * @author Richard Davey + * @copyright 2021 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=new r({initialize:function(a){if(this.gids=[],a!==void 0)for(var l=0;l{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(87010),h=e(46177),a=e(49075),l=function(n,u,f,o,c,d,v,m){f===void 0&&(f=32),o===void 0&&(o=32),c===void 0&&(c=10),d===void 0&&(d=10),m===void 0&&(m=!1);var S=null;if(Array.isArray(v)){var M=u!==void 0?u:"map";S=h(M,r.ARRAY_2D,v,f,o,m)}else if(u!==void 0){var w=n.cache.tilemap.get(u);w?S=h(u,w.format,w.data,f,o,m):console.warn("No map data found for key "+u)}return S===null&&(S=new p({tileWidth:f,tileHeight:o,width:c,height:d})),new a(n,S)};s.exports=l},23029:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(31401),h=e(91907),a=e(62644),l=e(93232),n=new r({Mixins:[p.AlphaSingle,p.Flip,p.Visible],initialize:function(f,o,c,d,v,m,S,M){this.layer=f,this.index=o,this.x=c,this.y=d,this.width=v,this.height=m,this.right,this.bottom,this.baseWidth=S!==void 0?S:v,this.baseHeight=M!==void 0?M:m,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.tintFill=!1,this.physics={}},containsPoint:function(u,f){return!(uthis.right||f>this.bottom)},copy:function(u){return this.index=u.index,this.alpha=u.alpha,this.properties=a(u.properties),this.visible=u.visible,this.setFlip(u.flipX,u.flipY),this.tint=u.tint,this.rotation=u.rotation,this.collideUp=u.collideUp,this.collideDown=u.collideDown,this.collideLeft=u.collideLeft,this.collideRight=u.collideRight,this.collisionCallback=u.collisionCallback,this.collisionCallbackContext=u.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(u){var f=this.tilemapLayer;if(f){var o=f.tileToWorldXY(this.x,this.y,void 0,u);return o.x}return this.x*this.baseWidth},getRight:function(u){var f=this.tilemapLayer;return f?this.getLeft(u)+this.width*f.scaleX:this.getLeft(u)+this.width},getTop:function(u){var f=this.tilemapLayer;if(f){var o=f.tileToWorldXY(this.x,this.y,void 0,u);return o.y}return this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(u){var f=this.tilemapLayer;return f?this.getTop(u)+this.height*f.scaleY:this.getTop(u)+this.height},getBounds:function(u,f){return f===void 0&&(f=new l),f.x=this.getLeft(u),f.y=this.getTop(u),f.width=this.getRight(u)-f.x,f.height=this.getBottom(u)-f.y,f},getCenterX:function(u){return(this.getLeft(u)+this.getRight(u))/2},getCenterY:function(u){return(this.getTop(u)+this.getBottom(u))/2},intersects:function(u,f,o,c){return!(o<=this.pixelX||c<=this.pixelY||u>=this.right||f>=this.bottom)},isInteresting:function(u,f){return u&&f?this.canCollide||this.hasInterestingFace:u?this.collides:f?this.hasInterestingFace:!1},resetCollision:function(u){if(u===void 0&&(u=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,u){var f=this.tilemapLayer;f&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(u,f,o,c,d){if(f===void 0&&(f=u),o===void 0&&(o=u),c===void 0&&(c=u),d===void 0&&(d=!0),this.collideLeft=u,this.collideRight=f,this.collideUp=o,this.collideDown=c,this.faceLeft=u,this.faceRight=f,this.faceTop=o,this.faceBottom=c,d){var v=this.tilemapLayer;v&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},setCollisionCallback:function(u,f){return u===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=u,this.collisionCallbackContext=f),this},setSize:function(u,f,o,c){return u!==void 0&&(this.width=u),f!==void 0&&(this.height=f),o!==void 0&&(this.baseWidth=o),c!==void 0&&(this.baseHeight=c),this.updatePixelXY(),this},updatePixelXY:function(){var u=this.layer.orientation;if(u===h.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(u===h.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(u===h.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(u===h.HEXAGONAL){var f=this.layer.staggerAxis,o=this.layer.staggerIndex,c=this.layer.hexSideLength,d,v;f==="y"?(v=(this.baseHeight-c)/2+c,o==="odd"?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*v):f==="x"&&(d=(this.baseWidth-c)/2+c,this.pixelX=this.x*d,o==="odd"?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback!==void 0}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var u=this.layer.tilemapLayer;if(u){var f=u.gidMap[this.index];if(f)return f}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var u=this.tilemapLayer;return u?u.tilemap:null}}});s.exports=n},49075:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(84101),p=e(83419),h=e(39506),a=e(80341),l=e(95540),n=e(14977),u=e(27462),f=e(91907),o=e(36305),c=e(19133),d=e(68287),v=e(23029),m=e(81086),S=e(20442),M=e(33629),w=new p({initialize:function(A,P){this.scene=A,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 b=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(b),WorldToTileX:m.GetWorldToTileXFunction(b),WorldToTileY:m.GetWorldToTileYFunction(b),TileToWorldXY:m.GetTileToWorldXYFunction(b),TileToWorldX:m.GetTileToWorldXFunction(b),TileToWorldY:m.GetTileToWorldYFunction(b),GetTileCorners:m.GetTileCornersFunction(b)}},setRenderOrder:function(C){var A=["right-down","left-down","right-up","left-up"];return typeof C=="number"&&(C=A[C]),A.indexOf(C)>-1&&(this.renderOrder=C),this},addTilesetImage:function(C,A,P,b,O,I,D,B){if(C===void 0)return null;A==null&&(A=C);var G=this.scene.sys.textures;if(!G.exists(A))return console.warn('Texture key "%s" not found',A),null;var z=G.get(A),X=this.getTilesetIndex(C);if(X===null&&this.format===a.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',C,this.tilesets),null;var K=this.tilesets[X];return K?(K.setTileSize(P,b),K.setSpacing(O,I),K.setImage(z),K):(P===void 0&&(P=this.tileWidth),b===void 0&&(b=this.tileHeight),O===void 0&&(O=0),I===void 0&&(I=0),D===void 0&&(D=0),B===void 0&&(B={x:0,y:0}),K=new M(C,D,P,b,O,I,void 0,void 0,B),K.setImage(z),this.tilesets.push(K),this.tiles=r(this),K)},copy:function(C,A,P,b,O,I,D,B){return B=this.getLayer(B),B!==null?(m.Copy(C,A,P,b,O,I,D,B),this):null},createBlankLayer:function(C,A,P,b,O,I,D,B){P===void 0&&(P=0),b===void 0&&(b=0),O===void 0&&(O=this.width),I===void 0&&(I=this.height),D===void 0&&(D=this.tileWidth),B===void 0&&(B=this.tileHeight);var G=this.getLayerIndex(C);if(G!==null)return console.warn("Invalid Tilemap Layer ID: "+C),null;for(var z=new n({name:C,tileWidth:D,tileHeight:B,width:O,height:I,orientation:this.orientation}),X,K=0;K-1&&this.putTileAt(A,I.x,I.y,P,I.tilemapLayer)}return b},removeTileAt:function(C,A,P,b,O){return P===void 0&&(P=!0),b===void 0&&(b=!0),O=this.getLayer(O),O===null?null:m.RemoveTileAt(C,A,P,b,O)},removeTileAtWorldXY:function(C,A,P,b,O,I){return P===void 0&&(P=!0),b===void 0&&(b=!0),I=this.getLayer(I),I===null?null:m.RemoveTileAtWorldXY(C,A,P,b,O,I)},renderDebug:function(C,A,P){return P=this.getLayer(P),P===null?null:(this.orientation===f.ORTHOGONAL&&m.RenderDebug(C,A,P),this)},renderDebugFull:function(C,A){for(var P=this.layers,b=0;b{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(44603),p=e(31989);r.register("tilemap",function(h){var a=h!==void 0?h:{};return p(this.scene,a.key,a.tileWidth,a.tileHeight,a.width,a.height,a.data,a.insertNull)})},46029:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(39429),p=e(31989);r.register("tilemap",function(h,a,l,n,u,f,o){return h===null&&(h=void 0),a===null&&(a=void 0),l===null&&(l=void 0),n===null&&(n=void 0),u===null&&(u=void 0),p(this.scene,h,a,l,n,u,f,o)})},20442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(78389),h=e(31401),a=e(95643),l=e(81086),n=e(19218),u=e(26099),f=new r({Extends:a,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.Transform,h.Visible,h.ScrollFactor,p,n],initialize:function(c,d,v,m,S,M){a.call(this,c,"TilemapLayer"),this.isTilemap=!0,this.tilemap=d,this.layerIndex=v,this.layer=d.layers[v],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=l.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new u,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(m),this.setAlpha(this.layer.alpha),this.setPosition(S,M),this.setOrigin(0,0),this.setSize(d.tileWidth*this.layer.width,d.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(o){var c=[],d=[],v=this.tilemap;Array.isArray(o)||(o=[o]);for(var m=0;m=0&&o<4&&(this._renderOrder=o),this},calculateFacesAt:function(o,c){return l.CalculateFacesAt(o,c,this.layer),this},calculateFacesWithin:function(o,c,d,v){return l.CalculateFacesWithin(o,c,d,v,this.layer),this},createFromTiles:function(o,c,d,v,m){return l.CreateFromTiles(o,c,d,v,m,this.layer)},cull:function(o){return this.cullCallback(this.layer,o,this.culledTiles,this._renderOrder)},copy:function(o,c,d,v,m,S,M){return l.Copy(o,c,d,v,m,S,M,this.layer),this},fill:function(o,c,d,v,m,S){return l.Fill(o,c,d,v,m,S,this.layer),this},filterTiles:function(o,c,d,v,m,S,M){return l.FilterTiles(o,c,d,v,m,S,M,this.layer)},findByIndex:function(o,c,d){return l.FindByIndex(o,c,d,this.layer)},findTile:function(o,c,d,v,m,S,M){return l.FindTile(o,c,d,v,m,S,M,this.layer)},forEachTile:function(o,c,d,v,m,S,M){return l.ForEachTile(o,c,d,v,m,S,M,this.layer),this},setTint:function(o,c,d,v,m,S){o===void 0&&(o=16777215);var M=function(w){w.tint=o,w.tintFill=!1};return this.forEachTile(M,this,c,d,v,m,S)},setTintFill:function(o,c,d,v,m,S){o===void 0&&(o=16777215);var M=function(w){w.tint=o,w.tintFill=!0};return this.forEachTile(M,this,c,d,v,m,S)},getTileAt:function(o,c,d){return l.GetTileAt(o,c,d,this.layer)},getTileAtWorldXY:function(o,c,d,v){return l.GetTileAtWorldXY(o,c,d,v,this.layer)},getIsoTileAtWorldXY:function(o,c,d,v,m){d===void 0&&(d=!0);var S=this.tempVec;return l.IsometricWorldToTileXY(o,c,!0,S,m,this.layer,d),this.getTileAt(S.x,S.y,v)},getTilesWithin:function(o,c,d,v,m){return l.GetTilesWithin(o,c,d,v,m,this.layer)},getTilesWithinShape:function(o,c,d){return l.GetTilesWithinShape(o,c,d,this.layer)},getTilesWithinWorldXY:function(o,c,d,v,m,S){return l.GetTilesWithinWorldXY(o,c,d,v,m,S,this.layer)},hasTileAt:function(o,c){return l.HasTileAt(o,c,this.layer)},hasTileAtWorldXY:function(o,c,d){return l.HasTileAtWorldXY(o,c,d,this.layer)},putTileAt:function(o,c,d,v){return l.PutTileAt(o,c,d,v,this.layer)},putTileAtWorldXY:function(o,c,d,v,m){return l.PutTileAtWorldXY(o,c,d,v,m,this.layer)},putTilesAt:function(o,c,d,v){return l.PutTilesAt(o,c,d,v,this.layer),this},randomize:function(o,c,d,v,m){return l.Randomize(o,c,d,v,m,this.layer),this},removeTileAt:function(o,c,d,v){return l.RemoveTileAt(o,c,d,v,this.layer)},removeTileAtWorldXY:function(o,c,d,v,m){return l.RemoveTileAtWorldXY(o,c,d,v,m,this.layer)},renderDebug:function(o,c){return l.RenderDebug(o,c,this.layer),this},replaceByIndex:function(o,c,d,v,m,S){return l.ReplaceByIndex(o,c,d,v,m,S,this.layer),this},setSkipCull:function(o){return o===void 0&&(o=!0),this.skipCull=o,this},setCullPadding:function(o,c){return o===void 0&&(o=1),c===void 0&&(c=1),this.cullPaddingX=o,this.cullPaddingY=c,this},setCollision:function(o,c,d,v){return l.SetCollision(o,c,d,this.layer,v),this},setCollisionBetween:function(o,c,d,v){return l.SetCollisionBetween(o,c,d,v,this.layer),this},setCollisionByProperty:function(o,c,d){return l.SetCollisionByProperty(o,c,d,this.layer),this},setCollisionByExclusion:function(o,c,d){return l.SetCollisionByExclusion(o,c,d,this.layer),this},setCollisionFromCollisionGroup:function(o,c){return l.SetCollisionFromCollisionGroup(o,c,this.layer),this},setTileIndexCallback:function(o,c,d){return l.SetTileIndexCallback(o,c,d,this.layer),this},setTileLocationCallback:function(o,c,d,v,m,S){return l.SetTileLocationCallback(o,c,d,v,m,S,this.layer),this},shuffle:function(o,c,d,v){return l.Shuffle(o,c,d,v,this.layer),this},swapByIndex:function(o,c,d,v,m,S){return l.SwapByIndex(o,c,d,v,m,S,this.layer),this},tileToWorldX:function(o,c){return this.tilemap.tileToWorldX(o,c,this)},tileToWorldY:function(o,c){return this.tilemap.tileToWorldY(o,c,this)},tileToWorldXY:function(o,c,d,v){return this.tilemap.tileToWorldXY(o,c,d,v,this)},getTileCorners:function(o,c,d){return this.tilemap.getTileCorners(o,c,d,this)},weightedRandomize:function(o,c,d,v,m){return l.WeightedRandomize(c,d,v,m,o,this.layer),this},worldToTileX:function(o,c,d){return this.tilemap.worldToTileX(o,c,d,this)},worldToTileY:function(o,c,d){return this.tilemap.worldToTileY(o,c,d,this)},worldToTileXY:function(o,c,d,v,m){return this.tilemap.worldToTileXY(o,c,d,v,m,this)},destroy:function(o){o===void 0&&(o=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),o&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],a.prototype.destroy.call(this))}});s.exports=f},16153:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61340),p=new r,h=new r,a=new r,l=function(n,u,f,o){var c=u.cull(f),d=c.length,v=f.alpha*u.alpha;if(!(d===0||v<=0)){var m=p,S=h,M=a;S.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),m.copyFrom(f.matrix);var w=n.currentContext,C=u.gidMap;w.save(),o?(m.multiplyWithOffset(o,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),S.e=u.x,S.f=u.y,m.multiply(S,M),M.copyToContext(w)):(S.e-=f.scrollX*u.scrollFactorX,S.f-=f.scrollY*u.scrollFactorY,S.copyToContext(w)),(!n.antialias||u.scaleX>1||u.scaleY>1)&&(w.imageSmoothingEnabled=!1);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(29747),p=r,h=r;p=e(99558),h=e(16153),s.exports={renderWebGL:p,renderCanvas:h}},99558:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70554),p=function(h,a,l){var n=a.cull(l),u=n.length,f=l.alpha*a.alpha;if(!(u===0||f<=0)){var o=a.gidMap,c=h.pipelines.set(a.pipeline,a),d=r.getTintAppendFloatAlpha,v=a.scrollFactorX,m=a.scrollFactorY,S=a.x,M=a.y,w=a.scaleX,C=a.scaleY;h.pipelines.preBatch(a);for(var A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(26099),h=new r({initialize:function(l,n,u,f,o,c,d,v,m){(u===void 0||u<=0)&&(u=32),(f===void 0||f<=0)&&(f=32),o===void 0&&(o=0),c===void 0&&(c=0),d===void 0&&(d={}),v===void 0&&(v={}),this.name=l,this.firstgid=n,this.tileWidth=u,this.tileHeight=f,this.tileMargin=o,this.tileSpacing=c,this.tileProperties=d,this.tileData=v,this.tileOffset=new p,m!==void 0&&this.tileOffset.set(m.x,m.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(a){return this.containsTileIndex(a)?this.tileProperties[a-this.firstgid]:null},getTileData:function(a){return this.containsTileIndex(a)?this.tileData[a-this.firstgid]:null},getTileCollisionGroup:function(a){var l=this.getTileData(a);return l&&l.objectgroup?l.objectgroup:null},containsTileIndex:function(a){return a>=this.firstgid&&an.width||l.height>n.height?this.updateTileData(l.width,l.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(a,l){return a!==void 0&&(this.tileWidth=a),l!==void 0&&(this.tileHeight=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(a,l){return a!==void 0&&(this.tileMargin=a),l!==void 0&&(this.tileSpacing=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=0);var f=(l-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),o=(a-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(f%1!==0||o%1!==0)&&console.warn("Image tile area not tile size multiple in: "+this.name),f=Math.floor(f),o=Math.floor(o),this.rows=f,this.columns=o,this.total=f*o,this.texCoordinates.length=0;for(var c=this.tileMargin+n,d=this.tileMargin+u,v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=function(h,a,l){var n=r(h,a,!0,l),u=r(h,a-1,!0,l),f=r(h,a+1,!0,l),o=r(h-1,a,!0,l),c=r(h+1,a,!0,l),d=n&&n.collides;return d&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),u&&u.collides&&(d&&(n.faceTop=!1),u.faceBottom=!d),f&&f.collides&&(d&&(n.faceBottom=!1),f.faceTop=!d),o&&o.collides&&(d&&(n.faceLeft=!1),o.faceRight=!d),c&&c.collides&&(d&&(n.faceRight=!1),c.faceLeft=!d),n&&!n.collides&&n.resetFaces(),n};s.exports=p},42573:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=e(7386),h=function(a,l,n,u,f){for(var o=null,c=null,d=null,v=null,m=p(a,l,n,u,null,f),S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=new r,h=function(a,l,n,u){var f=n.tilemapLayer,o=f.cullPaddingX,c=f.cullPaddingY,d=f.tilemap.tileToWorldXY(a,l,p,u,f);return d.x>u.worldView.x+f.scaleX*n.tileWidth*(-o-.5)&&d.xu.worldView.y+f.scaleY*n.tileHeight*(-c-1)&&d.y{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42573),p=e(7386),h=e(62991),a=e(23029),l=function(n,u,f,o,c,d,v,m){v===void 0&&(v=!0);var S=p(n,u,f,o,null,m),M=[];S.forEach(function(I){var D=new a(I.layer,I.index,I.x,I.y,I.width,I.height,I.baseWidth,I.baseHeight);D.copy(I),M.push(D)});for(var w=c-n,C=d-u,A=0;A{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62644),p=e(7386),h=e(27987),a=function(l,n,u,f,o,c){u||(u={}),Array.isArray(l)||(l=[l]);var d=c.tilemapLayer;f||(f=d.scene),o||(o=f.cameras.main);var v=c.width,m=c.height,S=p(0,0,v,m,null,c),M=[],w,C=function(O,I,D){for(var B=0;B{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(87841),p=e(63448),h=e(56583),a=new r,l=function(n,u){var f=n.tilemapLayer.tilemap,o=n.tilemapLayer,c=Math.floor(f.tileWidth*o.scaleX),d=Math.floor(f.tileHeight*o.scaleY),v=h(u.worldView.x-o.x,c,0,!0)-o.cullPaddingX,m=p(u.worldView.right-o.x,c,0,!0)+o.cullPaddingX,S=h(u.worldView.y-o.y,d,0,!0)-o.cullPaddingY,M=p(u.worldView.bottom-o.y,d,0,!0)+o.cullPaddingY;return a.setTo(v,S,m-v,M-S)};s.exports=l},30003:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19545),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return(f.skipCull||f.scrollFactorX!==1||f.scrollFactorY!==1)&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},35137:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(42573),h=e(20576),a=function(l,n,u,f,o,c,d){for(var v=d.collideIndexes.indexOf(l)!==-1,m=r(n,u,f,o,null,d),S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);return d.filter(h,a)};s.exports=p},52692:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=0),p===void 0&&(p=!1);var a=0,l,n,u;if(p){for(n=h.height-1;n>=0;n--)for(l=h.width-1;l>=0;l--)if(u=h.data[n][l],u&&u.index===e){if(a===r)return u;a+=1}}else for(n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);return d.find(h,a)||null};s.exports=p},97560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o,c){var d=r(l,n,u,f,o,c);d.forEach(h,a)};s.exports=p},43305:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(30003),h=e(9474),a=e(14018),l=e(29747),n=e(54503),u=function(f){return f===r.ORTHOGONAL?p:f===r.HEXAGONAL?h:f===r.STAGGERED?n:f===r.ISOMETRIC?a:l};s.exports=u},7423:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62991),p=function(h,a,l,n){if(l===void 0&&(l=!1),r(h,a,n)){var u=n.data[a][h]||null;return u?u.index===-1?l?u:null:u:null}else return null};s.exports=p},60540:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7423),p=e(26099),h=new p,a=function(l,n,u,f,o){return o.tilemapLayer.worldToTileXY(l,n,!0,h,f),r(h.x,h.y,u,o)};s.exports=a},55826:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n){var u=n.baseTileWidth,f=n.baseTileHeight,o=n.tilemapLayer,c=0,d=0;o&&(l||(l=o.scene.cameras.main),c=o.x+l.scrollX*(1-o.scrollFactorX),d=o.y+l.scrollY*(1-o.scrollFactorY),u*=o.scaleX,f*=o.scaleY);var v=c+h*u,m=d+a*f;return[new r(v,m),new r(v+u,m),new r(v+u,m+f),new r(v,m+f)]};s.exports=p},11758:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(27229),h=e(29747),a=e(55826),l=function(n){return n===r.ORTHOGONAL?a:n===r.ISOMETRIC?h:n===r.HEXAGONAL?p:(n===r.STAGGERED,h)};s.exports=l},39167:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(29747),h=e(97281),a=function(l){return l===r.ORTHOGONAL?h:p};s.exports=a},62e3:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(19951),h=e(14127),a=e(29747),l=e(97202),n=e(70326),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:a};s.exports=u},5984:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(29747),h=e(28054),a=e(29650),l=function(n){return n===r.ORTHOGONAL?a:n===r.STAGGERED?h:p};s.exports=l},7386:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l,n,u,f){h===void 0&&(h=0),a===void 0&&(a=0),l===void 0&&(l=f.width),n===void 0&&(n=f.height),u||(u={});var o=r(u,"isNotEmpty",!1),c=r(u,"isColliding",!1),d=r(u,"hasInterestingFace",!1);h<0&&(l+=h,h=0),a<0&&(n+=a,a=0),h+l>f.width&&(l=Math.max(f.width-h,0)),a+n>f.height&&(n=Math.max(f.height-a,0));for(var v=[],m=a;m{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(55738),p=e(7386),h=e(91865),a=e(29747),l=e(26099),n=function(d,v){return h.RectangleToTriangle(v,d)},u=new l,f=new l,o=new l,c=function(d,v,m,S){if(d===void 0)return[];var M=a;d instanceof r.Circle?M=h.CircleToRectangle:d instanceof r.Rectangle?M=h.RectangleToRectangle:d instanceof r.Triangle?M=n:d instanceof r.Line&&(M=h.LineToRectangle),S.tilemapLayer.worldToTileXY(d.left,d.top,!0,f,m);var w=f.x,C=f.y;S.tilemapLayer.worldToTileXY(d.right,d.bottom,!1,o,m);var A=Math.ceil(o.x),P=Math.ceil(o.y),b=Math.max(A-w,1),O=Math.max(P-C,1),I=p(w,C,b,O,v,S),D=S.tileWidth,B=S.tileHeight;S.tilemapLayer&&(D*=S.tilemapLayer.scaleX,B*=S.tilemapLayer.scaleY);for(var G=[],z=new r.Rectangle(0,0,D,B),X=0;X{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(26099),h=new p,a=new p,l=function(n,u,f,o,c,d,v){var m=v.tilemapLayer.tilemap._convert.WorldToTileXY;m(n,u,!0,h,d,v);var S=h.x,M=h.y;m(n+f,u+o,!1,a,d,v);var w=Math.ceil(a.x),C=Math.ceil(a.y);return r(S,M,w-S,C-M,c,v)};s.exports=l},96113:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(20242),h=e(10095),a=function(l){return l===r.ORTHOGONAL?h:p};s.exports=a},16926:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(86625),h=e(96897),a=e(29747),l=e(15108),n=e(85896),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:a};s.exports=u},55762:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=e(20242),h=e(51900),a=e(63288),l=function(n){return n===r.ORTHOGONAL?a:n===r.STAGGERED?h:p};s.exports=l},45091:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62991),p=function(h,a,l){if(r(h,a,l)){var n=l.data[a][h];return n!==null&&n.index>-1}else return!1};s.exports=p},24152:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(45091),p=e(26099),h=new p,a=function(l,n,u,f){f.tilemapLayer.worldToTileXY(l,n,!0,h,u);var o=h.x,c=h.y;return r(o,c,f)};s.exports=a},90454:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63448),p=e(56583),h=function(a,l){var n=a.tilemapLayer.tilemap,u=a.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),o=Math.floor(n.tileHeight*u.scaleY),c=a.hexSideLength,d,v,m,S;if(a.staggerAxis==="y"){var M=(o-c)/2+c;d=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,M,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,M,0,!0)+u.cullPaddingY}else{var w=(f-c)/2+c;d=p(l.worldView.x-u.x,w,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,w,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,o,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,o,0,!0)+u.cullPaddingY}return{left:d,right:v,top:m,bottom:S}};s.exports=h},9474:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(90454),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},27229:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19951),p=e(26099),h=new p,a=function(l,n,u,f){var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(o*=d.scaleX,c*=d.scaleY);var v=r(l,n,h,u,f),m=[],S=.5773502691896257,M,w;f.staggerAxis==="y"?(M=S*o,w=c/2):(M=o/2,w=S*c);for(var C=0;C<6;C++){var A=2*Math.PI*(.5-C)/6;m.push(new p(v.x+M*Math.cos(A),v.y+w*Math.sin(A)))}return m};s.exports=a},19951:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),v=c.y+n.scrollY*(1-c.scrollFactorY),f*=c.scaleX,o*=c.scaleY);var m=f/2,S=o/2,M,w;return u.staggerAxis==="y"?(M=d+f*h+f,w=v+1.5*a*S+S,a%2===0&&(this.staggerIndex==="odd"?M-=m:M+=m)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(M=d+1.5*h*m+m,w=v+o*h+o,h%2===0&&(this.staggerIndex==="odd"?w-=S:w+=S)),l.set(M,w)};s.exports=p},86625:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),o*=d.scaleX,c*=d.scaleY);var v=.5773502691896257,m=-.3333333333333333,S=0,M=.6666666666666666,w=o/2,C=c/2,A,P,b,O,I;f.staggerAxis==="y"?(A=(h-w)/(v*o),P=(a-C)/C,b=v*A+m*P,O=S*A+M*P):(A=(h-w)/w,P=(a-C)/(v*c),b=m*A+v*P,O=M*A+S*P),I=-b-O;var D=Math.round(b),B=Math.round(O),G=Math.round(I),z=Math.abs(D-b),X=Math.abs(B-O),K=Math.abs(G-I);z>X&&z>K?D=-B-G:X>K&&(B=-D-G);var Q,tt=B;return f.staggerIndex==="odd"?Q=tt%2===0?B/2+D:B/2+D-.5:Q=tt%2===0?B/2+D:B/2+D+.5,n.set(Q,tt)};s.exports=p},62991:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e>=0&&e=0&&r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33528),p=function(h,a,l,n){l===void 0&&(l=[]),n===void 0&&(n=0),l.length=0;var u=h.tilemapLayer,f=h.data,o=h.width,c=h.height,d=u.skipCull,v=0,m=o,S=0,M=c,w,C,A;if(n===0)for(C=S;C=v;w--)A=f[C][w],!(!A||A.index===-1||!A.visible||A.alpha===0)&&(!d&&!r(w,C,h,a)||l.push(A));else if(n===2)for(C=M;C>=S;C--)for(w=v;w=S;C--)for(w=m;w>=v;w--)A=f[C][w],!(!A||A.index===-1||!A.visible||A.alpha===0)&&(!d&&!r(w,C,h,a)||l.push(A));return u.tilesDrawn=l.length,u.tilesTotal=o*c,l};s.exports=p},14127:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),o*=c.scaleY);var m=d+(h-a)*(f/2),S=v+(h+a)*(o/2);return l.set(m,S)};s.exports=p},96897:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f,o){n||(n=new r);var c=f.baseTileWidth,d=f.baseTileHeight,v=f.tilemapLayer;v&&(u||(u=v.scene.cameras.main),a=a-(v.y+u.scrollY*(1-v.scrollFactorY)),d*=v.scaleY,h=h-(v.x+u.scrollX*(1-v.scrollFactorX)),c*=v.scaleX);var m=c/2,S=d/2;h=h-m,o||(a=a-d);var M=.5*(h/m+a/S),w=.5*(-h/m+a/S);return l&&(M=Math.floor(M),w=Math.floor(w)),n.set(M,w)};s.exports=p},71558:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23029),p=e(62991),h=e(72023),a=e(20576),l=function(n,u,f,o,c){if(o===void 0&&(o=!0),!p(u,f,c))return null;var d,v=c.data[f][u],m=v&&v.collides;n instanceof r?(c.data[f][u]===null&&(c.data[f][u]=new r(c,n.index,u,f,c.tileWidth,c.tileHeight)),c.data[f][u].copy(n)):(d=n,c.data[f][u]===null?c.data[f][u]=new r(c,d,u,f,c.tileWidth,c.tileHeight):c.data[f][u].index=d);var S=c.data[f][u],M=c.collideIndexes.indexOf(S.index)!==-1;if(d=n instanceof r?n.index:n,d===-1)S.width=c.tileWidth,S.height=c.tileHeight;else{var w=c.tilemapLayer.tilemap,C=w.tiles,A=C[d][2],P=w.tilesets[A];S.width=P.tileWidth,S.height=P.tileHeight}return a(S,M),o&&m!==S.collides&&h(u,f,c),S};s.exports=l},26303:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(71558),p=e(26099),h=new p,a=function(l,n,u,f,o,c){return c.tilemapLayer.worldToTileXY(n,u,!0,h,o,c),r(l,h.x,h.y,f,c)};s.exports=a},14051:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(42573),p=e(71558),h=function(a,l,n,u,f){if(u===void 0&&(u=!0),!Array.isArray(a))return null;Array.isArray(a[0])||(a=[a]);for(var o=a.length,c=a[0].length,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(26546),h=function(a,l,n,u,f,o){var c,d=r(a,l,n,u,{},o);if(!f)for(f=[],c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(23029),p=e(62991),h=e(72023),a=function(l,n,u,f,o){if(u===void 0&&(u=!0),f===void 0&&(f=!0),!p(l,n,o))return null;var c=o.data[n][l];if(c)o.data[n][l]=u?null:new r(o,-1,l,n,o.tileWidth,o.tileHeight);else return null;return f&&c&&c.collides&&h(l,n,o),c};s.exports=a},94178:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63557),p=e(26099),h=new p,a=function(l,n,u,f,o,c){return c.tilemapLayer.worldToTileXY(l,n,!0,h,o,c),r(h.x,h.y,u,f,c)};s.exports=a},15533:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(3956),h=new p(105,210,231,150),a=new p(243,134,48,200),l=new p(40,39,37,150),n=function(u,f,o){f===void 0&&(f={});var c=f.tileColor!==void 0?f.tileColor:h,d=f.collidingTileColor!==void 0?f.collidingTileColor:a,v=f.faceColor!==void 0?f.faceColor:l,m=r(0,0,o.width,o.height,null,o);u.translateCanvas(o.tilemapLayer.x,o.tilemapLayer.y),u.scaleCanvas(o.tilemapLayer.scaleX,o.tilemapLayer.scaleY);for(var S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(l,n,u,f,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e.data,l=e.width,n=e.height,u=e.tilemapLayer,f=Math.max(0,r.left),o=Math.min(l,r.right),c=Math.max(0,r.top),d=Math.min(n,r.bottom),v,m,S;if(p===0)for(m=c;m=f;v--)S=a[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);else if(p===2)for(m=d;m>=c;m--)for(v=f;a[m]&&v=c;m--)for(v=o;a[m]&&v>=f;v--)S=a[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);return u.tilesDrawn=h.length,u.tilesTotal=l*n,h};s.exports=y},57068:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f,o){n===void 0&&(n=!0),u===void 0&&(u=!0),o===void 0&&(o=!0),Array.isArray(l)||(l=[l]);for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f,o,c){if(u===void 0&&(u=!0),f===void 0&&(f=!0),c===void 0&&(c=!0),!(l>n)){for(var d=l;d<=n;d++)h(d,u,o);if(c)for(var v=0;v=l&&S.index<=n&&r(S,u)}f&&p(0,0,o.width,o.height,o)}};s.exports=a},75661:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(9589),a=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0),Array.isArray(l)||(l=[l]);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=e(97022),a=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0);for(var o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(20576),p=e(42573),h=function(a,l,n){a===void 0&&(a=!0),l===void 0&&(l=!0);for(var u=0;u0&&r(o,a)}}l&&p(0,0,n.width,n.height,n)};s.exports=h},9589:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.collideIndexes.indexOf(e);r&&h===-1?p.collideIndexes.push(e):!r&&h!==-1&&p.collideIndexes.splice(h,1)};s.exports=y},20576:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r?e.setCollision(!0,!0,!0,!0,!1):e.resetCollision(!1)};s.exports=y},79583:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(typeof e=="number")h.callbacks[e]=r!==null?{callback:r,callbackContext:p}:void 0;else for(var a=0,l=e.length;a{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(h,a,l,n,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(33680),h=function(a,l,n,u,f){var o=r(a,l,n,u,null,f),c=o.map(function(v){return v.index});p(c);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(63448),p=e(56583),h=function(a,l){var n=a.tilemapLayer.tilemap,u=a.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),o=Math.floor(n.tileHeight*u.scaleY),c=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,d=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,v=p(l.worldView.y-u.y,o/2,0,!0)-u.cullPaddingY,m=r(l.worldView.bottom-u.y,o/2,0,!0)+u.cullPaddingY;return{left:c,right:d,top:v,bottom:m}};s.exports=h},54503:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(61325),p=e(32483),h=function(a,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=a.tilemapLayer,o=r(a,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(o.left=0,o.right=a.width,o.top=0,o.bottom=a.height),p(a,o,u,n),n};s.exports=h},97202:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u){l||(l=new r);var f=u.baseTileWidth,o=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),o*=c.scaleY);var m=d+h*f+a%2*(f/2),S=v+a*(o/2);return l.set(m,S)};s.exports=p},28054:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileHeight,a=p.tilemapLayer,l=0;return a&&(r===void 0&&(r=a.scene.cameras.main),l=a.y+r.scrollY*(1-a.scrollFactorY),h*=a.scaleY),l+e*(h/2)+h};s.exports=y},15108:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),c*=d.scaleY,h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),o*=d.scaleX);var v=l?Math.floor(a/(c/2)):a/(c/2),m=l?Math.floor((h+v%2*.5*o)/o):(h+v%2*.5*o)/o;return n.set(m,v)};s.exports=p},51900:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=h.baseTileHeight,l=h.tilemapLayer;return l&&(p||(p=l.scene.cameras.main),e=e-(l.y+p.scrollY*(1-l.scrollFactorY)),a*=l.scaleY),r?Math.floor(e/(a/2)):e/(a/2)};s.exports=y},86560:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=function(h,a,l,n,u,f,o){for(var c=r(l,n,u,f,null,o),d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileWidth,a=p.tilemapLayer,l=0;return a&&(r||(r=a.scene.cameras.main),l=a.x+r.scrollX*(1-a.scrollFactorX),h*=a.scaleX),l+e*h};s.exports=y},70326:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97281),p=e(29650),h=e(26099),a=function(l,n,u,f,o){return u||(u=new h(0,0)),u.x=r(l,f,o),u.y=p(n,f,o),u};s.exports=a},29650:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=p.baseTileHeight,a=p.tilemapLayer,l=0;return a&&(r||(r=a.scene.cameras.main),l=a.y+r.scrollY*(1-a.scrollFactorY),h*=a.scaleY),l+e*h};s.exports=y},77366:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(7386),p=e(75508),h=function(a,l,n,u,f,o){if(f){var c,d=r(a,l,n,u,null,o),v=0;for(c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85896),p=e(26099),h=new p,a=function(l,n,u,f){return r(l,0,n,h,u,f),h.x};s.exports=a},85896:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(26099),p=function(h,a,l,n,u,f){l===void 0&&(l=!0),n||(n=new r);var o=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),a=a-(d.y+u.scrollY*(1-d.scrollFactorY)),o*=d.scaleX,c*=d.scaleY);var v=h/o,m=a/c;return l&&(v=Math.floor(v),m=Math.floor(m)),n.set(v,m)};s.exports=p},63288:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(85896),p=e(26099),h=new p,a=function(l,n,u,f){return r(0,l,n,h,u,f),h.y};s.exports=a},81086:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CalculateFacesAt:e(72023),CalculateFacesWithin:e(42573),CheckIsoBounds:e(33528),Copy:e(1785),CreateFromTiles:e(78419),CullBounds:e(19545),CullTiles:e(30003),Fill:e(35137),FilterTiles:e(40253),FindByIndex:e(52692),FindTile:e(66151),ForEachTile:e(97560),GetCullTilesFunction:e(43305),GetTileAt:e(7423),GetTileAtWorldXY:e(60540),GetTileCorners:e(55826),GetTileCornersFunction:e(11758),GetTilesWithin:e(7386),GetTilesWithinShape:e(91141),GetTilesWithinWorldXY:e(96523),GetTileToWorldXFunction:e(39167),GetTileToWorldXYFunction:e(62e3),GetTileToWorldYFunction:e(5984),GetWorldToTileXFunction:e(96113),GetWorldToTileXYFunction:e(16926),GetWorldToTileYFunction:e(55762),HasTileAt:e(45091),HasTileAtWorldXY:e(24152),HexagonalCullBounds:e(90454),HexagonalCullTiles:e(9474),HexagonalGetTileCorners:e(27229),HexagonalTileToWorldXY:e(19951),HexagonalWorldToTileXY:e(86625),IsInLayerBounds:e(62991),IsometricCullTiles:e(14018),IsometricTileToWorldXY:e(14127),IsometricWorldToTileXY:e(96897),PutTileAt:e(71558),PutTileAtWorldXY:e(26303),PutTilesAt:e(14051),Randomize:e(77389),RemoveTileAt:e(63557),RemoveTileAtWorldXY:e(94178),RenderDebug:e(15533),ReplaceByIndex:e(27987),RunCull:e(32483),SetCollision:e(57068),SetCollisionBetween:e(37266),SetCollisionByExclusion:e(75661),SetCollisionByProperty:e(64740),SetCollisionFromCollisionGroup:e(63307),SetLayerCollisionIndex:e(9589),SetTileCollision:e(20576),SetTileIndexCallback:e(79583),SetTileLocationCallback:e(93254),Shuffle:e(32903),StaggeredCullBounds:e(61325),StaggeredCullTiles:e(54503),StaggeredTileToWorldXY:e(97202),StaggeredTileToWorldY:e(28054),StaggeredWorldToTileXY:e(15108),StaggeredWorldToTileY:e(51900),SwapByIndex:e(86560),TileToWorldX:e(97281),TileToWorldXY:e(70326),TileToWorldY:e(29650),WeightedRandomize:e(77366),WorldToTileX:e(10095),WorldToTileXY:e(85896),WorldToTileY:e(63288)}},91907:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={ORIENTATION:e(91907)};s.exports=r},62501:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=e(21829),h={Components:e(81086),Parsers:e(57442),Formats:e(80341),ImageCollection:e(16536),ParseToTilemap:e(31989),Tile:e(23029),Tilemap:e(49075),TilemapCreator:e(45939),TilemapFactory:e(46029),Tileset:e(33629),TilemapLayer:e(20442),Orientation:e(91907),LayerData:e(14977),MapData:e(87010),ObjectLayer:e(48700)};h=r(!1,h,p.ORIENTATION),s.exports=h},14977:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91907),h=e(95540),a=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","layer"),this.id=h(n,"id",0),this.x=h(n,"x",0),this.y=h(n,"y",0),this.width=h(n,"width",0),this.height=h(n,"height",0),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.baseTileWidth=h(n,"baseTileWidth",this.tileWidth),this.baseTileHeight=h(n,"baseTileHeight",this.tileHeight),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.widthInPixels=h(n,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.baseTileHeight),this.alpha=h(n,"alpha",1),this.visible=h(n,"visible",!0),this.properties=h(n,"properties",[]),this.indexes=h(n,"indexes",[]),this.collideIndexes=h(n,"collideIndexes",[]),this.callbacks=h(n,"callbacks",[]),this.bodies=h(n,"bodies",[]),this.data=h(n,"data",[]),this.tilemapLayer=h(n,"tilemapLayer",null),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});s.exports=a},87010:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(91907),h=e(95540),a=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","map"),this.width=h(n,"width",0),this.height=h(n,"height",0),this.infinite=h(n,"infinite",!1),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.widthInPixels=h(n,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.tileHeight),this.format=h(n,"format",null),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.renderOrder=h(n,"renderOrder","right-down"),this.version=h(n,"version","1"),this.properties=h(n,"properties",{}),this.layers=h(n,"layers",[]),this.images=h(n,"images",[]),this.objects=h(n,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=h(n,"collision",{}),this.tilesets=h(n,"tilesets",[]),this.imageCollections=h(n,"imageCollections",[]),this.tiles=h(n,"tiles",[]),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});s.exports=a},48700:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=new r({initialize:function(l){l===void 0&&(l={}),this.name=p(l,"name","object layer"),this.id=p(l,"id",0),this.opacity=p(l,"opacity",1),this.properties=p(l,"properties",{}),this.propertyTypes=p(l,"propertytypes",{}),this.type=p(l,"type","objectgroup"),this.visible=p(l,"visible",!0),this.objects=p(l,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});s.exports=h},6641:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(91907),p=function(h){return h=h.toLowerCase(),h==="isometric"?r.ISOMETRIC:h==="staggered"?r.STAGGERED:h==="hexagonal"?r.HEXAGONAL:r.ORTHOGONAL};s.exports=p},46177:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(2342),h=e(82593),a=e(46594),l=e(87021),n=function(u,f,o,c,d,v){var m;switch(f){case r.ARRAY_2D:m=p(u,o,c,d,v);break;case r.CSV:m=h(u,o,c,d,v);break;case r.TILED_JSON:m=a(u,o,v);break;case r.WELTMEISTER:m=l(u,o,v);break;default:console.warn("Unrecognized tilemap data format: "+f),m=null}return m};s.exports=n},2342:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(14977),h=e(87010),a=e(23029),l=function(n,u,f,o,c){for(var d=new p({tileWidth:f,tileHeight:o}),v=new h({name:n,tileWidth:f,tileHeight:o,format:r.ARRAY_2D,layers:[d]}),m=[],S=u.length,M=0,w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(2342),h=function(a,l,n,u,f){var o=l.trim().split(` +`).map(function(d){return d.split(",")}),c=p(a,o,n,u,f);return c.format=r.CSV,c};s.exports=h},6656:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(14977),p=e(23029),h=function(a,l){for(var n=[],u=0;u-1?M=new p(o,S,m,v,f.tilesize,f.tilesize):M=l?null:new p(o,-1,m,v,f.tilesize,f.tilesize),c.push(M)}d.push(c),c=[]}o.data=d,n.push(o)}return n};s.exports=h},96483:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=function(h){for(var a=[],l=[],n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(80341),p=e(87010),h=e(6656),a=e(96483),l=function(n,u,f){if(u.layer.length===0)return console.warn("No layers found in the Weltmeister map: "+n),null;for(var o=0,c=0,d=0;do&&(o=u.layer[d].width),u.layer[d].height>c&&(c=u.layer[d].height);var v=new p({width:o,height:c,name:n,tileWidth:u.layer[0].tilesize,tileHeight:u.layer[0].tilesize,format:r.WELTMEISTER});return v.layers=h(u,f),v.tilesets=a(u),v};s.exports=l},52833:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ParseTileLayers:e(6656),ParseTilesets:e(96483),ParseWeltmeister:e(87021)}},57442:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={FromOrientationString:e(6641),Parse:e(46177),Parse2DArray:e(2342),ParseCSV:e(82593),Impact:e(52833),Tiled:e(96761)}},51233:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(79291),p=function(h){for(var a,l,n,u,f,o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=window.atob(e),p=r.length,h=new Array(p/4),a=0;a>>0;return h};s.exports=y},84101:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=function(h){var a,l,n=[];for(a=0;a{/** + * @author Seth Berrier + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=function(h,a,l){if(!a)return{i:0,layers:h.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=a.x+r(a,"startx",0)*h.tilewidth+r(a,"offsetx",0),u=a.y+r(a,"starty",0)*h.tileheight+r(a,"offsety",0);return{i:0,layers:a.layers,name:l.name+a.name+"/",opacity:l.opacity*a.opacity,visible:l.visible&&a.visible,x:l.x+n,y:l.y+u}};s.exports=p},29920:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=2147483648,e=1073741824,r=536870912,p=function(h){var a=!!(h&y),l=!!(h&e),n=!!(h&r);h=h&~(y|e|r);var u=0,f=!1;return a&&l&&n?(u=Math.PI/2,f=!0):a&&l&&!n?(u=Math.PI,f=!1):a&&!l&&n?(u=Math.PI/2,f=!1):a&&!l&&!n?(u=0,f=!0):!a&&l&&n?(u=3*Math.PI/2,f=!1):!a&&l&&!n?(u=Math.PI,f=!0):!a&&!l&&n?(u=3*Math.PI/2,f=!0):!a&&!l&&!n&&(u=0,f=!1),{gid:h,flippedHorizontal:a,flippedVertical:l,flippedAntiDiagonal:n,rotation:u,flipped:f}};s.exports=p},12635:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(79677),h=function(a){for(var l=[],n=[],u=p(a);u.i0;){if(u.i>=u.layers.length){if(n.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}u=n.pop();continue}var f=u.layers[u.i];if(u.i++,f.type!=="imagelayer"){if(f.type==="group"){var o=p(a,f,u);n.push(u),u=o}continue}var c=r(f,"offsetx",0)+r(f,"startx",0),d=r(f,"offsety",0)+r(f,"starty",0);l.push({name:u.name+f.name,image:f.image,x:u.x+c+f.x,y:u.y+d+f.y,alpha:u.opacity*f.opacity,visible:u.visible&&f.visible,properties:r(f,"properties",{})})}return l};s.exports=h},46594:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(51233),p=e(84101),h=e(91907),a=e(62644),l=e(80341),n=e(6641),u=e(87010),f=e(12635),o=e(22611),c=e(28200),d=e(24619),v=function(m,S,M){var w=a(S),C=new u({width:w.width,height:w.height,name:m,tileWidth:w.tilewidth,tileHeight:w.tileheight,orientation:n(w.orientation),format:l.TILED_JSON,version:w.version,properties:w.properties,renderOrder:w.renderorder,infinite:w.infinite});C.orientation===h.HEXAGONAL&&(C.hexSideLength=w.hexsidelength,C.staggerAxis=w.staggeraxis,C.staggerIndex=w.staggerindex),C.layers=c(w,M),C.images=f(w);var A=d(w);return C.tilesets=A.tilesets,C.imageCollections=A.imageCollections,C.objects=o(w),C.tiles=p(C),r(C),C};s.exports=v},52205:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(18254),p=e(29920),h=function(n){return{x:n.x,y:n.y}},a=["id","name","type","rotation","properties","visible","x","y","width","height"],l=function(n,u,f){u===void 0&&(u=0),f===void 0&&(f=0);var o=r(n,a);if(o.x+=u,o.y+=f,n.gid){var c=p(n.gid);o.gid=c.gid,o.flippedHorizontal=c.flippedHorizontal,o.flippedVertical=c.flippedVertical,o.flippedAntiDiagonal=c.flippedAntiDiagonal}else n.polyline?o.polyline=n.polyline.map(h):n.polygon?o.polygon=n.polygon.map(h):n.ellipse?o.ellipse=n.ellipse:n.text?o.text=n.text:n.point?o.point=!0:o.rectangle=!0;return o};s.exports=l},22611:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95540),p=e(52205),h=e(48700),a=e(79677),l=function(n){for(var u=[],f=[],o=a(n);o.i0;){if(o.i>=o.layers.length){if(f.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}o=f.pop();continue}var c=o.layers[o.i];if(o.i++,c.opacity*=o.opacity,c.visible=o.visible&&c.visible,c.type!=="objectgroup"){if(c.type==="group"){var d=a(n,c,o);f.push(o),o=d}continue}c.name=o.name+c.name;for(var v=o.x+r(c,"startx",0)+r(c,"offsetx",0),m=o.y+r(c,"starty",0)+r(c,"offsety",0),S=[],M=0;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41868),p=e(91907),h=e(79677),a=e(6641),l=e(95540),n=e(14977),u=e(29920),f=e(23029),o=function(c,d){for(var v=l(c,"infinite",!1),m=[],S=[],M=h(c);M.i0;){if(M.i>=M.layers.length){if(S.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}M=S.pop();continue}var w=M.layers[M.i];if(M.i++,w.type!=="tilelayer"){if(w.type==="group"){var C=h(c,w,M);S.push(M),M=C}continue}if(w.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+w.name+"'");continue}else if(w.encoding&&w.encoding==="base64"){if(w.chunks)for(var A=0;A0?(O=new f(P,b.gid,J,_,c.tilewidth,c.tileheight),O.rotation=b.rotation,O.flipX=b.flipped,D[_][J]=O):(I=d?null:new f(P,-1,J,_,c.tilewidth,c.tileheight),D[_][J]=I),B++,B===Q.width&&(Z++,B=0)}}else{P=new n({name:M.name+w.name,id:w.id,x:M.x+l(w,"offsetx",0)+w.x,y:M.y+l(w,"offsety",0)+w.y,width:w.width,height:w.height,tileWidth:c.tilewidth,tileHeight:c.tileheight,alpha:M.opacity*w.opacity,visible:M.visible&&w.visible,properties:l(w,"properties",[]),orientation:a(c.orientation)}),P.orientation===p.HEXAGONAL&&(P.hexSideLength=c.hexsidelength,P.staggerAxis=c.staggeraxis,P.staggerIndex=c.staggerindex);for(var q=[],at=0,ot=w.data.length;at0?(O=new f(P,b.gid,B,D.length,c.tilewidth,c.tileheight),O.rotation=b.rotation,O.flipX=b.flipped,q.push(O)):(I=d?null:new f(P,-1,B,D.length,c.tilewidth,c.tileheight),q.push(I)),B++,B===w.width&&(D.push(q),B=0,q=[])}P.data=D,m.push(P)}return m};s.exports=o},24619:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(33629),p=e(16536),h=e(52205),a=e(57880),l=function(n){for(var u=[],f=[],o=null,c,d=0;d1){var S=void 0,M=void 0;if(Array.isArray(v.tiles)){S=S||{},M=M||{};for(var w=0;w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p0){var l={},n={},u,f,o;if(Array.isArray(h.edgecolors))for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={AssignTileProperties:e(51233),Base64Decode:e(41868),BuildTilesetIndex:e(84101),CreateGroupLayer:e(79677),ParseGID:e(29920),ParseImageLayers:e(12635),ParseJSONTiled:e(46594),ParseObject:e(52205),ParseObjectLayers:e(22611),ParseTileLayers:e(28200),ParseTilesets:e(24619)}},33385:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(37277),h=e(44594),a=e(94880),l=e(72905),n=new r({initialize:function(f){this.scene=f,this.systems=f.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var u=this.systems.events;u.on(h.PRE_UPDATE,this.preUpdate,this),u.on(h.UPDATE,this.update,this),u.once(h.SHUTDOWN,this.shutdown,this)},addEvent:function(u){var f;return u instanceof a?(f=u,this.removeEvent(f),f.elapsed=f.startAt,f.hasDispatched=!1,f.repeatCount=f.repeat===-1||f.loop?999999999999:f.repeat):f=new a(u),this._pendingInsertion.push(f),f},delayedCall:function(u,f,o,c){return this.addEvent({delay:u,callback:f,args:o,callbackScope:c})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(u){Array.isArray(u)||(u=[u]);for(var f=0;f-1&&this._active.splice(d,1),c.destroy()}for(o=0;o=c.delay)){var d=c.elapsed-c.delay;if(c.elapsed=c.delay,!c.hasDispatched&&c.callback&&(c.hasDispatched=!0,c.callback.apply(c.callbackScope,c.args)),c.repeatCount>0){if(c.repeatCount--,d>=c.delay)for(;d>=c.delay&&c.repeatCount>0;)c.callback&&c.callback.apply(c.callbackScope,c.args),d-=c.delay,c.repeatCount--;c.elapsed=d,c.hasDispatched=!1}else c.hasDispatched&&this._pendingRemoval.push(c)}}}},shutdown:function(){var u;for(u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(39429),a=e(95540),l=e(44594),n=e(89809),u=new r({Extends:p,initialize:function(o,c){p.call(this),this.scene=o,this.systems=o.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var d=this.systems.events;d.on(l.PRE_UPDATE,this.preUpdate,this),d.on(l.UPDATE,this.update,this),d.once(l.SHUTDOWN,this.destroy,this),c&&this.add(c)},preUpdate:function(f,o){this.paused||(this.elapsed+=o)},update:function(){if(!(this.paused||this.complete)){var f,o=this.events,c=!1,d=this.systems,v;for(f=0;f=o.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(n.COMPLETE,this)}},play:function(f){return f===void 0&&(f=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,f&&this.reset(),this},pause:function(){return this.paused=!0,this},repeat:function(f){return(f===void 0||f===!0)&&(f=-1),f===!1&&(f=0),this.loop=f,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(f){f===void 0&&(f=!1),this.elapsed=0,f||(this.iteration=0);for(var o=0;o0&&(c=o[o.length-1].time);for(var d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(95540),h=new r({initialize:function(l){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(l)},reset:function(a){if(this.delay=p(a,"delay",0),this.repeat=p(a,"repeat",0),this.loop=p(a,"loop",!1),this.callback=p(a,"callback",void 0),this.callbackScope=p(a,"callbackScope",this),this.args=p(a,"args",[]),this.timeScale=p(a,"timeScale",1),this.startAt=p(a,"startAt",0),this.paused=p(a,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay===0&&(this.repeat>0||this.loop))throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var a=this.delay+this.delay*this.repeat,l=this.elapsed+this.delay*(this.repeat-this.repeatCount);return l/a}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(a){a===void 0&&(a=!1),this.elapsed=this.delay,this.hasDispatched=!a,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});s.exports=h},35945:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},89809:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={COMPLETE:e(35945)}},90291:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Clock:e(33385),Events:e(89809),Timeline:e(96120),TimerEvent:e(94880)}},40382:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(83419),h=e(43491),a=e(88032),l=e(37277),n=e(44594),u=e(93109),f=e(86081),o=e(8357),c=e(43960),d=e(26012),v=new p({initialize:function(S){this.scene=S,this.events=S.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(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.events.once(n.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(n.UPDATE,this.update,this),this.events.once(n.SHUTDOWN,this.shutdown,this)},create:function(m){Array.isArray(m)||(m=[m]);for(var S=[],M=0;M-1},existing:function(m){return this.has(m)||this.tweens.push(m.reset()),this},addCounter:function(m){var S=a(this,m);return this.tweens.push(S.reset()),S},stagger:function(m,S){return u(m,S)},setLagSmooth:function(m,S){return m===void 0&&(m=1/1e-8),S===void 0&&(S=0),this.maxLag=m,this.lagSkip=Math.min(S,this.maxLag),this},setFps:function(m){return m===void 0&&(m=240),this.gap=1e3/m,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(m){var S=Date.now()-this.prevTime;S>this.maxLag&&(this.startTime+=S-this.lagSkip),this.prevTime+=S;var M=this.prevTime-this.startTime,w=M-this.nextTime,C=M-this.time*1e3;return w>0||m?(M/=1e3,this.time=M,this.nextTime+=w+(w>=this.gap?4:this.gap-w)):C=0,C},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(m){m===void 0&&(m=!1);var S=this.getDelta(m);if(!(S<=0)){this.processing=!0;var M,w,C=[],A=this.tweens;for(M=0;M0){for(M=0;M-1&&(w.isPendingRemove()||w.isDestroyed())&&(A.splice(b,1),w.destroy())}C.length=0}this.processing=!1}},remove:function(m){return this.processing?m.setPendingRemoveState():(r(this.tweens,m),m.setRemovedState()),this},reset:function(m){return this.existing(m),m.seek(),m.setActiveState(),this},makeActive:function(m){return this.existing(m),m.setActiveState(),this},each:function(m,S){var M,w=[null];for(M=1;M{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){return e&&e.hasOwnProperty(r)?e[r]:p};s.exports=y},6113:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(62640),p=e(35355),h=function(a,l){var n=r.Power0;if(typeof a=="string")if(r.hasOwnProperty(a))n=r[a];else{var u="";if(a.indexOf(".")){u=a.substring(a.indexOf(".")+1);var f=u.toLowerCase();f==="in"?u="easeIn":f==="out"?u="easeOut":f==="inout"&&(u="easeInOut")}a=p(a.substring(0,a.indexOf(".")+1)+u),r.hasOwnProperty(a)&&(n=r[a])}else typeof a=="function"&&(n=a);if(!l)return n;var o=l.slice(0);return o.unshift(0),function(c){return o[0]=c,n.apply(this,o)}};s.exports=h},91389:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(89318),p=e(77259),h=e(28392),a={bezier:r,catmull:p,catmullrom:p,linear:h},l=function(n){if(n===null)return null;var u=a.linear;return typeof n=="string"?a.hasOwnProperty(n)&&(u=a[n]):typeof n=="function"&&(u=n),u};s.exports=l},55292:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h;if(e.hasOwnProperty(r)){var a=typeof e[r];a==="function"?h=function(l,n,u,f,o,c){return e[r](l,n,u,f,o,c)}:h=function(){return e[r]}}else typeof p=="function"?h=p:h=function(){return p};return h};s.exports=y},82985:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(81076),p=function(h){var a,l=[];if(h.hasOwnProperty("props"))for(a in h.props)a.substring(0,1)!=="_"&&l.push({key:a,value:h.props[a]});else for(a in h)r.indexOf(a)===-1&&a.substring(0,1)!=="_"&&l.push({key:a,value:h[a]});return l};s.exports=p},62329:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=function(h){var a=r(h,"targets",null);return a===null||(typeof a=="function"&&(a=a.call()),Array.isArray(a)||(a=[a])),a};s.exports=p},17777:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(30976),p=e(99472);function h(f){return!!f.getActive&&typeof f.getActive=="function"}function a(f){return!!f.getStart&&typeof f.getStart=="function"}function l(f){return!!f.getEnd&&typeof f.getEnd=="function"}function n(f){return a(f)||l(f)||h(f)}var u=function(f,o){var c,d=function(Q,tt,Y){return Y},v=function(Q,tt,Y){return Y},m=null,S=typeof o;if(S==="number")d=function(){return o};else if(Array.isArray(o))v=function(){return o[0]},d=function(){return o[o.length-1]};else if(S==="string"){var M=o.toLowerCase(),w=M.substring(0,6)==="random",C=M.substring(0,3)==="int";if(w||C){var A=M.indexOf("("),P=M.indexOf(")"),b=M.indexOf(",");if(A&&P&&b){var O=parseFloat(M.substring(A+1,b)),I=parseFloat(M.substring(b+1,P));w?d=function(){return p(O,I)}:d=function(){return r(O,I)}}else throw new Error("invalid random() format")}else{M=M[0];var D=parseFloat(o.substr(2));switch(M){case"+":d=function(Q,tt,Y){return Y+D};break;case"-":d=function(Q,tt,Y){return Y-D};break;case"*":d=function(Q,tt,Y){return Y*D};break;case"/":d=function(Q,tt,Y){return Y/D};break;default:d=function(){return parseFloat(o)}}}}else if(S==="function")d=o;else if(S==="object")if(n(o))h(o)&&(m=o.getActive),l(o)&&(d=o.getEnd),a(o)&&(v=o.getStart);else if(o.hasOwnProperty("value"))c=u(f,o.value);else{var B=o.hasOwnProperty("to"),G=o.hasOwnProperty("from"),z=o.hasOwnProperty("start");if(B&&(G||z)){if(c=u(f,o.to),z){var X=u(f,o.start);c.getActive=X.getEnd}if(G){var K=u(f,o.from);c.getStart=K.getEnd}}}return c||(c={getActive:m,getEnd:d,getStart:v}),c};s.exports=u},88032:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(69902),h=e(23568),a=e(57355),l=e(6113),n=e(55292),u=e(35154),f=e(17777),o=e(269),c=e(86081),d=function(v,m,S){if(m instanceof c)return m.parent=v,m;S===void 0?S=p:S=o(p,S);var M=u(m,"from",0),w=u(m,"to",1),C=[{value:M}],A=u(m,"delay",S.delay),P=u(m,"easeParams",S.easeParams),b=u(m,"ease",S.ease),O=f("value",w),I=new c(v,C),D=I.add(0,"value",O.getEnd,O.getStart,O.getActive,l(u(m,"ease",b),u(m,"easeParams",P)),n(m,"delay",A),u(m,"duration",S.duration),a(m,"yoyo",S.yoyo),u(m,"hold",S.hold),u(m,"repeat",S.repeat),u(m,"repeatDelay",S.repeatDelay),!1,!1);D.start=M,D.current=M,I.completeDelay=h(m,"completeDelay",0),I.loop=Math.round(h(m,"loop",0)),I.loopDelay=Math.round(h(m,"loopDelay",0)),I.paused=a(m,"paused",!1),I.persist=a(m,"persist",!1),I.callbackScope=u(m,"callbackScope",I);for(var B=r.TYPES,G=0;G{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(6113),p=e(35154),h=e(36383),a=function(l,n){n===void 0&&(n={});var u,f=p(n,"start",0),o=p(n,"ease",null),c=p(n,"grid",null),d=p(n,"from",0),v=d==="first",m=d==="center",S=d==="last",M=typeof d=="number",w=Array.isArray(l),C=parseFloat(w?l[0]:l),A=w?parseFloat(l[1]):0,P=Math.max(C,A);if(w&&(f+=C),c){var b=c[0],O=c[1],I=0,D=0,B=0,G=0,z=[];S?(I=b-1,D=O-1):M?(I=d%b,D=Math.floor(d/b)):m&&(I=(b-1)/2,D=(O-1)/2);for(var X=h.MIN_SAFE_INTEGER,K=0;KX&&(X=tt),z[K][Q]=tt}}}var Y=o?r(o):null;return c?u=function(Z,U,H,J){var _=0,q=J%b,at=Math.floor(J/b);q>=0&&q=0&&at{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(69902),h=e(23568),a=e(57355),l=e(6113),n=e(91389),u=e(55292),f=e(82985),o=e(62329),c=e(35154),d=e(17777),v=e(269),m=e(86081),S=function(M,w,C){if(w instanceof m)return w.parent=M,w;C===void 0?C=p:C=v(p,C);var A=o(w);!A&&C.targets&&(A=C.targets);for(var P=f(w),b=c(w,"delay",C.delay),O=c(w,"duration",C.duration),I=c(w,"easeParams",C.easeParams),D=c(w,"ease",C.ease),B=c(w,"hold",C.hold),G=c(w,"repeat",C.repeat),z=c(w,"repeatDelay",C.repeatDelay),X=a(w,"yoyo",C.yoyo),K=a(w,"flipX",C.flipX),Q=a(w,"flipY",C.flipY),tt=c(w,"interpolation",C.interpolation),Y=function(yt,Et,At,Pt){if(At==="texture"){var Vt=Pt,dt=void 0;Array.isArray(Pt)?(Vt=Pt[0],dt=Pt[1]):Pt.hasOwnProperty("value")?(Vt=Pt.value,Array.isArray(Pt.value)?(Vt=Pt.value[0],dt=Pt.value[1]):typeof Pt.value=="string"&&(Vt=Pt.value)):typeof Pt=="string"&&(Vt=Pt),yt.addFrame(Et,Vt,dt,u(Pt,"delay",b),c(Pt,"duration",O),c(Pt,"hold",B),c(Pt,"repeat",G),c(Pt,"repeatDelay",z),a(Pt,"flipX",K),a(Pt,"flipY",Q))}else{var ut=d(At,Pt),Rt=n(c(Pt,"interpolation",tt));yt.add(Et,At,ut.getEnd,ut.getStart,ut.getActive,l(c(Pt,"ease",D),c(Pt,"easeParams",I)),u(Pt,"delay",b),c(Pt,"duration",O),a(Pt,"yoyo",X),c(Pt,"hold",B),c(Pt,"repeat",G),c(Pt,"repeatDelay",z),a(Pt,"flipX",K),a(Pt,"flipY",Q),Rt,Rt?Pt:null)}},Z=new m(M,A),U=0;U{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(23568),h=e(57355),a=e(62329),l=e(35154),n=e(8357),u=e(43960),f=function(o,c){if(c instanceof u)return c.parent=o,c;var d=new u(o);d.startDelay=l(c,"delay",0),d.completeDelay=p(c,"completeDelay",0),d.loop=Math.round(p(c,"loop",l(c,"repeat",0))),d.loopDelay=Math.round(p(c,"loopDelay",l(c,"repeatDelay",0))),d.paused=h(c,"paused",!1),d.persist=h(c,"persist",!1),d.callbackScope=l(c,"callbackScope",d);var v,m=r.TYPES;for(v=0;v{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={GetBoolean:e(57355),GetEaseFunction:e(6113),GetInterpolationFunction:e(91389),GetNewValue:e(55292),GetProps:e(82985),GetTargets:e(62329),GetValueOp:e(17777),NumberTweenBuilder:e(88032),StaggerBuilder:e(93109),TweenBuilder:e(8357)}},73685:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="active"},98540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="complete"},67233:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="loop"},2859:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="pause"},98336:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="repeat"},25764:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="resume"},32193:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="start"},84371:s=>{/** + * @author samme + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="stop"},70766:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="update"},55659:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports="yoyo"},842:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={TWEEN_ACTIVE:e(73685),TWEEN_COMPLETE:e(98540),TWEEN_LOOP:e(67233),TWEEN_PAUSE:e(2859),TWEEN_RESUME:e(25764),TWEEN_REPEAT:e(98336),TWEEN_START:e(32193),TWEEN_STOP:e(84371),TWEEN_UPDATE:e(70766),TWEEN_YOYO:e(55659)}},43066:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r={States:e(86353),Builders:e(30231),Events:e(842),TweenManager:e(40382),Tween:e(86081),TweenData:e(48177),TweenFrameData:e(42220),BaseTween:e(70402),TweenChain:e(43960)};s.exports=r},70402:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(50792),h=e(842),a=e(86353),l=new r({Extends:p,initialize:function(u){p.call(this),this.parent=u,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(n){return this.timeScale=n,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(h.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(h.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(h.TWEEN_COMPLETE,"onComplete")},complete:function(n){return n===void 0&&(n=0),n?(this.setCompleteDelayState(),this.countdown=n):this.onCompleteHandler(),this},completeAfterLoop:function(n){return n===void 0&&(n=0),this.loopCounter>n&&(this.loopCounter=n),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(h.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(n){this.countdown-=n,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(h.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(n){return this.countdown-=n,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(h.TWEEN_START,"onStart"),n=0),n},updateCompleteDelay:function(n){this.countdown-=n,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(n,u,f){return f===void 0&&(f=[]),this.callbacks.hasOwnProperty(n)&&(this.callbacks[n]={func:u,params:f}),this},setPendingState:function(){this.state=a.PENDING},setActiveState:function(){this.state=a.ACTIVE},setLoopDelayState:function(){this.state=a.LOOP_DELAY},setCompleteDelayState:function(){this.state=a.COMPLETE_DELAY},setStartDelayState:function(){this.state=a.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=a.PENDING_REMOVE},setRemovedState:function(){this.state=a.REMOVED},setFinishedState:function(){this.state=a.FINISHED},setDestroyedState:function(){this.state=a.DESTROYED},isPending:function(){return this.state===a.PENDING},isActive:function(){return this.state===a.ACTIVE},isLoopDelayed:function(){return this.state===a.LOOP_DELAY},isCompleteDelayed:function(){return this.state===a.COMPLETE_DELAY},isStartDelayed:function(){return this.state===a.START_DELAY},isPendingRemove:function(){return this.state===a.PENDING_REMOVE},isRemoved:function(){return this.state===a.REMOVED},isFinished:function(){return this.state===a.FINISHED},isDestroyed:function(){return this.state===a.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(n){n.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});l.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],s.exports=l},95042:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(83419),p=e(842),h=e(86353),a=new r({initialize:function(n,u,f,o,c,d,v,m,S,M){this.tween=n,this.targetIndex=u,this.duration=o,this.totalDuration=0,this.delay=0,this.getDelay=f,this.yoyo=c,this.hold=d,this.repeat=v,this.repeatDelay=m,this.repeatCounter=0,this.flipX=S,this.flipY=M,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(l){l===void 0&&(l=this.current),this.tween.targets[this.targetIndex][this.key]=l},setCreatedState:function(){this.state=h.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=h.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=h.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=h.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=h.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=h.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=h.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=h.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===h.CREATED},isDelayed:function(){return this.state===h.DELAY},isPendingRender:function(){return this.state===h.PENDING_RENDER},isPlayingForward:function(){return this.state===h.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===h.PLAYING_BACKWARD},isHolding:function(){return this.state===h.HOLD_DELAY},isRepeating:function(){return this.state===h.REPEAT_DELAY},isComplete:function(){return this.state===h.COMPLETE},setStateFromEnd:function(l){this.yoyo?this.onRepeat(l,!0,!0):this.repeatCounter>0?this.onRepeat(l,!0,!1):this.setCompleteState()},setStateFromStart:function(l){this.repeatCounter>0?this.onRepeat(l,!1):this.setCompleteState()},reset:function(){var l=this.tween,n=l.totalTargets,u=this.targetIndex,f=l.targets[u],o=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(f,o,0,u,n,l),this.repeatCounter=this.repeat===-1?h.MAX:this.repeat,this.setPendingRenderState();var c=this.duration+this.hold;this.yoyo&&(c+=this.duration);var d=c+this.repeatDelay;this.totalDuration=this.delay+c,this.repeat===-1?(this.totalDuration+=d*h.MAX,l.isInfinite=!0):this.repeat>0&&(this.totalDuration+=d*this.repeat),this.totalDuration>l.duration&&(l.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(l,n,u){var f=this.tween,o=f.totalTargets,c=this.targetIndex,d=f.targets[c],v=this.key,m=v!=="texture";if(this.elapsed=l,this.progress=l/this.duration,this.flipX&&d.toggleFlipX(),this.flipY&&d.toggleFlipY(),m&&(n||u)&&(this.start=this.getStartValue(d,v,this.start,c,o,f)),u){this.setPlayingBackwardState(),this.dispatchEvent(p.TWEEN_YOYO,"onYoyo");return}this.repeatCounter--,m&&(this.end=this.getEndValue(d,v,this.start,c,o,f)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-l,m&&(this.current=this.start,d[v]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(p.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});s.exports=a},69902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null};s.exports=y},81076:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},86081:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(70402),p=e(83419),h=e(842),a=e(44603),l=e(39429),n=e(36383),u=e(86353),f=e(48177),o=e(42220),c=new p({Extends:r,initialize:function(v,m){r.call(this,v),this.targets=m,this.totalTargets=m.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(d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z){var X=new f(this,d,v,m,S,M,w,C,A,P,b,O,I,D,B,G,z);return this.totalData=this.data.push(X),X},addFrame:function(d,v,m,S,M,w,C,A,P,b){var O=new o(this,d,v,m,S,M,w,C,A,P,b);return this.totalData=this.data.push(O),O},getValue:function(d){d===void 0&&(d=0);var v=null;return this.data&&(v=this.data[d].current),v},hasTarget:function(d){return this.targets&&this.targets.indexOf(d)!==-1},updateTo:function(d,v,m){if(m===void 0&&(m=!1),d!=="texture")for(var S=0;S0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(h.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,r.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(d,v,m){if(d===void 0&&(d=0),v===void 0&&(v=16.6),m===void 0&&(m=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;m||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive");var S=this.paused;if(this.paused=!1,d>0){for(var M=Math.floor(d/v),w=d-M*v,C=0;C0&&this.update(w)}return this.paused=S,this.isSeeking=!1,this},initTweenData:function(d){d===void 0&&(d=!1),this.duration=0,this.startDelay=n.MAX_SAFE_INTEGER;for(var v=this.data,m=0;m0?this.totalDuration=S+M+(S+C)*w:this.totalDuration=S+M},reset:function(d){return d===void 0&&(d=!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=u.MAX),d||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")),this},update:function(d){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(d*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(d),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(d),!1;this.hasStarted||(this.startDelay-=d,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(h.TWEEN_START,"onStart"),d=0));var v=!1;if(this.isActive())for(var m=this.data,S=0;S{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(72905),p=e(70402),h=e(83419),a=e(842),l=e(44603),n=e(39429),u=e(86353),f=new h({Extends:p,initialize:function(c){p.call(this,c),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?u.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(a.TWEEN_ACTIVE,"onActive"),this},add:function(o){var c=this.parent.create(o);Array.isArray(c)||(c=[c]);for(var d=this.data,v=0;v0)this.loopCounter--,this.resetTweens(),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},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var o=this.data,c=this.totalData,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95042),p=e(45319),h=e(83419),a=e(842),l=new h({Extends:r,initialize:function(u,f,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D){r.call(this,u,f,S,M,w,C,A,P,b,O),this.key=o,this.getActiveValue=v,this.getEndValue=c,this.getStartValue=d,this.ease=m,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=I,this.interpolationData=D},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex],f=this.key;n&&(u[f]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(u[f]=this.getActiveValue(u,f,0))},update:function(n){var u=this.tween,f=u.totalTargets,o=this.targetIndex,c=u.targets[o],d=this.key;if(!c)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(c,d,c[d],o,f,u),this.end=this.getEndValue(c,d,this.start,o,f,u),this.current=this.start,c[d]=this.start,this.setPlayingForwardState(),!0;var v=this.isPlayingForward(),m=this.isPlayingBackward();if(v||m){var S=this.elapsed,M=this.duration,w=0,C=!1;S+=n,S>=M?(w=S-M,S=M,C=!0):S<0&&(S=0);var A=p(S/M,0,1);if(this.elapsed=S,this.progress=A,this.previous=this.current,C)v?(this.current=this.end,c[d]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(w)):(this.current=this.start,c[d]=this.start,this.setStateFromStart(w));else{v||(A=1-A);var P=this.ease(A);this.interpolation?this.current=this.interpolation(this.interpolationData,P):this.current=this.start+(this.end-this.start)*P,c[d]=this.current}this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var o=f.targets[this.targetIndex],c=this.key,d=this.current,v=this.previous;f.emit(n,f,c,o,d,v);var m=f.callbacks[u];m&&m.func.apply(f.callbackScope,[f,o,c,d,v].concat(m.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});s.exports=l},42220:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(95042),p=e(45319),h=e(83419),a=e(842),l=new h({Extends:r,initialize:function(u,f,o,c,d,v,m,S,M,w,C){r.call(this,u,f,d,v,!1,m,S,M,w,C),this.key="texture",this.startTexture=null,this.endTexture=o,this.startFrame=null,this.endFrame=c,this.yoyo=S!==0},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=u.texture.key,this.startFrame=u.frame.name),n&&u.setTexture(this.startTexture,this.startFrame)},update:function(n){var u=this.tween,f=this.targetIndex,o=u.targets[f];if(!o)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(a.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&o.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),d=this.isPlayingBackward();if(c||d){var v=this.elapsed,m=this.duration,S=0,M=!1;v+=n,v>=m?(S=v-m,v=m,M=!0):v<0&&(v=0);var w=p(v/m,0,1);this.elapsed=v,this.progress=w,M&&(c?(o.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(S)):(o.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(S))),this.dispatchEvent(a.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var o=f.targets[this.targetIndex],c=this.key;f.emit(n,f,c,o);var d=f.callbacks[u];d&&d.func.apply(f.callbackScope,[f,o,c].concat(d.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});s.exports=l},86353:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999};s.exports=y},83419:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(l){return!!l.get&&typeof l.get=="function"||!!l.set&&typeof l.set=="function"}function e(l,n,u){var f=u?l[n]:Object.getOwnPropertyDescriptor(l,n);return!u&&f.value&&typeof f.value=="object"&&(f=f.value),f&&y(f)?(typeof f.enumerable>"u"&&(f.enumerable=!0),typeof f.configurable>"u"&&(f.configurable=!0),f):!1}function r(l,n){var u=Object.getOwnPropertyDescriptor(l,n);return u?(u.value&&typeof u.value=="object"&&(u=u.value),u.configurable===!1):!1}function p(l,n,u,f){for(var o in n)if(n.hasOwnProperty(o)){var c=e(n,o,u);if(c!==!1){var d=f||l;if(r(d.prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(l.prototype,o,c)}else l.prototype[o]=n[o]}}function h(l,n){if(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){};s.exports=y},20242:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){return null};s.exports=y},71146:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a){if(a===void 0&&(a=e),p>0){var l=p-e.length;if(l<=0)return null}if(!Array.isArray(r))return e.indexOf(r)===-1?(e.push(r),h&&h.call(a,r),r):null;for(var n=r.length-1;n>=0;)e.indexOf(r[n])!==-1&&r.splice(n,1),n--;if(n=r.length,n===0)return null;p>0&&n>l&&(r.splice(l),n=l);for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h,a,l){if(p===void 0&&(p=0),l===void 0&&(l=e),h>0){var n=h-e.length;if(n<=0)return null}if(!Array.isArray(r))return e.indexOf(r)===-1?(e.splice(p,0,r),a&&a.call(l,r),r):null;for(var u=r.length-1;u>=0;)e.indexOf(r[u])!==-1&&r.pop(),u--;if(u=r.length,u===0)return null;h>0&&u>n&&(r.splice(n),u=n);for(var f=u-1;f>=0;f--){var o=r[f];e.splice(p,0,o),a&&a.call(l,o)}return r};s.exports=y},66905:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);return p!==-1&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=0;if(r(h,n,u))for(var o=n;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h,a=[null];for(h=3;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u)){var f,o=[null];for(f=5;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r.length){if(r.length===1)return r[0]}else return NaN;var h=1,a,l;if(p){if(er.length&&(h=r.length),p?(a=r[h-1][p],l=r[h][p],l-e<=e-a?r[h]:r[h-1]):(a=r[h-1],l=r[h],l-e<=e-a?l:a)};s.exports=y},43491:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=[]);for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=[];if(r(h,n,u))for(var o=n;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){r===void 0&&(r=0),p===void 0&&(p=e.length);var h=r+Math.floor(Math.random()*p);return e[h]===void 0?null:e[h]};s.exports=y},85835:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return h>a||(e.splice(h,1),a===e.length-1?e.push(r):e.splice(a,0,r)),e};s.exports=y},83371:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);if(p>0){var h=e[p-1],a=e.indexOf(h);e[p]=h,e[a]=r}return e};s.exports=y},69693:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.indexOf(r);if(h===-1||p<0||p>=e.length)throw new Error("Supplied index out of bounds");return h!==p&&(e.splice(h,1),e.splice(p,0,r)),r};s.exports=y},40853:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);if(p!==-1&&p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=[],l,n=!1;if((p||h)&&(n=!0,p||(p=""),h||(h="")),r=r;l--)n?a.push(p+l.toString()+h):a.push(l);else for(l=e;l<=r;l++)n?a.push(p+l.toString()+h):a.push(l);return a};s.exports=y},593:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(2284),p=function(h,a,l){h===void 0&&(h=0),a===void 0&&(a=null),l===void 0&&(l=1),a===null&&(a=h,h=0);for(var n=[],u=Math.max(r((a-h)/(l||1)),0),f=0;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */function y(p,h,a){var l=p[h];p[h]=p[a],p[a]=l}function e(p,h){return ph?1:0}var r=function(p,h,a,l,n){for(a===void 0&&(a=0),l===void 0&&(l=p.length-1),n===void 0&&(n=e);l>a;){if(l-a>600){var u=l-a+1,f=h-a+1,o=Math.log(u),c=.5*Math.exp(2*o/3),d=.5*Math.sqrt(o*c*(u-c)/u)*(f-u/2<0?-1:1),v=Math.max(a,Math.floor(h-f*c/u+d)),m=Math.min(l,Math.floor(h+(u-f)*c/u+d));r(p,h,v,m,n)}var S=p[h],M=a,w=l;for(y(p,a,h),n(p[l],S)>0&&y(p,a,l);M0;)w--}n(p[a],S)===0?y(p,a,w):(w++,y(p,w,l)),w<=h&&(a=w+1),h<=w&&(l=w-1)}};s.exports=r},88492:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=e(33680),h=function(l,n,u){for(var f=[],o=0;o{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l,n){n===void 0&&(n=h);var u;if(!Array.isArray(a))return u=h.indexOf(a),u!==-1?(r(h,u),l&&l.call(n,a),a):null;for(var f=a.length-1,o=[];f>=0;){var c=a[f];u=h.indexOf(c),u!==-1&&(r(h,u),o.push(c),l&&l.call(n,c)),f--}return o};s.exports=p},60248:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l,n){if(n===void 0&&(n=h),a<0||a>h.length-1)throw new Error("Index out of bounds");var u=r(h,a);return l&&l.call(n,u),u};s.exports=p},81409:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(a===void 0&&(a=0),l===void 0&&(l=h.length),u===void 0&&(u=h),r(h,a,l)){var f=l-a,o=h.splice(a,f);if(n)for(var c=0;c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(19133),p=function(h,a,l){a===void 0&&(a=0),l===void 0&&(l=h.length);var n=a+Math.floor(Math.random()*l);return r(h,n)};s.exports=p},42169:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=e.indexOf(r),a=e.indexOf(p);return h!==-1&&a===-1?(e[h]=p,!0):!1};s.exports=y},86003:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){var a=e.length;if(r<0||r>a||r>=p||p>a){if(h)throw new Error("Range Error: Values outside acceptable range");return!1}else return!0};s.exports=y},89545:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){var p=e.indexOf(r);return p!==-1&&p>0&&(e.splice(p,1),e.unshift(r)),r};s.exports=y},17810:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82011),p=function(h,a,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=e.length-1;r>0;r--){var p=Math.floor(Math.random()*(r+1)),h=e[r];e[r]=e[p],e[p]=h}return e};s.exports=y},90126:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r=/\D/g;return e.sort(function(p,h){return parseInt(p.replace(r,""),10)-parseInt(h.replace(r,""),10)}),e};s.exports=y},19133:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){if(!(r>=e.length)){for(var p=e.length-1,h=e[r],a=r;a{/** + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(82264);function p(n,u){return String(n).localeCompare(u)}function h(n,u){var f=n.length;if(f<=1)return n;for(var o=new Array(f),c=1;cc&&(S=c),M>c&&(M=c),w=m,C=S;;)if(w{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(r===p)return e;var h=e.indexOf(r),a=e.indexOf(p);if(h<0||a<0)throw new Error("Supplied items must be elements of the same array");return e[h]=p,e[a]=r,e};s.exports=y},37105:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Matrix:e(54915),Add:e(71146),AddAt:e(51067),BringToTop:e(66905),CountAllMatching:e(21612),Each:e(95428),EachInRange:e(36914),FindClosestInSorted:e(81957),Flatten:e(43491),GetAll:e(46710),GetFirst:e(58731),GetRandom:e(26546),MoveDown:e(70864),MoveTo:e(69693),MoveUp:e(40853),MoveAbove:e(85835),MoveBelow:e(83371),NumberArray:e(20283),NumberArrayStep:e(593),QuickSelect:e(43886),Range:e(88492),Remove:e(72905),RemoveAt:e(60248),RemoveBetween:e(81409),RemoveRandomElement:e(31856),Replace:e(42169),RotateLeft:e(86003),RotateRight:e(49498),SafeRange:e(82011),SendToBack:e(89545),SetAll:e(17810),Shuffle:e(33680),SortByDigits:e(90126),SpliceOne:e(19133),StableSort:e(19186),Swap:e(25630)}},86922:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!Array.isArray(e)||!Array.isArray(e[0]))return!1;for(var r=e[0].length,p=1;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41836),p=e(86922),h=function(a){var l="";if(!p(a))return l;for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.reverse()};s.exports=y},21224:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=0;r{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h){return r(h,180)};s.exports=p},44657:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h,a){a===void 0&&(a=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 r=e(86922),p=e(2429),h=function(a,l){if(l===void 0&&(l=90),!r(a))return null;if(typeof l!="string"&&(l=(l%360+360)%360),l===90||l===-270||l==="rotateLeft")a=p(a),a.reverse();else if(l===-90||l===270||l==="rotateRight")a.reverse(),a=p(a);else if(Math.abs(l)===180||l==="rotate180"){for(var n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(37829),p=function(h,a){a===void 0&&(a=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 r=e(86003),p=e(49498),h=function(a,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),n!==0&&(n<0?r(a,Math.abs(n)):p(a,n)),l!==0)for(var u=0;u{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){for(var r=e.length,p=e[0].length,h=new Array(p),a=0;a-1;l--)h[a][l]=e[l][a]}return h};s.exports=y},54915:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={CheckMatrix:e(86922),MatrixToString:e(63362),ReverseColumns:e(92598),ReverseRows:e(21224),Rotate180:e(98717),RotateLeft:e(44657),RotateMatrix:e(37829),RotateRight:e(92632),Translate:e(69512),TransposeMatrix:e(2429)}},71334:s=>{/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=function(r,p){for(var h=new Uint8Array(r),a=h.length,l=p?"data:"+p+";base64,":"",n=0;n>2],l+=y[(h[n]&3)<<4|h[n+1]>>4],l+=y[(h[n+1]&15)<<2|h[n+2]>>6],l+=y[h[n+2]&63];return a%3===2?l=l.substring(0,l.length-1)+"=":a%3===1&&(l=l.substring(0,l.length-2)+"=="),l};s.exports=e},53134:s=>{/** + * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),r=0;r>4,v[n++]=(f&15)<<4|o>>2,v[n++]=(o&3)<<6|c&63;return d};s.exports=p},65839:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={ArrayBufferToBase64:e(71334),Base64ToArrayBuffer:e(53134)}},91799:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Array:e(37105),Base64:e(65839),Objects:e(1183),String:e(31749),NOOP:e(29747),NULL:e(20242)}},41786:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r={};for(var p in e)Array.isArray(e[p])?r[p]=e[p].slice(0):r[p]=e[p];return r};s.exports=y},62644:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){var r,p,h;if(typeof e!="object"||e===null)return e;r=Array.isArray(e)?[]:{};for(h in e)p=e[h],r[h]=y(p);return r};s.exports=y},79291:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41212),p=function(){var h,a,l,n,u,f,o=arguments[0]||{},c=1,d=arguments.length,v=!1;for(typeof o=="boolean"&&(v=o,o=arguments[1]||{},c=2),d===c&&(o=this,--c);c{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(75508),p=e(35154),h=function(a,l,n){var u=p(a,l,null);if(u===null)return n;if(Array.isArray(u))return r.RND.pick(u);if(typeof u=="object"){if(u.hasOwnProperty("randInt"))return r.RND.integerInRange(u.randInt[0],u.randInt[1]);if(u.hasOwnProperty("randFloat"))return r.RND.realInRange(u.randFloat[0],u.randFloat[1])}else if(typeof u=="function")return u(l);return u};s.exports=h},95540:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){var h=typeof e;return!e||h==="number"||h==="string"?p:e.hasOwnProperty(r)&&e[r]!==void 0?e[r]:p};s.exports=y},82840:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(35154),p=e(45319),h=function(a,l,n,u,f){f===void 0&&(f=n);var o=r(a,l,f);return p(o,n,u)};s.exports=h},35154:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){if(!e&&!h||typeof e=="number")return p;if(e&&e.hasOwnProperty(r))return e[r];if(h&&h.hasOwnProperty(r))return h[r];if(r.indexOf(".")!==-1){for(var a=r.split("."),l=e,n=h,u=p,f=p,o=!0,c=!0,d=0;d{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){for(var p=0;p{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.hasOwnProperty(r)};s.exports=y},41212:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){if(!e||typeof e!="object"||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!{}.hasOwnProperty.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}return!0};s.exports=y},46975:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a){var l=r(h);for(var n in a)l.hasOwnProperty(n)||(l[n]=a[n]);return l};s.exports=p},269:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(41786),p=function(h,a){var l=r(h);for(var n in a)l.hasOwnProperty(n)&&(l[n]=a[n]);return l};s.exports=p},18254:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var r=e(97022),p=function(h,a){for(var l={},n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p){if(!e||typeof e=="number")return!1;if(e.hasOwnProperty(r))return e[r]=p,!0;if(r.indexOf(".")!==-1){for(var h=r.split("."),a=e,l=e,n=0;n{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Clone:e(41786),DeepCopy:e(62644),Extend:e(79291),GetAdvancedValue:e(23568),GetFastValue:e(95540),GetMinMaxValue:e(82840),GetValue:e(35154),HasAll:e(69036),HasAny:e(1985),HasValue:e(97022),IsPlainObject:e(41212),Merge:e(46975),MergeRight:e(269),Pick:e(18254),SetValue:e(61622)}},27902:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return e.replace(/%([0-9]+)/g,function(p,h){return r[Number(h)-1]})};s.exports=y},41836:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r,p,h){r===void 0&&(r=0),p===void 0&&(p=" "),h===void 0&&(h=3),e=e.toString();var a=0;if(r+1>=e.length)switch(h){case 1:e=new Array(r+1-e.length).join(p)+e;break;case 3:var l=Math.ceil((a=r-e.length)/2),n=a-l;e=new Array(n+1).join(p)+e+new Array(l+1).join(p);break;default:e=e+new Array(r+1-e.length).join(p);break}return e};s.exports=y},33628:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e,r){return r===0?e.slice(1):e.slice(0,r-1)+e.slice(r)};s.exports=y},27671:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e.split("").reverse().join("")};s.exports=y},45650:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=Math.random()*16|0,p=e==="x"?r:r&3|8;return p.toString(16)})};s.exports=y},35355:s=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */var y=function(e){return e&&e[0].toUpperCase()+e.slice(1)};s.exports=y},31749:(s,y,e)=>{/** + * @author Richard Davey + * @copyright 2013-2024 Phaser Studio Inc. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */s.exports={Format:e(27902),Pad:e(41836),RemoveAt:e(33628),Reverse:e(27671),UppercaseFirst:e(35355),UUID:e(45650)}}},x={};function T(s){var y=x[s];if(y!==void 0)return y.exports;var e=x[s]={exports:{}};return i[s](e,e.exports,T),e.exports}T.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var E=T(85454);return E})())})(BM);var jm=BM.exports;const sd=Wd(jm);var PF=Object.create,zx=Object.defineProperty,RF=Object.defineProperties,bF=Object.getOwnPropertyDescriptor,LF=Object.getOwnPropertyDescriptors,FF=Object.getOwnPropertyNames,ZS=Object.getOwnPropertySymbols,OF=Object.getPrototypeOf,UM=Object.prototype.hasOwnProperty,DF=Object.prototype.propertyIsEnumerable,JS=(g,t,i)=>t in g?zx(g,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[t]=i,An=(g,t)=>{for(var i in t||(t={}))UM.call(t,i)&&JS(g,i,t[i]);if(ZS)for(var i of ZS(t))DF.call(t,i)&&JS(g,i,t[i]);return g},dh=(g,t)=>RF(g,LF(t)),si=(g,t)=>()=>(t||g((t={exports:{}}).exports,t),t.exports),IF=(g,t,i,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let T of FF(t))!UM.call(g,T)&&T!==i&&zx(g,T,{get:()=>t[T],enumerable:!(x=bF(t,T))||x.enumerable});return g},zM=(g,t,i)=>(i=g!=null?PF(OF(g)):{},IF(t||!g||!g.__esModule?zx(i,"default",{value:g,enumerable:!0}):i,g)),Zm=si(g=>{var t=function(E,s){return Es?1:0},i=function(E,s){return Es?-1:0};function x(E){return function(s,y){return E(y,s)}}function T(E){return E===2?function(s,y){return s[0]y[0]?1:s[1]y[1]?1:0}:function(s,y){for(var e=0;ey[e])return 1;e++}return 0}}g.DEFAULT_COMPARATOR=t,g.DEFAULT_REVERSE_COMPARATOR=i,g.reverseComparator=x,g.createTupleComparator=T}),NF=si(g=>{g.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",g.SYMBOL_SUPPORT=typeof Symbol<"u"}),zn=si((g,t)=>{var i=NF(),x=i.ARRAY_BUFFER_SUPPORT,T=i.SYMBOL_SUPPORT;t.exports=function(E,s){var y,e,r,p,h;if(!E)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(E)||x&&ArrayBuffer.isView(E)||typeof E=="string"||E.toString()==="[object Arguments]"){for(r=0,p=E.length;r{var i=Zm(),x=zn(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function s(u){if(this.clear(),this.comparator=u||T,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}s.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function y(u){return{item:u,degree:0}}function e(u,f){u.root?(f.right=u.root.right,f.left=u.root,u.root.right.left=f,u.root.right=f):u.root=f}s.prototype.push=function(u){var f=y(u);return f.left=f,f.right=f,e(this,f),(!this.min||this.comparator(f.item,this.min.item)<=0)&&(this.min=f),++this.size},s.prototype.peek=function(){return this.min?this.min.item:void 0};function r(u){for(var f=[],o=u,c=!1;!(o===u&&c);)o===u&&(c=!0),f.push(o),o=o.right;return f}function p(u,f){u.root===f&&(u.root=f.right),f.left.right=f.right,f.right.left=f.left}function h(u,f){u.child?(f.right=u.child.right,f.left=u.child,u.child.right.left=f,u.child.right=f):u.child=f}function a(u,f,o){p(u,f),f.left=f,f.right=f,h(o,f),o.degree++,f.parent=o}function l(u){var f=new Array(u.size),o=r(u.root),c,d,v,m,S,M;for(c=0,d=o.length;c0&&(M=v,v=m,m=M),a(u,m,v),f[S]=null,S++;f[S]=v}for(c=0;c{var t=Math.pow(2,8)-1,i=Math.pow(2,16)-1,x=Math.pow(2,32)-1,T=Math.pow(2,7)-1,E=Math.pow(2,15)-1,s=Math.pow(2,31)-1;g.getPointerArray=function(e){var r=e-1;if(r<=t)return Uint8Array;if(r<=i)return Uint16Array;if(r<=x)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},g.getSignedPointerArray=function(e){var r=e-1;return r<=T?Int8Array:r<=E?Int16Array:r<=s?Int32Array:Float64Array},g.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var y={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};g.getMinimalRepresentation=function(e,r){var p=null,h=0,a,l,n,u,f;for(u=0,f=e.length;uh&&(h=a,p=l);return p},g.isTypedArray=function(e){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(e)},g.concat=function(){var e=0,r,p,h;for(r=0,h=arguments.length;r{var t=zn(),i=Is();function x(y){return Array.isArray(y)||i.isTypedArray(y)}function T(y){if(typeof y.length=="number")return y.length;if(typeof y.size=="number")return y.size}function E(y){var e=T(y),r=typeof e=="number"?new Array(e):[],p=0;return t(y,function(h){r[p++]=h}),r}function s(y){var e=T(y),r=typeof e=="number"?i.getPointerArray(e):Array,p=typeof e=="number"?new Array(e):[],h=typeof e=="number"?new r(e):[],a=0;return t(y,function(l){p[a]=l,h[a]=a++}),[p,h]}g.isArrayLike=x,g.guessLength=T,g.toArray=E,g.toArrayWithIndices=s}),Vx=si((g,t)=>{var i=zn(),x=Zm(),T=sa(),E=x.DEFAULT_COMPARATOR,s=x.reverseComparator;function y(d,v,m,S){for(var M=v[S],w,C;S>m;){if(w=S-1>>1,C=v[w],d(M,C)<0){v[S]=C,S=w;continue}break}v[S]=M}function e(d,v,m){for(var S=v.length,M=m,w=v[m],C=2*m+1,A;C=0&&(C=A),v[m]=v[C],m=C,C=2*m+1;v[m]=w,y(d,v,M,m)}function r(d,v,m){v.push(m),y(d,v,0,v.length-1)}function p(d,v){var m=v.pop();if(v.length!==0){var S=v[0];return v[0]=m,e(d,v,0),S}return m}function h(d,v,m){if(v.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var S=v[0];return v[0]=m,e(d,v,0),S}function a(d,v,m){var S;return v.length!==0&&d(v[0],m)<0&&(S=v[0],v[0]=m,m=S,e(d,v,0)),m}function l(d,v){for(var m=v.length,S=m>>1,M=S;--M>=0;)e(d,v,M)}function n(d,v){for(var m=v.length,S=0,M=new Array(m);S=m.length)return m.slice().sort(d);for(P=m.slice(0,v),l(S,P),M=v,w=m.length;M0&&h(S,P,m[M]);return P.sort(d)}var b=T.guessLength(m);return b!==null&&b0&&h(S,P,O)),M++}),P.length>M&&(P.length=M),P.sort(d)}function f(d,v,m){arguments.length===2&&(m=v,v=d,d=E);var S=s(d),M,w,C,A=-1/0,P;if(v===1){if(T.isArrayLike(m)){for(M=0,w=m.length;M0)&&(A=C);return P=new m.constructor(1),P[0]=A,P}return i(m,function(O){(A===-1/0||d(O,A)>0)&&(A=O)}),[A]}if(T.isArrayLike(m)){if(v>=m.length)return m.slice().sort(S);for(P=m.slice(0,v),l(d,P),M=v,w=m.length;M0&&h(d,P,m[M]);return P.sort(S)}var b=T.guessLength(m);return b!==null&&b0&&h(d,P,O)),M++}),P.length>M&&(P.length=M),P.sort(S)}function o(d){if(this.clear(),this.comparator=d||E,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}o.prototype.clear=function(){this.items=[],this.size=0},o.prototype.push=function(d){return r(this.comparator,this.items,d),++this.size},o.prototype.peek=function(){return this.items[0]},o.prototype.pop=function(){return this.size!==0&&this.size--,p(this.comparator,this.items)},o.prototype.replace=function(d){return h(this.comparator,this.items,d)},o.prototype.pushpop=function(d){return a(this.comparator,this.items,d)},o.prototype.consume=function(){return this.size=0,n(this.comparator,this.items)},o.prototype.toArray=function(){return n(this.comparator,this.items.slice())},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);function c(d){if(this.clear(),this.comparator=d||E,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=s(this.comparator)}c.prototype=o.prototype,o.from=function(d,v){var m=new o(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},c.from=function(d,v){var m=new c(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},o.siftUp=e,o.siftDown=y,o.push=r,o.pop=p,o.replace=h,o.pushpop=a,o.heapify=l,o.consume=n,o.nsmallest=u,o.nlargest=f,o.MinHeap=o,o.MaxHeap=c,t.exports=o}),BF=si((g,t)=>{var i="";function x(r,p,h){for(var a=p.length,l=[],n=a,u=-1,f,o=0,c;n--;)u=Math.max(r[p[n]+h],u);for(c=u>>24&&32||u>>16&&24||u>>8&&16||8;o>o&15].push(p[n]);for(f=0;f<16;f++)for(u=l[f].length;u--;)p[++n]=l[f][u]}}function T(r,p,h,a){return r[h]-r[a]||(h%3===2?r[h+1]-r[a+1]||p[h+2]-p[a+2]:p[h+1]-p[a+1])}function E(r,p){var h=[],a=[],l=2*p/3|0,n=p-l,u=l+1>>1,f=l,o=0,c,d=[],v=[];if(p===1)return[0];for(;f--;)h[f]=(f*3>>1)+1;for(f=3;f--;)x(r,h,f);for(o=a[(h[0]/3|0)+(h[0]%3===1?0:u)]=1,f=1;fthis.firstLength&&n>this.firstLength)){for(p=Math.min(this.length-l,this.length-n),a=0;ar.length&&(r=this.text.slice(l,l+p))}return r},e.prototype.toString=function(){return this.array.join(",")},e.prototype.toJSON=function(){return this.array},e.prototype.inspect=function(){for(var r=new Array(this.length),p=0;p{var i=zn();function x(r){this.size=0,this.items=new Map,this.inverse=r}function T(){this.size=0,this.items=new Map,this.inverse=new x(this)}function E(){this.size=0,this.items.clear(),this.inverse.items.clear()}T.prototype.clear=E,x.prototype.clear=E;function s(r,p){if(this.items.has(r)){var h=this.items.get(r);if(h===p)return this;this.inverse.items.delete(h)}if(this.inverse.items.has(p)){var a=this.inverse.items.get(p);if(a===r)return this;this.items.delete(a)}return this.items.set(r,p),this.inverse.items.set(p,r),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}T.prototype.set=s,x.prototype.set=s;function y(r){if(this.items.has(r)){var p=this.items.get(r);return this.items.delete(r),this.inverse.items.delete(p),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}T.prototype.delete=y,x.prototype.delete=y;var e=["has","get","forEach","keys","values","entries"];e.forEach(function(r){T.prototype[r]=x.prototype[r]=function(){return Map.prototype[r].apply(this.items,arguments)}}),typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries,x.prototype[Symbol.iterator]=x.prototype.entries),T.prototype.inspect=function(){var r={left:this.items,right:this.inverse.items};return Object.defineProperty(r,"constructor",{value:T,enumerable:!1}),r},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),x.prototype.inspect=function(){var r={left:this.inverse.items,right:this.items};return Object.defineProperty(r,"constructor",{value:x,enumerable:!1}),r},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),T.from=function(r){var p=new T;return i(r,function(h,a){p.set(a,h)}),p},t.exports=T}),Vr=si((g,t)=>{function i(x){if(typeof x!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=x}typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var x=arguments,T=x.length,E=0;return new i(function(){return E>=T?{done:!0}:{done:!1,value:x[E++]}})},i.empty=function(){var x=new i(function(){return{done:!0}});return x},i.fromSequence=function(x){var T=0,E=x.length;return new i(function(){return T>=E?{done:!0}:{done:!1,value:x[T++]}})},i.is=function(x){return x instanceof i?!0:typeof x=="object"&&x!==null&&typeof x.next=="function"},t.exports=i}),GM=si(g=>{function t(s){return s|=s>>1,s|=s>>2,s|=s>>4,s|=s>>8,s|=s>>16,s&~(s>>1)}g.msb32=t;function i(s){return s|=s>>1,s|=s>>2,s|=s>>4,s&~(s>>1)}g.msb8=i,g.test=function(s,y){return s>>y&1},g.criticalBit8=function(s,y){return i(s^y)},g.criticalBit8Mask=function(s,y){return~i(s^y)>>>0&255},g.testCriticalBit8=function(s,y){return 1+(s|y)>>8},g.criticalBit32Mask=function(s,y){return~t(s^y)>>>0&4294967295},g.popcount=function(s){return s-=s>>1&1431655765,s=(s&858993459)+(s>>2&858993459),s=s+(s>>4)&252645135,s+=s>>8,s+=s>>16,s&127};var x=new Uint8Array(Math.pow(2,8));for(T=0,E=x.length;T>8&255]+x[s>>16&255]+x[s>>24&255]}}),zF=si((g,t)=>{var i=Vr(),x=GM();function T(E){this.length=E,this.clear()}T.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},T.prototype.set=function(E,s){var y=E>>5,e=E&31,r=this.array[y],p;return s===0||s===!1?p=this.array[y]&=~(1<>>0,p>r?this.size++:p>5,y=E&31,e=this.array[s],r;return r=this.array[s]&=~(1<>5,y=E&31,e=this.array[s],r=this.array[s]^=1<>>0,r>e?this.size++:r>5,y=E&31;return this.array[s]>>y&1},T.prototype.test=function(E){return!!this.get(E)},T.prototype.rank=function(E){if(this.size===0)return 0;for(var s=E>>5,y=E&31,e=0,r=0;r=this.length)return-1;for(var s,y=32,e=0,r=0,p=0,h=this.array.length;p>a&1,r===E)return e}},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.length,e,r,p=32,h=0,a=this.array.length;h>l&1,E.call(s,r,h*32+l)}},T.prototype.values=function(){var E=this.length,s=!1,y,e,r=this.array,p=r.length,h=0,a=-1,l=32;return new i(function n(){if(!s){if(h>=p)return{done:!0};h===p-1&&(l=E%32||32),y=r[h++],s=!0,a=-1}return a++,a>=l?(s=!1,n()):(e=y>>a&1,{value:e})})},T.prototype.entries=function(){var E=this.length,s=!1,y,e,r=this.array,p,h=r.length,a=0,l=-1,n=32;return new i(function u(){if(!s){if(a>=h)return{done:!0};a===h-1&&(n=E%32||32),y=r[a++],s=!0,l=-1}return l++,p=~-a*32+l,l>=n?(s=!1,u()):(e=y>>l&1,{value:[p,e]})})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=new Uint8Array(this.length);return this.forEach(function(s,y){E[y]=s}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return Array.from(this.array)},t.exports=T}),GF=si((g,t)=>{var i=Vr(),x=GM(),T=function(y){return Math.max(1,Math.ceil(y*1.5))};function E(y){return new Uint32Array(Math.ceil(y/32))}function s(y){var e=y||0,r=T;typeof y=="object"&&(e=y.initialLength||y.initialCapacity||0,r=y.policy||r),this.size=0,this.length=e,this.capacity=Math.ceil(this.length/32)*32,this.policy=r,this.array=E(this.capacity)}s.prototype.set=function(y,e){if(this.length>5,p=y&31,h=this.array[r],a;return e===0||e===!1?a=this.array[r]&=~(1<>>0,a>h?this.size++:a>5,r=y&31,p=this.array[e],h;return h=this.array[e]&=~(1<>5,r=y&31,p=this.array[e],h=this.array[e]^=1<>>0,h>p?this.size++:hthis.array.length?(this.array=new Uint32Array(p),this.array.set(r,0)):this.array=r.slice(0,p),this.capacity=y,this)},s.prototype.grow=function(y){var e;if(typeof y=="number"){if(this.capacity>=y)return this;for(e=this.capacity;e>5,p=e&31;return this.array[r]|=1<>5,r=y&31;return this.array[e]>>r&1}},s.prototype.get=function(y){if(!(this.length>5,r=y&31;return this.array[e]>>r&1}},s.prototype.test=function(y){return this.length>5,r=y&31,p=0,h=0;h=this.length)return-1;for(var e,r=32,p=0,h=0,a=0,l=this.array.length;a>n&1,h===y)return p}},s.prototype.forEach=function(y,e){e=arguments.length>1?e:this;for(var r=this.length,p,h,a=32,l=0,n=this.array.length;l>u&1,y.call(e,h,l*32+u)}},s.prototype.values=function(){var y=this.length,e=!1,r,p,h=this.array,a=h.length,l=0,n=-1,u=32;return new i(function f(){if(!e){if(l>=a)return{done:!0};l===a-1&&(u=y%32||32),r=h[l++],e=!0,n=-1}return n++,n>=u?(e=!1,f()):(p=r>>n&1,{value:p})})},s.prototype.entries=function(){var y=this.length,e=!1,r,p,h=this.array,a,l=h.length,n=0,u=-1,f=32;return new i(function o(){if(!e){if(n>=l)return{done:!0};n===l-1&&(f=y%32||32),r=h[n++],e=!0,u=-1}return u++,a=~-n*32+u,u>=f?(e=!1,o()):(p=r>>u&1,{value:[a,p]})})},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.inspect=function(){var y=new Uint8Array(this.length);return this.forEach(function(e,r){y[r]=e}),Object.defineProperty(y,"constructor",{value:s,enumerable:!1}),y},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},t.exports=s}),VF=si((g,t)=>{function i(E,s){return(E&65535)*s+(((E>>>16)*s&65535)<<16)&4294967295}function x(E,s){return(E&65535)+(s>>>16)+(((E>>>16)+s&65535)<<16)&4294967295}function T(E,s){return E<>>32-s}t.exports=function(E,s){var y=3432918353,e=461845907,r=15,p=13,h=5,a=1801774676,l=E,n,u,f;for(u=0,f=s.length-4;u<=f;u+=4)n=s[u]|s[u+1]<<8|s[u+2]<<16|s[u+3]<<24,n=i(n,y),n=T(n,r),n=i(n,e),l^=n,l=T(l,p),l=i(l,h),l=x(l,a);switch(n=0,s.length&3){case 3:n^=s[u+2]<<16;case 2:n^=s[u+1]<<8;case 1:n^=s[u],n=i(n,y),n=T(n,r),n=i(n,e),l^=n}return l^=s.length,l^=l>>>16,l=i(l,2246822507),l^=l>>>13,l=i(l,3266489909),l^=l>>>16,l>>>0}}),HF=si((g,t)=>{var i=VF(),x=zn(),T=Math.LN2*Math.LN2,E={errorRate:.005};function s(r){var p=new Uint16Array(r.length),h,a;for(h=0,a=r.length;h>3]|=n}return this},e.prototype.test=function(r){for(var p=s(r),h=0,a=this.hashFunctions;h>3]&1<<(7&l)))return!1}return!0},e.prototype.toJSON=function(){return this.data},e.from=function(r,p){if(!p&&(p=r.length||r.size,typeof p!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var h=new e(p);return x(r,function(a){h.add(a)}),h},t.exports=e}),WF=si((g,t)=>{var i=zn();function x(T){if(typeof T!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=T,this.clear()}x.prototype.add=function(T){if(!this.root)return this.root={item:T,children:{}},this.size++,this;for(var E=this.root,s;s=this.distance(T,E.item),!!E.children[s];)E=E.children[s];return E.children[s]={item:T,children:{}},this.size++,this},x.prototype.search=function(T,E){if(!this.root)return[];for(var s=[],y=[this.root],e,r,p,h,a;y.length;)for(e=y.pop(),p=this.distance(E,e.item),p<=T&&s.push({item:e.item,distance:p}),h=p-T,a=p+T+1;h{var i=sa(),x=Vr();function T(E,s){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof s!="number"||s<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=E,this.capacity=s,this.items=new E(this.capacity),this.clear()}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var s=this.start+this.size;return s>=this.capacity&&(s-=this.capacity),this.items[s]=E,++this.size},T.prototype.unshift=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var s=this.start-1;return this.start===0&&(s=this.capacity-1),this.items[s]=E,this.start=s,++this.size},T.prototype.pop=function(){if(this.size!==0){this.size--;var E=this.start+this.size;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.shift=function(){if(this.size!==0){var E=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[E]}},T.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},T.prototype.peekLast=function(){if(this.size!==0){var E=this.start+this.size-1;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.get=function(E){if(!(this.size===0||E>=this.capacity))return E=this.start+E,E>=this.capacity&&(E-=this.capacity),this.items[E]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.capacity,e=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[e];return e++,r++,e===s&&(e=0),{value:p,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.capacity,y=this.size,e=this.start,r=0;return new x(function(){if(r>=y)return{done:!0};var p=E[e];return e++,e===s&&(e=0),{value:[r++,p],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){if(arguments.length<3&&(y=i.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var e=new T(s,y);if(i.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=sa(),x=VM();function T(s,y){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof y!="number"||y<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=s,this.capacity=y,this.items=new s(this.capacity),this.clear()}function E(s){T.prototype[s]=x.prototype[s]}Object.keys(x.prototype).forEach(E),typeof Symbol<"u"&&Object.getOwnPropertySymbols(x.prototype).forEach(E),T.prototype.push=function(s){var y=this.start+this.size;return y>=this.capacity&&(y-=this.capacity),this.items[y]=s,this.size===this.capacity?(y++,y>=this.capacity?this.start=0:this.start=y,this.size):++this.size},T.prototype.unshift=function(s){var y=this.start-1;return this.start===0&&(y=this.capacity-1),this.items[y]=s,this.size===this.capacity?(this.start=y,this.size):(this.start=y,++this.size)},T.from=function(s,y,e){if(arguments.length<3&&(e=i.guessLength(s),typeof e!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var r=new T(y,e);if(i.isArrayLike(s)){var p,h;for(p=0,h=s.length;p{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=x,this.size=0}i.prototype.clear=function(){this.items.clear(),this.size=0},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x,this.size),this.items.set(x,T),this.size++),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this.size=this.items.size,this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){var T=this.items.delete(x);return this.size=this.items.size,T},i.prototype.forEach=function(x,T){T=arguments.length>1?T:this,this.items.forEach(x,T)},i.prototype.entries=function(){return this.items.entries()},i.prototype.keys=function(){return this.items.keys()},i.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),i.autoIncrement=function(){var x=0;return function(){return x++}},t.exports=i}),kF=si((g,t)=>{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=x}i.prototype.clear=function(){this.items=new WeakMap},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x),this.items.set(x,T)),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){return this.items.delete(x)},i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),t.exports=i}),KF=si((g,t)=>{var i=Is();function x(T){var E=i.getPointerArray(T),s=i.getPointerArray(Math.log2(T));this.size=T,this.dimension=T,this.parents=new E(T),this.ranks=new s(T);for(var y=0;yr?this.parents[y]=s:(this.parents[y]=s,this.ranks[s]++),this},x.prototype.connected=function(T,E){var s=this.find(T);return s===this.find(E)},x.prototype.mapping=function(){for(var T=i.getPointerArray(this.dimension),E={},s=new T(this.size),y=0,e,r=0,p=this.parents.length;r"u"?(s[r]=y,E[e]=y++):s[r]=E[e];return s},x.prototype.compile=function(){for(var T={},E=new Array(this.dimension),s=0,y,e=0,r=this.parents.length;e"u"?(E[s]=[e],T[y]=s++):E[T[y]].push(e);return E},x.prototype.inspect=function(){var T=this.compile();return Object.defineProperty(T,"constructor",{value:x,enumerable:!1}),T},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),t.exports=x}),Hx=si((g,t)=>{var i=Zm(),x=Vx(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function s(r,p,h,a){for(var l=h,n=a,u=p[a],f=2*a+1,o;f=0&&(f=o),p[a]=p[f],a=f,f=2*a+1;p[a]=u,x.siftDown(r,p,n,a)}function y(r,p,h,a){for(var l=a,n=l,u=new r(a),f,o;n>0;)f=h[--n],n!==0&&(o=h[0],h[0]=f,s(p,h,--a,0),f=o),u[n]=f;return u}function e(r,p,h){if(arguments.length===2&&(h=p,p=null),this.ArrayClass=r,this.capacity=h,this.items=new r(h),this.clear(),this.comparator=p||T,typeof h!="number"&&h<=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=E(this.comparator)}e.prototype.clear=function(){this.size=0},e.prototype.push=function(r){return this.size0&&x.replace(this.comparator,this.items,r),this.size},e.prototype.peek=function(){return this.items[0]},e.prototype.consume=function(){var r=y(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,r},e.prototype.toArray=function(){return y(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},e.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:e,enumerable:!1}),r},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),t.exports=e}),jF=si((g,t)=>{var i=zn(),x=function(E){return E};function T(E){if(this.items=new Map,this.clear(),Array.isArray(E)?(this.writeHashFunction=E[0],this.readHashFunction=E[1]):(this.writeHashFunction=E,this.readHashFunction=E),this.writeHashFunction||(this.writeHashFunction=x),this.readHashFunction||(this.readHashFunction=x),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.")}T.prototype.clear=function(){this.items.clear(),this.size=0},T.prototype.add=function(E){var s=this.writeHashFunction(E);return this.items.set(s,E),this.size=this.items.size,this},T.prototype.set=function(E,s){return E=this.writeHashFunction(E),this.items.set(E,s),this.size=this.items.size,this},T.prototype.get=function(E){return E=this.readHashFunction(E),this.items.get(E)},T.prototype.has=function(E){return E=this.readHashFunction(E),this.items.has(E)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this,this.items.forEach(function(y){E.call(s,y,y)})},T.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=Array.from(this.items.values());return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){var e=new T(s);return i(E,function(r,p){y?e.set(p,r):e.add(r)}),e},t.exports=T}),HM=si((g,t)=>{var i=Vr(),x=zn();function T(E){this.Container=E||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:T,enumerable:!1})}T.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},T.prototype.set=function(E,s){var y=this.items.get(E),e;return y||(this.dimension++,y=new this.Container,this.items.set(E,y)),this.Container===Set?(e=y.size,y.add(s),e"u"?0:this.Container===Set?s.size:s.length},T.prototype.count=T.prototype.multiplicity,T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;var y;function e(r){E.call(s,r,y)}this.items.forEach(function(r,p){y=p,r.forEach(e)})},T.prototype.forEachAssociation=function(E,s){s=arguments.length>1?s:this,this.items.forEach(E,s)},T.prototype.keys=function(){return this.items.keys()},T.prototype.values=function(){var E=this.items.values(),s=!1,y,e,r,p;return this.Container===Set?new i(function h(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,y=e.value.values()}return e=y.next(),e.done?(s=!1,h()):{done:!1,value:e.value}}):new i(function h(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,y=e.value,r=0,p=y.length}return r>=p?(s=!1,h()):{done:!1,value:y[r++]}})},T.prototype.entries=function(){var E=this.items.entries(),s=!1,y,e,r,p,h;return this.Container===Set?new i(function a(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,r=e.value[0],y=e.value[1].values()}return e=y.next(),e.done?(s=!1,a()):{done:!1,value:[r,e.value]}}):new i(function a(){if(!s){if(e=E.next(),e.done)return{done:!0};s=!0,r=e.value[0],y=e.value[1],p=0,h=y.length}return p>=h?(s=!1,a()):{done:!1,value:[r,y[p++]]}})},T.prototype.containers=function(){return this.items.values()},T.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries),T.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return this.items},T.from=function(E,s){var y=new T(s);return x(E,function(e,r){y.set(r,e)}),y},t.exports=T}),ZF=si((g,t)=>{var i=HM(),x=zn(),T=function(s){return s};function E(s,y){if(this.items=new i(y),this.clear(),Array.isArray(s)?(this.writeHashFunction=s[0],this.readHashFunction=s[1]):(this.writeHashFunction=s,this.readHashFunction=s),this.writeHashFunction||(this.writeHashFunction=T),this.readHashFunction||(this.readHashFunction=T),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.")}E.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},E.prototype.add=function(s){var y=this.writeHashFunction(s);return this.items.set(y,s),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.set=function(s,y){return s=this.writeHashFunction(s),this.items.set(s,y),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.get=function(s){return s=this.readHashFunction(s),this.items.get(s)},E.prototype.has=function(s){return s=this.readHashFunction(s),this.items.has(s)},E.prototype.forEach=function(s,y){y=arguments.length>1?y:this,this.items.forEach(function(e){s.call(y,e,e)})},E.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.values),E.prototype.inspect=function(){var s=Array.from(this);return Object.defineProperty(s,"constructor",{value:E,enumerable:!1}),s},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.from=function(s,y,e,r){arguments.length===3&&typeof e=="boolean"&&(r=e,e=Array);var p=new E(y,e);return x(s,function(h,a){r?p.set(a,h):p.add(h)}),p},t.exports=E}),JF=si((g,t)=>{var i=1024;function x(E){return(E&E-1)===0}function T(E,s){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var y=s||0,e=i,r=0;if(typeof s=="object"&&(y=s.initialCapacity||0,r=s.initialLength||0,e=s.blockSize||i),!e||!x(e))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var p=Math.max(r,y),h=Math.ceil(p/e);this.ArrayClass=E,this.length=r,this.capacity=h*e,this.blockSize=e,this.offsetMask=e-1,this.blockMask=Math.log2(e),this.blocks=new Array(h);for(var a=0;a>this.blockMask,e=E&this.offsetMask;return this.blocks[y][e]=s,this},T.prototype.get=function(E){if(!(this.length>this.blockMask,y=E&this.offsetMask;return this.blocks[s][y]}},T.prototype.grow=function(E){if(typeof E!="number"&&(E=this.capacity+this.blockSize),this.capacity>=E)return this;for(;this.capacity>this.blockMask,e=s&this.offsetMask;return this.blocks[y][e]=E,++this.length},T.prototype.pop=function(){if(this.length!==0){var E=this.blocks[this.blocks.length-1],s=--this.length&this.offsetMask;return E[s]}},T.prototype.inspect=function(){for(var E=new this.ArrayClass(this.length),s,y=0,e=this.length;y>this.blockMask,E[y]=this.blocks[s][y&this.offsetMask];return E.type=this.ArrayClass.name,E.items=this.length,E.capacity=this.capacity,E.blockSize=this.blockSize,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),t.exports=T}),WM=si((g,t)=>{var i=Vr(),x=sa();function T(E,s){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof s!="number"||s<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=s,this.ArrayClass=E,this.items=new this.ArrayClass(this.capacity),this.clear()}T.prototype.clear=function(){this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=E,this.size},T.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0,e=this.items.length;y=s)return{done:!0};var e=E[s-y-1];return y++,{value:e,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.size,y=0;return new i(function(){if(y>=s)return{done:!0};var e=E[s-y-1];return{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,s,y){if(arguments.length<3&&(y=x.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var e=new T(s,y);if(x.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=sa(),x=Is(),T=WM();function E(y,e,r,p,h,a,l,n){var u=l+(n-l)/2|0,f=~-u,o=-~u,c=r[u];p[a]=c+1;var d=e?e(y[c]):y[c][1],v=a*2+1,m=a*2+2,S=-1/0,M=-1/0;l<=f&&(S=E(y,e,r,p,h,v,l,f)),o<=n&&(M=E(y,e,r,p,h,m,o,n));var w=Math.max(d,S,M),C=c;return w===S?C=h[p[v]-1]:w===M&&(C=h[p[m]-1]),h[c]=C,w}function s(y,e){this.size=y.length,this.intervals=y;var r=null,p=null;Array.isArray(e)&&(r=e[0],p=e[1]);var h=y.length,a=x.getPointerArray(h+1),l=new a(h),n;for(n=1;nv?1:0});var u=Math.ceil(Math.log2(h+1)),f=Math.pow(2,u)-1,o=new a(f),c=new a(h);E(y,p,l,o,c,0,0,h-1),l=null,this.height=u,this.tree=o,this.augmentations=c,this.startGetter=r,this.endGetter=p,this.stack=new T(a,this.height)}s.prototype.intervalsContainingPoint=function(y){var e=[],r=this.stack;r.clear(),r.push(0);for(var p=this.tree.length,h,a,l,n,u,f,o,c,d;r.size;)h=r.pop(),a=this.tree[h]-1,l=this.intervals[a],n=this.intervals[this.augmentations[a]],o=this.endGetter?this.endGetter(n):n[1],!(y>o)&&(c=h*2+1,c=u&&y<=f&&e.push(l),!(yd)&&(v=l*2+1,v=o&&e<=c&&p.push(u),!(r{g.search=function(t,i,x,T){var E=0;x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length,T--;for(var s;x<=T;)if(E=x+T>>>1,s=t[E],s>i)T=~-E;else if(s>>1,y=t(i[T],x),y>0)s=~-T;else if(y<0)E=-~T;else return T;return-1},g.lowerBound=function(t,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length;x>>1,i<=t[E]?T=E:x=-~E;return x},g.lowerBoundWithComparator=function(t,i,x){for(var T=0,E=0,s=i.length;E>>1,t(x,i[T])<=0?s=T:E=-~T;return E},g.lowerBoundIndices=function(t,i,x,T,E){var s=0;for(T=typeof T<"u"?T:0,E=typeof E<"u"?E:t.length;T>>1,x<=t[i[s]]?E=s:T=-~s;return T},g.upperBound=function(t,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:t.length;x>>1,i>=t[E]?x=-~E:T=E;return x},g.upperBoundWithComparator=function(t,i,x){for(var T=0,E=0,s=i.length;E>>1,t(x,i[T])>=0?E=-~T:s=T;return E}}),QF=si(g=>{var t=Is(),i=sa().isArrayLike,x=XM(),T=Gx();function E(r,p){if(r.length===0)return p.slice();if(p.length===0)return r.slice();var h;r[0]>p[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(a<=l)return t.isTypedArray(r)?t.concat(r,p):r.concat(p);var n=new r.constructor(r.length+p.length),u,f,o;for(u=0,f=r.length;up[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(ap[0]&&(h=r,r=p,p=h);var a=r[r.length-1],l=p[0];if(av?o=x.lowerBound(p,d,o+1):(n.push(d),u++,o++);return n};function y(r){var p=0,h=-1/0,a,l,n,u=[];for(l=0,n=r.length;lh&&(h=a));if(u.length===0)return new r[0].constructor(0);if(u.length===1)return u[0].slice();if(u.length===2)return E(u[0],u[1]);r=u;var f=new r[0].constructor(p),o=t.getPointerArray(h),c=new o(r.length),d=new T(function(S,M){return S=r[S][c[S]],M=r[M][c[M]],SM?1:0});for(l=0;lp&&(p=h));if(n.length===0)return new r[0].constructor(0);if(n.length===1)return n[0].slice();if(n.length===2)return s(n[0],n[1]);r=n;var u=new r[0].constructor,f=t.getPointerArray(p),o=new f(r.length),c=new T(function(m,S){return m=r[m][o[m]],S=r[S][o[S]],mS?1:0});for(a=0;ap&&(p=a),lh)return[];if(p===h)return[p];var o,c,d=r[0],v,m,S,M,w,C,A=p;for(u=1;uC?m=x.lowerBound(c,w,m+1):(d.push(w),v++,m++);if(d.length===0)return d;A=d[0]}return d},g.merge=function(){if(arguments.length===2){if(i(arguments[0]))return E(arguments[0],arguments[1])}else if(i(arguments[0]))return y(arguments);return null},g.unionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return s(arguments[0],arguments[1])}else if(i(arguments[0]))return e(arguments);return null},g.intersectionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return g.intersectionUniqueArrays(arguments[0],arguments[1])}else if(i(arguments[0]))return g.kWayIntersectionUniqueArrays(arguments);return null}}),_F=si((g,t)=>{var i=Vr(),x=zn(),T=QF();function E(y){return y}function s(y){if(this.clear(),Array.isArray(y)?(this.documentTokenizer=y[0],this.queryTokenizer=y[1]):(this.documentTokenizer=y,this.queryTokenizer=y),this.documentTokenizer||(this.documentTokenizer=E),this.queryTokenizer||(this.queryTokenizer=E),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.")}s.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},s.prototype.add=function(y){this.size++;var e=this.items.length;this.items.push(y);var r=this.documentTokenizer(y);if(!Array.isArray(r))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var p=new Set,h,a,l=0,n=r.length;l"u"||r.length===0)return[];if(e.length>1)for(h=1,a=e.length;h"u"||p.length===0)return[];r=T.intersectionUniqueArrays(r,p)}var l=new Array(r.length);for(h=0,a=l.length;h1?e:this;for(var r=0,p=this.documents.length;r=e)return{done:!0};var p=y[r++];return{value:p,done:!1}})},s.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.documents),s.prototype.inspect=function(){var y=this.items.slice();return Object.defineProperty(y,"constructor",{value:s,enumerable:!1}),y},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.from=function(y,e){var r=new s(e);return x(y,function(p){r.add(p)}),r},t.exports=s}),YM=si(g=>{var t=new Float64Array(64),i=new Float64Array(64);function x(E,s,y){var e,r,p,h,a;for(t[0]=s,i[0]=y,r=0;r>=0;)if(p=t[r],h=i[r]-1,p=e&&pi[r-1]-t[r-1]&&(a=t[r],t[r]=t[r-1],t[r-1]=a,a=i[r],i[r]=i[r-1],i[r-1]=a)}else r--;return E}g.inplaceQuickSort=x;function T(E,s,y,e){var r,p,h,a,l,n;for(t[0]=y,i[0]=e,p=0;p>=0;)if(h=t[p],a=i[p]-1,h=r&&hi[p-1]-t[p-1]&&(n=t[p],t[p]=t[p-1],t[p-1]=n,n=i[p],i[p]=i[p-1],i[p-1]=n)}else p--;return s}g.inplaceQuickSortIndices=T}),qF=si((g,t)=>{var i=sa(),x=Is(),T=Zm().createTupleComparator,E=Hx(),s=YM().inplaceQuickSortIndices;function y(l,n,u,f){var o,c=0,d;for(o=0;o>>1),P=u[A],d[D]=P,w>-1&&(C===0?v[w]=D+1:m[w]=D+1),I=(I+1)%l,A!==b&&A!==O-1&&S.push([I,A+1,O,D,1]),A!==b&&S.push([I,b,A,D,0]),D++;return{axes:n,labels:f,pivots:d,lefts:v,rights:m}}function p(l,n){this.dimensions=l,this.visited=0,this.axes=n.axes,this.labels=n.labels,this.pivots=n.pivots,this.lefts=n.lefts,this.rights=n.rights,this.size=this.labels.length}p.prototype.nearestNeighbor=function(l){var n=1/0,u=null,f=this.dimensions,o=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(M,w){m++;var C=d[w],A=v[w],P=c[w],b=y(f,o,P,l);if(!(b0?C!==0&&S(M,C-1):A!==0&&S(M,A-1),O*O0?A!==0&&S(M,A-1):C!==0&&S(M,C-1))}}return S(0,0),this.visited=m,this.labels[u]};var h=T(3),a=T(2);p.prototype.kNearestNeighbors=function(l,n){if(l<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(l=Math.min(l,this.size),l===1)return[this.nearestNeighbor(n)];var u=new E(Array,h,l),f=this.dimensions,o=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(C,A){var P=d[A],b=v[A],O=c[A],I=y(f,o,O,n);u.push([I,m++,O]);var D=n[C],B=o[C][O],G=D-B;C=(C+1)%f,D{var i=Vr(),x=zn();function T(){this.clear()}T.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},T.prototype.first=function(){return this.head?this.head.item:void 0},T.prototype.peek=T.prototype.first,T.prototype.last=function(){return this.tail?this.tail.item:void 0},T.prototype.push=function(E){var s={item:E,next:null};return this.head?(this.tail.next=s,this.tail=s):(this.head=s,this.tail=s),this.size++,this.size},T.prototype.unshift=function(E){var s={item:E,next:null};return this.head?(this.head.next||(this.tail=this.head),s.next=this.head,this.head=s):(this.head=s,this.tail=s),this.size++,this.size},T.prototype.shift=function(){if(this.size){var E=this.head;return this.head=E.next,this.size--,E.item}},T.prototype.forEach=function(E,s){if(this.size){s=arguments.length>1?s:this;for(var y=this.head,e=0;y;)E.call(s,y.item,e,this),y=y.next,e++}},T.prototype.toArray=function(){if(!this.size)return[];for(var E=new Array(this.size),s=0,y=this.size,e=this.head;s{var i=Vr(),x=zn(),T=Is(),E=sa();function s(y,e,r){if(arguments.length<2&&(r=y,y=null,e=null),this.capacity=r,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 p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof e=="function"?new e(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items={}}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},s.prototype.splayOnTop=function(y){var e=this.head;if(this.head===y)return this;var r=this.backward[y],p=this.forward[y];return this.tail===y?this.tail=r:this.backward[p]=r,this.forward[r]=p,this.backward[e]=y,this.head=y,this.forward[y]=e,this},s.prototype.set=function(y,e){var r=this.items[y];if(typeof r<"u"){this.splayOnTop(r),this.V[r]=e;return}this.size1?e:this;for(var r=0,p=this.size,h=this.head,a=this.K,l=this.V,n=this.forward;r=e)return{done:!0};var a=p[r];return y++,y=e)return{done:!0};var a=p[r];return y++,y=e)return{done:!0};var l=p[r],n=h[r];return y++,y{var i=Wx(),x=zn(),T=Is(),E=sa();function s(e,r,p){arguments.length<2?i.call(this,e):i.call(this,e,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)s.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),s.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},s.prototype.set=function(e,r){var p=this.items[e];if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],delete this.items[this.K[p]]),this.items[e]=p,this.K[p]=e,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},s.prototype.setpop=function(e,r){var p=null,h=null,a=this.items[e];return typeof a<"u"?(this.splayOnTop(a),p=this.V[a],this.V[a]=r,{evicted:!1,key:e,value:p}):(this.size0?a=this.deleted[--this.deletedSize]:a=this.size,this.size++):(a=this.tail,this.tail=this.backward[a],p=this.V[a],h=this.K[a],delete this.items[h]),this.items[e]=a,this.K[a]=e,this.V[a]=r,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a,h?{evicted:!0,key:h,value:p}:null)},s.prototype.delete=function(e){var r=this.items[e];if(typeof r>"u")return!1;if(delete this.items[e],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},s.prototype.remove=function(e,r=void 0){var p=this.items[e];if(typeof p>"u")return r;var h=this.V[p];if(delete this.items[e],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var a=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=a),this.forward[a]=l,this.backward[l]=a,this.size--,this.deleted[this.deletedSize++]=p,h},s.from=function(e,r,p,h){if(arguments.length<2){if(h=E.guessLength(e),typeof h!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var a=new s(r,p,h);return x(e,function(l,n){a.set(n,l)}),a},t.exports=s}),kM=si((g,t)=>{var i=Wx(),x=zn(),T=Is(),E=sa();function s(y,e,r){if(arguments.length<2&&(r=y,y=null,e=null),this.capacity=r,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 p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof e=="function"?new e(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items=new Map}s.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},s.prototype.set=function(y,e){var r=this.items.get(y);if(typeof r<"u"){this.splayOnTop(r),this.V[r]=e;return}this.size{var i=kM(),x=zn(),T=Is(),E=sa();function s(e,r,p){arguments.length<2?i.call(this,e):i.call(this,e,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)s.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),s.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},s.prototype.set=function(e,r){var p=this.items.get(e);if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],this.items.delete(this.K[p])),this.items.set(e,p),this.K[p]=e,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},s.prototype.setpop=function(e,r){var p=null,h=null,a=this.items.get(e);return typeof a<"u"?(this.splayOnTop(a),p=this.V[a],this.V[a]=r,{evicted:!1,key:e,value:p}):(this.size0?a=this.deleted[--this.deletedSize]:a=this.size,this.size++):(a=this.tail,this.tail=this.backward[a],p=this.V[a],h=this.K[a],this.items.delete(h)),this.items.set(e,a),this.K[a]=e,this.V[a]=r,this.forward[a]=this.head,this.backward[this.head]=a,this.head=a,h?{evicted:!0,key:h,value:p}:null)},s.prototype.delete=function(e){var r=this.items.get(e);if(typeof r>"u")return!1;if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},s.prototype.remove=function(e,r=void 0){var p=this.items.get(e);if(typeof p>"u")return r;var h=this.V[p];if(this.items.delete(e),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var a=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=a),this.forward[a]=l,this.backward[l]=a,this.size--,this.deleted[this.deletedSize++]=p,h},s.from=function(e,r,p,h){if(arguments.length<2){if(h=E.guessLength(e),typeof h!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var a=new s(r,p,h);return x(e,function(l,n){a.set(n,l)}),a},t.exports=s}),nO=si((g,t)=>{var i=Vr(),x=zn(),T=Hx(),E=function(y,e){return y[1]>e[1]?-1:y[1]"u"?0:e},s.prototype.get=s.prototype.multiplicity,s.prototype.count=s.prototype.multiplicity,s.prototype.frequency=function(y){if(this.size===0)return 0;var e=this.multiplicity(y);return e/this.size},s.prototype.top=function(y){if(typeof y!="number"||y<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var e=new T(Array,E,y),r=this.items.entries(),p;p=r.next(),!p.done;)e.push(p.value);return e.consume()},s.prototype.forEach=function(y,e){e=arguments.length>1?e:this;var r;this.items.forEach(function(p,h){for(r=0;r1?e:this,this.items.forEach(y,e)},s.prototype.keys=function(){return this.items.keys()},s.prototype.values=function(){var y=this.items.entries(),e=!1,r,p,h,a;return new i(function l(){if(!e){if(r=y.next(),r.done)return{done:!0};e=!0,p=r.value[0],h=r.value[1],a=0}return a>=h?(e=!1,l()):(a++,{done:!1,value:p})})},s.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(s.prototype[Symbol.iterator]=s.prototype.values),s.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect),s.prototype.toJSON=function(){return this.items},s.from=function(y){var e=new s;return x(y,function(r){e.add(r)}),e},s.isSubset=function(y,e){var r=y.multiplicities(),p,h,a;if(y===e)return!0;if(y.dimension>e.dimension)return!1;for(;p=r.next(),!p.done;)if(h=p.value[0],a=p.value[1],e.multiplicity(h){var i=Vr(),x=zn();function T(l,n,u){return((Math.pow(l,2)-Math.pow(Math.abs(n-u),2))/2|0)+l+1}function E(l,n){for(var u=0,f=0,o=n+1;fn.length?-1:l.lengthn?1:0}function y(l,n){var u=l+1,f=n/u|0,o=f+1,c,d,v=n-f*u,m=u-v,S=new Array(l+1);for(c=0;c 0");this.levenshtein=l,this.k=n,this.clear()}a.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},a.prototype.add=function(l){var n=l.length,u=this.size;this.strings.push(l),this.size++;var f=e(this.k,l),o=this.invertedIndices[n];typeof o>"u"&&(o={},this.invertedIndices[n]=o);var c,d,v,m,S;for(m=0,S=f.length;m"u"?(d=[u],o[v]=d):d.push(u);return this},a.prototype.search=function(l){var n=l.length,u=this.k,f=new Set,o,c,d,v,m,S,M,w,C,A,P,b,O,I,D;for(w=Math.max(0,n-u),C=n+u+1;w1?n:this;for(var u=0,f=this.strings.length;u=n)return{done:!0};var f=l[u];return u++,{value:f,done:!1}})},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.inspect=function(){var l=this.strings.slice();return Object.defineProperty(l,"constructor",{value:a,enumerable:!1}),l},typeof Symbol<"u"&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(l,n,u){var f=new a(n,u);return x(l,function(o){f.add(o)}),f},a.countKeys=E,a.comparator=s,a.partition=y,a.segments=e,a.segmentPos=r,a.multiMatchAwareInterval=p,a.multiMatchAwareSubstrings=h,t.exports=a}),sO=si((g,t)=>{var i=Vr(),x=zn();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},T.prototype.enqueue=function(E){return this.items.push(E),++this.size},T.prototype.dequeue=function(){if(this.size){var E=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,E}},T.prototype.peek=function(){if(this.size)return this.items[this.offset]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=this.offset,e=0,r=this.items.length;y=E.length)return{done:!0};var y=E[s];return s++,{value:y,done:!1}})},T.prototype.entries=function(){var E=this.items,s=this.offset,y=0;return new i(function(){if(s>=E.length)return{done:!0};var e=E[s];return s++,{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var s=new T;return x(E,function(y){s.enqueue(y)}),s},T.of=function(){return T.from(arguments)},t.exports=T}),aO=si((g,t)=>{var i=Vr(),x=zn();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.size=0},T.prototype.push=function(E){return this.items.push(E),++this.size},T.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0,e=this.items.length;y=s)return{done:!0};var e=E[s-y-1];return y++,{value:e,done:!1}})},T.prototype.entries=function(){var E=this.items,s=E.length,y=0;return new i(function(){if(y>=s)return{done:!0};var e=E[s-y-1];return{value:[y++,e],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var s=new T;return x(E,function(y){s.push(y)}),s},T.of=function(){return T.from(arguments)},t.exports=T}),oO=si(g=>{g.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var t=new Set,i=1/0,x=null,T,E,s=arguments.length;for(E=0;Ei.size)return!1;for(;T=x.next(),!T.done;)if(!i.has(T.value))return!1;return!0},g.isSuperset=function(t,i){return g.isSubset(i,t)},g.add=function(t,i){for(var x=i.values(),T;T=x.next(),!T.done;)t.add(T.value)},g.subtract=function(t,i){for(var x=i.values(),T;T=x.next(),!T.done;)t.delete(T.value)},g.intersect=function(t,i){for(var x=t.values(),T;T=x.next(),!T.done;)i.has(T.value)||t.delete(T.value)},g.disjunct=function(t,i){for(var x=t.values(),T,E=[];T=x.next(),!T.done;)i.has(T.value)&&E.push(T.value);for(x=i.values();T=x.next(),!T.done;)t.has(T.value)||t.add(T.value);for(var s=0,y=E.length;si.size&&(x=t,t=i,i=x),t.size===0)return 0;if(t===i)return t.size;for(var T=t.values(),E,s=0;E=T.next(),!E.done;)i.has(E.value)&&s++;return s},g.unionSize=function(t,i){var x=g.intersectionSize(t,i);return t.size+i.size-x},g.jaccard=function(t,i){var x=g.intersectionSize(t,i);if(x===0)return 0;var T=t.size+i.size-x;return x/T},g.overlap=function(t,i){var x=g.intersectionSize(t,i);return x===0?0:x/Math.min(t.size,i.size)}}),lO=si((g,t)=>{var i=Vr(),x=Is().getPointerArray;function T(E){var s=x(E);this.start=0,this.size=0,this.capacity=E,this.dense=new s(E),this.sparse=new s(E)}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.has=function(E){if(this.size===0)return!1;var s=this.sparse[E],y=s=this.start&&s=this.start&&s1?s:this;for(var y=this.capacity,e=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[e];return e++,r++,e===s&&(e=0),{value:p,done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=[];return this.forEach(function(s){E.push(s)}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E.capacity=this.capacity,E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),t.exports=T}),hO=si((g,t)=>{var i=Vr(),x=Is().getPointerArray;function T(E,s){arguments.length<2&&(s=E,E=Array);var y=x(s);this.size=0,this.length=s,this.dense=new y(s),this.sparse=new y(s),this.vals=new E(s)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var s=this.sparse[E];return s=this.size||this.dense[s]!==E?!1:(s=this.dense[this.size-1],this.dense[this.sparse[E]]=s,this.sparse[s]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y=0;y{var i=Vr(),x=Is().getPointerArray;function T(E){var s=x(E);this.size=0,this.length=E,this.dense=new s(E),this.sparse=new s(E)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var s=this.sparse[E];return s=this.size||this.dense[s]!==E?!1:(s=this.dense[this.size-1],this.dense[this.sparse[E]]=s,this.sparse[s]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,s){s=arguments.length>1?s:this;for(var y,e=0;e{var i=zn(),x=2,T=2,E=new Set([0,1,2]),s={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function y(n){var u=new Set;return typeof n=="number"&&u.add(n),{suggestions:u,count:0}}function e(n,u,f){return{term:n||"",distance:u||0,count:f||0}}function r(n,u,f,o){o=o||new Set,u++;var c,d=n.length,v;if(d>1)for(v=0;v0&&n[v].length-d.length>o.length-d.length&&(f.suggestions=new Set,f.count=0),(u===2||!f.suggestions.size||n[v].length-d.length>=o.length-d.length)&&f.suggestions.add(c)}function h(n,u){var f=n.length,o=u.length,c=[[]],d=f+o,v=new Map,m,S,M;for(c[0][0]=d,m=0;m<=f;m++)c[m+1]||(c[m+1]=[]),c[m+1][1]=m,c[m+1][0]=d;for(M=0;M<=o;M++)c[1][M+1]=M,c[0][M+1]=d;var w=n+u,C;for(m=0,S=w.length;mc)return[];for(var m=[d],S=new Set,M=new Set,w=[],C,A;m.length>0&&(C=m.shift(),!(f<2&&w.length>0&&v-C.length>w[0].distance));){if(A=n[C],A!==void 0){if(typeof A=="number"&&(A=y(A)),A.count>0&&!M.has(C)){M.add(C);var P=e(C,v-C.length,A.count);if(w.push(P),f<2&&v-C.length===0)break}A.suggestions.forEach(D=>{var B=u[D];if(!M.has(B)){M.add(B);var G=0;if(d!==B)if(B.length===C.length)G=v-C.length;else if(v===C.length)G=B.length-C.length;else{for(var z=0,X=0,K=B.length;z0||X>0?G=h(B.substr(z,K-z-X),d.substr(z,v-z-X)):G=h(B,d)}if(f<2&&w.length>0&&w[0].distance>G&&(w=[]),!(f<2&&w.length>0&&G>w[0].distance)&&G<=o){var Q=n[B];Q!==void 0&&w.push(e(B,G,Q.count))}}})}if(v-C.length0&&v-C.length>=w[0].distance)continue;for(var b=0,O=C.length;bthis.maxLength&&(this.maxLength=n.length)),u.count===1){var f=this.words.length;this.words.push(n);var o=r(n,0,this.maxDistance);o.forEach(c=>{var d=this.dictionary[c];d!==void 0?(typeof d=="number"&&(d=y(d),this.dictionary[c]=d),d.suggestions.has(f)||p(this.words,this.verbosity,d,n,f,c)):this.dictionary[c]=f})}return this.size++,this},l.prototype.search=function(n){return a(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,n)},l.prototype.inspect=function(){var n=[];n.size=this.size,n.maxDistance=this.maxDistance,n.verbosity=this.verbosity,n.behavior=s[this.verbosity];for(var u in this.dictionary)typeof this.dictionary[u]=="object"&&this.dictionary[u].count&&n.push([u,this.dictionary[u].count]);return Object.defineProperty(n,"constructor",{value:l,enumerable:!1}),n},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(n,u){var f=new l(u);return i(n,function(o){f.add(o)}),f},t.exports=l}),KM=si((g,t)=>{var i=zn(),x=Vr(),T="\0";function E(s){this.mode=s===Array?"array":"string",this.clear()}E.prototype.clear=function(){this.root={},this.size=0},E.prototype.set=function(s,y){for(var e=this.root,r,p=0,h=s.length;p"u")return;if(T in y)return y[T]},E.prototype.delete=function(s){var y=this.root,e=null,r=null,p,h,a,l;for(a=0,l=s.length;a"u")return!1;e!==null?Object.keys(y).length>1&&(e=null,r=null):Object.keys(y).length<2&&(e=p,r=h)}return T in y?(this.size--,e?delete e[r]:delete y[T],!0):!1},E.prototype.has=function(s){for(var y=this.root,e,r=0,p=s.length;r"u")return!1;return T in y},E.prototype.find=function(s){var y=typeof s=="string",e=this.root,r=[],p,h,a;for(h=0,a=s.length;h"u")return r;for(var l=[e],n=[s],u;l.length;){s=n.pop(),e=l.pop();for(u in e){if(u===T){r.push([s,e[T]]);continue}l.push(e[u]),n.push(y?s+u:s.concat(u))}}return r},E.prototype.values=function(s){var y=this.root,e=[],r,p,h;if(s){for(p=0,h=s.length;p"u")return x.empty()}return e.push(y),new x(function(){for(var a,l=!1,n;e.length;){a=e.pop();for(n in a){if(n===T){l=!0;continue}e.push(a[n])}if(l)return{done:!1,value:a[T]}}return{done:!0}})},E.prototype.prefixes=function(s){var y=this.root,e=[],r=[],p,h,a,l=this.mode==="string";if(s){for(h=0,a=s.length;h"u")return x.empty()}else s=l?"":[];return e.push(y),r.push(s),new x(function(){for(var n,u,f=!1,o;e.length;){n=e.pop(),u=r.pop();for(o in n){if(o===T){f=!0;continue}e.push(n[o]),r.push(l?u+o:u.concat(o))}if(f)return{done:!1,value:u}}return{done:!0}})},E.prototype.keys=E.prototype.prefixes,E.prototype.entries=function(s){var y=this.root,e=[],r=[],p,h,a,l=this.mode==="string";if(s){for(h=0,a=s.length;h"u")return x.empty()}else s=l?"":[];return e.push(y),r.push(s),new x(function(){for(var n,u,f=!1,o;e.length;){n=e.pop(),u=r.pop();for(o in n){if(o===T){f=!0;continue}e.push(n[o]),r.push(l?u+o:u.concat(o))}if(f)return{done:!1,value:[u,n[T]]}}return{done:!0}})},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.entries),E.prototype.inspect=function(){for(var s=new Array(this.size),y=this.entries(),e,r=0;e=y.next(),!e.done;)s[r++]=e.value;return Object.defineProperty(s,"constructor",{value:E,enumerable:!1}),s},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(s){var y=new E;return i(s,function(e,r){y.set(r,e)}),y},E.SENTINEL=T,t.exports=E}),cO=si((g,t)=>{var i=zn(),x=KM(),T="\0";function E(y){this.mode=y===Array?"array":"string",this.clear()}for(s in x.prototype)E.prototype[s]=x.prototype[s];var s;delete E.prototype.set,delete E.prototype.get,delete E.prototype.values,delete E.prototype.entries,E.prototype.add=function(y){for(var e=this.root,r,p=0,h=y.length;p"u")return p;for(var n=[r],u=[y],f;n.length;){y=u.pop(),r=n.pop();for(f in r){if(f===T){p.push(y);continue}n.push(r[f]),u.push(e?y+f:y.concat(f))}}return p},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.keys),E.prototype.inspect=function(){for(var y=new Set,e=this.keys(),r;r=e.next(),!r.done;)y.add(r.value);return Object.defineProperty(y,"constructor",{value:E,enumerable:!1}),y},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(y){var e=new E;return i(y,function(r){e.add(r)}),e},E.SENTINEL=T,t.exports=E}),dO=si((g,t)=>{var i=Vr(),x=zn(),T=sa(),E=Is(),s=function(p){return Math.max(1,Math.ceil(p*1.5))},y=function(p){var h=E.getPointerArray(p);return new h(p)};function e(p,h){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var a=h||0,l=s,n=0,u=!1;typeof h=="object"&&(a=h.initialCapacity||0,n=h.initialLength||0,l=h.policy||l,u=h.factory===!0),this.factory=u?p:null,this.ArrayClass=p,this.length=n,this.capacity=Math.max(n,a),this.policy=l,this.array=new p(this.capacity)}e.prototype.set=function(p,h){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(p):this.array=this.factory(p),E.isTypedArray(this.array))this.array.set(h,0);else for(var a=0,l=this.length;a=p)return this;for(h=this.capacity;h=h)return{done:!0};var l=p[a];return a++,{value:l,done:!1}})},e.prototype.entries=function(){var p=this.array,h=this.length,a=0;return new i(function(){if(a>=h)return{done:!0};var l=p[a];return{value:[a++,l],done:!1}})},typeof Symbol<"u"&&(e.prototype[Symbol.iterator]=e.prototype.values),e.prototype.inspect=function(){var p=this.array.slice(0,this.length);return p.type=this.array.constructor.name,p.items=this.length,p.capacity=this.capacity,Object.defineProperty(p,"constructor",{value:e,enumerable:!1}),p},typeof Symbol<"u"&&(e.prototype[Symbol.for("nodejs.util.inspect.custom")]=e.prototype.inspect),e.from=function(p,h,a){if(arguments.length<3&&(a=T.guessLength(p),typeof a!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var l=new e(h,a);return x(p,function(n){l.push(n)}),l};function r(p){var h=function(l){e.call(this,p,l)};for(var a in e.prototype)e.prototype.hasOwnProperty(a)&&(h.prototype[a]=e.prototype[a]);return h.from=function(l,n){return e.from(l,p,n)},typeof Symbol<"u"&&(h.prototype[Symbol.iterator]=h.prototype.values),h}e.Int8Vector=r(Int8Array),e.Uint8Vector=r(Uint8Array),e.Uint8ClampedVector=r(Uint8ClampedArray),e.Int16Vector=r(Int16Array),e.Uint16Vector=r(Uint16Array),e.Int32Vector=r(Int32Array),e.Uint32Vector=r(Uint32Array),e.Float32Vector=r(Float32Array),e.Float64Vector=r(Float64Array),e.PointerVector=r(y),t.exports=e}),pO=si((g,t)=>{var i=sa(),x=Is(),T=YM().inplaceQuickSortIndices,E=XM().lowerBoundIndices,s=Vx(),y=x.getPointerArray;function e(h,a){return h.distancea.distance?-1:0}function r(h,a,l){for(var n=l.length,u=y(n),f=0,o=new u(n),c=new u(n),d=new u(n),v=new Float64Array(n),m=[0,0,n],S=new Float64Array(n),M,w,C,A,P,b,O,I,D;m.length;)if(P=m.pop(),A=m.pop(),M=m.pop(),w=l[P-1],P--,D=P-A,o[M]=w,D!==0){if(D===1){O=h(a[w],a[l[A]]),v[M]=O,f++,d[M]=f,o[f]=l[A];continue}for(I=A;I0&&(f++,d[M]=f,m.push(f,b,P)),b-A>0&&(f++,c[M]=f,m.push(f,A,b))}return{nodes:o,lefts:c,rights:d,mus:v}}function p(h,a){if(typeof h!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!a)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=h,this.heap=new s(e),this.D=0;var l=i.toArrayWithIndices(a);this.items=l[0];var n=l[1];this.size=n.length;var u=r(h,this.items,n);this.nodes=u.nodes,this.lefts=u.lefts,this.rights=u.rights,this.mus=u.mus}p.prototype.nearestNeighbors=function(h,a){var l=this.heap,n=[0],u=1/0,f,o,c,d,v,m,S;for(this.D=0;n.length;)f=n.pop(),o=this.nodes[f],c=this.items[o],S=this.distance(c,a),this.D++,Sh&&l.pop(),l.size>=h&&(u=l.peek().distance)),d=this.lefts[f],v=this.rights[f],!(!d&&!v)&&(m=this.mus[f],S=m-u&&n.push(v)):(v&&S>=m-u&&n.push(v),d&&S=0;w--)M[w]=l.pop();return M},p.prototype.neighbors=function(h,a){var l=[],n=[0],u,f,o,c,d,v,m;for(this.D=0;n.length;)u=n.pop(),f=this.nodes[u],o=this.items[f],m=this.distance(o,a),this.D++,m<=h&&l.push({distance:m,item:o}),c=this.lefts[u],d=this.rights[u],!(!c&&!d)&&(v=this.mus[u],m=v-h&&n.push(d)):(d&&m>=v-h&&n.push(d),c&&m{var i=Vx(),x=Gx(),T=BF();t.exports={BiMap:UF(),BitSet:zF(),BitVector:GF(),BloomFilter:HF(),BKTree:WF(),CircularBuffer:XF(),DefaultMap:YF(),DefaultWeakMap:kF(),FixedDeque:VM(),StaticDisjointSet:KF(),FibonacciHeap:x,MinFibonacciHeap:x.MinFibonacciHeap,MaxFibonacciHeap:x.MaxFibonacciHeap,FixedReverseHeap:Hx(),FuzzyMap:jF(),FuzzyMultiMap:ZF(),HashedArrayTree:JF(),Heap:i,MinHeap:i.MinHeap,MaxHeap:i.MaxHeap,StaticIntervalTree:$F(),InvertedIndex:_F(),KDTree:qF(),LinkedList:tO(),LRUCache:Wx(),LRUCacheWithDelete:eO(),LRUMap:kM(),LRUMapWithDelete:iO(),MultiMap:HM(),MultiSet:nO(),PassjoinIndex:rO(),Queue:sO(),FixedStack:WM(),Stack:aO(),SuffixArray:T,GeneralizedSuffixArray:T.GeneralizedSuffixArray,Set:oO(),SparseQueueSet:lO(),SparseMap:hO(),SparseSet:uO(),SymSpell:fO(),Trie:cO(),TrieMap:KM(),Vector:dO(),VPTree:pO()}}),Qt=class fr{static get ZERO(){return new fr(0,0)}static get ONE(){return new fr(1,1)}static get UP(){return new fr(0,-1)}static get DOWN(){return new fr(0,1)}static get LEFT(){return new fr(-1,0)}static get RIGHT(){return new fr(1,0)}static get UP_LEFT(){return new fr(-1,-1)}static get UP_RIGHT(){return new fr(1,-1)}static get DOWN_RIGHT(){return new fr(1,1)}static get DOWN_LEFT(){return new fr(-1,1)}constructor(t,i){typeof t=="number"?(this.x=t,this.y=i||0):(this.x=t.x,this.y=t.y)}clone(){return new fr(this.x,this.y)}add(t){return new fr(this.x+t.x,this.y+t.y)}multiply(t){return new fr(this.x*t.x,this.y*t.y)}divide(t){return new fr(this.x/t.x,this.y/t.y)}subtract(t){return new fr(this.x-t.x,this.y-t.y)}equals(t){return this.x===t.x&&this.y===t.y}abs(){return new fr(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(t){return new fr(this.x%t.x,this.y%t.y)}scalarModulo(t){return new fr(this.x%t,this.y%t)}scalarMult(t){return new fr(this.x*t,this.y*t)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},Ai=class{static equal(g,t){return g.position.x===t.position.x&&g.position.y===t.position.y&&g.layer===t.layer}static copyOver(g,t){t.position.x=g.position.x,t.position.y=g.position.y,t.layer=g.layer}static clone(g){return{position:g.position.clone(),layer:g.layer}}static toString(g){return`${g.position.toString()}#${g.layer}`}static toInternal(g){return{position:new Qt(g.position.x,g.position.y),layer:g.charLayer}}static fromInternal(g){return{position:g.position.toPosition(),charLayer:g.layer}}},mO=(g=>(g.NONE="none",g.LEFT="left",g.UP_LEFT="up-left",g.UP="up",g.UP_RIGHT="up-right",g.RIGHT="right",g.DOWN_RIGHT="down-right",g.DOWN="down",g.DOWN_LEFT="down-left",g))(mO||{}),gO={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"},yO={up:Qt.UP,down:Qt.DOWN,left:Qt.LEFT,right:Qt.RIGHT,none:Qt.ZERO,"up-left":Qt.UP_LEFT,"up-right":Qt.UP_RIGHT,"down-right":Qt.DOWN_RIGHT,"down-left":Qt.DOWN_LEFT},dm={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},jM=["up","up-right","right","down-right","down","down-left","left","up-left"],xO=["down-left","down-right","up-right","up-left"];function Xx(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function ad(g){return xO.includes(g)}function SO(g,t=1){return g==="none"?"none":jM[(dm[g]+8-Math.abs(t)%8)%8]}function ZM(g,t=1){return g==="none"?"none":jM[(dm[g]+t)%8]}function Cu(g){return yO[g]}function TO(g){return gO[g]}function Ma(g,t){if(g.x===t.x){if(g.y>t.y)return"up";if(g.yt.x)return"left";if(g.xt.x){if(g.yt.y)return"up-left"}else if(g.xt.y)return"up-right"}return"none"}var EO=(g=>(g[g.FOUR=4]="FOUR",g[g.EIGHT=8]="EIGHT",g))(EO||{});function If(g){return typeof g=="string"&&Xx().includes(g)}var xy=function(g,t){return xy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,x){i.__proto__=x}||function(i,x){for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(i[T]=x[T])},xy(g,t)};function Yd(g,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xy(g,t);function i(){this.constructor=g}g.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function MO(g,t,i,x){function T(E){return E instanceof i?E:new i(function(s){s(E)})}return new(i||(i=Promise))(function(E,s){function y(p){try{r(x.next(p))}catch(h){s(h)}}function e(p){try{r(x.throw(p))}catch(h){s(h)}}function r(p){p.done?E(p.value):T(p.value).then(y,e)}r((x=x.apply(g,t||[])).next())})}function JM(g,t){var i={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},x,T,E,s;return s={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function y(r){return function(p){return e([r,p])}}function e(r){if(x)throw new TypeError("Generator is already executing.");for(;s&&(s=0,r[0]&&(i=0)),i;)try{if(x=1,T&&(E=r[0]&2?T.return:r[0]?T.throw||((E=T.return)&&E.call(T),0):T.next)&&!(E=E.call(T,r[1])).done)return E;switch(T=0,E&&(r=[r[0]&2,E.value]),r[0]){case 0:case 1:E=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,T=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(E=i.trys,!(E=E.length>0&&E[E.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!E||r[1]>E[0]&&r[1]=g.length&&(g=void 0),{value:g&&g[x++],done:!g}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function vd(g,t){var i=typeof Symbol=="function"&&g[Symbol.iterator];if(!i)return g;var x=i.call(g),T,E=[],s;try{for(;(t===void 0||t-- >0)&&!(T=x.next()).done;)E.push(T.value)}catch(y){s={error:y}}finally{try{T&&!T.done&&(i=x.return)&&i.call(x)}finally{if(s)throw s.error}}return E}function md(g,t,i){if(i||arguments.length===2)for(var x=0,T=t.length,E;x1||y(a,l)})})}function y(a,l){try{e(x[a](l))}catch(n){h(E[0][3],n)}}function e(a){a.value instanceof Wf?Promise.resolve(a.value.v).then(r,p):h(E[0][2],a)}function r(a){y("next",a)}function p(a){y("throw",a)}function h(a,l){a(l),E.shift(),E.length&&y(E[0][0],E[0][1])}}function wO(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=g[Symbol.asyncIterator],i;return t?t.call(g):(g=typeof Kf=="function"?Kf(g):g[Symbol.iterator](),i={},x("next"),x("throw"),x("return"),i[Symbol.asyncIterator]=function(){return this},i);function x(E){i[E]=g[E]&&function(s){return new Promise(function(y,e){s=g[E](s),T(y,e,s.done,s.value)})}}function T(E,s,y,e){Promise.resolve(e).then(function(r){E({value:r,done:y})},s)}}function mr(g){return typeof g=="function"}function $M(g){var t=function(x){Error.call(x),x.stack=new Error().stack},i=g(t);return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}var u0=$M(function(g){return function(t){g(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(i,x){return x+1+") "+i.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=t}});function Sy(g,t){if(g){var i=g.indexOf(t);0<=i&&g.splice(i,1)}}var Jm=function(){function g(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return g.prototype.unsubscribe=function(){var t,i,x,T,E;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var y=Kf(s),e=y.next();!e.done;e=y.next()){var r=e.value;r.remove(this)}}catch(u){t={error:u}}finally{try{e&&!e.done&&(i=y.return)&&i.call(y)}finally{if(t)throw t.error}}else s.remove(this);var p=this.initialTeardown;if(mr(p))try{p()}catch(u){E=u instanceof u0?u.errors:[u]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var a=Kf(h),l=a.next();!l.done;l=a.next()){var n=l.value;try{$S(n)}catch(u){E=E??[],u instanceof u0?E=md(md([],vd(E)),vd(u.errors)):E.push(u)}}}catch(u){x={error:u}}finally{try{l&&!l.done&&(T=a.return)&&T.call(a)}finally{if(x)throw x.error}}}if(E)throw new u0(E)}},g.prototype.add=function(t){var i;if(t&&t!==this)if(this.closed)$S(t);else{if(t instanceof g){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(i=this._finalizers)!==null&&i!==void 0?i:[]).push(t)}},g.prototype._hasParent=function(t){var i=this._parentage;return i===t||Array.isArray(i)&&i.includes(t)},g.prototype._addParent=function(t){var i=this._parentage;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t},g.prototype._removeParent=function(t){var i=this._parentage;i===t?this._parentage=null:Array.isArray(i)&&Sy(i,t)},g.prototype.remove=function(t){var i=this._finalizers;i&&Sy(i,t),t instanceof g&&t._removeParent(this)},g.EMPTY=function(){var t=new g;return t.closed=!0,t}(),g}(),QM=Jm.EMPTY;function _M(g){return g instanceof Jm||g&&"closed"in g&&mr(g.remove)&&mr(g.add)&&mr(g.unsubscribe)}function $S(g){mr(g)?g():g.unsubscribe()}var qM={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},AO={setTimeout:function(g,t){for(var i=[],x=2;x0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(i){return this._throwIfClosed(),g.prototype._trySubscribe.call(this,i)},t.prototype._subscribe=function(i){return this._throwIfClosed(),this._checkFinalizedStatuses(i),this._innerSubscribe(i)},t.prototype._innerSubscribe=function(i){var x=this,T=this,E=T.hasError,s=T.isStopped,y=T.observers;return E||s?QM:(this.currentObservers=null,y.push(i),new Jm(function(){x.currentObservers=null,Sy(y,i)}))},t.prototype._checkFinalizedStatuses=function(i){var x=this,T=x.hasError,E=x.thrownError,s=x.isStopped;T?i.error(E):s&&i.complete()},t.prototype.asObservable=function(){var i=new wa;return i.source=this,i},t.create=function(i,x){return new _S(i,x)},t}(wa),_S=function(g){Yd(t,g);function t(i,x){var T=g.call(this)||this;return T.destination=i,T.source=x,T}return t.prototype.next=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.next)===null||T===void 0||T.call(x,i)},t.prototype.error=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.error)===null||T===void 0||T.call(x,i)},t.prototype.complete=function(){var i,x;(x=(i=this.destination)===null||i===void 0?void 0:i.complete)===null||x===void 0||x.call(i)},t.prototype._subscribe=function(i){var x,T;return(T=(x=this.source)===null||x===void 0?void 0:x.subscribe(i))!==null&&T!==void 0?T:QM},t}(In),nC=new wa(function(g){return g.complete()});function UO(g){return g&&mr(g.schedule)}function rC(g){return g[g.length-1]}function sC(g){return UO(rC(g))?g.pop():void 0}function aC(g,t){return typeof rC(g)=="number"?g.pop():t}var oC=function(g){return g&&typeof g.length=="number"&&typeof g!="function"};function lC(g){return mr(g?.then)}function hC(g){return mr(g[kx])}function uC(g){return Symbol.asyncIterator&&mr(g?.[Symbol.asyncIterator])}function fC(g){return new TypeError("You provided "+(g!==null&&typeof g=="object"?"an invalid object":"'"+g+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zO(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var cC=zO();function dC(g){return mr(g?.[cC])}function pC(g){return CO(this,arguments,function(){var t,i,x,T;return JM(this,function(E){switch(E.label){case 0:t=g.getReader(),E.label=1;case 1:E.trys.push([1,,9,10]),E.label=2;case 2:return[4,Wf(t.read())];case 3:return i=E.sent(),x=i.value,T=i.done,T?[4,Wf(void 0)]:[3,5];case 4:return[2,E.sent()];case 5:return[4,Wf(x)];case 6:return[4,E.sent()];case 7:return E.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function vC(g){return mr(g?.getReader)}function Lu(g){if(g instanceof wa)return g;if(g!=null){if(hC(g))return GO(g);if(oC(g))return VO(g);if(lC(g))return HO(g);if(uC(g))return mC(g);if(dC(g))return WO(g);if(vC(g))return XO(g)}throw fC(g)}function GO(g){return new wa(function(t){var i=g[kx]();if(mr(i.subscribe))return i.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function VO(g){return new wa(function(t){for(var i=0;i{let T=this.tilePosInDirection(new Qt(i,x),g);return this.tilemap.hasBlockingTile(T,t,TO(g),this.ignoreMissingTiles)})}isCharBlocking(g,t){return this.someCharTile((i,x)=>{let T=this.tilePosInDirection(new Qt(i,x),g);return this.tilemap.hasBlockingChar(T,t,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(g){this.isMoving()||g!="none"&&this.changeFacingDirection(g)}changeFacingDirection(g){this.facingDirection!==g&&(this.facingDirection=g,this.directionChanged$.next(g))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(Cu(this.facingDirection))}addCollisionGroup(g){this.collisionGroups.add(g)}setCollisionGroups(g){this.collisionGroups=new Set(g)}setIgnoreCollisionGroups(g){this.ignoreCollisionGroups=new Set(g)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(g){return this.collisionGroups.has(g)}removeCollisionGroup(g){this.collisionGroups.delete(g)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(g){for(let t of g)this.labels.add(t)}getLabels(){return[...this.labels.values()]}hasLabel(g){return this.labels.has(g)}clearLabels(){this.labels.clear()}removeLabels(g){for(let t of g)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(g){let t=Math.max(0,Math.min(au,g));this.movementProgress=t}hasWalkedHalfATile(){return this.movementProgress>au/2}willCrossTileBorderThisUpdate(g){return this.movementProgress+this.maxProgressForDelta(g)>=au}updateCharacterPosition(g){let t=this.willCrossTileBorderThisUpdate(g),i=1-(t?au-this.movementProgress:this.maxProgressForDelta(g))/this.maxProgressForDelta(g);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(g),au),t&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),i>0&&this.updateCharacterPosition(g*i)):this.stopMoving())}maxProgressForDelta(g){let t=g/1e3;return Math.floor(t*this.speed*au)}get tilePos(){return Ai.clone(this._tilePos)}set tilePos(g){Ai.copyOver(g,this._tilePos)}startMoving(g){g!=="none"&&(g!=this.movementDirection&&this.movementStarted$.next(g),this.movementDirection=g,this.facingDirection=g,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(g,t){return g.add(Cu(this.tilemap.toMapDirection(t)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let g=this.tilePos,t=this.getNextTilePos(),i=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(i),this.fire(this.positionChangeFinished$,g,t)}fire(g,{position:t,layer:i},{position:x,layer:T}){g.next({exitTile:t,enterTile:x,exitLayer:i,enterLayer:T})}someCharTile(g){let t=this.getNextTilePos().position;for(let i=t.x;ithis.isLayerAlwaysOnTop(T));this.tilemap.layers.filter(T=>!this.isLayerAlwaysOnTop(T)).forEach(T=>{this.hasLayerProp(T,ou.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(T,i),t.push(T.tilemapLayer)):this.setDepth(T,++i)}),this.charLayerDepths.set(void 0,i),x.forEach((T,E)=>{T.tilemapLayer.setDepth(E+1+i)}),t.forEach(T=>T.destroy())}setDepth(t,i){t.tilemapLayer.setDepth(i),this.isCharLayer(t)&&this.charLayerDepths.set(this.getLayerProp(t,ou.CHAR_LAYER_PROP_NAME),i)}createHeightShiftLayers(t,i){let x=this.getLayerProp(t,ou.HEIGHT_SHIFT_PROP_NAME);isNaN(x)&&(x=0);let T=1;for(let E=0;ET.name==i);return x?.value}hasLayerProp(t,i){return this.getLayerProp(t,i)!=null}copyLayer(t,i){let x=`${t.name}#${i}`,T=this.tilemap.createBlankLayer(x,t.tilemapLayer.tileset);if(T){if(T.name=x,this.isIsometric())for(let E=i;E>=0;E--){let s=i-E;T.putTileAt(t.data[E][s],s,E)}else for(let E=0;Ey===this.charData.id)).subscribe(({direction:y})=>{var e;(e=this.animation)==null||e.setStandingFrame(y)}),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(g){g?(this.sprite&&(g.x=this.sprite.x,g.y=this.sprite.y),this.sprite=g,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(g){var t;this.container=g,this.cachedContainerHeight=(t=g?.getBounds().height)!=null?t:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(g){this.customOffset.x=g}getOffsetY(){return this.customOffset.y}setOffsetY(g){this.customOffset.y=g}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(g){var t;this.geHeadless.isMoving(this.charData.id)||g!="none"&&(this.geHeadless.turnTowards(this.charData.id,g),(t=this.animation)==null||t.setStandingFrame(g))}getAnimation(){return this.animation}setAnimation(g){this.animation=g}update(g){this.updateGridChar()}getEngineOffset(){var g,t,i,x;if(!this.sprite)return Qt.ZERO;let T=this.tilemap.getTileWidth()/2-Math.floor(((t=(g=this.sprite)==null?void 0:g.displayWidth)!=null?t:0)/2),E=-((x=(i=this.sprite)==null?void 0:i.displayHeight)!=null?x:0)+this.tilemap.getTileHeight();return new Qt(T,E)}updatePixelPos(){let g=new Qt(this.geHeadless.getPosition(this.charData.id)),t=this.geHeadless.getMovementProgress(this.charData.id)/1e3,i=this.tilemap.tilePosToPixelPos(g).add(this.getEngineOffset()).add(this.customOffset).add(Cu(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(t))),x=this.getGameObj();x&&(x.x=Math.floor(i.x),x.y=Math.floor(i.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var g;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let t=this.geHeadless.getMovementProgress(this.charData.id)>au/2;(g=this.getAnimation())==null||g.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),t,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(g){let t=new qS(this.walkingAnimationMapping,g.texture.source[0].width/g.width/qS.FRAMES_CHAR_ROW);this.setAnimation(t),t.frameChange().pipe(Ta(this.newSpriteSet$)).subscribe(i=>{g?.setFrame(i)}),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 g=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-g),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let g=new Qt(this.geHeadless.getPosition(this.charData.id)),t=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:g,layer:t}):this.sprite&&this.setSpriteDepth(this.sprite,{position:g,layer:t});let i=this.getLayerOverlaySprite();if(i){let x=new Qt(dh(An({},g),{y:g.y-1}));this.setSpriteDepth(i,{position:x,layer:t})}}setSpriteDepth(g,t){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthSprite(g))}setContainerDepth(g,t){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(t))+this.getPaddedPixelDepthContainer(g))}getPaddedPixelDepthContainer(g){return Cy.shiftPad(g.y+this.cachedContainerHeight,Ay.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(g){return Cy.shiftPad(g.y+g.displayHeight,Ay.Z_INDEX_PADDING)}getTransitionLayer(g){if(g.layer)return this.geHeadless.getTransition(g.position,g.layer)||g.layer}},s4=(g=>(g.DONT_BLOCK="DONT_BLOCK",g.BLOCK_TWO_TILES="BLOCK_TWO_TILES",g.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",g.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",g))(s4||{}),MC=(g=>(g.STOP="STOP",g.CLOSEST_REACHABLE="CLOSEST_REACHABLE",g.RETRY="RETRY",g.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",g))(MC||{}),a4=class{distance(g,t){return eo.manhattanDistance(g,t)}direction(g,t){if(eo.equal(g,t))return"none";let i=g.clone().subtract(t);return Math.abs(i.x)>Math.abs(i.y)?i.x>0?"left":"right":i.y>0?"up":"down"}neighbors(g){return[new Qt(g.x,g.y+1),new Qt(g.x+1,g.y),new Qt(g.x-1,g.y),new Qt(g.x,g.y-1)]}getDirections(){return["up","right","down","left"]}},o4=class{distance(g,t){return eo.chebyshevDistance(g,t)}neighbors(g){let t=[new Qt(g.x,g.y+1),new Qt(g.x+1,g.y),new Qt(g.x-1,g.y),new Qt(g.x,g.y-1)],i=[new Qt(g.x+1,g.y+1),new Qt(g.x+1,g.y-1),new Qt(g.x-1,g.y+1),new Qt(g.x-1,g.y-1)];return[...t,...i]}direction(g,t){return t.x>g.x?t.y>g.y?"down-right":t.yg.y?"down-left":t.yg.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},gd=class{static create(g){switch(g){case 4:return new a4;case 8:return new o4}}},tT=class{constructor(g,t,i){this.backoffMs=g,this.maxRetries=t,this.onFinished=i,this.retries=0,this.elapsed=0}retry(g,t){this.shouldRetry()?(this.elapsed+=g,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(g.WAIT="WAIT",g.RETRY="RETRY",g.STOP="STOP",g))(CC||{}),$m=class{constructor(g,{shortestPathAlgorithm:t="BFS",pathWidth:i=1,pathHeight:x=1,numberOfDirections:T=4,isPositionAllowed:E=(u,f)=>!0,collisionGroups:s=[],ignoredChars:y=[],ignoreTiles:e=!1,ignoreMapBounds:r=!1,ignoreBlockedTarget:p=!1,maxPathLength:h=1/0,ignoreLayers:a=!1,considerCosts:l=!1,calculateClosestToTarget:n=!0}={}){this.gridTilemap=g,this.options={shortestPathAlgorithm:t,pathWidth:i,pathHeight:x,numberOfDirections:T,isPositionAllowed:E,collisionGroups:s,ignoredChars:y,ignoreTiles:e,ignoreMapBounds:r,ignoreBlockedTarget:p,maxPathLength:h,ignoreLayers:a,considerCosts:l,calculateClosestToTarget:n},this.ignoredCharsSet=new Set(y)}findShortestPath(g,t){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(g.layer),t.layer=g.layer);let i=this.findShortestPathImpl(g,t);return this.gridTilemap.unfixCacheLayers(),i}getNeighbors(g,t){var i;return gd.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position).map(x=>{let T=g.layer;return this.options.ignoreLayers||(T=this.gridTilemap.getTransition(x,g.layer)),{position:x,layer:T||g.layer}}).filter(x=>!this.isBlocking(g,x)||this.options.ignoreBlockedTarget&&Ai.equal(x,t))}getTransition(g,t){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(g,t)}getCosts(g,t){if(!this.options.considerCosts)return 1;let i=Ma(t.position,g);return this.gridTilemap.getTileCosts(t,i)}isBlocking(g,t){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(t.position))||!this.options.isPositionAllowed(t.position,t.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(g,t,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(g,t,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(g,t){return(this.options.numberOfDirections===4?eo.manhattanDistance:eo.chebyshevDistance)(g,t)}getTilePosInDir(g,t){return this.options.ignoreLayers?{position:g.position.add(Cu(this.gridTilemap.toMapDirection(t))),layer:g.layer}:this.gridTilemap.getTilePosInDirection(g,t)}getReverseNeighbors(g,t){var i;let x=gd.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position),T;if(!this.options.ignoreLayers){let E=this.gridTilemap.getReverseTransitions(g.position,g.layer);T=E?[...E]:void 0}return x.map(E=>T?T.map(s=>({position:E,layer:s||g.layer})):[{position:E,layer:g.layer}]).flat().filter(E=>!this.isBlocking(E,g)||this.options.ignoreBlockedTarget&&Ai.equal(g,t))}hasBlockingCharFrom(g,t,i,x,T,E,s){if(i===1&&x===1)return s.hasBlockingChar(t.position,t.layer,T,E);let y=r=>s.hasBlockingChar(r,t.layer,T,E),e=Ma(g.position,t.position);return this.isBlockingMultiTile(g,e,i,x,y)}hasBlockingTileFrom(g,t,i,x,T,E){if(i===1&&x===1)return E.hasBlockingTile(t.position,t.layer,Ma(t.position,g.position),T);let s=Ma(g.position,t.position),y=e=>E.hasBlockingTile(e,t.layer,s,T);return this.isBlockingMultiTile(g,s,i,x,y)}isBlockingMultiTile(g,t,i,x,T){let E={src:new Qt(g.position.x+i,g.position.y),dest:new Qt(g.position.x+i,g.position.y+x-1)},s={src:new Qt(g.position.x-1,g.position.y),dest:new Qt(g.position.x-1,g.position.y+x-1)},y={src:new Qt(g.position.x,g.position.y-1),dest:new Qt(g.position.x+i-1,g.position.y-1)},e={src:new Qt(g.position.x,g.position.y+x),dest:new Qt(g.position.x+i-1,g.position.y+x)};switch(t){case"right":return this.checkLine(E,T);case"left":return this.checkLine(s,T);case"up":return this.checkLine(y,T);case"down":return this.checkLine(e,T);case"up-left":return this.checkLine({src:y.src,dest:new Qt(y.dest.x-1,y.dest.y)},T)||this.checkLine({src:new Qt(s.src.x,s.src.y-1),dest:new Qt(s.dest.x,s.dest.y-1)},T);case"up-right":return this.checkLine({src:new Qt(y.src.x+1,y.src.y),dest:y.dest},T)||this.checkLine({src:new Qt(E.src.x,E.src.y-1),dest:new Qt(E.dest.x,E.dest.y-1)},T);case"down-left":return this.checkLine({src:new Qt(s.src.x,s.src.y+1),dest:new Qt(s.dest.x,s.dest.y+1)},T)||this.checkLine({src:e.src,dest:new Qt(e.dest.x-1,e.dest.y)},T);case"down-right":return this.checkLine({src:new Qt(e.src.x+1,e.src.y),dest:e.dest},T)||this.checkLine({src:new Qt(E.src.x,E.src.y+1),dest:new Qt(E.dest.x,E.dest.y+1)},T)}return!1}checkLine(g,t){for(let i=g.src.x;i<=g.dest.x;i++)for(let x=g.src.y;x<=g.dest.y;x++)if(t(new Qt(i,x)))return!0;return!1}},l4=zM(Gx(),1),h4=class extends $m{findShortestPathImpl(g,t){let i=this.shortestPathBfs(g,t);return{path:this.returnPath(i.previous,g,t),closestToTarget:i.closestToTarget,steps:i.steps,maxPathLengthReached:i.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(g,t){let i=new Map,x=new Map,T=new Map,E=new l4.MinFibonacciHeap((r,p)=>Gc(T,r)-Gc(T,p)),s=g,y=this.distance(g.position,t.position),e=0;for(E.push(g),x.set(Ai.toString(g),0),T.set(Ai.toString(g),this.distance(g.position,t.position));E.size>0;){let r=E.pop();if(!r)break;e++;let p=this.distance(r.position,t.position);if(pthis.options.maxPathLength)return{previous:new Map,closestToTarget:s,steps:e,maxPathLengthReached:!0};for(let h of this.getNeighbors(r,t)){let a=Gc(x,r)+this.getCosts(r.position,h),l=Ai.toString(h);(!x.has(l)||a0;){let e=T.dequeue();if(y++,!e)break;let{node:r,dist:p}=e;if(p>this.options.maxPathLength)return{previous:new Map,closestToTarget:E,steps:y,maxPathLengthReached:!0};let h=this.distance(r.position,t.position);if(hthis.lastDist)}step(g,t,i){var x;this.lastDist=i;for(let T of g){let E=Ai.toString(T);if(!this.visited.has(E)){this.previous.set(E,t),this.queue.enqueue({node:T,dist:i+1}),this.visited.set(E,i+1);let s=(x=this.otherBfs)==null?void 0:x.visited.get(E);s!==void 0&&s0,T.queue.size()>0);){let e=x.queue.dequeue();if(!e)break;let{node:r,dist:p}=e;if(p+1+(((i=T.queue.peek())==null?void 0:i.dist)||0)>this.options.maxPathLength)return{previous:x.previous,previous2:T.previous,closestToTarget:this.maybeClosestToTarget(s),steps:E,maxPathLengthReached:!0};let h=this.distance(r.position,t.position);if(hVc(this.f,T)-Vc(this.f,E)),this.openSet.push(g);let x=Ai.toString(g);for(this.g.set(x,0),this.f.set(x,this.distance(g.position,t.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let T=this.openSet.pop();if(!T)break;if(this.steps++,Ai.equal(T,t))return{previous:i,closestToTarget:t,steps:this.steps,maxPathLengthReached:!1};if(Vc(this.g,T)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(T,t);for(let E of this.getNeighborsInternal(T,i.get(Ai.toString(T)),t)){let s=Ai.toString(E.p),y=Vc(this.g,T)+E.dist;(!this.g.has(s)||y({p:E,dist:1}));let x=this.prune(t,g).filter(E=>!this.isBlockingIgnoreTarget(g,E,i)).map(E=>{let s=this.getTransition(E.position,g.layer);return{position:E.position,layer:s||g.layer}}),T=[];for(let E of x)if(this.isHorizontal(g.position,E.position))T.push({p:E,dist:1});else{let s=this.jump(g,E,i,1,Ma(g.position,E.position));s&&T.push(s)}return T}isBlockingIgnoreTarget(g,t,i){return this.isBlocking(g,t)&&!(this.options.ignoreBlockedTarget&&Ai.equal(t,i))}jump(g,t,i,x,T){if(!this.isBlockingIgnoreTarget(g,t,i))return Ai.equal(t,i)?{p:t,dist:x}:x>=this.maxJumpSize?{p:t,dist:x}:this.getTransition(t.position,g.layer)!==void 0?{p:t,dist:x}:this.hasForced(g,t)?{p:t,dist:x}:(this.updateClosestToTarget(t,i),this.jump(t,this.getTilePosInDir(t,T),i,x+1,T))}isHorizontal(g,t){return g.y===t.y}getForced(g,t,i,x,T,E){let s=[],y=g;return(this.blockOrTrans(y,i)||this.blockOrTrans(i,x))&&this.addIfNotBlocked(s,t,x),(this.blockOrTrans(y,T)||this.blockOrTrans(T,E))&&this.addIfNotBlocked(s,t,E),s}hasForced(g,t){let{topLeft:i,downLeft:x,top:T,bottom:E}=this.normalizedPositions(g,t);return!!((this.blockOrTrans(g,x)||this.blockOrTrans(x,E))&&!this.blockOrTrans(t,E)||(this.blockOrTrans(g,i)||this.blockOrTrans(i,T))&&!this.blockOrTrans(t,T))}prune(g,t){let{right:i,top:x,bottom:T,downLeft:E,topLeft:s}=this.normalizedPositions(g,t);return this.isHorizontal(g.position,t.position)?[i,x,T]:[i,...this.getForced(g,t,E,T,s,x)]}normalizedPositions(g,t){return g.position.xt.position.x?{topLeft:{position:new Qt(t.position.x+1,t.position.y+1),layer:t.layer},downLeft:{position:new Qt(t.position.x+1,t.position.y-1),layer:t.layer},top:{position:new Qt(t.position.x,t.position.y+1),layer:t.layer},bottom:{position:new Qt(t.position.x,t.position.y-1),layer:t.layer},right:{position:new Qt(t.position.x-1,t.position.y),layer:t.layer}}:g.position.y1?this.fillPath(T,E,x):x.push(E),T=E}return x.reverse()}fillPath(g,t,i){let x=g;do{let T=Ma(x.position,t.position);x=this.getTilePosInDir(x,T),i.push(x)}while(!eo.equal(x.position,t.position))}};function Vc(g,t){var i;return(i=g.get(Ai.toString(t)))!=null?i:Number.MAX_VALUE}var f4=class{constructor(g,t,i,x={}){this.character=g,this.gridTilemap=t,this.charToFollow=i;let T={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:x.considerCosts||!1,facingDirection:"none"};this.options=An(An({},T),x),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=g,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(Ta(this.character.autoMovementSet().pipe(ph(E=>E!==this),qf(1)))).subscribe(({enterTile:E,enterLayer:s})=>{this.updateTarget(E,s)})}update(g){var t;(t=this.targetMovement)==null||t.update(g)}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 g=dm[this.options.facingDirection]+dm[this.charToFollow.getFacingDirection()],t=ZM("up",g),i={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return t==="right"?i.x+=this.charToFollow.getTileWidth()-1:t==="down"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-left"?i.y+=this.charToFollow.getTileWidth()-1:t==="down-right"?(i.y+=this.charToFollow.getTileWidth()-1,i.x+=this.charToFollow.getTileWidth()-1):t==="up-right"&&(i.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new Qt(i),layer:this.charToFollow.getTilePos().layer},t).position}updateTarget(g,t){let i=this.options.facingDirection!=="none"&&this.options.distance===0;i&&(g=this.getFacingPos()),this.targetMovement=new FC(this.character,this.gridTilemap,{position:new Qt(g),layer:t},{distance:i?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()]}})}},sT=class{static getRandomInt(g){return Math.floor(Math.random()*Math.floor(g))}},c4=class{constructor(g,t=0,i=-1){this.character=g,this.delay=t,this.radius=i,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=g.getNextTilePos().position.y,this.initialCol=g.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(Ta(this.character.autoMovementSet().pipe(ph(x=>x!==this),qf(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=gd.create(g.getNumberOfDirections())}update(g){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=g,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(g)).filter(g=>this.isWithinRadius(g))}isWithinRadius(g){return this.radius==-1?!0:this.getDist(g)<=this.radius}getDist(g){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(Cu(g)),new Qt(this.initialCol,this.initialRow))}getFreeRandomDirection(){let g=this.getFreeDirections();return g.length==0?"none":g[sT.getRandomInt(g.length)]}randomizeStepSize(){this.stepSize=sT.getRandomInt(this.radius)+1}};function d4(g,t){return g.filter(i=>{var x,T,E,s,y,e;return(x=t.labels)!=null&&x.withAllLabels?(T=t.labels)==null?void 0:T.withAllLabels.every(r=>i.hasLabel(r)):(E=t.labels)!=null&&E.withOneOfLabels?(s=t.labels)==null?void 0:s.withOneOfLabels.some(r=>i.hasLabel(r)):(y=t.labels)!=null&&y.withNoneLabels?!((e=t.labels)!=null&&e.withNoneLabels.some(r=>i.hasLabel(r))):!0})}var PC="2.44.6",p4=class{constructor(g,t){this.collistionStrategy=g,this.collisionGroupRelation=t,this.tilePosToCharacters=new v4,this.charRemoved$=new In}isCharBlockingAt(g,t,i,x=new Set,T=new Set){if(i.length===0)return!1;let E=this.tilePosToCharacters.get(g,t);return!!(E&&E.size>0&&[...E].filter(s=>!x.has(s.getId())).filter(s=>!this.doIntersect(s.getCollisionGroups(),T)).some(s=>i.some(y=>s.getCollisionGroups().some(e=>this.collidesWith(y,e)))))}doIntersect(g,t){for(let i of g)if(t.has(i))return!0;return!1}collidesWith(g,t){return this.collisionGroupRelation?(this.collisionGroupRelation.get(g)||new Set).has(t):g===t}getCharactersAt(g,t){return this.tilePosToCharacters.get(g,t)||new Set}addCharacter(g){this.addTilePositions(g.getTilePos(),g),this.addTilePositions(g.getNextTilePos(),g),this.addPositionChangeSub(g),this.addPositionChangeFinishedSub(g),this.addTilePosSetSub(g)}removeCharacter(g){let t=g.getId();this.charRemoved$.next(t),this.deleteTilePositions(g.getTilePos(),g),this.deleteTilePositions(g.getNextTilePos(),g)}add(g,t,i){let x=this.tilePosToCharacters.get(g,t);x||this.tilePosToCharacters.set(g,t,new Set([i])),x?.add(i)}addTilePosSetSub(g){g.tilePositionSet().pipe(Ta(this.charRemoved(g.getId()))).subscribe(t=>{this.deleteTilePositions(g.getNextTilePos(),g),this.addTilePositions(t,g)})}charRemoved(g){var t;return(t=this.charRemoved$)==null?void 0:t.pipe(qf(1),ph(i=>i==g))}addPositionChangeSub(g){g.positionChangeStarted().pipe(Ta(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(t.exit,g),this.addTilePositions(t.enter,g)})}addPositionChangeFinishedSub(g){g.positionChangeFinished().pipe(Ta(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(t=>{this.deleteTilePositions(t.exit,g),this.addTilePositions(t.enter,g)})}addTilePositions(g,t){this.forEachCharTile(g,t,(i,x)=>{this.add(new Qt(i,x),g.layer,t)})}deleteTilePositions(g,t){this.forEachCharTile(g,t,(i,x)=>{var T;(T=this.tilePosToCharacters.get(new Qt(i,x),g.layer))==null||T.delete(t)})}forEachCharTile(g,t,i){let x=g.position;for(let T=x.x;T({enter:{position:new Qt(g.enterTile),layer:g.enterLayer},exit:{position:new Qt(g.exitTile),layer:g.exitLayer}})))}posToString(g,t){return`${g.x}#${g.y}#${t}`}},v4=class{constructor(){this.memo=new Map}set(g,t,i){let x=this.memo.get(g.x);x||(x=new Map,this.memo.set(g.x,x));let T=x.get(g.y);T||(T=new Map,x.set(g.y,T)),T.set(t,i)}get(g,t){let i=this.memo.get(g.x);if(!i)return;let x=i.get(g.y);if(x)return x.get(t)}},Kx=class{constructor(g,t,i,x){this.x=g,this.y=t,this.width=i,this.height=x}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(g){return g.x>=this.x&&g.x=this.y&&g.yi.isCharLayer());for(let i of[...t,void 0]){let x=this.tileCollisionCache.get(i?.getName());if(x===void 0){x=new Array(this.tilemap.getWidth());for(let T=0;T>t&1)==1}var oT="ge_cost",RC=class bC{constructor(t,i,x,T=void 0,E=!1){this.tilemap=t,this.collisionTilePropertyName=i,this.useTileCollisionCache=E,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 p4(x,T);for(let s of Xx())this.collidesPropNames.set(s,bC.ONE_WAY_COLLIDE_PROP_PREFIX+s),this.tileCostPropNames.set(s,`${oT}_${s}`);this.useTileCollisionCache&&(this.tileCollisionCache=new g4(t,this),this.tileCollisionCache.rebuild())}fixCacheLayer(t){var i;(i=this.tileCollisionCache)==null||i.fixLayer(t)}unfixCacheLayers(){var t;(t=this.tileCollisionCache)==null||t.unfixLayers()}addCharacter(t){this.characters.set(t.getId(),t);let i=t.getNextTilePos().layer;i===void 0?t.setTilePosition(dh(An({},t.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(i)||console.warn(`Char layer '${i}' of character '${t.getId()}' is unknown.`),this.charBlockCache.addCharacter(t)}removeCharacter(t){let i=this.characters.get(t);i&&(this.charBlockCache.removeCharacter(i),this.characters.delete(t))}getCharacters(){return[...this.characters.values()]}getCharactersAt(t,i){return this.charBlockCache.getCharactersAt(t,i)}rebuildTileCollisionCache(t){var i;(i=this.tileCollisionCache)==null||i.rebuild(t)}hasBlockingTileUncached(t,i,x,T){if(!T&&this.hasNoTileUncached(t,i))return!0;let E=this.getCollisionRelevantLayers(i);for(let s of E)if(this.isLayerBlockingAt(s.getName(),t,x))return!0;return!1}hasBlockingTile(t,i,x,T){var E;let s=(E=this.tileCollisionCache)==null?void 0:E.isBlockingFrom(t.x,t.y,i,x,T);return s!==void 0?s:this.hasBlockingTileUncached(t,i,x,T)}getTransition(t,i){let x=this.transitions.get(t.toString());if(x)return x.get(i)}getReverseTransitions(t,i){let x=this.reverseTransitions.get(t.toString());if(x)return x.get(i)}setTransition(t,i,x){var T,E,s,y,e;this.transitions.has(t.toString())||this.transitions.set(t.toString(),new Map),this.reverseTransitions.has(t.toString())||this.reverseTransitions.set(t.toString(),new Map),(T=this.transitions.get(t.toString()))==null||T.set(i,x),(E=this.reverseTransitions.get(t.toString()))!=null&&E.has(x)||(s=this.reverseTransitions.get(t.toString()))==null||s.set(x,new Set),(e=(y=this.reverseTransitions.get(t.toString()))==null?void 0:y.get(x))==null||e.add(i)}getTransitions(){return new Map([...this.transitions].map(([t,i])=>[t,new Map(i)]))}getTileCosts(t,i){let x=this.getCollisionRelevantLayers(t.layer),T=1;for(let E of x)T=Math.max(T,this.getTileCostsForLayer(dh(An({},t),{layer:E.getName()}),i));return T}getTileCostsForLayer(t,i){let x=this.tilemap.getTileAt(t.position.x,t.position.y,t.layer);return i&&x?.getProperty(this.tileCostPropNames.get(i)||"")||x?.getProperty(oT)||1}hasNoTileUncached(t,i){return!this.getCollisionRelevantLayers(i).some(x=>this.tilemap.hasTileAt(t.x,t.y,x.getName()))}hasNoTile(t,i){var x;let T=(x=this.tileCollisionCache)==null?void 0:x.hasTileAt(t.x,t.y,i);return T!==void 0?T:this.hasNoTileUncached(t,i)}hasBlockingChar(t,i,x,T=new Set,E=new Set){return this.charBlockCache.isCharBlockingAt(t,i,x,T,E)}isInRange(t){return new Kx(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(t)}toMapDirection(t){return this.isIsometric()?SO(t):t}fromMapDirection(t){return this.isIsometric()?ZM(t):t}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(t,i){let x=t.position.add(Cu(this.toMapDirection(i))),T=this.getTransition(x,t.layer)||t.layer;return{position:x,layer:T}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(t,i,x){let T=this.tilemap.getTileAt(i.x,i.y,t);return T?!!(T.getProperty(this.collisionTilePropertyName)||x&&T.getProperty(this.collidesPropNames.get(x)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((t,i)=>({layer:t,index:i})).filter(({layer:t})=>t.isCharLayer()).map(({index:t})=>t)}findPrevAndCharLayer(t){let i=this.getCharLayerIndexes(),x=this.tilemap.getLayers(),T=i.findIndex(E=>x[E].getProperty(Qv)==t);return T==0?{prevIndex:-1,charLayerIndex:i[T]}:{prevIndex:i[T-1],charLayerIndex:i[T]}}getCollisionRelevantLayers(t){if(!t)return this.tilemap.getLayers();let i=this.collisionRelevantLayersFrameCache.get(t);if(i)return i;let{prevIndex:x,charLayerIndex:T}=this.findPrevAndCharLayer(t),E=this.tilemap.getLayers().slice(x+1,T+1);return this.collisionRelevantLayersFrameCache.set(t,E),E}getLowestCharLayer(){for(let t of this.tilemap.getLayers())if(t.isCharLayer())return t.getProperty(Qv)}getCharLayerNames(){return this.tilemap.getLayers().filter(t=>t.isCharLayer()).map(t=>t.getProperty(Qv)).filter(x4)}};RC.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var y4=RC;function x4(g){return g!=null}var S4=(g=>(g.REMOVED="REMOVED",g.ADDED="ADDED",g))(S4||{}),T4=(g=>(g.WAIT="WAIT",g.SKIP="SKIP",g.STOP="STOP",g))(T4||{}),E4=class{constructor(g,t){this.character=g,this.tilemap=t,this.queue=new pm,this.finished$=new In,this.pathBlockedWaitElapsed=0,this.distanceUtils=gd.create(g.getNumberOfDirections()),this.character.autoMovementSet().pipe(ph(i=>i!==this),qf(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(g){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(g))&&this.queue.size()>0&&this.moveCharOnPath(g)}getInfo(){return{type:"Queue"}}enqueue(g,t={}){var i,x,T;let E={pathBlockedStrategy:(i=t.pathBlockedStrategy)!=null?i:"STOP",pathBlockedWaitTimeoutMs:t?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(x=t.ignoreInvalidPositions)!=null?x:!1,skipInvalidPositions:(T=t.skipInvalidPositions)!=null?T:!1};for(let s of g){let y={command:s,config:E};if(If(s)){this.queue.enqueue(y);continue}let e=this.queue.peekEnd(),r=e?.command;if(r||(r=this.character.getNextTilePos()),If(r)){this.queue.enqueue(y);continue}let p=this.distanceUtils.distance(r.position,s.position)===1;(!t.ignoreInvalidPositions||p)&&this.queue.enqueue(y)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(g){let t=this.queue.peek();if(!t)return;let i=t.command,x=t.config;if(If(i)&&(i=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),i)),x.skipInvalidPositions){if(i=this.getNextValidPosition(),!i){this.finishInvalidNextPos(i);return}}else if(!this.isNeighborPos(i)){this.finishInvalidNextPos(i);return}if(this.character.isBlockingDirection(Ma(this.character.getNextTilePos().position,i.position))){if(x.pathBlockedStrategy==="STOP")this.finishPathBlocked(i);else if(x.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(g);return}else x.pathBlockedStrategy==="WAIT"&&x.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=g,this.pathBlockedWaitElapsed>=x.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(i,x.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,i.position)),this.isLastMovement()&&this.finish("SUCCESS","",i)}getNextValidPosition(){for(var g;this.queue.size()>0;){let t=(g=this.queue.peek())==null?void 0:g.command;if(If(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(g){let t=this.distanceUtils.distance(this.character.getNextTilePos().position,g.position)===1,i=this.tilemap.getTransition(g.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==g.layer)return t&&i===g.layer;let x=i!==void 0&&i!==g.layer;return t&&!x}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(g){g?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(g)} 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(g){this.finish("PATH_BLOCKED",`Position ${this.posToStr(g)} is blocked.`)}finishBlockedWaitTimeout(g,t){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(g)} is blocked and the wait timeout of ${t} ms has been exceeded.`)}finish(g,t="",i=this.character.getNextTilePos()){this.queue=new pm,this.finished$.next({position:i.position,result:g,description:t,layer:i.layer})}getDir(g,t){return this.tilemap.fromMapDirection(Ma(g,t))}posToStr(g){return`(${g.position.x}, ${g.position.y}, ${g.layer})`}},M4=class{constructor(g=!0){this.isCreatedInternal=!1,g&&console.log(`Using GridEngine v${PC}`)}getCharLayer(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().layer}getTransition(g,t){var i;return this.initGuard(),(i=this.gridTilemap)==null?void 0:i.getTransition(new Qt(g),t)}setTransition(g,t,i){var x;return this.initGuard(),(x=this.gridTilemap)==null?void 0:x.setTransition(new Qt(g),t,i)}create(g,t){this.isCreatedInternal=!0,this.gridCharacters=new Map;let i=this.setConfigDefaults(t);this.config=i,this.movementStopped$=new In,this.movementStarted$=new In,this.directionChanged$=new In,this.positionChangeStarted$=new In,this.positionChangeFinished$=new In,this.queueMovementFinished$=new In,this.charRemoved$=new In,this.charAdded$=new In,this.gridTilemap=new y4(g,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(g){return g?new Map(Object.entries(g).map(([t,i])=>[t,new Set(i)])):void 0}getPosition(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().position}move(g,t){this.moveChar(g,t)}moveRandomly(g,t=0,i=-1){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);let E=new c4(T,t,i);T.setMovement(E)}getMovement(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getMovement();return x?x.getInfo():{type:"None"}}moveTo(g,t,i){var x;let T=this.assembleMoveToConfig(i);this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let s=new FC(E,this.gridTilemap,{position:new Qt(t),layer:i?.targetLayer||E.getNextTilePos().layer},{distance:0,config:T});return E.setMovement(s),s.finishedObs().pipe(od(y=>({charId:g,position:y.position,result:y.result,description:y.description,layer:y.layer})))}stopMovement(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);i.setMovement(void 0)}setSpeed(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setSpeed(t)}getSpeed(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getSpeed()}collidesWithTiles(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.collidesWithTiles()}update(g,t){var i;if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(t);(i=this.gridTilemap)==null||i.invalidateFrameCache()}addCharacter(g){var t,i,x,T,E;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let s={speed:g.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:g.charLayer,facingDirection:g.facingDirection,labels:g.labels,numberOfDirections:(t=g.numberOfDirections)!=null?t:this.config.numberOfDirections,tileWidth:g.tileWidth,tileHeight:g.tileHeight};typeof g.collides=="boolean"?g.collides===!1&&(s.collidesWithTiles=!1,s.collisionGroups=[]):g.collides!==void 0&&(g.collides.collidesWithTiles===!1&&(s.collidesWithTiles=!1),g.collides.collisionGroups&&(s.collisionGroups=g.collides.collisionGroups),g.collides.ignoreCollisionGroups&&(s.ignoreCollisionGroups=g.collides.ignoreCollisionGroups),s.ignoreMissingTiles=(x=(i=g.collides)==null?void 0:i.ignoreMissingTiles)!=null?x:!1);let y=new n4(g.id,s);g.startPosition&&y.setTilePosition({position:new Qt(g.startPosition),layer:y.getTilePos().layer}),(T=this.gridCharacters)==null||T.set(g.id,y),this.gridTilemap.addCharacter(y);let e=y.getId();y.movementStopped().pipe(Ta(this.charRemoved(e))).subscribe(r=>{var p;(p=this.movementStopped$)==null||p.next({charId:e,direction:r})}),y.movementStarted().pipe(Ta(this.charRemoved(e))).subscribe(r=>{var p;(p=this.movementStarted$)==null||p.next({charId:e,direction:r})}),y.directionChanged().pipe(Ta(this.charRemoved(e))).subscribe(r=>{var p;(p=this.directionChanged$)==null||p.next({charId:e,direction:r})}),y.positionChangeStarted().pipe(Ta(this.charRemoved(e))).subscribe(r=>{var p;(p=this.positionChangeStarted$)==null||p.next(An({charId:e},r))}),y.positionChangeFinished().pipe(Ta(this.charRemoved(e))).subscribe(r=>{var p;(p=this.positionChangeFinished$)==null||p.next(An({charId:e},r))}),(E=this.charAdded$)==null||E.next(e)}hasCharacter(g){var t;return this.initGuard(),!!((t=this.gridCharacters)!=null&&t.has(g))}removeCharacter(g){var t,i,x,T;if(this.initGuard(),!((t=this.gridCharacters)!=null&&t.get(g)))throw this.createCharUnknownErr(g);(i=this.gridTilemap)==null||i.removeCharacter(g),(x=this.gridCharacters)==null||x.delete(g),(T=this.charRemoved$)==null||T.next(g)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let g of this.gridCharacters.keys())this.removeCharacter(g)}getAllCharacters(g){if(this.initGuard(),!this.gridCharacters)return[];let t=[...this.gridCharacters.values()];return(g?d4(t,g):t).map(i=>i.getId())}getLabels(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getLabels()}addLabels(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.addLabels(t)}removeLabels(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.removeLabels(t)}clearLabels(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);i.clearLabels()}follow(g,t,i,x){var T,E,s,y,e,r;let p;i===void 0?p={distance:0,closestPointIfBlocked:!1}:typeof i=="number"?(p={distance:i,closestPointIfBlocked:!1},x&&(p.closestPointIfBlocked=!0)):p=i,this.initGuard();let h=(T=this.gridCharacters)==null?void 0:T.get(g),a=(E=this.gridCharacters)==null?void 0:E.get(t);if(!h)throw this.createCharUnknownErr(g);if(!a)throw this.createCharUnknownErr(t);if(!this.gridTilemap)throw this.createUninitializedErr();let l=new f4(h,this.gridTilemap,a,{distance:(s=p.distance)!=null?s:0,noPathFoundStrategy:p.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(y=p.maxPathLength)!=null?y:1/0,shortestPathAlgorithm:(e=p.algorithm)!=null?e:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!p.ignoreLayers,facingDirection:(r=p.facingDirection)!=null?r:"none"});h.setMovement(l)}isMoving(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.isMoving()}getFacingDirection(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getFacingDirection()}getFacingPosition(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getFacingPosition();return{x:x.x,y:x.y}}turnTowards(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);return x.turnTowards(t)}getCharactersAt(g,t){if(this.initGuard(),!this.gridTilemap)return[];let i=this.gridTilemap.getCharactersAt(new Qt(g),t);return Array.from(i).map(x=>x.getId())}setPosition(g,t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);i||T.setTilePosition({position:new Qt(t),layer:T.getTilePos().layer}),T.setTilePosition({position:new Qt(t),layer:i})}isBlocked(g,t,i=["geDefault"]){var x,T;this.initGuard();let E=new Qt(g);return!!((x=this.gridTilemap)!=null&&x.hasBlockingTile(E,t)||(T=this.gridTilemap)!=null&&T.hasBlockingChar(E,t,i))}isTileBlocked(g,t){var i;return this.initGuard(),!!((i=this.gridTilemap)!=null&&i.hasBlockingTile(new Qt(g),t))}getCollisionGroups(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getCollisionGroups()||[]}setCollisionGroups(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setCollisionGroups(t)}getIgnoreCollisionGroups(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(g,t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setIgnoreCollisionGroups(t)}getTilePosInDirection(g,t,i){if(!this.gridTilemap)throw this.createUninitializedErr();let x=this.gridTilemap.getTilePosInDirection({position:new Qt(g),layer:t},i);return{position:x.position.toPosition(),charLayer:x.layer}}findShortestPath(g,t,i={}){if(!this.gridTilemap)throw this.createUninitializedErr();let x=i.shortestPathAlgorithm||"BFS";i.considerCosts&&x!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${x}'. It can only be used with A* algorithm.`);let T=i.pathWidth!==void 0&&i.pathWidth!==1,E=i.pathHeight!==void 0&&i.pathHeight!==1;(T||E)&&x==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let s=new LC(this.gridTilemap).findShortestPath(Ai.toInternal(g),Ai.toInternal(t),dh(An({},i),{shortestPathAlgorithm:x}));return{path:s.path.map(Ai.fromInternal),closestToTarget:s.closestToTarget?Ai.fromInternal(s.closestToTarget):void 0,reachedMaxPathLength:!1,steps:s.steps}}steppedOn(g,t,i){return this.positionChangeFinished().pipe(ph(x=>g.includes(x.charId)&&t.some(T=>T.x===x.enterTile.x&&T.y===x.enterTile.y)&&(i===void 0||i.includes(x.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(od(g=>({charId:g,action:"ADDED"})),i4(this.charRemoved$.pipe(od(g=>({charId:g,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(g){var t;this.initGuard();let i=(t=this.gridCharacters)==null?void 0:t.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getMovementProgress()}rebuildTileCollisionCache(g,t,i,x){var T;(T=this.gridTilemap)==null||T.rebuildTileCollisionCache(new Kx(g,t,i,x))}addQueueMovements(g,t,i){var x,T;this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let s;((T=E?.getMovement())==null?void 0:T.getInfo().type)==="Queue"?s=E.getMovement():(s=new E4(E,this.gridTilemap),E.setMovement(s),s.finished().pipe(Ta(_O(this.charRemoved(g),E.autoMovementSet()))).subscribe(y=>{var e;(e=this.queueMovementFinished$)==null||e.next(An({charId:g},y))})),s.enqueue(t.map(y=>If(y)?y:{position:new Qt(y.position),layer:y.charLayer}),i)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(g){var t,i;this.initGuard();let x=(t=this.gridCharacters)==null?void 0:t.get(g);if(!x)throw this.createCharUnknownErr(g);return((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"?x.getMovement().peekAll().map(T=>({command:If(T.command)?T.command:Ai.fromInternal(T.command),config:T.config})):[]}clearEnqueuedMovements(g){var t,i;this.initGuard();let x=(t=this.gridCharacters)==null?void 0:t.get(g);if(!x)throw this.createCharUnknownErr(g);((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"&&x.getMovement().clear()}getTileCost(g,t,i){var x,T;return this.initGuard(),(T=(x=this.gridTilemap)==null?void 0:x.getTileCosts({position:new Qt(g),layer:t},i))!=null?T:1}getState(){let g=[];if(this.gridCharacters)for(let[t,i]of this.gridCharacters.entries())g.push({id:t,position:Ai.fromInternal(i.getTilePos()),facingDirection:i.getFacingDirection(),speed:i.getSpeed(),labels:i.getLabels(),movementProgress:i.getMovementProgress(),collisionConfig:{collisionGroups:i.getCollisionGroups(),ignoreCollisionGroups:i.getIgnoreCollisionGroups(),collidesWithTiles:i.collidesWithTiles(),ignoreMissingTiles:i.getIgnoreMissingTiles()}});return{characters:g}}setState(g){if(this.gridCharacters)for(let t of g.characters){let i=this.gridCharacters.get(t.id);if(i){let x=i.getTilePos();Ai.equal(x,Ai.toInternal(t.position))||i.setTilePosition(Ai.toInternal(t.position)),i.setSpeed(t.speed),i.turnTowards(t.facingDirection),t.collisionConfig.collisionGroups&&i.setCollisionGroups(t.collisionConfig.collisionGroups),t.collisionConfig.collidesWithTiles!==void 0&&i.setCollidesWithTiles(t.collisionConfig.collidesWithTiles),t.collisionConfig.ignoreMissingTiles!==void 0&&i.setIgnoreMissingTiles(t.collisionConfig.ignoreMissingTiles),i.setMovementProgress(t.movementProgress),i.clearLabels(),i.addLabels(t.labels)}}}charRemoved(g){var t;if(!this.charRemoved$)throw this.createUninitializedErr();return(t=this.charRemoved$)==null?void 0:t.pipe(qf(1),ph(i=>i==g))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var g;(g=this.config)==null||g.characters.forEach(t=>this.addCharacter(t))}moveChar(g,t){var i,x,T;this.initGuard();let E=(i=this.gridCharacters)==null?void 0:i.get(g);if(!E)throw this.createCharUnknownErr(g);if(E.getNumberOfDirections()===4){if(!((x=this.gridTilemap)!=null&&x.isIsometric())&&ad(t)){console.warn(`GridEngine: Character '${g}' can't be moved '${t}' in 4 direction mode.`);return}else if((T=this.gridTilemap)!=null&&T.isIsometric()&&!ad(t)){console.warn(`GridEngine: Character '${g}' can't be moved '${t}' in 4 direction isometric mode.`);return}}E.move(t)}createCharUnknownErr(g){return new Error(`Character unknown: ${g}`)}assembleMoveToConfig(g={}){let t=dh(An({},g),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return g!=null&&g.noPathFoundStrategy&&(Object.values(MC).includes(g.noPathFoundStrategy)?t.noPathFoundStrategy=g.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${g.noPathFoundStrategy}'. Falling back to 'STOP'`)),g!=null&&g.pathBlockedStrategy&&(Object.values(CC).includes(g.pathBlockedStrategy)?t.pathBlockedStrategy=g.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${g.pathBlockedStrategy}'. Falling back to 'WAIT'`)),t}setConfigDefaults(g){return An({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},g)}},C4=class extends AC{constructor(g,t={}){super(g,t),this.jumpCache=new lT}findShortestPathImpl(g,t){return this.jumpCache=new lT,super.findShortestPathImpl(g,t)}getNeighborsInternal(g,t,i){if(!t||g.layer!==t.layer)return this.getNeighbors(g,i).map(E=>({p:E,dist:1}));let x=this.prune(t,g).map(E=>{let s=this.getTransition(E.position,g.layer);return{position:E.position,layer:s||g.layer}}),T=[];for(let E of x){let s=this.jump(g,E,i,1,Ma(g.position,E.position));s&&(s.dist=this.distance(g.position,s.p.position),T.push(s))}return T}getForced(g,t){let i=[],{topLeft:x,downLeft:T,top:E,bottom:s,topRight:y,downRight:e}=this.normalizedPositions(g,t),r=Ma(g.position,t.position);return ad(r)?(this.blockOrTrans(g,x)&&(this.addIfNotBlocked(i,t,E),this.addIfNotBlocked(i,t,y),this.blockOrTrans(T,x)&&this.addIfNotBlocked(i,t,x)),this.blockOrTrans(g,T)&&(this.addIfNotBlocked(i,t,s),this.addIfNotBlocked(i,t,e),this.blockOrTrans(x,T)&&this.addIfNotBlocked(i,t,T)),this.blockOrTrans(x,E)&&this.addIfNotBlocked(i,t,E),this.blockOrTrans(T,s)&&this.addIfNotBlocked(i,t,s),this.blockOrTrans(x,y)&&this.addIfNotBlocked(i,t,y),this.blockOrTrans(T,e)&&this.addIfNotBlocked(i,t,e)):((this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&this.addIfNotBlocked(i,t,y),(this.blockOrTrans(g,s)||this.blockOrTrans(s,e))&&this.addIfNotBlocked(i,t,e),this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(this.addIfNotBlocked(i,t,E),this.addIfNotBlocked(i,t,x)),this.blockOrTrans(g,T)&&this.blockOrTrans(g,s)&&(this.addIfNotBlocked(i,t,s),this.addIfNotBlocked(i,t,T)),this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&this.addIfNotBlocked(i,t,E),this.blockOrTrans(T,s)&&this.blockOrTrans(g,s)&&this.addIfNotBlocked(i,t,s)),i}hasForced(g,t){let{topLeft:i,downLeft:x,top:T,bottom:E,topRight:s,downRight:y}=this.normalizedPositions(g,t),e=Ma(g.position,t.position);if(ad(e)){if(this.blockOrTrans(g,i)&&(!this.blockOrTrans(t,T)||!this.blockOrTrans(t,s)||this.blockOrTrans(x,i)&&!this.blockOrTrans(t,i))||this.blockOrTrans(g,x)&&(!this.blockOrTrans(t,E)||!this.blockOrTrans(t,y)||this.blockOrTrans(i,x)&&!this.blockOrTrans(t,x))||this.blockOrTrans(i,T)&&!this.blockOrTrans(t,T)||this.blockOrTrans(x,E)&&!this.blockOrTrans(t,E)||this.blockOrTrans(i,s)&&!this.blockOrTrans(t,s)||this.blockOrTrans(x,y)&&!this.blockOrTrans(t,y))return!0}else if((this.blockOrTrans(g,T)||this.blockOrTrans(T,s))&&!this.blockOrTrans(t,s)||(this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&!this.blockOrTrans(t,y)||this.blockOrTrans(g,i)&&this.blockOrTrans(g,T)&&(!this.blockOrTrans(t,T)||!this.blockOrTrans(t,i))||this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(!this.blockOrTrans(t,E)||!this.blockOrTrans(t,x))||this.blockOrTrans(i,T)&&this.blockOrTrans(g,T)&&!this.blockOrTrans(t,T)||this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&!this.blockOrTrans(t,E))return!0;return!1}prune(g,t){let{top:i,right:x,topRight:T,downRight:E,bottom:s}=this.normalizedPositions(g,t),y=this.getForced(g,t),e=Ma(g.position,t.position);return ad(e)?[i,x,T,E,s,...y]:[x,...y]}jump(g,t,i,x,T){let E=this.jumpCache.get(g,t);if(E!==null)return E;if(this.isBlocking(g,t)&&!(Ai.equal(t,i)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(g,t,void 0);return}if(Ai.equal(t,i))return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(x>=this.maxJumpSize)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.getTransition(t.position,g.layer)!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.hasForced(g,t))return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.updateClosestToTarget(t,i),T==="up-left"){if(this.jump(t,this.getTilePosInDir(t,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="down-left"){if(this.jump(t,this.getTilePosInDir(t,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="up-right"){if(this.jump(t,this.getTilePosInDir(t,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}else if(T==="down-right"){if(this.jump(t,this.getTilePosInDir(t,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0};if(this.jump(t,this.getTilePosInDir(t,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,t,{p:t,dist:0}),{p:t,dist:0}}let s=this.jump(t,this.getTilePosInDir(t,T),i,x+1,T);return this.jumpCache.set(g,t,s),s}normalizedPositions(g,t){return g.position.xt.position.x&&g.position.y===t.position.y?{topLeft:{position:new Qt(t.position.x+1,t.position.y+1),layer:t.layer},downLeft:{position:new Qt(t.position.x+1,t.position.y-1),layer:t.layer},top:{position:new Qt(t.position.x,t.position.y+1),layer:t.layer},bottom:{position:new Qt(t.position.x,t.position.y-1),layer:t.layer},right:{position:new Qt(t.position.x-1,t.position.y),layer:t.layer},topRight:{position:new Qt(t.position.x-1,t.position.y+1),layer:t.layer},downRight:{position:new Qt(t.position.x-1,t.position.y-1),layer:t.layer}}:g.position.yt.position.y&&g.position.x===t.position.x?{topLeft:{position:new Qt(t.position.x-1,t.position.y+1),layer:t.layer},downLeft:{position:new Qt(t.position.x+1,t.position.y+1),layer:t.layer},top:{position:new Qt(t.position.x-1,t.position.y),layer:t.layer},bottom:{position:new Qt(t.position.x+1,t.position.y),layer:t.layer},right:{position:new Qt(t.position.x,t.position.y-1),layer:t.layer},topRight:{position:new Qt(t.position.x-1,t.position.y-1),layer:t.layer},downRight:{position:new Qt(t.position.x+1,t.position.y-1),layer:t.layer}}:g.position.yt.position.x?{topLeft:{position:new Qt(t.position.x+1,t.position.y),layer:t.layer},downLeft:{position:new Qt(t.position.x,t.position.y-1),layer:t.layer},top:{position:new Qt(t.position.x+1,t.position.y+1),layer:t.layer},bottom:{position:new Qt(t.position.x-1,t.position.y-1),layer:t.layer},right:{position:new Qt(t.position.x-1,t.position.y+1),layer:t.layer},topRight:{position:new Qt(t.position.x,t.position.y+1),layer:t.layer},downRight:{position:new Qt(t.position.x-1,t.position.y),layer:t.layer}}:g.position.y>t.position.y&&g.position.x(g.SUCCESS="SUCCESS",g.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED="PATH_BLOCKED",g.NO_PATH_FOUND="NO_PATH_FOUND",g.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",g.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",g.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",g))(A4||{}),FC=class{constructor(g,t,i,{config:x,ignoreBlockedTarget:T=!1,distance:E=0}={}){this.character=g,this.tilemap=t,this.targetPos=i,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=(e,r)=>e?new wC(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:e,layer:r}):!0;var s,y;this.shortestPathAlgorithm=(s=x?.algorithm)!=null?s:this.shortestPathAlgorithm,this.ignoreBlockedTarget=T,this.distance=E,this.noPathFoundStrategy=x?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=x?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new tT(x?.noPathFoundRetryBackoffMs||200,x?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new tT(x?.pathBlockedRetryBackoffMs||200,x?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),x!=null&&x.isPositionAllowedFn&&(this.isPositionAllowed=x.isPositionAllowedFn),x!=null&&x.maxPathLength&&(this.maxPathLength=x.maxPathLength),this.alternativeTargets=x?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=x?.noPathFoundAlternativeTargetsFallbackStrategy,x!=null&&x.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=x?.considerCosts||!1,this.ignoreLayers=!!(x!=null&&x.ignoreLayers),this.distanceUtils=gd.create(g.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=x?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(y=x?.ignoredChars)!=null?y:[],this.finished$=new In,this.setCharacter(g)}setPathBlockedStrategy(g){this.pathBlockedStrategy=g}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(g){this.character=g,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(ph(t=>t!==this),qf(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(g){var t,i,x,T;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(g,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((t=this.nextTileOnPath())==null?void 0:t.position,(i=this.character)==null?void 0:i.getNextTilePos().layer)?this.applyPathBlockedStrategy(g):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((x=this.nextTileOnPath())==null?void 0:x.position,(T=this.character)==null?void 0:T.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(g=>Ai.fromInternal(g))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:Ai.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(g){switch(g){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(g){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(g,()=>{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+=g,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let g=this.nextTileOnPath();if(!g)return;let t=this.getDir(this.character.getNextTilePos().position,g.position);this.character.move(t)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(g){this.finished$.next({position:this.character.getTilePos().position,result:g,description:this.resultToReason(g),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let g=this.shortestPath[this.posOnPath+1],t=this.getDir(this.character.getNextTilePos().position,g.position);this.character.turnTowards(t)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let g=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:E,distOffset:s}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:i,distOffset:0}}pathToAlternativeTarget(g,t){let i=t.findShortestPath(this.character.getNextTilePos(),g,this.getPathfindingOptions()).path,x=this.distanceUtils.distance(g.position,this.targetPos.position);return{path:i,distOffset:x}}getDir(g,t){return this.tilemap.fromMapDirection(this.distanceUtils.direction(g,t))}},P4=Object.create,OC=Object.defineProperty,R4=Object.getOwnPropertyDescriptor,b4=Object.getOwnPropertyNames,L4=Object.getPrototypeOf,F4=Object.prototype.hasOwnProperty,O4=(g,t)=>()=>(t||g((t={exports:{}}).exports,t),t.exports),D4=(g,t,i,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let T of b4(t))!F4.call(g,T)&&T!==i&&OC(g,T,{get:()=>t[T],enumerable:!(x=R4(t,T))||x.enumerable});return g},jx=(g,t,i)=>(i=g!=null?P4(L4(g)):{},D4(t||!g||!g.__esModule?OC(i,"default",{value:g,enumerable:!0}):i,g)),Zx=O4((g,t)=>{(function(){var i,x="4.17.21",T=200,E="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",y="Invalid `variable` option passed into `_.template`",e="__lodash_hash_undefined__",r=500,p="__lodash_placeholder__",h=1,a=2,l=4,n=1,u=2,f=1,o=2,c=4,d=8,v=16,m=32,S=64,M=128,w=256,C=512,A=30,P="...",b=800,O=16,I=1,D=2,B=3,G=1/0,z=9007199254740991,X=17976931348623157e292,K=NaN,Q=4294967295,tt=Q-1,Y=Q>>>1,Z=[["ary",M],["bind",f],["bindKey",o],["curry",d],["curryRight",v],["flip",C],["partial",m],["partialRight",S],["rearg",w]],U="[object Arguments]",H="[object Array]",J="[object AsyncFunction]",_="[object Boolean]",q="[object Date]",at="[object DOMException]",ot="[object Error]",rt="[object Function]",gt="[object GeneratorFunction]",yt="[object Map]",Et="[object Number]",At="[object Null]",Pt="[object Object]",Vt="[object Promise]",dt="[object Proxy]",ut="[object RegExp]",Rt="[object Set]",Dt="[object String]",Ht="[object Symbol]",Bt="[object Undefined]",ne="[object WeakMap]",oe="[object WeakSet]",ge="[object ArrayBuffer]",xe="[object DataView]",Ae="[object Float32Array]",qt="[object Float64Array]",Ge="[object Int8Array]",Oe="[object Int16Array]",Be="[object Int32Array]",Le="[object Uint8Array]",ie="[object Uint8ClampedArray]",Ke="[object Uint16Array]",ri="[object Uint32Array]",Ti=/\b__p \+= '';/g,le=/\b(__p \+=) '' \+/g,xi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,Me=/[&<>"']/g,Ce=RegExp(bt.source),Ve=RegExp(Me.source),Je=/<%-([\s\S]+?)%>/g,zi=/<%([\s\S]+?)%>/g,Di=/<%=([\s\S]+?)%>/g,en=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zn=/^\w*$/,Gi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,di=/[\\^$.*+?()[\]{}|]/g,Wi=RegExp(di.source),Pa=/^\s+/,aa=/\s/,Bs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qr=/\{\n\/\* \[wrapped with (.+)\] \*/,ao=/,? & /,_r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Us=/[()=,{}\[\]\/\s]/,xs=/\\(\\)?/g,oo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Rl=/\w*$/,Tt=/^[-+]0x[0-9a-f]+$/i,jt=/^0b[01]+$/i,_t=/^\[object .+?Constructor\]$/,ee=/^0o[0-7]+$/i,te=/^(?:0|[1-9]\d*)$/,Te=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ue=/($^)/,We=/['\n\r\u2028\u2029\\]/g,$e="\\ud800-\\udfff",qe="\\u0300-\\u036f",ii="\\ufe20-\\ufe2f",ai="\\u20d0-\\u20ff",Ji=qe+ii+ai,hn="\\u2700-\\u27bf",ki="a-z\\xdf-\\xf6\\xf8-\\xff",mn="\\xac\\xb1\\xd7\\xf7",ti="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Se="\\u2000-\\u206f",Nr=" \\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",mi="A-Z\\xc0-\\xd6\\xd8-\\xde",un="\\ufe0e\\ufe0f",Ii=mn+ti+Se+Nr,Gn="['’]",pn="["+$e+"]",Ki="["+Ii+"]",dr="["+Ji+"]",zs="\\d+",Tn="["+hn+"]",oa="["+ki+"]",Jn="[^"+$e+Ii+zs+hn+ki+mi+"]",Ra="\\ud83c[\\udffb-\\udfff]",Gs="(?:"+dr+"|"+Ra+")",lo="[^"+$e+"]",ba="(?:\\ud83c[\\udde6-\\uddff]){2}",ho="[\\ud800-\\udbff][\\udc00-\\udfff]",gi="["+mi+"]",La="\\u200d",Bu="(?:"+oa+"|"+Jn+")",oc="(?:"+gi+"|"+Jn+")",rr="(?:"+Gn+"(?:d|ll|m|re|s|t|ve))?",Vs="(?:"+Gn+"(?:D|LL|M|RE|S|T|VE))?",Hs=Gs+"?",Ws="["+un+"]?",bl="(?:"+La+"(?:"+[lo,ba,ho].join("|")+")"+Ws+Hs+")*",Ni="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Br=Ws+Hs+bl,uo="(?:"+[Tn,ba,ho].join("|")+")"+Br,Wo="(?:"+[lo+dr+"?",dr,ba,ho,pn].join("|")+")",Eh=RegExp(Gn,"g"),nn=RegExp(dr,"g"),Xo=RegExp(Ra+"(?="+Ra+")|"+Wo+Br,"g"),Ss=RegExp([gi+"?"+oa+"+"+rr+"(?="+[Ki,gi,"$"].join("|")+")",oc+"+"+Vs+"(?="+[Ki,gi+Bu,"$"].join("|")+")",gi+"?"+Bu+"+"+rr,gi+"+"+Vs,Pn,Ni,zs,uo].join("|"),"g"),Yo=RegExp("["+La+$e+Ji+un+"]"),Uu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fo=["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"],xr=-1,ji={};ji[Ae]=ji[qt]=ji[Ge]=ji[Oe]=ji[Be]=ji[Le]=ji[ie]=ji[Ke]=ji[ri]=!0,ji[U]=ji[H]=ji[ge]=ji[_]=ji[xe]=ji[q]=ji[ot]=ji[rt]=ji[yt]=ji[Et]=ji[Pt]=ji[ut]=ji[Rt]=ji[Dt]=ji[ne]=!1;var Zi={};Zi[U]=Zi[H]=Zi[ge]=Zi[xe]=Zi[_]=Zi[q]=Zi[Ae]=Zi[qt]=Zi[Ge]=Zi[Oe]=Zi[Be]=Zi[yt]=Zi[Et]=Zi[Pt]=Zi[ut]=Zi[Rt]=Zi[Dt]=Zi[Ht]=Zi[Le]=Zi[ie]=Zi[Ke]=Zi[ri]=!0,Zi[ot]=Zi[rt]=Zi[ne]=!1;var Ts={À:"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"},Ur={"&":"&","<":"<",">":">",'"':""","'":"'"},Ll={"&":"&","<":"<",">":">",""":'"',"'":"'"},Mh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ko=parseFloat,Fl=parseInt,zr=typeof global=="object"&&global&&global.Object===Object&&global,lc=typeof self=="object"&&self&&self.Object===Object&&self,gn=zr||lc||Function("return this")(),Ch=typeof g=="object"&&g&&!g.nodeType&&g,Rn=Ch&&typeof t=="object"&&t&&!t.nodeType&&t,Fa=Rn&&Rn.exports===Ch,Oa=Fa&&zr.process,En=function(){try{var ct=Rn&&Rn.require&&Rn.require("util").types;return ct||Oa&&Oa.binding&&Oa.binding("util")}catch{}}(),Da=En&&En.isArrayBuffer,Ia=En&&En.isDate,Ol=En&&En.isMap,Dl=En&&En.isRegExp,Na=En&&En.isSet,Xs=En&&En.isTypedArray;function $i(ct,St,vt){switch(vt.length){case 0:return ct.call(St);case 1:return ct.call(St,vt[0]);case 2:return ct.call(St,vt[0],vt[1]);case 3:return ct.call(St,vt[0],vt[1],vt[2])}return ct.apply(St,vt)}function Wr(ct,St,vt,Ft){for(var Lt=-1,Ut=ct==null?0:ct.length;++Lt-1}function la(ct,St,vt){for(var Ft=-1,Lt=ct==null?0:ct.length;++Ft-1;);return vt}function po(ct,St){for(var vt=ct.length;vt--&&ts(St,ct[vt],0)>-1;);return vt}function is(ct,St){for(var vt=ct.length,Ft=0;vt--;)ct[vt]===St&&++Ft;return Ft}var zu=ar(Ts),Jo=ar(Ur);function ns(ct){return"\\"+Mh[ct]}function cn(ct,St){return ct==null?i:ct[St]}function Cs(ct){return Yo.test(ct)}function lr(ct){return Uu.test(ct)}function vo(ct){for(var St,vt=[];!(St=ct.next()).done;)vt.push(St.value);return vt}function Ga(ct){var St=-1,vt=Array(ct.size);return ct.forEach(function(Ft,Lt){vt[++St]=[Lt,Ft]}),vt}function Va(ct,St){return function(vt){return ct(St(vt))}}function Qn(ct,St){for(var vt=-1,Ft=ct.length,Lt=0,Ut=[];++vt-1}function Vu(R,N){var k=this.__data__,nt=To(k,R);return nt<0?(++this.size,k.push([R,N])):k[nt][1]=N,this}ks.prototype.clear=Tp,ks.prototype.delete=dc,ks.prototype.get=Ep,ks.prototype.has=Mp,ks.prototype.set=Vu;function ws(R){var N=-1,k=R==null?0:R.length;for(this.clear();++N=N?R:N)),R}function ss(R,N,k,nt,ft,xt){var Ot,Gt=N&h,kt=N&a,fe=N&l;if(k&&(Ot=ft?k(R,nt,ft,xt):k(R)),Ot!==i)return Ot;if(!Dn(R))return R;var ce=Si(R);if(ce){if(Ot=qA(R),!Gt)return Rr(R,Ot)}else{var ye=Yr(R),Ie=ye==rt||ye==gt;if($l(R))return Dc(R,Gt);if(ye==Pt||ye==U||Ie&&!ft){if(Ot=kt||Ie?{}:j1(R),!Gt)return kt?Gp(R,bp(Ot,R)):Gg(R,xc(Ot,R))}else{if(!Zi[ye])return ft?R:{};Ot=tP(R,ye,Gt)}}xt||(xt=new qn);var je=xt.get(R);if(je)return je;xt.set(R,Ot),ES(R)?R.forEach(function(hi){Ot.add(ss(hi,N,k,hi,R,xt))}):SS(R)&&R.forEach(function(hi,Bi){Ot.set(Bi,ss(hi,N,k,Bi,R,xt))});var li=fe?kt?Ui:Yn:kt?Ls:Lr,Fi=ce?i:li(R);return yn(Fi||R,function(hi,Bi){Fi&&(Bi=hi,hi=R[Bi]),Ks(Ot,Bi,ss(hi,N,k,Bi,R,xt))}),Ot}function Sc(R){var N=Lr(R);return function(k){return Yu(k,R,N)}}function Yu(R,N,k){var nt=k.length;if(R==null)return!nt;for(R=It(R);nt--;){var ft=k[nt],xt=N[ft],Ot=R[ft];if(Ot===i&&!(ft in R)||!xt(Ot))return!1}return!0}function Tc(R,N,k){if(typeof R!="function")throw new $t(s);return Uc(function(){R.apply(i,k)},N)}function tl(R,N,k,nt){var ft=-1,xt=Sr,Ot=!0,Gt=R.length,kt=[],fe=N.length;if(!Gt)return kt;k&&(N=Qi(N,or(k))),nt?(xt=la,Ot=!1):N.length>=T&&(xt=Hn,Ot=!1,N=new So(N));t:for(;++ftft?0:ft+k),nt=nt===i||nt>ft?ft:Ri(nt),nt<0&&(nt+=ft),nt=k>nt?0:CS(nt);k0&&k(Gt)?N>1?hr(Gt,N-1,k,nt,ft):Xr(ft,Gt):nt||(ft[ft.length]=Gt)}return ft}var Hl=nf(),Bh=nf(!0);function as(R,N){return R&&Hl(R,N,Lr)}function Wl(R,N){return R&&Bh(R,N,Lr)}function el(R,N){return Mn(N,function(k){return al(R[k])})}function Zs(R,N){N=Po(N,R);for(var k=0,nt=N.length;R!=null&&kN}function Op(R,N){return R!=null&&me.call(R,N)}function Mc(R,N){return R!=null&&N in It(R)}function Ug(R,N,k){return R>=Er(N,k)&&R<_n(N,k)}function Xl(R,N,k){for(var nt=k?la:Sr,ft=R[0].length,xt=R.length,Ot=xt,Gt=vt(xt),kt=1/0,fe=[];Ot--;){var ce=R[Ot];Ot&&N&&(ce=Qi(ce,or(N))),kt=Er(ce.length,kt),Gt[Ot]=!k&&(N||ft>=120&&ce.length>=120)?new So(Ot&&ce):i}ce=R[0];var ye=-1,Ie=Gt[0];t:for(;++ye-1;)Gt!==R&&yo.call(Gt,kt,1),yo.call(R,kt,1);return R}function wr(R,N){for(var k=R?N.length:0,nt=k-1;k--;){var ft=N[k];if(k==nt||ft!==xt){var xt=ft;sl(ft)?yo.call(R,ft,1):Lc(R,ft)}}return R}function va(R,N){return R+bh(fc()*(N-R+1))}function As(R,N,k,nt){for(var ft=-1,xt=_n(Rh((N-R)/(k||1)),0),Ot=vt(xt);xt--;)Ot[nt?xt:++ft]=R,R+=k;return Ot}function Jl(R,N){var k="";if(!R||N<1||N>z)return k;do N%2&&(k+=R),N=bh(N/2),N&&(R+=R);while(N);return k}function ei(R,N){return Kg($1(R,N,Fs),R+"")}function Dp(R){return Ih(of(R))}function Pc(R,N){var k=of(R);return Wp(k,Eo(N,0,k.length))}function nl(R,N,k,nt){if(!Dn(R))return R;N=Po(N,R);for(var ft=-1,xt=N.length,Ot=xt-1,Gt=R;Gt!=null&&++ftft?0:ft+N),k=k>ft?ft:k,k<0&&(k+=ft),ft=N>k?0:k-N>>>0,N>>>=0;for(var xt=vt(ft);++nt>>1,Ot=R[xt];Ot!==null&&!$s(Ot)&&(k?Ot<=N:Ot=T){var fe=N?null:br(R);if(fe)return Ha(fe);Ot=!1,ft=Hn,kt=new So}else kt=N?[]:Gt;t:for(;++nt=nt?R:ls(R,N,k)}var Up=Ph||function(R){return gn.clearTimeout(R)};function Dc(R,N){if(N)return R.slice();var k=R.length,nt=mo?mo(k):new R.constructor(k);return R.copy(nt),nt}function tf(R){var N=new R.constructor(R.byteLength);return new Cn(N).set(new Cn(R)),N}function zg(R,N){var k=N?tf(R.buffer):R.buffer;return new R.constructor(k,R.byteOffset,R.byteLength)}function Ps(R){var N=new R.constructor(R.source,Rl.exec(R));return N.lastIndex=R.lastIndex,N}function Ic(R){return Xa?It(Xa.call(R)):{}}function zp(R,N){var k=N?tf(R.buffer):R.buffer;return new R.constructor(k,R.byteOffset,R.length)}function Ka(R,N){if(R!==N){var k=R!==i,nt=R===null,ft=R===R,xt=$s(R),Ot=N!==i,Gt=N===null,kt=N===N,fe=$s(N);if(!Gt&&!fe&&!xt&&R>N||xt&&Ot&&kt&&!Gt&&!fe||nt&&Ot&&kt||!k&&kt||!ft)return 1;if(!nt&&!xt&&!fe&&R=Gt)return kt;var fe=k[nt];return kt*(fe=="desc"?-1:1)}}return R.index-N.index}function bo(R,N,k,nt){for(var ft=-1,xt=R.length,Ot=k.length,Gt=-1,kt=N.length,fe=_n(xt-Ot,0),ce=vt(kt+fe),ye=!nt;++Gt1?k[ft-1]:i,Ot=ft>2?k[2]:i;for(xt=R.length>3&&typeof xt=="function"?(ft--,xt):i,Ot&&us(k[0],k[1],Ot)&&(xt=ft<3?i:xt,ft=1),N=It(N);++nt-1?ft[xt?N[Ot]:Ot]:i}}function it(R){return Ci(function(N){var k=N.length,nt=k,ft=Mr.prototype.thru;for(R&&N.reverse();nt--;){var xt=N[nt];if(typeof xt!="function")throw new $t(s);if(ft&&!Ot&&rf(xt)=="wrapper")var Ot=new Mr([],!0)}for(nt=Ot?nt:k;++nt1&&Vi.reverse(),ce&&ktGt))return!1;var fe=xt.get(R),ce=xt.get(N);if(fe&&ce)return fe==N&&ce==R;var ye=-1,Ie=!0,je=k&u?new So:i;for(xt.set(R,N),xt.set(N,R);++ye1?"& ":"")+N[nt],N=N.join(k>2?", ":" "),R.replace(Bs,`{ +/* [wrapped with `+N+`] */ +`)}function iP(R){return Si(R)||jh(R)||!!(hc&&R&&R[hc])}function sl(R,N){var k=typeof R;return N=N??z,!!N&&(k=="number"||k!="symbol"&&te.test(R))&&R>-1&&R%1==0&&R0){if(++N>=b)return arguments[0]}else N=0;return R.apply(i,arguments)}}function Wp(R,N){var k=-1,nt=R.length,ft=nt-1;for(N=N===i?nt:N;++k1?R[N-1]:i;return k=typeof k=="function"?(R.pop(),k):i,lS(R,k)});function hS(R){var N=mt(R);return N.__chain__=!0,N}function dR(R,N){return N(R),R}function Xp(R,N){return N(R)}var pR=Ci(function(R){var N=R.length,k=N?R[0]:0,nt=this.__wrapped__,ft=function(xt){return Xu(xt,R)};return N>1||this.__actions__.length||!(nt instanceof ni)||!sl(k)?this.thru(ft):(nt=nt.slice(k,+k+(N?1:0)),nt.__actions__.push({func:Xp,args:[ft],thisArg:i}),new Mr(nt,this.__chain__).thru(function(xt){return N&&!xt.length&&xt.push(i),xt}))});function vR(){return hS(this)}function mR(){return new Mr(this.value(),this.__chain__)}function gR(){this.__values__===i&&(this.__values__=MS(this.value()));var R=this.__index__>=this.__values__.length,N=R?i:this.__values__[this.__index__++];return{done:R,value:N}}function yR(){return this}function xR(R){for(var N,k=this;k instanceof Dh;){var nt=iS(k);nt.__index__=0,nt.__values__=i,N?ft.__wrapped__=nt:N=nt;var ft=nt;k=k.__wrapped__}return ft.__wrapped__=R,N}function SR(){var R=this.__wrapped__;if(R instanceof ni){var N=R;return this.__actions__.length&&(N=new ni(this)),N=N.reverse(),N.__actions__.push({func:Xp,args:[jg],thisArg:i}),new Mr(N,this.__chain__)}return this.thru(jg)}function TR(){return wo(this.__wrapped__,this.__actions__)}var ER=Yh(function(R,N,k){me.call(R,k)?++R[k]:pa(R,k,1)});function MR(R,N,k){var nt=Si(R)?Ba:Bg;return k&&us(R,N,k)&&(N=i),nt(R,oi(N,3))}function CR(R,N){var k=Si(R)?Mn:Ec;return k(R,oi(N,3))}var wR=$(nS),AR=$(rS);function PR(R,N){return hr(Yp(R,N),1)}function RR(R,N){return hr(Yp(R,N),G)}function bR(R,N,k){return k=k===i?1:Ri(k),hr(Yp(R,N),k)}function uS(R,N){var k=Si(R)?yn:js;return k(R,oi(N,3))}function fS(R,N){var k=Si(R)?Vn:Lp;return k(R,oi(N,3))}var LR=Yh(function(R,N,k){me.call(R,k)?R[k].push(N):pa(R,k,[N])});function FR(R,N,k,nt){R=bs(R)?R:of(R),k=k&&!nt?Ri(k):0;var ft=R.length;return k<0&&(k=_n(ft+k,0)),Jp(R)?k<=ft&&R.indexOf(N,k)>-1:!!ft&&ts(R,N,k)>-1}var OR=ei(function(R,N,k){var nt=-1,ft=typeof N=="function",xt=bs(R)?vt(R.length):[];return js(R,function(Ot){xt[++nt]=ft?$i(N,Ot,k):dn(Ot,N,k)}),xt}),DR=Yh(function(R,N,k){pa(R,k,N)});function Yp(R,N){var k=Si(R)?Qi:il;return k(R,oi(N,3))}function IR(R,N,k,nt){return R==null?[]:(Si(N)||(N=N==null?[]:[N]),k=nt?i:k,Si(k)||(k=k==null?[]:[k]),Vh(R,N,k))}var NR=Yh(function(R,N,k){R[k?0:1].push(N)},function(){return[[],[]]});function BR(R,N,k){var nt=Si(R)?Ua:fa,ft=arguments.length<3;return nt(R,oi(N,4),k,ft,js)}function UR(R,N,k){var nt=Si(R)?Il:fa,ft=arguments.length<3;return nt(R,oi(N,4),k,ft,Lp)}function zR(R,N){var k=Si(R)?Mn:Ec;return k(R,jp(oi(N,3)))}function GR(R){var N=Si(R)?Ih:Dp;return N(R)}function VR(R,N,k){(k?us(R,N,k):N===i)?N=1:N=Ri(N);var nt=Si(R)?mc:Pc;return nt(R,N)}function HR(R){var N=Si(R)?Rp:Np;return N(R)}function WR(R){if(R==null)return 0;if(bs(R))return Jp(R)?V(R):R.length;var N=Yr(R);return N==yt||N==Rt?R.size:Cr(R).length}function XR(R,N,k){var nt=Si(R)?qr:Rc;return k&&us(R,N,k)&&(N=i),nt(R,oi(N,3))}var YR=ei(function(R,N){if(R==null)return[];var k=N.length;return k>1&&us(R,N[0],N[1])?N=[]:k>2&&us(N[0],N[1],N[2])&&(N=[N[0]]),Vh(R,hr(N,1),[])}),kp=sp||function(){return gn.Date.now()};function kR(R,N){if(typeof N!="function")throw new $t(s);return R=Ri(R),function(){if(--R<1)return N.apply(this,arguments)}}function cS(R,N,k){return N=k?i:N,N=R&&N==null?R.length:N,Jt(R,M,i,i,i,i,N)}function dS(R,N){var k;if(typeof N!="function")throw new $t(s);return R=Ri(R),function(){return--R>0&&(k=N.apply(this,arguments)),R<=1&&(N=i),k}}var Jg=ei(function(R,N,k){var nt=f;if(k.length){var ft=Qn(k,sf(Jg));nt|=m}return Jt(R,nt,N,k,ft)}),pS=ei(function(R,N,k){var nt=f|o;if(k.length){var ft=Qn(k,sf(pS));nt|=m}return Jt(N,nt,R,k,ft)});function vS(R,N,k){N=k?i:N;var nt=Jt(R,d,i,i,i,i,i,N);return nt.placeholder=vS.placeholder,nt}function mS(R,N,k){N=k?i:N;var nt=Jt(R,v,i,i,i,i,i,N);return nt.placeholder=mS.placeholder,nt}function gS(R,N,k){var nt,ft,xt,Ot,Gt,kt,fe=0,ce=!1,ye=!1,Ie=!0;if(typeof R!="function")throw new $t(s);N=xa(N)||0,Dn(k)&&(ce=!!k.leading,ye="maxWait"in k,xt=ye?_n(xa(k.maxWait)||0,N):xt,Ie="trailing"in k?!!k.trailing:Ie);function je(er){var Za=nt,ll=ft;return nt=ft=i,fe=er,Ot=R.apply(ll,Za),Ot}function li(er){return fe=er,Gt=Uc(Bi,N),ce?je(er):Ot}function Fi(er){var Za=er-kt,ll=er-fe,BS=N-Za;return ye?Er(BS,xt-ll):BS}function hi(er){var Za=er-kt,ll=er-fe;return kt===i||Za>=N||Za<0||ye&&ll>=xt}function Bi(){var er=kp();if(hi(er))return Vi(er);Gt=Uc(Bi,Fi(er))}function Vi(er){return Gt=i,Ie&&nt?je(er):(nt=ft=i,Ot)}function Qs(){Gt!==i&&Up(Gt),fe=0,nt=kt=ft=Gt=i}function fs(){return Gt===i?Ot:Vi(kp())}function _s(){var er=kp(),Za=hi(er);if(nt=arguments,ft=this,kt=er,Za){if(Gt===i)return li(kt);if(ye)return Up(Gt),Gt=Uc(Bi,N),je(kt)}return Gt===i&&(Gt=Uc(Bi,N)),Ot}return _s.cancel=Qs,_s.flush=fs,_s}var KR=ei(function(R,N){return Tc(R,1,N)}),jR=ei(function(R,N,k){return Tc(R,xa(N)||0,k)});function ZR(R){return Jt(R,C)}function Kp(R,N){if(typeof R!="function"||N!=null&&typeof N!="function")throw new $t(s);var k=function(){var nt=arguments,ft=N?N.apply(this,nt):nt[0],xt=k.cache;if(xt.has(ft))return xt.get(ft);var Ot=R.apply(this,nt);return k.cache=xt.set(ft,Ot)||xt,Ot};return k.cache=new(Kp.Cache||ws),k}Kp.Cache=ws;function jp(R){if(typeof R!="function")throw new $t(s);return function(){var N=arguments;switch(N.length){case 0:return!R.call(this);case 1:return!R.call(this,N[0]);case 2:return!R.call(this,N[0],N[1]);case 3:return!R.call(this,N[0],N[1],N[2])}return!R.apply(this,N)}}function JR(R){return dS(2,R)}var $R=Bp(function(R,N){N=N.length==1&&Si(N[0])?Qi(N[0],or(oi())):Qi(hr(N,1),or(oi()));var k=N.length;return ei(function(nt){for(var ft=-1,xt=Er(nt.length,k);++ft=N}),jh=Ei(function(){return arguments}())?Ei:function(R){return kn(R)&&me.call(R,"callee")&&!go.call(R,"callee")},Si=vt.isArray,f3=Da?or(Da):Wn;function bs(R){return R!=null&&Zp(R.length)&&!al(R)}function tr(R){return kn(R)&&bs(R)}function c3(R){return R===!0||R===!1||kn(R)&&pr(R)==_}var $l=op||o0,d3=Ia?or(Ia):Xn;function p3(R){return kn(R)&&R.nodeType===1&&!zc(R)}function v3(R){if(R==null)return!0;if(bs(R)&&(Si(R)||typeof R=="string"||typeof R.splice=="function"||$l(R)||af(R)||jh(R)))return!R.length;var N=Yr(R);if(N==yt||N==Rt)return!R.size;if(Bc(R))return!Cr(R).length;for(var k in R)if(me.call(R,k))return!1;return!0}function m3(R,N){return Fn(R,N)}function g3(R,N,k){k=typeof k=="function"?k:i;var nt=k?k(R,N):i;return nt===i?Fn(R,N,i,k):!!nt}function Qg(R){if(!kn(R))return!1;var N=pr(R);return N==ot||N==at||typeof R.message=="string"&&typeof R.name=="string"&&!zc(R)}function y3(R){return typeof R=="number"&&uc(R)}function al(R){if(!Dn(R))return!1;var N=pr(R);return N==rt||N==gt||N==J||N==dt}function xS(R){return typeof R=="number"&&R==Ri(R)}function Zp(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=z}function Dn(R){var N=typeof R;return R!=null&&(N=="object"||N=="function")}function kn(R){return R!=null&&typeof R=="object"}var SS=Ol?or(Ol):Yl;function x3(R,N){return R===N||On(R,N,Hg(N))}function S3(R,N,k){return k=typeof k=="function"?k:i,On(R,N,Hg(N),k)}function T3(R){return TS(R)&&R!=+R}function E3(R){if(sP(R))throw new Lt(E);return kl(R)}function M3(R){return R===null}function C3(R){return R==null}function TS(R){return typeof R=="number"||kn(R)&&pr(R)==Et}function zc(R){if(!kn(R)||pr(R)!=Pt)return!1;var N=bn(R);if(N===null)return!0;var k=me.call(N,"constructor")&&N.constructor;return typeof k=="function"&&k instanceof k&&we.call(k)==ui}var _g=Dl?or(Dl):Kl;function w3(R){return xS(R)&&R>=-z&&R<=z}var ES=Na?or(Na):Ku;function Jp(R){return typeof R=="string"||!Si(R)&&kn(R)&&pr(R)==Dt}function $s(R){return typeof R=="symbol"||kn(R)&&pr(R)==Ht}var af=Xs?or(Xs):wc;function A3(R){return R===i}function P3(R){return kn(R)&&Yr(R)==ne}function R3(R){return kn(R)&&pr(R)==oe}var b3=Qe(zh),L3=Qe(function(R,N){return R<=N});function MS(R){if(!R)return[];if(bs(R))return Jp(R)?j(R):Rr(R);if(xo&&R[xo])return vo(R[xo]());var N=Yr(R),k=N==yt?Ga:N==Rt?Ha:of;return k(R)}function ol(R){if(!R)return R===0?R:0;if(R=xa(R),R===G||R===-G){var N=R<0?-1:1;return N*X}return R===R?R:0}function Ri(R){var N=ol(R),k=N%1;return N===N?k?N-k:N:0}function CS(R){return R?Eo(Ri(R),0,Q):0}function xa(R){if(typeof R=="number")return R;if($s(R))return K;if(Dn(R)){var N=typeof R.valueOf=="function"?R.valueOf():R;R=Dn(N)?N+"":N}if(typeof R!="string")return R===0?R:+R;R=Bl(R);var k=jt.test(R);return k||ee.test(R)?Fl(R.slice(2),k?2:8):Tt.test(R)?K:+R}function wS(R){return Rs(R,Ls(R))}function F3(R){return R?Eo(Ri(R),-z,z):R===0?R:0}function tn(R){return R==null?"":Ar(R)}var O3=rl(function(R,N){if(Bc(N)||bs(N)){Rs(N,Lr(N),R);return}for(var k in N)me.call(N,k)&&Ks(R,k,N[k])}),AS=rl(function(R,N){Rs(N,Ls(N),R)}),$p=rl(function(R,N,k,nt){Rs(N,Ls(N),R,nt)}),D3=rl(function(R,N,k,nt){Rs(N,Lr(N),R,nt)}),I3=Ci(Xu);function N3(R,N){var k=Ya(R);return N==null?k:xc(k,N)}var B3=ei(function(R,N){R=It(R);var k=-1,nt=N.length,ft=nt>2?N[2]:i;for(ft&&us(N[0],N[1],ft)&&(nt=1);++k1),xt}),Rs(R,Ui(R),k),nt&&(k=ss(k,h|a|l,Ne));for(var ft=N.length;ft--;)Lc(k,N[ft]);return k});function tb(R,N){return RS(R,jp(oi(N)))}var eb=Ci(function(R,N){return R==null?{}:Hh(R,N)});function RS(R,N){if(R==null)return{};var k=Qi(Ui(R),function(nt){return[nt]});return N=oi(N),Ju(R,k,function(nt,ft){return N(nt,ft[0])})}function ib(R,N,k){N=Po(N,R);var nt=-1,ft=N.length;for(ft||(ft=1,R=i);++ntN){var nt=R;R=N,N=nt}if(k||R%1||N%1){var ft=fc();return Er(R+ft*(N-R+ko("1e-"+((ft+"").length-1))),N)}return va(R,N)}var db=L(function(R,N,k){return N=N.toLowerCase(),R+(k?FS(N):N)});function FS(R){return e0(tn(R).toLowerCase())}function OS(R){return R=tn(R),R&&R.replace(Te,zu).replace(nn,"")}function pb(R,N,k){R=tn(R),N=Ar(N);var nt=R.length;k=k===i?nt:Eo(Ri(k),0,nt);var ft=k;return k-=N.length,k>=0&&R.slice(k,ft)==N}function vb(R){return R=tn(R),R&&Ve.test(R)?R.replace(Me,Jo):R}function mb(R){return R=tn(R),R&&Wi.test(R)?R.replace(di,"\\$&"):R}var gb=L(function(R,N,k){return R+(k?"-":"")+N.toLowerCase()}),yb=L(function(R,N,k){return R+(k?" ":"")+N.toLowerCase()}),xb=Vp("toLowerCase");function Sb(R,N,k){R=tn(R),N=Ri(N);var nt=N?V(R):0;if(!N||nt>=N)return R;var ft=(N-nt)/2;return Ee(bh(ft),k)+R+Ee(Rh(ft),k)}function Tb(R,N,k){R=tn(R),N=Ri(N);var nt=N?V(R):0;return N&&nt>>0,k?(R=tn(R),R&&(typeof N=="string"||N!=null&&!_g(N))&&(N=Ar(N),!N&&Cs(R))?Ro(j(R),0,k):R.split(N,k)):[]}var Rb=L(function(R,N,k){return R+(k?" ":"")+e0(N)});function bb(R,N,k){return R=tn(R),k=k==null?0:Eo(Ri(k),0,R.length),N=Ar(N),R.slice(k,k+N.length)==N}function Lb(R,N,k){var nt=mt.templateSettings;k&&us(R,N,k)&&(N=i),R=tn(R),N=$p({},N,nt,Yt);var ft=$p({},N.imports,nt.imports,Yt),xt=Lr(ft),Ot=$n(ft,xt),Gt,kt,fe=0,ce=N.interpolate||Ue,ye="__p += '",Ie=Kt((N.escape||Ue).source+"|"+ce.source+"|"+(ce===Di?oo:Ue).source+"|"+(N.evaluate||Ue).source+"|$","g"),je="//# sourceURL="+(me.call(N,"sourceURL")?(N.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xr+"]")+` +`;R.replace(Ie,function(hi,Bi,Vi,Qs,fs,_s){return Vi||(Vi=Qs),ye+=R.slice(fe,_s).replace(We,ns),Bi&&(Gt=!0,ye+=`' + +__e(`+Bi+`) + +'`),fs&&(kt=!0,ye+=`'; +`+fs+`; +__p += '`),Vi&&(ye+=`' + +((__t = (`+Vi+`)) == null ? '' : __t) + +'`),fe=_s+hi.length,hi}),ye+=`'; +`;var li=me.call(N,"variable")&&N.variable;if(!li)ye=`with (obj) { +`+ye+` +} +`;else if(Us.test(li))throw new Lt(y);ye=(kt?ye.replace(Ti,""):ye).replace(le,"$1").replace(xi,"$1;"),ye="function("+(li||"obj")+`) { +`+(li?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Gt?", __e = _.escape":"")+(kt?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ye+`return __p +}`;var Fi=IS(function(){return Ut(xt,je+"return "+ye).apply(i,Ot)});if(Fi.source=ye,Qg(Fi))throw Fi;return Fi}function Fb(R){return tn(R).toLowerCase()}function Ob(R){return tn(R).toUpperCase()}function Db(R,N,k){if(R=tn(R),R&&(k||N===i))return Bl(R);if(!R||!(N=Ar(N)))return R;var nt=j(R),ft=j(N),xt=_i(nt,ft),Ot=po(nt,ft)+1;return Ro(nt,xt,Ot).join("")}function Ib(R,N,k){if(R=tn(R),R&&(k||N===i))return R.slice(0,et(R)+1);if(!R||!(N=Ar(N)))return R;var nt=j(R),ft=po(nt,j(N))+1;return Ro(nt,0,ft).join("")}function Nb(R,N,k){if(R=tn(R),R&&(k||N===i))return R.replace(Pa,"");if(!R||!(N=Ar(N)))return R;var nt=j(R),ft=_i(nt,j(N));return Ro(nt,ft).join("")}function Bb(R,N){var k=A,nt=P;if(Dn(N)){var ft="separator"in N?N.separator:ft;k="length"in N?Ri(N.length):k,nt="omission"in N?Ar(N.omission):nt}R=tn(R);var xt=R.length;if(Cs(R)){var Ot=j(R);xt=Ot.length}if(k>=xt)return R;var Gt=k-V(nt);if(Gt<1)return nt;var kt=Ot?Ro(Ot,0,Gt).join(""):R.slice(0,Gt);if(ft===i)return kt+nt;if(Ot&&(Gt+=kt.length-Gt),_g(ft)){if(R.slice(Gt).search(ft)){var fe,ce=kt;for(ft.global||(ft=Kt(ft.source,tn(Rl.exec(ft))+"g")),ft.lastIndex=0;fe=ft.exec(ce);)var ye=fe.index;kt=kt.slice(0,ye===i?Gt:ye)}}else if(R.indexOf(Ar(ft),Gt)!=Gt){var Ie=kt.lastIndexOf(ft);Ie>-1&&(kt=kt.slice(0,Ie))}return kt+nt}function Ub(R){return R=tn(R),R&&Ce.test(R)?R.replace(bt,st):R}var zb=L(function(R,N,k){return R+(k?" ":"")+N.toUpperCase()}),e0=Vp("toUpperCase");function DS(R,N,k){return R=tn(R),N=k?i:N,N===i?lr(R)?Mt(R):Ko(R):R.match(N)||[]}var IS=ei(function(R,N){try{return $i(R,i,N)}catch(k){return Qg(k)?k:new Lt(k)}}),Gb=Ci(function(R,N){return yn(N,function(k){k=Lo(k),pa(R,k,Jg(R[k],R))}),R});function Vb(R){var N=R==null?0:R.length,k=oi();return R=N?Qi(R,function(nt){if(typeof nt[1]!="function")throw new $t(s);return[k(nt[0]),nt[1]]}):[],ei(function(nt){for(var ft=-1;++ftz)return[];var k=Q,nt=Er(R,Q);N=oi(N),R-=Q;for(var ft=Ms(nt,N);++k0||N<0)?new ni(k):(R<0?k=k.takeRight(-R):R&&(k=k.drop(R)),N!==i&&(N=Ri(N),k=N<0?k.dropRight(-N):k.take(N-R)),k)},ni.prototype.takeRightWhile=function(R){return this.reverse().takeWhile(R).reverse()},ni.prototype.toArray=function(){return this.take(Q)},as(ni.prototype,function(R,N){var k=/^(?:filter|find|map|reject)|While$/.test(N),nt=/^(?:head|last)$/.test(N),ft=mt[nt?"take"+(N=="last"?"Right":""):N],xt=nt||/^find/.test(N);ft&&(mt.prototype[N]=function(){var Ot=this.__wrapped__,Gt=nt?[1]:arguments,kt=Ot instanceof ni,fe=Gt[0],ce=kt||Si(Ot),ye=function(Bi){var Vi=ft.apply(mt,Xr([Bi],Gt));return nt&&Ie?Vi[0]:Vi};ce&&k&&typeof fe=="function"&&fe.length!=1&&(kt=ce=!1);var Ie=this.__chain__,je=!!this.__actions__.length,li=xt&&!Ie,Fi=kt&&!je;if(!xt&&ce){Ot=Fi?Ot:new ni(this);var hi=R.apply(Ot,Gt);return hi.__actions__.push({func:Xp,args:[ye],thisArg:i}),new Mr(hi,Ie)}return li&&Fi?R.apply(this,Gt):(hi=this.thru(ye),li?nt?hi.value()[0]:hi.value():hi)})}),yn(["pop","push","shift","sort","splice","unshift"],function(R){var N=se[R],k=/^(?:push|sort|unshift)$/.test(R)?"tap":"thru",nt=/^(?:pop|shift)$/.test(R);mt.prototype[R]=function(){var ft=arguments;if(nt&&!this.__chain__){var xt=this.value();return N.apply(Si(xt)?xt:[],ft)}return this[k](function(Ot){return N.apply(Si(Ot)?Ot:[],ft)})}}),as(ni.prototype,function(R,N){var k=mt[N];if(k){var nt=k.name+"";me.call(_o,nt)||(_o[nt]=[]),_o[nt].push({name:N,func:k})}}),_o[lt(i,o).name]=[{name:"wrapper",func:i}],ni.prototype.clone=Fg,ni.prototype.reverse=Og,ni.prototype.value=rs,mt.prototype.at=pR,mt.prototype.chain=vR,mt.prototype.commit=mR,mt.prototype.next=gR,mt.prototype.plant=xR,mt.prototype.reverse=SR,mt.prototype.toJSON=mt.prototype.valueOf=mt.prototype.value=TR,mt.prototype.first=mt.prototype.head,xo&&(mt.prototype[xo]=yR),mt},zt=Nt();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(gn._=zt,define(function(){return zt})):Rn?((Rn.exports=zt)._=zt,Ch._=zt):gn._=zt}).call(g)}),DC=class extends Set{constructor(g,t=!1){super(g),this.valuesAsFlags=t}};function ld(g){if(g instanceof Map)return Object.fromEntries([...g.entries()].map(([t,i])=>[t,ld(i)]));if(g instanceof Set)return Array.from(g.values()).map(ld);if(g instanceof DC)return{values:[...g.values()],valuesAsFlags:g.valuesAsFlags};if(typeof g=="object"){let t={};return Object.entries(g).forEach(([i,x])=>{t[i]=ld(x)}),t}else return g}jx(Zx(),1);var I4=jx(Zx(),1);function lu(g,t){if(typeof g!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(g)}`);if(typeof t!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(t)}`);let i=(0,I4.cloneDeep)(g);for(let[x,T]of Object.entries(t))typeof T!="object"||T instanceof Set||i[x]===void 0?i[x]=T:i[x]=lu(i[x],T);return i}function IC(g,t){if(!(g===void 0||typeof g!="object"))for(let i of Object.keys(g)){if(i===t)return g[i];let x=g[i];if(typeof x=="object"){let T=IC(x,t);if(T!==void 0)return T}}}var p0="@composite:",N4="@inherit:",B4=class{constructor(g,t,i){this.tiledClassToMembersMap=g,this.enumNameToValuesMap=t,this.parserOptions=i,this.memoiser=new Map}flattenMembers(g,t){return this.memoiser.has(g)?{[g]:this.memoiser.get(g)}:(this.memoiser.set(g,t.reduce((i,x)=>An(An({},i),this.flattenMemberProperty(x)),{})),{[g]:this.memoiser.get(g)})}flattenMemberProperty(g){var t;let i=(t=g.propertyType)!=null?t:g.propertytype;if(g.type==="class"){if(!this.memoiser.has(i)){let E=this.tiledClassToMembersMap.get(i).reduce((s,y)=>lu(this.flattenMemberProperty(y),s),{});this.memoiser.set(i,E)}let x=this.memoiser.get(i),T=lu(x,this.flattenValue(g.value,x));return this.checkIfShouldFlatten(g.name)?T:{[g.name.replace(p0,"")]:T}}else return this.enumNameToValuesMap.has(i)?this.enumNameToValuesMap.get(i).valuesAsFlags?{[g.name]:new Set(g.value.split(",").filter(x=>x!==""))}:{[g.name]:g.value}:{[g.name]:g.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(g,t){return Object.entries(g).reduce((i,[x,T])=>{if(typeof T!="object")return IC(t,x)instanceof Set?lu({[x]:new Set(T.split(",").filter(E=>E!==""))},i):lu({[x]:T},i);if(this.checkIfShouldFlatten(x))return lu(this.flattenValue(T,t),i);{let E=x.replace(p0,"");return lu({[E]:this.flattenValue(T,t)},i)}},{})}checkIfShouldFlatten(g){var t;return((t=this.parserOptions)==null?void 0:t.defaultComposite)===!0?g.startsWith(N4):!g.startsWith(p0)}},hT=jx(Zx(),1),U4=class{constructor(g){this.flattener=g}flattenPropertiesOnObject(g){var t,i,x,T;return dh(An(An({},this.flattener.memoisedFlattenedProperties.get((t=g.class)!=null?t:g.type)),(i=g.properties)==null?void 0:i.reduce((E,s)=>An(An({},E),this.flattener.flattenMemberProperty(s)),{})),{name:g.name,id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null,x:g.x,y:g.y})}flattenPropertiesOnTile(g){var t,i,x,T;return dh(An(An({},this.flattener.memoisedFlattenedProperties.get((t=g.class)!=null?t:g.type)),(i=g.properties)==null?void 0:i.reduce((E,s)=>An(An({},E),this.flattener.flattenMemberProperty(s)),{})),{id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([g,t])=>[g,(0,hT.cloneDeep)(t)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([g,t])=>[g,(0,hT.cloneDeep)(t)]))}toJSON(){return JSON.stringify({customTypes:ld(this.getCustomTypesMap()),enums:ld(this.getEnumsMap())},null,4)}};function z4(g,t){let i=new Map(g.propertyTypes.filter(E=>E.type==="enum").map(E=>[E.name,new DC(E.values,E.valuesAsFlags)])),x=new Map(g.propertyTypes.filter(E=>E.type==="class").map(E=>[E.name,E.members])),T=new B4(x,i,t);return x.forEach((E,s)=>{T.flattenMembers(s,E)}),new U4(T)}var G4={parse:z4},NC=class{constructor(g,t){this.phaserTile=g,this.tiledProject=t}getProperty(g){var t,i;let x={};if(this.tiledProject){let T=G4.parse(this.tiledProject),E=this.getType();if(E){let s=(t=T.getCustomTypesMap())==null?void 0:t.get(E);if(s)for(let[y,e]of Object.entries(s))x[y]=e}}return(i=this.phaserTile.properties[g])!=null?i:x[g]}hasProperty(g){return this.getProperty(g)!=null}getType(){var g,t;return(t=(g=this.phaserTile.tileset)==null?void 0:g.tileData[this.phaserTile.index-1])==null?void 0:t.type}},V4=class{constructor(g,t){this.phaserTilemapLayer=g,this.tiledProject=t}getName(){return this.phaserTilemapLayer.layer.name}getProperty(g){let t=this.phaserTilemapLayer.layer.properties,i=t?.find(x=>x.name==g);return i?.value}hasProperty(g){return this.getProperty(g)!=null}isCharLayer(){return this.hasProperty(Qv)}getData(){return this.phaserTilemapLayer.layer.data.map(g=>g.map(t=>new NC(t,this.tiledProject)))}},H4=class{constructor(g,t){this.phaserTilemap=g,this.tiledProject=t;for(let i of this.phaserTilemap.layers)if(i.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${i.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(g=>new V4(g.tilemapLayer,this.tiledProject))}hasTileAt(g,t,i){return!!this.phaserTilemap.hasTileAt(g,t,i)}getTileAt(g,t,i){let x=this.phaserTilemap.getTileAt(g,t,!1,i);if(x)return new NC(x,this.tiledProject)}},BC=class Py{constructor(t){this.scene=t,this.geHeadless=new M4(!1),this.isCreatedInternal=!1,Py.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${PC}`),Py.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,i){return this.geHeadless.getTransition(t,i)}setTransition(t,i,x){this.geHeadless.setTransition(t,i,x)}create(t,i){this.geHeadless.create(new H4(t,i.tiledProject),i),this.isCreatedInternal=!0,this.gridCharacters=new Map;let x=this.setConfigDefaults(i);this.config=x,this.gridTilemap=new Ay(t),this.addCharacters()}getPosition(t){return this.geHeadless.getPosition(t)}move(t,i){this.geHeadless.move(t,i)}moveRandomly(t,i=0,x=-1){this.geHeadless.moveRandomly(t,i,x)}getMovement(t){return this.geHeadless.getMovement(t)}moveTo(t,i,x){return this.geHeadless.moveTo(t,i,x)}stopMovement(t){this.geHeadless.stopMovement(t)}setSpeed(t,i){this.geHeadless.setSpeed(t,i)}getSpeed(t){return this.geHeadless.getSpeed(t)}setContainer(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setContainer(i)}getContainer(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getContainer()}getOffsetX(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getOffsetX()}setOffsetX(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setOffsetX(i)}getOffsetY(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getOffsetY()}setOffsetY(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.setOffsetY(i)}collidesWithTiles(t){return this.geHeadless.collidesWithTiles(t)}getWalkingAnimationMapping(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);let T=x.getAnimation();return T?.getWalkingAnimationMapping()}hasLayerOverlay(){var t;return this.initGuard(),!!((t=this.config)!=null&&t.layerOverlay)}setWalkingAnimationMapping(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);let E=T.getAnimation();E?.setWalkingAnimationMapping(i)}update(t,i){if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(i);this.geHeadless.update(t,i)}addCharacter(t){this.geHeadless.addCharacter(t),this.addCharacterInternal(t)}hasCharacter(t){return this.geHeadless.hasCharacter(t)}removeCharacter(t){var i,x;this.initGuard();let T=(i=this.gridCharacters)==null?void 0:i.get(t);if(!T)throw this.createCharUnknownErr(t);T.destroy(),(x=this.gridCharacters)==null||x.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,i){this.geHeadless.addLabels(t,i)}removeLabels(t,i){this.geHeadless.removeLabels(t,i)}clearLabels(t){this.geHeadless.clearLabels(t)}follow(t,i,x,T){let E;x===void 0?E={distance:0,closestPointIfBlocked:!1}:typeof x=="number"?(E={distance:x,closestPointIfBlocked:!1},T&&(E.closestPointIfBlocked=!0)):E=x,this.geHeadless.follow(t,i,E)}isMoving(t){return this.geHeadless.isMoving(t)}getFacingDirection(t){return this.geHeadless.getFacingDirection(t)}getFacingPosition(t){return this.geHeadless.getFacingPosition(t)}turnTowards(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);T.turnTowards(i),this.geHeadless.turnTowards(t,i)}getCharactersAt(t,i){return this.geHeadless.getCharactersAt(t,i)}setPosition(t,i,x){this.geHeadless.setPosition(t,i,x)}getSprite(t){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(t);if(!x)throw this.createCharUnknownErr(t);return x.getSprite()}setSprite(t,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(t);if(!T)throw this.createCharUnknownErr(t);i.setOrigin(0,0),T.setSprite(i)}isBlocked(t,i,x=["geDefault"]){return this.geHeadless.isBlocked(t,i,x)}isTileBlocked(t,i){return this.geHeadless.isTileBlocked(t,i)}getCollisionGroups(t){return this.geHeadless.getCollisionGroups(t)}setCollisionGroups(t,i){this.geHeadless.setCollisionGroups(t,i)}getIgnoreCollisionGroups(t){return this.geHeadless.getIgnoreCollisionGroups(t)}setIgnoreCollisionGroups(t,i){this.geHeadless.setIgnoreCollisionGroups(t,i)}getTilePosInDirection(t,i,x){return this.geHeadless.getTilePosInDirection(t,i,x)}findShortestPath(t,i,x={}){return this.geHeadless.findShortestPath(t,i,x)}steppedOn(t,i,x){return this.geHeadless.steppedOn(t,i,x)}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,i,x,T){this.geHeadless.rebuildTileCollisionCache(t,i,x,T)}addQueueMovements(t,i,x){this.geHeadless.addQueueMovements(t,i,x)}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=>dh(An({},t),{offsetX:this.getOffsetX(t.id),offsetY:this.getOffsetY(t.id)}))}}setState(t){if(this.geHeadless.setState(t),this.gridCharacters)for(let i of t.characters){let x=this.gridCharacters.get(i.id);x&&(x.setOffsetX(i.offsetX),x.setOffsetY(i.offsetY))}}getTileCost(t,i,x){return this.initGuard(),this.geHeadless.getTileCost(t,i,x)}setConfigDefaults(t){return An({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(i=>this.addCharacterInternal(i))}createCharUnknownErr(t){return new Error(`Character unknown: ${t}`)}addCharacterInternal(t){var i;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let x=new r4(t,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(i=this.gridCharacters)==null||i.set(t.id,x)}};BC.welcomeMessagePrinted=!1;var W4=BC,X4=W4;/*! Bundled license information: + +tiled-property-flattener/dist/tiled_property_flattener.min.js: + (*! Bundled license information: + + lodash/lodash.js: + (** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + *) +*/function uT(g){return g.type==="ROLL_DICE"}class du{constructor(t,i=4){this.bounds=t,this.capacity=i,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:t,yMin:i,xMax:x,yMax:T}=this.bounds,E=(x-t)/2,s=(T-i)/2,y=t,e=i;this.northeast=new du({xMin:y+E,xMax:y+2*E,yMin:i,yMax:e+s},this.capacity),this.northwest=new du({xMin:t,xMax:y+E,yMin:i,yMax:e+s},this.capacity),this.southeast=new du({xMin:y+E,xMax:y+2*E,yMin:e+s,yMax:e+2*s},this.capacity),this.southwest=new du({xMin:t,xMax:y+E,yMin:e+s,yMax:e+2*s},this.capacity),this.divided=!0}insert(t){return this.contains(t.bounds)?this.points.length=i&&t.xMax<=T&&t.yMin>=x&&t.yMax<=E}generateCacheKey(t){const{xMin:i,xMax:x,yMin:T,yMax:E}=t;return`${i},${x},${T},${E}`}queryRange(t,i=[]){if(!this.intersects(t))return i;for(const x of this.points)this.isWithinBounds(x.bounds,t)&&i.push(x);return this.divided&&(this.northwest?.queryRange(t,i),this.northeast?.queryRange(t,i),this.southwest?.queryRange(t,i),this.southeast?.queryRange(t,i)),i}query(t,i=[]){const x=`${t.x},${t.y}`,T=this.cache.get(x);if(T)return T;if(!this.intersects({xMin:t.x,xMax:t.x,yMin:t.y,yMax:t.y}))return i;for(const E of this.points)this.isWithinRange(t,E.bounds)&&i.push(E);return this.divided&&(this.northwest?.query(t,i),this.northeast?.query(t,i),this.southwest?.query(t,i),this.southeast?.query(t,i)),this.cache.set(x,i),i}intersects(t){const{xMin:i,yMin:x,xMax:T,yMax:E}=this.bounds;return!(t.xMin>T||t.xMaxE||t.yMax=i.xMin&&t.xMin<=i.xMax&&t.yMax>=i.yMin&&t.yMin<=i.yMax}isWithinRange(t,i){return t.x>=i.xMin&&t.x<=i.xMax&&t.y>=i.yMin&&t.y<=i.yMax}}class Y4{constructor(){this.events={},this.lastEmitted=new Map}on(t,i){this.events[t]||(this.events[t]=[]),this.events[t]?.push(i)}off(t,i){this.events[t]&&(this.events[t]=this.events[t]?.filter(x=>x!==i))}emit(t,i,x=0){const T=Date.now(),E=this.lastEmitted.get(t)||0;if(T-E>=x){if(!this.events[t])return;this.events[t]?.forEach(s=>s(i)),this.lastEmitted.set(t,T)}}}const Pi=new Y4;function k4(g,t,i){let x=new Set([...t,void 0]);return g.listen((T,E)=>{x.has(E)&&i(T,E)})}function UC(g,t){return function(){return g.apply(t,arguments)}}const{toString:K4}=Object.prototype,{getPrototypeOf:Jx}=Object,Qm=(g=>t=>{const i=K4.call(t);return g[i]||(g[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Vo=g=>(g=g.toLowerCase(),t=>Qm(t)===g),_m=g=>t=>typeof t===g,{isArray:tc}=Array,yd=_m("undefined");function j4(g){return g!==null&&!yd(g)&&g.constructor!==null&&!yd(g.constructor)&&Ca(g.constructor.isBuffer)&&g.constructor.isBuffer(g)}const zC=Vo("ArrayBuffer");function Z4(g){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(g):t=g&&g.buffer&&zC(g.buffer),t}const J4=_m("string"),Ca=_m("function"),GC=_m("number"),qm=g=>g!==null&&typeof g=="object",$4=g=>g===!0||g===!1,_v=g=>{if(Qm(g)!=="object")return!1;const t=Jx(g);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in g)&&!(Symbol.iterator in g)},Q4=Vo("Date"),_4=Vo("File"),q4=Vo("Blob"),tD=Vo("FileList"),eD=g=>qm(g)&&Ca(g.pipe),iD=g=>{let t;return g&&(typeof FormData=="function"&&g instanceof FormData||Ca(g.append)&&((t=Qm(g))==="formdata"||t==="object"&&Ca(g.toString)&&g.toString()==="[object FormData]"))},nD=Vo("URLSearchParams"),rD=g=>g.trim?g.trim():g.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kd(g,t,{allOwnKeys:i=!1}={}){if(g===null||typeof g>"u")return;let x,T;if(typeof g!="object"&&(g=[g]),tc(g))for(x=0,T=g.length;x0;)if(T=i[x],t===T.toLowerCase())return T;return null}const HC=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,WC=g=>!yd(g)&&g!==HC;function Ry(){const{caseless:g}=WC(this)&&this||{},t={},i=(x,T)=>{const E=g&&VC(t,T)||T;_v(t[E])&&_v(x)?t[E]=Ry(t[E],x):_v(x)?t[E]=Ry({},x):tc(x)?t[E]=x.slice():t[E]=x};for(let x=0,T=arguments.length;x(kd(t,(T,E)=>{i&&Ca(T)?g[E]=UC(T,i):g[E]=T},{allOwnKeys:x}),g),aD=g=>(g.charCodeAt(0)===65279&&(g=g.slice(1)),g),oD=(g,t,i,x)=>{g.prototype=Object.create(t.prototype,x),g.prototype.constructor=g,Object.defineProperty(g,"super",{value:t.prototype}),i&&Object.assign(g.prototype,i)},lD=(g,t,i,x)=>{let T,E,s;const y={};if(t=t||{},g==null)return t;do{for(T=Object.getOwnPropertyNames(g),E=T.length;E-- >0;)s=T[E],(!x||x(s,g,t))&&!y[s]&&(t[s]=g[s],y[s]=!0);g=i!==!1&&Jx(g)}while(g&&(!i||i(g,t))&&g!==Object.prototype);return t},hD=(g,t,i)=>{g=String(g),(i===void 0||i>g.length)&&(i=g.length),i-=t.length;const x=g.indexOf(t,i);return x!==-1&&x===i},uD=g=>{if(!g)return null;if(tc(g))return g;let t=g.length;if(!GC(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=g[t];return i},fD=(g=>t=>g&&t instanceof g)(typeof Uint8Array<"u"&&Jx(Uint8Array)),cD=(g,t)=>{const x=(g&&g[Symbol.iterator]).call(g);let T;for(;(T=x.next())&&!T.done;){const E=T.value;t.call(g,E[0],E[1])}},dD=(g,t)=>{let i;const x=[];for(;(i=g.exec(t))!==null;)x.push(i);return x},pD=Vo("HTMLFormElement"),vD=g=>g.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,x,T){return x.toUpperCase()+T}),fT=(({hasOwnProperty:g})=>(t,i)=>g.call(t,i))(Object.prototype),mD=Vo("RegExp"),XC=(g,t)=>{const i=Object.getOwnPropertyDescriptors(g),x={};kd(i,(T,E)=>{let s;(s=t(T,E,g))!==!1&&(x[E]=s||T)}),Object.defineProperties(g,x)},gD=g=>{XC(g,(t,i)=>{if(Ca(g)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const x=g[i];if(Ca(x)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},yD=(g,t)=>{const i={},x=T=>{T.forEach(E=>{i[E]=!0})};return tc(g)?x(g):x(String(g).split(t)),i},xD=()=>{},SD=(g,t)=>(g=+g,Number.isFinite(g)?g:t),v0="abcdefghijklmnopqrstuvwxyz",cT="0123456789",YC={DIGIT:cT,ALPHA:v0,ALPHA_DIGIT:v0+v0.toUpperCase()+cT},TD=(g=16,t=YC.ALPHA_DIGIT)=>{let i="";const{length:x}=t;for(;g--;)i+=t[Math.random()*x|0];return i};function ED(g){return!!(g&&Ca(g.append)&&g[Symbol.toStringTag]==="FormData"&&g[Symbol.iterator])}const MD=g=>{const t=new Array(10),i=(x,T)=>{if(qm(x)){if(t.indexOf(x)>=0)return;if(!("toJSON"in x)){t[T]=x;const E=tc(x)?[]:{};return kd(x,(s,y)=>{const e=i(s,T+1);!yd(e)&&(E[y]=e)}),t[T]=void 0,E}}return x};return i(g,0)},CD=Vo("AsyncFunction"),wD=g=>g&&(qm(g)||Ca(g))&&Ca(g.then)&&Ca(g.catch),de={isArray:tc,isArrayBuffer:zC,isBuffer:j4,isFormData:iD,isArrayBufferView:Z4,isString:J4,isNumber:GC,isBoolean:$4,isObject:qm,isPlainObject:_v,isUndefined:yd,isDate:Q4,isFile:_4,isBlob:q4,isRegExp:mD,isFunction:Ca,isStream:eD,isURLSearchParams:nD,isTypedArray:fD,isFileList:tD,forEach:kd,merge:Ry,extend:sD,trim:rD,stripBOM:aD,inherits:oD,toFlatObject:lD,kindOf:Qm,kindOfTest:Vo,endsWith:hD,toArray:uD,forEachEntry:cD,matchAll:dD,isHTMLForm:pD,hasOwnProperty:fT,hasOwnProp:fT,reduceDescriptors:XC,freezeMethods:gD,toObjectSet:yD,toCamelCase:vD,noop:xD,toFiniteNumber:SD,findKey:VC,global:HC,isContextDefined:WC,ALPHABET:YC,generateString:TD,isSpecCompliantForm:ED,toJSONObject:MD,isAsyncFn:CD,isThenable:wD};function Hi(g,t,i,x,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=g,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),x&&(this.request=x),T&&(this.response=T)}de.inherits(Hi,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:de.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const kC=Hi.prototype,KC={};["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(g=>{KC[g]={value:g}});Object.defineProperties(Hi,KC);Object.defineProperty(kC,"isAxiosError",{value:!0});Hi.from=(g,t,i,x,T,E)=>{const s=Object.create(kC);return de.toFlatObject(g,s,function(e){return e!==Error.prototype},y=>y!=="isAxiosError"),Hi.call(s,g.message,t,i,x,T),s.cause=g,s.name=g.name,E&&Object.assign(s,E),s};const AD=null;function by(g){return de.isPlainObject(g)||de.isArray(g)}function jC(g){return de.endsWith(g,"[]")?g.slice(0,-2):g}function dT(g,t,i){return g?g.concat(t).map(function(T,E){return T=jC(T),!i&&E?"["+T+"]":T}).join(i?".":""):t}function PD(g){return de.isArray(g)&&!g.some(by)}const RD=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function tg(g,t,i){if(!de.isObject(g))throw new TypeError("target must be an object");t=t||new FormData,i=de.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,f){return!de.isUndefined(f[u])});const x=i.metaTokens,T=i.visitor||p,E=i.dots,s=i.indexes,e=(i.Blob||typeof Blob<"u"&&Blob)&&de.isSpecCompliantForm(t);if(!de.isFunction(T))throw new TypeError("visitor must be a function");function r(n){if(n===null)return"";if(de.isDate(n))return n.toISOString();if(!e&&de.isBlob(n))throw new Hi("Blob is not supported. Use a Buffer instead.");return de.isArrayBuffer(n)||de.isTypedArray(n)?e&&typeof Blob=="function"?new Blob([n]):Buffer.from(n):n}function p(n,u,f){let o=n;if(n&&!f&&typeof n=="object"){if(de.endsWith(u,"{}"))u=x?u:u.slice(0,-2),n=JSON.stringify(n);else if(de.isArray(n)&&PD(n)||(de.isFileList(n)||de.endsWith(u,"[]"))&&(o=de.toArray(n)))return u=jC(u),o.forEach(function(d,v){!(de.isUndefined(d)||d===null)&&t.append(s===!0?dT([u],v,E):s===null?u:u+"[]",r(d))}),!1}return by(n)?!0:(t.append(dT(f,u,E),r(n)),!1)}const h=[],a=Object.assign(RD,{defaultVisitor:p,convertValue:r,isVisitable:by});function l(n,u){if(!de.isUndefined(n)){if(h.indexOf(n)!==-1)throw Error("Circular reference detected in "+u.join("."));h.push(n),de.forEach(n,function(o,c){(!(de.isUndefined(o)||o===null)&&T.call(t,o,de.isString(c)?c.trim():c,u,a))===!0&&l(o,u?u.concat(c):[c])}),h.pop()}}if(!de.isObject(g))throw new TypeError("data must be an object");return l(g),t}function pT(g){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(g).replace(/[!'()~]|%20|%00/g,function(x){return t[x]})}function $x(g,t){this._pairs=[],g&&tg(g,this,t)}const ZC=$x.prototype;ZC.append=function(t,i){this._pairs.push([t,i])};ZC.toString=function(t){const i=t?function(x){return t.call(this,x,pT)}:pT;return this._pairs.map(function(T){return i(T[0])+"="+i(T[1])},"").join("&")};function bD(g){return encodeURIComponent(g).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function JC(g,t,i){if(!t)return g;const x=i&&i.encode||bD,T=i&&i.serialize;let E;if(T?E=T(t,i):E=de.isURLSearchParams(t)?t.toString():new $x(t,i).toString(x),E){const s=g.indexOf("#");s!==-1&&(g=g.slice(0,s)),g+=(g.indexOf("?")===-1?"?":"&")+E}return g}class vT{constructor(){this.handlers=[]}use(t,i,x){return this.handlers.push({fulfilled:t,rejected:i,synchronous:x?x.synchronous:!1,runWhen:x?x.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){de.forEach(this.handlers,function(x){x!==null&&t(x)})}}const $C={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},LD=typeof URLSearchParams<"u"?URLSearchParams:$x,FD=typeof FormData<"u"?FormData:null,OD=typeof Blob<"u"?Blob:null,DD={isBrowser:!0,classes:{URLSearchParams:LD,FormData:FD,Blob:OD},protocols:["http","https","file","blob","url","data"]},QC=typeof window<"u"&&typeof document<"u",ID=(g=>QC&&["ReactNative","NativeScript","NS"].indexOf(g)<0)(typeof navigator<"u"&&navigator.product),ND=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",BD=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:QC,hasStandardBrowserEnv:ID,hasStandardBrowserWebWorkerEnv:ND},Symbol.toStringTag,{value:"Module"})),Do={...BD,...DD};function UD(g,t){return tg(g,new Do.classes.URLSearchParams,Object.assign({visitor:function(i,x,T,E){return Do.isNode&&de.isBuffer(i)?(this.append(x,i.toString("base64")),!1):E.defaultVisitor.apply(this,arguments)}},t))}function zD(g){return de.matchAll(/\w+|\[(\w*)]/g,g).map(t=>t[0]==="[]"?"":t[1]||t[0])}function GD(g){const t={},i=Object.keys(g);let x;const T=i.length;let E;for(x=0;x=i.length;return s=!s&&de.isArray(T)?T.length:s,e?(de.hasOwnProp(T,s)?T[s]=[T[s],x]:T[s]=x,!y):((!T[s]||!de.isObject(T[s]))&&(T[s]=[]),t(i,x,T[s],E)&&de.isArray(T[s])&&(T[s]=GD(T[s])),!y)}if(de.isFormData(g)&&de.isFunction(g.entries)){const i={};return de.forEachEntry(g,(x,T)=>{t(zD(x),T,i,0)}),i}return null}function VD(g,t,i){if(de.isString(g))try{return(t||JSON.parse)(g),de.trim(g)}catch(x){if(x.name!=="SyntaxError")throw x}return(i||JSON.stringify)(g)}const Qx={transitional:$C,adapter:["xhr","http"],transformRequest:[function(t,i){const x=i.getContentType()||"",T=x.indexOf("application/json")>-1,E=de.isObject(t);if(E&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return T?JSON.stringify(_C(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let y;if(E){if(x.indexOf("application/x-www-form-urlencoded")>-1)return UD(t,this.formSerializer).toString();if((y=de.isFileList(t))||x.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return tg(y?{"files[]":t}:t,e&&new e,this.formSerializer)}}return E||T?(i.setContentType("application/json",!1),VD(t)):t}],transformResponse:[function(t){const i=this.transitional||Qx.transitional,x=i&&i.forcedJSONParsing,T=this.responseType==="json";if(t&&de.isString(t)&&(x&&!this.responseType||T)){const s=!(i&&i.silentJSONParsing)&&T;try{return JSON.parse(t)}catch(y){if(s)throw y.name==="SyntaxError"?Hi.from(y,Hi.ERR_BAD_RESPONSE,this,null,this.response):y}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Do.classes.FormData,Blob:Do.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(["delete","get","head","post","put","patch"],g=>{Qx.headers[g]={}});const _x=Qx,HD=de.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"]),WD=g=>{const t={};let i,x,T;return g&&g.split(` +`).forEach(function(s){T=s.indexOf(":"),i=s.substring(0,T).trim().toLowerCase(),x=s.substring(T+1).trim(),!(!i||t[i]&&HD[i])&&(i==="set-cookie"?t[i]?t[i].push(x):t[i]=[x]:t[i]=t[i]?t[i]+", "+x:x)}),t},mT=Symbol("internals");function Hc(g){return g&&String(g).trim().toLowerCase()}function qv(g){return g===!1||g==null?g:de.isArray(g)?g.map(qv):String(g)}function XD(g){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let x;for(;x=i.exec(g);)t[x[1]]=x[2];return t}const YD=g=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(g.trim());function m0(g,t,i,x,T){if(de.isFunction(x))return x.call(this,t,i);if(T&&(t=i),!!de.isString(t)){if(de.isString(x))return t.indexOf(x)!==-1;if(de.isRegExp(x))return x.test(t)}}function kD(g){return g.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,x)=>i.toUpperCase()+x)}function KD(g,t){const i=de.toCamelCase(" "+t);["get","set","has"].forEach(x=>{Object.defineProperty(g,x+i,{value:function(T,E,s){return this[x].call(this,t,T,E,s)},configurable:!0})})}class eg{constructor(t){t&&this.set(t)}set(t,i,x){const T=this;function E(y,e,r){const p=Hc(e);if(!p)throw new Error("header name must be a non-empty string");const h=de.findKey(T,p);(!h||T[h]===void 0||r===!0||r===void 0&&T[h]!==!1)&&(T[h||e]=qv(y))}const s=(y,e)=>de.forEach(y,(r,p)=>E(r,p,e));return de.isPlainObject(t)||t instanceof this.constructor?s(t,i):de.isString(t)&&(t=t.trim())&&!YD(t)?s(WD(t),i):t!=null&&E(i,t,x),this}get(t,i){if(t=Hc(t),t){const x=de.findKey(this,t);if(x){const T=this[x];if(!i)return T;if(i===!0)return XD(T);if(de.isFunction(i))return i.call(this,T,x);if(de.isRegExp(i))return i.exec(T);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=Hc(t),t){const x=de.findKey(this,t);return!!(x&&this[x]!==void 0&&(!i||m0(this,this[x],x,i)))}return!1}delete(t,i){const x=this;let T=!1;function E(s){if(s=Hc(s),s){const y=de.findKey(x,s);y&&(!i||m0(x,x[y],y,i))&&(delete x[y],T=!0)}}return de.isArray(t)?t.forEach(E):E(t),T}clear(t){const i=Object.keys(this);let x=i.length,T=!1;for(;x--;){const E=i[x];(!t||m0(this,this[E],E,t,!0))&&(delete this[E],T=!0)}return T}normalize(t){const i=this,x={};return de.forEach(this,(T,E)=>{const s=de.findKey(x,E);if(s){i[s]=qv(T),delete i[E];return}const y=t?kD(E):String(E).trim();y!==E&&delete i[E],i[y]=qv(T),x[y]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return de.forEach(this,(x,T)=>{x!=null&&x!==!1&&(i[T]=t&&de.isArray(x)?x.join(", "):x)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const x=new this(t);return i.forEach(T=>x.set(T)),x}static accessor(t){const x=(this[mT]=this[mT]={accessors:{}}).accessors,T=this.prototype;function E(s){const y=Hc(s);x[y]||(KD(T,s),x[y]=!0)}return de.isArray(t)?t.forEach(E):E(t),this}}eg.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(eg.prototype,({value:g},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>g,set(x){this[i]=x}}});de.freezeMethods(eg);const El=eg;function g0(g,t){const i=this||_x,x=t||i,T=El.from(x.headers);let E=x.data;return de.forEach(g,function(y){E=y.call(i,E,T.normalize(),t?t.status:void 0)}),T.normalize(),E}function qC(g){return!!(g&&g.__CANCEL__)}function Kd(g,t,i){Hi.call(this,g??"canceled",Hi.ERR_CANCELED,t,i),this.name="CanceledError"}de.inherits(Kd,Hi,{__CANCEL__:!0});function jD(g,t,i){const x=i.config.validateStatus;!i.status||!x||x(i.status)?g(i):t(new Hi("Request failed with status code "+i.status,[Hi.ERR_BAD_REQUEST,Hi.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}const ZD=Do.hasStandardBrowserEnv?{write(g,t,i,x,T,E){const s=[g+"="+encodeURIComponent(t)];de.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),de.isString(x)&&s.push("path="+x),de.isString(T)&&s.push("domain="+T),E===!0&&s.push("secure"),document.cookie=s.join("; ")},read(g){const t=document.cookie.match(new RegExp("(^|;\\s*)("+g+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(g){this.write(g,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function JD(g){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(g)}function $D(g,t){return t?g.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):g}function t2(g,t){return g&&!JD(t)?$D(g,t):t}const QD=Do.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let x;function T(E){let s=E;return t&&(i.setAttribute("href",s),s=i.href),i.setAttribute("href",s),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return x=T(window.location.href),function(s){const y=de.isString(s)?T(s):s;return y.protocol===x.protocol&&y.host===x.host}}():function(){return function(){return!0}}();function _D(g){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g);return t&&t[1]||""}function qD(g,t){g=g||10;const i=new Array(g),x=new Array(g);let T=0,E=0,s;return t=t!==void 0?t:1e3,function(e){const r=Date.now(),p=x[E];s||(s=r),i[T]=e,x[T]=r;let h=E,a=0;for(;h!==T;)a+=i[h++],h=h%g;if(T=(T+1)%g,T===E&&(E=(E+1)%g),r-s{const E=T.loaded,s=T.lengthComputable?T.total:void 0,y=E-i,e=x(y),r=E<=s;i=E;const p={loaded:E,total:s,progress:s?E/s:void 0,bytes:y,rate:e||void 0,estimated:e&&s&&r?(s-E)/e:void 0,event:T};p[t?"download":"upload"]=!0,g(p)}}const tI=typeof XMLHttpRequest<"u",eI=tI&&function(g){return new Promise(function(i,x){let T=g.data;const E=El.from(g.headers).normalize();let{responseType:s,withXSRFToken:y}=g,e;function r(){g.cancelToken&&g.cancelToken.unsubscribe(e),g.signal&&g.signal.removeEventListener("abort",e)}let p;if(de.isFormData(T)){if(Do.hasStandardBrowserEnv||Do.hasStandardBrowserWebWorkerEnv)E.setContentType(!1);else if((p=E.getContentType())!==!1){const[u,...f]=p?p.split(";").map(o=>o.trim()).filter(Boolean):[];E.setContentType([u||"multipart/form-data",...f].join("; "))}}let h=new XMLHttpRequest;if(g.auth){const u=g.auth.username||"",f=g.auth.password?unescape(encodeURIComponent(g.auth.password)):"";E.set("Authorization","Basic "+btoa(u+":"+f))}const a=t2(g.baseURL,g.url);h.open(g.method.toUpperCase(),JC(a,g.params,g.paramsSerializer),!0),h.timeout=g.timeout;function l(){if(!h)return;const u=El.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),o={data:!s||s==="text"||s==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:u,config:g,request:h};jD(function(d){i(d),r()},function(d){x(d),r()},o),h=null}if("onloadend"in h?h.onloadend=l:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(l)},h.onabort=function(){h&&(x(new Hi("Request aborted",Hi.ECONNABORTED,g,h)),h=null)},h.onerror=function(){x(new Hi("Network Error",Hi.ERR_NETWORK,g,h)),h=null},h.ontimeout=function(){let f=g.timeout?"timeout of "+g.timeout+"ms exceeded":"timeout exceeded";const o=g.transitional||$C;g.timeoutErrorMessage&&(f=g.timeoutErrorMessage),x(new Hi(f,o.clarifyTimeoutError?Hi.ETIMEDOUT:Hi.ECONNABORTED,g,h)),h=null},Do.hasStandardBrowserEnv&&(y&&de.isFunction(y)&&(y=y(g)),y||y!==!1&&QD(a))){const u=g.xsrfHeaderName&&g.xsrfCookieName&&ZD.read(g.xsrfCookieName);u&&E.set(g.xsrfHeaderName,u)}T===void 0&&E.setContentType(null),"setRequestHeader"in h&&de.forEach(E.toJSON(),function(f,o){h.setRequestHeader(o,f)}),de.isUndefined(g.withCredentials)||(h.withCredentials=!!g.withCredentials),s&&s!=="json"&&(h.responseType=g.responseType),typeof g.onDownloadProgress=="function"&&h.addEventListener("progress",gT(g.onDownloadProgress,!0)),typeof g.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",gT(g.onUploadProgress)),(g.cancelToken||g.signal)&&(e=u=>{h&&(x(!u||u.type?new Kd(null,g,h):u),h.abort(),h=null)},g.cancelToken&&g.cancelToken.subscribe(e),g.signal&&(g.signal.aborted?e():g.signal.addEventListener("abort",e)));const n=_D(a);if(n&&Do.protocols.indexOf(n)===-1){x(new Hi("Unsupported protocol "+n+":",Hi.ERR_BAD_REQUEST,g));return}h.send(T||null)})},Ly={http:AD,xhr:eI};de.forEach(Ly,(g,t)=>{if(g){try{Object.defineProperty(g,"name",{value:t})}catch{}Object.defineProperty(g,"adapterName",{value:t})}});const yT=g=>`- ${g}`,iI=g=>de.isFunction(g)||g===null||g===!1,e2={getAdapter:g=>{g=de.isArray(g)?g:[g];const{length:t}=g;let i,x;const T={};for(let E=0;E`adapter ${y} `+(e===!1?"is not supported by the environment":"is not available in the build"));let s=t?E.length>1?`since : +`+E.map(yT).join(` +`):" "+yT(E[0]):"as no adapter specified";throw new Hi("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return x},adapters:Ly};function y0(g){if(g.cancelToken&&g.cancelToken.throwIfRequested(),g.signal&&g.signal.aborted)throw new Kd(null,g)}function xT(g){return y0(g),g.headers=El.from(g.headers),g.data=g0.call(g,g.transformRequest),["post","put","patch"].indexOf(g.method)!==-1&&g.headers.setContentType("application/x-www-form-urlencoded",!1),e2.getAdapter(g.adapter||_x.adapter)(g).then(function(x){return y0(g),x.data=g0.call(g,g.transformResponse,x),x.headers=El.from(x.headers),x},function(x){return qC(x)||(y0(g),x&&x.response&&(x.response.data=g0.call(g,g.transformResponse,x.response),x.response.headers=El.from(x.response.headers))),Promise.reject(x)})}const ST=g=>g instanceof El?g.toJSON():g;function jf(g,t){t=t||{};const i={};function x(r,p,h){return de.isPlainObject(r)&&de.isPlainObject(p)?de.merge.call({caseless:h},r,p):de.isPlainObject(p)?de.merge({},p):de.isArray(p)?p.slice():p}function T(r,p,h){if(de.isUndefined(p)){if(!de.isUndefined(r))return x(void 0,r,h)}else return x(r,p,h)}function E(r,p){if(!de.isUndefined(p))return x(void 0,p)}function s(r,p){if(de.isUndefined(p)){if(!de.isUndefined(r))return x(void 0,r)}else return x(void 0,p)}function y(r,p,h){if(h in t)return x(r,p);if(h in g)return x(void 0,r)}const e={url:E,method:E,data:E,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:y,headers:(r,p)=>T(ST(r),ST(p),!0)};return de.forEach(Object.keys(Object.assign({},g,t)),function(p){const h=e[p]||T,a=h(g[p],t[p],p);de.isUndefined(a)&&h!==y||(i[p]=a)}),i}const i2="1.6.7",qx={};["object","boolean","number","function","string","symbol"].forEach((g,t)=>{qx[g]=function(x){return typeof x===g||"a"+(t<1?"n ":" ")+g}});const TT={};qx.transitional=function(t,i,x){function T(E,s){return"[Axios v"+i2+"] Transitional option '"+E+"'"+s+(x?". "+x:"")}return(E,s,y)=>{if(t===!1)throw new Hi(T(s," has been removed"+(i?" in "+i:"")),Hi.ERR_DEPRECATED);return i&&!TT[s]&&(TT[s]=!0,console.warn(T(s," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(E,s,y):!0}};function nI(g,t,i){if(typeof g!="object")throw new Hi("options must be an object",Hi.ERR_BAD_OPTION_VALUE);const x=Object.keys(g);let T=x.length;for(;T-- >0;){const E=x[T],s=t[E];if(s){const y=g[E],e=y===void 0||s(y,E,g);if(e!==!0)throw new Hi("option "+E+" must be "+e,Hi.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Hi("Unknown option "+E,Hi.ERR_BAD_OPTION)}}const Fy={assertOptions:nI,validators:qx},Ql=Fy.validators;class vm{constructor(t){this.defaults=t,this.interceptors={request:new vT,response:new vT}}async request(t,i){try{return await this._request(t,i)}catch(x){if(x instanceof Error){let T;Error.captureStackTrace?Error.captureStackTrace(T={}):T=new Error;const E=T.stack?T.stack.replace(/^.+\n/,""):"";x.stack?E&&!String(x.stack).endsWith(E.replace(/^.+\n.+\n/,""))&&(x.stack+=` +`+E):x.stack=E}throw x}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=jf(this.defaults,i);const{transitional:x,paramsSerializer:T,headers:E}=i;x!==void 0&&Fy.assertOptions(x,{silentJSONParsing:Ql.transitional(Ql.boolean),forcedJSONParsing:Ql.transitional(Ql.boolean),clarifyTimeoutError:Ql.transitional(Ql.boolean)},!1),T!=null&&(de.isFunction(T)?i.paramsSerializer={serialize:T}:Fy.assertOptions(T,{encode:Ql.function,serialize:Ql.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let s=E&&de.merge(E.common,E[i.method]);E&&de.forEach(["delete","get","head","post","put","patch","common"],n=>{delete E[n]}),i.headers=El.concat(s,E);const y=[];let e=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(i)===!1||(e=e&&u.synchronous,y.unshift(u.fulfilled,u.rejected))});const r=[];this.interceptors.response.forEach(function(u){r.push(u.fulfilled,u.rejected)});let p,h=0,a;if(!e){const n=[xT.bind(this),void 0];for(n.unshift.apply(n,y),n.push.apply(n,r),a=n.length,p=Promise.resolve(i);h{if(!x._listeners)return;let E=x._listeners.length;for(;E-- >0;)x._listeners[E](T);x._listeners=null}),this.promise.then=T=>{let E;const s=new Promise(y=>{x.subscribe(y),E=y}).then(T);return s.cancel=function(){x.unsubscribe(E)},s},t(function(E,s,y){x.reason||(x.reason=new Kd(E,s,y),i(x.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 i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new t1(function(T){t=T}),cancel:t}}}const rI=t1;function sI(g){return function(i){return g.apply(null,i)}}function aI(g){return de.isObject(g)&&g.isAxiosError===!0}const Oy={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(Oy).forEach(([g,t])=>{Oy[t]=g});const oI=Oy;function n2(g){const t=new tm(g),i=UC(tm.prototype.request,t);return de.extend(i,tm.prototype,t,{allOwnKeys:!0}),de.extend(i,t,null,{allOwnKeys:!0}),i.create=function(T){return n2(jf(g,T))},i}const xn=n2(_x);xn.Axios=tm;xn.CanceledError=Kd;xn.CancelToken=rI;xn.isCancel=qC;xn.VERSION=i2;xn.toFormData=tg;xn.AxiosError=Hi;xn.Cancel=xn.CanceledError;xn.all=function(t){return Promise.all(t)};xn.spread=sI;xn.isAxiosError=aI;xn.mergeConfig=jf;xn.AxiosHeaders=El;xn.formToJSON=g=>_C(de.isHTMLForm(g)?new FormData(g):g);xn.getAdapter=e2.getAdapter;xn.HttpStatusCode=oI;xn.default=xn;const Nf="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function lI(g,t,i){for(;g.length=0;x--){const T=g%Nf.length;i=Nf.charAt(T)+i,g=Math.floor(g/Nf.length)}return lI(i,t,Nf[0])}function e1(){const g=Date.now(),t=fI(g,10),i=uI(16);return t+i}const cI={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},dI={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},r2={},pI={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},vI={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"},mI={stats:vI,inventory:dI,state:pI},gI={tooltipItem:{id:null,position:{x:0,y:0}},submenuItem:{id:null,position:{x:0,y:0}},tooltipNPC:{id:null,position:{x:0,y:0}},isStatsMenuCollapsed:!1},yI={gamemode:"Idle",action:{type:"ROLL_DICE",diceValues:[],isRolling:!1},textures:{side1:"",side2:"",side3:"",side4:"",side5:"",side6:""}},xI=g=>{Dr(async()=>{Zr.set({...Zr.get(),[g.id]:g})})},SI=g=>{Dr(async()=>{const t=Zr.get(),{[g]:i,...x}=t;Zr.set(x)})};function Fu(g,t){return CL(g,t,{encode(i){return JSON.stringify(i)},decode(i){try{return JSON.parse(i)}catch{return t}}})}const Sn=Fu("playerData",mI),TI=Fu("quest",cI),Zr=Fu("items",r2),Zh=Fu("notifications",[]),s2=Fu("itemDB",r2),mm=Fu("settings",gI),xd=Fu("minigameState",yI),Jh=g=>mm.get()[g],Wc=(g,t)=>{Dr(async()=>{const i=mm.get();mm.set({...i,[g]:t})})},EI=()=>{Dr(async()=>{try{const t=(await xn.get("https://kbve.com/api/itemdb.json")).data,i={};Object.keys(t.key).forEach(x=>{const T=t.key[x];i[T.id]=T,i[T.name]=T}),s2.set(i)}catch(g){console.error("Failed to reload item database:",g)}})},MI=g=>s2.get()[g],CI=g=>{Dr(async()=>{const t=Sn.get();t.inventory.backpack.push(g),Sn.set({...t})})},yl=g=>{const i=Zr.get()[g];if(i)return i;console.warn(`Item with ID ${g} not found.`)},wI=g=>{Dr(async()=>{const t=e1(),i={...g,id:t};xI(i),CI(i.id),Pi.emit("notification",{title:"Success",message:`You got a ${i.name}, verified by E Corp ID ${i.id}`,notificationType:Au.success})})},AI=(g,t)=>{Dr(async()=>{const i=Sn.get(),x=Zr.get()[t];if(x){const T=i.inventory.equipment[g];if(T){const E=Zr.get()[T];E.equipped=!1,Zr.set({...Zr.get(),[E.id]:E})}x.equipped=!0,Zr.set({...Zr.get(),[x.id]:x}),i.inventory.equipment[g]=t,Sn.set({...i})}})},PI=g=>{Dr(async()=>{const t=Sn.get(),i=t.inventory.equipment[g];if(i){const x=Zr.get()[i];x&&(x.equipped=!1,Zr.set({...Zr.get(),[x.id]:x}),t.inventory.equipment[g]=null,Sn.set({...t}))}})},ET=g=>{Dr(async()=>{const t=Sn.get(),i=Zr.get()[g];i&&!i.equipped?(t.inventory.backpack=t.inventory.backpack.filter(x=>x!==g),Sn.set({...t}),SI(g)):Pi.emit("notification",{title:"Warning",message:"Cannot remove item that is currently equipped.",notificationType:Au.warning})})},a2=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.health,10),x=Math.max(i-g,0);t.stats={...t.stats,health:x.toString()},Sn.set({...t})})},RI=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.health,10),x=parseInt(t.stats.maxHealth,10),T=Math.min(i+g,x);t.stats={...t.stats,health:T.toString()},Sn.set({...t})})},bI=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.mana,10),x=Math.max(i-g,0);t.stats={...t.stats,mana:x.toString()},Sn.set({...t})})},LI=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.mana,10),x=parseInt(t.stats.maxMana,10),T=Math.min(i+g,x);t.stats={...t.stats,mana:T.toString()},Sn.set({...t})})},FI=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.energy,10),x=Math.max(i-g,0);t.stats={...t.stats,energy:x.toString()},Sn.set({...t})})},OI=g=>{Dr(async()=>{const t=Sn.get(),i=parseInt(t.stats.energy,10),x=parseInt(t.stats.maxEnergy,10),T=Math.min(i+g,x);t.stats={...t.stats,energy:T.toString()},Sn.set({...t})})},DI=g=>{if(g.health!==void 0){const t=parseInt(g.health,10);t>0?RI(t):a2(Math.abs(t))}if(g.mana!==void 0){const t=parseInt(g.mana,10);t>0?LI(t):bI(Math.abs(t))}if(g.energy!==void 0){const t=parseInt(g.energy,10);t>0?OI(t):FI(Math.abs(t))}},II=async g=>{const t=e1();Dr(async()=>{const i=Sn.get();i.state.activeBoosts[t]={...g,expiry:Date.now()+g.duration*1e3},Sn.set({...i})})},NI=g=>{Dr(async()=>{const t=Sn.get(),i=g.bonuses,x={health:i?.health!==void 0?i.health.toString():void 0,mana:i?.mana!==void 0?i.mana.toString():void 0,energy:i?.energy!==void 0?i.energy.toString():void 0};DI(x),g.boost&&II(g.boost),g.action&&console.log(`Action: ${g.action}`),Sn.set({...t})})},BI=g=>{const t=yl(g);if(!t)return[];const i=["view","discard"];return t.consumable&&i.push("consume"),t.equipped?i.push("unequip"):t.consumable||i.push("equip"),i},Au={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"}};function jd(g){try{Dr(async()=>{const t=xd.get();xd.set({...t,...g})})}catch(t){console.error("Error updating minigame state:",t)}}function UI(g){jd({gamemode:g})}function zI(g){jd({action:g})}function GI(g){jd({textures:g})}function o2(g){const t=xd.get();t.gamemode==="Dice"&&t.action.type==="ROLL_DICE"&&jd({action:{...t.action,diceValues:g}})}function MT(g){const t=xd.get();t.gamemode==="Dice"&&t.action.type==="ROLL_DICE"&&jd({action:{...t.action,isRolling:g}})}const VI=({styleClass:g,size:t=32,color:i="#000",onClick:x,...T})=>he.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:t,height:t,className:g,onClick:x,...T,children:he.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11.493 8.757L8.039 5.304 5.374 7.969l3.454 3.453-2.59 2.59 7.797.004-.017-7.784-2.525 2.525zm11.679 2.665l3.454-3.453-2.665-2.665-3.454 3.453-2.525-2.525-.017 7.784 7.797-.004-2.59-2.59zM8.828 20.578l-3.454 3.453 2.665 2.665 3.454-3.453 2.526 2.525.017-7.784-7.797.004 2.589 2.59zm16.934-2.59l-7.797-.004.017 7.784 2.525-2.525 3.454 3.453 2.665-2.665-3.454-3.453 2.59-2.59z"})}),HI=({styleClass:g,size:t=24,color:i="#000",onClick:x,...T})=>he.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:t,height:t,className:g,onClick:x,...T,children:he.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8.5V4m0 0h4.5M4 4l5.5 5.5m10.5-1V4m0 0h-4.5M20 4l-5.5 5.5M4 15.5V20m0 0h4.5M4 20l5.5-5.5m10.5 1V20m0 0h-4.5m4.5 0l-5.5-5.5"})});/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const ig="161",WI={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},XI={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},l2=0,Dy=1,h2=2,YI=3,u2=0,ng=1,hd=2,_a=3,Cl=0,ms=1,Oo=2,Ml=0,yu=1,Iy=2,Ny=3,By=4,f2=5,oh=100,c2=101,d2=102,Uy=103,zy=104,p2=200,v2=201,m2=202,g2=203,gm=204,ym=205,y2=206,x2=207,S2=208,T2=209,E2=210,M2=211,C2=212,w2=213,A2=214,P2=0,R2=1,b2=2,Sd=3,L2=4,F2=5,O2=6,D2=7,Zd=0,I2=1,N2=2,Bo=0,B2=1,U2=2,z2=3,i1=4,G2=5,V2=6,Gy="attached",H2="detached",rg=300,wl=301,vh=302,Td=303,Ed=304,ec=306,Md=1e3,Jr=1001,Cd=1002,nr=1003,xm=1004,kI=1004,fu=1005,KI=1005,Nn=1006,ud=1007,jI=1007,Io=1008,ZI=1008,Uo=1009,W2=1010,X2=1011,sg=1012,n1=1013,xl=1014,Ea=1015,Zf=1016,r1=1017,s1=1018,uh=1020,Y2=1021,ps=1023,k2=1024,K2=1025,fh=1026,Pu=1027,j2=1028,a1=1029,Z2=1030,o1=1031,l1=1033,em=33776,im=33777,nm=33778,rm=33779,Vy=35840,Hy=35841,Wy=35842,Xy=35843,h1=36196,Yy=37492,ky=37496,Ky=37808,jy=37809,Zy=37810,Jy=37811,$y=37812,Qy=37813,_y=37814,qy=37815,tx=37816,ex=37817,ix=37818,nx=37819,rx=37820,sx=37821,sm=36492,ax=36494,ox=36495,J2=36283,lx=36284,hx=36285,ux=36286,$2=2200,Q2=2201,_2=2202,wd=2300,Ad=2301,am=2302,pu=2400,vu=2401,Pd=2402,ag=2500,u1=2501,JI=0,$I=1,QI=2,f1=3e3,ch=3001,q2=3200,tw=3201,yh=0,ew=1,ea="",vr="srgb",Go="srgb-linear",og="display-p3",Jd="display-p3-linear",Rd="linear",vn="srgb",bd="rec709",Ld="p3",_I=0,hu=7680,qI=7681,t5=7682,e5=7683,i5=34055,n5=34056,r5=5386,s5=512,a5=513,o5=514,l5=515,h5=516,u5=517,f5=518,fx=519,iw=512,nw=513,rw=514,c1=515,sw=516,aw=517,ow=518,lw=519,Fd=35044,c5=35048,d5=35040,p5=35045,v5=35049,m5=35041,g5=35046,y5=35050,x5=35042,S5="100",cx="300 es",Sm=1035,No=2e3,Od=2001;class Pl{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});const x=this._listeners;x[t]===void 0&&(x[t]=[]),x[t].indexOf(i)===-1&&x[t].push(i)}hasEventListener(t,i){if(this._listeners===void 0)return!1;const x=this._listeners;return x[t]!==void 0&&x[t].indexOf(i)!==-1}removeEventListener(t,i){if(this._listeners===void 0)return;const T=this._listeners[t];if(T!==void 0){const E=T.indexOf(i);E!==-1&&T.splice(E,1)}}dispatchEvent(t){if(this._listeners===void 0)return;const x=this._listeners[t.type];if(x!==void 0){t.target=this;const T=x.slice(0);for(let E=0,s=T.length;E>8&255]+kr[g>>16&255]+kr[g>>24&255]+"-"+kr[t&255]+kr[t>>8&255]+"-"+kr[t>>16&15|64]+kr[t>>24&255]+"-"+kr[i&63|128]+kr[i>>8&255]+"-"+kr[i>>16&255]+kr[i>>24&255]+kr[x&255]+kr[x>>8&255]+kr[x>>16&255]+kr[x>>24&255]).toLowerCase()}function jn(g,t,i){return Math.max(t,Math.min(i,g))}function d1(g,t){return(g%t+t)%t}function T5(g,t,i,x,T){return x+(g-t)*(T-x)/(i-t)}function E5(g,t,i){return g!==t?(i-g)/(t-g):0}function fd(g,t,i){return(1-i)*g+i*t}function M5(g,t,i,x){return fd(g,t,1-Math.exp(-i*x))}function C5(g,t=1){return t-Math.abs(d1(g,t*2)-t)}function w5(g,t,i){return g<=t?0:g>=i?1:(g=(g-t)/(i-t),g*g*(3-2*g))}function A5(g,t,i){return g<=t?0:g>=i?1:(g=(g-t)/(i-t),g*g*g*(g*(g*6-15)+10))}function P5(g,t){return g+Math.floor(Math.random()*(t-g+1))}function R5(g,t){return g+Math.random()*(t-g)}function b5(g){return g*(.5-Math.random())}function L5(g){g!==void 0&&(CT=g);let t=CT+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function F5(g){return g*xu}function O5(g){return g*Jf}function dx(g){return(g&g-1)===0&&g!==0}function D5(g){return Math.pow(2,Math.ceil(Math.log(g)/Math.LN2))}function Tm(g){return Math.pow(2,Math.floor(Math.log(g)/Math.LN2))}function I5(g,t,i,x,T){const E=Math.cos,s=Math.sin,y=E(i/2),e=s(i/2),r=E((t+x)/2),p=s((t+x)/2),h=E((t-x)/2),a=s((t-x)/2),l=E((x-t)/2),n=s((x-t)/2);switch(T){case"XYX":g.set(y*p,e*h,e*a,y*r);break;case"YZY":g.set(e*a,y*p,e*h,y*r);break;case"ZXZ":g.set(e*h,e*a,y*p,y*r);break;case"XZX":g.set(y*p,e*n,e*l,y*r);break;case"YXY":g.set(e*l,y*p,e*n,y*r);break;case"ZYZ":g.set(e*n,e*l,y*p,y*r);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+T)}}function vs(g,t){switch(t.constructor){case Float32Array:return g;case Uint32Array:return g/4294967295;case Uint16Array:return g/65535;case Uint8Array:return g/255;case Int32Array:return Math.max(g/2147483647,-1);case Int16Array:return Math.max(g/32767,-1);case Int8Array:return Math.max(g/127,-1);default:throw new Error("Invalid component type.")}}function wi(g,t){switch(t.constructor){case Float32Array:return g;case Uint32Array:return Math.round(g*4294967295);case Uint16Array:return Math.round(g*65535);case Uint8Array:return Math.round(g*255);case Int32Array:return Math.round(g*2147483647);case Int16Array:return Math.round(g*32767);case Int8Array:return Math.round(g*127);default:throw new Error("Invalid component type.")}}const om={DEG2RAD:xu,RAD2DEG:Jf,generateUUID:na,clamp:jn,euclideanModulo:d1,mapLinear:T5,inverseLerp:E5,lerp:fd,damp:M5,pingpong:C5,smoothstep:w5,smootherstep:A5,randInt:P5,randFloat:R5,randFloatSpread:b5,seededRandom:L5,degToRad:F5,radToDeg:O5,isPowerOfTwo:dx,ceilPowerOfTwo:D5,floorPowerOfTwo:Tm,setQuaternionFromProperEuler:I5,normalize:wi,denormalize:vs};class ve{constructor(t=0,i=0){ve.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const i=this.x,x=this.y,T=t.elements;return this.x=T[0]*i+T[3]*x+T[6],this.y=T[1]*i+T[4]*x+T[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(t)/i;return Math.acos(jn(x,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,x=this.y-t.y;return i*i+x*x}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){const x=Math.cos(i),T=Math.sin(i),E=this.x-t.x,s=this.y-t.y;return this.x=E*x-s*T+t.x,this.y=E*T+s*x+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Oi{constructor(t,i,x,T,E,s,y,e,r){Oi.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,i,x,T,E,s,y,e,r)}set(t,i,x,T,E,s,y,e,r){const p=this.elements;return p[0]=t,p[1]=T,p[2]=y,p[3]=i,p[4]=E,p[5]=e,p[6]=x,p[7]=s,p[8]=r,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const i=this.elements,x=t.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],this}extractBasis(t,i,x){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),x.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const x=t.elements,T=i.elements,E=this.elements,s=x[0],y=x[3],e=x[6],r=x[1],p=x[4],h=x[7],a=x[2],l=x[5],n=x[8],u=T[0],f=T[3],o=T[6],c=T[1],d=T[4],v=T[7],m=T[2],S=T[5],M=T[8];return E[0]=s*u+y*c+e*m,E[3]=s*f+y*d+e*S,E[6]=s*o+y*v+e*M,E[1]=r*u+p*c+h*m,E[4]=r*f+p*d+h*S,E[7]=r*o+p*v+h*M,E[2]=a*u+l*c+n*m,E[5]=a*f+l*d+n*S,E[8]=a*o+l*v+n*M,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8];return i*s*p-i*y*r-x*E*p+x*y*e+T*E*r-T*s*e}invert(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8],h=p*s-y*r,a=y*e-p*E,l=r*E-s*e,n=i*h+x*a+T*l;if(n===0)return this.set(0,0,0,0,0,0,0,0,0);const u=1/n;return t[0]=h*u,t[1]=(T*r-p*x)*u,t[2]=(y*x-T*s)*u,t[3]=a*u,t[4]=(p*i-T*e)*u,t[5]=(T*E-y*i)*u,t[6]=l*u,t[7]=(x*e-r*i)*u,t[8]=(s*i-x*E)*u,this}transpose(){let t;const i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,x,T,E,s,y){const e=Math.cos(E),r=Math.sin(E);return this.set(x*e,x*r,-x*(e*s+r*y)+s+t,-T*r,T*e,-T*(-r*s+e*y)+y+i,0,0,1),this}scale(t,i){return this.premultiply(x0.makeScale(t,i)),this}rotate(t){return this.premultiply(x0.makeRotation(-t)),this}translate(t,i){return this.premultiply(x0.makeTranslation(t,i)),this}makeTranslation(t,i){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,-x,0,x,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){const i=this.elements,x=t.elements;for(let T=0;T<9;T++)if(i[T]!==x[T])return!1;return!0}fromArray(t,i=0){for(let x=0;x<9;x++)this.elements[x]=t[x+i];return this}toArray(t=[],i=0){const x=this.elements;return t[i]=x[0],t[i+1]=x[1],t[i+2]=x[2],t[i+3]=x[3],t[i+4]=x[4],t[i+5]=x[5],t[i+6]=x[6],t[i+7]=x[7],t[i+8]=x[8],t}clone(){return new this.constructor().fromArray(this.elements)}}const x0=new Oi;function hw(g){for(let t=g.length-1;t>=0;--t)if(g[t]>=65535)return!0;return!1}const N5={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Bf(g,t){return new N5[g](t)}function Dd(g){return document.createElementNS("http://www.w3.org/1999/xhtml",g)}function uw(){const g=Dd("canvas");return g.style.display="block",g}const wT={};function Su(g){g in wT||(wT[g]=!0,console.warn(g))}const AT=new Oi().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),PT=new Oi().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),ev={[Go]:{transfer:Rd,primaries:bd,toReference:g=>g,fromReference:g=>g},[vr]:{transfer:vn,primaries:bd,toReference:g=>g.convertSRGBToLinear(),fromReference:g=>g.convertLinearToSRGB()},[Jd]:{transfer:Rd,primaries:Ld,toReference:g=>g.applyMatrix3(PT),fromReference:g=>g.applyMatrix3(AT)},[og]:{transfer:vn,primaries:Ld,toReference:g=>g.convertSRGBToLinear().applyMatrix3(PT),fromReference:g=>g.applyMatrix3(AT).convertLinearToSRGB()}},B5=new Set([Go,Jd]),rn={enabled:!0,_workingColorSpace:Go,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(g){if(!B5.has(g))throw new Error(`Unsupported working color space, "${g}".`);this._workingColorSpace=g},convert:function(g,t,i){if(this.enabled===!1||t===i||!t||!i)return g;const x=ev[t].toReference,T=ev[i].fromReference;return T(x(g))},fromWorkingColorSpace:function(g,t){return this.convert(g,this._workingColorSpace,t)},toWorkingColorSpace:function(g,t){return this.convert(g,t,this._workingColorSpace)},getPrimaries:function(g){return ev[g].primaries},getTransfer:function(g){return g===ea?Rd:ev[g].transfer}};function Xf(g){return g<.04045?g*.0773993808:Math.pow(g*.9478672986+.0521327014,2.4)}function S0(g){return g<.0031308?g*12.92:1.055*Math.pow(g,.41666)-.055}let lf;class p1{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{lf===void 0&&(lf=Dd("canvas")),lf.width=t.width,lf.height=t.height;const x=lf.getContext("2d");t instanceof ImageData?x.putImageData(t,0,0):x.drawImage(t,0,0,t.width,t.height),i=lf}return i.width>2048||i.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),i.toDataURL("image/jpeg",.6)):i.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){const i=Dd("canvas");i.width=t.width,i.height=t.height;const x=i.getContext("2d");x.drawImage(t,0,0,t.width,t.height);const T=x.getImageData(0,0,t.width,t.height),E=T.data;for(let s=0;s0&&(x.userData=this.userData),i||(t.textures[this.uuid]=x),x}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==rg)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Md:t.x=t.x-Math.floor(t.x);break;case Jr:t.x=t.x<0?0:1;break;case Cd:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case Md:t.y=t.y-Math.floor(t.y);break;case Jr:t.y=t.y<0?0:1;break;case Cd:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Su("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===vr?ch:f1}set encoding(t){Su("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===ch?vr:ea}}Un.DEFAULT_IMAGE=null;Un.DEFAULT_MAPPING=rg;Un.DEFAULT_ANISOTROPY=1;class sn{constructor(t=0,i=0,x=0,T=1){sn.prototype.isVector4=!0,this.x=t,this.y=i,this.z=x,this.w=T}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,x,T){return this.x=t,this.y=i,this.z=x,this.w=T,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const i=this.x,x=this.y,T=this.z,E=this.w,s=t.elements;return this.x=s[0]*i+s[4]*x+s[8]*T+s[12]*E,this.y=s[1]*i+s[5]*x+s[9]*T+s[13]*E,this.z=s[2]*i+s[6]*x+s[10]*T+s[14]*E,this.w=s[3]*i+s[7]*x+s[11]*T+s[15]*E,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,x,T,E;const e=t.elements,r=e[0],p=e[4],h=e[8],a=e[1],l=e[5],n=e[9],u=e[2],f=e[6],o=e[10];if(Math.abs(p-a)<.01&&Math.abs(h-u)<.01&&Math.abs(n-f)<.01){if(Math.abs(p+a)<.1&&Math.abs(h+u)<.1&&Math.abs(n+f)<.1&&Math.abs(r+l+o-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const d=(r+1)/2,v=(l+1)/2,m=(o+1)/2,S=(p+a)/4,M=(h+u)/4,w=(n+f)/4;return d>v&&d>m?d<.01?(x=0,T=.707106781,E=.707106781):(x=Math.sqrt(d),T=S/x,E=M/x):v>m?v<.01?(x=.707106781,T=0,E=.707106781):(T=Math.sqrt(v),x=S/T,E=w/T):m<.01?(x=.707106781,T=.707106781,E=0):(E=Math.sqrt(m),x=M/E,T=w/E),this.set(x,T,E,i),this}let c=Math.sqrt((f-n)*(f-n)+(h-u)*(h-u)+(a-p)*(a-p));return Math.abs(c)<.001&&(c=1),this.x=(f-n)/c,this.y=(h-u)/c,this.z=(a-p)/c,this.w=Math.acos((r+l+o-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this.z=t.z+(i.z-t.z)*x,this.w=t.w+(i.w-t.w)*x,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class fw extends Pl{constructor(t=1,i=1,x={}){super(),this.isRenderTarget=!0,this.width=t,this.height=i,this.depth=1,this.scissor=new sn(0,0,t,i),this.scissorTest=!1,this.viewport=new sn(0,0,t,i);const T={width:t,height:i,depth:1};x.encoding!==void 0&&(Su("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),x.colorSpace=x.encoding===ch?vr:ea),x=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Nn,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},x),this.texture=new Un(T,x.mapping,x.wrapS,x.wrapT,x.magFilter,x.minFilter,x.format,x.type,x.anisotropy,x.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=x.generateMipmaps,this.texture.internalFormat=x.internalFormat,this.depthBuffer=x.depthBuffer,this.stencilBuffer=x.stencilBuffer,this.depthTexture=x.depthTexture,this.samples=x.samples}setSize(t,i,x=1){(this.width!==t||this.height!==i||this.depth!==x)&&(this.width=t,this.height=i,this.depth=x,this.texture.image.width=t,this.texture.image.height=i,this.texture.image.depth=x,this.dispose()),this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const i=Object.assign({},t.texture.image);return this.texture.source=new mu(i),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class io extends fw{constructor(t=1,i=1,x={}){super(t,i,x),this.isWebGLRenderTarget=!0}}class lg extends Un{constructor(t=null,i=1,x=1,T=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:x,depth:T},this.magFilter=nr,this.minFilter=nr,this.wrapR=Jr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class G5 extends io{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGLArrayRenderTarget=!0,this.depth=x,this.texture=new lg(null,t,i,x),this.texture.isRenderTargetTexture=!0}}class v1 extends Un{constructor(t=null,i=1,x=1,T=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:x,depth:T},this.magFilter=nr,this.minFilter=nr,this.wrapR=Jr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class V5 extends io{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGL3DRenderTarget=!0,this.depth=x,this.texture=new v1(null,t,i,x),this.texture.isRenderTargetTexture=!0}}class H5 extends io{constructor(t=1,i=1,x=1,T={}){super(t,i,T),this.isWebGLMultipleRenderTargets=!0;const E=this.texture;this.texture=[];for(let s=0;s=0?1:-1,d=1-o*o;if(d>Number.EPSILON){const m=Math.sqrt(d),S=Math.atan2(m,o*c);f=Math.sin(f*S)/m,y=Math.sin(y*S)/m}const v=y*c;if(e=e*f+a*v,r=r*f+l*v,p=p*f+n*v,h=h*f+u*v,f===1-y){const m=1/Math.sqrt(e*e+r*r+p*p+h*h);e*=m,r*=m,p*=m,h*=m}}t[i]=e,t[i+1]=r,t[i+2]=p,t[i+3]=h}static multiplyQuaternionsFlat(t,i,x,T,E,s){const y=x[T],e=x[T+1],r=x[T+2],p=x[T+3],h=E[s],a=E[s+1],l=E[s+2],n=E[s+3];return t[i]=y*n+p*h+e*l-r*a,t[i+1]=e*n+p*a+r*h-y*l,t[i+2]=r*n+p*l+y*a-e*h,t[i+3]=p*n-y*h-e*a-r*l,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,x,T){return this._x=t,this._y=i,this._z=x,this._w=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i=!0){const x=t._x,T=t._y,E=t._z,s=t._order,y=Math.cos,e=Math.sin,r=y(x/2),p=y(T/2),h=y(E/2),a=e(x/2),l=e(T/2),n=e(E/2);switch(s){case"XYZ":this._x=a*p*h+r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h-a*l*n;break;case"YXZ":this._x=a*p*h+r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h+a*l*n;break;case"ZXY":this._x=a*p*h-r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h-a*l*n;break;case"ZYX":this._x=a*p*h-r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h+a*l*n;break;case"YZX":this._x=a*p*h+r*l*n,this._y=r*l*h+a*p*n,this._z=r*p*n-a*l*h,this._w=r*p*h-a*l*n;break;case"XZY":this._x=a*p*h-r*l*n,this._y=r*l*h-a*p*n,this._z=r*p*n+a*l*h,this._w=r*p*h+a*l*n;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,i){const x=i/2,T=Math.sin(x);return this._x=t.x*T,this._y=t.y*T,this._z=t.z*T,this._w=Math.cos(x),this._onChangeCallback(),this}setFromRotationMatrix(t){const i=t.elements,x=i[0],T=i[4],E=i[8],s=i[1],y=i[5],e=i[9],r=i[2],p=i[6],h=i[10],a=x+y+h;if(a>0){const l=.5/Math.sqrt(a+1);this._w=.25/l,this._x=(p-e)*l,this._y=(E-r)*l,this._z=(s-T)*l}else if(x>y&&x>h){const l=2*Math.sqrt(1+x-y-h);this._w=(p-e)/l,this._x=.25*l,this._y=(T+s)/l,this._z=(E+r)/l}else if(y>h){const l=2*Math.sqrt(1+y-x-h);this._w=(E-r)/l,this._x=(T+s)/l,this._y=.25*l,this._z=(e+p)/l}else{const l=2*Math.sqrt(1+h-x-y);this._w=(s-T)/l,this._x=(E+r)/l,this._y=(e+p)/l,this._z=.25*l}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let x=t.dot(i)+1;return xMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=x):(this._x=0,this._y=-t.z,this._z=t.y,this._w=x)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=x),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(jn(this.dot(t),-1,1)))}rotateTowards(t,i){const x=this.angleTo(t);if(x===0)return this;const T=Math.min(1,i/x);return this.slerp(t,T),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){const x=t._x,T=t._y,E=t._z,s=t._w,y=i._x,e=i._y,r=i._z,p=i._w;return this._x=x*p+s*y+T*r-E*e,this._y=T*p+s*e+E*y-x*r,this._z=E*p+s*r+x*e-T*y,this._w=s*p-x*y-T*e-E*r,this._onChangeCallback(),this}slerp(t,i){if(i===0)return this;if(i===1)return this.copy(t);const x=this._x,T=this._y,E=this._z,s=this._w;let y=s*t._w+x*t._x+T*t._y+E*t._z;if(y<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,y=-y):this.copy(t),y>=1)return this._w=s,this._x=x,this._y=T,this._z=E,this;const e=1-y*y;if(e<=Number.EPSILON){const l=1-i;return this._w=l*s+i*this._w,this._x=l*x+i*this._x,this._y=l*T+i*this._y,this._z=l*E+i*this._z,this.normalize(),this}const r=Math.sqrt(e),p=Math.atan2(r,y),h=Math.sin((1-i)*p)/r,a=Math.sin(i*p)/r;return this._w=s*h+this._w*a,this._x=x*h+this._x*a,this._y=T*h+this._y*a,this._z=E*h+this._z*a,this._onChangeCallback(),this}slerpQuaternions(t,i,x){return this.copy(t).slerp(i,x)}random(){const t=Math.random(),i=Math.sqrt(1-t),x=Math.sqrt(t),T=2*Math.PI*Math.random(),E=2*Math.PI*Math.random();return this.set(i*Math.cos(T),x*Math.sin(E),x*Math.cos(E),i*Math.sin(T))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ct{constructor(t=0,i=0,x=0){Ct.prototype.isVector3=!0,this.x=t,this.y=i,this.z=x}set(t,i,x){return x===void 0&&(x=this.z),this.x=t,this.y=i,this.z=x,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(RT.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(RT.setFromAxisAngle(t,i))}applyMatrix3(t){const i=this.x,x=this.y,T=this.z,E=t.elements;return this.x=E[0]*i+E[3]*x+E[6]*T,this.y=E[1]*i+E[4]*x+E[7]*T,this.z=E[2]*i+E[5]*x+E[8]*T,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const i=this.x,x=this.y,T=this.z,E=t.elements,s=1/(E[3]*i+E[7]*x+E[11]*T+E[15]);return this.x=(E[0]*i+E[4]*x+E[8]*T+E[12])*s,this.y=(E[1]*i+E[5]*x+E[9]*T+E[13])*s,this.z=(E[2]*i+E[6]*x+E[10]*T+E[14])*s,this}applyQuaternion(t){const i=this.x,x=this.y,T=this.z,E=t.x,s=t.y,y=t.z,e=t.w,r=2*(s*T-y*x),p=2*(y*i-E*T),h=2*(E*x-s*i);return this.x=i+e*r+s*h-y*p,this.y=x+e*p+y*r-E*h,this.z=T+e*h+E*p-s*r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const i=this.x,x=this.y,T=this.z,E=t.elements;return this.x=E[0]*i+E[4]*x+E[8]*T,this.y=E[1]*i+E[5]*x+E[9]*T,this.z=E[2]*i+E[6]*x+E[10]*T,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this}clampLength(t,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(t,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,x){return this.x=t.x+(i.x-t.x)*x,this.y=t.y+(i.y-t.y)*x,this.z=t.z+(i.z-t.z)*x,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){const x=t.x,T=t.y,E=t.z,s=i.x,y=i.y,e=i.z;return this.x=T*e-E*y,this.y=E*s-x*e,this.z=x*y-T*s,this}projectOnVector(t){const i=t.lengthSq();if(i===0)return this.set(0,0,0);const x=t.dot(this)/i;return this.copy(t).multiplyScalar(x)}projectOnPlane(t){return E0.copy(this).projectOnVector(t),this.sub(E0)}reflect(t){return this.sub(E0.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(t)/i;return Math.acos(jn(x,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const i=this.x-t.x,x=this.y-t.y,T=this.z-t.z;return i*i+x*x+T*T}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,x){const T=Math.sin(i)*t;return this.x=T*Math.sin(x),this.y=Math.cos(i)*t,this.z=T*Math.cos(x),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,x){return this.x=t*Math.sin(i),this.y=x,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){const i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){const i=this.setFromMatrixColumn(t,0).length(),x=this.setFromMatrixColumn(t,1).length(),T=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=x,this.z=T,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=(Math.random()-.5)*2,i=Math.random()*Math.PI*2,x=Math.sqrt(1-t**2);return this.x=x*Math.cos(i),this.y=x*Math.sin(i),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const E0=new Ct,RT=new Ds;class gs{constructor(t=new Ct(1/0,1/0,1/0),i=new Ct(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){this.makeEmpty();for(let i=0,x=t.length;ithis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,Ja),Ja.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,x;return t.normal.x>0?(i=t.normal.x*this.min.x,x=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,x=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,x+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,x+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,x+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,x+=t.normal.z*this.min.z),i<=-t.constant&&x>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Xc),nv.subVectors(this.max,Xc),hf.subVectors(t.a,Xc),uf.subVectors(t.b,Xc),ff.subVectors(t.c,Xc),_l.subVectors(uf,hf),ql.subVectors(ff,uf),$h.subVectors(hf,ff);let i=[0,-_l.z,_l.y,0,-ql.z,ql.y,0,-$h.z,$h.y,_l.z,0,-_l.x,ql.z,0,-ql.x,$h.z,0,-$h.x,-_l.y,_l.x,0,-ql.y,ql.x,0,-$h.y,$h.x,0];return!M0(i,hf,uf,ff,nv)||(i=[1,0,0,0,1,0,0,0,1],!M0(i,hf,uf,ff,nv))?!1:(rv.crossVectors(_l,ql),i=[rv.x,rv.y,rv.z],M0(i,hf,uf,ff,nv))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ja).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(Ja).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(hl[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),hl[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),hl[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),hl[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),hl[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),hl[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),hl[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),hl[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(hl),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const hl=[new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct],Ja=new Ct,iv=new gs,hf=new Ct,uf=new Ct,ff=new Ct,_l=new Ct,ql=new Ct,$h=new Ct,Xc=new Ct,nv=new Ct,rv=new Ct,Qh=new Ct;function M0(g,t,i,x,T){for(let E=0,s=g.length-3;E<=s;E+=3){Qh.fromArray(g,E);const y=T.x*Math.abs(Qh.x)+T.y*Math.abs(Qh.y)+T.z*Math.abs(Qh.z),e=t.dot(Qh),r=i.dot(Qh),p=x.dot(Qh);if(Math.max(-Math.max(e,r,p),Math.min(e,r,p))>y)return!1}return!0}const W5=new gs,Yc=new Ct,C0=new Ct;class $r{constructor(t=new Ct,i=-1){this.isSphere=!0,this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){const x=this.center;i!==void 0?x.copy(i):W5.setFromPoints(t).getCenter(x);let T=0;for(let E=0,s=t.length;Ethis.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Yc.subVectors(t,this.center);const i=Yc.lengthSq();if(i>this.radius*this.radius){const x=Math.sqrt(i),T=(x-this.radius)*.5;this.center.addScaledVector(Yc,T/x),this.radius+=T}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(C0.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Yc.copy(t.center).add(C0)),this.expandByPoint(Yc.copy(t.center).sub(C0))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ul=new Ct,w0=new Ct,sv=new Ct,th=new Ct,A0=new Ct,av=new Ct,P0=new Ct;class ic{constructor(t=new Ct,i=new Ct(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,ul)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);const x=i.dot(this.direction);return x<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,x)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const i=ul.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(ul.copy(this.origin).addScaledVector(this.direction,i),ul.distanceToSquared(t))}distanceSqToSegment(t,i,x,T){w0.copy(t).add(i).multiplyScalar(.5),sv.copy(i).sub(t).normalize(),th.copy(this.origin).sub(w0);const E=t.distanceTo(i)*.5,s=-this.direction.dot(sv),y=th.dot(this.direction),e=-th.dot(sv),r=th.lengthSq(),p=Math.abs(1-s*s);let h,a,l,n;if(p>0)if(h=s*e-y,a=s*y-e,n=E*p,h>=0)if(a>=-n)if(a<=n){const u=1/p;h*=u,a*=u,l=h*(h+s*a+2*y)+a*(s*h+a+2*e)+r}else a=E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;else a=-E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;else a<=-n?(h=Math.max(0,-(-s*E+y)),a=h>0?-E:Math.min(Math.max(-E,-e),E),l=-h*h+a*(a+2*e)+r):a<=n?(h=0,a=Math.min(Math.max(-E,-e),E),l=a*(a+2*e)+r):(h=Math.max(0,-(s*E+y)),a=h>0?E:Math.min(Math.max(-E,-e),E),l=-h*h+a*(a+2*e)+r);else a=s>0?-E:E,h=Math.max(0,-(s*a+y)),l=-h*h+a*(a+2*e)+r;return x&&x.copy(this.origin).addScaledVector(this.direction,h),T&&T.copy(w0).addScaledVector(sv,a),l}intersectSphere(t,i){ul.subVectors(t.center,this.origin);const x=ul.dot(this.direction),T=ul.dot(ul)-x*x,E=t.radius*t.radius;if(T>E)return null;const s=Math.sqrt(E-T),y=x-s,e=x+s;return e<0?null:y<0?this.at(e,i):this.at(y,i)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;const x=-(this.origin.dot(t.normal)+t.constant)/i;return x>=0?x:null}intersectPlane(t,i){const x=this.distanceToPlane(t);return x===null?null:this.at(x,i)}intersectsPlane(t){const i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let x,T,E,s,y,e;const r=1/this.direction.x,p=1/this.direction.y,h=1/this.direction.z,a=this.origin;return r>=0?(x=(t.min.x-a.x)*r,T=(t.max.x-a.x)*r):(x=(t.max.x-a.x)*r,T=(t.min.x-a.x)*r),p>=0?(E=(t.min.y-a.y)*p,s=(t.max.y-a.y)*p):(E=(t.max.y-a.y)*p,s=(t.min.y-a.y)*p),x>s||E>T||((E>x||isNaN(x))&&(x=E),(s=0?(y=(t.min.z-a.z)*h,e=(t.max.z-a.z)*h):(y=(t.max.z-a.z)*h,e=(t.min.z-a.z)*h),x>e||y>T)||((y>x||x!==x)&&(x=y),(e=0?x:T,i)}intersectsBox(t){return this.intersectBox(t,ul)!==null}intersectTriangle(t,i,x,T,E){A0.subVectors(i,t),av.subVectors(x,t),P0.crossVectors(A0,av);let s=this.direction.dot(P0),y;if(s>0){if(T)return null;y=1}else if(s<0)y=-1,s=-s;else return null;th.subVectors(this.origin,t);const e=y*this.direction.dot(av.crossVectors(th,av));if(e<0)return null;const r=y*this.direction.dot(A0.cross(th));if(r<0||e+r>s)return null;const p=-y*th.dot(P0);return p<0?null:this.at(p/s,E)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class ci{constructor(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f){ci.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f)}set(t,i,x,T,E,s,y,e,r,p,h,a,l,n,u,f){const o=this.elements;return o[0]=t,o[4]=i,o[8]=x,o[12]=T,o[1]=E,o[5]=s,o[9]=y,o[13]=e,o[2]=r,o[6]=p,o[10]=h,o[14]=a,o[3]=l,o[7]=n,o[11]=u,o[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new ci().fromArray(this.elements)}copy(t){const i=this.elements,x=t.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],i[9]=x[9],i[10]=x[10],i[11]=x[11],i[12]=x[12],i[13]=x[13],i[14]=x[14],i[15]=x[15],this}copyPosition(t){const i=this.elements,x=t.elements;return i[12]=x[12],i[13]=x[13],i[14]=x[14],this}setFromMatrix3(t){const i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,x){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),x.setFromMatrixColumn(this,2),this}makeBasis(t,i,x){return this.set(t.x,i.x,x.x,0,t.y,i.y,x.y,0,t.z,i.z,x.z,0,0,0,0,1),this}extractRotation(t){const i=this.elements,x=t.elements,T=1/cf.setFromMatrixColumn(t,0).length(),E=1/cf.setFromMatrixColumn(t,1).length(),s=1/cf.setFromMatrixColumn(t,2).length();return i[0]=x[0]*T,i[1]=x[1]*T,i[2]=x[2]*T,i[3]=0,i[4]=x[4]*E,i[5]=x[5]*E,i[6]=x[6]*E,i[7]=0,i[8]=x[8]*s,i[9]=x[9]*s,i[10]=x[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){const i=this.elements,x=t.x,T=t.y,E=t.z,s=Math.cos(x),y=Math.sin(x),e=Math.cos(T),r=Math.sin(T),p=Math.cos(E),h=Math.sin(E);if(t.order==="XYZ"){const a=s*p,l=s*h,n=y*p,u=y*h;i[0]=e*p,i[4]=-e*h,i[8]=r,i[1]=l+n*r,i[5]=a-u*r,i[9]=-y*e,i[2]=u-a*r,i[6]=n+l*r,i[10]=s*e}else if(t.order==="YXZ"){const a=e*p,l=e*h,n=r*p,u=r*h;i[0]=a+u*y,i[4]=n*y-l,i[8]=s*r,i[1]=s*h,i[5]=s*p,i[9]=-y,i[2]=l*y-n,i[6]=u+a*y,i[10]=s*e}else if(t.order==="ZXY"){const a=e*p,l=e*h,n=r*p,u=r*h;i[0]=a-u*y,i[4]=-s*h,i[8]=n+l*y,i[1]=l+n*y,i[5]=s*p,i[9]=u-a*y,i[2]=-s*r,i[6]=y,i[10]=s*e}else if(t.order==="ZYX"){const a=s*p,l=s*h,n=y*p,u=y*h;i[0]=e*p,i[4]=n*r-l,i[8]=a*r+u,i[1]=e*h,i[5]=u*r+a,i[9]=l*r-n,i[2]=-r,i[6]=y*e,i[10]=s*e}else if(t.order==="YZX"){const a=s*e,l=s*r,n=y*e,u=y*r;i[0]=e*p,i[4]=u-a*h,i[8]=n*h+l,i[1]=h,i[5]=s*p,i[9]=-y*p,i[2]=-r*p,i[6]=l*h+n,i[10]=a-u*h}else if(t.order==="XZY"){const a=s*e,l=s*r,n=y*e,u=y*r;i[0]=e*p,i[4]=-h,i[8]=r*p,i[1]=a*h+u,i[5]=s*p,i[9]=l*h-n,i[2]=n*h-l,i[6]=y*p,i[10]=u*h+a}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(X5,t,Y5)}lookAt(t,i,x){const T=this.elements;return qs.subVectors(t,i),qs.lengthSq()===0&&(qs.z=1),qs.normalize(),eh.crossVectors(x,qs),eh.lengthSq()===0&&(Math.abs(x.z)===1?qs.x+=1e-4:qs.z+=1e-4,qs.normalize(),eh.crossVectors(x,qs)),eh.normalize(),ov.crossVectors(qs,eh),T[0]=eh.x,T[4]=ov.x,T[8]=qs.x,T[1]=eh.y,T[5]=ov.y,T[9]=qs.y,T[2]=eh.z,T[6]=ov.z,T[10]=qs.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){const x=t.elements,T=i.elements,E=this.elements,s=x[0],y=x[4],e=x[8],r=x[12],p=x[1],h=x[5],a=x[9],l=x[13],n=x[2],u=x[6],f=x[10],o=x[14],c=x[3],d=x[7],v=x[11],m=x[15],S=T[0],M=T[4],w=T[8],C=T[12],A=T[1],P=T[5],b=T[9],O=T[13],I=T[2],D=T[6],B=T[10],G=T[14],z=T[3],X=T[7],K=T[11],Q=T[15];return E[0]=s*S+y*A+e*I+r*z,E[4]=s*M+y*P+e*D+r*X,E[8]=s*w+y*b+e*B+r*K,E[12]=s*C+y*O+e*G+r*Q,E[1]=p*S+h*A+a*I+l*z,E[5]=p*M+h*P+a*D+l*X,E[9]=p*w+h*b+a*B+l*K,E[13]=p*C+h*O+a*G+l*Q,E[2]=n*S+u*A+f*I+o*z,E[6]=n*M+u*P+f*D+o*X,E[10]=n*w+u*b+f*B+o*K,E[14]=n*C+u*O+f*G+o*Q,E[3]=c*S+d*A+v*I+m*z,E[7]=c*M+d*P+v*D+m*X,E[11]=c*w+d*b+v*B+m*K,E[15]=c*C+d*O+v*G+m*Q,this}multiplyScalar(t){const i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){const t=this.elements,i=t[0],x=t[4],T=t[8],E=t[12],s=t[1],y=t[5],e=t[9],r=t[13],p=t[2],h=t[6],a=t[10],l=t[14],n=t[3],u=t[7],f=t[11],o=t[15];return n*(+E*e*h-T*r*h-E*y*a+x*r*a+T*y*l-x*e*l)+u*(+i*e*l-i*r*a+E*s*a-T*s*l+T*r*p-E*e*p)+f*(+i*r*h-i*y*l-E*s*h+x*s*l+E*y*p-x*r*p)+o*(-T*y*p-i*e*h+i*y*a+T*s*h-x*s*a+x*e*p)}transpose(){const t=this.elements;let i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,x){const T=this.elements;return t.isVector3?(T[12]=t.x,T[13]=t.y,T[14]=t.z):(T[12]=t,T[13]=i,T[14]=x),this}invert(){const t=this.elements,i=t[0],x=t[1],T=t[2],E=t[3],s=t[4],y=t[5],e=t[6],r=t[7],p=t[8],h=t[9],a=t[10],l=t[11],n=t[12],u=t[13],f=t[14],o=t[15],c=h*f*r-u*a*r+u*e*l-y*f*l-h*e*o+y*a*o,d=n*a*r-p*f*r-n*e*l+s*f*l+p*e*o-s*a*o,v=p*u*r-n*h*r+n*y*l-s*u*l-p*y*o+s*h*o,m=n*h*e-p*u*e-n*y*a+s*u*a+p*y*f-s*h*f,S=i*c+x*d+T*v+E*m;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/S;return t[0]=c*M,t[1]=(u*a*E-h*f*E-u*T*l+x*f*l+h*T*o-x*a*o)*M,t[2]=(y*f*E-u*e*E+u*T*r-x*f*r-y*T*o+x*e*o)*M,t[3]=(h*e*E-y*a*E-h*T*r+x*a*r+y*T*l-x*e*l)*M,t[4]=d*M,t[5]=(p*f*E-n*a*E+n*T*l-i*f*l-p*T*o+i*a*o)*M,t[6]=(n*e*E-s*f*E-n*T*r+i*f*r+s*T*o-i*e*o)*M,t[7]=(s*a*E-p*e*E+p*T*r-i*a*r-s*T*l+i*e*l)*M,t[8]=v*M,t[9]=(n*h*E-p*u*E-n*x*l+i*u*l+p*x*o-i*h*o)*M,t[10]=(s*u*E-n*y*E+n*x*r-i*u*r-s*x*o+i*y*o)*M,t[11]=(p*y*E-s*h*E-p*x*r+i*h*r+s*x*l-i*y*l)*M,t[12]=m*M,t[13]=(p*u*T-n*h*T+n*x*a-i*u*a-p*x*f+i*h*f)*M,t[14]=(n*y*T-s*u*T-n*x*e+i*u*e+s*x*f-i*y*f)*M,t[15]=(s*h*T-p*y*T+p*x*e-i*h*e-s*x*a+i*y*a)*M,this}scale(t){const i=this.elements,x=t.x,T=t.y,E=t.z;return i[0]*=x,i[4]*=T,i[8]*=E,i[1]*=x,i[5]*=T,i[9]*=E,i[2]*=x,i[6]*=T,i[10]*=E,i[3]*=x,i[7]*=T,i[11]*=E,this}getMaxScaleOnAxis(){const t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],x=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],T=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,x,T))}makeTranslation(t,i,x){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,i,0,0,1,x,0,0,0,1),this}makeRotationX(t){const i=Math.cos(t),x=Math.sin(t);return this.set(1,0,0,0,0,i,-x,0,0,x,i,0,0,0,0,1),this}makeRotationY(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,0,x,0,0,1,0,0,-x,0,i,0,0,0,0,1),this}makeRotationZ(t){const i=Math.cos(t),x=Math.sin(t);return this.set(i,-x,0,0,x,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){const x=Math.cos(i),T=Math.sin(i),E=1-x,s=t.x,y=t.y,e=t.z,r=E*s,p=E*y;return this.set(r*s+x,r*y-T*e,r*e+T*y,0,r*y+T*e,p*y+x,p*e-T*s,0,r*e-T*y,p*e+T*s,E*e*e+x,0,0,0,0,1),this}makeScale(t,i,x){return this.set(t,0,0,0,0,i,0,0,0,0,x,0,0,0,0,1),this}makeShear(t,i,x,T,E,s){return this.set(1,x,E,0,t,1,s,0,i,T,1,0,0,0,0,1),this}compose(t,i,x){const T=this.elements,E=i._x,s=i._y,y=i._z,e=i._w,r=E+E,p=s+s,h=y+y,a=E*r,l=E*p,n=E*h,u=s*p,f=s*h,o=y*h,c=e*r,d=e*p,v=e*h,m=x.x,S=x.y,M=x.z;return T[0]=(1-(u+o))*m,T[1]=(l+v)*m,T[2]=(n-d)*m,T[3]=0,T[4]=(l-v)*S,T[5]=(1-(a+o))*S,T[6]=(f+c)*S,T[7]=0,T[8]=(n+d)*M,T[9]=(f-c)*M,T[10]=(1-(a+u))*M,T[11]=0,T[12]=t.x,T[13]=t.y,T[14]=t.z,T[15]=1,this}decompose(t,i,x){const T=this.elements;let E=cf.set(T[0],T[1],T[2]).length();const s=cf.set(T[4],T[5],T[6]).length(),y=cf.set(T[8],T[9],T[10]).length();this.determinant()<0&&(E=-E),t.x=T[12],t.y=T[13],t.z=T[14],$a.copy(this);const r=1/E,p=1/s,h=1/y;return $a.elements[0]*=r,$a.elements[1]*=r,$a.elements[2]*=r,$a.elements[4]*=p,$a.elements[5]*=p,$a.elements[6]*=p,$a.elements[8]*=h,$a.elements[9]*=h,$a.elements[10]*=h,i.setFromRotationMatrix($a),x.x=E,x.y=s,x.z=y,this}makePerspective(t,i,x,T,E,s,y=No){const e=this.elements,r=2*E/(i-t),p=2*E/(x-T),h=(i+t)/(i-t),a=(x+T)/(x-T);let l,n;if(y===No)l=-(s+E)/(s-E),n=-2*s*E/(s-E);else if(y===Od)l=-s/(s-E),n=-s*E/(s-E);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+y);return e[0]=r,e[4]=0,e[8]=h,e[12]=0,e[1]=0,e[5]=p,e[9]=a,e[13]=0,e[2]=0,e[6]=0,e[10]=l,e[14]=n,e[3]=0,e[7]=0,e[11]=-1,e[15]=0,this}makeOrthographic(t,i,x,T,E,s,y=No){const e=this.elements,r=1/(i-t),p=1/(x-T),h=1/(s-E),a=(i+t)*r,l=(x+T)*p;let n,u;if(y===No)n=(s+E)*h,u=-2*h;else if(y===Od)n=E*h,u=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+y);return e[0]=2*r,e[4]=0,e[8]=0,e[12]=-a,e[1]=0,e[5]=2*p,e[9]=0,e[13]=-l,e[2]=0,e[6]=0,e[10]=u,e[14]=-n,e[3]=0,e[7]=0,e[11]=0,e[15]=1,this}equals(t){const i=this.elements,x=t.elements;for(let T=0;T<16;T++)if(i[T]!==x[T])return!1;return!0}fromArray(t,i=0){for(let x=0;x<16;x++)this.elements[x]=t[x+i];return this}toArray(t=[],i=0){const x=this.elements;return t[i]=x[0],t[i+1]=x[1],t[i+2]=x[2],t[i+3]=x[3],t[i+4]=x[4],t[i+5]=x[5],t[i+6]=x[6],t[i+7]=x[7],t[i+8]=x[8],t[i+9]=x[9],t[i+10]=x[10],t[i+11]=x[11],t[i+12]=x[12],t[i+13]=x[13],t[i+14]=x[14],t[i+15]=x[15],t}}const cf=new Ct,$a=new ci,X5=new Ct(0,0,0),Y5=new Ct(1,1,1),eh=new Ct,ov=new Ct,qs=new Ct,bT=new ci,LT=new Ds;class qa{constructor(t=0,i=0,x=0,T=qa.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=x,this._order=T}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,x,T=this._order){return this._x=t,this._y=i,this._z=x,this._order=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,x=!0){const T=t.elements,E=T[0],s=T[4],y=T[8],e=T[1],r=T[5],p=T[9],h=T[2],a=T[6],l=T[10];switch(i){case"XYZ":this._y=Math.asin(jn(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(-p,l),this._z=Math.atan2(-s,E)):(this._x=Math.atan2(a,r),this._z=0);break;case"YXZ":this._x=Math.asin(-jn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(y,l),this._z=Math.atan2(e,r)):(this._y=Math.atan2(-h,E),this._z=0);break;case"ZXY":this._x=Math.asin(jn(a,-1,1)),Math.abs(a)<.9999999?(this._y=Math.atan2(-h,l),this._z=Math.atan2(-s,r)):(this._y=0,this._z=Math.atan2(e,E));break;case"ZYX":this._y=Math.asin(-jn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(a,l),this._z=Math.atan2(e,E)):(this._x=0,this._z=Math.atan2(-s,r));break;case"YZX":this._z=Math.asin(jn(e,-1,1)),Math.abs(e)<.9999999?(this._x=Math.atan2(-p,r),this._y=Math.atan2(-h,E)):(this._x=0,this._y=Math.atan2(y,l));break;case"XZY":this._z=Math.asin(-jn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(a,r),this._y=Math.atan2(y,E)):(this._x=Math.atan2(-p,l),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,x===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,x){return bT.makeRotationFromQuaternion(t),this.setFromRotationMatrix(bT,i,x)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return LT.setFromEuler(this),this.setFromQuaternion(LT,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}qa.DEFAULT_ORDER="XYZ";class Tu{constructor(){this.mask=1}set(t){this.mask=(1<>>0}enable(t){this.mask|=1<1){for(let i=0;i1){for(let x=0;x0&&(T.userData=this.userData),T.layers=this.layers.mask,T.matrix=this.matrix.toArray(),T.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(T.matrixAutoUpdate=!1),this.isInstancedMesh&&(T.type="InstancedMesh",T.count=this.count,T.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(T.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(T.type="BatchedMesh",T.perObjectFrustumCulled=this.perObjectFrustumCulled,T.sortObjects=this.sortObjects,T.drawRanges=this._drawRanges,T.reservedRanges=this._reservedRanges,T.visibility=this._visibility,T.active=this._active,T.bounds=this._bounds.map(y=>({boxInitialized:y.boxInitialized,boxMin:y.box.min.toArray(),boxMax:y.box.max.toArray(),sphereInitialized:y.sphereInitialized,sphereRadius:y.sphere.radius,sphereCenter:y.sphere.center.toArray()})),T.maxGeometryCount=this._maxGeometryCount,T.maxVertexCount=this._maxVertexCount,T.maxIndexCount=this._maxIndexCount,T.geometryInitialized=this._geometryInitialized,T.geometryCount=this._geometryCount,T.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(T.boundingSphere={center:T.boundingSphere.center.toArray(),radius:T.boundingSphere.radius}),this.boundingBox!==null&&(T.boundingBox={min:T.boundingBox.min.toArray(),max:T.boundingBox.max.toArray()}));function E(y,e){return y[e.uuid]===void 0&&(y[e.uuid]=e.toJSON(t)),e.uuid}if(this.isScene)this.background&&(this.background.isColor?T.background=this.background.toJSON():this.background.isTexture&&(T.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(T.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){T.geometry=E(t.geometries,this.geometry);const y=this.geometry.parameters;if(y!==void 0&&y.shapes!==void 0){const e=y.shapes;if(Array.isArray(e))for(let r=0,p=e.length;r0){T.children=[];for(let y=0;y0){T.animations=[];for(let y=0;y0&&(x.geometries=y),e.length>0&&(x.materials=e),r.length>0&&(x.textures=r),p.length>0&&(x.images=p),h.length>0&&(x.shapes=h),a.length>0&&(x.skeletons=a),l.length>0&&(x.animations=l),n.length>0&&(x.nodes=n)}return x.object=T,x;function s(y){const e=[];for(const r in y){const p=y[r];delete p.metadata,e.push(p)}return e}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let x=0;x0?T.multiplyScalar(1/Math.sqrt(E)):T.set(0,0,0)}static getBarycoord(t,i,x,T,E){Qa.subVectors(T,i),cl.subVectors(x,i),R0.subVectors(t,i);const s=Qa.dot(Qa),y=Qa.dot(cl),e=Qa.dot(R0),r=cl.dot(cl),p=cl.dot(R0),h=s*r-y*y;if(h===0)return E.set(0,0,0),null;const a=1/h,l=(r*e-y*p)*a,n=(s*p-y*e)*a;return E.set(1-l-n,n,l)}static containsPoint(t,i,x,T){return this.getBarycoord(t,i,x,T,dl)===null?!1:dl.x>=0&&dl.y>=0&&dl.x+dl.y<=1}static getInterpolation(t,i,x,T,E,s,y,e){return this.getBarycoord(t,i,x,T,dl)===null?(e.x=0,e.y=0,"z"in e&&(e.z=0),"w"in e&&(e.w=0),null):(e.setScalar(0),e.addScaledVector(E,dl.x),e.addScaledVector(s,dl.y),e.addScaledVector(y,dl.z),e)}static isFrontFacing(t,i,x,T){return Qa.subVectors(x,i),cl.subVectors(t,i),Qa.cross(cl).dot(T)<0}set(t,i,x){return this.a.copy(t),this.b.copy(i),this.c.copy(x),this}setFromPointsAndIndices(t,i,x,T){return this.a.copy(t[i]),this.b.copy(t[x]),this.c.copy(t[T]),this}setFromAttributeAndIndices(t,i,x,T){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,x),this.c.fromBufferAttribute(t,T),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Qa.subVectors(this.c,this.b),cl.subVectors(this.a,this.b),Qa.cross(cl).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ia.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return ia.getBarycoord(t,this.a,this.b,this.c,i)}getInterpolation(t,i,x,T,E){return ia.getInterpolation(t,this.a,this.b,this.c,i,x,T,E)}containsPoint(t){return ia.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ia.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){const x=this.a,T=this.b,E=this.c;let s,y;pf.subVectors(T,x),vf.subVectors(E,x),b0.subVectors(t,x);const e=pf.dot(b0),r=vf.dot(b0);if(e<=0&&r<=0)return i.copy(x);L0.subVectors(t,T);const p=pf.dot(L0),h=vf.dot(L0);if(p>=0&&h<=p)return i.copy(T);const a=e*h-p*r;if(a<=0&&e>=0&&p<=0)return s=e/(e-p),i.copy(x).addScaledVector(pf,s);F0.subVectors(t,E);const l=pf.dot(F0),n=vf.dot(F0);if(n>=0&&l<=n)return i.copy(E);const u=l*r-e*n;if(u<=0&&r>=0&&n<=0)return y=r/(r-n),i.copy(x).addScaledVector(vf,y);const f=p*n-l*h;if(f<=0&&h-p>=0&&l-n>=0)return NT.subVectors(E,T),y=(h-p)/(h-p+(l-n)),i.copy(T).addScaledVector(NT,y);const o=1/(f+u+a);return s=u*o,y=a*o,i.copy(x).addScaledVector(pf,s).addScaledVector(vf,y)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const cw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ih={h:0,s:0,l:0},hv={h:0,s:0,l:0};function O0(g,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?g+(t-g)*6*i:i<1/2?t:i<2/3?g+(t-g)*6*(2/3-i):g}class ze{constructor(t,i,x){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,i,x)}set(t,i,x){if(i===void 0&&x===void 0){const T=t;T&&T.isColor?this.copy(T):typeof T=="number"?this.setHex(T):typeof T=="string"&&this.setStyle(T)}else this.setRGB(t,i,x);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=vr){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,rn.toWorkingColorSpace(this,i),this}setRGB(t,i,x,T=rn.workingColorSpace){return this.r=t,this.g=i,this.b=x,rn.toWorkingColorSpace(this,T),this}setHSL(t,i,x,T=rn.workingColorSpace){if(t=d1(t,1),i=jn(i,0,1),x=jn(x,0,1),i===0)this.r=this.g=this.b=x;else{const E=x<=.5?x*(1+i):x+i-x*i,s=2*x-E;this.r=O0(s,E,t+1/3),this.g=O0(s,E,t),this.b=O0(s,E,t-1/3)}return rn.toWorkingColorSpace(this,T),this}setStyle(t,i=vr){function x(E){E!==void 0&&parseFloat(E)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let T;if(T=/^(\w+)\(([^\)]*)\)/.exec(t)){let E;const s=T[1],y=T[2];switch(s){case"rgb":case"rgba":if(E=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(255,parseInt(E[1],10))/255,Math.min(255,parseInt(E[2],10))/255,Math.min(255,parseInt(E[3],10))/255,i);if(E=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(100,parseInt(E[1],10))/100,Math.min(100,parseInt(E[2],10))/100,Math.min(100,parseInt(E[3],10))/100,i);break;case"hsl":case"hsla":if(E=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setHSL(parseFloat(E[1])/360,parseFloat(E[2])/100,parseFloat(E[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(T=/^\#([A-Fa-f\d]+)$/.exec(t)){const E=T[1],s=E.length;if(s===3)return this.setRGB(parseInt(E.charAt(0),16)/15,parseInt(E.charAt(1),16)/15,parseInt(E.charAt(2),16)/15,i);if(s===6)return this.setHex(parseInt(E,16),i);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,i);return this}setColorName(t,i=vr){const x=cw[t.toLowerCase()];return x!==void 0?this.setHex(x,i):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Xf(t.r),this.g=Xf(t.g),this.b=Xf(t.b),this}copyLinearToSRGB(t){return this.r=S0(t.r),this.g=S0(t.g),this.b=S0(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=vr){return rn.fromWorkingColorSpace(Kr.copy(this),t),Math.round(jn(Kr.r*255,0,255))*65536+Math.round(jn(Kr.g*255,0,255))*256+Math.round(jn(Kr.b*255,0,255))}getHexString(t=vr){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=rn.workingColorSpace){rn.fromWorkingColorSpace(Kr.copy(this),i);const x=Kr.r,T=Kr.g,E=Kr.b,s=Math.max(x,T,E),y=Math.min(x,T,E);let e,r;const p=(y+s)/2;if(y===s)e=0,r=0;else{const h=s-y;switch(r=p<=.5?h/(s+y):h/(2-s-y),s){case x:e=(T-E)/h+(T0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(const i in t){const x=t[i];if(x===void 0){console.warn(`THREE.Material: parameter '${i}' has value of undefined.`);continue}const T=this[i];if(T===void 0){console.warn(`THREE.Material: '${i}' is not a property of THREE.${this.type}.`);continue}T&&T.isColor?T.set(x):T&&T.isVector3&&x&&x.isVector3?T.copy(x):this[i]=x}}toJSON(t){const i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});const x={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};x.uuid=this.uuid,x.type=this.type,this.name!==""&&(x.name=this.name),this.color&&this.color.isColor&&(x.color=this.color.getHex()),this.roughness!==void 0&&(x.roughness=this.roughness),this.metalness!==void 0&&(x.metalness=this.metalness),this.sheen!==void 0&&(x.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(x.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(x.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(x.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(x.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(x.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(x.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(x.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(x.shininess=this.shininess),this.clearcoat!==void 0&&(x.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(x.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(x.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(x.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(x.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,x.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(x.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(x.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(x.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(x.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(x.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(x.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(x.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(x.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(x.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(x.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(x.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(x.lightMap=this.lightMap.toJSON(t).uuid,x.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(x.aoMap=this.aoMap.toJSON(t).uuid,x.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(x.bumpMap=this.bumpMap.toJSON(t).uuid,x.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(x.normalMap=this.normalMap.toJSON(t).uuid,x.normalMapType=this.normalMapType,x.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(x.displacementMap=this.displacementMap.toJSON(t).uuid,x.displacementScale=this.displacementScale,x.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(x.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(x.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(x.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(x.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(x.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(x.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(x.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(x.combine=this.combine)),this.envMapIntensity!==void 0&&(x.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(x.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(x.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(x.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(x.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(x.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(x.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(x.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(x.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(x.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(x.size=this.size),this.shadowSide!==null&&(x.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(x.sizeAttenuation=this.sizeAttenuation),this.blending!==yu&&(x.blending=this.blending),this.side!==Cl&&(x.side=this.side),this.vertexColors===!0&&(x.vertexColors=!0),this.opacity<1&&(x.opacity=this.opacity),this.transparent===!0&&(x.transparent=!0),this.blendSrc!==gm&&(x.blendSrc=this.blendSrc),this.blendDst!==ym&&(x.blendDst=this.blendDst),this.blendEquation!==oh&&(x.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(x.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(x.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(x.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(x.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(x.blendAlpha=this.blendAlpha),this.depthFunc!==Sd&&(x.depthFunc=this.depthFunc),this.depthTest===!1&&(x.depthTest=this.depthTest),this.depthWrite===!1&&(x.depthWrite=this.depthWrite),this.colorWrite===!1&&(x.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(x.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==fx&&(x.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(x.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(x.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==hu&&(x.stencilFail=this.stencilFail),this.stencilZFail!==hu&&(x.stencilZFail=this.stencilZFail),this.stencilZPass!==hu&&(x.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(x.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(x.rotation=this.rotation),this.polygonOffset===!0&&(x.polygonOffset=!0),this.polygonOffsetFactor!==0&&(x.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(x.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(x.linewidth=this.linewidth),this.dashSize!==void 0&&(x.dashSize=this.dashSize),this.gapSize!==void 0&&(x.gapSize=this.gapSize),this.scale!==void 0&&(x.scale=this.scale),this.dithering===!0&&(x.dithering=!0),this.alphaTest>0&&(x.alphaTest=this.alphaTest),this.alphaHash===!0&&(x.alphaHash=!0),this.alphaToCoverage===!0&&(x.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(x.premultipliedAlpha=!0),this.forceSinglePass===!0&&(x.forceSinglePass=!0),this.wireframe===!0&&(x.wireframe=!0),this.wireframeLinewidth>1&&(x.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(x.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(x.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(x.flatShading=!0),this.visible===!1&&(x.visible=!1),this.toneMapped===!1&&(x.toneMapped=!1),this.fog===!1&&(x.fog=!1),Object.keys(this.userData).length>0&&(x.userData=this.userData);function T(E){const s=[];for(const y in E){const e=E[y];delete e.metadata,s.push(e)}return s}if(i){const E=T(t.textures),s=T(t.images);E.length>0&&(x.textures=E),s.length>0&&(x.images=s)}return x}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const i=t.clippingPlanes;let x=null;if(i!==null){const T=i.length;x=new Array(T);for(let E=0;E!==T;++E)x[E]=i[E].clone()}return this.clippingPlanes=x,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}}class xh extends Hr{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const ml=Q5();function Q5(){const g=new ArrayBuffer(4),t=new Float32Array(g),i=new Uint32Array(g),x=new Uint32Array(512),T=new Uint32Array(512);for(let e=0;e<256;++e){const r=e-127;r<-27?(x[e]=0,x[e|256]=32768,T[e]=24,T[e|256]=24):r<-14?(x[e]=1024>>-r-14,x[e|256]=1024>>-r-14|32768,T[e]=-r-1,T[e|256]=-r-1):r<=15?(x[e]=r+15<<10,x[e|256]=r+15<<10|32768,T[e]=13,T[e|256]=13):r<128?(x[e]=31744,x[e|256]=64512,T[e]=24,T[e|256]=24):(x[e]=31744,x[e|256]=64512,T[e]=13,T[e|256]=13)}const E=new Uint32Array(2048),s=new Uint32Array(64),y=new Uint32Array(64);for(let e=1;e<1024;++e){let r=e<<13,p=0;for(;!(r&8388608);)r<<=1,p-=8388608;r&=-8388609,p+=947912704,E[e]=r|p}for(let e=1024;e<2048;++e)E[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)s[e]=e<<23;s[31]=1199570944,s[32]=2147483648;for(let e=33;e<63;++e)s[e]=2147483648+(e-32<<23);s[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(y[e]=1024);return{floatView:t,uint32View:i,baseTable:x,shiftTable:T,mantissaTable:E,exponentTable:s,offsetTable:y}}function Os(g){Math.abs(g)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),g=jn(g,-65504,65504),ml.floatView[0]=g;const t=ml.uint32View[0],i=t>>23&511;return ml.baseTable[i]+((t&8388607)>>ml.shiftTable[i])}function nd(g){const t=g>>10;return ml.uint32View[0]=ml.mantissaTable[ml.offsetTable[t]+(g&1023)]+ml.exponentTable[t],ml.floatView[0]}const _5={toHalfFloat:Os,fromHalfFloat:nd},ur=new Ct,uv=new ve;class an{constructor(t,i,x=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=x,this.usage=Fd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ea,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Su("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,i,x){t*=this.itemSize,x*=i.itemSize;for(let T=0,E=this.itemSize;T0&&(t.userData=this.userData),this.parameters!==void 0){const e=this.parameters;for(const r in e)e[r]!==void 0&&(t[r]=e[r]);return t}t.data={attributes:{}};const i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const x=this.attributes;for(const e in x){const r=x[e];t.data.attributes[e]=r.toJSON(t.data)}const T={};let E=!1;for(const e in this.morphAttributes){const r=this.morphAttributes[e],p=[];for(let h=0,a=r.length;h0&&(T[e]=p,E=!0)}E&&(t.data.morphAttributes=T,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const y=this.boundingSphere;return y!==null&&(t.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=t.name;const x=t.index;x!==null&&this.setIndex(x.clone(i));const T=t.attributes;for(const r in T){const p=T[r];this.setAttribute(r,p.clone(i))}const E=t.morphAttributes;for(const r in E){const p=[],h=E[r];for(let a=0,l=h.length;a0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;E(t.far-t.near)**2))&&(BT.copy(E).invert(),_h.copy(t.ray).applyMatrix4(BT),!(x.boundingBox!==null&&_h.intersectsBox(x.boundingBox)===!1)&&this._computeIntersections(t,i,_h)))}_computeIntersections(t,i,x){let T;const E=this.geometry,s=this.material,y=E.index,e=E.attributes.position,r=E.attributes.uv,p=E.attributes.uv1,h=E.attributes.normal,a=E.groups,l=E.drawRange;if(y!==null)if(Array.isArray(s))for(let n=0,u=a.length;ni.far?null:{distance:r,point:gv.clone(),object:g}}function yv(g,t,i,x,T,E,s,y,e,r){g.getVertexPosition(y,gf),g.getVertexPosition(e,yf),g.getVertexPosition(r,xf);const p=oN(g,t,i,x,gf,yf,xf,mv);if(p){T&&(dv.fromBufferAttribute(T,y),pv.fromBufferAttribute(T,e),vv.fromBufferAttribute(T,r),p.uv=ia.getInterpolation(mv,gf,yf,xf,dv,pv,vv,new ve)),E&&(dv.fromBufferAttribute(E,y),pv.fromBufferAttribute(E,e),vv.fromBufferAttribute(E,r),p.uv1=ia.getInterpolation(mv,gf,yf,xf,dv,pv,vv,new ve),p.uv2=p.uv1),s&&(zT.fromBufferAttribute(s,y),GT.fromBufferAttribute(s,e),VT.fromBufferAttribute(s,r),p.normal=ia.getInterpolation(mv,gf,yf,xf,zT,GT,VT,new Ct),p.normal.dot(x.direction)>0&&p.normal.multiplyScalar(-1));const h={a:y,b:e,c:r,normal:new Ct,materialIndex:0};ia.getNormal(gf,yf,xf,h.normal),p.face=h}return p}class Ou extends Li{constructor(t=1,i=1,x=1,T=1,E=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:x,widthSegments:T,heightSegments:E,depthSegments:s};const y=this;T=Math.floor(T),E=Math.floor(E),s=Math.floor(s);const e=[],r=[],p=[],h=[];let a=0,l=0;n("z","y","x",-1,-1,x,i,t,s,E,0),n("z","y","x",1,-1,x,i,-t,s,E,1),n("x","z","y",1,1,t,x,i,T,s,2),n("x","z","y",1,-1,t,x,-i,T,s,3),n("x","y","z",1,-1,t,i,x,T,E,4),n("x","y","z",-1,-1,t,i,-x,T,E,5),this.setIndex(e),this.setAttribute("position",new ke(r,3)),this.setAttribute("normal",new ke(p,3)),this.setAttribute("uv",new ke(h,2));function n(u,f,o,c,d,v,m,S,M,w,C){const A=v/M,P=m/w,b=v/2,O=m/2,I=S/2,D=M+1,B=w+1;let G=0,z=0;const X=new Ct;for(let K=0;K0?1:-1,p.push(X.x,X.y,X.z),h.push(tt/M),h.push(1-K/w),G+=1}}for(let K=0;K0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const x={};for(const T in this.extensions)this.extensions[T]===!0&&(x[T]=!0);return Object.keys(x).length>0&&(i.extensions=x),i}}class $d extends Yi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ci,this.projectionMatrix=new ci,this.projectionMatrixInverse=new ci,this.coordinateSystem=No}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const nh=new Ct,HT=new ve,WT=new ve;class Or extends $d{constructor(t=50,i=1,x=.1,T=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=x,this.far=T,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const i=.5*this.getFilmHeight()/t;this.fov=Jf*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(xu*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Jf*2*Math.atan(Math.tan(xu*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,i,x){nh.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(nh.x,nh.y).multiplyScalar(-t/nh.z),nh.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),x.set(nh.x,nh.y).multiplyScalar(-t/nh.z)}getViewSize(t,i){return this.getViewBounds(t,HT,WT),i.subVectors(WT,HT)}setViewOffset(t,i,x,T,E,s){this.aspect=t/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let i=t*Math.tan(xu*.5*this.fov)/this.zoom,x=2*i,T=this.aspect*x,E=-.5*T;const s=this.view;if(this.view!==null&&this.view.enabled){const e=s.fullWidth,r=s.fullHeight;E+=s.offsetX*T/e,i-=s.offsetY*x/r,T*=s.width/e,x*=s.height/r}const y=this.filmOffset;y!==0&&(E+=t*y/this.getFilmWidth()),this.projectionMatrix.makePerspective(E,E+T,i,i-x,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}const Sf=-90,Tf=1;class vw extends Yi{constructor(t,i,x){super(),this.type="CubeCamera",this.renderTarget=x,this.coordinateSystem=null,this.activeMipmapLevel=0;const T=new Or(Sf,Tf,t,i);T.layers=this.layers,this.add(T);const E=new Or(Sf,Tf,t,i);E.layers=this.layers,this.add(E);const s=new Or(Sf,Tf,t,i);s.layers=this.layers,this.add(s);const y=new Or(Sf,Tf,t,i);y.layers=this.layers,this.add(y);const e=new Or(Sf,Tf,t,i);e.layers=this.layers,this.add(e);const r=new Or(Sf,Tf,t,i);r.layers=this.layers,this.add(r)}updateCoordinateSystem(){const t=this.coordinateSystem,i=this.children.concat(),[x,T,E,s,y,e]=i;for(const r of i)this.remove(r);if(t===No)x.up.set(0,1,0),x.lookAt(1,0,0),T.up.set(0,1,0),T.lookAt(-1,0,0),E.up.set(0,0,-1),E.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),y.up.set(0,1,0),y.lookAt(0,0,1),e.up.set(0,1,0),e.lookAt(0,0,-1);else if(t===Od)x.up.set(0,-1,0),x.lookAt(-1,0,0),T.up.set(0,-1,0),T.lookAt(1,0,0),E.up.set(0,0,1),E.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),y.up.set(0,-1,0),y.lookAt(0,0,1),e.up.set(0,-1,0),e.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(const r of i)this.add(r),r.updateMatrixWorld()}update(t,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:x,activeMipmapLevel:T}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[E,s,y,e,r,p]=this.children,h=t.getRenderTarget(),a=t.getActiveCubeFace(),l=t.getActiveMipmapLevel(),n=t.xr.enabled;t.xr.enabled=!1;const u=x.texture.generateMipmaps;x.texture.generateMipmaps=!1,t.setRenderTarget(x,0,T),t.render(i,E),t.setRenderTarget(x,1,T),t.render(i,s),t.setRenderTarget(x,2,T),t.render(i,y),t.setRenderTarget(x,3,T),t.render(i,e),t.setRenderTarget(x,4,T),t.render(i,r),x.texture.generateMipmaps=u,t.setRenderTarget(x,5,T),t.render(i,p),t.setRenderTarget(h,a,l),t.xr.enabled=n,x.texture.needsPMREMUpdate=!0}}class Qd extends Un{constructor(t,i,x,T,E,s,y,e,r,p){t=t!==void 0?t:[],i=i!==void 0?i:wl,super(t,i,x,T,E,s,y,e,r,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class mw extends io{constructor(t=1,i={}){super(t,t,i),this.isWebGLCubeRenderTarget=!0;const x={width:t,height:t,depth:1},T=[x,x,x,x,x,x];i.encoding!==void 0&&(Su("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===ch?vr:ea),this.texture=new Qd(T,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Nn}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const x={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},T=new Ou(5,5,5),E=new no({name:"CubemapFromEquirect",uniforms:$f(x.uniforms),vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,side:ms,blending:Ml});E.uniforms.tEquirect.value=i;const s=new cr(T,E),y=i.minFilter;return i.minFilter===Io&&(i.minFilter=Nn),new vw(1,10,this).update(t,s),i.minFilter=y,s.geometry.dispose(),s.material.dispose(),this}clear(t,i,x,T){const E=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(this,s),t.clear(i,x,T);t.setRenderTarget(E)}}const N0=new Ct,fN=new Ct,cN=new Oi;class ah{constructor(t=new Ct(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,x,T){return this.normal.set(t,i,x),this.constant=T,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,x){const T=N0.subVectors(x,i).cross(fN.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(T,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,i){const x=t.delta(N0),T=this.normal.dot(x);if(T===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;const E=-(t.start.dot(this.normal)+this.constant)/T;return E<0||E>1?null:i.copy(t.start).addScaledVector(x,E)}intersectsLine(t){const i=this.distanceToPoint(t.start),x=this.distanceToPoint(t.end);return i<0&&x>0||x<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){const x=i||cN.getNormalMatrix(t),T=this.coplanarPoint(N0).applyMatrix4(t),E=this.normal.applyMatrix3(x).normalize();return this.constant=-T.dot(E),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}}const qh=new $r,xv=new Ct;class _d{constructor(t=new ah,i=new ah,x=new ah,T=new ah,E=new ah,s=new ah){this.planes=[t,i,x,T,E,s]}set(t,i,x,T,E,s){const y=this.planes;return y[0].copy(t),y[1].copy(i),y[2].copy(x),y[3].copy(T),y[4].copy(E),y[5].copy(s),this}copy(t){const i=this.planes;for(let x=0;x<6;x++)i[x].copy(t.planes[x]);return this}setFromProjectionMatrix(t,i=No){const x=this.planes,T=t.elements,E=T[0],s=T[1],y=T[2],e=T[3],r=T[4],p=T[5],h=T[6],a=T[7],l=T[8],n=T[9],u=T[10],f=T[11],o=T[12],c=T[13],d=T[14],v=T[15];if(x[0].setComponents(e-E,a-r,f-l,v-o).normalize(),x[1].setComponents(e+E,a+r,f+l,v+o).normalize(),x[2].setComponents(e+s,a+p,f+n,v+c).normalize(),x[3].setComponents(e-s,a-p,f-n,v-c).normalize(),x[4].setComponents(e-y,a-h,f-u,v-d).normalize(),i===No)x[5].setComponents(e+y,a+h,f+u,v+d).normalize();else if(i===Od)x[5].setComponents(y,h,u,d).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),qh.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const i=t.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),qh.copy(i.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(qh)}intersectsSprite(t){return qh.center.set(0,0,0),qh.radius=.7071067811865476,qh.applyMatrix4(t.matrixWorld),this.intersectsSphere(qh)}intersectsSphere(t){const i=this.planes,x=t.center,T=-t.radius;for(let E=0;E<6;E++)if(i[E].distanceToPoint(x)0?t.max.x:t.min.x,xv.y=T.normal.y>0?t.max.y:t.min.y,xv.z=T.normal.z>0?t.max.z:t.min.z,T.distanceToPoint(xv)<0)return!1}return!0}containsPoint(t){const i=this.planes;for(let x=0;x<6;x++)if(i[x].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function gw(){let g=null,t=!1,i=null,x=null;function T(E,s){i(E,s),x=g.requestAnimationFrame(T)}return{start:function(){t!==!0&&i!==null&&(x=g.requestAnimationFrame(T),t=!0)},stop:function(){g.cancelAnimationFrame(x),t=!1},setAnimationLoop:function(E){i=E},setContext:function(E){g=E}}}function dN(g,t){const i=t.isWebGL2,x=new WeakMap;function T(r,p){const h=r.array,a=r.usage,l=h.byteLength,n=g.createBuffer();g.bindBuffer(p,n),g.bufferData(p,h,a),r.onUploadCallback();let u;if(h instanceof Float32Array)u=g.FLOAT;else if(h instanceof Uint16Array)if(r.isFloat16BufferAttribute)if(i)u=g.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else u=g.UNSIGNED_SHORT;else if(h instanceof Int16Array)u=g.SHORT;else if(h instanceof Uint32Array)u=g.UNSIGNED_INT;else if(h instanceof Int32Array)u=g.INT;else if(h instanceof Int8Array)u=g.BYTE;else if(h instanceof Uint8Array)u=g.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)u=g.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:n,type:u,bytesPerElement:h.BYTES_PER_ELEMENT,version:r.version,size:l}}function E(r,p,h){const a=p.array,l=p._updateRange,n=p.updateRanges;if(g.bindBuffer(h,r),l.count===-1&&n.length===0&&g.bufferSubData(h,0,a),n.length!==0){for(let u=0,f=n.length;u 0 + vec4 plane; + #ifdef ALPHA_TO_COVERAGE + float distanceToPlane, distanceGradient; + float clipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + if ( clipOpacity == 0.0 ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + float unionClipOpacity = 1.0; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; + distanceGradient = fwidth( distanceToPlane ) / 2.0; + unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); + } + #pragma unroll_loop_end + clipOpacity *= 1.0 - unionClipOpacity; + #endif + diffuseColor.a *= clipOpacity; + if ( diffuseColor.a == 0.0 ) discard; + #else + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif + #endif +#endif`,LN=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,FN=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,ON=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,DN=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,IN=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,NN=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,BN=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,UN=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,zN=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,GN=`vec3 transformedNormal = objectNormal; +#ifdef USE_TANGENT + vec3 transformedTangent = objectTangent; +#endif +#ifdef USE_BATCHING + mat3 bm = mat3( batchingMatrix ); + transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); + transformedNormal = bm * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = bm * transformedTangent; + #endif +#endif +#ifdef USE_INSTANCING + mat3 im = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); + transformedNormal = im * transformedNormal; + #ifdef USE_TANGENT + transformedTangent = im * transformedTangent; + #endif +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,VN=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,HN=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,WN=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,XN=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,YN="gl_FragColor = linearToOutputTexel( gl_FragColor );",kN=` +const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( + vec3( 0.8224621, 0.177538, 0.0 ), + vec3( 0.0331941, 0.9668058, 0.0 ), + vec3( 0.0170827, 0.0723974, 0.9105199 ) +); +const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( + vec3( 1.2249401, - 0.2249404, 0.0 ), + vec3( - 0.0420569, 1.0420571, 0.0 ), + vec3( - 0.0196376, - 0.0786361, 1.0982735 ) +); +vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { + return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); +} +vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { + return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); +} +vec4 LinearTransferOETF( in vec4 value ) { + return value; +} +vec4 sRGBTransferOETF( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +} +vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return sRGBTransferOETF( value ); +}`,KN=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,jN=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,ZN=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,JN=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,$N=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,QN=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,_N=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,qN=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,t9=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,e9=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,i9=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,n9=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,r9=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,s9=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,a9=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +#if defined( USE_LIGHT_PROBES ) + uniform vec3 lightProbe[ 9 ]; +#endif +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometryPosition; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometryPosition; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,o9=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,l9=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,h9=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,u9=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,f9=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,c9=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + if( material.anisotropy == 0.0 ) { + anisotropyV = vec2( 1.0, 0.0 ); + } else { + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + } + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; +#endif`,d9=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecularDirect = vec3( 0.0 ); +vec3 clearcoatSpecularIndirect = vec3( 0.0 ); +vec3 sheenSpecularDirect = vec3( 0.0 ); +vec3 sheenSpecularIndirect = vec3(0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometryNormal; + vec3 viewDir = geometryViewDir; + vec3 position = geometryPosition; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,p9=` +vec3 geometryPosition = - vViewPosition; +vec3 geometryNormal = normal; +vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +vec3 geometryClearcoatNormal = vec3( 0.0 ); +#ifdef USE_CLEARCOAT + geometryClearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometryViewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometryPosition, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,v9=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometryNormal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,m9=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); +#endif`,g9=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,y9=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,x9=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,S9=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,T9=`#ifdef USE_MAP + vec4 sampledDiffuseColor = texture2D( map, vMapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + + #endif + diffuseColor *= sampledDiffuseColor; +#endif`,E9=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,M9=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,C9=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,w9=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,A9=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,P9=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,R9=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,b9=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,L9=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,F9=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 nonPerturbedNormal = normal;`,O9=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,D9=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,I9=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,N9=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,B9=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,U9=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = nonPerturbedNormal; +#endif`,z9=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,G9=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,V9=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,H9=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,W9=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,X9=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,Y9=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_BATCHING + mvPosition = batchingMatrix * mvPosition; +#endif +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,k9=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,K9=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,j9=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,Z9=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,J9=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,$9=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,Q9=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,_9=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,q9=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,tB=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + mat4 getBoneMatrix( const in float i ) { + int size = textureSize( boneTexture, 0 ).x; + int j = int( i ) * 4; + int x = j % size; + int y = j / size; + vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); + vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); + vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); + vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); + return mat4( v1, v2, v3, v4 ); + } +#endif`,eB=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,iB=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,nB=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,rB=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,sB=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,aB=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( + vec3( 1.6605, - 0.1246, - 0.0182 ), + vec3( - 0.5876, 1.1329, - 0.1006 ), + vec3( - 0.0728, - 0.0083, 1.1187 ) +); +const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( + vec3( 0.6274, 0.0691, 0.0164 ), + vec3( 0.3293, 0.9195, 0.0880 ), + vec3( 0.0433, 0.0113, 0.8956 ) +); +vec3 agxDefaultContrastApprox( vec3 x ) { + vec3 x2 = x * x; + vec3 x4 = x2 * x2; + return + 15.5 * x4 * x2 + - 40.14 * x4 * x + + 31.96 * x4 + - 6.868 * x2 * x + + 0.4298 * x2 + + 0.1191 * x + - 0.00232; +} +vec3 AgXToneMapping( vec3 color ) { + const mat3 AgXInsetMatrix = mat3( + vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), + vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), + vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) + ); + const mat3 AgXOutsetMatrix = mat3( + vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), + vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), + vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) + ); + const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; + color *= toneMappingExposure; + color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; + color = AgXInsetMatrix * color; + color = max( color, 1e-10 ); color = log2( color ); + color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); + color = clamp( color, 0.0, 1.0 ); + color = agxDefaultContrastApprox( color ); + color = AgXOutsetMatrix * color; + color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); + color = LINEAR_REC2020_TO_LINEAR_SRGB * color; + color = clamp( color, 0.0, 1.0 ); + return color; +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,oB=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,lB=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,hB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,uB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,fB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,cB=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_BATCHING + worldPosition = batchingMatrix * worldPosition; + #endif + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const dB=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,pB=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + #ifdef DECODE_VIDEO_TEXTURE + texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,vB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,mB=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,gB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,yB=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,xB=`#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,SB=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + vec4 diffuseColor = vec4( 1.0 ); + #include + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,TB=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,EB=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,MB=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,CB=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,wB=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,AB=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,PB=`#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,RB=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,bB=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,LB=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,FB=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,OB=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,DB=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,IB=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,NB=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,BB=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,UB=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,zB=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,GB=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,VB=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,HB=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,WB=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,XB=`#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,YB=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,kB=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,KB=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + vec3 outgoingLight = vec3( 0.0 ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,bi={alphahash_fragment:pN,alphahash_pars_fragment:vN,alphamap_fragment:mN,alphamap_pars_fragment:gN,alphatest_fragment:yN,alphatest_pars_fragment:xN,aomap_fragment:SN,aomap_pars_fragment:TN,batching_pars_vertex:EN,batching_vertex:MN,begin_vertex:CN,beginnormal_vertex:wN,bsdfs:AN,iridescence_fragment:PN,bumpmap_pars_fragment:RN,clipping_planes_fragment:bN,clipping_planes_pars_fragment:LN,clipping_planes_pars_vertex:FN,clipping_planes_vertex:ON,color_fragment:DN,color_pars_fragment:IN,color_pars_vertex:NN,color_vertex:BN,common:UN,cube_uv_reflection_fragment:zN,defaultnormal_vertex:GN,displacementmap_pars_vertex:VN,displacementmap_vertex:HN,emissivemap_fragment:WN,emissivemap_pars_fragment:XN,colorspace_fragment:YN,colorspace_pars_fragment:kN,envmap_fragment:KN,envmap_common_pars_fragment:jN,envmap_pars_fragment:ZN,envmap_pars_vertex:JN,envmap_physical_pars_fragment:o9,envmap_vertex:$N,fog_vertex:QN,fog_pars_vertex:_N,fog_fragment:qN,fog_pars_fragment:t9,gradientmap_pars_fragment:e9,lightmap_fragment:i9,lightmap_pars_fragment:n9,lights_lambert_fragment:r9,lights_lambert_pars_fragment:s9,lights_pars_begin:a9,lights_toon_fragment:l9,lights_toon_pars_fragment:h9,lights_phong_fragment:u9,lights_phong_pars_fragment:f9,lights_physical_fragment:c9,lights_physical_pars_fragment:d9,lights_fragment_begin:p9,lights_fragment_maps:v9,lights_fragment_end:m9,logdepthbuf_fragment:g9,logdepthbuf_pars_fragment:y9,logdepthbuf_pars_vertex:x9,logdepthbuf_vertex:S9,map_fragment:T9,map_pars_fragment:E9,map_particle_fragment:M9,map_particle_pars_fragment:C9,metalnessmap_fragment:w9,metalnessmap_pars_fragment:A9,morphcolor_vertex:P9,morphnormal_vertex:R9,morphtarget_pars_vertex:b9,morphtarget_vertex:L9,normal_fragment_begin:F9,normal_fragment_maps:O9,normal_pars_fragment:D9,normal_pars_vertex:I9,normal_vertex:N9,normalmap_pars_fragment:B9,clearcoat_normal_fragment_begin:U9,clearcoat_normal_fragment_maps:z9,clearcoat_pars_fragment:G9,iridescence_pars_fragment:V9,opaque_fragment:H9,packing:W9,premultiplied_alpha_fragment:X9,project_vertex:Y9,dithering_fragment:k9,dithering_pars_fragment:K9,roughnessmap_fragment:j9,roughnessmap_pars_fragment:Z9,shadowmap_pars_fragment:J9,shadowmap_pars_vertex:$9,shadowmap_vertex:Q9,shadowmask_pars_fragment:_9,skinbase_vertex:q9,skinning_pars_vertex:tB,skinning_vertex:eB,skinnormal_vertex:iB,specularmap_fragment:nB,specularmap_pars_fragment:rB,tonemapping_fragment:sB,tonemapping_pars_fragment:aB,transmission_fragment:oB,transmission_pars_fragment:lB,uv_pars_fragment:hB,uv_pars_vertex:uB,uv_vertex:fB,worldpos_vertex:cB,background_vert:dB,background_frag:pB,backgroundCube_vert:vB,backgroundCube_frag:mB,cube_vert:gB,cube_frag:yB,depth_vert:xB,depth_frag:SB,distanceRGBA_vert:TB,distanceRGBA_frag:EB,equirect_vert:MB,equirect_frag:CB,linedashed_vert:wB,linedashed_frag:AB,meshbasic_vert:PB,meshbasic_frag:RB,meshlambert_vert:bB,meshlambert_frag:LB,meshmatcap_vert:FB,meshmatcap_frag:OB,meshnormal_vert:DB,meshnormal_frag:IB,meshphong_vert:NB,meshphong_frag:BB,meshphysical_vert:UB,meshphysical_frag:zB,meshtoon_vert:GB,meshtoon_frag:VB,points_vert:HB,points_frag:WB,shadow_vert:XB,shadow_frag:YB,sprite_vert:kB,sprite_frag:KB},Fe={common:{diffuse:{value:new ze(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Oi},alphaMap:{value:null},alphaMapTransform:{value:new Oi},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Oi}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Oi}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Oi}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Oi},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Oi},normalScale:{value:new ve(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Oi},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Oi}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Oi}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Oi}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ze(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ze(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Oi},alphaTest:{value:0},uvTransform:{value:new Oi}},sprite:{diffuse:{value:new ze(16777215)},opacity:{value:1},center:{value:new ve(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Oi},alphaMap:{value:null},alphaMapTransform:{value:new Oi},alphaTest:{value:0}}},to={basic:{uniforms:ds([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.fog]),vertexShader:bi.meshbasic_vert,fragmentShader:bi.meshbasic_frag},lambert:{uniforms:ds([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)}}]),vertexShader:bi.meshlambert_vert,fragmentShader:bi.meshlambert_frag},phong:{uniforms:ds([Fe.common,Fe.specularmap,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)},specular:{value:new ze(1118481)},shininess:{value:30}}]),vertexShader:bi.meshphong_vert,fragmentShader:bi.meshphong_frag},standard:{uniforms:ds([Fe.common,Fe.envmap,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.roughnessmap,Fe.metalnessmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bi.meshphysical_vert,fragmentShader:bi.meshphysical_frag},toon:{uniforms:ds([Fe.common,Fe.aomap,Fe.lightmap,Fe.emissivemap,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.gradientmap,Fe.fog,Fe.lights,{emissive:{value:new ze(0)}}]),vertexShader:bi.meshtoon_vert,fragmentShader:bi.meshtoon_frag},matcap:{uniforms:ds([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,Fe.fog,{matcap:{value:null}}]),vertexShader:bi.meshmatcap_vert,fragmentShader:bi.meshmatcap_frag},points:{uniforms:ds([Fe.points,Fe.fog]),vertexShader:bi.points_vert,fragmentShader:bi.points_frag},dashed:{uniforms:ds([Fe.common,Fe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bi.linedashed_vert,fragmentShader:bi.linedashed_frag},depth:{uniforms:ds([Fe.common,Fe.displacementmap]),vertexShader:bi.depth_vert,fragmentShader:bi.depth_frag},normal:{uniforms:ds([Fe.common,Fe.bumpmap,Fe.normalmap,Fe.displacementmap,{opacity:{value:1}}]),vertexShader:bi.meshnormal_vert,fragmentShader:bi.meshnormal_frag},sprite:{uniforms:ds([Fe.sprite,Fe.fog]),vertexShader:bi.sprite_vert,fragmentShader:bi.sprite_frag},background:{uniforms:{uvTransform:{value:new Oi},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bi.background_vert,fragmentShader:bi.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:bi.backgroundCube_vert,fragmentShader:bi.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bi.cube_vert,fragmentShader:bi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bi.equirect_vert,fragmentShader:bi.equirect_frag},distanceRGBA:{uniforms:ds([Fe.common,Fe.displacementmap,{referencePosition:{value:new Ct},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bi.distanceRGBA_vert,fragmentShader:bi.distanceRGBA_frag},shadow:{uniforms:ds([Fe.lights,Fe.fog,{color:{value:new ze(0)},opacity:{value:1}}]),vertexShader:bi.shadow_vert,fragmentShader:bi.shadow_frag}};to.physical={uniforms:ds([to.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Oi},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Oi},clearcoatNormalScale:{value:new ve(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Oi},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Oi},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Oi},sheen:{value:0},sheenColor:{value:new ze(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Oi},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Oi},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Oi},transmissionSamplerSize:{value:new ve},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Oi},attenuationDistance:{value:0},attenuationColor:{value:new ze(0)},specularColor:{value:new ze(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Oi},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Oi},anisotropyVector:{value:new ve},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Oi}}]),vertexShader:bi.meshphysical_vert,fragmentShader:bi.meshphysical_frag};const Sv={r:0,b:0,g:0};function jB(g,t,i,x,T,E,s){const y=new ze(0);let e=E===!0?0:1,r,p,h=null,a=0,l=null;function n(f,o){let c=!1,d=o.isScene===!0?o.background:null;d&&d.isTexture&&(d=(o.backgroundBlurriness>0?i:t).get(d)),d===null?u(y,e):d&&d.isColor&&(u(d,1),c=!0);const v=g.xr.getEnvironmentBlendMode();v==="additive"?x.buffers.color.setClear(0,0,0,1,s):v==="alpha-blend"&&x.buffers.color.setClear(0,0,0,0,s),(g.autoClear||c)&&g.clear(g.autoClearColor,g.autoClearDepth,g.autoClearStencil),d&&(d.isCubeTexture||d.mapping===ec)?(p===void 0&&(p=new cr(new Ou(1,1,1),new no({name:"BackgroundCubeMaterial",uniforms:$f(to.backgroundCube.uniforms),vertexShader:to.backgroundCube.vertexShader,fragmentShader:to.backgroundCube.fragmentShader,side:ms,depthTest:!1,depthWrite:!1,fog:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(m,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),T.update(p)),p.material.uniforms.envMap.value=d,p.material.uniforms.flipEnvMap.value=d.isCubeTexture&&d.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=o.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,p.material.toneMapped=rn.getTransfer(d.colorSpace)!==vn,(h!==d||a!==d.version||l!==g.toneMapping)&&(p.material.needsUpdate=!0,h=d,a=d.version,l=g.toneMapping),p.layers.enableAll(),f.unshift(p,p.geometry,p.material,0,0,null)):d&&d.isTexture&&(r===void 0&&(r=new cr(new nc(2,2),new no({name:"BackgroundMaterial",uniforms:$f(to.background.uniforms),vertexShader:to.background.vertexShader,fragmentShader:to.background.fragmentShader,side:Cl,depthTest:!1,depthWrite:!1,fog:!1})),r.geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),T.update(r)),r.material.uniforms.t2D.value=d,r.material.uniforms.backgroundIntensity.value=o.backgroundIntensity,r.material.toneMapped=rn.getTransfer(d.colorSpace)!==vn,d.matrixAutoUpdate===!0&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),(h!==d||a!==d.version||l!==g.toneMapping)&&(r.material.needsUpdate=!0,h=d,a=d.version,l=g.toneMapping),r.layers.enableAll(),f.unshift(r,r.geometry,r.material,0,0,null))}function u(f,o){f.getRGB(Sv,dw(g)),x.buffers.color.setClear(Sv.r,Sv.g,Sv.b,o,s)}return{getClearColor:function(){return y},setClearColor:function(f,o=1){y.set(f),e=o,u(y,e)},getClearAlpha:function(){return e},setClearAlpha:function(f){e=f,u(y,e)},render:n}}function ZB(g,t,i,x){const T=g.getParameter(g.MAX_VERTEX_ATTRIBS),E=x.isWebGL2?null:t.get("OES_vertex_array_object"),s=x.isWebGL2||E!==null,y={},e=f(null);let r=e,p=!1;function h(I,D,B,G,z){let X=!1;if(s){const K=u(G,B,D);r!==K&&(r=K,l(r.object)),X=o(I,G,B,z),X&&c(I,G,B,z)}else{const K=D.wireframe===!0;(r.geometry!==G.id||r.program!==B.id||r.wireframe!==K)&&(r.geometry=G.id,r.program=B.id,r.wireframe=K,X=!0)}z!==null&&i.update(z,g.ELEMENT_ARRAY_BUFFER),(X||p)&&(p=!1,w(I,D,B,G),z!==null&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,i.get(z).buffer))}function a(){return x.isWebGL2?g.createVertexArray():E.createVertexArrayOES()}function l(I){return x.isWebGL2?g.bindVertexArray(I):E.bindVertexArrayOES(I)}function n(I){return x.isWebGL2?g.deleteVertexArray(I):E.deleteVertexArrayOES(I)}function u(I,D,B){const G=B.wireframe===!0;let z=y[I.id];z===void 0&&(z={},y[I.id]=z);let X=z[D.id];X===void 0&&(X={},z[D.id]=X);let K=X[G];return K===void 0&&(K=f(a()),X[G]=K),K}function f(I){const D=[],B=[],G=[];for(let z=0;z=0){const Z=z[tt];let U=X[tt];if(U===void 0&&(tt==="instanceMatrix"&&I.instanceMatrix&&(U=I.instanceMatrix),tt==="instanceColor"&&I.instanceColor&&(U=I.instanceColor)),Z===void 0||Z.attribute!==U||U&&Z.data!==U.data)return!0;K++}return r.attributesNum!==K||r.index!==G}function c(I,D,B,G){const z={},X=D.attributes;let K=0;const Q=B.getAttributes();for(const tt in Q)if(Q[tt].location>=0){let Z=X[tt];Z===void 0&&(tt==="instanceMatrix"&&I.instanceMatrix&&(Z=I.instanceMatrix),tt==="instanceColor"&&I.instanceColor&&(Z=I.instanceColor));const U={};U.attribute=Z,Z&&Z.data&&(U.data=Z.data),z[tt]=U,K++}r.attributes=z,r.attributesNum=K,r.index=G}function d(){const I=r.newAttributes;for(let D=0,B=I.length;D=0){let Y=z[Q];if(Y===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(Y=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(Y=I.instanceColor)),Y!==void 0){const Z=Y.normalized,U=Y.itemSize,H=i.get(Y);if(H===void 0)continue;const J=H.buffer,_=H.type,q=H.bytesPerElement,at=x.isWebGL2===!0&&(_===g.INT||_===g.UNSIGNED_INT||Y.gpuType===n1);if(Y.isInterleavedBufferAttribute){const ot=Y.data,rt=ot.stride,gt=Y.offset;if(ot.isInstancedInterleavedBuffer){for(let yt=0;yt0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&g.getShaderPrecisionFormat(g.VERTEX_SHADER,g.MEDIUM_FLOAT).precision>0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const s=typeof WebGL2RenderingContext<"u"&&g.constructor.name==="WebGL2RenderingContext";let y=i.precision!==void 0?i.precision:"highp";const e=E(y);e!==y&&(console.warn("THREE.WebGLRenderer:",y,"not supported, using",e,"instead."),y=e);const r=s||t.has("WEBGL_draw_buffers"),p=i.logarithmicDepthBuffer===!0,h=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS),a=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=g.getParameter(g.MAX_TEXTURE_SIZE),n=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE),u=g.getParameter(g.MAX_VERTEX_ATTRIBS),f=g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS),o=g.getParameter(g.MAX_VARYING_VECTORS),c=g.getParameter(g.MAX_FRAGMENT_UNIFORM_VECTORS),d=a>0,v=s||t.has("OES_texture_float"),m=d&&v,S=s?g.getParameter(g.MAX_SAMPLES):0;return{isWebGL2:s,drawBuffers:r,getMaxAnisotropy:T,getMaxPrecision:E,precision:y,logarithmicDepthBuffer:p,maxTextures:h,maxVertexTextures:a,maxTextureSize:l,maxCubemapSize:n,maxAttributes:u,maxVertexUniforms:f,maxVaryings:o,maxFragmentUniforms:c,vertexTextures:d,floatFragmentTextures:v,floatVertexTextures:m,maxSamples:S}}function QB(g){const t=this;let i=null,x=0,T=!1,E=!1;const s=new ah,y=new Oi,e={value:null,needsUpdate:!1};this.uniform=e,this.numPlanes=0,this.numIntersection=0,this.init=function(h,a){const l=h.length!==0||a||x!==0||T;return T=a,x=h.length,l},this.beginShadows=function(){E=!0,p(null)},this.endShadows=function(){E=!1},this.setGlobalState=function(h,a){i=p(h,a,0)},this.setState=function(h,a,l){const n=h.clippingPlanes,u=h.clipIntersection,f=h.clipShadows,o=g.get(h);if(!T||n===null||n.length===0||E&&!f)E?p(null):r();else{const c=E?0:x,d=c*4;let v=o.clippingState||null;e.value=v,v=p(n,a,d,l);for(let m=0;m!==d;++m)v[m]=i[m];o.clippingState=v,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=c}};function r(){e.value!==i&&(e.value=i,e.needsUpdate=x>0),t.numPlanes=x,t.numIntersection=0}function p(h,a,l,n){const u=h!==null?h.length:0;let f=null;if(u!==0){if(f=e.value,n!==!0||f===null){const o=l+u*4,c=a.matrixWorldInverse;y.getNormalMatrix(c),(f===null||f.length0){const r=new mw(e.height);return r.fromEquirectangularTexture(g,s),t.set(s,r),s.addEventListener("dispose",T),i(r.texture,s.mapping)}else return null}}return s}function T(s){const y=s.target;y.removeEventListener("dispose",T);const e=t.get(y);e!==void 0&&(t.delete(y),e.dispose())}function E(){t=new WeakMap}return{get:x,dispose:E}}class qd extends $d{constructor(t=-1,i=1,x=1,T=-1,E=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=x,this.bottom=T,this.near=E,this.far=s,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,x,T,E,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),x=(this.right+this.left)/2,T=(this.top+this.bottom)/2;let E=x-t,s=x+t,y=T+i,e=T-i;if(this.view!==null&&this.view.enabled){const r=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;E+=r*this.view.offsetX,s=E+r*this.view.width,y-=p*this.view.offsetY,e=y-p*this.view.height}this.projectionMatrix.makeOrthographic(E,s,y,e,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}const Uf=4,XT=[.125,.215,.35,.446,.526,.582],cu=20,B0=new qd,YT=new ze;let U0=null,z0=0,G0=0;const uu=(1+Math.sqrt(5))/2,Ef=1/uu,kT=[new Ct(1,1,1),new Ct(-1,1,1),new Ct(1,1,-1),new Ct(-1,1,-1),new Ct(0,uu,Ef),new Ct(0,uu,-Ef),new Ct(Ef,0,uu),new Ct(-Ef,0,uu),new Ct(uu,Ef,0),new Ct(-uu,Ef,0)];class px{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,i=0,x=.1,T=100){U0=this._renderer.getRenderTarget(),z0=this._renderer.getActiveCubeFace(),G0=this._renderer.getActiveMipmapLevel(),this._setSize(256);const E=this._allocateTargets();return E.depthBuffer=!0,this._sceneToCubeUV(t,x,T,E),i>0&&this._blur(E,0,0,i),this._applyPMREM(E),this._cleanup(E),E}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=ZT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=jT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t2?d:0,d,d),p.setRenderTarget(T),u&&p.render(n,y),p.render(t,y)}n.geometry.dispose(),n.material.dispose(),p.toneMapping=a,p.autoClear=h,t.background=f}_textureToCubeUV(t,i){const x=this._renderer,T=t.mapping===wl||t.mapping===vh;T?(this._cubemapMaterial===null&&(this._cubemapMaterial=ZT()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=jT());const E=T?this._cubemapMaterial:this._equirectMaterial,s=new cr(this._lodPlanes[0],E),y=E.uniforms;y.envMap.value=t;const e=this._cubeSize;Tv(i,0,0,3*e,2*e),x.setRenderTarget(i),x.render(s,B0)}_applyPMREM(t){const i=this._renderer,x=i.autoClear;i.autoClear=!1;for(let T=1;Tcu&&console.warn(`sigmaRadians, ${E}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${cu}`);const o=[];let c=0;for(let M=0;Md-Uf?T-d+Uf:0),S=4*(this._cubeSize-v);Tv(i,m,S,3*v,2*v),e.setRenderTarget(i),e.render(h,B0)}}function qB(g){const t=[],i=[],x=[];let T=g;const E=g-Uf+1+XT.length;for(let s=0;sg-Uf?e=XT[s-g+Uf-1]:s===0&&(e=0),x.push(e);const r=1/(y-2),p=-r,h=1+r,a=[p,p,h,p,h,h,p,p,h,h,p,h],l=6,n=6,u=3,f=2,o=1,c=new Float32Array(u*n*l),d=new Float32Array(f*n*l),v=new Float32Array(o*n*l);for(let S=0;S2?0:-1,C=[M,w,0,M+2/3,w,0,M+2/3,w+1,0,M,w,0,M+2/3,w+1,0,M,w+1,0];c.set(C,u*n*S),d.set(a,f*n*S);const A=[S,S,S,S,S,S];v.set(A,o*n*S)}const m=new Li;m.setAttribute("position",new an(c,u)),m.setAttribute("uv",new an(d,f)),m.setAttribute("faceIndex",new an(v,o)),t.push(m),T>Uf&&T--}return{lodPlanes:t,sizeLods:i,sigmas:x}}function KT(g,t,i){const x=new io(g,t,i);return x.texture.mapping=ec,x.texture.name="PMREM.cubeUv",x.scissorTest=!0,x}function Tv(g,t,i,x,T){g.viewport.set(t,i,x,T),g.scissor.set(t,i,x,T)}function t8(g,t,i){const x=new Float32Array(cu),T=new Ct(0,1,0);return new no({name:"SphericalGaussianBlur",defines:{n:cu,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${g}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:x},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:T}},vertexShader:y1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Ml,depthTest:!1,depthWrite:!1})}function jT(){return new no({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:y1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Ml,depthTest:!1,depthWrite:!1})}function ZT(){return new no({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:y1(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Ml,depthTest:!1,depthWrite:!1})}function y1(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function e8(g){let t=new WeakMap,i=null;function x(y){if(y&&y.isTexture){const e=y.mapping,r=e===Td||e===Ed,p=e===wl||e===vh;if(r||p)if(y.isRenderTargetTexture&&y.needsPMREMUpdate===!0){y.needsPMREMUpdate=!1;let h=t.get(y);return i===null&&(i=new px(g)),h=r?i.fromEquirectangular(y,h):i.fromCubemap(y,h),t.set(y,h),h.texture}else{if(t.has(y))return t.get(y).texture;{const h=y.image;if(r&&h&&h.height>0||p&&h&&T(h)){i===null&&(i=new px(g));const a=r?i.fromEquirectangular(y):i.fromCubemap(y);return t.set(y,a),y.addEventListener("dispose",E),a.texture}else return null}}}return y}function T(y){let e=0;const r=6;for(let p=0;pt.maxTextureSize&&(A=Math.ceil(C/t.maxTextureSize),C=t.maxTextureSize);const P=new Float32Array(C*A*4*n),b=new lg(P,C,A,n);b.type=Ea,b.needsUpdate=!0;const O=w*4;for(let D=0;D0)return g;const T=t*i;let E=JT[T];if(E===void 0&&(E=new Float32Array(T),JT[T]=E),t!==0){x.toArray(E,0);for(let s=1,y=0;s!==t;++s)y+=i,g[s].toArray(E,y)}return E}function gr(g,t){if(g.length!==t.length)return!1;for(let i=0,x=g.length;i":" "} ${y}: ${i[s]}`)}return x.join(` +`)}function n6(g){const t=rn.getPrimaries(rn.workingColorSpace),i=rn.getPrimaries(g);let x;switch(t===i?x="":t===Ld&&i===bd?x="LinearDisplayP3ToLinearSRGB":t===bd&&i===Ld&&(x="LinearSRGBToLinearDisplayP3"),g){case Go:case Jd:return[x,"LinearTransferOETF"];case vr:case og:return[x,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",g),[x,"LinearTransferOETF"]}}function iE(g,t,i){const x=g.getShaderParameter(t,g.COMPILE_STATUS),T=g.getShaderInfoLog(t).trim();if(x&&T==="")return"";const E=/ERROR: 0:(\d+)/.exec(T);if(E){const s=parseInt(E[1]);return i.toUpperCase()+` + +`+T+` + +`+i6(g.getShaderSource(t),s)}else return T}function r6(g,t){const i=n6(t);return`vec4 ${g}( vec4 value ) { return ${i[0]}( ${i[1]}( value ) ); }`}function s6(g,t){let i;switch(t){case B2:i="Linear";break;case U2:i="Reinhard";break;case z2:i="OptimizedCineon";break;case i1:i="ACESFilmic";break;case V2:i="AgX";break;case G2:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),i="Linear"}return"vec3 "+g+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function a6(g){return[g.extensionDerivatives||g.envMapCubeUVHeight||g.bumpMap||g.normalMapTangentSpace||g.clearcoatNormalMap||g.flatShading||g.alphaToCoverage||g.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(g.extensionFragDepth||g.logarithmicDepthBuffer)&&g.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",g.extensionDrawBuffers&&g.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(g.extensionShaderTextureLOD||g.envMap||g.transmission)&&g.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(zf).join(` +`)}function o6(g){return[g.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",g.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(zf).join(` +`)}function l6(g){const t=[];for(const i in g){const x=g[i];x!==!1&&t.push("#define "+i+" "+x)}return t.join(` +`)}function h6(g,t){const i={},x=g.getProgramParameter(t,g.ACTIVE_ATTRIBUTES);for(let T=0;T/gm;function vx(g){return g.replace(u6,c6)}const f6=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function c6(g,t){let i=bi[t];if(i===void 0){const x=f6.get(t);if(x!==void 0)i=bi[x],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',t,x);else throw new Error("Can not resolve #include <"+t+">")}return vx(i)}const d6=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function sE(g){return g.replace(d6,p6)}function p6(g,t,i,x){let T="";for(let E=parseInt(t);E0&&(o+=` +`),c=[l,"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u].filter(zf).join(` +`),c.length>0&&(c+=` +`)):(o=[aE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+e:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(zf).join(` +`),c=[l,aE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+r:"",i.envMap?"#define "+p:"",i.envMap?"#define "+h:"",a?"#define CUBEUV_TEXEL_WIDTH "+a.texelWidth:"",a?"#define CUBEUV_TEXEL_HEIGHT "+a.texelHeight:"",a?"#define CUBEUV_MAX_MIP "+a.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+e:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Bo?"#define TONE_MAPPING":"",i.toneMapping!==Bo?bi.tonemapping_pars_fragment:"",i.toneMapping!==Bo?s6("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",bi.colorspace_pars_fragment,r6("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",` +`].filter(zf).join(` +`)),s=vx(s),s=nE(s,i),s=rE(s,i),y=vx(y),y=nE(y,i),y=rE(y,i),s=sE(s),y=sE(y),i.isWebGL2&&i.isRawShaderMaterial!==!0&&(d=`#version 300 es +`,o=[n,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+o,c=["precision mediump sampler2DArray;","#define varying in",i.glslVersion===cx?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===cx?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+c);const v=d+o+s,m=d+c+y,S=eE(T,T.VERTEX_SHADER,v),M=eE(T,T.FRAGMENT_SHADER,m);T.attachShader(f,S),T.attachShader(f,M),i.index0AttributeName!==void 0?T.bindAttribLocation(f,0,i.index0AttributeName):i.morphTargets===!0&&T.bindAttribLocation(f,0,"position"),T.linkProgram(f);function w(b){if(g.debug.checkShaderErrors){const O=T.getProgramInfoLog(f).trim(),I=T.getShaderInfoLog(S).trim(),D=T.getShaderInfoLog(M).trim();let B=!0,G=!0;if(T.getProgramParameter(f,T.LINK_STATUS)===!1)if(B=!1,typeof g.debug.onShaderError=="function")g.debug.onShaderError(T,f,S,M);else{const z=iE(T,S,"vertex"),X=iE(T,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+T.getError()+" - VALIDATE_STATUS "+T.getProgramParameter(f,T.VALIDATE_STATUS)+` + +Material Name: `+b.name+` +Material Type: `+b.type+` + +Program Info Log: `+O+` +`+z+` +`+X)}else O!==""?console.warn("THREE.WebGLProgram: Program Info Log:",O):(I===""||D==="")&&(G=!1);G&&(b.diagnostics={runnable:B,programLog:O,vertexShader:{log:I,prefix:o},fragmentShader:{log:D,prefix:c}})}T.deleteShader(S),T.deleteShader(M),C=new lm(T,f),A=h6(T,f)}let C;this.getUniforms=function(){return C===void 0&&w(this),C};let A;this.getAttributes=function(){return A===void 0&&w(this),A};let P=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=T.getProgramParameter(f,t6)),P},this.destroy=function(){x.releaseStatesOfProgram(this),T.deleteProgram(f),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=e6++,this.cacheKey=t,this.usedTimes=1,this.program=f,this.vertexShader=S,this.fragmentShader=M,this}let T6=0;class E6{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const i=t.vertexShader,x=t.fragmentShader,T=this._getShaderStage(i),E=this._getShaderStage(x),s=this._getShaderCacheForMaterial(t);return s.has(T)===!1&&(s.add(T),T.usedTimes++),s.has(E)===!1&&(s.add(E),E.usedTimes++),this}remove(t){const i=this.materialCache.get(t);for(const x of i)x.usedTimes--,x.usedTimes===0&&this.shaderCache.delete(x.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const i=this.materialCache;let x=i.get(t);return x===void 0&&(x=new Set,i.set(t,x)),x}_getShaderStage(t){const i=this.shaderCache;let x=i.get(t);return x===void 0&&(x=new M6(t),i.set(t,x)),x}}class M6{constructor(t){this.id=T6++,this.code=t,this.usedTimes=0}}function C6(g,t,i,x,T,E,s){const y=new Tu,e=new E6,r=new Set,p=[],h=T.isWebGL2,a=T.logarithmicDepthBuffer,l=T.vertexTextures;let n=T.precision;const u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function f(A){return r.add(A),A===0?"uv":`uv${A}`}function o(A,P,b,O,I){const D=O.fog,B=I.geometry,G=A.isMeshStandardMaterial?O.environment:null,z=(A.isMeshStandardMaterial?i:t).get(A.envMap||G),X=z&&z.mapping===ec?z.image.height:null,K=u[A.type];A.precision!==null&&(n=T.getMaxPrecision(A.precision),n!==A.precision&&console.warn("THREE.WebGLProgram.getParameters:",A.precision,"not supported, using",n,"instead."));const Q=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,tt=Q!==void 0?Q.length:0;let Y=0;B.morphAttributes.position!==void 0&&(Y=1),B.morphAttributes.normal!==void 0&&(Y=2),B.morphAttributes.color!==void 0&&(Y=3);let Z,U,H,J;if(K){const Di=to[K];Z=Di.vertexShader,U=Di.fragmentShader}else Z=A.vertexShader,U=A.fragmentShader,e.update(A),H=e.getVertexShaderID(A),J=e.getFragmentShaderID(A);const _=g.getRenderTarget(),q=I.isInstancedMesh===!0,at=I.isBatchedMesh===!0,ot=!!A.map,rt=!!A.matcap,gt=!!z,yt=!!A.aoMap,Et=!!A.lightMap,At=!!A.bumpMap,Pt=!!A.normalMap,Vt=!!A.displacementMap,dt=!!A.emissiveMap,ut=!!A.metalnessMap,Rt=!!A.roughnessMap,Dt=A.anisotropy>0,Ht=A.clearcoat>0,Bt=A.iridescence>0,ne=A.sheen>0,oe=A.transmission>0,ge=Dt&&!!A.anisotropyMap,xe=Ht&&!!A.clearcoatMap,Ae=Ht&&!!A.clearcoatNormalMap,qt=Ht&&!!A.clearcoatRoughnessMap,Ge=Bt&&!!A.iridescenceMap,Oe=Bt&&!!A.iridescenceThicknessMap,Be=ne&&!!A.sheenColorMap,Le=ne&&!!A.sheenRoughnessMap,ie=!!A.specularMap,Ke=!!A.specularColorMap,ri=!!A.specularIntensityMap,Ti=oe&&!!A.transmissionMap,le=oe&&!!A.thicknessMap,xi=!!A.gradientMap,bt=!!A.alphaMap,Me=A.alphaTest>0,Ce=!!A.alphaHash,Ve=!!A.extensions;let Je=Bo;A.toneMapped&&(_===null||_.isXRRenderTarget===!0)&&(Je=g.toneMapping);const zi={isWebGL2:h,shaderID:K,shaderType:A.type,shaderName:A.name,vertexShader:Z,fragmentShader:U,defines:A.defines,customVertexShaderID:H,customFragmentShaderID:J,isRawShaderMaterial:A.isRawShaderMaterial===!0,glslVersion:A.glslVersion,precision:n,batching:at,instancing:q,instancingColor:q&&I.instanceColor!==null,supportsVertexTextures:l,outputColorSpace:_===null?g.outputColorSpace:_.isXRRenderTarget===!0?_.texture.colorSpace:Go,alphaToCoverage:!!A.alphaToCoverage,map:ot,matcap:rt,envMap:gt,envMapMode:gt&&z.mapping,envMapCubeUVHeight:X,aoMap:yt,lightMap:Et,bumpMap:At,normalMap:Pt,displacementMap:l&&Vt,emissiveMap:dt,normalMapObjectSpace:Pt&&A.normalMapType===ew,normalMapTangentSpace:Pt&&A.normalMapType===yh,metalnessMap:ut,roughnessMap:Rt,anisotropy:Dt,anisotropyMap:ge,clearcoat:Ht,clearcoatMap:xe,clearcoatNormalMap:Ae,clearcoatRoughnessMap:qt,iridescence:Bt,iridescenceMap:Ge,iridescenceThicknessMap:Oe,sheen:ne,sheenColorMap:Be,sheenRoughnessMap:Le,specularMap:ie,specularColorMap:Ke,specularIntensityMap:ri,transmission:oe,transmissionMap:Ti,thicknessMap:le,gradientMap:xi,opaque:A.transparent===!1&&A.blending===yu&&A.alphaToCoverage===!1,alphaMap:bt,alphaTest:Me,alphaHash:Ce,combine:A.combine,mapUv:ot&&f(A.map.channel),aoMapUv:yt&&f(A.aoMap.channel),lightMapUv:Et&&f(A.lightMap.channel),bumpMapUv:At&&f(A.bumpMap.channel),normalMapUv:Pt&&f(A.normalMap.channel),displacementMapUv:Vt&&f(A.displacementMap.channel),emissiveMapUv:dt&&f(A.emissiveMap.channel),metalnessMapUv:ut&&f(A.metalnessMap.channel),roughnessMapUv:Rt&&f(A.roughnessMap.channel),anisotropyMapUv:ge&&f(A.anisotropyMap.channel),clearcoatMapUv:xe&&f(A.clearcoatMap.channel),clearcoatNormalMapUv:Ae&&f(A.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:qt&&f(A.clearcoatRoughnessMap.channel),iridescenceMapUv:Ge&&f(A.iridescenceMap.channel),iridescenceThicknessMapUv:Oe&&f(A.iridescenceThicknessMap.channel),sheenColorMapUv:Be&&f(A.sheenColorMap.channel),sheenRoughnessMapUv:Le&&f(A.sheenRoughnessMap.channel),specularMapUv:ie&&f(A.specularMap.channel),specularColorMapUv:Ke&&f(A.specularColorMap.channel),specularIntensityMapUv:ri&&f(A.specularIntensityMap.channel),transmissionMapUv:Ti&&f(A.transmissionMap.channel),thicknessMapUv:le&&f(A.thicknessMap.channel),alphaMapUv:bt&&f(A.alphaMap.channel),vertexTangents:!!B.attributes.tangent&&(Pt||Dt),vertexColors:A.vertexColors,vertexAlphas:A.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,pointsUvs:I.isPoints===!0&&!!B.attributes.uv&&(ot||bt),fog:!!D,useFog:A.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:A.flatShading===!0,sizeAttenuation:A.sizeAttenuation===!0,logarithmicDepthBuffer:a,skinning:I.isSkinnedMesh===!0,morphTargets:B.morphAttributes.position!==void 0,morphNormals:B.morphAttributes.normal!==void 0,morphColors:B.morphAttributes.color!==void 0,morphTargetsCount:tt,morphTextureStride:Y,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:A.dithering,shadowMapEnabled:g.shadowMap.enabled&&b.length>0,shadowMapType:g.shadowMap.type,toneMapping:Je,useLegacyLights:g._useLegacyLights,decodeVideoTexture:ot&&A.map.isVideoTexture===!0&&rn.getTransfer(A.map.colorSpace)===vn,premultipliedAlpha:A.premultipliedAlpha,doubleSided:A.side===Oo,flipSided:A.side===ms,useDepthPacking:A.depthPacking>=0,depthPacking:A.depthPacking||0,index0AttributeName:A.index0AttributeName,extensionDerivatives:Ve&&A.extensions.derivatives===!0,extensionFragDepth:Ve&&A.extensions.fragDepth===!0,extensionDrawBuffers:Ve&&A.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ve&&A.extensions.shaderTextureLOD===!0,extensionClipCullDistance:Ve&&A.extensions.clipCullDistance===!0&&x.has("WEBGL_clip_cull_distance"),extensionMultiDraw:Ve&&A.extensions.multiDraw===!0&&x.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||x.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||x.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||x.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:x.has("KHR_parallel_shader_compile"),customProgramCacheKey:A.customProgramCacheKey()};return zi.vertexUv1s=r.has(1),zi.vertexUv2s=r.has(2),zi.vertexUv3s=r.has(3),r.clear(),zi}function c(A){const P=[];if(A.shaderID?P.push(A.shaderID):(P.push(A.customVertexShaderID),P.push(A.customFragmentShaderID)),A.defines!==void 0)for(const b in A.defines)P.push(b),P.push(A.defines[b]);return A.isRawShaderMaterial===!1&&(d(P,A),v(P,A),P.push(g.outputColorSpace)),P.push(A.customProgramCacheKey),P.join()}function d(A,P){A.push(P.precision),A.push(P.outputColorSpace),A.push(P.envMapMode),A.push(P.envMapCubeUVHeight),A.push(P.mapUv),A.push(P.alphaMapUv),A.push(P.lightMapUv),A.push(P.aoMapUv),A.push(P.bumpMapUv),A.push(P.normalMapUv),A.push(P.displacementMapUv),A.push(P.emissiveMapUv),A.push(P.metalnessMapUv),A.push(P.roughnessMapUv),A.push(P.anisotropyMapUv),A.push(P.clearcoatMapUv),A.push(P.clearcoatNormalMapUv),A.push(P.clearcoatRoughnessMapUv),A.push(P.iridescenceMapUv),A.push(P.iridescenceThicknessMapUv),A.push(P.sheenColorMapUv),A.push(P.sheenRoughnessMapUv),A.push(P.specularMapUv),A.push(P.specularColorMapUv),A.push(P.specularIntensityMapUv),A.push(P.transmissionMapUv),A.push(P.thicknessMapUv),A.push(P.combine),A.push(P.fogExp2),A.push(P.sizeAttenuation),A.push(P.morphTargetsCount),A.push(P.morphAttributeCount),A.push(P.numDirLights),A.push(P.numPointLights),A.push(P.numSpotLights),A.push(P.numSpotLightMaps),A.push(P.numHemiLights),A.push(P.numRectAreaLights),A.push(P.numDirLightShadows),A.push(P.numPointLightShadows),A.push(P.numSpotLightShadows),A.push(P.numSpotLightShadowsWithMaps),A.push(P.numLightProbes),A.push(P.shadowMapType),A.push(P.toneMapping),A.push(P.numClippingPlanes),A.push(P.numClipIntersection),A.push(P.depthPacking)}function v(A,P){y.disableAll(),P.isWebGL2&&y.enable(0),P.supportsVertexTextures&&y.enable(1),P.instancing&&y.enable(2),P.instancingColor&&y.enable(3),P.matcap&&y.enable(4),P.envMap&&y.enable(5),P.normalMapObjectSpace&&y.enable(6),P.normalMapTangentSpace&&y.enable(7),P.clearcoat&&y.enable(8),P.iridescence&&y.enable(9),P.alphaTest&&y.enable(10),P.vertexColors&&y.enable(11),P.vertexAlphas&&y.enable(12),P.vertexUv1s&&y.enable(13),P.vertexUv2s&&y.enable(14),P.vertexUv3s&&y.enable(15),P.vertexTangents&&y.enable(16),P.anisotropy&&y.enable(17),P.alphaHash&&y.enable(18),P.batching&&y.enable(19),A.push(y.mask),y.disableAll(),P.fog&&y.enable(0),P.useFog&&y.enable(1),P.flatShading&&y.enable(2),P.logarithmicDepthBuffer&&y.enable(3),P.skinning&&y.enable(4),P.morphTargets&&y.enable(5),P.morphNormals&&y.enable(6),P.morphColors&&y.enable(7),P.premultipliedAlpha&&y.enable(8),P.shadowMapEnabled&&y.enable(9),P.useLegacyLights&&y.enable(10),P.doubleSided&&y.enable(11),P.flipSided&&y.enable(12),P.useDepthPacking&&y.enable(13),P.dithering&&y.enable(14),P.transmission&&y.enable(15),P.sheen&&y.enable(16),P.opaque&&y.enable(17),P.pointsUvs&&y.enable(18),P.decodeVideoTexture&&y.enable(19),P.alphaToCoverage&&y.enable(20),A.push(y.mask)}function m(A){const P=u[A.type];let b;if(P){const O=to[P];b=pw.clone(O.uniforms)}else b=A.uniforms;return b}function S(A,P){let b;for(let O=0,I=p.length;O0?x.push(o):l.transparent===!0?T.push(o):i.push(o)}function e(h,a,l,n,u,f){const o=s(h,a,l,n,u,f);l.transmission>0?x.unshift(o):l.transparent===!0?T.unshift(o):i.unshift(o)}function r(h,a){i.length>1&&i.sort(h||A6),x.length>1&&x.sort(a||oE),T.length>1&&T.sort(a||oE)}function p(){for(let h=t,a=g.length;h=E.length?(s=new lE,E.push(s)):s=E[T],s}function i(){g=new WeakMap}return{get:t,dispose:i}}function R6(){const g={};return{get:function(t){if(g[t.id]!==void 0)return g[t.id];let i;switch(t.type){case"DirectionalLight":i={direction:new Ct,color:new ze};break;case"SpotLight":i={position:new Ct,direction:new Ct,color:new ze,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ct,color:new ze,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ct,skyColor:new ze,groundColor:new ze};break;case"RectAreaLight":i={color:new ze,position:new Ct,halfWidth:new Ct,halfHeight:new Ct};break}return g[t.id]=i,i}}}function b6(){const g={};return{get:function(t){if(g[t.id]!==void 0)return g[t.id];let i;switch(t.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ve,shadowCameraNear:1,shadowCameraFar:1e3};break}return g[t.id]=i,i}}}let L6=0;function F6(g,t){return(t.castShadow?2:0)-(g.castShadow?2:0)+(t.map?1:0)-(g.map?1:0)}function O6(g,t){const i=new R6,x=b6(),T={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)T.probe.push(new Ct);const E=new Ct,s=new ci,y=new ci;function e(p,h){let a=0,l=0,n=0;for(let b=0;b<9;b++)T.probe[b].set(0,0,0);let u=0,f=0,o=0,c=0,d=0,v=0,m=0,S=0,M=0,w=0,C=0;p.sort(F6);const A=h===!0?Math.PI:1;for(let b=0,O=p.length;b0&&(t.isWebGL2?g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_FLOAT_1,T.rectAreaLTC2=Fe.LTC_FLOAT_2):(T.rectAreaLTC1=Fe.LTC_HALF_1,T.rectAreaLTC2=Fe.LTC_HALF_2):g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_FLOAT_1,T.rectAreaLTC2=Fe.LTC_FLOAT_2):g.has("OES_texture_half_float_linear")===!0?(T.rectAreaLTC1=Fe.LTC_HALF_1,T.rectAreaLTC2=Fe.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),T.ambient[0]=a,T.ambient[1]=l,T.ambient[2]=n;const P=T.hash;(P.directionalLength!==u||P.pointLength!==f||P.spotLength!==o||P.rectAreaLength!==c||P.hemiLength!==d||P.numDirectionalShadows!==v||P.numPointShadows!==m||P.numSpotShadows!==S||P.numSpotMaps!==M||P.numLightProbes!==C)&&(T.directional.length=u,T.spot.length=o,T.rectArea.length=c,T.point.length=f,T.hemi.length=d,T.directionalShadow.length=v,T.directionalShadowMap.length=v,T.pointShadow.length=m,T.pointShadowMap.length=m,T.spotShadow.length=S,T.spotShadowMap.length=S,T.directionalShadowMatrix.length=v,T.pointShadowMatrix.length=m,T.spotLightMatrix.length=S+M-w,T.spotLightMap.length=M,T.numSpotLightShadowsWithMaps=w,T.numLightProbes=C,P.directionalLength=u,P.pointLength=f,P.spotLength=o,P.rectAreaLength=c,P.hemiLength=d,P.numDirectionalShadows=v,P.numPointShadows=m,P.numSpotShadows=S,P.numSpotMaps=M,P.numLightProbes=C,T.version=L6++)}function r(p,h){let a=0,l=0,n=0,u=0,f=0;const o=h.matrixWorldInverse;for(let c=0,d=p.length;c=y.length?(e=new hE(g,t),y.push(e)):e=y[s],e}function T(){i=new WeakMap}return{get:x,dispose:T}}class S1 extends Hr{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=q2,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class T1 extends Hr{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}const I6=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,N6=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function B6(g,t,i){let x=new _d;const T=new ve,E=new ve,s=new sn,y=new S1({depthPacking:tw}),e=new T1,r={},p=i.maxTextureSize,h={[Cl]:ms,[ms]:Cl,[Oo]:Oo},a=new no({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ve},radius:{value:4}},vertexShader:I6,fragmentShader:N6}),l=a.clone();l.defines.HORIZONTAL_PASS=1;const n=new Li;n.setAttribute("position",new an(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const u=new cr(n,a),f=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=ng;let o=this.type;this.render=function(S,M,w){if(f.enabled===!1||f.autoUpdate===!1&&f.needsUpdate===!1||S.length===0)return;const C=g.getRenderTarget(),A=g.getActiveCubeFace(),P=g.getActiveMipmapLevel(),b=g.state;b.setBlending(Ml),b.buffers.color.setClear(1,1,1,1),b.buffers.depth.setTest(!0),b.setScissorTest(!1);const O=o!==_a&&this.type===_a,I=o===_a&&this.type!==_a;for(let D=0,B=S.length;Dp||T.y>p)&&(T.x>p&&(E.x=Math.floor(p/X.x),T.x=E.x*X.x,z.mapSize.x=E.x),T.y>p&&(E.y=Math.floor(p/X.y),T.y=E.y*X.y,z.mapSize.y=E.y)),z.map===null||O===!0||I===!0){const Q=this.type!==_a?{minFilter:nr,magFilter:nr}:{};z.map!==null&&z.map.dispose(),z.map=new io(T.x,T.y,Q),z.map.texture.name=G.name+".shadowMap",z.camera.updateProjectionMatrix()}g.setRenderTarget(z.map),g.clear();const K=z.getViewportCount();for(let Q=0;Q0||M.map&&M.alphaTest>0){const b=A.uuid,O=M.uuid;let I=r[b];I===void 0&&(I={},r[b]=I);let D=I[O];D===void 0&&(D=A.clone(),I[O]=D,M.addEventListener("dispose",m)),A=D}if(A.visible=M.visible,A.wireframe=M.wireframe,C===_a?A.side=M.shadowSide!==null?M.shadowSide:M.side:A.side=M.shadowSide!==null?M.shadowSide:h[M.side],A.alphaMap=M.alphaMap,A.alphaTest=M.alphaTest,A.map=M.map,A.clipShadows=M.clipShadows,A.clippingPlanes=M.clippingPlanes,A.clipIntersection=M.clipIntersection,A.displacementMap=M.displacementMap,A.displacementScale=M.displacementScale,A.displacementBias=M.displacementBias,A.wireframeLinewidth=M.wireframeLinewidth,A.linewidth=M.linewidth,w.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const b=g.properties.get(A);b.light=w}return A}function v(S,M,w,C,A){if(S.visible===!1)return;if(S.layers.test(M.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&A===_a)&&(!S.frustumCulled||x.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(w.matrixWorldInverse,S.matrixWorld);const O=t.update(S),I=S.material;if(Array.isArray(I)){const D=O.groups;for(let B=0,G=D.length;B=1):K.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec(K)[1]),z=X>=2);let Q=null,tt={};const Y=g.getParameter(g.SCISSOR_BOX),Z=g.getParameter(g.VIEWPORT),U=new sn().fromArray(Y),H=new sn().fromArray(Z);function J(bt,Me,Ce,Ve){const Je=new Uint8Array(4),zi=g.createTexture();g.bindTexture(bt,zi),g.texParameteri(bt,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(bt,g.TEXTURE_MAG_FILTER,g.NEAREST);for(let Di=0;Di"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let h;const a=new WeakMap;let l=!1;try{l=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function n(dt,ut){return l?new OffscreenCanvas(dt,ut):Dd("canvas")}function u(dt,ut,Rt,Dt){let Ht=1;if((dt.width>Dt||dt.height>Dt)&&(Ht=Dt/Math.max(dt.width,dt.height)),Ht<1||ut===!0)if(typeof HTMLImageElement<"u"&&dt instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&dt instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&dt instanceof ImageBitmap){const Bt=ut?Tm:Math.floor,ne=Bt(Ht*dt.width),oe=Bt(Ht*dt.height);h===void 0&&(h=n(ne,oe));const ge=Rt?n(ne,oe):h;return ge.width=ne,ge.height=oe,ge.getContext("2d").drawImage(dt,0,0,ne,oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+dt.width+"x"+dt.height+") to ("+ne+"x"+oe+")."),ge}else return"data"in dt&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+dt.width+"x"+dt.height+")."),dt;return dt}function f(dt){return dx(dt.width)&&dx(dt.height)}function o(dt){return y?!1:dt.wrapS!==Jr||dt.wrapT!==Jr||dt.minFilter!==nr&&dt.minFilter!==Nn}function c(dt,ut){return dt.generateMipmaps&&ut&&dt.minFilter!==nr&&dt.minFilter!==Nn}function d(dt){g.generateMipmap(dt)}function v(dt,ut,Rt,Dt,Ht=!1){if(y===!1)return ut;if(dt!==null){if(g[dt]!==void 0)return g[dt];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+dt+"'")}let Bt=ut;if(ut===g.RED&&(Rt===g.FLOAT&&(Bt=g.R32F),Rt===g.HALF_FLOAT&&(Bt=g.R16F),Rt===g.UNSIGNED_BYTE&&(Bt=g.R8)),ut===g.RED_INTEGER&&(Rt===g.UNSIGNED_BYTE&&(Bt=g.R8UI),Rt===g.UNSIGNED_SHORT&&(Bt=g.R16UI),Rt===g.UNSIGNED_INT&&(Bt=g.R32UI),Rt===g.BYTE&&(Bt=g.R8I),Rt===g.SHORT&&(Bt=g.R16I),Rt===g.INT&&(Bt=g.R32I)),ut===g.RG&&(Rt===g.FLOAT&&(Bt=g.RG32F),Rt===g.HALF_FLOAT&&(Bt=g.RG16F),Rt===g.UNSIGNED_BYTE&&(Bt=g.RG8)),ut===g.RGBA){const ne=Ht?Rd:rn.getTransfer(Dt);Rt===g.FLOAT&&(Bt=g.RGBA32F),Rt===g.HALF_FLOAT&&(Bt=g.RGBA16F),Rt===g.UNSIGNED_BYTE&&(Bt=ne===vn?g.SRGB8_ALPHA8:g.RGBA8),Rt===g.UNSIGNED_SHORT_4_4_4_4&&(Bt=g.RGBA4),Rt===g.UNSIGNED_SHORT_5_5_5_1&&(Bt=g.RGB5_A1)}return(Bt===g.R16F||Bt===g.R32F||Bt===g.RG16F||Bt===g.RG32F||Bt===g.RGBA16F||Bt===g.RGBA32F)&&t.get("EXT_color_buffer_float"),Bt}function m(dt,ut,Rt){return c(dt,Rt)===!0||dt.isFramebufferTexture&&dt.minFilter!==nr&&dt.minFilter!==Nn?Math.log2(Math.max(ut.width,ut.height))+1:dt.mipmaps!==void 0&&dt.mipmaps.length>0?dt.mipmaps.length:dt.isCompressedTexture&&Array.isArray(dt.image)?ut.mipmaps.length:1}function S(dt){return dt===nr||dt===xm||dt===fu?g.NEAREST:g.LINEAR}function M(dt){const ut=dt.target;ut.removeEventListener("dispose",M),C(ut),ut.isVideoTexture&&p.delete(ut)}function w(dt){const ut=dt.target;ut.removeEventListener("dispose",w),P(ut)}function C(dt){const ut=x.get(dt);if(ut.__webglInit===void 0)return;const Rt=dt.source,Dt=a.get(Rt);if(Dt){const Ht=Dt[ut.__cacheKey];Ht.usedTimes--,Ht.usedTimes===0&&A(dt),Object.keys(Dt).length===0&&a.delete(Rt)}x.remove(dt)}function A(dt){const ut=x.get(dt);g.deleteTexture(ut.__webglTexture);const Rt=dt.source,Dt=a.get(Rt);delete Dt[ut.__cacheKey],s.memory.textures--}function P(dt){const ut=dt.texture,Rt=x.get(dt),Dt=x.get(ut);if(Dt.__webglTexture!==void 0&&(g.deleteTexture(Dt.__webglTexture),s.memory.textures--),dt.depthTexture&&dt.depthTexture.dispose(),dt.isWebGLCubeRenderTarget)for(let Ht=0;Ht<6;Ht++){if(Array.isArray(Rt.__webglFramebuffer[Ht]))for(let Bt=0;Bt=T.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+dt+" texture units while this GPU supports only "+T.maxTextures),b+=1,dt}function D(dt){const ut=[];return ut.push(dt.wrapS),ut.push(dt.wrapT),ut.push(dt.wrapR||0),ut.push(dt.magFilter),ut.push(dt.minFilter),ut.push(dt.anisotropy),ut.push(dt.internalFormat),ut.push(dt.format),ut.push(dt.type),ut.push(dt.generateMipmaps),ut.push(dt.premultiplyAlpha),ut.push(dt.flipY),ut.push(dt.unpackAlignment),ut.push(dt.colorSpace),ut.join()}function B(dt,ut){const Rt=x.get(dt);if(dt.isVideoTexture&&Pt(dt),dt.isRenderTargetTexture===!1&&dt.version>0&&Rt.__version!==dt.version){const Dt=dt.image;if(Dt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Dt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{U(Rt,dt,ut);return}}i.bindTexture(g.TEXTURE_2D,Rt.__webglTexture,g.TEXTURE0+ut)}function G(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){U(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_2D_ARRAY,Rt.__webglTexture,g.TEXTURE0+ut)}function z(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){U(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_3D,Rt.__webglTexture,g.TEXTURE0+ut)}function X(dt,ut){const Rt=x.get(dt);if(dt.version>0&&Rt.__version!==dt.version){H(Rt,dt,ut);return}i.bindTexture(g.TEXTURE_CUBE_MAP,Rt.__webglTexture,g.TEXTURE0+ut)}const K={[Md]:g.REPEAT,[Jr]:g.CLAMP_TO_EDGE,[Cd]:g.MIRRORED_REPEAT},Q={[nr]:g.NEAREST,[xm]:g.NEAREST_MIPMAP_NEAREST,[fu]:g.NEAREST_MIPMAP_LINEAR,[Nn]:g.LINEAR,[ud]:g.LINEAR_MIPMAP_NEAREST,[Io]:g.LINEAR_MIPMAP_LINEAR},tt={[iw]:g.NEVER,[lw]:g.ALWAYS,[nw]:g.LESS,[c1]:g.LEQUAL,[rw]:g.EQUAL,[ow]:g.GEQUAL,[sw]:g.GREATER,[aw]:g.NOTEQUAL};function Y(dt,ut,Rt){if(ut.type===Ea&&t.has("OES_texture_float_linear")===!1&&(ut.magFilter===Nn||ut.magFilter===ud||ut.magFilter===fu||ut.magFilter===Io||ut.minFilter===Nn||ut.minFilter===ud||ut.minFilter===fu||ut.minFilter===Io)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),Rt?(g.texParameteri(dt,g.TEXTURE_WRAP_S,K[ut.wrapS]),g.texParameteri(dt,g.TEXTURE_WRAP_T,K[ut.wrapT]),(dt===g.TEXTURE_3D||dt===g.TEXTURE_2D_ARRAY)&&g.texParameteri(dt,g.TEXTURE_WRAP_R,K[ut.wrapR]),g.texParameteri(dt,g.TEXTURE_MAG_FILTER,Q[ut.magFilter]),g.texParameteri(dt,g.TEXTURE_MIN_FILTER,Q[ut.minFilter])):(g.texParameteri(dt,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(dt,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),(dt===g.TEXTURE_3D||dt===g.TEXTURE_2D_ARRAY)&&g.texParameteri(dt,g.TEXTURE_WRAP_R,g.CLAMP_TO_EDGE),(ut.wrapS!==Jr||ut.wrapT!==Jr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),g.texParameteri(dt,g.TEXTURE_MAG_FILTER,S(ut.magFilter)),g.texParameteri(dt,g.TEXTURE_MIN_FILTER,S(ut.minFilter)),ut.minFilter!==nr&&ut.minFilter!==Nn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),ut.compareFunction&&(g.texParameteri(dt,g.TEXTURE_COMPARE_MODE,g.COMPARE_REF_TO_TEXTURE),g.texParameteri(dt,g.TEXTURE_COMPARE_FUNC,tt[ut.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){const Dt=t.get("EXT_texture_filter_anisotropic");if(ut.magFilter===nr||ut.minFilter!==fu&&ut.minFilter!==Io||ut.type===Ea&&t.has("OES_texture_float_linear")===!1||y===!1&&ut.type===Zf&&t.has("OES_texture_half_float_linear")===!1)return;(ut.anisotropy>1||x.get(ut).__currentAnisotropy)&&(g.texParameterf(dt,Dt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(ut.anisotropy,T.getMaxAnisotropy())),x.get(ut).__currentAnisotropy=ut.anisotropy)}}function Z(dt,ut){let Rt=!1;dt.__webglInit===void 0&&(dt.__webglInit=!0,ut.addEventListener("dispose",M));const Dt=ut.source;let Ht=a.get(Dt);Ht===void 0&&(Ht={},a.set(Dt,Ht));const Bt=D(ut);if(Bt!==dt.__cacheKey){Ht[Bt]===void 0&&(Ht[Bt]={texture:g.createTexture(),usedTimes:0},s.memory.textures++,Rt=!0),Ht[Bt].usedTimes++;const ne=Ht[dt.__cacheKey];ne!==void 0&&(Ht[dt.__cacheKey].usedTimes--,ne.usedTimes===0&&A(ut)),dt.__cacheKey=Bt,dt.__webglTexture=Ht[Bt].texture}return Rt}function U(dt,ut,Rt){let Dt=g.TEXTURE_2D;(ut.isDataArrayTexture||ut.isCompressedArrayTexture)&&(Dt=g.TEXTURE_2D_ARRAY),ut.isData3DTexture&&(Dt=g.TEXTURE_3D);const Ht=Z(dt,ut),Bt=ut.source;i.bindTexture(Dt,dt.__webglTexture,g.TEXTURE0+Rt);const ne=x.get(Bt);if(Bt.version!==ne.__version||Ht===!0){i.activeTexture(g.TEXTURE0+Rt);const oe=rn.getPrimaries(rn.workingColorSpace),ge=ut.colorSpace===ea?null:rn.getPrimaries(ut.colorSpace),xe=ut.colorSpace===ea||oe===ge?g.NONE:g.BROWSER_DEFAULT_WEBGL;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,ut.flipY),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ut.premultiplyAlpha),g.pixelStorei(g.UNPACK_ALIGNMENT,ut.unpackAlignment),g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,xe);const Ae=o(ut)&&f(ut.image)===!1;let qt=u(ut.image,Ae,!1,T.maxTextureSize);qt=Vt(ut,qt);const Ge=f(qt)||y,Oe=E.convert(ut.format,ut.colorSpace);let Be=E.convert(ut.type),Le=v(ut.internalFormat,Oe,Be,ut.colorSpace,ut.isVideoTexture);Y(Dt,ut,Ge);let ie;const Ke=ut.mipmaps,ri=y&&ut.isVideoTexture!==!0&&Le!==h1,Ti=ne.__version===void 0||Ht===!0,le=Bt.dataReady,xi=m(ut,qt,Ge);if(ut.isDepthTexture)Le=g.DEPTH_COMPONENT,y?ut.type===Ea?Le=g.DEPTH_COMPONENT32F:ut.type===xl?Le=g.DEPTH_COMPONENT24:ut.type===uh?Le=g.DEPTH24_STENCIL8:Le=g.DEPTH_COMPONENT16:ut.type===Ea&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),ut.format===fh&&Le===g.DEPTH_COMPONENT&&ut.type!==sg&&ut.type!==xl&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),ut.type=xl,Be=E.convert(ut.type)),ut.format===Pu&&Le===g.DEPTH_COMPONENT&&(Le=g.DEPTH_STENCIL,ut.type!==uh&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),ut.type=uh,Be=E.convert(ut.type))),Ti&&(ri?i.texStorage2D(g.TEXTURE_2D,1,Le,qt.width,qt.height):i.texImage2D(g.TEXTURE_2D,0,Le,qt.width,qt.height,0,Oe,Be,null));else if(ut.isDataTexture)if(Ke.length>0&&Ge){ri&&Ti&&i.texStorage2D(g.TEXTURE_2D,xi,Le,Ke[0].width,Ke[0].height);for(let bt=0,Me=Ke.length;bt>=1,Me>>=1}}else if(Ke.length>0&&Ge){ri&&Ti&&i.texStorage2D(g.TEXTURE_2D,xi,Le,Ke[0].width,Ke[0].height);for(let bt=0,Me=Ke.length;bt0&&le++,i.texStorage2D(g.TEXTURE_CUBE_MAP,le,ie,qt[0].width,qt[0].height));for(let bt=0;bt<6;bt++)if(Ae){Ke?Ti&&i.texSubImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,0,0,qt[bt].width,qt[bt].height,Be,Le,qt[bt].data):i.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+bt,0,ie,qt[bt].width,qt[bt].height,0,Be,Le,qt[bt].data);for(let Me=0;Me>Bt),qt=Math.max(1,ut.height>>Bt);Ht===g.TEXTURE_3D||Ht===g.TEXTURE_2D_ARRAY?i.texImage3D(Ht,Bt,ge,Ae,qt,ut.depth,0,ne,oe,null):i.texImage2D(Ht,Bt,ge,Ae,qt,0,ne,oe,null)}i.bindFramebuffer(g.FRAMEBUFFER,dt),At(ut)?e.framebufferTexture2DMultisampleEXT(g.FRAMEBUFFER,Dt,Ht,x.get(Rt).__webglTexture,0,Et(ut)):(Ht===g.TEXTURE_2D||Ht>=g.TEXTURE_CUBE_MAP_POSITIVE_X&&Ht<=g.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&g.framebufferTexture2D(g.FRAMEBUFFER,Dt,Ht,x.get(Rt).__webglTexture,Bt),i.bindFramebuffer(g.FRAMEBUFFER,null)}function _(dt,ut,Rt){if(g.bindRenderbuffer(g.RENDERBUFFER,dt),ut.depthBuffer&&!ut.stencilBuffer){let Dt=y===!0?g.DEPTH_COMPONENT24:g.DEPTH_COMPONENT16;if(Rt||At(ut)){const Ht=ut.depthTexture;Ht&&Ht.isDepthTexture&&(Ht.type===Ea?Dt=g.DEPTH_COMPONENT32F:Ht.type===xl&&(Dt=g.DEPTH_COMPONENT24));const Bt=Et(ut);At(ut)?e.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Bt,Dt,ut.width,ut.height):g.renderbufferStorageMultisample(g.RENDERBUFFER,Bt,Dt,ut.width,ut.height)}else g.renderbufferStorage(g.RENDERBUFFER,Dt,ut.width,ut.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,dt)}else if(ut.depthBuffer&&ut.stencilBuffer){const Dt=Et(ut);Rt&&At(ut)===!1?g.renderbufferStorageMultisample(g.RENDERBUFFER,Dt,g.DEPTH24_STENCIL8,ut.width,ut.height):At(ut)?e.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Dt,g.DEPTH24_STENCIL8,ut.width,ut.height):g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_STENCIL,ut.width,ut.height),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_STENCIL_ATTACHMENT,g.RENDERBUFFER,dt)}else{const Dt=ut.isWebGLMultipleRenderTargets===!0?ut.texture:[ut.texture];for(let Ht=0;Ht0){Rt.__webglFramebuffer[oe]=[];for(let ge=0;ge0){Rt.__webglFramebuffer=[];for(let oe=0;oe0&&At(dt)===!1){const oe=Bt?ut:[ut];Rt.__webglMultisampledFramebuffer=g.createFramebuffer(),Rt.__webglColorRenderbuffer=[],i.bindFramebuffer(g.FRAMEBUFFER,Rt.__webglMultisampledFramebuffer);for(let ge=0;ge0)for(let ge=0;ge0)for(let ge=0;ge0&&At(dt)===!1){const ut=dt.isWebGLMultipleRenderTargets?dt.texture:[dt.texture],Rt=dt.width,Dt=dt.height;let Ht=g.COLOR_BUFFER_BIT;const Bt=[],ne=dt.stencilBuffer?g.DEPTH_STENCIL_ATTACHMENT:g.DEPTH_ATTACHMENT,oe=x.get(dt),ge=dt.isWebGLMultipleRenderTargets===!0;if(ge)for(let xe=0;xe0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&ut.__useRenderToTexture!==!1}function Pt(dt){const ut=s.render.frame;p.get(dt)!==ut&&(p.set(dt,ut),dt.update())}function Vt(dt,ut){const Rt=dt.colorSpace,Dt=dt.format,Ht=dt.type;return dt.isCompressedTexture===!0||dt.isVideoTexture===!0||dt.format===Sm||Rt!==Go&&Rt!==ea&&(rn.getTransfer(Rt)===vn?y===!1?t.has("EXT_sRGB")===!0&&Dt===ps?(dt.format=Sm,dt.minFilter=Nn,dt.generateMipmaps=!1):ut=p1.sRGBToLinear(ut):(Dt!==ps||Ht!==Uo)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Rt)),ut}this.allocateTextureUnit=I,this.resetTextureUnits=O,this.setTexture2D=B,this.setTexture2DArray=G,this.setTexture3D=z,this.setTextureCube=X,this.rebindTextures=ot,this.setupRenderTarget=rt,this.updateRenderTargetMipmap=gt,this.updateMultisampleRenderTarget=yt,this.setupDepthRenderbuffer=at,this.setupFrameBufferTexture=J,this.useMultisampledRTT=At}function Mw(g,t,i){const x=i.isWebGL2;function T(E,s=ea){let y;const e=rn.getTransfer(s);if(E===Uo)return g.UNSIGNED_BYTE;if(E===r1)return g.UNSIGNED_SHORT_4_4_4_4;if(E===s1)return g.UNSIGNED_SHORT_5_5_5_1;if(E===W2)return g.BYTE;if(E===X2)return g.SHORT;if(E===sg)return g.UNSIGNED_SHORT;if(E===n1)return g.INT;if(E===xl)return g.UNSIGNED_INT;if(E===Ea)return g.FLOAT;if(E===Zf)return x?g.HALF_FLOAT:(y=t.get("OES_texture_half_float"),y!==null?y.HALF_FLOAT_OES:null);if(E===Y2)return g.ALPHA;if(E===ps)return g.RGBA;if(E===k2)return g.LUMINANCE;if(E===K2)return g.LUMINANCE_ALPHA;if(E===fh)return g.DEPTH_COMPONENT;if(E===Pu)return g.DEPTH_STENCIL;if(E===Sm)return y=t.get("EXT_sRGB"),y!==null?y.SRGB_ALPHA_EXT:null;if(E===j2)return g.RED;if(E===a1)return g.RED_INTEGER;if(E===Z2)return g.RG;if(E===o1)return g.RG_INTEGER;if(E===l1)return g.RGBA_INTEGER;if(E===em||E===im||E===nm||E===rm)if(e===vn)if(y=t.get("WEBGL_compressed_texture_s3tc_srgb"),y!==null){if(E===em)return y.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(E===im)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(E===nm)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(E===rm)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(y=t.get("WEBGL_compressed_texture_s3tc"),y!==null){if(E===em)return y.COMPRESSED_RGB_S3TC_DXT1_EXT;if(E===im)return y.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(E===nm)return y.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(E===rm)return y.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(E===Vy||E===Hy||E===Wy||E===Xy)if(y=t.get("WEBGL_compressed_texture_pvrtc"),y!==null){if(E===Vy)return y.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(E===Hy)return y.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(E===Wy)return y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(E===Xy)return y.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(E===h1)return y=t.get("WEBGL_compressed_texture_etc1"),y!==null?y.COMPRESSED_RGB_ETC1_WEBGL:null;if(E===Yy||E===ky)if(y=t.get("WEBGL_compressed_texture_etc"),y!==null){if(E===Yy)return e===vn?y.COMPRESSED_SRGB8_ETC2:y.COMPRESSED_RGB8_ETC2;if(E===ky)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:y.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(E===Ky||E===jy||E===Zy||E===Jy||E===$y||E===Qy||E===_y||E===qy||E===tx||E===ex||E===ix||E===nx||E===rx||E===sx)if(y=t.get("WEBGL_compressed_texture_astc"),y!==null){if(E===Ky)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:y.COMPRESSED_RGBA_ASTC_4x4_KHR;if(E===jy)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:y.COMPRESSED_RGBA_ASTC_5x4_KHR;if(E===Zy)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:y.COMPRESSED_RGBA_ASTC_5x5_KHR;if(E===Jy)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:y.COMPRESSED_RGBA_ASTC_6x5_KHR;if(E===$y)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:y.COMPRESSED_RGBA_ASTC_6x6_KHR;if(E===Qy)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:y.COMPRESSED_RGBA_ASTC_8x5_KHR;if(E===_y)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:y.COMPRESSED_RGBA_ASTC_8x6_KHR;if(E===qy)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:y.COMPRESSED_RGBA_ASTC_8x8_KHR;if(E===tx)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:y.COMPRESSED_RGBA_ASTC_10x5_KHR;if(E===ex)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:y.COMPRESSED_RGBA_ASTC_10x6_KHR;if(E===ix)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:y.COMPRESSED_RGBA_ASTC_10x8_KHR;if(E===nx)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:y.COMPRESSED_RGBA_ASTC_10x10_KHR;if(E===rx)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:y.COMPRESSED_RGBA_ASTC_12x10_KHR;if(E===sx)return e===vn?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:y.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(E===sm||E===ax||E===ox)if(y=t.get("EXT_texture_compression_bptc"),y!==null){if(E===sm)return e===vn?y.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:y.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(E===ax)return y.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(E===ox)return y.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(E===J2||E===lx||E===hx||E===ux)if(y=t.get("EXT_texture_compression_rgtc"),y!==null){if(E===sm)return y.COMPRESSED_RED_RGTC1_EXT;if(E===lx)return y.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(E===hx)return y.COMPRESSED_RED_GREEN_RGTC2_EXT;if(E===ux)return y.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return E===uh?x?g.UNSIGNED_INT_24_8:(y=t.get("WEBGL_depth_texture"),y!==null?y.UNSIGNED_INT_24_8_WEBGL:null):g[E]!==void 0?g[E]:null}return{convert:T}}class Cw extends Or{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}class Gf extends Yi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const G6={type:"move"};class H0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Gf,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Gf,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ct,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ct),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Gf,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ct,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ct),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const i=this._hand;if(i)for(const x of t.hand.values())this._getHandJoint(i,x)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,x){let T=null,E=null,s=null;const y=this._targetRay,e=this._grip,r=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(r&&t.hand){s=!0;for(const u of t.hand.values()){const f=i.getJointPose(u,x),o=this._getHandJoint(r,u);f!==null&&(o.matrix.fromArray(f.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,o.jointRadius=f.radius),o.visible=f!==null}const p=r.joints["index-finger-tip"],h=r.joints["thumb-tip"],a=p.position.distanceTo(h.position),l=.02,n=.005;r.inputState.pinching&&a>l+n?(r.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!r.inputState.pinching&&a<=l-n&&(r.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else e!==null&&t.gripSpace&&(E=i.getPose(t.gripSpace,x),E!==null&&(e.matrix.fromArray(E.transform.matrix),e.matrix.decompose(e.position,e.rotation,e.scale),e.matrixWorldNeedsUpdate=!0,E.linearVelocity?(e.hasLinearVelocity=!0,e.linearVelocity.copy(E.linearVelocity)):e.hasLinearVelocity=!1,E.angularVelocity?(e.hasAngularVelocity=!0,e.angularVelocity.copy(E.angularVelocity)):e.hasAngularVelocity=!1));y!==null&&(T=i.getPose(t.targetRaySpace,x),T===null&&E!==null&&(T=E),T!==null&&(y.matrix.fromArray(T.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,T.linearVelocity?(y.hasLinearVelocity=!0,y.linearVelocity.copy(T.linearVelocity)):y.hasLinearVelocity=!1,T.angularVelocity?(y.hasAngularVelocity=!0,y.angularVelocity.copy(T.angularVelocity)):y.hasAngularVelocity=!1,this.dispatchEvent(G6)))}return y!==null&&(y.visible=T!==null),e!==null&&(e.visible=E!==null),r!==null&&(r.visible=s!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){const x=new Gf;x.matrixAutoUpdate=!1,x.visible=!1,t.joints[i.jointName]=x,t.add(x)}return t.joints[i.jointName]}}const V6=` +void main() { + + gl_Position = vec4( position, 1.0 ); + +}`,H6=` +uniform sampler2DArray depthColor; +uniform float depthWidth; +uniform float depthHeight; + +void main() { + + vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); + + if ( coord.x >= 1.0 ) { + + gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; + + } else { + + gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; + + } + +}`;class W6{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i,x){if(this.texture===null){const T=new Un,E=t.properties.get(T);E.__webglTexture=i.texture,(i.depthNear!=x.depthNear||i.depthFar!=x.depthFar)&&(this.depthNear=i.depthNear,this.depthFar=i.depthFar),this.texture=T}}render(t,i){if(this.texture!==null){if(this.mesh===null){const x=i.cameras[0].viewport,T=new no({extensions:{fragDepth:!0},vertexShader:V6,fragmentShader:H6,uniforms:{depthColor:{value:this.texture},depthWidth:{value:x.z},depthHeight:{value:x.w}}});this.mesh=new cr(new nc(20,20),T)}t.render(this.mesh,i)}}reset(){this.texture=null,this.mesh=null}}class X6 extends Pl{constructor(t,i){super();const x=this;let T=null,E=1,s=null,y="local-floor",e=1,r=null,p=null,h=null,a=null,l=null,n=null;const u=new W6,f=i.getContextAttributes();let o=null,c=null;const d=[],v=[],m=new ve;let S=null;const M=new Or;M.layers.enable(1),M.viewport=new sn;const w=new Or;w.layers.enable(2),w.viewport=new sn;const C=[M,w],A=new Cw;A.layers.enable(1),A.layers.enable(2);let P=null,b=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(Z){let U=d[Z];return U===void 0&&(U=new H0,d[Z]=U),U.getTargetRaySpace()},this.getControllerGrip=function(Z){let U=d[Z];return U===void 0&&(U=new H0,d[Z]=U),U.getGripSpace()},this.getHand=function(Z){let U=d[Z];return U===void 0&&(U=new H0,d[Z]=U),U.getHandSpace()};function O(Z){const U=v.indexOf(Z.inputSource);if(U===-1)return;const H=d[U];H!==void 0&&(H.update(Z.inputSource,Z.frame,r||s),H.dispatchEvent({type:Z.type,data:Z.inputSource}))}function I(){T.removeEventListener("select",O),T.removeEventListener("selectstart",O),T.removeEventListener("selectend",O),T.removeEventListener("squeeze",O),T.removeEventListener("squeezestart",O),T.removeEventListener("squeezeend",O),T.removeEventListener("end",I),T.removeEventListener("inputsourceschange",D);for(let Z=0;Z=0&&(v[J]=null,d[J].disconnect(H))}for(let U=0;U=v.length){v.push(H),J=q;break}else if(v[q]===null){v[q]=H,J=q;break}if(J===-1)break}const _=d[J];_&&_.connect(H)}}const B=new Ct,G=new Ct;function z(Z,U,H){B.setFromMatrixPosition(U.matrixWorld),G.setFromMatrixPosition(H.matrixWorld);const J=B.distanceTo(G),_=U.projectionMatrix.elements,q=H.projectionMatrix.elements,at=_[14]/(_[10]-1),ot=_[14]/(_[10]+1),rt=(_[9]+1)/_[5],gt=(_[9]-1)/_[5],yt=(_[8]-1)/_[0],Et=(q[8]+1)/q[0],At=at*yt,Pt=at*Et,Vt=J/(-yt+Et),dt=Vt*-yt;U.matrixWorld.decompose(Z.position,Z.quaternion,Z.scale),Z.translateX(dt),Z.translateZ(Vt),Z.matrixWorld.compose(Z.position,Z.quaternion,Z.scale),Z.matrixWorldInverse.copy(Z.matrixWorld).invert();const ut=at+Vt,Rt=ot+Vt,Dt=At-dt,Ht=Pt+(J-dt),Bt=rt*ot/Rt*ut,ne=gt*ot/Rt*ut;Z.projectionMatrix.makePerspective(Dt,Ht,Bt,ne,ut,Rt),Z.projectionMatrixInverse.copy(Z.projectionMatrix).invert()}function X(Z,U){U===null?Z.matrixWorld.copy(Z.matrix):Z.matrixWorld.multiplyMatrices(U.matrixWorld,Z.matrix),Z.matrixWorldInverse.copy(Z.matrixWorld).invert()}this.updateCamera=function(Z){if(T===null)return;u.texture!==null&&(Z.near=u.depthNear,Z.far=u.depthFar),A.near=w.near=M.near=Z.near,A.far=w.far=M.far=Z.far,(P!==A.near||b!==A.far)&&(T.updateRenderState({depthNear:A.near,depthFar:A.far}),P=A.near,b=A.far,M.near=P,M.far=b,w.near=P,w.far=b,M.updateProjectionMatrix(),w.updateProjectionMatrix(),Z.updateProjectionMatrix());const U=Z.parent,H=A.cameras;X(A,U);for(let J=0;J0&&(f.alphaTest.value=o.alphaTest);const c=t.get(o).envMap;if(c&&(f.envMap.value=c,f.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1,f.reflectivity.value=o.reflectivity,f.ior.value=o.ior,f.refractionRatio.value=o.refractionRatio),o.lightMap){f.lightMap.value=o.lightMap;const d=g._useLegacyLights===!0?Math.PI:1;f.lightMapIntensity.value=o.lightMapIntensity*d,i(o.lightMap,f.lightMapTransform)}o.aoMap&&(f.aoMap.value=o.aoMap,f.aoMapIntensity.value=o.aoMapIntensity,i(o.aoMap,f.aoMapTransform))}function s(f,o){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,o.map&&(f.map.value=o.map,i(o.map,f.mapTransform))}function y(f,o){f.dashSize.value=o.dashSize,f.totalSize.value=o.dashSize+o.gapSize,f.scale.value=o.scale}function e(f,o,c,d){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,f.size.value=o.size*c,f.scale.value=d*.5,o.map&&(f.map.value=o.map,i(o.map,f.uvTransform)),o.alphaMap&&(f.alphaMap.value=o.alphaMap,i(o.alphaMap,f.alphaMapTransform)),o.alphaTest>0&&(f.alphaTest.value=o.alphaTest)}function r(f,o){f.diffuse.value.copy(o.color),f.opacity.value=o.opacity,f.rotation.value=o.rotation,o.map&&(f.map.value=o.map,i(o.map,f.mapTransform)),o.alphaMap&&(f.alphaMap.value=o.alphaMap,i(o.alphaMap,f.alphaMapTransform)),o.alphaTest>0&&(f.alphaTest.value=o.alphaTest)}function p(f,o){f.specular.value.copy(o.specular),f.shininess.value=Math.max(o.shininess,1e-4)}function h(f,o){o.gradientMap&&(f.gradientMap.value=o.gradientMap)}function a(f,o){f.metalness.value=o.metalness,o.metalnessMap&&(f.metalnessMap.value=o.metalnessMap,i(o.metalnessMap,f.metalnessMapTransform)),f.roughness.value=o.roughness,o.roughnessMap&&(f.roughnessMap.value=o.roughnessMap,i(o.roughnessMap,f.roughnessMapTransform)),t.get(o).envMap&&(f.envMapIntensity.value=o.envMapIntensity)}function l(f,o,c){f.ior.value=o.ior,o.sheen>0&&(f.sheenColor.value.copy(o.sheenColor).multiplyScalar(o.sheen),f.sheenRoughness.value=o.sheenRoughness,o.sheenColorMap&&(f.sheenColorMap.value=o.sheenColorMap,i(o.sheenColorMap,f.sheenColorMapTransform)),o.sheenRoughnessMap&&(f.sheenRoughnessMap.value=o.sheenRoughnessMap,i(o.sheenRoughnessMap,f.sheenRoughnessMapTransform))),o.clearcoat>0&&(f.clearcoat.value=o.clearcoat,f.clearcoatRoughness.value=o.clearcoatRoughness,o.clearcoatMap&&(f.clearcoatMap.value=o.clearcoatMap,i(o.clearcoatMap,f.clearcoatMapTransform)),o.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=o.clearcoatRoughnessMap,i(o.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),o.clearcoatNormalMap&&(f.clearcoatNormalMap.value=o.clearcoatNormalMap,i(o.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(o.clearcoatNormalScale),o.side===ms&&f.clearcoatNormalScale.value.negate())),o.iridescence>0&&(f.iridescence.value=o.iridescence,f.iridescenceIOR.value=o.iridescenceIOR,f.iridescenceThicknessMinimum.value=o.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=o.iridescenceThicknessRange[1],o.iridescenceMap&&(f.iridescenceMap.value=o.iridescenceMap,i(o.iridescenceMap,f.iridescenceMapTransform)),o.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=o.iridescenceThicknessMap,i(o.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),o.transmission>0&&(f.transmission.value=o.transmission,f.transmissionSamplerMap.value=c.texture,f.transmissionSamplerSize.value.set(c.width,c.height),o.transmissionMap&&(f.transmissionMap.value=o.transmissionMap,i(o.transmissionMap,f.transmissionMapTransform)),f.thickness.value=o.thickness,o.thicknessMap&&(f.thicknessMap.value=o.thicknessMap,i(o.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=o.attenuationDistance,f.attenuationColor.value.copy(o.attenuationColor)),o.anisotropy>0&&(f.anisotropyVector.value.set(o.anisotropy*Math.cos(o.anisotropyRotation),o.anisotropy*Math.sin(o.anisotropyRotation)),o.anisotropyMap&&(f.anisotropyMap.value=o.anisotropyMap,i(o.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=o.specularIntensity,f.specularColor.value.copy(o.specularColor),o.specularColorMap&&(f.specularColorMap.value=o.specularColorMap,i(o.specularColorMap,f.specularColorMapTransform)),o.specularIntensityMap&&(f.specularIntensityMap.value=o.specularIntensityMap,i(o.specularIntensityMap,f.specularIntensityMapTransform))}function n(f,o){o.matcap&&(f.matcap.value=o.matcap)}function u(f,o){const c=t.get(o).light;f.referencePosition.value.setFromMatrixPosition(c.matrixWorld),f.nearDistance.value=c.shadow.camera.near,f.farDistance.value=c.shadow.camera.far}return{refreshFogUniforms:x,refreshMaterialUniforms:T}}function k6(g,t,i,x){let T={},E={},s=[];const y=i.isWebGL2?g.getParameter(g.MAX_UNIFORM_BUFFER_BINDINGS):0;function e(c,d){const v=d.program;x.uniformBlockBinding(c,v)}function r(c,d){let v=T[c.id];v===void 0&&(n(c),v=p(c),T[c.id]=v,c.addEventListener("dispose",f));const m=d.program;x.updateUBOMapping(c,m);const S=t.render.frame;E[c.id]!==S&&(a(c),E[c.id]=S)}function p(c){const d=h();c.__bindingPointIndex=d;const v=g.createBuffer(),m=c.__size,S=c.usage;return g.bindBuffer(g.UNIFORM_BUFFER,v),g.bufferData(g.UNIFORM_BUFFER,m,S),g.bindBuffer(g.UNIFORM_BUFFER,null),g.bindBufferBase(g.UNIFORM_BUFFER,d,v),v}function h(){for(let c=0;c0&&(v+=m-S),c.__size=v,c.__cache={},this}function u(c){const d={boundary:0,storage:0};return typeof c=="number"||typeof c=="boolean"?(d.boundary=4,d.storage=4):c.isVector2?(d.boundary=8,d.storage=8):c.isVector3||c.isColor?(d.boundary=16,d.storage=12):c.isVector4?(d.boundary=16,d.storage=16):c.isMatrix3?(d.boundary=48,d.storage=48):c.isMatrix4?(d.boundary=64,d.storage=64):c.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",c),d}function f(c){const d=c.target;d.removeEventListener("dispose",f);const v=s.indexOf(d.__bindingPointIndex);s.splice(v,1),g.deleteBuffer(T[d.id]),delete T[d.id],delete E[d.id]}function o(){for(const c in T)g.deleteBuffer(T[c]);s=[],T={},E={}}return{bind:e,update:r,dispose:o}}class E1{constructor(t={}){const{canvas:i=uw(),context:x=null,depth:T=!0,stencil:E=!0,alpha:s=!1,antialias:y=!1,premultipliedAlpha:e=!0,preserveDrawingBuffer:r=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:h=!1}=t;this.isWebGLRenderer=!0;let a;x!==null?a=x.getContextAttributes().alpha:a=s;const l=new Uint32Array(4),n=new Int32Array(4);let u=null,f=null;const o=[],c=[];this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=vr,this._useLegacyLights=!1,this.toneMapping=Bo,this.toneMappingExposure=1;const d=this;let v=!1,m=0,S=0,M=null,w=-1,C=null;const A=new sn,P=new sn;let b=null;const O=new ze(0);let I=0,D=i.width,B=i.height,G=1,z=null,X=null;const K=new sn(0,0,D,B),Q=new sn(0,0,D,B);let tt=!1;const Y=new _d;let Z=!1,U=!1,H=null;const J=new ci,_=new ve,q=new Ct,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return M===null?G:1}let rt=x;function gt(Tt,jt){for(let _t=0;_t{function Te(){if(ee.forEach(function(Ue){Vt.get(Ue).currentProgram.isReady()&&ee.delete(Ue)}),ee.size===0){te(Tt);return}setTimeout(Te,10)}yt.get("KHR_parallel_shader_compile")!==null?Te():setTimeout(Te,10)})};let Di=null;function en(Tt){Di&&Di(Tt)}function Zn(){di.stop()}function Gi(){di.start()}const di=new gw;di.setAnimationLoop(en),typeof self<"u"&&di.setContext(self),this.setAnimationLoop=function(Tt){Di=Tt,le.setAnimationLoop(Tt),Tt===null?di.stop():di.start()},le.addEventListener("sessionstart",Zn),le.addEventListener("sessionend",Gi),this.render=function(Tt,jt){if(jt!==void 0&&jt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(v===!0)return;Tt.matrixWorldAutoUpdate===!0&&Tt.updateMatrixWorld(),jt.parent===null&&jt.matrixWorldAutoUpdate===!0&&jt.updateMatrixWorld(),le.enabled===!0&&le.isPresenting===!0&&(le.cameraAutoUpdate===!0&&le.updateCamera(jt),jt=le.getCamera()),Tt.isScene===!0&&Tt.onBeforeRender(d,Tt,jt,M),f=xe.get(Tt,c.length),f.init(),c.push(f),J.multiplyMatrices(jt.projectionMatrix,jt.matrixWorldInverse),Y.setFromProjectionMatrix(J),U=this.localClippingEnabled,Z=Ae.init(this.clippingPlanes,U),u=ge.get(Tt,o.length),u.init(),o.push(u),Wi(Tt,jt,0,d.sortObjects),u.finish(),d.sortObjects===!0&&u.sort(z,X),this.info.render.frame++,Z===!0&&Ae.beginShadows();const _t=f.state.shadowsArray;if(qt.render(_t,Tt,jt),Z===!0&&Ae.endShadows(),this.info.autoReset===!0&&this.info.reset(),(le.enabled===!1||le.isPresenting===!1||le.hasDepthSensing()===!1)&&Ge.render(u,Tt),f.setupLights(d._useLegacyLights),jt.isArrayCamera){const ee=jt.cameras;for(let te=0,Te=ee.length;te0?f=c[c.length-1]:f=null,o.pop(),o.length>0?u=o[o.length-1]:u=null};function Wi(Tt,jt,_t,ee){if(Tt.visible===!1)return;if(Tt.layers.test(jt.layers)){if(Tt.isGroup)_t=Tt.renderOrder;else if(Tt.isLOD)Tt.autoUpdate===!0&&Tt.update(jt);else if(Tt.isLight)f.pushLight(Tt),Tt.castShadow&&f.pushShadow(Tt);else if(Tt.isSprite){if(!Tt.frustumCulled||Y.intersectsSprite(Tt)){ee&&q.setFromMatrixPosition(Tt.matrixWorld).applyMatrix4(J);const Ue=Bt.update(Tt),We=Tt.material;We.visible&&u.push(Tt,Ue,We,_t,q.z,null)}}else if((Tt.isMesh||Tt.isLine||Tt.isPoints)&&(!Tt.frustumCulled||Y.intersectsObject(Tt))){const Ue=Bt.update(Tt),We=Tt.material;if(ee&&(Tt.boundingSphere!==void 0?(Tt.boundingSphere===null&&Tt.computeBoundingSphere(),q.copy(Tt.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),q.copy(Ue.boundingSphere.center)),q.applyMatrix4(Tt.matrixWorld).applyMatrix4(J)),Array.isArray(We)){const $e=Ue.groups;for(let qe=0,ii=$e.length;qe0&&aa(te,Te,jt,_t),ee&&At.viewport(A.copy(ee)),te.length>0&&Bs(te,jt,_t),Te.length>0&&Bs(Te,jt,_t),Ue.length>0&&Bs(Ue,jt,_t),At.buffers.depth.setTest(!0),At.buffers.depth.setMask(!0),At.buffers.color.setMask(!0),At.setPolygonOffset(!1)}function aa(Tt,jt,_t,ee){if((_t.isScene===!0?_t.overrideMaterial:null)!==null)return;const Te=Et.isWebGL2;H===null&&(H=new io(1,1,{generateMipmaps:!0,type:yt.has("EXT_color_buffer_half_float")?Zf:Uo,minFilter:Io,samples:Te?4:0})),d.getDrawingBufferSize(_),Te?H.setSize(_.x,_.y):H.setSize(Tm(_.x),Tm(_.y));const Ue=d.getRenderTarget();d.setRenderTarget(H),d.getClearColor(O),I=d.getClearAlpha(),I<1&&d.setClearColor(16777215,.5),d.clear();const We=d.toneMapping;d.toneMapping=Bo,Bs(Tt,_t,ee),dt.updateMultisampleRenderTarget(H),dt.updateRenderTargetMipmap(H);let $e=!1;for(let qe=0,ii=jt.length;qe0),ai=!!_t.morphAttributes.position,Ji=!!_t.morphAttributes.normal,hn=!!_t.morphAttributes.color;let ki=Bo;ee.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(ki=d.toneMapping);const mn=_t.morphAttributes.position||_t.morphAttributes.normal||_t.morphAttributes.color,ti=mn!==void 0?mn.length:0,Se=Vt.get(ee),Nr=f.state.lights;if(Z===!0&&(U===!0||Tt!==C)){const Tn=Tt===C&&ee.id===w;Ae.setState(ee,Tt,Tn)}let mi=!1;ee.version===Se.__version?(Se.needsLights&&Se.lightsStateVersion!==Nr.state.version||Se.outputColorSpace!==We||te.isBatchedMesh&&Se.batching===!1||!te.isBatchedMesh&&Se.batching===!0||te.isInstancedMesh&&Se.instancing===!1||!te.isInstancedMesh&&Se.instancing===!0||te.isSkinnedMesh&&Se.skinning===!1||!te.isSkinnedMesh&&Se.skinning===!0||te.isInstancedMesh&&Se.instancingColor===!0&&te.instanceColor===null||te.isInstancedMesh&&Se.instancingColor===!1&&te.instanceColor!==null||Se.envMap!==$e||ee.fog===!0&&Se.fog!==Te||Se.numClippingPlanes!==void 0&&(Se.numClippingPlanes!==Ae.numPlanes||Se.numIntersection!==Ae.numIntersection)||Se.vertexAlphas!==qe||Se.vertexTangents!==ii||Se.morphTargets!==ai||Se.morphNormals!==Ji||Se.morphColors!==hn||Se.toneMapping!==ki||Et.isWebGL2===!0&&Se.morphTargetsCount!==ti)&&(mi=!0):(mi=!0,Se.__version=ee.version);let un=Se.currentProgram;mi===!0&&(un=ao(ee,jt,te));let Ii=!1,Gn=!1,pn=!1;const Ki=un.getUniforms(),dr=Se.uniforms;if(At.useProgram(un.program)&&(Ii=!0,Gn=!0,pn=!0),ee.id!==w&&(w=ee.id,Gn=!0),Ii||C!==Tt){Ki.setValue(rt,"projectionMatrix",Tt.projectionMatrix),Ki.setValue(rt,"viewMatrix",Tt.matrixWorldInverse);const Tn=Ki.map.cameraPosition;Tn!==void 0&&Tn.setValue(rt,q.setFromMatrixPosition(Tt.matrixWorld)),Et.logarithmicDepthBuffer&&Ki.setValue(rt,"logDepthBufFC",2/(Math.log(Tt.far+1)/Math.LN2)),(ee.isMeshPhongMaterial||ee.isMeshToonMaterial||ee.isMeshLambertMaterial||ee.isMeshBasicMaterial||ee.isMeshStandardMaterial||ee.isShaderMaterial)&&Ki.setValue(rt,"isOrthographic",Tt.isOrthographicCamera===!0),C!==Tt&&(C=Tt,Gn=!0,pn=!0)}if(te.isSkinnedMesh){Ki.setOptional(rt,te,"bindMatrix"),Ki.setOptional(rt,te,"bindMatrixInverse");const Tn=te.skeleton;Tn&&(Et.floatVertexTextures?(Tn.boneTexture===null&&Tn.computeBoneTexture(),Ki.setValue(rt,"boneTexture",Tn.boneTexture,dt)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}te.isBatchedMesh&&(Ki.setOptional(rt,te,"batchingTexture"),Ki.setValue(rt,"batchingTexture",te._matricesTexture,dt));const zs=_t.morphAttributes;if((zs.position!==void 0||zs.normal!==void 0||zs.color!==void 0&&Et.isWebGL2===!0)&&Oe.update(te,_t,un),(Gn||Se.receiveShadow!==te.receiveShadow)&&(Se.receiveShadow=te.receiveShadow,Ki.setValue(rt,"receiveShadow",te.receiveShadow)),ee.isMeshGouraudMaterial&&ee.envMap!==null&&(dr.envMap.value=$e,dr.flipEnvMap.value=$e.isCubeTexture&&$e.isRenderTargetTexture===!1?-1:1),Gn&&(Ki.setValue(rt,"toneMappingExposure",d.toneMappingExposure),Se.needsLights&&oo(dr,pn),Te&&ee.fog===!0&&oe.refreshFogUniforms(dr,Te),oe.refreshMaterialUniforms(dr,ee,G,B,H),lm.upload(rt,_r(Se),dr,dt)),ee.isShaderMaterial&&ee.uniformsNeedUpdate===!0&&(lm.upload(rt,_r(Se),dr,dt),ee.uniformsNeedUpdate=!1),ee.isSpriteMaterial&&Ki.setValue(rt,"center",te.center),Ki.setValue(rt,"modelViewMatrix",te.modelViewMatrix),Ki.setValue(rt,"normalMatrix",te.normalMatrix),Ki.setValue(rt,"modelMatrix",te.matrixWorld),ee.isShaderMaterial||ee.isRawShaderMaterial){const Tn=ee.uniformsGroups;for(let oa=0,Jn=Tn.length;oa0&&dt.useMultisampledRTT(Tt)===!1?te=Vt.get(Tt).__webglMultisampledFramebuffer:Array.isArray(ii)?te=ii[_t]:te=ii,A.copy(Tt.viewport),P.copy(Tt.scissor),b=Tt.scissorTest}else A.copy(K).multiplyScalar(G).floor(),P.copy(Q).multiplyScalar(G).floor(),b=tt;if(At.bindFramebuffer(rt.FRAMEBUFFER,te)&&Et.drawBuffers&&ee&&At.drawBuffers(Tt,te),At.viewport(A),At.scissor(P),At.setScissorTest(b),Te){const $e=Vt.get(Tt.texture);rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+jt,$e.__webglTexture,_t)}else if(Ue){const $e=Vt.get(Tt.texture),qe=jt||0;rt.framebufferTextureLayer(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,$e.__webglTexture,_t||0,qe)}w=-1},this.readRenderTargetPixels=function(Tt,jt,_t,ee,te,Te,Ue){if(!(Tt&&Tt.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let We=Vt.get(Tt).__webglFramebuffer;if(Tt.isWebGLCubeRenderTarget&&Ue!==void 0&&(We=We[Ue]),We){At.bindFramebuffer(rt.FRAMEBUFFER,We);try{const $e=Tt.texture,qe=$e.format,ii=$e.type;if(qe!==ps&&ie.convert(qe)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ai=ii===Zf&&(yt.has("EXT_color_buffer_half_float")||Et.isWebGL2&&yt.has("EXT_color_buffer_float"));if(ii!==Uo&&ie.convert(ii)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ii===Ea&&(Et.isWebGL2||yt.has("OES_texture_float")||yt.has("WEBGL_color_buffer_float")))&&!ai){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}jt>=0&&jt<=Tt.width-ee&&_t>=0&&_t<=Tt.height-te&&rt.readPixels(jt,_t,ee,te,ie.convert(qe),ie.convert(ii),Te)}finally{const $e=M!==null?Vt.get(M).__webglFramebuffer:null;At.bindFramebuffer(rt.FRAMEBUFFER,$e)}}},this.copyFramebufferToTexture=function(Tt,jt,_t=0){const ee=Math.pow(2,-_t),te=Math.floor(jt.image.width*ee),Te=Math.floor(jt.image.height*ee);dt.setTexture2D(jt,0),rt.copyTexSubImage2D(rt.TEXTURE_2D,_t,0,0,Tt.x,Tt.y,te,Te),At.unbindTexture()},this.copyTextureToTexture=function(Tt,jt,_t,ee=0){const te=jt.image.width,Te=jt.image.height,Ue=ie.convert(_t.format),We=ie.convert(_t.type);dt.setTexture2D(_t,0),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,_t.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_t.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,_t.unpackAlignment),jt.isDataTexture?rt.texSubImage2D(rt.TEXTURE_2D,ee,Tt.x,Tt.y,te,Te,Ue,We,jt.image.data):jt.isCompressedTexture?rt.compressedTexSubImage2D(rt.TEXTURE_2D,ee,Tt.x,Tt.y,jt.mipmaps[0].width,jt.mipmaps[0].height,Ue,jt.mipmaps[0].data):rt.texSubImage2D(rt.TEXTURE_2D,ee,Tt.x,Tt.y,Ue,We,jt.image),ee===0&&_t.generateMipmaps&&rt.generateMipmap(rt.TEXTURE_2D),At.unbindTexture()},this.copyTextureToTexture3D=function(Tt,jt,_t,ee,te=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Te=Tt.max.x-Tt.min.x+1,Ue=Tt.max.y-Tt.min.y+1,We=Tt.max.z-Tt.min.z+1,$e=ie.convert(ee.format),qe=ie.convert(ee.type);let ii;if(ee.isData3DTexture)dt.setTexture3D(ee,0),ii=rt.TEXTURE_3D;else if(ee.isDataArrayTexture||ee.isCompressedArrayTexture)dt.setTexture2DArray(ee,0),ii=rt.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,ee.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ee.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,ee.unpackAlignment);const ai=rt.getParameter(rt.UNPACK_ROW_LENGTH),Ji=rt.getParameter(rt.UNPACK_IMAGE_HEIGHT),hn=rt.getParameter(rt.UNPACK_SKIP_PIXELS),ki=rt.getParameter(rt.UNPACK_SKIP_ROWS),mn=rt.getParameter(rt.UNPACK_SKIP_IMAGES),ti=_t.isCompressedTexture?_t.mipmaps[te]:_t.image;rt.pixelStorei(rt.UNPACK_ROW_LENGTH,ti.width),rt.pixelStorei(rt.UNPACK_IMAGE_HEIGHT,ti.height),rt.pixelStorei(rt.UNPACK_SKIP_PIXELS,Tt.min.x),rt.pixelStorei(rt.UNPACK_SKIP_ROWS,Tt.min.y),rt.pixelStorei(rt.UNPACK_SKIP_IMAGES,Tt.min.z),_t.isDataTexture||_t.isData3DTexture?rt.texSubImage3D(ii,te,jt.x,jt.y,jt.z,Te,Ue,We,$e,qe,ti.data):_t.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),rt.compressedTexSubImage3D(ii,te,jt.x,jt.y,jt.z,Te,Ue,We,$e,ti.data)):rt.texSubImage3D(ii,te,jt.x,jt.y,jt.z,Te,Ue,We,$e,qe,ti),rt.pixelStorei(rt.UNPACK_ROW_LENGTH,ai),rt.pixelStorei(rt.UNPACK_IMAGE_HEIGHT,Ji),rt.pixelStorei(rt.UNPACK_SKIP_PIXELS,hn),rt.pixelStorei(rt.UNPACK_SKIP_ROWS,ki),rt.pixelStorei(rt.UNPACK_SKIP_IMAGES,mn),te===0&&ee.generateMipmaps&&rt.generateMipmap(ii),At.unbindTexture()},this.initTexture=function(Tt){Tt.isCubeTexture?dt.setTextureCube(Tt,0):Tt.isData3DTexture?dt.setTexture3D(Tt,0):Tt.isDataArrayTexture||Tt.isCompressedArrayTexture?dt.setTexture2DArray(Tt,0):dt.setTexture2D(Tt,0),At.unbindTexture()},this.resetState=function(){m=0,S=0,M=null,At.reset(),Ke.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return No}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=t===og?"display-p3":"srgb",i.unpackColorSpace=rn.workingColorSpace===Jd?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===vr?ch:f1}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===ch?vr:Go}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}class ww extends E1{}ww.prototype.isWebGL1Renderer=!0;class ug{constructor(t,i=25e-5){this.isFogExp2=!0,this.name="",this.color=new ze(t),this.density=i}clone(){return new ug(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class fg{constructor(t,i=1,x=1e3){this.isFog=!0,this.name="",this.color=new ze(t),this.near=i,this.far=x}clone(){return new fg(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Em extends Yi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i}}class cg{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=Fd,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=na()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return Su("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,i){this.updateRanges.push({start:t,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,x){t*=this.stride,x*=i.stride;for(let T=0,E=this.stride;Tt.far||i.push({distance:e,point:jc.clone(),uv:ia.getInterpolation(jc,Ev,Jc,Mv,uE,W0,fE,new ve),face:null,object:this})}copy(t,i){return super.copy(t,i),t.center!==void 0&&this.center.copy(t.center),this.material=t.material,this}}function Cv(g,t,i,x,T,E){Af.subVectors(g,i).addScalar(.5).multiply(x),T!==void 0?(Zc.x=E*Af.x-T*Af.y,Zc.y=T*Af.x+E*Af.y):Zc.copy(Af),g.copy(t),g.x+=Zc.x,g.y+=Zc.y,g.applyMatrix4(Aw)}const wv=new Ct,cE=new Ct;class Rw extends Yi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const i=t.levels;for(let x=0,T=i.length;x0){let x,T;for(x=1,T=i.length;x0){wv.setFromMatrixPosition(this.matrixWorld);const T=t.ray.origin.distanceTo(wv);this.getObjectForDistance(T).raycast(t,i)}}update(t){const i=this.levels;if(i.length>1){wv.setFromMatrixPosition(t.matrixWorld),cE.setFromMatrixPosition(this.matrixWorld);const x=wv.distanceTo(cE)/t.zoom;i[0].object.visible=!0;let T,E;for(T=1,E=i.length;T=s)i[T-1].object.visible=!1,i[T].object.visible=!0;else break}for(this._currentLevel=T-1;T=x.length&&x.push({start:-1,count:-1,z:-1});const E=x[this.index];T.push(E),this.index++,E.start=t.start,E.count=t.count,E.z=i}reset(){this.list.length=0,this.index=0}}const Rf="batchId",rh=new ci,TE=new ci,_6=new ci,EE=new ci,k0=new _d,Rv=new gs,tu=new $r,_c=new Ct,K0=new Q6,jr=new cr,bv=[];function q6(g,t,i=0){const x=t.itemSize;if(g.isInterleavedBufferAttribute||g.array.constructor!==t.array.constructor){const T=g.count;for(let E=0;E65536?new Uint32Array(E):new Uint16Array(E);i.setIndex(new an(y,1))}const s=T>65536?new Uint32Array(x):new Uint16Array(x);i.setAttribute(Rf,new an(s,1)),this._geometryInitialized=!0}}_validateGeometry(t){if(t.getAttribute(Rf))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Rf}"`);const i=this.geometry;if(!!t.getIndex()!=!!i.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const x in i.attributes){if(x===Rf)continue;if(!t.hasAttribute(x))throw new Error(`BatchedMesh: Added geometry missing "${x}". All geometries must have consistent attributes.`);const T=t.getAttribute(x),E=i.getAttribute(x);if(T.itemSize!==E.itemSize||T.normalized!==E.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(t){return this.customSort=t,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new gs);const t=this._geometryCount,i=this.boundingBox,x=this._active;i.makeEmpty();for(let T=0;T=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const T={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let E=null;const s=this._reservedRanges,y=this._drawRanges,e=this._bounds;this._geometryCount!==0&&(E=s[s.length-1]),i===-1?T.vertexCount=t.getAttribute("position").count:T.vertexCount=i,E===null?T.vertexStart=0:T.vertexStart=E.vertexStart+E.vertexCount;const r=t.getIndex(),p=r!==null;if(p&&(x===-1?T.indexCount=r.count:T.indexCount=x,E===null?T.indexStart=0:T.indexStart=E.indexStart+E.indexCount),T.indexStart!==-1&&T.indexStart+T.indexCount>this._maxIndexCount||T.vertexStart+T.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,a=this._active,l=this._matricesTexture,n=this._matricesTexture.image.data;h.push(!0),a.push(!0);const u=this._geometryCount;this._geometryCount++,_6.toArray(n,u*16),l.needsUpdate=!0,s.push(T),y.push({start:p?T.indexStart:T.vertexStart,count:-1}),e.push({boxInitialized:!1,box:new gs,sphereInitialized:!1,sphere:new $r});const f=this.geometry.getAttribute(Rf);for(let o=0;o=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(i);const x=this.geometry,T=x.getIndex()!==null,E=x.getIndex(),s=i.getIndex(),y=this._reservedRanges[t];if(T&&s.count>y.indexCount||i.attributes.position.count>y.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const e=y.vertexStart,r=y.vertexCount;for(const l in x.attributes){if(l===Rf)continue;const n=i.getAttribute(l),u=x.getAttribute(l);q6(n,u,e);const f=n.itemSize;for(let o=n.count,c=r;o=i.length||i[t]===!1?this:(i[t]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(t,i){if(this._active[t]===!1)return null;const T=this._bounds[t],E=T.box,s=this.geometry;if(T.boxInitialized===!1){E.makeEmpty();const y=s.index,e=s.attributes.position,r=this._drawRanges[t];for(let p=r.start,h=r.start+r.count;p=s||x[t]===!1?this:(i.toArray(E,t*16),T.needsUpdate=!0,this)}getMatrixAt(t,i){const x=this._active,T=this._matricesTexture.image.data,E=this._geometryCount;return t>=E||x[t]===!1?null:i.fromArray(T,t*16)}setVisibleAt(t,i){const x=this._visibility,T=this._active,E=this._geometryCount;return t>=E||T[t]===!1||x[t]===i?this:(x[t]=i,this._visibilityChanged=!0,this)}getVisibleAt(t){const i=this._visibility,x=this._active,T=this._geometryCount;return t>=T||x[t]===!1?!1:i[t]}raycast(t,i){const x=this._visibility,T=this._active,E=this._drawRanges,s=this._geometryCount,y=this.matrixWorld,e=this.geometry;jr.material=this.material,jr.geometry.index=e.index,jr.geometry.attributes=e.attributes,jr.geometry.boundingBox===null&&(jr.geometry.boundingBox=new gs),jr.geometry.boundingSphere===null&&(jr.geometry.boundingSphere=new $r);for(let r=0;r({...i})),this._reservedRanges=t._reservedRanges.map(i=>({...i})),this._visibility=t._visibility.slice(),this._active=t._active.slice(),this._bounds=t._bounds.map(i=>({boxInitialized:i.boxInitialized,box:i.box.clone(),sphereInitialized:i.sphereInitialized,sphere:i.sphere.clone()})),this._maxGeometryCount=t._maxGeometryCount,this._maxVertexCount=t._maxVertexCount,this._maxIndexCount=t._maxIndexCount,this._geometryInitialized=t._geometryInitialized,this._geometryCount=t._geometryCount,this._multiDrawCounts=t._multiDrawCounts.slice(),this._multiDrawStarts=t._multiDrawStarts.slice(),this._matricesTexture=t._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(t,i,x,T,E){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const s=T.getIndex(),y=s===null?1:s.array.BYTES_PER_ELEMENT,e=this._active,r=this._visibility,p=this._multiDrawStarts,h=this._multiDrawCounts,a=this._drawRanges,l=this.perObjectFrustumCulled;l&&(EE.multiplyMatrices(x.projectionMatrix,x.matrixWorldInverse).multiply(this.matrixWorld),k0.setFromProjectionMatrix(EE,t.coordinateSystem));let n=0;if(this.sortObjects){TE.copy(this.matrixWorld).invert(),_c.setFromMatrixPosition(x.matrixWorld).applyMatrix4(TE);for(let o=0,c=r.length;oe)continue;a.applyMatrix4(this.matrixWorld);const w=t.ray.origin.distanceTo(a);wt.far||i.push({distance:w,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}else{const o=Math.max(0,s.start),c=Math.min(f.count,s.start+s.count);for(let d=o,v=c-1;de)continue;a.applyMatrix4(this.matrixWorld);const S=t.ray.origin.distanceTo(a);St.far||i.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const i=this.geometry.morphAttributes,x=Object.keys(i);if(x.length>0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;E0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,s=T.length;ET.far)return;E.push({distance:r,distanceToRay:Math.sqrt(y),point:e,index:t,face:null,object:s})}}class tU extends Un{constructor(t,i,x,T,E,s,y,e,r){super(t,i,x,T,E,s,y,e,r),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Nn,this.magFilter=E!==void 0?E:Nn,this.generateMipmaps=!1;const p=this;function h(){p.needsUpdate=!0,t.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;"requestVideoFrameCallback"in t===!1&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class eU extends Un{constructor(t,i){super({width:t,height:i}),this.isFramebufferTexture=!0,this.magFilter=nr,this.minFilter=nr,this.generateMipmaps=!1,this.needsUpdate=!0}}class pg extends Un{constructor(t,i,x,T,E,s,y,e,r,p,h,a){super(null,s,y,e,r,p,T,E,h,a),this.isCompressedTexture=!0,this.image={width:i,height:x},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}class iU extends pg{constructor(t,i,x,T,E,s){super(t,i,x,E,s),this.isCompressedArrayTexture=!0,this.image.depth=T,this.wrapR=Jr}}class nU extends pg{constructor(t,i,x){super(void 0,t[0].width,t[0].height,i,x,wl),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=t}}class rU extends Un{constructor(t,i,x,T,E,s,y,e,r){super(t,i,x,T,E,s,y,e,r),this.isCanvasTexture=!0,this.needsUpdate=!0}}class ro{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,i){const x=this.getUtoTmapping(t);return this.getPoint(x,i)}getPoints(t=5){const i=[];for(let x=0;x<=t;x++)i.push(this.getPoint(x/t));return i}getSpacedPoints(t=5){const i=[];for(let x=0;x<=t;x++)i.push(this.getPointAt(x/t));return i}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const i=[];let x,T=this.getPoint(0),E=0;i.push(0);for(let s=1;s<=t;s++)x=this.getPoint(s/t),E+=x.distanceTo(T),i.push(E),T=x;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,i){const x=this.getLengths();let T=0;const E=x.length;let s;i?s=i:s=t*x[E-1];let y=0,e=E-1,r;for(;y<=e;)if(T=Math.floor(y+(e-y)/2),r=x[T]-s,r<0)y=T+1;else if(r>0)e=T-1;else{e=T;break}if(T=e,x[T]===s)return T/(E-1);const p=x[T],a=x[T+1]-p,l=(s-p)/a;return(T+l)/(E-1)}getTangent(t,i){let T=t-1e-4,E=t+1e-4;T<0&&(T=0),E>1&&(E=1);const s=this.getPoint(T),y=this.getPoint(E),e=i||(s.isVector2?new ve:new Ct);return e.copy(y).sub(s).normalize(),e}getTangentAt(t,i){const x=this.getUtoTmapping(t);return this.getTangent(x,i)}computeFrenetFrames(t,i){const x=new Ct,T=[],E=[],s=[],y=new Ct,e=new ci;for(let l=0;l<=t;l++){const n=l/t;T[l]=this.getTangentAt(n,new Ct)}E[0]=new Ct,s[0]=new Ct;let r=Number.MAX_VALUE;const p=Math.abs(T[0].x),h=Math.abs(T[0].y),a=Math.abs(T[0].z);p<=r&&(r=p,x.set(1,0,0)),h<=r&&(r=h,x.set(0,1,0)),a<=r&&x.set(0,0,1),y.crossVectors(T[0],x).normalize(),E[0].crossVectors(T[0],y),s[0].crossVectors(T[0],E[0]);for(let l=1;l<=t;l++){if(E[l]=E[l-1].clone(),s[l]=s[l-1].clone(),y.crossVectors(T[l-1],T[l]),y.length()>Number.EPSILON){y.normalize();const n=Math.acos(jn(T[l-1].dot(T[l]),-1,1));E[l].applyMatrix4(e.makeRotationAxis(y,n))}s[l].crossVectors(T[l],E[l])}if(i===!0){let l=Math.acos(jn(E[0].dot(E[t]),-1,1));l/=t,T[0].dot(y.crossVectors(E[0],E[t]))>0&&(l=-l);for(let n=1;n<=t;n++)E[n].applyMatrix4(e.makeRotationAxis(T[n],l*n)),s[n].crossVectors(T[n],E[n])}return{tangents:T,normals:E,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class vg extends ro{constructor(t=0,i=0,x=1,T=1,E=0,s=Math.PI*2,y=!1,e=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=i,this.xRadius=x,this.yRadius=T,this.aStartAngle=E,this.aEndAngle=s,this.aClockwise=y,this.aRotation=e}getPoint(t,i){const x=i||new ve,T=Math.PI*2;let E=this.aEndAngle-this.aStartAngle;const s=Math.abs(E)T;)E-=T;E0?0:(Math.floor(Math.abs(y)/E)+1)*E:e===0&&y===E-1&&(y=E-2,e=1);let r,p;this.closed||y>0?r=T[(y-1)%E]:(Dv.subVectors(T[0],T[1]).add(T[0]),r=Dv);const h=T[y%E],a=T[(y+1)%E];if(this.closed||y+2T.length-2?T.length-1:s+1],h=T[s>T.length-3?T.length-1:s+2];return x.set(LE(y,e.x,r.x,p.x,h.x),LE(y,e.y,r.y,p.y,h.y)),x}copy(t){super.copy(t),this.points=[];for(let i=0,x=t.points.length;i=x){const s=T[E]-x,y=this.curves[E],e=y.getLength(),r=e===0?0:1-s/e;return y.getPointAt(r,i)}E++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let i=0;for(let x=0,T=this.curves.length;x1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let i=0,x=t.curves.length;i0){const h=r.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(r);const p=r.getPoint(1);return this.currentPoint.copy(p),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class tp extends Li{constructor(t=[new ve(0,-.5),new ve(.5,0),new ve(0,.5)],i=12,x=0,T=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:i,phiStart:x,phiLength:T},i=Math.floor(i),T=jn(T,0,Math.PI*2);const E=[],s=[],y=[],e=[],r=[],p=1/i,h=new Ct,a=new ve,l=new Ct,n=new Ct,u=new Ct;let f=0,o=0;for(let c=0;c<=t.length-1;c++)switch(c){case 0:f=t[c+1].x-t[c].x,o=t[c+1].y-t[c].y,l.x=o*1,l.y=-f,l.z=o*0,u.copy(l),l.normalize(),e.push(l.x,l.y,l.z);break;case t.length-1:e.push(u.x,u.y,u.z);break;default:f=t[c+1].x-t[c].x,o=t[c+1].y-t[c].y,l.x=o*1,l.y=-f,l.z=o*0,n.copy(l),l.x+=u.x,l.y+=u.y,l.z+=u.z,l.normalize(),e.push(l.x,l.y,l.z),u.copy(n)}for(let c=0;c<=i;c++){const d=x+c*p*T,v=Math.sin(d),m=Math.cos(d);for(let S=0;S<=t.length-1;S++){h.x=t[S].x*v,h.y=t[S].y,h.z=t[S].x*m,s.push(h.x,h.y,h.z),a.x=c/i,a.y=S/(t.length-1),y.push(a.x,a.y);const M=e[3*S+0]*v,w=e[3*S+1],C=e[3*S+0]*m;r.push(M,w,C)}}for(let c=0;c0&&d(!0),i>0&&d(!1)),this.setIndex(p),this.setAttribute("position",new ke(h,3)),this.setAttribute("normal",new ke(a,3)),this.setAttribute("uv",new ke(l,2));function c(){const v=new Ct,m=new Ct;let S=0;const M=(i-t)/x;for(let w=0;w<=E;w++){const C=[],A=w/E,P=A*(i-t)+t;for(let b=0;b<=T;b++){const O=b/T,I=O*e+y,D=Math.sin(I),B=Math.cos(I);m.x=P*D,m.y=-A*x+f,m.z=P*B,h.push(m.x,m.y,m.z),v.set(D,M,B).normalize(),a.push(v.x,v.y,v.z),l.push(O,1-A),C.push(n++)}u.push(C)}for(let w=0;w.9&&M<.1&&(d<.2&&(s[c+0]+=1),v<.2&&(s[c+2]+=1),m<.2&&(s[c+4]+=1))}}function a(c){E.push(c.x,c.y,c.z)}function l(c,d){const v=c*3;d.x=t[v+0],d.y=t[v+1],d.z=t[v+2]}function n(){const c=new Ct,d=new Ct,v=new Ct,m=new Ct,S=new ve,M=new ve,w=new ve;for(let C=0,A=0;C80*i){y=r=g[0],e=p=g[1];for(let n=i;nr&&(r=h),a>p&&(p=a);l=Math.max(r-y,p-e),l=l!==0?32767/l:0}return Nd(E,s,i,y,e,l,0),s}};function Vw(g,t,i,x,T){let E,s;if(T===RU(g,t,i,x)>0)for(E=t;E=t;E-=x)s=FE(E,g[E],g[E+1],s);return s&&Sg(s,s.next)&&(Ud(s),s=s.next),s}function bu(g,t){if(!g)return g;t||(t=g);let i=g,x;do if(x=!1,!i.steiner&&(Sg(i,i.next)||Bn(i.prev,i,i.next)===0)){if(Ud(i),i=t=i.prev,i===i.next)break;x=!0}else i=i.next;while(x||i!==t);return t}function Nd(g,t,i,x,T,E,s){if(!g)return;!s&&E&&EU(g,x,T,E);let y=g,e,r;for(;g.prev!==g.next;){if(e=g.prev,r=g.next,E?pU(g,x,T,E):dU(g)){t.push(e.i/i|0),t.push(g.i/i|0),t.push(r.i/i|0),Ud(g),g=r.next,y=r.next;continue}if(g=r,g===y){s?s===1?(g=vU(bu(g),t,i),Nd(g,t,i,x,T,E,2)):s===2&&mU(g,t,i,x,T,E):Nd(bu(g),t,i,x,T,E,1);break}}}function dU(g){const t=g.prev,i=g,x=g.next;if(Bn(t,i,x)>=0)return!1;const T=t.x,E=i.x,s=x.x,y=t.y,e=i.y,r=x.y,p=TE?T>s?T:s:E>s?E:s,l=y>e?y>r?y:r:e>r?e:r;let n=x.next;for(;n!==t;){if(n.x>=p&&n.x<=a&&n.y>=h&&n.y<=l&&Vf(T,y,E,e,s,r,n.x,n.y)&&Bn(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function pU(g,t,i,x){const T=g.prev,E=g,s=g.next;if(Bn(T,E,s)>=0)return!1;const y=T.x,e=E.x,r=s.x,p=T.y,h=E.y,a=s.y,l=ye?y>r?y:r:e>r?e:r,f=p>h?p>a?p:a:h>a?h:a,o=gx(l,n,t,i,x),c=gx(u,f,t,i,x);let d=g.prevZ,v=g.nextZ;for(;d&&d.z>=o&&v&&v.z<=c;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==s&&Vf(y,p,e,h,r,a,d.x,d.y)&&Bn(d.prev,d,d.next)>=0||(d=d.prevZ,v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==s&&Vf(y,p,e,h,r,a,v.x,v.y)&&Bn(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;d&&d.z>=o;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==s&&Vf(y,p,e,h,r,a,d.x,d.y)&&Bn(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;v&&v.z<=c;){if(v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==s&&Vf(y,p,e,h,r,a,v.x,v.y)&&Bn(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function vU(g,t,i){let x=g;do{const T=x.prev,E=x.next.next;!Sg(T,E)&&Hw(T,x,x.next,E)&&Bd(T,E)&&Bd(E,T)&&(t.push(T.i/i|0),t.push(x.i/i|0),t.push(E.i/i|0),Ud(x),Ud(x.next),x=g=E),x=x.next}while(x!==g);return bu(x)}function mU(g,t,i,x,T,E){let s=g;do{let y=s.next.next;for(;y!==s.prev;){if(s.i!==y.i&&wU(s,y)){let e=Ww(s,y);s=bu(s,s.next),e=bu(e,e.next),Nd(s,t,i,x,T,E,0),Nd(e,t,i,x,T,E,0);return}y=y.next}s=s.next}while(s!==g)}function gU(g,t,i,x){const T=[];let E,s,y,e,r;for(E=0,s=t.length;E=i.next.y&&i.next.y!==i.y){const a=i.x+(s-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=E&&a>x&&(x=a,T=i.x=i.x&&i.x>=e&&E!==i.x&&Vf(sT.x||i.x===T.x&&TU(T,i)))&&(T=i,p=h)),i=i.next;while(i!==y);return T}function TU(g,t){return Bn(g.prev,g,t.prev)<0&&Bn(t.next,g,g.next)<0}function EU(g,t,i,x){let T=g;do T.z===0&&(T.z=gx(T.x,T.y,t,i,x)),T.prevZ=T.prev,T.nextZ=T.next,T=T.next;while(T!==g);T.prevZ.nextZ=null,T.prevZ=null,MU(T)}function MU(g){let t,i,x,T,E,s,y,e,r=1;do{for(i=g,g=null,E=null,s=0;i;){for(s++,x=i,y=0,t=0;t0||e>0&&x;)y!==0&&(e===0||!x||i.z<=x.z)?(T=i,i=i.nextZ,y--):(T=x,x=x.nextZ,e--),E?E.nextZ=T:g=T,T.prevZ=E,E=T;i=x}E.nextZ=null,r*=2}while(s>1);return g}function gx(g,t,i,x,T){return g=(g-i)*T|0,t=(t-x)*T|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,g|t<<1}function CU(g){let t=g,i=g;do(t.x=(g-s)*(E-y)&&(g-s)*(x-y)>=(i-s)*(t-y)&&(i-s)*(E-y)>=(T-s)*(x-y)}function wU(g,t){return g.next.i!==t.i&&g.prev.i!==t.i&&!AU(g,t)&&(Bd(g,t)&&Bd(t,g)&&PU(g,t)&&(Bn(g.prev,g,t.prev)||Bn(g,t.prev,t))||Sg(g,t)&&Bn(g.prev,g,g.next)>0&&Bn(t.prev,t,t.next)>0)}function Bn(g,t,i){return(t.y-g.y)*(i.x-t.x)-(t.x-g.x)*(i.y-t.y)}function Sg(g,t){return g.x===t.x&&g.y===t.y}function Hw(g,t,i,x){const T=zv(Bn(g,t,i)),E=zv(Bn(g,t,x)),s=zv(Bn(i,x,g)),y=zv(Bn(i,x,t));return!!(T!==E&&s!==y||T===0&&Uv(g,i,t)||E===0&&Uv(g,x,t)||s===0&&Uv(i,g,x)||y===0&&Uv(i,t,x))}function Uv(g,t,i){return t.x<=Math.max(g.x,i.x)&&t.x>=Math.min(g.x,i.x)&&t.y<=Math.max(g.y,i.y)&&t.y>=Math.min(g.y,i.y)}function zv(g){return g>0?1:g<0?-1:0}function AU(g,t){let i=g;do{if(i.i!==g.i&&i.next.i!==g.i&&i.i!==t.i&&i.next.i!==t.i&&Hw(i,i.next,g,t))return!0;i=i.next}while(i!==g);return!1}function Bd(g,t){return Bn(g.prev,g,g.next)<0?Bn(g,t,g.next)>=0&&Bn(g,g.prev,t)>=0:Bn(g,t,g.prev)<0||Bn(g,g.next,t)<0}function PU(g,t){let i=g,x=!1;const T=(g.x+t.x)/2,E=(g.y+t.y)/2;do i.y>E!=i.next.y>E&&i.next.y!==i.y&&T<(i.next.x-i.x)*(E-i.y)/(i.next.y-i.y)+i.x&&(x=!x),i=i.next;while(i!==g);return x}function Ww(g,t){const i=new yx(g.i,g.x,g.y),x=new yx(t.i,t.x,t.y),T=g.next,E=t.prev;return g.next=t,t.prev=g,i.next=T,T.prev=i,x.next=i,i.prev=x,E.next=x,x.prev=E,x}function FE(g,t,i,x){const T=new yx(g,t,i);return x?(T.next=x.next,T.prev=x,x.next.prev=T,x.next=T):(T.prev=T,T.next=T),T}function Ud(g){g.next.prev=g.prev,g.prev.next=g.next,g.prevZ&&(g.prevZ.nextZ=g.nextZ),g.nextZ&&(g.nextZ.prevZ=g.prevZ)}function yx(g,t,i){this.i=g,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function RU(g,t,i,x){let T=0;for(let E=t,s=i-x;E2&&g[t-1].equals(g[0])&&g.pop()}function DE(g,t){for(let i=0;iNumber.EPSILON){const Bt=Math.sqrt(Dt),ne=Math.sqrt(ut*ut+Rt*Rt),oe=gt.x-dt/Bt,ge=gt.y+Vt/Bt,xe=yt.x-Rt/ne,Ae=yt.y+ut/ne,qt=((xe-oe)*Rt-(Ae-ge)*ut)/(Vt*Rt-dt*ut);Et=oe+Vt*qt-rt.x,At=ge+dt*qt-rt.y;const Ge=Et*Et+At*At;if(Ge<=2)return new ve(Et,At);Pt=Math.sqrt(Ge/2)}else{let Bt=!1;Vt>Number.EPSILON?ut>Number.EPSILON&&(Bt=!0):Vt<-Number.EPSILON?ut<-Number.EPSILON&&(Bt=!0):Math.sign(dt)===Math.sign(Rt)&&(Bt=!0),Bt?(Et=-dt,At=Vt,Pt=Math.sqrt(Dt)):(Et=Vt,At=dt,Pt=Math.sqrt(Dt/2))}return new ve(Et/Pt,At/Pt)}const X=[];for(let rt=0,gt=I.length,yt=gt-1,Et=rt+1;rt=0;rt--){const gt=rt/f,yt=l*Math.cos(gt*Math.PI/2),Et=n*Math.sin(gt*Math.PI/2)+u;for(let At=0,Pt=I.length;At=0;){const Et=yt;let At=yt-1;At<0&&(At=rt.length-1);for(let Pt=0,Vt=p+f*2;Pt0)&&l.push(d,v,S),(o!==x-1||e0!=t>0&&this.version++,this._anisotropy=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get iridescence(){return this._iridescence}set iridescence(t){this._iridescence>0!=t>0&&this.version++,this._iridescence=t}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=t.anisotropy,this.anisotropyRotation=t.anisotropyRotation,this.anisotropyMap=t.anisotropyMap,this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.iridescence=t.iridescence,this.iridescenceMap=t.iridescenceMap,this.iridescenceIOR=t.iridescenceIOR,this.iridescenceThicknessRange=[...t.iridescenceThicknessRange],this.iridescenceThicknessMap=t.iridescenceThicknessMap,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}class jw extends Hr{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new ze(16777215),this.specular=new ze(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yh,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Zw extends Hr{constructor(t){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new ze(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yh,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}class Jw extends Hr{constructor(t){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yh,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}class $w extends Hr{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new ze(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ze(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yh,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Zd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}class Qw extends Hr{constructor(t){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ze(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=yh,this.normalScale=new ve(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}class _w extends ys{constructor(t){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}function gu(g,t,i){return!g||!i&&g.constructor===t?g:typeof t.BYTES_PER_ELEMENT=="number"?new t(g):Array.prototype.slice.call(g)}function qw(g){return ArrayBuffer.isView(g)&&!(g instanceof DataView)}function tA(g){function t(T,E){return g[T]-g[E]}const i=g.length,x=new Array(i);for(let T=0;T!==i;++T)x[T]=T;return x.sort(t),x}function xx(g,t,i){const x=g.length,T=new g.constructor(x);for(let E=0,s=0;s!==x;++E){const y=i[E]*t;for(let e=0;e!==t;++e)T[s++]=g[y+e]}return T}function O1(g,t,i,x){let T=1,E=g[0];for(;E!==void 0&&E[x]===void 0;)E=g[T++];if(E===void 0)return;let s=E[x];if(s!==void 0)if(Array.isArray(s))do s=E[x],s!==void 0&&(t.push(E.time),i.push.apply(i,s)),E=g[T++];while(E!==void 0);else if(s.toArray!==void 0)do s=E[x],s!==void 0&&(t.push(E.time),s.toArray(i,i.length)),E=g[T++];while(E!==void 0);else do s=E[x],s!==void 0&&(t.push(E.time),i.push(s)),E=g[T++];while(E!==void 0)}function OU(g,t,i,x,T=30){const E=g.clone();E.name=t;const s=[];for(let e=0;e=x)){h.push(r.times[l]);for(let u=0;uE.tracks[e].times[0]&&(y=E.tracks[e].times[0]);for(let e=0;e=y.times[n]){const o=n*h+p,c=o+h-p;u=y.values.slice(o,c)}else{const o=y.createInterpolant(),c=p,d=h-p;o.evaluate(E),u=o.resultBuffer.slice(c,d)}e==="quaternion"&&new Ds().fromArray(u).normalize().conjugate().toArray(u);const f=r.times.length;for(let o=0;o=E)){const y=i[1];t=E)break e}s=x,x=0;break i}break t}for(;x>>1;ti;)--s;if(++s,E!==0||s!==T){E>=s&&(s=Math.max(s,1),E=s-1);const y=this.getValueSize();this.times=x.slice(E,s),this.values=this.values.slice(E*y,s*y)}return this}validate(){let t=!0;const i=this.getValueSize();i-Math.floor(i)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const x=this.times,T=this.values,E=x.length;E===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let y=0;y!==E;y++){const e=x[y];if(typeof e=="number"&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,y,e),t=!1;break}if(s!==null&&s>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,y,e,s),t=!1;break}s=e}if(T!==void 0&&qw(T))for(let y=0,e=T.length;y!==e;++y){const r=T[y];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,y,r),t=!1;break}}return t}optimize(){const t=this.times.slice(),i=this.values.slice(),x=this.getValueSize(),T=this.getInterpolation()===am,E=t.length-1;let s=1;for(let y=1;y0){t[s]=t[E];for(let y=E*x,e=s*x,r=0;r!==x;++r)i[e+r]=i[y+r];++s}return s!==t.length?(this.times=t.slice(0,s),this.values=i.slice(0,s*x)):(this.times=t,this.values=i),this}clone(){const t=this.times.slice(),i=this.values.slice(),x=this.constructor,T=new x(this.name,t,i);return T.createInterpolant=this.createInterpolant,T}}so.prototype.TimeBufferType=Float32Array;so.prototype.ValueBufferType=Float32Array;so.prototype.DefaultInterpolation=Ad;class Du extends so{}Du.prototype.ValueTypeName="bool";Du.prototype.ValueBufferType=Array;Du.prototype.DefaultInterpolation=wd;Du.prototype.InterpolantFactoryMethodLinear=void 0;Du.prototype.InterpolantFactoryMethodSmooth=void 0;class I1 extends so{}I1.prototype.ValueTypeName="color";class zd extends so{}zd.prototype.ValueTypeName="number";class nA extends np{constructor(t,i,x,T){super(t,i,x,T)}interpolate_(t,i,x,T){const E=this.resultBuffer,s=this.sampleValues,y=this.valueSize,e=(x-i)/(T-i);let r=t*y;for(let p=r+y;r!==p;r+=4)Ds.slerpFlat(E,0,s,r-y,s,r,e);return E}}class ac extends so{InterpolantFactoryMethodLinear(t){return new nA(this.times,this.values,this.getValueSize(),t)}}ac.prototype.ValueTypeName="quaternion";ac.prototype.DefaultInterpolation=Ad;ac.prototype.InterpolantFactoryMethodSmooth=void 0;class Iu extends so{}Iu.prototype.ValueTypeName="string";Iu.prototype.ValueBufferType=Array;Iu.prototype.DefaultInterpolation=wd;Iu.prototype.InterpolantFactoryMethodLinear=void 0;Iu.prototype.InterpolantFactoryMethodSmooth=void 0;class Gd extends so{}Gd.prototype.ValueTypeName="vector";class Vd{constructor(t,i=-1,x,T=ag){this.name=t,this.tracks=x,this.duration=i,this.blendMode=T,this.uuid=na(),this.duration<0&&this.resetDuration()}static parse(t){const i=[],x=t.tracks,T=1/(t.fps||1);for(let s=0,y=x.length;s!==y;++s)i.push(BU(x[s]).scale(T));const E=new this(t.name,t.duration,i,t.blendMode);return E.uuid=t.uuid,E}static toJSON(t){const i=[],x=t.tracks,T={name:t.name,duration:t.duration,tracks:i,uuid:t.uuid,blendMode:t.blendMode};for(let E=0,s=x.length;E!==s;++E)i.push(so.toJSON(x[E]));return T}static CreateFromMorphTargetSequence(t,i,x,T){const E=i.length,s=[];for(let y=0;y1){const h=p[1];let a=T[h];a||(T[h]=a=[]),a.push(r)}}const s=[];for(const y in T)s.push(this.CreateFromMorphTargetSequence(y,T[y],i,x));return s}static parseAnimation(t,i){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const x=function(h,a,l,n,u){if(l.length!==0){const f=[],o=[];O1(l,f,o,n),f.length!==0&&u.push(new h(a,f,o))}},T=[],E=t.name||"default",s=t.fps||30,y=t.blendMode;let e=t.length||-1;const r=t.hierarchy||[];for(let h=0;h{i&&i(E),this.manager.itemEnd(t)},0),E;if(pl[t]!==void 0){pl[t].push({onLoad:i,onProgress:x,onError:T});return}pl[t]=[],pl[t].push({onLoad:i,onProgress:x,onError:T});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),y=this.mimeType,e=this.responseType;fetch(s).then(r=>{if(r.status===200||r.status===0){if(r.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||r.body===void 0||r.body.getReader===void 0)return r;const p=pl[t],h=r.body.getReader(),a=r.headers.get("Content-Length")||r.headers.get("X-File-Size"),l=a?parseInt(a):0,n=l!==0;let u=0;const f=new ReadableStream({start(o){c();function c(){h.read().then(({done:d,value:v})=>{if(d)o.close();else{u+=v.byteLength;const m=new ProgressEvent("progress",{lengthComputable:n,loaded:u,total:l});for(let S=0,M=p.length;S{switch(e){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"document":return r.text().then(p=>new DOMParser().parseFromString(p,y));case"json":return r.json();default:if(y===void 0)return r.text();{const h=/charset="?([^;"\s]*)"?/i.exec(y),a=h&&h[1]?h[1].toLowerCase():void 0,l=new TextDecoder(a);return r.arrayBuffer().then(n=>l.decode(n))}}}).then(r=>{Sl.add(t,r);const p=pl[t];delete pl[t];for(let h=0,a=p.length;h{const p=pl[t];if(p===void 0)throw this.manager.itemError(t),r;delete pl[t];for(let h=0,a=p.length;h{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class zU extends Ns{constructor(t){super(t)}load(t,i,x,T){const E=this,s=new Al(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(y){try{i(E.parse(JSON.parse(y)))}catch(e){T?T(e):console.error(e),E.manager.itemError(t)}},x,T)}parse(t){const i=[];for(let x=0;x0:T.vertexColors=t.vertexColors),t.uniforms!==void 0)for(const E in t.uniforms){const s=t.uniforms[E];switch(T.uniforms[E]={},s.type){case"t":T.uniforms[E].value=x(s.value);break;case"c":T.uniforms[E].value=new ze().setHex(s.value);break;case"v2":T.uniforms[E].value=new ve().fromArray(s.value);break;case"v3":T.uniforms[E].value=new Ct().fromArray(s.value);break;case"v4":T.uniforms[E].value=new sn().fromArray(s.value);break;case"m3":T.uniforms[E].value=new Oi().fromArray(s.value);break;case"m4":T.uniforms[E].value=new ci().fromArray(s.value);break;default:T.uniforms[E].value=s.value}}if(t.defines!==void 0&&(T.defines=t.defines),t.vertexShader!==void 0&&(T.vertexShader=t.vertexShader),t.fragmentShader!==void 0&&(T.fragmentShader=t.fragmentShader),t.glslVersion!==void 0&&(T.glslVersion=t.glslVersion),t.extensions!==void 0)for(const E in t.extensions)T.extensions[E]=t.extensions[E];if(t.lights!==void 0&&(T.lights=t.lights),t.clipping!==void 0&&(T.clipping=t.clipping),t.size!==void 0&&(T.size=t.size),t.sizeAttenuation!==void 0&&(T.sizeAttenuation=t.sizeAttenuation),t.map!==void 0&&(T.map=x(t.map)),t.matcap!==void 0&&(T.matcap=x(t.matcap)),t.alphaMap!==void 0&&(T.alphaMap=x(t.alphaMap)),t.bumpMap!==void 0&&(T.bumpMap=x(t.bumpMap)),t.bumpScale!==void 0&&(T.bumpScale=t.bumpScale),t.normalMap!==void 0&&(T.normalMap=x(t.normalMap)),t.normalMapType!==void 0&&(T.normalMapType=t.normalMapType),t.normalScale!==void 0){let E=t.normalScale;Array.isArray(E)===!1&&(E=[E,E]),T.normalScale=new ve().fromArray(E)}return t.displacementMap!==void 0&&(T.displacementMap=x(t.displacementMap)),t.displacementScale!==void 0&&(T.displacementScale=t.displacementScale),t.displacementBias!==void 0&&(T.displacementBias=t.displacementBias),t.roughnessMap!==void 0&&(T.roughnessMap=x(t.roughnessMap)),t.metalnessMap!==void 0&&(T.metalnessMap=x(t.metalnessMap)),t.emissiveMap!==void 0&&(T.emissiveMap=x(t.emissiveMap)),t.emissiveIntensity!==void 0&&(T.emissiveIntensity=t.emissiveIntensity),t.specularMap!==void 0&&(T.specularMap=x(t.specularMap)),t.specularIntensityMap!==void 0&&(T.specularIntensityMap=x(t.specularIntensityMap)),t.specularColorMap!==void 0&&(T.specularColorMap=x(t.specularColorMap)),t.envMap!==void 0&&(T.envMap=x(t.envMap)),t.envMapIntensity!==void 0&&(T.envMapIntensity=t.envMapIntensity),t.reflectivity!==void 0&&(T.reflectivity=t.reflectivity),t.refractionRatio!==void 0&&(T.refractionRatio=t.refractionRatio),t.lightMap!==void 0&&(T.lightMap=x(t.lightMap)),t.lightMapIntensity!==void 0&&(T.lightMapIntensity=t.lightMapIntensity),t.aoMap!==void 0&&(T.aoMap=x(t.aoMap)),t.aoMapIntensity!==void 0&&(T.aoMapIntensity=t.aoMapIntensity),t.gradientMap!==void 0&&(T.gradientMap=x(t.gradientMap)),t.clearcoatMap!==void 0&&(T.clearcoatMap=x(t.clearcoatMap)),t.clearcoatRoughnessMap!==void 0&&(T.clearcoatRoughnessMap=x(t.clearcoatRoughnessMap)),t.clearcoatNormalMap!==void 0&&(T.clearcoatNormalMap=x(t.clearcoatNormalMap)),t.clearcoatNormalScale!==void 0&&(T.clearcoatNormalScale=new ve().fromArray(t.clearcoatNormalScale)),t.iridescenceMap!==void 0&&(T.iridescenceMap=x(t.iridescenceMap)),t.iridescenceThicknessMap!==void 0&&(T.iridescenceThicknessMap=x(t.iridescenceThicknessMap)),t.transmissionMap!==void 0&&(T.transmissionMap=x(t.transmissionMap)),t.thicknessMap!==void 0&&(T.thicknessMap=x(t.thicknessMap)),t.anisotropyMap!==void 0&&(T.anisotropyMap=x(t.anisotropyMap)),t.sheenColorMap!==void 0&&(T.sheenColorMap=x(t.sheenColorMap)),t.sheenRoughnessMap!==void 0&&(T.sheenRoughnessMap=x(t.sheenRoughnessMap)),T}setTextures(t){return this.textures=t,this}static createMaterialFromType(t){const i={ShadowMaterial:Yw,SpriteMaterial:M1,RawShaderMaterial:kw,ShaderMaterial:no,PointsMaterial:w1,MeshPhysicalMaterial:Kw,MeshStandardMaterial:vl,MeshPhongMaterial:jw,MeshToonMaterial:Zw,MeshNormalMaterial:Jw,MeshLambertMaterial:$w,MeshDepthMaterial:S1,MeshDistanceMaterial:T1,MeshBasicMaterial:xh,MeshMatcapMaterial:Qw,LineDashedMaterial:_w,LineBasicMaterial:ys,Material:Hr};return new i[t]}}class Sx{static decodeText(t){if(typeof TextDecoder<"u")return new TextDecoder().decode(t);let i="";for(let x=0,T=t.length;x0){const e=new N1(i);E=new Hd(e),E.setCrossOrigin(this.crossOrigin);for(let r=0,p=t.length;r0){T=new Hd(this.manager),T.setCrossOrigin(this.crossOrigin);for(let s=0,y=t.length;s{const f=new gs;f.min.fromArray(u.boxMin),f.max.fromArray(u.boxMax);const o=new $r;return o.radius=u.sphereRadius,o.center.fromArray(u.sphereCenter),{boxInitialized:u.boxInitialized,box:f,sphereInitialized:u.sphereInitialized,sphere:o}}),s._maxGeometryCount=t.maxGeometryCount,s._maxVertexCount=t.maxVertexCount,s._maxIndexCount=t.maxIndexCount,s._geometryInitialized=t.geometryInitialized,s._geometryCount=t.geometryCount,s._matricesTexture=r(t.matricesTexture.uuid);break;case"LOD":s=new Rw;break;case"Line":s=new mh(y(t.geometry),e(t.material));break;case"LineLoop":s=new Ow(y(t.geometry),e(t.material));break;case"LineSegments":s=new Ho(y(t.geometry),e(t.material));break;case"PointCloud":case"Points":s=new Dw(y(t.geometry),e(t.material));break;case"Sprite":s=new Pw(e(t.material));break;case"Group":s=new Gf;break;case"Bone":s=new C1;break;default:s=new Yi}if(s.uuid=t.uuid,t.name!==void 0&&(s.name=t.name),t.matrix!==void 0?(s.matrix.fromArray(t.matrix),t.matrixAutoUpdate!==void 0&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(t.position!==void 0&&s.position.fromArray(t.position),t.rotation!==void 0&&s.rotation.fromArray(t.rotation),t.quaternion!==void 0&&s.quaternion.fromArray(t.quaternion),t.scale!==void 0&&s.scale.fromArray(t.scale)),t.up!==void 0&&s.up.fromArray(t.up),t.castShadow!==void 0&&(s.castShadow=t.castShadow),t.receiveShadow!==void 0&&(s.receiveShadow=t.receiveShadow),t.shadow&&(t.shadow.bias!==void 0&&(s.shadow.bias=t.shadow.bias),t.shadow.normalBias!==void 0&&(s.shadow.normalBias=t.shadow.normalBias),t.shadow.radius!==void 0&&(s.shadow.radius=t.shadow.radius),t.shadow.mapSize!==void 0&&s.shadow.mapSize.fromArray(t.shadow.mapSize),t.shadow.camera!==void 0&&(s.shadow.camera=this.parseObject(t.shadow.camera))),t.visible!==void 0&&(s.visible=t.visible),t.frustumCulled!==void 0&&(s.frustumCulled=t.frustumCulled),t.renderOrder!==void 0&&(s.renderOrder=t.renderOrder),t.userData!==void 0&&(s.userData=t.userData),t.layers!==void 0&&(s.layers.mask=t.layers),t.children!==void 0){const a=t.children;for(let l=0;l"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,i,x,T){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const E=this,s=Sl.get(t);if(s!==void 0){if(E.manager.itemStart(t),s.then){s.then(r=>{i&&i(r),E.manager.itemEnd(t)}).catch(r=>{T&&T(r)});return}return setTimeout(function(){i&&i(s),E.manager.itemEnd(t)},0),s}const y={};y.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",y.headers=this.requestHeader;const e=fetch(t,y).then(function(r){return r.blob()}).then(function(r){return createImageBitmap(r,Object.assign(E.options,{colorSpaceConversion:"none"}))}).then(function(r){return Sl.add(t,r),i&&i(r),E.manager.itemEnd(t),r}).catch(function(r){T&&T(r),Sl.remove(t),E.manager.itemError(t),E.manager.itemEnd(t)});Sl.add(t,e),E.manager.itemStart(t)}}let Gv,U1=class{static getContext(){return Gv===void 0&&(Gv=new(window.AudioContext||window.webkitAudioContext)),Gv}static setContext(t){Gv=t}};class ZU extends Ns{constructor(t){super(t)}load(t,i,x,T){const E=this,s=new Al(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,function(e){try{const r=e.slice(0);U1.getContext().decodeAudioData(r,function(h){i(h)}).catch(y)}catch(r){y(r)}},x,T);function y(e){T?T(e):console.error(e),E.manager.itemError(t)}}}const HE=new ci,WE=new ci,eu=new ci;class JU{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Or,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Or,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const i=this._cache;if(i.focus!==t.focus||i.fov!==t.fov||i.aspect!==t.aspect*this.aspect||i.near!==t.near||i.far!==t.far||i.zoom!==t.zoom||i.eyeSep!==this.eyeSep){i.focus=t.focus,i.fov=t.fov,i.aspect=t.aspect*this.aspect,i.near=t.near,i.far=t.far,i.zoom=t.zoom,i.eyeSep=this.eyeSep,eu.copy(t.projectionMatrix);const T=i.eyeSep/2,E=T*i.near/i.focus,s=i.near*Math.tan(xu*i.fov*.5)/i.zoom;let y,e;WE.elements[12]=-T,HE.elements[12]=T,y=-s*i.aspect+E,e=s*i.aspect+E,eu.elements[0]=2*i.near/(e-y),eu.elements[8]=(e+y)/(e-y),this.cameraL.projectionMatrix.copy(eu),y=-s*i.aspect-E,e=s*i.aspect-E,eu.elements[0]=2*i.near/(e-y),eu.elements[8]=(e+y)/(e-y),this.cameraR.projectionMatrix.copy(eu)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(WE),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(HE)}}class z1{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=XE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const i=XE();t=(i-this.oldTime)/1e3,this.oldTime=i,this.elapsedTime+=t}return t}}function XE(){return(typeof performance>"u"?Date:performance).now()}const iu=new Ct,YE=new Ds,$U=new Ct,nu=new Ct;class QU extends Yi{constructor(){super(),this.type="AudioListener",this.context=U1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new z1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const i=this.context.listener,x=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(iu,YE,$U),nu.set(0,0,-1).applyQuaternion(YE),i.positionX){const T=this.context.currentTime+this.timeDelta;i.positionX.linearRampToValueAtTime(iu.x,T),i.positionY.linearRampToValueAtTime(iu.y,T),i.positionZ.linearRampToValueAtTime(iu.z,T),i.forwardX.linearRampToValueAtTime(nu.x,T),i.forwardY.linearRampToValueAtTime(nu.y,T),i.forwardZ.linearRampToValueAtTime(nu.z,T),i.upX.linearRampToValueAtTime(x.x,T),i.upY.linearRampToValueAtTime(x.y,T),i.upZ.linearRampToValueAtTime(x.z,T)}else i.setPosition(iu.x,iu.y,iu.z),i.setOrientation(nu.x,nu.y,nu.z,x.x,x.y,x.z)}}let mA=class extends Yi{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+t;const i=this.context.createBufferSource();return i.buffer=this.buffer,i.loop=this.loop,i.loopStart=this.loopStart,i.loopEnd=this.loopEnd,i.onended=this.onEnded.bind(this),i.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=i,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,i=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,i=this.filters.length;t0&&this._mixBufferRegionAdditive(x,T,this._addIndex*i,1,i);for(let e=i,r=i+i;e!==r;++e)if(x[e]!==x[e+i]){y.setValue(x,T);break}}saveOriginalState(){const t=this.binding,i=this.buffer,x=this.valueSize,T=x*this._origIndex;t.getValue(i,T);for(let E=x,s=T;E!==s;++E)i[E]=i[T+E%x];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,i=t+this.valueSize;for(let x=t;x=.5)for(let s=0;s!==E;++s)t[i+s]=t[x+s]}_slerp(t,i,x,T){Ds.slerpFlat(t,i,t,i,t,x,T)}_slerpAdditive(t,i,x,T,E){const s=this._workIndex*E;Ds.multiplyQuaternionsFlat(t,s,t,i,t,x),Ds.slerpFlat(t,i,t,i,t,s,T)}_lerp(t,i,x,T,E){const s=1-T;for(let y=0;y!==E;++y){const e=i+y;t[e]=t[e]*s+t[x+y]*T}}_lerpAdditive(t,i,x,T,E){for(let s=0;s!==E;++s){const y=i+s;t[y]=t[y]+t[x+s]*T}}}const G1="\\[\\]\\.:\\/",e7=new RegExp("["+G1+"]","g"),V1="[^"+G1+"]",i7="[^"+G1.replace("\\.","")+"]",n7=/((?:WC+[\/:])*)/.source.replace("WC",V1),r7=/(WCOD+)?/.source.replace("WCOD",i7),s7=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",V1),a7=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",V1),o7=new RegExp("^"+n7+r7+s7+a7+"$"),l7=["material","materials","bones","map"];class h7{constructor(t,i,x){const T=x||Xi.parseTrackName(i);this._targetGroup=t,this._bindings=t.subscribe_(i,T)}getValue(t,i){this.bind();const x=this._targetGroup.nCachedObjects_,T=this._bindings[x];T!==void 0&&T.getValue(t,i)}setValue(t,i){const x=this._bindings;for(let T=this._targetGroup.nCachedObjects_,E=x.length;T!==E;++T)x[T].setValue(t,i)}bind(){const t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=t.length;i!==x;++i)t[i].bind()}unbind(){const t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=t.length;i!==x;++i)t[i].unbind()}}class Xi{constructor(t,i,x){this.path=i,this.parsedPath=x||Xi.parseTrackName(i),this.node=Xi.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,x){return t&&t.isAnimationObjectGroup?new Xi.Composite(t,i,x):new Xi(t,i,x)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(e7,"")}static parseTrackName(t){const i=o7.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const x={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},T=x.nodeName&&x.nodeName.lastIndexOf(".");if(T!==void 0&&T!==-1){const E=x.nodeName.substring(T+1);l7.indexOf(E)!==-1&&(x.nodeName=x.nodeName.substring(0,T),x.objectName=E)}if(x.propertyName===null||x.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return x}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){const x=t.skeleton.getBoneByName(i);if(x!==void 0)return x}if(t.children){const x=function(E){for(let s=0;s=E){const h=E++,a=t[h];i[a.uuid]=p,t[p]=a,i[r]=h,t[h]=e;for(let l=0,n=T;l!==n;++l){const u=x[l],f=u[h],o=u[p];u[p]=f,u[h]=o}}}this.nCachedObjects_=E}uncache(){const t=this._objects,i=this._indicesByUUID,x=this._bindings,T=x.length;let E=this.nCachedObjects_,s=t.length;for(let y=0,e=arguments.length;y!==e;++y){const r=arguments[y],p=r.uuid,h=i[p];if(h!==void 0)if(delete i[p],h0&&(i[l.uuid]=h),t[h]=l,t.pop();for(let n=0,u=T;n!==u;++n){const f=x[n];f[h]=f[a],f.pop()}}}this.nCachedObjects_=E}subscribe_(t,i){const x=this._bindingsIndicesByPath;let T=x[t];const E=this._bindings;if(T!==void 0)return E[T];const s=this._paths,y=this._parsedPaths,e=this._objects,r=e.length,p=this.nCachedObjects_,h=new Array(r);T=E.length,x[t]=T,s.push(t),y.push(i),E.push(h);for(let a=p,l=e.length;a!==l;++a){const n=e[a];h[a]=new Xi(n,t,i)}return h}unsubscribe_(t){const i=this._bindingsIndicesByPath,x=i[t];if(x!==void 0){const T=this._paths,E=this._parsedPaths,s=this._bindings,y=s.length-1,e=s[y],r=t[y];i[r]=x,s[x]=e,s.pop(),E[x]=E[y],E.pop(),T[x]=T[y],T.pop()}}}class yA{constructor(t,i,x=null,T=i.blendMode){this._mixer=t,this._clip=i,this._localRoot=x,this.blendMode=T;const E=i.tracks,s=E.length,y=new Array(s),e={endingStart:pu,endingEnd:pu};for(let r=0;r!==s;++r){const p=E[r].createInterpolant(null);y[r]=p,p.settings=e}this._interpolantSettings=e,this._interpolants=y,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Q2,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,i){return this.loop=t,this.repetitions=i,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,i,x){if(t.fadeOut(i),this.fadeIn(i),x){const T=this._clip.duration,E=t._clip.duration,s=E/T,y=T/E;t.warp(1,s,i),this.warp(y,1,i)}return this}crossFadeTo(t,i,x){return t.crossFadeFrom(this,i,x)}stopFading(){const t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,i,x){const T=this._mixer,E=T.time,s=this.timeScale;let y=this._timeScaleInterpolant;y===null&&(y=T._lendControlInterpolant(),this._timeScaleInterpolant=y);const e=y.parameterPositions,r=y.sampleValues;return e[0]=E,e[1]=E+x,r[0]=t/s,r[1]=i/s,this}stopWarping(){const t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,i,x,T){if(!this.enabled){this._updateWeight(t);return}const E=this._startTime;if(E!==null){const e=(t-E)*x;e<0||x===0?i=0:(this._startTime=null,i=x*e)}i*=this._updateTimeScale(t);const s=this._updateTime(i),y=this._updateWeight(t);if(y>0){const e=this._interpolants,r=this._propertyBindings;switch(this.blendMode){case u1:for(let p=0,h=e.length;p!==h;++p)e[p].evaluate(s),r[p].accumulateAdditive(y);break;case ag:default:for(let p=0,h=e.length;p!==h;++p)e[p].evaluate(s),r[p].accumulate(T,y)}}}_updateWeight(t){let i=0;if(this.enabled){i=this.weight;const x=this._weightInterpolant;if(x!==null){const T=x.evaluate(t)[0];i*=T,t>x.parameterPositions[1]&&(this.stopFading(),T===0&&(this.enabled=!1))}}return this._effectiveWeight=i,i}_updateTimeScale(t){let i=0;if(!this.paused){i=this.timeScale;const x=this._timeScaleInterpolant;if(x!==null){const T=x.evaluate(t)[0];i*=T,t>x.parameterPositions[1]&&(this.stopWarping(),i===0?this.paused=!0:this.timeScale=i)}}return this._effectiveTimeScale=i,i}_updateTime(t){const i=this._clip.duration,x=this.loop;let T=this.time+t,E=this._loopCount;const s=x===_2;if(t===0)return E===-1?T:s&&(E&1)===1?i-T:T;if(x===$2){E===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(T>=i)T=i;else if(T<0)T=0;else{this.time=T;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(E===-1&&(t>=0?(E=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),T>=i||T<0){const y=Math.floor(T/i);T-=i*y,E+=Math.abs(y);const e=this.repetitions-E;if(e<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,T=t>0?i:0,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(e===1){const r=t<0;this._setEndings(r,!r,s)}else this._setEndings(!1,!1,s);this._loopCount=E,this.time=T,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:y})}}else this.time=T;if(s&&(E&1)===1)return i-T}return T}_setEndings(t,i,x){const T=this._interpolantSettings;x?(T.endingStart=vu,T.endingEnd=vu):(t?T.endingStart=this.zeroSlopeAtStart?vu:pu:T.endingStart=Pd,i?T.endingEnd=this.zeroSlopeAtEnd?vu:pu:T.endingEnd=Pd)}_scheduleFading(t,i,x){const T=this._mixer,E=T.time;let s=this._weightInterpolant;s===null&&(s=T._lendControlInterpolant(),this._weightInterpolant=s);const y=s.parameterPositions,e=s.sampleValues;return y[0]=E,e[0]=i,y[1]=E+t,e[1]=x,this}}const f7=new Float32Array(1);class c7 extends Pl{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,i){const x=t._localRoot||this._root,T=t._clip.tracks,E=T.length,s=t._propertyBindings,y=t._interpolants,e=x.uuid,r=this._bindingsByRootAndName;let p=r[e];p===void 0&&(p={},r[e]=p);for(let h=0;h!==E;++h){const a=T[h],l=a.name;let n=p[l];if(n!==void 0)++n.referenceCount,s[h]=n;else{if(n=s[h],n!==void 0){n._cacheIndex===null&&(++n.referenceCount,this._addInactiveBinding(n,e,l));continue}const u=i&&i._propertyBindings[h].binding.parsedPath;n=new gA(Xi.create(x,l,u),a.ValueTypeName,a.getValueSize()),++n.referenceCount,this._addInactiveBinding(n,e,l),s[h]=n}y[h].resultBuffer=n.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){const x=(t._localRoot||this._root).uuid,T=t._clip.uuid,E=this._actionsByClip[T];this._bindAction(t,E&&E.knownActions[0]),this._addInactiveAction(t,T,x)}const i=t._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];E.useCount++===0&&(this._lendBinding(E),E.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const i=t._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];--E.useCount===0&&(E.restoreOriginalState(),this._takeBackBinding(E))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const i=t._cacheIndex;return i!==null&&i=0;--x)t[x].stop();return this}update(t){t*=this.timeScale;const i=this._actions,x=this._nActiveActions,T=this.time+=t,E=Math.sign(t),s=this._accuIndex^=1;for(let r=0;r!==x;++r)i[r]._update(T,t,E,s);const y=this._bindings,e=this._nActiveBindings;for(let r=0;r!==e;++r)y[r].apply(s);return this}setTime(t){this.time=0;for(let i=0;ithis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,jE).distanceTo(t)}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const ZE=new Ct,Vv=new Ct;class S7{constructor(t=new Ct,i=new Ct){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){ZE.subVectors(t,this.start),Vv.subVectors(this.end,this.start);const x=Vv.dot(Vv);let E=Vv.dot(ZE)/x;return i&&(E=jn(E,0,1)),E}closestPointToPoint(t,i,x){const T=this.closestPointToPointParameter(t,i);return this.delta(x).multiplyScalar(T).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const JE=new Ct;class T7 extends Yi{constructor(t,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="SpotLightHelper";const x=new Li,T=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,y=1,e=32;s1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{tM.set(t.z,0,-t.x).normalize();const i=Math.acos(t.y);this.quaternion.setFromAxisAngle(tM,i)}}setLength(t,i=t*.2,x=i*.2){this.line.scale.set(1,Math.max(1e-4,t-i),1),this.line.updateMatrix(),this.cone.scale.set(x,i,x),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class I7 extends Ho{constructor(t=1){const i=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],x=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],T=new Li;T.setAttribute("position",new ke(i,3)),T.setAttribute("color",new ke(x,3));const E=new ys({vertexColors:!0,toneMapped:!1});super(T,E),this.type="AxesHelper"}setColors(t,i,x){const T=new ze,E=this.geometry.attributes.color.array;return T.set(t),T.toArray(E,0),T.toArray(E,3),T.set(i),T.toArray(E,6),T.toArray(E,9),T.set(x),T.toArray(E,12),T.toArray(E,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class N7{constructor(){this.type="ShapePath",this.color=new ze,this.subPaths=[],this.currentPath=null}moveTo(t,i){return this.currentPath=new Id,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,i),this}lineTo(t,i){return this.currentPath.lineTo(t,i),this}quadraticCurveTo(t,i,x,T){return this.currentPath.quadraticCurveTo(t,i,x,T),this}bezierCurveTo(t,i,x,T,E,s){return this.currentPath.bezierCurveTo(t,i,x,T,E,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function i(o){const c=[];for(let d=0,v=o.length;dNumber.EPSILON){if(A<0&&(M=c[S],C=-C,w=c[m],A=-A),o.yw.y)continue;if(o.y===M.y){if(o.x===M.x)return!0}else{const P=A*(o.x-M.x)-C*(o.y-M.y);if(P===0)return!0;if(P<0)continue;v=!v}}else{if(o.y!==M.y)continue;if(w.x<=o.x&&o.x<=M.x||M.x<=o.x&&o.x<=w.x)return!0}}return v}const T=zo.isClockWise,E=this.subPaths;if(E.length===0)return[];let s,y,e;const r=[];if(E.length===1)return y=E[0],e=new Mu,e.curves=y.curves,r.push(e),r;let p=!T(E[0].getPoints());p=t?!p:p;const h=[],a=[];let l=[],n=0,u;a[n]=void 0,l[n]=[];for(let o=0,c=E.length;o1){let o=!1,c=0;for(let d=0,v=a.length;d0&&o===!1&&(l=h)}let f;for(let o=0,c=a.length;o{const h=typeof r=="function"?r(t):r;if(h!==t){const a=t;t=p?h:Object.assign({},t,h),i.forEach(l=>l(t,a))}},T=()=>t,E=(r,p=T,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let a=p(t);function l(){const n=p(t);if(!h(a,n)){const u=a;r(a=n,u)}}return i.add(l),()=>i.delete(l)},e={setState:x,getState:T,subscribe:(r,p,h)=>p||h?E(r,p,h):(i.add(r),()=>i.delete(r)),destroy:()=>i.clear()};return t=g(x,T,e),e}const z7=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),eM=z7?Pe.useEffect:Pe.useLayoutEffect;function G7(g){const t=typeof g=="function"?U7(g):g,i=(x=t.getState,T=Object.is)=>{const[,E]=Pe.useReducer(f=>f+1,0),s=t.getState(),y=Pe.useRef(s),e=Pe.useRef(x),r=Pe.useRef(T),p=Pe.useRef(!1),h=Pe.useRef();h.current===void 0&&(h.current=x(s));let a,l=!1;(y.current!==s||e.current!==x||r.current!==T||p.current)&&(a=x(s),l=!T(h.current,a)),eM(()=>{l&&(h.current=a),y.current=s,e.current=x,r.current=T,p.current=!1});const n=Pe.useRef(s);eM(()=>{const f=()=>{try{const c=t.getState(),d=e.current(c);r.current(h.current,d)||(y.current=c,h.current=d,E())}catch{p.current=!0,E()}},o=t.subscribe(f);return t.getState()!==n.current&&f(),o},[]);const u=l?a:h.current;return Pe.useDebugValue(u),u};return Object.assign(i,t),i[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const x=[i,t];return{next(){const T=x.length<=0;return{value:x.shift(),done:T}}}},i}var EA={exports:{}},iy={exports:{}},ny={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var iM;function V7(){return iM||(iM=1,function(g){function t(z,X){var K=z.length;z.push(X);t:for(;0>>1,tt=z[Q];if(0>>1;QT(U,K))HT(J,U)?(z[Q]=J,z[H]=K,Q=H):(z[Q]=U,z[Z]=K,Q=Z);else if(HT(J,K))z[Q]=J,z[H]=K,Q=H;else break t}}return X}function T(z,X){var K=z.sortIndex-X.sortIndex;return K!==0?K:z.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var s=Date,y=s.now();g.unstable_now=function(){return s.now()-y}}var e=[],r=[],p=1,h=null,a=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var X=i(r);X!==null;){if(X.callback===null)x(r);else if(X.startTime<=z)x(r),X.sortIndex=X.expirationTime,t(e,X);else break;X=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(e)!==null)n=!0,B(m);else{var X=i(r);X!==null&&G(v,X.startTime-z)}}function m(z,X){n=!1,u&&(u=!1,o(w),w=-1),l=!0;var K=a;try{for(d(X),h=i(e);h!==null&&(!(h.expirationTime>X)||z&&!P());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,a=h.priorityLevel;var tt=Q(h.expirationTime<=X);X=g.unstable_now(),typeof tt=="function"?h.callback=tt:h===i(e)&&x(e),d(X)}else x(e);h=i(e)}if(h!==null)var Y=!0;else{var Z=i(r);Z!==null&&G(v,Z.startTime-X),Y=!1}return Y}finally{h=null,a=K,l=!1}}var S=!1,M=null,w=-1,C=5,A=-1;function P(){return!(g.unstable_now()-Az||125Q?(z.sortIndex=K,t(r,z),i(e)===null&&z===i(r)&&(u?(o(w),w=-1):u=!0,G(v,K-Q))):(z.sortIndex=tt,t(e,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var X=a;return function(){var K=a;a=X;try{return z.apply(this,arguments)}finally{a=K}}}}(ny)),ny}var nM;function H7(){return nM||(nM=1,iy.exports=V7()),iy.exports}/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var W7=function(t){var i={},x=Pe,T=H7(),E=Object.assign;function s(L){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+L,W=1;WXt||it[wt]!==lt[Xt]){var ae=` +`+it[wt].replace(" at new "," at ");return L.displayName&&ae.includes("")&&(ae=ae.replace("",L.displayName)),ae}while(1<=wt&&0<=Xt);break}}}finally{ii=!1,Error.prepareStackTrace=W}return(L=L?L.displayName||L.name:"")?qe(L):""}var Ji=Object.prototype.hasOwnProperty,hn=[],ki=-1;function mn(L){return{current:L}}function ti(L){0>ki||(L.current=hn[ki],hn[ki]=null,ki--)}function Se(L,F){ki++,hn[ki]=L.current,L.current=F}var Nr={},mi=mn(Nr),un=mn(!1),Ii=Nr;function Gn(L,F){var W=L.type.contextTypes;if(!W)return Nr;var $=L.stateNode;if($&&$.__reactInternalMemoizedUnmaskedChildContext===F)return $.__reactInternalMemoizedMaskedChildContext;var it={},lt;for(lt in W)it[lt]=F[lt];return $&&(L=L.stateNode,L.__reactInternalMemoizedUnmaskedChildContext=F,L.__reactInternalMemoizedMaskedChildContext=it),it}function pn(L){return L=L.childContextTypes,L!=null}function Ki(){ti(un),ti(mi)}function dr(L,F,W){if(mi.current!==Nr)throw Error(s(168));Se(mi,F),Se(un,W)}function zs(L,F,W){var $=L.stateNode;if(F=F.childContextTypes,typeof $.getChildContext!="function")return W;$=$.getChildContext();for(var it in $)if(!(it in F))throw Error(s(108,w(L)||"Unknown",it));return E({},W,$)}function Tn(L){return L=(L=L.stateNode)&&L.__reactInternalMemoizedMergedChildContext||Nr,Ii=mi.current,Se(mi,L),Se(un,un.current),!0}function oa(L,F,W){var $=L.stateNode;if(!$)throw Error(s(169));W?(L=zs(L,F,Ii),$.__reactInternalMemoizedMergedChildContext=L,ti(un),ti(mi),Se(mi,L)):ti(un),Se(un,W)}var Jn=Math.clz32?Math.clz32:lo,Ra=Math.log,Gs=Math.LN2;function lo(L){return L>>>=0,L===0?32:31-(Ra(L)/Gs|0)|0}var ba=64,ho=4194304;function gi(L){switch(L&-L){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return L&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return L&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return L}}function La(L,F){var W=L.pendingLanes;if(W===0)return 0;var $=0,it=L.suspendedLanes,lt=L.pingedLanes,wt=W&268435455;if(wt!==0){var Xt=wt&~it;Xt!==0?$=gi(Xt):(lt&=wt,lt!==0&&($=gi(lt)))}else wt=W&~it,wt!==0?$=gi(wt):lt!==0&&($=gi(lt));if($===0)return 0;if(F!==0&&F!==$&&!(F&it)&&(it=$&-$,lt=F&-F,it>=lt||it===16&&(lt&4194240)!==0))return F;if($&4&&($|=W&16),F=L.entangledLanes,F!==0)for(L=L.entanglements,F&=$;0W;W++)F.push(L);return F}function Hs(L,F,W){L.pendingLanes|=F,F!==536870912&&(L.suspendedLanes=0,L.pingedLanes=0),L=L.eventTimes,F=31-Jn(F),L[F]=W}function Ws(L,F){var W=L.pendingLanes&~F;L.pendingLanes=F,L.suspendedLanes=0,L.pingedLanes=0,L.expiredLanes&=F,L.mutableReadLanes&=F,L.entangledLanes&=F,F=L.entanglements;var $=L.eventTimes;for(L=L.expirationTimes;0>=wt,it-=wt,Es=1<<32-Jn(F)+it|W<Ci?(Yn=yi,yi=null):Yn=yi.sibling;var Ui=Qe(Jt,yi,re[Ci],Ne);if(Ui===null){yi===null&&(yi=Yn);break}L&&yi&&Ui.alternate===null&&F(Jt,yi),Yt=lt(Ui,Yt,Ci),Mi===null?Ye=Ui:Mi.sibling=Ui,Mi=Ui,yi=Yn}if(Ci===re.length)return W(Jt,yi),_i&&Ms(Jt,Ci),Ye;if(yi===null){for(;CiCi?(Yn=yi,yi=null):Yn=yi.sibling;var ga=Qe(Jt,yi,Ui.value,Ne);if(ga===null){yi===null&&(yi=Yn);break}L&&yi&&ga.alternate===null&&F(Jt,yi),Yt=lt(ga,Yt,Ci),Mi===null?Ye=ga:Mi.sibling=ga,Mi=ga,yi=Yn}if(Ui.done)return W(Jt,yi),_i&&Ms(Jt,Ci),Ye;if(yi===null){for(;!Ui.done;Ci++,Ui=re.next())Ui=vi(Jt,Ui.value,Ne),Ui!==null&&(Yt=lt(Ui,Yt,Ci),Mi===null?Ye=Ui:Mi.sibling=Ui,Mi=Ui);return _i&&Ms(Jt,Ci),Ye}for(yi=$(Jt,yi);!Ui.done;Ci++,Ui=re.next())Ui=qi(yi,Jt,Ci,Ui.value,Ne),Ui!==null&&(L&&Ui.alternate!==null&&yi.delete(Ui.key===null?Ci:Ui.key),Yt=lt(Ui,Yt,Ci),Mi===null?Ye=Ui:Mi.sibling=Ui,Mi=Ui);return L&&yi.forEach(function(rf){return F(Jt,rf)}),_i&&Ms(Jt,Ci),Ye}function hs(Jt,Yt,re,Ne){if(typeof re=="object"&&re!==null&&re.type===p&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case e:t:{for(var Ye=re.key,Mi=Yt;Mi!==null;){if(Mi.key===Ye){if(Ye=re.type,Ye===p){if(Mi.tag===7){W(Jt,Mi.sibling),Yt=it(Mi,re.props.children),Yt.return=Jt,Jt=Yt;break t}}else if(Mi.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===d&&Ha(Ye)===Mi.type){W(Jt,Mi.sibling),Yt=it(Mi,re.props),Yt.ref=Va(Jt,Mi,re),Yt.return=Jt,Jt=Yt;break t}W(Jt,Mi);break}else F(Jt,Mi);Mi=Mi.sibling}re.type===p?(Yt=bo(re.props.children,Jt.mode,Ne,re.key),Yt.return=Jt,Jt=Yt):(Ne=ef(re.type,re.key,re.props,null,Jt.mode,Ne),Ne.ref=Va(Jt,Yt,re),Ne.return=Jt,Jt=Ne)}return wt(Jt);case r:t:{for(Mi=re.key;Yt!==null;){if(Yt.key===Mi)if(Yt.tag===4&&Yt.stateNode.containerInfo===re.containerInfo&&Yt.stateNode.implementation===re.implementation){W(Jt,Yt.sibling),Yt=it(Yt,re.children||[]),Yt.return=Jt,Jt=Yt;break t}else{W(Jt,Yt);break}else F(Jt,Yt);Yt=Yt.sibling}Yt=Rs(re,Jt.mode,Ne),Yt.return=Jt,Jt=Yt}return wt(Jt);case d:return Mi=re._init,hs(Jt,Yt,Mi(re._payload),Ne)}if(D(re))return Xe(Jt,Yt,re,Ne);if(S(re))return br(Jt,Yt,re,Ne);Qn(Jt,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Yt!==null&&Yt.tag===6?(W(Jt,Yt.sibling),Yt=it(Yt,re),Yt.return=Jt,Jt=Yt):(W(Jt,Yt),Yt=Rr(re,Jt.mode,Ne),Yt.return=Jt,Jt=Yt),wt(Jt)):W(Jt,Yt)}return hs}var Gr=Wa(!0),Ah=Wa(!1),V={},j=mn(V),et=mn(V),st=mn(V);function ht(L){if(L===V)throw Error(s(174));return L}function pt(L,F){Se(st,F),Se(et,L),Se(j,V),L=G(F),ti(j),Se(j,L)}function Mt(){ti(j),ti(et),ti(st)}function Nt(L){var F=ht(st.current),W=ht(j.current);F=z(W,L.type,F),W!==F&&(Se(et,L),Se(j,F))}function zt(L){et.current===L&&(ti(j),ti(et))}var ct=mn(0);function St(L){for(var F=L;F!==null;){if(F.tag===13){var W=F.memoizedState;if(W!==null&&(W=W.dehydrated,W===null||Pa(W)||aa(W)))return F}else if(F.tag===19&&F.memoizedProps.revealOrder!==void 0){if(F.flags&128)return F}else if(F.child!==null){F.child.return=F,F=F.child;continue}if(F===L)break;for(;F.sibling===null;){if(F.return===null||F.return===L)return null;F=F.return}F.sibling.return=F.return,F=F.sibling}return null}var vt=[];function Ft(){for(var L=0;LW?W:4,L(!0);var $=Ut.transition;Ut.transition={};try{L(!1),F()}finally{Ni=W,Ut.transition=$}}function lp(){return Ze().memoizedState}function _n(L,F,W){var $=va(L);W={lane:$,action:W,hasEagerState:!1,eagerState:null,next:null},hp(L)?up(F,W):(fc(L,F,W),W=wr(),L=As(L,$,W),L!==null&&fp(L,F,$))}function Er(L,F,W){var $=va(L),it={lane:$,action:W,hasEagerState:!1,eagerState:null,next:null};if(hp(L))up(F,it);else{fc(L,F,it);var lt=L.alternate;if(L.lanes===0&&(lt===null||lt.lanes===0)&&(lt=F.lastRenderedReducer,lt!==null))try{var wt=F.lastRenderedState,Xt=lt(wt,W);if(it.hasEagerState=!0,it.eagerState=Xt,Ts(Xt,wt))return}catch{}finally{}W=wr(),L=As(L,$,W),L!==null&&fp(L,F,$)}}function hp(L){var F=L.alternate;return L===It||F!==null&&F===It}function up(L,F){se=$t=!0;var W=L.pending;W===null?F.next=F:(F.next=W.next,W.next=F),L.pending=F}function fc(L,F,W){Wn!==null&&L.mode&1&&!(Ei&2)?(L=F.interleaved,L===null?(W.next=W,Wr===null?Wr=[F]:Wr.push(F)):(W.next=L.next,L.next=W),F.interleaved=W):(L=F.pending,L===null?W.next=W:(W.next=L.next,L.next=W),F.pending=W)}function fp(L,F,W){if(W&4194240){var $=F.lanes;$&=L.pendingLanes,W|=$,F.lanes=W,bl(L,W)}}var zl={readContext:$i,useCallback:pe,useContext:pe,useEffect:pe,useImperativeHandle:pe,useInsertionEffect:pe,useLayoutEffect:pe,useMemo:pe,useReducer:pe,useRef:pe,useState:pe,useDebugValue:pe,useDeferredValue:pe,useTransition:pe,useMutableSource:pe,useSyncExternalStore:pe,useId:pe,unstable_isNewReconciler:!1},Fh={readContext:$i,useCallback:function(L,F){return _e().memoizedState=[L,F===void 0?null:F],L},useContext:$i,useEffect:Ul,useImperativeHandle:function(L,F,W){return W=W!=null?W.concat([L]):null,xo(4194308,4,Rh.bind(null,F,L),W)},useLayoutEffect:function(L,F){return xo(4194308,4,L,F)},useInsertionEffect:function(L,F){return xo(4,2,L,F)},useMemo:function(L,F){var W=_e();return F=F===void 0?null:F,L=L(),W.memoizedState=[L,F],L},useReducer:function(L,F,W){var $=_e();return F=W!==void 0?W(F):F,$.memoizedState=$.baseState=F,L={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:L,lastRenderedState:F},$.queue=L,L=L.dispatch=_n.bind(null,It,L),[$.memoizedState,L]},useRef:function(L){var F=_e();return L={current:L},F.memoizedState=L},useState:go,useDebugValue:Lh,useDeferredValue:function(L){var F=go(L),W=F[0],$=F[1];return Ul(function(){var it=Ut.transition;Ut.transition={};try{$(L)}finally{Ut.transition=it}},[L]),W},useTransition:function(){var L=go(!1),F=L[0];return L=Lg.bind(null,L[1]),_e().memoizedState=L,[F,L]},useMutableSource:function(){},useSyncExternalStore:function(L,F,W){var $=It,it=_e();if(_i){if(W===void 0)throw Error(s(407));W=W()}else{if(W=F(),Wn===null)throw Error(s(349));Wt&30||Cn($,F,W)}it.memoizedState=W;var lt={value:W,getSnapshot:F};return it.queue=lt,Ul(bn.bind(null,$,lt,L),[L]),$.flags|=2048,yo(9,mo.bind(null,$,lt,W,F),void 0,null),W},useId:function(){var L=_e(),F=Wn.identifierPrefix;if(_i){var W=es,$=Es;W=($&~(1<<32-Jn($)-1)).toString(32)+W,F=":"+F+"R"+W,W=ue++,0zh&&(F.flags|=128,$=!0,Mr(it,!1),F.lanes=4194304)}else{if(!$)if(L=St(lt),L!==null){if(F.flags|=128,$=!0,L=L.updateQueue,L!==null&&(F.updateQueue=L,F.flags|=4),Mr(it,!0),it.tail===null&&it.tailMode==="hidden"&&!lt.alternate&&!_i)return ni(F),null}else 2*nn()-it.renderingStartTime>zh&&W!==1073741824&&(F.flags|=128,$=!0,Mr(it,!1),F.lanes=4194304);it.isBackwards?(lt.sibling=F.child,F.child=lt):(L=it.last,L!==null?L.sibling=lt:F.child=lt,it.last=lt)}return it.tail!==null?(F=it.tail,it.rendering=F,it.tail=F.sibling,it.renderingStartTime=nn(),F.sibling=null,L=ct.current,Se(ct,$?L&1|2:L&1),F):(ni(F),null);case 22:case 23:return Rc(),$=F.memoizedState!==null,L!==null&&L.memoizedState!==null!==$&&(F.flags|=8192),$&&F.mode&1?os&1073741824&&(ni(F),ot&&F.subtreeFlags&6&&(F.flags|=8192)):ni(F),null;case 24:return null;case 25:return null}throw Error(s(156,F.tag))}var Og=y.ReactCurrentOwner,rs=!1;function Ln(L,F,W,$){F.child=L===null?Ah(F,null,W,$):Gr(F,L.child,W,$)}function mp(L,F,W,$,it){W=W.render;var lt=F.ref;return Xs(F,it),$=me(L,F,W,$,lt,it),W=be(),L!==null&&!rs?(F.updateQueue=L.updateQueue,F.flags&=-2053,L.lanes&=~it,qn(L,F,it)):(_i&&W&&Bl(F),F.flags|=1,Ln(L,F,$,it),F.child)}function gp(L,F,W,$,it){if(L===null){var lt=W.type;return typeof lt=="function"&&!Ic(lt)&<.defaultProps===void 0&&W.compare===null&&W.defaultProps===void 0?(F.tag=15,F.type=lt,yp(L,F,lt,$,it)):(L=ef(W.type,null,$,F,F.mode,it),L.ref=F.ref,L.return=F,F.child=L)}if(lt=L.child,!(L.lanes&it)){var wt=lt.memoizedProps;if(W=W.compare,W=W!==null?W:gn,W(wt,$)&&L.ref===F.ref)return qn(L,F,it)}return F.flags|=1,L=Ka(lt,$),L.ref=F.ref,L.return=F,F.child=L}function yp(L,F,W,$,it){if(L!==null&&gn(L.memoizedProps,$)&&L.ref===F.ref)if(rs=!1,(L.lanes&it)!==0)L.flags&131072&&(rs=!0);else return F.lanes=L.lanes,qn(L,F,it);return ks(L,F,W,$,it)}function xp(L,F,W){var $=F.pendingProps,it=$.children,lt=L!==null?L.memoizedState:null;if($.mode==="hidden")if(!(F.mode&1))F.memoizedState={baseLanes:0,cachePool:null},Se(Yl,os),os|=W;else if(W&1073741824)F.memoizedState={baseLanes:0,cachePool:null},$=lt!==null?lt.baseLanes:W,Se(Yl,os),os|=$;else return L=lt!==null?lt.baseLanes|W:W,F.lanes=F.childLanes=1073741824,F.memoizedState={baseLanes:L,cachePool:null},F.updateQueue=null,Se(Yl,os),os|=L,null;else lt!==null?($=lt.baseLanes|W,F.memoizedState=null):$=W,Se(Yl,os),os|=$;return Ln(L,F,it,W),F.child}function Sp(L,F){var W=F.ref;(L===null&&W!==null||L!==null&&L.ref!==W)&&(F.flags|=512,F.flags|=2097152)}function ks(L,F,W,$,it){var lt=pn(W)?Ii:mi.current;return lt=Gn(F,lt),Xs(F,it),W=me(L,F,W,$,lt,it),$=be(),L!==null&&!rs?(F.updateQueue=L.updateQueue,F.flags&=-2053,L.lanes&=~it,qn(L,F,it)):(_i&&$&&Bl(F),F.flags|=1,Ln(L,F,W,it),F.child)}function Tp(L,F,W,$,it){if(pn(W)){var lt=!0;Tn(F)}else lt=!1;if(Xs(F,it),F.stateNode===null)L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),Ko(F,W,$),za(F,W,$,it),$=!0;else if(L===null){var wt=F.stateNode,Xt=F.memoizedProps;wt.props=Xt;var ae=wt.context,Ee=W.contextType;typeof Ee=="object"&&Ee!==null?Ee=$i(Ee):(Ee=pn(W)?Ii:mi.current,Ee=Gn(F,Ee));var He=W.getDerivedStateFromProps,vi=typeof He=="function"||typeof wt.getSnapshotBeforeUpdate=="function";vi||typeof wt.UNSAFE_componentWillReceiveProps!="function"&&typeof wt.componentWillReceiveProps!="function"||(Xt!==$||ae!==Ee)&&jo(F,wt,$,Ee),yn=!1;var Qe=F.memoizedState;wt.state=Qe,Xr(F,$,wt,it),ae=F.memoizedState,Xt!==$||Qe!==ae||un.current||yn?(typeof He=="function"&&(qr(F,W,He,$),ae=F.memoizedState),(Xt=yn||Nl(F,W,Xt,$,Qe,ae,Ee))?(vi||typeof wt.UNSAFE_componentWillMount!="function"&&typeof wt.componentWillMount!="function"||(typeof wt.componentWillMount=="function"&&wt.componentWillMount(),typeof wt.UNSAFE_componentWillMount=="function"&&wt.UNSAFE_componentWillMount()),typeof wt.componentDidMount=="function"&&(F.flags|=4194308)):(typeof wt.componentDidMount=="function"&&(F.flags|=4194308),F.memoizedProps=$,F.memoizedState=ae),wt.props=$,wt.state=ae,wt.context=Ee,$=Xt):(typeof wt.componentDidMount=="function"&&(F.flags|=4194308),$=!1)}else{wt=F.stateNode,Ba(L,F),Xt=F.memoizedProps,Ee=F.type===F.elementType?Xt:Rn(F.type,Xt),wt.props=Ee,vi=F.pendingProps,Qe=wt.context,ae=W.contextType,typeof ae=="object"&&ae!==null?ae=$i(ae):(ae=pn(W)?Ii:mi.current,ae=Gn(F,ae));var qi=W.getDerivedStateFromProps;(He=typeof qi=="function"||typeof wt.getSnapshotBeforeUpdate=="function")||typeof wt.UNSAFE_componentWillReceiveProps!="function"&&typeof wt.componentWillReceiveProps!="function"||(Xt!==vi||Qe!==ae)&&jo(F,wt,$,ae),yn=!1,Qe=F.memoizedState,wt.state=Qe,Xr(F,$,wt,it);var Xe=F.memoizedState;Xt!==vi||Qe!==Xe||un.current||yn?(typeof qi=="function"&&(qr(F,W,qi,$),Xe=F.memoizedState),(Ee=yn||Nl(F,W,Ee,$,Qe,Xe,ae)||!1)?(He||typeof wt.UNSAFE_componentWillUpdate!="function"&&typeof wt.componentWillUpdate!="function"||(typeof wt.componentWillUpdate=="function"&&wt.componentWillUpdate($,Xe,ae),typeof wt.UNSAFE_componentWillUpdate=="function"&&wt.UNSAFE_componentWillUpdate($,Xe,ae)),typeof wt.componentDidUpdate=="function"&&(F.flags|=4),typeof wt.getSnapshotBeforeUpdate=="function"&&(F.flags|=1024)):(typeof wt.componentDidUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=4),typeof wt.getSnapshotBeforeUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=1024),F.memoizedProps=$,F.memoizedState=Xe),wt.props=$,wt.state=Xe,wt.context=ae,$=Ee):(typeof wt.componentDidUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=4),typeof wt.getSnapshotBeforeUpdate!="function"||Xt===L.memoizedProps&&Qe===L.memoizedState||(F.flags|=1024),$=!1)}return dc(L,F,W,$,lt,it)}function dc(L,F,W,$,it,lt){Sp(L,F);var wt=(F.flags&128)!==0;if(!$&&!wt)return it&&oa(F,W,!1),qn(L,F,lt);$=F.stateNode,Og.current=F;var Xt=wt&&typeof W.getDerivedStateFromError!="function"?null:$.render();return F.flags|=1,L!==null&&wt?(F.child=Gr(F,L.child,null,lt),F.child=Gr(F,null,Xt,lt)):Ln(L,F,Xt,lt),F.memoizedState=$.state,it&&oa(F,W,!0),F.child}function Ep(L){var F=L.stateNode;F.pendingContext?dr(L,F.pendingContext,F.pendingContext!==F.context):F.context&&dr(L,F.context,!1),pt(L,F.containerInfo)}function Mp(L,F,W,$,it){return vo(),Ga(it),F.flags|=256,Ln(L,F,W,$),F.child}var Vu={dehydrated:null,treeContext:null,retryLane:0};function ws(L){return{baseLanes:L,cachePool:null}}function Cp(L,F,W){var $=F.pendingProps,it=ct.current,lt=!1,wt=(F.flags&128)!==0,Xt;if((Xt=wt)||(Xt=L!==null&&L.memoizedState===null?!1:(it&2)!==0),Xt?(lt=!0,F.flags&=-129):(L===null||L.memoizedState!==null)&&(it|=1),Se(ct,it&1),L===null)return cn(F),L=F.memoizedState,L!==null&&(L=L.dehydrated,L!==null)?(F.mode&1?aa(L)?F.lanes=8:F.lanes=1073741824:F.lanes=1,null):(it=$.children,L=$.fallback,lt?($=F.mode,lt=F.child,it={mode:"hidden",children:it},!($&1)&<!==null?(lt.childLanes=0,lt.pendingProps=it):lt=Xh(it,$,0,null),L=bo(L,$,W,null),lt.return=F,L.return=F,lt.sibling=L,F.child=lt,F.child.memoizedState=ws(W),F.memoizedState=Vu,L):pc(F,it));if(it=L.memoizedState,it!==null){if(Xt=it.dehydrated,Xt!==null){if(wt)return F.flags&256?(F.flags&=-257,Hu(L,F,W,Error(s(422)))):F.memoizedState!==null?(F.child=L.child,F.flags|=128,null):(lt=$.fallback,it=F.mode,$=Xh({mode:"visible",children:$.children},it,0,null),lt=bo(lt,it,W,null),lt.flags|=2,$.return=F,lt.return=F,$.sibling=lt,F.child=$,F.mode&1&&Gr(F,L.child,null,W),F.child.memoizedState=ws(W),F.memoizedState=Vu,lt);if(!(F.mode&1))F=Hu(L,F,W,null);else if(aa(Xt))F=Hu(L,F,W,Error(s(419)));else if($=(W&L.childLanes)!==0,rs||$){if($=Wn,$!==null){switch(W&-W){case 4:lt=2;break;case 16:lt=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:lt=32;break;case 536870912:lt=268435456;break;default:lt=0}$=lt&($.suspendedLanes|W)?0:lt,$!==0&&$!==it.retryLane&&(it.retryLane=$,As(L,$,-1))}_u(),F=Hu(L,F,W,Error(s(421)))}else Pa(Xt)?(F.flags|=128,F.child=L.child,F=Ro.bind(null,L),Bs(Xt,F),F=null):(W=it.treeContext,gt&&(Hn=Us(Xt),$n=F,_i=!0,is=null,po=!1,W!==null&&(sr[ar++]=Es,sr[ar++]=es,sr[ar++]=fa,Es=W.id,es=W.overflow,fa=F)),F=pc(F,F.pendingProps.children),F.flags|=4096);return F}return lt?($=Ap(L,F,$.children,$.fallback,W),lt=F.child,it=L.child.memoizedState,lt.memoizedState=it===null?ws(W):{baseLanes:it.baseLanes|W,cachePool:null},lt.childLanes=L.childLanes&~W,F.memoizedState=Vu,$):(W=wp(L,F,$.children,W),F.memoizedState=null,W)}return lt?($=Ap(L,F,$.children,$.fallback,W),lt=F.child,it=L.child.memoizedState,lt.memoizedState=it===null?ws(W):{baseLanes:it.baseLanes|W,cachePool:null},lt.childLanes=L.childLanes&~W,F.memoizedState=Vu,$):(W=wp(L,F,$.children,W),F.memoizedState=null,W)}function pc(L,F){return F=Xh({mode:"visible",children:F},L.mode,0,null),F.return=L,L.child=F}function wp(L,F,W,$){var it=L.child;return L=it.sibling,W=Ka(it,{mode:"visible",children:W}),!(F.mode&1)&&(W.lanes=$),W.return=F,W.sibling=null,L!==null&&($=F.deletions,$===null?(F.deletions=[L],F.flags|=16):$.push(L)),F.child=W}function Ap(L,F,W,$,it){var lt=F.mode;L=L.child;var wt=L.sibling,Xt={mode:"hidden",children:W};return!(lt&1)&&F.child!==L?(W=F.child,W.childLanes=0,W.pendingProps=Xt,F.deletions=null):(W=Ka(L,Xt),W.subtreeFlags=L.subtreeFlags&14680064),wt!==null?$=Ka(wt,$):($=bo($,lt,it,null),$.flags|=2),$.return=F,W.return=F,W.sibling=$,F.child=W,$}function Hu(L,F,W,$){return $!==null&&Ga($),Gr(F,L.child,null,W),L=pc(F,F.pendingProps.children),L.flags|=2,F.memoizedState=null,L}function So(L,F,W){L.lanes|=F;var $=L.alternate;$!==null&&($.lanes|=F),Na(L.return,F,W)}function vc(L,F,W,$,it){var lt=L.memoizedState;lt===null?L.memoizedState={isBackwards:F,rendering:null,renderingStartTime:0,last:$,tail:W,tailMode:it}:(lt.isBackwards=F,lt.rendering=null,lt.renderingStartTime=0,lt.last=$,lt.tail=W,lt.tailMode=it)}function Pp(L,F,W){var $=F.pendingProps,it=$.revealOrder,lt=$.tail;if(Ln(L,F,$.children,W),$=ct.current,$&2)$=$&1|2,F.flags|=128;else{if(L!==null&&L.flags&128)t:for(L=F.child;L!==null;){if(L.tag===13)L.memoizedState!==null&&So(L,W,F);else if(L.tag===19)So(L,W,F);else if(L.child!==null){L.child.return=L,L=L.child;continue}if(L===F)break t;for(;L.sibling===null;){if(L.return===null||L.return===F)break t;L=L.return}L.sibling.return=L.return,L=L.sibling}$&=1}if(Se(ct,$),!(F.mode&1))F.memoizedState=null;else switch(it){case"forwards":for(W=F.child,it=null;W!==null;)L=W.alternate,L!==null&&St(L)===null&&(it=W),W=W.sibling;W=it,W===null?(it=F.child,F.child=null):(it=W.sibling,W.sibling=null),vc(F,!1,it,W,lt);break;case"backwards":for(W=null,it=F.child,F.child=null;it!==null;){if(L=it.alternate,L!==null&&St(L)===null){F.child=it;break}L=it.sibling,it.sibling=W,W=it,it=L}vc(F,!0,W,null,lt);break;case"together":vc(F,!1,null,null,void 0);break;default:F.memoizedState=null}return F.child}function qn(L,F,W){if(L!==null&&(F.dependencies=L.dependencies),Kl|=F.lanes,!(W&F.childLanes))return null;if(L!==null&&F.child!==L.child)throw Error(s(153));if(F.child!==null){for(L=F.child,W=Ka(L,L.pendingProps),F.child=W,W.return=F;L.sibling!==null;)L=L.sibling,W=W.sibling=Ka(L,L.pendingProps),W.return=F;W.sibling=null}return F.child}function Dg(L,F,W){switch(F.tag){case 3:Ep(F),vo();break;case 5:Nt(F);break;case 1:pn(F.type)&&Tn(F);break;case 4:pt(F,F.stateNode.containerInfo);break;case 10:Ol(F,F.type._context,F.memoizedProps.value);break;case 13:var $=F.memoizedState;if($!==null)return $.dehydrated!==null?(Se(ct,ct.current&1),F.flags|=128,null):W&F.child.childLanes?Cp(L,F,W):(Se(ct,ct.current&1),L=qn(L,F,W),L!==null?L.sibling:null);Se(ct,ct.current&1);break;case 19:if($=(W&F.childLanes)!==0,L.flags&128){if($)return Pp(L,F,W);F.flags|=128}var it=F.memoizedState;if(it!==null&&(it.rendering=null,it.tail=null,it.lastEffect=null),Se(ct,ct.current),$)break;return null;case 22:case 23:return F.lanes=0,xp(L,F,W)}return qn(L,F,W)}function Ig(L,F){switch(or(F),F.tag){case 1:return pn(F.type)&&Ki(),L=F.flags,L&65536?(F.flags=L&-65537|128,F):null;case 3:return Mt(),ti(un),ti(mi),Ft(),L=F.flags,L&65536&&!(L&128)?(F.flags=L&-65537|128,F):null;case 5:return zt(F),null;case 13:if(ti(ct),L=F.memoizedState,L!==null&&L.dehydrated!==null){if(F.alternate===null)throw Error(s(340));vo()}return L=F.flags,L&65536?(F.flags=L&-65537|128,F):null;case 19:return ti(ct),null;case 4:return Mt(),null;case 10:return Dl(F.type._context),null;case 22:case 23:return Rc(),null;case 24:return null;default:return null}}var Wu=!1,qo=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,De=null;function Ih(L,F){var W=L.ref;if(W!==null)if(typeof W=="function")try{W(null)}catch($){Pr(L,F,$)}else W.current=null}function mc(L,F,W){try{W()}catch($){Pr(L,F,$)}}var Rp=!1;function gc(L,F){for(X(L.containerInfo),De=F;De!==null;)if(L=De,F=L.child,(L.subtreeFlags&1028)!==0&&F!==null)F.return=L,De=F;else for(;De!==null;){L=De;try{var W=L.alternate;if(L.flags&1024)switch(L.tag){case 0:case 11:case 15:break;case 1:if(W!==null){var $=W.memoizedProps,it=W.memoizedState,lt=L.stateNode,wt=lt.getSnapshotBeforeUpdate(L.elementType===L.type?$:Rn(L.type,$),it);lt.__reactInternalSnapshotBeforeUpdate=wt}break;case 3:ot&&Me(L.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(Xt){Pr(L,L.return,Xt)}if(F=L.sibling,F!==null){F.return=L.return,De=F;break}De=L.return}return W=Rp,Rp=!1,W}function Ks(L,F,W){var $=F.updateQueue;if($=$!==null?$.lastEffect:null,$!==null){var it=$=$.next;do{if((it.tag&L)===L){var lt=it.destroy;it.destroy=void 0,lt!==void 0&&mc(F,W,lt)}it=it.next}while(it!==$)}}function To(L,F){if(F=F.updateQueue,F=F!==null?F.lastEffect:null,F!==null){var W=F=F.next;do{if((W.tag&L)===L){var $=W.create;W.destroy=$()}W=W.next}while(W!==F)}}function yc(L){var F=L.ref;if(F!==null){var W=L.stateNode;switch(L.tag){case 5:L=B(W);break;default:L=W}typeof F=="function"?F(L):F.current=L}}function xc(L,F,W){if(xr&&typeof xr.onCommitFiberUnmount=="function")try{xr.onCommitFiberUnmount(fo,F)}catch{}switch(F.tag){case 0:case 11:case 14:case 15:if(L=F.updateQueue,L!==null&&(L=L.lastEffect,L!==null)){var $=L=L.next;do{var it=$,lt=it.destroy;it=it.tag,lt!==void 0&&(it&2||it&4)&&mc(F,W,lt),$=$.next}while($!==L)}break;case 1:if(Ih(F,W),L=F.stateNode,typeof L.componentWillUnmount=="function")try{L.props=F.memoizedProps,L.state=F.memoizedState,L.componentWillUnmount()}catch(wt){Pr(F,W,wt)}break;case 5:Ih(F,W);break;case 4:ot?Tc(L,F,W):rt&&rt&&(F=F.stateNode.containerInfo,W=Ve(F),Di(F,W))}}function bp(L,F,W){for(var $=F;;)if(xc(L,$,W),$.child===null||ot&&$.tag===4){if($===F)break;for(;$.sibling===null;){if($.return===null||$.return===F)return;$=$.return}$.sibling.return=$.return,$=$.sibling}else $.child.return=$,$=$.child}function pa(L){var F=L.alternate;F!==null&&(L.alternate=null,pa(F)),L.child=null,L.deletions=null,L.sibling=null,L.tag===5&&(F=L.stateNode,F!==null&&Pt(F)),L.stateNode=null,L.return=null,L.dependencies=null,L.memoizedProps=null,L.memoizedState=null,L.pendingProps=null,L.stateNode=null,L.updateQueue=null}function Xu(L){return L.tag===5||L.tag===3||L.tag===4}function Eo(L){t:for(;;){for(;L.sibling===null;){if(L.return===null||Xu(L.return))return null;L=L.return}for(L.sibling.return=L.return,L=L.sibling;L.tag!==5&&L.tag!==6&&L.tag!==18;){if(L.flags&2||L.child===null||L.tag===4)continue t;L.child.return=L,L=L.child}if(!(L.flags&2))return L.stateNode}}function ss(L){if(ot){t:{for(var F=L.return;F!==null;){if(Xu(F))break t;F=F.return}throw Error(s(160))}var W=F;switch(W.tag){case 5:F=W.stateNode,W.flags&32&&(ri(F),W.flags&=-33),W=Eo(L),Yu(L,W,F);break;case 3:case 4:F=W.stateNode.containerInfo,W=Eo(L),Sc(L,W,F);break;default:throw Error(s(161))}}}function Sc(L,F,W){var $=L.tag;if($===5||$===6)L=L.stateNode,F?Le(W,L,F):Ae(W,L);else if($!==4&&(L=L.child,L!==null))for(Sc(L,F,W),L=L.sibling;L!==null;)Sc(L,F,W),L=L.sibling}function Yu(L,F,W){var $=L.tag;if($===5||$===6)L=L.stateNode,F?Be(W,L,F):xe(W,L);else if($!==4&&(L=L.child,L!==null))for(Yu(L,F,W),L=L.sibling;L!==null;)Yu(L,F,W),L=L.sibling}function Tc(L,F,W){for(var $=F,it=!1,lt,wt;;){if(!it){it=$.return;t:for(;;){if(it===null)throw Error(s(160));switch(lt=it.stateNode,it.tag){case 5:wt=!1;break t;case 3:lt=lt.containerInfo,wt=!0;break t;case 4:lt=lt.containerInfo,wt=!0;break t}it=it.return}it=!0}if($.tag===5||$.tag===6)bp(L,$,W),wt?Ke(lt,$.stateNode):ie(lt,$.stateNode);else if($.tag===18)wt?te(lt,$.stateNode):ee(lt,$.stateNode);else if($.tag===4){if($.child!==null){lt=$.stateNode.containerInfo,wt=!0,$.child.return=$,$=$.child;continue}}else if(xc(L,$,W),$.child!==null){$.child.return=$,$=$.child;continue}if($===F)break;for(;$.sibling===null;){if($.return===null||$.return===F)return;$=$.return,$.tag===4&&(it=!1)}$.sibling.return=$.return,$=$.sibling}}function tl(L,F){if(ot){switch(F.tag){case 0:case 11:case 14:case 15:Ks(3,F,F.return),To(3,F),Ks(5,F,F.return);return;case 1:return;case 5:var W=F.stateNode;if(W!=null){var $=F.memoizedProps;L=L!==null?L.memoizedProps:$;var it=F.type,lt=F.updateQueue;F.updateQueue=null,lt!==null&&Oe(W,lt,it,L,$,F)}return;case 6:if(F.stateNode===null)throw Error(s(162));W=F.memoizedProps,qt(F.stateNode,L!==null?L.memoizedProps:W,W);return;case 3:gt&&L!==null&&L.memoizedState.isDehydrated&&jt(F.stateNode.containerInfo);return;case 12:return;case 13:js(F);return;case 19:js(F);return;case 17:return}throw Error(s(163))}switch(F.tag){case 0:case 11:case 14:case 15:Ks(3,F,F.return),To(3,F),Ks(5,F,F.return);return;case 12:return;case 13:js(F);return;case 19:js(F);return;case 3:gt&&L!==null&&L.memoizedState.isDehydrated&&jt(F.stateNode.containerInfo);break;case 22:case 23:return}t:if(rt){switch(F.tag){case 1:case 5:case 6:break t;case 3:case 4:F=F.stateNode,Di(F.containerInfo,F.pendingChildren);break t}throw Error(s(163))}}function js(L){var F=L.updateQueue;if(F!==null){L.updateQueue=null;var W=L.stateNode;W===null&&(W=L.stateNode=new Ng),F.forEach(function($){var it=Up.bind(null,L,$);W.has($)||(W.add($),$.then(it,it))})}}function Lp(L,F){for(De=F;De!==null;){F=De;var W=F.deletions;if(W!==null)for(var $=0;$";case Bh:return":has("+(Uh(L)||"")+")";case as:return'[role="'+L.value+'"]';case el:return'"'+L.value+'"';case Wl:return'[data-testname="'+L.value+'"]';default:throw Error(s(365))}}function Op(L,F){var W=[];L=[L,0];for(var $=0;$it&&(it=wt),$&=~lt}if($=it,$=nn()-$,$=(120>$?120:480>$?480:1080>$?1080:1920>$?1920:3e3>$?3e3:4320>$?4320:1960*Ug($/1960))-$,10<$){L.timeoutHandle=J(wo.bind(null,L,Cr),$);break}wo(L,Cr);break;case 5:wo(L,Cr);break;default:throw Error(s(329))}}}return ei(L,nn()),L.callbackNode===W?Dp.bind(null,L):null}function Pc(L,F){var W=jl;return L.current.memoizedState.isDehydrated&&(ma(L,F).flags|=256),L=Ar(L,F),L!==2&&(F=Cr,Cr=W,F!==null&&nl(F)),L}function nl(L){Cr===null?Cr=L:Cr.push.apply(Cr,L)}function Ip(L){for(var F=L;;){if(F.flags&16384){var W=F.updateQueue;if(W!==null&&(W=W.stores,W!==null))for(var $=0;$L?16:L,ka===null)var $=!1;else{if(L=ka,ka=null,Vh=0,Ei&6)throw Error(s(331));var it=Ei;for(Ei|=4,De=L.current;De!==null;){var lt=De,wt=lt.child;if(De.flags&16){var Xt=lt.deletions;if(Xt!==null){for(var ae=0;aenn()-Ac?ma(L,0):wc|=W),ei(L,F)}function Bp(L,F){F===0&&(L.mode&1?(F=ho,ho<<=1,!(ho&130023424)&&(ho=4194304)):F=1);var W=wr();L=Jl(L,F),L!==null&&(Hs(L,F,W),ei(L,W))}function Ro(L){var F=L.memoizedState,W=0;F!==null&&(W=F.retryLane),Bp(L,W)}function Up(L,F){var W=0;switch(L.tag){case 13:var $=L.stateNode,it=L.memoizedState;it!==null&&(W=it.retryLane);break;case 19:$=L.stateNode;break;default:throw Error(s(314))}$!==null&&$.delete(F),Bp(L,W)}var Dc;Dc=function(L,F,W){if(L!==null)if(L.memoizedProps!==F.pendingProps||un.current)rs=!0;else{if(!(L.lanes&W)&&!(F.flags&128))return rs=!1,Dg(L,F,W);rs=!!(L.flags&131072)}else rs=!1,_i&&F.flags&1048576&&wh(F,Zo,F.index);switch(F.lanes=0,F.tag){case 2:var $=F.type;L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),L=F.pendingProps;var it=Gn(F,mi.current);Xs(F,W),it=me(null,F,$,L,it,W);var lt=be();return F.flags|=1,typeof it=="object"&&it!==null&&typeof it.render=="function"&&it.$$typeof===void 0?(F.tag=1,F.memoizedState=null,F.updateQueue=null,pn($)?(lt=!0,Tn(F)):lt=!1,F.memoizedState=it.state!==null&&it.state!==void 0?it.state:null,Vn(F),it.updater=co,F.stateNode=it,it._reactInternals=F,za(F,$,L,W),F=dc(null,F,$,!0,lt,W)):(F.tag=0,_i&<&&Bl(F),Ln(null,F,it,W),F=F.child),F;case 16:$=F.elementType;t:{switch(L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),L=F.pendingProps,it=$._init,$=it($._payload),F.type=$,it=F.tag=zp($),L=Rn($,L),it){case 0:F=ks(null,F,$,L,W);break t;case 1:F=Tp(null,F,$,L,W);break t;case 11:F=mp(null,F,$,L,W);break t;case 14:F=gp(null,F,$,Rn($.type,L),W);break t}throw Error(s(306,$,""))}return F;case 0:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:Rn($,it),ks(L,F,$,it,W);case 1:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:Rn($,it),Tp(L,F,$,it,W);case 3:t:{if(Ep(F),L===null)throw Error(s(387));$=F.pendingProps,lt=F.memoizedState,it=lt.element,Ba(L,F),Xr(F,$,null,W);var wt=F.memoizedState;if($=wt.element,gt&<.isDehydrated)if(lt={element:$,isDehydrated:!1,cache:wt.cache,transitions:wt.transitions},F.updateQueue.baseState=lt,F.memoizedState=lt,F.flags&256){it=Error(s(423)),F=Mp(L,F,$,W,it);break t}else if($!==it){it=Error(s(424)),F=Mp(L,F,$,W,it);break t}else for(gt&&(Hn=_r(F.stateNode.containerInfo),$n=F,_i=!0,is=null,po=!1),W=Ah(F,null,$,W),F.child=W;W;)W.flags=W.flags&-3|4096,W=W.sibling;else{if(vo(),$===it){F=qn(L,F,W);break t}Ln(L,F,$,W)}F=F.child}return F;case 5:return Nt(F),L===null&&cn(F),$=F.type,it=F.pendingProps,lt=L!==null?L.memoizedProps:null,wt=it.children,U($,it)?wt=null:lt!==null&&U($,lt)&&(F.flags|=32),Sp(L,F),Ln(L,F,wt,W),F.child;case 6:return L===null&&cn(F),null;case 13:return Cp(L,F,W);case 4:return pt(F,F.stateNode.containerInfo),$=F.pendingProps,L===null?F.child=Gr(F,null,$,W):Ln(L,F,$,W),F.child;case 11:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:Rn($,it),mp(L,F,$,it,W);case 7:return Ln(L,F,F.pendingProps,W),F.child;case 8:return Ln(L,F,F.pendingProps.children,W),F.child;case 12:return Ln(L,F,F.pendingProps.children,W),F.child;case 10:t:{if($=F.type._context,it=F.pendingProps,lt=F.memoizedProps,wt=it.value,Ol(F,$,wt),lt!==null)if(Ts(lt.value,wt)){if(lt.children===it.children&&!un.current){F=qn(L,F,W);break t}}else for(lt=F.child,lt!==null&&(lt.return=F);lt!==null;){var Xt=lt.dependencies;if(Xt!==null){wt=lt.child;for(var ae=Xt.firstContext;ae!==null;){if(ae.context===$){if(lt.tag===1){ae=Mn(-1,W&-W),ae.tag=2;var Ee=lt.updateQueue;if(Ee!==null){Ee=Ee.shared;var He=Ee.pending;He===null?ae.next=ae:(ae.next=He.next,He.next=ae),Ee.pending=ae}}lt.lanes|=W,ae=lt.alternate,ae!==null&&(ae.lanes|=W),Na(lt.return,W,F),Xt.lanes|=W;break}ae=ae.next}}else if(lt.tag===10)wt=lt.type===F.type?null:lt.child;else if(lt.tag===18){if(wt=lt.return,wt===null)throw Error(s(341));wt.lanes|=W,Xt=wt.alternate,Xt!==null&&(Xt.lanes|=W),Na(wt,W,F),wt=lt.sibling}else wt=lt.child;if(wt!==null)wt.return=lt;else for(wt=lt;wt!==null;){if(wt===F){wt=null;break}if(lt=wt.sibling,lt!==null){lt.return=wt.return,wt=lt;break}wt=wt.return}lt=wt}Ln(L,F,it.children,W),F=F.child}return F;case 9:return it=F.type,$=F.pendingProps.children,Xs(F,W),it=$i(it),$=$(it),F.flags|=1,Ln(L,F,$,W),F.child;case 14:return $=F.type,it=Rn($,F.pendingProps),it=Rn($.type,it),gp(L,F,$,it,W);case 15:return yp(L,F,F.type,F.pendingProps,W);case 17:return $=F.type,it=F.pendingProps,it=F.elementType===$?it:Rn($,it),L!==null&&(L.alternate=null,F.alternate=null,F.flags|=2),F.tag=1,pn($)?(L=!0,Tn(F)):L=!1,Xs(F,W),Ko(F,$,it),za(F,$,it,W),dc(null,F,$,!0,L,W);case 19:return Pp(L,F,W);case 22:return xp(L,F,W)}throw Error(s(156,F.tag))};function tf(L,F){return Br(L,F)}function zg(L,F,W,$){this.tag=L,this.key=W,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=F,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=$,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ps(L,F,W,$){return new zg(L,F,W,$)}function Ic(L){return L=L.prototype,!(!L||!L.isReactComponent)}function zp(L){if(typeof L=="function")return Ic(L)?1:0;if(L!=null){if(L=L.$$typeof,L===u)return 11;if(L===c)return 14}return 2}function Ka(L,F){var W=L.alternate;return W===null?(W=Ps(L.tag,F,L.key,L.mode),W.elementType=L.elementType,W.type=L.type,W.stateNode=L.stateNode,W.alternate=L,L.alternate=W):(W.pendingProps=F,W.type=L.type,W.flags=0,W.subtreeFlags=0,W.deletions=null),W.flags=L.flags&14680064,W.childLanes=L.childLanes,W.lanes=L.lanes,W.child=L.child,W.memoizedProps=L.memoizedProps,W.memoizedState=L.memoizedState,W.updateQueue=L.updateQueue,F=L.dependencies,W.dependencies=F===null?null:{lanes:F.lanes,firstContext:F.firstContext},W.sibling=L.sibling,W.index=L.index,W.ref=L.ref,W}function ef(L,F,W,$,it,lt){var wt=2;if($=L,typeof L=="function")Ic(L)&&(wt=1);else if(typeof L=="string")wt=5;else t:switch(L){case p:return bo(W.children,it,lt,F);case h:wt=8,it|=8;break;case a:return L=Ps(12,W,F,it|2),L.elementType=a,L.lanes=lt,L;case f:return L=Ps(13,W,F,it),L.elementType=f,L.lanes=lt,L;case o:return L=Ps(19,W,F,it),L.elementType=o,L.lanes=lt,L;case v:return Xh(W,it,lt,F);default:if(typeof L=="object"&&L!==null)switch(L.$$typeof){case l:wt=10;break t;case n:wt=9;break t;case u:wt=11;break t;case c:wt=14;break t;case d:wt=16,$=null;break t}throw Error(s(130,L==null?L:typeof L,""))}return F=Ps(wt,W,F,it),F.elementType=L,F.type=$,F.lanes=lt,F}function bo(L,F,W,$){return L=Ps(7,L,$,F),L.lanes=W,L}function Xh(L,F,W,$){return L=Ps(22,L,$,F),L.elementType=v,L.lanes=W,L.stateNode={},L}function Rr(L,F,W){return L=Ps(6,L,null,F),L.lanes=W,L}function Rs(L,F,W){return F=Ps(4,L.children!==null?L.children:[],L.key,F),F.lanes=W,F.stateNode={containerInfo:L.containerInfo,pendingChildren:null,implementation:L.implementation},F}function Gg(L,F,W,$,it){this.tag=F,this.containerInfo=L,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vs(0),this.expirationTimes=Vs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vs(0),this.identifierPrefix=$,this.onRecoverableError=it,gt&&(this.mutableSourceEagerHydrationData=null)}function Gp(L,F,W,$,it,lt,wt,Xt,ae){return L=new Gg(L,F,W,Xt,ae),F===1?(F=1,lt===!0&&(F|=8)):F=0,lt=Ps(3,null,null,F),L.current=lt,lt.stateNode=L,lt.memoizedState={element:$,isDehydrated:W,cache:null,transitions:null},Vn(lt),L}function Yh(L){if(!L)return Nr;L=L._reactInternals;t:{if(C(L)!==L||L.tag!==1)throw Error(s(170));var F=L;do{switch(F.tag){case 3:F=F.stateNode.context;break t;case 1:if(pn(F.type)){F=F.stateNode.__reactInternalMemoizedMergedChildContext;break t}}F=F.return}while(F!==null);throw Error(s(171))}if(L.tag===1){var W=L.type;if(pn(W))return zs(L,W,F)}return F}function rl(L){var F=L._reactInternals;if(F===void 0)throw typeof L.render=="function"?Error(s(188)):(L=Object.keys(L).join(","),Error(s(268,L)));return L=b(F),L===null?null:L.stateNode}function Nc(L,F){if(L=L.memoizedState,L!==null&&L.dehydrated!==null){var W=L.retryLane;L.retryLane=W!==0&&W=Ee&<>=vi&&it<=He&&wt<=Qe){L.splice(F,1);break}else if($!==Ee||W.width!==ae.width||Qewt){if(!(lt!==vi||W.height!==ae.height||He<$||Ee>it)){Ee>$&&(ae.width+=Ee-$,ae.x=$),Helt&&(ae.height+=vi-lt,ae.y=lt),QeW&&(W=wt)),wt ")+` + +No matching component was found for: + `)+L.join(" > ")}return null},i.getPublicRootInstance=function(L){if(L=L.current,!L.child)return null;switch(L.child.tag){case 5:return B(L.child.stateNode);default:return L.child.stateNode}},i.injectIntoDevTools=function(L){if(L={bundleType:L.bundleType,version:L.version,rendererPackageName:L.rendererPackageName,rendererConfig:L.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:Vg,findFiberByHostInstance:L.findFiberByHostInstance||Vp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")L=!1;else{var F=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(F.isDisabled||!F.supportsFiber)L=!0;else{try{fo=F.inject(L),xr=F}catch{}L=!!F.checkDCE}}return L},i.isAlreadyRendering=function(){return!1},i.observeVisibleRects=function(L,F,W,$){if(!ut)throw Error(s(363));L=Mc(L,F);var it=ge(L,W,$).disconnect;return{disconnect:function(){it()}}},i.registerMutableSourceForHydration=function(L,F){var W=F._getVersion;W=W(F._source),L.mutableSourceEagerHydrationData==null?L.mutableSourceEagerHydrationData=[F,W]:L.mutableSourceEagerHydrationData.push(F,W)},i.runWithPriority=function(L,F){var W=Ni;try{return Ni=L,F()}finally{Ni=W}},i.shouldError=function(){return null},i.shouldSuspend=function(){return!1},i.updateContainer=function(L,F,W,$){var it=F.current,lt=wr(),wt=va(it);return W=Yh(W),F.context===null?F.context=W:F.pendingContext=W,F=Mn(lt,wt),F.payload={element:L},$=$===void 0?null:$,$!==null&&(F.callback=$),Sr(it,F),L=As(it,wt,lt),L!==null&&la(L,it,wt),wt},i};EA.exports=W7;var X7=EA.exports;const Y7=Wd(X7);var MA={exports:{}},CA={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(g){function t(z,X){var K=z.length;z.push(X);t:for(;0>>1,tt=z[Q];if(0>>1;QT(U,K))HT(J,U)?(z[Q]=J,z[H]=K,Q=H):(z[Q]=U,z[Z]=K,Q=Z);else if(HT(J,K))z[Q]=J,z[H]=K,Q=H;else break t}}return X}function T(z,X){var K=z.sortIndex-X.sortIndex;return K!==0?K:z.id-X.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var s=Date,y=s.now();g.unstable_now=function(){return s.now()-y}}var e=[],r=[],p=1,h=null,a=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var X=i(r);X!==null;){if(X.callback===null)x(r);else if(X.startTime<=z)x(r),X.sortIndex=X.expirationTime,t(e,X);else break;X=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(e)!==null)n=!0,B(m);else{var X=i(r);X!==null&&G(v,X.startTime-z)}}function m(z,X){n=!1,u&&(u=!1,o(w),w=-1),l=!0;var K=a;try{for(d(X),h=i(e);h!==null&&(!(h.expirationTime>X)||z&&!P());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,a=h.priorityLevel;var tt=Q(h.expirationTime<=X);X=g.unstable_now(),typeof tt=="function"?h.callback=tt:h===i(e)&&x(e),d(X)}else x(e);h=i(e)}if(h!==null)var Y=!0;else{var Z=i(r);Z!==null&&G(v,Z.startTime-X),Y=!1}return Y}finally{h=null,a=K,l=!1}}var S=!1,M=null,w=-1,C=5,A=-1;function P(){return!(g.unstable_now()-Az||125Q?(z.sortIndex=K,t(r,z),i(e)===null&&z===i(r)&&(u?(o(w),w=-1):u=!0,G(v,K-Q))):(z.sortIndex=tt,t(e,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var X=a;return function(){var K=a;a=X;try{return z.apply(this,arguments)}finally{a=K}}}})(CA);MA.exports=CA;var rM=MA.exports;const W1={},k7=g=>void Object.assign(W1,g);function K7(g,t){function i(p,{args:h=[],attach:a,...l},n){let u=`${p[0].toUpperCase()}${p.slice(1)}`,f;if(p==="primitive"){if(l.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const o=l.object;f=Ff(o,{type:p,root:n,attach:a,primitive:!0})}else{const o=W1[u];if(!o)throw new Error(`R3F: ${u} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");f=Ff(new o(...h),{type:p,root:n,attach:a,memoizedProps:{args:h}})}return f.__r3f.attach===void 0&&(f instanceof Li?f.__r3f.attach="geometry":f instanceof Hr&&(f.__r3f.attach="material")),u!=="inject"&&ay(f,l),f}function x(p,h){let a=!1;if(h){var l,n;(l=h.__r3f)!=null&&l.attach?sy(p,h,h.__r3f.attach):h.isObject3D&&p.isObject3D&&(p.add(h),a=!0),a||(n=p.__r3f)==null||n.objects.push(h),h.__r3f||Ff(h,{}),h.__r3f.parent=p,Mx(h),Of(h)}}function T(p,h,a){let l=!1;if(h){var n,u;if((n=h.__r3f)!=null&&n.attach)sy(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){h.parent=p,h.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:h});const f=p.children.filter(c=>c!==h),o=f.indexOf(a);p.children=[...f.slice(0,o),h,...f.slice(o)],l=!0}l||(u=p.__r3f)==null||u.objects.push(h),h.__r3f||Ff(h,{}),h.__r3f.parent=p,Mx(h),Of(h)}}function E(p,h,a=!1){p&&[...p].forEach(l=>s(h,l,a))}function s(p,h,a){if(h){var l,n,u;if(h.__r3f&&(h.__r3f.parent=null),(l=p.__r3f)!=null&&l.objects&&(p.__r3f.objects=p.__r3f.objects.filter(v=>v!==h)),(n=h.__r3f)!=null&&n.attach)hM(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){var f;p.remove(h),(f=h.__r3f)!=null&&f.root&&tz(hm(h),h)}const c=(u=h.__r3f)==null?void 0:u.primitive,d=!c&&(a===void 0?h.dispose!==null:a);if(!c){var o;E((o=h.__r3f)==null?void 0:o.objects,h,d),E(h.children,h,d)}if(delete h.__r3f,d&&h.dispose&&h.type!=="Scene"){const v=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?rM.unstable_scheduleCallback(rM.unstable_IdlePriority,v):v()}Of(p)}}function y(p,h,a,l){var n;const u=(n=p.__r3f)==null?void 0:n.parent;if(!u)return;const f=i(h,a,p.__r3f.root);if(p.children){for(const o of p.children)o.__r3f&&x(f,o);p.children=p.children.filter(o=>!o.__r3f)}p.__r3f.objects.forEach(o=>x(f,o)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||s(u,p),f.parent&&(f.__r3f.autoRemovedBeforeAppend=!0),x(u,f),f.raycast&&f.__r3f.eventCount&&hm(f).getState().internal.interaction.push(f),[l,l.alternate].forEach(o=>{o!==null&&(o.stateNode=f,o.ref&&(typeof o.ref=="function"?o.ref(f):o.ref.current=f))})}const e=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:Y7({createInstance:i,removeChild:s,appendChild:x,appendInitialChild:x,insertBefore:T,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,h)=>{if(!h)return;const a=p.getState().scene;a.__r3f&&(a.__r3f.root=p,x(a,h))},removeChildFromContainer:(p,h)=>{h&&s(p.getState().scene,h)},insertInContainerBefore:(p,h,a)=>{if(!h||!a)return;const l=p.getState().scene;l.__r3f&&T(l,h,a)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var h;return!!((h=p?.__r3f)!=null?h:{}).handlers},prepareUpdate(p,h,a,l){var n;if(((n=p?.__r3f)!=null?n:{}).primitive&&l.object&&l.object!==p)return[!0];{const{args:f=[],children:o,...c}=l,{args:d=[],children:v,...m}=a;if(!Array.isArray(f))throw new Error("R3F: the args prop must be an array!");if(f.some((M,w)=>M!==d[w]))return[!0];const S=FA(p,c,m,!0);return S.changes.length?[!1,S]:null}},commitUpdate(p,[h,a],l,n,u,f){h?y(p,l,u,f):ay(p,a)},commitMount(p,h,a,l){var n;const u=(n=p.__r3f)!=null?n:{};p.raycast&&u.handlers&&u.eventCount&&hm(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>Ff(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var h;const{attach:a,parent:l}=(h=p.__r3f)!=null?h:{};a&&l&&hM(l,p,a),p.isObject3D&&(p.visible=!1),Of(p)},unhideInstance(p,h){var a;const{attach:l,parent:n}=(a=p.__r3f)!=null?a:{};l&&n&&sy(n,p,l),(p.isObject3D&&h.visible==null||h.visible)&&(p.visible=!0),Of(p)},createTextInstance:e,hideTextInstance:e,unhideTextInstance:e,getCurrentEventPriority:()=>t?t():Hf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&wn.fun(performance.now)?performance.now:wn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:wn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:wn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:ay}}var sM,aM;const ry=g=>"colorSpace"in g||"outputColorSpace"in g,wA=()=>{var g;return(g=W1.ColorManagement)!=null?g:null},AA=g=>g&&g.isOrthographicCamera,j7=g=>g&&g.hasOwnProperty("current"),rp=typeof window<"u"&&((sM=window.document)!=null&&sM.createElement||((aM=window.navigator)==null?void 0:aM.product)==="ReactNative")?Pe.useLayoutEffect:Pe.useEffect;function PA(g){const t=Pe.useRef(g);return rp(()=>void(t.current=g),[g]),t}function Z7({set:g}){return rp(()=>(g(new Promise(()=>null)),()=>g(!1)),[g]),null}class RA extends Pe.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}}RA.getDerivedStateFromError=()=>({error:!0});const bA="__default",oM=new Map,J7=g=>g&&!!g.memoized&&!!g.changes;function LA(g){var t;const i=typeof window<"u"?(t=window.devicePixelRatio)!=null?t:2:1;return Array.isArray(g)?Math.min(Math.max(g[0],i),g[1]):g}const td=g=>{var t;return(t=g.__r3f)==null?void 0:t.root.getState()};function hm(g){let t=g.__r3f.root;for(;t.getState().previousRoot;)t=t.getState().previousRoot;return t}const wn={obj:g=>g===Object(g)&&!wn.arr(g)&&typeof g!="function",fun:g=>typeof g=="function",str:g=>typeof g=="string",num:g=>typeof g=="number",boo:g=>typeof g=="boolean",und:g=>g===void 0,arr:g=>Array.isArray(g),equ(g,t,{arrays:i="shallow",objects:x="reference",strict:T=!0}={}){if(typeof g!=typeof t||!!g!=!!t)return!1;if(wn.str(g)||wn.num(g))return g===t;const E=wn.obj(g);if(E&&x==="reference")return g===t;const s=wn.arr(g);if(s&&i==="reference")return g===t;if((s||E)&&g===t)return!0;let y;for(y in g)if(!(y in t))return!1;if(E&&i==="shallow"&&x==="shallow"){for(y in T?t:g)if(!wn.equ(g[y],t[y],{strict:T,objects:"reference"}))return!1}else for(y in T?t:g)if(g[y]!==t[y])return!1;if(wn.und(y)){if(s&&g.length===0&&t.length===0||E&&Object.keys(g).length===0&&Object.keys(t).length===0)return!0;if(g!==t)return!1}return!0}};function $7(g){g.dispose&&g.type!=="Scene"&&g.dispose();for(const t in g)t.dispose==null||t.dispose(),delete g[t]}function Ff(g,t){const i=g;return i.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...t},g}function Ex(g,t){let i=g;if(t.includes("-")){const x=t.split("-"),T=x.pop();return i=x.reduce((E,s)=>E[s],g),{target:i,key:T}}else return{target:i,key:t}}const lM=/-\d+$/;function sy(g,t,i){if(wn.str(i)){if(lM.test(i)){const E=i.replace(lM,""),{target:s,key:y}=Ex(g,E);Array.isArray(s[y])||(s[y]=[])}const{target:x,key:T}=Ex(g,i);t.__r3f.previousAttach=x[T],x[T]=t}else t.__r3f.previousAttach=i(g,t)}function hM(g,t,i){var x,T;if(wn.str(i)){const{target:E,key:s}=Ex(g,i),y=t.__r3f.previousAttach;y===void 0?delete E[s]:E[s]=y}else(x=t.__r3f)==null||x.previousAttach==null||x.previousAttach(g,t);(T=t.__r3f)==null||delete T.previousAttach}function FA(g,{children:t,key:i,ref:x,...T},{children:E,key:s,ref:y,...e}={},r=!1){var p;const h=(p=g?.__r3f)!=null?p:{},a=Object.entries(T),l=[];if(r){const u=Object.keys(e);for(let f=0;f{var o;if((o=g.__r3f)!=null&&o.primitive&&u==="object"||wn.equ(f,e[u]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(u))return l.push([u,f,!0,[]]);let c=[];u.includes("-")&&(c=u.split("-")),l.push([u,f,!1,c]);for(const d in T){const v=T[d];d.startsWith(`${u}-`)&&l.push([d,v,!1,d.split("-")])}});const n={...T};return h.memoizedProps&&h.memoizedProps.args&&(n.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(n.attach=h.memoizedProps.attach),{memoized:n,changes:l}}const Q7=typeof process<"u"&&!1;function ay(g,t){var i,x,T;const E=(i=g.__r3f)!=null?i:{},s=E.root,y=(x=s==null||s.getState==null?void 0:s.getState())!=null?x:{},{memoized:e,changes:r}=J7(t)?t:FA(g,t),p=E.eventCount;g.__r3f&&(g.__r3f.memoizedProps=e);for(let a=0;ad[v],g),!(c&&c.set))){const[d,...v]=f.reverse();o=v.reverse().reduce((m,S)=>m[S],g),l=d}if(n===bA+"remove")if(o.constructor){let d=oM.get(o.constructor);d||(d=new o.constructor,oM.set(o.constructor,d)),n=d[l]}else n=0;if(u)n?E.handlers[l]=n:delete E.handlers[l],E.eventCount=Object.keys(E.handlers).length;else if(c&&c.set&&(c.copy||c instanceof Tu)){if(Array.isArray(n))c.fromArray?c.fromArray(n):c.set(...n);else if(c.copy&&n&&n.constructor&&(Q7?c.constructor.name===n.constructor.name:c.constructor===n.constructor))c.copy(n);else if(n!==void 0){const d=c instanceof ze;!d&&c.setScalar?c.setScalar(n):c instanceof Tu&&n instanceof Tu?c.mask=n.mask:c.set(n),!wA()&&!y.linear&&d&&c.convertSRGBToLinear()}}else if(o[l]=n,o[l]instanceof Un&&o[l].format===ps&&o[l].type===Uo){const d=o[l];ry(d)&&ry(y.gl)?d.colorSpace=y.gl.outputColorSpace:d.encoding=y.gl.outputEncoding}Of(g)}if(E.parent&&g.raycast&&p!==E.eventCount){const a=hm(g).getState().internal,l=a.interaction.indexOf(g);l>-1&&a.interaction.splice(l,1),E.eventCount&&a.interaction.push(g)}return!(r.length===1&&r[0][0]==="onUpdate")&&r.length&&(T=g.__r3f)!=null&&T.parent&&Mx(g),g}function Of(g){var t,i;const x=(t=g.__r3f)==null||(i=t.root)==null||i.getState==null?void 0:i.getState();x&&x.internal.frames===0&&x.invalidate()}function Mx(g){g.onUpdate==null||g.onUpdate(g)}function _7(g,t){g.manual||(AA(g)?(g.left=t.width/-2,g.right=t.width/2,g.top=t.height/2,g.bottom=t.height/-2):g.aspect=t.width/t.height,g.updateProjectionMatrix(),g.updateMatrixWorld())}function Kv(g){return(g.eventObject||g.object).uuid+"/"+g.index+g.instanceId}function q7(){var g;const t=typeof self<"u"&&self||typeof window<"u"&&window;if(!t)return Hf.DefaultEventPriority;switch((g=t.event)==null?void 0:g.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Hf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Hf.ContinuousEventPriority;default:return Hf.DefaultEventPriority}}function OA(g,t,i,x){const T=i.get(t);T&&(i.delete(t),i.size===0&&(g.delete(x),T.target.releasePointerCapture(x)))}function tz(g,t){const{internal:i}=g.getState();i.interaction=i.interaction.filter(x=>x!==t),i.initialHits=i.initialHits.filter(x=>x!==t),i.hovered.forEach((x,T)=>{(x.eventObject===t||x.object===t)&&i.hovered.delete(T)}),i.capturedMap.forEach((x,T)=>{OA(i.capturedMap,t,x,T)})}function ez(g){function t(e){const{internal:r}=g.getState(),p=e.offsetX-r.initialClick[0],h=e.offsetY-r.initialClick[1];return Math.round(Math.sqrt(p*p+h*h))}function i(e){return e.filter(r=>["Move","Over","Enter","Out","Leave"].some(p=>{var h;return(h=r.__r3f)==null?void 0:h.handlers["onPointer"+p]}))}function x(e,r){const p=g.getState(),h=new Set,a=[],l=r?r(p.internal.interaction):p.internal.interaction;for(let o=0;o{const d=td(o.object),v=td(c.object);return!d||!v?o.distance-c.distance:v.events.priority-d.events.priority||o.distance-c.distance}).filter(o=>{const c=Kv(o);return h.has(c)?!1:(h.add(c),!0)});p.events.filter&&(u=p.events.filter(u,p));for(const o of u){let c=o.object;for(;c;){var f;(f=c.__r3f)!=null&&f.eventCount&&a.push({...o,eventObject:c}),c=c.parent}}if("pointerId"in e&&p.internal.capturedMap.has(e.pointerId))for(let o of p.internal.capturedMap.get(e.pointerId).values())h.has(Kv(o.intersection))||a.push(o.intersection);return a}function T(e,r,p,h){const a=g.getState();if(e.length){const l={stopped:!1};for(const n of e){const u=td(n.object)||a,{raycaster:f,pointer:o,camera:c,internal:d}=u,v=new Ct(o.x,o.y,0).unproject(c),m=A=>{var P,b;return(P=(b=d.capturedMap.get(A))==null?void 0:b.has(n.eventObject))!=null?P:!1},S=A=>{const P={intersection:n,target:r.target};d.capturedMap.has(A)?d.capturedMap.get(A).set(n.eventObject,P):d.capturedMap.set(A,new Map([[n.eventObject,P]])),r.target.setPointerCapture(A)},M=A=>{const P=d.capturedMap.get(A);P&&OA(d.capturedMap,n.eventObject,P,A)};let w={};for(let A in r){let P=r[A];typeof P!="function"&&(w[A]=P)}let C={...n,...w,pointer:o,intersections:e,stopped:l.stopped,delta:p,unprojectedPoint:v,ray:f.ray,camera:c,stopPropagation(){const A="pointerId"in r&&d.capturedMap.get(r.pointerId);if((!A||A.has(n.eventObject))&&(C.stopped=l.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(P=>P.eventObject===n.eventObject))){const P=e.slice(0,e.indexOf(n));E([...P,n])}},target:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},currentTarget:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},nativeEvent:r};if(h(C),l.stopped===!0)break}}return e}function E(e){const{internal:r}=g.getState();for(const p of r.hovered.values())if(!e.length||!e.find(h=>h.object===p.object&&h.index===p.index&&h.instanceId===p.instanceId)){const a=p.eventObject.__r3f,l=a?.handlers;if(r.hovered.delete(Kv(p)),a!=null&&a.eventCount){const n={...p,intersections:e};l.onPointerOut==null||l.onPointerOut(n),l.onPointerLeave==null||l.onPointerLeave(n)}}}function s(e,r){for(let p=0;pE([]);case"onLostPointerCapture":return r=>{const{internal:p}=g.getState();"pointerId"in r&&p.capturedMap.has(r.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(r.pointerId)&&(p.capturedMap.delete(r.pointerId),E([]))})}}return function(p){const{onPointerMissed:h,internal:a}=g.getState();a.lastEvent.current=p;const l=e==="onPointerMove",n=e==="onClick"||e==="onContextMenu"||e==="onDoubleClick",f=x(p,l?i:void 0),o=n?t(p):0;e==="onPointerDown"&&(a.initialClick=[p.offsetX,p.offsetY],a.initialHits=f.map(d=>d.eventObject)),n&&!f.length&&o<=2&&(s(p,a.interaction),h&&h(p)),l&&E(f);function c(d){const v=d.eventObject,m=v.__r3f,S=m?.handlers;if(m!=null&&m.eventCount)if(l){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const M=Kv(d),w=a.hovered.get(M);w?w.stopped&&d.stopPropagation():(a.hovered.set(M,d),S.onPointerOver==null||S.onPointerOver(d),S.onPointerEnter==null||S.onPointerEnter(d))}S.onPointerMove==null||S.onPointerMove(d)}else{const M=S[e];M?(!n||a.initialHits.includes(v))&&(s(p,a.interaction.filter(w=>!a.initialHits.includes(w))),M(d)):n&&a.initialHits.includes(v)&&s(p,a.interaction.filter(w=>!a.initialHits.includes(w)))}}T(f,p,o,c)}}return{handlePointer:y}}const DA=g=>!!(g!=null&&g.render),IA=Pe.createContext(null),iz=(g,t)=>{const i=G7((y,e)=>{const r=new Ct,p=new Ct,h=new Ct;function a(o=e().camera,c=p,d=e().size){const{width:v,height:m,top:S,left:M}=d,w=v/m;c instanceof Ct?h.copy(c):h.set(...c);const C=o.getWorldPosition(r).distanceTo(h);if(AA(o))return{width:v/o.zoom,height:m/o.zoom,top:S,left:M,factor:1,distance:C,aspect:w};{const A=o.fov*Math.PI/180,P=2*Math.tan(A/2)*C,b=P*(v/m);return{width:b,height:P,top:S,left:M,factor:v/b,distance:C,aspect:w}}}let l;const n=o=>y(c=>({performance:{...c.performance,current:o}})),u=new ve;return{set:y,get:e,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(o=1)=>g(e(),o),advance:(o,c)=>t(o,c,e()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new z1,pointer:u,mouse:u,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const o=e();l&&clearTimeout(l),o.performance.current!==o.performance.min&&n(o.performance.min),l=setTimeout(()=>n(e().performance.max),o.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:a},setEvents:o=>y(c=>({...c,events:{...c.events,...o}})),setSize:(o,c,d,v,m)=>{const S=e().camera,M={width:o,height:c,top:v||0,left:m||0,updateStyle:d};y(w=>({size:M,viewport:{...w.viewport,...a(S,p,M)}}))},setDpr:o=>y(c=>{const d=LA(o);return{viewport:{...c.viewport,dpr:d,initialDpr:c.viewport.initialDpr||d}}}),setFrameloop:(o="always")=>{const c=e().clock;c.stop(),c.elapsedTime=0,o!=="never"&&(c.start(),c.elapsedTime=0),y(()=>({frameloop:o}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Pe.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(o,c,d)=>{const v=e().internal;return v.priority=v.priority+(c>0?1:0),v.subscribers.push({ref:o,priority:c,store:d}),v.subscribers=v.subscribers.sort((m,S)=>m.priority-S.priority),()=>{const m=e().internal;m!=null&&m.subscribers&&(m.priority=m.priority-(c>0?1:0),m.subscribers=m.subscribers.filter(S=>S.ref!==o))}}}}}),x=i.getState();let T=x.size,E=x.viewport.dpr,s=x.camera;return i.subscribe(()=>{const{camera:y,size:e,viewport:r,gl:p,set:h}=i.getState();if(e.width!==T.width||e.height!==T.height||r.dpr!==E){var a;T=e,E=r.dpr,_7(y,e),p.setPixelRatio(r.dpr);const l=(a=e.updateStyle)!=null?a:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(e.width,e.height,l)}y!==s&&(s=y,h(l=>({viewport:{...l.viewport,...l.viewport.getCurrentViewport(y)}})))}),i.subscribe(y=>g(y)),i};let jv,nz=new Set,rz=new Set,sz=new Set;function oy(g,t){if(g.size)for(const{callback:i}of g.values())i(t)}function ed(g,t){switch(g){case"before":return oy(nz,t);case"after":return oy(rz,t);case"tail":return oy(sz,t)}}let ly,hy;function uy(g,t,i){let x=t.clock.getDelta();for(t.frameloop==="never"&&typeof g=="number"&&(x=g-t.clock.elapsedTime,t.clock.oldTime=t.clock.elapsedTime,t.clock.elapsedTime=g),ly=t.internal.subscribers,jv=0;jv0)&&!((p=E.gl.xr)!=null&&p.isPresenting)&&(x+=uy(r,E))}if(i=!1,ed("after",r),x===0)return ed("tail",r),t=!1,cancelAnimationFrame(T)}function y(r,p=1){var h;if(!r)return g.forEach(a=>y(a.store.getState(),p));(h=r.gl.xr)!=null&&h.isPresenting||!r.internal.active||r.frameloop==="never"||(p>1?r.internal.frames=Math.min(60,r.internal.frames+p):i?r.internal.frames=2:r.internal.frames=1,t||(t=!0,requestAnimationFrame(s)))}function e(r,p=!0,h,a){if(p&&ed("before",r),h)uy(r,h,a);else for(const l of g.values())uy(r,l.store.getState());p&&ed("after",r)}return{loop:s,invalidate:y,advance:e}}function oz(){const g=Pe.useContext(IA);if(!g)throw new Error("R3F: Hooks can only be used within the Canvas component!");return g}function lz(g,t=0){const i=oz(),x=i.getState().internal.subscribe,T=PA(g);return rp(()=>x(T,t,i),[t,x,i]),null}const _f=new Map,{invalidate:uM,advance:fM}=az(_f),{reconciler:Cm,applyProps:bf}=K7(_f,q7),Lf={objects:"shallow",strict:!1},hz=(g,t)=>{const i=typeof g=="function"?g(t):g;return DA(i)?i:new E1({powerPreference:"high-performance",canvas:t,antialias:!0,alpha:!0,...g})};function uz(g,t){const i=typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement;if(t){const{width:x,height:T,top:E,left:s,updateStyle:y=i}=t;return{width:x,height:T,top:E,left:s,updateStyle:y}}else if(typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement&&g.parentElement){const{width:x,height:T,top:E,left:s}=g.parentElement.getBoundingClientRect();return{width:x,height:T,top:E,left:s,updateStyle:i}}else if(typeof OffscreenCanvas<"u"&&g instanceof OffscreenCanvas)return{width:g.width,height:g.height,top:0,left:0,updateStyle:i};return{width:0,height:0,top:0,left:0}}function fz(g){const t=_f.get(g),i=t?.fiber,x=t?.store;t&&console.warn("R3F.createRoot should only be called once!");const T=typeof reportError=="function"?reportError:console.error,E=x||iz(uM,fM),s=i||Cm.createContainer(E,Hf.ConcurrentRoot,null,!1,null,"",T,null);t||_f.set(g,{fiber:s,store:E});let y,e=!1,r;return{configure(p={}){let{gl:h,size:a,scene:l,events:n,onCreated:u,shadows:f=!1,linear:o=!1,flat:c=!1,legacy:d=!1,orthographic:v=!1,frameloop:m="always",dpr:S=[1,2],performance:M,raycaster:w,camera:C,onPointerMissed:A}=p,P=E.getState(),b=P.gl;P.gl||P.set({gl:b=hz(h,g)});let O=P.raycaster;O||P.set({raycaster:O=new xA});const{params:I,...D}=w||{};if(wn.equ(D,O,Lf)||bf(O,{...D}),wn.equ(I,O.params,Lf)||bf(O,{params:{...O.params,...I}}),!P.camera||P.camera===r&&!wn.equ(r,C,Lf)){r=C;const K=C instanceof $d,Q=K?C:v?new qd(0,0,0,0,.1,1e3):new Or(75,0,.1,1e3);K||(Q.position.z=5,C&&bf(Q,C),!P.camera&&!(C!=null&&C.rotation)&&Q.lookAt(0,0,0)),P.set({camera:Q}),O.camera=Q}if(!P.scene){let K;l instanceof Em?K=l:(K=new Em,l&&bf(K,l)),P.set({scene:Ff(K)})}if(!P.xr){var B;const K=(Y,Z)=>{const U=E.getState();U.frameloop!=="never"&&fM(Y,!0,U,Z)},Q=()=>{const Y=E.getState();Y.gl.xr.enabled=Y.gl.xr.isPresenting,Y.gl.xr.setAnimationLoop(Y.gl.xr.isPresenting?K:null),Y.gl.xr.isPresenting||uM(Y)},tt={connect(){const Y=E.getState().gl;Y.xr.addEventListener("sessionstart",Q),Y.xr.addEventListener("sessionend",Q)},disconnect(){const Y=E.getState().gl;Y.xr.removeEventListener("sessionstart",Q),Y.xr.removeEventListener("sessionend",Q)}};typeof((B=b.xr)==null?void 0:B.addEventListener)=="function"&&tt.connect(),P.set({xr:tt})}if(b.shadowMap){const K=b.shadowMap.enabled,Q=b.shadowMap.type;if(b.shadowMap.enabled=!!f,wn.boo(f))b.shadowMap.type=hd;else if(wn.str(f)){var G;const tt={basic:u2,percentage:ng,soft:hd,variance:_a};b.shadowMap.type=(G=tt[f])!=null?G:hd}else wn.obj(f)&&Object.assign(b.shadowMap,f);(K!==b.shadowMap.enabled||Q!==b.shadowMap.type)&&(b.shadowMap.needsUpdate=!0)}const z=wA();z&&("enabled"in z?z.enabled=!d:"legacyMode"in z&&(z.legacyMode=d)),e||bf(b,{outputEncoding:o?3e3:3001,toneMapping:c?Bo:i1}),P.legacy!==d&&P.set(()=>({legacy:d})),P.linear!==o&&P.set(()=>({linear:o})),P.flat!==c&&P.set(()=>({flat:c})),h&&!wn.fun(h)&&!DA(h)&&!wn.equ(h,b,Lf)&&bf(b,h),n&&!P.events.handlers&&P.set({events:n(E)});const X=uz(g,a);return wn.equ(X,P.size,Lf)||P.setSize(X.width,X.height,X.updateStyle,X.top,X.left),S&&P.viewport.dpr!==LA(S)&&P.setDpr(S),P.frameloop!==m&&P.setFrameloop(m),P.onPointerMissed||P.set({onPointerMissed:A}),M&&!wn.equ(M,P.performance,Lf)&&P.set(K=>({performance:{...K.performance,...M}})),y=u,e=!0,this},render(p){return e||this.configure(),Cm.updateContainer(Pe.createElement(cz,{store:E,children:p,onCreated:y,rootElement:g}),s,null,()=>{}),E},unmount(){NA(g)}}}function cz({store:g,children:t,onCreated:i,rootElement:x}){return rp(()=>{const T=g.getState();T.set(E=>({internal:{...E.internal,active:!0}})),i&&i(T),g.getState().events.connected||T.events.connect==null||T.events.connect(x)},[]),Pe.createElement(IA.Provider,{value:g},t)}function NA(g,t){const i=_f.get(g),x=i?.fiber;if(x){const T=i?.store.getState();T&&(T.internal.active=!1),Cm.updateContainer(null,x,null,()=>{T&&setTimeout(()=>{try{var E,s,y,e;T.events.disconnect==null||T.events.disconnect(),(E=T.gl)==null||(s=E.renderLists)==null||s.dispose==null||s.dispose(),(y=T.gl)==null||y.forceContextLoss==null||y.forceContextLoss(),(e=T.gl)!=null&&e.xr&&T.xr.disconnect(),$7(T),_f.delete(g),t&&t(g)}catch{}},500)})}}Cm.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Pe.version});function wm(){return wm=Object.assign?Object.assign.bind():function(g){for(var t=1;t=0?x=setTimeout(e,t-p):(x=null,i||(y=g.apply(E,T),E=T=null))}var r=function(){E=this,T=arguments,s=Date.now();var p=i&&!x;return x||(x=setTimeout(e,t)),p&&(y=g.apply(E,T),E=T=null),y};return r.clear=function(){x&&(clearTimeout(x),x=null)},r.flush=function(){x&&(y=g.apply(E,T),E=T=null,clearTimeout(x),x=null)},r}Cx.debounce=Cx;var dz=Cx;const cM=Wd(dz);function pz(g){let{debounce:t,scroll:i,polyfill:x,offsetSize:T}=g===void 0?{debounce:0,scroll:!1,offsetSize:!1}:g;const E=x||(typeof window>"u"?class{}:window.ResizeObserver);if(!E)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,y]=Pe.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),e=Pe.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s}),r=t?typeof t=="number"?t:t.scroll:null,p=t?typeof t=="number"?t:t.resize:null,h=Pe.useRef(!1);Pe.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[a,l,n]=Pe.useMemo(()=>{const c=()=>{if(!e.current.element)return;const{left:d,top:v,width:m,height:S,bottom:M,right:w,x:C,y:A}=e.current.element.getBoundingClientRect(),P={left:d,top:v,width:m,height:S,bottom:M,right:w,x:C,y:A};e.current.element instanceof HTMLElement&&T&&(P.height=e.current.element.offsetHeight,P.width=e.current.element.offsetWidth),Object.freeze(P),h.current&&!yz(e.current.lastBounds,P)&&y(e.current.lastBounds=P)};return[c,p?cM(c,p):c,r?cM(c,r):c]},[y,T,r,p]);function u(){e.current.scrollContainers&&(e.current.scrollContainers.forEach(c=>c.removeEventListener("scroll",n,!0)),e.current.scrollContainers=null),e.current.resizeObserver&&(e.current.resizeObserver.disconnect(),e.current.resizeObserver=null)}function f(){e.current.element&&(e.current.resizeObserver=new E(n),e.current.resizeObserver.observe(e.current.element),i&&e.current.scrollContainers&&e.current.scrollContainers.forEach(c=>c.addEventListener("scroll",n,{capture:!0,passive:!0})))}const o=c=>{!c||c===e.current.element||(u(),e.current.element=c,e.current.scrollContainers=BA(c),f())};return mz(n,!!i),vz(l),Pe.useEffect(()=>{u(),f()},[i,n,l]),Pe.useEffect(()=>u,[]),[o,s,a]}function vz(g){Pe.useEffect(()=>{const t=g;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[g])}function mz(g,t){Pe.useEffect(()=>{if(t){const i=g;return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)}},[g,t])}function BA(g){const t=[];if(!g||g===document.body)return t;const{overflow:i,overflowX:x,overflowY:T}=window.getComputedStyle(g);return[i,x,T].some(E=>E==="auto"||E==="scroll")&&t.push(g),[...t,...BA(g.parentElement)]}const gz=["x","y","top","bottom","left","right","width","height"],yz=(g,t)=>gz.every(i=>g[i]===t[i]);var xz=Object.defineProperty,Sz=Object.defineProperties,Tz=Object.getOwnPropertyDescriptors,dM=Object.getOwnPropertySymbols,Ez=Object.prototype.hasOwnProperty,Mz=Object.prototype.propertyIsEnumerable,pM=(g,t,i)=>t in g?xz(g,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[t]=i,vM=(g,t)=>{for(var i in t||(t={}))Ez.call(t,i)&&pM(g,i,t[i]);if(dM)for(var i of dM(t))Mz.call(t,i)&&pM(g,i,t[i]);return g},Cz=(g,t)=>Sz(g,Tz(t)),mM,gM;typeof window<"u"&&((mM=window.document)!=null&&mM.createElement||((gM=window.navigator)==null?void 0:gM.product)==="ReactNative")?Pe.useLayoutEffect:Pe.useEffect;function UA(g,t,i){if(!g)return;if(i(g)===!0)return g;let x=t?g.return:g.child;for(;x;){const T=UA(x,t,i);if(T)return T;x=t?null:x.sibling}}function zA(g){try{return Object.defineProperties(g,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return g}}const yM=console.error;console.error=function(){const g=[...arguments].join("");if(g?.startsWith("Warning:")&&g.includes("useContext")){console.error=yM;return}return yM.apply(this,arguments)};const X1=zA(Pe.createContext(null));class GA extends Pe.Component{render(){return Pe.createElement(X1.Provider,{value:this._reactInternals},this.props.children)}}function wz(){const g=Pe.useContext(X1);if(g===null)throw new Error("its-fine: useFiber must be called within a !");const t=Pe.useId();return Pe.useMemo(()=>{for(const x of[g,g?.alternate]){if(!x)continue;const T=UA(x,!1,E=>{let s=E.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}});if(T)return T}},[g,t])}function Az(){const g=wz(),[t]=Pe.useState(()=>new Map);t.clear();let i=g;for(;i;){if(i.type&&typeof i.type=="object"){const T=i.type._context===void 0&&i.type.Provider===i.type?i.type:i.type._context;T&&T!==X1&&!t.has(T)&&t.set(T,Pe.useContext(zA(T)))}i=i.return}return t}function Pz(){const g=Az();return Pe.useMemo(()=>Array.from(g.keys()).reduce((t,i)=>x=>Pe.createElement(t,null,Pe.createElement(i.Provider,Cz(vM({},x),{value:g.get(i)}))),t=>Pe.createElement(GA,vM({},t))),[g])}const fy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Rz(g){const{handlePointer:t}=ez(g);return{priority:1,enabled:!0,compute(i,x,T){x.pointer.set(i.offsetX/x.size.width*2-1,-(i.offsetY/x.size.height)*2+1),x.raycaster.setFromCamera(x.pointer,x.camera)},connected:void 0,handlers:Object.keys(fy).reduce((i,x)=>({...i,[x]:t(x)}),{}),update:()=>{var i;const{events:x,internal:T}=g.getState();(i=T.lastEvent)!=null&&i.current&&x.handlers&&x.handlers.onPointerMove(T.lastEvent.current)},connect:i=>{var x;const{set:T,events:E}=g.getState();E.disconnect==null||E.disconnect(),T(s=>({events:{...s.events,connected:i}})),Object.entries((x=E.handlers)!=null?x:[]).forEach(([s,y])=>{const[e,r]=fy[s];i.addEventListener(e,y,{passive:r})})},disconnect:()=>{const{set:i,events:x}=g.getState();if(x.connected){var T;Object.entries((T=x.handlers)!=null?T:[]).forEach(([E,s])=>{if(x&&x.connected instanceof HTMLElement){const[y]=fy[E];x.connected.removeEventListener(y,s)}}),i(E=>({events:{...E.events,connected:void 0}}))}}}}const bz=Pe.forwardRef(function({children:t,fallback:i,resize:x,style:T,gl:E,events:s=Rz,eventSource:y,eventPrefix:e,shadows:r,linear:p,flat:h,legacy:a,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:o,camera:c,scene:d,onPointerMissed:v,onCreated:m,...S},M){Pe.useMemo(()=>k7(B7),[]);const w=Pz(),[C,A]=pz({scroll:!0,debounce:{scroll:50,resize:0},...x}),P=Pe.useRef(null),b=Pe.useRef(null);Pe.useImperativeHandle(M,()=>P.current);const O=PA(v),[I,D]=Pe.useState(!1),[B,G]=Pe.useState(!1);if(I)throw I;if(B)throw B;const z=Pe.useRef(null);rp(()=>{const K=P.current;A.width>0&&A.height>0&&K&&(z.current||(z.current=fz(K)),z.current.configure({gl:E,events:s,shadows:r,linear:p,flat:h,legacy:a,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:o,camera:c,scene:d,size:A,onPointerMissed:(...Q)=>O.current==null?void 0:O.current(...Q),onCreated:Q=>{Q.events.connect==null||Q.events.connect(y?j7(y)?y.current:y:b.current),e&&Q.setEvents({compute:(tt,Y)=>{const Z=tt[e+"X"],U=tt[e+"Y"];Y.pointer.set(Z/Y.size.width*2-1,-(U/Y.size.height)*2+1),Y.raycaster.setFromCamera(Y.pointer,Y.camera)}}),m?.(Q)}}),z.current.render(Pe.createElement(w,null,Pe.createElement(RA,{set:G},Pe.createElement(Pe.Suspense,{fallback:Pe.createElement(Z7,{set:D})},t)))))}),Pe.useEffect(()=>{const K=P.current;if(K)return()=>NA(K)},[]);const X=y?"none":"auto";return Pe.createElement("div",wm({ref:b,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:X,...T}},S),Pe.createElement("div",{ref:C,style:{width:"100%",height:"100%"}},Pe.createElement("canvas",{ref:P,style:{display:"block"}},i)))}),Lz=Pe.forwardRef(function(t,i){return Pe.createElement(GA,null,Pe.createElement(bz,wm({},t,{ref:i})))});function Tl(g,t={}){let i=Pe.useCallback(T=>t.keys?k4(g,t.keys,T):g.listen(T),[t.keys,g]),x=g.get.bind(g);return Pe.useSyncExternalStore(i,x,x)}const Fz=[new qa(-Math.PI/2,-Math.PI/2,-Math.PI/2),new qa(0,Math.PI/2,0),new qa(0,-Math.PI/2,-Math.PI/2),new qa(Math.PI/2,Math.PI,Math.PI),new qa(0,0,-Math.PI/2),new qa(Math.PI,0,0)],Oz=({diceValues:g,isRolling:t,textures:i})=>{const x=Pe.useRef([]),T=Pe.useRef([]);return Pe.useEffect(()=>{const E=new sA,s=new ze(16776960);T.current=[new vl({map:E.load(i.side1),color:s}),new vl({map:E.load(i.side2),color:s}),new vl({map:E.load(i.side3),color:s}),new vl({map:E.load(i.side4),color:s}),new vl({map:E.load(i.side5),color:s}),new vl({map:E.load(i.side6),color:s})],x.current.forEach(y=>{y&&(y.material=T.current)})},[i]),lz(()=>{x.current.forEach((E,s)=>{if(E)if(t)E.rotation.x+=.2,E.rotation.y+=.2;else{const y=Fz[g[s]-1];E.rotation.x=om.lerp(E.rotation.x,y.x,.1),E.rotation.y=om.lerp(E.rotation.y,y.y,.1),E.rotation.z=om.lerp(E.rotation.z,y.z,.1)}})}),he.jsx(he.Fragment,{children:g.map((E,s)=>he.jsxs("mesh",{ref:y=>x.current[s]=y,position:[s*2-(g.length-1),0,0],children:[he.jsx("boxGeometry",{args:[1,1,1]}),T.current.length===6&&T.current.map((y,e)=>he.jsx("meshStandardMaterial",{attach:`material-${e}`,map:y.map},e))]},s))})},Dz=({styleClass:g,textures:t,diceCount:i})=>{const x=Tl(xd);Pe.useEffect(()=>{UI("Dice"),GI(t),zI({type:"ROLL_DICE",diceValues:Array(i).fill(1),isRolling:!1})},[t,i]);const T=()=>{MT(!0),setTimeout(()=>{const E=Array.from({length:i},()=>Math.floor(Math.random()*6)+1);console.log("New dice values:",E),o2(E),MT(!1);const s={diceValues:E};Pi.emit("diceRollResult",s)},2e3)};return he.jsxs("div",{className:`flex flex-col items-center justify-center p-4 ${g}`,children:[he.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Dice Roller"}),he.jsxs(Lz,{className:"w-full h-full",camera:{position:[0,0,5]},children:[he.jsx("ambientLight",{intensity:2.5}),he.jsx("pointLight",{position:[10,10,10]}),uT(x.action)&&he.jsx(Oz,{diceValues:x.action.diceValues,isRolling:x.action.isRolling,textures:x.textures})]}),uT(x.action)&&he.jsx("button",{onClick:T,className:`mt-4 p-2 border border-yellow-300 rounded text-yellow-400 ${x.action.isRolling?"opacity-50":""}`,disabled:x.action.isRolling,children:"Roll Dice"})]})};class VA{constructor(t,i,x){this.scene=t,this.gridEngine=i,this.quadtree=x,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers(),this.tooltip=this.scene.add.text(0,0,"Press [F]",{font:"16px Arial",backgroundColor:"#000000"}).setDepth(4).setPadding(3,2,2,3).setVisible(!1)}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 i=yl(t);i&&i.consumable?(console.log(`Consuming item: ${i.name}`),NI(i),ET(i.id)):console.log(`Item ${t} is not consumable`)}handleEquip(t){const i=yl(t);i&&(console.log(`Equipping item: ${i.name}`),AI("weapon",i.id))}handleUnequip(t){const i=yl(t);i&&(console.log(`Unequipping item: ${i.name}`),PI("weapon"))}handleDiscard(t){console.log(`Discarding item: ${t}`),ET(t)}handleView(t){const i=yl(t);if(i&&(console.log(`Viewing item: ${i.name} with ${i.slug}`),i.slug)){const x=`https://kbve.com/${i.slug}#${i.name.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")}`;window.open(x,"_blank")}}registerEventHandlers(){Pi.on("itemAction",this.handleItemAction.bind(this));//! Broken +Pi.on("playerMove",this.handlePlayerMove.bind(this)),Pi.on("playerReward",this.handlePlayerReward.bind(this)),Pi.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&&(Pi.emit("notification",{title:"Success",message:t.message,notificationType:Au.success}),wI(t.item))}handlePlayerCombatDamage(t){t&&(a2(parseInt(t.damage)),Pi.emit("notification",{title:"Danger",message:`You taken ${t.damage} points of damage!`,notificationType:Au.danger}))}handlePlayerMove(t){t&&this.gridEngine.moveTo("player",{x:t.x,y:t.y})}checkForNearbyObjects(){const i=this.gridEngine.getPosition("player"),x=i.x*48,T=i.y*48;this.quadtree.query(i).length>0?this.tooltip.setPosition(x,T-60).setVisible(!0):this.tooltip.setVisible(!1)}handleMovement(){if(!this.cursor)return;const t=this.cursor,i=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const x=this.gridEngine.getPosition("player"),T=this.quadtree.query(x);for(const E of T)E.action()}(t.left.isDown||i.A.isDown)&&(t.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-left"):(t.left.isDown||i.A.isDown)&&(t.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-left"):(t.right.isDown||i.D.isDown)&&(t.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-right"):(t.right.isDown||i.D.isDown)&&(t.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-right"):t.left.isDown||i.A.isDown?this.gridEngine.move("player","left"):t.right.isDown||i.D.isDown?this.gridEngine.move("player","right"):t.up.isDown||i.W.isDown?this.gridEngine.move("player","up"):(t.down.isDown||i.S.isDown)&&this.gridEngine.move("player","down"),this.checkForNearbyObjects()}}class HA extends Phaser.GameObjects.Container{constructor(t,i,x,T){const E=i.x,s=i.y-i.height+10;super(t,E,s),this.sprite=i;const y=150,e=40+T.length*20;this.background=t.add.rectangle(0,0,y,e,0,.7),this.text=t.add.text(0,-e/2+10,x,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=T.map((r,p)=>{const h=t.add.text(0,-e/2+30+p*20,r.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return h.setInteractive({useHandCursor:!0}),h.on("pointerdown",r.callback),h}),this.add(this.background),this.add(this.text),this.buttons.forEach(r=>this.add(r)),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,i,x,T){i.setInteractive(),i.on("pointerover",E=>{const s={npcId:i.name,npcName:x,actions:T.map(e=>e.label),coords:{x:E.x,y:E.y}};if(Pi.emit("npcInteraction",s),!i.getData("tooltipMenu")){const e=new HA(t,i,x,T);i.setData("tooltipMenu",e)}const y=i.getData("tooltipMenu");y.setVisible(!0),y.updatePosition()}),i.on("pointerout",()=>{const E=i.getData("tooltipMenu");E&&E.setVisible(!1)})}static updateAllTooltipPositions(t){t.children.list.forEach(i=>{if(i instanceof Phaser.GameObjects.Sprite){const x=i.getData("tooltipMenu");x&&x.updatePosition()}})}}let cG=class extends Phaser.GameObjects.Sprite{};function Iz(g,t,i,x){const y=g.add.graphics();y.fillStyle(16777215,1),y.fillRoundedRect(0,0,200,60,16),y.setDepth(99);const e=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});e.setOrigin(.5),e.setWordWrapWidth(200-10*2),e.setDepth(100);const r=g.add.container(0,0,[y,e]);return r.setDepth(100),t.messageBubble=r,Bz(t),g.time.addEvent({delay:x,callback:()=>{r.destroy(),t.messageBubble===r&&(t.messageBubble=void 0)},callbackScope:g}),r}function Nz(g,t,i){const s=g.add.graphics();s.fillStyle(16777215,1),s.fillRoundedRect(0,0,200,60,16),s.setDepth(99);const y=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});y.setOrigin(.5),y.setWordWrapWidth(200-10*2),y.setDepth(100);const e=g.add.container(0,0,[s,y]);return e.setDepth(100),t.textBubble=e,wx(t),e}function wx(g){const t=g.textBubble;t&&(t.x=g.x,t.y=g.y-g.height-t.height/2)}function Bz(g){const t=g.messageBubble;t&&(t.x=g.x,t.y=g.y-g.height-t.height/2)}class Uz{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 x=t.data?.coords||{x:10,y:15};Pi.emit("playerMove",x)}stealFromNPC(t){console.log(`Attempting to steal from NPC with ID: ${t.npcId}`);const i={npcId:t.npcId,npcName:t.npcName,data:t.data};Pi.emit("playerSteal",i)}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,i,x,T){t.setInteractive(),t.on("pointerover",E=>{const s={npcId:t.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};Pi.emit("npcInteraction",s)}),t.on("pointerout",()=>{}),t.on("pointerdown",E=>{const s={npcId:t.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};console.log(`Click Registered at X: ${s.coords.x} Y: ${s.coords.y}`),Pi.emit("npcInteractionClick",s,1e3)})}}const Y1=new Uz;var WA={exports:{}};(function(g,t){(function(i,x){g.exports=x()})(py,function(){var i=function(V,j){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(et,st){et.__proto__=st}||function(et,st){for(var ht in st)Object.prototype.hasOwnProperty.call(st,ht)&&(et[ht]=st[ht])})(V,j)},x=function(){return(x=Object.assign||function(V){for(var j,et=1,st=arguments.length;et"u"||E.Promise||(E.Promise=Promise);var r=Object.getPrototypeOf,p={}.hasOwnProperty;function h(V,j){return p.call(V,j)}function a(V,j){typeof j=="function"&&(j=j(r(V))),(typeof Reflect>"u"?s:Reflect.ownKeys)(j).forEach(function(et){n(V,et,j[et])})}var l=Object.defineProperty;function n(V,j,et,st){l(V,j,e(et&&h(et,"get")&&typeof et.get=="function"?{get:et.get,set:et.set,configurable:!0}:{value:et,configurable:!0,writable:!0},st))}function u(V){return{from:function(j){return V.prototype=Object.create(j.prototype),n(V.prototype,"constructor",V),{extend:a.bind(null,V.prototype)}}}}var f=Object.getOwnPropertyDescriptor,o=[].slice;function c(V,j,et){return o.call(V,j,et)}function d(V,j){return j(V)}function v(V){if(!V)throw new Error("Assertion Failed")}function m(V){E.setImmediate?setImmediate(V):setTimeout(V,0)}function S(V,j){if(typeof j=="string"&&h(V,j))return V[j];if(!j)return V;if(typeof j!="string"){for(var et=[],st=0,ht=j.length;st"u"?[]:function(){var V=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[V,r(V),V];var j=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[j,r(j),V]}(),ne=Gs[0],lr=Gs[1],Gs=Gs[2],lr=lr&&lr.then,oe=ne&&ne.constructor,ge=!!Gs,xe=function(V,j){Ke.push([V,j]),qt&&(queueMicrotask(zi),qt=!1)},Ae=!0,qt=!0,Ge=[],Oe=[],Be=gt,Le={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:rt,pgp:!1,env:{},finalize:rt},ie=Le,Ke=[],ri=0,Ti=[];function le(V){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var j=this._PSD=ie;if(typeof V!="function"){if(V!==Ht)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Me(this,this._value))}this._state=null,this._value=null,++j.ref,function et(st,ht){try{ht(function(pt){if(st._state===null){if(pt===st)throw new TypeError("A promise cannot be resolved with itself.");var Mt=st._lib&&Di();pt&&typeof pt.then=="function"?et(st,function(Nt,zt){pt instanceof le?pt._then(Nt,zt):pt.then(Nt,zt)}):(st._state=!0,st._value=pt,Ce(st)),Mt&&en()}},Me.bind(null,st))}catch(pt){Me(st,pt)}}(this,V)}var xi={get:function(){var V=ie,j=Qr;function et(st,ht){var pt=this,Mt=!V.global&&(V!==ie||j!==Qr),Nt=Mt&&!xs(),zt=new le(function(ct,St){Ve(pt,new bt(ee(st,V,Mt,Nt),ee(ht,V,Mt,Nt),ct,St,V))});return this._consoleTask&&(zt._consoleTask=this._consoleTask),zt}return et.prototype=Ht,et},set:function(V){n(this,"then",V&&V.prototype===Ht?xi:{get:function(){return V},set:xi.set})}};function bt(V,j,et,st,ht){this.onFulfilled=typeof V=="function"?V:null,this.onRejected=typeof j=="function"?j:null,this.resolve=et,this.reject=st,this.psd=ht}function Me(V,j){var et,st;Oe.push(j),V._state===null&&(et=V._lib&&Di(),j=Be(j),V._state=!1,V._value=j,st=V,Ge.some(function(ht){return ht._value===st._value})||Ge.push(st),Ce(V),et&&en())}function Ce(V){var j=V._listeners;V._listeners=[];for(var et=0,st=j.length;et.",$e="String expected.",qe=[],ii="__dbnames",ai="readonly",Ji="readwrite";function hn(V,j){return V?j?function(){return V.apply(this,arguments)&&j.apply(this,arguments)}:V:j}var ki={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function mn(V){return typeof V!="string"||/\./.test(V)?function(j){return j}:function(j){return j[V]===void 0&&V in j&&delete(j=O(j))[V],j}}function ti(){throw q.Type()}function Se(V,j){try{var et=Nr(V),st=Nr(j);if(et!==st)return et==="Array"?1:st==="Array"?-1:et==="binary"?1:st==="binary"?-1:et==="string"?1:st==="string"?-1:et==="Date"?1:st!=="Date"?NaN:-1;switch(et){case"number":case"Date":case"string":return j$t+se&&Kt($t+Ft)})})}var Zt=Ki(et)&&et.limit===1/0&&(typeof V!="function"||V===La)&&{index:et.index,range:et.range};return Kt(0).then(function(){if(0=Ft})).length!==0?(St.forEach(function(Kt){Wt.push(function(){var Zt=It,$t=Kt._cfg.dbschema;Ia(vt,Zt,Ut),Ia(vt,$t,Ut),It=vt._dbSchema=$t;var se=Rn(Zt,$t);se.add.forEach(function(me){Fa(Ut,me[0],me[1].primKey,me[1].indexes)}),se.change.forEach(function(me){if(me.recreate)throw new q.Upgrade("Not yet support for changing primary key");var be=Ut.objectStore(me.name);me.add.forEach(function(_e){return En(be,_e)}),me.change.forEach(function(_e){be.deleteIndex(_e.name),En(be,_e)}),me.del.forEach(function(_e){return be.deleteIndex(_e)})});var ue=Kt._cfg.contentUpgrade;if(ue&&Kt._cfg.version>Ft){ko(vt,Ut),Lt._memoizedTables={};var Re=w($t);se.del.forEach(function(me){Re[me]=Zt[me]}),zr(vt,[vt.Transaction.prototype]),Fl(vt,[vt.Transaction.prototype],s(Re),Re),Lt.schema=Re;var pe,we=Q(ue);return we&&Us(),se=le.follow(function(){var me;(pe=ue(Lt))&&we&&(me=xs.bind(null,null),pe.then(me,me))}),pe&&typeof pe.then=="function"?le.resolve(pe):se.then(function(){return pe})}}),Wt.push(function(Zt){var $t,se,ue=Kt._cfg.dbschema;$t=ue,se=Zt,[].slice.call(se.db.objectStoreNames).forEach(function(Re){return $t[Re]==null&&se.db.deleteObjectStore(Re)}),zr(vt,[vt.Transaction.prototype]),Fl(vt,[vt.Transaction.prototype],vt._storeNames,vt._dbSchema),Lt.schema=vt._dbSchema}),Wt.push(function(Zt){vt.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(vt.idbdb.version/10)===Kt._cfg.version?(vt.idbdb.deleteObjectStore("$meta"),delete vt._dbSchema.$meta,vt._storeNames=vt._storeNames.filter(function($t){return $t!=="$meta"})):Zt.objectStore("$meta").put(Kt._cfg.version,"version"))})}),function Kt(){return Wt.length?le.resolve(Wt.shift()(Lt.idbtrans)).then(Kt):le.resolve()}().then(function(){Oa(It,Ut)})):le.resolve();var vt,Ft,Lt,Ut,Wt,It}).catch(Mt)):(s(ht).forEach(function(St){Fa(et,St,ht[St].primKey,ht[St].indexes)}),ko(V,et),void le.follow(function(){return V.on.populate.fire(pt)}).catch(Mt));var zt,ct})}function Ch(V,j){Oa(V._dbSchema,j),j.db.version%10!=0||j.objectStoreNames.contains("$meta")||j.db.createObjectStore("$meta").add(Math.ceil(j.db.version/10-1),"version");var et=Da(0,V.idbdb,j);Ia(V,V._dbSchema,j);for(var st=0,ht=Rn(et,V._dbSchema).change;stMath.pow(2,62)?0:It.oldVersion,vt=It<1,V.idbdb=Wt.result,pt&&Ch(V,St),gn(V,It/10,St,Lt))},Lt),Wt.onsuccess=di(function(){St=null;var It,Kt,Zt,$t,se,ue=V.idbdb=Wt.result,Re=c(ue.objectStoreNames);if(0"u"?le.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Ft){function Lt(){return indexedDB.databases().finally(Ft)}zt=setInterval(Lt,100),Lt()}).finally(function(){return clearInterval(zt)}):Promise.resolve()).then(Nt)]).then(function(){return Mt(),j.onReadyBeingFired=[],le.resolve(Wr(function(){return V.on.ready.fire(V.vip)})).then(function Ft(){if(0j.limit?Ft.length=j.limit:V.length===j.limit&&Ft.length=Kt.limit&&(!Kt.values||ue.req.values)&&po(ue.req.query.range,Kt.query.range)}),!1,Zt,$t];case"count":return se=$t.find(function(ue){return _i(ue.req.query.range,Kt.query.range)}),[se,!!se,Zt,$t]}}(j,et,"query",pt),St=ct[0],vt=ct[1],Ft=ct[2],Lt=ct[3];return St&&vt?St.obsSet=pt.obsSet:(vt=st.query(pt).then(function(Ut){var Wt=Ut.result;if(St&&(St.res=Wt),Mt){for(var It=0,Kt=Wt.length;It{console.log(`Texture ${s} loaded successfully.`),this.addNPCToScene(t,E,x,T)}),t.load.start()}else throw new Error(`Sprite with ID ${E.spriteImageId} not found`)}}catch(E){E instanceof Error?console.error(`Failed to load NPC: ${E.message}`):console.error("Failed to load NPC:",E)}}addNPCToScene(t,i,x,T){try{console.log(`Adding NPC to scene: ${JSON.stringify(i)}`),console.log(`Using sprite key: ${i.spriteKey}`);const E=t.add.sprite(x??i.startPosition.x,T??i.startPosition.y,i.spriteKey);E.scale=i.scale||1.5,E.name=i.id||"Error Missing Name",console.log(`NPC Sprite created with texture key ${i.spriteKey} at position (${i.startPosition.x}, ${i.startPosition.y})`);const s={id:i.id,sprite:E,walkingAnimationMapping:i.walkingAnimationMapping,startPosition:{x:x??i.startPosition.x,y:T??i.startPosition.y},speed:i.speed};if(console.log(`Grid engine config: ${JSON.stringify(s)}`),!t.textures.exists(i.spriteKey))throw new Error(`Texture with key ${i.spriteKey} does not exist in the scene`);t.gridEngine.addCharacter(s),console.log(`NPC added to grid engine with ID ${i.id}`),((e,r,p)=>{const h=t.gridEngine.getPosition(e.name);console.log(`Attaching NPC events to ${r} at position: ${JSON.stringify(h)}`),Y1.attachNPCEvent(e,r,p,{coords:h})})(E,i.name,i.actions.map(e=>({label:e}))),console.log(`NPC ${i.name} added to scene successfully`)}catch(E){E instanceof Error?console.error(`Error adding NPC to scene from addNPCToScene: ${E.message}`):console.error("Error adding NPC to scene:",E)}}}const XA=new Gz;function YA(g){return+g[g.length-1]}function kA(g){return g.startsWith("monster_bird_")&&!g.startsWith("monster_bird_shadow")}function KA(g,t,i,x,T){const E=[];for(let s=0;s<10;s++){const y=g.add.sprite(0,0,"monster_bird");y.setCrop(t,i,x,T),y.scale=3,E.push(y)}return E}function jA(g){return KA(g,0,0,61,47)}function ZA(g){return KA(g,22,47,16,10)}function JA(g){g.anims.create({key:"bird",frames:g.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class Vz extends jm.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}),EI()}async create(){await XA.initializeDatabase(),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 pG=class extends sd.GameObjects.Sprite{textBubble;tooltip};class Hz extends jm.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 du(t)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),Pi.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${e1()}`,notificationType:Au.success})}async create(){const t=this.make.tilemap({key:"cloud-city-map"});t.addTilesetImage("Cloud City","tiles");for(let E=0;E({id:"monster_bird_"+s,sprite:E,startPosition:{x:7,y:7+s},speed:5,collides:!1})),...this.monsterBirdShadows.map((E,s)=>({id:"monster_bird_shadow_"+s,sprite:E,startPosition:{x:7,y:7+s},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(t,x),this.loadRanges(),this.playerController=new VA(this,this.gridEngine,this.quadtree),Iz(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!",3e3),await XA.loadCharacter(this,"01J2DT4G871KJ0VNSHCNC5REDM"),this.gridEngine.moveRandomly("npc",1500,3),this.gridEngine.moveRandomly("fishNpc",1500,3);for(let E=0;E<10;E++)this.gridEngine.moveRandomly("monster_bird_"+E,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:E,exitTile:s,enterTile:y})=>{kA(E)&&this.gridEngine.moveTo("monster_bird_shadow_"+YA(E),{x:y.x,y:y.y})});const T=(E,s,y)=>{const e=this.gridEngine.getPosition(E.name);Y1.attachNPCEvent(E,s,y,{coords:e})};T(this.npcSprite,"FisherMan",[{label:"Talk"},{label:"Trade"},{label:"Move to"},{label:"Steal"},{label:"Combat"}]),T(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 i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Pi.emit("charEvent",i)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const i={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"};Pi.emit("charEvent",i)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Pi.emit("charEvent",i)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={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"};Pi.emit("charEvent",i)}}];for(const i of t)this.quadtree.insert(i)}update(){this.playerController?.handleMovement()}}class mG extends sd.GameObjects.Sprite{textBubble}class Wz extends jm.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 du(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 T=0;T({id:"monster_bird_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1})),...this.monsterBirdShadows.map((T,E)=>({id:"monster_bird_shadow_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(t,x),this.loadRanges(),this.playerController=new VA(this,this.gridEngine,this.quadtree),Nz(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let T=0;T<10;T++)this.gridEngine.moveRandomly("monster_bird_"+T,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:T,exitTile:E,enterTile:s})=>{kA(T)&&this.gridEngine.moveTo("monster_bird_shadow_"+YA(T),{x:s.x,y:s.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const t=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};Pi.emit("charEvent",i)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const T={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"};Pi.emit("charEvent",T)}catch(i){console.error("Error fetching data:",i);const x={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"};Pi.emit("charEvent",x)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};Pi.emit("charEvent",i)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={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"};Pi.emit("charEvent",i)}}];for(const i of t)this.quadtree.insert(i)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&wx(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&wx(this.fishNpcSprite)}}const Xz=cm.div` + // Your style here +`;function Yz(){const g=Pe.useRef(null);return Pe.useEffect(()=>{if(g.current){const t=g.current,x={...{title:"CryptoThrone",render:{antialias:!1},scale:{mode:sd.Scale.RESIZE,min:{width:1024,height:768},max:{width:1600,height:1200},zoom:1},type:sd.AUTO,transparent:!0,width:800,height:600,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:X4,mapping:"gridEngine"}]},scene:[Vz,Hz,Wz],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!1}}},parent:t},T=new sd.Game(x);return()=>{T.destroy(!0)}}},[]),he.jsx(Xz,{children:he.jsx("div",{ref:g})})}const SM=Rx({message:""}),kz=()=>{const g=Tl(SM);Pe.useEffect(()=>{const i=x=>{if(x){SM.set(x);const T=document.querySelector("#hs-stacked-overlays");T&&(T.classList.remove("hidden"),T.classList.add("open"))}};return Pi.on("charEvent",i),()=>{Pi.off("charEvent",i)}},[]);const t=()=>{const i=document.querySelector("#hs-stacked-overlays");i&&(i.classList.add("hidden"),i.classList.remove("open"))};return he.jsx(he.Fragment,{children:he.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:he.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:he.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(${g.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[he.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[he.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${g.character_name||"NPC"}`}),he.jsx("img",{src:g.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),he.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[he.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[he.jsx("h3",{className:"font-bold text-yellow-400",children:""}),he.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:[he.jsx("span",{className:"sr-only",children:"Close"}),he.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:[he.jsx("path",{d:"M18 6 6 18"}),he.jsx("path",{d:"m6 6 12 12"})]})]})]}),he.jsx("div",{className:"p-4 overflow-y-auto",children:he.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:g.message||"No Message"})}),he.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:he.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:[he.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"}),he.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},Kz=(g,t)=>{const i=yl(g);return i?he.jsxs("div",{style:{top:t.y,left:t.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[he.jsx("p",{className:"text-sm font-semibold",children:i.name}),he.jsxs("p",{className:"text-xs",children:["Type: ",i.type]}),he.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(i.bonuses)]}),he.jsxs("p",{className:"text-xs",children:["Durability: ",i.durability]}),he.jsxs("p",{className:"text-xs",children:["Weight: ",i.weight]})]}):null},jz=(g,t,i,x)=>he.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(g).map(T=>{const E=g[T];return Zz(E,t,i,x)})}),Zz=(g,t,i,x)=>{if(!g)return he.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 T=yl(g);return T?he.jsxs("li",{className:"text-sm relative",onMouseEnter:E=>t(T.id,E),onMouseLeave:i,onClick:E=>x(T.id,E),children:[T.name," (",T.type,") - Bonuses: ",JSON.stringify(T.bonuses)," - Durability: ",T.durability," - Weight: ",T.weight]},T.id):null},Jz=(g,t,i,x)=>he.jsx("ul",{className:"grid grid-cols-8 gap-1",children:g.map((T,E)=>{const s=yl(T);return s?he.jsx("li",{className:"text-sm relative hover:scale-[1.3] transition ease-in-out duration-100",onMouseEnter:y=>t(s.id,y),onMouseLeave:i,onClick:y=>x(s.id,y),children:he.jsx("img",{src:s.img,alt:s.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},E):null})}),$z=()=>{const g=Tl(Sn);Tl(mm),Tl(TI),Tl(Zr),Pe.useEffect(()=>{const r=p=>{};return Pi.on("playerEvent",r),()=>{Pi.off("playerEvent",r)}},[]);const t=(r,p)=>{Wc("tooltipItem",{id:r,position:{x:p.clientX+10,y:p.clientY-150}})},i=()=>{Wc("tooltipItem",{...Jh("tooltipItem"),id:null})},x=(r,p)=>{Wc("submenuItem",{id:r,position:{x:p.clientX,y:p.clientY-150}})},T=()=>{Wc("submenuItem",{...Jh("submenuItem"),id:null})},E=(r,p)=>{const h=yl(r);if(h){const a={itemId:h.id,action:p};Pi.emit("itemAction",a),T()}};if(!g||!g.stats)return null;const s=Jh("submenuItem"),y=s.id?BI(s.id):[],e=Jh("tooltipItem");return he.jsxs("div",{className:"fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",children:[he.jsx("button",{onClick:()=>Wc("isStatsMenuCollapsed",!Jh("isStatsMenuCollapsed")),className:"bg-yellow-500 text-white p-2 rounded",children:Jh("isStatsMenuCollapsed")?he.jsx(HI,{styleClass:"w-8"}):he.jsx(VI,{styleClass:"w-8"})}),he.jsxs("div",{className:`transition transform duration-1000 ease-in-out ${Jh("isStatsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:[he.jsxs("div",{className:"mb-4",children:[he.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),he.jsx("p",{className:"text-sm text-green-400",children:`HP: ${g.stats.health||"0"} / ${g.stats.maxHealth}`}),he.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${g.stats.mana||"0"} / ${g.stats.maxMana}`}),he.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${g.stats.energy||"0"} / ${g.stats.maxEnergy}`})]}),he.jsxs("div",{className:"mb-4",children:[he.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),he.jsx("p",{className:"text-sm",children:g.stats.username||"Guest"})]}),he.jsxs("div",{className:"mb-4",children:[he.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),he.jsx("p",{className:"text-sm",children:""})]}),he.jsxs("div",{className:"mb-4",children:[he.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),Jz(g.inventory.backpack,t,i,x)]}),he.jsxs("div",{className:"mb-4",children:[he.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),jz(g.inventory.equipment,t,i,x)]}),e.id&&Kz(e.id,e.position),s.id&&he.jsxs("div",{style:{top:s.position.y,left:s.position.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[he.jsx("button",{onClick:T,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),he.jsx("p",{className:"text-sm strong",children:"Actions:"}),he.jsxs("ul",{className:"text-xs",children:[y.map(r=>he.jsx("li",{onClick:()=>s.id&&E(s.id,r),className:"cursor-pointer hover:bg-gray-600",children:r.charAt(0).toUpperCase()+r.slice(1)},r)),he.jsx("li",{onClick:T,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})]})},cy=Rx(null),dy=Rx(null),Qz=()=>{const g=Tl(cy),[t,i]=Pe.useState({x:0,y:0});Pe.useEffect(()=>{const y=e=>{e&&(cy.set(e),i(x(e.coords.x,e.coords.y)))};return Pi.on("npcInteractionClick",y),()=>{Pi.off("npcInteractionClick",y)}},[]);const x=(y,e)=>{let n=y+250,u=e+250;return n+200>window.innerWidth-10&&(n=window.innerWidth-200-10),u+200>window.innerHeight-10&&(u=window.innerHeight-200-10),n<10&&(n=10),u<10&&(u=10),{x:n,y:u}},T=y=>{if(g){const e=Y1.getActionHandler(y);e&&(e(g),E())}},E=()=>{cy.set(null)},s=()=>{if(!g)return null;const{npcName:y,actions:e,npcId:r}=g,{x:p,y:h}=t;return he.jsxs("div",{className:"absolute bg-zinc-900 border border-yellow-300 rounded-md p-2 z-50 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",style:{left:`${p}px`,top:`${h}px`,transform:"translate(-50%, -100%)"},children:[he.jsxs("div",{className:"flex justify-between items-center mb-2",children:[he.jsx("h3",{className:"font-bold text-sm",children:y}),he.jsx("button",{onClick:E,className:"text-xs font-bold m-1 text-yellow-300 hover:text-yellow-500",children:"X"})]}),e.map((a,l)=>he.jsx("button",{onClick:()=>T(a),className:"block w-full text-xs py-1 px-2 mb-1 bg-yellow-500 hover:bg-yellow-400 rounded",children:a},l)),he.jsx("button",{onClick:E,className:"block w-full text-xs py-1 px-2 mt-2 bg-red-500 hover:bg-red-600 rounded text-white",children:"Close"})]},r)};return he.jsx("div",{children:s()})},_z=()=>{const g=Tl(Zh);Pe.useEffect(()=>{const i=x=>{if(x){const T=Date.now()+Math.random();Zh.set([...Zh.get(),{id:T,...x}]),setTimeout(()=>{Zh.set(Zh.get().filter(E=>E.id!==T))},5e3)}};return Pi.on("notification",i),()=>{Pi.off("notification",i)}},[]);const t=i=>{Zh.set(Zh.get().filter(x=>x.id!==i))};return he.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(g)&&g.map(i=>he.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${i.notificationType.color}`,role:"alert",children:he.jsxs("div",{className:"flex p-4",children:[he.jsx("img",{src:i.notificationType.imgUrl,alt:i.notificationType.type,className:"flex-shrink-0 size-4"}),he.jsxs("div",{className:"ms-2",children:[he.jsx("h3",{className:"text-sm font-bold",children:i.title}),he.jsx("p",{className:"text-sm",children:i.message})]}),he.jsx("div",{className:"ms-auto",children:he.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(i.id),children:[he.jsx("span",{className:"sr-only",children:"Close"}),he.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:[he.jsx("path",{d:"M18 6 6 18"}),he.jsx("path",{d:"m6 6 12 12"})]})]})})]})},i.id))})},qz=()=>{const g=Tl(dy),[t,i]=Pe.useState([]),[x,T]=Pe.useState(null);Pe.useEffect(()=>{const y=r=>{r&&dy.set(r)},e=r=>{r&&i(r.diceValues)};return Pi.on("playerSteal",y),Pi.on("diceRollResult",e),()=>{Pi.off("playerSteal",y),Pi.off("diceRollResult",e)}},[]),Pe.useEffect(()=>{t.length>0&&E(t)},[t]);const E=y=>{const e=y.reduce((a,l)=>a+l,0);if(T(e),!g)return;let r="",p="";switch(!0){case e===12:r="01J27QABD2GPFNRVK69S51HSGB",p=`You successfully stole a ${r}!`;break;case e===11:r="01J27QN2KZG1RDZW4CE9Q9Z3YQ",p=`You successfully stole a ${r}!`;break;case e===10:r="01J269PK47V1DWX2S1251DEASD",p=`You successfully stole a ${r}!`;break;case e===9:r="Blue Shark",p=`You successfully stole a ${r}!`;break;case e>=7:r="Salmon",p=`You successfully stole a ${r}!`;break;case e===2:Pi.emit("notification",{title:"Danger",message:`You crit failed to steal from ${g.npcName}!`,notificationType:Au.danger}),Pi.emit("playerDamage",{damage:"5"});break;default:Pi.emit("notification",{title:"Danger",message:`You failed to steal from ${g.npcName}!`,notificationType:Au.danger}),Pi.emit("playerDamage",{damage:"1"});return}const h=MI(r);h?Pi.emit("playerReward",{message:p,item:h}):console.warn("Item not found in ItemDB")},s=()=>{o2([]),i([]),T(null),dy.set(null)};return g?he.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 bg-zinc-800 bg-opacity-50",children:he.jsxs("div",{className:"bg-zinc-800 p-4 rounded-lg shadow-lg max-w-xs w-full",children:[he.jsx(tG,{npcName:g.npcName,roll:x}),he.jsx(iG,{}),he.jsx(nG,{handleClose:s})]})}):null},tG=({npcName:g,roll:t})=>he.jsxs("div",{children:[he.jsx("h2",{className:"text-lg text-yellow-400 font-bold mb-4",children:"Steal Attempt"}),he.jsxs("p",{className:"mb-4",children:["Roll the dice to steal from ",g,". You need a total of 7 or higher to succeed."]}),t!==null&&he.jsxs("p",{className:"mb-4",children:["Your roll: ",t]})]}),eG=()=>he.jsx(Dz,{textures:{side1:"/assets/items/set/dice/dice1.png",side2:"/assets/items/set/dice/dice2.png",side3:"/assets/items/set/dice/dice3.png",side4:"/assets/items/set/dice/dice4.png",side5:"/assets/items/set/dice/dice5.png",side6:"/assets/items/set/dice/dice6.png"},styleClass:"h-96",diceCount:2}),iG=Pe.memo(eG),nG=({handleClose:g})=>he.jsx("button",{onClick:g,className:"block w-full py-2 bg-red-500 text-white rounded hover:bg-red-700 mt-2",children:"Close"}),rG=cm.div` + // Your style here +`;function gG(){return he.jsxs(rG,{children:[he.jsx($z,{}),he.jsx("div",{className:"flex justify-center items-center h-screen",children:he.jsxs("div",{className:"border-4 border-yellow-500 rounded-xl",children:[he.jsx(qz,{}),he.jsx(Yz,{}),he.jsx(_z,{})]})}),he.jsx(Qz,{}),he.jsx(kz,{})]})}export{gG as default}; diff --git a/docs/_astro/App.Bvb9y5My.js b/docs/_astro/App.Bvb9y5My.js deleted file mode 100644 index ee6fed3..0000000 --- a/docs/_astro/App.Bvb9y5My.js +++ /dev/null @@ -1,10214 +0,0 @@ -import{j as Xt}from"./jsx-runtime.BFYNFNPI.js";import{g as gm,r as ym,a as te,c as yb}from"./index.DIpCM_17.js";import{p as xb,a as Ax}from"./index.DxhZiom7.js";import{t as kn}from"./index.BH1EYZ08.js";var mM={exports:{}},Ei={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var wx=Symbol.for("react.element"),Px=Symbol.for("react.portal"),xm=Symbol.for("react.fragment"),Sm=Symbol.for("react.strict_mode"),Tm=Symbol.for("react.profiler"),Em=Symbol.for("react.provider"),Mm=Symbol.for("react.context"),Sb=Symbol.for("react.server_context"),Cm=Symbol.for("react.forward_ref"),Am=Symbol.for("react.suspense"),wm=Symbol.for("react.suspense_list"),Pm=Symbol.for("react.memo"),Rm=Symbol.for("react.lazy"),Tb=Symbol.for("react.offscreen"),gM;gM=Symbol.for("react.module.reference");function Fs(g){if(typeof g=="object"&&g!==null){var e=g.$$typeof;switch(e){case wx:switch(g=g.type,g){case xm:case Tm:case Sm:case Am:case wm:return g;default:switch(g=g&&g.$$typeof,g){case Sb:case Mm:case Cm:case Rm:case Pm:case Em:return g;default:return e}}case Px:return e}}}Ei.ContextConsumer=Mm;Ei.ContextProvider=Em;Ei.Element=wx;Ei.ForwardRef=Cm;Ei.Fragment=xm;Ei.Lazy=Rm;Ei.Memo=Pm;Ei.Portal=Px;Ei.Profiler=Tm;Ei.StrictMode=Sm;Ei.Suspense=Am;Ei.SuspenseList=wm;Ei.isAsyncMode=function(){return!1};Ei.isConcurrentMode=function(){return!1};Ei.isContextConsumer=function(g){return Fs(g)===Mm};Ei.isContextProvider=function(g){return Fs(g)===Em};Ei.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===wx};Ei.isForwardRef=function(g){return Fs(g)===Cm};Ei.isFragment=function(g){return Fs(g)===xm};Ei.isLazy=function(g){return Fs(g)===Rm};Ei.isMemo=function(g){return Fs(g)===Pm};Ei.isPortal=function(g){return Fs(g)===Px};Ei.isProfiler=function(g){return Fs(g)===Tm};Ei.isStrictMode=function(g){return Fs(g)===Sm};Ei.isSuspense=function(g){return Fs(g)===Am};Ei.isSuspenseList=function(g){return Fs(g)===wm};Ei.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===xm||g===Tm||g===Sm||g===Am||g===wm||g===Tb||typeof g=="object"&&g!==null&&(g.$$typeof===Rm||g.$$typeof===Pm||g.$$typeof===Em||g.$$typeof===Mm||g.$$typeof===Cm||g.$$typeof===gM||g.getModuleId!==void 0)};Ei.typeOf=Fs;mM.exports=Ei;var yM=mM.exports;function Eb(g){function e(Q,Y,K,U,V){for(var j=0,$=0,q=0,it=0,nt,et,ht=0,ut=0,dt,mt=dt=nt=0,gt=0,At=0,ot=0,st=0,yt=K.length,Tt=yt-1,wt,Et="",Gt="",Wt="",Jt="",$t;gtnt)&&(st=(Et=Et.replace(" ",":")).length),0U&&(U=(Y=Y.trim()).charCodeAt(0)),U){case 38:return Y.replace(s,"$1"+Q.trim());case 58:return Q.trim()+Y.replace(s,"$1"+Q.trim());default:if(0<1*K&&0$.charCodeAt(8))break;case 115:V=V.replace($,"-webkit-"+$)+";"+V;break;case 207:case 102:V=V.replace($,"-webkit-"+(102K.charCodeAt(0)&&(K=K.trim()),J=K,K=[J],01?e-1:0),x=1;x0?" Args: "+i.join(", "):""))}var Wb=function(){function g(i){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=i}var e=g.prototype;return e.indexOfGroup=function(i){for(var x=0,T=0;T=this.groupSizes.length){for(var T=this.groupSizes,E=T.length,a=E;i>=a;)(a<<=1)<0&&xd(16,""+i);this.groupSizes=new Uint32Array(a),this.groupSizes.set(T),this.length=a;for(var y=E;y=this.length||this.groupSizes[i]===0)return x;for(var T=this.groupSizes[i],E=this.indexOfGroup(i),a=E+T,y=E;y=Nc&&(Nc=e+1),Gv.set(g,e),im.set(e,g)},kb="style["+of+'][data-styled-version="5.3.6"]',Kb=new RegExp("^"+of+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),jb=function(g,e,i){for(var x,T=i.split(","),E=0,a=T.length;E=0;r--){var p=t[r];if(p&&p.nodeType===1&&p.hasAttribute(of))return p}}(i),E=T!==void 0?T.nextSibling:null;x.setAttribute(of,"active"),x.setAttribute("data-styled-version","5.3.6");var a=Jb();return a&&x.setAttribute("nonce",a),i.insertBefore(x,E),x},$b=function(){function g(i){var x=this.element=MM(i);x.appendChild(document.createTextNode("")),this.sheet=function(T){if(T.sheet)return T.sheet;for(var E=document.styleSheets,a=0,y=E.length;a=0){var T=document.createTextNode(x),E=this.nodes[i];return this.element.insertBefore(T,E||null),this.length++,!0}return!1},e.deleteRule=function(i){this.element.removeChild(this.nodes[i]),this.length--},e.getRule=function(i){return i0&&(h+=o+",")}),E+=""+r+p+'{content:"'+h+`"}/*!sc*/ -`}}}return E}(this)},g}(),tF=/(a)(d)/gi,VS=function(g){return String.fromCharCode(g+(g>25?39:97))};function vy(g){var e,i="";for(e=Math.abs(g);e>52;e=e/52|0)i=VS(e%52)+i;return(VS(e%52)+i).replace(tF,"$1-$2")}var Ju=function(g,e){for(var i=e.length;i;)g=33*g^e.charCodeAt(--i);return g},AM=function(g){return Ju(5381,g)};function eF(g){for(var e=0;e>>0);if(!i.hasNameForId(T,y)){var t=x(a,"."+y,void 0,T);i.insertRules(T,y,t)}E.push(y),this.staticRulesId=y}else{for(var r=this.rules.length,p=Ju(this.baseHash,x.hash),h="",o=0;o>>0);if(!i.hasNameForId(T,f)){var s=x(h,"."+f,void 0,T);i.insertRules(T,f,s)}E.push(f)}}return E.join(" ")},g}(),rF=/^\s*\/\/.*$/gm,sF=[":","[",".","#"];function aF(g){var e,i,x,T,E=g===void 0?el:g,a=E.options,y=a===void 0?el:a,t=E.plugins,r=t===void 0?em:t,p=new Eb(y),h=[],o=function(u){function f(s){if(s)try{u(s+"}")}catch{}}return function(s,c,d,v,m,S,M,A,C,w){switch(s){case 1:if(C===0&&c.charCodeAt(0)===64)return u(c+";"),"";break;case 2:if(A===0)return c+"/*|*/";break;case 3:switch(A){case 102:case 112:return u(d[0]+c),"";default:return c+(w===0?"/*|*/":"")}case-2:c.split("/*|*/}").forEach(f)}}}(function(u){h.push(u)}),l=function(u,f,s){return f===0&&sF.indexOf(s[i.length])!==-1||s.match(T)?u:"."+e};function n(u,f,s,c){c===void 0&&(c="&");var d=u.replace(rF,""),v=f&&s?s+" "+f+" { "+d+" }":d;return e=c,i=f,x=new RegExp("\\"+i+"\\b","g"),T=new RegExp("(\\"+i+"\\b){2,}"),p(s||!f?"":f,v)}return p.use([].concat(r,[function(u,f,s){u===2&&s.length&&s[0].lastIndexOf(i)>0&&(s[0]=s[0].replace(x,l))},o,function(u){if(u===-2){var f=h;return h=[],f}}])),n.hash=r.length?r.reduce(function(u,f){return f.name||xd(15),Ju(u,f.name)},5381).toString():"",n}var wM=ym.createContext();wM.Consumer;var PM=ym.createContext(),oF=(PM.Consumer,new CM),my=aF();function lF(){return te.useContext(wM)||oF}function hF(){return te.useContext(PM)||my}var uF=function(){function g(e,i){var x=this;this.inject=function(T,E){E===void 0&&(E=my);var a=x.name+E.hash;T.hasNameForId(x.id,a)||T.insertRules(x.id,a,E(x.rules,a,"@keyframes"))},this.toString=function(){return xd(12,String(x.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=i}return g.prototype.getName=function(e){return e===void 0&&(e=my),this.name+e.hash},g}(),fF=/([A-Z])/,cF=/([A-Z])/g,dF=/^ms-/,pF=function(g){return"-"+g.toLowerCase()};function HS(g){return fF.test(g)?g.replace(cF,pF).replace(dF,"-ms-"):g}var WS=function(g){return g==null||g===!1||g===""};function lf(g,e,i,x){if(Array.isArray(g)){for(var T,E=[],a=0,y=g.length;a1?e-1:0),x=1;x?@[\\\]^`{|}~-]+/g,yF=/(^-|-$)/g;function l0(g){return g.replace(gF,"-").replace(yF,"")}var xF=function(g){return vy(AM(g)>>>0)};function Xp(g){return typeof g=="string"&&!0}var gy=function(g){return typeof g=="function"||typeof g=="object"&&g!==null&&!Array.isArray(g)},SF=function(g){return g!=="__proto__"&&g!=="constructor"&&g!=="prototype"};function TF(g,e,i){var x=g[i];gy(e)&&gy(x)?RM(x,e):g[i]=e}function RM(g){for(var e=arguments.length,i=new Array(e>1?e-1:0),x=1;x=0||(w[A]=S[A]);return w}(e,["componentId"]),m=d&&d+"-"+(Xp(c)?c:l0(zS(c)));return bM(c,qa({},v,{attrs:o,componentId:m}),i)},Object.defineProperty(n,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(c){this._foldedDefaultProps=x?RM({},g.defaultProps,c):c}}),n.toString=function(){return"."+n.styledComponentId},T&&Vb(n,g,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),n}var nm=function(g){return function e(i,x,T){if(T===void 0&&(T=el),!yM.isValidElementType(x))return xd(1,String(x));var E=function(){return i(x,T,vF.apply(void 0,arguments))};return E.withConfig=function(a){return e(i,x,qa({},T,{},a))},E.attrs=function(a){return e(i,x,qa({},T,{attrs:Array.prototype.concat(T.attrs,a).filter(Boolean)}))},E}(bM,g)};["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(g){nm[g]=nm(g)});var FM={exports:{}};(function(g,e){(function(x,T){g.exports=T()})(yb,()=>(()=>{var i={50792:a=>{var y=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function p(n,u,f){this.fn=n,this.context=u,this.once=f||!1}function h(n,u,f,s,c){if(typeof f!="function")throw new TypeError("The listener must be a function");var d=new p(f,s||n,c),v=t?t+u:u;return n._events[v]?n._events[v].fn?n._events[v]=[n._events[v],d]:n._events[v].push(d):(n._events[v]=d,n._eventsCount++),n}function o(n,u){--n._eventsCount===0?n._events=new r:delete n._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,s;if(this._eventsCount===0)return u;for(s in f=this._events)y.call(f,s)&&u.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,s=this._events[f];if(!s)return[];if(s.fn)return[s.fn];for(var c=0,d=s.length,v=new Array(d);c{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(38829),p=function(h,o,l,n){for(var u=h[0],f=1;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"angle",o,l,n,u)};a.exports=p},60757:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){for(var h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){p===void 0&&(p=0);for(var h=p;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){p===void 0&&(p=0);for(var h=t.length-1;h>=p;h--){var o=t[h],l=!0;for(var n in r)o[n]!==r[n]&&(l=!1);if(l)return o}return null};a.exports=y},94420:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(11879),p=t(60461),h=t(95540),o=t(29747),l=t(41481),n=new l({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1).setOrigin(0,0),u=function(f,s){s===void 0&&(s={});var c=s.hasOwnProperty("width"),d=s.hasOwnProperty("height"),v=h(s,"width",-1),m=h(s,"height",-1),S=h(s,"cellWidth",1),M=h(s,"cellHeight",S),A=h(s,"position",p.TOP_LEFT),C=h(s,"x",0),w=h(s,"y",0),P=0,L=0,O=v*S,I=m*M;n.setPosition(C,w),n.setSize(S,M);for(var D=0;D{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"alpha",o,l,n,u)};a.exports=p},67285:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"x",o,l,n,u)};a.exports=p},9074:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"x",o,n,f,s),r(h,"y",l,u,f,s)};a.exports=p},75222:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"y",o,l,n,u)};a.exports=p},22983:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var o=p,l=(h-p)/t.length,n=r.x,u=r.y,f=r.radius,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p===void 0&&(p=0),h===void 0&&(h=6.28);for(var o=p,l=(h-p)/t.length,n=r.width/2,u=r.height/2,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(15258),p=t(26708),h=function(o,l,n){var u;n?u=p(l,n,o.length):u=r(l,o.length);for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(14649),p=t(86003),h=t(49498),o=function(l,n,u){u===void 0&&(u=0);var f=r(n,!1,l.length);u>0?p(f,u):u<0&&h(f,Math.abs(u));for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(84993),p=function(h,o,l){var n=r({x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2},l),u=r({x1:o.x2,y1:o.y2,x2:o.x3,y2:o.y3},l),f=r({x1:o.x3,y1:o.y3,x2:o.x1,y2:o.y1},l);n.pop(),u.pop(),f.pop(),n=n.concat(u,f);for(var s=n.length/h.length,c=0,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){for(var h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l){h===void 0&&(h=0),o===void 0&&(o=0),l===void 0&&(l=1);var n,u=0,f=t.length;if(l===1)for(n=o;n=0;n--)t[n][r]+=p+u*h,u++;return t};a.exports=y},43967:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l){h===void 0&&(h=0),o===void 0&&(o=0),l===void 0&&(l=1);var n,u=0,f=t.length;if(l===1)for(n=o;n=0;n--)t[n][r]=p+u*h,u++;return t};a.exports=y},88926:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(28176),p=function(h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(24820),p=function(h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65822),p=function(h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26597),p=function(h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(90260),p=function(h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"rotation",o,l,n,u)};a.exports=p},91051:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(1163),p=t(20339),h=function(o,l,n){for(var u=l.x,f=l.y,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(1163),p=function(h,o,l,n){var u=o.x,f=o.y;if(n===0)return h;for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"scaleX",o,l,n,u)};a.exports=p},94868:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"scaleX",o,n,f,s),r(h,"scaleY",l,u,f,s)};a.exports=p},95532:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66979),p=function(h,o,l,n,u){return r(h,"scaleY",o,l,n,u)};a.exports=p},8689:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"alpha",o,l,n,u)};a.exports=p},2645:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n){return r(h,"blendMode",o,0,l,n)};a.exports=p},32372:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"depth",o,l,n,u)};a.exports=p},85373:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){for(var h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"originX",o,n,f,s),r(h,"originY",l,u,f,s),h.forEach(function(c){c.updateDisplayOrigin()}),h};a.exports=p},79939:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"rotation",o,l,n,u)};a.exports=p},2699:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"scaleX",o,n,f,s),r(h,"scaleY",l,u,f,s)};a.exports=p},98739:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"scaleX",o,l,n,u)};a.exports=p},98476:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"scaleY",o,l,n,u)};a.exports=p},6207:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"scrollFactorX",o,n,f,s),r(h,"scrollFactorY",l,u,f,s)};a.exports=p},6607:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"scrollFactorX",o,l,n,u)};a.exports=p},72248:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"scrollFactorY",o,l,n,u)};a.exports=p},14036:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n){return r(h,"visible",o,0,l,n)};a.exports=p},77597:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"x",o,l,n,u)};a.exports=p},83194:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u,f,s){return l==null&&(l=o),r(h,"x",o,n,f,s),r(h,"y",l,u,f,s)};a.exports=p},67678:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43967),p=function(h,o,l,n,u){return r(h,"y",o,l,n,u)};a.exports=p},35850:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u){n===void 0&&(n=0),u===void 0&&(u=new r);var f,s,c=h.length;if(c===1)f=h[0].x,s=h[0].y,h[0].x=o,h[0].y=l;else{var d=1,v=0;n===0&&(v=c-1,d=c-2),f=h[v].x,s=h[v].y,h[v].x=o,h[v].y=l;for(var m=0;m=c||d===-1)){var S=h[d],M=S.x,A=S.y;S.x=f,S.y=s,f=M,s=A,n===0?d--:d++}}return u.x=f,u.y=s,u};a.exports=p},8628:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33680),p=function(h){return r(h)};a.exports=p},21837:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7602),p=function(h,o,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,s;if(u)for(s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54261),p=function(h,o,l,n,u){u===void 0&&(u=!1);var f=Math.abs(n-l)/h.length,s;if(u)for(s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){if(o===void 0&&(o=!1),t.length===0)return t;if(t.length===1)return o?t[0][r]+=(h+p)/2:t[0][r]=(h+p)/2,t;var l=Math.abs(h-p)/(t.length-1),n;if(o)for(n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=0;r{/** - * @author Richard Davey - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(15994),p=function(h,o,l){l===void 0&&(l=0);for(var n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AlignTo:t(11517),Angle:t(80318),Call:t(60757),GetFirst:t(69927),GetLast:t(32265),GridAlign:t(94420),IncAlpha:t(41721),IncX:t(67285),IncXY:t(9074),IncY:t(75222),PlaceOnCircle:t(22983),PlaceOnEllipse:t(95253),PlaceOnLine:t(88505),PlaceOnRectangle:t(41346),PlaceOnTriangle:t(11575),PlayAnimation:t(29953),PropertyValueInc:t(66979),PropertyValueSet:t(43967),RandomCircle:t(88926),RandomEllipse:t(33286),RandomLine:t(96e3),RandomRectangle:t(28789),RandomTriangle:t(97154),Rotate:t(20510),RotateAround:t(91051),RotateAroundDistance:t(76332),ScaleX:t(61619),ScaleXY:t(94868),ScaleY:t(95532),SetAlpha:t(8689),SetBlendMode:t(2645),SetDepth:t(32372),SetHitArea:t(85373),SetOrigin:t(81583),SetRotation:t(79939),SetScale:t(2699),SetScaleX:t(98739),SetScaleY:t(98476),SetScrollFactor:t(6207),SetScrollFactorX:t(6607),SetScrollFactorY:t(72248),SetTint:t(14036),SetVisible:t(50159),SetX:t(77597),SetXY:t(83194),SetY:t(67678),ShiftPosition:t(35850),Shuffle:t(8628),SmootherStep:t(21910),SmoothStep:t(21837),Spread:t(62054),ToggleVisible:t(79815),WrapInRectangle:t(39665)}},42099:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(74943),o=t(81957),l=t(41138),n=t(35154),u=t(90126),f=new p({initialize:function(c,d,v){this.manager=c,this.key=d,this.type="frame",this.frames=this.getFrames(c.textureManager,n(v,"frames",[]),n(v,"defaultTextureKey",null),n(v,"sortFrames",!0)),this.frameRate=n(v,"frameRate",null),this.duration=n(v,"duration",null),this.msPerFrame,this.skipMissedFrames=n(v,"skipMissedFrames",!0),this.delay=n(v,"delay",0),this.repeat=n(v,"repeat",0),this.repeatDelay=n(v,"repeatDelay",0),this.yoyo=n(v,"yoyo",!1),this.showBeforeDelay=n(v,"showBeforeDelay",!1),this.showOnStart=n(v,"showOnStart",!1),this.hideOnComplete=n(v,"hideOnComplete",!1),this.randomFrame=n(v,"randomFrame",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(h.PAUSE_ALL,this.pause,this),this.manager.on(h.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(s,c,d,v){d===null&&v===null?(s.frameRate=24,s.duration=24/c*1e3):d&&v===null?(s.duration=d,s.frameRate=c/(d/1e3)):(s.frameRate=v,s.duration=c/v*1e3),s.msPerFrame=1e3/s.frameRate},addFrame:function(s){return this.addFrameAt(this.frames.length,s)},addFrameAt:function(s,c){var d=this.getFrames(this.manager.textureManager,c);if(d.length>0){if(s===0)this.frames=d.concat(this.frames);else if(s===this.frames.length)this.frames=this.frames.concat(d);else{var v=this.frames.slice(0,s),m=this.frames.slice(s);this.frames=v.concat(d,m)}this.updateFrameSequence()}return this},checkFrame:function(s){return s>=0&&s0){M.isLast=!0,M.nextFrame=m[0],m[0].prevFrame=M;var G=1/(m.length-1);for(C=0;C0?s.inReverse&&s.forward?s.forward=!1:this.repeatAnimation(s):s.complete():this.updateAndGetNextTick(s,c.nextFrame)},handleYoyoFrame:function(s,c){if(c||(c=!1),s.inReverse===!c&&s.repeatCounter>0){(s.repeatDelay===0||s.pendingRepeat)&&(s.forward=c),this.repeatAnimation(s);return}if(s.inReverse!==c&&s.repeatCounter===0){s.complete();return}s.forward=c;var d=c?s.currentFrame.nextFrame:s.currentFrame.prevFrame;this.updateAndGetNextTick(s,d)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(s){var c=s.currentFrame;c.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,c.prevFrame)},updateAndGetNextTick:function(s,c){s.setCurrentFrame(c),this.getNextTick(s)},removeFrame:function(s){var c=this.frames.indexOf(s);return c!==-1&&this.removeFrameAt(c),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(c){s.frames.push(c.toJSON())}),s},updateFrameSequence:function(){for(var s=this.frames.length,c=1/(s-1),d,v=0;v1?(d.isLast=!0,d.prevFrame=this.frames[s-2],d.nextFrame=this.frames[0]):s>1&&(d.prevFrame=this.frames[v-1],d.nextFrame=this.frames[v+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(h.PAUSE_ALL,this.pause,this),this.manager.off(h.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} - */var r=t(83419),p=new r({initialize:function(o,l,n,u,f){f===void 0&&(f=!1),this.textureKey=o,this.textureFrame=l,this.index=n,this.frame=u,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=f},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});a.exports=p},60848:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(42099),p=t(83419),h=t(90330),o=t(50792),l=t(74943),n=t(8443),u=t(95540),f=t(35154),s=t(36383),c=t(20283),d=t(41836),v=new p({Extends:o,initialize:function(S){o.call(this),this.game=S,this.textureManager=null,this.globalTimeScale=1,this.anims=new h,this.mixes=new h,this.paused=!1,this.name="AnimationManager",S.events.once(n.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(n.DESTROY,this.destroy,this)},addMix:function(m,S,M){var A=this.anims,C=this.mixes,w=typeof m=="string"?m:m.key,P=typeof S=="string"?S:S.key;if(A.has(w)&&A.has(P)){var L=C.get(w);L||(L={}),L[P]=M,C.set(w,L)}return this},removeMix:function(m,S){var M=this.mixes,A=typeof m=="string"?m:m.key,C=M.get(A);if(C)if(S){var w=typeof S=="string"?S:S.key;C.hasOwnProperty(w)&&delete C[w]}else S||M.delete(A);return this},getMix:function(m,S){var M=this.mixes,A=typeof m=="string"?m:m.key,C=typeof S=="string"?S:S.key,w=M.get(A);return w&&w.hasOwnProperty(C)?w[C]:0},add:function(m,S){return this.anims.has(m)?(console.warn("Animation key exists: "+m),this):(S.key=m,this.anims.set(m,S),this.emit(l.ADD_ANIMATION,m,S),this)},exists:function(m){return this.anims.has(m)},createFromAseprite:function(m,S,M){var A=[],C=this.game.cache.json.get(m);if(!C)return console.warn("No Aseprite data found for: "+m),A;var w=this,P=f(C,"meta",null),L=f(C,"frames",null);if(P&&L){var O=f(P,"frameTags",[]);O.forEach(function(I){var D=[],B=u(I,"name",null),G=u(I,"from",0),z=u(I,"to",0),W=u(I,"direction","forward");if(B&&(!S||S&&S.indexOf(B)>-1)){for(var k=0,J=G;J<=z;J++){var Q=J.toString(),Y=L[Q];if(Y){var K=u(Y,"duration",s.MAX_SAFE_INTEGER);D.push({key:m,frame:Q,duration:K}),k+=K}}W==="reverse"&&(D=D.reverse());var U={key:B,frames:D,duration:k,yoyo:W==="pingpong"},V;M?M.anims&&(V=M.anims.create(U)):V=w.create(U),V&&A.push(V)}})}return A},create:function(m){var S=m.key,M=!1;return S&&(M=this.get(S),M?console.warn("AnimationManager key already exists: "+S):(M=new r(this,S,m),this.anims.set(S,M),this.emit(l.ADD_ANIMATION,S,M))),M},fromJSON:function(m,S){S===void 0&&(S=!1),S&&this.anims.clear(),typeof m=="string"&&(m=JSON.parse(m));var M=[];if(m.hasOwnProperty("anims")&&Array.isArray(m.anims)){for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(42099),p=t(30976),h=t(83419),o=t(90330),l=t(74943),n=t(95540),u=new h({initialize:function(s){this.parent=s,this.animationManager=s.scene.sys.anims,this.animationManager.on(l.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(f){var s=this.parent;if(f===void 0)return this.nextAnimsQueue.length=0,this.nextAnim=null,s;Array.isArray(f)||(f=[f]);for(var c=0;cv&&(M=0),this.randomFrame&&(M=p(0,v-1));var A=d.frames[M];M===0&&!this.forward&&(A=d.getLastFrame()),this.currentFrame=A}return this.parent},pause:function(f){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),f!==void 0&&this.setCurrentFrame(f),this.parent},resume:function(f){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),f!==void 0&&this.setCurrentFrame(f),this.parent},playAfterDelay:function(f,s){if(!this.isPlaying)this.delayCounter=s,this.play(f,!0);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.nextAnim=f,this._pendingStop=1,this._pendingStopValue=s}return this.parent},playAfterRepeat:function(f,s){if(s===void 0&&(s=1),!this.isPlaying)this.play(f);else{var c=this.nextAnim,d=this.nextAnimsQueue;c&&d.unshift(c),this.repeatCounter!==-1&&s>this.repeatCounter&&(s=this.repeatCounter),this.nextAnim=f,this._pendingStop=2,this._pendingStopValue=s}return this.parent},play:function(f,s){s===void 0&&(s=!1);var c=this.currentAnim,d=this.parent,v=typeof f=="string"?f:f.key;if(s&&this.isPlaying&&c.key===v)return d;if(c&&this.isPlaying){var m=this.animationManager.getMix(c.key,f);if(m>0)return this.playAfterDelay(f,m)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f)},playReverse:function(f,s){s===void 0&&(s=!1);var c=typeof f=="string"?f:f.key;return s&&this.isPlaying&&this.currentAnim.key===c?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(f))},startAnimation:function(f){this.load(f);var s=this.currentAnim,c=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)),c},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(l.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(l.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(l.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(l.ANIMATION_COMPLETE,l.ANIMATION_COMPLETE_KEY)},emitEvents:function(f,s){var c=this.currentAnim;if(c){var d=this.currentFrame,v=this.parent,m=d.textureFrame;v.emit(f,c,d,v,m),s&&v.emit(s+c.key,c,d,v,m)}},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var f=this.currentFrame;if(!f)return 0;var s=f.progress;return this.inReverse&&(s*=-1),s},setProgress:function(f){return this.forward||(f=1-f),this.setCurrentFrame(this.currentAnim.getFrameByProgress(f)),this.parent},setRepeat:function(f){return this.repeatCounter=f===-1?Number.MAX_VALUE:f,this.parent},globalRemove:function(f,s){s===void 0&&(s=this.currentAnim),this.isPlaying&&s.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(f,s){f===void 0&&(f=!1),s===void 0&&(s=!1);var c=this.currentAnim,d=this.parent;return c?(s&&(this.repeatCounter=this.repeat===-1?Number.MAX_VALUE:this.repeat),c.getFirstTick(this),this.emitEvents(l.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!f,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(c.frames[0]),this.parent):d},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(f)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.delayCounter=0,this.currentAnim&&this.handleStop(),this.nextAnim){var f=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(f)}return this.parent},stopAfterDelay:function(f){return this._pendingStop=1,this._pendingStopValue=f,this.parent},stopAfterRepeat:function(f){return f===void 0&&(f=1),this.repeatCounter!==-1&&f>this.repeatCounter&&(f=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=f,this.parent},stopOnFrame:function(f){return this._pendingStop=3,this._pendingStopValue=f,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(f,s){var c=this.currentAnim;if(!(!this.isPlaying||!c||c.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?c.nextFrame(this):c.previousFrame(this),this.isPlaying&&this._pendingStop===0&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var d=0;do this.forward?c.nextFrame(this):c.previousFrame(this),d++;while(this.isPlaying&&this.accumulator>this.nextTick&&d<60)}}},setCurrentFrame:function(f){var s=this.parent;return this.currentFrame=f,s.texture=f.frame.texture,s.frame=f.frame,s.isCropped&&s.frame.updateCropUVs(s._crop,s.flipX,s.flipY),f.setAlpha&&(s.alpha=f.alpha),s.setSizeToFrame(),s._originComponent&&(f.frame.customPivot?s.setOrigin(f.frame.pivotX,f.frame.pivotY):s.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(l.ANIMATION_UPDATE),this._pendingStop===3&&this._pendingStopValue===f&&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(f){return this.anims?this.anims.get(f):null},exists:function(f){return this.anims?this.anims.has(f):!1},create:function(f){var s=f.key,c=!1;return s&&(c=this.get(s),c?console.warn("Animation key already exists: "+s):(c=new r(this,s,f),this.anims||(this.anims=new o),this.anims.set(s,c))),c},createFromAseprite:function(f,s){return this.animationManager.createFromAseprite(f,s,this.parent)},generateFrameNames:function(f,s){return this.animationManager.generateFrameNames(f,s)},generateFrameNumbers:function(f,s){return this.animationManager.generateFrameNumbers(f,s)},remove:function(f){var s=this.get(f);return s&&(this.currentAnim===s&&this.stop(),this.anims.delete(f)),s},destroy:function(){this.animationManager.off(l.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}}});a.exports=u},57090:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="add"},25312:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationcomplete"},89580:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationcomplete-"},52860:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationrepeat"},63850:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationrestart"},99085:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationstart"},28087:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationstop"},1794:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="animationupdate"},52562:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pauseall"},57953:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="remove"},68339:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resumeall"},74943:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADD_ANIMATION:t(57090),ANIMATION_COMPLETE:t(25312),ANIMATION_COMPLETE_KEY:t(89580),ANIMATION_REPEAT:t(52860),ANIMATION_RESTART:t(63850),ANIMATION_START:t(99085),ANIMATION_STOP:t(28087),ANIMATION_UPDATE:t(1794),PAUSE_ALL:t(52562),REMOVE_ANIMATION:t(57953),RESUME_ALL:t(68339)}},60421:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Animation:t(42099),AnimationFrame:t(41138),AnimationManager:t(60848),AnimationState:t(9674),Events:t(74943)}},2161:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(90330),h=t(50792),o=t(24736),l=new r({initialize:function(){this.entries=new p,this.events=new h},add:function(n,u){return this.entries.set(n,u),this.events.emit(o.ADD,this,n,u),this},has:function(n){return this.entries.has(n)},exists:function(n){return this.entries.has(n)},get:function(n){return this.entries.get(n)},remove:function(n){var u=this.get(n);return u&&(this.entries.delete(n),this.events.emit(o.REMOVE,this,n,u.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});a.exports=l},24047:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2161),p=t(83419),h=t(8443),o=new p({initialize:function(n){this.game=n,this.binary=new r,this.bitmapFont=new r,this.json=new r,this.physics=new r,this.shader=new r,this.audio=new r,this.video=new r,this.text=new r,this.html=new r,this.obj=new r,this.tilemap=new r,this.xml=new r,this.custom={},this.game.events.once(h.DESTROY,this.destroy,this)},addCustom:function(l){return this.custom.hasOwnProperty(l)||(this.custom[l]=new r),this.custom[l]},destroy:function(){for(var l=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="add"},59261:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="remove"},24736:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADD:t(51464),REMOVE:t(59261)}},83388:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BaseCache:t(2161),CacheManager:t(24047),Events:t(24736)}},71911:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(39506),o=t(50792),l=t(19715),n=t(87841),u=t(61340),f=t(80333),s=t(26099),c=new r({Extends:o,Mixins:[p.AlphaSingle,p.Visible],initialize:function(v,m,S,M){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new n,this.dirty=!0,this._x=v,this._y=m,this._width=S,this._height=M,this._bounds=new n,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new u,this.transparent=!0,this.backgroundColor=f("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new s(S/2,M/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[],this.isSceneCamera=!0},addToRenderList:function(d){this.renderList.push(d)},setOrigin:function(d,v){return d===void 0&&(d=.5),v===void 0&&(v=d),this.originX=d,this.originY=v,this},getScroll:function(d,v,m){m===void 0&&(m=new s);var S=this.width*.5,M=this.height*.5;return m.x=d-S,m.y=v-M,this.useBounds&&(m.x=this.clampX(m.x),m.y=this.clampY(m.y)),m},centerOnX:function(d){var v=this.width*.5;return this.midPoint.x=d,this.scrollX=d-v,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(d){var v=this.height*.5;return this.midPoint.y=d,this.scrollY=d-v,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(d,v){return this.centerOnX(d),this.centerOnY(v),this},centerToBounds:function(){if(this.useBounds){var d=this._bounds,v=this.width*.5,m=this.height*.5;this.midPoint.set(d.centerX,d.centerY),this.scrollX=d.centerX-v,this.scrollY=d.centerY-m}return this},centerToSize:function(){return this.scrollX=this.width*.5,this.scrollY=this.height*.5,this},cull:function(d){if(this.disableCull)return d;var v=this.matrix.matrix,m=v[0],S=v[1],M=v[2],A=v[3],C=m*A-S*M;if(!C)return d;var w=v[4],P=v[5],L=this.scrollX,O=this.scrollY,I=this.width,D=this.height,B=this.y,G=B+D,z=this.x,W=z+I,k=this.culledObjects,J=d.length;C=1/C,k.length=0;for(var Q=0;Qz&&$B&&qM&&(d=M),d},clampY:function(d){var v=this._bounds,m=this.displayHeight,S=v.y+(m-this.height)/2,M=Math.max(S,S+v.height-m);return dM&&(d=M),d},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(d){return d===void 0&&(d=0),this.rotation=h(d),this},setBackgroundColor:function(d){return d===void 0&&(d="rgba(0,0,0,0)"),this.backgroundColor=f(d),this.transparent=this.backgroundColor.alpha===0,this},setBounds:function(d,v,m,S,M){return M===void 0&&(M=!1),this._bounds.setTo(d,v,m,S),this.dirty=!0,this.useBounds=!0,M?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(d){d===void 0&&(d=new n);var v=this._bounds;return d.setTo(v.x,v.y,v.width,v.height),d},setName:function(d){return d===void 0&&(d=""),this.name=d,this},setPosition:function(d,v){return v===void 0&&(v=d),this.x=d,this.y=v,this},setRotation:function(d){return d===void 0&&(d=0),this.rotation=d,this},setRoundPixels:function(d){return this.roundPixels=d,this},setScene:function(d,v){v===void 0&&(v=!0),this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=d,this.isSceneCamera=v;var m=d.sys;return this.sceneManager=m.game.scene,this.scaleManager=m.scale,this.cameraManager=m.cameras,this.updateSystem(),this},setScroll:function(d,v){return v===void 0&&(v=d),this.scrollX=d,this.scrollY=v,this},setSize:function(d,v){return v===void 0&&(v=d),this.width=d,this.height=v,this},setViewport:function(d,v,m,S){return this.x=d,this.y=v,this.width=m,this.height=S,this},setZoom:function(d,v){return d===void 0&&(d=1),v===void 0&&(v=d),d===0&&(d=.001),v===0&&(v=.001),this.zoomX=d,this.zoomY=v,this},setMask:function(d,v){return v===void 0&&(v=!0),this.mask=d,this._maskCamera=v?this.cameraManager.default:this,this},clearMask:function(d){return d===void 0&&(d=!1),d&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var d={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&&(d.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),d},update:function(){},setIsSceneCamera:function(d){return this.isSceneCamera=d,this},updateSystem:function(){if(!(!this.scaleManager||!this.isSceneCamera)){var d=this._x!==0||this._y!==0||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,v=this.sceneManager;d&&!this._customViewport?v.customViewports++:!d&&this._customViewport&&v.customViewports--,this.dirty=!0,this._customViewport=d}},destroy:function(){this.emit(l.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(d){this._x=d,this.updateSystem()}},y:{get:function(){return this._y},set:function(d){this._y=d,this.updateSystem()}},width:{get:function(){return this._width},set:function(d){this._width=d,this.updateSystem()}},height:{get:function(){return this._height},set:function(d){this._height=d,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(d){d!==this._scrollX&&(this._scrollX=d,this.dirty=!0)}},scrollY:{get:function(){return this._scrollY},set:function(d){d!==this._scrollY&&(this._scrollY=d,this.dirty=!0)}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(d){this._zoomX=d,this._zoomY=d,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(d){this._zoomX=d,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(d){this._zoomY=d,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(d){this._rotation=d,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}}});a.exports=c},38058:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(71911),p=t(67502),h=t(45319),o=t(83419),l=t(31401),n=t(20052),u=t(19715),f=t(28915),s=t(87841),c=t(26099),d=new o({Extends:r,Mixins:[l.PostPipeline],initialize:function(m,S,M,A){r.call(this,m,S,M,A),this.initPostPipeline(),this.inputEnabled=!0,this.fadeEffect=new n.Fade(this),this.flashEffect=new n.Flash(this),this.shakeEffect=new n.Shake(this),this.panEffect=new n.Pan(this),this.rotateToEffect=new n.RotateTo(this),this.zoomEffect=new n.Zoom(this),this.lerp=new c(1,1),this.followOffset=new c,this.deadzone=null,this._follow=null},setDeadzone:function(v,m){if(v===void 0)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=v,this.deadzone.height=m):this.deadzone=new s(0,0,v,m),this._follow){var S=this.width/2,M=this.height/2,A=this._follow.x-this.followOffset.x,C=this._follow.y-this.followOffset.y;this.midPoint.set(A,C),this.scrollX=A-S,this.scrollY=C-M}p(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(v,m,S,M,A,C){return this.fadeEffect.start(!1,v,m,S,M,!0,A,C)},fadeOut:function(v,m,S,M,A,C){return this.fadeEffect.start(!0,v,m,S,M,!0,A,C)},fadeFrom:function(v,m,S,M,A,C,w){return this.fadeEffect.start(!1,v,m,S,M,A,C,w)},fade:function(v,m,S,M,A,C,w){return this.fadeEffect.start(!0,v,m,S,M,A,C,w)},flash:function(v,m,S,M,A,C,w){return this.flashEffect.start(v,m,S,M,A,C,w)},shake:function(v,m,S,M,A){return this.shakeEffect.start(v,m,S,M,A)},pan:function(v,m,S,M,A,C,w){return this.panEffect.start(v,m,S,M,A,C,w)},rotateTo:function(v,m,S,M,A,C,w){return this.rotateToEffect.start(v,m,S,M,A,C,w)},zoomTo:function(v,m,S,M,A,C){return this.zoomEffect.start(v,m,S,M,A,C)},preRender:function(){this.renderList.length=0;var v=this.width,m=this.height,S=v*.5,M=m*.5,A=this.zoom,C=this.matrix,w=v*this.originX,P=m*this.originY,L=this._follow,O=this.deadzone,I=this.scrollX,D=this.scrollY;O&&p(O,this.midPoint.x,this.midPoint.y);var B=!1;if(L&&!this.panEffect.isRunning){var G=this.lerp,z=L.x-this.followOffset.x,W=L.y-this.followOffset.y;O?(zO.right&&(I=f(I,I+(z-O.right),G.x)),WO.bottom&&(D=f(D,D+(W-O.bottom),G.y))):(I=f(I,z-w,G.x),D=f(D,W-P,G.y)),B=!0}this.useBounds&&(I=this.clampX(I),D=this.clampY(D)),this.scrollX=I,this.scrollY=D;var k=I+S,J=D+M;this.midPoint.set(k,J);var Q=v/A,Y=m/A,K=Math.floor(k-Q/2),U=Math.floor(J-Y/2);this.worldView.setTo(K,U,Q,Y),C.applyITRS(Math.floor(this.x+w),Math.floor(this.y+P),this.rotation,A,A),C.translate(-w,-P),this.shakeEffect.preRender(),B&&this.emit(u.FOLLOW_UPDATE,this,L)},setLerp:function(v,m){return v===void 0&&(v=1),m===void 0&&(m=v),this.lerp.set(v,m),this},setFollowOffset:function(v,m){return v===void 0&&(v=0),m===void 0&&(m=0),this.followOffset.set(v,m),this},startFollow:function(v,m,S,M,A,C){m===void 0&&(m=!1),S===void 0&&(S=1),M===void 0&&(M=S),A===void 0&&(A=0),C===void 0&&(C=A),this._follow=v,this.roundPixels=m,S=h(S,0,1),M=h(M,0,1),this.lerp.set(S,M),this.followOffset.set(A,C);var w=this.width/2,P=this.height/2,L=v.x-A,O=v.y-C;return this.midPoint.set(L,O),this.scrollX=L-w,this.scrollY=O-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(v,m){this.visible&&(this.rotateToEffect.update(v,m),this.panEffect.update(v,m),this.zoomEffect.update(v,m),this.shakeEffect.update(v,m),this.flashEffect.update(v,m),this.fadeEffect.update(v,m))},destroy:function(){this.resetFX(),r.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});a.exports=d},32743:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(38058),p=t(83419),h=t(95540),o=t(37277),l=t(37303),n=t(97480),u=t(44594),f=new p({initialize:function(c){this.scene=c,this.systems=c.sys,this.roundPixels=c.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,c.sys.events.once(u.BOOT,this.boot,this),c.sys.events.on(u.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 r(0,0,s.scale.width,s.scale.height).setScene(this.scene),s.game.scale.on(n.RESIZE,this.onResize,this),this.systems.events.once(u.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 c=this.systems.events;c.on(u.UPDATE,this.update,this),c.once(u.SHUTDOWN,this.shutdown,this)},add:function(s,c,d,v,m,S){s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),m===void 0&&(m=!1),S===void 0&&(S="");var M=new r(s,c,d,v);return M.setName(S),M.setScene(this.scene),M.setRoundPixels(this.roundPixels),M.id=this.getNextID(),this.cameras.push(M),m&&(this.main=M),M},addExisting:function(s,c){c===void 0&&(c=!1);var d=this.cameras.indexOf(s);return d===-1?(s.id=this.getNextID(),s.setRoundPixels(this.roundPixels),this.cameras.push(s),c&&(this.main=s),s):null},getNextID:function(){for(var s=this.cameras,c=1,d=0;d<32;d++){for(var v=!1,m=0;m0){S.preRender();var M=this.getVisibleChildren(c.getChildren(),S);s.render(d,M,S)}}},getVisibleChildren:function(s,c){return s.filter(function(d){return d.willRender(c)})},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} - */var r=t(45319),p=t(83419),h=t(19715),o=new p({initialize:function(n){this.camera=n,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(l,n,u,f,s,c,d,v){if(l===void 0&&(l=!0),n===void 0&&(n=1e3),u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),!c&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=n,this.direction=l,this.progress=0,this.red=u,this.green=f,this.blue=s,this.alpha=l?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v;var m=l?h.FADE_OUT_START:h.FADE_IN_START;return this.camera.emit(m,this.camera,this,n,u,f,s),this.camera},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(19715),o=new p({initialize:function(n){this.camera=n,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=1,this.progress=0,this._elapsed=0,this._alpha,this._onUpdate,this._onUpdateScope},start:function(l,n,u,f,s,c,d){return l===void 0&&(l=250),n===void 0&&(n=255),u===void 0&&(u=255),f===void 0&&(f=255),s===void 0&&(s=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene),!s&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=l,this.progress=0,this.red=n,this.green=u,this.blue=f,this._alpha=this.alpha,this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(h.FLASH_START,this.camera,this,l,n,u,f),this.camera)},update:function(l,n){this.isRunning&&(this._elapsed+=n,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(62640),o=t(19715),l=t(26099),n=new p({initialize:function(f){this.camera=f,this.isRunning=!1,this.duration=0,this.source=new l,this.current=new l,this.destination=new l,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(u,f,s,c,d,v,m){s===void 0&&(s=1e3),c===void 0&&(c=h.Linear),d===void 0&&(d=!1),v===void 0&&(v=null),m===void 0&&(m=this.camera.scene);var S=this.camera;return!d&&this.isRunning||(this.isRunning=!0,this.duration=s,this.progress=0,this.source.set(S.scrollX,S.scrollY),this.destination.set(u,f),S.getScroll(u,f,this.current),typeof c=="string"&&h.hasOwnProperty(c)?this.ease=h[c]:typeof c=="function"&&(this.ease=c),this._elapsed=0,this._onUpdate=v,this._onUpdateScope=m,this.camera.emit(o.PAN_START,this.camera,this,s,u,f)),S},update:function(u,f){if(this.isRunning){this._elapsed+=f;var s=r(this._elapsed/this.duration,0,1);this.progress=s;var c=this.camera;if(this._elapsed{/** - * @author Jason Nicholls - * @copyright 2018 Photon Storm Ltd. - * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} - */var r=t(45319),p=t(83419),h=t(19715),o=t(62640),l=new p({initialize:function(u){this.camera=u,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(n,u,f,s,c,d,v){f===void 0&&(f=1e3),s===void 0&&(s=o.Linear),c===void 0&&(c=!1),d===void 0&&(d=null),v===void 0&&(v=this.camera.scene),u===void 0&&(u=!1),this.shortestPath=u;var m=n;n<0?(m=-1*n,this.clockwise=!1):this.clockwise=!0;var S=360*Math.PI/180;m=m-Math.floor(m/S)*S;var M=this.camera;if(!c&&this.isRunning)return M;if(this.isRunning=!0,this.duration=f,this.progress=0,this.source=M.rotation,this.destination=m,typeof s=="string"&&o.hasOwnProperty(s)?this.ease=o[s]:typeof s=="function"&&(this.ease=s),this._elapsed=0,this._onUpdate=d,this._onUpdateScope=v,this.shortestPath){var A=0,C=0;this.destination>this.source?A=Math.abs(this.destination-this.source):A=Math.abs(this.destination+S)-this.source,this.source>this.destination?C=Math.abs(this.source-this.destination):C=Math.abs(this.source+S)-this.destination,AC&&(this.clockwise=!1)}return this.camera.emit(h.ROTATE_START,this.camera,this,f,m),M},update:function(n,u){if(this.isRunning){this._elapsed+=u;var f=r(this._elapsed/this.duration,0,1);this.progress=f;var s=this.camera;if(this._elapsed=S?d=Math.abs(m-S):d=Math.abs(m+v)-S;var M=0;this.clockwise?M=s.rotation+d*c:M=s.rotation-d*c,s.rotation=M,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,f,M)}else s.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,s,f,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(h.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}});a.exports=l},30330:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(19715),o=t(26099),l=new p({initialize:function(u){this.camera=u,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(n,u,f,s,c){return n===void 0&&(n=100),u===void 0&&(u=.05),f===void 0&&(f=!1),s===void 0&&(s=null),c===void 0&&(c=this.camera.scene),!f&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=n,this.progress=0,typeof u=="number"?this.intensity.set(u):this.intensity.set(u.x,u.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=s,this._onUpdateScope=c,this.camera.emit(h.SHAKE_START,this.camera,this,n,u),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(n,u){if(this.isRunning)if(this._elapsed+=u,this.progress=r(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(62640),o=t(19715),l=new p({initialize:function(u){this.camera=u,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(n,u,f,s,c,d){u===void 0&&(u=1e3),f===void 0&&(f=h.Linear),s===void 0&&(s=!1),c===void 0&&(c=null),d===void 0&&(d=this.camera.scene);var v=this.camera;return!s&&this.isRunning||(this.isRunning=!0,this.duration=u,this.progress=0,this.source=v.zoom,this.destination=n,typeof f=="string"&&h.hasOwnProperty(f)?this.ease=h[f]:typeof f=="function"&&(this.ease=f),this._elapsed=0,this._onUpdate=c,this._onUpdateScope=d,this.camera.emit(o.ZOOM_START,this.camera,this,u,n)),v},update:function(n,u){this.isRunning&&(this._elapsed+=u,this.progress=r(this._elapsed/this.duration,0,1),this._elapsed{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Fade:t(5020),Flash:t(10662),Pan:t(20359),Shake:t(30330),RotateTo:t(34208),Zoom:t(45641)}},16438:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="cameradestroy"},32726:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerafadeincomplete"},87807:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerafadeinstart"},45917:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerafadeoutcomplete"},95666:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerafadeoutstart"},47056:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="cameraflashcomplete"},91261:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="cameraflashstart"},45047:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="followupdate"},81927:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerapancomplete"},74264:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerapanstart"},54419:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="postrender"},79330:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="prerender"},93183:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerarotatecomplete"},80112:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerarotatestart"},62252:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerashakecomplete"},86017:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerashakestart"},539:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerazoomcomplete"},51892:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="camerazoomstart"},19715:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={DESTROY:t(16438),FADE_IN_COMPLETE:t(32726),FADE_IN_START:t(87807),FADE_OUT_COMPLETE:t(45917),FADE_OUT_START:t(95666),FLASH_COMPLETE:t(47056),FLASH_START:t(91261),FOLLOW_UPDATE:t(45047),PAN_COMPLETE:t(81927),PAN_START:t(74264),POST_RENDER:t(54419),PRE_RENDER:t(79330),ROTATE_COMPLETE:t(93183),ROTATE_START:t(80112),SHAKE_COMPLETE:t(62252),SHAKE_START:t(86017),ZOOM_COMPLETE:t(539),ZOOM_START:t(51892)}},87969:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Camera:t(38058),BaseCamera:t(71911),CameraManager:t(32743),Effects:t(20052),Events:t(19715)}},63091:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.speedX=0,this.speedY=0;var n=p(l,"speed",null);typeof n=="number"?(this.speedX=n,this.speedY=n):(this.speedX=p(l,"speed.x",0),this.speedY=p(l,"speed.y",0)),this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(o){return this.camera=o,this},update:function(o){if(this.active){o===void 0&&(o=1);var l=this.camera;this.up&&this.up.isDown?l.scrollY-=this.speedY*o|0:this.down&&this.down.isDown&&(l.scrollY+=this.speedY*o|0),this.left&&this.left.isDown?l.scrollX-=this.speedX*o|0:this.right&&this.right.isDown&&(l.scrollX+=this.speedX*o|0),this.zoomIn&&this.zoomIn.isDown?(l.zoom-=this.zoomSpeed,l.zoomthis.maxZoom&&(l.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});a.exports=h},58818:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(35154),h=new r({initialize:function(l){this.camera=p(l,"camera",null),this.left=p(l,"left",null),this.right=p(l,"right",null),this.up=p(l,"up",null),this.down=p(l,"down",null),this.zoomIn=p(l,"zoomIn",null),this.zoomOut=p(l,"zoomOut",null),this.zoomSpeed=p(l,"zoomSpeed",.01),this.minZoom=p(l,"minZoom",.001),this.maxZoom=p(l,"maxZoom",1e3),this.accelX=0,this.accelY=0;var n=p(l,"acceleration",null);typeof n=="number"?(this.accelX=n,this.accelY=n):(this.accelX=p(l,"acceleration.x",0),this.accelY=p(l,"acceleration.y",0)),this.dragX=0,this.dragY=0;var u=p(l,"drag",null);typeof u=="number"?(this.dragX=u,this.dragY=u):(this.dragX=p(l,"drag.x",0),this.dragY=p(l,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var f=p(l,"maxSpeed",null);typeof f=="number"?(this.maxSpeedX=f,this.maxSpeedY=f):(this.maxSpeedX=p(l,"maxSpeed.x",0),this.maxSpeedY=p(l,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=this.camera!==null},start:function(){return this.active=this.camera!==null,this},stop:function(){return this.active=!1,this},setCamera:function(o){return this.camera=o,this},update:function(o){if(this.active){o===void 0&&(o=1);var l=this.camera;this._speedX>0?(this._speedX-=this.dragX*o,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*o,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*o,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*o,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,this._speedX!==0&&(l.scrollX-=this._speedX*o|0),this._speedY!==0&&(l.scrollY-=this._speedY*o|0),this._zoom!==0&&(l.zoom+=this._zoom,l.zoomthis.maxZoom&&(l.zoom=this.maxZoom))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});a.exports=h},38865:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={FixedKeyControl:t(63091),SmoothedKeyControl:t(58818)}},26638:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Controls:t(38865),Scene2D:t(87969)}},8054:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={VERSION:"3.80.1",BlendModes:t(10312),ScaleModes:t(29795),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};a.exports=r},69547:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(8054),h=t(42363),o=t(82264),l=t(95540),n=t(35154),u=t(41212),f=t(29747),s=t(75508),c=t(36060),d=t(80333),v=new r({initialize:function(S){S===void 0&&(S={});var M=["#ff0000","#ffff00","#00ff00","#00ffff","#000000"],A="#ffffff",C=n(S,"scale",null);this.width=n(C,"width",1024,S),this.height=n(C,"height",768,S),this.zoom=n(C,"zoom",1,S),this.parent=n(C,"parent",void 0,S),this.scaleMode=n(C,C?"mode":"scaleMode",0,S),this.expandParent=n(C,"expandParent",!0,S),this.autoRound=n(C,"autoRound",!1,S),this.autoCenter=n(C,"autoCenter",0,S),this.resizeInterval=n(C,"resizeInterval",500,S),this.fullscreenTarget=n(C,"fullscreenTarget",null,S),this.minWidth=n(C,"min.width",0,S),this.maxWidth=n(C,"max.width",0,S),this.minHeight=n(C,"min.height",0,S),this.maxHeight=n(C,"max.height",0,S),this.snapWidth=n(C,"snap.width",0,S),this.snapHeight=n(C,"snap.height",0,S),this.renderType=n(S,"type",p.AUTO),this.canvas=n(S,"canvas",null),this.context=n(S,"context",null),this.canvasStyle=n(S,"canvasStyle",null),this.customEnvironment=n(S,"customEnvironment",!1),this.sceneConfig=n(S,"scene",null),this.seed=n(S,"seed",[(Date.now()*Math.random()).toString()]),s.RND=new s.RandomDataGenerator(this.seed),this.gameTitle=n(S,"title",""),this.gameURL=n(S,"url","https://phaser.io"),this.gameVersion=n(S,"version",""),this.autoFocus=n(S,"autoFocus",!0),this.stableSort=n(S,"stableSort",-1),this.stableSort===-1&&(this.stableSort=o.browser.es2019?1:0),o.features.stableSort=this.stableSort,this.domCreateContainer=n(S,"dom.createContainer",!1),this.domPointerEvents=n(S,"dom.pointerEvents","none"),this.inputKeyboard=n(S,"input.keyboard",!0),this.inputKeyboardEventTarget=n(S,"input.keyboard.target",window),this.inputKeyboardCapture=n(S,"input.keyboard.capture",[]),this.inputMouse=n(S,"input.mouse",!0),this.inputMouseEventTarget=n(S,"input.mouse.target",null),this.inputMousePreventDefaultDown=n(S,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=n(S,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=n(S,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=n(S,"input.mouse.preventDefaultWheel",!0),this.inputTouch=n(S,"input.touch",o.input.touch),this.inputTouchEventTarget=n(S,"input.touch.target",null),this.inputTouchCapture=n(S,"input.touch.capture",!0),this.inputActivePointers=n(S,"input.activePointers",1),this.inputSmoothFactor=n(S,"input.smoothFactor",0),this.inputWindowEvents=n(S,"input.windowEvents",!0),this.inputGamepad=n(S,"input.gamepad",!1),this.inputGamepadEventTarget=n(S,"input.gamepad.target",window),this.disableContextMenu=n(S,"disableContextMenu",!1),this.audio=n(S,"audio",{}),this.hideBanner=n(S,"banner",null)===!1,this.hidePhaser=n(S,"banner.hidePhaser",!1),this.bannerTextColor=n(S,"banner.text",A),this.bannerBackgroundColor=n(S,"banner.background",M),this.gameTitle===""&&this.hidePhaser&&(this.hideBanner=!0),this.fps=n(S,"fps",null),this.disablePreFX=n(S,"disablePreFX",!1),this.disablePostFX=n(S,"disablePostFX",!1);var w=n(S,"render",null);this.pipeline=n(w,"pipeline",null,S),this.autoMobilePipeline=n(w,"autoMobilePipeline",!0,S),this.defaultPipeline=n(w,"defaultPipeline",c.MULTI_PIPELINE,S),this.antialias=n(w,"antialias",!0,S),this.antialiasGL=n(w,"antialiasGL",!0,S),this.mipmapFilter=n(w,"mipmapFilter","",S),this.desynchronized=n(w,"desynchronized",!1,S),this.roundPixels=n(w,"roundPixels",!0,S),this.pixelArt=n(w,"pixelArt",this.zoom!==1,S),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=n(w,"transparent",!1,S),this.clearBeforeRender=n(w,"clearBeforeRender",!0,S),this.preserveDrawingBuffer=n(w,"preserveDrawingBuffer",!1,S),this.premultipliedAlpha=n(w,"premultipliedAlpha",!0,S),this.failIfMajorPerformanceCaveat=n(w,"failIfMajorPerformanceCaveat",!1,S),this.powerPreference=n(w,"powerPreference","default",S),this.batchSize=n(w,"batchSize",4096,S),this.maxTextures=n(w,"maxTextures",-1,S),this.maxLights=n(w,"maxLights",10,S);var P=n(S,"backgroundColor",0);this.backgroundColor=d(P),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=n(S,"callbacks.preBoot",f),this.postBoot=n(S,"callbacks.postBoot",f),this.physics=n(S,"physics",{}),this.defaultPhysicsSystem=n(this.physics,"default",!1),this.loaderBaseURL=n(S,"loader.baseURL",""),this.loaderPath=n(S,"loader.path",""),this.loaderMaxParallelDownloads=n(S,"loader.maxParallelDownloads",o.os.android?6:32),this.loaderCrossOrigin=n(S,"loader.crossOrigin",void 0),this.loaderResponseType=n(S,"loader.responseType",""),this.loaderAsync=n(S,"loader.async",!0),this.loaderUser=n(S,"loader.user",""),this.loaderPassword=n(S,"loader.password",""),this.loaderTimeout=n(S,"loader.timeout",0),this.loaderWithCredentials=n(S,"loader.withCredentials",!1),this.loaderImageLoadType=n(S,"loader.imageLoadType","XHR"),this.loaderLocalScheme=n(S,"loader.localScheme",["file://","capacitor://"]),this.glowFXQuality=n(S,"fx.glow.quality",.1),this.glowFXDistance=n(S,"fx.glow.distance",10),this.installGlobalPlugins=[],this.installScenePlugins=[];var L=n(S,"plugins",null),O=h.DefaultScene;L&&(Array.isArray(L)?this.defaultPlugins=L:u(L)&&(this.installGlobalPlugins=l(L,"global",[]),this.installScenePlugins=l(L,"scene",[]),Array.isArray(L.default)?O=L.default:Array.isArray(L.defaultMerge)&&(O=O.concat(L.defaultMerge)))),this.defaultPlugins=O;var I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=n(S,"images.default",I+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=n(S,"images.missing",I+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=n(S,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=p.WEBGL:window.FORCE_CANVAS&&(this.renderType=p.CANVAS))}});a.exports=v},86054:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20623),p=t(27919),h=t(8054),o=t(89357),l=function(n){var u=n.config;if((u.customEnvironment||u.canvas)&&u.renderType===h.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!u.customEnvironment&&!u.canvas&&u.renderType!==h.HEADLESS)if(u.renderType===h.AUTO&&(u.renderType=o.webGL?h.WEBGL:h.CANVAS),u.renderType===h.WEBGL){if(!o.webGL)throw new Error("Cannot create WebGL context, aborting.")}else if(u.renderType===h.CANVAS){if(!o.canvas)throw new Error("Cannot create Canvas context, aborting.")}else throw new Error("Unknown value for renderer type: "+u.renderType);u.antialias||p.disableSmoothing();var f=n.scale.baseSize,s=f.width,c=f.height;if(u.canvas?(n.canvas=u.canvas,n.canvas.width=s,n.canvas.height=c):n.canvas=p.create(n,s,c,u.renderType),u.canvasStyle&&(n.canvas.style=u.canvasStyle),u.antialias||r.setCrisp(n.canvas),u.renderType!==h.HEADLESS){var d,v;d=t(68627),v=t(74797),u.renderType===h.WEBGL?n.renderer=new v(n):(n.renderer=new d(n),n.context=n.renderer.gameContext)}};a.exports=l},96391:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8054),p=function(h){var o=h.config;if(!o.hideBanner){var l="WebGL";o.renderType===r.CANVAS?l="Canvas":o.renderType===r.HEADLESS&&(l="Headless");var n=o.audio,u=h.device.audio,f;if(u.webAudio&&!n.disableWebAudio?f="Web Audio":n.noAudio||!u.webAudio&&!u.audioData?f="No Audio":f="HTML5 Audio",h.device.browser.ie)window.console&&console.log("Phaser v"+r.VERSION+" / https://phaser.io");else{var s="",c=[s];if(Array.isArray(o.bannerBackgroundColor)){var d;o.bannerBackgroundColor.forEach(function(m){s=s.concat("%c "),c.push("background: "+m),d=m}),c[c.length-1]="color: "+o.bannerTextColor+"; background: "+d}else s=s.concat("%c "),c.push("color: "+o.bannerTextColor+"; background: "+o.bannerBackgroundColor);c.push("background: transparent"),o.gameTitle&&(s=s.concat(o.gameTitle),o.gameVersion&&(s=s.concat(" v"+o.gameVersion)),o.hidePhaser||(s=s.concat(" / ")));var v="";o.hidePhaser||(s=s.concat("Phaser v"+r.VERSION+v+" ("+l+" | "+f+")")),s=s.concat(" %c "+o.gameURL),c[0]=s,console.log.apply(console,c)}}};a.exports=p},50127:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40366),p=t(60848),h=t(24047),o=t(27919),l=t(83419),n=t(69547),u=t(83719),f=t(86054),s=t(45893),c=t(96391),d=t(82264),v=t(57264),m=t(50792),S=t(8443),M=t(7003),A=t(37277),C=t(77332),w=t(76531),P=t(60903),L=t(69442),O=t(17130),I=t(65898),D=t(51085),B=t(14747),G=new l({initialize:function(W){this.config=new n(W),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new p(this),this.textures=new O(this),this.cache=new h(this),this.registry=new s(this,new m),this.input=new M(this,this.config),this.scene=new P(this,this.config.sceneConfig),this.device=d,this.scale=new w(this,this.config),this.sound=null,this.sound=B.create(this),this.loop=new I(this,this.config.fps),this.plugins=new C(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,this.isPaused=!1,v(this.boot.bind(this))},boot:function(){if(!A.hasCore("EventEmitter")){console.warn("Aborting. Core Plugins missing.");return}this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),f(this),u(this),c(this),r(this.canvas,this.config.parent),this.textures.once(L.READY,this.texturesReady,this),this.events.emit(S.BOOT)},texturesReady:function(){this.events.emit(S.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)),D(this);var z=this.events;z.on(S.HIDDEN,this.onHidden,this),z.on(S.VISIBLE,this.onVisible,this),z.on(S.BLUR,this.onBlur,this),z.on(S.FOCUS,this.onFocus,this)},step:function(z,W){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var k=this.events;k.emit(S.PRE_STEP,z,W),k.emit(S.STEP,z,W),this.scene.update(z,W),k.emit(S.POST_STEP,z,W);var J=this.renderer;J.preRender(),k.emit(S.PRE_RENDER,J,z,W),this.scene.render(J),J.postRender(),k.emit(S.POST_RENDER,J,z,W)}},headlessStep:function(z,W){if(this.pendingDestroy)return this.runDestroy();if(!this.isPaused){var k=this.events;k.emit(S.PRE_STEP,z,W),k.emit(S.STEP,z,W),this.scene.update(z,W),k.emit(S.POST_STEP,z,W),this.scene.isProcessing=!1,k.emit(S.PRE_RENDER,null,z,W),k.emit(S.POST_RENDER,null,z,W)}},onHidden:function(){this.loop.pause(),this.events.emit(S.PAUSE)},pause:function(){var z=this.isPaused;this.isPaused=!0,z||this.events.emit(S.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(S.RESUME)},resume:function(){var z=this.isPaused;this.isPaused=!1,z&&this.events.emit(S.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(z,W){W===void 0&&(W=!1),this.pendingDestroy=!0,this.removeCanvas=z,this.noReturn=W},runDestroy:function(){this.scene.destroy(),this.events.emit(S.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});a.exports=G},65898:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(35154),h=t(29747),o=t(43092),l=new r({initialize:function(u,f){this.game=u,this.raf=new o,this.started=!1,this.running=!1,this.minFps=p(f,"min",5),this.targetFps=p(f,"target",60),this.fpsLimit=p(f,"limit",0),this.hasFpsLimit=this.fpsLimit>0,this._limitRate=this.hasFpsLimit?1e3/this.fpsLimit:0,this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=h,this.forceSetTimeOut=p(f,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=p(f,"deltaHistory",10),this.panicMax=p(f,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=p(f,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var n=window.performance.now();this.time=n,this.lastTime=n,this.nextFpsUpdate=n+1e3,this.framesThisSecond=0;for(var u=0;u0||!this.inFocus)&&(this._coolDown--,n=Math.min(n,this._target)),n>this._min&&(n=f[u],n=Math.min(n,this._min)),f[u]=n,this.deltaIndex++,this.deltaIndex>=s&&(this.deltaIndex=0);for(var c=0,d=0;d=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.delta>=this._limitRate&&(this.callback(n,this.delta),this.delta=0),this.lastTime=n,this.frame++},step:function(n){this.now=n;var u=Math.max(0,n-this.lastTime);this.rawDelta=u,this.time+=this.rawDelta,this.smoothStep&&(u=this.smoothDelta(u)),this.delta=u,n>=this.nextFpsUpdate&&this.updateFPS(n),this.framesThisSecond++,this.callback(n,u),this.lastTime=n,this.frame++},tick:function(){var n=window.performance.now();this.hasFpsLimit?this.stepLimitFPS(n):this.step(n)},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(n){n===void 0&&(n=!1);var u=window.performance.now();if(!this.running){n&&(this.startTime+=-this.lastTime+(this.lastTime+u));var f=this.hasFpsLimit?this.stepLimitFPS.bind(this):this.step.bind(this);this.raf.start(f,this.forceSetTimeOut,this._target),this.running=!0,this.nextFpsUpdate=u+1e3,this.framesThisSecond=0,this.fpsLimitTriggered=!1,this.tick()}},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.raf.destroy(),this.raf=null,this.game=null,this.callback=null}});a.exports=l},51085:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8443),p=function(h){var o,l=h.events;if(document.hidden!==void 0)o="visibilitychange";else{var n=["webkit","moz","ms"];n.forEach(function(f){document[f+"Hidden"]!==void 0&&(document.hidden=function(){return document[f+"Hidden"]},o=f+"visibilitychange")})}var u=function(f){document.hidden||f.type==="pause"?l.emit(r.HIDDEN):l.emit(r.VISIBLE)};o&&document.addEventListener(o,u,!1),window.onblur=function(){l.emit(r.BLUR)},window.onfocus=function(){l.emit(r.FOCUS)},window.focus&&h.config.autoFocus&&window.focus()};a.exports=p},97217:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="blur"},47548:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="boot"},19814:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="contextlost"},68446:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},41700:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="focus"},25432:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="hidden"},65942:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},59211:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="postrender"},47789:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="poststep"},39066:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="prerender"},460:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="prestep"},16175:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="ready"},42331:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},11966:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="step"},32969:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="systemready"},94830:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="visible"},8443:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BLUR:t(97217),BOOT:t(47548),CONTEXT_LOST:t(19814),DESTROY:t(68446),FOCUS:t(41700),HIDDEN:t(25432),PAUSE:t(65942),POST_RENDER:t(59211),POST_STEP:t(47789),PRE_RENDER:t(39066),PRE_STEP:t(460),READY:t(16175),RESUME:t(42331),STEP:t(11966),SYSTEM_READY:t(32969),VISIBLE:t(94830)}},42857:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Config:t(69547),CreateRenderer:t(86054),DebugHeader:t(96391),Events:t(8443),TimeStep:t(65898),VisibilityHandler:t(51085)}},99584:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(5290),p=t(27919),h=t(35154),o=function(l){var n=h(l,"data",[]),u=h(l,"canvas",null),f=h(l,"palette",r),s=h(l,"pixelWidth",1),c=h(l,"pixelHeight",s),d=h(l,"resizeCanvas",!0),v=h(l,"clearCanvas",!0),m=h(l,"preRender",null),S=h(l,"postRender",null),M=Math.floor(Math.abs(n[0].length*s)),A=Math.floor(Math.abs(n.length*c));u||(u=p.create2D(this,M,A),d=!1,v=!1),d&&(u.width=M,u.height=A);var C=u.getContext("2d",{willReadFrequently:!0});v&&C.clearRect(0,0,M,A),m&&m(u,C);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={GenerateTexture:t(99584),Palettes:t(57763)}},5290:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},23816:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},9866:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},77552:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},92259:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},57763:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ARNE16:t(5290),C64:t(23816),CGA:t(9866),JMP:t(77552),MSX:t(92259)}},46728:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(36316),h=t(80021),o=t(26099),l=new r({Extends:h,initialize:function(u,f,s,c){h.call(this,"CubicBezierCurve"),Array.isArray(u)&&(c=new o(u[6],u[7]),s=new o(u[4],u[5]),f=new o(u[2],u[3]),u=new o(u[0],u[1])),this.p0=u,this.p1=f,this.p2=s,this.p3=c},getStartPoint:function(n){return n===void 0&&(n=new o),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new o);var f=this.p0,s=this.p1,c=this.p2,d=this.p3;return u.set(p(n,f.x,s.x,c.x,d.x),p(n,f.y,s.y,c.y,d.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var s=1;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(19217),h=t(87841),o=t(26099),l=new r({initialize:function(u){this.type=u,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(n,u){return u===void 0&&(u=32),n.strokePoints(this.getPoints(u))},getBounds:function(n,u){n||(n=new h),u===void 0&&(u=16);var f=this.getLength();u>f&&(u=f/2);var s=Math.max(1,Math.round(f/u));return p(this.getSpacedPoints(s),n)},getDistancePoints:function(n){var u=this.getLength(),f=Math.max(1,u/n);return this.getSpacedPoints(f)},getEndPoint:function(n){return n===void 0&&(n=new o),this.getPointAt(1,n)},getLength:function(){var n=this.getLengths();return n[n.length-1]},getLengths:function(n){if(n===void 0&&(n=this.arcLengthDivisions),this.cacheArcLengths.length===n+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var u=[],f,s=this.getPoint(0,this._tmpVec2A),c=0;u.push(0);for(var d=1;d<=n;d++)f=this.getPoint(d/n,this._tmpVec2B),c+=f.distance(s),u.push(c),s.copy(f);return this.cacheArcLengths=u,u},getPointAt:function(n,u){var f=this.getUtoTmapping(n);return this.getPoint(f,u)},getPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var s=0;s<=n;s++)f.push(this.getPoint(s/n));return f},getRandomPoint:function(n){return n===void 0&&(n=new o),this.getPoint(Math.random(),n)},getSpacedPoints:function(n,u,f){f===void 0&&(f=[]),n||(u?n=this.getLength()/u:n=this.defaultDivisions);for(var s=0;s<=n;s++){var c=this.getUtoTmapping(s/n,null,n);f.push(this.getPoint(c))}return f},getStartPoint:function(n){return n===void 0&&(n=new o),this.getPointAt(0,n)},getTangent:function(n,u){u===void 0&&(u=new o);var f=1e-4,s=n-f,c=n+f;return s<0&&(s=0),c>1&&(c=1),this.getPoint(s,this._tmpVec2A),this.getPoint(c,u),u.subtract(this._tmpVec2A).normalize()},getTangentAt:function(n,u){var f=this.getUtoTmapping(n);return this.getTangent(f,u)},getTFromDistance:function(n,u){return n<=0?0:this.getUtoTmapping(0,n,u)},getUtoTmapping:function(n,u,f){var s=this.getLengths(f),c=0,d=s.length,v;u?v=Math.min(u,s[d-1]):v=n*s[d-1];for(var m=0,S=d-1,M;m<=S;)if(c=Math.floor(m+(S-m)/2),M=s[c]-v,M<0)m=c+1;else if(M>0)S=c-1;else{S=c;break}if(c=S,s[c]===v)return c/(d-1);var A=s[c],C=s[c+1],w=C-A,P=(v-A)/w;return(c+P)/(d-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});a.exports=l},73825:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(80021),h=t(39506),o=t(35154),l=t(43396),n=t(26099),u=new r({Extends:p,initialize:function(s,c,d,v,m,S,M,A){if(typeof s=="object"){var C=s;s=o(C,"x",0),c=o(C,"y",0),d=o(C,"xRadius",0),v=o(C,"yRadius",d),m=o(C,"startAngle",0),S=o(C,"endAngle",360),M=o(C,"clockwise",!1),A=o(C,"rotation",0)}else v===void 0&&(v=d),m===void 0&&(m=0),S===void 0&&(S=360),M===void 0&&(M=!1),A===void 0&&(A=0);p.call(this,"EllipseCurve"),this.p0=new n(s,c),this._xRadius=d,this._yRadius=v,this._startAngle=h(m),this._endAngle=h(S),this._clockwise=M,this._rotation=h(A)},getStartPoint:function(f){return f===void 0&&(f=new n),this.getPoint(0,f)},getResolution:function(f){return f*2},getPoint:function(f,s){s===void 0&&(s=new n);for(var c=Math.PI*2,d=this._endAngle-this._startAngle,v=Math.abs(d)c;)d-=c;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(80021),h=t(19217),o=t(87841),l=t(26099),n=new r({Extends:p,initialize:function(f,s){p.call(this,"LineCurve"),Array.isArray(f)&&(s=new l(f[2],f[3]),f=new l(f[0],f[1])),this.p0=f,this.p1=s,this.arcLengthDivisions=1},getBounds:function(u){return u===void 0&&(u=new o),h([this.p0,this.p1],u)},getStartPoint:function(u){return u===void 0&&(u=new l),u.copy(this.p0)},getResolution:function(u){return u===void 0&&(u=1),u},getPoint:function(u,f){return f===void 0&&(f=new l),u===1?f.copy(this.p1):(f.copy(this.p1).subtract(this.p0).scale(u).add(this.p0),f)},getPointAt:function(u,f){return this.getPoint(u,f)},getTangent:function(u,f){return f===void 0&&(f=new l),f.copy(this.p1).subtract(this.p0).normalize(),f},getUtoTmapping:function(u,f,s){var c;if(f){var d=this.getLengths(s),v=d[d.length-1],m=Math.min(f,v);c=m/v}else c=u;return c},draw:function(u){return u.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),u},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});n.fromJSON=function(u){var f=u.points,s=new l(f[0],f[1]),c=new l(f[2],f[3]);return new n(s,c)},a.exports=n},14744:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(80021),h=t(32112),o=t(26099),l=new r({Extends:p,initialize:function(u,f,s){p.call(this,"QuadraticBezierCurve"),Array.isArray(u)&&(s=new o(u[4],u[5]),f=new o(u[2],u[3]),u=new o(u[0],u[1])),this.p0=u,this.p1=f,this.p2=s},getStartPoint:function(n){return n===void 0&&(n=new o),n.copy(this.p0)},getResolution:function(n){return n},getPoint:function(n,u){u===void 0&&(u=new o);var f=this.p0,s=this.p1,c=this.p2;return u.set(h(n,f.x,s.x,c.x),h(n,f.y,s.y,c.y))},draw:function(n,u){u===void 0&&(u=32);var f=this.getPoints(u);n.beginPath(),n.moveTo(this.p0.x,this.p0.y);for(var s=1;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87842),p=t(83419),h=t(80021),o=t(26099),l=new p({Extends:h,initialize:function(u){u===void 0&&(u=[]),h.call(this,"SplineCurve"),this.points=[],this.addPoints(u)},addPoints:function(n){for(var u=0;uf.length-2?f.length-1:c+1],M=f[c>f.length-3?f.length-1:c+2];return u.set(r(d,v.x,m.x,S.x,M.x),r(d,v.y,m.y,S.y,M.y))},toJSON:function(){for(var n=[],u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Path:t(46669),MoveTo:t(68618),CubicBezier:t(46728),Curve:t(80021),Ellipse:t(73825),Line:t(33951),QuadraticBezier:t(14744),Spline:t(42534)}},68618:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(26099),h=new r({initialize:function(l,n){this.active=!1,this.p0=new p(l,n)},getPoint:function(o,l){return l===void 0&&(l=new p),l.copy(this.p0)},getPointAt:function(o,l){return this.getPoint(o,l)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});a.exports=h},46669:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(46728),h=t(73825),o=t(39429),l=t(33951),n=t(68618),u=t(14744),f=t(87841),s=t(42534),c=t(26099),d=t(36383),v=new r({initialize:function(S,M){S===void 0&&(S=0),M===void 0&&(M=0),this.name="",this.defaultDivisions=12,this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new c,this._tmpVec2A=new c,this._tmpVec2B=new c,typeof S=="object"?this.fromJSON(S):this.startPoint.set(S,M)},add:function(m){return this.curves.push(m),this},circleTo:function(m,S,M){return S===void 0&&(S=!1),this.ellipseTo(m,m,0,360,S,M)},closePath:function(){var m=this.curves[0].getPoint(0),S=this.curves[this.curves.length-1].getPoint(1);return m.equals(S)||this.curves.push(new l(S,m)),this},cubicBezierTo:function(m,S,M,A,C,w){var P=this.getEndPoint(),L,O,I;return m instanceof c?(L=m,O=S,I=M):(L=new c(M,A),O=new c(C,w),I=new c(m,S)),this.add(new p(P,L,O,I))},quadraticBezierTo:function(m,S,M,A){var C=this.getEndPoint(),w,P;return m instanceof c?(w=m,P=S):(w=new c(M,A),P=new c(m,S)),this.add(new u(C,w,P))},draw:function(m,S){for(var M=0;M=S)return this.curves[A];A++}return null},getEndPoint:function(m){return m===void 0&&(m=new c),this.curves.length>0?this.curves[this.curves.length-1].getPoint(1,m):m.copy(this.startPoint),m},getLength:function(){var m=this.getCurveLengths();return m[m.length-1]},getPoint:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),A=this.getCurveLengths(),C=0;C=M){var w=A[C]-M,P=this.curves[C],L=P.getLength(),O=L===0?0:1-w/L;return P.getPointAt(O,S)}C++}return null},getPoints:function(m,S){!m&&!S&&(m=this.defaultDivisions);for(var M=[],A,C=0;C1&&!M[M.length-1].equals(M[0])&&M.push(M[0]),M},getRandomPoint:function(m){return m===void 0&&(m=new c),this.getPoint(Math.random(),m)},getSpacedPoints:function(m){m===void 0&&(m=40);for(var S=[],M=0;M<=m;M++)S.push(this.getPoint(M/m));return this.autoClose&&S.push(S[0]),S},getStartPoint:function(m){return m===void 0&&(m=new c),m.copy(this.startPoint)},getTangent:function(m,S){S===void 0&&(S=new c);for(var M=m*this.getLength(),A=this.getCurveLengths(),C=0;C=M){var w=A[C]-M,P=this.curves[C],L=P.getLength(),O=L===0?0:1-w/L;return P.getTangentAt(O,S)}C++}return null},lineTo:function(m,S){m instanceof c?this._tmpVec2B.copy(m):typeof m=="object"?this._tmpVec2B.setFromObject(m):this._tmpVec2B.set(m,S);var M=this.getEndPoint(this._tmpVec2A);return this.add(new l([M.x,M.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(m){return m.unshift(this.getEndPoint()),this.add(new s(m))},moveTo:function(m,S){return m instanceof c?this.add(new n(m.x,m.y)):this.add(new n(m,S))},toJSON:function(){for(var m=[],S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(24882),h=new r({initialize:function(l,n){this.parent=l,this.events=n,n||(this.events=l.events?l.events:l),this.list={},this.values={},this._frozen=!1,!l.hasOwnProperty("sys")&&this.events&&this.events.once(p.DESTROY,this.destroy,this)},get:function(o){var l=this.list;if(Array.isArray(o)){for(var n=[],u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(45893),h=t(37277),o=t(44594),l=new r({Extends:p,initialize:function(u){p.call(this,u,u.sys.events),this.scene=u,this.systems=u.sys,u.sys.events.once(o.BOOT,this.boot,this),u.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){p.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});h.register("DataManagerPlugin",l,"data"),a.exports=l},10700:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="changedata"},93608:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="changedata-"},60883:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},69780:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="removedata"},22166:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="setdata"},24882:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CHANGE_DATA:t(10700),CHANGE_DATA_KEY:t(93608),DESTROY:t(60883),REMOVE_DATA:t(69780),SET_DATA:t(22166)}},44965:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={DataManager:t(45893),DataManagerPlugin:t(63646),Events:t(24882)}},7098:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(84148),p={flac:!1,aac:!1,audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};function h(){if(typeof importScripts=="function")return p;p.audioData=!!window.Audio,p.webAudio=!!(window.AudioContext||window.webkitAudioContext);var o=document.createElement("audio"),l=!!o.canPlayType;try{if(l){var n=function(s,c){var d=o.canPlayType("audio/"+s).replace(/^no$/,"");return c?!!(d||o.canPlayType("audio/"+c).replace(/^no$/,"")):!!d};if(p.ogg=n('ogg; codecs="vorbis"'),p.opus=n('ogg; codecs="opus"',"opus"),p.mp3=n("mpeg"),p.wav=n("wav"),p.m4a=n("x-m4a"),p.aac=n("aac"),p.flac=n("flac","x-flac"),p.webm=n('webm; codecs="vorbis"'),o.canPlayType('audio/mp4; codecs="ec-3"')!==""){if(r.edge)p.dolby=!0;else if(r.safari&&r.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var u=parseInt(RegExp.$1,10),f=parseInt(RegExp.$2,10);(u===10&&f>=11||u>10)&&(p.dolby=!0)}}}}catch{}return p}a.exports=h()},84148:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25892),p={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0,es2019:!1};function h(){var o=navigator.userAgent;return/Edg\/\d+/.test(o)?(p.edge=!0,p.es2019=!0):/OPR/.test(o)?(p.opera=!0,p.es2019=!0):/Chrome\/(\d+)/.test(o)&&!r.windowsPhone?(p.chrome=!0,p.chromeVersion=parseInt(RegExp.$1,10),p.es2019=p.chromeVersion>69):/Firefox\D+(\d+)/.test(o)?(p.firefox=!0,p.firefoxVersion=parseInt(RegExp.$1,10),p.es2019=p.firefoxVersion>10):/AppleWebKit\/(?!.*CriOS)/.test(o)&&r.iOS?(p.mobileSafari=!0,p.es2019=!0):/MSIE (\d+\.\d+);/.test(o)?(p.ie=!0,p.ieVersion=parseInt(RegExp.$1,10)):/Version\/(\d+\.\d+(\.\d+)?) Safari/.test(o)&&!r.windowsPhone?(p.safari=!0,p.safariVersion=parseInt(RegExp.$1,10),p.es2019=p.safariVersion>10):/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(o)&&(p.ie=!0,p.trident=!0,p.tridentVersion=parseInt(RegExp.$1,10),p.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(o)&&(p.silk=!0),p}a.exports=h()},89289:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p={supportInverseAlpha:!1,supportNewBlendModes:!1};function h(){var n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",u="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",f=new Image;return f.onload=function(){var s=new Image;s.onload=function(){var c=r.create2D(s,6),d=c.getContext("2d",{willReadFrequently:!0});if(d.globalCompositeOperation="multiply",d.drawImage(f,0,0),d.drawImage(s,2,0),!d.getImageData(2,0,1,1))return!1;var v=d.getImageData(2,0,1,1).data;r.remove(s),p.supportNewBlendModes=v[0]===255&&v[1]===0&&v[2]===0},s.src=n+"/wCKxvRF"+u},f.src=n+"AP804Oa6"+u,!1}function o(){var n=r.create2D(this,2),u=n.getContext("2d",{willReadFrequently:!0});u.fillStyle="rgba(10, 20, 30, 0.5)",u.fillRect(0,0,1,1);var f=u.getImageData(0,0,1,1);if(f===null)return!1;u.putImageData(f,1,0);var s=u.getImageData(1,0,1,1),c=s.data[0]===f.data[0]&&s.data[1]===f.data[1]&&s.data[2]===f.data[2]&&s.data[3]===f.data[3];return r.remove(this),c}function l(){return typeof importScripts!="function"&&document!==void 0&&(p.supportNewBlendModes=h(),p.supportInverseAlpha=o()),p}a.exports=l()},89357:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25892),p=t(84148),h=t(27919),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,stableSort:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};function l(){var u=new ArrayBuffer(4),f=new Uint8Array(u),s=new Uint32Array(u);return f[0]=161,f[1]=178,f[2]=195,f[3]=212,s[0]===3569595041?!0:s[0]===2712847316?!1:null}function n(){if(typeof importScripts=="function")return o;o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch{o.localStorage=!1}o.file=!!window.File&&!!window.FileReader&&!!window.FileList&&!!window.Blob,o.fileSystem=!!window.requestFileSystem;var u=!1,f=function(){if(window.WebGLRenderingContext)try{var s=h.createWebGL(this),c=s.getContext("webgl")||s.getContext("experimental-webgl"),d=h.create2D(this),v=d.getContext("2d",{willReadFrequently:!0}),m=v.createImageData(1,1);return u=m.data instanceof Uint8ClampedArray,h.remove(s),h.remove(d),!!c}catch{return!1}return!1};return o.webGL=f(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,p.firefox&&p.firefoxVersion<21&&(o.getUserMedia=!1),!r.iOS&&(p.ie||p.firefox||p.chrome)&&(o.canvasBitBltShift=!0),(p.safari||p.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint32Array<"u"&&(o.littleEndian=l()),o.support32bit=typeof ArrayBuffer<"u"&&typeof Uint8ClampedArray<"u"&&typeof Int32Array<"u"&&o.littleEndian!==null&&u,o}a.exports=n()},91639:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={available:!1,cancel:"",keyboard:!1,request:""};function t(){if(typeof importScripts=="function")return y;var r,p="Fullscreen",h="FullScreen",o=["request"+p,"request"+h,"webkitRequest"+p,"webkitRequest"+h,"msRequest"+p,"msRequest"+h,"mozRequest"+h,"mozRequest"+p];for(r=0;r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(84148),p={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};function h(){return typeof importScripts=="function"||(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(p.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(p.mspointer=!0),navigator.getGamepads&&(p.gamepads=!0),"onwheel"in window||r.ie&&"WheelEvent"in window?p.wheelEvent="wheel":"onmousewheel"in window?p.wheelEvent="mousewheel":r.firefox&&"MouseScrollEvent"in window&&(p.wheelEvent="DOMMouseScroll")),p}a.exports=h()},25892:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};function t(){if(typeof importScripts=="function")return y;var r=navigator.userAgent;/Windows/.test(r)?y.windows=!0:/Mac OS/.test(r)&&!/like Mac OS/.test(r)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(y.iOS=!0,y.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),y.iOSVersion=parseInt(RegExp.$1,10)):y.macOS=!0:/Android/.test(r)?y.android=!0:/Linux/.test(r)?y.linux=!0:/iP[ao]d|iPhone/i.test(r)?(y.iOS=!0,navigator.appVersion.match(/OS (\d+)/),y.iOSVersion=parseInt(RegExp.$1,10),y.iPhone=r.toLowerCase().indexOf("iphone")!==-1,y.iPad=r.toLowerCase().indexOf("ipad")!==-1):/Kindle/.test(r)||/\bKF[A-Z][A-Z]+/.test(r)||/Silk.*Mobile Safari/.test(r)?y.kindle=!0:/CrOS/.test(r)&&(y.chromeOS=!0),(/Windows Phone/i.test(r)||/IEMobile/i.test(r))&&(y.android=!1,y.iOS=!1,y.macOS=!1,y.windows=!0,y.windowsPhone=!0);var p=/Silk/.test(r);return(y.windows||y.macOS||y.linux&&!p||y.chromeOS)&&(y.desktop=!0),(y.windowsPhone||/Windows NT/i.test(r)&&/Touch/i.test(r))&&(y.desktop=!1),navigator.standalone&&(y.webApp=!0),typeof importScripts!="function"&&(window.cordova!==void 0&&(y.cordova=!0),window.ejecta!==void 0&&(y.ejecta=!0)),typeof process<"u"&&process.versions&&process.versions.node&&(y.node=!0),y.node&&typeof process.versions=="object"&&(y.nodeWebkit=!!process.versions["node-webkit"],y.electron=!!process.versions.electron),/Crosswalk/.test(r)&&(y.crosswalk=!0),y.pixelRatio=window.devicePixelRatio||1,y}a.exports=t()},43267:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p={h264:!1,hls:!1,mp4:!1,m4v:!1,ogg:!1,vp9:!1,webm:!1,hasRequestVideoFrame:!1};function h(){if(typeof importScripts=="function")return p;var o=document.createElement("video"),l=!!o.canPlayType,n=/^no$/;try{l&&(o.canPlayType('video/ogg; codecs="theora"').replace(n,"")&&(p.ogg=!0),o.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(n,"")&&(p.h264=!0,p.mp4=!0),o.canPlayType("video/x-m4v").replace(n,"")&&(p.m4v=!0),o.canPlayType('video/webm; codecs="vp8, vorbis"').replace(n,"")&&(p.webm=!0),o.canPlayType('video/webm; codecs="vp9"').replace(n,"")&&(p.vp9=!0),o.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(n,"")&&(p.hls=!0))}catch{}return o.parentNode&&o.parentNode.removeChild(o),p.getVideoURL=function(u){Array.isArray(u)||(u=[u]);for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={os:t(25892),browser:t(84148),features:t(89357),input:t(31784),audio:t(7098),video:t(43267),fullscreen:t(91639),canvasFeatures:t(89289)}},89422:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new Float32Array(20),h=new r({initialize:function(){this._matrix=new Float32Array(20),this.alpha=1,this._dirty=!0,this._data=new Float32Array(20),this.reset()},set:function(o){return this._matrix.set(o),this._dirty=!0,this},reset:function(){var o=this._matrix;return o.fill(0),o[0]=1,o[6]=1,o[12]=1,o[18]=1,this.alpha=1,this._dirty=!0,this},getData:function(){var o=this._data;return this._dirty&&(o.set(this._matrix),o[4]/=255,o[9]/=255,o[14]/=255,o[19]/=255,this._dirty=!1),o},brightness:function(o,l){o===void 0&&(o=0),l===void 0&&(l=!1);var n=o;return this.multiply([n,0,0,0,0,0,n,0,0,0,0,0,n,0,0,0,0,0,1,0],l)},saturate:function(o,l){o===void 0&&(o=0),l===void 0&&(l=!1);var n=o*2/3+1,u=(n-1)*-.5;return this.multiply([n,u,u,0,0,u,n,u,0,0,u,u,n,0,0,0,0,0,1,0],l)},desaturate:function(o){return o===void 0&&(o=!1),this.saturate(-1,o)},hue:function(o,l){o===void 0&&(o=0),l===void 0&&(l=!1),o=o/180*Math.PI;var n=Math.cos(o),u=Math.sin(o),f=.213,s=.715,c=.072;return this.multiply([f+n*(1-f)+u*-f,s+n*-s+u*-s,c+n*-c+u*(1-c),0,0,f+n*-f+u*.143,s+n*(1-s)+u*.14,c+n*-c+u*-.283,0,0,f+n*-f+u*-(1-f),s+n*-s+u*s,c+n*(1-c)+u*c,0,0,0,0,0,1,0],l)},grayscale:function(o,l){return o===void 0&&(o=1),l===void 0&&(l=!1),this.saturate(-o,l)},blackWhite:function(o){return o===void 0&&(o=!1),this.multiply(h.BLACK_WHITE,o)},contrast:function(o,l){o===void 0&&(o=0),l===void 0&&(l=!1);var n=o+1,u=-.5*(n-1);return this.multiply([n,0,0,0,u,0,n,0,0,u,0,0,n,0,u,0,0,0,1,0],l)},negative:function(o){return o===void 0&&(o=!1),this.multiply(h.NEGATIVE,o)},desaturateLuminance:function(o){return o===void 0&&(o=!1),this.multiply(h.DESATURATE_LUMINANCE,o)},sepia:function(o){return o===void 0&&(o=!1),this.multiply(h.SEPIA,o)},night:function(o,l){return o===void 0&&(o=.1),l===void 0&&(l=!1),this.multiply([o*-2,-o,0,0,0,-o,0,o,0,0,0,o,o*2,0,0,0,0,0,1,0],l)},lsd:function(o){return o===void 0&&(o=!1),this.multiply(h.LSD,o)},brown:function(o){return o===void 0&&(o=!1),this.multiply(h.BROWN,o)},vintagePinhole:function(o){return o===void 0&&(o=!1),this.multiply(h.VINTAGE,o)},kodachrome:function(o){return o===void 0&&(o=!1),this.multiply(h.KODACHROME,o)},technicolor:function(o){return o===void 0&&(o=!1),this.multiply(h.TECHNICOLOR,o)},polaroid:function(o){return o===void 0&&(o=!1),this.multiply(h.POLAROID,o)},shiftToBGR:function(o){return o===void 0&&(o=!1),this.multiply(h.SHIFT_BGR,o)},multiply:function(o,l){l===void 0&&(l=!1),l||this.reset();var n=this._matrix,u=p;return u.set(n),n.set([u[0]*o[0]+u[1]*o[5]+u[2]*o[10]+u[3]*o[15],u[0]*o[1]+u[1]*o[6]+u[2]*o[11]+u[3]*o[16],u[0]*o[2]+u[1]*o[7]+u[2]*o[12]+u[3]*o[17],u[0]*o[3]+u[1]*o[8]+u[2]*o[13]+u[3]*o[18],u[0]*o[4]+u[1]*o[9]+u[2]*o[14]+u[3]*o[19]+u[4],u[5]*o[0]+u[6]*o[5]+u[7]*o[10]+u[8]*o[15],u[5]*o[1]+u[6]*o[6]+u[7]*o[11]+u[8]*o[16],u[5]*o[2]+u[6]*o[7]+u[7]*o[12]+u[8]*o[17],u[5]*o[3]+u[6]*o[8]+u[7]*o[13]+u[8]*o[18],u[5]*o[4]+u[6]*o[9]+u[7]*o[14]+u[8]*o[19]+u[9],u[10]*o[0]+u[11]*o[5]+u[12]*o[10]+u[13]*o[15],u[10]*o[1]+u[11]*o[6]+u[12]*o[11]+u[13]*o[16],u[10]*o[2]+u[11]*o[7]+u[12]*o[12]+u[13]*o[17],u[10]*o[3]+u[11]*o[8]+u[12]*o[13]+u[13]*o[18],u[10]*o[4]+u[11]*o[9]+u[12]*o[14]+u[13]*o[19]+u[14],u[15]*o[0]+u[16]*o[5]+u[17]*o[10]+u[18]*o[15],u[15]*o[1]+u[16]*o[6]+u[17]*o[11]+u[18]*o[16],u[15]*o[2]+u[16]*o[7]+u[17]*o[12]+u[18]*o[17],u[15]*o[3]+u[16]*o[8]+u[17]*o[13]+u[18]*o[18],u[15]*o[4]+u[16]*o[9]+u[17]*o[14]+u[18]*o[19]+u[19]]),this._dirty=!0,this}});h.BLACK_WHITE=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],h.NEGATIVE=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],h.DESATURATE_LUMINANCE=[.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],h.SEPIA=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],h.LSD=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],h.BROWN=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],h.VINTAGE=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],h.KODACHROME=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],h.TECHNICOLOR=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],h.POLAROID=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],h.SHIFT_BGR=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],a.exports=h},51767:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(29747),h=new r({initialize:function(l,n,u){this._rgb=[0,0,0],this.onChangeCallback=p,this.dirty=!1,this.set(l,n,u)},set:function(o,l,n){return o===void 0&&(o=0),l===void 0&&(l=0),n===void 0&&(n=0),this._rgb=[o,l,n],this.onChange(),this},equals:function(o,l,n){var u=this._rgb;return u[0]===o&&u[1]===l&&u[2]===n},onChange:function(){this.dirty=!0;var o=this._rgb;this.onChangeCallback.call(this,o[0],o[1],o[2])},r:{get:function(){return this._rgb[0]},set:function(o){this._rgb[0]=o,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(o){this._rgb[1]=o,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(o){this._rgb[2]=o,this.onChange()}},destroy:function(){this.onChangeCallback=null}});a.exports=h},60461:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12};a.exports=y},54312:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(35893),h=t(86327),o=t(88417),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)+f),h(n,r(u)+s),n};a.exports=l},46768:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(26541),h=t(86327),o=t(385),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)-f),h(n,r(u)+s),n};a.exports=l},35827:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(54380),h=t(86327),o=t(40136),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)+f),h(n,r(u)+s),n};a.exports=l},46871:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66786),p=t(35893),h=t(7702),o=function(l,n,u,f){return u===void 0&&(u=0),f===void 0&&(f=0),r(l,p(n)+u,h(n)+f),l};a.exports=o},5198:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7702),p=t(26541),h=t(20786),o=t(385),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)-f),h(n,r(u)+s),n};a.exports=l},11879:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(60461),p=[];p[r.BOTTOM_CENTER]=t(54312),p[r.BOTTOM_LEFT]=t(46768),p[r.BOTTOM_RIGHT]=t(35827),p[r.CENTER]=t(46871),p[r.LEFT_CENTER]=t(5198),p[r.RIGHT_CENTER]=t(80503),p[r.TOP_CENTER]=t(89698),p[r.TOP_LEFT]=t(922),p[r.TOP_RIGHT]=t(21373),p[r.LEFT_BOTTOM]=p[r.BOTTOM_LEFT],p[r.LEFT_TOP]=p[r.TOP_LEFT],p[r.RIGHT_BOTTOM]=p[r.BOTTOM_RIGHT],p[r.RIGHT_TOP]=p[r.TOP_RIGHT];var h=function(o,l,n,u,f){return p[n](o,l,u,f)};a.exports=h},80503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7702),p=t(54380),h=t(20786),o=t(40136),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)+f),h(n,r(u)+s),n};a.exports=l},89698:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35893),p=t(17717),h=t(88417),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,r(u)+f),o(n,p(u)-s),n};a.exports=l},922:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26541),p=t(17717),h=t(385),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,r(u)-f),o(n,p(u)-s),n};a.exports=l},21373:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54380),p=t(17717),h=t(40136),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,r(u)+f),o(n,p(u)-s),n};a.exports=l},91660:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BottomCenter:t(54312),BottomLeft:t(46768),BottomRight:t(35827),Center:t(46871),LeftCenter:t(5198),QuickSet:t(11879),RightCenter:t(80503),TopCenter:t(89698),TopLeft:t(922),TopRight:t(21373)}},71926:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(60461),p=t(79291),h={In:t(91660),To:t(16694)};h=p(!1,h,r),a.exports=h},21578:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(35893),h=t(88417),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,p(u)+f),o(n,r(u)+s),n};a.exports=l},10210:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(26541),h=t(385),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,p(u)-f),o(n,r(u)+s),n};a.exports=l},82341:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(54380),h=t(40136),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,p(u)+f),o(n,r(u)+s),n};a.exports=l},87958:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(26541),h=t(86327),o=t(40136),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)-f),h(n,r(u)+s),n};a.exports=l},40080:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7702),p=t(26541),h=t(20786),o=t(40136),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)-f),h(n,r(u)+s),n};a.exports=l},88466:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26541),p=t(17717),h=t(40136),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,r(u)-f),o(n,p(u)-s),n};a.exports=l},38829:(a,y,t)=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(60461),p=[];p[r.BOTTOM_CENTER]=t(21578),p[r.BOTTOM_LEFT]=t(10210),p[r.BOTTOM_RIGHT]=t(82341),p[r.LEFT_BOTTOM]=t(87958),p[r.LEFT_CENTER]=t(40080),p[r.LEFT_TOP]=t(88466),p[r.RIGHT_BOTTOM]=t(19211),p[r.RIGHT_CENTER]=t(34609),p[r.RIGHT_TOP]=t(48741),p[r.TOP_CENTER]=t(49440),p[r.TOP_LEFT]=t(81288),p[r.TOP_RIGHT]=t(61323);var h=function(o,l,n,u,f){return p[n](o,l,u,f)};a.exports=h},19211:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(54380),h=t(86327),o=t(385),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)+f),h(n,r(u)+s),n};a.exports=l},34609:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7702),p=t(54380),h=t(20786),o=t(385),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,p(u)+f),h(n,r(u)+s),n};a.exports=l},48741:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54380),p=t(17717),h=t(385),o=t(66737),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),h(n,r(u)+f),o(n,p(u)-s),n};a.exports=l},49440:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35893),p=t(17717),h=t(86327),o=t(88417),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,r(u)+f),h(n,p(u)-s),n};a.exports=l},81288:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26541),p=t(17717),h=t(86327),o=t(385),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,r(u)-f),h(n,p(u)-s),n};a.exports=l},61323:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54380),p=t(17717),h=t(86327),o=t(40136),l=function(n,u,f,s){return f===void 0&&(f=0),s===void 0&&(s=0),o(n,r(u)+f),h(n,p(u)-s),n};a.exports=l},16694:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BottomCenter:t(21578),BottomLeft:t(10210),BottomRight:t(82341),LeftBottom:t(87958),LeftCenter:t(40080),LeftTop:t(88466),QuickSet:t(38829),RightBottom:t(19211),RightCenter:t(34609),RightTop:t(48741),TopCenter:t(49440),TopLeft:t(81288),TopRight:t(61323)}},66786:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(88417),p=t(20786),h=function(o,l,n){return r(o,l),p(o,n)};a.exports=h},62235:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.y+t.height-t.height*t.originY};a.exports=y},72873:(a,y,t)=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62235),p=t(26541),h=t(54380),o=t(17717),l=t(87841),n=function(u,f){f===void 0&&(f=new l);var s=p(u),c=o(u);return f.x=s,f.y=c,f.width=h(u)-s,f.height=r(u)-c,f};a.exports=n},35893:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x-t.width*t.originX+t.width*.5};a.exports=y},7702:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.y-t.height*t.originY+t.height*.5};a.exports=y},26541:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x-t.width*t.originX};a.exports=y},87431:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.width*t.originX};a.exports=y},46928:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.height*t.originY};a.exports=y},54380:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x+t.width-t.width*t.originX};a.exports=y},17717:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.y-t.height*t.originY};a.exports=y},86327:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.y=r-t.height+t.height*t.originY,t};a.exports=y},88417:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.width*t.originX;return t.x=r+p-t.width*.5,t};a.exports=y},20786:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.height*t.originY;return t.y=r+p-t.height*.5,t};a.exports=y},385:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x=r+t.width*t.originX,t};a.exports=y},40136:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x=r-t.width+t.width*t.originX,t};a.exports=y},66737:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.y=r+t.height*t.originY,t};a.exports=y},58724:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CenterOn:t(66786),GetBottom:t(62235),GetBounds:t(72873),GetCenterX:t(35893),GetCenterY:t(7702),GetLeft:t(26541),GetOffsetX:t(87431),GetOffsetY:t(46928),GetRight:t(54380),GetTop:t(17717),SetBottom:t(86327),SetCenterX:t(88417),SetCenterY:t(20786),SetLeft:t(385),SetRight:t(40136),SetTop:t(66737)}},20623:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setCrisp:function(t){var r=["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"];return r.forEach(function(p){t.style["image-rendering"]=p}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}};a.exports=y},27919:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8054),p=t(68703),h=[],o=!1,l=function(){var n=function(M,A,C,w,P){A===void 0&&(A=1),C===void 0&&(C=1),w===void 0&&(w=r.CANVAS),P===void 0&&(P=!1);var L,O=s(w);return O===null?(O={parent:M,canvas:document.createElement("canvas"),type:w},w===r.CANVAS&&h.push(O),L=O.canvas):(O.parent=M,L=O.canvas),P&&(O.parent=L),L.width=A,L.height=C,o&&w===r.CANVAS&&p.disable(L.getContext("2d",{willReadFrequently:!1})),L},u=function(M,A,C){return n(M,A,C,r.CANVAS)},f=function(M,A,C){return n(M,A,C,r.WEBGL)},s=function(M){if(M===void 0&&(M=r.CANVAS),M===r.WEBGL)return null;for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y="",t=function(){var r=function(l){for(var n=["i","webkitI","msI","mozI","oI"],u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r="none"),t.style.msTouchAction=r,t.style["ms-touch-action"]=r,t.style["touch-action"]=r,t};a.exports=y},91610:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r="none");var p=["-webkit-","-khtml-","-moz-","-ms-",""];return p.forEach(function(h){t.style[h+"user-select"]=r}),t.style["-webkit-touch-callout"]=r,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t};a.exports=y},26253:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CanvasInterpolation:t(20623),CanvasPool:t(27919),Smoothing:t(68703),TouchAction:t(65208),UserSelect:t(91610)}},40987:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(37589),h=t(1e3),o=t(7537),l=t(87837),n=new r({initialize:function(f,s,c,d){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(f,s,c,d)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(u,f,s,c,d){return c===void 0&&(c=255),d===void 0&&(d=!0),this._locked=!0,this.red=u,this.green=f,this.blue=s,this.alpha=c,this._locked=!1,this.update(d)},setGLTo:function(u,f,s,c){return c===void 0&&(c=1),this._locked=!0,this.redGL=u,this.greenGL=f,this.blueGL=s,this.alphaGL=c,this._locked=!1,this.update(!0)},setFromRGB:function(u){return this._locked=!0,this.red=u.r,this.green=u.g,this.blue=u.b,u.hasOwnProperty("a")&&(this.alpha=u.a),this._locked=!1,this.update(!0)},setFromHSV:function(u,f,s){return o(u,f,s,this)},update:function(u){if(u===void 0&&(u=!1),this._locked)return this;var f=this.r,s=this.g,c=this.b,d=this.a;return this._color=p(f,s,c),this._color32=h(f,s,c,d),this._rgba="rgba("+f+","+s+","+c+","+d/255+")",u&&l(f,s,c,this),this},updateHSV:function(){var u=this.r,f=this.g,s=this.b;return l(u,f,s,this),this},clone:function(){return new n(this.r,this.g,this.b,this.a)},gray:function(u){return this.setTo(u,u,u)},random:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var s=Math.floor(u+Math.random()*(f-u)),c=Math.floor(u+Math.random()*(f-u)),d=Math.floor(u+Math.random()*(f-u));return this.setTo(s,c,d)},randomGray:function(u,f){u===void 0&&(u=0),f===void 0&&(f=255);var s=Math.floor(u+Math.random()*(f-u));return this.setTo(s,s,s)},saturate:function(u){return this.s+=u/100,this},desaturate:function(u){return this.s-=u/100,this},lighten:function(u){return this.v+=u/100,this},darken:function(u){return this.v-=u/100,this},brighten:function(u){var f=this.r,s=this.g,c=this.b;return f=Math.max(0,Math.min(255,f-Math.round(255*-(u/100)))),s=Math.max(0,Math.min(255,s-Math.round(255*-(u/100)))),c=Math.max(0,Math.min(255,c-Math.round(255*-(u/100)))),this.setTo(f,s,c)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(u){this.gl[0]=Math.min(Math.abs(u),1),this.r=Math.floor(this.gl[0]*255),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(u){this.gl[1]=Math.min(Math.abs(u),1),this.g=Math.floor(this.gl[1]*255),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(u){this.gl[2]=Math.min(Math.abs(u),1),this.b=Math.floor(this.gl[2]*255),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(u){this.gl[3]=Math.min(Math.abs(u),1),this.a=Math.floor(this.gl[3]*255),this.update()}},red:{get:function(){return this.r},set:function(u){u=Math.floor(Math.abs(u)),this.r=Math.min(u,255),this.gl[0]=u/255,this.update(!0)}},green:{get:function(){return this.g},set:function(u){u=Math.floor(Math.abs(u)),this.g=Math.min(u,255),this.gl[1]=u/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(u){u=Math.floor(Math.abs(u)),this.b=Math.min(u,255),this.gl[2]=u/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(u){u=Math.floor(Math.abs(u)),this.a=Math.min(u,255),this.gl[3]=u/255,this.update()}},h:{get:function(){return this._h},set:function(u){this._h=u,o(u,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(u){this._s=u,o(this._h,u,this._v,this)}},v:{get:function(){return this._v},set:function(u){this._v=u,o(this._h,this._s,u,this)}}});a.exports=n},92728:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37589),p=function(h){h===void 0&&(h=1024);var o=[],l=255,n,u=255,f=0,s=0;for(n=0;n<=l;n++)o.push({r:u,g:n,b:s,color:r(u,n,s)});for(f=255,n=l;n>=0;n--)o.push({r:n,g:f,b:s,color:r(n,f,s)});for(u=0,n=0;n<=l;n++,f--)o.push({r:u,g:f,b:n,color:r(u,f,n)});for(f=0,s=255,n=0;n<=l;n++,s--,u++)o.push({r:u,g:f,b:s,color:r(u,f,s)});if(h===1024)return o;var c=[],d=0,v=1024/h;for(n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r={r:t>>16&255,g:t>>8&255,b:t&255,a:255};return t>16777215&&(r.a=t>>>24),r};a.exports=y},62957:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=t.toString(16);return r.length===1?"0"+r:r};a.exports=y},37589:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t<<16|r<<8|p};a.exports=y},1e3:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return h<<24|t<<16|r<<8|p};a.exports=y},62183:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987),p=t(89528),h=function(o,l,n){var u=n,f=n,s=n;if(l!==0){var c=n<.5?n*(1+l):n+l-n*l,d=2*n-c;u=p(d,c,o+1/3),f=p(d,c,o),s=p(d,c,o-1/3)}var v=new r;return v.setGLTo(u,f,s,1)};a.exports=h},27939:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7537),p=function(h,o){h===void 0&&(h=1),o===void 0&&(o=1);for(var l=[],n=0;n<=359;n++)l.push(r(n/359,h,o));return l};a.exports=p},7537:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37589);function p(o,l,n,u){var f=(o+l*6)%6,s=Math.min(f,4-f,1);return Math.round(255*(u-u*n*Math.max(0,s)))}var h=function(o,l,n,u){l===void 0&&(l=1),n===void 0&&(n=1);var f=p(5,o,l,n),s=p(3,o,l,n),c=p(1,o,l,n);return u?u.setTo?u.setTo(f,s,c,u.alpha,!0):(u.r=f,u.g=s,u.b=c,u.color=r(f,s,c),u):{r:f,g:s,b:c,color:r(f,s,c)}};a.exports=h},70238:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987),p=function(h){var o=new r;h=h.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(s,c,d,v){return c+c+d+d+v+v});var l=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(h);if(l){var n=parseInt(l[1],16),u=parseInt(l[2],16),f=parseInt(l[3],16);o.setTo(n,u,f)}return o};a.exports=p},89528:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p<0&&(p+=1),p>1&&(p-=1),p<.16666666666666666?t+(r-t)*6*p:p<.5?r:p<.6666666666666666?t+(r-t)*(.6666666666666666-p)*6:t};a.exports=y},30100:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987),p=t(90664),h=function(o){var l=p(o);return new r(l.r,l.g,l.b,l.a)};a.exports=h},90664:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t>16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:t&255}:{a:255,r:t>>16&255,g:t>>8&255,b:t&255}};a.exports=y},13699:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(28915),p=function(l,n,u,f,s,c,d,v){d===void 0&&(d=100),v===void 0&&(v=0);var m=v/d;return{r:r(l,f,m),g:r(n,s,m),b:r(u,c,m)}},h=function(l,n,u,f){return u===void 0&&(u=100),f===void 0&&(f=0),p(l.r,l.g,l.b,n.r,n.g,n.b,u,f)},o=function(l,n,u,f,s,c){return s===void 0&&(s=100),c===void 0&&(c=0),p(l.r,l.g,l.b,n,u,f,s,c)};a.exports={RGBWithRGB:p,ColorWithRGB:o,ColorWithColor:h}},68957:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987),p=function(h){return new r(h.r,h.g,h.b,h.a)};a.exports=p},87388:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987),p=function(h){var o=new r,l=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(h.toLowerCase());if(l){var n=parseInt(l[1],10),u=parseInt(l[2],10),f=parseInt(l[3],10),s=l[4]!==void 0?parseFloat(l[4]):1;o.setTo(n,u,f,s*255)}return o};a.exports=p},87837:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){h===void 0&&(h={h:0,s:0,v:0}),t/=255,r/=255,p/=255;var o=Math.min(t,r,p),l=Math.max(t,r,p),n=l-o,u=0,f=l===0?0:n/l,s=l;return l!==o&&(l===t?u=(r-p)/n+(r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62957),p=function(h,o,l,n,u){return n===void 0&&(n=255),u===void 0&&(u="#"),u==="#"?"#"+((1<<24)+(h<<16)+(o<<8)+l).toString(16).slice(1,7):"0x"+r(n)+r(h)+r(o)+r(l)};a.exports=p},85386:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30976),p=t(40987),h=function(o,l){return o===void 0&&(o=0),l===void 0&&(l=255),new p(r(o,l),r(o,l),r(o,l))};a.exports=h},80333:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70238),p=t(30100),h=t(68957),o=t(87388),l=function(n){var u=typeof n;switch(u){case"string":return n.substr(0,3).toLowerCase()==="rgb"?o(n):r(n);case"number":return p(n);case"object":return h(n)}};a.exports=l},3956:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40987);r.ColorSpectrum=t(92728),r.ColorToRGBA=t(91588),r.ComponentToHex=t(62957),r.GetColor=t(37589),r.GetColor32=t(1e3),r.HexStringToColor=t(70238),r.HSLToColor=t(62183),r.HSVColorWheel=t(27939),r.HSVToRGB=t(7537),r.HueToComponent=t(89528),r.IntegerToColor=t(30100),r.IntegerToRGB=t(90664),r.Interpolate=t(13699),r.ObjectToColor=t(68957),r.RandomRGB=t(85386),r.RGBStringToColor=t(87388),r.RGBToHSV=t(87837),r.RGBToString=t(75723),r.ValueToColor=t(80333),a.exports=r},27460:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Align:t(71926),BaseShader:t(73894),Bounds:t(58724),Canvas:t(26253),Color:t(3956),ColorMatrix:t(89422),Masks:t(69781),RGB:t(51767)}},6858:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(39429),h=new r({initialize:function(l,n,u,f,s,c){n||(n=l.sys.make.image({x:u,y:f,key:s,frame:c,add:!1})),this.bitmapMask=n,this.invertAlpha=!1,this.isStencil=!1},setBitmap:function(o){this.bitmapMask=o},preRenderWebGL:function(o,l,n){o.pipelines.BITMAPMASK_PIPELINE.beginMask(this,l,n)},postRenderWebGL:function(o,l,n){o.pipelines.BITMAPMASK_PIPELINE.endMask(this,l,n)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.bitmapMask=null}});p.register("bitmapMask",function(o,l,n,u,f){return new h(this.scene,o,l,n,u,f)}),a.exports=h},80661:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l){this.geometryMask=l,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(h){return this.geometryMask=h,this},setInvertAlpha:function(h){return h===void 0&&(h=!0),this.invertAlpha=h,this},preRenderWebGL:function(h,o,l){var n=h.gl;h.flush(),h.maskStack.length===0&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),h.maskCount=0),h.currentCameraMask.mask!==this&&(h.currentMask.mask=this),h.maskStack.push({mask:this,camera:l}),this.applyStencil(h,l,!0),h.maskCount++},applyStencil:function(h,o,l){var n=h.gl,u=this.geometryMask,f=h.maskCount,s=255;n.colorMask(!1,!1,!1,!1),l?(n.stencilFunc(n.EQUAL,f,s),n.stencilOp(n.KEEP,n.KEEP,n.INCR),f++):(n.stencilFunc(n.EQUAL,f+1,s),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),this.level=f,u.renderWebGL(h,u,o),h.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),this.invertAlpha?n.stencilFunc(n.NOTEQUAL,f,s):n.stencilFunc(n.EQUAL,f,s)},postRenderWebGL:function(h){var o=h.gl;h.maskStack.pop(),h.maskCount--,h.flush();var l=h.currentMask;if(h.maskStack.length===0)l.mask=null,o.disable(o.STENCIL_TEST);else{var n=h.maskStack[h.maskStack.length-1];n.mask.applyStencil(h,n.camera,!1),h.currentCameraMask.mask!==n.mask?(l.mask=n.mask,l.camera=n.camera):l.mask=null}},preRenderCanvas:function(h,o,l){var n=this.geometryMask;h.currentContext.save(),n.renderCanvas(h,n,l,null,null,!0),h.currentContext.clip()},postRenderCanvas:function(h){h.currentContext.restore()},destroy:function(){this.geometryMask=null}});a.exports=p},69781:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BitmapMask:t(6858),GeometryMask:t(80661)}},73894:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u){(!l||l==="")&&(l=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join(` -`)),(!n||n==="")&&(n=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join(` -`)),u===void 0&&(u=null),this.key=o,this.fragmentSrc=l,this.vertexSrc=n,this.uniforms=u}});a.exports=p},40366:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p;if(r)typeof r=="string"?p=document.getElementById(r):typeof r=="object"&&r.nodeType===1&&(p=r);else if(t.parentElement||r===null)return t;return p||(p=document.body),p.appendChild(t),t};a.exports=y},83719:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40366),p=function(h){var o=h.config;if(!(!o.parent||!o.domCreateContainer)){var l=document.createElement("div");l.style.cssText=["display: block;","width: "+h.scale.width+"px;","height: "+h.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: "+o.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),h.domContainer=l,r(l,o.parent)}};a.exports=p},57264:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25892),p=function(h){if(document.readyState==="complete"||document.readyState==="interactive"){h();return}var o=function(){document.removeEventListener("deviceready",o,!0),document.removeEventListener("DOMContentLoaded",o,!0),window.removeEventListener("load",o,!0),h()};document.body?r.cordova?document.addEventListener("deviceready",o,!1):(document.addEventListener("DOMContentLoaded",o,!0),window.addEventListener("load",o,!0)):window.setTimeout(o,20)};a.exports=p},57811:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){if(!t)return window.innerHeight;var r=Math.abs(window.orientation),p={w:0,h:0},h=document.createElement("div");return h.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(h),p.w=r===90?h.offsetHeight:window.innerWidth,p.h=r===90?window.innerWidth:h.offsetHeight,document.documentElement.removeChild(h),h=null,Math.abs(window.orientation)!==90?p.h:p.w};a.exports=y},45818:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13560),p=function(h,o){var l=window.screen,n=l?l.orientation||l.mozOrientation||l.msOrientation:!1;if(n&&typeof n.type=="string")return n.type;if(typeof n=="string")return n;if(typeof window.orientation=="number")return window.orientation===0||window.orientation===180?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return r.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return r.ORIENTATION.LANDSCAPE}else return o>h?r.ORIENTATION.PORTRAIT:r.ORIENTATION.LANDSCAPE};a.exports=p},74403:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r;return t!==""&&(typeof t=="string"?r=document.getElementById(t):t&&t.nodeType===1&&(r=t)),r||(r=document.body),r};a.exports=y},56836:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r="";try{if(window.DOMParser){var p=new DOMParser;r=p.parseFromString(t,"text/xml")}else r=new ActiveXObject("Microsoft.XMLDOM"),r.loadXML(t)}catch{r=null}return!r||!r.documentElement||r.getElementsByTagName("parsererror").length?null:r};a.exports=y},35846:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){t.parentNode&&t.parentNode.removeChild(t)};a.exports=y},43092:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(29747),h=new r({initialize:function(){this.isRunning=!1,this.callback=p,this.isSetTimeOut=!1,this.timeOutID=null,this.delay=0;var l=this;this.step=function n(u){l.callback(u),l.isRunning&&(l.timeOutID=window.requestAnimationFrame(n))},this.stepTimeout=function n(){l.isRunning&&(l.timeOutID=window.setTimeout(n,l.delay)),l.callback(window.performance.now())}},start:function(o,l,n){this.isRunning||(this.callback=o,this.isSetTimeOut=l,this.delay=n,this.isRunning=!0,this.timeOutID=l?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=p}});a.exports=h},84902:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={AddToDOM:t(40366),DOMContentLoaded:t(57264),GetInnerHeight:t(57811),GetScreenOrientation:t(45818),GetTarget:t(74403),ParseXML:t(56836),RemoveFromDOM:t(35846),RequestAnimationFrame:t(43092)};a.exports=r},47565:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(37277),o=new r({Extends:p,initialize:function(){p.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});h.register("EventEmitter",o,"events"),a.exports=o},93055:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={EventEmitter:t(47565)}},20122:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.BARREL,n),this.amount=u}});a.exports=o},32251:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v){f===void 0&&(f=1),s===void 0&&(s=1),c===void 0&&(c=1),d===void 0&&(d=1),v===void 0&&(v=4),p.call(this,h.BLOOM,n),this.steps=v,this.offsetX=f,this.offsetY=s,this.blurStrength=c,this.strength=d,this.glcolor=[1,1,1],u!=null&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});a.exports=o},9047:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v){u===void 0&&(u=0),f===void 0&&(f=2),s===void 0&&(s=2),c===void 0&&(c=1),v===void 0&&(v=4),p.call(this,h.BLUR,n),this.quality=u,this.x=f,this.y=s,this.steps=v,this.strength=c,this.glcolor=[1,1,1],d!=null&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});a.exports=o},27885:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v,m){u===void 0&&(u=.5),f===void 0&&(f=1),s===void 0&&(s=.2),c===void 0&&(c=!1),d===void 0&&(d=1),v===void 0&&(v=1),m===void 0&&(m=1),p.call(this,h.BOKEH,n),this.radius=u,this.amount=f,this.contrast=s,this.isTiltShift=c,this.strength=m,this.blurX=d,this.blurY=v}});a.exports=o},12578:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d){u===void 0&&(u=8),c===void 0&&(c=1),d===void 0&&(d=.005),p.call(this,h.CIRCLE,n),this.scale=c,this.feather=d,this.thickness=u,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4],f!=null&&(this.color=f),s!=null&&(this.backgroundColor=s)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundColor:{get:function(){var l=this.glcolor2;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor2;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}},backgroundAlpha:{get:function(){return this.glcolor2[3]},set:function(l){this.glcolor2[3]=l}}});a.exports=o},15802:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(89422),h=t(14811),o=new r({Extends:p,initialize:function(n){p.call(this),this.type=h.COLOR_MATRIX,this.gameObject=n,this.active=!0},destroy:function(){this.gameObject=null,this._matrix=null,this._data=null}});a.exports=o},72898:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l){this.type=o,this.gameObject=l,this.active=!0},setActive:function(h){return this.active=h,this},destroy:function(){this.gameObject=null,this.active=!1}});a.exports=p},44553:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s){u===void 0&&(u="__WHITE"),f===void 0&&(f=.005),s===void 0&&(s=.005),p.call(this,h.DISPLACEMENT,n),this.x=f,this.y=s,this.glTexture,this.setTexture(u)},setTexture:function(l){var n=this.gameObject.scene.sys.textures.getFrame(l);return n&&(this.glTexture=n.glTexture),this}});a.exports=o},68531:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c){f===void 0&&(f=4),s===void 0&&(s=0),c===void 0&&(c=!1),p.call(this,h.GLOW,n),this.outerStrength=f,this.innerStrength=s,this.knockout=c,this.glcolor=[1,1,1,1],u!==void 0&&(this.color=u)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});a.exports=o},37102:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v,m,S){s===void 0&&(s=.2),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=1),S===void 0&&(S=0),p.call(this,h.GRADIENT,n),this.alpha=s,this.size=S,this.fromX=c,this.fromY=d,this.toX=v,this.toY=m,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0],u!=null&&(this.color1=u),f!=null&&(this.color2=f)},color1:{get:function(){var l=this.glcolor1;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor1;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}},color2:{get:function(){var l=this.glcolor2;return(l[0]<<16)+(l[1]<<8)+(l[2]|0)},set:function(l){var n=this.glcolor2;n[0]=l>>16&255,n[1]=l>>8&255,n[2]=l&255}}});a.exports=o},86886:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u){u===void 0&&(u=1),p.call(this,h.PIXELATE,n),this.amount=u}});a.exports=o},92322:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=.1),c===void 0&&(c=1),v===void 0&&(v=6),m===void 0&&(m=1),p.call(this,h.SHADOW,n),this.x=u,this.y=f,this.decay=s,this.power=c,this.glcolor=[0,0,0,1],this.samples=v,this.intensity=m,d!==void 0&&(this.color=d)},color:{get:function(){var l=this.glcolor;return(l[0]*255<<16)+(l[1]*255<<8)+(l[2]*255|0)},set:function(l){var n=this.glcolor;n[0]=(l>>16&255)/255,n[1]=(l>>8&255)/255,n[2]=(l&255)/255}}});a.exports=o},39563:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c){u===void 0&&(u=.5),f===void 0&&(f=.5),s===void 0&&(s=3),c===void 0&&(c=!1),p.call(this,h.SHINE,n),this.speed=u,this.lineWidth=f,this.gradient=s,this.reveal=c}});a.exports=o},56448:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c){u===void 0&&(u=.5),f===void 0&&(f=.5),s===void 0&&(s=.5),c===void 0&&(c=.5),p.call(this,h.VIGNETTE,n),this.x=u,this.y=f,this.radius=s,this.strength=c}});a.exports=o},38433:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72898),h=t(14811),o=new r({Extends:p,initialize:function(n,u,f,s,c){u===void 0&&(u=.1),f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=!1),p.call(this,h.WIPE,n),this.progress=0,this.wipeWidth=u,this.direction=f,this.axis=s,this.reveal=c}});a.exports=o},14811:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={GLOW:4,SHADOW:5,PIXELATE:6,VIGNETTE:7,SHINE:8,BLUR:9,GRADIENT:12,BLOOM:13,COLOR_MATRIX:14,CIRCLE:15,BARREL:16,DISPLACEMENT:17,WIPE:18,BOKEH:19};a.exports=y},66064:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79291),p=t(14811),h={Barrel:t(20122),Controller:t(72898),Bloom:t(32251),Blur:t(9047),Bokeh:t(27885),Circle:t(12578),ColorMatrix:t(15802),Displacement:t(44553),Glow:t(68531),Gradient:t(37102),Pixelate:t(86886),Shadow:t(92322),Shine:t(39563),Vignette:t(56448),Wipe:t(38433)};h=r(!1,h,p),a.exports=h},25305:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(23568),h=function(o,l,n){l.x=p(n,"x",0),l.y=p(n,"y",0),l.depth=p(n,"depth",0),l.flipX=p(n,"flipX",!1),l.flipY=p(n,"flipY",!1);var u=p(n,"scale",null);typeof u=="number"?l.setScale(u):u!==null&&(l.scaleX=p(u,"x",1),l.scaleY=p(u,"y",1));var f=p(n,"scrollFactor",null);typeof f=="number"?l.setScrollFactor(f):f!==null&&(l.scrollFactorX=p(f,"x",1),l.scrollFactorY=p(f,"y",1)),l.rotation=p(n,"rotation",0);var s=p(n,"angle",null);s!==null&&(l.angle=s),l.alpha=p(n,"alpha",1);var c=p(n,"origin",null);if(typeof c=="number")l.setOrigin(c);else if(c!==null){var d=p(c,"x",.5),v=p(c,"y",.5);l.setOrigin(d,v)}l.blendMode=p(n,"blendMode",r.NORMAL),l.visible=p(n,"visible",!0);var m=p(n,"add",!0);return m&&o.sys.displayList.add(l),l.preUpdate&&o.sys.updateList.add(l),l};a.exports=h},13059:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23568),p=function(h,o){var l=r(o,"anims",null);if(l===null)return h;if(typeof l=="string")h.anims.play(l);else if(typeof l=="object"){var n=h.anims,u=r(l,"key",void 0);if(u){var f=r(l,"startFrame",void 0),s=r(l,"delay",0),c=r(l,"repeat",0),d=r(l,"repeatDelay",0),v=r(l,"yoyo",!1),m=r(l,"play",!1),S=r(l,"delayedPlay",0),M={key:u,delay:s,repeat:c,repeatDelay:d,yoyo:v,startFrame:f};m?n.play(M):S>0?n.playAfterDelay(M,S):n.load(M)}}return h};a.exports=p},8050:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(73162),h=t(37277),o=t(51708),l=t(44594),n=t(19186),u=new r({Extends:p,initialize:function(s){p.call(this,s),this.sortChildrenFlag=!1,this.scene=s,this.systems=s.sys,this.events=s.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(l.BOOT,this.boot,this),this.events.on(l.START,this.start,this)},boot:function(){this.events.once(l.DESTROY,this.destroy,this)},addChildCallback:function(f){f.displayList&&f.displayList!==this&&f.removeFromDisplayList(),f.parentContainer&&f.parentContainer.remove(f),f.displayList||(this.queueDepthSort(),f.displayList=this,f.emit(o.ADDED_TO_SCENE,f,this.scene),this.events.emit(l.ADDED_TO_SCENE,f,this.scene))},removeChildCallback:function(f){this.queueDepthSort(),f.displayList=null,f.emit(o.REMOVED_FROM_SCENE,f,this.scene),this.events.emit(l.REMOVED_FROM_SCENE,f,this.scene)},start:function(){this.events.once(l.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(n(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(f,s){return f._depth-s._depth},getChildren:function(){return this.list},shutdown:function(){for(var f=this.list;f.length;)f[0].destroy(!0);this.events.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(l.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});h.register("DisplayList",u,"displayList"),a.exports=u},95643:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(53774),h=t(45893),o=t(50792),l=t(51708),n=t(44594),u=new r({Extends:o,initialize:function(s,c){o.call(this),this.scene=s,this.displayList=null,this.type=c,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(l.ADDED_TO_SCENE,this.addedToScene,this),this.on(l.REMOVED_FROM_SCENE,this.removedFromScene,this),s.sys.queueDepthSort()},setActive:function(f){return this.active=f,this},setName:function(f){return this.name=f,this},setState:function(f){return this.state=f,this},setDataEnabled:function(){return this.data||(this.data=new h(this)),this},setData:function(f,s){return this.data||(this.data=new h(this)),this.data.set(f,s),this},incData:function(f,s){return this.data||(this.data=new h(this)),this.data.inc(f,s),this},toggleData:function(f){return this.data||(this.data=new h(this)),this.data.toggle(f),this},getData:function(f){return this.data||(this.data=new h(this)),this.data.get(f)},setInteractive:function(f,s,c){return this.scene.sys.input.enable(this,f,s,c),this},disableInteractive:function(){return this.scene.sys.input.disable(this),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return p(this)},willRender:function(f){var s=this.displayList&&this.displayList.active?this.displayList.willRender(f):!0;return!(!s||u.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&f.id)},getIndexList:function(){for(var f=this,s=this.parentContainer,c=[];s&&(c.unshift(s.getIndex(f)),f=s,s.parentContainer);)s=s.parentContainer;return this.displayList?c.unshift(this.displayList.getIndex(f)):c.unshift(this.scene.sys.displayList.getIndex(f)),c},addToDisplayList:function(f){return f===void 0&&(f=this.scene.sys.displayList),this.displayList&&this.displayList!==f&&this.removeFromDisplayList(),f.exists(this)||(this.displayList=f,f.add(this,!0),f.queueDepthSort(),this.emit(l.ADDED_TO_SCENE,this,this.scene),f.events.emit(n.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var f=this.displayList||this.scene.sys.displayList;return f&&f.exists(this)&&(f.remove(this,!0),f.queueDepthSort(),this.displayList=null,this.emit(l.REMOVED_FROM_SCENE,this,this.scene),f.events.emit(n.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(f){!this.scene||this.ignoreDestroy||(f===void 0&&(f=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(l.DESTROY,this,f),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.preFX&&(this.preFX.destroy(),this.preFX=void 0),this.postFX&&(this.postFX.destroy(),this.postFX=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0)}});u.RENDER_MASK=15,a.exports=u},44603:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(37277),h=t(44594),o=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(l,n){o.prototype.hasOwnProperty(l)||(o.prototype[l]=n)},o.remove=function(l){o.prototype.hasOwnProperty(l)&&delete o.prototype[l]},p.register("GameObjectCreator",o,"make"),a.exports=o},39429:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(37277),h=t(44594),o=new r({initialize:function(n){this.scene=n,this.systems=n.sys,this.events=n.sys.events,this.displayList,this.updateList,this.events.once(h.BOOT,this.boot,this),this.events.on(h.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(h.DESTROY,this.destroy,this)},start:function(){this.events.once(h.SHUTDOWN,this.shutdown,this)},existing:function(l){return(l.renderCanvas||l.renderWebGL)&&this.displayList.add(l),l.preUpdate&&this.updateList.add(l),l},shutdown:function(){this.events.off(h.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(l,n){o.prototype.hasOwnProperty(l)||(o.prototype[l]=n)},o.remove=function(l){o.prototype.hasOwnProperty(l)&&delete o.prototype[l]},p.register("GameObjectFactory",o,"add"),a.exports=o},91296:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61340),p=new r,h=new r,o=new r,l={camera:p,sprite:h,calc:o},n=function(u,f,s){var c=p,d=h,v=o;return d.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),c.copyFrom(f.matrix),s?(c.multiplyWithOffset(s,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),d.e=u.x,d.f=u.y):(d.e-=f.scrollX*u.scrollFactorX,d.f-=f.scrollY*u.scrollFactorY),c.multiply(d,v),l};a.exports=n},45027:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(25774),h=t(37277),o=t(44594),l=new r({Extends:p,initialize:function(u){p.call(this),this.checkQueue=!0,this.scene=u,this.systems=u.sys,u.sys.events.once(o.BOOT,this.boot,this),u.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var n=this.systems.events;n.on(o.PRE_UPDATE,this.update,this),n.on(o.UPDATE,this.sceneUpdate,this),n.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(n,u){for(var f=this._active,s=f.length,c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l,n,u,f,s,c,d,v,m,S){var M=p.x-r.displayOriginX+o,A=p.y-r.displayOriginY+l,C=M+p.w,w=A+p.h,P=n.getXRound(M,A,u),L=n.getYRound(M,A,u),O=n.getXRound(M,w,u),I=n.getYRound(M,w,u),D=n.getXRound(C,w,u),B=n.getYRound(C,w,u),G=n.getXRound(C,A,u),z=n.getYRound(C,A,u);t.batchQuad(r,P,L,O,I,D,B,G,z,h.u0,h.v0,h.u1,h.v1,f,s,c,d,v,m,S)};a.exports=y},53048:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){if(p===void 0&&(p=!1),h===void 0)return h={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},h;var o=t.text,l=o.length,n=t.maxWidth,u=t.wordWrapCharCode,f=Number.MAX_VALUE,s=Number.MAX_VALUE,c=0,d=0,v=t.fontData.chars,m=t.fontData.lineHeight,S=t.letterSpacing,M=t.lineSpacing,A=0,C=0,w=0,P=null,L=t._align,O=0,I=0,D=t.fontSize/t.fontData.size,B=D*t.scaleX,G=D*t.scaleY,z=null,W=0,k=[],J=Number.MAX_VALUE,Q=0,Y=0,K=0,U,V=[],j=[],$=null;if(n>0){for(U=0;Un||At>n?(et.push(ht.i-1),ht.cr?(et.push(ht.i+ht.word.length),nt=0,it=null):it=ht):ht.cr&&(et.push(ht.i+ht.word.length),nt=0,it=null)}var ot=function(le,ce,se){return le.substr(0,ce)+se+le.substr(ce+1)};for(U=et.length-1;U>=0;U--)o=ot(o,et[U],` -`);h.wrappedText=o,l=o.length,V=[],$=null}var st=0;for(U=0;UQ&&(Q=K),KO&&(f=O),s>I&&(s=I);var Tt=O+P.xAdvance,wt=I+m;cQ&&(Q=K),K0)for(var Gt=0;Gt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(21859),p=function(h,o,l,n,u,f,s){var c=h.sys.textures.get(l),d=c.get(n),v=h.sys.cache.xml.get(u);if(d&&v){var m=r(v,d,f,s,c);return h.sys.cache.bitmapFont.add(o,{data:m,texture:l,frame:n,fromAtlas:!0}),!0}else return!1};a.exports=p},6925:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35154),p=function(h,o){var l=o.width,n=o.height,u=Math.floor(l/2),f=Math.floor(n/2),s=r(o,"chars","");if(s!==""){var c=r(o,"image",""),d=h.sys.textures.getFrame(c),v=d.cutX,m=d.cutY,S=d.source.width,M=d.source.height,A=r(o,"offset.x",0),C=r(o,"offset.y",0),w=r(o,"spacing.x",0),P=r(o,"spacing.y",0),L=r(o,"lineSpacing",0),O=r(o,"charsPerRow",null);O===null&&(O=S/l,O>s.length&&(O=s.length));for(var I=A,D=C,B={retroFont:!0,font:c,size:l,lineHeight:n+L,chars:{}},G=0,z=0;z{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(r,p){return parseInt(r.getAttribute(p),10)}var t=function(r,p,h,o,l){h===void 0&&(h=0),o===void 0&&(o=0);var n=p.cutX,u=p.cutY,f=p.source.width,s=p.source.height,c=p.sourceIndex,d={},v=r.getElementsByTagName("info")[0],m=r.getElementsByTagName("common")[0];d.font=v.getAttribute("face"),d.size=y(v,"size"),d.lineHeight=y(m,"lineHeight")+o,d.chars={};var S=r.getElementsByTagName("char"),M=p!==void 0&&p.trimmed;if(M)var A=p.height,C=p.width;for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87662),p=t(79291),h={Parse:t(6925)};h=p(!1,h,r),a.exports=h},87662:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:` !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ`,TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:`ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789"(),-.' `,TEXT_SET7:`AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW")28FLRX-'39`,TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:`ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'"?!`,TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:`ABCDEFGHIJKLMNOPQRSTUVWXYZ.,"-+!?()':;0123456789`};a.exports=y},2638:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22186),p=t(83419),h=t(12310),o=new p({Extends:r,Mixins:[h],initialize:function(n,u,f,s,c,d,v){r.call(this,n,u,f,s,c,d,v),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(l,n){return this.cropWidth=l,this.cropHeight=n,this},setDisplayCallback:function(l){return this.displayCallback=l,this},setScrollX:function(l){return this.scrollX=l,this},setScrollY:function(l){return this.scrollY=l,this}});a.exports=o},86741:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20926),p=function(h,o,l,n){var u=o._text,f=u.length,s=h.currentContext;if(!(f===0||!r(h,s,o,l,n))){l.addToRenderList(o);var c=o.fromAtlas?o.frame:o.texture.frames.__BASE,d=o.displayCallback,v=o.callbackData,m=o.fontData.chars,S=o.fontData.lineHeight,M=o._letterSpacing,A=0,C=0,w=0,P=null,L=0,O=0,I=0,D=0,B=0,G=0,z=null,W=0,k=o.frame.source.image,J=c.cutX,Q=c.cutY,Y=0,K=0,U=o._fontSize/o.fontData.size,V=o._align,j=0,$=0;o.getTextBounds(!1);var q=o._bounds.lines;V===1?$=(q.longest-q.lengths[0])/2:V===2&&($=q.longest-q.lengths[0]),s.translate(-o.displayOriginX,-o.displayOriginY);var it=l.roundPixels;o.cropWidth>0&&o.cropHeight>0&&(s.beginPath(),s.rect(0,0,o.cropWidth,o.cropHeight),s.clip());for(var nt=0;nt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2638),p=t(25305),h=t(44603),o=t(23568);h.register("dynamicBitmapText",function(l,n){l===void 0&&(l={});var u=o(l,"font",""),f=o(l,"text",""),s=o(l,"size",!1),c=new r(this.scene,0,0,u,f,s);return n!==void 0&&(l.add=n),p(this.scene,c,l),c})},72566:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2638),p=t(39429);p.register("dynamicBitmapText",function(h,o,l,n,u){return this.displayList.add(new r(this.scene,h,o,l,n,u))})},12310:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(73482),h=t(86741),a.exports={renderWebGL:p,renderCanvas:h}},73482:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(61340),h=t(70554),o=new p,l=function(n,u,f,s){var c=u.text,d=c.length;if(d!==0){f.addToRenderList(u);var v=n.pipelines.set(u.pipeline,u),m=r(u,f,s);n.pipelines.preBatch(u);var S=m.sprite,M=m.calc,A=o,C=u.cropWidth>0||u.cropHeight>0;C&&(v.flush(),n.pushScissor(M.tx,M.ty,u.cropWidth*M.scaleX,u.cropHeight*M.scaleY));var w=u.frame,P=w.glTexture,L=u.tintFill,O=h.getTintAppendFloatAlpha(u.tintTopLeft,f.alpha*u._alphaTL),I=h.getTintAppendFloatAlpha(u.tintTopRight,f.alpha*u._alphaTR),D=h.getTintAppendFloatAlpha(u.tintBottomLeft,f.alpha*u._alphaBL),B=h.getTintAppendFloatAlpha(u.tintBottomRight,f.alpha*u._alphaBR),G=v.setGameObject(u),z=0,W=0,k=0,J=0,Q=u.letterSpacing,Y,K=0,U=0,V,j=u.scrollX,$=u.scrollY,q=u.fontData,it=q.chars,nt=q.lineHeight,et=u.fontSize/q.size,ht=0,ut=u._align,dt=0,mt=0,gt=u.getTextBounds(!1);u.maxWidth>0&&(c=gt.wrappedText,d=c.length);var At=u._bounds.lines;ut===1?mt=(At.longest-At.lengths[0])/2:ut===2&&(mt=At.longest-At.lengths[0]);for(var ot=f.roundPixels,st=u.displayCallback,yt=u.callbackData,Tt=0;Tt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(45319),h=t(31401),o=t(95643),l=t(53048),n=t(61327),u=t(21859),f=t(87841),s=t(18658),c=new r({Extends:o,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Texture,h.Tint,h.Transform,h.Visible,s],initialize:function(v,m,S,M,A,C,w){A===void 0&&(A=""),w===void 0&&(w=0),o.call(this,v,"BitmapText"),this.font=M;var P=this.scene.sys.cache.bitmapFont.get(M);P||console.warn("Invalid BitmapText key: "+M),this.fontData=P.data,this._text="",this._fontSize=C||this.fontData.size,this._letterSpacing=0,this._lineSpacing=0,this._align=w,this._bounds=l(),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(m,S),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(),this.setText(A)},setLeftAlign:function(){return this._align=c.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=c.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=c.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(d){return this._fontSize=d,this._dirty=!0,this},setLetterSpacing:function(d){return d===void 0&&(d=0),this._letterSpacing=d,this._dirty=!0,this},setLineSpacing:function(d){return d===void 0&&(d=0),this.lineSpacing=d,this},setText:function(d){return!d&&d!==0&&(d=""),Array.isArray(d)&&(d=d.join(` -`)),d!==this.text&&(this._text=d.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=.5),this.dropShadowX=d,this.dropShadowY=v,this.dropShadowColor=m,this.dropShadowAlpha=S,this},setCharacterTint:function(d,v,m,S,M,A,C){d===void 0&&(d=0),v===void 0&&(v=1),m===void 0&&(m=!1),S===void 0&&(S=-1),M===void 0&&(M=S,A=S,C=S);var w=this.text.length;v===-1&&(v=w),d<0&&(d=w+d),d=p(d,0,w-1);for(var P=p(d+v,d,w),L=this.charColors,O=d;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20926),p=function(h,o,l,n){var u=o._text,f=u.length,s=h.currentContext;if(!(f===0||!r(h,s,o,l,n))){l.addToRenderList(o);var c=o.fromAtlas?o.frame:o.texture.frames.__BASE,d=o.fontData.chars,v=o.fontData.lineHeight,m=o._letterSpacing,S=o._lineSpacing,M=0,A=0,C=0,w=null,P=0,L=0,O=0,I=0,D=0,B=0,G=null,z=0,W=c.source.image,k=c.cutX,J=c.cutY,Q=o._fontSize/o.fontData.size,Y=o._align,K=0,U=0,V=o.getTextBounds(!1);o.maxWidth>0&&(u=V.wrappedText,f=u.length);var j=o._bounds.lines;Y===1?U=(j.longest-j.lengths[0])/2:Y===2&&(U=j.longest-j.lengths[0]),s.translate(-o.displayOriginX,-o.displayOriginY);for(var $=l.roundPixels,q=0;q{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22186),p=t(25305),h=t(44603),o=t(23568),l=t(35154);h.register("bitmapText",function(n,u){n===void 0&&(n={});var f=l(n,"font",""),s=o(n,"text",""),c=o(n,"size",!1),d=l(n,"align",0),v=new r(this.scene,0,0,f,s,c,d);return u!==void 0&&(n.add=u),p(this.scene,v,n),v})},34914:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22186),p=t(39429);p.register("bitmapText",function(h,o,l,n,u,f){return this.displayList.add(new r(this.scene,h,o,l,n,u,f))})},18658:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(33590),h=t(37289),a.exports={renderWebGL:p,renderCanvas:h}},33590:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(3217),p=t(91296),h=t(70554),o=function(l,n,u,f){var s=n._text,c=s.length;if(c!==0){u.addToRenderList(n);var d=l.pipelines.set(n.pipeline,n),v=p(n,u,f).calc;l.pipelines.preBatch(n);var m=u.roundPixels,S=u.alpha,M=n.charColors,A=n.tintFill,C=h.getTintAppendFloatAlpha,w=C(n.tintTopLeft,S*n._alphaTL),P=C(n.tintTopRight,S*n._alphaTR),L=C(n.tintBottomLeft,S*n._alphaBL),O=C(n.tintBottomRight,S*n._alphaBR),I=n.frame.glTexture,D=d.setGameObject(n),B=n.getTextBounds(!1),G,z,W,k=B.characters,J=n.dropShadowX,Q=n.dropShadowY,Y=J!==0||Q!==0;if(Y){var K=n.dropShadowColor,U=n.dropShadowAlpha,V=C(K,S*U*n._alphaTL),j=C(K,S*U*n._alphaTR),$=C(K,S*U*n._alphaBL),q=C(K,S*U*n._alphaBR);for(G=0;G{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(48011),p=t(46590),h=t(83419),o=t(31401),l=t(4327),n=t(95643),u=t(73162),f=new h({Extends:n,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,r],initialize:function(c,d,v,m,S){n.call(this,c,"Blitter"),this.setTexture(m,S),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(),this.children=new u,this.renderList=[],this.dirty=!1},create:function(s,c,d,v,m){v===void 0&&(v=!0),m===void 0&&(m=this.children.length),d===void 0?d=this.frame:d instanceof l||(d=this.texture.get(d));var S=new p(this,s,c,d,v);return this.children.addAt(S,m,!1),this.dirty=!0,S},createFromCallback:function(s,c,d,v){for(var m=this.createMultiple(c,d,v),S=0;S0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});a.exports=f},72396:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=r.getRenderList();if(o.length!==0){var l=t.currentContext,n=p.alpha*r.alpha;if(n!==0){p.addToRenderList(r),l.globalCompositeOperation=t.blendModes[r.blendMode],l.imageSmoothingEnabled=!r.frame.source.scaleMode;var u=r.x-p.scrollX*r.scrollFactorX,f=r.y-p.scrollY*r.scrollFactorY;l.save(),h&&h.copyToContext(l);for(var s=p.roundPixels,c=0;c0&&S.height>0&&(l.save(),l.translate(d.x+u,d.y+f),l.scale(C,w),l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M,A,S.width,S.height),l.restore())):(s&&(M=Math.round(M),A=Math.round(A)),S.width>0&&S.height>0&&l.drawImage(m.source.image,S.x,S.y,S.width,S.height,M+d.x+u,A+d.y+f,S.width,S.height)))}l.restore()}}};a.exports=y},9403:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6107),p=t(25305),h=t(44603),o=t(23568);h.register("blitter",function(l,n){l===void 0&&(l={});var u=o(l,"key",null),f=o(l,"frame",null),s=new r(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),p(this.scene,s,l),s})},12709:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6107),p=t(39429);p.register("blitter",function(h,o,l,n){return this.displayList.add(new r(this.scene,h,o,l,n))})},48011:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(99485),h=t(72396),a.exports={renderWebGL:p,renderCanvas:h}},99485:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61340),p=t(70554),h=new r,o=function(l,n,u,f){var s=n.getRenderList(),c=u.alpha*n.alpha;if(!(s.length===0||c===0)){u.addToRenderList(n);var d=l.pipelines.set(this.pipeline,n),v=u.scrollX*n.scrollFactorX,m=u.scrollY*n.scrollFactorY,S=h.copyFrom(u.matrix);f&&(S.multiplyWithOffset(f,-v,-m),v=0,m=0);var M=n.x-v,A=n.y-m,C=-1,w=!1;l.pipelines.preBatch(n);for(var P=0;P{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(4327),h=new r({initialize:function(l,n,u,f,s){this.parent=l,this.x=n,this.y=u,this.frame=f,this.data={},this.tint=16777215,this._visible=s,this._alpha=1,this.flipX=!1,this.flipY=!1,this.hasTransformComponent=!0},setFrame:function(o){return o===void 0?this.frame=this.parent.frame:o instanceof p&&o.texture===this.parent.texture?this.frame=o:this.frame=this.parent.texture.get(o),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(o,l,n){return this.x=o,this.y=l,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,n&&this.setFrame(n),this},setPosition:function(o,l){return this.x=o,this.y=l,this},setFlipX:function(o){return this.flipX=o,this},setFlipY:function(o){return this.flipY=o,this},setFlip:function(o,l){return this.flipX=o,this.flipY=l,this},setVisible:function(o){return this.visible=o,this},setAlpha:function(o){return this.alpha=o,this},setTint:function(o){return this.tint=o,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(o){this.parent.dirty|=this._visible!==o,this._visible=o}},alpha:{get:function(){return this._alpha},set:function(o){this.parent.dirty|=this._alpha>0!=o>0,this._alpha=o}}});a.exports=h},16005:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=2,h={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(o,l,n,u){return o===void 0&&(o=1),l===void 0?this.alpha=o:(this._alphaTL=r(o,0,1),this._alphaTR=r(l,0,1),this._alphaBL=r(n,0,1),this._alphaBR=r(u,0,1)),this},alpha:{get:function(){return this._alpha},set:function(o){var l=r(o,0,1);this._alpha=l,this._alphaTL=l,this._alphaTR=l,this._alphaBL=l,this._alphaBR=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(o){var l=r(o,0,1);this._alphaTL=l,l!==0&&(this.renderFlags|=p)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(o){var l=r(o,0,1);this._alphaTR=l,l!==0&&(this.renderFlags|=p)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(o){var l=r(o,0,1);this._alphaBL=l,l!==0&&(this.renderFlags|=p)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(o){var l=r(o,0,1);this._alphaBR=l,l!==0&&(this.renderFlags|=p)}}};a.exports=h},88509:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=2,h={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(o){return o===void 0&&(o=1),this.alpha=o,this},alpha:{get:function(){return this._alpha},set:function(o){var l=r(o,0,1);this._alpha=l,l===0?this.renderFlags&=~p:this.renderFlags|=p}}};a.exports=h},90065:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p={_blendMode:r.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(h){typeof h=="string"&&(h=r[h]),h|=0,h>=-1&&(this._blendMode=h)}},setBlendMode:function(h){return this.blendMode=h,this}};a.exports=p},94215:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,r){return this.width=t,this.height=r,this},setDisplaySize:function(t,r){return this.displayWidth=t,this.displayHeight=r,this}};a.exports=y},61683:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={texture:null,frame:null,isCropped:!1,setCrop:function(t,r,p,h){if(t===void 0)this.isCropped=!1;else if(this.frame){if(typeof t=="number")this.frame.setCropUVs(this._crop,t,r,p,h,this.flipX,this.flipY);else{var o=t;this.frame.setCropUVs(this._crop,o.x,o.y,o.width,o.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};a.exports=y},89272:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return t===void 0&&(t=0),this.depth=t,this}};a.exports=y},47059:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(66064),h=t(19133),o=new r({initialize:function(n,u){this.gameObject=n,this.isPost=u,this.enabled=!1,this.list=[],this.padding=0},setPadding:function(l){return l===void 0&&(l=0),this.padding=l,this.gameObject},onFXCopy:function(){},onFX:function(){},enable:function(l){if(!this.isPost){var n=this.gameObject.scene.sys.renderer;n&&n.pipelines?(this.gameObject.pipeline=n.pipelines.FX_PIPELINE,l!==void 0&&(this.padding=l),this.enabled=!0):this.enabled=!1}},clear:function(){if(this.isPost)this.gameObject.resetPostPipeline(!0);else{for(var l=this.list,n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,r){return this.flipX=t,this.flipY=r,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}};a.exports=y},8004:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=t(11520),h=t(26099),o={prepareBoundsOutput:function(l,n){if(n===void 0&&(n=!1),this.rotation!==0&&p(l,this.x,this.y,this.rotation),n&&this.parentContainer){var u=this.parentContainer.getBoundsTransformMatrix();u.transformPoint(l.x,l.y,l)}return l},getCenter:function(l,n){return l===void 0&&(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getTopLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getTopRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(l,n)},getLeftCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getRightCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(l,n)},getBottomLeft:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomCenter:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBottomRight:function(l,n){return l||(l=new h),l.x=this.x-this.displayWidth*this.originX+this.displayWidth,l.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(l,n)},getBounds:function(l){l===void 0&&(l=new r);var n,u,f,s,c,d,v,m;if(this.parentContainer){var S=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(l),S.transformPoint(l.x,l.y,l),n=l.x,u=l.y,this.getTopRight(l),S.transformPoint(l.x,l.y,l),f=l.x,s=l.y,this.getBottomLeft(l),S.transformPoint(l.x,l.y,l),c=l.x,d=l.y,this.getBottomRight(l),S.transformPoint(l.x,l.y,l),v=l.x,m=l.y}else this.getTopLeft(l),n=l.x,u=l.y,this.getTopRight(l),f=l.x,s=l.y,this.getBottomLeft(l),c=l.x,d=l.y,this.getBottomRight(l),v=l.x,m=l.y;return l.x=Math.min(n,f,c,v),l.y=Math.min(u,s,d,m),l.width=Math.max(n,f,c,v)-l.x,l.height=Math.max(u,s,d,m)-l.y,l}};a.exports=o},8573:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6858),p=t(80661),h={mask:null,setMask:function(o){return this.mask=o,this},clearMask:function(o){return o===void 0&&(o=!1),o&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(o,l,n,u,f){return o===void 0&&(this.texture||this.shader||this.geom)&&(o=this),new r(this.scene,o,l,n,u,f)},createGeometryMask:function(o){return o===void 0&&(this.type==="Graphics"||this.geom)&&(o=this),new p(this.scene,o)}};a.exports=h},27387:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,r){return t===void 0&&(t=.5),r===void 0&&(r=t),this.originX=t,this.originY=r,this.updateDisplayOrigin()},setOriginFromFrame:function(){return!this.frame||!this.frame.customPivot?this.setOrigin():(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin())},setDisplayOrigin:function(t,r){return t===void 0&&(t=0),r===void 0&&(r=t),this.displayOriginX=t,this.displayOriginY=r,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};a.exports=y},37640:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39506),p=t(57355),h=t(35154),o=t(86353),l=t(26099),n={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(u,f){f===void 0&&(f=this.pathConfig);var s=this.pathTween;return s&&s.isPlaying()&&s.stop(),this.path=u,f&&this.startFollow(f),this},setRotateToPath:function(u,f){return f===void 0&&(f=0),this.rotateToPath=u,this.pathRotationOffset=f,this},isFollowing:function(){var u=this.pathTween;return u&&u.isPlaying()},startFollow:function(u,f){u===void 0&&(u={}),f===void 0&&(f=0);var s=this.pathTween;s&&s.isPlaying()&&s.stop(),typeof u=="number"&&(u={duration:u}),u.from=h(u,"from",0),u.to=h(u,"to",1);var c=p(u,"positionOnPath",!1);this.rotateToPath=p(u,"rotateToPath",!1),this.pathRotationOffset=h(u,"rotationOffset",0);var d=h(u,"startAt",f);if(d&&(u.onStart=function(m){var S=m.data[0];S.progress=d,S.elapsed=S.duration*d;var M=S.ease(S.progress);S.current=S.start+(S.end-S.start)*M,S.setTargetValue()}),this.pathOffset||(this.pathOffset=new l(this.x,this.y)),this.pathVector||(this.pathVector=new l),this.pathDelta||(this.pathDelta=new l),this.pathDelta.reset(),u.persist=!0,this.pathTween=this.scene.sys.tweens.addCounter(u),this.path.getStartPoint(this.pathOffset),c&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var v=this.path.getPoint(.1);this.rotation=Math.atan2(v.y-this.y,v.x-this.x)+r(this.pathRotationOffset)}return this.pathConfig=u,this},pauseFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.pause(),this},resumeFollow:function(){var u=this.pathTween;return u&&u.isPaused()&&u.resume(),this},stopFollow:function(){var u=this.pathTween;return u&&u.isPlaying()&&u.stop(),this},pathUpdate:function(){var u=this.pathTween;if(u&&u.data){var f=u.data[0],s=this.pathDelta,c=this.pathVector;if(s.copy(c).negate(),f.state===o.COMPLETE){this.path.getPoint(f.end,c),s.add(c),c.add(this.pathOffset),this.setPosition(c.x,c.y);return}else if(f.state!==o.PLAYING_FORWARD&&f.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(u.getValue(),c),s.add(c),c.add(this.pathOffset);var d=this.x,v=this.y;this.setPosition(c.x,c.y);var m=this.x-d,S=this.y-v;if(m===0&&S===0)return;if(f.state!==this._prevDirection){this._prevDirection=f.state;return}this.rotateToPath&&(this.rotation=Math.atan2(S,m)+r(this.pathRotationOffset))}}};a.exports=n},72699:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62644),p={defaultPipeline:null,pipeline:null,pipelineData:null,initPipeline:function(h){this.pipelineData={};var o=this.scene.sys.renderer;if(!o)return!1;var l=o.pipelines;if(l){h===void 0&&(h=l.default);var n=l.get(h);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(h,o,l){var n=this.scene.sys.renderer;if(!n)return this;var u=n.pipelines;if(u){var f=u.get(h);f&&(this.pipeline=f),o&&(this.pipelineData=l?r(o):o)}return this},setPipelineData:function(h,o){var l=this.pipelineData;return o===void 0?delete l[h]:l[h]=o,this},resetPipeline:function(h){return h===void 0&&(h=!1),this.pipeline=this.defaultPipeline,h&&(this.pipelineData={}),this.pipeline!==null},getPipelineName:function(){return this.pipeline.name}};a.exports=p},17581:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62644),p=t(47059),h=t(19133),o={hasPostPipeline:!1,postPipelines:null,postPipelineData:null,preFX:null,postFX:null,initPostPipeline:function(l){this.postPipelines=[],this.postPipelineData={},this.postFX=new p(this,!0),l&&(this.preFX=new p(this,!1))},setPostPipeline:function(l,n,u){var f=this.scene.sys.renderer;if(!f)return this;var s=f.pipelines;if(s){Array.isArray(l)||(l=[l]);for(var c=0;c0,this},setPostPipelineData:function(l,n){var u=this.postPipelineData;return n===void 0?delete u[l]:u[l]=n,this},getPostPipeline:function(l){for(var n=typeof l=="string",u=this.postPipelines,f=[],s=0;s=0;f--){var s=u[f];(n&&s.name===l||!n&&s===l)&&(s.destroy(),h(u,f))}return this.hasPostPipeline=this.postPipelines.length>0,this},clearFX:function(){return this.preFX&&this.preFX.clear(),this.postFX&&this.postFX.clear(),this}};a.exports=o},80227:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,r){return r===void 0&&(r=t),this.scrollFactorX=t,this.scrollFactorY=r,this}};a.exports=y},16736:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){t||(t=this.frame),this.width=t.realWidth,this.height=t.realHeight;var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=this.width,r.hitArea.height=this.height),this},setSize:function(t,r){return this.width=t,this.height=r,this},setDisplaySize:function(t,r){return this.displayWidth=t,this.displayHeight=r,this}};a.exports=y},37726:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(4327),p=8,h={texture:null,frame:null,isCropped:!1,setTexture:function(o,l,n,u){return this.texture=this.scene.sys.textures.get(o),this.setFrame(l,n,u)},setFrame:function(o,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),o instanceof r?(this.texture=this.scene.sys.textures.get(o.texture.key),this.frame=o):this.frame=this.texture.get(o),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};a.exports=h},79812:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(4327),p=8,h={texture:null,frame:null,isCropped:!1,setCrop:function(o,l,n,u){if(o===void 0)this.isCropped=!1;else if(this.frame){if(typeof o=="number")this.frame.setCropUVs(this._crop,o,l,n,u,this.flipX,this.flipY);else{var f=o;this.frame.setCropUVs(this._crop,f.x,f.y,f.width,f.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(o,l){return this.texture=this.scene.sys.textures.get(o),this.setFrame(l)},setFrame:function(o,l,n){return l===void 0&&(l=!0),n===void 0&&(n=!0),o instanceof r?(this.texture=this.scene.sys.textures.get(o.texture.key),this.frame=o):this.frame=this.texture.get(o),!this.frame.cutWidth||!this.frame.cutHeight?this.renderFlags&=~p:this.renderFlags|=p,this._sizeComponent&&l&&this.setSizeToFrame(),this._originComponent&&n&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};a.exports=h},27472:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,r,p,h){return t===void 0&&(t=16777215),r===void 0&&(r=t,p=t,h=t),this.tintTopLeft=t,this.tintTopRight=r,this.tintBottomLeft=p,this.tintBottomRight=h,this.tintFill=!1,this},setTintFill:function(t,r,p,h){return this.setTint(t,r,p,h),this.tintFill=!0,this},tint:{get:function(){return this.tintTopLeft},set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){var t=16777215;return this.tintFill||this.tintTopLeft!==t||this.tintTopRight!==t||this.tintBottomLeft!==t||this.tintBottomRight!==t}}};a.exports=y},53774:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(r.textureKey=t.texture.key,r.frameKey=t.frame.name),r};a.exports=y},16901:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(61340),h=t(85955),o=t(86554),l=t(30954),n=t(26099),u=4,f={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&=~u:this.renderFlags|=u}},scaleX:{get:function(){return this._scaleX},set:function(s){this._scaleX=s,s===0?this.renderFlags&=~u:this._scaleY!==0&&(this.renderFlags|=u)}},scaleY:{get:function(){return this._scaleY},set:function(s){this._scaleY=s,s===0?this.renderFlags&=~u:this._scaleX!==0&&(this.renderFlags|=u)}},angle:{get:function(){return l(this._rotation*r.RAD_TO_DEG)},set:function(s){this.rotation=l(s)*r.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(s){this._rotation=o(s)}},setPosition:function(s,c,d,v){return s===void 0&&(s=0),c===void 0&&(c=s),d===void 0&&(d=0),v===void 0&&(v=0),this.x=s,this.y=c,this.z=d,this.w=v,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,c,d,v){return s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=this.scene.sys.scale.width),v===void 0&&(v=this.scene.sys.scale.height),this.x=s+Math.random()*d,this.y=c+Math.random()*v,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,c){return s===void 0&&(s=1),c===void 0&&(c=s),this.scaleX=s,this.scaleY=c,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 p),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(s,c){s===void 0&&(s=new p);var d=this.parentContainer;if(!d)return this.getLocalTransformMatrix(s);for(c||(c=new p),s.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);d;)c.applyITRS(d.x,d.y,d._rotation,d._scaleX,d._scaleY),c.multiply(s,s),d=d.parentContainer;return s},getLocalPoint:function(s,c,d,v){d||(d=new n),v||(v=this.scene.sys.cameras.main);var m=v.scrollX,S=v.scrollY,M=s+m*this.scrollFactorX-m,A=c+S*this.scrollFactorY-S;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(M,A,d):h(M,A,this.x,this.y,this.rotation,this.scaleX,this.scaleY,d),this._originComponent&&(d.x+=this._displayOriginX,d.y+=this._displayOriginY),d},getParentRotation:function(){for(var s=0,c=this.parentContainer;c;)s+=c.rotation,c=c.parentContainer;return s}};a.exports=f},61340:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(36383),h=t(26099),o=new r({initialize:function(n,u,f,s,c,d){n===void 0&&(n=1),u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=1),c===void 0&&(c=0),d===void 0&&(d=0),this.matrix=new Float32Array([n,u,f,s,c,d,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(l){this.matrix[0]=l}},b:{get:function(){return this.matrix[1]},set:function(l){this.matrix[1]=l}},c:{get:function(){return this.matrix[2]},set:function(l){this.matrix[2]=l}},d:{get:function(){return this.matrix[3]},set:function(l){this.matrix[3]=l}},e:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},f:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},tx:{get:function(){return this.matrix[4]},set:function(l){this.matrix[4]=l}},ty:{get:function(){return this.matrix[5]},set:function(l){this.matrix[5]=l}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],s=l[3];return n||u?u>0?Math.acos(n/this.scaleX):-Math.acos(n/this.scaleX):f||s?p.TAU-(s>0?Math.acos(-f/this.scaleY):-Math.acos(f/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 l=this.matrix;return l[0]=1,l[1]=0,l[2]=0,l[3]=1,l[4]=0,l[5]=0,this},translate:function(l,n){var u=this.matrix;return u[4]=u[0]*l+u[2]*n+u[4],u[5]=u[1]*l+u[3]*n+u[5],this},scale:function(l,n){var u=this.matrix;return u[0]*=l,u[1]*=l,u[2]*=n,u[3]*=n,this},rotate:function(l){var n=Math.sin(l),u=Math.cos(l),f=this.matrix,s=f[0],c=f[1],d=f[2],v=f[3];return f[0]=s*u+d*n,f[1]=c*u+v*n,f[2]=s*-n+d*u,f[3]=c*-n+v*u,this},multiply:function(l,n){var u=this.matrix,f=l.matrix,s=u[0],c=u[1],d=u[2],v=u[3],m=u[4],S=u[5],M=f[0],A=f[1],C=f[2],w=f[3],P=f[4],L=f[5],O=n===void 0?u:n.matrix;return O[0]=M*s+A*d,O[1]=M*c+A*v,O[2]=C*s+w*d,O[3]=C*c+w*v,O[4]=P*s+L*d+m,O[5]=P*c+L*v+S,O},multiplyWithOffset:function(l,n,u){var f=this.matrix,s=l.matrix,c=f[0],d=f[1],v=f[2],m=f[3],S=f[4],M=f[5],A=n*c+u*v+S,C=n*d+u*m+M,w=s[0],P=s[1],L=s[2],O=s[3],I=s[4],D=s[5];return f[0]=w*c+P*v,f[1]=w*d+P*m,f[2]=L*c+O*v,f[3]=L*d+O*m,f[4]=I*c+D*v+A,f[5]=I*d+D*m+C,this},transform:function(l,n,u,f,s,c){var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],A=d[4],C=d[5];return d[0]=l*v+n*S,d[1]=l*m+n*M,d[2]=u*v+f*S,d[3]=u*m+f*M,d[4]=s*v+c*S+A,d[5]=s*m+c*M+C,this},transformPoint:function(l,n,u){u===void 0&&(u={x:0,y:0});var f=this.matrix,s=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5];return u.x=l*s+n*d+m,u.y=l*c+n*v+S,u},invert:function(){var l=this.matrix,n=l[0],u=l[1],f=l[2],s=l[3],c=l[4],d=l[5],v=n*s-u*f;return l[0]=s/v,l[1]=-u/v,l[2]=-f/v,l[3]=n/v,l[4]=(f*d-s*c)/v,l[5]=-(n*d-u*c)/v,this},copyFrom:function(l){var n=this.matrix;return n[0]=l.a,n[1]=l.b,n[2]=l.c,n[3]=l.d,n[4]=l.e,n[5]=l.f,this},copyFromArray:function(l){var n=this.matrix;return n[0]=l[0],n[1]=l[1],n[2]=l[2],n[3]=l[3],n[4]=l[4],n[5]=l[5],this},copyToContext:function(l){var n=this.matrix;return l.transform(n[0],n[1],n[2],n[3],n[4],n[5]),l},setToContext:function(l){return l.setTransform(this),l},copyToArray:function(l){var n=this.matrix;return l===void 0?l=[n[0],n[1],n[2],n[3],n[4],n[5]]:(l[0]=n[0],l[1]=n[1],l[2]=n[2],l[3]=n[3],l[4]=n[4],l[5]=n[5]),l},setTransform:function(l,n,u,f,s,c){var d=this.matrix;return d[0]=l,d[1]=n,d[2]=u,d[3]=f,d[4]=s,d[5]=c,this},decomposeMatrix:function(){var l=this.decomposedMatrix,n=this.matrix,u=n[0],f=n[1],s=n[2],c=n[3],d=u*c-f*s;if(l.translateX=n[4],l.translateY=n[5],u||f){var v=Math.sqrt(u*u+f*f);l.rotation=f>0?Math.acos(u/v):-Math.acos(u/v),l.scaleX=v,l.scaleY=d/v}else if(s||c){var m=Math.sqrt(s*s+c*c);l.rotation=Math.PI*.5-(c>0?Math.acos(-s/m):-Math.acos(s/m)),l.scaleX=d/m,l.scaleY=m}else l.rotation=0,l.scaleX=0,l.scaleY=0;return l},applyITRS:function(l,n,u,f,s){var c=this.matrix,d=Math.sin(u),v=Math.cos(u);return c[4]=l,c[5]=n,c[0]=v*f,c[1]=d*f,c[2]=-d*s,c[3]=v*s,this},applyInverse:function(l,n,u){u===void 0&&(u=new h);var f=this.matrix,s=f[0],c=f[1],d=f[2],v=f[3],m=f[4],S=f[5],M=1/(s*v+d*-c);return u.x=v*M*l+-d*M*n+(S*d-m*v)*M,u.y=s*M*n+-c*M*l+(-S*s+m*c)*M,u},setQuad:function(l,n,u,f,s,c){s===void 0&&(s=!1),c===void 0&&(c=this.quad);var d=this.matrix,v=d[0],m=d[1],S=d[2],M=d[3],A=d[4],C=d[5];return s?(c[0]=Math.round(l*v+n*S+A),c[1]=Math.round(l*m+n*M+C),c[2]=Math.round(l*v+f*S+A),c[3]=Math.round(l*m+f*M+C),c[4]=Math.round(u*v+f*S+A),c[5]=Math.round(u*m+f*M+C),c[6]=Math.round(u*v+n*S+A),c[7]=Math.round(u*m+n*M+C)):(c[0]=l*v+n*S+A,c[1]=l*m+n*M+C,c[2]=l*v+f*S+A,c[3]=l*m+f*M+C,c[4]=u*v+f*S+A,c[5]=u*m+f*M+C,c[6]=u*v+n*S+A,c[7]=u*m+n*M+C),c},getX:function(l,n){return l*this.a+n*this.c+this.e},getY:function(l,n){return l*this.b+n*this.d+this.f},getXRound:function(l,n,u){var f=this.getX(l,n);return u&&(f=Math.round(f)),f},getYRound:function(l,n,u){var f=this.getY(l,n);return u&&(f=Math.round(f)),f},getCSSMatrix:function(){var l=this.matrix;return"matrix("+l[0]+","+l[1]+","+l[2]+","+l[3]+","+l[4]+","+l[5]+")"},destroy:function(){this.matrix=null,this.quad=null,this.decomposedMatrix=null}});a.exports=o},59715:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=1,t={_visible:!0,visible:{get:function(){return this._visible},set:function(r){r?(this._visible=!0,this.renderFlags|=y):(this._visible=!1,this.renderFlags&=~y)}},setVisible:function(r){return this.visible=r,this}};a.exports=t},31401:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Alpha:t(16005),AlphaSingle:t(88509),BlendMode:t(90065),ComputedSize:t(94215),Crop:t(61683),Depth:t(89272),Flip:t(54434),FX:t(47059),GetBounds:t(8004),Mask:t(8573),Origin:t(27387),PathFollower:t(37640),Pipeline:t(72699),PostPipeline:t(17581),ScrollFactor:t(80227),Size:t(16736),Texture:t(37726),TextureCrop:t(79812),Tint:t(27472),ToJSON:t(53774),Transform:t(16901),TransformMatrix:t(61340),Visible:t(59715)}},31559:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37105),p=t(10312),h=t(83419),o=t(31401),l=t(51708),n=t(95643),u=t(87841),f=t(29959),s=t(36899),c=t(26099),d=new h({Extends:n,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.PostPipeline,o.Transform,o.Visible,f],initialize:function(m,S,M,A){n.call(this,m,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=m.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPostPipeline(),this.setPosition(S,M),this.setBlendMode(p.SKIP_CHECK),A&&this.add(A)},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(v){return v===void 0&&(v=!0),this.exclusive=v,this},getBounds:function(v){if(v===void 0&&(v=new u),v.setTo(this.x,this.y,0,0),this.parentContainer){var m=this.parentContainer.getBoundsTransformMatrix(),S=m.transformPoint(this.x,this.y);v.setTo(S.x,S.y,0,0)}if(this.list.length>0){var M=this.list,A=new u,C=!1;v.setEmpty();for(var w=0;w-1},setAll:function(v,m,S,M){return r.SetAll(this.list,v,m,S,M),this},each:function(v,m){var S=[null],M,A=this.list.slice(),C=A.length;for(M=2;M0?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(v){r.Remove(this.list,v),this.exclusive&&(v.parentContainer=null,v.removedFromScene())}});a.exports=d},53584:a=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r);var o=r.list;if(o.length!==0){var l=r.localTransform;h?(l.loadIdentity(),l.multiply(h),l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.scaleX,r.scaleY)):l.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY);var n=r.blendMode!==-1;n||t.setBlendMode(0);var u=r._alpha,f=r.scrollFactorX,s=r.scrollFactorY;r.mask&&r.mask.preRenderCanvas(t,null,p);for(var c=0;c{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(31559),h=t(44603),o=t(23568),l=t(95540);h.register("container",function(n,u){n===void 0&&(n={});var f=o(n,"x",0),s=o(n,"y",0),c=l(n,"children",null),d=new p(this.scene,f,s,c);return u!==void 0&&(n.add=u),r(this.scene,d,n),d})},24961:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(31559),p=t(39429);p.register("container",function(h,o,l){return this.displayList.add(new r(this.scene,h,o,l))})},29959:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(72249),h=t(53584),a.exports={renderWebGL:p,renderCanvas:h}},72249:a=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r);var o=r.list,l=o.length;if(l!==0){var n=r.localTransform;h?(n.loadIdentity(),n.multiply(h),n.translate(r.x,r.y),n.rotate(r.rotation),n.scale(r.scaleX,r.scaleY)):n.applyITRS(r.x,r.y,r.rotation,r.scaleX,r.scaleY),t.pipelines.preBatch(r);var u=r.blendMode!==-1;u||t.setBlendMode(0);for(var f=r.alpha,s=r.scrollFactorX,c=r.scrollFactorY,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},3069:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(441),o=t(95643),l=t(41212),n=t(35846),u=t(44594),f=t(61369),s=new r({Extends:o,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Origin,p.ScrollFactor,p.Transform,p.Visible,h],initialize:function(d,v,m,S,M,A){o.call(this,d,"DOMElement"),this.parent=d.sys.game.domContainer,this.cache=d.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new f,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(v,m),typeof S=="string"?S[0]==="#"?this.setElement(S.substr(1),M,A):this.createElement(S,M,A):S&&this.setElement(S,M,A),d.sys.events.on(u.SLEEP,this.handleSceneEvent,this),d.sys.events.on(u.WAKE,this.handleSceneEvent,this),d.sys.events.on(u.PRE_RENDER,this.preRender,this)},handleSceneEvent:function(c){var d=this.node,v=d.style;d&&(v.display=c.settings.visible?"block":"none")},setSkew:function(c,d){return c===void 0&&(c=0),d===void 0&&(d=c),this.skewX=c,this.skewY=d,this},setPerspective:function(c){return this.parent.style.perspective=c+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(c){this.parent.style.perspective=c+"px"}},addListener:function(c){if(this.node){c=c.split(" ");for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(47407),p=t(95643),h=t(61340),o=new h,l=new h,n=new h,u=function(f,s,c,d){if(s.node){var v=s.node.style,m=s.scene.sys.settings;if(!v||!m.visible||p.RENDER_MASK!==s.renderFlags||s.cameraFilter!==0&&s.cameraFilter&c.id||s.parentContainer&&!s.parentContainer.willRender()){v.display="none";return}var S=s.parentContainer,M=c.alpha*s.alpha;S&&(M*=S.alpha);var A=o,C=l,w=n,P=0,L=0,O="0%",I="0%";d?(P=s.width*s.scaleX*s.originX,L=s.height*s.scaleY*s.originY,C.applyITRS(s.x-P,s.y-L,s.rotation,s.scaleX,s.scaleY),A.copyFrom(c.matrix),A.multiplyWithOffset(d,-c.scrollX*s.scrollFactorX,-c.scrollY*s.scrollFactorY),C.e=s.x-P,C.f=s.y-L,A.multiply(C,w)):(P=s.width*s.originX,L=s.height*s.originY,C.applyITRS(s.x-P,s.y-L,s.rotation,s.scaleX,s.scaleY),A.copyFrom(c.matrix),O=100*s.originX+"%",I=100*s.originY+"%",C.e-=c.scrollX*s.scrollFactorX,C.f-=c.scrollY*s.scrollFactorY,A.multiply(C,w)),s.transformOnly||(v.display="block",v.opacity=M,v.zIndex=s._depth,v.pointerEvents=s.pointerEvents,v.mixBlendMode=r[s._blendMode]),v.transform=w.getCSSMatrix()+" skew("+s.skewX+"rad, "+s.skewY+"rad) rotate3d("+s.rotate3d.x+","+s.rotate3d.y+","+s.rotate3d.z+","+s.rotate3d.w+s.rotate3dAngle+")",v.transformOrigin=O+" "+I}};a.exports=u},2611:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(3069),p=t(39429);p.register("dom",function(h,o,l,n,u){var f=new r(this.scene,h,o,l,n,u);return this.displayList.add(f),f})},441:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(49381),h=t(49381),a.exports={renderWebGL:p,renderCanvas:h}},62980:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="addedtoscene"},41337:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},44947:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="removedfromscene"},49358:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},35163:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="created"},97249:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="error"},19483:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="locked"},56059:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="loop"},26772:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="metadata"},64437:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="playing"},83411:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="play"},75780:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="seeked"},67799:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="seeking"},63500:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stalled"},55541:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stop"},53208:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="textureready"},4992:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="unlocked"},12:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="unsupported"},51708:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADDED_TO_SCENE:t(62980),DESTROY:t(41337),REMOVED_FROM_SCENE:t(44947),VIDEO_COMPLETE:t(49358),VIDEO_CREATED:t(35163),VIDEO_ERROR:t(97249),VIDEO_LOCKED:t(19483),VIDEO_LOOP:t(56059),VIDEO_METADATA:t(26772),VIDEO_PLAY:t(83411),VIDEO_PLAYING:t(64437),VIDEO_SEEKED:t(75780),VIDEO_SEEKING:t(67799),VIDEO_STALLED:t(63500),VIDEO_STOP:t(55541),VIDEO_TEXTURE:t(53208),VIDEO_UNLOCKED:t(4992),VIDEO_UNSUPPORTED:t(12)}},42421:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(95643),o=t(64993),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.Origin,p.ScrollFactor,p.Size,p.Texture,p.Tint,p.Transform,p.Visible,o],initialize:function(u){h.call(this,u,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});a.exports=l},70217:()=>{},56315:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(42421),p=t(39429);p.register("extern",function(){var h=new r(this.scene);return this.displayList.add(h),h})},64993:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(80287),h=t(70217),a.exports={renderWebGL:p,renderCanvas:h}},80287:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=function(h,o,l,n){h.pipelines.clear();var u=r(o,l,n).calc;o.render.call(o,h,l,u),h.pipelines.rebind()};a.exports=p},85592:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},43831:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(71911),p=t(83419),h=t(85592),o=t(31401),l=t(8497),n=t(95643),u=t(95540),f=t(35154),s=t(36383),c=t(84503),d=new p({Extends:n,Mixins:[o.AlphaSingle,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.PostPipeline,o.Transform,o.Visible,o.ScrollFactor,c],initialize:function(m,S){var M=f(S,"x",0),A=f(S,"y",0);n.call(this,m,"Graphics"),this.setPosition(M,A),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(S)},setDefaultStyles:function(v){return f(v,"lineStyle",null)&&(this.defaultStrokeWidth=f(v,"lineStyle.width",1),this.defaultStrokeColor=f(v,"lineStyle.color",16777215),this.defaultStrokeAlpha=f(v,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),f(v,"fillStyle",null)&&(this.defaultFillColor=f(v,"fillStyle.color",16777215),this.defaultFillAlpha=f(v,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(v,m,S){return S===void 0&&(S=1),this.commandBuffer.push(h.LINE_STYLE,v,m,S),this._lineWidth=v,this},fillStyle:function(v,m){return m===void 0&&(m=1),this.commandBuffer.push(h.FILL_STYLE,v,m),this},fillGradientStyle:function(v,m,S,M,A,C,w,P){return A===void 0&&(A=1),C===void 0&&(C=A),w===void 0&&(w=A),P===void 0&&(P=A),this.commandBuffer.push(h.GRADIENT_FILL_STYLE,A,C,w,P,v,m,S,M),this},lineGradientStyle:function(v,m,S,M,A,C){return C===void 0&&(C=1),this.commandBuffer.push(h.GRADIENT_LINE_STYLE,v,C,m,S,M,A),this},beginPath:function(){return this.commandBuffer.push(h.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(h.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(h.FILL_PATH),this},fill:function(){return this.commandBuffer.push(h.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(h.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(h.STROKE_PATH),this},fillCircleShape:function(v){return this.fillCircle(v.x,v.y,v.radius)},strokeCircleShape:function(v){return this.strokeCircle(v.x,v.y,v.radius)},fillCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,s.PI2),this.fillPath(),this},strokeCircle:function(v,m,S){return this.beginPath(),this.arc(v,m,S,0,s.PI2),this.strokePath(),this},fillRectShape:function(v){return this.fillRect(v.x,v.y,v.width,v.height)},strokeRectShape:function(v){return this.strokeRect(v.x,v.y,v.width,v.height)},fillRect:function(v,m,S,M){return this.commandBuffer.push(h.FILL_RECT,v,m,S,M),this},strokeRect:function(v,m,S,M){var A=this._lineWidth/2,C=v-A,w=v+A;return this.beginPath(),this.moveTo(v,m),this.lineTo(v,m+M),this.strokePath(),this.beginPath(),this.moveTo(v+S,m),this.lineTo(v+S,m+M),this.strokePath(),this.beginPath(),this.moveTo(C,m),this.lineTo(w+S,m),this.strokePath(),this.beginPath(),this.moveTo(C,m+M),this.lineTo(w+S,m+M),this.strokePath(),this},fillRoundedRect:function(v,m,S,M,A){A===void 0&&(A=20);var C=A,w=A,P=A,L=A;typeof A!="number"&&(C=u(A,"tl",20),w=u(A,"tr",20),P=u(A,"bl",20),L=u(A,"br",20));var O=C>=0,I=w>=0,D=P>=0,B=L>=0;return C=Math.abs(C),w=Math.abs(w),P=Math.abs(P),L=Math.abs(L),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-w,m),I?this.arc(v+S-w,m+w,w,-s.TAU,0):this.arc(v+S,m,w,Math.PI,s.TAU,!0),this.lineTo(v+S,m+M-L),B?this.arc(v+S-L,m+M-L,L,0,s.TAU):this.arc(v+S,m+M,L,-s.TAU,Math.PI,!0),this.lineTo(v+P,m+M),D?this.arc(v+P,m+M-P,P,s.TAU,Math.PI):this.arc(v,m+M,P,0,-s.TAU,!0),this.lineTo(v,m+C),O?this.arc(v+C,m+C,C,-Math.PI,-s.TAU):this.arc(v,m,C,s.TAU,0,!0),this.fillPath(),this},strokeRoundedRect:function(v,m,S,M,A){A===void 0&&(A=20);var C=A,w=A,P=A,L=A,O=Math.min(S,M)/2;typeof A!="number"&&(C=u(A,"tl",20),w=u(A,"tr",20),P=u(A,"bl",20),L=u(A,"br",20));var I=C>=0,D=w>=0,B=P>=0,G=L>=0;return C=Math.min(Math.abs(C),O),w=Math.min(Math.abs(w),O),P=Math.min(Math.abs(P),O),L=Math.min(Math.abs(L),O),this.beginPath(),this.moveTo(v+C,m),this.lineTo(v+S-w,m),this.moveTo(v+S-w,m),D?this.arc(v+S-w,m+w,w,-s.TAU,0):this.arc(v+S,m,w,Math.PI,s.TAU,!0),this.lineTo(v+S,m+M-L),this.moveTo(v+S,m+M-L),G?this.arc(v+S-L,m+M-L,L,0,s.TAU):this.arc(v+S,m+M,L,-s.TAU,Math.PI,!0),this.lineTo(v+P,m+M),this.moveTo(v+P,m+M),B?this.arc(v+P,m+M-P,P,s.TAU,Math.PI):this.arc(v,m+M,P,0,-s.TAU,!0),this.lineTo(v,m+C),this.moveTo(v,m+C),I?this.arc(v+C,m+C,C,-Math.PI,-s.TAU):this.arc(v,m,C,s.TAU,0,!0),this.strokePath(),this},fillPointShape:function(v,m){return this.fillPoint(v.x,v.y,m)},fillPoint:function(v,m,S){return!S||S<1?S=1:(v-=S/2,m-=S/2),this.commandBuffer.push(h.FILL_RECT,v,m,S,S),this},fillTriangleShape:function(v){return this.fillTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},strokeTriangleShape:function(v){return this.strokeTriangle(v.x1,v.y1,v.x2,v.y2,v.x3,v.y3)},fillTriangle:function(v,m,S,M,A,C){return this.commandBuffer.push(h.FILL_TRIANGLE,v,m,S,M,A,C),this},strokeTriangle:function(v,m,S,M,A,C){return this.commandBuffer.push(h.STROKE_TRIANGLE,v,m,S,M,A,C),this},strokeLineShape:function(v){return this.lineBetween(v.x1,v.y1,v.x2,v.y2)},lineBetween:function(v,m,S,M){return this.beginPath(),this.moveTo(v,m),this.lineTo(S,M),this.strokePath(),this},lineTo:function(v,m){return this.commandBuffer.push(h.LINE_TO,v,m),this},moveTo:function(v,m){return this.commandBuffer.push(h.MOVE_TO,v,m),this},strokePoints:function(v,m,S,M){m===void 0&&(m=!1),S===void 0&&(S=!1),M===void 0&&(M=v.length),this.beginPath(),this.moveTo(v[0].x,v[0].y);for(var A=1;A-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(v,m,S){var M=this.scene.sys,A=M.game.renderer;m===void 0&&(m=M.scale.width),S===void 0&&(S=M.scale.height),d.TargetCamera.setScene(this.scene),d.TargetCamera.setViewport(0,0,m,S),d.TargetCamera.scrollX=this.x,d.TargetCamera.scrollY=this.y;var C,w,P={willReadFrequently:!0};if(typeof v=="string")if(M.textures.exists(v)){C=M.textures.get(v);var L=C.getSourceImage();L instanceof HTMLCanvasElement&&(w=L.getContext("2d",P))}else C=M.textures.createCanvas(v,m,S),w=C.getSourceImage().getContext("2d",P);else v instanceof HTMLCanvasElement&&(w=v.getContext("2d",P));return w&&(this.renderCanvas(A,this,d.TargetCamera,null,w,!1),C&&C.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});d.TargetCamera=new r,a.exports=d},32768:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85592),p=t(20926),h=function(o,l,n,u,f,s){var c=l.commandBuffer,d=c.length,v=f||o.currentContext;if(!(d===0||!p(o,v,l,n,u))){n.addToRenderList(l);var m=1,S=1,M=0,A=0,C=1,w=0,P=0,L=0;v.beginPath();for(var O=0;O>>16,P=(M&65280)>>>8,L=M&255,v.strokeStyle="rgba("+w+","+P+","+L+","+m+")",v.lineWidth=C,O+=3;break;case r.FILL_STYLE:A=c[O+1],S=c[O+2],w=(A&16711680)>>>16,P=(A&65280)>>>8,L=A&255,v.fillStyle="rgba("+w+","+P+","+L+","+S+")",O+=2;break;case r.BEGIN_PATH:v.beginPath();break;case r.CLOSE_PATH:v.closePath();break;case r.FILL_PATH:s||v.fill();break;case r.STROKE_PATH:s||v.stroke();break;case r.FILL_RECT:s?v.rect(c[O+1],c[O+2],c[O+3],c[O+4]):v.fillRect(c[O+1],c[O+2],c[O+3],c[O+4]),O+=4;break;case r.FILL_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),s||v.fill(),O+=6;break;case r.STROKE_TRIANGLE:v.beginPath(),v.moveTo(c[O+1],c[O+2]),v.lineTo(c[O+3],c[O+4]),v.lineTo(c[O+5],c[O+6]),v.closePath(),s||v.stroke(),O+=6;break;case r.LINE_TO:v.lineTo(c[O+1],c[O+2]),O+=2;break;case r.MOVE_TO:v.moveTo(c[O+1],c[O+2]),O+=2;break;case r.LINE_FX_TO:v.lineTo(c[O+1],c[O+2]),O+=5;break;case r.MOVE_FX_TO:v.moveTo(c[O+1],c[O+2]),O+=5;break;case r.SAVE:v.save();break;case r.RESTORE:v.restore();break;case r.TRANSLATE:v.translate(c[O+1],c[O+2]),O+=2;break;case r.SCALE:v.scale(c[O+1],c[O+2]),O+=2;break;case r.ROTATE:v.rotate(c[O+1]),O+=1;break;case r.GRADIENT_FILL_STYLE:O+=5;break;case r.GRADIENT_LINE_STYLE:O+=6;break}}v.restore()}};a.exports=h},87079:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(44603),p=t(43831);r.register("graphics",function(h,o){h===void 0&&(h={}),o!==void 0&&(h.add=o);var l=new p(this.scene,h);return h.add&&this.scene.sys.displayList.add(l),l})},1201:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43831),p=t(39429);p.register("graphics",function(h){return this.displayList.add(new r(this.scene,h))})},84503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(77545),h=t(32768),h=t(32768),a.exports={renderWebGL:p,renderCanvas:h}},77545:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85592),p=t(91296),h=t(61340),o=t(70554),l=function(c,d,v){this.x=c,this.y=d,this.width=v},n=function(c,d,v){this.points=[],this.pointsLength=1,this.points[0]=new l(c,d,v)},u=[],f=new h,s=function(c,d,v,m){if(d.commandBuffer.length!==0){v.addToRenderList(d);var S=c.pipelines.set(d.pipeline,d);c.pipelines.preBatch(d);for(var M=p(d,v,m).calc,A=f.loadIdentity(),C=d.commandBuffer,w=v.alpha*d.alpha,P=1,L=S.fillTint,O=S.strokeTint,I=0,D=0,B=0,G=.01,z=Math.PI*2,W,k=[],J=0,Q=!0,Y=null,K=o.getTintAppendFloatAlpha,U=0;U0&&(Tt=-z+Tt%z):Tt>z?Tt=z:Tt<0&&(Tt=z+Tt%z),Y===null&&(Y=new n(At+Math.cos(yt)*st,ot+Math.sin(yt)*st,P),k.push(Y),gt+=G);gt<1+Et;)B=Tt*gt+yt,I=At+Math.cos(B)*st,D=ot+Math.sin(B)*st,Y.points.push(new l(I,D,P)),gt+=G;B=Tt+yt,I=At+Math.cos(B)*st,D=ot+Math.sin(B)*st,Y.points.push(new l(I,D,P));break}case r.FILL_RECT:{S.batchFillRect(C[++U],C[++U],C[++U],C[++U],A,M);break}case r.FILL_TRIANGLE:{S.batchFillTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],A,M);break}case r.STROKE_TRIANGLE:{S.batchStrokeTriangle(C[++U],C[++U],C[++U],C[++U],C[++U],C[++U],P,A,M);break}case r.LINE_TO:{Y!==null?Y.points.push(new l(C[++U],C[++U],P)):(Y=new n(C[++U],C[++U],P),k.push(Y));break}case r.MOVE_TO:{Y=new n(C[++U],C[++U],P),k.push(Y);break}case r.SAVE:{u.push(A.copyToArray());break}case r.RESTORE:{A.copyFromArray(u.pop());break}case r.TRANSLATE:{At=C[++U],ot=C[++U],A.translate(At,ot);break}case r.SCALE:{At=C[++U],ot=C[++U],A.scale(At,ot);break}case r.ROTATE:{A.rotate(C[++U]);break}}c.pipelines.postBatch(d)}};a.exports=s},26479:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61061),p=t(83419),h=t(51708),o=t(50792),l=t(46710),n=t(95540),u=t(35154),f=t(97022),s=t(41212),c=t(88492),d=t(35072),v=t(68287),m=new p({Extends:o,initialize:function(M,A,C){o.call(this),C?A&&!Array.isArray(A)&&(A=[A]):Array.isArray(A)?s(A[0])&&(C=A,A=null):s(A)&&(C=A,A=null),this.scene=M,this.children=new d,this.isParent=!0,this.type="Group",this.classType=n(C,"classType",v),this.name=n(C,"name",""),this.active=n(C,"active",!0),this.maxSize=n(C,"maxSize",-1),this.defaultKey=n(C,"defaultKey",null),this.defaultFrame=n(C,"defaultFrame",null),this.runChildUpdate=n(C,"runChildUpdate",!1),this.createCallback=n(C,"createCallback",null),this.removeCallback=n(C,"removeCallback",null),this.createMultipleCallback=n(C,"createMultipleCallback",null),this.internalCreateCallback=n(C,"internalCreateCallback",null),this.internalRemoveCallback=n(C,"internalRemoveCallback",null),A&&this.addMultiple(A),C&&this.createMultiple(C),this.on(h.ADDED_TO_SCENE,this.addedToScene,this),this.on(h.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(S,M,A,C,w,P){if(S===void 0&&(S=0),M===void 0&&(M=0),A===void 0&&(A=this.defaultKey),C===void 0&&(C=this.defaultFrame),w===void 0&&(w=!0),P===void 0&&(P=!0),this.isFull())return null;var L=new this.classType(this.scene,S,M,A,C);return L.addToDisplayList(this.scene.sys.displayList),L.addToUpdateList(),L.visible=w,L.setActive(P),this.add(L),L},createMultiple:function(S){if(this.isFull())return[];Array.isArray(S)||(S=[S]);var M=[];if(S[0].key)for(var A=0;A=0;B--)if(D=z[B],D.active===A){if(G++,G===M)break}else D=null;return D?(typeof w=="number"&&(D.x=w),typeof P=="number"&&(D.y=P),D):C?this.create(w,P,L,O,I):null},get:function(S,M,A,C,w){return this.getFirst(!1,!0,S,M,A,C,w)},getFirstAlive:function(S,M,A,C,w,P){return this.getFirst(!0,S,M,A,C,w,P)},getFirstDead:function(S,M,A,C,w,P){return this.getFirst(!1,S,M,A,C,w,P)},playAnimation:function(S,M){return r.PlayAnimation(this.children.entries,S,M),this},isFull:function(){return this.maxSize===-1?!1:this.children.size>=this.maxSize},countActive:function(S){S===void 0&&(S=!0);for(var M=0,A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(44603),p=t(26479);r.register("group",function(h){return new p(this.scene,null,h)})},3385:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26479),p=t(39429);p.register("group",function(h,o){return this.updateList.add(new r(this.scene,h,o))})},88571:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(95643),o=t(59819),l=new r({Extends:h,Mixins:[p.Alpha,p.BlendMode,p.Depth,p.Flip,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.TextureCrop,p.Tint,p.Transform,p.Visible,o],initialize:function(u,f,s,c,d){h.call(this,u,"Image"),this._crop=this.resetCropObject(),this.setTexture(c,d),this.setPosition(f,s),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)}});a.exports=l},40652:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r),t.batchSprite(r,r.frame,p,h)};a.exports=y},82459:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(88571);p.register("image",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"frame",null),s=new o(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,s,l),s})},2117:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(88571),p=t(39429);p.register("image",function(h,o,l,n){return this.displayList.add(new r(this.scene,h,o,l,n))})},59819:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(99517),h=t(40652),a.exports={renderWebGL:p,renderCanvas:h}},99517:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r),this.pipeline.batchSprite(r,p,h)};a.exports=y},77856:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={Events:t(51708),DisplayList:t(8050),GameObjectCreator:t(44603),GameObjectFactory:t(39429),UpdateList:t(45027),Components:t(31401),GetCalcMatrix:t(91296),BuildGameObject:t(25305),BuildGameObjectAnimation:t(13059),GameObject:t(95643),BitmapText:t(22186),Blitter:t(6107),Bob:t(46590),Container:t(31559),DOMElement:t(3069),DynamicBitmapText:t(2638),Extern:t(42421),Graphics:t(43831),Group:t(26479),Image:t(88571),Layer:t(93595),Particles:t(18404),PathFollower:t(1159),RenderTexture:t(591),RetroFont:t(196),Rope:t(77757),Sprite:t(68287),Text:t(50171),GetTextSize:t(14220),MeasureText:t(79557),TextStyle:t(35762),TileSprite:t(20839),Zone:t(41481),Video:t(18471),Shape:t(17803),Arc:t(23629),Curve:t(89),Ellipse:t(19921),Grid:t(30479),IsoBox:t(61475),IsoTriangle:t(16933),Line:t(57847),Polygon:t(24949),Rectangle:t(74561),Star:t(55911),Triangle:t(36931),Factories:{Blitter:t(12709),Container:t(24961),DOMElement:t(2611),DynamicBitmapText:t(72566),Extern:t(56315),Graphics:t(1201),Group:t(3385),Image:t(2117),Layer:t(20005),Particles:t(676),PathFollower:t(90145),RenderTexture:t(60505),Rope:t(96819),Sprite:t(46409),StaticBitmapText:t(34914),Text:t(68005),TileSprite:t(91681),Zone:t(84175),Video:t(89025),Arc:t(42563),Curve:t(40511),Ellipse:t(1543),Grid:t(34137),IsoBox:t(3933),IsoTriangle:t(49803),Line:t(2481),Polygon:t(64827),Rectangle:t(87959),Star:t(93697),Triangle:t(45245)},Creators:{Blitter:t(9403),Container:t(77143),DynamicBitmapText:t(11164),Graphics:t(87079),Group:t(94975),Image:t(82459),Layer:t(25179),Particles:t(92730),RenderTexture:t(34495),Rope:t(26209),Sprite:t(15567),StaticBitmapText:t(57336),Text:t(71259),TileSprite:t(14167),Zone:t(95261),Video:t(11511)}};r.Shader=t(20071),r.Mesh=t(4703),r.NineSlice=t(28103),r.PointLight=t(80321),r.Plane=t(33663),r.Factories.Shader=t(74177),r.Factories.Mesh=t(9225),r.Factories.NineSlice=t(47521),r.Factories.PointLight=t(71255),r.Factories.Plane=t(30985),r.Creators.Shader=t(54935),r.Creators.Mesh=t(20527),r.Creators.NineSlice=t(28279),r.Creators.PointLight=t(39829),r.Creators.Plane=t(56015),r.Light=t(41432),r.LightsManager=t(61356),r.LightsPlugin=t(88992),a.exports=r},93595:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(83419),h=t(31401),o=t(53774),l=t(45893),n=t(50792),u=t(51708),f=t(73162),s=t(33963),c=t(44594),d=t(19186),v=new p({Extends:f,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Mask,h.PostPipeline,h.Visible,n,s],initialize:function(S,M){f.call(this,S),n.call(this),this.scene=S,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=S.sys,this.events=S.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPostPipeline(),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),M&&this.add(M),S.sys.queueDepthSort()},setActive:function(m){return this.active=m,this},setName:function(m){return this.name=m,this},setState:function(m){return this.state=m,this},setDataEnabled:function(){return this.data||(this.data=new l(this)),this},setData:function(m,S){return this.data||(this.data=new l(this)),this.data.set(m,S),this},incData:function(m,S){return this.data||(this.data=new l(this)),this.data.inc(m,S),this},toggleData:function(m){return this.data||(this.data=new l(this)),this.data.toggle(m),this},getData:function(m){return this.data||(this.data=new l(this)),this.data.get(m)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(m){return!(this.renderFlags!==15||this.list.length===0||this.cameraFilter!==0&&this.cameraFilter&m.id)},getIndexList:function(){for(var m=this,S=this.parentContainer,M=[];S&&(M.unshift(S.getIndex(m)),m=S,S.parentContainer);)S=S.parentContainer;return M.unshift(this.displayList.getIndex(m)),M},addChildCallback:function(m){var S=m.displayList;S&&S!==this&&m.removeFromDisplayList(),m.displayList||(this.queueDepthSort(),m.displayList=this,m.emit(u.ADDED_TO_SCENE,m,this.scene),this.events.emit(c.ADDED_TO_SCENE,m,this.scene))},removeChildCallback:function(m){this.queueDepthSort(),m.displayList=null,m.emit(u.REMOVED_FROM_SCENE,m,this.scene),this.events.emit(c.REMOVED_FROM_SCENE,m,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(d(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(m,S){return m._depth-S._depth},getChildren:function(){return this.list},addToDisplayList:function(m){return m===void 0&&(m=this.scene.sys.displayList),this.displayList&&this.displayList!==m&&this.removeFromDisplayList(),m.exists(this)||(this.displayList=m,m.add(this,!0),m.queueDepthSort(),this.emit(u.ADDED_TO_SCENE,this,this.scene),m.events.emit(c.ADDED_TO_SCENE,this,this.scene)),this},removeFromDisplayList:function(){var m=this.displayList||this.scene.sys.displayList;return m.exists(this)&&(m.remove(this,!0),m.queueDepthSort(),this.displayList=null,this.emit(u.REMOVED_FROM_SCENE,this,this.scene),m.events.emit(c.REMOVED_FROM_SCENE,this,this.scene)),this},destroy:function(m){if(!(!this.scene||this.ignoreDestroy)){this.emit(u.DESTROY,this);for(var S=this.list;S.length;)S[0].destroy(m);this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.remove(this,!0,!1),this.displayList.queueDepthSort()),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});a.exports=v},2956:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=r.list;if(h.length!==0){r.depthSort();var o=r.blendMode!==-1;o||t.setBlendMode(0);var l=r._alpha;r.mask&&r.mask.preRenderCanvas(t,null,p);for(var n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(93595),h=t(44603),o=t(23568);h.register("layer",function(l,n){l===void 0&&(l={});var u=o(l,"children",null),f=new p(this.scene,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},20005:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(93595),p=t(39429);p.register("layer",function(h){return this.displayList.add(new r(this.scene,h))})},33963:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(15869),h=t(2956),a.exports={renderWebGL:p,renderCanvas:h}},15869:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=r.list,o=h.length;if(o!==0){r.depthSort(),t.pipelines.preBatch(r);var l=r.blendMode!==-1;l||t.setBlendMode(0);for(var n=r.alpha,u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(96503),p=t(83419),h=t(31401),o=t(51767),l=t(70554),n=new p({Extends:r,Mixins:[h.Origin,h.ScrollFactor,h.Visible],initialize:function(f,s,c,d,v,m,S){r.call(this,f,s,c),this.color=new o(d,v,m),this.intensity=S,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1),this.setOrigin(),this.setDisplayOrigin(c)},displayWidth:{get:function(){return this.diameter},set:function(u){this.diameter=u}},displayHeight:{get:function(){return this.diameter},set:function(u){this.diameter=u}},width:{get:function(){return this.diameter},set:function(u){this.diameter=u}},height:{get:function(){return this.diameter},set:function(u){this.diameter=u}},willRender:function(u){return!(n.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&u.id)},setColor:function(u){var f=l.getFloatsFromUintRGB(u);return this.color.set(f[0],f[1],f[2]),this},setIntensity:function(u){return this.intensity=u,this},setRadius:function(u){return this.radius=u,this}});n.RENDER_MASK=15,a.exports=n},61356:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(81491),p=t(83419),h=t(20339),o=t(41432),l=t(80321),n=t(51767),u=t(19133),f=t(19186),s=t(70554),c=new p({initialize:function(){this.lights=[],this.ambientColor=new n(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(d,v,m,S,M,A){return this.systems.displayList.add(new l(this.scene,d,v,m,S,M,A))},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(d){for(var v=this.lights,m=d.worldView,S=[],M=0;Mthis.maxLights&&(f(S,this.sortByDistance),S=S.slice(0,this.maxLights)),this.visibleLights=S.length,S},sortByDistance:function(d,v){return d.distance>=v.distance},setAmbientColor:function(d){var v=s.getFloatsFromUintRGB(d);return this.ambientColor.set(v[0],v[1],v[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=16777215),M===void 0&&(M=1);var A=s.getFloatsFromUintRGB(S),C=new o(d,v,m,A[0],A[1],A[2],M);return this.lights.push(C),C},removeLight:function(d){var v=this.lights.indexOf(d);return v>=0&&u(this.lights,v),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});a.exports=c},88992:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(61356),h=t(37277),o=t(44594),l=new r({Extends:p,initialize:function(u){this.scene=u,this.systems=u.sys,u.sys.settings.isBooted||u.sys.events.once(o.BOOT,this.boot,this),p.call(this)},boot:function(){var n=this.systems.events;n.on(o.SHUTDOWN,this.shutdown,this),n.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});h.register("LightsPlugin",l,"lights"),a.exports=l},4703:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(39506),o=t(83997),l=t(95643),n=t(34684),u=t(92515),f=t(91296),s=t(37867),c=t(29807),d=t(43396),v=t(19186),m=t(25836),S=t(39318),M=new r({Extends:l,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Size,p.Texture,p.Transform,p.Visible,c],initialize:function(C,w,P,L,O,I,D,B,G,z,W,k){w===void 0&&(w=0),P===void 0&&(P=0),L===void 0&&(L="__WHITE"),l.call(this,C,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new m,this.modelScale=new m(1,1,1),this.modelRotation=new m,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new s,this.viewPosition=new m,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=C.sys.renderer;this.setPosition(w,P),this.setTexture(L,O),this.setSize(J.width,J.height),this.initPipeline(),this.initPostPipeline(),this.setPerspective(J.width,J.height),I&&this.addVertices(I,D,B,G,z,W,k)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(A){return this.viewPosition.addScale(m.LEFT,A),this.dirtyCache[10]=1,this},panY:function(A){return this.viewPosition.y+=m.DOWN.y*A,this.dirtyCache[10]=1,this},panZ:function(A){return this.viewPosition.z+=A,this.dirtyCache[10]=1,this},setPerspective:function(A,C,w,P,L){return w===void 0&&(w=45),P===void 0&&(P=.01),L===void 0&&(L=1e3),this.fov=w,this.projectionMatrix.perspective(h(w),A/C,P,L),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(A,C,w,P){return A===void 0&&(A=this.scene.sys.renderer.getAspectRatio()),C===void 0&&(C=1),w===void 0&&(w=-1e3),P===void 0&&(P=1e3),this.fov=0,this.projectionMatrix.ortho(-A,A,-C,C,w,P),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach(function(A){A.destroy()}),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(A,C,w,P,L,O,I,D,B){var G=this.scene.sys.cache.obj.get(A),z;return G&&(z=n(G,this,C,w,P,L,O,I,D,B)),(!z||z.verts.length===0)&&console.warn("Mesh.addVerticesFromObj data empty:",A),this},sortByDepth:function(A,C){return A.depth-C.depth},depthSort:function(){return v(this.faces,this.sortByDepth),this},addVertex:function(A,C,w,P,L,O,I){var D=new S(A,C,w,P,L,O,I);return this.vertices.push(D),D},addFace:function(A,C,w){var P=new o(A,C,w);return this.faces.push(P),this.dirtyCache[9]=-1,P},addVertices:function(A,C,w,P,L,O,I){var D=u(A,C,w,P,L,O,I);return D?(this.faces=this.faces.concat(D.faces),this.vertices=this.vertices.concat(D.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(A){return this.faces[A]},hasFaceAt:function(A,C,w){w===void 0&&(w=this.scene.sys.cameras.main);for(var P=f(this,w).calc,L=this.faces,O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){};a.exports=y},20527:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(35154),l=t(4703);p.register("mesh",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),s=h(n,"frame",null),c=o(n,"vertices",[]),d=o(n,"uvs",[]),v=o(n,"indicies",[]),m=o(n,"containsZ",!1),S=o(n,"normals",[]),M=o(n,"colors",16777215),A=o(n,"alphas",1),C=new l(this.scene,0,0,f,s,c,d,v,m,S,M,A);return u!==void 0&&(n.add=u),r(this.scene,C,n),C})},9225:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(4703),p=t(39429);p.register("mesh",function(h,o,l,n,u,f,s,c,d,v,m){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s,c,d,v,m))})},29807:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(48833),h=t(36488),a.exports={renderWebGL:p,renderCanvas:h}},48833:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=function(h,o,l,n){var u=o.faces,f=u.length;if(f!==0){l.addToRenderList(o);var s=h.pipelines.set(o.pipeline,o),c=r(o,l,n).calc;h.pipelines.preBatch(o);for(var d=s.setGameObject(o),v=s.vertexViewF32,m=s.vertexViewU32,S=s.vertexCount*s.currentShader.vertexComponentCount-1,M=o.tintFill,A=[],C=o.debugCallback,w=c.a,P=c.b,L=c.c,O=c.d,I=c.e,D=c.f,B=o.viewPosition.z,G=o.hideCCW,z=l.roundPixels,W=l.alpha*o.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 r=t(83419),p=t(31401),h=t(95643),o=t(78023),l=t(39318),n=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,o],initialize:function(f,s,c,d,v,m,S,M,A,C,w){h.call(this,f,"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=f.textures.getFrame(d,v);this.is3Slice=!C&&!w,P.scale9&&(this.is3Slice=P.is3Slice);for(var L=this.is3Slice?18:54,O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(35154),l=t(28103);p.register("nineslice",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),s=h(n,"frame",null),c=o(n,"width",256),d=o(n,"height",256),v=o(n,"leftWidth",10),m=o(n,"rightWidth",10),S=o(n,"topHeight",0),M=o(n,"bottomHeight",0),A=new l(this.scene,0,0,f,s,c,d,v,m,S,M);return u!==void 0&&(n.add=u),r(this.scene,A,n),A})},47521:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(28103),p=t(39429);p.register("nineslice",function(h,o,l,n,u,f,s,c,d,v){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s,c,d,v))})},78023:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(52230),a.exports={renderWebGL:p,renderCanvas:h}},52230:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){var f=l.vertices,s=f.length;if(s!==0){n.addToRenderList(l);var c=o.pipelines.set(l.pipeline,l),d=r(l,n,u,!1).calc;o.pipelines.preBatch(l);var v=c.setGameObject(l),m=c.vertexViewF32,S=c.vertexViewU32,M=c.vertexCount*c.currentShader.vertexComponentCount-1,A=n.roundPixels,C=l.tintFill,w=n.alpha*l.alpha,P=p.getTintAppendFloatAlpha(l.tint,w),L=c.vertexAvailable(),O=-1;L{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(44777),h=t(37589),o=t(6113),l=t(91389),n=t(90664),u=new r({Extends:p,initialize:function(s){p.call(this,s,null,!1),this.active=!1,this.easeName="Linear",this.r=[],this.g=[],this.b=[]},getMethod:function(){return this.propertyValue===null?0:9},setMethods:function(){var f=this.propertyValue,s=f,c=this.defaultEmit,d=this.defaultUpdate;if(this.method===9){this.start=f[0],this.ease=o("Linear"),this.interpolation=l("linear"),c=this.easedValueEmit,d=this.easeValueUpdate,s=f[0],this.active=!0;for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30976),p=t(45319),h=t(83419),o=t(99472),l=t(6113),n=t(95540),u=t(91389),f=t(77720),s=t(15994),c=new h({initialize:function(v,m,S){S===void 0&&(S=!1),this.propertyKey=v,this.propertyValue=m,this.defaultValue=m,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=S,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.active=!0,this.method=0,this._onEmit,this._onUpdate},loadConfig:function(d,v){d===void 0&&(d={}),v&&(this.propertyKey=v),this.propertyValue=n(d,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(d){var v;switch(this.method){case 1:case 3:case 8:v=d;break;case 2:this.propertyValue.indexOf(d)>=0&&(v=d);break;case 4:var m=(this.end-this.start)/this.steps;v=f(d,m),this.counter=v;break;case 5:case 6:case 7:v=p(d,this.start,this.end);break;case 9:v=this.start[0];break}return this.current=v,this},getMethod:function(){var d=this.propertyValue;if(d===null)return 0;var v=typeof d;if(v==="number")return 1;if(Array.isArray(d))return 2;if(v==="function")return 3;if(v==="object"){if(this.hasBoth(d,"start","end"))return this.has(d,"steps")?4:5;if(this.hasBoth(d,"min","max"))return 6;if(this.has(d,"random"))return 7;if(this.hasEither(d,"onEmit","onUpdate"))return 8;if(this.hasEither(d,"values","interpolation"))return 9}return 0},setMethods:function(){var d=this.propertyValue,v=d,m=this.defaultEmit,S=this.defaultUpdate;switch(this.method){case 1:m=this.staticValueEmit;break;case 2:m=this.randomStaticValueEmit,v=d[0];break;case 3:this._onEmit=d,m=this.proxyEmit;break;case 4:this.start=d.start,this.end=d.end,this.steps=d.steps,this.counter=this.start,this.yoyo=this.has(d,"yoyo")?d.yoyo:!1,this.direction=0,m=this.steppedEmit,v=this.start;break;case 5:this.start=d.start,this.end=d.end;var M=this.has(d,"ease")?d.ease:"Linear";this.ease=l(M,d.easeParams),m=this.has(d,"random")&&d.random?this.randomRangedValueEmit:this.easedValueEmit,S=this.easeValueUpdate,v=this.start;break;case 6:this.start=d.min,this.end=d.max,m=this.has(d,"int")&&d.int?this.randomRangedIntEmit:this.randomRangedValueEmit,v=this.start;break;case 7:var A=d.random;Array.isArray(A)&&(this.start=A[0],this.end=A[1]),m=this.randomRangedIntEmit,v=this.start;break;case 8:this._onEmit=this.has(d,"onEmit")?d.onEmit:this.defaultEmit,this._onUpdate=this.has(d,"onUpdate")?d.onUpdate:this.defaultUpdate,m=this.proxyEmit,S=this.proxyUpdate;break;case 9:this.start=d.values;var C=this.has(d,"ease")?d.ease:"Linear";this.ease=l(C,d.easeParams),this.interpolation=u(d.interpolation),m=this.easedValueEmit,S=this.easeValueUpdate,v=this.start[0];break}return this.onEmit=m,this.onUpdate=S,this.current=v,this},has:function(d,v){return d.hasOwnProperty(v)},hasBoth:function(d,v,m){return d.hasOwnProperty(v)&&d.hasOwnProperty(m)},hasEither:function(d,v,m){return d.hasOwnProperty(v)||d.hasOwnProperty(m)},defaultEmit:function(d,v,m){return m},defaultUpdate:function(d,v,m,S){return S},proxyEmit:function(d,v,m){var S=this._onEmit(d,v,m);return this.current=S,S},proxyUpdate:function(d,v,m,S){var M=this._onUpdate(d,v,m,S);return this.current=M,M},staticValueEmit:function(){return this.current},staticValueUpdate:function(){return this.current},randomStaticValueEmit:function(){var d=Math.floor(Math.random()*this.propertyValue.length);return this.current=this.propertyValue[d],this.current},randomRangedValueEmit:function(d,v){var m=o(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},randomRangedIntEmit:function(d,v){var m=r(this.start,this.end);return d&&d.data[v]&&(d.data[v].min=m,d.data[v].max=this.end),this.current=m,m},steppedEmit:function(){var d=this.counter,v=d,m=(this.end-this.start)/this.steps;if(this.yoyo){var S;this.direction===0?(v+=m,v>=this.end&&(S=v-this.end,v=this.end-S,this.direction=1)):(v-=m,v<=this.start&&(S=this.start-v,v=this.start+S,this.direction=0)),this.counter=v}else this.counter=s(v+m,this.start,this.end);return this.current=d,d},easedValueEmit:function(d,v){if(d&&d.data[v]){var m=d.data[v];m.min=this.start,m.max=this.end}return this.current=this.start,this.start},easeValueUpdate:function(d,v,m){var S=d.data[v],M,A=this.ease(m);return this.interpolation?M=this.interpolation(this.start,A):M=(S.max-S.min)*A+S.min,this.current=M,M},destroy:function(){this.propertyValue=null,this.defaultValue=null,this.ease=null,this.interpolation=null,this._onEmit=null,this._onUpdate=null}});a.exports=c},24502:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(20286),o=new r({Extends:h,initialize:function(n,u,f,s,c){if(typeof n=="object"){var d=n;n=p(d,"x",0),u=p(d,"y",0),f=p(d,"power",0),s=p(d,"epsilon",100),c=p(d,"gravity",50)}else n===void 0&&(n=0),u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=100),c===void 0&&(c=50);h.call(this,n,u,!0),this._gravity=c,this._power=f*c,this._epsilon=s*s},update:function(l,n){var u=this.x-l.x,f=this.y-l.y,s=u*u+f*f;if(s!==0){var c=Math.sqrt(s);s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(9674),p=t(45319),h=t(83419),o=t(39506),l=t(87841),n=t(11520),u=t(26099),f=new h({initialize:function(c){this.emitter=c,this.texture=null,this.frame=null,this.x=0,this.y=0,this.worldPosition=new u,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=c.scene,this.anims=new r(this),this.bounds=new l},emit:function(s,c,d,v,m,S){return this.emitter.emit(s,c,d,v,m,S)},isAlive:function(){return this.lifeCurrent>0},kill:function(){this.lifeCurrent=0},setPosition:function(s,c){s===void 0&&(s=0),c===void 0&&(c=0),this.x=s,this.y=c},fire:function(s,c){var d=this.emitter,v=d.ops,m=d.getAnim();if(m?this.anims.play(m):(this.frame=d.getFrame(),this.texture=this.frame.texture),!this.frame)throw new Error("Particle has no texture frame");if(d.getEmitZone(this),s===void 0?this.x+=v.x.onEmit(this,"x"):v.x.steps>0?this.x+=s+v.x.onEmit(this,"x"):this.x+=s,c===void 0?this.y+=v.y.onEmit(this,"y"):v.y.steps>0?this.y+=c+v.y.onEmit(this,"y"):this.y+=c,this.life=v.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0,this.delayCurrent=v.delay.onEmit(this,"delay"),this.holdCurrent=v.hold.onEmit(this,"hold"),this.scaleX=v.scaleX.onEmit(this,"scaleX"),this.scaleY=v.scaleY.active?v.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=v.rotate.onEmit(this,"rotate"),this.rotation=o(this.angle),d.worldMatrix.transformPoint(this.x,this.y,this.worldPosition),this.delayCurrent===0&&d.getDeathZone(this))return this.lifeCurrent=0,!1;var S=v.speedX.onEmit(this,"speedX"),M=v.speedY.active?v.speedY.onEmit(this,"speedY"):S;if(d.radial){var A=o(v.angle.onEmit(this,"angle"));this.velocityX=Math.cos(A)*Math.abs(S),this.velocityY=Math.sin(A)*Math.abs(M)}else if(d.moveTo){var C=v.moveToX.onEmit(this,"moveToX"),w=v.moveToY.onEmit(this,"moveToY"),P=this.life/1e3;this.velocityX=(C-this.x)/P,this.velocityY=(w-this.y)/P}else this.velocityX=S,this.velocityY=M;return d.acceleration&&(this.accelerationX=v.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=v.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=v.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=v.maxVelocityY.onEmit(this,"maxVelocityY"),this.bounce=v.bounce.onEmit(this,"bounce"),this.alpha=v.alpha.onEmit(this,"alpha"),v.color.active?this.tint=v.color.onEmit(this,"tint"):this.tint=v.tint.onEmit(this,"tint"),!0},update:function(s,c,d){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 v=this.emitter,m=v.ops,S=1-this.lifeCurrent/this.life;if(this.lifeT=S,this.x=m.x.onUpdate(this,"x",S,this.x),this.y=m.y.onUpdate(this,"y",S,this.y),v.moveTo){var M=m.moveToX.onUpdate(this,"moveToX",S,v.moveToX),A=m.moveToY.onUpdate(this,"moveToY",S,v.moveToY),C=this.lifeCurrent/1e3;this.velocityX=(M-this.x)/C,this.velocityY=(A-this.y)/C}return this.computeVelocity(v,s,c,d,S),this.scaleX=m.scaleX.onUpdate(this,"scaleX",S,this.scaleX),m.scaleY.active?this.scaleY=m.scaleY.onUpdate(this,"scaleY",S,this.scaleY):this.scaleY=this.scaleX,this.angle=m.rotate.onUpdate(this,"rotate",S,this.angle),this.rotation=o(this.angle),v.getDeathZone(this)?(this.lifeCurrent=0,!0):(this.alpha=p(m.alpha.onUpdate(this,"alpha",S,this.alpha),0,1),m.color.active?this.tint=m.color.onUpdate(this,"color",S,this.tint):this.tint=m.tint.onUpdate(this,"tint",S,this.tint),this.lifeCurrent-=s,this.lifeCurrent<=0&&this.holdCurrent<=0)},computeVelocity:function(s,c,d,v,m){var S=s.ops,M=this.velocityX,A=this.velocityY,C=S.accelerationX.onUpdate(this,"accelerationX",m,this.accelerationX),w=S.accelerationY.onUpdate(this,"accelerationY",m,this.accelerationY),P=S.maxVelocityX.onUpdate(this,"maxVelocityX",m,this.maxVelocityX),L=S.maxVelocityY.onUpdate(this,"maxVelocityY",m,this.maxVelocityY);this.bounce=S.bounce.onUpdate(this,"bounce",m,this.bounce),M+=s.gravityX*d+C*d,A+=s.gravityY*d+w*d,M=p(M,-P,P),A=p(A,-L,L),this.velocityX=M,this.velocityY=A,this.x+=M*d,this.y+=A*d,s.worldMatrix.transformPoint(this.x,this.y,this.worldPosition);for(var O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(20286),h=t(87841),o=new r({Extends:p,initialize:function(n,u,f,s,c,d,v,m){c===void 0&&(c=!0),d===void 0&&(d=!0),v===void 0&&(v=!0),m===void 0&&(m=!0),p.call(this,n,u,!0),this.bounds=new h(n,u,f,s),this.collideLeft=c,this.collideRight=d,this.collideTop=v,this.collideBottom=m},update:function(l){var n=this.bounds,u=-l.bounce,f=l.worldPosition;f.xn.right&&this.collideRight&&(l.x-=f.x-n.right,l.velocityX*=u),f.yn.bottom&&this.collideBottom&&(l.y-=f.y-n.bottom,l.velocityY*=u)}});a.exports=o},31600:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(53774),o=t(43459),l=t(26388),n=t(19909),u=t(76472),f=t(44777),s=t(20696),c=t(95643),d=t(95540),v=t(26546),m=t(24502),S=t(1985),M=t(97022),A=t(86091),C=t(73162),w=t(20074),P=t(56480),L=t(68875),O=t(87841),I=t(59996),D=t(72905),B=t(90668),G=t(19186),z=t(61340),W=t(26099),k=t(15994),J=t(69601),Q=["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"],Y=["accelerationX","accelerationY","alpha","angle","bounce","color","delay","hold","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],K=new r({Extends:c,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Texture,p.Transform,p.Visible,B],initialize:function(V,j,$,q,it){c.call(this,V,"ParticleEmitter"),this.particleClass=P,this.ops={accelerationX:new f("accelerationX",0),accelerationY:new f("accelerationY",0),alpha:new f("alpha",1),angle:new f("angle",{min:0,max:360},!0),bounce:new f("bounce",0),color:new u("color"),delay:new f("delay",0,!0),hold:new f("hold",0,!0),lifespan:new f("lifespan",1e3,!0),maxVelocityX:new f("maxVelocityX",1e4),maxVelocityY:new f("maxVelocityY",1e4),moveToX:new f("moveToX",0),moveToY:new f("moveToY",0),quantity:new f("quantity",1,!0),rotate:new f("rotate",0),scaleX:new f("scaleX",1),scaleY:new f("scaleY",1),speedX:new f("speedX",0,!0),speedY:new f("speedY",0,!0),tint:new f("tint",16777215),x:new f("x",0),y:new f("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 W,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 z,this.sortProperty="",this.sortOrderAsc=!0,this.sortCallback=this.depthSortCallback,this.processors=new C(this),this.tintFill=!1,this.initPipeline(),this.initPostPipeline(),this.setPosition(j,$),this.setTexture(q),it&&this.setConfig(it)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setConfig:function(U){if(!U)return this;var V=0,j="",$=this.ops;for(V=0;V=this.animQuantity&&(this.animCounter=0,this.currentAnim=k(this.currentAnim+1,0,V)),j},setAnim:function(U,V,j){V===void 0&&(V=!0),j===void 0&&(j=1),this.randomAnim=V,this.animQuantity=j,this.currentAnim=0;var $=typeof U;if(this.anims.length=0,Array.isArray(U))this.anims=this.anims.concat(U);else if($==="string")this.anims.push(U);else if($==="object"){var q=U;U=d(q,"anims",null),U&&(this.anims=this.anims.concat(U));var it=d(q,"cycle",!1);this.randomAnim=!it,this.animQuantity=d(q,"quantity",j)}return this.anims.length===1&&(this.animQuantity=1,this.randomAnim=!1),this},setRadial:function(U){return U===void 0&&(U=!0),this.radial=U,this},addParticleBounds:function(U,V,j,$,q,it,nt,et){if(typeof U=="object"){var ht=U;U=ht.x,V=ht.y,j=M(ht,"w")?ht.w:ht.width,$=M(ht,"h")?ht.h:ht.height}return this.addParticleProcessor(new J(U,V,j,$,q,it,nt,et))},setParticleSpeed:function(U,V){return V===void 0&&(V=U),this.ops.speedX.onChange(U),U===V?this.ops.speedY.active=!1:this.ops.speedY.onChange(V),this.radial=!0,this},setParticleScale:function(U,V){return U===void 0&&(U=1),V===void 0&&(V=U),this.ops.scaleX.onChange(U),this.ops.scaleY.onChange(V),this},setParticleGravity:function(U,V){return this.gravityX=U,this.gravityY=V,this},setParticleAlpha:function(U){return this.ops.alpha.onChange(U),this},setParticleTint:function(U){return this.ops.tint.onChange(U),this},setEmitterAngle:function(U){return this.ops.angle.onChange(U),this},setParticleLifespan:function(U){return this.ops.lifespan.onChange(U),this},setQuantity:function(U){return this.quantity=U,this},setFrequency:function(U,V){return this.frequency=U,this.flowCounter=U>0?U:0,V&&(this.quantity=V),this},addDeathZone:function(U){Array.isArray(U)||(U=[U]);for(var V,j=[],$=0;$-1&&(this.zoneTotal++,this.zoneTotal===$.total&&(this.zoneTotal=0,this.zoneIndex++,this.zoneIndex===j&&(this.zoneIndex=0)))}},getDeathZone:function(U){for(var V=this.deathZones,j=0;j=0&&(this.zoneIndex=V),this},addParticleProcessor:function(U){return this.processors.exists(U)||(U.emitter&&U.emitter.removeParticleProcessor(U),this.processors.add(U),U.emitter=this),U},removeParticleProcessor:function(U){return this.processors.exists(U)&&(this.processors.remove(U,!0),U.emitter=null),U},getProcessors:function(){return this.processors.getAll("active",!0)},createGravityWell:function(U){return this.addParticleProcessor(new m(U))},reserve:function(U){var V=this.dead;if(this.maxParticles>0){var j=this.getParticleCount();j+U>this.maxParticles&&(U=this.maxParticles-(j+U))}for(var $=0;$0&&this.getParticleCount()>=this.maxParticles?!0:this.maxAliveParticles>0&&this.getAliveParticleCount()>=this.maxAliveParticles},onParticleEmit:function(U,V){return U===void 0?(this.emitCallback=null,this.emitCallbackScope=null):typeof U=="function"&&(this.emitCallback=U,V&&(this.emitCallbackScope=V)),this},onParticleDeath:function(U,V){return U===void 0?(this.deathCallback=null,this.deathCallbackScope=null):typeof U=="function"&&(this.deathCallback=U,V&&(this.deathCallbackScope=V)),this},killAll:function(){for(var U=this.dead,V=this.alive;V.length>0;)U.push(V.pop());return this},forEachAlive:function(U,V){for(var j=this.alive,$=j.length,q=0;q<$;q++)U.call(V,j[q],this);return this},forEachDead:function(U,V){for(var j=this.dead,$=j.length,q=0;q<$;q++)U.call(V,j[q],this);return this},start:function(U,V){return U===void 0&&(U=0),this.emitting||(U>0&&this.fastForward(U),this.emitting=!0,this.resetCounters(this.frequency,!0),V!==void 0&&(this.duration=Math.abs(V)),this.emit(s.START,this)),this},stop:function(U){return U===void 0&&(U=!1),this.emitting&&(this.emitting=!1,U&&this.killAll(),this.emit(s.STOP,this)),this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},setSortProperty:function(U,V){return U===void 0&&(U=""),V===void 0&&(V=this.true),this.sortProperty=U,this.sortOrderAsc=V,this.sortCallback=this.depthSortCallback,this},setSortCallback:function(U){return this.sortProperty!==""?U=this.depthSortCallback:U=null,this.sortCallback=U,this},depthSort:function(){return G(this.alive,this.sortCallback.bind(this)),this},depthSortCallback:function(U,V){var j=this.sortProperty;return this.sortOrderAsc?U[j]-V[j]:V[j]-U[j]},flow:function(U,V,j){return V===void 0&&(V=1),this.emitting=!1,this.frequency=U,this.quantity=V,j!==void 0&&(this.stopAfter=j),this.start()},explode:function(U,V,j){this.frequency=-1,this.resetCounters(-1,!0);var $=this.emitParticle(U,V,j);return this.emit(s.EXPLODE,this,$),$},emitParticleAt:function(U,V,j){return this.emitParticle(j,U,V)},emitParticle:function(U,V,j){if(!this.atLimit()){U===void 0&&(U=this.ops.quantity.onEmit());for(var $=this.dead,q=this.stopAfter,it=this.follow?this.follow.x+this.followOffset.x:V,nt=this.follow?this.follow.y+this.followOffset.y:j,et=0;et0&&(this.stopCounter++,this.stopCounter>=q)||this.atLimit())break}return ht}},fastForward:function(U,V){V===void 0&&(V=1e3/60);var j=0;for(this.skipping=!0;j0){var dt=this.deathCallback,mt=this.deathCallbackScope;for(nt=ht-1;nt>=0;nt--){var gt=et[nt];q.splice(gt.index,1),it.push(gt.particle),dt&&dt.call(mt,gt.particle),gt.particle.setPosition()}}if(!this.emitting&&!this.skipping){this.completeFlag===1&&q.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-=V;this.flowCounter<=0;)this.emitParticle(),this.flowCounter+=this.frequency;this.skipping||(this.duration>0&&(this.elapsed+=V,this.elapsed>=this.duration&&this.stop()),this.stopAfter>0&&this.stopCounter>=this.stopAfter&&this.stop())},overlap:function(U){for(var V=this.getWorldTransformMatrix(),j=this.alive,$=j.length,q=[],it=0;it<$;it++){var nt=j[it];I(U,nt.getBounds(V))&&q.push(nt)}return q},getBounds:function(U,V,j,$){U===void 0&&(U=0),V===void 0&&(V=0),j===void 0&&(j=1e3/60),$===void 0&&($=new O);var q=this.getWorldTransformMatrix(),it,nt,et=this.alive,ht=!1;if($.setTo(0,0,0,0),V>0){var ut=0;for(this.skipping=!0;ut0&&A($,U,U),$},createEmitter:function(){throw new Error("createEmitter removed. See ParticleEmitter docs for info")},particleX:{get:function(){return this.ops.x.current},set:function(U){this.ops.x.onChange(U)}},particleY:{get:function(){return this.ops.y.current},set:function(U){this.ops.y.onChange(U)}},accelerationX:{get:function(){return this.ops.accelerationX.current},set:function(U){this.ops.accelerationX.onChange(U)}},accelerationY:{get:function(){return this.ops.accelerationY.current},set:function(U){this.ops.accelerationY.onChange(U)}},maxVelocityX:{get:function(){return this.ops.maxVelocityX.current},set:function(U){this.ops.maxVelocityX.onChange(U)}},maxVelocityY:{get:function(){return this.ops.maxVelocityY.current},set:function(U){this.ops.maxVelocityY.onChange(U)}},speed:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U),this.ops.speedY.onChange(U)}},speedX:{get:function(){return this.ops.speedX.current},set:function(U){this.ops.speedX.onChange(U)}},speedY:{get:function(){return this.ops.speedY.current},set:function(U){this.ops.speedY.onChange(U)}},moveToX:{get:function(){return this.ops.moveToX.current},set:function(U){this.ops.moveToX.onChange(U)}},moveToY:{get:function(){return this.ops.moveToY.current},set:function(U){this.ops.moveToY.onChange(U)}},bounce:{get:function(){return this.ops.bounce.current},set:function(U){this.ops.bounce.onChange(U)}},particleScaleX:{get:function(){return this.ops.scaleX.current},set:function(U){this.ops.scaleX.onChange(U)}},particleScaleY:{get:function(){return this.ops.scaleY.current},set:function(U){this.ops.scaleY.onChange(U)}},particleColor:{get:function(){return this.ops.color.current},set:function(U){this.ops.color.onChange(U)}},colorEase:{get:function(){return this.ops.color.easeName},set:function(U){this.ops.color.setEase(U)}},particleTint:{get:function(){return this.ops.tint.current},set:function(U){this.ops.tint.onChange(U)}},particleAlpha:{get:function(){return this.ops.alpha.current},set:function(U){this.ops.alpha.onChange(U)}},lifespan:{get:function(){return this.ops.lifespan.current},set:function(U){this.ops.lifespan.onChange(U)}},particleAngle:{get:function(){return this.ops.angle.current},set:function(U){this.ops.angle.onChange(U)}},particleRotate:{get:function(){return this.ops.rotate.current},set:function(U){this.ops.rotate.onChange(U)}},quantity:{get:function(){return this.ops.quantity.current},set:function(U){this.ops.quantity.onChange(U)}},delay:{get:function(){return this.ops.delay.current},set:function(U){this.ops.delay.onChange(U)}},hold:{get:function(){return this.ops.hold.current},set:function(U){this.ops.hold.onChange(U)}},flowCounter:{get:function(){return this.counters[0]},set:function(U){this.counters[0]=U}},frameCounter:{get:function(){return this.counters[1]},set:function(U){this.counters[1]=U}},animCounter:{get:function(){return this.counters[2]},set:function(U){this.counters[2]=U}},elapsed:{get:function(){return this.counters[3]},set:function(U){this.counters[3]=U}},stopCounter:{get:function(){return this.counters[4]},set:function(U){this.counters[4]=U}},completeFlag:{get:function(){return this.counters[5]},set:function(U){this.counters[5]=U}},zoneIndex:{get:function(){return this.counters[6]},set:function(U){this.counters[6]=U}},zoneTotal:{get:function(){return this.counters[7]},set:function(U){this.counters[7]=U}},currentFrame:{get:function(){return this.counters[8]},set:function(U){this.counters[8]=U}},currentAnim:{get:function(){return this.counters[9]},set:function(U){this.counters[9]=U}},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 U,V=this.ops;for(U=0;U{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(59996),p=t(61340),h=new p,o=new p,l=new p,n=new p,u=function(f,s,c,d){var v=h,m=o,S=l,M=n;d?(M.loadIdentity(),M.multiply(d),M.translate(s.x,s.y),M.rotate(s.rotation),M.scale(s.scaleX,s.scaleY)):M.applyITRS(s.x,s.y,s.rotation,s.scaleX,s.scaleY);var A=f.currentContext,C=c.roundPixels,w=c.alpha,P=s.alpha,L=s.alive,O=L.length,I=s.viewBounds;if(!(!s.visible||O===0||I&&!r(I,c.worldView))){s.sortCallback&&s.depthSort(),c.addToRenderList(s);var D=s.scrollFactorX,B=s.scrollFactorY;A.save(),A.globalCompositeOperation=f.blendModes[s.blendMode];for(var G=0;G0&&J.height>0){var Q=-k.halfWidth,Y=-k.halfHeight;A.globalAlpha=W,A.save(),m.setToContext(A),C&&(Q=Math.round(Q),Y=Math.round(Y)),A.imageSmoothingEnabled=!k.source.scaleMode,A.drawImage(k.source.image,J.x,J.y,J.width,J.height,Q,Y,J.width,J.height),A.restore()}}}A.restore()}};a.exports=u},92730:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(95540),l=t(31600);p.register("particles",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),s=o(n,"config",null),c=new l(this.scene,0,0,f);return u!==void 0&&(n.add=u),r(this.scene,c,n),s&&c.setConfig(s),c})},676:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(31600);r.register("particles",function(h,o,l,n){return h!==void 0&&typeof h=="string"&&console.warn("ParticleEmitterManager was removed in Phaser 3.60. See documentation for details"),this.displayList.add(new p(this.scene,h,o,l,n))})},90668:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(21188),h=t(9871),a.exports={renderWebGL:p,renderCanvas:h}},21188:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(59996),p=t(61340),h=t(70554),o=new p,l=new p,n=new p,u=new p,f=function(s,c,d,v){var m=s.pipelines.set(c.pipeline),S=o,M=l,A=n,C=u;v?(C.loadIdentity(),C.multiply(v),C.translate(c.x,c.y),C.rotate(c.rotation),C.scale(c.scaleX,c.scaleY)):C.applyITRS(c.x,c.y,c.rotation,c.scaleX,c.scaleY);var w=h.getTintAppendFloatAlpha,P=d.alpha,L=c.alpha;s.pipelines.preBatch(c);var O=c.alive,I=O.length,D=c.viewBounds;if(!(I===0||D&&!r(D,d.worldView))){c.sortCallback&&c.depthSort(),d.addToRenderList(c),S.copyFrom(d.matrix),S.multiplyWithOffset(C,-d.scrollX*c.scrollFactorX,-d.scrollY*c.scrollFactorY),s.setBlendMode(c.blendMode),c.mask&&(c.mask.preRenderWebGL(s,c,d),s.pipelines.set(c.pipeline));for(var B=c.tintFill,G,z,W=0;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n){o===void 0&&(o=0),l===void 0&&(l=0),n===void 0&&(n=!0),this.emitter,this.x=o,this.y=l,this.active=n},update:function(){},destroy:function(){this.emitter=null}});a.exports=p},9774:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},812:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="deathzone"},30522:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="explode"},96695:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="start"},18677:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stop"},20696:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={COMPLETE:t(9774),DEATH_ZONE:t(812),EXPLODE:t(30522),START:t(96695),STOP:t(18677)}},18404:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={EmitterColorOp:t(76472),EmitterOp:t(44777),Events:t(20696),GravityWell:t(24502),Particle:t(56480),ParticleBounds:t(69601),ParticleEmitter:t(31600),ParticleProcessor:t(20286),Zones:t(21024)}},26388:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l){this.source=o,this.killOnEnter=l},willKill:function(h){var o=h.worldPosition,l=this.source.contains(o.x,o.y);return l&&this.killOnEnter||!l&&!this.killOnEnter}});a.exports=p},19909:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u,f,s){u===void 0&&(u=!1),f===void 0&&(f=!0),s===void 0&&(s=-1),this.source=o,this.points=[],this.quantity=l,this.stepRate=n,this.yoyo=u,this.counter=-1,this.seamless=f,this._length=0,this._direction=0,this.total=s,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var h=this.points[0],o=this.points[this.points.length-1];h.x===o.x&&h.y===o.y&&this.points.pop()}var l=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(h){return this.source=h,this.updateSource()},getPoint:function(h){this._direction===0?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,this.counter===-1&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var o=this.points[this.counter];o&&(h.x=o.x,h.y=o.y)}});a.exports=p},68875:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(26099),h=new r({initialize:function(l){this.source=l,this._tempVec=new p,this.total=-1},getPoint:function(o){var l=this._tempVec;this.source.getRandomPoint(l),o.x=l.x,o.y=l.y}});a.exports=h},21024:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={DeathZone:t(26388),EdgeZone:t(19909),RandomZone:t(68875)}},1159:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(68287),o=new r({Extends:h,Mixins:[p.PathFollower],initialize:function(n,u,f,s,c,d){h.call(this,n,f,s,c,d),this.path=u},preUpdate:function(l,n){this.anims.update(l,n),this.pathUpdate(l)}});a.exports=o},90145:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(1159);r.register("follower",function(h,o,l,n,u){var f=new p(this.scene,h,o,l,n,u);return this.displayList.add(f),this.updateList.add(f),f})},33663:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(9674),p=t(83419),h=t(48803),o=t(90664),l=t(4703),n=t(45650),u=new p({Extends:l,initialize:function(s,c,d,v,m,S,M,A){v||(v="__DEFAULT"),l.call(this,s,c,d,v,m),this.type="Plane",this.anims=new r(this),this.gridWidth,this.gridHeight,this.isTiled,this._checkerboard=null,this.hideCCW=!1,this.setGridSize(S,M,A),this.setSizeToFrame(!1),this.setViewHeight()},originX:{get:function(){return .5}},originY:{get:function(){return .5}},setGridSize:function(f,s,c){f===void 0&&(f=8),s===void 0&&(s=8),c===void 0&&(c=!1);var d=!1;return c&&(d=!0),this.gridWidth=f,this.gridHeight=s,this.isTiled=c,this.clear(),h({mesh:this,widthSegments:f,heightSegments:s,isOrtho:!1,tile:c,flipY:d}),this},setSizeToFrame:function(f){f===void 0&&(f=!0);var s=this.frame;if(this.setPerspective(this.width/s.width,this.height/s.height),this._checkerboard&&this._checkerboard!==this.texture&&this.removeCheckerboard(),!f)return this;var c=this.gridWidth,d=this.gridHeight,v=this.vertices,m=s.u0,S=s.u1,M=s.v0,A=s.v1,C,w,P=0;if(this.isTiled)for(M=s.v1,A=s.v0,w=0;w7&&C>7?M.push(m.r,m.g,m.b,c):M.push(S.r,S.g,S.b,d);var w=this.scene.sys.textures.addUint8Array(n(),new Uint8Array(M),16,16);return this.removeCheckerboard(),this.setTexture(w),this.setSizeToFrame(),this.setViewHeight(v),this},removeCheckerboard:function(){this._checkerboard&&(this._checkerboard.destroy(),this._checkerboard=null)},play:function(f,s){return this.anims.play(f,s)},playReverse:function(f,s){return this.anims.playReverse(f,s)},playAfterDelay:function(f,s){return this.anims.playAfterDelay(f,s)},playAfterRepeat:function(f,s){return this.anims.playAfterRepeat(f,s)},stop:function(){return this.anims.stop()},stopAfterDelay:function(f){return this.anims.stopAfterDelay(f)},stopAfterRepeat:function(f){return this.anims.stopAfterRepeat(f)},stopOnFrame:function(f){return this.anims.stopOnFrame(f)},preUpdate:function(f,s){l.prototype.preUpdate.call(this,f,s),this.anims.update(f,s)},preDestroy:function(){this.clear(),this.removeCheckerboard(),this.anims.destroy(),this.anims=void 0,this.debugCallback=null,this.debugGraphic=null}});a.exports=u},56015:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(13059),h=t(44603),o=t(23568),l=t(35154),n=t(33663);h.register("plane",function(u,f){u===void 0&&(u={});var s=o(u,"key",null),c=o(u,"frame",null),d=l(u,"width",8),v=l(u,"height",8),m=l(u,"tile",!1),S=new n(this.scene,0,0,s,c,d,v,m);f!==void 0&&(u.add=f);var M=l(u,"checkerboard",null);if(M){var A=l(M,"color1",16777215),C=l(M,"color2",255),w=l(M,"alpha1",255),P=l(M,"alpha2",255),L=l(M,"height",128);S.createCheckerboard(A,C,w,P,L)}return r(this.scene,S,u),p(S,u),S})},30985:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33663),p=t(39429);p.register("plane",function(h,o,l,n,u,f,s){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s))})},80321:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(95643),o=t(30100),l=t(36060),n=t(67277),u=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.Mask,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible,n],initialize:function(s,c,d,v,m,S,M){v===void 0&&(v=16777215),m===void 0&&(m=128),S===void 0&&(S=1),M===void 0&&(M=.1),h.call(this,s,"PointLight"),this.initPipeline(l.POINTLIGHT_PIPELINE),this.initPostPipeline(),this.setPosition(c,d),this.color=o(v),this.intensity=S,this.attenuation=M,this.width=m*2,this.height=m*2,this._radius=m},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this.width=f*2,this.height=f*2}},originX:{get:function(){return .5}},originY:{get:function(){return .5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});a.exports=u},39829:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(80321);p.register("pointlight",function(l,n){l===void 0&&(l={});var u=h(l,"color",16777215),f=h(l,"radius",128),s=h(l,"intensity",1),c=h(l,"attenuation",.1),d=new o(this.scene,0,0,u,f,s,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},71255:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(80321);r.register("pointlight",function(h,o,l,n,u,f){return this.displayList.add(new p(this.scene,h,o,l,n,u,f))})},67277:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(57787),a.exports={renderWebGL:p,renderCanvas:h}},57787:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=function(h,o,l,n){l.addToRenderList(o);var u=h.pipelines.set(o.pipeline),f=r(o,l,n).calc,s=o.width,c=o.height,d=-o._radius,v=-o._radius,m=d+s,S=v+c,M=f.getX(0,0),A=f.getY(0,0),C=f.getX(d,v),w=f.getY(d,v),P=f.getX(d,S),L=f.getY(d,S),O=f.getX(m,S),I=f.getY(m,S),D=f.getX(m,v),B=f.getY(m,v);h.pipelines.preBatch(o),u.batchPointLight(o,l,C,w,P,L,O,I,D,B,M,A),h.pipelines.postBatch(o)};a.exports=p},591:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(81320),h=t(88571),o=new r({Extends:h,initialize:function(n,u,f,s,c){u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=32),c===void 0&&(c=32);var d=new p(n.sys.textures,"",s,c);h.call(this,n,u,f,d),this.type="RenderTexture",this.camera=this.texture.camera,this._saved=!1},setSize:function(l,n){this.width=l,this.height=n,this.texture.setSize(l,n),this.updateDisplayOrigin();var u=this.input;return u&&!u.customHitArea&&(u.hitArea.width=l,u.hitArea.height=n),this},resize:function(l,n){return this.setSize(l,n),this},saveTexture:function(l){var n=this.texture;return n.key=l,n.manager.addDynamicTexture(n)&&(this._saved=!0),n},fill:function(l,n,u,f,s,c){return this.texture.fill(l,n,u,f,s,c),this},clear:function(){return this.texture.clear(),this},stamp:function(l,n,u,f,s){return this.texture.stamp(l,n,u,f,s),this},erase:function(l,n,u){return this.texture.erase(l,n,u),this},draw:function(l,n,u,f,s){return this.texture.draw(l,n,u,f,s),this},drawFrame:function(l,n,u,f,s,c){return this.texture.drawFrame(l,n,u,f,s,c),this},repeat:function(l,n,u,f,s,c,d,v,m){return this.texture.repeat(l,n,u,f,s,c,d,v,m),this},beginDraw:function(){return this.texture.beginDraw(),this},batchDraw:function(l,n,u,f,s){return this.texture.batchDraw(l,n,u,f,s),this},batchDrawFrame:function(l,n,u,f,s,c){return this.texture.batchDrawFrame(l,n,u,f,s,c),this},endDraw:function(l){return this.texture.endDraw(l),this},snapshotArea:function(l,n,u,f,s,c,d){return this.texture.snapshotArea(l,n,u,f,s,c,d),this},snapshot:function(l,n,u){return this.snapshotArea(0,0,this.width,this.height,l,n,u)},snapshotPixel:function(l,n,u){return this.snapshotArea(l,n,1,1,u,"pixel")},preDestroy:function(){this.camera=null,this._saved||this.texture.destroy()}});a.exports=o},34495:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(591);p.register("renderTexture",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),s=h(l,"width",32),c=h(l,"height",32),d=new o(this.scene,u,f,s,c);return n!==void 0&&(l.add=n),r(this.scene,d,l),d})},60505:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(591);r.register("renderTexture",function(h,o,l,n){return this.displayList.add(new p(this.scene,h,o,l,n))})},77757:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(9674),p=t(83419),h=t(31401),o=t(95643),l=t(36060),n=t(38745),u=t(26099),f=new p({Extends:o,Mixins:[h.AlphaSingle,h.BlendMode,h.Depth,h.Flip,h.Mask,h.Pipeline,h.PostPipeline,h.Size,h.Texture,h.Transform,h.Visible,h.ScrollFactor,n],initialize:function(c,d,v,m,S,M,A,C,w){m===void 0&&(m="__DEFAULT"),M===void 0&&(M=2),A===void 0&&(A=!0),o.call(this,c,"Rope"),this.anims=new r(this),this.points=M,this.vertices,this.uv,this.colors,this.alphas,this.tintFill=m==="__DEFAULT",this.dirty=!1,this.horizontal=A,this._flipX=!1,this._flipY=!1,this._perp=new u,this.debugCallback=null,this.debugGraphic=null,this.setTexture(m,S),this.setPosition(d,v),this.setSizeToFrame(),this.initPipeline(l.ROPE_PIPELINE),this.initPostPipeline(),Array.isArray(M)&&this.resizeArrays(M.length),this.setPoints(M,C,w),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(s,c){var d=this.anims.currentFrame;this.anims.update(s,c),this.anims.currentFrame!==d&&(this.updateUVs(),this.updateVertices())},play:function(s,c,d){return this.anims.play(s,c,d),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(s,c,d){return s===void 0&&(s=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(s,c,d))},setVertical:function(s,c,d){return s===void 0&&(s=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(s,c,d)):this},setTintFill:function(s){return s===void 0&&(s=!1),this.tintFill=s,this},setAlphas:function(s,c){var d=this.points.length;if(d<1)return this;var v=this.alphas;s===void 0?s=[1]:!Array.isArray(s)&&c===void 0&&(s=[s]);var m,S=0;if(c!==void 0)for(m=0;mS&&(M=s[S]),v[S]=M,s.length>S+1&&(M=s[S+1]),v[S+1]=M}return this},setColors:function(s){var c=this.points.length;if(c<1)return this;var d=this.colors;s===void 0?s=[16777215]:Array.isArray(s)||(s=[s]);var v,m=0;if(s.length===c)for(v=0;vm&&(S=s[m]),d[m]=S,s.length>m+1&&(S=s[m+1]),d[m+1]=S}return this},setPoints:function(s,c,d){if(s===void 0&&(s=2),typeof s=="number"){var v=s;v<2&&(v=2),s=[];var m,S,M;if(this.horizontal)for(M=-this.frame.halfWidth,S=this.frame.width/(v-1),m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){};a.exports=y},26209:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(35154),l=t(77757);p.register("rope",function(n,u){n===void 0&&(n={});var f=h(n,"key",null),s=h(n,"frame",null),c=h(n,"horizontal",!0),d=o(n,"points",void 0),v=o(n,"colors",void 0),m=o(n,"alphas",void 0),S=new l(this.scene,0,0,f,s,d,c,v,m);return u!==void 0&&(n.add=u),r(this.scene,S,n),S})},96819:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(77757),p=t(39429);p.register("rope",function(h,o,l,n,u,f,s,c){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s,c))})},38745:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(20439),h=t(95262),a.exports={renderWebGL:p,renderCanvas:h}},20439:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){n.addToRenderList(l);var f=o.pipelines.set(l.pipeline,l),s=r(l,n,u).calc,c=l.vertices,d=l.uv,v=l.colors,m=l.alphas,S=l.alpha,M=p.getTintAppendFloatAlpha,A=n.roundPixels,C=c.length,w=Math.floor(C*.5);f.flush(),o.pipelines.preBatch(l);var P=f.setGameObject(l),L=f.vertexViewF32,O=f.vertexViewU32,I=f.vertexCount*f.currentShader.vertexComponentCount-1,D=0,B=l.tintFill;l.dirty&&l.updateVertices();for(var G=l.debugCallback,z=[],W=0;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(95643),o=t(95540),l=t(79291),n=t(61622),u=t(25479),f=t(61340),s=t(95428),c=t(92503),d=new r({Extends:h,Mixins:[p.ComputedSize,p.Depth,p.GetBounds,p.Mask,p.Origin,p.ScrollFactor,p.Transform,p.Visible,u],initialize:function(m,S,M,A,C,w,P,L){M===void 0&&(M=0),A===void 0&&(A=0),C===void 0&&(C=128),w===void 0&&(w=128),h.call(this,m,"Shader"),this.blendMode=-1,this.shader;var O=m.sys.renderer;this.renderer=O,this.gl=O.gl,this.vertexData=new ArrayBuffer(6*(Float32Array.BYTES_PER_ELEMENT*2)),this.vertexBuffer=O.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 f,this._tempMatrix2=new f,this._tempMatrix3=new f,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=O.width,this._rendererHeight=O.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(M,A),this.setSize(C,w),this.setOrigin(.5,.5),this.setShader(S,P,L),this.renderer.on(c.RESTORE_WEBGL,this.onContextRestored,this)},willRender:function(v){return this.renderToTexture?!0:!(h.RENDER_MASK!==this.renderFlags||this.cameraFilter!==0&&this.cameraFilter&v.id)},setRenderToTexture:function(v,m){if(!this.renderToTexture){var S=this.width,M=this.height,A=this.renderer;this.glTexture=A.createTextureFromSource(null,S,M,0),this.framebuffer=A.createFramebuffer(S,M,this.glTexture,!1),this._rendererWidth=S,this._rendererHeight=M,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),v&&(this.texture=this.scene.sys.textures.addGLTexture(v,this.glTexture))}return this.shader&&(A.pipelines.clear(),this.load(),this.flush(),A.pipelines.rebind()),this},setShader:function(v,m,S){if(this.renderer.contextLost)return this._deferSetShader={key:v,textures:m,textureData:S},this;if(m===void 0&&(m=[]),typeof v=="string"){var M=this.scene.sys.cache.shader;if(!M.has(v))return console.warn("Shader missing: "+v),this;this.shader=M.get(v)}else this.shader=v;var A=this.gl,C=this.renderer;this.program&&C.deleteProgram(this.program);var w=C.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);A.uniformMatrix4fv(A.getUniformLocation(w.webGLProgram,"uViewMatrix"),!1,this.viewMatrix),A.uniformMatrix4fv(A.getUniformLocation(w.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),A.uniform2f(A.getUniformLocation(w.webGLProgram,"uResolution"),this.width,this.height),this.program=w;var P=new Date,L={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[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=l(!0,{},this.shader.uniforms,L):this.uniforms=L;for(var O=0;O<4;O++)m[O]&&this.setSampler2D("iChannel"+O,m[O],O,S);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(v){return this.pointer=v,this},projOrtho:function(v,m,S,M){if(this.renderer.contextLost){this._deferProjOrtho={left:v,right:m,bottom:S,top:M};return}var A=-1e3,C=1e3,w=1/(v-m),P=1/(S-M),L=1/(A-C),O=this.projectionMatrix;O[0]=-2*w,O[5]=-2*P,O[10]=2*L,O[12]=(v+m)*w,O[13]=(M+S)*P,O[14]=(C+A)*L;var I=this.program,D=this.gl,B=this.renderer;B.setProgram(I),D.uniformMatrix4fv(D.getUniformLocation(I.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=m,this._rendererHeight=S},initUniforms:function(){var v=this.renderer.glFuncMap,m=this.program;this._textureCount=0;for(var S in this.uniforms){var M=this.uniforms[S],A=M.type,C=v[A];M.uniformLocation=this.renderer.createUniformLocation(m,S),A!=="sampler2D"&&(M.glMatrix=C.matrix,M.glValueLength=C.length,M.glFunc=C.func)}},setSampler2DBuffer:function(v,m,S,M,A,C){A===void 0&&(A=0),C===void 0&&(C={});var w=this.uniforms[v];return w.value=m,C.width=S,C.height=M,w.textureData=C,this._textureCount=A,this.initSampler2D(w),this},setSampler2D:function(v,m,S,M){S===void 0&&(S=0);var A=this.scene.sys.textures;if(A.exists(m)){var C=A.getFrame(m);if(C.glTexture&&C.glTexture.isRenderTexture)return this.setSampler2DBuffer(v,C.glTexture,C.width,C.height,S,M);var w=this.uniforms[v],P=C.source;w.textureKey=m,w.source=P.image,w.value=C.glTexture,P.isGLTexture&&(M||(M={}),M.width=P.width,M.height=P.height),M&&(w.textureData=M),this._textureCount=S,this.initSampler2D(w)}return this},setUniform:function(v,m){return n(this.uniforms,v,m),this},getUniform:function(v){return o(this.uniforms,v,null)},setChannel0:function(v,m){return this.setSampler2D("iChannel0",v,0,m)},setChannel1:function(v,m){return this.setSampler2D("iChannel1",v,1,m)},setChannel2:function(v,m){return this.setSampler2D("iChannel2",v,2,m)},setChannel3:function(v,m){return this.setSampler2D("iChannel3",v,3,m)},initSampler2D:function(v){if(v.value){var m=v.textureData;if(m&&!v.value.isRenderTexture){var S=this.gl,M=v.value,A=S[o(m,"magFilter","linear").toUpperCase()],C=S[o(m,"minFilter","linear").toUpperCase()],w=S[o(m,"wrapS","repeat").toUpperCase()],P=S[o(m,"wrapT","repeat").toUpperCase()],L=S[o(m,"format","rgba").toUpperCase()],O=o(m,"flipY",!1),I=o(m,"width",M.width),D=o(m,"height",M.height),B=o(m,"source",M.pixels);m.repeat&&(w=S.REPEAT,P=S.REPEAT),m.width&&(B=null),M.update(B,I,D,O,w,P,C,A,L)}this.renderer.setProgram(this.program),this._textureCount++}},syncUniforms:function(){var v=this.gl,m=this.uniforms,S,M,A,C,w,P=0;for(var L in m)S=m[L],A=S.glFunc,M=S.glValueLength,C=S.uniformLocation,w=S.value,w!==null&&(M===1?S.glMatrix?A.call(v,C.webGLUniformLocation,S.transpose,w):A.call(v,C.webGLUniformLocation,w):M===2?A.call(v,C.webGLUniformLocation,w.x,w.y):M===3?A.call(v,C.webGLUniformLocation,w.x,w.y,w.z):M===4?A.call(v,C.webGLUniformLocation,w.x,w.y,w.z,w.w):S.type==="sampler2D"&&(v.activeTexture(v.TEXTURE0+P),v.bindTexture(v.TEXTURE_2D,w.webGLTexture),v.uniform1i(C.webGLUniformLocation,P),P++))},load:function(v){var m=this.gl,S=this.width,M=this.height,A=this.renderer,C=this.program,w=this.viewMatrix;if(!this.renderToTexture){var P=-this._displayOriginX,L=-this._displayOriginY;w[0]=v[0],w[1]=v[1],w[4]=v[2],w[5]=v[3],w[8]=v[4],w[9]=v[5],w[12]=w[0]*P+w[4]*L,w[13]=w[1]*P+w[5]*L}m.useProgram(C.webGLProgram),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uViewMatrix"),!1,w),m.uniformMatrix4fv(m.getUniformLocation(C.webGLProgram,"uProjectionMatrix"),!1,this.projectionMatrix),m.uniform2f(m.getUniformLocation(C.webGLProgram,"uResolution"),this.width,this.height);var O=this.uniforms,I=O.resolution;I.value.x=S,I.value.y=M,O.time.value=A.game.loop.getDuration();var D=this.pointer;if(D){var B=O.mouse,G=D.x/S,z=1-D.y/M;B.value.x=G.toFixed(2),B.value.y=z.toFixed(2)}this.syncUniforms()},flush:function(){var v=this.width,m=this.height,S=this.program,M=this.gl,A=this.vertexBuffer,C=this.renderer,w=Float32Array.BYTES_PER_ELEMENT*2;this.renderToTexture&&(C.setFramebuffer(this.framebuffer),M.clearColor(0,0,0,0),M.clear(M.COLOR_BUFFER_BIT)),M.bindBuffer(M.ARRAY_BUFFER,A.webGLBuffer);var P=M.getAttribLocation(S.webGLProgram,"inPosition");P!==-1&&(M.enableVertexAttribArray(P),M.vertexAttribPointer(P,2,M.FLOAT,!1,w,0));var L=this.vertexViewF32;L[3]=m,L[4]=v,L[5]=m,L[8]=v,L[9]=m,L[10]=v;var O=6;M.bufferSubData(M.ARRAY_BUFFER,0,this.bytes.subarray(0,O*w)),M.drawArrays(M.TRIANGLES,0,O),this.renderToTexture&&C.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},onContextRestored:function(){if(this._deferSetShader!==null){var v=this._deferSetShader.key,m=this._deferSetShader.textures,S=this._deferSetShader.textureData;this._deferSetShader=null,this.setShader(v,m,S)}if(this._deferProjOrtho!==null){var M=this._deferProjOrtho.left,A=this._deferProjOrtho.right,C=this._deferProjOrtho.bottom,w=this._deferProjOrtho.top;this._deferProjOrtho=null,this.projOrtho(M,A,C,w)}},preDestroy:function(){var v=this.renderer;v.off(c.RESTORE_WEBGL,this.onContextRestored,this),v.deleteProgram(this.program),v.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(v.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null),s(this.uniforms,function(m){v.deleteUniformLocation(m.uniformLocation),m.uniformLocation=null})}});a.exports=d},80464:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){};a.exports=y},54935:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(20071);p.register("shader",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=h(l,"x",0),s=h(l,"y",0),c=h(l,"width",128),d=h(l,"height",128),v=new o(this.scene,u,f,s,c,d);return n!==void 0&&(l.add=n),r(this.scene,v,l),v})},74177:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20071),p=t(39429);p.register("shader",function(h,o,l,n,u,f,s){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s))})},25479:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(19257),h=t(80464),a.exports={renderWebGL:p,renderCanvas:h}},19257:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=function(h,o,l,n){if(o.shader){if(l.addToRenderList(o),h.pipelines.clear(),o.renderToTexture)o.load(),o.flush();else{var u=r(o,l,n).calc;(h.width!==o._rendererWidth||h.height!==o._rendererHeight)&&o.projOrtho(0,h.width,h.height,0),o.load(u.matrix),o.flush()}h.pipelines.rebind()}};a.exports=p},10441:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70554),p=function(h,o,l,n,u,f){for(var s=r.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*n),c=l.pathData,d=l.pathIndexes,v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=p||r.fillColor,l=h||r.fillAlpha,n=(o&16711680)>>>16,u=(o&65280)>>>8,f=o&255;t.fillStyle="rgba("+n+","+u+","+f+","+l+")"};a.exports=y},75177:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=p||r.strokeColor,l=h||r.strokeAlpha,n=(o&16711680)>>>16,u=(o&65280)>>>8,f=o&255;t.strokeStyle="rgba("+n+","+u+","+f+","+l+")",t.lineWidth=r.lineWidth};a.exports=y},17803:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(95643),o=t(23031),l=new r({Extends:h,Mixins:[p.AlphaSingle,p.BlendMode,p.Depth,p.GetBounds,p.Mask,p.Origin,p.Pipeline,p.PostPipeline,p.ScrollFactor,p.Transform,p.Visible],initialize:function(u,f,s){f===void 0&&(f="Shape"),h.call(this,u,f),this.geom=s,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline(),this.initPostPipeline()},setFillStyle:function(n,u){return u===void 0&&(u=1),n===void 0?this.isFilled=!1:(this.fillColor=n,this.fillAlpha=u,this.isFilled=!0),this},setStrokeStyle:function(n,u,f){return f===void 0&&(f=1),n===void 0?this.isStroked=!1:(this.lineWidth=n,this.strokeColor=u,this.strokeAlpha=f,this.isStroked=!0),this},setClosePath:function(n){return this.closePath=n,this},setSize:function(n,u){return this.width=n,this.height=u,this},setDisplaySize:function(n,u){return this.displayWidth=n,this.displayHeight=u,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(n){this.scaleX=n/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(n){this.scaleY=n/this.height}}});a.exports=l},34682:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70554),p=function(h,o,l,n,u){var f=h.strokeTint,s=r.getTintAppendFloatAlpha(o.strokeColor,o.strokeAlpha*l);f.TL=s,f.TR=s,f.BL=s,f.BR=s;var c=o.pathData,d=c.length-1,v=o.lineWidth,m=v/2,S=c[0]-n,M=c[1]-u;o.closePath||(d-=2);for(var A=2;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13609),p=t(83419),h=t(39506),o=t(94811),l=t(96503),n=t(36383),u=t(17803),f=new p({Extends:u,Mixins:[r],initialize:function(c,d,v,m,S,M,A,C,w){d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=128),S===void 0&&(S=0),M===void 0&&(M=360),A===void 0&&(A=!1),u.call(this,c,"Arc",new l(0,0,m)),this._startAngle=S,this._endAngle=M,this._anticlockwise=A,this._iterations=.01,this.setPosition(d,v);var P=this.geom.radius*2;this.setSize(P,P),C!==void 0&&this.setFillStyle(C,w),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 c=s*2;this.setSize(c,c),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,c){return this._startAngle=s,c!==void 0&&(this._anticlockwise=c),this.updateData()},setEndAngle:function(s,c){return this._endAngle=s,c!==void 0&&(this._anticlockwise=c),this.updateData()},updateData:function(){var s=this._iterations,c=s,d=this.geom.radius,v=h(this._startAngle),m=h(this._endAngle),S=this._anticlockwise,M=d,A=d;m-=v,S?m<-n.PI2?m=-n.PI2:m>0&&(m=-n.PI2+m%n.PI2):m>n.PI2?m=n.PI2:m<0&&(m=n.PI2+m%n.PI2);for(var C=[M+Math.cos(v)*d,A+Math.sin(v)*d],w;c<1;)w=m*c+v,C.push(M+Math.cos(w)*d,A+Math.sin(w)*d),c+=s;return w=m+v,C.push(M+Math.cos(w)*d,A+Math.sin(w)*d),C.push(M+Math.cos(v)*d,A+Math.sin(v)*d),this.pathIndexes=o(C),this.pathData=C,this}});a.exports=f},42542:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39506),p=t(65960),h=t(75177),o=t(20926),l=function(n,u,f,s){f.addToRenderList(u);var c=n.currentContext;if(o(n,c,u,f,s)){var d=u.radius;c.beginPath(),c.arc(d-u.originX*(d*2),d-u.originY*(d*2),d,r(u._startAngle),r(u._endAngle),u.anticlockwise),u.closePath&&c.closePath(),u.isFilled&&(p(c,u),c.fill()),u.isStroked&&(h(c,u),c.stroke()),c.restore()}};a.exports=l},42563:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23629),p=t(39429);p.register("arc",function(h,o,l,n,u,f,s,c){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s,c))}),p.register("circle",function(h,o,l,n,u){return this.displayList.add(new r(this.scene,h,o,l,0,360,!1,n,u))})},13609:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(41447),h=t(42542),a.exports={renderWebGL:p,renderCanvas:h}},41447:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(10441),h=t(34682),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=r(n,u,f),d=s.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&p(s,d,n,S,v,m),n.isStroked&&h(s,n,S,v,m),l.pipelines.postBatch(n)};a.exports=o},89:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(33141),h=t(94811),o=t(87841),l=t(17803),n=new r({Extends:l,Mixins:[p],initialize:function(f,s,c,d,v,m){s===void 0&&(s=0),c===void 0&&(c=0),l.call(this,f,"Curve",d),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(s,c),v!==void 0&&this.setFillStyle(v,m),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){var u=this._curveBounds,f=this._smoothness;this.geom.getBounds(u,f),this.setSize(u.width,u.height),this.updateDisplayOrigin();for(var s=[],c=this.geom.getPoints(f),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX+n._curveBounds.x,d=n._displayOriginY+n._curveBounds.y,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;s.beginPath(),s.moveTo(S,M),n.closePath||(m-=2);for(var A=2;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(89);r.register("curve",function(h,o,l,n,u){return this.displayList.add(new p(this.scene,h,o,l,n,u))})},33141:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(53987),h=t(3170),a.exports={renderWebGL:p,renderCanvas:h}},53987:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10441),p=t(91296),h=t(34682),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=p(n,u,f),d=s.calcMatrix.copyFrom(c.calc),v=n._displayOriginX+n._curveBounds.x,m=n._displayOriginY+n._curveBounds.y,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(s,d,n,S,v,m),n.isStroked&&h(s,n,S,v,m),l.pipelines.postBatch(n)};a.exports=o},19921:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(94811),h=t(54205),o=t(8497),l=t(17803),n=new r({Extends:l,Mixins:[h],initialize:function(f,s,c,d,v,m,S){s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=128),l.call(this,f,"Ellipse",new o(d/2,v/2,d,v)),this._smoothness=64,this.setPosition(s,c),this.width=d,this.height=v,m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(u){this._smoothness=u,this.updateData()}},setSize:function(u,f){return this.width=u,this.height=f,this.geom.setPosition(u/2,f/2),this.geom.setSize(u,f),this.updateData()},setSmoothness:function(u){return this._smoothness=u,this.updateData()},updateData:function(){for(var u=[],f=this.geom.getPoints(this._smoothness),s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;s.beginPath(),s.moveTo(S,M),n.closePath||(m-=2);for(var A=2;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19921),p=t(39429);p.register("ellipse",function(h,o,l,n,u,f){return this.displayList.add(new r(this.scene,h,o,l,n,u,f))})},54205:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(19467),h=t(7930),a.exports={renderWebGL:p,renderCanvas:h}},19467:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10441),p=t(91296),h=t(34682),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=p(n,u,f),d=s.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(s,d,n,S,v,m),n.isStroked&&h(s,n,S,v,m),l.pipelines.postBatch(n)};a.exports=o},30479:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(17803),h=t(26015),o=new r({Extends:p,Mixins:[h],initialize:function(n,u,f,s,c,d,v,m,S,M,A){u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=128),c===void 0&&(c=128),d===void 0&&(d=32),v===void 0&&(v=32),p.call(this,n,"Grid",null),this.cellWidth=d,this.cellHeight=v,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(u,f),this.setSize(s,c),this.setFillStyle(m,S),M!==void 0&&this.setOutlineStyle(M,A),this.updateDisplayOrigin()},setFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showCells=!1:(this.fillColor=l,this.fillAlpha=n,this.showCells=!0),this},setAltFillStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showAltCells=!1:(this.altFillColor=l,this.altFillAlpha=n,this.showAltCells=!0),this},setOutlineStyle:function(l,n){return n===void 0&&(n=1),l===void 0?this.showOutline=!1:(this.outlineFillColor=l,this.outlineFillAlpha=n,this.showOutline=!0),this}});a.exports=o},49912:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=-n._displayOriginX,d=-n._displayOriginY,v=u.alpha*n.alpha,m=n.width,S=n.height,M=n.cellWidth,A=n.cellHeight,C=Math.ceil(m/M),w=Math.ceil(S/A),P=M,L=A,O=M-(C*M-m),I=A-(w*A-S),D=n.showCells,B=n.showAltCells,G=n.showOutline,z=0,W=0,k=0,J=0,Q=0;if(G&&(P--,L--,O===M&&O--,I===A&&I--),D&&n.fillAlpha>0)for(r(s,n),W=0;W0)for(r(s,n,n.altFillColor,n.altFillAlpha*v),W=0;W0){for(p(s,n,n.outlineFillColor,n.outlineFillAlpha*v),z=1;z{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(30479);r.register("grid",function(h,o,l,n,u,f,s,c,d,v){return this.displayList.add(new p(this.scene,h,o,l,n,u,f,s,c,d,v))})},26015:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(46161),h=t(49912),a.exports={renderWebGL:p,renderCanvas:h}},46161:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){n.addToRenderList(l);var f=o.pipelines.set(l.pipeline),s=r(l,n,u),c=f.calcMatrix.copyFrom(s.calc);c.translate(-l._displayOriginX,-l._displayOriginY);var d=n.alpha*l.alpha,v=l.width,m=l.height,S=l.cellWidth,M=l.cellHeight,A=Math.ceil(v/S),C=Math.ceil(m/M),w=S,P=M,L=S-(A*S-v),O=M-(C*M-m),I,D,B=l.showCells,G=l.showAltCells,z=l.showOutline,W=0,k=0,J=0,Q=0,Y=0;if(z&&(w--,P--,L===S&&L--,O===M&&O--),o.pipelines.preBatch(l),B&&l.fillAlpha>0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.fillColor,l.fillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,k=0;k0)for(I=f.fillTint,D=p.getTintAppendFloatAlpha(l.altFillColor,l.altFillAlpha*d),I.TL=D,I.TR=D,I.BL=D,I.BR=D,k=0;k0){var K=f.strokeTint,U=p.getTintAppendFloatAlpha(l.outlineFillColor,l.outlineFillAlpha*d);for(K.TL=U,K.TR=U,K.BL=U,K.BR=U,W=1;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(99651),p=t(83419),h=t(17803),o=new p({Extends:h,Mixins:[r],initialize:function(n,u,f,s,c,d,v,m){u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=48),c===void 0&&(c=32),d===void 0&&(d=15658734),v===void 0&&(v=10066329),m===void 0&&(m=13421772),h.call(this,n,"IsoBox",null),this.projection=4,this.fillTop=d,this.fillLeft=v,this.fillRight=m,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(u,f),this.setSize(s,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});a.exports=o},11508:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(20926),h=function(o,l,n,u){n.addToRenderList(l);var f=o.currentContext;if(p(o,f,l,n,u)&&l.isFilled){var s=l.width,c=l.height,d=s/2,v=s/l.projection;l.showTop&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(d,-1),f.lineTo(0,v-1),f.lineTo(-d,-1),f.lineTo(-d,-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(-d,-c),f.lineTo(-d,0),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c),f.lineTo(d,-c),f.lineTo(d,0),f.fill()),f.restore()}};a.exports=h},3933:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(61475);r.register("isobox",function(h,o,l,n,u,f,s){return this.displayList.add(new p(this.scene,h,o,l,n,u,f,s))})},99651:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(68149),h=t(11508),a.exports={renderWebGL:p,renderCanvas:h}},68149:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){n.addToRenderList(l);var f=o.pipelines.set(l.pipeline),s=r(l,n,u),c=f.calcMatrix.copyFrom(s.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=n.alpha*l.alpha;if(l.isFilled){var A,C,w,P,L,O,I,D,B;o.pipelines.preBatch(l),l.showTop&&(A=p.getTintAppendFloatAlpha(l.fillTop,M),C=c.getX(-m,-v),w=c.getY(-m,-v),P=c.getX(0,-S-v),L=c.getY(0,-S-v),O=c.getX(m,-v),I=c.getY(m,-v),D=c.getX(0,S-v),B=c.getY(0,S-v),f.batchQuad(l,C,w,P,L,O,I,D,B,0,0,1,1,A,A,A,A,2)),l.showLeft&&(A=p.getTintAppendFloatAlpha(l.fillLeft,M),C=c.getX(-m,0),w=c.getY(-m,0),P=c.getX(0,S),L=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(-m,-v),B=c.getY(-m,-v),f.batchQuad(l,C,w,P,L,O,I,D,B,0,0,1,1,A,A,A,A,2)),l.showRight&&(A=p.getTintAppendFloatAlpha(l.fillRight,M),C=c.getX(m,0),w=c.getY(m,0),P=c.getX(0,S),L=c.getY(0,S),O=c.getX(0,S-v),I=c.getY(0,S-v),D=c.getX(m,-v),B=c.getY(m,-v),f.batchQuad(l,C,w,P,L,O,I,D,B,0,0,1,1,A,A,A,A,2)),o.pipelines.postBatch(l)}};a.exports=h},16933:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(60561),h=t(17803),o=new r({Extends:h,Mixins:[p],initialize:function(n,u,f,s,c,d,v,m,S){u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s=48),c===void 0&&(c=32),d===void 0&&(d=!1),v===void 0&&(v=15658734),m===void 0&&(m=10066329),S===void 0&&(S=13421772),h.call(this,n,"IsoTriangle",null),this.projection=4,this.fillTop=v,this.fillLeft=m,this.fillRight=S,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=d,this.isFilled=!0,this.setPosition(u,f),this.setSize(s,c),this.updateDisplayOrigin()},setProjection:function(l){return this.projection=l,this},setReversed:function(l){return this.isReversed=l,this},setFaces:function(l,n,u){return l===void 0&&(l=!0),n===void 0&&(n=!0),u===void 0&&(u=!0),this.showTop=l,this.showLeft=n,this.showRight=u,this},setFillStyle:function(l,n,u){return this.fillTop=l,this.fillLeft=n,this.fillRight=u,this.isFilled=!0,this}});a.exports=o},79590:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(20926),h=function(o,l,n,u){n.addToRenderList(l);var f=o.currentContext;if(p(o,f,l,n,u)&&l.isFilled){var s=l.width,c=l.height,d=s/2,v=s/l.projection,m=l.isReversed;l.showTop&&m&&(r(f,l,l.fillTop),f.beginPath(),f.moveTo(-d,-c),f.lineTo(0,-v-c),f.lineTo(d,-c),f.lineTo(0,v-c),f.fill()),l.showLeft&&(r(f,l,l.fillLeft),f.beginPath(),m?(f.moveTo(-d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(-d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),l.showRight&&(r(f,l,l.fillRight),f.beginPath(),m?(f.moveTo(d,-c),f.lineTo(0,v),f.lineTo(0,v-c)):(f.moveTo(d,0),f.lineTo(0,v),f.lineTo(0,v-c)),f.fill()),f.restore()}};a.exports=h},49803:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(16933);r.register("isotriangle",function(h,o,l,n,u,f,s,c){return this.displayList.add(new p(this.scene,h,o,l,n,u,f,s,c))})},60561:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(51503),h=t(79590),a.exports={renderWebGL:p,renderCanvas:h}},51503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){n.addToRenderList(l);var f=o.pipelines.set(l.pipeline),s=r(l,n,u),c=f.calcMatrix.copyFrom(s.calc),d=l.width,v=l.height,m=d/2,S=d/l.projection,M=l.isReversed,A=n.alpha*l.alpha;if(l.isFilled){o.pipelines.preBatch(l);var C,w,P,L,O,I,D;if(l.showTop&&M){C=p.getTintAppendFloatAlpha(l.fillTop,A),w=c.getX(-m,-v),P=c.getY(-m,-v),L=c.getX(0,-S-v),O=c.getY(0,-S-v),I=c.getX(m,-v),D=c.getY(m,-v);var B=c.getX(0,S-v),G=c.getY(0,S-v);f.batchQuad(l,w,P,L,O,I,D,B,G,0,0,1,1,C,C,C,C,2)}l.showLeft&&(C=p.getTintAppendFloatAlpha(l.fillLeft,A),M?(w=c.getX(-m,-v),P=c.getY(-m,-v),L=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(w=c.getX(-m,0),P=c.getY(-m,0),L=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,w,P,L,O,I,D,0,0,1,1,C,C,C,2)),l.showRight&&(C=p.getTintAppendFloatAlpha(l.fillRight,A),M?(w=c.getX(m,-v),P=c.getY(m,-v),L=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)):(w=c.getX(m,0),P=c.getY(m,0),L=c.getX(0,S),O=c.getY(0,S),I=c.getX(0,S-v),D=c.getY(0,S-v)),f.batchTri(l,w,P,L,O,I,D,0,0,1,1,C,C,C,2)),o.pipelines.postBatch(l)}};a.exports=h},57847:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(17803),h=t(23031),o=t(36823),l=new r({Extends:p,Mixins:[o],initialize:function(u,f,s,c,d,v,m,S,M){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=128),m===void 0&&(m=0),p.call(this,u,"Line",new h(c,d,v,m));var A=Math.max(1,this.geom.right-this.geom.left),C=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(f,s),this.setSize(A,C),S!==void 0&&this.setStrokeStyle(1,S,M),this.updateDisplayOrigin()},setLineWidth:function(n,u){return u===void 0&&(u=n),this._startWidth=n,this._endWidth=u,this.lineWidth=n,this},setTo:function(n,u,f,s){return this.geom.setTo(n,u,f,s),this}});a.exports=l},17440:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(75177),p=t(20926),h=function(o,l,n,u){n.addToRenderList(l);var f=o.currentContext;if(p(o,f,l,n,u)){var s=l._displayOriginX,c=l._displayOriginY;l.isStroked&&(r(f,l),f.beginPath(),f.moveTo(l.geom.x1-s,l.geom.y1-c),f.lineTo(l.geom.x2-s,l.geom.y2-c),f.stroke()),f.restore()}};a.exports=h},2481:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(57847);r.register("line",function(h,o,l,n,u,f,s,c){return this.displayList.add(new p(this.scene,h,o,l,n,u,f,s,c))})},36823:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(77385),h=t(17440),a.exports={renderWebGL:p,renderCanvas:h}},77385:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(70554),h=function(o,l,n,u){n.addToRenderList(l);var f=o.pipelines.set(l.pipeline),s=r(l,n,u);f.calcMatrix.copyFrom(s.calc);var c=l._displayOriginX,d=l._displayOriginY,v=n.alpha*l.alpha;if(o.pipelines.preBatch(l),l.isStroked){var m=f.strokeTint,S=p.getTintAppendFloatAlpha(l.strokeColor,l.strokeAlpha*v);m.TL=S,m.TR=S,m.BL=S,m.BR=S,f.batchLine(l.geom.x1-c,l.geom.y1-d,l.geom.x2-c,l.geom.y2-d,l._startWidth/2,l._endWidth/2,1,0,!1,s.sprite,s.camera)}o.pipelines.postBatch(l)};a.exports=h},24949:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(90273),p=t(83419),h=t(94811),o=t(13829),l=t(25717),n=t(17803),u=t(5469),f=new p({Extends:n,Mixins:[r],initialize:function(c,d,v,m,S,M){d===void 0&&(d=0),v===void 0&&(v=0),n.call(this,c,"Polygon",new l(m));var A=o(this.geom);this.setPosition(d,v),this.setSize(A.width,A.height),S!==void 0&&this.setFillStyle(S,M),this.updateDisplayOrigin(),this.updateData()},smooth:function(s){s===void 0&&(s=1);for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;s.beginPath(),s.moveTo(S,M),n.closePath||(m-=2);for(var A=2;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(24949);r.register("polygon",function(h,o,l,n,u){return this.displayList.add(new p(this.scene,h,o,l,n,u))})},90273:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(73695),h=t(38710),a.exports={renderWebGL:p,renderCanvas:h}},73695:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10441),p=t(91296),h=t(34682),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=p(n,u,f),d=s.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(s,d,n,S,v,m),n.isStroked&&h(s,n,S,v,m),l.pipelines.postBatch(n)};a.exports=o},74561:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(87841),h=t(17803),o=t(95597),l=new r({Extends:h,Mixins:[o],initialize:function(u,f,s,c,d,v,m){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=128),d===void 0&&(d=128),h.call(this,u,"Rectangle",new p(0,0,c,d)),this.setPosition(f,s),this.setSize(c,d),v!==void 0&&this.setFillStyle(v,m),this.updateDisplayOrigin(),this.updateData()},setSize:function(n,u){this.width=n,this.height=u,this.geom.setSize(n,u),this.updateData(),this.updateDisplayOrigin();var f=this.input;return f&&!f.customHitArea&&(f.hitArea.width=n,f.hitArea.height=u),this},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),u.getLineD(f),n.push(f.x2,f.y2),this.pathData=n,this}});a.exports=l},48682:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY;n.isFilled&&(r(s,n),s.fillRect(-c,-d,n.width,n.height)),n.isStroked&&(p(s,n),s.beginPath(),s.rect(-c,-d,n.width,n.height),s.stroke()),s.restore()}};a.exports=o},87959:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(74561);r.register("rectangle",function(h,o,l,n,u,f){return this.displayList.add(new p(this.scene,h,o,l,n,u,f))})},95597:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(52059),h=t(48682),a.exports={renderWebGL:p,renderCanvas:h}},52059:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(34682),h=t(70554),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=r(n,u,f);s.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=s.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M,s.batchFillRect(-d,-v,n.width,n.height)}n.isStroked&&p(s,n,m,d,v),l.pipelines.postBatch(n)};a.exports=o},55911:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(81991),p=t(83419),h=t(94811),o=t(17803),l=new p({Extends:o,Mixins:[r],initialize:function(u,f,s,c,d,v,m,S){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=5),d===void 0&&(d=32),v===void 0&&(v=64),o.call(this,u,"Star",null),this._points=c,this._innerRadius=d,this._outerRadius=v,this.setPosition(f,s),this.setSize(v*2,v*2),m!==void 0&&this.setFillStyle(m,S),this.updateDisplayOrigin(),this.updateData()},setPoints:function(n){return this._points=n,this.updateData()},setInnerRadius:function(n){return this._innerRadius=n,this.updateData()},setOuterRadius:function(n){return this._outerRadius=n,this.updateData()},points:{get:function(){return this._points},set:function(n){this._points=n,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this.updateData()}},updateData:function(){var n=[],u=this._points,f=this._innerRadius,s=this._outerRadius,c=Math.PI/2*3,d=Math.PI/u,v=s,m=s;n.push(v,m+-s);for(var S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.pathData,m=v.length-1,S=v[0]-c,M=v[1]-d;s.beginPath(),s.moveTo(S,M),n.closePath||(m-=2);for(var A=2;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(55911),p=t(39429);p.register("star",function(h,o,l,n,u,f,s){return this.displayList.add(new r(this.scene,h,o,l,n,u,f,s))})},81991:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(57017),h=t(64272),a.exports={renderWebGL:p,renderCanvas:h}},57017:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10441),p=t(91296),h=t(34682),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=p(n,u,f),d=s.calcMatrix.copyFrom(c.calc),v=n._displayOriginX,m=n._displayOriginY,S=u.alpha*n.alpha;l.pipelines.preBatch(n),n.isFilled&&r(s,d,n,S,v,m),n.isStroked&&h(s,n,S,v,m),l.pipelines.postBatch(n)};a.exports=o},36931:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(17803),h=t(16483),o=t(96195),l=new r({Extends:p,Mixins:[o],initialize:function(u,f,s,c,d,v,m,S,M,A,C){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=128),v===void 0&&(v=64),m===void 0&&(m=0),S===void 0&&(S=128),M===void 0&&(M=128),p.call(this,u,"Triangle",new h(c,d,v,m,S,M));var w=this.geom.right-this.geom.left,P=this.geom.bottom-this.geom.top;this.setPosition(f,s),this.setSize(w,P),A!==void 0&&this.setFillStyle(A,C),this.updateDisplayOrigin(),this.updateData()},setTo:function(n,u,f,s,c,d){return this.geom.setTo(n,u,f,s,c,d),this.updateData()},updateData:function(){var n=[],u=this.geom,f=this._tempLine;return u.getLineA(f),n.push(f.x1,f.y1,f.x2,f.y2),u.getLineB(f),n.push(f.x2,f.y2),u.getLineC(f),n.push(f.x2,f.y2),this.pathData=n,this}});a.exports=l},85172:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(65960),p=t(75177),h=t(20926),o=function(l,n,u,f){u.addToRenderList(n);var s=l.currentContext;if(h(l,s,n,u,f)){var c=n._displayOriginX,d=n._displayOriginY,v=n.geom.x1-c,m=n.geom.y1-d,S=n.geom.x2-c,M=n.geom.y2-d,A=n.geom.x3-c,C=n.geom.y3-d;s.beginPath(),s.moveTo(v,m),s.lineTo(S,M),s.lineTo(A,C),s.closePath(),n.isFilled&&(r(s,n),s.fill()),n.isStroked&&(p(s,n),s.stroke()),s.restore()}};a.exports=o},45245:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(36931);r.register("triangle",function(h,o,l,n,u,f,s,c,d,v){return this.displayList.add(new p(this.scene,h,o,l,n,u,f,s,c,d,v))})},96195:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(83253),h=t(85172),a.exports={renderWebGL:p,renderCanvas:h}},83253:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=t(34682),h=t(70554),o=function(l,n,u,f){u.addToRenderList(n);var s=l.pipelines.set(n.pipeline),c=r(n,u,f);s.calcMatrix.copyFrom(c.calc);var d=n._displayOriginX,v=n._displayOriginY,m=u.alpha*n.alpha;if(l.pipelines.preBatch(n),n.isFilled){var S=s.fillTint,M=h.getTintAppendFloatAlpha(n.fillColor,n.fillAlpha*m);S.TL=M,S.TR=M,S.BL=M,S.BR=M;var A=n.geom.x1-d,C=n.geom.y1-v,w=n.geom.x2-d,P=n.geom.y2-v,L=n.geom.x3-d,O=n.geom.y3-v;s.batchFillTriangle(A,C,w,P,L,O,c.sprite,c.camera)}n.isStroked&&p(s,n,m,d,v),l.pipelines.postBatch(n)};a.exports=o},68287:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(9674),p=t(83419),h=t(31401),o=t(95643),l=t(92751),n=new p({Extends:o,Mixins:[h.Alpha,h.BlendMode,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Size,h.TextureCrop,h.Tint,h.Transform,h.Visible,l],initialize:function(f,s,c,d,v){o.call(this,f,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(d,v),this.setPosition(s,c),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(u,f){this.anims.update(u,f)},play:function(u,f){return this.anims.play(u,f)},playReverse:function(u,f){return this.anims.playReverse(u,f)},playAfterDelay:function(u,f){return this.anims.playAfterDelay(u,f)},playAfterRepeat:function(u,f){return this.anims.playAfterRepeat(u,f)},chain:function(u){return this.anims.chain(u)},stop:function(){return this.anims.stop()},stopAfterDelay:function(u){return this.anims.stopAfterDelay(u)},stopAfterRepeat:function(u){return this.anims.stopAfterRepeat(u)},stopOnFrame:function(u){return this.anims.stopOnFrame(u)},toJSON:function(){return h.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});a.exports=n},76552:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r),t.batchSprite(r,r.frame,p,h)};a.exports=y},15567:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(13059),h=t(44603),o=t(23568),l=t(68287);h.register("sprite",function(n,u){n===void 0&&(n={});var f=o(n,"key",null),s=o(n,"frame",null),c=new l(this.scene,0,0,f,s);return u!==void 0&&(n.add=u),r(this.scene,c,n),p(c,n),c})},46409:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(68287);r.register("sprite",function(h,o,l,n){return this.displayList.add(new p(this.scene,h,o,l,n))})},92751:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(9409),h=t(76552),a.exports={renderWebGL:p,renderCanvas:h}},9409:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p.addToRenderList(r),r.pipeline.batchSprite(r,p,h)};a.exports=y},14220:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=t.canvas,o=t.context,l=t.style,n=[],u=0,f=p.length;l.maxLines>0&&l.maxLines1&&(c+=t.letterSpacing*(p[s].length-1)),l.wordWrap&&(c-=o.measureText(" ").width),n[s]=Math.ceil(c),u=Math.max(u,n[s])}var d=r.fontSize+l.strokeThickness,v=d*f,m=t.lineSpacing;return f>1&&(v+=m*(f-1)),{width:u,height:v,lines:f,lineWidths:n,lineSpacing:m,lineHeight:d}};a.exports=y},79557:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=function(h){var o=r.create(this),l=o.getContext("2d",{willReadFrequently:!0});h.syncFont(o,l);var n=l.measureText(h.testString);if("actualBoundingBoxAscent"in n){var u=n.actualBoundingBoxAscent,f=n.actualBoundingBoxDescent;return r.remove(o),{ascent:u,descent:f,fontSize:u+f}}var s=Math.ceil(n.width*h.baselineX),c=s,d=2*c;c=c*h.baselineY|0,o.width=s,o.height=d,l.fillStyle="#f00",l.fillRect(0,0,s,d),l.font=h._font,l.textBaseline="alphabetic",l.fillStyle="#000",l.fillText(h.testString,0,c);var v={ascent:0,descent:0,fontSize:0},m=l.getImageData(0,0,s,d);if(!m)return v.ascent=c,v.descent=c+6,v.fontSize=v.ascent+v.descent,r.remove(o),v;var S=m.data,M=S.length,A=s*4,C,w,P=0,L=!1;for(C=0;Cc;C--){for(w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(40366),p=t(27919),h=t(83419),o=t(31401),l=t(95643),n=t(14220),u=t(35154),f=t(35846),s=t(61771),c=t(35762),d=t(45650),v=new h({Extends:l,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.PostPipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,s],initialize:function(S,M,A,C,w){M===void 0&&(M=0),A===void 0&&(A=0),l.call(this,S,"Text"),this.renderer=S.sys.renderer,this.setPosition(M,A),this.setOrigin(0,0),this.initPipeline(),this.initPostPipeline(!0),this.canvas=p.create(this),this.context,this.style=new c(this,w),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=d(),this.texture=S.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(C),w&&w.padding&&this.setPadding(w.padding),w&&w.lineSpacing&&this.setLineSpacing(w.lineSpacing)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",r(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(m){var S=this.style;if(S.wordWrapCallback){var M=S.wordWrapCallback.call(S.wordWrapCallbackScope,m,this);return Array.isArray(M)&&(M=M.join(` -`)),M}else return S.wordWrapWidth?S.wordWrapUseAdvanced?this.advancedWordWrap(m,this.context,this.style.wordWrapWidth):this.basicWordWrap(m,this.context,this.style.wordWrapWidth):m},advancedWordWrap:function(m,S,M){for(var A="",C=m.replace(/ +/gi," ").split(this.splitRegExp),w=C.length,P=0;PD){if(G===0){for(var J=W;J.length&&(J=J.slice(0,-1),k=S.measureText(J).width,!(k<=D)););if(!J.length)throw new Error("wordWrapWidth < a single character");var Q=z.substr(J.length);B[G]=Q,O+=J}var Y=B[G].length?G:G+1,K=B.slice(Y).join(" ").replace(/[ \n]*$/gi,"");C.splice(P+1,0,K),w=C.length;break}else O+=W,D-=k}A+=O.replace(/[ \n]*$/gi,"")+` -`}return A=A.replace(/[\s|\n]*$/gi,""),A},basicWordWrap:function(m,S,M){for(var A="",C=m.split(this.splitRegExp),w=C.length-1,P=S.measureText(" ").width,L=0;L<=w;L++){for(var O=M,I=C[L].split(" "),D=I.length-1,B=0;B<=D;B++){var G=I[B],z=S.measureText(G).width,W=z;BO&&B>0&&(A+=` -`,O=M),A+=G,B0&&(z+=L.lineSpacing*W),M.rtl)G=D-G-O.left-O.right;else if(M.align==="right")G+=I-L.lineWidths[W];else if(M.align==="center")G+=(I-L.lineWidths[W])/2;else if(M.align==="justify"){var k=.85;if(L.lineWidths[W]/L.width>=k){var J=L.width-L.lineWidths[W],Q=S.measureText(" ").width,Y=P[W].trim(),K=Y.split(" ");J+=(P[W].length-Y.length)*Q;for(var U=Math.floor(J/Q),V=0;U>0;)K[V]+=" ",V=(V+1)%(K.length-1||1),--U;P[W]=K.join(" ")}}if(this.autoRound&&(G=Math.round(G),z=Math.round(z)),M.strokeThickness&&(M.syncShadow(S,M.shadowStroke),S.strokeText(P[W],G,z)),M.color){M.syncShadow(S,M.shadowFill);var j=this.letterSpacing;if(j!==0)for(var $=0,q=P[W].split(""),it=0;it{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r.width===0||r.height===0||(p.addToRenderList(r),t.batchSprite(r,r.frame,p,h))};a.exports=y},71259:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(50171);p.register("text",function(l,n){l===void 0&&(l={});var u=h(l,"text",""),f=h(l,"style",null),s=h(l,"padding",null);s!==null&&(f.padding=s);var c=new o(this.scene,0,0,u,f);return n!==void 0&&(l.add=n),r(this.scene,c,l),c.autoRound=h(l,"autoRound",!0),c.resolution=h(l,"resolution",1),c})},68005:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(50171),p=t(39429);p.register("text",function(h,o,l,n){return this.displayList.add(new r(this.scene,h,o,l,n))})},61771:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(34397),h=t(79724),a.exports={renderWebGL:p,renderCanvas:h}},35762:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23568),h=t(35154),o=t(79557),l={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},n=new r({initialize:function(f,s){this.parent=f,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(s,!1,!0)},setStyle:function(u,f,s){f===void 0&&(f=!0),s===void 0&&(s=!1),u&&u.hasOwnProperty("fontSize")&&typeof u.fontSize=="number"&&(u.fontSize=u.fontSize.toString()+"px");for(var c in l){var d=s?l[c][1]:this[c];c==="wordWrapCallback"||c==="wordWrapCallbackScope"?this[c]=h(u,l[c][0],d):this[c]=p(u,l[c][0],d)}var v=h(u,"font",null);v!==null&&this.setFont(v,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var m=h(u,"fill",null);m!==null&&(this.color=m);var S=h(u,"metrics",!1);return S?this.metrics={ascent:h(S,"ascent",0),descent:h(S,"descent",0),fontSize:h(S,"fontSize",0)}:(f||!this.metrics)&&(this.metrics=o(this)),f?this.parent.updateText():this.parent},syncFont:function(u,f){f.font=this._font},syncStyle:function(u,f){f.textBaseline="alphabetic",f.fillStyle=this.color,f.strokeStyle=this.stroke,f.lineWidth=this.strokeThickness,f.lineCap="round",f.lineJoin="round"},syncShadow:function(u,f){f?(u.shadowOffsetX=this.shadowOffsetX,u.shadowOffsetY=this.shadowOffsetY,u.shadowColor=this.shadowColor,u.shadowBlur=this.shadowBlur):(u.shadowOffsetX=0,u.shadowOffsetY=0,u.shadowColor=0,u.shadowBlur=0)},update:function(u){return u&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(u,f){f===void 0&&(f=!0);var s=u,c="",d="";if(typeof u!="string")s=h(u,"fontFamily","Courier"),c=h(u,"fontSize","16px"),d=h(u,"fontStyle","");else{var v=u.split(" "),m=0;d=v.length>2?v[m++]:"",c=v[m++]||"16px",s=v[m++]||"Courier"}return(s!==this.fontFamily||c!==this.fontSize||d!==this.fontStyle)&&(this.fontFamily=s,this.fontSize=c,this.fontStyle=d,f&&this.update(!0)),this.parent},setFontFamily:function(u){return this.fontFamily!==u&&(this.fontFamily=u,this.update(!0)),this.parent},setFontStyle:function(u){return this.fontStyle!==u&&(this.fontStyle=u,this.update(!0)),this.parent},setFontSize:function(u){return typeof u=="number"&&(u=u.toString()+"px"),this.fontSize!==u&&(this.fontSize=u,this.update(!0)),this.parent},setTestString:function(u){return this.testString=u,this.update(!0)},setFixedSize:function(u,f){return this.fixedWidth=u,this.fixedHeight=f,u&&(this.parent.width=u),f&&(this.parent.height=f),this.update(!1)},setBackgroundColor:function(u){return this.backgroundColor=u,this.update(!1)},setFill:function(u){return this.color=u,this.update(!1)},setColor:function(u){return this.color=u,this.update(!1)},setResolution:function(u){return this.resolution=u,this.update(!1)},setStroke:function(u,f){return f===void 0&&(f=this.strokeThickness),u===void 0&&this.strokeThickness!==0?(this.strokeThickness=0,this.update(!0)):(this.stroke!==u||this.strokeThickness!==f)&&(this.stroke=u,this.strokeThickness=f,this.update(!0)),this.parent},setShadow:function(u,f,s,c,d,v){return u===void 0&&(u=0),f===void 0&&(f=0),s===void 0&&(s="#000"),c===void 0&&(c=0),d===void 0&&(d=!1),v===void 0&&(v=!0),this.shadowOffsetX=u,this.shadowOffsetY=f,this.shadowColor=s,this.shadowBlur=c,this.shadowStroke=d,this.shadowFill=v,this.update(!1)},setShadowOffset:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this.shadowOffsetX=u,this.shadowOffsetY=f,this.update(!1)},setShadowColor:function(u){return u===void 0&&(u="#000"),this.shadowColor=u,this.update(!1)},setShadowBlur:function(u){return u===void 0&&(u=0),this.shadowBlur=u,this.update(!1)},setShadowStroke:function(u){return this.shadowStroke=u,this.update(!1)},setShadowFill:function(u){return this.shadowFill=u,this.update(!1)},setWordWrapWidth:function(u,f){return f===void 0&&(f=!1),this.wordWrapWidth=u,this.wordWrapUseAdvanced=f,this.update(!1)},setWordWrapCallback:function(u,f){return f===void 0&&(f=null),this.wordWrapCallback=u,this.wordWrapCallbackScope=f,this.update(!1)},setAlign:function(u){return u===void 0&&(u="left"),this.align=u,this.update(!1)},setMaxLines:function(u){return u===void 0&&(u=0),this.maxLines=u,this.update(!1)},getTextMetrics:function(){var u=this.metrics;return{ascent:u.ascent,descent:u.descent,fontSize:u.fontSize}},toJSON:function(){var u={};for(var f in l)u[f]=this[f];return u.metrics=this.getTextMetrics(),u},destroy:function(){this.parent=void 0}});a.exports=n},34397:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70554),p=function(h,o,l,n){if(!(o.width===0||o.height===0)){l.addToRenderList(o);var u=o.frame,f=u.width,s=u.height,c=r.getTintAppendFloatAlpha,d=h.pipelines.set(o.pipeline,o),v=d.setTexture2D(u.glTexture,o);d.batchTexture(o,u.glTexture,f,s,o.x,o.y,f/o.style.resolution,s/o.style.resolution,o.scaleX,o.scaleY,o.rotation,o.flipX,o.flipY,o.scrollFactorX,o.scrollFactorY,o.displayOriginX,o.displayOriginY,0,0,f,s,c(o.tintTopLeft,l.alpha*o._alphaTL),c(o.tintTopRight,l.alpha*o._alphaTR),c(o.tintBottomLeft,l.alpha*o._alphaBL),c(o.tintBottomRight,l.alpha*o._alphaBR),o.tintFill,0,0,l,n,!1,v)}};a.exports=p},20839:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=t(83419),h=t(31401),o=t(95643),l=t(98439),n=t(68703),u=t(56295),f=t(45650),s=t(26099),c=8,d=new p({Extends:o,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Crop,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.Tint,h.Transform,h.Visible,u],initialize:function(m,S,M,A,C,w,P){var L=m.sys.renderer;o.call(this,m,"TileSprite");var O=m.sys.textures.get(w),I=O.get(P);I.source.compressionAlgorithm&&(console.warn("TileSprite cannot use compressed texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),O.type==="DynamicTexture"&&(console.warn("TileSprite cannot use Dynamic Texture"),O=m.sys.textures.get("__MISSING"),I=O.get()),!A||!C?(A=I.width,C=I.height):(A=Math.floor(A),C=Math.floor(C)),this._tilePosition=new s,this._tileScale=new s(1,1),this.dirty=!1,this.renderer=L,this.canvas=r.create(this,A,C),this.context=this.canvas.getContext("2d",{willReadFrequently:!1}),this.displayTexture=O,this.displayFrame=I,this._crop=this.resetCropObject(),this._textureKey=f(),this.texture=m.sys.textures.addCanvas(this._textureKey,this.canvas),this.frame=this.texture.get(),this.potWidth=l(I.width),this.potHeight=l(I.height),this.fillCanvas=r.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d",{willReadFrequently:!1}),this.fillPattern=null,this.setPosition(S,M),this.setSize(A,C),this.setFrame(P),this.setOriginFromFrame(),this.initPipeline(),this.initPostPipeline(!0)},setTexture:function(v,m){return this.displayTexture=this.scene.sys.textures.get(v),this.setFrame(m)},setFrame:function(v){var m=this.displayTexture.get(v);return this.potWidth=l(m.width),this.potHeight=l(m.height),this.canvas.width=0,!m.cutWidth||!m.cutHeight?this.renderFlags&=~c:this.renderFlags|=c,this.displayFrame=m,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(v,m){return v!==void 0&&(this.tilePositionX=v),m!==void 0&&(this.tilePositionY=m),this},setTileScale:function(v,m){return v===void 0&&(v=this.tileScaleX),m===void 0&&(m=v),this.tileScaleX=v,this.tileScaleY=m,this},updateTileTexture:function(){if(!(!this.dirty||!this.renderer)){var v=this.displayFrame;if(v.source.isRenderTexture||v.source.isGLTexture){console.warn("TileSprites can only use Image or Canvas based textures"),this.dirty=!1;return}var m=this.fillContext,S=this.fillCanvas,M=this.potWidth,A=this.potHeight;(!this.renderer||!this.renderer.gl)&&(M=v.cutWidth,A=v.cutHeight),m.clearRect(0,0,M,A),S.width=M,S.height=A,m.drawImage(v.source.image,v.cutX,v.cutY,v.cutWidth,v.cutHeight,0,0,M,A),this.renderer&&this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(S,this.fillPattern):this.fillPattern=m.createPattern(S,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var v=this.canvas;if((v.width!==this.width||v.height!==this.height)&&(v.width=this.width,v.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 m=this.context;this.scene.sys.game.config.antialias||n.disable(m);var S=this._tileScale.x,M=this._tileScale.y,A=this._tilePosition.x,C=this._tilePosition.y;m.clearRect(0,0,this.width,this.height),m.save(),m.scale(S,M),m.translate(-A,-C),m.fillStyle=this.fillPattern,m.fillRect(A,C,this.width/S,this.height/M),m.restore(),this.dirty=!1},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),r.remove(this.canvas),r.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null;var v=this.texture;v&&v.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(v){this._tilePosition.x=v,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(v){this._tilePosition.y=v,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(v){this._tileScale.x=v,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(v){this._tileScale.y=v,this.dirty=!0}}});a.exports=d},46992:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r.updateCanvas(),p.addToRenderList(r),t.batchSprite(r,r.frame,p,h)};a.exports=y},14167:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(20839);p.register("tileSprite",function(l,n){l===void 0&&(l={});var u=h(l,"x",0),f=h(l,"y",0),s=h(l,"width",512),c=h(l,"height",512),d=h(l,"key",""),v=h(l,"frame",""),m=new o(this.scene,u,f,s,c,d,v);return n!==void 0&&(l.add=n),r(this.scene,m,l),m})},91681:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20839),p=t(39429);p.register("tileSprite",function(h,o,l,n,u,f){return this.displayList.add(new r(this.scene,h,o,l,n,u,f))})},56295:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(18553),h=t(46992),a.exports={renderWebGL:p,renderCanvas:h}},18553:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70554),p=function(h,o,l,n){o.updateCanvas();var u=o.width,f=o.height;if(!(u===0||f===0)){l.addToRenderList(o);var s=r.getTintAppendFloatAlpha,c=h.pipelines.set(o.pipeline,o),d=c.setTexture2D(o.fillPattern,o);c.batchTexture(o,o.fillPattern,o.displayFrame.width*o.tileScaleX,o.displayFrame.height*o.tileScaleY,o.x,o.y,u,f,o.scaleX,o.scaleY,o.rotation,o.flipX,o.flipY,o.scrollFactorX,o.scrollFactorY,o.originX*u,o.originY*f,0,0,u,f,s(o.tintTopLeft,l.alpha*o._alphaTL),s(o.tintTopRight,l.alpha*o._alphaTR),s(o.tintBottomLeft,l.alpha*o._alphaBL),s(o.tintBottomRight,l.alpha*o._alphaBR),o.tintFill,o.tilePositionX%o.displayFrame.width/o.displayFrame.width,o.tilePositionY%o.displayFrame.height/o.displayFrame.height,l,n,!1,d)}};a.exports=p},18471:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(31401),o=t(51708),l=t(8443),n=t(95643),u=t(36383),f=t(14463),s=t(45650),c=t(10247),d=new p({Extends:n,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.ScrollFactor,h.TextureCrop,h.Tint,h.Transform,h.Visible,c],initialize:function(m,S,M,A){n.call(this,m,"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 C=m.sys.game;this._device=C.device.video,this.setPosition(S,M),this.setSize(256,256),this.initPipeline(),this.initPostPipeline(!0),C.events.on(l.PAUSE,this.globalPause,this),C.events.on(l.RESUME,this.globalResume,this);var w=m.sys.sound;w&&w.on(f.GLOBAL_MUTE,this.globalMute,this),A&&this.load(A)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},load:function(v){var m=this.scene.sys.cache.video.get(v);return m?(this.cacheKey=v,this.loadHandler(m.url,m.noAudio,m.crossOrigin)):console.warn("No video in cache for key: "+v),this},changeSource:function(v,m,S,M,A){m===void 0&&(m=!0),S===void 0&&(S=!1),this.cacheKey!==v&&(this.load(v),m&&this.play(S,M,A))},getVideoKey:function(){return this.cacheKey},loadURL:function(v,m,S){m===void 0&&(m=!1);var M=this._device.getVideoURL(v);return M?(this.cacheKey="",this.loadHandler(M.url,m,S)):console.warn("No supported video format found for "+v),this},loadMediaStream:function(v,m,S){return this.loadHandler(null,m,S,v)},loadHandler:function(v,m,S,M){m||(m=!1);var A=this.video;if(A?(this.removeLoadEventHandlers(),this.stop()):(A=document.createElement("video"),A.controls=!1,A.setAttribute("playsinline","playsinline"),A.setAttribute("preload","auto"),A.setAttribute("disablePictureInPicture","true")),m?(A.muted=!0,A.defaultMuted=!0,A.setAttribute("autoplay","autoplay")):(A.muted=!1,A.defaultMuted=!1,A.removeAttribute("autoplay")),S?A.setAttribute("crossorigin",S):A.removeAttribute("crossorigin"),M)if("srcObject"in A)try{A.srcObject=M}catch(w){if(w.name!=="TypeError")throw w;A.src=URL.createObjectURL(M)}else A.src=URL.createObjectURL(M);else A.src=v;this.retry=0,this.video=A,this._playCalled=!1,A.load(),this.addLoadEventHandlers();var C=this.scene.sys.textures.get(this._key);return this.setTexture(C),this},requestVideoFrame:function(v,m){var S=this.video;if(S){var M=m.width,A=m.height,C=this.videoTexture,w=this.videoTextureSource,P=!C||w.source!==S;P?(this._codePaused=S.paused,this._codeMuted=S.muted,C?(w.source=S,w.width=M,w.height=A,C.get().setSize(M,A)):(C=this.scene.sys.textures.create(this._key,S,M,A),C.add("__BASE",0,0,0,M,A),this.setTexture(C),this.videoTexture=C,this.videoTextureSource=C.source[0],this.videoTextureSource.setFlipY(this.flipY),this.emit(o.VIDEO_TEXTURE,this,C)),this.setSizeToFrame(),this.updateDisplayOrigin()):w.update(),this.isStalled=!1,this.metadata=m;var L=m.mediaTime;P&&(this._lastUpdate=L,this.emit(o.VIDEO_CREATED,this,M,A),this.frameReady||(this.frameReady=!0,this.emit(o.VIDEO_PLAY,this))),this._playingMarker?L>=this._markerOut&&(S.loop?(S.currentTime=this._markerIn,this.emit(o.VIDEO_LOOP,this)):(this.stop(!1),this.emit(o.VIDEO_COMPLETE,this))):L-1&&S>m&&S=0&&!isNaN(S)&&S>m&&(this.markers[v]=[m,S]),this},playMarker:function(v,m){var S=this.markers[v];return S&&this.play(m,S[0],S[1]),this},removeMarker:function(v){return delete this.markers[v],this},snapshot:function(v,m){return v===void 0&&(v=this.width),m===void 0&&(m=this.height),this.snapshotArea(0,0,this.width,this.height,v,m)},snapshotArea:function(v,m,S,M,A,C){v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=this.width),M===void 0&&(M=this.height),A===void 0&&(A=S),C===void 0&&(C=M);var w=this.video,P=this.snapshotTexture;return P?(P.setSize(A,C),w&&P.context.drawImage(w,v,m,S,M,0,0,A,C)):(P=this.scene.sys.textures.createCanvas(s(),A,C),this.snapshotTexture=P,w&&P.context.drawImage(w,v,m,S,M,0,0,A,C)),P.update()},saveSnapshotTexture:function(v){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,v):this.snapshotTexture=this.scene.sys.textures.createCanvas(v,this.width,this.height),this.snapshotTexture},playSuccess:function(){if(this._playCalled){this.addEventHandlers(),this._codePaused=!1,this.touchLocked&&(this.touchLocked=!1,this.emit(o.VIDEO_UNLOCKED,this));var v=this.scene.sys.sound;v&&v.mute&&this.setMute(!0),this._markerIn>-1&&(this.video.currentTime=this._markerIn)}},playError:function(v){var m=v.name;m==="NotAllowedError"?(this.touchLocked=!0,this.playWhenUnlocked=!0,this.failedPlayAttempts=1,this.emit(o.VIDEO_LOCKED,this)):m==="NotSupportedError"?(this.stop(!1),this.emit(o.VIDEO_UNSUPPORTED,this,v)):(this.stop(!1),this.emit(o.VIDEO_ERROR,this,v))},legacyPlayHandler:function(){var v=this.video;v&&(this.playSuccess(),v.removeEventListener("playing",this._callbacks.legacy))},playingHandler:function(){this.isStalled=!1,this.emit(o.VIDEO_PLAYING,this)},loadErrorHandler:function(v){this.stop(!1),this.emit(o.VIDEO_ERROR,this,v)},metadataHandler:function(v){this.emit(o.VIDEO_METADATA,this,v)},setSizeToFrame:function(v){v||(v=this.frame),this.width=v.realWidth,this.height=v.realHeight,this.scaleX!==1&&(this.scaleX=this.displayWidth/this.width),this.scaleY!==1&&(this.scaleY=this.displayHeight/this.height);var m=this.input;return m&&!m.customHitArea&&(m.hitArea.width=this.width,m.hitArea.height=this.height),this},stalledHandler:function(v){this.isStalled=!0,this.emit(o.VIDEO_STALLED,this,v)},completeHandler:function(){this._playCalled=!1,this.emit(o.VIDEO_COMPLETE,this)},preUpdate:function(v,m){var S=this.video;!S||!this._playCalled||this.touchLocked&&this.playWhenUnlocked&&(this.retry+=m,this.retry>=this.retryInterval&&(this.createPlayPromise(!1),this.retry=0))},seekTo:function(v){var m=this.video;if(m){var S=m.duration;if(S!==1/0&&!isNaN(S)){var M=S*v;this.setCurrentTime(M)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(v){var m=this.video;if(m){if(typeof v=="string"){var S=v[0],M=parseFloat(v.substr(1));S==="+"?v=m.currentTime+M:S==="-"&&(v=m.currentTime-M)}m.currentTime=v}return this},seekingHandler:function(){this.isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this.isSeeking=!1,this.emit(o.VIDEO_SEEKED,this)},getProgress:function(){var v=this.video;if(v){var m=v.duration;if(m!==1/0&&!isNaN(m))return v.currentTime/m}return-1},getDuration:function(){return this.video?this.video.duration:0},setMute:function(v){v===void 0&&(v=!0),this._codeMuted=v;var m=this.video;return m&&(m.muted=this._systemMuted?!0:v),this},isMuted:function(){return this._codeMuted},globalMute:function(v,m){this._systemMuted=m;var S=this.video;S&&(S.muted=this._codeMuted?!0:m)},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(v){v===void 0&&(v=!0);var m=this.video;return this._codePaused=v,m&&!m.ended&&(v?m.paused||(this.removeEventHandlers(),m.pause()):v||(this._playCalled?m.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(v){return v===void 0&&(v=1),this.video&&(this.video.volume=r(v,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(v){return this.video&&(this.video.playbackRate=v),this},getLoop:function(){return this.video?this.video.loop:!1},setLoop:function(v){return v===void 0&&(v=!0),this.video&&(this.video.loop=v),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(v,m){return m===void 0&&(m=!1),this.videoTexture&&(this.scene.sys.textures.renameTexture(this._key,v),this.videoTextureSource.setFlipY(m)),this._key=v,this.flipY=m,!!this.videoTexture},stop:function(v){v===void 0&&(v=!0);var m=this.video;return m&&(this.removeEventHandlers(),m.cancelVideoFrameCallback(this._rfvCallbackId),m.pause()),this.retry=0,this._playCalled=!1,v&&this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var v=this.video;if(v){for(v.parentNode&&v.parentNode.removeChild(v);v.hasChildNodes();)v.removeChild(v.firstChild);v.removeAttribute("autoplay"),v.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(!1),this.removeLoadEventHandlers(),this.removeVideoElement();var v=this.scene.sys.game.events;v.off(l.PAUSE,this.globalPause,this),v.off(l.RESUME,this.globalResume,this);var m=this.scene.sys.sound;m&&m.off(f.GLOBAL_MUTE,this.globalMute,this)}});a.exports=d},58352:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r.videoTexture&&(p.addToRenderList(r),t.batchSprite(r,r.frame,p,h))};a.exports=y},11511:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25305),p=t(44603),h=t(23568),o=t(18471);p.register("video",function(l,n){l===void 0&&(l={});var u=h(l,"key",null),f=new o(this.scene,0,0,u);return n!==void 0&&(l.add=n),r(this.scene,f,l),f})},89025:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(18471),p=t(39429);p.register("video",function(h,o,l){return this.displayList.add(new r(this.scene,h,o,l))})},10247:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(29849),h=t(58352),a.exports={renderWebGL:p,renderCanvas:h}},29849:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r.videoTexture&&(p.addToRenderList(r),r.pipeline.batchSprite(r,p,h))};a.exports=y},41481:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(96503),h=t(87902),o=t(83419),l=t(31401),n=t(95643),u=t(87841),f=t(37303),s=new o({Extends:n,Mixins:[l.Depth,l.GetBounds,l.Origin,l.Transform,l.ScrollFactor,l.Visible],initialize:function(d,v,m,S,M){S===void 0&&(S=1),M===void 0&&(M=S),n.call(this,d,"Zone"),this.setPosition(v,m),this.width=S,this.height=M,this.blendMode=r.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(c){this.scaleX=c/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(c){this.scaleY=c/this.height}},setSize:function(c,d,v){v===void 0&&(v=!0),this.width=c,this.height=d,this.updateDisplayOrigin();var m=this.input;return v&&m&&!m.customHitArea&&(m.hitArea.width=c,m.hitArea.height=d),this},setDisplaySize:function(c,d){return this.displayWidth=c,this.displayHeight=d,this},setCircleDropZone:function(c){return this.setDropZone(new p(0,0,c),h)},setRectangleDropZone:function(c,d){return this.setDropZone(new u(0,0,c,d),f)},setDropZone:function(c,d){return this.input||this.setInteractive(c,d,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(c,d,v){v.addToRenderList(d)},renderWebGL:function(c,d,v){v.addToRenderList(d)}});a.exports=s},95261:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(44603),p=t(23568),h=t(41481);r.register("zone",function(o){var l=p(o,"x",0),n=p(o,"y",0),u=p(o,"width",1),f=p(o,"height",u);return new h(this.scene,l,n,u,f)})},84175:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41481),p=t(39429);p.register("zone",function(h,o,l,n){return this.displayList.add(new r(this.scene,h,o,l,n))})},95166:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0};a.exports=y},96503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(87902),h=t(26241),o=t(79124),l=t(23777),n=t(28176),u=new r({initialize:function(s,c,d){s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),this.type=l.CIRCLE,this.x=s,this.y=c,this._radius=d,this._diameter=d*2},contains:function(f,s){return p(this,f,s)},getPoint:function(f,s){return h(this,f,s)},getPoints:function(f,s,c){return o(this,f,s,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,s,c){return this.x=f,this.y=s,this._radius=c,this._diameter=c*2,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(f,s){return s===void 0&&(s=f),this.x=f,this.y=s,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(f){this._radius=f,this._diameter=f*2}},diameter:{get:function(){return this._diameter},set:function(f){this._diameter=f,this._radius=f*.5}},left:{get:function(){return this.x-this._radius},set:function(f){this.x=f+this._radius}},right:{get:function(){return this.x+this._radius},set:function(f){this.x=f-this._radius}},top:{get:function(){return this.y-this._radius},set:function(f){this.y=f+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(f){this.y=f-this._radius}}});a.exports=u},71562:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return 2*(Math.PI*t.radius)};a.exports=y},92110:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l){return l===void 0&&(l=new r),l.x=h.x+h.radius*Math.cos(o),l.y=h.y+h.radius*Math.sin(o),l};a.exports=p},42250:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(96503),p=function(h){return new r(h.x,h.y,h.radius)};a.exports=p},87902:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(t.radius>0&&r>=t.left&&r<=t.right&&p>=t.top&&p<=t.bottom){var h=(t.x-r)*(t.x-r),o=(t.y-p)*(t.y-p);return h+o<=t.radius*t.radius}else return!1};a.exports=y},5698:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87902),p=function(h,o){return r(h,o.x,o.y)};a.exports=p},70588:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87902),p=function(h,o){return r(h,o.x,o.y)&&r(h,o.right,o.y)&&r(h,o.x,o.bottom)&&r(h,o.right,o.bottom)};a.exports=p},26394:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x,t.y,t.radius)};a.exports=y},76278:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x===r.x&&t.y===r.y&&t.radius===r.radius};a.exports=y},2074:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o){return o===void 0&&(o=new r),o.x=h.left,o.y=h.top,o.width=h.diameter,o.height=h.diameter,o};a.exports=p},26241:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(92110),p=t(62945),h=t(36383),o=t(2141),l=function(n,u,f){f===void 0&&(f=new o);var s=p(u,0,h.PI2);return r(n,s,f)};a.exports=l},79124:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(71562),p=t(92110),h=t(62945),o=t(36383),l=function(n,u,f,s){s===void 0&&(s=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x+=r,t.y+=p,t};a.exports=y},39212:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x+=r.x,t.y+=r.y,t};a.exports=y},28176:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){o===void 0&&(o=new r);var l=2*Math.PI*Math.random(),n=Math.random()+Math.random(),u=n>1?2-n:n,f=u*Math.cos(l),s=u*Math.sin(l);return o.x=h.x+f*h.radius,o.y=h.y+s*h.radius,o};a.exports=p},88911:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(96503);r.Area=t(95166),r.Circumference=t(71562),r.CircumferencePoint=t(92110),r.Clone=t(42250),r.Contains=t(87902),r.ContainsPoint=t(5698),r.ContainsRect=t(70588),r.CopyFrom=t(26394),r.Equals=t(76278),r.GetBounds=t(2074),r.GetPoint=t(26241),r.GetPoints=t(79124),r.Offset=t(50884),r.OffsetPoint=t(39212),r.Random=t(28176),a.exports=r},23777:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6};a.exports=y},78874:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI};a.exports=y},92990:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=t.width/2,p=t.height/2,h=Math.pow(r-p,2)/Math.pow(r+p,2);return Math.PI*(r+p)*(1+3*h/(10+Math.sqrt(4-3*h)))};a.exports=y},79522:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l){l===void 0&&(l=new r);var n=h.width/2,u=h.height/2;return l.x=h.x+n*Math.cos(o),l.y=h.y+u*Math.sin(o),l};a.exports=p},58102:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8497),p=function(h){return new r(h.x,h.y,h.width,h.height)};a.exports=p},81154:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(t.width<=0||t.height<=0)return!1;var h=(r-t.x)/t.width,o=(p-t.y)/t.height;return h*=h,o*=o,h+o<.25};a.exports=y},46662:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(81154),p=function(h,o){return r(h,o.x,o.y)};a.exports=p},1632:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(81154),p=function(h,o){return r(h,o.x,o.y)&&r(h,o.right,o.y)&&r(h,o.x,o.bottom)&&r(h,o.right,o.bottom)};a.exports=p},65534:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x,t.y,t.width,t.height)};a.exports=y},8497:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(81154),h=t(90549),o=t(48320),l=t(23777),n=t(24820),u=new r({initialize:function(s,c,d,v){s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=l.ELLIPSE,this.x=s,this.y=c,this.width=d,this.height=v},contains:function(f,s){return p(this,f,s)},getPoint:function(f,s){return h(this,f,s)},getPoints:function(f,s,c){return o(this,f,s,c)},getRandomPoint:function(f){return n(this,f)},setTo:function(f,s,c,d){return this.x=f,this.y=s,this.width=c,this.height=d,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(f,s){return s===void 0&&(s=f),this.x=f,this.y=s,this},setSize:function(f,s){return s===void 0&&(s=f),this.width=f,this.height=s,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(f){this.x=f+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(f){this.x=f-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(f){this.y=f+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(f){this.y=f-this.height/2}}});a.exports=u},36146:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height};a.exports=y},23694:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o){return o===void 0&&(o=new r),o.x=h.left,o.y=h.top,o.width=h.width,o.height=h.height,o};a.exports=p},90549:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79522),p=t(62945),h=t(36383),o=t(2141),l=function(n,u,f){f===void 0&&(f=new o);var s=p(u,0,h.PI2);return r(n,s,f)};a.exports=l},48320:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(92990),p=t(79522),h=t(62945),o=t(36383),l=function(n,u,f,s){s===void 0&&(s=[]),!u&&f>0&&(u=r(n)/f);for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x+=r,t.y+=p,t};a.exports=y},44808:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x+=r.x,t.y+=r.y,t};a.exports=y},24820:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){o===void 0&&(o=new r);var l=Math.random()*Math.PI*2,n=Math.sqrt(Math.random());return o.x=h.x+n*Math.cos(l)*h.width/2,o.y=h.y+n*Math.sin(l)*h.height/2,o};a.exports=p},49203:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8497);r.Area=t(78874),r.Circumference=t(92990),r.CircumferencePoint=t(79522),r.Clone=t(58102),r.Contains=t(81154),r.ContainsPoint=t(46662),r.ContainsRect=t(1632),r.CopyFrom=t(65534),r.Equals=t(36146),r.GetBounds=t(23694),r.GetPoint=t(90549),r.GetPoints=t(48320),r.Offset=t(73424),r.OffsetPoint=t(44808),r.Random=t(24820),a.exports=r},55738:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23777),p=t(79291),h={Circle:t(88911),Ellipse:t(49203),Intersects:t(91865),Line:t(2529),Mesh:t(73090),Point:t(43711),Polygon:t(58423),Rectangle:t(93232),Triangle:t(84435)};h=p(!1,h,r),a.exports=h},2044:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20339),p=function(h,o){return r(h.x,h.y,o.x,o.y)<=h.radius+o.radius};a.exports=p},81491:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=r.width/2,h=r.height/2,o=Math.abs(t.x-r.x-p),l=Math.abs(t.y-r.y-h),n=p+t.radius,u=h+t.radius;if(o>n||l>u)return!1;if(o<=p||l<=h)return!0;var f=o-p,s=l-h,c=f*f,d=s*s,v=t.radius*t.radius;return c+d<=v};a.exports=y},63376:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(2044),h=function(o,l,n){if(n===void 0&&(n=[]),p(o,l)){var u=o.x,f=o.y,s=o.radius,c=l.x,d=l.y,v=l.radius,m,S,M,A,C;if(f===d)C=(v*v-s*s-c*c+u*u)/(2*(u-c)),m=1,S=-2*d,M=c*c+C*C-2*c*C+d*d-v*v,A=S*S-4*m*M,A===0?n.push(new r(C,-S/(2*m))):A>0&&(n.push(new r(C,(-S+Math.sqrt(A))/(2*m))),n.push(new r(C,(-S-Math.sqrt(A))/(2*m))));else{var w=(u-c)/(f-d),P=(v*v-s*s-c*c+u*u-d*d+f*f)/(2*(f-d));m=w*w+1,S=2*f*w-2*P*w-2*u,M=u*u+f*f+P*P-s*s-2*f*P,A=S*S-4*m*M,A===0?(C=-S/(2*m),n.push(new r(C,P-C*w))):A>0&&(C=(-S+Math.sqrt(A))/(2*m),n.push(new r(C,P-C*w)),C=(-S-Math.sqrt(A))/(2*m),n.push(new r(C,P-C*w)))}}return n};a.exports=h},97439:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(4042),p=t(81491),h=function(o,l,n){if(n===void 0&&(n=[]),p(o,l)){var u=l.getLineA(),f=l.getLineB(),s=l.getLineC(),c=l.getLineD();r(u,o,n),r(f,o,n),r(s,o,n),r(c,o,n)}return n};a.exports=h},4042:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(80462),h=function(o,l,n){if(n===void 0&&(n=[]),p(o,l)){var u=o.x1,f=o.y1,s=o.x2,c=o.y2,d=l.x,v=l.y,m=l.radius,S=s-u,M=c-f,A=u-d,C=f-v,w=S*S+M*M,P=2*(S*A+M*C),L=A*A+C*C-m*m,O=P*P-4*w*L,I,D;if(O===0){var B=-P/(2*w);I=u+B*S,D=f+B*M,B>=0&&B<=1&&n.push(new r(I,D))}else if(O>0){var G=(-P-Math.sqrt(O))/(2*w);I=u+G*S,D=f+G*M,G>=0&&G<=1&&n.push(new r(I,D));var z=(-P+Math.sqrt(O))/(2*w);I=u+z*S,D=f+z*M,z>=0&&z<=1&&n.push(new r(I,D))}}return n};a.exports=h},36100:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25836),p=function(h,o,l,n){l===void 0&&(l=!1);var u=h.x1,f=h.y1,s=h.x2,c=h.y2,d=o.x1,v=o.y1,m=o.x2,S=o.y2,M=s-u,A=c-f,C=m-d,w=S-v,P=M*w-A*C;if(P===0)return null;var L,O,I;if(l){if(L=(M*(v-f)+A*(u-d))/(C*A-w*M),O=(d+C*L-u)/M,O<0||L<0||L>1)return null;I=O}else{if(L=((d-u)*w-(v-f)*C)/P,O=((f-v)*M-(u-d)*A)/P,L<0||L>1||O<0||O>1)return null;I=L}return n===void 0&&(n=new r),n.set(u+M*I,f+A*I,I)};a.exports=p},3073:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36100),p=t(23031),h=t(25836),o=new p,l=new h,n=function(u,f,s,c){s===void 0&&(s=!1),c===void 0&&(c=new h);var d=!1;c.set(),l.set();for(var v=f[f.length-1],m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25836),p=t(61369),h=t(3073),o=new r,l=function(n,u,f,s){s===void 0&&(s=new p),Array.isArray(u)||(u=[u]);var c=!1;s.set(),o.set();for(var d=0;d{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(76112),h=t(92773),o=function(l,n,u){if(u===void 0&&(u=[]),h(l,n))for(var f=n.getLineA(),s=n.getLineB(),c=n.getLineC(),d=n.getLineD(),v=[new r,new r,new r,new r],m=[p(f,l,v[0]),p(s,l,v[1]),p(c,l,v[2]),p(d,l,v[3])],S=0;S<4;S++)m[S]&&u.push(v[S]);return u};a.exports=o},71147:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61369),p=t(56362),h=t(23031),o=new h;function l(f,s,c,d,v){var m=Math.cos(f),S=Math.sin(f);o.setTo(s,c,s+m,c+S);var M=p(o,d,!0);M&&v.push(new r(M.x,M.y,f,M.w))}function n(f,s){return f.z-s.z}var u=function(f,s,c){Array.isArray(c)||(c=[c]);for(var d=[],v=[],m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=t(59996),h=function(o,l,n){return n===void 0&&(n=new r),p(o,l)&&(n.x=Math.max(o.x,l.x),n.y=Math.max(o.y,l.y),n.width=Math.min(o.right,l.right)-n.x,n.height=Math.min(o.bottom,l.bottom)-n.y),n};a.exports=h},52784:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(60646),p=t(59996),h=function(o,l,n){if(n===void 0&&(n=[]),p(o,l)){var u=o.getLineA(),f=o.getLineB(),s=o.getLineC(),c=o.getLineD();r(u,l,n),r(f,l,n),r(s,l,n),r(c,l,n)}return n};a.exports=h},26341:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(89265),p=t(60646),h=function(o,l,n){if(n===void 0&&(n=[]),r(o,l)){var u=l.getLineA(),f=l.getLineB(),s=l.getLineC();p(u,o,n),p(f,o,n),p(s,o,n)}return n};a.exports=h},38720:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(4042),p=t(67636),h=function(o,l,n){if(n===void 0&&(n=[]),p(o,l)){var u=o.getLineA(),f=o.getLineB(),s=o.getLineC();r(u,l,n),r(f,l,n),r(s,l,n)}return n};a.exports=h},13882:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(2822),h=t(76112),o=function(l,n,u){if(u===void 0&&(u=[]),p(l,n))for(var f=l.getLineA(),s=l.getLineB(),c=l.getLineC(),d=[new r,new r,new r],v=[h(f,n,d[0]),h(s,n,d[1]),h(c,n,d[2])],m=0;m<3;m++)v[m]&&u.push(d[m]);return u};a.exports=o},75636:(a,y,t)=>{/** - * @author Florian Vazelle - * @author Geoffrey Glaive - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82944),p=t(13882),h=function(o,l,n){if(n===void 0&&(n=[]),r(o,l)){var u=l.getLineA(),f=l.getLineB(),s=l.getLineC();p(o,u,n),p(o,f,n),p(o,s,n)}return n};a.exports=h},80462:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87902),p=t(2141),h=new p,o=function(l,n,u){if(u===void 0&&(u=h),r(n,l.x1,l.y1))return u.x=l.x1,u.y=l.y1,!0;if(r(n,l.x2,l.y2))return u.x=l.x2,u.y=l.y2,!0;var f=l.x2-l.x1,s=l.y2-l.y1,c=n.x-l.x1,d=n.y-l.y1,v=f*f+s*s,m=f,S=s;if(v>0){var M=(c*f+d*s)/v;m*=M,S*=M}u.x=l.x1+m,u.y=l.y1+S;var A=m*m+S*S;return A<=v&&m*f+S*s>=0&&r(n,u.x,u.y)};a.exports=o},76112:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=t.x1,o=t.y1,l=t.x2,n=t.y2,u=r.x1,f=r.y1,s=r.x2,c=r.y2;if(h===l&&o===n||u===s&&f===c)return!1;var d=(c-f)*(l-h)-(s-u)*(n-o);if(d===0)return!1;var v=((s-u)*(o-f)-(c-f)*(h-u))/d,m=((l-h)*(o-f)-(n-o)*(h-u))/d;return v<0||v>1||m<0||m>1?!1:(p&&(p.x=h+v*(l-h),p.y=o+v*(n-o)),!0)};a.exports=y},92773:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.x1,h=t.y1,o=t.x2,l=t.y2,n=r.x,u=r.y,f=r.right,s=r.bottom,c=0;if(p>=n&&p<=f&&h>=u&&h<=s||o>=n&&o<=f&&l>=u&&l<=s)return!0;if(p=n){if(c=h+(l-h)*(n-p)/(o-p),c>u&&c<=s)return!0}else if(p>f&&o<=f&&(c=h+(l-h)*(f-p)/(o-p),c>=u&&c<=s))return!0;if(h=u){if(c=p+(o-p)*(u-h)/(l-h),c>=n&&c<=f)return!0}else if(h>s&&l<=s&&(c=p+(o-p)*(s-h)/(l-h),c>=n&&c<=f))return!0;return!1};a.exports=y},16204:a=>{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){p===void 0&&(p=1);var h=r.x1,o=r.y1,l=r.x2,n=r.y2,u=t.x,f=t.y,s=(l-h)*(l-h)+(n-o)*(n-o);if(s===0)return!1;var c=((u-h)*(l-h)+(f-o)*(n-o))/s;if(c<0)return Math.sqrt((h-u)*(h-u)+(o-f)*(o-f))<=p;if(c>=0&&c<=1){var d=((o-f)*(l-h)-(h-u)*(n-o))/s;return Math.abs(d)*Math.sqrt(s)<=p}else return Math.sqrt((l-u)*(l-u)+(n-f)*(n-f))<=p};a.exports=y},14199:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(16204),p=function(h,o){if(!r(h,o))return!1;var l=Math.min(o.x1,o.x2),n=Math.max(o.x1,o.x2),u=Math.min(o.y1,o.y2),f=Math.max(o.y1,o.y2);return h.x>=l&&h.x<=n&&h.y>=u&&h.y<=f};a.exports=p},59996:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.width<=0||t.height<=0||r.width<=0||r.height<=0?!1:!(t.rightr.right||t.y>r.bottom)};a.exports=y},89265:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(76112),p=t(37303),h=t(48653),o=t(77493),l=function(n,u){if(u.left>n.right||u.rightn.bottom||u.bottom0};a.exports=l},84411:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l){return l===void 0&&(l=0),!(r>t.right+l||pt.bottom+l||o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80462),p=t(10690),h=function(o,l){return o.left>l.right||o.rightl.bottom||o.bottom{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(76112),p=function(h,o){return!!(h.contains(o.x1,o.y1)||h.contains(o.x2,o.y2)||r(h.getLineA(),o)||r(h.getLineB(),o)||r(h.getLineC(),o))};a.exports=p},82944:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(48653),p=t(71694),h=t(76112),o=function(l,n){if(l.left>n.right||l.rightn.bottom||l.bottom0||(m=p(n),S=r(l,m,!0),S.length>0)};a.exports=o},91865:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CircleToCircle:t(2044),CircleToRectangle:t(81491),GetCircleToCircle:t(63376),GetCircleToRectangle:t(97439),GetLineToCircle:t(4042),GetLineToLine:t(36100),GetLineToPoints:t(3073),GetLineToPolygon:t(56362),GetLineToRectangle:t(60646),GetRaysFromPointToPolygon:t(71147),GetRectangleIntersection:t(68389),GetRectangleToRectangle:t(52784),GetRectangleToTriangle:t(26341),GetTriangleToCircle:t(38720),GetTriangleToLine:t(13882),GetTriangleToTriangle:t(75636),LineToCircle:t(80462),LineToLine:t(76112),LineToRectangle:t(92773),PointToLine:t(16204),PointToLineSegment:t(14199),RectangleToRectangle:t(59996),RectangleToTriangle:t(89265),RectangleToValues:t(84411),TriangleToCircle:t(67636),TriangleToLine:t(2822),TriangleToTriangle:t(82944)}},91938:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)};a.exports=y},84993:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){r===void 0&&(r=1),p===void 0&&(p=[]);var h=Math.round(t.x1),o=Math.round(t.y1),l=Math.round(t.x2),n=Math.round(t.y2),u=Math.abs(l-h),f=Math.abs(n-o),s=h-f&&(d-=f,h+=s),m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=r-(t.x1+t.x2)/2,o=p-(t.y1+t.y2)/2;return t.x1+=h,t.y1+=o,t.x2+=h,t.y2+=o,t};a.exports=y},31116:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23031),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2)};a.exports=p},59944:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x1,t.y1,t.x2,t.y2)};a.exports=y},59220:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x1===r.x1&&t.y1===r.y1&&t.x2===r.x2&&t.y2===r.y2};a.exports=y},78177:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=function(h,o,l){l===void 0&&(l=o);var n=r(h),u=h.x2-h.x1,f=h.y2-h.y1;return o&&(h.x1=h.x1-u/n*o,h.y1=h.y1-f/n*o),l&&(h.x2=h.x2+u/n*l,h.y2=h.y2+f/n*l),h};a.exports=p},26708:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(52816),p=t(6113),h=t(2141),o=function(l,n,u,f,s){f===void 0&&(f=0),s===void 0&&(s=[]);var c=[],d=l.x1,v=l.y1,m=l.x2-d,S=l.y2-v,M=p(n,s),A,C,w=u-1;for(A=0;A0){var P=c[0],L=[P];for(A=1;A=f&&(L.push(O),P=O)}var I=c[c.length-1];return r(P,I){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.x=(h.x1+h.x2)/2,o.y=(h.y1+h.y2)/2,o};a.exports=p},99569:(a,y,t)=>{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l){l===void 0&&(l=new r);var n=h.x1,u=h.y1,f=h.x2,s=h.y2,c=(f-n)*(f-n)+(s-u)*(s-u);if(c===0)return l;var d=((o.x-n)*(f-n)+(o.y-u)*(s-u))/c;return l.x=n+d*(f-n),l.y=u+d*(s-u),l};a.exports=p},34638:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(91938),h=t(2141),o=function(l,n){n===void 0&&(n=new h);var u=p(l)-r.TAU;return n.x=Math.cos(u),n.y=Math.sin(u),n};a.exports=o},13151:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l){return l===void 0&&(l=new r),l.x=h.x1+(h.x2-h.x1)*o,l.y=h.y1+(h.y2-h.y1)*o,l};a.exports=p},15258:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=t(2141),h=function(o,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=r(o)/n);for(var f=o.x1,s=o.y1,c=o.x2,d=o.y2,v=0;v{/** - * @author Richard Davey - * @author Florian Mertens - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.x1,h=t.y1,o=t.x2,l=t.y2,n=(o-p)*(o-p)+(l-h)*(l-h);if(n===0)return!1;var u=((h-r.y)*(o-p)-(p-r.x)*(l-h))/n;return Math.abs(u)*Math.sqrt(n)};a.exports=y},98770:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.abs(t.y1-t.y2)};a.exports=y},35001:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))};a.exports=y},23031:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(13151),h=t(15258),o=t(23777),l=t(65822),n=t(26099),u=new r({initialize:function(s,c,d,v){s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),this.type=o.LINE,this.x1=s,this.y1=c,this.x2=d,this.y2=v},getPoint:function(f,s){return p(this,f,s)},getPoints:function(f,s,c){return h(this,f,s,c)},getRandomPoint:function(f){return l(this,f)},setTo:function(f,s,c,d){return f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),this.x1=f,this.y1=s,this.x2=c,this.y2=d,this},setFromObjects:function(f,s){return this.x1=f.x,this.y1=f.y,this.x2=s.x,this.y2=s.y,this},getPointA:function(f){return f===void 0&&(f=new n),f.set(this.x1,this.y1),f},getPointB:function(f){return f===void 0&&(f=new n),f.set(this.x2,this.y2),f},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(f){this.x1<=this.x2?this.x1=f:this.x2=f}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(f){this.x1>this.x2?this.x1=f:this.x2=f}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(f){this.y1<=this.y2?this.y1=f:this.y2=f}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(f){this.y1>this.y2?this.y1=f:this.y2=f}}});a.exports=u},64795:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(15994),h=t(91938),o=function(l){var n=h(l)-r.TAU;return p(n,-Math.PI,Math.PI)};a.exports=o},52616:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(91938),h=function(o){return Math.cos(p(o)-r.TAU)};a.exports=h},87231:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(91938),h=function(o){return Math.sin(p(o)-r.TAU)};a.exports=h},89662:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x1+=r,t.y1+=p,t.x2+=r,t.y2+=p,t};a.exports=y},71165:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return-((t.x2-t.x1)/(t.y2-t.y1))};a.exports=y},65822:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){o===void 0&&(o=new r);var l=Math.random();return o.x=h.x1+l*(h.x2-h.x1),o.y=h.y1+l*(h.y2-h.y1),o};a.exports=p},69777:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91938),p=t(64795),h=function(o,l){return 2*p(l)-Math.PI-r(o)};a.exports=h},39706:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(64400),p=function(h,o){var l=(h.x1+h.x2)/2,n=(h.y1+h.y2)/2;return r(h,l,n,o)};a.exports=p},82585:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(64400),p=function(h,o,l){return r(h,o.x,o.y,l)};a.exports=p},64400:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=Math.cos(h),l=Math.sin(h),n=t.x1-r,u=t.y1-p;return t.x1=n*o-u*l+r,t.y1=n*l+u*o+p,n=t.x2-r,u=t.y2-p,t.x2=n*o-u*l+r,t.y2=n*l+u*o+p,t};a.exports=y},62377:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){return t.x1=r,t.y1=p,t.x2=r+Math.cos(h)*o,t.y2=p+Math.sin(h)*o,t};a.exports=y},71366:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t.y2-t.y1)/(t.x2-t.x1)};a.exports=y},10809:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.abs(t.x1-t.x2)};a.exports=y},2529:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23031);r.Angle=t(91938),r.BresenhamPoints=t(84993),r.CenterOn=t(36469),r.Clone=t(31116),r.CopyFrom=t(59944),r.Equals=t(59220),r.Extend=t(78177),r.GetEasedPoints=t(26708),r.GetMidPoint=t(32125),r.GetNearestPoint=t(99569),r.GetNormal=t(34638),r.GetPoint=t(13151),r.GetPoints=t(15258),r.GetShortestDistance=t(26408),r.Height=t(98770),r.Length=t(35001),r.NormalAngle=t(64795),r.NormalX=t(52616),r.NormalY=t(87231),r.Offset=t(89662),r.PerpSlope=t(71165),r.Random=t(65822),r.ReflectAngle=t(69777),r.Rotate=t(39706),r.RotateAroundPoint=t(82585),r.RotateAroundXY=t(64400),r.SetToAngle=t(62377),r.Slope=t(71366),r.Width=t(10809),a.exports=r},83997:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(87841),h=t(26099);function o(n,u,f,s){var c=n-f,d=u-s,v=c*c+d*d;return Math.sqrt(v)}var l=new r({initialize:function(u,f,s){this.vertex1=u,this.vertex2=f,this.vertex3=s,this.bounds=new p,this._inCenter=new h},getInCenter:function(n){n===void 0&&(n=!0);var u=this.vertex1,f=this.vertex2,s=this.vertex3,c,d,v,m,S,M;n?(c=u.x,d=u.y,v=f.x,m=f.y,S=s.x,M=s.y):(c=u.vx,d=u.vy,v=f.vx,m=f.vy,S=s.vx,M=s.vy);var A=o(S,M,v,m),C=o(c,d,S,M),w=o(v,m,c,d),P=A+C+w;return this._inCenter.set((c*A+v*C+S*w)/P,(d*A+m*C+M*w)/P)},contains:function(n,u,f){var s=this.vertex1,c=this.vertex2,d=this.vertex3,v=s.vx,m=s.vy,S=c.vx,M=c.vy,A=d.vx,C=d.vy;if(f){var w=f.a,P=f.b,L=f.c,O=f.d,I=f.e,D=f.f;v=s.vx*w+s.vy*L+I,m=s.vx*P+s.vy*O+D,S=c.vx*w+c.vy*L+I,M=c.vx*P+c.vy*O+D,A=d.vx*w+d.vy*L+I,C=d.vx*P+d.vy*O+D}var B=A-v,G=C-m,z=S-v,W=M-m,k=n-v,J=u-m,Q=B*B+G*G,Y=B*z+G*W,K=B*k+G*J,U=z*z+W*W,V=z*k+W*J,j=Q*U-Y*Y,$=j===0?0:1/j,q=(U*K-Y*V)*$,it=(Q*V-Y*K)*$;return q>=0&&it>=0&&q+it<1},isCounterClockwise:function(n){var u=this.vertex1,f=this.vertex2,s=this.vertex3,c=(f.vx-u.vx)*(s.vy-u.vy)-(f.vy-u.vy)*(s.vx-u.vx);return n<=0?c>=0:c<0},load:function(n,u,f,s,c){return f=this.vertex1.load(n,u,f,s,c),f=this.vertex2.load(n,u,f,s,c),f=this.vertex3.load(n,u,f,s,c),f},transformCoordinatesLocal:function(n,u,f,s){return this.vertex1.transformCoordinatesLocal(n,u,f,s),this.vertex2.transformCoordinatesLocal(n,u,f,s),this.vertex3.transformCoordinatesLocal(n,u,f,s),this},updateBounds:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3,s=this.bounds;return s.x=Math.min(n.vx,u.vx,f.vx),s.y=Math.min(n.vy,u.vy,f.vy),s.width=Math.max(n.vx,u.vx,f.vx)-s.x,s.height=Math.max(n.vy,u.vy,f.vy)-s.y,this},isInView:function(n,u,f,s,c,d,v,m,S,M,A){this.update(s,c,d,v,m,S,M,A);var C=this.vertex1,w=this.vertex2,P=this.vertex3;if(C.ta<=0&&w.ta<=0&&P.ta<=0||u&&!this.isCounterClockwise(f))return!1;var L=this.bounds;L.x=Math.min(C.tx,w.tx,P.tx),L.y=Math.min(C.ty,w.ty,P.ty),L.width=Math.max(C.tx,w.tx,P.tx)-L.x,L.height=Math.max(C.ty,w.ty,P.ty)-L.y;var O=n.x+n.width,I=n.y+n.height;return L.width<=0||L.height<=0||n.width<=0||n.height<=0?!1:!(L.rightO||L.y>I)},scrollUV:function(n,u){return this.vertex1.scrollUV(n,u),this.vertex2.scrollUV(n,u),this.vertex3.scrollUV(n,u),this},scaleUV:function(n,u){return this.vertex1.scaleUV(n,u),this.vertex2.scaleUV(n,u),this.vertex3.scaleUV(n,u),this},setColor:function(n){return this.vertex1.color=n,this.vertex2.color=n,this.vertex3.color=n,this},update:function(n,u,f,s,c,d,v,m){return this.vertex1.update(u,f,s,c,d,v,m,n),this.vertex2.update(u,f,s,c,d,v,m,n),this.vertex3.update(u,f,s,c,d,v,m,n),this},translate:function(n,u){u===void 0&&(u=0);var f=this.vertex1,s=this.vertex2,c=this.vertex3;return f.x+=n,f.y+=u,s.x+=n,s.y+=u,c.x+=n,c.y+=u,this},x:{get:function(){return this.getInCenter().x},set:function(n){var u=this.getInCenter();this.translate(n-u.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(n){var u=this.getInCenter();this.translate(0,n-u.y)}},alpha:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.alpha+u.alpha+f.alpha)/3},set:function(n){this.vertex1.alpha=n,this.vertex2.alpha=n,this.vertex3.alpha=n}},depth:{get:function(){var n=this.vertex1,u=this.vertex2,f=this.vertex3;return(n.vz+u.vz+f.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});a.exports=l},48803:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83997),p=t(95540),h=t(37867),o=t(25836),l=t(39318),n=new o,u=new o,f=new h,s=function(c){var d=p(c,"mesh"),v=p(c,"texture",null),m=p(c,"frame"),S=p(c,"width",1),M=p(c,"height",S),A=p(c,"widthSegments",1),C=p(c,"heightSegments",A),w=p(c,"x",0),P=p(c,"y",0),L=p(c,"z",0),O=p(c,"rotateX",0),I=p(c,"rotateY",0),D=p(c,"rotateZ",0),B=p(c,"zIsUp",!0),G=p(c,"isOrtho",d?d.dirtyCache[11]:!1),z=p(c,"colors",[16777215]),W=p(c,"alphas",[1]),k=p(c,"tile",!1),J=p(c,"flipY",!1),Q=p(c,"width",null),Y={faces:[],verts:[]};n.set(w,P,L),u.set(O,I,D),f.fromRotationXYTranslation(u,n,B);var K;if(!v&&d)v=d.texture,m||(K=d.frame);else if(d&&typeof v=="string")v=d.scene.sys.textures.get(v);else if(!v)return Y;K||(K=v.get(m)),!Q&&G&&v&&d&&(S=K.width/d.height,M=K.height/d.height);var U=S/2,V=M/2,j=Math.floor(A),$=Math.floor(C),q=j+1,it=$+1,nt=S/j,et=M/$,ht=[],ut=[],dt,mt,gt=0,At=1,ot=0,st=1;K&&(gt=K.u0,At=K.u1,J?(ot=K.v1,st=K.v0):(ot=K.v0,st=K.v1));var yt=At-gt,Tt=st-ot;for(mt=0;mt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83997),p=t(37867),h=t(25836),o=t(39318),l=new h,n=new h,u=new p,f=function(s,c,d,v,m,S,M,A,C,w){d===void 0&&(d=1),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),A===void 0&&(A=0),C===void 0&&(C=0),w===void 0&&(w=!0);var P={faces:[],verts:[]},L=s.materials;l.set(v,m,S),n.set(M,A,C),u.fromRotationXYTranslation(n,l,w);for(var O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83997),p=t(39318),h=function(o,l,n,u,f,s,c,d){if(u===void 0&&(u=!1),s===void 0&&(s=16777215),c===void 0&&(c=1),d===void 0&&(d=!1),o.length!==l.length&&!u){console.warn("GenerateVerts: vertices and uvs count not equal");return}var v={faces:[],vertices:[]},m,S,M,A,C,w,P,L,O,I,D,B=u?3:2,G=Array.isArray(s),z=Array.isArray(c);if(Array.isArray(n)&&n.length>0)for(m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=!0,t="untitled",r="",p="";function h(S){var M=S.indexOf("#");return M>-1?S.substring(0,M):S}function o(S){return S.models.length===0&&S.models.push({faces:[],name:t,textureCoords:[],vertexNormals:[],vertices:[]}),r="",S.models[S.models.length-1]}function l(S,M){var A=S.length>=2?S[1]:t;M.models.push({faces:[],name:A,textureCoords:[],vertexNormals:[],vertices:[]}),r=""}function n(S){S.length===2&&(r=S[1])}function u(S,M){var A=S.length,C=A>=2?parseFloat(S[1]):0,w=A>=3?parseFloat(S[2]):0,P=A>=4?parseFloat(S[3]):0;o(M).vertices.push({x:C,y:w,z:P})}function f(S,M){var A=S.length,C=A>=2?parseFloat(S[1]):0,w=A>=3?parseFloat(S[2]):0,P=A>=4?parseFloat(S[3]):0;isNaN(C)&&(C=0),isNaN(w)&&(w=0),isNaN(P)&&(P=0),y&&(w=1-w),o(M).textureCoords.push({u:C,v:w,w:P})}function s(S,M){var A=S.length,C=A>=2?parseFloat(S[1]):0,w=A>=3?parseFloat(S[2]):0,P=A>=4?parseFloat(S[3]):0;o(M).vertexNormals.push({x:C,y:w,z:P})}function c(S,M){var A=S.length-1;if(!(A<3)){for(var C={group:r,material:p,vertices:[]},w=0;w3)){var I=0,D=0,B=0;I=parseInt(L[0],10),O>1&&L[1]!==""&&(D=parseInt(L[1],10)),O>2&&(B=parseInt(L[2],10)),I!==0&&(I<0&&(I=o(M).vertices.length+1+I),D-=1,I-=1,B-=1,C.vertices.push({textureCoordsIndex:D,vertexIndex:I,vertexNormalIndex:B}))}}o(M).faces.push(C)}}function d(S,M){S.length>=2&&M.materialLibraries.push(S[1])}function v(S){S.length>=2&&(p=S[1])}var m=function(S,M){M===void 0&&(M=!0),y=M;var A={materials:{},materialLibraries:[],models:[]};r="",p="";for(var C=S.split(` -`),w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37589),p=function(h){for(var o={},l=h.split(` -`),n="",u=0;u=2?Math.floor(s[2]*255):c,v=s.length>=3?Math.floor(s[3]*255):c;o[n]=r(c,d,v);break}}}}return o};a.exports=p},92570:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o,l;if(p===void 0&&h===void 0){var n=t.getInCenter();o=n.x,l=n.y}var u=Math.cos(r),f=Math.sin(r),s=t.vertex1,c=t.vertex2,d=t.vertex3,v=s.x-o,m=s.y-l;s.set(v*u-m*f+o,v*f+m*u+l),v=c.x-o,m=c.y-l,c.set(v*u-m*f+o,v*f+m*u+l),v=d.x-o,m=d.y-l,d.set(v*u-m*f+o,v*f+m*u+l)};a.exports=y},39318:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(70554),h=t(25836),o=new r({Extends:h,initialize:function(n,u,f,s,c,d,v,m,S,M){d===void 0&&(d=16777215),v===void 0&&(v=1),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),h.call(this,n,u,f),this.vx=0,this.vy=0,this.vz=0,this.nx=m,this.ny=S,this.nz=M,this.u=s,this.v=c,this.color=d,this.alpha=v,this.tx=0,this.ty=0,this.ta=0,this.tu=s,this.tv=c},setUVs:function(l,n){return this.u=l,this.v=n,this.tu=l,this.tv=n,this},scrollUV:function(l,n){return this.tu+=l,this.tv+=n,this},scaleUV:function(l,n){return this.tu=this.u*l,this.tv=this.v*n,this},transformCoordinatesLocal:function(l,n,u,f){var s=this.x,c=this.y,d=this.z,v=l.val,m=s*v[0]+c*v[4]+d*v[8]+v[12],S=s*v[1]+c*v[5]+d*v[9]+v[13],M=s*v[2]+c*v[6]+d*v[10]+v[14],A=s*v[3]+c*v[7]+d*v[11]+v[15];this.vx=m/A*n,this.vy=-(S/A)*u,f<=0?this.vz=M/A:this.vz=-(M/A)},resize:function(l,n,u,f,s,c){return this.x=l,this.y=n,this.vx=this.x*u,this.vy=-this.y*f,this.vz=0,s<.5?this.vx+=u*(.5-s):s>.5&&(this.vx-=u*(s-.5)),c<.5?this.vy+=f*(.5-c):c>.5&&(this.vy-=f*(c-.5)),this},update:function(l,n,u,f,s,c,d,v){var m=this.vx*l+this.vy*u+s,S=this.vx*n+this.vy*f+c;return d&&(m=Math.round(m),S=Math.round(S)),this.tx=m,this.ty=S,this.ta=this.alpha*v,this},load:function(l,n,u,f,s){return l[++u]=this.tx,l[++u]=this.ty,l[++u]=this.tu,l[++u]=this.tv,l[++u]=f,l[++u]=s,n[++u]=p.getTintAppendFloatAlpha(this.color,this.ta),u}});a.exports=o},73090:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={Face:t(83997),GenerateGridVerts:t(48803),GenerateObjVerts:t(34684),GenerateVerts:t(92515),ParseObj:t(85048),ParseObjMaterial:t(61485),RotateFace:t(92570),Vertex:t(39318)};a.exports=r},96550:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))};a.exports=y},99706:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h){return new r(h.x,h.y)};a.exports=p},68010:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x,t.y)};a.exports=y},27814:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x===r.x&&t.y===r.y};a.exports=y},73565:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))};a.exports=y},87555:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){if(o===void 0&&(o=new r),!Array.isArray(h))throw new Error("GetCentroid points argument must be an array");var l=h.length;if(l<1)throw new Error("GetCentroid points array must not be empty");if(l===1)o.x=h[0].x,o.y=h[0].y;else{for(var n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)};a.exports=y},44405:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x*t.x+t.y*t.y};a.exports=y},20873:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o){o===void 0&&(o=new r);for(var l=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,f=Number.POSITIVE_INFINITY,s=0;sl&&(l=c.x),c.xu&&(u=c.y),c.y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l,n){return l===void 0&&(l=0),n===void 0&&(n=new r),n.x=h.x+(o.x-h.x)*l,n.y=h.y+(o.y-h.y)*l,n};a.exports=p},55767:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.setTo(t.y,t.x)};a.exports=y},79432:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.setTo(-h.x,-h.y)};a.exports=p},2141:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23777),h=new r({initialize:function(l,n){l===void 0&&(l=0),n===void 0&&(n=l),this.type=p.POINT,this.x=l,this.y=n},setTo:function(o,l){return o===void 0&&(o=0),l===void 0&&(l=o),this.x=o,this.y=l,this}});a.exports=h},72930:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(44405),h=function(o,l,n){n===void 0&&(n=new r);var u=o.x*l.x+o.y*l.y,f=u/p(l);return f!==0&&(n.x=f*l.x,n.y=f*l.y),n};a.exports=h},62880:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o,l){l===void 0&&(l=new r);var n=h.x*o.x+h.y*o.y;return n!==0&&(l.x=n*o.x,l.y=n*o.y),l};a.exports=p},15093:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(28793),p=function(h,o){if(h.x!==0||h.y!==0){var l=r(h);h.x/=l,h.y/=l}return h.x*=o,h.y*=o,h};a.exports=p},43711:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141);r.Ceil=t(96550),r.Clone=t(99706),r.CopyFrom=t(68010),r.Equals=t(27814),r.Floor=t(73565),r.GetCentroid=t(87555),r.GetMagnitude=t(28793),r.GetMagnitudeSq=t(44405),r.GetRectangleFromPoints=t(20873),r.Interpolate=t(26152),r.Invert=t(55767),r.Negative=t(79432),r.Project=t(72930),r.ProjectUnit=t(62880),r.SetMagnitude=t(15093),a.exports=r},12306:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25717),p=function(h){return new r(h.points)};a.exports=p},63814:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){for(var h=!1,o=-1,l=t.points.length-1;++o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(63814),p=function(h,o){return r(h,o.x,o.y)};a.exports=p},94811:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(Y,K,U){U=U||2;var V=K&&K.length,j=V?K[0]*U:Y.length,$=t(Y,0,j,U,!0),q=[];if(!$||$.next===$.prev)return q;var it,nt,et,ht,ut,dt,mt;if(V&&($=u(Y,K,$,U)),Y.length>80*U){it=et=Y[0],nt=ht=Y[1];for(var gt=U;gtet&&(et=ut),dt>ht&&(ht=dt);mt=Math.max(et-it,ht-nt),mt=mt!==0?32767/mt:0}return p($,q,U,it,nt,mt,0),q}function t(Y,K,U,V,j){var $,q;if(j===Q(Y,K,U,V)>0)for($=K;$=K;$-=V)q=W($,Y[$],Y[$+1],q);return q&&P(q,q.next)&&(k(q),q=q.next),q}function r(Y,K){if(!Y)return Y;K||(K=Y);var U=Y,V;do if(V=!1,!U.steiner&&(P(U,U.next)||w(U.prev,U,U.next)===0)){if(k(U),U=K=U.prev,U===U.next)break;V=!0}else U=U.next;while(V||U!==K);return K}function p(Y,K,U,V,j,$,q){if(Y){!q&&$&&v(Y,V,j,$);for(var it=Y,nt,et;Y.prev!==Y.next;){if(nt=Y.prev,et=Y.next,$?o(Y,V,j,$):h(Y)){K.push(nt.i/U|0),K.push(Y.i/U|0),K.push(et.i/U|0),k(Y),Y=et.next,it=et.next;continue}if(Y=et,Y===it){q?q===1?(Y=l(r(Y),K,U),p(Y,K,U,V,j,$,2)):q===2&&n(Y,K,U,V,j,$):p(r(Y),K,U,V,j,$,1);break}}}}function h(Y){var K=Y.prev,U=Y,V=Y.next;if(w(K,U,V)>=0)return!1;for(var j=K.x,$=U.x,q=V.x,it=K.y,nt=U.y,et=V.y,ht=j<$?j$?j>q?j:q:$>q?$:q,mt=it>nt?it>et?it:et:nt>et?nt:et,gt=V.next;gt!==K;){if(gt.x>=ht&>.x<=dt&>.y>=ut&>.y<=mt&&A(j,it,$,nt,q,et,gt.x,gt.y)&&w(gt.prev,gt,gt.next)>=0)return!1;gt=gt.next}return!0}function o(Y,K,U,V){var j=Y.prev,$=Y,q=Y.next;if(w(j,$,q)>=0)return!1;for(var it=j.x,nt=$.x,et=q.x,ht=j.y,ut=$.y,dt=q.y,mt=itnt?it>et?it:et:nt>et?nt:et,ot=ht>ut?ht>dt?ht:dt:ut>dt?ut:dt,st=S(mt,gt,K,U,V),yt=S(At,ot,K,U,V),Tt=Y.prevZ,wt=Y.nextZ;Tt&&Tt.z>=st&&wt&&wt.z<=yt;){if(Tt.x>=mt&&Tt.x<=At&&Tt.y>=gt&&Tt.y<=ot&&Tt!==j&&Tt!==q&&A(it,ht,nt,ut,et,dt,Tt.x,Tt.y)&&w(Tt.prev,Tt,Tt.next)>=0||(Tt=Tt.prevZ,wt.x>=mt&&wt.x<=At&&wt.y>=gt&&wt.y<=ot&&wt!==j&&wt!==q&&A(it,ht,nt,ut,et,dt,wt.x,wt.y)&&w(wt.prev,wt,wt.next)>=0))return!1;wt=wt.nextZ}for(;Tt&&Tt.z>=st;){if(Tt.x>=mt&&Tt.x<=At&&Tt.y>=gt&&Tt.y<=ot&&Tt!==j&&Tt!==q&&A(it,ht,nt,ut,et,dt,Tt.x,Tt.y)&&w(Tt.prev,Tt,Tt.next)>=0)return!1;Tt=Tt.prevZ}for(;wt&&wt.z<=yt;){if(wt.x>=mt&&wt.x<=At&&wt.y>=gt&&wt.y<=ot&&wt!==j&&wt!==q&&A(it,ht,nt,ut,et,dt,wt.x,wt.y)&&w(wt.prev,wt,wt.next)>=0)return!1;wt=wt.nextZ}return!0}function l(Y,K,U){var V=Y;do{var j=V.prev,$=V.next.next;!P(j,$)&&L(j,V,V.next,$)&&B(j,$)&&B($,j)&&(K.push(j.i/U|0),K.push(V.i/U|0),K.push($.i/U|0),k(V),k(V.next),V=Y=$),V=V.next}while(V!==Y);return r(V)}function n(Y,K,U,V,j,$){var q=Y;do{for(var it=q.next.next;it!==q.prev;){if(q.i!==it.i&&C(q,it)){var nt=z(q,it);q=r(q,q.next),nt=r(nt,nt.next),p(q,K,U,V,j,$,0),p(nt,K,U,V,j,$,0);return}it=it.next}q=q.next}while(q!==Y)}function u(Y,K,U,V){var j=[],$,q,it,nt,et;for($=0,q=K.length;$=U.next.y&&U.next.y!==U.y){var it=U.x+(j-U.y)*(U.next.x-U.x)/(U.next.y-U.y);if(it<=V&&it>$&&($=it,q=U.x=U.x&&U.x>=et&&V!==U.x&&A(jq.x||U.x===q.x&&d(q,U)))&&(q=U,ut=dt)),U=U.next;while(U!==nt);return q}function d(Y,K){return w(Y.prev,Y,K.prev)<0&&w(K.next,Y,Y.next)<0}function v(Y,K,U,V){var j=Y;do j.z===0&&(j.z=S(j.x,j.y,K,U,V)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==Y);j.prevZ.nextZ=null,j.prevZ=null,m(j)}function m(Y){var K,U,V,j,$,q,it,nt,et=1;do{for(U=Y,Y=null,$=null,q=0;U;){for(q++,V=U,it=0,K=0;K0||nt>0&&V;)it!==0&&(nt===0||!V||U.z<=V.z)?(j=U,U=U.nextZ,it--):(j=V,V=V.nextZ,nt--),$?$.nextZ=j:Y=j,j.prevZ=$,$=j;U=V}$.nextZ=null,et*=2}while(q>1);return Y}function S(Y,K,U,V,j){return Y=(Y-U)*j|0,K=(K-V)*j|0,Y=(Y|Y<<8)&16711935,Y=(Y|Y<<4)&252645135,Y=(Y|Y<<2)&858993459,Y=(Y|Y<<1)&1431655765,K=(K|K<<8)&16711935,K=(K|K<<4)&252645135,K=(K|K<<2)&858993459,K=(K|K<<1)&1431655765,Y|K<<1}function M(Y){var K=Y,U=Y;do(K.x=(Y-q)*($-it)&&(Y-q)*(V-it)>=(U-q)*(K-it)&&(U-q)*($-it)>=(j-q)*(V-it)}function C(Y,K){return Y.next.i!==K.i&&Y.prev.i!==K.i&&!D(Y,K)&&(B(Y,K)&&B(K,Y)&&G(Y,K)&&(w(Y.prev,Y,K.prev)||w(Y,K.prev,K))||P(Y,K)&&w(Y.prev,Y,Y.next)>0&&w(K.prev,K,K.next)>0)}function w(Y,K,U){return(K.y-Y.y)*(U.x-K.x)-(K.x-Y.x)*(U.y-K.y)}function P(Y,K){return Y.x===K.x&&Y.y===K.y}function L(Y,K,U,V){var j=I(w(Y,K,U)),$=I(w(Y,K,V)),q=I(w(U,V,Y)),it=I(w(U,V,K));return!!(j!==$&&q!==it||j===0&&O(Y,U,K)||$===0&&O(Y,V,K)||q===0&&O(U,Y,V)||it===0&&O(U,K,V))}function O(Y,K,U){return K.x<=Math.max(Y.x,U.x)&&K.x>=Math.min(Y.x,U.x)&&K.y<=Math.max(Y.y,U.y)&&K.y>=Math.min(Y.y,U.y)}function I(Y){return Y>0?1:Y<0?-1:0}function D(Y,K){var U=Y;do{if(U.i!==Y.i&&U.next.i!==Y.i&&U.i!==K.i&&U.next.i!==K.i&&L(U,U.next,Y,K))return!0;U=U.next}while(U!==Y);return!1}function B(Y,K){return w(Y.prev,Y,Y.next)<0?w(Y,K,Y.next)>=0&&w(Y,Y.prev,K)>=0:w(Y,K,Y.prev)<0||w(Y,Y.next,K)<0}function G(Y,K){var U=Y,V=!1,j=(Y.x+K.x)/2,$=(Y.y+K.y)/2;do U.y>$!=U.next.y>$&&U.next.y!==U.y&&j<(U.next.x-U.x)*($-U.y)/(U.next.y-U.y)+U.x&&(V=!V),U=U.next;while(U!==Y);return V}function z(Y,K){var U=new J(Y.i,Y.x,Y.y),V=new J(K.i,K.x,K.y),j=Y.next,$=K.prev;return Y.next=K,K.prev=Y,U.next=j,j.prev=U,V.next=U,U.prev=V,$.next=V,V.prev=$,V}function W(Y,K,U,V){var j=new J(Y,K,U);return V?(j.next=V.next,j.prev=V,V.next.prev=j,V.next=j):(j.prev=j,j.next=j),j}function k(Y){Y.next.prev=Y.prev,Y.prev.next=Y.next,Y.prevZ&&(Y.prevZ.nextZ=Y.nextZ),Y.nextZ&&(Y.nextZ.prevZ=Y.prevZ)}function J(Y,K,U){this.i=Y,this.x=K,this.y=U,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}y.deviation=function(Y,K,U,V){var j=K&&K.length,$=j?K[0]*U:Y.length,q=Math.abs(Q(Y,0,$,U));if(j)for(var it=0,nt=K.length;it0&&(V+=Y[j-1].length,U.holes.push(V))}return U},a.exports=y},13829:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o){o===void 0&&(o=new r);for(var l=1/0,n=1/0,u=-l,f=-n,s,c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=[]);for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=t(23031),h=t(30052),o=function(l,n,u,f){f===void 0&&(f=[]);var s=l.points,c=h(l);!n&&u>0&&(n=c/u);for(var d=0;dm+w){m+=w;continue}var P=C.getPoint((v-m)/w);f.push(P);break}return f};a.exports=o},30052:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=t(23031),h=function(o){for(var l=o.points,n=0,u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(63814),h=t(9564),o=t(23777),l=new r({initialize:function(u){this.type=o.POLYGON,this.area=0,this.points=[],u&&this.setTo(u)},contains:function(n,u){return p(this,n,u)},setTo:function(n){if(this.area=0,this.points=[],typeof n=="string"&&(n=n.split(" ")),!Array.isArray(n))return this;for(var u,f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.points.reverse(),t};a.exports=y},29524:a=>{function y(l,n){var u=l.x-n.x,f=l.y-n.y;return u*u+f*f}function t(l,n,u){var f=n.x,s=n.y,c=u.x-f,d=u.y-s;if(c!==0||d!==0){var v=((l.x-f)*c+(l.y-s)*d)/(c*c+d*d);v>1?(f=u.x,s=u.y):v>0&&(f+=c*v,s+=d*v)}return c=l.x-f,d=l.y-s,c*c+d*d}function r(l,n){for(var u=l[0],f=[u],s,c=1,d=l.length;cn&&(f.push(s),u=s);return u!==s&&f.push(s),f}function p(l,n,u,f,s){for(var c=f,d,v=n+1;vc&&(d=v,c=m)}c>f&&(d-n>1&&p(l,n,d,f,s),s.push(l[d]),u-d>1&&p(l,d,u,f,s))}function h(l,n){var u=l.length-1,f=[l[0]];return p(l,0,u,n,f),f.push(l[u]),f}var o=function(l,n,u){n===void 0&&(n=1),u===void 0&&(u=!1);var f=l.points;if(f.length>2){var s=n*n;u||(f=r(f,s)),l.setTo(h(f,s))}return l};a.exports=o},5469:a=>{/** - * @author Richard Davey - * @author Igor Ognichenko - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(r,p){return r[0]=p[0],r[1]=p[1],r},t=function(r){var p,h=[],o=r.points;for(p=0;p0&&l.push(y([0,0],h[0])),p=0;p1&&l.push(y([0,0],h[h.length-1])),r.setTo(l)};a.exports=t},24709:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){for(var h=t.points,o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25717);r.Clone=t(12306),r.Contains=t(63814),r.ContainsPoint=t(99338),r.Earcut=t(94811),r.GetAABB=t(13829),r.GetNumberArray=t(26173),r.GetPoints=t(9564),r.Perimeter=t(30052),r.Reverse=t(8133),r.Simplify=t(29524),r.Smooth=t(5469),r.Translate=t(24709),a.exports=r},62224:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.width*t.height};a.exports=y},98615:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t};a.exports=y},31688:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t};a.exports=y},67502:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x=r-t.width/2,t.y=p-t.height/2,t};a.exports=y},65085:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h){return new r(h.x,h.y,h.width,h.height)};a.exports=p},37303:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.width<=0||t.height<=0?!1:t.x<=r&&t.x+t.width>=r&&t.y<=p&&t.y+t.height>=p};a.exports=y},96553:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37303),p=function(h,o){return r(h,o.x,o.y)};a.exports=p},70273:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.width*r.height>t.width*t.height?!1:r.x>t.x&&r.xt.x&&r.rightt.y&&r.yt.y&&r.bottom{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x,t.y,t.width,t.height)};a.exports=y},77493:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=[]),r.push({x:t.x,y:t.y}),r.push({x:t.right,y:t.y}),r.push({x:t.right,y:t.bottom}),r.push({x:t.x,y:t.bottom}),r};a.exports=y},9219:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height};a.exports=y},53751:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8249),p=function(h,o){var l=r(h);return l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(8249),p=function(h,o){var l=r(h);return l>r(o)?h.setSize(o.height*l,o.height):h.setSize(o.width,o.width/l),h.setPosition(o.centerX-h.width/2,o.centerY-h.height/2)};a.exports=p},80774:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t};a.exports=y},83859:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t};a.exports=y},19217:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=t(36383),h=function(o,l){if(l===void 0&&(l=new r),o.length===0)return l;for(var n=Number.MAX_VALUE,u=Number.MAX_VALUE,f=p.MIN_SAFE_INTEGER,s=p.MIN_SAFE_INTEGER,c,d,v,m=0;m{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o,l,n,u){return u===void 0&&(u=new r),u.setTo(Math.min(h,l),Math.min(o,n),Math.abs(h-l),Math.abs(o-n))};a.exports=p},8249:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.height===0?NaN:t.width/t.height};a.exports=y},27165:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.x=h.centerX,o.y=h.centerY,o};a.exports=p},20812:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13019),p=t(2141),h=function(o,l,n){if(n===void 0&&(n=new p),l<=0||l>=1)return n.x=o.x,n.y=o.y,n;var u=r(o)*l;return l>.5?(u-=o.width+o.height,u<=o.width?(n.x=o.right-u,n.y=o.bottom):(n.x=o.x,n.y=o.bottom-(u-o.width))):u<=o.width?(n.x=o.x+u,n.y=o.y):(n.x=o.right,n.y=o.y+(u-o.width)),n};a.exports=h},34819:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20812),p=t(13019),h=function(o,l,n,u){u===void 0&&(u=[]),!l&&n>0&&(l=p(o)/n);for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.x=h.width,o.y=h.height,o};a.exports=p},86091:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(67502),p=function(h,o,l){var n=h.centerX,u=h.centerY;return h.setSize(h.width+o*2,h.height+l*2),r(h,n,u)};a.exports=p},53951:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=t(59996),h=function(o,l,n){return n===void 0&&(n=new r),p(o,l)?(n.x=Math.max(o.x,l.x),n.y=Math.max(o.y,l.y),n.width=Math.min(o.right,l.right)-n.x,n.height=Math.min(o.bottom,l.bottom)-n.y):n.setEmpty(),n};a.exports=h},14649:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13019),p=t(2141),h=function(o,l,n,u){if(u===void 0&&(u=[]),!l&&!n)return u;l?n=Math.round(r(o)/l):l=r(o)/n;for(var f=o.x,s=o.y,c=0,d=0;d=o.right&&(c=1,s+=f-o.right,f=o.right);break;case 1:s+=l,s>=o.bottom&&(c=2,f-=s-o.bottom,s=o.bottom);break;case 2:f-=l,f<=o.left&&(c=3,s-=o.left-f,f=o.left);break;case 3:s-=l,s<=o.top&&(c=0,s=o.top);break}return u};a.exports=h},33595:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){for(var p=t.x,h=t.right,o=t.y,l=t.bottom,n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=Math.min(t.x,r.x),h=Math.max(t.right,r.right);t.x=p,t.width=h-p;var o=Math.min(t.y,r.y),l=Math.max(t.bottom,r.bottom);return t.y=o,t.height=l-o,t};a.exports=y},92171:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=Math.min(t.x,r),o=Math.max(t.right,r);t.x=h,t.width=o-h;var l=Math.min(t.y,p),n=Math.max(t.bottom,p);return t.y=l,t.height=n-l,t};a.exports=y},42981:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x+=r,t.y+=p,t};a.exports=y},46907:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x+=r.x,t.y+=r.y,t};a.exports=y},60170:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.xr.x&&t.yr.y};a.exports=y},13019:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return 2*(t.width+t.height)};a.exports=y},85133:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(39506),h=function(o,l,n){n===void 0&&(n=new r),l=p(l);var u=Math.sin(l),f=Math.cos(l),s=f>0?o.width/2:o.width/-2,c=u>0?o.height/2:o.height/-2;return Math.abs(s*u){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.x=h.x+Math.random()*h.width,o.y=h.y+Math.random()*h.height,o};a.exports=p},86470:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30976),p=t(70273),h=t(2141),o=function(l,n,u){if(u===void 0&&(u=new h),p(l,n))switch(r(0,3)){case 0:u.x=l.x+Math.random()*(n.right-l.x),u.y=l.y+Math.random()*(n.top-l.y);break;case 1:u.x=n.x+Math.random()*(l.right-n.x),u.y=n.bottom+Math.random()*(l.bottom-n.bottom);break;case 2:u.x=l.x+Math.random()*(n.x-l.x),u.y=n.y+Math.random()*(l.bottom-n.y);break;case 3:u.x=n.right+Math.random()*(l.right-n.right),u.y=l.y+Math.random()*(n.bottom-l.y);break}return u};a.exports=o},87841:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(37303),h=t(20812),o=t(34819),l=t(23777),n=t(23031),u=t(26597),f=new r({initialize:function(c,d,v,m){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),this.type=l.RECTANGLE,this.x=c,this.y=d,this.width=v,this.height=m},contains:function(s,c){return p(this,s,c)},getPoint:function(s,c){return h(this,s,c)},getPoints:function(s,c,d){return o(this,s,c,d)},getRandomPoint:function(s){return u(this,s)},setTo:function(s,c,d,v){return this.x=s,this.y=c,this.width=d,this.height=v,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(s,c){return c===void 0&&(c=s),this.x=s,this.y=c,this},setSize:function(s,c){return c===void 0&&(c=s),this.width=s,this.height=c,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(s){return s===void 0&&(s=new n),s.setTo(this.x,this.y,this.right,this.y),s},getLineB:function(s){return s===void 0&&(s=new n),s.setTo(this.right,this.y,this.right,this.bottom),s},getLineC:function(s){return s===void 0&&(s=new n),s.setTo(this.right,this.bottom,this.x,this.bottom),s},getLineD:function(s){return s===void 0&&(s=new n),s.setTo(this.x,this.bottom,this.x,this.y),s},left:{get:function(){return this.x},set:function(s){s>=this.right?this.width=0:this.width=this.right-s,this.x=s}},right:{get:function(){return this.x+this.width},set:function(s){s<=this.x?this.width=0:this.width=s-this.x}},top:{get:function(){return this.y},set:function(s){s>=this.bottom?this.height=0:this.height=this.bottom-s,this.y=s}},bottom:{get:function(){return this.y+this.height},set:function(s){s<=this.y?this.height=0:this.height=s-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(s){this.x=s-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(s){this.y=s-this.height/2}}});a.exports=f},94845:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.width===r.width&&t.height===r.height};a.exports=y},31730:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p===void 0&&(p=r),t.width*=r,t.height*=p,t};a.exports=y},36899:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=function(h,o,l){l===void 0&&(l=new r);var n=Math.min(h.x,o.x),u=Math.min(h.y,o.y),f=Math.max(h.right,o.right)-n,s=Math.max(h.bottom,o.bottom)-u;return l.setTo(n,u,f,s)};a.exports=p},93232:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841);r.Area=t(62224),r.Ceil=t(98615),r.CeilAll=t(31688),r.CenterOn=t(67502),r.Clone=t(65085),r.Contains=t(37303),r.ContainsPoint=t(96553),r.ContainsRect=t(70273),r.CopyFrom=t(43459),r.Decompose=t(77493),r.Equals=t(9219),r.FitInside=t(53751),r.FitOutside=t(16088),r.Floor=t(80774),r.FloorAll=t(83859),r.FromPoints=t(19217),r.FromXY=t(9477),r.GetAspectRatio=t(8249),r.GetCenter=t(27165),r.GetPoint=t(20812),r.GetPoints=t(34819),r.GetSize=t(51313),r.Inflate=t(86091),r.Intersection=t(53951),r.MarchingAnts=t(14649),r.MergePoints=t(33595),r.MergeRect=t(20074),r.MergeXY=t(92171),r.Offset=t(42981),r.OffsetPoint=t(46907),r.Overlaps=t(60170),r.Perimeter=t(13019),r.PerimeterPoint=t(85133),r.Random=t(26597),r.RandomOutside=t(86470),r.SameDimensions=t(94845),r.Scale=t(31730),r.Union=t(36899),a.exports=r},41658:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=t.x1,p=t.y1,h=t.x2,o=t.y2,l=t.x3,n=t.y3;return Math.abs(((l-r)*(o-p)-(h-r)*(n-p))/2)};a.exports=y},39208:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(16483),p=function(h,o,l){var n=l*(Math.sqrt(3)/2),u=h,f=o,s=h+l/2,c=o+n,d=h-l/2,v=o+n;return new r(u,f,s,c,d,v)};a.exports=p},39545:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(94811),p=t(16483),h=function(o,l,n,u,f){l===void 0&&(l=null),n===void 0&&(n=1),u===void 0&&(u=1),f===void 0&&(f=[]);for(var s=r(o,l),c,d,v,m,S,M,A,C,w,P=0;P{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(16483),p=function(h,o,l,n){n===void 0&&(n=l);var u=h,f=o,s=h,c=o-n,d=h+l,v=o;return new r(u,f,s,c,d,v)};a.exports=p},23707:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(97523),p=t(13584),h=function(o,l,n,u){u===void 0&&(u=r);var f=u(o),s=l-f.x,c=n-f.y;return p(o,s,c)};a.exports=h},97523:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){return o===void 0&&(o=new r),o.x=(h.x1+h.x2+h.x3)/3,o.y=(h.y1+h.y2+h.y3)/3,o};a.exports=p},24951:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099);function p(o,l,n,u){return o*u-l*n}var h=function(o,l){l===void 0&&(l=new r);var n=o.x3,u=o.y3,f=o.x1-n,s=o.y1-u,c=o.x2-n,d=o.y2-u,v=2*p(f,s,c,d),m=p(s,f*f+s*s,d,c*c+d*d),S=p(f,f*f+s*s,c,c*c+d*d);return l.x=n-m/v,l.y=u+S/v,l};a.exports=h},85614:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(96503),p=function(h,o){o===void 0&&(o=new r);var l=h.x1,n=h.y1,u=h.x2,f=h.y2,s=h.x3,c=h.y3,d=u-l,v=f-n,m=s-l,S=c-n,M=d*(l+u)+v*(n+f),A=m*(l+s)+S*(n+c),C=2*(d*(c-f)-v*(s-u)),w,P;if(Math.abs(C)<1e-6){var L=Math.min(l,u,s),O=Math.min(n,f,c);w=(Math.max(l,u,s)-L)*.5,P=(Math.max(n,f,c)-O)*.5,o.x=L+w,o.y=O+P,o.radius=Math.sqrt(w*w+P*P)}else o.x=(S*M-v*A)/C,o.y=(d*A-m*M)/C,w=o.x-l,P=o.y-n,o.radius=Math.sqrt(w*w+P*P);return o};a.exports=p},74422:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(16483),p=function(h){return new r(h.x1,h.y1,h.x2,h.y2,h.x3,h.y3)};a.exports=p},10690:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=t.x3-t.x1,o=t.y3-t.y1,l=t.x2-t.x1,n=t.y2-t.y1,u=r-t.x1,f=p-t.y1,s=h*h+o*o,c=h*l+o*n,d=h*u+o*f,v=l*l+n*n,m=l*u+n*f,S=s*v-c*c,M=S===0?0:1/S,A=(v*d-c*m)*M,C=(s*m-c*d)*M;return A>=0&&C>=0&&A+C<1};a.exports=y},48653:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p===void 0&&(p=!1),h===void 0&&(h=[]);for(var o=t.x3-t.x1,l=t.y3-t.y1,n=t.x2-t.x1,u=t.y2-t.y1,f=o*o+l*l,s=o*n+l*u,c=n*n+u*u,d=f*c-s*s,v=d===0?0:1/d,m,S,M,A,C,w,P=t.x1,L=t.y1,O=0;O=0&&S>=0&&m+S<1&&(h.push({x:r[O].x,y:r[O].y}),p)));O++);return h};a.exports=y},96006:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10690),p=function(h,o){return r(h,o.x,o.y)};a.exports=p},71326:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)};a.exports=y},71694:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=[]),r.push({x:t.x1,y:t.y1}),r.push({x:t.x2,y:t.y2}),r.push({x:t.x3,y:t.y3}),r};a.exports=y},33522:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.x1===r.x1&&t.y1===r.y1&&t.x2===r.x2&&t.y2===r.y2&&t.x3===r.x3&&t.y3===r.y3};a.exports=y},20437:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=t(35001),h=function(o,l,n){n===void 0&&(n=new r);var u=o.getLineA(),f=o.getLineB(),s=o.getLineC();if(l<=0||l>=1)return n.x=u.x1,n.y=u.y1,n;var c=p(u),d=p(f),v=p(s),m=c+d+v,S=m*l,M=0;return Sc+d?(S-=c+d,M=S/v,n.x=s.x1+(s.x2-s.x1)*M,n.y=s.y1+(s.y2-s.y1)*M):(S-=c,M=S/d,n.x=f.x1+(f.x2-f.x1)*M,n.y=f.y1+(f.y2-f.y1)*M),n};a.exports=h},80672:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=t(2141),h=function(o,l,n,u){u===void 0&&(u=[]);var f=o.getLineA(),s=o.getLineB(),c=o.getLineC(),d=r(f),v=r(s),m=r(c),S=d+v+m;!l&&n>0&&(l=S/n);for(var M=0;Md+v?(A-=d+v,C=A/m,w.x=c.x1+(c.x2-c.x1)*C,w.y=c.y1+(c.y2-c.y1)*C):(A-=d,C=A/v,w.x=s.x1+(s.x2-s.x1)*C,w.y=s.y1+(s.y2-s.y1)*C),u.push(w)}return u};a.exports=h},39757:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141);function p(o,l,n,u){var f=o-n,s=l-u,c=f*f+s*s;return Math.sqrt(c)}var h=function(o,l){l===void 0&&(l=new r);var n=o.x1,u=o.y1,f=o.x2,s=o.y2,c=o.x3,d=o.y3,v=p(c,d,f,s),m=p(n,u,c,d),S=p(f,s,n,u),M=v+m+S;return l.x=(n*v+f*m+c*S)/M,l.y=(u*v+s*m+d*S)/M,l};a.exports=h},13584:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t.x1+=r,t.y1+=p,t.x2+=r,t.y2+=p,t.x3+=r,t.y3+=p,t};a.exports=y},1376:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35001),p=function(h){var o=h.getLineA(),l=h.getLineB(),n=h.getLineC();return r(o)+r(l)+r(n)};a.exports=p},90260:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2141),p=function(h,o){o===void 0&&(o=new r);var l=h.x2-h.x1,n=h.y2-h.y1,u=h.x3-h.x1,f=h.y3-h.y1,s=Math.random(),c=Math.random();return s+c>=1&&(s=1-s,c=1-c),o.x=h.x1+(l*s+u*c),o.y=h.y1+(n*s+f*c),o};a.exports=p},52172:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(99614),p=t(39757),h=function(o,l){var n=p(o);return r(o,n.x,n.y,l)};a.exports=h},49907:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(99614),p=function(h,o,l){return r(h,o.x,o.y,l)};a.exports=p},99614:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=Math.cos(h),l=Math.sin(h),n=t.x1-r,u=t.y1-p;return t.x1=n*o-u*l+r,t.y1=n*l+u*o+p,n=t.x2-r,u=t.y2-p,t.x2=n*o-u*l+r,t.y2=n*l+u*o+p,n=t.x3-r,u=t.y3-p,t.x3=n*o-u*l+r,t.y3=n*l+u*o+p,t};a.exports=y},16483:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(10690),h=t(20437),o=t(80672),l=t(23777),n=t(23031),u=t(90260),f=new r({initialize:function(c,d,v,m,S,M){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),M===void 0&&(M=0),this.type=l.TRIANGLE,this.x1=c,this.y1=d,this.x2=v,this.y2=m,this.x3=S,this.y3=M},contains:function(s,c){return p(this,s,c)},getPoint:function(s,c){return h(this,s,c)},getPoints:function(s,c,d){return o(this,s,c,d)},getRandomPoint:function(s){return u(this,s)},setTo:function(s,c,d,v,m,S){return s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=0),S===void 0&&(S=0),this.x1=s,this.y1=c,this.x2=d,this.y2=v,this.x3=m,this.y3=S,this},getLineA:function(s){return s===void 0&&(s=new n),s.setTo(this.x1,this.y1,this.x2,this.y2),s},getLineB:function(s){return s===void 0&&(s=new n),s.setTo(this.x2,this.y2,this.x3,this.y3),s},getLineC:function(s){return s===void 0&&(s=new n),s.setTo(this.x3,this.y3,this.x1,this.y1),s},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(s){var c=0;this.x1<=this.x2&&this.x1<=this.x3?c=this.x1-s:this.x2<=this.x1&&this.x2<=this.x3?c=this.x2-s:c=this.x3-s,this.x1-=c,this.x2-=c,this.x3-=c}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(s){var c=0;this.x1>=this.x2&&this.x1>=this.x3?c=this.x1-s:this.x2>=this.x1&&this.x2>=this.x3?c=this.x2-s:c=this.x3-s,this.x1-=c,this.x2-=c,this.x3-=c}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(s){var c=0;this.y1<=this.y2&&this.y1<=this.y3?c=this.y1-s:this.y2<=this.y1&&this.y2<=this.y3?c=this.y2-s:c=this.y3-s,this.y1-=c,this.y2-=c,this.y3-=c}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(s){var c=0;this.y1>=this.y2&&this.y1>=this.y3?c=this.y1-s:this.y2>=this.y1&&this.y2>=this.y3?c=this.y2-s:c=this.y3-s,this.y1-=c,this.y2-=c,this.y3-=c}}});a.exports=f},84435:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(16483);r.Area=t(41658),r.BuildEquilateral=t(39208),r.BuildFromPolygon=t(39545),r.BuildRight=t(90301),r.CenterOn=t(23707),r.Centroid=t(97523),r.CircumCenter=t(24951),r.CircumCircle=t(85614),r.Clone=t(74422),r.Contains=t(10690),r.ContainsArray=t(48653),r.ContainsPoint=t(96006),r.CopyFrom=t(71326),r.Decompose=t(71694),r.Equals=t(33522),r.GetPoint=t(20437),r.GetPoints=t(80672),r.InCenter=t(39757),r.Perimeter=t(1376),r.Offset=t(13584),r.Random=t(90260),r.Rotate=t(52172),r.RotateAroundPoint=t(49907),r.RotateAroundXY=t(99614),a.exports=r},74457:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return{gameObject:t,enabled:!0,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:r,hitAreaCallback:p,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}};a.exports=y},84409:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return function(p,h,o,l){var n=t.getPixelAlpha(h,o,l.texture.key,l.frame.name);return n&&n>=r}};a.exports=y},7003:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(93301),h=t(50792),o=t(8214),l=t(8443),n=t(78970),u=t(85098),f=t(42515),s=t(36210),c=t(61340),d=t(85955),v=new r({initialize:function(S,M){this.game=S,this.scaleManager,this.canvas,this.config=M,this.enabled=!0,this.events=new h,this.isOver=!0,this.defaultCursor="",this.keyboard=M.inputKeyboard?new n(this):null,this.mouse=M.inputMouse?new u(this):null,this.touch=M.inputTouch?new s(this):null,this.pointers=[],this.pointersTotal=M.inputActivePointers,M.inputTouch&&this.pointersTotal===1&&(this.pointersTotal=2);for(var A=0;A<=this.pointersTotal;A++){var C=new f(this,A);C.smoothFactor=M.inputSmoothFactor,this.pointers.push(C)}this.mousePointer=M.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 c,this._tempMatrix2=new c,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],S.events.once(l.BOOT,this.boot,this)},boot:function(){var m=this.game,S=m.events;this.canvas=m.canvas,this.scaleManager=m.scale,this.events.emit(o.MANAGER_BOOT),S.on(l.PRE_RENDER,this.preRender,this),S.once(l.DESTROY,this.destroy,this)},setCanvasOver:function(m){this.isOver=!0,this.events.emit(o.GAME_OVER,m)},setCanvasOut:function(m){this.isOver=!1,this.events.emit(o.GAME_OUT,m)},preRender:function(){var m=this.game.loop.now,S=this.game.loop.delta,M=this.game.scene.getScenes(!0,!0);this.time=m,this.events.emit(o.MANAGER_UPDATE);for(var A=0;A10&&(m=10-this.pointersTotal);for(var M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(96503),p=t(87902),h=t(83419),o=t(93301),l=t(74457),n=t(84409),u=t(20339),f=t(8497),s=t(81154),c=t(8214),d=t(50792),v=t(95540),m=t(23777),S=t(89639),M=t(41212),A=t(37277),C=t(87841),w=t(37303),P=t(44594),L=t(16483),O=t(10690),I=new h({Extends:d,initialize:function(B){d.call(this),this.scene=B,this.systems=B.sys,this.settings=B.sys.settings,this.manager=B.sys.game.input,this.pluginEvents=new d,this.enabled=!0,this.displayList,this.cameras,S.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var G={cancelled:!1};this._eventContainer={stopPropagation:function(){G.cancelled=!0}},this._eventData=G,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(c.BOOT)},start:function(){var D=this.systems.events;D.on(P.TRANSITION_START,this.transitionIn,this),D.on(P.TRANSITION_OUT,this.transitionOut,this),D.on(P.TRANSITION_COMPLETE,this.transitionComplete,this),D.on(P.PRE_UPDATE,this.preUpdate,this),D.once(P.SHUTDOWN,this.shutdown,this),this.manager.events.on(c.GAME_OUT,this.onGameOut,this),this.manager.events.on(c.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(c.START)},onGameOver:function(D){this.isActive()&&this.emit(c.GAME_OVER,D.timeStamp,D)},onGameOut:function(D){this.isActive()&&this.emit(c.GAME_OUT,D.timeStamp,D)},preUpdate:function(){this.pluginEvents.emit(c.PRE_UPDATE);var D=this._pendingRemoval,B=this._pendingInsertion,G=D.length,z=B.length;if(!(G===0&&z===0)){for(var W=this._list,k=0;k-1&&(W.splice(Q,1),this.clear(J,!0))}this._pendingRemoval.length=0,this._list=W.concat(B.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.canInput()},updatePoll:function(D,B){if(!this.isActive())return!1;if(this.pluginEvents.emit(c.UPDATE,D,B),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var G,z=this.manager,W=z.pointers,k=z.pointersTotal;for(G=0;G0)if(this._pollTimer-=B,this._pollTimer<0)this._pollTimer=this.pollRate;else return!1;var Q=!1;for(G=0;G0&&(Q=!0)}return Q},update:function(D,B){if(!this.isActive())return!1;for(var G=B.length,z=!1,W=0;W0&&(z=!0)}return this._updatedThisFrame=!0,z},clear:function(D,B){B===void 0&&(B=!1),this.disable(D);var G=D.input;G&&(this.removeDebug(D),this.manager.resetCursor(G),G.gameObject=void 0,G.target=void 0,G.hitArea=void 0,G.hitAreaCallback=void 0,G.callbackContext=void 0,D.input=null),B||this.queueForRemoval(D);var z=this._draggable.indexOf(D);return z>-1&&this._draggable.splice(z,1),D},disable:function(D){var B=D.input;B&&(B.enabled=!1,B.dragState=0);for(var G=this._drag,z=this._over,W=this.manager,k=0,J;k-1&&G[k].splice(J,1),J=z[k].indexOf(D),J>-1&&z[k].splice(J,1);return this},enable:function(D,B,G,z){return z===void 0&&(z=!1),D.input?D.input.enabled=!0:this.setHitArea(D,B,G),D.input&&z&&!D.input.dropZone&&(D.input.dropZone=z),this},hitTestPointer:function(D){for(var B=this.cameras.getCamerasBelowPointer(D),G=0;G0)return D.camera=z,W}return D.camera=B[0],[]},processDownEvents:function(D){var B=0,G=this._temp,z=this._eventData,W=this._eventContainer;z.cancelled=!1;for(var k=!1,J=0;J0&&u(D.x,D.y,D.downX,D.downY)>=W||z>0&&B>=D.downTime+z)&&(G=!0),G)return this.setDragState(D,3),this.processDragStartList(D)},processDragStartList:function(D){if(this.getDragState(D)!==3)return 0;for(var B=this._drag[D.id],G=0;G1&&(this.sortGameObjects(G,D),this.topOnly&&G.splice(1)),this._drag[D.id]=G,this.dragDistanceThreshold===0&&this.dragTimeThreshold===0?(this.setDragState(D,3),this.processDragStartList(D)):(this.setDragState(D,2),0))},processDragMoveEvent:function(D){if(this.getDragState(D)===2&&this.processDragThresholdEvent(D,this.manager.game.loop.now),this.getDragState(D)!==4)return 0;for(var B=this._tempZones,G=this._drag[D.id],z=0;z0?(W.emit(c.GAMEOBJECT_DRAG_LEAVE,D,J),this.emit(c.DRAG_LEAVE,D,W,J),k.target=B[0],J=k.target,W.emit(c.GAMEOBJECT_DRAG_ENTER,D,J),this.emit(c.DRAG_ENTER,D,W,J)):(W.emit(c.GAMEOBJECT_DRAG_LEAVE,D,J),this.emit(c.DRAG_LEAVE,D,W,J),B[0]?(k.target=B[0],J=k.target,W.emit(c.GAMEOBJECT_DRAG_ENTER,D,J),this.emit(c.DRAG_ENTER,D,W,J)):k.target=null)}else!J&&B[0]&&(k.target=B[0],J=k.target,W.emit(c.GAMEOBJECT_DRAG_ENTER,D,J),this.emit(c.DRAG_ENTER,D,W,J));var Y,K;if(!W.parentContainer)Y=D.worldX-k.dragX,K=D.worldY-k.dragY;else{var U=D.worldX-k.dragStartXGlobal,V=D.worldY-k.dragStartYGlobal,j=W.getParentRotation(),$=U*Math.cos(j)+V*Math.sin(j),q=V*Math.cos(j)-U*Math.sin(j);$*=1/W.parentContainer.scaleX,q*=1/W.parentContainer.scaleY,Y=$+k.dragStartX,K=q+k.dragStartY}W.emit(c.GAMEOBJECT_DRAG,D,Y,K),this.emit(c.DRAG,D,W,Y,K)}return G.length},processDragUpEvent:function(D){for(var B=this._drag[D.id],G=0;G0){var k=this.manager,J=this._eventData,Q=this._eventContainer;J.cancelled=!1;for(var Y=!1,K=0;K0){var W=this.manager,k=this._eventData,J=this._eventContainer;k.cancelled=!1;var Q=!1;this.sortGameObjects(B,D);for(var Y=0;Y0){for(this.sortGameObjects(W,D),G=0;G0){for(this.sortGameObjects(k,D),G=0;G-1&&this._draggable.splice(W,1)}return this},makePixelPerfect:function(D){D===void 0&&(D=1);var B=this.systems.textures;return n(B,D)},setHitArea:function(D,B,G){if(B===void 0)return this.setHitAreaFromTexture(D);Array.isArray(D)||(D=[D]);var z=!1,W=!1,k=!1,J=!1,Q=!1,Y=!0;if(M(B)&&Object.keys(B).length){var K=B,U=D.some(function(it){return it.hasOwnProperty("faces")});if(!U){B=v(K,"hitArea",null),G=v(K,"hitAreaCallback",null),Q=v(K,"pixelPerfect",!1);var V=v(K,"alphaTolerance",1);Q&&(B={},G=this.makePixelPerfect(V))}z=v(K,"draggable",!1),W=v(K,"dropZone",!1),k=v(K,"cursor",!1),J=v(K,"useHandCursor",!1),(!B||!G)&&(this.setHitAreaFromTexture(D),Y=!1)}else typeof B=="function"&&!G&&(G=B,B={});for(var j=0;j{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35154),p={},h={};h.register=function(o,l,n,u,f){p[o]={plugin:l,mapping:n,settingsKey:u,configKey:f}},h.getPlugin=function(o){return p[o]},h.install=function(o){var l=o.scene.sys,n=l.settings.input,u=l.game.config;for(var f in p){var s=p[f].plugin,c=p[f].mapping,d=p[f].settingsKey,v=p[f].configKey;r(n,d,u[v])&&(o[c]=new s(o))}},h.remove=function(o){p.hasOwnProperty(o)&&delete p[o]},a.exports=h},42515:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(31040),p=t(83419),h=t(20339),o=t(43855),l=t(47235),n=t(26099),u=t(25892),f=new p({initialize:function(c,d){this.manager=c,this.id=d,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new n,this.prevPosition=new n,this.midPoint=new n(-1,-1),this.velocity=new n,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=d===0,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(s){var c=s.getWorldPoint(this.x,this.y);return this.worldX=c.x,this.worldY=c.y,this},positionToCamera:function(s,c){return s.getWorldPoint(this.x,this.y,c)},updateMotion:function(){var s=this.position.x,c=this.position.y,d=this.midPoint.x,v=this.midPoint.y;if(!(s===d&&c===v)){var m=l(this.motionFactor,d,s),S=l(this.motionFactor,v,c);o(m,s,.1)&&(m=s),o(S,c,.1)&&(S=c),this.midPoint.set(m,S);var M=s-m,A=c-S;this.velocity.set(M,A),this.angle=r(m,S,s,c),this.distance=Math.sqrt(M*M+A*A)}},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),u.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,c){s.pointerId&&(this.pointerId=s.pointerId),this.identifier=s.identifier,this.target=s.target,this.active=!0,this.buttons=1,this.event=c,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=c.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(s,c){this.event=c,this.manager.transformPointer(this,s.pageX,s.pageY,!0),this.moveTime=c.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(s,c){this.buttons=0,this.event=c,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=c.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(s,c){this.buttons=0,this.event=c,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=c.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?h(this.downX,this.downY,this.x,this.y):h(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?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(s,c){s===void 0&&(s=10),c===void 0&&(c=[]);for(var d=this.prevPosition.x,v=this.prevPosition.y,m=this.position.x,S=this.position.y,M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8};a.exports=y},7179:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="boot"},85375:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},39843:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragend"},23388:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragenter"},16133:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="drag"},27829:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragleave"},53904:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragover"},56058:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragstart"},2642:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="drop"},88171:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectdown"},36147:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragend"},71692:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragenter"},96149:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="drag"},81285:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragleave"},74048:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragover"},21322:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragstart"},49378:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="drop"},86754:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectmove"},86433:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectout"},60709:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectover"},24081:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerdown"},11172:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointermove"},18907:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerout"},95579:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerover"},35368:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerup"},26972:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="wheel"},47078:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectup"},73802:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameobjectwheel"},56718:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameout"},25936:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="gameover"},27503:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="boot"},50852:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="process"},96438:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="update"},59152:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerlockchange"},47777:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerdown"},27957:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerdownoutside"},19444:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointermove"},54251:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerout"},18667:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerover"},27192:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerup"},24652:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pointerupoutside"},45132:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="wheel"},44512:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="preupdate"},15757:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="shutdown"},41637:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="start"},93802:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="update"},8214:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BOOT:t(7179),DESTROY:t(85375),DRAG_END:t(39843),DRAG_ENTER:t(23388),DRAG:t(16133),DRAG_LEAVE:t(27829),DRAG_OVER:t(53904),DRAG_START:t(56058),DROP:t(2642),GAME_OUT:t(56718),GAME_OVER:t(25936),GAMEOBJECT_DOWN:t(88171),GAMEOBJECT_DRAG_END:t(36147),GAMEOBJECT_DRAG_ENTER:t(71692),GAMEOBJECT_DRAG:t(96149),GAMEOBJECT_DRAG_LEAVE:t(81285),GAMEOBJECT_DRAG_OVER:t(74048),GAMEOBJECT_DRAG_START:t(21322),GAMEOBJECT_DROP:t(49378),GAMEOBJECT_MOVE:t(86754),GAMEOBJECT_OUT:t(86433),GAMEOBJECT_OVER:t(60709),GAMEOBJECT_POINTER_DOWN:t(24081),GAMEOBJECT_POINTER_MOVE:t(11172),GAMEOBJECT_POINTER_OUT:t(18907),GAMEOBJECT_POINTER_OVER:t(95579),GAMEOBJECT_POINTER_UP:t(35368),GAMEOBJECT_POINTER_WHEEL:t(26972),GAMEOBJECT_UP:t(47078),GAMEOBJECT_WHEEL:t(73802),MANAGER_BOOT:t(27503),MANAGER_PROCESS:t(50852),MANAGER_UPDATE:t(96438),POINTER_DOWN:t(47777),POINTER_DOWN_OUTSIDE:t(27957),POINTER_MOVE:t(19444),POINTER_OUT:t(54251),POINTER_OVER:t(18667),POINTER_UP:t(27192),POINTER_UP_OUTSIDE:t(24652),POINTER_WHEEL:t(45132),POINTERLOCK_CHANGE:t(59152),PRE_UPDATE:t(44512),SHUTDOWN:t(15757),START:t(41637),UPDATE:t(93802)}},97421:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l){this.pad=o,this.events=o.events,this.index=l,this.value=0,this.threshold=.1},update:function(h){this.value=h},getValue:function(){return Math.abs(this.value){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(92734),h=new r({initialize:function(l,n){this.pad=l,this.events=l.manager,this.index=n,this.value=0,this.threshold=1,this.pressed=!1},update:function(o){this.value=o;var l=this.pad,n=this.index;o>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(p.BUTTON_DOWN,l,this,o),this.pad.emit(p.GAMEPAD_BUTTON_DOWN,n,o,this)):this.pressed&&(this.pressed=!1,this.events.emit(p.BUTTON_UP,l,this,o),this.pad.emit(p.GAMEPAD_BUTTON_UP,n,o,this))},destroy:function(){this.pad=null,this.events=null}});a.exports=h},99125:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(97421),p=t(28884),h=t(83419),o=t(50792),l=t(26099),n=new h({Extends:o,initialize:function(f,s){o.call(this),this.manager=f,this.pad=s,this.id=s.id,this.index=s.index;for(var c=[],d=0;d=2&&(this.leftStick.set(v[0].getValue(),v[1].getValue()),d>=4&&this.rightStick.set(v[2].getValue(),v[3].getValue()))}},destroy:function(){this.removeAllListeners(),this.manager=null,this.pad=null;var u;for(u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(92734),o=t(99125),l=t(35154),n=t(89639),u=t(8214),f=new r({Extends:p,initialize:function(c){p.call(this),this.scene=c.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=c,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,c.pluginEvents.once(u.BOOT,this.boot,this),c.pluginEvents.on(u.START,this.start,this)},boot:function(){var s=this.scene.sys.game,c=this.settings.input,d=s.config;this.enabled=l(c,"gamepad",d.inputGamepad)&&s.device.input.gamepads,this.target=l(c,"gamepad.target",d.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(u.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(u.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var s=this,c=this.target,d=function(v){v.defaultPrevented||!s.isActive()||(s.refreshPads(),s.queue.push(v))};this.onGamepadHandler=d,c.addEventListener("gamepadconnected",d,!1),c.addEventListener("gamepaddisconnected",d,!1),this.sceneInputPlugin.pluginEvents.on(u.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(u.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} - */a.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},65294:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},90089:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},64894:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={DUALSHOCK_4:t(65294),SNES_USB:t(89651),XBOX_360:t(90089)}},46008:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="down"},7629:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="up"},42206:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="connected"},86544:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="disconnected"},94784:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="down"},14325:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="up"},92734:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BUTTON_DOWN:t(46008),BUTTON_UP:t(7629),CONNECTED:t(42206),DISCONNECTED:t(86544),GAMEPAD_BUTTON_DOWN:t(94784),GAMEPAD_BUTTON_UP:t(14325)}},48646:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Axis:t(97421),Button:t(28884),Events:t(92734),Gamepad:t(99125),GamepadPlugin:t(56654),Configs:t(64894)}},14350:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(93301),p=t(79291),h={CreatePixelPerfectHandler:t(84409),CreateInteractiveObject:t(74457),Events:t(8214),Gamepad:t(48646),InputManager:t(7003),InputPlugin:t(48205),InputPluginCache:t(89639),Keyboard:t(51442),Mouse:t(87078),Pointer:t(42515),Touch:t(95618)};h=p(!1,h,r),a.exports=h},78970:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(72905),p=t(83419),h=t(8443),o=t(8214),l=t(46032),n=t(29747),u=new p({initialize:function(s){this.manager=s,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=n,this.onKeyUp=n,s.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var f=this.manager.config;this.enabled=f.inputKeyboard,this.target=f.inputKeyboardEventTarget,this.addCapture(f.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(h.POST_STEP,this.postUpdate,this)},startListeners:function(){var f=this;this.onKeyDown=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(o.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}},this.onKeyUp=function(c){if(!(c.defaultPrevented||!f.enabled||!f.manager)){f.queue.push(c),f.manager.events.emit(o.MANAGER_PROCESS);var d=c.altKey||c.ctrlKey||c.shiftKey||c.metaKey;f.preventDefault&&!d&&f.captures.indexOf(c.keyCode)>-1&&c.preventDefault()}};var s=this.target;s&&(s.addEventListener("keydown",this.onKeyDown,!1),s.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var f=this.target;f.removeEventListener("keydown",this.onKeyDown,!1),f.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var s=this.captures,c=0;c0},removeCapture:function(f){typeof f=="string"&&(f=f.split(",")),Array.isArray(f)||(f=[f]);for(var s=this.captures,c=0;c0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(h.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});a.exports=u},28846:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(95922),o=t(8443),l=t(35154),n=t(8214),u=t(89639),f=t(30472),s=t(46032),c=t(87960),d=t(74600),v=t(44594),m=t(56583),S=new r({Extends:p,initialize:function(A){p.call(this),this.game=A.systems.game,this.scene=A.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=A,this.manager=A.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,A.pluginEvents.once(n.BOOT,this.boot,this),A.pluginEvents.on(n.START,this.start,this)},boot:function(){var M=this.settings.input;this.enabled=l(M,"keyboard",!0);var A=l(M,"keyboard.capture",null);A&&this.addCaptures(A),this.sceneInputPlugin.pluginEvents.once(n.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(n.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(n.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(v.PAUSE,this.resetKeys,this),this.scene.sys.events.on(v.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.canInput()},addCapture:function(M){return this.manager.addCapture(M),this},removeCapture:function(M){return this.manager.removeCapture(M),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(M,A,C){A===void 0&&(A=!0),C===void 0&&(C=!1);var w={};if(typeof M=="string"){M=M.split(",");for(var P=0;P-1?w[P]=M:w[M.keyCode]=M,A&&this.addCapture(M.keyCode),M.setEmitOnRepeat(C),M}return typeof M=="string"&&(M=s[M.toUpperCase()]),w[M]||(w[M]=new f(this,M),A&&this.addCapture(M),w[M].setEmitOnRepeat(C)),w[M]},removeKey:function(M,A,C){A===void 0&&(A=!1),C===void 0&&(C=!1);var w=this.keys,P;if(M instanceof f){var L=w.indexOf(M);L>-1&&(P=this.keys[L],this.keys[L]=void 0)}else typeof M=="string"&&(M=s[M.toUpperCase()]);return w[M]&&(P=w[M],w[M]=void 0),P&&(P.plugin=null,C&&this.removeCapture(P.keyCode),A&&P.destroy()),this},removeAllKeys:function(M,A){M===void 0&&(M=!1),A===void 0&&(A=!1);for(var C=this.keys,w=0;wM._tick)return M._tick=C,!0}return!1},update:function(){var M=this.manager.queue,A=M.length;if(!(!this.isActive()||A===0))for(var C=this.keys,w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r.timeLastMatched=t.timeStamp,r.index++,r.index===r.size?!0:(r.current=r.keyCodes[r.index],!1)};a.exports=y},87960:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95922),h=t(95540),o=t(68769),l=t(92803),n=new r({initialize:function(f,s,c){if(c===void 0&&(c={}),s.length<2)return!1;this.manager=f,this.enabled=!0,this.keyCodes=[];for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66970),p=function(h,o){if(o.matched)return!0;var l=!1,n=!1;if(h.keyCode===o.current)if(o.index>0&&o.maxKeyDelay>0){var u=o.timeLastMatched+o.maxKeyDelay;h.timeStamp<=u&&(n=!0,l=r(h,o))}else n=!0,l=r(h,o);return!n&&o.resetOnWrongKey&&(o.index=0,o.current=o.keyCodes[0]),l&&(o.timeLastMatched=h.timeStamp,o.matched=!0,o.timeMatched=h.timeStamp),l};a.exports=p},92803:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t};a.exports=y},92612:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="keydown"},23345:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="keyup"},21957:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="keycombomatch"},44743:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="down"},3771:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="keydown-"},46358:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="keyup-"},75674:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="up"},95922:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ANY_KEY_DOWN:t(92612),ANY_KEY_UP:t(23345),COMBO_MATCH:t(21957),DOWN:t(44743),KEY_DOWN:t(3771),KEY_UP:t(46358),UP:t(75674)}},51442:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Events:t(95922),KeyboardManager:t(78970),KeyboardPlugin:t(28846),Key:t(30472),KeyCodes:t(46032),KeyCombo:t(87960),AdvanceKeyCombo:t(66970),ProcessKeyCombo:t(68769),ResetKeyCombo:t(92803),JustDown:t(90229),JustUp:t(38796),DownDuration:t(37015),UpDuration:t(41170)}},37015:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=50);var p=t.plugin.game.loop.time-t.timeDown;return t.isDown&&p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t._justDown?(t._justDown=!1,!0):!1};a.exports=y},38796:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t._justUp?(t._justUp=!1,!0):!1};a.exports=y},30472:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(95922),o=new r({Extends:p,initialize:function(n,u){p.call(this),this.plugin=n,this.keyCode=u,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(l){return this.emitOnRepeat=l,this},onDown:function(l){this.originalEvent=l,this.enabled&&(this.altKey=l.altKey,this.ctrlKey=l.ctrlKey,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.location=l.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(h.DOWN,this,l):(this.isDown=!0,this.isUp=!1,this.timeDown=l.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(h.DOWN,this,l)))},onUp:function(l){this.originalEvent=l,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=l.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(h.UP,this,l))},reset:function(){return this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});a.exports=o},46032:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175};a.exports=y},74600:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(46032),p={};for(var h in r)p[r[h]]=h;a.exports=p},41170:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=50);var p=t.plugin.game.loop.time-t.timeUp;return t.isUp&&p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(89357),h=t(8214),o=t(29747),l=new r({initialize:function(u){this.manager=u,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,u.events.once(h.MANAGER_BOOT,this.boot,this)},boot:function(){var n=this.manager.config;this.enabled=n.inputMouse,this.target=n.inputMouseEventTarget,this.passive=n.inputMousePassive,this.preventDefaultDown=n.inputMousePreventDefaultDown,this.preventDefaultUp=n.inputMousePreventDefaultUp,this.preventDefaultMove=n.inputMousePreventDefaultMove,this.preventDefaultWheel=n.inputMousePreventDefaultWheel,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,n.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(n){return n.preventDefault(),!1}),this},requestPointerLock:function(){if(p.pointerLock){var n=this.target;n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock,n.requestPointerLock()}},releasePointerLock:function(){p.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var n=this.target;if(n){var u=this,f=this.manager,s=f.canvas,c=window&&window.focus&&f.game.config.autoFocus;this.onMouseMove=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseMove(v),u.preventDefaultMove&&v.preventDefault())},this.onMouseDown=function(v){c&&window.focus(),!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseDown(v),u.preventDefaultDown&&v.target===s&&v.preventDefault())},this.onMouseDownWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==s&&f.onMouseDown(v)},this.onMouseUp=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&(f.onMouseUp(v),u.preventDefaultUp&&v.target===s&&v.preventDefault())},this.onMouseUpWindow=function(v){v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents||!v.defaultPrevented&&u.enabled&&f&&f.enabled&&v.target!==s&&f.onMouseUp(v)},this.onMouseOver=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOver(v)},this.onMouseOut=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.setCanvasOut(v)},this.onMouseWheel=function(v){!v.defaultPrevented&&u.enabled&&f&&f.enabled&&f.onMouseWheel(v),u.preventDefaultWheel&&v.target===s&&v.preventDefault()};var d={passive:!0};if(n.addEventListener("mousemove",this.onMouseMove),n.addEventListener("mousedown",this.onMouseDown),n.addEventListener("mouseup",this.onMouseUp),n.addEventListener("mouseover",this.onMouseOver,d),n.addEventListener("mouseout",this.onMouseOut,d),this.preventDefaultWheel?n.addEventListener("wheel",this.onMouseWheel,{passive:!1}):n.addEventListener("wheel",this.onMouseWheel,d),window&&f.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,d),window.top.addEventListener("mouseup",this.onMouseUpWindow,d)}catch{window.addEventListener("mousedown",this.onMouseDownWindow,d),window.addEventListener("mouseup",this.onMouseUpWindow,d),this.isTop=!1}p.pointerLock&&(this.pointerLockChange=function(v){var m=u.target;u.locked=document.pointerLockElement===m||document.mozPointerLockElement===m||document.webkitPointerLockElement===m,f.onPointerLockChange(v)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var n=this.target;n.removeEventListener("mousemove",this.onMouseMove),n.removeEventListener("mousedown",this.onMouseDown),n.removeEventListener("mouseup",this.onMouseUp),n.removeEventListener("mouseover",this.onMouseOver),n.removeEventListener("mouseout",this.onMouseOut),window&&(n=this.isTop?window.top:window,n.removeEventListener("mousedown",this.onMouseDownWindow),n.removeEventListener("mouseup",this.onMouseUpWindow)),p.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});a.exports=l},87078:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={MouseManager:t(85098)}},36210:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(8214),h=t(29747),o=new r({initialize:function(n){this.manager=n,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=h,this.onTouchStartWindow=h,this.onTouchMove=h,this.onTouchEnd=h,this.onTouchEndWindow=h,this.onTouchCancel=h,this.onTouchCancelWindow=h,this.isTop=!0,n.events.once(p.MANAGER_BOOT,this.boot,this)},boot:function(){var l=this.manager.config;this.enabled=l.inputTouch,this.target=l.inputTouchEventTarget,this.capture=l.inputTouchCapture,this.target?typeof this.target=="string"&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,l.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return this.target.addEventListener("contextmenu",function(l){return l.preventDefault(),!1}),this},startListeners:function(){var l=this.target;if(l){var n=this,u=this.manager,f=u.canvas,s=window&&window.focus&&u.game.config.autoFocus;this.onTouchMove=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchMove(m),n.capture&&m.cancelable&&m.preventDefault())},this.onTouchStart=function(m){s&&window.focus(),!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchStart(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchStartWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchStart(m)},this.onTouchEnd=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchEnd(m),n.capture&&m.cancelable&&m.target===f&&m.preventDefault())},this.onTouchEndWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&m.target!==f&&u.onTouchEnd(m)},this.onTouchCancel=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&(u.onTouchCancel(m),n.capture&&m.preventDefault())},this.onTouchCancelWindow=function(m){!m.defaultPrevented&&n.enabled&&u&&u.enabled&&u.onTouchCancel(m)};var c=this.capture,d={passive:!0},v={passive:!1};if(l.addEventListener("touchstart",this.onTouchStart,c?v:d),l.addEventListener("touchmove",this.onTouchMove,c?v:d),l.addEventListener("touchend",this.onTouchEnd,c?v:d),l.addEventListener("touchcancel",this.onTouchCancel,c?v:d),window&&u.game.config.inputWindowEvents)try{window.top.addEventListener("touchstart",this.onTouchStartWindow,v),window.top.addEventListener("touchend",this.onTouchEndWindow,v),window.top.addEventListener("touchcancel",this.onTouchCancelWindow,v)}catch{window.addEventListener("touchstart",this.onTouchStartWindow,v),window.addEventListener("touchend",this.onTouchEndWindow,v),window.addEventListener("touchcancel",this.onTouchCancelWindow,v),this.isTop=!1}this.enabled=!0}},stopListeners:function(){var l=this.target;l.removeEventListener("touchstart",this.onTouchStart),l.removeEventListener("touchmove",this.onTouchMove),l.removeEventListener("touchend",this.onTouchEnd),l.removeEventListener("touchcancel",this.onTouchCancel),window&&(l=this.isTop?window.top:window,l.removeEventListener("touchstart",this.onTouchStartWindow),l.removeEventListener("touchend",this.onTouchEndWindow),l.removeEventListener("touchcancel",this.onTouchCancelWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});a.exports=o},95618:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={TouchManager:t(36210)}},41299:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(54899),o=t(95540),l=t(98356),n=t(3374),u=t(84376),f=t(92638),s=new r({initialize:function(d,v){if(this.loader=d,this.cache=o(v,"cache",!1),this.type=o(v,"type",!1),!this.type)throw new Error("Invalid File type: "+this.type);this.key=o(v,"key",!1);var m=this.key;if(d.prefix&&d.prefix!==""&&(this.key=d.prefix+m),!this.key)throw new Error("Invalid File key: "+this.key);var S=o(v,"url");S===void 0?S=d.path+m+"."+o(v,"extension",""):typeof S=="string"&&!S.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)&&(S=d.path+S),this.url=S,this.src="",this.xhrSettings=f(o(v,"responseType",void 0)),o(v,"xhrSettings",!1)&&(this.xhrSettings=n(this.xhrSettings,o(v,"xhrSettings",{}))),this.xhrLoader=null,this.state=typeof this.url=="function"?p.FILE_POPULATED:p.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(v,"config",{}),this.multiFile,this.linkFile,this.base64=typeof S=="string"&&S.indexOf("data:")===0},setLink:function(c){this.linkFile=c,c.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===p.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=p.FILE_LOADING,this.src=l(this,this.loader.baseURL),this.src.indexOf("data:")===0&&(this.base64=!0),this.xhrLoader=u(this,this.loader.xhr))},onLoad:function(c,d){var v=c.responseURL&&this.loader.localSchemes.some(function(M){return c.responseURL.indexOf(M)===0}),m=v&&d.target.status===0,S=!(d.target&&d.target.status!==200)||m;c.readyState===4&&c.status>=400&&c.status<=599&&(S=!1),this.state=p.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,S)},onBase64Load:function(c){this.xhrLoader=c,this.state=p.FILE_LOADED,this.percentComplete=1,this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete),this.loader.nextFile(this,!0)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(c){c.lengthComputable&&(this.bytesLoaded=c.loaded,this.bytesTotal=c.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(h.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=p.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=p.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){console.error('Failed to process file: %s "%s"',this.type,this.key),this.state=p.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.data&&this.cache.add(this.key,this.data)},pendingDestroy:function(c){if(this.state!==p.FILE_PENDING_DESTROY){c===void 0&&(c=this.data);var d=this.key,v=this.type;this.loader.emit(h.FILE_COMPLETE,d,v,c),this.loader.emit(h.FILE_KEY_COMPLETE+v+"-"+d,d,v,c),this.loader.flagForRemoval(this),this.state=p.FILE_PENDING_DESTROY}},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});s.createObjectURL=function(c,d,v){if(typeof URL=="function")c.src=URL.createObjectURL(d);else{var m=new FileReader;m.onload=function(){c.removeAttribute("crossOrigin"),c.src="data:"+(d.type||v)+";base64,"+m.result.split(",")[1]},m.onerror=c.onerror,m.readAsDataURL(d)}},s.revokeObjectURL=function(c){typeof URL=="function"&&URL.revokeObjectURL(c.src)},a.exports=s},74099:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={},t={install:function(r){for(var p in y)r[p]=y[p]},register:function(r,p){y[r]=p},destroy:function(){y={}}};a.exports=t},98356:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.url?t.url.match(/^(?:blob:|data:|capacitor:\/\/|http:\/\/|https:\/\/|\/\/)/)?t.url:r+t.url:!1};a.exports=y},74261:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(35072),o=t(50792),l=t(54899),n=t(74099),u=t(95540),f=t(35154),s=t(37277),c=t(44594),d=t(92638),v=new r({Extends:o,initialize:function(S){o.call(this);var M=S.sys.game.config,A=S.sys.settings.loader;this.scene=S,this.systems=S.sys,this.cacheManager=S.sys.cache,this.textureManager=S.sys.textures,this.sceneManager=S.sys.game.scene,n.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(u(A,"baseURL",M.loaderBaseURL)),this.setPath(u(A,"path",M.loaderPath)),this.setPrefix(u(A,"prefix",M.loaderPrefix)),this.maxParallelDownloads=u(A,"maxParallelDownloads",M.loaderMaxParallelDownloads),this.xhr=d(u(A,"responseType",M.loaderResponseType),u(A,"async",M.loaderAsync),u(A,"user",M.loaderUser),u(A,"password",M.loaderPassword),u(A,"timeout",M.loaderTimeout),u(A,"withCredentials",M.loaderWithCredentials)),this.crossOrigin=u(A,"crossOrigin",M.loaderCrossOrigin),this.imageLoadType=u(A,"imageLoadType",M.loaderImageLoadType),this.localSchemes=u(A,"localScheme",M.loaderLocalScheme),this.totalToLoad=0,this.progress=0,this.list=new h,this.inflight=new h,this.queue=new h,this._deleteQueue=new h,this.totalFailed=0,this.totalComplete=0,this.state=p.LOADER_IDLE,this.multiKeyIndex=0,S.sys.events.once(c.BOOT,this.boot,this),S.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.SHUTDOWN,this.shutdown,this)},setBaseURL:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.baseURL=m,this},setPath:function(m){return m===void 0&&(m=""),m!==""&&m.substr(-1)!=="/"&&(m=m.concat("/")),this.path=m,this},setPrefix:function(m){return m===void 0&&(m=""),this.prefix=m,this},setCORS:function(m){return this.crossOrigin=m,this},addFile:function(m){Array.isArray(m)||(m=[m]);for(var S=0;S0},isLoading:function(){return this.state===p.LOADER_LOADING||this.state===p.LOADER_PROCESSING},isReady:function(){return this.state===p.LOADER_IDLE||this.state===p.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(l.START,this),this.list.size===0?this.loadComplete():(this.state=p.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(l.PROGRESS,this.progress)},update:function(){this.state===p.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} - */var r=t(79291),p=t(92638),h=function(o,l){var n=o===void 0?p():r({},o);if(l)for(var u in l)l[u]!==void 0&&(n[u]=l[u]);return n};a.exports=h},26430:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(54899),o=new r({initialize:function(n,u,f,s){var c=[];s.forEach(function(m){m&&c.push(m)}),this.loader=n,this.type=u,this.key=f;var d=this.key;n.prefix&&n.prefix!==""&&(this.key=n.prefix+d),this.multiKeyIndex=n.multiKeyIndex++,this.files=c,this.state=p.FILE_PENDING,this.complete=!1,this.pending=c.length,this.failed=0,this.config={},this.baseURL=n.baseURL,this.path=n.path,this.prefix=n.prefix;for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(3374),p=function(h,o){var l=r(o,h.xhrSettings);if(h.base64){var n=h.url.split(";base64,").pop()||h.url.split(",").pop(),u={responseText:atob(n)};h.onBase64Load(u);return}var f=new XMLHttpRequest;if(f.open("GET",h.src,l.async,l.user,l.password),f.responseType=h.xhrSettings.responseType,f.timeout=l.timeout,l.headers)for(var s in l.headers)f.setRequestHeader(s,l.headers[s]);return l.header&&l.headerValue&&f.setRequestHeader(l.header,l.headerValue),l.requestedWith&&f.setRequestHeader("X-Requested-With",l.requestedWith),l.overrideMimeType&&f.overrideMimeType(l.overrideMimeType),l.withCredentials&&(f.withCredentials=!0),f.onload=h.onLoad.bind(h,f),f.onerror=h.onError.bind(h,f),f.onprogress=h.onProgress.bind(h),f.ontimeout=h.onError.bind(h,f),f.send(),f};a.exports=p},92638:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l){return t===void 0&&(t=""),r===void 0&&(r=!0),p===void 0&&(p=""),h===void 0&&(h=""),o===void 0&&(o=0),l===void 0&&(l=!1),{responseType:t,async:r,user:p,password:h,timeout:o,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:l}};a.exports=y},23906:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19,FILE_PENDING_DESTROY:20};a.exports=y},42155:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="addfile"},38991:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},27540:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="filecomplete"},87464:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="filecomplete-"},94486:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="loaderror"},13035:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="load"},38144:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="fileprogress"},97520:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="postprocess"},85595:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="progress"},55680:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="start"},54899:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADD:t(42155),COMPLETE:t(38991),FILE_COMPLETE:t(27540),FILE_KEY_COMPLETE:t(87464),FILE_LOAD_ERROR:t(94486),FILE_LOAD:t(13035),FILE_PROGRESS:t(38144),POST_PROCESS:t(97520),PROGRESS:t(85595),START:t(55680)}},14135:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(518),o=t(54899),l=new r({Extends:h,initialize:function(u,f,s,c,d){h.call(this,u,f,s,c,d),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),h.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});p.register("animation",function(n,u,f,s){if(Array.isArray(n))for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(518),u=t(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var A,C;if(l(d)){var w=d;d=h(w,"key"),A=new o(c,{key:d,url:h(w,"textureURL"),extension:h(w,"textureExtension","png"),normalMap:h(w,"normalMap"),xhrSettings:h(w,"textureXhrSettings")}),C=new n(c,{key:d,url:h(w,"atlasURL"),extension:h(w,"atlasExtension","json"),xhrSettings:h(w,"atlasXhrSettings")})}else A=new o(c,d,v,S),C=new n(c,d,m,M);A.linkFile?u.call(this,c,"atlasjson",d,[A,C,A.linkFile]):u.call(this,c,"atlasjson",d,[A,C])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,c.data,d),c.addToCache(),this.complete=!0}}});p.register("aseprite",function(s,c,d,v,m){var S;if(Array.isArray(s))for(var M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(518),u=t(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M){var A,C;if(l(d)){var w=d;d=h(w,"key"),A=new o(c,{key:d,url:h(w,"textureURL"),extension:h(w,"textureExtension","png"),normalMap:h(w,"normalMap"),xhrSettings:h(w,"textureXhrSettings")}),C=new n(c,{key:d,url:h(w,"atlasURL"),extension:h(w,"atlasExtension","json"),xhrSettings:h(w,"atlasXhrSettings")})}else A=new o(c,d,v,S),C=new n(c,d,m,M);A.linkFile?u.call(this,c,"atlasjson",d,[A,C,A.linkFile]):u.call(this,c,"atlasjson",d,[A,C])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(s.key,s.data,c.data,d),this.complete=!0}}});p.register("atlas",function(s,c,d,v,m){var S;if(Array.isArray(s))for(var M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(26430),u=t(57318),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var A,C;if(l(d)){var w=d;d=h(w,"key"),A=new o(c,{key:d,url:h(w,"textureURL"),extension:h(w,"textureExtension","png"),normalMap:h(w,"normalMap"),xhrSettings:h(w,"textureXhrSettings")}),C=new u(c,{key:d,url:h(w,"atlasURL"),extension:h(w,"atlasExtension","xml"),xhrSettings:h(w,"atlasXhrSettings")})}else A=new o(c,d,v,S),C=new u(c,d,m,M);A.linkFile?n.call(this,c,"atlasxml",d,[A,C,A.linkFile]):n.call(this,c,"atlasxml",d,[A,C])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(s.key,s.data,c.data,d),this.complete=!0}}});p.register("atlasXML",function(s,c,d,v,m){var S;if(Array.isArray(s))for(var M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(89749),u=t(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){if(u(d)){var M=d;d=l(M,"key"),m=l(M,"xhrSettings"),S=l(M,"context",S)}var A={type:"audio",cache:c.cacheManager.audio,extension:v.type,responseType:"arraybuffer",key:d,url:v.url,xhrSettings:m,config:{context:S}};h.call(this,c,A)},onProcess:function(){this.state=p.FILE_PROCESSING;var s=this;this.config.context.decodeAudioData(this.xhrLoader.response,function(c){s.data=c,s.onProcessComplete()},function(c){console.error("Error decoding audio: "+s.key+" - ",c?c.message:null),s.onProcessError()}),this.config.context=null}});f.create=function(s,c,d,v,m){var S=s.systems.game,M=S.config.audio,A=S.device.audio;u(c)&&(d=l(c,"url",[]),v=l(c,"config",{}));var C=f.getAudioURL(S,d);return C?A.webAudio&&!M.disableWebAudio?new f(s,c,C,m,S.sound.context):new n(s,c,C,v):(console.warn('No audio URLs for "%s" matched this device',c),null)},f.getAudioURL=function(s,c){Array.isArray(c)||(c=[c]);for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(21097),p=t(83419),h=t(74099),o=t(95540),l=t(41212),n=t(518),u=t(26430),f=new p({Extends:u,initialize:function(c,d,v,m,S,M,A){if(l(d)){var C=d;d=o(C,"key"),v=o(C,"jsonURL"),m=o(C,"audioURL"),S=o(C,"audioConfig"),M=o(C,"audioXhrSettings"),A=o(C,"jsonXhrSettings")}var w;if(!m)w=new n(c,d,v,A),u.call(this,c,"audiosprite",d,[w]),this.config.resourceLoad=!0,this.config.audioConfig=S,this.config.audioXhrSettings=M;else{var P=r.create(c,d,m,S,M);P&&(w=new n(c,d,v,A),u.call(this,c,"audiosprite",d,[P,w]),this.config.resourceLoad=!1)}},onFileComplete:function(s){var c=this.files.indexOf(s);if(c!==-1&&(this.pending--,this.config.resourceLoad&&s.type==="json"&&s.data.hasOwnProperty("resources"))){var d=s.data.resources,v=o(this.config,"audioConfig"),m=o(this.config,"audioXhrSettings"),S=r.create(this.loader,s.key,d,v,m);S&&(this.addToMultiFile(S),this.loader.addFile(S))}},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],c=this.files[1];s.addToCache(),c.addToCache(),this.complete=!0}}});h.register("audioSprite",function(s,c,d,v,m,S){var M=this.systems.game,A=M.config.audio,C=M.device.audio;if(A&&A.noAudio||!C.webAudio&&!C.audioData)return this;var w;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 r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m){var S="bin";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"xhrSettings"),S=l(M,"extension",S),m=l(M,"dataType",m)}var A={type:"binary",cache:s.cacheManager.binary,extension:S,responseType:"arraybuffer",key:c,url:d,xhrSettings:v,config:{dataType:m}};h.call(this,s,A)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.dataType;this.data=f?new f(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",function(f,s,c,d){if(Array.isArray(f))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(26430),u=t(21859),f=t(57318),s=new r({Extends:n,initialize:function(d,v,m,S,M,A){var C,w;if(l(v)){var P=v;v=h(P,"key"),C=new o(d,{key:v,url:h(P,"textureURL"),extension:h(P,"textureExtension","png"),normalMap:h(P,"normalMap"),xhrSettings:h(P,"textureXhrSettings")}),w=new f(d,{key:v,url:h(P,"fontDataURL"),extension:h(P,"fontDataExtension","xml"),xhrSettings:h(P,"fontDataXhrSettings")})}else C=new o(d,v,m,M),w=new f(d,v,S,A);C.linkFile?n.call(this,d,"bitmapfont",v,[C,w,C.linkFile]):n.call(this,d,"bitmapfont",v,[C,w])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1];c.addToCache();var v=c.cache.get(c.key),m=u(d.data,c.cache.getFrame(c.key),0,0,v);this.loader.cacheManager.bitmapFont.add(c.key,{data:m,texture:c.key,frame:null}),this.complete=!0}}});p.register("bitmapFont",function(c,d,v,m,S){var M;if(Array.isArray(c))for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v){var m="css";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"script",cache:!1,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,s,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",function(f,s,c){if(Array.isArray(f))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(38734),p=t(85722),h=t(83419),o=t(74099),l=t(95540),n=t(19550),u=t(41212),f=t(518),s=t(31403),c=t(46975),d=t(59327),v=t(26430),m=t(82038),S=t(55222),M=new h({Extends:v,initialize:function(C,w,P,L){if(P.multiAtlasURL){var O=new f(C,{key:w,url:P.multiAtlasURL,xhrSettings:L,config:P});v.call(this,C,"texture",w,[O])}else{var I=P.textureURL.substr(P.textureURL.length-3);P.type||(P.type=I.toLowerCase()==="ktx"?"KTX":"PVR");var D=new p(C,{key:w,url:P.textureURL,extension:I,xhrSettings:L,config:P});if(P.atlasURL){var B=new f(C,{key:w,url:P.atlasURL,xhrSettings:L,config:P});v.call(this,C,"texture",w,[D,B])}else v.call(this,C,"texture",w,[D])}this.config=P},onFileComplete:function(A){var C=this.files.indexOf(A);if(C!==-1){if(this.pending--,!this.config.multiAtlasURL)return;if(A.type==="json"&&A.data.hasOwnProperty("textures")){var w=A.data.textures,P=this.config,L=this.loader,O=L.baseURL,I=L.path,D=L.prefix,B=l(P,"multiBaseURL",this.baseURL),G=l(P,"multiPath",this.path),z=l(P,"prefix",this.prefix),W=l(P,"textureXhrSettings");B&&L.setBaseURL(B),G&&L.setPath(G),z&&L.setPrefix(z);for(var k=0;k{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=t(73894),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="glsl";if(n(d)){var A=d;d=l(A,"key"),v=l(A,"url"),m=l(A,"shaderType","fragment"),S=l(A,"xhrSettings"),M=l(A,"extension",M)}else m===void 0&&(m="fragment");var C={type:"glsl",cache:c.cacheManager.shader,extension:M,responseType:"text",key:d,url:v,config:{shaderType:m},xhrSettings:S};h.call(this,c,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var s=this.data.split(` -`),c=this.extractBlock(s,0);if(c)for(;c;){var d=this.getShaderName(c.header),v=this.getShaderType(c.header),m=this.getShaderUniforms(c.header),S=c.shader;if(this.cache.has(d)){var M=this.cache.get(d);v==="fragment"?M.fragmentSrc=S:M.vertexSrc=S,M.uniforms||(M.uniforms=m)}else v==="fragment"?this.cache.add(d,new u(d,S,"",m)):this.cache.add(d,new u(d,"",S,m));c=this.extractBlock(s,c.offset)}else this.config.shaderType==="fragment"?this.cache.add(this.key,new u(this.key,this.data)):this.cache.add(this.key,new u(this.key,"",this.data))},getShaderName:function(s){for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(54899),h=t(41299),o=t(95540),l=t(98356),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v){if(n(c)){var m=c;c=o(m,"key"),v=o(m,"config",v)}var S={type:"audio",cache:s.cacheManager.audio,extension:d.type,key:c,url:d.url,config:v};h.call(this,s,S),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v){var m="html";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",cache:s.cacheManager.html,extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,s,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",function(f,s,c){if(Array.isArray(f))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m,S){v===void 0&&(v=512),m===void 0&&(m=512);var M="html";if(n(c)){var A=c;c=l(A,"key"),d=l(A,"url"),S=l(A,"xhrSettings"),M=l(A,"extension",M),v=l(A,"width",v),m=l(A,"height",m)}var C={type:"html",cache:s.textureManager,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{width:v,height:m}};h.call(this,s,C)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.config.width,s=this.config.height,c=[];c.push(''),c.push(''),c.push(''),c.push(this.xhrLoader.responseText),c.push(""),c.push(""),c.push("");var d=[c.join(` -`)],v=this;try{var m=new window.Blob(d,{type:"image/svg+xml;charset=utf-8"})}catch{v.state=p.FILE_ERRORED,v.onProcessComplete();return}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){h.revokeObjectURL(v.data),v.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(v.data),v.onProcessError()},h.createObjectURL(this.data,m,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("htmlTexture",function(f,s,c,d,v){if(Array.isArray(f))for(var m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=t(98356),f=new r({Extends:h,initialize:function s(c,d,v,m,S){var M="png",A;if(n(d)){var C=d;d=l(C,"key"),v=l(C,"url"),A=l(C,"normalMap"),m=l(C,"xhrSettings"),M=l(C,"extension",M),S=l(C,"frameConfig")}Array.isArray(v)&&(A=v[1],v=v[0]);var w={type:"image",cache:c.textureManager,extension:M,responseType:"blob",key:d,url:v,xhrSettings:m,config:S};if(h.call(this,c,w),A){var P=new s(c,this.key,A,m,S);P.type="normalMap",this.setLink(P),c.addFile(P)}this.useImageElementLoad=c.imageLoadType==="HTMLImageElement"||this.base64,this.useImageElementLoad&&(this.load=this.loadImage,this.onProcess=this.onProcessImage)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){h.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){h.revokeObjectURL(s.data),s.onProcessError()},h.createObjectURL(this.data,this.xhrLoader.response,"image/png")},onProcessImage:function(){var s=this.state;this.state=p.FILE_PROCESSING,s===p.FILE_LOADED?this.onProcessComplete():this.onProcessError()},loadImage:function(){this.state=p.FILE_LOADING,this.src=u(this,this.loader.baseURL),this.data=new Image,this.data.crossOrigin=this.crossOrigin;var s=this;this.data.onload=function(){s.state=p.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>=p.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)}});o.register("image",function(s,c,d){if(Array.isArray(s))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(35154),u=t(41212),f=new r({Extends:h,initialize:function(c,d,v,m,S){var M="json";if(u(d)){var A=d;d=l(A,"key"),v=l(A,"url"),m=l(A,"xhrSettings"),M=l(A,"extension",M),S=l(A,"dataKey",S)}var C={type:"json",cache:c.cacheManager.json,extension:M,responseType:"text",key:d,url:v,xhrSettings:m,config:S};h.call(this,c,C),u(v)&&(S?this.data=n(v,S):this.data=v,this.state=p.FILE_POPULATED)},onProcess:function(){if(this.state!==p.FILE_POPULATED){this.state=p.FILE_PROCESSING;try{var s=JSON.parse(this.xhrLoader.responseText)}catch(d){throw this.onProcessError(),d}var c=this.config;typeof c=="string"?this.data=n(s,c,s):this.data=s}this.onProcessComplete()}});o.register("json",function(s,c,d,v){if(Array.isArray(s))for(var m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(518),u=t(26430),f=new r({Extends:u,initialize:function(c,d,v,m,S,M,A){if(l(d)){var C=d;d=h(C,"key"),h(C,"url",!1)?v=h(C,"url"):v=h(C,"atlasURL"),M=h(C,"xhrSettings"),m=h(C,"path"),S=h(C,"baseURL"),A=h(C,"textureXhrSettings")}var w=new n(c,d,v,M);u.call(this,c,"multiatlas",d,[w]),this.config.path=m,this.config.baseURL=S,this.config.textureXhrSettings=A},onFileComplete:function(s){var c=this.files.indexOf(s);if(c!==-1&&(this.pending--,s.type==="json"&&s.data.hasOwnProperty("textures"))){var d=s.data.textures,v=this.config,m=this.loader,S=m.baseURL,M=m.path,A=m.prefix,C=h(v,"baseURL",this.baseURL),w=h(v,"path",this.path),P=h(v,"prefix",this.prefix),L=h(v,"textureXhrSettings");m.setBaseURL(C),m.setPath(w),m.setPrefix(P);for(var O=0;O{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(41212),l=t(26430),n=t(34328),u=new r({Extends:l,initialize:function(s,c,d,v){var m="js",S=[];if(o(c)){var M=c;c=h(M,"key"),d=h(M,"url"),v=h(M,"xhrSettings"),m=h(M,"extension",m)}Array.isArray(d)||(d=[d]);for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(41212),l=t(26430),n=t(85048),u=t(61485),f=t(78776),s=new r({Extends:l,initialize:function(d,v,m,S,M,A){var C,w,P=d.cacheManager.obj;if(o(v)){var L=v;v=h(L,"key"),C=new f(d,{key:v,type:"obj",cache:P,url:h(L,"url"),extension:h(L,"extension","obj"),xhrSettings:h(L,"xhrSettings"),config:{flipUV:h(L,"flipUV",M)}}),S=h(L,"matURL"),S&&(w=new f(d,{key:v,type:"mat",cache:P,url:S,extension:h(L,"matExtension","mat"),xhrSettings:h(L,"xhrSettings")}))}else C=new f(d,{key:v,url:m,type:"obj",cache:P,extension:"obj",xhrSettings:A,config:{flipUV:M}}),S&&(w=new f(d,{key:v,url:S,type:"mat",cache:P,extension:"mat",xhrSettings:A}));l.call(this,d,"obj",v,[C,w])},addToCache:function(){if(this.isReadyToProcess()){var c=this.files[0],d=this.files[1],v=n(c.data,c.config.flipUV);d&&(v.materials=u(d.data)),c.cache.add(c.key,v),this.complete=!0}}});p.register("obj",function(c,d,v,m,S){var M;if(Array.isArray(c))for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(74099),o=t(518),l=new r({Extends:o,initialize:function(u,f,s,c,d){o.call(this,u,f,s,c,d),this.type="packfile"},onProcess:function(){if(this.state!==p.FILE_POPULATED&&(this.state=p.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.data.hasOwnProperty("files")&&this.config){var n={};n[this.config]=this.data,this.data=n}this.loader.addPack(this.data,this.config),this.onProcessComplete()}});h.register("pack",function(n,u,f,s){if(Array.isArray(n))for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m,S){var M="js";if(n(c)){var A=c;c=l(A,"key"),d=l(A,"url"),S=l(A,"xhrSettings"),M=l(A,"extension",M),v=l(A,"start"),m=l(A,"mapping")}var C={type:"plugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{start:v,mapping:m}};h.call(this,s,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,s=this.config,c=l(s,"start",!1),d=l(s,"mapping",null);if(this.state===p.FILE_POPULATED)f.install(this.key,this.data,c,d);else{this.state=p.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 v=f.install(this.key,window[this.key],c,d);(c||d)&&(this.loader.systems[d]=v,this.loader.scene[d]=v)}this.onProcessComplete()}});o.register("plugin",function(f,s,c,d,v){if(Array.isArray(f))for(var m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m){var S="svg";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"svgConfig",{}),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var A={type:"svg",cache:s.textureManager,extension:S,responseType:"text",key:c,url:d,xhrSettings:m,config:{width:l(v,"width"),height:l(v,"height"),scale:l(v,"scale")}};h.call(this,s,A)},onProcess:function(){this.state=p.FILE_PROCESSING;var f=this.xhrLoader.responseText,s=[f],c=this.config.width,d=this.config.height,v=this.config.scale;t:if(c&&d||v){var m=null,S=new DOMParser;m=S.parseFromString(f,"text/xml");var M=m.getElementsByTagName("svg")[0],A=M.hasAttribute("viewBox"),C=parseFloat(M.getAttribute("width")),w=parseFloat(M.getAttribute("height"));if(!A&&C&&w)M.setAttribute("viewBox","0 0 "+C+" "+w);else if(A&&!C&&!w){var P=M.getAttribute("viewBox").split(/\s+|,/);C=P[2],w=P[3]}if(v)if(C&&w)c=C*v,d=w*v;else break t;M.setAttribute("width",c.toString()+"px"),M.setAttribute("height",d.toString()+"px"),s=[new XMLSerializer().serializeToString(M)]}try{var L=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 O=this,I=!1;this.data.onload=function(){I||h.revokeObjectURL(O.data),O.onProcessComplete()},this.data.onerror=function(){I?O.onProcessError():(I=!0,h.revokeObjectURL(O.data),O.data.src="data:image/svg+xml,"+encodeURIComponent(s.join("")))},h.createObjectURL(this.data,L,"image/svg+xml")},addToCache:function(){this.cache.addImage(this.key,this.data)}});o.register("svg",function(f,s,c,d){if(Array.isArray(f))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v){var m="js";if(n(c)){var S=c;c=l(S,"key"),d=l(S,"url"),v=l(S,"xhrSettings"),m=l(S,"extension",m)}var M={type:"text",extension:m,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,s,M)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var f=this.data.concat(`(function(){ -return new `+this.key+`(); -}).call(this);`),s=eval;this.loader.sceneManager.add(this.key,s(f)),this.complete=!0}});o.register("sceneFile",function(f,s,c){if(Array.isArray(f))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m,S){var M="js";if(n(c)){var A=c;c=l(A,"key"),d=l(A,"url"),S=l(A,"xhrSettings"),M=l(A,"extension",M),v=l(A,"systemKey"),m=l(A,"sceneKey")}var C={type:"scenePlugin",cache:!1,extension:M,responseType:"text",key:c,url:d,xhrSettings:S,config:{systemKey:v,sceneKey:m}};h.call(this,s,C),typeof d=="function"&&(this.data=d,this.state=p.FILE_POPULATED)},onProcess:function(){var f=this.loader.systems.plugins,s=this.config,c=this.key,d=l(s,"systemKey",c),v=l(s,"sceneKey",c);this.state===p.FILE_POPULATED?f.installScenePlugin(d,this.data,v,this.loader.scene,!0):(this.state=p.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),f.installScenePlugin(d,window[this.key],v,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",function(f,s,c,d,v){if(Array.isArray(f))for(var m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v,m){var S="js";if(n(c)){var M=c;c=l(M,"key"),d=l(M,"url"),v=l(M,"type","script"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}else v===void 0&&(v="script");var A={type:v,cache:!1,extension:S,responseType:"text",key:c,url:d,xhrSettings:m};h.call(this,s,A)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",function(f,s,c,d){if(Array.isArray(f))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(74099),o=t(19550),l=new r({Extends:o,initialize:function(u,f,s,c,d){o.call(this,u,f,s,d,c),this.type="spritesheet"},addToCache:function(){var n=this.linkFile;n?n.state>=p.FILE_COMPLETE&&(this.type==="normalMap"?this.cache.addSpriteSheet(this.key,n.data,this.config,this.data):this.cache.addSpriteSheet(this.key,this.data,this.config,n.data)):this.cache.addSpriteSheet(this.key,this.data,this.config)}});h.register("spritesheet",function(n,u,f,s){if(Array.isArray(n))for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=new r({Extends:h,initialize:function(s,c,d,v){var m="text",S="txt",M=s.cacheManager.text;if(n(c)){var A=c;c=l(A,"key"),d=l(A,"url"),v=l(A,"xhrSettings"),S=l(A,"extension",S),m=l(A,"type",m),M=l(A,"cache",M)}var C={type:m,cache:M,extension:S,responseType:"text",key:c,url:d,xhrSettings:v};h.call(this,s,C)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",function(f,s,c){if(Array.isArray(f))for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=t(80341),f=new r({Extends:h,initialize:function(c,d,v,m){var S="csv";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var A={type:"tilemapCSV",cache:c.cacheManager.tilemap,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,A),this.tilemapFormat=u.CSV},onProcess:function(){this.state=p.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)}});o.register("tilemapCSV",function(s,c,d){if(Array.isArray(s))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(518),o=t(80341),l=new r({Extends:h,initialize:function(u,f,s,c){h.call(this,u,f,s,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapImpact",function(n,u,f){if(Array.isArray(n))for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(518),o=t(80341),l=new r({Extends:h,initialize:function(u,f,s,c){h.call(this,u,f,s,c),this.type="tilemapJSON",this.cache=u.cacheManager.tilemap},addToCache:function(){var n={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,n)}});p.register("tilemapTiledJSON",function(n,u,f){if(Array.isArray(n))for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(74099),h=t(95540),o=t(19550),l=t(41212),n=t(26430),u=t(78776),f=new r({Extends:n,initialize:function(c,d,v,m,S,M){var A,C;if(l(d)){var w=d;d=h(w,"key"),A=new o(c,{key:d,url:h(w,"textureURL"),extension:h(w,"textureExtension","png"),normalMap:h(w,"normalMap"),xhrSettings:h(w,"textureXhrSettings")}),C=new u(c,{key:d,url:h(w,"atlasURL"),extension:h(w,"atlasExtension","txt"),xhrSettings:h(w,"atlasXhrSettings")})}else A=new o(c,d,v,S),C=new u(c,d,m,M);A.linkFile?n.call(this,c,"unityatlas",d,[A,C,A.linkFile]):n.call(this,c,"unityatlas",d,[A,C])},addToCache:function(){if(this.isReadyToProcess()){var s=this.files[0],c=this.files[1],d=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(s.key,s.data,c.data,d),this.complete=!0}}});p.register("unityAtlas",function(s,c,d,v,m){var S;if(Array.isArray(s))for(var M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(98356),n=t(95540),u=t(41212),f=new r({Extends:h,initialize:function(c,d,v,m){if(m===void 0&&(m=!1),u(d)){var S=d;d=n(S,"key"),v=n(S,"url",[]),m=n(S,"noAudio",!1)}var M=c.systems.game.device.video.getVideoURL(v);M||console.warn("VideoFile: No supported format for "+d);var A={type:"video",cache:c.cacheManager.video,extension:M.type,key:d,url:M.url,config:{noAudio:m}};h.call(this,c,A)},onProcess:function(){this.data={url:this.src,noAudio:this.config.noAudio,crossOrigin:this.crossOrigin},this.onProcessComplete()},load:function(){this.src=l(this,this.loader.baseURL),this.state=p.FILE_LOADED,this.loader.nextFile(this,!0)}});o.register("video",function(s,c,d){if(Array.isArray(s))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(23906),h=t(41299),o=t(74099),l=t(95540),n=t(41212),u=t(56836),f=new r({Extends:h,initialize:function(c,d,v,m){var S="xml";if(n(d)){var M=d;d=l(M,"key"),v=l(M,"url"),m=l(M,"xhrSettings"),S=l(M,"extension",S)}var A={type:"xml",cache:c.cacheManager.xml,extension:S,responseType:"text",key:d,url:v,xhrSettings:m};h.call(this,c,A)},onProcess:function(){this.state=p.FILE_PROCESSING,this.data=u(this.xhrLoader.responseText),this.data?this.onProcessComplete():this.onProcessError()}});o.register("xml",function(s,c,d){if(Array.isArray(s))for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AnimationJSONFile:t(14135),AsepriteFile:t(76272),AtlasJSONFile:t(38734),AtlasXMLFile:t(74599),AudioFile:t(21097),AudioSpriteFile:t(89524),BinaryFile:t(85722),BitmapFontFile:t(97025),CompressedTextureFile:t(69559),CSSFile:t(16024),GLSLFile:t(47931),HTML5AudioFile:t(89749),HTMLFile:t(88470),HTMLTextureFile:t(14643),ImageFile:t(19550),JSONFile:t(518),MultiAtlasFile:t(59327),MultiScriptFile:t(99297),OBJFile:t(41846),PackFile:t(58610),PluginFile:t(48988),SceneFile:t(88423),ScenePluginFile:t(56812),ScriptFile:t(34328),SpriteSheetFile:t(85035),SVGFile:t(67397),TextFile:t(78776),TilemapCSVFile:t(49477),TilemapImpactFile:t(40807),TilemapJSONFile:t(56775),UnityAtlasFile:t(25771),VideoFile:t(33720),XMLFile:t(57318)}},57777:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23906),p=t(79291),h={Events:t(54899),FileTypes:t(64589),File:t(41299),FileTypesManager:t(74099),GetURL:t(98356),LoaderPlugin:t(74261),MergeXHRSettings:t(3374),MultiFile:t(26430),XHRLoader:t(84376),XHRSettings:t(92638)};h=p(!1,h,r),a.exports=h},53307:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=0,p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6411),p=function(h,o){return r(h)/r(o)/r(h-o)};a.exports=p},30976:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return Math.floor(Math.random()*(r-t+1)+t)};a.exports=y},87842:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){var l=(h-r)*.5,n=(o-p)*.5,u=t*t,f=t*u;return(2*p-2*h+l+n)*f+(-3*p+3*h-2*l-n)*u+l*t+p};a.exports=y},26302:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.ceil(t*h)/h};a.exports=y},45319:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return Math.max(r,Math.min(p,t))};a.exports=y},39506:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=function(h){return h*r.DEG_TO_RAD};a.exports=p},61241:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return Math.abs(t-r)};a.exports=y},38857:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(37867),o=t(29747),l=new h,n=new p({initialize:function u(f,s,c,d){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d=u.DefaultOrder),this._x=f,this._y=s,this._z=c,this._order=d,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(u){this._x=u,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(u){this._y=u,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(u){this._z=u,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(u){this._order=u,this.onChangeCallback(this)}},set:function(u,f,s,c){return c===void 0&&(c=this._order),this._x=u,this._y=f,this._z=s,this._order=c,this.onChangeCallback(this),this},copy:function(u){return this.set(u.x,u.y,u.z,u.order)},setFromQuaternion:function(u,f,s){return f===void 0&&(f=this._order),s===void 0&&(s=!1),l.fromQuat(u),this.setFromRotationMatrix(l,f,s)},setFromRotationMatrix:function(u,f,s){f===void 0&&(f=this._order),s===void 0&&(s=!1);var c=u.val,d=c[0],v=c[4],m=c[8],S=c[1],M=c[5],A=c[9],C=c[2],w=c[6],P=c[10],L=0,O=0,I=0,D=.99999;switch(f){case"XYZ":{O=Math.asin(r(m,-1,1)),Math.abs(m){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){if(t===0)return 1;for(var r=t;--t;)r*=t;return r};a.exports=y},99472:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return Math.random()*(r-t)+t};a.exports=y},77623:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.floor(t*h)/h};a.exports=y},62945:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=function(h,o,l){return h=r(h,0,1),(l-o)*h+o};a.exports=p},38265:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t/r/1e3};a.exports=y},78702:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t==parseFloat(t)?!(t%2):void 0};a.exports=y},94883:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t===parseFloat(t)?!(t%2):void 0};a.exports=y},28915:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return(r-t)*p+t};a.exports=y},94908:a=>{/** - * @author Greg McLean - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p===void 0&&(p=0),t.clone().lerp(r,p)};a.exports=y},94434:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o){this.val=new Float32Array(9),o?this.copy(o):this.identity()},clone:function(){return new p(this)},set:function(h){return this.copy(h)},copy:function(h){var o=this.val,l=h.val;return o[0]=l[0],o[1]=l[1],o[2]=l[2],o[3]=l[3],o[4]=l[4],o[5]=l[5],o[6]=l[6],o[7]=l[7],o[8]=l[8],this},fromMat4:function(h){var o=h.val,l=this.val;return l[0]=o[0],l[1]=o[1],l[2]=o[2],l[3]=o[4],l[4]=o[5],l[5]=o[6],l[6]=o[8],l[7]=o[9],l[8]=o[10],this},fromArray:function(h){var o=this.val;return o[0]=h[0],o[1]=h[1],o[2]=h[2],o[3]=h[3],o[4]=h[4],o[5]=h[5],o[6]=h[6],o[7]=h[7],o[8]=h[8],this},identity:function(){var h=this.val;return h[0]=1,h[1]=0,h[2]=0,h[3]=0,h[4]=1,h[5]=0,h[6]=0,h[7]=0,h[8]=1,this},transpose:function(){var h=this.val,o=h[1],l=h[2],n=h[5];return h[1]=h[3],h[2]=h[6],h[3]=o,h[5]=h[7],h[6]=l,h[7]=n,this},invert:function(){var h=this.val,o=h[0],l=h[1],n=h[2],u=h[3],f=h[4],s=h[5],c=h[6],d=h[7],v=h[8],m=v*f-s*d,S=-v*u+s*c,M=d*u-f*c,A=o*m+l*S+n*M;return A?(A=1/A,h[0]=m*A,h[1]=(-v*l+n*d)*A,h[2]=(s*l-n*f)*A,h[3]=S*A,h[4]=(v*o-n*c)*A,h[5]=(-s*o+n*u)*A,h[6]=M*A,h[7]=(-d*o+l*c)*A,h[8]=(f*o-l*u)*A,this):null},adjoint:function(){var h=this.val,o=h[0],l=h[1],n=h[2],u=h[3],f=h[4],s=h[5],c=h[6],d=h[7],v=h[8];return h[0]=f*v-s*d,h[1]=n*d-l*v,h[2]=l*s-n*f,h[3]=s*c-u*v,h[4]=o*v-n*c,h[5]=n*u-o*s,h[6]=u*d-f*c,h[7]=l*c-o*d,h[8]=o*f-l*u,this},determinant:function(){var h=this.val,o=h[0],l=h[1],n=h[2],u=h[3],f=h[4],s=h[5],c=h[6],d=h[7],v=h[8];return o*(v*f-s*d)+l*(-v*u+s*c)+n*(d*u-f*c)},multiply:function(h){var o=this.val,l=o[0],n=o[1],u=o[2],f=o[3],s=o[4],c=o[5],d=o[6],v=o[7],m=o[8],S=h.val,M=S[0],A=S[1],C=S[2],w=S[3],P=S[4],L=S[5],O=S[6],I=S[7],D=S[8];return o[0]=M*l+A*f+C*d,o[1]=M*n+A*s+C*v,o[2]=M*u+A*c+C*m,o[3]=w*l+P*f+L*d,o[4]=w*n+P*s+L*v,o[5]=w*u+P*c+L*m,o[6]=O*l+I*f+D*d,o[7]=O*n+I*s+D*v,o[8]=O*u+I*c+D*m,this},translate:function(h){var o=this.val,l=h.x,n=h.y;return o[6]=l*o[0]+n*o[3]+o[6],o[7]=l*o[1]+n*o[4]+o[7],o[8]=l*o[2]+n*o[5]+o[8],this},rotate:function(h){var o=this.val,l=o[0],n=o[1],u=o[2],f=o[3],s=o[4],c=o[5],d=Math.sin(h),v=Math.cos(h);return o[0]=v*l+d*f,o[1]=v*n+d*s,o[2]=v*u+d*c,o[3]=v*f-d*l,o[4]=v*s-d*n,o[5]=v*c-d*u,this},scale:function(h){var o=this.val,l=h.x,n=h.y;return o[0]=l*o[0],o[1]=l*o[1],o[2]=l*o[2],o[3]=n*o[3],o[4]=n*o[4],o[5]=n*o[5],this},fromQuat:function(h){var o=h.x,l=h.y,n=h.z,u=h.w,f=o+o,s=l+l,c=n+n,d=o*f,v=o*s,m=o*c,S=l*s,M=l*c,A=n*c,C=u*f,w=u*s,P=u*c,L=this.val;return L[0]=1-(S+A),L[3]=v+P,L[6]=m-w,L[1]=v-P,L[4]=1-(d+A),L[7]=M+C,L[2]=m+w,L[5]=M-C,L[8]=1-(d+S),this},normalFromMat4:function(h){var o=h.val,l=this.val,n=o[0],u=o[1],f=o[2],s=o[3],c=o[4],d=o[5],v=o[6],m=o[7],S=o[8],M=o[9],A=o[10],C=o[11],w=o[12],P=o[13],L=o[14],O=o[15],I=n*d-u*c,D=n*v-f*c,B=n*m-s*c,G=u*v-f*d,z=u*m-s*d,W=f*m-s*v,k=S*P-M*w,J=S*L-A*w,Q=S*O-C*w,Y=M*L-A*P,K=M*O-C*P,U=A*O-C*L,V=I*U-D*K+B*Y+G*Q-z*J+W*k;return V?(V=1/V,l[0]=(d*U-v*K+m*Y)*V,l[1]=(v*Q-c*U-m*J)*V,l[2]=(c*K-d*Q+m*k)*V,l[3]=(f*K-u*U-s*Y)*V,l[4]=(n*U-f*Q+s*J)*V,l[5]=(u*Q-n*K-s*k)*V,l[6]=(P*W-L*z+O*G)*V,l[7]=(L*B-w*W-O*D)*V,l[8]=(w*z-P*B+O*I)*V,this):null}});a.exports=p},37867:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(25836),h=1e-6,o=new r({initialize:function(d){this.val=new Float32Array(16),d?this.copy(d):this.identity()},clone:function(){return new o(this)},set:function(c){return this.copy(c)},setValues:function(c,d,v,m,S,M,A,C,w,P,L,O,I,D,B,G){var z=this.val;return z[0]=c,z[1]=d,z[2]=v,z[3]=m,z[4]=S,z[5]=M,z[6]=A,z[7]=C,z[8]=w,z[9]=P,z[10]=L,z[11]=O,z[12]=I,z[13]=D,z[14]=B,z[15]=G,this},copy:function(c){var d=c.val;return this.setValues(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15])},fromArray:function(c){return this.setValues(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],c[8],c[9],c[10],c[11],c[12],c[13],c[14],c[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(c,d,v){var m=l.fromQuat(v),S=m.val,M=d.x,A=d.y,C=d.z;return this.setValues(S[0]*M,S[1]*M,S[2]*M,0,S[4]*A,S[5]*A,S[6]*A,0,S[8]*C,S[9]*C,S[10]*C,0,c.x,c.y,c.z,1)},xyz:function(c,d,v){this.identity();var m=this.val;return m[12]=c,m[13]=d,m[14]=v,this},scaling:function(c,d,v){this.zero();var m=this.val;return m[0]=c,m[5]=d,m[10]=v,m[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 c=this.val,d=c[1],v=c[2],m=c[3],S=c[6],M=c[7],A=c[11];return c[1]=c[4],c[2]=c[8],c[3]=c[12],c[4]=d,c[6]=c[9],c[7]=c[13],c[8]=v,c[9]=S,c[11]=c[14],c[12]=m,c[13]=M,c[14]=A,this},getInverse:function(c){return this.copy(c),this.invert()},invert:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],A=c[5],C=c[6],w=c[7],P=c[8],L=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],W=d*A-v*M,k=d*C-m*M,J=d*w-S*M,Q=v*C-m*A,Y=v*w-S*A,K=m*w-S*C,U=P*B-L*D,V=P*G-O*D,j=P*z-I*D,$=L*G-O*B,q=L*z-I*B,it=O*z-I*G,nt=W*it-k*q+J*$+Q*j-Y*V+K*U;return nt?(nt=1/nt,this.setValues((A*it-C*q+w*$)*nt,(m*q-v*it-S*$)*nt,(B*K-G*Y+z*Q)*nt,(O*Y-L*K-I*Q)*nt,(C*j-M*it-w*V)*nt,(d*it-m*j+S*V)*nt,(G*J-D*K-z*k)*nt,(P*K-O*J+I*k)*nt,(M*q-A*j+w*U)*nt,(v*j-d*q-S*U)*nt,(D*Y-B*J+z*W)*nt,(L*J-P*Y-I*W)*nt,(A*V-M*$-C*U)*nt,(d*$-v*V+m*U)*nt,(B*k-D*Q-G*W)*nt,(P*Q-L*k+O*W)*nt)):this},adjoint:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],A=c[5],C=c[6],w=c[7],P=c[8],L=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15];return this.setValues(A*(O*z-I*G)-L*(C*z-w*G)+B*(C*I-w*O),-(v*(O*z-I*G)-L*(m*z-S*G)+B*(m*I-S*O)),v*(C*z-w*G)-A*(m*z-S*G)+B*(m*w-S*C),-(v*(C*I-w*O)-A*(m*I-S*O)+L*(m*w-S*C)),-(M*(O*z-I*G)-P*(C*z-w*G)+D*(C*I-w*O)),d*(O*z-I*G)-P*(m*z-S*G)+D*(m*I-S*O),-(d*(C*z-w*G)-M*(m*z-S*G)+D*(m*w-S*C)),d*(C*I-w*O)-M*(m*I-S*O)+P*(m*w-S*C),M*(L*z-I*B)-P*(A*z-w*B)+D*(A*I-w*L),-(d*(L*z-I*B)-P*(v*z-S*B)+D*(v*I-S*L)),d*(A*z-w*B)-M*(v*z-S*B)+D*(v*w-S*A),-(d*(A*I-w*L)-M*(v*I-S*L)+P*(v*w-S*A)),-(M*(L*G-O*B)-P*(A*G-C*B)+D*(A*O-C*L)),d*(L*G-O*B)-P*(v*G-m*B)+D*(v*O-m*L),-(d*(A*G-C*B)-M*(v*G-m*B)+D*(v*C-m*A)),d*(A*O-C*L)-M*(v*O-m*L)+P*(v*C-m*A))},determinant:function(){var c=this.val,d=c[0],v=c[1],m=c[2],S=c[3],M=c[4],A=c[5],C=c[6],w=c[7],P=c[8],L=c[9],O=c[10],I=c[11],D=c[12],B=c[13],G=c[14],z=c[15],W=d*A-v*M,k=d*C-m*M,J=d*w-S*M,Q=v*C-m*A,Y=v*w-S*A,K=m*w-S*C,U=P*B-L*D,V=P*G-O*D,j=P*z-I*D,$=L*G-O*B,q=L*z-I*B,it=O*z-I*G;return W*it-k*q+J*$+Q*j-Y*V+K*U},multiply:function(c){var d=this.val,v=d[0],m=d[1],S=d[2],M=d[3],A=d[4],C=d[5],w=d[6],P=d[7],L=d[8],O=d[9],I=d[10],D=d[11],B=d[12],G=d[13],z=d[14],W=d[15],k=c.val,J=k[0],Q=k[1],Y=k[2],K=k[3];return d[0]=J*v+Q*A+Y*L+K*B,d[1]=J*m+Q*C+Y*O+K*G,d[2]=J*S+Q*w+Y*I+K*z,d[3]=J*M+Q*P+Y*D+K*W,J=k[4],Q=k[5],Y=k[6],K=k[7],d[4]=J*v+Q*A+Y*L+K*B,d[5]=J*m+Q*C+Y*O+K*G,d[6]=J*S+Q*w+Y*I+K*z,d[7]=J*M+Q*P+Y*D+K*W,J=k[8],Q=k[9],Y=k[10],K=k[11],d[8]=J*v+Q*A+Y*L+K*B,d[9]=J*m+Q*C+Y*O+K*G,d[10]=J*S+Q*w+Y*I+K*z,d[11]=J*M+Q*P+Y*D+K*W,J=k[12],Q=k[13],Y=k[14],K=k[15],d[12]=J*v+Q*A+Y*L+K*B,d[13]=J*m+Q*C+Y*O+K*G,d[14]=J*S+Q*w+Y*I+K*z,d[15]=J*M+Q*P+Y*D+K*W,this},multiplyLocal:function(c){var d=this.val,v=c.val;return this.setValues(d[0]*v[0]+d[1]*v[4]+d[2]*v[8]+d[3]*v[12],d[0]*v[1]+d[1]*v[5]+d[2]*v[9]+d[3]*v[13],d[0]*v[2]+d[1]*v[6]+d[2]*v[10]+d[3]*v[14],d[0]*v[3]+d[1]*v[7]+d[2]*v[11]+d[3]*v[15],d[4]*v[0]+d[5]*v[4]+d[6]*v[8]+d[7]*v[12],d[4]*v[1]+d[5]*v[5]+d[6]*v[9]+d[7]*v[13],d[4]*v[2]+d[5]*v[6]+d[6]*v[10]+d[7]*v[14],d[4]*v[3]+d[5]*v[7]+d[6]*v[11]+d[7]*v[15],d[8]*v[0]+d[9]*v[4]+d[10]*v[8]+d[11]*v[12],d[8]*v[1]+d[9]*v[5]+d[10]*v[9]+d[11]*v[13],d[8]*v[2]+d[9]*v[6]+d[10]*v[10]+d[11]*v[14],d[8]*v[3]+d[9]*v[7]+d[10]*v[11]+d[11]*v[15],d[12]*v[0]+d[13]*v[4]+d[14]*v[8]+d[15]*v[12],d[12]*v[1]+d[13]*v[5]+d[14]*v[9]+d[15]*v[13],d[12]*v[2]+d[13]*v[6]+d[14]*v[10]+d[15]*v[14],d[12]*v[3]+d[13]*v[7]+d[14]*v[11]+d[15]*v[15])},premultiply:function(c){return this.multiplyMatrices(c,this)},multiplyMatrices:function(c,d){var v=c.val,m=d.val,S=v[0],M=v[4],A=v[8],C=v[12],w=v[1],P=v[5],L=v[9],O=v[13],I=v[2],D=v[6],B=v[10],G=v[14],z=v[3],W=v[7],k=v[11],J=v[15],Q=m[0],Y=m[4],K=m[8],U=m[12],V=m[1],j=m[5],$=m[9],q=m[13],it=m[2],nt=m[6],et=m[10],ht=m[14],ut=m[3],dt=m[7],mt=m[11],gt=m[15];return this.setValues(S*Q+M*V+A*it+C*ut,w*Q+P*V+L*it+O*ut,I*Q+D*V+B*it+G*ut,z*Q+W*V+k*it+J*ut,S*Y+M*j+A*nt+C*dt,w*Y+P*j+L*nt+O*dt,I*Y+D*j+B*nt+G*dt,z*Y+W*j+k*nt+J*dt,S*K+M*$+A*et+C*mt,w*K+P*$+L*et+O*mt,I*K+D*$+B*et+G*mt,z*K+W*$+k*et+J*mt,S*U+M*q+A*ht+C*gt,w*U+P*q+L*ht+O*gt,I*U+D*q+B*ht+G*gt,z*U+W*q+k*ht+J*gt)},translate:function(c){return this.translateXYZ(c.x,c.y,c.z)},translateXYZ:function(c,d,v){var m=this.val;return m[12]=m[0]*c+m[4]*d+m[8]*v+m[12],m[13]=m[1]*c+m[5]*d+m[9]*v+m[13],m[14]=m[2]*c+m[6]*d+m[10]*v+m[14],m[15]=m[3]*c+m[7]*d+m[11]*v+m[15],this},scale:function(c){return this.scaleXYZ(c.x,c.y,c.z)},scaleXYZ:function(c,d,v){var m=this.val;return m[0]=m[0]*c,m[1]=m[1]*c,m[2]=m[2]*c,m[3]=m[3]*c,m[4]=m[4]*d,m[5]=m[5]*d,m[6]=m[6]*d,m[7]=m[7]*d,m[8]=m[8]*v,m[9]=m[9]*v,m[10]=m[10]*v,m[11]=m[11]*v,this},makeRotationAxis:function(c,d){var v=Math.cos(d),m=Math.sin(d),S=1-v,M=c.x,A=c.y,C=c.z,w=S*M,P=S*A;return this.setValues(w*M+v,w*A-m*C,w*C+m*A,0,w*A+m*C,P*A+v,P*C-m*M,0,w*C-m*A,P*C+m*M,S*C*C+v,0,0,0,0,1)},rotate:function(c,d){var v=this.val,m=d.x,S=d.y,M=d.z,A=Math.sqrt(m*m+S*S+M*M);if(Math.abs(A){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return Math.min(t+r,p)};a.exports=y},50040:a=>{/** - * @author Vladislav Forsh - * @copyright 2021 RoboWhale - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=t.length;if(r===0)return 0;t.sort(function(h,o){return h-o});var p=Math.floor(r/2);return r%2===0?(t[p]+t[p-1])/2:t[p]};a.exports=y},37204:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return Math.max(t-r,p)};a.exports=y},65201:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){p===void 0&&(p=r+1);var o=(t-r)/(p-r);return o>1?h!==void 0?(o=(h-t)/(h-p),o<0&&(o=0)):o=1:o<0&&(o=0),o};a.exports=y},15746:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(94434),h=t(29747),o=t(25836),l=1e-6,n=new Int8Array([1,2,0]),u=new Float32Array([0,0,0]),f=new o(1,0,0),s=new o(0,1,0),c=new o,d=new p,v=new r({initialize:function(S,M,A,C){this.onChangeCallback=h,this.set(S,M,A,C)},x:{get:function(){return this._x},set:function(m){this._x=m,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(m){this._y=m,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(m){this._z=m,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(m){this._w=m,this.onChangeCallback(this)}},copy:function(m){return this.set(m)},set:function(m,S,M,A,C){return C===void 0&&(C=!0),typeof m=="object"?(this._x=m.x||0,this._y=m.y||0,this._z=m.z||0,this._w=m.w||0):(this._x=m||0,this._y=S||0,this._z=M||0,this._w=A||0),C&&this.onChangeCallback(this),this},add:function(m){return this._x+=m.x,this._y+=m.y,this._z+=m.z,this._w+=m.w,this.onChangeCallback(this),this},subtract:function(m){return this._x-=m.x,this._y-=m.y,this._z-=m.z,this._w-=m.w,this.onChangeCallback(this),this},scale:function(m){return this._x*=m,this._y*=m,this._z*=m,this._w*=m,this.onChangeCallback(this),this},length:function(){var m=this.x,S=this.y,M=this.z,A=this.w;return Math.sqrt(m*m+S*S+M*M+A*A)},lengthSq:function(){var m=this.x,S=this.y,M=this.z,A=this.w;return m*m+S*S+M*M+A*A},normalize:function(){var m=this.x,S=this.y,M=this.z,A=this.w,C=m*m+S*S+M*M+A*A;return C>0&&(C=1/Math.sqrt(C),this._x=m*C,this._y=S*C,this._z=M*C,this._w=A*C),this.onChangeCallback(this),this},dot:function(m){return this.x*m.x+this.y*m.y+this.z*m.z+this.w*m.w},lerp:function(m,S){S===void 0&&(S=0);var M=this.x,A=this.y,C=this.z,w=this.w;return this.set(M+S*(m.x-M),A+S*(m.y-A),C+S*(m.z-C),w+S*(m.w-w))},rotationTo:function(m,S){var M=m.x*S.x+m.y*S.y+m.z*S.z;return M<-.999999?(c.copy(f).cross(m).length().999999?this.set(0,0,0,1):(c.copy(m).cross(S),this._x=c.x,this._y=c.y,this._z=c.z,this._w=1+M,this.normalize())},setAxes:function(m,S,M){var A=d.val;return A[0]=S.x,A[3]=S.y,A[6]=S.z,A[1]=M.x,A[4]=M.y,A[7]=M.z,A[2]=-m.x,A[5]=-m.y,A[8]=-m.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(m,S){S=S*.5;var M=Math.sin(S);return this.set(M*m.x,M*m.y,M*m.z,Math.cos(S))},multiply:function(m){var S=this.x,M=this.y,A=this.z,C=this.w,w=m.x,P=m.y,L=m.z,O=m.w;return this.set(S*O+C*w+M*L-A*P,M*O+C*P+A*w-S*L,A*O+C*L+S*P-M*w,C*O-S*w-M*P-A*L)},slerp:function(m,S){var M=this.x,A=this.y,C=this.z,w=this.w,P=m.x,L=m.y,O=m.z,I=m.w,D=M*P+A*L+C*O+w*I;D<0&&(D=-D,P=-P,L=-L,O=-O,I=-I);var B=1-S,G=S;if(1-D>l){var z=Math.acos(D),W=Math.sin(z);B=Math.sin((1-S)*z)/W,G=Math.sin(S*z)/W}return this.set(B*M+G*P,B*A+G*L,B*C+G*O,B*w+G*I)},invert:function(){var m=this.x,S=this.y,M=this.z,A=this.w,C=m*m+S*S+M*M+A*A,w=C?1/C:0;return this.set(-m*w,-S*w,-M*w,A*w)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(m){m*=.5;var S=this.x,M=this.y,A=this.z,C=this.w,w=Math.sin(m),P=Math.cos(m);return this.set(S*P+C*w,M*P+A*w,A*P-M*w,C*P-S*w)},rotateY:function(m){m*=.5;var S=this.x,M=this.y,A=this.z,C=this.w,w=Math.sin(m),P=Math.cos(m);return this.set(S*P-A*w,M*P+C*w,A*P+S*w,C*P-M*w)},rotateZ:function(m){m*=.5;var S=this.x,M=this.y,A=this.z,C=this.w,w=Math.sin(m),P=Math.cos(m);return this.set(S*P+M*w,M*P-S*w,A*P+C*w,C*P-A*w)},calculateW:function(){var m=this.x,S=this.y,M=this.z;return this.w=-Math.sqrt(1-m*m-S*S-M*M),this},setFromEuler:function(m,S){var M=m.x/2,A=m.y/2,C=m.z/2,w=Math.cos(M),P=Math.cos(A),L=Math.cos(C),O=Math.sin(M),I=Math.sin(A),D=Math.sin(C);switch(m.order){case"XYZ":{this.set(O*P*L+w*I*D,w*I*L-O*P*D,w*P*D+O*I*L,w*P*L-O*I*D,S);break}case"YXZ":{this.set(O*P*L+w*I*D,w*I*L-O*P*D,w*P*D-O*I*L,w*P*L+O*I*D,S);break}case"ZXY":{this.set(O*P*L-w*I*D,w*I*L+O*P*D,w*P*D+O*I*L,w*P*L-O*I*D,S);break}case"ZYX":{this.set(O*P*L-w*I*D,w*I*L+O*P*D,w*P*D-O*I*L,w*P*L+O*I*D,S);break}case"YZX":{this.set(O*P*L+w*I*D,w*I*L+O*P*D,w*P*D-O*I*L,w*P*L-O*I*D,S);break}case"XZY":{this.set(O*P*L-w*I*D,w*I*L-O*P*D,w*P*D+O*I*L,w*P*L+O*I*D,S);break}}return this},setFromRotationMatrix:function(m){var S=m.val,M=S[0],A=S[4],C=S[8],w=S[1],P=S[5],L=S[9],O=S[2],I=S[6],D=S[10],B=M+P+D,G;return B>0?(G=.5/Math.sqrt(B+1),this.set((I-L)*G,(C-O)*G,(w-A)*G,.25/G)):M>P&&M>D?(G=2*Math.sqrt(1+M-P-D),this.set(.25*G,(A+w)/G,(C+O)/G,(I-L)/G)):P>D?(G=2*Math.sqrt(1+P-M-D),this.set((A+w)/G,.25*G,(L+I)/G,(C-O)/G)):(G=2*Math.sqrt(1+D-M-P),this.set((C+O)/G,(L+I)/G,.25*G,(w-A)/G)),this},fromMat3:function(m){var S=m.val,M=S[0]+S[4]+S[8],A;if(M>0)A=Math.sqrt(M+1),this.w=.5*A,A=.5/A,this._x=(S[7]-S[5])*A,this._y=(S[2]-S[6])*A,this._z=(S[3]-S[1])*A;else{var C=0;S[4]>S[0]&&(C=1),S[8]>S[C*3+C]&&(C=2);var w=n[C],P=n[w];A=Math.sqrt(S[C*3+C]-S[w*3+w]-S[P*3+P]+1),u[C]=.5*A,A=.5/A,u[w]=(S[w*3+C]+S[C*3+w])*A,u[P]=(S[P*3+C]+S[C*3+P])*A,this._x=u[0],this._y=u[1],this._z=u[2],this._w=(S[P*3+w]-S[w*3+P])*A}return this.onChangeCallback(this),this}});a.exports=v},43396:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=function(h){return h*r.RAD_TO_DEG};a.exports=p},74362:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI;return t.x=Math.cos(p)*r,t.y=Math.sin(p)*r,t};a.exports=y},60706:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=1);var p=Math.random()*2*Math.PI,h=Math.random()*2-1,o=Math.sqrt(1-h*h)*r;return t.x=Math.cos(p)*o,t.y=Math.sin(p)*o,t.z=h*r,t};a.exports=y},67421:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1),t.x=(Math.random()*2-1)*r,t.y=(Math.random()*2-1)*r,t.z=(Math.random()*2-1)*r,t.w=(Math.random()*2-1)*r,t};a.exports=y},36305:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.x,h=t.y;return t.x=p*Math.cos(r)-h*Math.sin(r),t.y=p*Math.sin(r)+h*Math.cos(r),t};a.exports=y},11520:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=Math.cos(h),l=Math.sin(h),n=t.x-r,u=t.y-p;return t.x=n*o-u*l+r,t.y=n*l+u*o+p,t};a.exports=y},1163:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){var l=h+Math.atan2(t.y-p,t.x-r);return t.x=r+o*Math.cos(l),t.y=p+o*Math.sin(l),t};a.exports=y},70336:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){return t.x=r+o*Math.cos(h),t.y=p+o*Math.sin(h),t};a.exports=y},72678:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(25836),p=t(37867),h=t(15746),o=new p,l=new h,n=new r,u=function(f,s,c){return l.setAxisAngle(s,c),o.fromRotationTranslation(l,n.set(0,0,0)),f.transformMat4(o)};a.exports=u},2284:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t>0?Math.ceil(t):Math.floor(t)};a.exports=y},41013:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){r===void 0&&(r=0),p===void 0&&(p=10);var h=Math.pow(p,-r);return Math.round(t*h)/h};a.exports=y},16922:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r===void 0&&(r=1),p===void 0&&(p=1),h===void 0&&(h=1),h*=Math.PI/t;for(var o=[],l=[],n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t<=r?0:t>=p?1:(t=(t-r)/(p-r),t*t*(3-2*t))};a.exports=y},54261:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t=Math.max(0,Math.min(1,(t-r)/(p-r))),t*t*t*(t*(t*6-15)+10)};a.exports=y},44408:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n){n===void 0&&(n=new r);var u=0,f=0,s=o*l;return h>0&&h<=s&&(h>o-1?(f=Math.floor(h/o),u=h-f*o):u=h),n.set(u,f)};a.exports=p},85955:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u,f,s,c){c===void 0&&(c=new r);var d=Math.sin(u),v=Math.cos(u),m=v*f,S=d*f,M=-d*s,A=v*s,C=1/(m*A+M*-S);return c.x=A*C*h+-M*C*o+(n*M-l*A)*C,c.y=m*C*o+-S*C*h+(-n*m+l*S)*C,c};a.exports=p},26099:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(43855),h=new r({initialize:function(l,n){this.x=0,this.y=0,typeof l=="object"?(this.x=l.x||0,this.y=l.y||0):(n===void 0&&(n=l),this.x=l||0,this.y=n||0)},clone:function(){return new h(this.x,this.y)},copy:function(o){return this.x=o.x||0,this.y=o.y||0,this},setFromObject:function(o){return this.x=o.x||0,this.y=o.y||0,this},set:function(o,l){return l===void 0&&(l=o),this.x=o,this.y=l,this},setTo:function(o,l){return this.set(o,l)},setToPolar:function(o,l){return l==null&&(l=1),this.x=Math.cos(o)*l,this.y=Math.sin(o)*l,this},equals:function(o){return this.x===o.x&&this.y===o.y},fuzzyEquals:function(o,l){return p(this.x,o.x,l)&&p(this.y,o.y,l)},angle:function(){var o=Math.atan2(this.y,this.x);return o<0&&(o+=2*Math.PI),o},setAngle:function(o){return this.setToPolar(o,this.length())},add:function(o){return this.x+=o.x,this.y+=o.y,this},subtract:function(o){return this.x-=o.x,this.y-=o.y,this},multiply:function(o){return this.x*=o.x,this.y*=o.y,this},scale:function(o){return isFinite(o)?(this.x*=o,this.y*=o):(this.x=0,this.y=0),this},divide:function(o){return this.x/=o.x,this.y/=o.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(o){var l=o.x-this.x,n=o.y-this.y;return Math.sqrt(l*l+n*n)},distanceSq:function(o){var l=o.x-this.x,n=o.y-this.y;return l*l+n*n},length:function(){var o=this.x,l=this.y;return Math.sqrt(o*o+l*l)},setLength:function(o){return this.normalize().scale(o)},lengthSq:function(){var o=this.x,l=this.y;return o*o+l*l},normalize:function(){var o=this.x,l=this.y,n=o*o+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=o*n,this.y=l*n),this},normalizeRightHand:function(){var o=this.x;return this.x=this.y*-1,this.y=o,this},normalizeLeftHand:function(){var o=this.x;return this.x=this.y,this.y=o*-1,this},dot:function(o){return this.x*o.x+this.y*o.y},cross:function(o){return this.x*o.y-this.y*o.x},lerp:function(o,l){l===void 0&&(l=0);var n=this.x,u=this.y;return this.x=n+l*(o.x-n),this.y=u+l*(o.y-u),this},transformMat3:function(o){var l=this.x,n=this.y,u=o.val;return this.x=u[0]*l+u[3]*n+u[6],this.y=u[1]*l+u[4]*n+u[7],this},transformMat4:function(o){var l=this.x,n=this.y,u=o.val;return this.x=u[0]*l+u[4]*n+u[12],this.y=u[1]*l+u[5]*n+u[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(o){var l=this.length();return l&&l>o&&this.scale(o/l),this},reflect:function(o){return o=o.clone().normalize(),this.subtract(o.scale(2*this.dot(o)))},mirror:function(o){return this.reflect(o).negate()},rotate:function(o){var l=Math.cos(o),n=Math.sin(o);return this.set(l*this.x-n*this.y,n*this.x+l*this.y)},project:function(o){var l=this.dot(o)/o.dot(o);return this.copy(o).scale(l)}});h.ZERO=new h,h.RIGHT=new h(1,0),h.LEFT=new h(-1,0),h.UP=new h(0,-1),h.DOWN=new h(0,1),h.ONE=new h(1,1),a.exports=h},25836:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n){this.x=0,this.y=0,this.z=0,typeof o=="object"?(this.x=o.x||0,this.y=o.y||0,this.z=o.z||0):(this.x=o||0,this.y=l||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(h){return this.x=Math.min(this.x,h.x),this.y=Math.min(this.y,h.y),this.z=Math.min(this.z,h.z),this},max:function(h){return this.x=Math.max(this.x,h.x),this.y=Math.max(this.y,h.y),this.z=Math.max(this.z,h.z),this},clone:function(){return new p(this.x,this.y,this.z)},addVectors:function(h,o){return this.x=h.x+o.x,this.y=h.y+o.y,this.z=h.z+o.z,this},crossVectors:function(h,o){var l=h.x,n=h.y,u=h.z,f=o.x,s=o.y,c=o.z;return this.x=n*c-u*s,this.y=u*f-l*c,this.z=l*s-n*f,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this},set:function(h,o,l){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0):(this.x=h||0,this.y=o||0,this.z=l||0),this},setFromMatrixPosition:function(h){return this.fromArray(h.val,12)},setFromMatrixColumn:function(h,o){return this.fromArray(h.val,o*4)},fromArray:function(h,o){return o===void 0&&(o=0),this.x=h[o],this.y=h[o+1],this.z=h[o+2],this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this},addScalar:function(h){return this.x+=h,this.y+=h,this.z+=h,this},addScale:function(h,o){return this.x+=h.x*o,this.y+=h.y*o,this.z+=h.z*o||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this},scale:function(h){return isFinite(h)?(this.x*=h,this.y*=h,this.z*=h):(this.x=0,this.y=0,this.z=0),this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(h){var o=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return Math.sqrt(o*o+l*l+n*n)},distanceSq:function(h){var o=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0;return o*o+l*l+n*n},length:function(){var h=this.x,o=this.y,l=this.z;return Math.sqrt(h*h+o*o+l*l)},lengthSq:function(){var h=this.x,o=this.y,l=this.z;return h*h+o*o+l*l},normalize:function(){var h=this.x,o=this.y,l=this.z,n=h*h+o*o+l*l;return n>0&&(n=1/Math.sqrt(n),this.x=h*n,this.y=o*n,this.z=l*n),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z},cross:function(h){var o=this.x,l=this.y,n=this.z,u=h.x,f=h.y,s=h.z;return this.x=l*s-n*f,this.y=n*u-o*s,this.z=o*f-l*u,this},lerp:function(h,o){o===void 0&&(o=0);var l=this.x,n=this.y,u=this.z;return this.x=l+o*(h.x-l),this.y=n+o*(h.y-n),this.z=u+o*(h.z-u),this},applyMatrix3:function(h){var o=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*o+u[3]*l+u[6]*n,this.y=u[1]*o+u[4]*l+u[7]*n,this.z=u[2]*o+u[5]*l+u[8]*n,this},applyMatrix4:function(h){var o=this.x,l=this.y,n=this.z,u=h.val,f=1/(u[3]*o+u[7]*l+u[11]*n+u[15]);return this.x=(u[0]*o+u[4]*l+u[8]*n+u[12])*f,this.y=(u[1]*o+u[5]*l+u[9]*n+u[13])*f,this.z=(u[2]*o+u[6]*l+u[10]*n+u[14])*f,this},transformMat3:function(h){var o=this.x,l=this.y,n=this.z,u=h.val;return this.x=o*u[0]+l*u[3]+n*u[6],this.y=o*u[1]+l*u[4]+n*u[7],this.z=o*u[2]+l*u[5]+n*u[8],this},transformMat4:function(h){var o=this.x,l=this.y,n=this.z,u=h.val;return this.x=u[0]*o+u[4]*l+u[8]*n+u[12],this.y=u[1]*o+u[5]*l+u[9]*n+u[13],this.z=u[2]*o+u[6]*l+u[10]*n+u[14],this},transformCoordinates:function(h){var o=this.x,l=this.y,n=this.z,u=h.val,f=o*u[0]+l*u[4]+n*u[8]+u[12],s=o*u[1]+l*u[5]+n*u[9]+u[13],c=o*u[2]+l*u[6]+n*u[10]+u[14],d=o*u[3]+l*u[7]+n*u[11]+u[15];return this.x=f/d,this.y=s/d,this.z=c/d,this},transformQuat:function(h){var o=this.x,l=this.y,n=this.z,u=h.x,f=h.y,s=h.z,c=h.w,d=c*o+f*n-s*l,v=c*l+s*o-u*n,m=c*n+u*l-f*o,S=-u*o-f*l-s*n;return this.x=d*c+S*-u+v*-s-m*-f,this.y=v*c+S*-f+m*-u-d*-s,this.z=m*c+S*-s+d*-f-v*-u,this},project:function(h){var o=this.x,l=this.y,n=this.z,u=h.val,f=u[0],s=u[1],c=u[2],d=u[3],v=u[4],m=u[5],S=u[6],M=u[7],A=u[8],C=u[9],w=u[10],P=u[11],L=u[12],O=u[13],I=u[14],D=u[15],B=1/(o*d+l*M+n*P+D);return this.x=(o*f+l*v+n*A+L)*B,this.y=(o*s+l*m+n*C+O)*B,this.z=(o*c+l*S+n*w+I)*B,this},projectViewMatrix:function(h,o){return this.applyMatrix4(h).applyMatrix4(o)},unprojectViewMatrix:function(h,o){return this.applyMatrix4(h).applyMatrix4(o)},unproject:function(h,o){var l=h.x,n=h.y,u=h.z,f=h.w,s=this.x-l,c=f-this.y-1-n,d=this.z;return this.x=2*s/u-1,this.y=2*c/f-1,this.z=2*d-1,this.project(o)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});p.ZERO=new p,p.RIGHT=new p(1,0,0),p.LEFT=new p(-1,0,0),p.UP=new p(0,-1,0),p.DOWN=new p(0,1,0),p.FORWARD=new p(0,0,1),p.BACK=new p(0,0,-1),p.ONE=new p(1,1,1),a.exports=p},61369:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u){this.x=0,this.y=0,this.z=0,this.w=0,typeof o=="object"?(this.x=o.x||0,this.y=o.y||0,this.z=o.z||0,this.w=o.w||0):(this.x=o||0,this.y=l||0,this.z=n||0,this.w=u||0)},clone:function(){return new p(this.x,this.y,this.z,this.w)},copy:function(h){return this.x=h.x,this.y=h.y,this.z=h.z||0,this.w=h.w||0,this},equals:function(h){return this.x===h.x&&this.y===h.y&&this.z===h.z&&this.w===h.w},set:function(h,o,l,n){return typeof h=="object"?(this.x=h.x||0,this.y=h.y||0,this.z=h.z||0,this.w=h.w||0):(this.x=h||0,this.y=o||0,this.z=l||0,this.w=n||0),this},add:function(h){return this.x+=h.x,this.y+=h.y,this.z+=h.z||0,this.w+=h.w||0,this},subtract:function(h){return this.x-=h.x,this.y-=h.y,this.z-=h.z||0,this.w-=h.w||0,this},scale:function(h){return this.x*=h,this.y*=h,this.z*=h,this.w*=h,this},length:function(){var h=this.x,o=this.y,l=this.z,n=this.w;return Math.sqrt(h*h+o*o+l*l+n*n)},lengthSq:function(){var h=this.x,o=this.y,l=this.z,n=this.w;return h*h+o*o+l*l+n*n},normalize:function(){var h=this.x,o=this.y,l=this.z,n=this.w,u=h*h+o*o+l*l+n*n;return u>0&&(u=1/Math.sqrt(u),this.x=h*u,this.y=o*u,this.z=l*u,this.w=n*u),this},dot:function(h){return this.x*h.x+this.y*h.y+this.z*h.z+this.w*h.w},lerp:function(h,o){o===void 0&&(o=0);var l=this.x,n=this.y,u=this.z,f=this.w;return this.x=l+o*(h.x-l),this.y=n+o*(h.y-n),this.z=u+o*(h.z-u),this.w=f+o*(h.w-f),this},multiply:function(h){return this.x*=h.x,this.y*=h.y,this.z*=h.z||1,this.w*=h.w||1,this},divide:function(h){return this.x/=h.x,this.y/=h.y,this.z/=h.z||1,this.w/=h.w||1,this},distance:function(h){var o=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return Math.sqrt(o*o+l*l+n*n+u*u)},distanceSq:function(h){var o=h.x-this.x,l=h.y-this.y,n=h.z-this.z||0,u=h.w-this.w||0;return o*o+l*l+n*n+u*u},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(h){var o=this.x,l=this.y,n=this.z,u=this.w,f=h.val;return this.x=f[0]*o+f[4]*l+f[8]*n+f[12]*u,this.y=f[1]*o+f[5]*l+f[9]*n+f[13]*u,this.z=f[2]*o+f[6]*l+f[10]*n+f[14]*u,this.w=f[3]*o+f[7]*l+f[11]*n+f[15]*u,this},transformQuat:function(h){var o=this.x,l=this.y,n=this.z,u=h.x,f=h.y,s=h.z,c=h.w,d=c*o+f*n-s*l,v=c*l+s*o-u*n,m=c*n+u*l-f*o,S=-u*o-f*l-s*n;return this.x=d*c+S*-u+v*-s-m*-f,this.y=v*c+S*-f+m*-u-d*-s,this.z=m*c+S*-s+d*-f-v*-u,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});p.prototype.sub=p.prototype.subtract,p.prototype.mul=p.prototype.multiply,p.prototype.div=p.prototype.divide,p.prototype.dist=p.prototype.distance,p.prototype.distSq=p.prototype.distanceSq,p.prototype.len=p.prototype.length,p.prototype.lenSq=p.prototype.lengthSq,a.exports=p},60417:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return Math.abs(t-r)<=p};a.exports=y},15994:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=p-r;return r+((t-r)%h+h)%h};a.exports=y},31040:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return Math.atan2(h-r,p-t)};a.exports=y},55495:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return Math.atan2(r.y-t.y,r.x-t.x)};a.exports=y},128:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return Math.atan2(r.x-t.x,r.y-t.y)};a.exports=y},41273:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return Math.atan2(p-t,h-r)};a.exports=y},1432:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=function(h){return h>Math.PI&&(h-=r.PI2),Math.abs(((h+r.TAU)%r.PI2-r.PI2)%r.PI2)};a.exports=p},12407:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t=t%(2*Math.PI),t>=0?t:t+2*Math.PI};a.exports=y},53993:(a,y,t)=>{/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(99472),p=function(){return r(-Math.PI,Math.PI)};a.exports=p},86564:(a,y,t)=>{/** - * @author Richard Davey - * @author @samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(99472),p=function(){return r(-180,180)};a.exports=p},90154:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(12407),p=function(h){return r(h+Math.PI)};a.exports=p},48736:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=function(h,o,l){return l===void 0&&(l=.05),h===o||(Math.abs(o-h)<=l||Math.abs(o-h)>=r.PI2-l?h=o:(Math.abs(o-h)>Math.PI&&(oh?h+=l:o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=r-t;if(p===0)return 0;var h=Math.floor((p- -180)/360);return p-h*360};a.exports=y},86554:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(15994),p=function(h){return r(h,-Math.PI,Math.PI)};a.exports=p},30954:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(15994),p=function(h){return r(h,-180,180)};a.exports=p},25588:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Between:t(31040),BetweenPoints:t(55495),BetweenPointsY:t(128),BetweenY:t(41273),CounterClockwise:t(1432),Normalize:t(12407),Random:t(53993),RandomDegrees:t(86564),Reverse:t(90154),RotateTo:t(48736),ShortestBetween:t(61430),Wrap:t(86554),WrapDegrees:t(30954)}},36383:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={PI2:Math.PI*2,TAU:Math.PI*.5,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};a.exports=y},20339:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=t-p,l=r-h;return Math.sqrt(o*o+l*l)};a.exports=y},52816:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.x-r.x,h=t.y-r.y;return Math.sqrt(p*p+h*h)};a.exports=y},64559:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.x-r.x,h=t.y-r.y;return p*p+h*h};a.exports=y},82340:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return Math.max(Math.abs(t-p),Math.abs(r-h))};a.exports=y},14390:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){return o===void 0&&(o=2),Math.sqrt(Math.pow(p-t,o)+Math.pow(h-r,o))};a.exports=y},2243:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return Math.abs(t-p)+Math.abs(r-h)};a.exports=y},89774:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=t-p,l=r-h;return o*o+l*l};a.exports=y},50994:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Between:t(20339),BetweenPoints:t(52816),BetweenPointsSquared:t(64559),Chebyshev:t(82340),Power:t(14390),Snake:t(2243),Squared:t(89774)}},62640:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54178),p=t(41521),h=t(79980),o=t(85433),l=t(99140),n=t(48857),u=t(81596),f=t(59133),s=t(98516),c=t(35248),d=t(82500),v=t(49752);a.exports={Power0:u,Power1:f.Out,Power2:o.Out,Power3:s.Out,Power4:c.Out,Linear:u,Quad:f.Out,Cubic:o.Out,Quart:s.Out,Quint:c.Out,Sine:d.Out,Expo:n.Out,Circ:h.Out,Elastic:l.Out,Back:r.Out,Bounce:p.Out,Stepped:v,"Quad.easeIn":f.In,"Cubic.easeIn":o.In,"Quart.easeIn":s.In,"Quint.easeIn":c.In,"Sine.easeIn":d.In,"Expo.easeIn":n.In,"Circ.easeIn":h.In,"Elastic.easeIn":l.In,"Back.easeIn":r.In,"Bounce.easeIn":p.In,"Quad.easeOut":f.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":s.Out,"Quint.easeOut":c.Out,"Sine.easeOut":d.Out,"Expo.easeOut":n.Out,"Circ.easeOut":h.Out,"Elastic.easeOut":l.Out,"Back.easeOut":r.Out,"Bounce.easeOut":p.Out,"Quad.easeInOut":f.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":s.InOut,"Quint.easeInOut":c.InOut,"Sine.easeInOut":d.InOut,"Expo.easeInOut":n.InOut,"Circ.easeInOut":h.InOut,"Elastic.easeInOut":l.InOut,"Back.easeInOut":r.InOut,"Bounce.easeInOut":p.InOut}},1639:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1.70158),t*t*((r+1)*t-r)};a.exports=y},50099:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=1.70158);var p=r*1.525;return(t*=2)<1?.5*(t*t*((p+1)*t-p)):.5*((t-=2)*t*((p+1)*t+p)+2)};a.exports=y},41286:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1.70158),--t*t*((r+1)*t+r)+1};a.exports=y},54178:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(1639),Out:t(41286),InOut:t(50099)}},59590:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t=1-t,t<.36363636363636365?1-7.5625*t*t:t<.7272727272727273?1-(7.5625*(t-=.5454545454545454)*t+.75):t<.9090909090909091?1-(7.5625*(t-=.8181818181818182)*t+.9375):1-(7.5625*(t-=.9545454545454546)*t+.984375)};a.exports=y},41788:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=!1;return t<.5?(t=1-t*2,r=!0):t=t*2-1,t<.36363636363636365?t=7.5625*t*t:t<.7272727272727273?t=7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?t=7.5625*(t-=.8181818181818182)*t+.9375:t=7.5625*(t-=.9545454545454546)*t+.984375,r?(1-t)*.5:t*.5+.5};a.exports=y},69905:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375};a.exports=y},41521:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(59590),Out:t(69905),InOut:t(41788)}},91861:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return 1-Math.sqrt(1-t*t)};a.exports=y},4177:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)};a.exports=y},57512:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.sqrt(1- --t*t)};a.exports=y},79980:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(91861),Out:t(57512),InOut:t(4177)}},51150:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t*t*t};a.exports=y},82820:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)};a.exports=y},35033:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return--t*t*t+1};a.exports=y},85433:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(51150),Out:t(35033),InOut:t(82820)}},69965:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),t===0)return 0;if(t===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-h)*(2*Math.PI)/p))};a.exports=y},50665:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),t===0)return 0;if(t===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-h)*(2*Math.PI)/p)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-h)*(2*Math.PI)/p)*.5+1};a.exports=y},7744:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===void 0&&(r=.1),p===void 0&&(p=.1),t===0)return 0;if(t===1)return 1;var h=p/4;return r<1?r=1:h=p*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-h)*(2*Math.PI)/p)+1};a.exports=y},99140:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(69965),Out:t(7744),InOut:t(50665)}},24590:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return Math.pow(2,10*(t-1))-.001};a.exports=y},87844:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))};a.exports=y},89433:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return 1-Math.pow(2,-10*t)};a.exports=y},48857:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(24590),Out:t(89433),InOut:t(87844)}},48820:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Back:t(54178),Bounce:t(41521),Circular:t(79980),Cubic:t(85433),Elastic:t(99140),Expo:t(48857),Linear:t(81596),Quadratic:t(59133),Quartic:t(98516),Quintic:t(35248),Sine:t(82500),Stepped:t(49752)}},7147:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t};a.exports=y},81596:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports=t(7147)},34826:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t*t};a.exports=y},20544:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)};a.exports=y},92029:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t*(2-t)};a.exports=y},59133:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(34826),Out:t(92029),InOut:t(20544)}},64413:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t*t*t*t};a.exports=y},78137:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)};a.exports=y},45840:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return 1- --t*t*t*t};a.exports=y},98516:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(64413),Out:t(45840),InOut:t(78137)}},87745:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t*t*t*t*t};a.exports=y},16509:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)};a.exports=y},17868:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return--t*t*t*t*t+1};a.exports=y},35248:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(87745),Out:t(17868),InOut:t(16509)}},80461:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t===0?0:t===1?1:1-Math.cos(t*Math.PI/2)};a.exports=y},34025:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t===0?0:t===1?1:.5*(1-Math.cos(Math.PI*t))};a.exports=y},52768:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t===0?0:t===1?1:Math.sin(t*Math.PI/2)};a.exports=y},82500:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={In:t(80461),Out:t(52768),InOut:t(34025)}},72251:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1),t<=0?0:t>=1?1:((r*t|0)+1)*(1/r)};a.exports=y},49752:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports=t(72251)},75698:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1e-4),Math.ceil(t-r)};a.exports=y},43855:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p===void 0&&(p=1e-4),Math.abs(t-r){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r=1e-4),Math.floor(t+r)};a.exports=y},5470:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p===void 0&&(p=1e-4),t>r-p};a.exports=y},94977:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return p===void 0&&(p=1e-4),t{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Ceil:t(75698),Equal:t(43855),Floor:t(25777),GreaterThan:t(5470),LessThan:t(94977)}},75508:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36383),p=t(79291),h={Angle:t(25588),Distance:t(50994),Easing:t(48820),Fuzzy:t(48379),Interpolation:t(38289),Pow2:t(49001),Snap:t(73697),RandomDataGenerator:t(28453),Average:t(53307),Bernstein:t(85710),Between:t(30976),CatmullRom:t(87842),CeilTo:t(26302),Clamp:t(45319),DegToRad:t(39506),Difference:t(61241),Euler:t(38857),Factorial:t(6411),FloatBetween:t(99472),FloorTo:t(77623),FromPercent:t(62945),GetSpeed:t(38265),IsEven:t(78702),IsEvenStrict:t(94883),Linear:t(28915),LinearXY:t(94908),MaxAdd:t(86883),Median:t(50040),MinSub:t(37204),Percent:t(65201),RadToDeg:t(43396),RandomXY:t(74362),RandomXYZ:t(60706),RandomXYZW:t(67421),Rotate:t(36305),RotateAround:t(11520),RotateAroundDistance:t(1163),RotateTo:t(70336),RoundAwayFromZero:t(2284),RoundTo:t(41013),SinCosTableGenerator:t(16922),SmootherStep:t(54261),SmoothStep:t(7602),ToXY:t(44408),TransformXY:t(85955),Within:t(60417),Wrap:t(15994),Vector2:t(26099),Vector3:t(25836),Vector4:t(61369),Matrix3:t(94434),Matrix4:t(37867),Quaternion:t(15746),RotateVec3:t(72678)};h=p(!1,h,r),a.exports=h},89318:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85710),p=function(h,o){for(var l=0,n=h.length-1,u=0;u<=n;u++)l+=Math.pow(1-o,n-u)*Math.pow(o,u)*h[u]*r(n,u);return l};a.exports=p},77259:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87842),p=function(h,o){var l=h.length-1,n=l*o,u=Math.floor(n);return h[0]===h[l]?(o<0&&(u=Math.floor(n=l*(1+o))),r(n-u,h[(u-1+l)%l],h[u],h[(u+1)%l],h[(u+2)%l])):o<0?h[0]-(r(-n,h[0],h[0],h[1],h[1])-h[0]):o>1?h[l]-(r(n-l,h[l],h[l],h[l-1],h[l-1])-h[l]):r(n-u,h[u?u-1:0],h[u],h[l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(o,l){var n=1-o;return n*n*n*l}function t(o,l){var n=1-o;return 3*n*n*o*l}function r(o,l){return 3*(1-o)*o*o*l}function p(o,l){return o*o*o*l}var h=function(o,l,n,u,f){return y(o,l)+t(o,n)+r(o,u)+p(o,f)};a.exports=h},28392:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(28915),p=function(h,o){var l=h.length-1,n=l*o,u=Math.floor(n);return o<0?r(h[0],h[1],n):o>1?r(h[l],h[l-1],l-n):r(h[u],h[u+1>l?l:u+1],n-u)};a.exports=p},32112:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(h,o){var l=1-h;return l*l*o}function t(h,o){return 2*(1-h)*h*o}function r(h,o){return h*h*o}var p=function(h,o,l,n){return y(h,o)+t(h,l)+r(h,n)};a.exports=p},47235:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7602),p=function(h,o,l){return o+(l-o)*r(h,0,1)};a.exports=p},50178:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(54261),p=function(h,o,l){return o+(l-o)*r(h,0,1)};a.exports=p},38289:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Bezier:t(89318),CatmullRom:t(77259),CubicBezier:t(36316),Linear:t(28392),QuadraticBezier:t(32112),SmoothStep:t(47235),SmootherStep:t(50178)}},98439:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=Math.log(t)/.6931471805599453;return 1<{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t>0&&(t&t-1)===0&&r>0&&(r&r-1)===0};a.exports=y},81230:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t>0&&(t&t-1)===0};a.exports=y},49001:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={GetNext:t(98439),IsSize:t(50030),IsValue:t(81230)}},28453:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o){o===void 0&&(o=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],o&&this.init(o)},rnd:function(){var h=2091639*this.s0+this.c*23283064365386963e-26;return this.c=h|0,this.s0=this.s1,this.s1=this.s2,this.s2=h-this.c,this.s2},hash:function(h){var o,l=this.n;h=h.toString();for(var n=0;n>>0,o-=l,o*=l,l=o>>>0,o-=l,l+=o*4294967296;return this.n=l,(l>>>0)*23283064365386963e-26},init:function(h){typeof h=="string"?this.state(h):this.sow(h)},sow:function(h){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,!!h)for(var o=0;o0;l--){var n=Math.floor(this.frac()*(l+1)),u=h[n];h[n]=h[l],h[l]=u}return h}});a.exports=p},63448:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return p===void 0&&(p=0),r===0?t:(t-=p,t=r*Math.ceil(t/r),h?(p+t)/r:p+t)};a.exports=y},56583:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return p===void 0&&(p=0),r===0?t:(t-=p,t=r*Math.floor(t/r),h?(p+t)/r:p+t)};a.exports=y},77720:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){return p===void 0&&(p=0),r===0?t:(t-=p,t=r*Math.round(t/r),h?(p+t)/r:p+t)};a.exports=y},73697:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Ceil:t(63448),Floor:t(56583),To:t(77720)}},85454:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */t(63595);var r=t(8054),p=t(79291),h={Actions:t(61061),Animations:t(60421),BlendModes:t(10312),Cache:t(83388),Cameras:t(26638),Core:t(42857),Class:t(83419),Create:t(15822),Curves:t(25410),Data:t(44965),Display:t(27460),DOM:t(84902),Events:t(93055),FX:t(66064),Game:t(50127),GameObjects:t(77856),Geom:t(55738),Input:t(14350),Loader:t(57777),Math:t(75508),Physics:t(44563),Plugins:t(18922),Renderer:t(36909),Scale:t(93364),ScaleModes:t(29795),Scene:t(97482),Scenes:t(62194),Structs:t(41392),Textures:t(27458),Tilemaps:t(62501),Time:t(90291),Tweens:t(43066),Utils:t(91799)};h.Sound=t(23717),h=p(!1,h,r),a.exports=h,t.g.Phaser=h},71289:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(92209),h=t(88571),o=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,s,c){h.call(this,n,u,f,s,c),this.body=null}});a.exports=o},86689:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(39506),h=t(20339),o=t(89774),l=t(66022),n=t(95540),u=t(46975),f=t(72441),s=t(47956),c=t(37277),d=t(44594),v=t(26099),m=t(82248),S=new r({initialize:function(A){this.scene=A,this.systems=A.sys,this.config=this.getConfig(),this.world,this.add,this._category=1,A.sys.events.once(d.BOOT,this.boot,this),A.sys.events.on(d.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new l(this.world),this.systems.events.once(d.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new l(this.world));var M=this.systems.events;n(this.config,"customUpdate",!1)||M.on(d.UPDATE,this.world.update,this.world),M.on(d.POST_UPDATE,this.world.postUpdate,this.world),M.once(d.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(d.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(d.UPDATE,this.world.update,this.world)},getConfig:function(){var M=this.systems.game.config.physics,A=this.systems.settings.physics,C=u(n(A,"arcade",{}),n(M,"arcade",{}));return C},nextCategory:function(){return this._category=this._category<<1,this._category},overlap:function(M,A,C,w,P){return C===void 0&&(C=null),w===void 0&&(w=null),P===void 0&&(P=C),this.world.collideObjects(M,A,C,w,P,!0)},collide:function(M,A,C,w,P){return C===void 0&&(C=null),w===void 0&&(w=null),P===void 0&&(P=C),this.world.collideObjects(M,A,C,w,P,!1)},collideTiles:function(M,A,C,w,P){return this.world.collideTiles(M,A,C,w,P)},overlapTiles:function(M,A,C,w,P){return this.world.overlapTiles(M,A,C,w,P)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(M,A,C,w,P,L){w===void 0&&(w=60);var O=Math.atan2(C-M.y,A-M.x);return M.body.acceleration.setToPolar(O,w),P!==void 0&&L!==void 0&&M.body.maxVelocity.set(P,L),O},accelerateToObject:function(M,A,C,w,P){return this.accelerateTo(M,A.x,A.y,C,w,P)},closest:function(M,A){A||(A=this.world.bodies.entries);for(var C=Number.MAX_VALUE,w=null,P=M.x,L=M.y,O=A.length,I=0;IC&&(w=D,C=G)}}return w},moveTo:function(M,A,C,w,P){w===void 0&&(w=60),P===void 0&&(P=0);var L=Math.atan2(C-M.y,A-M.x);return P>0&&(w=h(M.x,M.y,A,C)/(P/1e3)),M.body.velocity.setToPolar(L,w),L},moveToObject:function(M,A,C,w){return this.moveTo(M,A.x,A.y,C,w)},velocityFromAngle:function(M,A,C){return A===void 0&&(A=60),C===void 0&&(C=new v),C.setToPolar(p(M),A)},velocityFromRotation:function(M,A,C){return A===void 0&&(A=60),C===void 0&&(C=new v),C.setToPolar(M,A)},overlapRect:function(M,A,C,w,P,L){return s(this.world,M,A,C,w,P,L)},overlapCirc:function(M,A,C,w,P){return f(this.world,M,A,C,w,P)},shutdown:function(){if(this.world){var M=this.systems.events;M.off(d.UPDATE,this.world.update,this.world),M.off(d.POST_UPDATE,this.world.postUpdate,this.world),M.off(d.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(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",S,"arcadePhysics"),a.exports=S},13759:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(92209),h=t(68287),o=new r({Extends:h,Mixins:[p.Acceleration,p.Angular,p.Bounce,p.Collision,p.Debug,p.Drag,p.Enable,p.Friction,p.Gravity,p.Immovable,p.Mass,p.Pushable,p.Size,p.Velocity],initialize:function(n,u,f,s,c){h.call(this,n,u,f,s,c),this.body=null}});a.exports=o},37742:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(78389),h=t(37747),o=t(63012),l=t(43396),n=t(87841),u=t(37303),f=t(95829),s=t(26099),c=new r({Mixins:[p],initialize:function(v,m){var S=64,M=64,A={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},C=m!==void 0;C&&m.displayWidth&&(S=m.displayWidth,M=m.displayHeight),C||(m=A),this.world=v,this.gameObject=C?m:void 0,this.isBody=!0,this.transform={x:m.x,y:m.y,rotation:m.angle,scaleX:m.scaleX,scaleY:m.scaleY,displayOriginX:m.displayOriginX,displayOriginY:m.displayOriginY},this.debugShowBody=v.defaults.debugShowBody,this.debugShowVelocity=v.defaults.debugShowVelocity,this.debugBodyColor=v.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new s,this.position=new s(m.x-m.scaleX*m.displayOriginX,m.y-m.scaleY*m.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=m.angle,this.preRotation=m.angle,this.width=S,this.height=M,this.sourceWidth=S,this.sourceHeight=M,m.frame&&(this.sourceWidth=m.frame.realWidth,this.sourceHeight=m.frame.realHeight),this.halfWidth=Math.abs(S/2),this.halfHeight=Math.abs(M/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=v.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=h.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=f(!1),this.touching=f(!0),this.wasTouching=f(!0),this.blocked=f(!0),this.syncBounds=!1,this.physicsType=h.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._sx=m.scaleX,this._sy=m.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new n,this.directControl=!1,this.autoFrame=this.position.clone()},updateBounds:function(){var d=this.gameObject,v=this.transform;if(d.parentContainer){var m=d.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);v.x=m.tx,v.y=m.ty,v.rotation=l(m.rotation),v.scaleX=m.scaleX,v.scaleY=m.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY}else v.x=d.x,v.y=d.y,v.rotation=d.angle,v.scaleX=d.scaleX,v.scaleY=d.scaleY,v.displayOriginX=d.displayOriginX,v.displayOriginY=d.displayOriginY;var S=!1;if(this.syncBounds){var M=d.getBounds(this._bounds);this.width=M.width,this.height=M.height,S=!0}else{var A=Math.abs(v.scaleX),C=Math.abs(v.scaleY);(this._sx!==A||this._sy!==C)&&(this.width=this.sourceWidth*A,this.height=this.sourceHeight*C,this._sx=A,this._sy=C,S=!0)}S&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var d=this.transform;this.position.x=d.x+d.scaleX*(this.offset.x-d.displayOriginX),this.position.y=d.y+d.scaleY*(this.offset.y-d.displayOriginY),this.updateCenter()},resetFlags:function(d){d===void 0&&(d=!1);var v=this.wasTouching,m=this.touching,S=this.blocked;d?f(!0,v):(v.none=m.none,v.up=m.up,v.down=m.down,v.left=m.left,v.right=m.right),f(!0,m),f(!0,S),this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(d,v){if(d&&this.resetFlags(),this.gameObject&&this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves){var m=this.position;this.prev.x=m.x,this.prev.y=m.y,this.prevFrame.x=m.x,this.prevFrame.y=m.y}d&&this.update(v)},update:function(d){var v=this.prev,m=this.position,S=this.velocity;if(v.set(m.x,m.y),!this.moves){this._dx=m.x-v.x,this._dy=m.y-v.y;return}if(this.directControl){var M=this.autoFrame;S.set((m.x-M.x)/d,(m.y-M.y)/d),this.world.updateMotion(this,d),this._dx=m.x-M.x,this._dy=m.y-M.y}else this.world.updateMotion(this,d),this.newVelocity.set(S.x*d,S.y*d),m.add(this.newVelocity),this._dx=m.x-v.x,this._dy=m.y-v.y;var A=S.x,C=S.y;if(this.updateCenter(),this.angle=Math.atan2(C,A),this.speed=Math.sqrt(A*A+C*C),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds){var w=this.blocked;this.world.emit(o.WORLD_BOUNDS,this,w.up,w.down,w.left,w.right)}},postUpdate:function(){var d=this.position,v=d.x-this.prevFrame.x,m=d.y-this.prevFrame.y,S=this.gameObject;if(this.moves){var M=this.deltaMax.x,A=this.deltaMax.y;M!==0&&v!==0&&(v<0&&v<-M?v=-M:v>0&&v>M&&(v=M)),A!==0&&m!==0&&(m<0&&m<-A?m=-A:m>0&&m>A&&(m=A)),S&&(S.x+=v,S.y+=m)}v<0?this.facing=h.FACING_LEFT:v>0&&(this.facing=h.FACING_RIGHT),m<0?this.facing=h.FACING_UP:m>0&&(this.facing=h.FACING_DOWN),this.allowRotation&&S&&(S.angle+=this.deltaZ()),this._tx=v,this._ty=m,this.autoFrame.set(d.x,d.y)},setBoundsRectangle:function(d){return this.customBoundsRectangle=d||this.world.bounds,this},checkWorldBounds:function(){var d=this.position,v=this.velocity,m=this.blocked,S=this.customBoundsRectangle,M=this.world.checkCollision,A=this.worldBounce?-this.worldBounce.x:-this.bounce.x,C=this.worldBounce?-this.worldBounce.y:-this.bounce.y,w=!1;return d.xS.right&&M.right&&(d.x=S.right-this.width,v.x*=A,m.right=!0,w=!0),d.yS.bottom&&M.down&&(d.y=S.bottom-this.height,v.y*=C,m.down=!0,w=!0),w&&(this.blocked.none=!1,this.updateCenter()),w},setOffset:function(d,v){return v===void 0&&(v=d),this.offset.set(d,v),this},setGameObject:function(d,v){return v===void 0&&(v=!0),this.world.remove(this),this.gameObject&&this.gameObject.body&&(this.gameObject.body=null),this.gameObject=d,d.body&&(d.body=this),this.setSize(),this.world.add(this),this.enable=v,this},setSize:function(d,v,m){m===void 0&&(m=!0);var S=this.gameObject;if(S&&(!d&&S.frame&&(d=S.frame.realWidth),!v&&S.frame&&(v=S.frame.realHeight)),this.sourceWidth=d,this.sourceHeight=v,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(),m&&S&&S.getCenter){var M=(S.width-d)/2,A=(S.height-v)/2;this.offset.set(M,A)}return this.isCircle=!1,this.radius=0,this},setCircle:function(d,v,m){return v===void 0&&(v=this.offset.x),m===void 0&&(m=this.offset.y),d>0?(this.isCircle=!0,this.radius=d,this.sourceWidth=d*2,this.sourceHeight=d*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(v,m),this.updateCenter()):this.isCircle=!1,this},reset:function(d,v){this.stop();var m=this.gameObject;m&&(m.setPosition(d,v),this.rotation=m.angle,this.preRotation=m.angle);var S=this.position;m&&m.getTopLeft?m.getTopLeft(S):S.set(d,v),this.prev.copy(S),this.prevFrame.copy(S),this.autoFrame.copy(S),m&&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(d){return d.x=this.x,d.y=this.y,d.right=this.right,d.bottom=this.bottom,d},hitTest:function(d,v){if(!this.isCircle)return u(this,d,v);if(this.radius>0&&d>=this.left&&d<=this.right&&v>=this.top&&v<=this.bottom){var m=(this.center.x-d)*(this.center.x-d),S=(this.center.y-v)*(this.center.y-v);return m+S<=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(d){var v=this.position,m=v.x+this.halfWidth,S=v.y+this.halfHeight;this.debugShowBody&&(d.lineStyle(d.defaultStrokeWidth,this.debugBodyColor),this.isCircle?d.strokeCircle(m,S,this.width/2):(this.checkCollision.up&&d.lineBetween(v.x,v.y,v.x+this.width,v.y),this.checkCollision.right&&d.lineBetween(v.x+this.width,v.y,v.x+this.width,v.y+this.height),this.checkCollision.down&&d.lineBetween(v.x,v.y+this.height,v.x+this.width,v.y+this.height),this.checkCollision.left&&d.lineBetween(v.x,v.y,v.x,v.y+this.height))),this.debugShowVelocity&&(d.lineStyle(d.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),d.lineBetween(m,S,m+this.velocity.x/2,S+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setDirectControl:function(d){return d===void 0&&(d=!0),this.directControl=d,this},setCollideWorldBounds:function(d,v,m,S){d===void 0&&(d=!0),this.collideWorldBounds=d;var M=v!==void 0,A=m!==void 0;return(M||A)&&(this.worldBounce||(this.worldBounce=new s),M&&(this.worldBounce.x=v),A&&(this.worldBounce.y=m)),S!==void 0&&(this.onWorldBounds=S),this},setVelocity:function(d,v){return this.velocity.set(d,v),d=this.velocity.x,v=this.velocity.y,this.speed=Math.sqrt(d*d+v*v),this},setVelocityX:function(d){return this.setVelocity(d,this.velocity.y)},setVelocityY:function(d){return this.setVelocity(this.velocity.x,d)},setMaxVelocity:function(d,v){return this.maxVelocity.set(d,v),this},setMaxVelocityX:function(d){return this.maxVelocity.x=d,this},setMaxVelocityY:function(d){return this.maxVelocity.y=d,this},setMaxSpeed:function(d){return this.maxSpeed=d,this},setSlideFactor:function(d,v){return this.slideFactor.set(d,v),this},setBounce:function(d,v){return this.bounce.set(d,v),this},setBounceX:function(d){return this.bounce.x=d,this},setBounceY:function(d){return this.bounce.y=d,this},setAcceleration:function(d,v){return this.acceleration.set(d,v),this},setAccelerationX:function(d){return this.acceleration.x=d,this},setAccelerationY:function(d){return this.acceleration.y=d,this},setAllowDrag:function(d){return d===void 0&&(d=!0),this.allowDrag=d,this},setAllowGravity:function(d){return d===void 0&&(d=!0),this.allowGravity=d,this},setAllowRotation:function(d){return d===void 0&&(d=!0),this.allowRotation=d,this},setDrag:function(d,v){return this.drag.set(d,v),this},setDamping:function(d){return this.useDamping=d,this},setDragX:function(d){return this.drag.x=d,this},setDragY:function(d){return this.drag.y=d,this},setGravity:function(d,v){return this.gravity.set(d,v),this},setGravityX:function(d){return this.gravity.x=d,this},setGravityY:function(d){return this.gravity.y=d,this},setFriction:function(d,v){return this.friction.set(d,v),this},setFrictionX:function(d){return this.friction.x=d,this},setFrictionY:function(d){return this.friction.y=d,this},setAngularVelocity:function(d){return this.angularVelocity=d,this},setAngularAcceleration:function(d){return this.angularAcceleration=d,this},setAngularDrag:function(d){return this.angularDrag=d,this},setMass:function(d){return this.mass=d,this},setImmovable:function(d){return d===void 0&&(d=!0),this.immovable=d,this},setEnable:function(d){return d===void 0&&(d=!0),this.enable=d,this},processX:function(d,v,m,S){this.x+=d,this.updateCenter(),v!==null&&(this.velocity.x=v*this.slideFactor.x);var M=this.blocked;m&&(M.left=!0,M.none=!1),S&&(M.right=!0,M.none=!1)},processY:function(d,v,m,S){this.y+=d,this.updateCenter(),v!==null&&(this.velocity.y=v*this.slideFactor.y);var M=this.blocked;m&&(M.up=!0,M.none=!1),S&&(M.down=!0,M.none=!1)},x:{get:function(){return this.position.x},set:function(d){this.position.x=d}},y:{get:function(){return this.position.y},set:function(d){this.position.y=d}},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}}});a.exports=c},79342:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u,f,s,c){this.world=o,this.name="",this.active=!0,this.overlapOnly=l,this.object1=n,this.object2=u,this.collideCallback=f,this.processCallback=s,this.callbackContext=c},setName:function(h){return this.name=h,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});a.exports=p},66022:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(71289),p=t(13759),h=t(37742),o=t(83419),l=t(37747),n=t(60758),u=t(72624),f=t(71464),s=new o({initialize:function(d){this.world=d,this.scene=d.scene,this.sys=d.scene.sys},collider:function(c,d,v,m,S){return this.world.addCollider(c,d,v,m,S)},overlap:function(c,d,v,m,S){return this.world.addOverlap(c,d,v,m,S)},existing:function(c,d){var v=d?l.STATIC_BODY:l.DYNAMIC_BODY;return this.world.enableBody(c,v),c},staticImage:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},image:function(c,d,v,m){var S=new r(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticSprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.STATIC_BODY),S},sprite:function(c,d,v,m){var S=new p(this.scene,c,d,v,m);return this.sys.displayList.add(S),this.sys.updateList.add(S),this.world.enableBody(S,l.DYNAMIC_BODY),S},staticGroup:function(c,d){return this.sys.updateList.add(new f(this.world,this.world.scene,c,d))},group:function(c,d){return this.sys.updateList.add(new n(this.world,this.world.scene,c,d))},body:function(c,d,v,m){var S=new h(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.DYNAMIC_BODY),S},staticBody:function(c,d,v,m){var S=new u(this.world);return S.position.set(c,d),v&&m&&S.setSize(v,m),this.world.add(S,l.STATIC_BODY),S},destroy:function(){this.world=null,this.scene=null,this.sys=null}});a.exports=s},79599:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=0;if(!Array.isArray(t))r=t;else for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37747),p=function(h,o,l,n){var u=0,f=h.deltaAbsX()+o.deltaAbsX()+n;return h._dx===0&&o._dx===0?(h.embedded=!0,o.embedded=!0):h._dx>o._dx?(u=h.right-o.x,u>f&&!l||h.checkCollision.right===!1||o.checkCollision.left===!1?u=0:(h.touching.none=!1,h.touching.right=!0,o.touching.none=!1,o.touching.left=!0,o.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.right=!0),h.physicsType===r.STATIC_BODY&&!l&&(o.blocked.none=!1,o.blocked.left=!0))):h._dxf&&!l||h.checkCollision.left===!1||o.checkCollision.right===!1?u=0:(h.touching.none=!1,h.touching.left=!0,o.touching.none=!1,o.touching.right=!0,o.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.left=!0),h.physicsType===r.STATIC_BODY&&!l&&(o.blocked.none=!1,o.blocked.right=!0))),h.overlapX=u,o.overlapX=u,u};a.exports=p},45170:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37747),p=function(h,o,l,n){var u=0,f=h.deltaAbsY()+o.deltaAbsY()+n;return h._dy===0&&o._dy===0?(h.embedded=!0,o.embedded=!0):h._dy>o._dy?(u=h.bottom-o.y,u>f&&!l||h.checkCollision.down===!1||o.checkCollision.up===!1?u=0:(h.touching.none=!1,h.touching.down=!0,o.touching.none=!1,o.touching.up=!0,o.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.down=!0),h.physicsType===r.STATIC_BODY&&!l&&(o.blocked.none=!1,o.blocked.up=!0))):h._dyf&&!l||h.checkCollision.up===!1||o.checkCollision.down===!1?u=0:(h.touching.none=!1,h.touching.up=!0,o.touching.none=!1,o.touching.down=!0,o.physicsType===r.STATIC_BODY&&!l&&(h.blocked.none=!1,h.blocked.up=!0),h.physicsType===r.STATIC_BODY&&!l&&(o.blocked.none=!1,o.blocked.down=!0))),h.overlapY=u,o.overlapY=u,u};a.exports=p},60758:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13759),p=t(83419),h=t(78389),o=t(37747),l=t(95540),n=t(26479),u=t(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){if(!v&&!m)m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else if(u(v))m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(v)&&u(v[0])){var S=this;v.forEach(function(M){M.internalCreateCallback=S.createCallbackHandler,M.internalRemoveCallback=S.removeCallbackHandler,M.classType=l(M,"classType",r)}),m=null}else m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=c,m&&(m.classType=l(m,"classType",r)),this.physicsType=o.DYNAMIC_BODY,this.collisionCategory=1,this.collisionMask=1,this.defaults={setCollideWorldBounds:l(m,"collideWorldBounds",!1),setBoundsRectangle:l(m,"customBoundsRectangle",null),setAccelerationX:l(m,"accelerationX",0),setAccelerationY:l(m,"accelerationY",0),setAllowDrag:l(m,"allowDrag",!0),setAllowGravity:l(m,"allowGravity",!0),setAllowRotation:l(m,"allowRotation",!0),setDamping:l(m,"useDamping",!1),setBounceX:l(m,"bounceX",0),setBounceY:l(m,"bounceY",0),setDragX:l(m,"dragX",0),setDragY:l(m,"dragY",0),setEnable:l(m,"enable",!0),setGravityX:l(m,"gravityX",0),setGravityY:l(m,"gravityY",0),setFrictionX:l(m,"frictionX",0),setFrictionY:l(m,"frictionY",0),setMaxSpeed:l(m,"maxSpeed",-1),setMaxVelocityX:l(m,"maxVelocityX",1e4),setMaxVelocityY:l(m,"maxVelocityY",1e4),setVelocityX:l(m,"velocityX",0),setVelocityY:l(m,"velocityY",0),setAngularVelocity:l(m,"angularVelocity",0),setAngularAcceleration:l(m,"angularAcceleration",0),setAngularDrag:l(m,"angularDrag",0),setMass:l(m,"mass",1),setImmovable:l(m,"immovable",!1)},n.call(this,d,v,m),this.type="PhysicsGroup"},createCallbackHandler:function(s){s.body||this.world.enableBody(s,o.DYNAMIC_BODY);var c=s.body;for(var d in this.defaults)c[d](this.defaults[d])},removeCallbackHandler:function(s){s.body&&this.world.disableBody(s)},setVelocity:function(s,c,d){d===void 0&&(d=0);for(var v=this.getChildren(),m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y,t,r,p,h,o,l,n,u,f,s,c,d,v,m,S,M,A=function(I,D,B){y=I,t=D;var G=y.velocity.x,z=t.velocity.x;return r=y.pushable,u=y._dx<0,f=y._dx>0,s=y._dx===0,m=Math.abs(y.right-t.x)<=Math.abs(t.right-y.x),l=z-G*y.bounce.x,p=t.pushable,c=t._dx<0,d=t._dx>0,v=t._dx===0,S=!m,n=G-z*t.bounce.x,M=Math.abs(B),C()},C=function(){return f&&m&&t.blocked.right?(y.processX(-M,l,!1,!0),1):u&&S&&t.blocked.left?(y.processX(M,l,!0),1):d&&S&&y.blocked.right?(t.processX(-M,n,!1,!0),2):c&&m&&y.blocked.left?(t.processX(M,n,!0),2):0},w=function(){var I=y.velocity.x,D=t.velocity.x,B=Math.sqrt(D*D*t.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/t.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.x,o=z+G*t.bounce.x,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processX(M,h),t.processX(-M,o)):(y.processX(-M,h),t.processX(M,o));else if(r&&!p)I===0||I===3?y.processX(M,l,!0):y.processX(-M,l,!1,!0);else if(!r&&p)I===0||I===3?t.processX(-M,n,!1,!0):t.processX(M,n,!0);else{var D=M*.5;I===0?v?(y.processX(M,0,!0),t.processX(0,null,!1,!0)):d?(y.processX(D,0,!0),t.processX(-D,0,!1,!0)):(y.processX(D,t.velocity.x,!0),t.processX(-D,null,!1,!0)):I===1?s?(y.processX(0,null,!1,!0),t.processX(M,0,!0)):f?(y.processX(-D,0,!1,!0),t.processX(D,0,!0)):(y.processX(-D,null,!1,!0),t.processX(D,y.velocity.x,!0)):I===2?v?(y.processX(-M,0,!1,!0),t.processX(0,null,!0)):c?(y.processX(-D,0,!1,!0),t.processX(D,0,!0)):(y.processX(-D,t.velocity.x,!1,!0),t.processX(D,null,!0)):I===3&&(s?(y.processX(0,null,!0),t.processX(-M,0,!1,!0)):u?(y.processX(D,0,!0),t.processX(-D,0,!1,!0)):(y.processX(D,t.velocity.y,!0),t.processX(-D,null,!1,!0)))}return!0},L=function(I){I===1?t.velocity.x=0:m?t.processX(M,n,!0):t.processX(-M,n,!1,!0),y.moves&&(t.y+=(y.y-y.prev.y)*y.friction.y,t._dy=t.y-t.prev.y)},O=function(I){I===2?y.velocity.x=0:S?y.processX(M,l,!0):y.processX(-M,l,!1,!0),t.moves&&(y.y+=(t.y-t.prev.y)*t.friction.y,y._dy=y.y-y.prev.y)};a.exports={BlockCheck:C,Check:w,Set:A,Run:P,RunImmovableBody1:L,RunImmovableBody2:O}},47962:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y,t,r,p,h,o,l,n,u,f,s,c,d,v,m,S,M,A=function(I,D,B){y=I,t=D;var G=y.velocity.y,z=t.velocity.y;return r=y.pushable,u=y._dy<0,f=y._dy>0,s=y._dy===0,m=Math.abs(y.bottom-t.y)<=Math.abs(t.bottom-y.y),l=z-G*y.bounce.y,p=t.pushable,c=t._dy<0,d=t._dy>0,v=t._dy===0,S=!m,n=G-z*t.bounce.y,M=Math.abs(B),C()},C=function(){return f&&m&&t.blocked.down?(y.processY(-M,l,!1,!0),1):u&&S&&t.blocked.up?(y.processY(M,l,!0),1):d&&S&&y.blocked.down?(t.processY(-M,n,!1,!0),2):c&&m&&y.blocked.up?(t.processY(M,n,!0),2):0},w=function(){var I=y.velocity.y,D=t.velocity.y,B=Math.sqrt(D*D*t.mass/y.mass)*(D>0?1:-1),G=Math.sqrt(I*I*y.mass/t.mass)*(I>0?1:-1),z=(B+G)*.5;return B-=z,G-=z,h=z+B*y.bounce.y,o=z+G*t.bounce.y,u&&S?P(0):c&&m?P(1):f&&m?P(2):d&&S?P(3):!1},P=function(I){if(r&&p)M*=.5,I===0||I===3?(y.processY(M,h),t.processY(-M,o)):(y.processY(-M,h),t.processY(M,o));else if(r&&!p)I===0||I===3?y.processY(M,l,!0):y.processY(-M,l,!1,!0);else if(!r&&p)I===0||I===3?t.processY(-M,n,!1,!0):t.processY(M,n,!0);else{var D=M*.5;I===0?v?(y.processY(M,0,!0),t.processY(0,null,!1,!0)):d?(y.processY(D,0,!0),t.processY(-D,0,!1,!0)):(y.processY(D,t.velocity.y,!0),t.processY(-D,null,!1,!0)):I===1?s?(y.processY(0,null,!1,!0),t.processY(M,0,!0)):f?(y.processY(-D,0,!1,!0),t.processY(D,0,!0)):(y.processY(-D,null,!1,!0),t.processY(D,y.velocity.y,!0)):I===2?v?(y.processY(-M,0,!1,!0),t.processY(0,null,!0)):c?(y.processY(-D,0,!1,!0),t.processY(D,0,!0)):(y.processY(-D,t.velocity.y,!1,!0),t.processY(D,null,!0)):I===3&&(s?(y.processY(0,null,!0),t.processY(-M,0,!1,!0)):u?(y.processY(D,0,!0),t.processY(-D,0,!1,!0)):(y.processY(D,t.velocity.y,!0),t.processY(-D,null,!1,!0)))}return!0},L=function(I){I===1?t.velocity.y=0:m?t.processY(M,n,!0):t.processY(-M,n,!1,!0),y.moves&&(t.x+=(y.x-y.prev.x)*y.friction.x,t._dx=t.x-t.prev.x)},O=function(I){I===2?y.velocity.y=0:S?y.processY(M,l,!0):y.processY(-M,l,!1,!0),t.moves&&(y.x+=(t.x-t.prev.x)*t.friction.x,y._dx=y.x-y.prev.x)};a.exports={BlockCheck:C,Check:w,Set:A,Run:P,RunImmovableBody1:L,RunImmovableBody2:O}},14087:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(64897),p=t(3017),h=function(o,l,n,u,f){f===void 0&&(f=r(o,l,n,u));var s=o.immovable,c=l.immovable;if(n||f===0||s&&c||o.customSeparateX||l.customSeparateX)return f!==0||o.embedded&&l.embedded;var d=p.Set(o,l,f);return!s&&!c?d>0?!0:p.Check():(s?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};a.exports=h},89936:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45170),p=t(47962),h=function(o,l,n,u,f){f===void 0&&(f=r(o,l,n,u));var s=o.immovable,c=l.immovable;if(n||f===0||s&&c||o.customSeparateY||l.customSeparateY)return f!==0||o.embedded&&l.embedded;var d=p.Set(o,l,f);return!s&&!c?d>0?!0:p.Check():(s?p.RunImmovableBody1(d):c&&p.RunImmovableBody2(d),!0)};a.exports=h},95829:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===void 0&&(r={}),r.none=t,r.up=!1,r.down=!1,r.left=!1,r.right=!1,t||(r.up=!0,r.down=!0,r.left=!0,r.right=!0),r};a.exports=y},72624:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87902),p=t(83419),h=t(78389),o=t(37747),l=t(37303),n=t(95829),u=t(26099),f=new p({Mixins:[h],initialize:function(c,d){var v=64,m=64,S={x:0,y:0,angle:0,rotation:0,scaleX:1,scaleY:1,displayOriginX:0,displayOriginY:0},M=d!==void 0;M&&d.displayWidth&&(v=d.displayWidth,m=d.displayHeight),M||(d=S),this.world=c,this.gameObject=M?d:void 0,this.isBody=!0,this.debugShowBody=c.defaults.debugShowStaticBody,this.debugBodyColor=c.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new u,this.position=new u(d.x-v*d.originX,d.y-m*d.originY),this.width=v,this.height=m,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new u(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=u.ZERO,this.allowGravity=!1,this.gravity=u.ZERO,this.bounce=u.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision=n(!1),this.touching=n(!0),this.wasTouching=n(!0),this.blocked=n(!0),this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,this._dx=0,this._dy=0},setGameObject:function(s,c){return s&&s!==this.gameObject&&(this.gameObject.body=null,s.body=this,this.gameObject=s),c&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var s=this.gameObject;return s.getTopLeft(this.position),this.width=s.displayWidth,this.height=s.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(s,c){return c===void 0&&(c=s),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s,c),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(s,c,d){d===void 0&&(d=!0);var v=this.gameObject;if(v&&v.frame&&(s||(s=v.frame.realWidth),c||(c=v.frame.realHeight)),this.world.staticTree.remove(this),this.width=s,this.height=c,this.halfWidth=Math.floor(s/2),this.halfHeight=Math.floor(c/2),d&&v&&v.getCenter){var m=v.displayWidth/2,S=v.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(m-this.halfWidth,S-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(s,c,d){return c===void 0&&(c=this.offset.x),d===void 0&&(d=this.offset.y),s>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=s,this.width=s*2,this.height=s*2,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(c,d),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(s,c){var d=this.gameObject;s===void 0&&(s=d.x),c===void 0&&(c=d.y),this.world.staticTree.remove(this),d.setPosition(s,c),d.getTopLeft(this.position),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(s){return s.x=this.x,s.y=this.y,s.right=this.right,s.bottom=this.bottom,s},hitTest:function(s,c){return this.isCircle?r(this,s,c):l(this,s,c)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(s){var c=this.position,d=c.x+this.halfWidth,v=c.y+this.halfHeight;this.debugShowBody&&(s.lineStyle(s.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?s.strokeCircle(d,v,this.width/2):s.strokeRect(c.x,c.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(s){return s<=0&&(s=.1),this.mass=s,this},x:{get:function(){return this.position.x},set:function(s){this.world.staticTree.remove(this),this.position.x=s,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(s){this.world.staticTree.remove(this),this.position.y=s,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});a.exports=f},71464:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13759),p=t(83419),h=t(78389),o=t(37747),l=t(95540),n=t(26479),u=t(41212),f=new p({Extends:n,Mixins:[h],initialize:function(c,d,v,m){!v&&!m?m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:r}:u(v)?(m=v,v=null,m.internalCreateCallback=this.createCallbackHandler,m.internalRemoveCallback=this.removeCallbackHandler,m.createMultipleCallback=this.createMultipleCallbackHandler,m.classType=l(m,"classType",r)):Array.isArray(v)&&u(v[0])?(m=v,v=null,m.forEach(function(S){S.internalCreateCallback=this.createCallbackHandler,S.internalRemoveCallback=this.removeCallbackHandler,S.createMultipleCallback=this.createMultipleCallbackHandler,S.classType=l(S,"classType",r)})):m={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler},this.world=c,this.physicsType=o.STATIC_BODY,this.collisionCategory=1,this.collisionMask=1,n.call(this,d,v,m),this.type="StaticPhysicsGroup"},createCallbackHandler:function(s){s.body||this.world.enableBody(s,o.STATIC_BODY)},removeCallbackHandler:function(s){s.body&&this.world.disableBody(s)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var s=this.children.entries,c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(55495),p=t(37742),h=t(45319),o=t(83419),l=t(79342),n=t(37747),u=t(20339),f=t(52816),s=t(50792),c=t(63012),d=t(43855),v=t(5470),m=t(94977),S=t(64897),M=t(45170),A=t(96523),C=t(35154),w=t(36383),P=t(25774),L=t(96602),O=t(87841),I=t(59542),D=t(40012),B=t(14087),G=t(89936),z=t(35072),W=t(72624),k=t(2483),J=t(61340),Q=t(26099),Y=t(15994),K=new o({Extends:s,initialize:function(V,j){s.call(this),this.scene=V,this.bodies=new z,this.staticBodies=new z,this.pendingDestroy=new z,this.colliders=new P,this.gravity=new Q(C(j,"gravity.x",0),C(j,"gravity.y",0)),this.bounds=new O(C(j,"x",0),C(j,"y",0),C(j,"width",V.sys.scale.width),C(j,"height",V.sys.scale.height)),this.checkCollision={up:C(j,"checkCollision.up",!0),down:C(j,"checkCollision.down",!0),left:C(j,"checkCollision.left",!0),right:C(j,"checkCollision.right",!0)},this.fps=C(j,"fps",60),this.fixedStep=C(j,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=C(j,"timeScale",1),this.OVERLAP_BIAS=C(j,"overlapBias",4),this.TILE_BIAS=C(j,"tileBias",16),this.forceX=C(j,"forceX",!1),this.isPaused=C(j,"isPaused",!1),this._total=0,this.drawDebug=C(j,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:C(j,"debugShowBody",!0),debugShowStaticBody:C(j,"debugShowStaticBody",!0),debugShowVelocity:C(j,"debugShowVelocity",!0),bodyDebugColor:C(j,"debugBodyColor",16711935),staticBodyDebugColor:C(j,"debugStaticBodyColor",255),velocityDebugColor:C(j,"debugVelocityColor",65280)},this.maxEntries=C(j,"maxEntries",16),this.useTree=C(j,"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(U,V){V===void 0&&(V=n.DYNAMIC_BODY),Array.isArray(U)||(U=[U]);for(var j=0;j=q;for(this.fixedStep||($=V*.001,et=!0,this._elapsed=0),j=0;j=q;)this._elapsed-=q,this.step($)}},step:function(U){var V,j,$=this.bodies.entries,q=$.length;for(V=0;V0){var ht=this.tree,ut=this.staticTree;for(j=et.entries,$=j.length,U=0;U<$;U++)V=j[U],V.physicsType===n.DYNAMIC_BODY?(ht.remove(V),q.delete(V)):V.physicsType===n.STATIC_BODY&&(ut.remove(V),it.delete(V)),V.world=void 0,V.gameObject=void 0;et.clear()}},updateMotion:function(U,V){U.allowRotation&&this.computeAngularVelocity(U,V),this.computeVelocity(U,V)},computeAngularVelocity:function(U,V){var j=U.angularVelocity,$=U.angularAcceleration,q=U.angularDrag,it=U.maxAngular;$?j+=$*V:U.allowDrag&&q&&(q*=V,v(j-q,0,.1)?j-=q:m(j+q,0,.1)?j+=q:j=0),j=h(j,-it,it);var nt=j-U.angularVelocity;U.angularVelocity+=nt,U.rotation+=U.angularVelocity*V},computeVelocity:function(U,V){var j=U.velocity.x,$=U.acceleration.x,q=U.drag.x,it=U.maxVelocity.x,nt=U.velocity.y,et=U.acceleration.y,ht=U.drag.y,ut=U.maxVelocity.y,dt=U.speed,mt=U.maxSpeed,gt=U.allowDrag,At=U.useDamping;U.allowGravity&&(j+=(this.gravity.x+U.gravity.x)*V,nt+=(this.gravity.y+U.gravity.y)*V),$?j+=$*V:gt&&q&&(At?(q=Math.pow(q,V),j*=q,dt=Math.sqrt(j*j+nt*nt),d(dt,0,.001)&&(j=0)):(q*=V,v(j-q,0,.01)?j-=q:m(j+q,0,.01)?j+=q:j=0)),et?nt+=et*V:gt&&ht&&(At?(ht=Math.pow(ht,V),nt*=ht,dt=Math.sqrt(j*j+nt*nt),d(dt,0,.001)&&(nt=0)):(ht*=V,v(nt-ht,0,.01)?nt-=ht:m(nt+ht,0,.01)?nt+=ht:nt=0)),j=h(j,-it,it),nt=h(nt,-ut,ut),U.velocity.set(j,nt),mt>-1&&U.velocity.length()>mt&&(U.velocity.normalize().scale(mt),dt=mt),U.speed=dt},separate:function(U,V,j,$,q){var it,nt,et=!1,ht=!0;if(!U.enable||!V.enable||U.checkCollision.none||V.checkCollision.none||!this.intersects(U,V)||j&&j.call($,U.gameObject,V.gameObject)===!1)return et;if(U.isCircle||V.isCircle){var ut=this.separateCircle(U,V,q);ut.result?(et=!0,ht=!1):(it=ut.x,nt=ut.y,ht=!0)}if(ht){var dt=!1,mt=!1,gt=this.OVERLAP_BIAS;q?(dt=B(U,V,q,gt,it),mt=G(U,V,q,gt,nt)):this.forceX||Math.abs(this.gravity.y+U.gravity.y)wt&&(mt=u(At,ot,wt,Tt)-st):ot>Et&&(Atwt&&(mt=u(At,ot,wt,Et)-st)),mt*=-1}else mt=U.halfWidth+V.halfWidth-f(it,nt);U.overlapR=mt,V.overlapR=mt;var Gt=r(it,nt),Wt=(mt+w.EPSILON)*Math.cos(Gt),Jt=(mt+w.EPSILON)*Math.sin(Gt),$t={overlap:mt,result:!1,x:Wt,y:Jt};if(j&&(!gt||gt&&mt!==0))return $t.result=!0,$t;if(!gt&&mt===0||et&&ht||U.customSeparateX||V.customSeparateX)return $t.x=void 0,$t.y=void 0,$t;var ee=!U.pushable&&!V.pushable;if(gt){var Nt=it.x-nt.x,Te=it.y-nt.y,le=Math.sqrt(Math.pow(Nt,2)+Math.pow(Te,2)),ce=(nt.x-it.x)/le||0,se=(nt.y-it.y)/le||0,ie=2*(ut.x*ce+ut.y*se-dt.x*ce-dt.y*se)/(U.mass+V.mass);(et||ht)&&(ie*=2),et||(ut.x=ut.x-ie/U.mass*ce,ut.y=ut.y-ie/U.mass*se,ut.multiply(U.bounce)),ht||(dt.x=dt.x+ie/V.mass*ce,dt.y=dt.y+ie/V.mass*se,dt.multiply(V.bounce)),!et&&!ht&&(Wt*=.5,Jt*=.5),et||(U.x-=Wt,U.y-=Jt,U.updateCenter()),ht||(V.x+=Wt,V.y+=Jt,V.updateCenter()),$t.result=!0}else!et||U.pushable||ee?(U.x-=Wt,U.y-=Jt,U.updateCenter()):(!ht||V.pushable||ee)&&(V.x+=Wt,V.y+=Jt,V.updateCenter()),$t.x=void 0,$t.y=void 0;return $t},intersects:function(U,V){return U===V?!1:!U.isCircle&&!V.isCircle?!(U.right<=V.left||U.bottom<=V.top||U.left>=V.right||U.top>=V.bottom):U.isCircle?V.isCircle?f(U.center,V.center)<=U.halfWidth+V.halfWidth:this.circleBodyIntersects(U,V):this.circleBodyIntersects(V,U)},circleBodyIntersects:function(U,V){var j=h(U.center.x,V.left,V.right),$=h(U.center.y,V.top,V.bottom),q=(U.center.x-j)*(U.center.x-j),it=(U.center.y-$)*(U.center.y-$);return q+it<=U.halfWidth*U.halfWidth},overlap:function(U,V,j,$,q){return j===void 0&&(j=null),$===void 0&&($=null),q===void 0&&(q=j),this.collideObjects(U,V,j,$,q,!0)},collide:function(U,V,j,$,q){return j===void 0&&(j=null),$===void 0&&($=null),q===void 0&&(q=j),this.collideObjects(U,V,j,$,q,!1)},collideObjects:function(U,V,j,$,q,it){var nt,et;U.isParent&&(U.physicsType===void 0||V===void 0||U===V)&&(U=U.children.entries),V&&V.isParent&&V.physicsType===void 0&&(V=V.children.entries);var ht=Array.isArray(U),ut=Array.isArray(V);if(this._total=0,!ht&&!ut)this.collideHandler(U,V,j,$,q,it);else if(!ht&&ut)for(nt=0;nt0},collideHandler:function(U,V,j,$,q,it){if(V===void 0&&U.isParent)return this.collideGroupVsGroup(U,U,j,$,q,it);if(!U||!V)return!1;if(U.body||U.isBody){if(V.body||V.isBody)return this.collideSpriteVsSprite(U,V,j,$,q,it);if(V.isParent)return this.collideSpriteVsGroup(U,V,j,$,q,it);if(V.isTilemap)return this.collideSpriteVsTilemapLayer(U,V,j,$,q,it)}else if(U.isParent){if(V.body||V.isBody)return this.collideSpriteVsGroup(V,U,j,$,q,it);if(V.isParent)return this.collideGroupVsGroup(U,V,j,$,q,it);if(V.isTilemap)return this.collideGroupVsTilemapLayer(U,V,j,$,q,it)}else if(U.isTilemap){if(V.body||V.isBody)return this.collideSpriteVsTilemapLayer(V,U,j,$,q,it);if(V.isParent)return this.collideGroupVsTilemapLayer(V,U,j,$,q,it)}},canCollide:function(U,V){return U&&V&&(U.collisionMask&V.collisionCategory)!==0&&(V.collisionMask&U.collisionCategory)!==0},collideSpriteVsSprite:function(U,V,j,$,q,it){var nt=U.isBody?U:U.body,et=V.isBody?V:V.body;return this.canCollide(nt,et)?(this.separate(nt,et,$,q,it)&&(j&&j.call(q,U,V),this._total++),!0):!1},collideSpriteVsGroup:function(U,V,j,$,q,it){var nt=U.isBody?U:U.body;if(!(V.length===0||!nt||!nt.enable||nt.checkCollision.none||!this.canCollide(nt,V))){var et,ht,ut;if(this.useTree||V.physicsType===n.STATIC_BODY){var dt=this.treeMinMax;dt.minX=nt.left,dt.minY=nt.top,dt.maxX=nt.right,dt.maxY=nt.bottom;var mt=V.physicsType===n.DYNAMIC_BODY?this.tree.search(dt):this.staticTree.search(dt);for(ht=mt.length,et=0;et{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setAcceleration:function(t,r){return this.body.acceleration.set(t,r),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}};a.exports=y},59023:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}};a.exports=y},62069:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setBounce:function(t,r){return this.body.bounce.set(t,r),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,r,p,h){return this.body.setCollideWorldBounds(t,r,p,h),this}};a.exports=y},78389:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79599),p={setCollisionCategory:function(h){var o=this.body?this.body:this;return o.collisionCategory=h,this},willCollideWith:function(h){var o=this.body?this.body:this;return(o.collisionMask&h)!==0},addCollidesWith:function(h){var o=this.body?this.body:this;return o.collisionMask=o.collisionMask|h,this},removeCollidesWith:function(h){var o=this.body?this.body:this;return o.collisionMask=o.collisionMask&~h,this},setCollidesWith:function(h){var o=this.body?this.body:this;return o.collisionMask=r(h),this},resetCollisionCategory:function(){var h=this.body?this.body:this;return h.collisionCategory=1,h.collisionMask=1,this}};a.exports=p},87118:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setDebug:function(t,r,p){return this.debugShowBody=t,this.debugShowVelocity=r,this.debugBodyColor=p,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}};a.exports=y},52819:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setDrag:function(t,r){return this.body.drag.set(t,r),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}};a.exports=y},4074:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setDirectControl:function(t){return this.body.setDirectControl(t),this},enableBody:function(t,r,p,h,o){return t&&this.body.reset(r,p),h&&(this.body.gameObject.active=!0),o&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,r){return t===void 0&&(t=!1),r===void 0&&(r=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),r&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};a.exports=y},40831:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setFriction:function(t,r){return this.body.friction.set(t,r),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}};a.exports=y},26775:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setGravity:function(t,r){return this.body.gravity.set(t,r),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}};a.exports=y},9437:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setImmovable:function(t){return t===void 0&&(t=!0),this.body.immovable=t,this}};a.exports=y},30621:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setMass:function(t){return this.body.mass=t,this}};a.exports=y},72441:(a,y,t)=>{var r=t(47956),p=t(96503),h=t(2044),o=t(81491),l=function(n,u,f,s,c,d){var v=r(n,u-s,f-s,2*s,2*s,c,d);if(v.length===0)return v;for(var m=new p(u,f,s),S=new p,M=[],A=0;A{var y=function(t,r,p,h,o,l,n){l===void 0&&(l=!0),n===void 0&&(n=!1);var u=[],f=[],s=t.treeMinMax;if(s.minX=r,s.minY=p,s.maxX=r+h,s.maxY=p+o,n&&(f=t.staticTree.search(s)),l&&t.useTree)u=t.tree.search(s);else if(l){var c=t.bodies,d={position:{x:r,y:p},left:r,top:p,right:r+h,bottom:p+o,isCircle:!1},v=t.intersects;c.iterate(function(m){v(m,d)&&u.push(m)})}return f.concat(u)};a.exports=y},62121:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setPushable:function(t){return t===void 0&&(t=!0),this.body.pushable=t,this}};a.exports=y},29384:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setOffset:function(t,r){return this.body.setOffset(t,r),this},setSize:function(t,r,p){return this.body.setSize(t,r,p),this},setBodySize:function(t,r,p){return this.body.setSize(t,r,p),this},setCircle:function(t,r,p){return this.body.setCircle(t,r,p),this}};a.exports=y},15098:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setVelocity:function(t,r){return this.body.setVelocity(t,r),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,r){return this.body.maxVelocity.set(t,r),this}};a.exports=y},92209:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Acceleration:t(1093),Angular:t(59023),Bounce:t(62069),Collision:t(78389),Debug:t(87118),Drag:t(52819),Enable:t(4074),Friction:t(40831),Gravity:t(26775),Immovable:t(9437),Mass:t(30621),OverlapCirc:t(72441),OverlapRect:t(47956),Pushable:t(62121),Size:t(29384),Velocity:t(15098)}},37747:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14};a.exports=y},20009:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="collide"},36768:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="overlap"},60473:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},89954:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},61804:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="tilecollide"},7161:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="tileoverlap"},34689:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="worldbounds"},16006:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="worldstep"},63012:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={COLLIDE:t(20009),OVERLAP:t(36768),PAUSE:t(60473),RESUME:t(89954),TILE_COLLIDE:t(61804),TILE_OVERLAP:t(7161),WORLD_BOUNDS:t(34689),WORLD_STEP:t(16006)}},27064:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37747),p=t(79291),h={ArcadePhysics:t(86689),Body:t(37742),Collider:t(79342),Components:t(92209),Events:t(63012),Factory:t(66022),GetCollidesWith:t(79599),GetOverlapX:t(64897),GetOverlapY:t(45170),SeparateX:t(14087),SeparateY:t(89936),Group:t(60758),Image:t(71289),Sprite:t(13759),StaticBody:t(72624),StaticGroup:t(71464),Tilemap:t(55173),World:t(82248)};h=p(!1,h,r),a.exports=h},96602:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,r,t):t.layer.callbacks[t.index]?!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,r,t):!0};a.exports=y},36294:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r<0?(t.blocked.none=!1,t.blocked.left=!0):r>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=r,t.updateCenter(),t.bounce.x===0?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x};a.exports=y},67013:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r<0?(t.blocked.none=!1,t.blocked.up=!0):r>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=r,t.updateCenter(),t.bounce.y===0?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y};a.exports=y},40012:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(21329),p=t(53442),h=t(2483),o=function(l,n,u,f,s,c,d){var v=f.left,m=f.top,S=f.right,M=f.bottom,A=u.faceLeft||u.faceRight,C=u.faceTop||u.faceBottom;if(d||(A=!0,C=!0),!A&&!C)return!1;var w=0,P=0,L=0,O=1;if(n.deltaAbsX()>n.deltaAbsY()?L=-1:n.deltaAbsX(){/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36294),p=function(h,o,l,n,u,f){var s=0,c=o.faceLeft,d=o.faceRight,v=o.collideLeft,m=o.collideRight;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaX()<0&&m&&h.checkCollision.left?d&&h.x0&&v&&h.checkCollision.right&&c&&h.right>l&&(s=h.right-l,s>u&&(s=0)),s!==0&&(h.customSeparateX?h.overlapX=s:r(h,s)),s};a.exports=p},53442:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(67013),p=function(h,o,l,n,u,f){var s=0,c=o.faceTop,d=o.faceBottom,v=o.collideUp,m=o.collideDown;return f||(c=!0,d=!0,v=!0,m=!0),h.deltaY()<0&&m&&h.checkCollision.up?d&&h.y0&&v&&h.checkCollision.down&&c&&h.bottom>l&&(s=h.bottom-l,s>u&&(s=0)),s!==0&&(h.customSeparateY?h.overlapY=s:r(h,s)),s};a.exports=p},2483:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return!(r.right<=t.left||r.bottom<=t.top||r.position.x>=t.right||r.position.y>=t.bottom)};a.exports=y},55173:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={ProcessTileCallbacks:t(96602),ProcessTileSeparationX:t(36294),ProcessTileSeparationY:t(67013),SeparateTile:t(40012),TileCheckX:t(21329),TileCheckY:t(53442),TileIntersectsBody:t(2483)};a.exports=r},44563:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Arcade:t(27064),Matter:t(3875)}},68174:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(26099),h=new r({initialize:function(){this.boundsCenter=new p,this.centerDiff=new p},parseBody:function(o){if(o=o.hasOwnProperty("body")?o.body:o,!o.hasOwnProperty("bounds")||!o.hasOwnProperty("centerOfMass"))return!1;var l=this.boundsCenter,n=this.centerDiff,u=o.bounds.max.x-o.bounds.min.x,f=o.bounds.max.y-o.bounds.min.y,s=u*o.centerOfMass.x,c=f*o.centerOfMass.y;return l.set(u/2,f/2),n.set(s-l.x,c-l.y),!0},getTopLeft:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+u.y+f.y)}return!1},getTopCenter:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n+u.y+f.y)}return!1},getTopRight:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+u.y+f.y)}return!1},getLeftCenter:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n+f.y)}return!1},getCenter:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.centerDiff;return new p(l+u.x,n+u.y)}return!1},getRightCenter:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n+f.y)}return!1},getBottomLeft:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+u.x+f.x,n-(u.y-f.y))}return!1},getBottomCenter:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l+f.x,n-(u.y-f.y))}return!1},getBottomRight:function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),this.parseBody(o)){var u=this.boundsCenter,f=this.centerDiff;return new p(l-(u.x-f.x),n-(u.y-f.y))}return!1}});a.exports=h},19933:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6790);r.Body=t(22562),r.Composite=t(69351),r.World=t(4372),r.Collision=t(52284),r.Detector=t(81388),r.Pairs=t(99561),r.Pair=t(4506),r.Query=t(73296),r.Resolver=t(66272),r.Constraint=t(48140),r.Common=t(53402),r.Engine=t(48413),r.Events=t(35810),r.Sleeping=t(53614),r.Plugin=t(73832),r.Bodies=t(66280),r.Composites=t(74116),r.Axes=t(66615),r.Bounds=t(15647),r.Svg=t(74058),r.Vector=t(31725),r.Vertices=t(41598),r.World.add=r.Composite.add,r.World.remove=r.Composite.remove,r.World.addComposite=r.Composite.addComposite,r.World.addBody=r.Composite.addBody,r.World.addConstraint=r.Composite.addConstraint,r.World.clear=r.Composite.clear,a.exports=r},28137:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66280),p=t(83419),h=t(74116),o=t(48140),l=t(74058),n=t(75803),u=t(23181),f=t(34803),s=t(73834),c=t(19496),d=t(85791),v=t(98713),m=t(41598),S=new p({initialize:function(A){this.world=A,this.scene=A.scene,this.sys=A.scene.sys},rectangle:function(M,A,C,w,P){var L=r.rectangle(M,A,C,w,P);return this.world.add(L),L},trapezoid:function(M,A,C,w,P,L){var O=r.trapezoid(M,A,C,w,P,L);return this.world.add(O),O},circle:function(M,A,C,w,P){var L=r.circle(M,A,C,w,P);return this.world.add(L),L},polygon:function(M,A,C,w,P){var L=r.polygon(M,A,C,w,P);return this.world.add(L),L},fromVertices:function(M,A,C,w,P,L,O){typeof C=="string"&&(C=m.fromPath(C));var I=r.fromVertices(M,A,C,w,P,L,O);return this.world.add(I),I},fromPhysicsEditor:function(M,A,C,w,P){P===void 0&&(P=!0);var L=c.parseBody(M,A,C,w);return P&&!this.world.has(L)&&this.world.add(L),L},fromSVG:function(M,A,C,w,P,L){w===void 0&&(w=1),P===void 0&&(P={}),L===void 0&&(L=!0);for(var O=C.getElementsByTagName("path"),I=[],D=0;D{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(31884),p=t(95540),h=t(26099);function o(n){return!!n.get&&typeof n.get=="function"||!!n.set&&typeof n.set=="function"}var l=function(n,u,f,s){f===void 0&&(f={}),s===void 0&&(s=!0);var c=u.x,d=u.y;u.body={temp:!0,position:{x:c,y:d}};var v=[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity];if(v.forEach(function(S){for(var M in S)o(S[M])?Object.defineProperty(u,M,{get:S[M].get,set:S[M].set}):Object.defineProperty(u,M,{value:S[M]})}),u.world=n,u._tempVec2=new h(c,d),f.hasOwnProperty("type")&&f.type==="body")u.setExistingBody(f,s);else{var m=p(f,"shape",null);m||(m="rectangle"),f.addToWorld=s,u.setBody(m,f)}return u};a.exports=l},23181:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31884),h=t(95643),o=t(95540),l=t(88571),n=t(72699),u=t(26099),f=new r({Extends:l,Mixins:[p.Bounce,p.Collision,p.Force,p.Friction,p.Gravity,p.Mass,p.Sensor,p.SetBody,p.Sleep,p.Static,p.Transform,p.Velocity,n],initialize:function(c,d,v,m,S,M){h.call(this,c.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(m,S),this.setSizeToFrame(),this.setOrigin(),this.world=c,this._tempVec2=new u(d,v);var A=o(M,"shape",null);A?this.setBody(A,M):this.setRectangle(this.width,this.height,M),this.setPosition(d,v),this.initPipeline(),this.initPostPipeline(!0)}});a.exports=f},42045:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(60461),p=t(66615),h=t(66280),o=t(22562),l=t(68174),n=t(15647),u=t(83419),f=t(52284),s=t(53402),c=t(69351),d=t(74116),v=t(48140),m=t(81388),S=t(20339),M=t(28137),A=t(95540),C=t(35154),w=t(18210),P=t(40178),L=t(6790),O=t(74507),I=t(46975),D=t(4506),B=t(99561),G=t(73832),z=t(37277),W=t(73296),k=t(66272),J=t(44594),Q=t(74058),Y=t(31725),K=t(41598),U=t(68243);s.setDecomp(t(55973));var V=new u({initialize:function($){this.scene=$,this.systems=$.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=c,this.collision=f,this.detector=m,this.pair=D,this.pairs=B,this.query=W,this.resolver=k,this.constraint=v,this.bodies=h,this.composites=d,this.axes=p,this.bounds=n,this.svg=Q,this.vector=Y,this.vertices=K,this.verts=K,this._tempVec2=Y.create(),C(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),C(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),C(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),k._restingThresh=C(this.config,"restingThresh",4),k._restingThreshTangent=C(this.config,"restingThreshTangent",6),k._positionDampen=C(this.config,"positionDampen",.9),k._positionWarming=C(this.config,"positionWarming",.8),k._frictionNormalMultiplier=C(this.config,"frictionNormalMultiplier",5),$.sys.events.once(J.BOOT,this.boot,this),$.sys.events.on(J.START,this.start,this)},boot:function(){this.world=new U(this.scene,this.config),this.add=new M(this.world),this.bodyBounds=new l,this.systems.events.once(J.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new U(this.scene,this.config),this.add=new M(this.world));var j=this.systems.events;j.on(J.UPDATE,this.world.update,this.world),j.on(J.POST_UPDATE,this.world.postUpdate,this.world),j.once(J.SHUTDOWN,this.shutdown,this)},getConfig:function(){var j=this.systems.game.config.physics,$=this.systems.settings.physics,q=I(A($,"matter",{}),A(j,"matter",{}));return q},enableAttractorPlugin:function(){return G.register(w),G.use(L,w),this},enableWrapPlugin:function(){return G.register(O),G.use(L,O),this},enableCollisionEventsPlugin:function(){return G.register(P),G.use(L,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(j,$){this.world.step(j,$)},containsPoint:function(j,$,q){j=this.getMatterBodies(j);var it=Y.create($,q),nt=W.point(j,it);return nt.length>0},intersectPoint:function(j,$,q){q=this.getMatterBodies(q);var it=Y.create(j,$),nt=[],et=W.point(q,it);return et.forEach(function(ht){nt.indexOf(ht)===-1&&nt.push(ht)}),nt},intersectRect:function(j,$,q,it,nt,et){nt===void 0&&(nt=!1),et=this.getMatterBodies(et);var ht={min:{x:j,y:$},max:{x:j+q,y:$+it}},ut=[],dt=W.region(et,ht,nt);return dt.forEach(function(mt){ut.indexOf(mt)===-1&&ut.push(mt)}),ut},intersectRay:function(j,$,q,it,nt,et){nt===void 0&&(nt=1),et=this.getMatterBodies(et);for(var ht=[],ut=W.ray(et,Y.create(j,$),Y.create(q,it),nt),dt=0;dt{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(9674),p=t(83419),h=t(31884),o=t(95643),l=t(95540),n=t(72699),u=t(68287),f=t(26099),s=new p({Extends:u,Mixins:[h.Bounce,h.Collision,h.Force,h.Friction,h.Gravity,h.Mass,h.Sensor,h.SetBody,h.Sleep,h.Static,h.Transform,h.Velocity,n],initialize:function(d,v,m,S,M,A){o.call(this,d.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(S,M),this.setSizeToFrame(),this.setOrigin(),this.world=d,this._tempVec2=new f(v,m);var C=l(A,"shape",null);C?this.setBody(C,A):this.setRectangle(this.width,this.height,A),this.setPosition(v,m),this.initPipeline(),this.initPostPipeline(!0)}});a.exports=s},73834:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66280),p=t(22562),h=t(83419),o=t(31884),l=t(62644),n=t(50792),u=t(95540),f=t(97022),s=t(41598),c=new h({Extends:n,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(v,m,S){n.call(this),this.tile=m,this.world=v,m.physics.matterBody&&m.physics.matterBody.destroy(),m.physics.matterBody=this;var M=u(S,"body",null),A=u(S,"addToWorld",!0);if(M)this.setBody(M,A);else{var C=m.getCollisionGroup(),w=u(C,"objects",[]);w.length>0?this.setFromTileCollision(S):this.setFromTileRectangle(S)}if(m.flipX||m.flipY){var P={x:m.getCenterX(),y:m.getCenterY()},L=m.flipX?-1:1,O=m.flipY?-1:1;p.scale(M,L,O,P)}},setFromTileRectangle:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);var v=this.tile.getBounds(),m=v.x+v.width/2,S=v.y+v.height/2,M=r.rectangle(m,S,v.width,v.height,d);return this.setBody(M,d.addToWorld),this},setFromTileCollision:function(d){d===void 0&&(d={}),f(d,"isStatic")||(d.isStatic=!0),f(d,"addToWorld")||(d.addToWorld=!0);for(var v=this.tile.tilemapLayer.scaleX,m=this.tile.tilemapLayer.scaleY,S=this.tile.getLeft(),M=this.tile.getTop(),A=this.tile.getCollisionGroup(),C=u(A,"objects",[]),w=[],P=0;P1){var Q=l(d);Q.parts=w,this.setBody(p.create(Q),Q.addToWorld)}return this},setBody:function(d,v){return v===void 0&&(v=!0),this.body&&this.removeBody(),this.body=d,this.body.gameObject=this,v&&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()}});a.exports=c},19496:(a,y,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 r=t(66280),p=t(22562),h=t(53402),o=t(95540),l=t(41598),n={parseBody:function(u,f,s,c){c===void 0&&(c={});for(var d=o(s,"fixtures",[]),v=[],m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66280),p=t(22562),h={parseBody:function(o,l,n,u){u===void 0&&(u={});var f,s=n.vertices;if(s.length===1)u.vertices=s[0],f=p.create(u),r.flagCoincidentParts(f.parts);else{for(var c=[],d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(15647),p=t(83419),h=t(69351),o=t(48140),l=t(81388),n=t(1121),u=t(8214),f=t(46975),s=t(53614),c=t(26099),d=t(41598),v=new p({initialize:function(S,M,A){A===void 0&&(A={});var C={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=S,this.world=M,this.camera=null,this.pointer=null,this.active=!0,this.position=new c,this.body=null,this.part=null,this.constraint=o.create(f(A,C)),this.world.on(n.BEFORE_UPDATE,this.update,this),S.sys.input.on(u.POINTER_DOWN,this.onDown,this),S.sys.input.on(u.POINTER_UP,this.onUp,this)},onDown:function(m){this.pointer||(this.pointer=m,this.camera=m.camera)},onUp:function(m){m===this.pointer&&(this.pointer=null)},getBody:function(m){var S=this.position,M=this.constraint;this.camera.getWorldPoint(m.x,m.y,S);for(var A=h.allBodies(this.world.localWorld),C=0;C1?1:0,w=C;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66280),p=t(22562),h=t(83419),o=t(53402),l=t(69351),n=t(48413),u=t(50792),f=t(1121),s=t(95540),c=t(35154),d=t(22562),v=t(35810),m=t(73834),S=t(4372),M=t(31725),A=new h({Extends:u,initialize:function(w,P){u.call(this),this.scene=w,this.engine=n.create(P),this.localWorld=this.engine.world;var L=c(P,"gravity",null);L?this.setGravity(L.x,L.y,L.scale):L===!1&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=c(P,"enabled",!0),this.getDelta=c(P,"getDelta",this.update60Hz);var O=s(P,"runner",{}),I=s(O,"fps",!1),D=s(O,"fps",60),B=s(O,"delta",1e3/D),G=s(O,"deltaMin",1e3/D),z=s(O,"deltaMax",1e3/(D*.5));I||(D=1e3/B),this.runner={fps:D,deltaSampleSize:s(O,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:s(O,"isFixed",!1),delta:B,deltaMin:G,deltaMax:z},this.autoUpdate=c(P,"autoUpdate",!0);var W=c(P,"debug",!1);if(this.drawDebug=typeof W=="object"?!0:W,this.debugGraphic,this.debugConfig={showAxes:s(W,"showAxes",!1),showAngleIndicator:s(W,"showAngleIndicator",!1),angleColor:s(W,"angleColor",15208787),showBroadphase:s(W,"showBroadphase",!1),broadphaseColor:s(W,"broadphaseColor",16757760),showBounds:s(W,"showBounds",!1),boundsColor:s(W,"boundsColor",16777215),showVelocity:s(W,"showVelocity",!1),velocityColor:s(W,"velocityColor",44783),showCollisions:s(W,"showCollisions",!1),collisionColor:s(W,"collisionColor",16094476),showSeparations:s(W,"showSeparations",!1),separationColor:s(W,"separationColor",16753920),showBody:s(W,"showBody",!0),showStaticBody:s(W,"showStaticBody",!0),showInternalEdges:s(W,"showInternalEdges",!1),renderFill:s(W,"renderFill",!1),renderLine:s(W,"renderLine",!0),fillColor:s(W,"fillColor",1075465),fillOpacity:s(W,"fillOpacity",1),lineColor:s(W,"lineColor",2678297),lineOpacity:s(W,"lineOpacity",1),lineThickness:s(W,"lineThickness",1),staticFillColor:s(W,"staticFillColor",857979),staticLineColor:s(W,"staticLineColor",1255396),showSleeping:s(W,"showSleeping",!1),staticBodySleepOpacity:s(W,"staticBodySleepOpacity",.7),sleepFillColor:s(W,"sleepFillColor",4605510),sleepLineColor:s(W,"sleepLineColor",10066585),showSensors:s(W,"showSensors",!0),sensorFillColor:s(W,"sensorFillColor",857979),sensorLineColor:s(W,"sensorLineColor",1255396),showPositions:s(W,"showPositions",!0),positionSize:s(W,"positionSize",4),positionColor:s(W,"positionColor",14697178),showJoint:s(W,"showJoint",!0),jointColor:s(W,"jointColor",14737474),jointLineOpacity:s(W,"jointLineOpacity",1),jointLineThickness:s(W,"jointLineThickness",2),pinSize:s(W,"pinSize",4),pinColor:s(W,"pinColor",4382944),springColor:s(W,"springColor",14697184),anchorColor:s(W,"anchorColor",15724527),anchorSize:s(W,"anchorSize",4),showConvexHulls:s(W,"showConvexHulls",!1),hullColor:s(W,"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),Q=s(k,"y",0),Y=s(k,"width",w.sys.scale.width),K=s(k,"height",w.sys.scale.height),U=s(k,"thickness",64),V=s(k,"left",!0),j=s(k,"right",!0),$=s(k,"top",!0),q=s(k,"bottom",!0);this.setBounds(J,Q,Y,K,U,V,j,$,q)}}},setCompositeRenderStyle:function(C){var w=C.bodies,P=C.constraints,L=C.composites,O,I,D;for(O=0;O0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_START,L,I,D)}),v.on(w,"collisionActive",function(L){var O=L.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_ACTIVE,L,I,D)}),v.on(w,"collisionEnd",function(L){var O=L.pairs,I,D;O.length>0&&(I=O[0].bodyA,D=O[0].bodyB),C.emit(f.COLLISION_END,L,I,D)})},setBounds:function(C,w,P,L,O,I,D,B,G){return C===void 0&&(C=0),w===void 0&&(w=0),P===void 0&&(P=this.scene.sys.scale.width),L===void 0&&(L=this.scene.sys.scale.height),O===void 0&&(O=64),I===void 0&&(I=!0),D===void 0&&(D=!0),B===void 0&&(B=!0),G===void 0&&(G=!0),this.updateWall(I,"left",C-O,w-O,O,L+O*2),this.updateWall(D,"right",C+P,w-O,O,L+O*2),this.updateWall(B,"top",C,w-O,P,O),this.updateWall(G,"bottom",C,w+L,P,O),this},updateWall:function(C,w,P,L,O,I){var D=this.walls[w];C?(D&&S.remove(this.localWorld,D),P+=O/2,L+=I/2,this.walls[w]=this.create(P,L,O,I,{isStatic:!0,friction:0,frictionStatic:0})):(D&&S.remove(this.localWorld,D),this.walls[w]=null)},createDebugGraphic:function(){var C=this.scene.sys.add.graphics({x:0,y:0});return C.setDepth(Number.MAX_VALUE),this.debugGraphic=C,this.drawDebug=!0,C},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(C,w,P){return C===void 0&&(C=0),w===void 0&&(w=1),P===void 0&&(P=.001),this.localWorld.gravity.x=C,this.localWorld.gravity.y=w,this.localWorld.gravity.scale=P,this},create:function(C,w,P,L,O){var I=r.rectangle(C,w,P,L,O);return S.add(this.localWorld,I),I},add:function(C){return S.add(this.localWorld,C),this},remove:function(C,w){Array.isArray(C)||(C=[C]);for(var P=0;PL.deltaMax?L.deltaMax:w,L.delta=w),L.timeScalePrev=O.timeScale,L.frameCounter+=1,C-L.counterTimestamp>=1e3&&(L.fps=L.frameCounter*((C-L.counterTimestamp)/1e3),L.counterTimestamp=C,L.frameCounter=0),n.update(P,w)}},step:function(C){n.update(this.engine,C)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(C){var w=C.hasOwnProperty("body")?C.body:C;return l.get(this.localWorld,w.id,w.type)!==null},getAllBodies:function(){return l.allBodies(this.localWorld)},getAllConstraints:function(){return l.allConstraints(this.localWorld)},getAllComposites:function(){return l.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var C=this.debugConfig,w=this.engine,P=this.debugGraphic,L=l.allBodies(this.localWorld);this.debugGraphic.clear(),C.showBroadphase&&w.broadphase.controller&&this.renderGrid(w.broadphase,P,C.broadphaseColor,.5),C.showBounds&&this.renderBodyBounds(L,P,C.boundsColor,.5),(C.showBody||C.showStaticBody)&&this.renderBodies(L),C.showJoint&&this.renderJoints(),(C.showAxes||C.showAngleIndicator)&&this.renderBodyAxes(L,P,C.showAxes,C.angleColor,.5),C.showVelocity&&this.renderBodyVelocity(L,P,C.velocityColor,1,2),C.showSeparations&&this.renderSeparations(w.pairs.list,P,C.separationColor),C.showCollisions&&this.renderCollisions(w.pairs.list,P,C.collisionColor)}},renderGrid:function(C,w,P,L){w.lineStyle(1,P,L);for(var O=o.keys(C.buckets),I=0;I0){var W=z[0].vertex.x,k=z[0].vertex.y;z.length===2&&(W=(z[0].vertex.x+z[1].vertex.x)/2,k=(z[0].vertex.y+z[1].vertex.y)/2),G.bodyB===G.supports[0].body||G.bodyA.isStatic?w.lineBetween(W-G.normal.x*8,k-G.normal.y*8,W,k):w.lineBetween(W+G.normal.x*8,k+G.normal.y*8,W,k)}}return this},renderBodyBounds:function(C,w,P,L){w.lineStyle(1,P,L);for(var O=0;O1?1:0;G1?1:0;z1?1:0;z1&&this.renderConvexHull(K,w,Q,j)}}},renderBody:function(C,w,P,L,O,I,D,B){L===void 0&&(L=null),O===void 0&&(O=null),I===void 0&&(I=1),D===void 0&&(D=null),B===void 0&&(B=null);for(var G=this.debugConfig,z=G.sensorFillColor,W=G.sensorLineColor,k=C.parts,J=k.length,Q=J>1?1:0;Q1){var D=C.vertices;w.lineStyle(L,P),w.beginPath(),w.moveTo(D[0].x,D[0].y);for(var B=1;B0&&(w.fillStyle(D),w.fillCircle(k.x,k.y,B),w.fillCircle(J.x,J.y,B)),this},resetCollisionIDs:function(){return p._nextCollidingGroupId=1,p._nextNonCollidingGroupId=-1,p._nextCategory=1,this},shutdown:function(){v.off(this.engine),this.removeAllListeners(),S.clear(this.localWorld,!1),n.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});a.exports=A},70410:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setBounce:function(t){return this.body.restitution=t,this}};a.exports=y},66968:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var r=0;if(!Array.isArray(t))r=t;else for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22562),p={applyForce:function(h){return this._tempVec2.set(this.body.position.x,this.body.position.y),r.applyForce(this.body,this._tempVec2,h),this},applyForceFrom:function(h,o){return r.applyForce(this.body,h,o),this},thrust:function(h){var o=this.body.angle;return this._tempVec2.set(h*Math.cos(o),h*Math.sin(o)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(h){var o=this.body.angle-Math.PI/2;return this._tempVec2.set(h*Math.cos(o),h*Math.sin(o)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(h){var o=this.body.angle+Math.PI/2;return this._tempVec2.set(h*Math.cos(o),h*Math.sin(o)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(h){var o=this.body.angle-Math.PI;return this._tempVec2.set(h*Math.cos(o),h*Math.sin(o)),r.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};a.exports=p},5436:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setFriction:function(t,r,p){return this.body.friction=t,r!==void 0&&(this.body.frictionAir=r),p!==void 0&&(this.body.frictionStatic=p),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};a.exports=y},39858:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}};a.exports=y},37302:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22562),p=t(26099),h={setMass:function(o){return r.setMass(this.body,o),this},setDensity:function(o){return r.setDensity(this.body,o),this},centerOfMass:{get:function(){return new p(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};a.exports=h},39132:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}};a.exports=y},57772:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(66280),p=t(22562),h=t(43855),o=t(95540),l=t(19496),n=t(85791),u=t(41598),f={setRectangle:function(s,c,d){return this.setBody({type:"rectangle",width:s,height:c},d)},setCircle:function(s,c){return this.setBody({type:"circle",radius:s},c)},setPolygon:function(s,c,d){return this.setBody({type:"polygon",sides:c,radius:s},d)},setTrapezoid:function(s,c,d,v){return this.setBody({type:"trapezoid",width:s,height:c,slope:d},v)},setExistingBody:function(s,c){c===void 0&&(c=!0),this.body&&this.world.remove(this.body,!0),this.body=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 r=t(1121),p=t(53614),h=t(35810),o={setToSleep:function(){return p.set(this.body,!0),this},setAwake:function(){return p.set(this.body,!1),this},setSleepThreshold:function(l){return l===void 0&&(l=60),this.body.sleepThreshold=l,this},setSleepEvents:function(l,n){return this.setSleepStartEvent(l),this.setSleepEndEvent(n),this},setSleepStartEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepStart",function(u){n.emit(r.SLEEP_START,u,this)})}else h.off(this.body,"sleepStart");return this},setSleepEndEvent:function(l){if(l){var n=this.world;h.on(this.body,"sleepEnd",function(u){n.emit(r.SLEEP_END,u,this)})}else h.off(this.body,"sleepEnd");return this}};a.exports=o},90556:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22562),p={setStatic:function(h){return r.setStatic(this.body,h),this},isStatic:function(){return this.body.isStatic}};a.exports=p},85436:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22562),p=t(36383),h=t(86554),o=t(30954),l=4,n={x:{get:function(){return this.body.position.x},set:function(u){this._tempVec2.set(u,this.y),r.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(u){this._tempVec2.set(this.x,u),r.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(u){var f=1/this._scaleX,s=1/this._scaleY;this._scaleX=u,this._scaleX===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,s),r.scale(this.body,u,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(u){var f=1/this._scaleX,s=1/this._scaleY;this._scaleY=u,this._scaleY===0?this.renderFlags&=~l:this.renderFlags|=l,r.scale(this.body,f,s),r.scale(this.body,this._scaleX,u)}},angle:{get:function(){return o(this.body.angle*p.RAD_TO_DEG)},set:function(u){this.rotation=o(u)*p.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(u){this._rotation=h(u),r.setAngle(this.body,this._rotation)}},setPosition:function(u,f){return u===void 0&&(u=0),f===void 0&&(f=u),this._tempVec2.set(u,f),r.setPosition(this.body,this._tempVec2),this},setRotation:function(u){return u===void 0&&(u=0),this._rotation=h(u),r.setAngle(this.body,u),this},setFixedRotation:function(){return r.setInertia(this.body,1/0),this},setAngle:function(u){return u===void 0&&(u=0),this.angle=u,r.setAngle(this.body,this.rotation),this},setScale:function(u,f,s){u===void 0&&(u=1),f===void 0&&(f=u);var c=1/this._scaleX,d=1/this._scaleY;return this._scaleX=u,this._scaleY=f,r.scale(this.body,c,d,s),r.scale(this.body,u,f,s),this}};a.exports=n},42081:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(22562),p={setVelocityX:function(h){return this._tempVec2.set(h,this.body.velocity.y),r.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(h){return this._tempVec2.set(this.body.velocity.x,h),r.setVelocity(this.body,this._tempVec2),this},setVelocity:function(h,o){return this._tempVec2.set(h,o),r.setVelocity(this.body,this._tempVec2),this},getVelocity:function(){return r.getVelocity(this.body)},setAngularVelocity:function(h){return r.setAngularVelocity(this.body,h),this},getAngularVelocity:function(){return r.getAngularVelocity(this.body)},setAngularSpeed:function(h){return r.setAngularSpeed(this.body,h),this},getAngularSpeed:function(){return r.getAngularSpeed(this.body)}};a.exports=p},31884:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Bounce:t(70410),Collision:t(66968),Force:t(51607),Friction:t(5436),Gravity:t(39858),Mass:t(37302),Sensor:t(39132),SetBody:t(57772),Sleep:t(38083),Static:t(90556),Transform:t(85436),Velocity:t(42081)}},85608:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="afteradd"},1213:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="afterremove"},25968:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="afterupdate"},67205:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="beforeadd"},39438:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="beforeremove"},44823:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="beforeupdate"},92593:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="collisionactive"},60128:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="collisionend"},76861:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="collisionstart"},92362:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragend"},76408:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="drag"},93971:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="dragstart"},5656:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},47861:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},79099:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="sleepend"},35906:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="sleepstart"},1121:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AFTER_ADD:t(85608),AFTER_REMOVE:t(1213),AFTER_UPDATE:t(25968),BEFORE_ADD:t(67205),BEFORE_REMOVE:t(39438),BEFORE_UPDATE:t(44823),COLLISION_ACTIVE:t(92593),COLLISION_END:t(60128),COLLISION_START:t(76861),DRAG_END:t(92362),DRAG:t(76408),DRAG_START:t(93971),PAUSE:t(5656),RESUME:t(47861),SLEEP_END:t(79099),SLEEP_START:t(35906)}},3875:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.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:(a,y,t)=>{var r={};a.exports=r;var p=t(41598),h=t(31725),o=t(53614),l=t(53402),n=t(15647),u=t(66615);(function(){r._timeCorrection=!0,r._inertiaScale=4,r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,r._baseDelta=16.666666666666668,r.create=function(s){var c={id:l.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=p.centre(s.vertices):s.hasOwnProperty("vertices")||(c.vertices=p.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var d=l.extend(c,s);return f(d,s),d.setOnCollideWith=function(v,m){return m?this.onCollideWith[v.id]=m:delete this.onCollideWith[v.id],this},d},r.nextGroup=function(s){return s?r._nextNonCollidingGroupId--:r._nextCollidingGroupId++},r.nextCategory=function(){return r._nextCategory=r._nextCategory<<1,r._nextCategory};var f=function(s,c){if(c=c||{},r.set(s,{bounds:s.bounds||n.create(s.vertices),positionPrev:s.positionPrev||h.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}),p.rotate(s.vertices,s.angle,s.position),u.rotate(s.axes,s.angle),n.update(s.bounds,s.vertices,s.velocity),r.set(s,{axes:c.axes||s.axes,area:c.area||s.area,mass:c.mass||s.mass,inertia:c.inertia||s.inertia}),s.parts.length===1){var d=s.bounds,v=s.centerOfMass,m=s.centerOffset,S=d.max.x-d.min.x,M=d.max.y-d.min.y;v.x=-(d.min.x-s.position.x)/S,v.y=-(d.min.y-s.position.y)/M,m.x=S*v.x,m.y=M*v.y}};r.set=function(s,c,d){var v;typeof c=="string"&&(v=c,c={},c[v]=d);for(v in c)if(Object.prototype.hasOwnProperty.call(c,v))switch(d=c[v],v){case"isStatic":r.setStatic(s,d);break;case"isSleeping":o.set(s,d);break;case"mass":r.setMass(s,d);break;case"density":r.setDensity(s,d);break;case"inertia":r.setInertia(s,d);break;case"vertices":r.setVertices(s,d);break;case"position":r.setPosition(s,d);break;case"angle":r.setAngle(s,d);break;case"velocity":r.setVelocity(s,d);break;case"angularVelocity":r.setAngularVelocity(s,d);break;case"speed":r.setSpeed(s,d);break;case"angularSpeed":r.setAngularSpeed(s,d);break;case"parts":r.setParts(s,d);break;case"centre":r.setCentre(s,d);break;default:s[v]=d}},r.setStatic=function(s,c){for(var d=0;d0&&h.rotateAbout(S.position,v,s.position,S.position)}},r.setVelocity=function(s,c){var d=s.deltaTime/r._baseDelta;s.positionPrev.x=s.position.x-c.x*d,s.positionPrev.y=s.position.y-c.y*d,s.velocity.x=(s.position.x-s.positionPrev.x)/d,s.velocity.y=(s.position.y-s.positionPrev.y)/d,s.speed=h.magnitude(s.velocity)},r.getVelocity=function(s){var c=r._baseDelta/s.deltaTime;return{x:(s.position.x-s.positionPrev.x)*c,y:(s.position.y-s.positionPrev.y)*c}},r.getSpeed=function(s){return h.magnitude(r.getVelocity(s))},r.setSpeed=function(s,c){r.setVelocity(s,h.mult(h.normalise(r.getVelocity(s)),c))},r.setAngularVelocity=function(s,c){var d=s.deltaTime/r._baseDelta;s.anglePrev=s.angle-c*d,s.angularVelocity=(s.angle-s.anglePrev)/d,s.angularSpeed=Math.abs(s.angularVelocity)},r.getAngularVelocity=function(s){return(s.angle-s.anglePrev)*r._baseDelta/s.deltaTime},r.getAngularSpeed=function(s){return Math.abs(r.getAngularVelocity(s))},r.setAngularSpeed=function(s,c){r.setAngularVelocity(s,l.sign(r.getAngularVelocity(s))*c)},r.translate=function(s,c,d){r.setPosition(s,h.add(s.position,c),d)},r.rotate=function(s,c,d,v){if(!d)r.setAngle(s,s.angle+c,v);else{var m=Math.cos(c),S=Math.sin(c),M=s.position.x-d.x,A=s.position.y-d.y;r.setPosition(s,{x:d.x+(M*m-A*S),y:d.y+(M*S+A*m)},v),r.setAngle(s,s.angle+c,v)}},r.scale=function(s,c,d,v){var m=0,S=0;v=v||s.position;for(var M=s.inertia===1/0,A=0;A0&&(m+=C.area,S+=C.inertia),C.position.x=v.x+(C.position.x-v.x)*c,C.position.y=v.y+(C.position.y-v.y)*d,n.update(C.bounds,C.vertices,s.velocity)}s.parts.length>1&&(s.area=m,s.isStatic||(r.setMass(s,s.density*m),r.setInertia(s,S))),s.circleRadius&&(c===d?s.circleRadius*=c:s.circleRadius=null),M&&r.setInertia(s,1/0)},r.update=function(s,c){c=(typeof c<"u"?c:16.666666666666668)*s.timeScale;var d=c*c,v=r._timeCorrection?c/(s.deltaTime||c):1,m=1-s.frictionAir*(c/l._baseDelta),S=(s.position.x-s.positionPrev.x)*v,M=(s.position.y-s.positionPrev.y)*v;s.velocity.x=S*m+s.force.x/s.mass*d,s.velocity.y=M*m+s.force.y/s.mass*d,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=c,s.angularVelocity=(s.angle-s.anglePrev)*m*v+s.torque/s.inertia*d,s.anglePrev=s.angle,s.angle+=s.angularVelocity,s.speed=h.magnitude(s.velocity),s.angularSpeed=Math.abs(s.angularVelocity);for(var A=0;A0&&(C.position.x+=s.velocity.x,C.position.y+=s.velocity.y),s.angularVelocity!==0&&(p.rotate(C.vertices,s.angularVelocity,s.position),u.rotate(C.axes,s.angularVelocity),A>0&&h.rotateAbout(C.position,s.angularVelocity,s.position,C.position)),n.update(C.bounds,C.vertices,s.velocity)}},r.updateVelocities=function(s){var c=r._baseDelta/s.deltaTime,d=s.velocity;d.x=(s.position.x-s.positionPrev.x)*c,d.y=(s.position.y-s.positionPrev.y)*c,s.speed=Math.sqrt(d.x*d.x+d.y*d.y),s.angularVelocity=(s.angle-s.anglePrev)*c,s.angularSpeed=Math.abs(s.angularVelocity)},r.applyForce=function(s,c,d){var v={x:c.x-s.position.x,y:c.y-s.position.y};s.force.x+=d.x,s.force.y+=d.y,s.torque+=v.x*d.y-v.y*d.x},r._totalProperties=function(s){for(var c={mass:0,area:0,inertia:0,centre:{x:0,y:0}},d=s.parts.length===1?0:1;d{var r={};a.exports=r;var p=t(35810),h=t(53402),o=t(15647),l=t(22562);(function(){r.create=function(n){return h.extend({id:h.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{},cache:{allBodies:null,allConstraints:null,allComposites:null}},n)},r.setModified=function(n,u,f,s){if(p.trigger(n,"compositeModified",n),n.isModified=u,u&&n.cache&&(n.cache.allBodies=null,n.cache.allConstraints=null,n.cache.allComposites=null),f&&n.parent&&r.setModified(n.parent,u,f,s),s)for(var c=0;c{var r={};a.exports=r;var p=t(69351);(function(){r.create=p.create,r.add=p.add,r.remove=p.remove,r.clear=p.clear,r.addComposite=p.addComposite,r.addBody=p.addBody,r.addConstraint=p.addConstraint})()},52284:(a,y,t)=>{var r={};a.exports=r;var p=t(41598),h=t(4506);(function(){var o=[],l={overlap:0,axis:null},n={overlap:0,axis:null};r.create=function(u,f){return{pair:null,collided:!1,bodyA:u,bodyB:f,parentA:u.parent,parentB:f.parent,depth:0,normal:{x:0,y:0},tangent:{x:0,y:0},penetration:{x:0,y:0},supports:[]}},r.collides=function(u,f,s){if(r._overlapAxes(l,u.vertices,f.vertices,u.axes),l.overlap<=0||(r._overlapAxes(n,f.vertices,u.vertices,f.axes),n.overlap<=0))return null;var c=s&&s.table[h.id(u,f)],d;c?d=c.collision:(d=r.create(u,f),d.collided=!0,d.bodyA=u.idY?Y=D:DK?K=D:Dd?d=m:m{var y={};a.exports=y,function(){y.create=function(t){return{vertex:t,normalImpulse:0,tangentImpulse:0}}}()},81388:(a,y,t)=>{var r={};a.exports=r;var p=t(53402),h=t(52284);(function(){r.create=function(o){var l={bodies:[],pairs:null};return p.extend(l,o)},r.setBodies=function(o,l){o.bodies=l.slice(0)},r.clear=function(o){o.bodies=[]},r.collisions=function(o){var l=[],n=o.pairs,u=o.bodies,f=u.length,s=r.canCollide,c=h.collides,d,v;for(u.sort(r._compareBoundsX),d=0;dM)break;if(!(AI.max.y)&&!(w&&(O.isStatic||O.isSleeping))&&s(m.collisionFilter,O.collisionFilter)){var D=O.parts.length;if(L&&D===1){var B=c(m,O,n);B&&l.push(B)}else for(var G=P>1?1:0,z=D>1?1:0,W=G;WI.max.x||S.max.xI.max.y)){var B=c(k,Q,n);B&&l.push(B)}}}}}return l},r.canCollide=function(o,l){return o.group===l.group&&o.group!==0?o.group>0:(o.mask&l.category)!==0&&(l.mask&o.category)!==0},r._compareBoundsX=function(o,l){return o.bounds.min.x-l.bounds.min.x}})()},4506:(a,y,t)=>{var r={};a.exports=r;var p=t(43424);(function(){r.create=function(h,o){var l=h.bodyA,n=h.bodyB,u={id:r.id(l,n),bodyA:l,bodyB:n,collision:h,contacts:[],activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:l.isSensor||n.isSensor,timeCreated:o,timeUpdated:o,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return r.update(u,h,o),u},r.update=function(h,o,l){var n=h.contacts,u=o.supports,f=h.activeContacts,s=o.parentA,c=o.parentB,d=s.vertices.length;h.isActive=!0,h.timeUpdated=l,h.collision=o,h.separation=o.depth,h.inverseMass=s.inverseMass+c.inverseMass,h.friction=s.frictionc.frictionStatic?s.frictionStatic:c.frictionStatic,h.restitution=s.restitution>c.restitution?s.restitution:c.restitution,h.slop=s.slop>c.slop?s.slop:c.slop,o.pair=h,f.length=0;for(var v=0;v{var r={};a.exports=r;var p=t(4506),h=t(53402);(function(){r.create=function(o){return h.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},o)},r.update=function(o,l,n){var u=o.list,f=u.length,s=o.table,c=l.length,d=o.collisionStart,v=o.collisionEnd,m=o.collisionActive,S,M,A,C;for(d.length=0,v.length=0,m.length=0,C=0;C{var r={};a.exports=r;var p=t(31725),h=t(52284),o=t(15647),l=t(66280),n=t(41598);(function(){r.collides=function(u,f){for(var s=[],c=f.length,d=u.bounds,v=h.collides,m=o.overlaps,S=0;S{var r={};a.exports=r;var p=t(41598),h=t(53402),o=t(15647);(function(){r._restingThresh=2,r._restingThreshTangent=Math.sqrt(6),r._positionDampen=.9,r._positionWarming=.8,r._frictionNormalMultiplier=5,r._frictionMaxStatic=Number.MAX_VALUE,r.preSolvePosition=function(l){var n,u,f,s=l.length;for(n=0;nTt?(A=ot>0?ot:-ot,M=P.friction*(ot>0?1:-1)*s,M<-A?M=-A:M>A&&(M=A)):(M=ot,A=m);var wt=$*z-q*G,Et=it*z-nt*G,Gt=Y/(K+O.inverseInertia*wt*wt+I.inverseInertia*Et*Et),Wt=(1+P.restitution)*At*Gt;if(M*=Gt,At0&&(V.normalImpulse=0),Wt=V.normalImpulse-Jt}if(ot<-d||ot>d)V.tangentImpulse=0;else{var $t=V.tangentImpulse;V.tangentImpulse+=M,V.tangentImpulse<-A&&(V.tangentImpulse=-A),V.tangentImpulse>A&&(V.tangentImpulse=A),M=V.tangentImpulse-$t}var ee=G*Wt+W*M,Nt=z*Wt+k*M;O.isStatic||O.isSleeping||(O.positionPrev.x+=ee*O.inverseMass,O.positionPrev.y+=Nt*O.inverseMass,O.anglePrev+=($*Nt-q*ee)*O.inverseInertia),I.isStatic||I.isSleeping||(I.positionPrev.x-=ee*I.inverseMass,I.positionPrev.y-=Nt*I.inverseMass,I.anglePrev-=(it*Nt-nt*ee)*I.inverseInertia)}}}}})()},48140:(a,y,t)=>{var r={};a.exports=r;var p=t(41598),h=t(31725),o=t(53614),l=t(15647),n=t(66615),u=t(53402);(function(){r._warming=.4,r._torqueDampen=1,r._minLength=1e-6,r.create=function(f){var s=f;s.bodyA&&!s.pointA&&(s.pointA={x:0,y:0}),s.bodyB&&!s.pointB&&(s.pointB={x:0,y:0});var c=s.bodyA?h.add(s.bodyA.position,s.pointA):s.pointA,d=s.bodyB?h.add(s.bodyB.position,s.pointB):s.pointB,v=h.magnitude(h.sub(c,d));s.length=typeof s.length<"u"?s.length:v,s.id=s.id||u.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 m={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?(m.type="pin",m.anchors=!1):s.stiffness<.9&&(m.type="spring"),s.render=u.extend(m,s.render),s},r.preSolveAll=function(f){for(var s=0;s=1||f.length===0,L=P?f.stiffness*s:f.stiffness*s*s,O=f.damping*s,I=h.mult(A,w*L),D=(c?c.inverseMass:0)+(d?d.inverseMass:0),B=(c?c.inverseInertia:0)+(d?d.inverseInertia:0),G=D+B,z,W,k,J,Q;if(O>0){var Y=h.create();k=h.div(A,C),Q=h.sub(d&&h.sub(d.position,d.positionPrev)||Y,c&&h.sub(c.position,c.positionPrev)||Y),J=h.dot(k,Q)}c&&!c.isStatic&&(W=c.inverseMass/D,c.constraintImpulse.x-=I.x*W,c.constraintImpulse.y-=I.y*W,c.position.x-=I.x*W,c.position.y-=I.y*W,O>0&&(c.positionPrev.x-=O*k.x*J*W,c.positionPrev.y-=O*k.y*J*W),z=h.cross(v,I)/G*r._torqueDampen*c.inverseInertia*(1-f.angularStiffness),c.constraintImpulse.angle-=z,c.angle-=z),d&&!d.isStatic&&(W=d.inverseMass/D,d.constraintImpulse.x+=I.x*W,d.constraintImpulse.y+=I.y*W,d.position.x+=I.x*W,d.position.y+=I.y*W,O>0&&(d.positionPrev.x+=O*k.x*J*W,d.positionPrev.y+=O*k.y*J*W),z=h.cross(m,I)/G*r._torqueDampen*d.inverseInertia*(1-f.angularStiffness),d.constraintImpulse.angle+=z,d.angle+=z)}}},r.postSolveAll=function(f){for(var s=0;s0&&(m.position.x+=d.x,m.position.y+=d.y),d.angle!==0&&(p.rotate(m.vertices,d.angle,c.position),n.rotate(m.axes,d.angle),v>0&&h.rotateAbout(m.position,d.angle,c.position,m.position)),l.update(m.bounds,m.vertices,c.velocity)}d.angle*=r._warming,d.x*=r._warming,d.y*=r._warming}}},r.pointAWorld=function(f){return{x:(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),y:(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0)}},r.pointBWorld=function(f){return{x:(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),y:(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0)}},r.currentLength=function(f){var s=(f.bodyA?f.bodyA.position.x:0)+(f.pointA?f.pointA.x:0),c=(f.bodyA?f.bodyA.position.y:0)+(f.pointA?f.pointA.y:0),d=(f.bodyB?f.bodyB.position.x:0)+(f.pointB?f.pointB.x:0),v=(f.bodyB?f.bodyB.position.y:0)+(f.pointB?f.pointB.y:0),m=s-d,S=c-v;return Math.sqrt(m*m+S*S)}})()},53402:(a,y,t)=>{var r={};a.exports=r,function(){r._baseDelta=16.666666666666668,r._nextId=0,r._seed=0,r._nowStartTime=+new Date,r._warnedOnce={},r._decomp=null,r.extend=function(h,o){var l,n;typeof o=="boolean"?(l=2,n=o):(l=1,n=!0);for(var u=l;u0;o--){var l=Math.floor(r.random()*(o+1)),n=h[o];h[o]=h[l],h[l]=n}return h},r.choose=function(h){return h[Math.floor(r.random()*h.length)]},r.isElement=function(h){return typeof HTMLElement<"u"?h instanceof HTMLElement:!!(h&&h.nodeType&&h.nodeName)},r.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"},r.isFunction=function(h){return typeof h=="function"},r.isPlainObject=function(h){return typeof h=="object"&&h.constructor===Object},r.isString=function(h){return toString.call(h)==="[object String]"},r.clamp=function(h,o,l){return hl?l:h},r.sign=function(h){return h<0?-1:1},r.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-r._nowStartTime},r.random=function(h,o){return h=typeof h<"u"?h:0,o=typeof o<"u"?o:1,h+p()*(o-h)};var p=function(){return r._seed=(r._seed*9301+49297)%233280,r._seed/233280};r.colorToNumber=function(h){return h=h.replace("#",""),h.length==3&&(h=h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2)),parseInt(h,16)},r.logLevel=1,r.log=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.info=function(){console&&r.logLevel>0&&r.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warn=function(){console&&r.logLevel>0&&r.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},r.warnOnce=function(){var h=Array.prototype.slice.call(arguments).join(" ");r._warnedOnce[h]||(r.warn(h),r._warnedOnce[h]=!0)},r.deprecated=function(h,o,l){h[o]=r.chain(function(){r.warnOnce("🔅 deprecated 🔅",l)},h[o])},r.nextId=function(){return r._nextId++},r.indexOf=function(h,o){if(h.indexOf)return h.indexOf(o);for(var l=0;l{var r={};a.exports=r;var p=t(53614),h=t(66272),o=t(81388),l=t(99561),n=t(35810),u=t(69351),f=t(48140),s=t(53402),c=t(22562);(function(){r.create=function(d){d=d||{};var v={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}},m=s.extend(v,d);return m.world=d.world||u.create({label:"World"}),m.pairs=d.pairs||l.create(),m.detector=d.detector||o.create(),m.grid={buckets:[]},m.world.gravity=m.gravity,m.broadphase=m.grid,m.metrics={},m},r.update=function(d,v){var m=s.now(),S=d.world,M=d.detector,A=d.pairs,C=d.timing,w=C.timestamp,P;v=typeof v<"u"?v:s._baseDelta,v*=C.timeScale,C.timestamp+=v,C.lastDelta=v;var L={timestamp:C.timestamp,delta:v};n.trigger(d,"beforeUpdate",L);var O=u.allBodies(S),I=u.allConstraints(S);for(S.isModified&&(o.setBodies(M,O),u.setModified(S,!1,!1,!0)),d.enableSleeping&&p.update(O,v),r._bodiesApplyGravity(O,d.gravity),v>0&&r._bodiesUpdate(O,v),n.trigger(d,"beforeSolve",L),f.preSolveAll(O),P=0;P0&&n.trigger(d,"collisionStart",{pairs:A.collisionStart,timestamp:C.timestamp,delta:v});var B=s.clamp(20/d.positionIterations,0,1);for(h.preSolvePosition(A.list),P=0;P0&&n.trigger(d,"collisionActive",{pairs:A.collisionActive,timestamp:C.timestamp,delta:v}),A.collisionEnd.length>0&&n.trigger(d,"collisionEnd",{pairs:A.collisionEnd,timestamp:C.timestamp,delta:v}),r._bodiesClearForces(O),n.trigger(d,"afterUpdate",L),d.timing.lastElapsed=s.now()-m,d},r.merge=function(d,v){if(s.extend(d,v),v.world){d.world=v.world,r.clear(d);for(var m=u.allBodies(d.world),S=0;S{var r={};a.exports=r;var p=t(53402);(function(){r.on=function(h,o,l){for(var n=o.split(" "),u,f=0;f0){l||(l={}),n=o.split(" ");for(var d=0;d{var r={};a.exports=r;var p=t(73832),h=t(53402);(function(){r.name="matter-js",r.version="0.19.0",r.uses=[],r.used=[],r.use=function(){p.use(r,Array.prototype.slice.call(arguments))},r.before=function(o,l){return o=o.replace(/^Matter./,""),h.chainPathBefore(r,o,l)},r.after=function(o,l){return o=o.replace(/^Matter./,""),h.chainPathAfter(r,o,l)}})()},73832:(a,y,t)=>{var r={};a.exports=r;var p=t(53402);(function(){r._registry={},r.register=function(h){if(r.isPlugin(h)||p.warn("Plugin.register:",r.toString(h),"does not implement all required fields."),h.name in r._registry){var o=r._registry[h.name],l=r.versionParse(h.version).number,n=r.versionParse(o.version).number;l>n?(p.warn("Plugin.register:",r.toString(o),"was upgraded to",r.toString(h)),r._registry[h.name]=h):l-1},r.isFor=function(h,o){var l=h.for&&r.dependencyParse(h.for);return!h.for||o.name===l.name&&r.versionSatisfies(o.version,l.range)},r.use=function(h,o){if(h.uses=(h.uses||[]).concat(o||[]),h.uses.length===0){p.warn("Plugin.use:",r.toString(h),"does not specify any dependencies to install.");return}for(var l=r.dependencies(h),n=p.topologicalSort(l),u=[],f=0;f0&&!s.silent&&p.info(u.join(" "))},r.dependencies=function(h,o){var l=r.dependencyParse(h),n=l.name;if(o=o||{},!(n in o)){h=r.resolve(h)||h,o[n]=p.map(h.uses||[],function(f){r.isPlugin(f)&&r.register(f);var s=r.dependencyParse(f),c=r.resolve(f);return c&&!r.versionSatisfies(c.version,s.range)?(p.warn("Plugin.dependencies:",r.toString(c),"does not satisfy",r.toString(s),"used by",r.toString(l)+"."),c._warned=!0,h._warned=!0):c||(p.warn("Plugin.dependencies:",r.toString(f),"used by",r.toString(l),"could not be resolved."),h._warned=!0),s.name});for(var u=0;u=|>)?\s*((\d+)\.(\d+)\.(\d+))(-[0-9A-Za-z-+]+)?$/;o.test(h)||p.warn("Plugin.versionParse:",h,"is not a valid version or range.");var l=o.exec(h),n=Number(l[4]),u=Number(l[5]),f=Number(l[6]);return{isRange:!!(l[1]||l[2]),version:l[3],range:h,operator:l[1]||l[2]||"",major:n,minor:u,patch:f,parts:[n,u,f],prerelease:l[7],number:n*1e8+u*1e4+f}},r.versionSatisfies=function(h,o){o=o||"*";var l=r.versionParse(o),n=r.versionParse(h);if(l.isRange){if(l.operator==="*"||h==="*")return!0;if(l.operator===">")return n.number>l.number;if(l.operator===">=")return n.number>=l.number;if(l.operator==="~")return n.major===l.major&&n.minor===l.minor&&n.patch>=l.patch;if(l.operator==="^")return l.major>0?n.major===l.major&&n.number>=l.number:l.minor>0?n.minor===l.minor&&n.patch>=l.patch:n.patch===l.patch}return h===o||h==="*"}})()},53614:(a,y,t)=>{var r={};a.exports=r;var p=t(22562),h=t(35810),o=t(53402);(function(){r._motionWakeThreshold=.18,r._motionSleepThreshold=.08,r._minBias=.9,r.update=function(l,n){for(var u=n/o._baseDelta,f=r._motionSleepThreshold,s=0;s0&&c.motion=c.sleepThreshold/u&&r.set(c,!0)):c.sleepCounter>0&&(c.sleepCounter-=1)}},r.afterCollisions=function(l){for(var n=r._motionSleepThreshold,u=0;un&&r.set(v,!1)}}}},r.set=function(l,n){var u=l.isSleeping;n?(l.isSleeping=!0,l.sleepCounter=l.sleepThreshold,l.positionImpulse.x=0,l.positionImpulse.y=0,l.positionPrev.x=l.position.x,l.positionPrev.y=l.position.y,l.anglePrev=l.angle,l.speed=0,l.angularSpeed=0,l.motion=0,u||h.trigger(l,"sleepStart")):(l.isSleeping=!1,l.sleepCounter=0,u&&h.trigger(l,"sleepEnd"))}})()},66280:(a,y,t)=>{var r={};a.exports=r;var p=t(41598),h=t(53402),o=t(22562),l=t(15647),n=t(31725);(function(){r.rectangle=function(u,f,s,c,d){d=d||{};var v={label:"Rectangle Body",position:{x:u,y:f},vertices:p.fromPath("L 0 0 L "+s+" 0 L "+s+" "+c+" L 0 "+c)};if(d.chamfer){var m=d.chamfer;v.vertices=p.chamfer(v.vertices,m.radius,m.quality,m.qualityMin,m.qualityMax),delete d.chamfer}return o.create(h.extend({},v,d))},r.trapezoid=function(u,f,s,c,d,v){v=v||{},d*=.5;var m=(1-d*2)*s,S=s*d,M=S+m,A=M+S,C;d<.5?C="L 0 0 L "+S+" "+-c+" L "+M+" "+-c+" L "+A+" 0":C="L 0 0 L "+M+" "+-c+" L "+A+" 0";var w={label:"Trapezoid Body",position:{x:u,y:f},vertices:p.fromPath(C)};if(v.chamfer){var P=v.chamfer;w.vertices=p.chamfer(w.vertices,P.radius,P.quality,P.qualityMin,P.qualityMax),delete v.chamfer}return o.create(h.extend({},w,v))},r.circle=function(u,f,s,c,d){c=c||{};var v={label:"Circle Body",circleRadius:s};d=d||25;var m=Math.ceil(Math.max(10,Math.min(d,s)));return m%2===1&&(m+=1),r.polygon(u,f,m,s,h.extend({},v,c))},r.polygon=function(u,f,s,c,d){if(d=d||{},s<3)return r.circle(u,f,c,d);for(var v=2*Math.PI/s,m="",S=v*.5,M=0;M0&&p.area(Q)1?(C=o.create(h.extend({parts:w.slice(0)},c)),o.setPosition(C,{x:u,y:f}),C):w[0]},r.flagCoincidentParts=function(u,f){f===void 0&&(f=5);for(var s=0;s{var r={};a.exports=r;var p=t(69351),h=t(48140),o=t(53402),l=t(22562),n=t(66280);(function(){r.stack=function(u,f,s,c,d,v,m){for(var S=p.create({label:"Stack"}),M=u,A=f,C,w=0,P=0;PL&&(L=D),l.translate(I,{x:B*.5,y:D*.5}),M=I.bounds.max.x+d,p.addBody(S,I),C=I,w+=1}else M+=d}A+=L+v,M=u}return S},r.chain=function(u,f,s,c,d,v){for(var m=u.bodies,S=1;S0)for(S=0;S0&&(C=v[S-1+(m-1)*f],p.addConstraint(u,h.create(o.extend({bodyA:C,bodyB:A},d)))),c&&SL)){C=L-C;var I=C,D=s-1-C;if(!(AD)){P===1&&l.translate(w,{x:(A+(s%2===1?1:-1))*O,y:0});var B=w?A*O:0;return m(u+B+A*d,M,A,C,w,P)}}})},r.newtonsCradle=function(u,f,s,c,d){for(var v=p.create({label:"Newtons Cradle"}),m=0;m{var r={};a.exports=r;var p=t(31725),h=t(53402);(function(){r.fromVertices=function(o){for(var l={},n=0;n{var y={};a.exports=y,function(){y.create=function(t){var r={min:{x:0,y:0},max:{x:0,y:0}};return t&&y.update(r,t),r},y.update=function(t,r,p){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var h=0;ht.max.x&&(t.max.x=o.x),o.xt.max.y&&(t.max.y=o.y),o.y0?t.max.x+=p.x:t.min.x+=p.x,p.y>0?t.max.y+=p.y:t.min.y+=p.y)},y.contains=function(t,r){return r.x>=t.min.x&&r.x<=t.max.x&&r.y>=t.min.y&&r.y<=t.max.y},y.overlaps=function(t,r){return t.min.x<=r.max.x&&t.max.x>=r.min.x&&t.max.y>=r.min.y&&t.min.y<=r.max.y},y.translate=function(t,r){t.min.x+=r.x,t.max.x+=r.x,t.min.y+=r.y,t.max.y+=r.y},y.shift=function(t,r){var p=t.max.x-t.min.x,h=t.max.y-t.min.y;t.min.x=r.x,t.max.x=r.x+p,t.min.y=r.y,t.max.y=r.y+h}}()},74058:(a,y,t)=>{var r={};a.exports=r,t(15647);var p=t(53402);(function(){r.pathToVertices=function(h,o){typeof window<"u"&&!("SVGPathSeg"in window)&&p.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var l,n,u,f,s,c,d,v,m,S,M=[],A,C,w=0,P=0,L=0;o=o||15;var O=function(D,B,G){var z=G%2===1&&G>1;if(!m||D!=m.x||B!=m.y){m&&z?(A=m.x,C=m.y):(A=0,C=0);var W={x:A+D,y:C+B};(z||!m)&&(m=W),M.push(W),P=A+D,L=C+B}},I=function(D){var B=D.pathSegTypeAsLetter.toUpperCase();if(B!=="Z"){switch(B){case"M":case"L":case"T":case"C":case"S":case"Q":P=D.x,L=D.y;break;case"H":P=D.x;break;case"V":L=D.y;break}O(P,L,D.pathSegType)}};for(r._svgPathToAbsolute(h),u=h.getTotalLength(),c=[],l=0;l{var y={};a.exports=y,function(){y.create=function(t,r){return{x:t||0,y:r||0}},y.clone=function(t){return{x:t.x,y:t.y}},y.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},y.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},y.rotate=function(t,r,p){var h=Math.cos(r),o=Math.sin(r);p||(p={});var l=t.x*h-t.y*o;return p.y=t.x*o+t.y*h,p.x=l,p},y.rotateAbout=function(t,r,p,h){var o=Math.cos(r),l=Math.sin(r);h||(h={});var n=p.x+((t.x-p.x)*o-(t.y-p.y)*l);return h.y=p.y+((t.x-p.x)*l+(t.y-p.y)*o),h.x=n,h},y.normalise=function(t){var r=y.magnitude(t);return r===0?{x:0,y:0}:{x:t.x/r,y:t.y/r}},y.dot=function(t,r){return t.x*r.x+t.y*r.y},y.cross=function(t,r){return t.x*r.y-t.y*r.x},y.cross3=function(t,r,p){return(r.x-t.x)*(p.y-t.y)-(r.y-t.y)*(p.x-t.x)},y.add=function(t,r,p){return p||(p={}),p.x=t.x+r.x,p.y=t.y+r.y,p},y.sub=function(t,r,p){return p||(p={}),p.x=t.x-r.x,p.y=t.y-r.y,p},y.mult=function(t,r){return{x:t.x*r,y:t.y*r}},y.div=function(t,r){return{x:t.x/r,y:t.y/r}},y.perp=function(t,r){return r=r===!0?-1:1,{x:r*-t.y,y:r*t.x}},y.neg=function(t){return{x:-t.x,y:-t.y}},y.angle=function(t,r){return Math.atan2(r.y-t.y,r.x-t.x)},y._temp=[y.create(),y.create(),y.create(),y.create(),y.create(),y.create()]}()},41598:(a,y,t)=>{var r={};a.exports=r;var p=t(31725),h=t(53402);(function(){r.create=function(o,l){for(var n=[],u=0;u0)return!1;s=c}return!0},r.scale=function(o,l,n,u){if(l===1&&n===1)return o;u=u||r.centre(o);for(var f,s,c=0;c=0?c-1:o.length-1],v=o[c],m=o[(c+1)%o.length],S=l[c0&&(l|=2),l===3)return!1;return l!==0?!0:null},r.hull=function(o){var l=[],n=[],u,f;for(o=o.slice(0),o.sort(function(s,c){var d=s.x-c.x;return d!==0?d:s.y-c.y}),f=0;f=2&&p.cross3(n[n.length-2],n[n.length-1],u)<=0;)n.pop();n.push(u)}for(f=o.length-1;f>=0;f-=1){for(u=o[f];l.length>=2&&p.cross3(l[l.length-2],l[l.length-1],u)<=0;)l.pop();l.push(u)}return l.pop(),n.pop(),l.concat(n)}})()},18210:(a,y,t)=>{var r=t(19933),p={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Body.create",function(){p.Body.init(this)}),h.before("Engine.update",function(o){p.Engine.update(o)})},Body:{init:function(h){h.plugin.attractors=h.plugin.attractors||[]}},Engine:{update:function(h){for(var o=r.Composite.allBodies(h.world),l=0;l0)for(var f=0;f{/** - * @author @dxu https://github.com/dxu/matter-collision-events - * @author Richard Davey - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={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(r){r.pairs.map(function(p){var h=p.bodyA,o=p.bodyB;h.gameObject&&h.gameObject.emit("collide",h,o,p),o.gameObject&&o.gameObject.emit("collide",o,h,p),t.Events.trigger(h,"onCollide",{pair:p}),t.Events.trigger(o,"onCollide",{pair:p}),h.onCollideCallback&&h.onCollideCallback(p),o.onCollideCallback&&o.onCollideCallback(p),h.onCollideWith[o.id]&&h.onCollideWith[o.id](o,p),o.onCollideWith[h.id]&&o.onCollideWith[h.id](h,p)})}),t.Events.on(this,"collisionActive",function(r){r.pairs.map(function(p){var h=p.bodyA,o=p.bodyB;h.gameObject&&h.gameObject.emit("collideActive",h,o,p),o.gameObject&&o.gameObject.emit("collideActive",o,h,p),t.Events.trigger(h,"onCollideActive",{pair:p}),t.Events.trigger(o,"onCollideActive",{pair:p}),h.onCollideActiveCallback&&h.onCollideActiveCallback(p),o.onCollideActiveCallback&&o.onCollideActiveCallback(p)})}),t.Events.on(this,"collisionEnd",function(r){r.pairs.map(function(p){var h=p.bodyA,o=p.bodyB;h.gameObject&&h.gameObject.emit("collideEnd",h,o,p),o.gameObject&&o.gameObject.emit("collideEnd",o,h,p),t.Events.trigger(h,"onCollideEnd",{pair:p}),t.Events.trigger(o,"onCollideEnd",{pair:p}),h.onCollideEndCallback&&h.onCollideEndCallback(p),o.onCollideEndCallback&&o.onCollideEndCallback(p)})})})}};a.exports=y},74507:(a,y,t)=>{var r=t(19933),p={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.19.0",silent:!0,install:function(h){h.after("Engine.update",function(){p.Engine.update(this)})},Engine:{update:function(h){for(var o=h.world,l=r.Composite.allBodies(o),n=r.Composite.allComposites(o),u=0;uo.max.x?l=o.min.x-h.max.x:h.max.xo.max.y?n=o.min.y-h.max.y:h.max.y{/** - * @author Stefan Hedman (http://steffe.se) - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={decomp:I,quickDecomp:z,isSimple:B,removeCollinearPoints:W,removeDuplicatePoints:k,makeCCW:m};function y(Y,K,U){U=U||0;var V=[0,0],j,$,q,it,nt,et,ht;return j=Y[1][1]-Y[0][1],$=Y[0][0]-Y[1][0],q=j*Y[0][0]+$*Y[0][1],it=K[1][1]-K[0][1],nt=K[0][0]-K[1][0],et=it*K[0][0]+nt*K[0][1],ht=j*nt-it*$,J(ht,0,U)||(V[0]=(nt*q-$*et)/ht,V[1]=(j*et-it*q)/ht),V}function t(Y,K,U,V){var j=K[0]-Y[0],$=K[1]-Y[1],q=V[0]-U[0],it=V[1]-U[1];if(q*$-it*j===0)return!1;var nt=(j*(U[1]-Y[1])+$*(Y[0]-U[0]))/(q*$-it*j),et=(q*(Y[1]-U[1])+it*(U[0]-Y[0]))/(it*j-q*$);return nt>=0&&nt<=1&&et>=0&&et<=1}function r(Y,K,U){return(K[0]-Y[0])*(U[1]-Y[1])-(U[0]-Y[0])*(K[1]-Y[1])}function p(Y,K,U){return r(Y,K,U)>0}function h(Y,K,U){return r(Y,K,U)>=0}function o(Y,K,U){return r(Y,K,U)<0}function l(Y,K,U){return r(Y,K,U)<=0}var n=[],u=[];function f(Y,K,U,V){if(V){var j=n,$=u;j[0]=K[0]-Y[0],j[1]=K[1]-Y[1],$[0]=U[0]-K[0],$[1]=U[1]-K[1];var q=j[0]*$[0]+j[1]*$[1],it=Math.sqrt(j[0]*j[0]+j[1]*j[1]),nt=Math.sqrt($[0]*$[0]+$[1]*$[1]),et=Math.acos(q/(it*nt));return etU[K][0])&&(K=V);return p(c(Y,K-1),c(Y,K),c(Y,K+1))?!1:(S(Y),!0)}function S(Y){for(var K=[],U=Y.length,V=0;V!==U;V++)K.push(Y.pop());for(var V=0;V!==U;V++)Y[V]=K[V]}function M(Y,K){return o(c(Y,K-1),c(Y,K),c(Y,K+1))}var A=[],C=[];function w(Y,K,U){var V,j,$=A,q=C;if(h(c(Y,K+1),c(Y,K),c(Y,U))&&l(c(Y,K-1),c(Y,K),c(Y,U)))return!1;j=s(c(Y,K),c(Y,U));for(var it=0;it!==Y.length;++it)if(!((it+1)%Y.length===K||it===K)&&h(c(Y,K),c(Y,U),c(Y,it+1))&&l(c(Y,K),c(Y,U),c(Y,it))&&($[0]=c(Y,K),$[1]=c(Y,U),q[0]=c(Y,it),q[1]=c(Y,it+1),V=y($,q),s(c(Y,K),V)0?D(Y,K):[Y]}function D(Y,K){if(K.length===0)return[Y];if(K instanceof Array&&K.length&&K[0]instanceof Array&&K[0].length===2&&K[0][0]instanceof Array){for(var U=[Y],V=0;V$)return console.warn("quickDecomp: max level ("+$+") reached."),K;for(var Et=0;Etgt&&(gt+=Y.length),mt=Number.MAX_VALUE,gt3&&V>=0;--V)f(c(Y,V-1),c(Y,V),c(Y,V+1),K)&&(Y.splice(V%Y.length,1),U++);return U}function k(Y,K){for(var U=Y.length-1;U>=1;--U)for(var V=Y[U],j=U-1;j>=0;--j)if(Q(V,Y[j],K)){Y.splice(U,1);continue}}function J(Y,K,U){return U=U||0,Math.abs(Y-K)<=U}function Q(Y,K,U){return J(Y[0],K[0],U)&&J(Y[1],K[1],U)}},52018:(a,y,t)=>{/** -* @author Richard Davey -* @copyright 2013-2024 Phaser Studio Inc. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/var r=t(83419),p=new r({initialize:function(o){this.pluginManager=o,this.game=o.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});a.exports=p},42363:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]};a.exports=y},37277:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={},t={},r={};r.register=function(p,h,o,l){l===void 0&&(l=!1),y[p]={plugin:h,mapping:o,custom:l}},r.registerCustom=function(p,h,o,l){t[p]={plugin:h,mapping:o,data:l}},r.hasCore=function(p){return y.hasOwnProperty(p)},r.hasCustom=function(p){return t.hasOwnProperty(p)},r.getCore=function(p){return y[p]},r.getCustom=function(p){return t[p]},r.getCustomClass=function(p){return t.hasOwnProperty(p)?t[p].plugin:null},r.remove=function(p){y.hasOwnProperty(p)&&delete y[p]},r.removeCustom=function(p){t.hasOwnProperty(p)&&delete t[p]},r.destroyCorePlugins=function(){for(var p in y)y.hasOwnProperty(p)&&delete y[p]},r.destroyCustomPlugins=function(){for(var p in t)t.hasOwnProperty(p)&&delete t[p]},a.exports=r},77332:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(8443),h=t(50792),o=t(74099),l=t(44603),n=t(39429),u=t(95540),f=t(37277),s=t(72905),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],v.isBooted?this.boot():v.events.once(p.BOOT,this.boot,this)},boot:function(){var d,v,m,S,M,A,C,w=this.game.config,P=w.installGlobalPlugins;for(P=P.concat(this._pendingGlobal),d=0;d{/** -* @author Richard Davey -* @copyright 2013-2024 Phaser Studio Inc. -* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} -*/var r=t(52018),p=t(83419),h=t(44594),o=new p({Extends:r,initialize:function(n,u,f){r.call(this,u),this.scene=n,this.systems=n.sys,this.pluginKey=f,n.sys.events.once(h.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});a.exports=o},18922:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={BasePlugin:t(52018),DefaultPlugins:t(42363),PluginCache:t(37277),PluginManager:t(77332),ScenePlugin:t(45145)}},63595:()=>{HTMLVideoElement&&!("requestVideoFrameCallback"in HTMLVideoElement.prototype)&&"getVideoPlaybackQuality"in HTMLVideoElement.prototype&&(HTMLVideoElement.prototype._rvfcpolyfillmap={},HTMLVideoElement.prototype.requestVideoFrameCallback=function(a){const y=performance.now(),t=this.getVideoPlaybackQuality(),r=this.mozPresentedFrames||this.mozPaintedFrames||t.totalVideoFrames-t.droppedVideoFrames,p=(h,o)=>{const l=this.getVideoPlaybackQuality(),n=this.mozPresentedFrames||this.mozPaintedFrames||l.totalVideoFrames-l.droppedVideoFrames;if(n>r){const u=this.mozFrameDelay||l.totalFrameDelay-t.totalFrameDelay||0,f=o-h;a(o,{presentationTime:o+u*1e3,expectedDisplayTime:o+f,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+f/1e3,presentedFrames:n,processingDuration:u}),delete this._rvfcpolyfillmap[y]}else this._rvfcpolyfillmap[y]=requestAnimationFrame(u=>p(o,u))};return this._rvfcpolyfillmap[y]=requestAnimationFrame(h=>p(y,h)),y},HTMLVideoElement.prototype.cancelVideoFrameCallback=function(a){cancelAnimationFrame(this._rvfcpolyfillmap[a]),delete this._rvfcpolyfillmap[a]})},10312:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},29795:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={DEFAULT:0,LINEAR:0,NEAREST:1};a.exports=y},68627:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19715),p=t(32880),h=t(83419),o=t(8054),l=t(50792),n=t(92503),u=t(56373),f=t(97480),s=t(69442),c=t(61340),d=new h({Extends:l,initialize:function(m){l.call(this);var S=m.config;this.config={clearBeforeRender:S.clearBeforeRender,backgroundColor:S.backgroundColor,antialias:S.antialias,roundPixels:S.roundPixels},this.game=m,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=m.canvas;var M={alpha:m.config.transparent,desynchronized:m.config.desynchronized,willReadFrequently:!1};this.gameContext=S.context?S.context:this.gameCanvas.getContext("2d",M),this.currentContext=this.gameContext,this.antialias=m.config.antialias,this.blendModes=u(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(s.READY,this.boot,this)},boot:function(){var v=this.game,m=v.scale.baseSize;this.width=m.width,this.height=m.height,this.isBooted=!0,v.scale.on(f.RESIZE,this.onResize,this),this.resize(m.width,m.height)},onResize:function(v,m){(m.width!==this.width||m.height!==this.height)&&this.resize(m.width,m.height)},resize:function(v,m){this.width=v,this.height=m,this.emit(n.RESIZE,v,m)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(v){return this.currentContext.globalCompositeOperation=v,this},setContext:function(v){return this.currentContext=v||this.gameContext,this},setAlpha:function(v){return this.currentContext.globalAlpha=v,this},preRender:function(){var v=this.gameContext,m=this.config,S=this.width,M=this.height;v.globalAlpha=1,v.globalCompositeOperation="source-over",v.setTransform(1,0,0,1,0,0),m.clearBeforeRender&&(v.clearRect(0,0,S,M),m.transparent||(v.fillStyle=m.backgroundColor.rgba,v.fillRect(0,0,S,M))),v.save(),this.drawCount=0,this.emit(n.PRE_RENDER)},render:function(v,m,S){var M=m.length;this.emit(n.RENDER,v,S);var A=S.x,C=S.y,w=S.width,P=S.height,L=S.renderToTexture?S.context:v.sys.context;L.save(),this.game.scene.customViewports&&(L.beginPath(),L.rect(A,C,w,P),L.clip()),S.emit(r.PRE_RENDER,S),this.currentContext=L;var O=S.mask;O&&O.preRenderCanvas(this,null,S._maskCamera),S.transparent||(L.fillStyle=S.backgroundColor.rgba,L.fillRect(A,C,w,P)),L.globalAlpha=S.alpha,L.globalCompositeOperation="source-over",this.drawCount+=M,S.renderToTexture&&S.emit(r.PRE_RENDER,S),S.matrix.copyToContext(L);for(var I=0;I=0?J=-(J+D):J<0&&(J=Math.abs(J)-D)),v.flipY&&(Q>=0?Q=-(Q+B):Q<0&&(Q=Math.abs(Q)-B))}var K=1,U=1;v.flipX&&(G||(J+=-m.realWidth+W*2),K=-1),v.flipY&&(G||(Q+=-m.realHeight+k*2),U=-1);var V=v.x,j=v.y;P.applyITRS(V,j,v.rotation,v.scaleX*K,v.scaleY*U),w.copyFrom(S.matrix),M?(w.multiplyWithOffset(M,-S.scrollX*v.scrollFactorX,-S.scrollY*v.scrollFactorY),P.e=V,P.f=j):(P.e-=S.scrollX*v.scrollFactorX,P.f-=S.scrollY*v.scrollFactorY),w.multiply(P),S.roundPixels&&(w.e=Math.round(w.e),w.f=Math.round(w.f)),C.save(),w.setToContext(C),C.globalCompositeOperation=this.blendModes[v.blendMode],C.globalAlpha=A,C.imageSmoothingEnabled=!m.source.scaleMode,v.mask&&v.mask.preRenderCanvas(this,v,S),D>0&&B>0&&(S.roundPixels?C.drawImage(m.source.image,O,I,D,B,Math.round(J),Math.round(Q),Math.round(D/z),Math.round(B/z)):C.drawImage(m.source.image,O,I,D,B,J,Q,D/z,B/z)),v.mask&&v.mask.postRenderCanvas(this,v,S),C.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});a.exports=d},55830:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CanvasRenderer:t(68627),GetBlendModes:t(56373),SetTransform:t(20926)}},56373:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(89289),h=function(){var o=[],l=p.supportNewBlendModes,n="source-over";return o[r.NORMAL]=n,o[r.ADD]="lighter",o[r.MULTIPLY]=l?"multiply":n,o[r.SCREEN]=l?"screen":n,o[r.OVERLAY]=l?"overlay":n,o[r.DARKEN]=l?"darken":n,o[r.LIGHTEN]=l?"lighten":n,o[r.COLOR_DODGE]=l?"color-dodge":n,o[r.COLOR_BURN]=l?"color-burn":n,o[r.HARD_LIGHT]=l?"hard-light":n,o[r.SOFT_LIGHT]=l?"soft-light":n,o[r.DIFFERENCE]=l?"difference":n,o[r.EXCLUSION]=l?"exclusion":n,o[r.HUE]=l?"hue":n,o[r.SATURATION]=l?"saturation":n,o[r.COLOR]=l?"color":n,o[r.LUMINOSITY]=l?"luminosity":n,o[r.ERASE]="destination-out",o[r.SOURCE_IN]="source-in",o[r.SOURCE_OUT]="source-out",o[r.SOURCE_ATOP]="source-atop",o[r.DESTINATION_OVER]="destination-over",o[r.DESTINATION_IN]="destination-in",o[r.DESTINATION_OUT]="destination-out",o[r.DESTINATION_ATOP]="destination-atop",o[r.LIGHTER]="lighter",o[r.COPY]="copy",o[r.XOR]="xor",o};a.exports=h},20926:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91296),p=function(h,o,l,n,u){var f=n.alpha*l.alpha;if(f<=0)return!1;var s=r(l,n,u).calc;return o.globalCompositeOperation=h.blendModes[l.blendMode],o.globalAlpha=f,o.save(),s.setToContext(o),o.imageSmoothingEnabled=l.frame?!l.frame.source.scaleMode:h.antialias,!0};a.exports=p},63899:a=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="losewebgl"},6119:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="postrender"},48070:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="prerender"},15640:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="render"},8912:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resize"},87124:a=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="restorewebgl"},92503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={LOSE_WEBGL:t(63899),POST_RENDER:t(6119),PRE_RENDER:t(48070),RENDER:t(15640),RESIZE:t(8912),RESTORE_WEBGL:t(87124)}},36909:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Events:t(92503),Snapshot:t(89966)},a.exports.Canvas=t(55830),a.exports.WebGL=t(4159)},32880:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=t(40987),h=t(95540),o=function(l,n){var u=h(n,"callback"),f=h(n,"type","image/png"),s=h(n,"encoder",.92),c=Math.abs(Math.round(h(n,"x",0))),d=Math.abs(Math.round(h(n,"y",0))),v=Math.floor(h(n,"width",l.width)),m=Math.floor(h(n,"height",l.height)),S=h(n,"getPixel",!1);if(S){var M=l.getContext("2d",{willReadFrequently:!1}),A=M.getImageData(c,d,1,1),C=A.data;u.call(null,new p(C[0],C[1],C[2],C[3]))}else if(c!==0||d!==0||v!==l.width||m!==l.height){var w=r.createWebGL(this,v,m),P=w.getContext("2d",{willReadFrequently:!0});v>0&&m>0&&P.drawImage(l,c,d,v,m,0,0,v,m);var L=new Image;L.onerror=function(){u.call(null),r.remove(w)},L.onload=function(){u.call(null,L),r.remove(w)},L.src=w.toDataURL(f,s)}else{var O=new Image;O.onerror=function(){u.call(null)},O.onload=function(){u.call(null,O)},O.src=l.toDataURL(f,s)}};a.exports=o},88815:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=t(40987),h=t(95540),o=function(l,n){var u=l,f=h(n,"callback"),s=h(n,"type","image/png"),c=h(n,"encoder",.92),d=Math.abs(Math.round(h(n,"x",0))),v=Math.abs(Math.round(h(n,"y",0))),m=h(n,"getPixel",!1),S=h(n,"isFramebuffer",!1),M=S?h(n,"bufferWidth",1):u.drawingBufferWidth,A=S?h(n,"bufferHeight",1):u.drawingBufferHeight;if(m){var C=new Uint8Array(4),w=S?v:A-v;u.readPixels(d,w,1,1,u.RGBA,u.UNSIGNED_BYTE,C),f.call(null,new p(C[0],C[1],C[2],C[3]))}else{var P=Math.floor(h(n,"width",M)),L=Math.floor(h(n,"height",A)),O=P*L*4,I=new Uint8Array(O);u.readPixels(d,A-v-L,P,L,u.RGBA,u.UNSIGNED_BYTE,I);for(var D=r.createWebGL(this,P,L),B=D.getContext("2d",{willReadFrequently:!0}),G=B.getImageData(0,0,P,L),z=G.data,W=0;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Canvas:t(32880),WebGL:t(88815)}},7530:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(36060),h=t(90330),o=t(82264),l=t(95540),n=t(32302),u=t(63448),f=t(31302),s=t(58918),c=t(14811),d=t(92651),v=t(96569),m=t(56527),S=t(57516),M=t(43439),A=t(81041),C=t(12385),w=t(7589),P=t(95428),L=t(72905),O=new r({initialize:function(D){this.game=D.game,this.renderer=D,this.classes=new h([[p.UTILITY_PIPELINE,w],[p.MULTI_PIPELINE,S],[p.BITMAPMASK_PIPELINE,f],[p.SINGLE_PIPELINE,C],[p.ROPE_PIPELINE,A],[p.LIGHT_PIPELINE,v],[p.POINTLIGHT_PIPELINE,M],[p.MOBILE_PIPELINE,m]]),this.postPipelineClasses=new h,this.pipelines=new h,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,D,B){var G=this.renderer,z=this.renderTargets;this.frameInc=Math.floor(l(I,"frameInc",32));var W=G.width,k=G.height,J=this.game.config.disablePreFX,Q=this.game.config.disablePostFX;if(Q||this.postPipelineClasses.setAll([[String(c.BARREL),s.Barrel],[String(c.BLOOM),s.Bloom],[String(c.BLUR),s.Blur],[String(c.BOKEH),s.Bokeh],[String(c.CIRCLE),s.Circle],[String(c.COLOR_MATRIX),s.ColorMatrix],[String(c.DISPLACEMENT),s.Displacement],[String(c.GLOW),s.Glow],[String(c.GRADIENT),s.Gradient],[String(c.PIXELATE),s.Pixelate],[String(c.SHADOW),s.Shadow],[String(c.SHINE),s.Shine],[String(c.VIGNETTE),s.Vignette],[String(c.WIPE),s.Wipe]]),!J){this.classes.set(p.FX_PIPELINE,d);for(var Y=Math.min(W,k),K=Math.ceil(Y/this.frameInc),U=1;U=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatch:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;B=0;B--){var G=D[B];G.active&&G.preBatch(I)}}},postBatchCamera:function(I){if(I.hasPostPipeline){this.flush();for(var D=I.postPipelines,B=0;Bthis.maxDimension)return this.targetIndex=D.length-B,D[this.targetIndex];var G=(u(I,this.frameInc,0,!0)-1)*B;return this.targetIndex=G,D[G]},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}});a.exports=O},32302:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(92503),h=new r({initialize:function(l,n,u,f,s,c,d,v,m){f===void 0&&(f=1),s===void 0&&(s=0),c===void 0&&(c=!0),d===void 0&&(d=!1),v===void 0&&(v=!0),m===void 0&&(m=!0),this.renderer=l,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=f,this.minFilter=s,this.autoClear=c,this.autoResize=!0,this.hasDepthBuffer=v,this.forceClamp=m,this.resize(n,u),d?this.setAutoResize(!0):this.autoResize=!1},setAutoResize:function(o){return o&&!this.autoResize?(this.renderer.on(p.RESIZE,this.resize,this),this.autoResize=!0):!o&&this.autoResize&&(this.renderer.off(p.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(o,l){if(o=Math.round(o*this.scale),l=Math.round(l*this.scale),o<=0&&(o=1),l<=0&&(l=1),this.autoResize&&(o!==this.width||l!==this.height)){var n=this.renderer;n.deleteFramebuffer(this.framebuffer),n.deleteTexture(this.texture),this.texture=n.createTextureFromSource(null,o,l,this.minFilter,this.forceClamp),this.framebuffer=n.createFramebuffer(o,l,this.texture,this.hasDepthBuffer),this.width=o,this.height=l}return this},willResize:function(o,l){return o=Math.round(o*this.scale),l=Math.round(l*this.scale),o<=0&&(o=1),l<=0&&(l=1),o!==this.width||l!==this.height},bind:function(o,l,n){o===void 0&&(o=!1);var u=this.renderer;if(o&&u.flush(),l&&n&&this.resize(l,n),u.pushFramebuffer(this.framebuffer,!1,!1),o&&this.adjustViewport(),this.autoClear){var f=this.renderer.gl;f.clearColor(0,0,0,0),f.clear(f.COLOR_BUFFER_BIT)}u.clearStencilMask()},adjustViewport:function(){var o=this.renderer.gl;o.viewport(0,0,this.width,this.height),o.disable(o.SCISSOR_TEST)},clear:function(){var o=this.renderer,l=o.gl;o.pushFramebuffer(this.framebuffer),l.disable(l.SCISSOR_TEST),l.clearColor(0,0,0,0),l.clear(l.COLOR_BUFFER_BIT),o.popFramebuffer(),o.resetScissor()},unbind:function(o){o===void 0&&(o=!1);var l=this.renderer;return o&&l.flush(),l.popFramebuffer()},destroy:function(){var o=this.renderer;o.off(p.RESIZE,this.resize,this),o.deleteFramebuffer(this.framebuffer),o.deleteTexture(this.texture),this.renderer=null,this.framebuffer=null,this.texture=null}});a.exports=h},70554:a=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @author Matthew Groves <@doormat> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={getTintFromFloats:function(y,t,r,p){var h=(y*255|0)&255,o=(t*255|0)&255,l=(r*255|0)&255,n=(p*255|0)&255;return(n<<24|h<<16|o<<8|l)>>>0},getTintAppendFloatAlpha:function(y,t){var r=(t*255|0)&255;return(r<<24|y)>>>0},getTintAppendFloatAlphaAndSwap:function(y,t){var r=(y>>16|0)&255,p=(y>>8|0)&255,h=(y|0)&255,o=(t*255|0)&255;return(o<<24|h<<16|p<<8|r)>>>0},getFloatsFromUintRGB:function(y){var t=(y>>16|0)&255,r=(y>>8|0)&255,p=(y|0)&255;return[t/255,r/255,p/255]},checkShaderMax:function(y,t){var r=Math.min(16,y.getParameter(y.MAX_TEXTURE_IMAGE_UNITS));return!t||t===-1?r:Math.min(r,t)},parseFragmentShaderMaxTextures:function(y,t){if(!y)return"";for(var r="",p=0;p0&&(r+=` - else `),p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(62644),h=t(50792),o=t(77085),l=t(95540),n=t(37867),u=t(92503),f=t(32302),s=t(70554),c=t(38683),d=new r({Extends:h,initialize:function(m){h.call(this);var S=m.game,M=S.renderer,A=M.gl;this.name=l(m,"name","WebGLPipeline"),this.game=S,this.renderer=M,this.manager,this.gl=A,this.view=S.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.activeBuffer,this.topology=l(m,"topology",A.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.forceZero=l(m,"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=m,this.glReset=!1,this.batch=[],this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,this.activeTextures=[],this.resizeUniform=l(m,"resizeUniform","")},boot:function(){var v,m=this.gl,S=this.config,M=this.renderer;this.isPostFX||(this.projectionMatrix=new n().identity());var A=this.renderTargets,C=l(S,"renderTarget",!1);typeof C=="boolean"&&C&&(C=1);var w=M.width,P=M.height;if(typeof C=="number")for(v=0;vW&&(W=z[v].vertexSize);var k=l(S,"batchSize",M.config.batchSize);this.vertexCapacity=k*6;var J=new ArrayBuffer(this.vertexCapacity*W);this.vertexData=J,this.bytes=new Uint8Array(J),this.vertexViewF32=new Float32Array(J),this.vertexViewU32=new Uint32Array(J);var Q=l(S,"vertices",null);for(Q?(this.vertexViewF32.set(Q),this.vertexBuffer=M.createVertexBuffer(J,m.STATIC_DRAW)):this.vertexBuffer=M.createVertexBuffer(J.byteLength,m.DYNAMIC_DRAW),this.setVertexBuffer(),v=z.length-1;v>=0;v--)z[v].rebind();this.hasBooted=!0,M.on(u.RESIZE,this.resize,this),M.on(u.PRE_RENDER,this.onPreRender,this),M.on(u.RENDER,this.onRender,this),M.on(u.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(v,m,S){var M=this.renderer;if(v!==this.currentShader||M.currentProgram!==this.currentShader.program){this.flush();var A=this.setVertexBuffer(S);A&&!m&&(m=!0),v.bind(m,!1),this.currentShader=v}return this},getShaderByName:function(v){for(var m=this.shaders,S=0;S-1&&(z=Y.substring(20))}W&&k&&B.push(new c(this,z,W,k,p(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(v){return this.currentBatch={start:this.vertexCount,count:0,texture:[v],unit:0,maxUnit:0},this.currentUnit=0,this.currentTexture=v,this.batch.push(this.currentBatch),0},addTextureToBatch:function(v){var m=this.currentBatch;m&&(m.texture.push(v),m.unit++,m.maxUnit++)},pushBatch:function(v){if(!this.currentBatch||this.forceZero&&v!==this.currentTexture)return this.createBatch(v);if(v===this.currentTexture)return this.currentUnit;var m=this.currentBatch,S=m.texture.indexOf(v);return S===-1?m.texture.length===this.renderer.maxTextures?this.createBatch(v):(m.unit++,m.maxUnit++,m.texture.push(v),this.currentUnit=m.unit,this.currentTexture=v,m.unit):(this.currentUnit=S,this.currentTexture=v,S)},setGameObject:function(v,m){return m===void 0&&(m=v.frame),this.pushBatch(m.source.glTexture)},shouldFlush:function(v){return v===void 0&&(v=0),this.vertexCount+v>this.vertexCapacity},vertexAvailable:function(){return this.vertexCapacity-this.vertexCount},resize:function(v,m){(v!==this.width||m!==this.height)&&this.flush(),this.width=v,this.height=m;for(var S=this.renderTargets,M=0;M=0;S--){var M=m[S].rebind();(!v||M===v)&&(this.currentShader=M)}return this.activeTextures.length=0,this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,this},restoreContext:function(){var v=this.shaders,m=!!this.vertexBuffer;this.activeBuffer=null,this.activeTextures.length=0,this.batch.length=0,this.currentBatch=null,this.currentTexture=null,this.currentUnit=0,m&&this.setVertexBuffer();for(var S=0;S0){this.emit(o.BEFORE_FLUSH,this,v),this.onBeforeFlush(v);var m=this.gl,S=this.vertexCount,M=this.currentShader.vertexSize,A=this.topology;if(this.active){this.setVertexBuffer(),S===this.vertexCapacity?m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.DYNAMIC_DRAW):m.bufferSubData(m.ARRAY_BUFFER,0,this.bytes.subarray(0,S*M));var C,w,P,L=this.batch,O=this.activeTextures;if(this.forceZero)for(O[0]||m.activeTexture(m.TEXTURE0),C=0;C{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95428),p=t(72905),h=t(19715),o=t(83419),l=t(8054),n=t(50792),u=t(92503),f=t(50030),s=t(37867),c=t(29747),d=t(7530),v=t(32302),m=t(97480),S=t(69442),M=t(70554),A=t(88815),C=t(26128),w=t(1482),P=t(82751),L=t(84387),O=t(93567),I=t(57183),D=new o({Extends:n,initialize:function(G){n.call(this);var z=G.config,W={alpha:z.transparent,desynchronized:z.desynchronized,depth:!0,antialias:z.antialiasGL,premultipliedAlpha:z.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:z.failIfMajorPerformanceCaveat,powerPreference:z.powerPreference,preserveDrawingBuffer:z.preserveDrawingBuffer,willReadFrequently:!1};this.config={clearBeforeRender:z.clearBeforeRender,antialias:z.antialias,backgroundColor:z.backgroundColor,contextCreation:W,roundPixels:z.roundPixels,maxTextures:z.maxTextures,maxTextureSize:z.maxTextureSize,batchSize:z.batchSize,maxLights:z.maxLights,mipmapFilter:z.mipmapFilter},this.game=G,this.type=l.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=G.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=c,this.contextRestoredHandler=c,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats,this.compression,this.drawingBufferHeight=0,this.blankTexture=null,this.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 G,z=this.game,W=this.canvas,k=B.backgroundColor;if(z.config.context?G=z.config.context:G=W.getContext("webgl",B.contextCreation)||W.getContext("experimental-webgl",B.contextCreation),!G||G.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=G;var J=this,Q=function(){var U=G.getSupportedExtensions();J.supportedExtensions=U;var V="ANGLE_instanced_arrays";J.instancedArraysExtension=U.indexOf(V)>-1?G.getExtension(V):null;var j="OES_vertex_array_object";J.vaoExtension=U.indexOf(j)>-1?G.getExtension(j):null};Q(),this.contextLostHandler=function(U){J.contextLost=!0,console&&console.warn("WebGL Context lost. Renderer disabled"),J.emit(u.LOSE_WEBGL,J),U.preventDefault()},W.addEventListener("webglcontextlost",this.contextLostHandler,!1),this.contextRestoredHandler=function(U){if(G.isContextLost()){console&&console.log("WebGL Context restored, but context is still lost");return}J.currentProgram=null,J.currentFramebuffer=null,J.setBlendMode(l.BlendModes.NORMAL),G.disable(G.BLEND),G.disable(G.DEPTH_TEST),G.enable(G.CULL_FACE),J.compression=J.getCompressedTextures();var V=function(j){j.createResource()};r(J.glTextureWrappers,V),r(J.glBufferWrappers,V),r(J.glFramebufferWrappers,V),r(J.glProgramWrappers,V),r(J.glAttribLocationWrappers,V),r(J.glUniformLocationWrappers,V),J.createTemporaryTextures(),J.pipelines.restoreContext(),J.resize(J.game.scale.baseSize.width,J.game.scale.baseSize.height),Q(),J.contextLost=!1,console&&console.warn("WebGL Context restored. Renderer running again."),J.emit(u.RESTORE_WEBGL,J),U.preventDefault()},W.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),z.context=G;for(var Y=0;Y<=27;Y++)this.blendModes.push({func:[G.ONE,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_ADD});this.blendModes[1].func=[G.ONE,G.DST_ALPHA],this.blendModes[2].func=[G.DST_COLOR,G.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[G.ONE,G.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[G.ZERO,G.ONE_MINUS_SRC_ALPHA],equation:G.FUNC_REVERSE_SUBTRACT},this.glFormats=[G.BYTE,G.SHORT,G.UNSIGNED_BYTE,G.UNSIGNED_SHORT,G.FLOAT],this.glFuncMap={mat2:{func:G.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:G.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:G.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:G.uniform1f,length:1},"1fv":{func:G.uniform1fv,length:1},"1i":{func:G.uniform1i,length:1},"1iv":{func:G.uniform1iv,length:1},"2f":{func:G.uniform2f,length:2},"2fv":{func:G.uniform2fv,length:1},"2i":{func:G.uniform2i,length:2},"2iv":{func:G.uniform2iv,length:1},"3f":{func:G.uniform3f,length:3},"3fv":{func:G.uniform3fv,length:1},"3i":{func:G.uniform3i,length:3},"3iv":{func:G.uniform3iv,length:1},"4f":{func:G.uniform4f,length:4},"4fv":{func:G.uniform4fv,length:1},"4i":{func:G.uniform4i,length:4},"4iv":{func:G.uniform4iv,length:1}},(!B.maxTextures||B.maxTextures===-1)&&(B.maxTextures=G.getParameter(G.MAX_TEXTURE_IMAGE_UNITS)),B.maxTextureSize||(B.maxTextureSize=G.getParameter(G.MAX_TEXTURE_SIZE)),this.compression=this.getCompressedTextures(),G.disable(G.DEPTH_TEST),G.disable(G.CULL_FACE),G.enable(G.BLEND),G.clearColor(k.redGL,k.greenGL,k.blueGL,k.alphaGL);var K=["NEAREST","LINEAR","NEAREST_MIPMAP_NEAREST","LINEAR_MIPMAP_NEAREST","NEAREST_MIPMAP_LINEAR","LINEAR_MIPMAP_LINEAR"];return K.indexOf(B.mipmapFilter)!==-1&&(this.mipmapFilter=G[B.mipmapFilter]),this.maxTextures=M.checkShaderMax(G,B.maxTextures),this.textureIndexes=[],this.createTemporaryTextures(),this.pipelines=new d(this),this.setBlendMode(l.BlendModes.NORMAL),this.projectionMatrix=new s().identity(),z.textures.once(S.READY,this.boot,this),this},boot:function(){var B=this.game,G=this.pipelines,z=B.scale.baseSize,W=z.width,k=z.height;this.width=W,this.height=k,this.isBooted=!0,this.renderTarget=new v(this,W,k,1,0,!0,!0),this.maskTarget=new v(this,W,k,1,0,!0,!0),this.maskSource=new v(this,W,k,1,0,!0,!0);var J=B.config;G.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 Q=this.gl;Q.bindFramebuffer(Q.FRAMEBUFFER,null),Q.enable(Q.SCISSOR_TEST),B.scale.on(m.RESIZE,this.onResize,this),this.resize(W,k)},createTemporaryTextures:function(){for(var B=this.gl,G=0;G0&&W>0;if(Q&&Y){var K=Q[0],U=Q[1],V=Q[2],j=Q[3];Y=K!==B||U!==G||V!==z||j!==W}Y&&(this.flush(),J.scissor(B,k-G-W,z,W))},resetScissor:function(){var B=this.gl;B.enable(B.SCISSOR_TEST);var G=this.currentScissor;if(G){var z=G[0],W=G[1],k=G[2],J=G[3];k>0&&J>0&&B.scissor(z,this.drawingBufferHeight-W-J,k,J)}},popScissor:function(){var B=this.scissorStack;B.pop();var G=B[B.length-1];G&&this.setScissor(G[0],G[1],G[2],G[3]),this.currentScissor=G},hasActiveStencilMask:function(){var B=this.currentMask.mask,G=this.currentCameraMask.mask;return B&&B.isStencil||G&&G.isStencil},resetViewport:function(){var B=this.gl;B.viewport(0,0,this.width,this.height),this.drawingBufferHeight=B.drawingBufferHeight},setBlendMode:function(B,G){G===void 0&&(G=!1);var z=this.gl,W=this.blendModes[B];return G||B!==l.BlendModes.SKIP_CHECK&&this.currentBlendMode!==B?(this.flush(),z.enable(z.BLEND),z.blendEquation(W.equation),W.func.length>2?z.blendFuncSeparate(W.func[0],W.func[1],W.func[2],W.func[3]):z.blendFunc(W.func[0],W.func[1]),this.currentBlendMode=B,!0):!1},addBlendMode:function(B,G){var z=this.blendModes.push({func:B,equation:G});return z-1},updateBlendMode:function(B,G,z){return this.blendModes[B]&&(this.blendModes[B].func=G,z&&(this.blendModes[B].equation=z)),this},removeBlendMode:function(B){return B>17&&this.blendModes[B]&&this.blendModes.splice(B,1),this},pushFramebuffer:function(B,G,z,W,k){return B===this.currentFramebuffer?this:(this.fboStack.push(B),this.setFramebuffer(B,G,z,W,k))},setFramebuffer:function(B,G,z,W,k){if(G===void 0&&(G=!1),z===void 0&&(z=!0),W===void 0&&(W=null),k===void 0&&(k=!1),B===this.currentFramebuffer)return this;var J=this.gl,Q=this.width,Y=this.height;return B&&B.renderTexture&&z?(Q=B.renderTexture.width,Y=B.renderTexture.height):this.flush(),B?J.bindFramebuffer(J.FRAMEBUFFER,B.webGLFramebuffer):J.bindFramebuffer(J.FRAMEBUFFER,null),z&&J.viewport(0,0,Q,Y),W&&J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,W.webGLTexture,0),k&&(J.clearColor(0,0,0,0),J.clear(J.COLOR_BUFFER_BIT)),G&&(B?(this.drawingBufferHeight=Y,this.pushScissor(0,0,Q,Y)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=B,this},popFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack;z.pop();var W=z[z.length-1];return W||(W=null),this.setFramebuffer(W,B,G),W},restoreFramebuffer:function(B,G){B===void 0&&(B=!1),G===void 0&&(G=!0);var z=this.fboStack,W=z[z.length-1];W||(W=null),this.currentFramebuffer=null,this.setFramebuffer(W,B,G)},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,G,z,W,k){k===void 0&&(k=!1);var J=this.gl,Q=J.NEAREST,Y=J.NEAREST,K=J.CLAMP_TO_EDGE,U=null;G=B?B.width:G,z=B?B.height:z;var V=f(G,z);if(V&&!k&&(K=J.REPEAT),W===l.ScaleModes.LINEAR&&this.config.antialias){var j=B&&B.compressed,$=!j&&V||j&&B.mipmaps.length>1;Q=this.mipmapFilter&&$?this.mipmapFilter:J.LINEAR,Y=J.LINEAR}return!B&&typeof G=="number"&&typeof z=="number"?U=this.createTexture2D(0,Q,Y,K,K,J.RGBA,null,G,z):U=this.createTexture2D(0,Q,Y,K,K,J.RGBA,B),U},createTexture2D:function(B,G,z,W,k,J,Q,Y,K,U,V,j){typeof Y!="number"&&(Y=Q?Q.width:1),typeof K!="number"&&(K=Q?Q.height:1);var $=new P(this.gl,B,G,z,W,k,J,Q,Y,K,U,V,j);return this.glTextureWrappers.push($),$},createFramebuffer:function(B,G,z,W){this.currentFramebuffer=null;var k=new L(this.gl,B,G,z,W);return this.glFramebufferWrappers.push(k),k},beginBitmapMask:function(B,G){var z=this.gl;z&&(this.flush(),this.maskTarget.bind(!0),this.currentCameraMask.mask!==B&&(this.currentMask.mask=B,this.currentMask.camera=G))},drawBitmapMask:function(B,G,z){this.flush(),this.maskSource.bind(),this.setBlendMode(0,!0),B.renderWebGL(this,B,G),this.maskSource.unbind(!0),this.maskTarget.unbind();var W=this.gl,k=this.getCurrentStencilMask();k?(W.enable(W.STENCIL_TEST),k.mask.applyStencil(this,k.camera,!0)):this.currentMask.mask=null,this.pipelines.set(z),W.activeTexture(W.TEXTURE0),W.bindTexture(W.TEXTURE_2D,this.maskTarget.texture.webGLTexture),W.activeTexture(W.TEXTURE1),W.bindTexture(W.TEXTURE_2D,this.maskSource.texture.webGLTexture)},createProgram:function(B,G){var z=new w(this.gl,B,G);return this.glProgramWrappers.push(z),z},createVertexBuffer:function(B,G){var z=this.gl,W=new C(z,B,z.ARRAY_BUFFER,G);return this.glBufferWrappers.push(W),W},createAttribLocation:function(B,G){var z=new O(this.gl,B,G);return this.glAttribLocationWrappers.push(z),z},createUniformLocation:function(B,G){var z=new I(this.gl,B,G);return this.glUniformLocationWrappers.push(z),z},createIndexBuffer:function(B,G){var z=this.gl,W=new C(z,B,z.ELEMENT_ARRAY_BUFFER,G);return this.glBufferWrappers.push(W),W},deleteTexture:function(B){if(B)return p(this.glTextureWrappers,B),B.destroy(),this},deleteFramebuffer:function(B){return B?(p(this.fboStack,B),p(this.glFramebufferWrappers,B),B.destroy(),this):this},deleteProgram:function(B){return B&&(p(this.glProgramWrappers,B),B.destroy()),this},deleteAttribLocation:function(B){return B&&(p(this.glAttribLocationWrappers,B),B.destroy()),this},deleteUniformLocation:function(B){return B&&(p(this.glUniformLocationWrappers,B),B.destroy()),this},deleteBuffer:function(B){return B?(p(this.glBufferWrappers,B),B.destroy(),this):this},preRenderCamera:function(B){var G=B.x,z=B.y,W=B.width,k=B.height,J=B.backgroundColor;if(B.emit(h.PRE_RENDER,B),this.pipelines.preBatchCamera(B),this.pushScissor(G,z,W,k),B.mask&&(this.currentCameraMask.mask=B.mask,this.currentCameraMask.camera=B._maskCamera,B.mask.preRenderWebGL(this,B,B._maskCamera)),J.alphaGL>0){var Q=this.pipelines.setMulti();Q.drawFillRect(G,z,W,k,M.getTintFromFloats(J.blueGL,J.greenGL,J.redGL,1),J.alphaGL)}},getCurrentStencilMask:function(){var B=null,G=this.maskStack,z=this.currentCameraMask;return G.length>0?B=G[G.length-1]:z.mask&&z.mask.isStencil&&(B=z),B},postRenderCamera:function(B){var G=B.flashEffect,z=B.fadeEffect;if(G.isRunning||z.isRunning||z.isComplete){var W=this.pipelines.setMulti();G.postRenderWebGL(W,M.getTintFromFloats),z.postRenderWebGL(W,M.getTintFromFloats)}B.dirty=!1,this.popScissor(),B.mask&&(this.currentCameraMask.mask=null,B.mask.postRenderWebGL(this,B._maskCamera)),this.pipelines.postBatchCamera(B),B.emit(h.POST_RENDER,B)},preRender:function(){if(!this.contextLost){var B=this.gl;if(B.bindFramebuffer(B.FRAMEBUFFER,null),this.config.clearBeforeRender){var G=this.config.backgroundColor;B.clearColor(G.redGL,G.greenGL,G.blueGL,G.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(u.PRE_RENDER)}},render:function(B,G,z){if(!this.contextLost){var W=G.length;if(this.emit(u.RENDER,B,z),this.preRenderCamera(z),W===0){this.setBlendMode(l.BlendModes.NORMAL),this.postRenderCamera(z);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 r=t(83419),p=t(95428),h=t(95540),o=t(14500),l=new r({initialize:function(u,f,s,c,d){this.pipeline=u,this.name=f,this.renderer=u.renderer,this.gl=this.renderer.gl,this.fragSrc=c,this.vertSrc=s,this.program=this.renderer.createProgram(s,c),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(d),this.createUniforms()},createAttributes:function(n){var u=0,f=0,s=[];this.vertexComponentCount=0;for(var c=0;c=0?(u.enableVertexAttribArray(L.webGLAttribLocation),u.vertexAttribPointer(L.webGLAttribLocation,S,M,P,s,A),m.enabled=!0,m.location=L):L.webGLAttribLocation!==-1&&u.disableVertexAttribArray(L.webGLAttribLocation)}else C?u.vertexAttribPointer(w.webGLAttribLocation,S,M,P,s,A):!C&&w!==-1&&w.webGLAttribLocation>-1&&(u.disableVertexAttribArray(w.webGLAttribLocation),m.location=-1)}return this},createUniforms:function(){var n=this.gl,u=this.program,f=this.uniforms,s,c,d,v=n.getProgramParameter(u.webGLProgram,n.ACTIVE_UNIFORMS);for(s=0;s0&&(c=c.substr(0,S),f.hasOwnProperty(c)||(d=this.renderer.createUniformLocation(u,c),d!==null&&(f[c]={name:c,location:d,setter:null,value1:null,value2:null,value3:null,value4:null})))}}return this},syncUniforms:function(){var n=this.gl;this.renderer.setProgram(this.program);for(var u in this.uniforms){var f=this.uniforms[u];f.setter&&f.setter.call(n,f.location.webGLUniformLocation,f.value1,f.value2,f.value3,f.value4)}},hasUniform:function(n){return this.uniforms.hasOwnProperty(n)},resetUniform:function(n){var u=this.uniforms[n];return u&&(u.value1=null,u.value2=null,u.value3=null,u.value4=null),this},setUniform1:function(n,u,f,s){var c=this.uniforms[u];return c?((s||c.value1!==f)&&(c.setter||(c.setter=n),c.value1=f,this.renderer.setProgram(this.program),n.call(this.gl,c.location.webGLUniformLocation,f),this.pipeline.currentShader=this),this):this},setUniform2:function(n,u,f,s,c){var d=this.uniforms[u];return d?((c||d.value1!==f||d.value2!==s)&&(d.setter||(d.setter=n),d.value1=f,d.value2=s,this.renderer.setProgram(this.program),n.call(this.gl,d.location.webGLUniformLocation,f,s),this.pipeline.currentShader=this),this):this},setUniform3:function(n,u,f,s,c,d){var v=this.uniforms[u];return v?((d||v.value1!==f||v.value2!==s||v.value3!==c)&&(v.setter||(v.setter=n),v.value1=f,v.value2=s,v.value3=c,this.renderer.setProgram(this.program),n.call(this.gl,v.location.webGLUniformLocation,f,s,c),this.pipeline.currentShader=this),this):this},setUniform4:function(n,u,f,s,c,d,v){var m=this.uniforms[u];return m?((v||m.value1!==f||m.value2!==s||m.value3!==c||m.value4!==d)&&(m.setter||(m.setter=n),m.value1=f,m.value2=s,m.value3=c,m.value4=d,this.renderer.setProgram(this.program),n.call(this.gl,m.location.webGLUniformLocation,f,s,c,d),this.pipeline.currentShader=this),this):this},setBoolean:function(n,u){return this.setUniform1(this.gl.uniform1i,n,Number(u))},set1f:function(n,u){return this.setUniform1(this.gl.uniform1f,n,u)},set2f:function(n,u,f){return this.setUniform2(this.gl.uniform2f,n,u,f)},set3f:function(n,u,f,s){return this.setUniform3(this.gl.uniform3f,n,u,f,s)},set4f:function(n,u,f,s,c){return this.setUniform4(this.gl.uniform4f,n,u,f,s,c)},set1fv:function(n,u){return this.setUniform1(this.gl.uniform1fv,n,u,!0)},set2fv:function(n,u){return this.setUniform1(this.gl.uniform2fv,n,u,!0)},set3fv:function(n,u){return this.setUniform1(this.gl.uniform3fv,n,u,!0)},set4fv:function(n,u){return this.setUniform1(this.gl.uniform4fv,n,u,!0)},set1iv:function(n,u){return this.setUniform1(this.gl.uniform1iv,n,u,!0)},set2iv:function(n,u){return this.setUniform1(this.gl.uniform2iv,n,u,!0)},set3iv:function(n,u){return this.setUniform1(this.gl.uniform3iv,n,u,!0)},set4iv:function(n,u){return this.setUniform1(this.gl.uniform4iv,n,u,!0)},set1i:function(n,u){return this.setUniform1(this.gl.uniform1i,n,u)},set2i:function(n,u,f){return this.setUniform2(this.gl.uniform2i,n,u,f)},set3i:function(n,u,f,s){return this.setUniform3(this.gl.uniform3i,n,u,f,s)},set4i:function(n,u,f,s,c){return this.setUniform4(this.gl.uniform4i,n,u,f,s,c)},setMatrix2fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix2fv,n,u,f,!0)},setMatrix3fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix3fv,n,u,f,!0)},setMatrix4fv:function(n,u,f){return this.setUniform2(this.gl.uniformMatrix4fv,n,u,f,!0)},createProgram:function(n,u){return n===void 0&&(n=this.vertSrc),u===void 0&&(u=this.fragSrc),this.program&&this.renderer.deleteProgram(this.program),this.vertSrc=n,this.fragSrc=u,this.program=this.renderer.createProgram(n,u),this.createUniforms(),this.rebind()},destroy:function(){var n=this.renderer;p(this.uniforms,function(u){n.deleteUniformLocation(u.location)}),this.uniforms=null,p(this.attributes,function(u){n.deleteAttribLocation(u.location)}),this.attributes=null,n.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null}});a.exports=l},14500:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}};a.exports=y},4159:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(14500),p=t(79291),h={PipelineManager:t(7530),Pipelines:t(96615),RenderTarget:t(32302),Utils:t(70554),WebGLPipeline:t(29100),WebGLRenderer:t(74797),WebGLShader:t(38683),Wrappers:t(9503)};h=p(!1,h,r),a.exports=h},31302:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(78908),o=t(85191),l=t(14500),n=t(29100),u=new r({Extends:n,initialize:function(s){s.fragShader=p(s,"fragShader",h),s.vertShader=p(s,"vertShader",o),s.batchSize=p(s,"batchSize",1),s.vertices=p(s,"vertices",[-1,1,-1,-7,7,1]),s.attributes=p(s,"attributes",[{name:"inPosition",size:2,type:l.FLOAT}]),n.call(this,s)},boot:function(){n.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(f,s){n.prototype.resize.call(this,f,s),this.set2f("uResolution",f,s)},beginMask:function(f,s,c){this.renderer.beginBitmapMask(f,c)},endMask:function(f,s,c){var d=this.gl,v=this.renderer,m=f.bitmapMask;m&&d&&(v.drawBitmapMask(m,s,this),c&&this.set2f("uResolution",c.width,c.height),this.set1i("uInvertMaskAlpha",f.invertAlpha),d.drawArrays(this.topology,0,3),c&&this.set2f("uResolution",this.width,this.height),d.bindTexture(d.TEXTURE_2D,null))}});a.exports=u},92651:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(58918),h=t(14811),o=t(95540),l=t(43558),n=t(89350),u=t(70554),f=new r({Extends:l,initialize:function(c){c.shaders=[u.setGlowQuality(n.FXGlowFrag,c.game),n.FXShadowFrag,n.FXPixelateFrag,n.FXVignetteFrag,n.FXShineFrag,n.FXBlurLowFrag,n.FXBlurMedFrag,n.FXBlurHighFrag,n.FXGradientFrag,n.FXBloomFrag,n.ColorMatrixFrag,n.FXCircleFrag,n.FXBarrelFrag,n.FXDisplacementFrag,n.FXWipeFrag,n.FXBokehFrag],l.call(this,c);var d=this.game;this.glow=new p.Glow(d),this.shadow=new p.Shadow(d),this.pixelate=new p.Pixelate(d),this.vignette=new p.Vignette(d),this.shine=new p.Shine(d),this.gradient=new p.Gradient(d),this.circle=new p.Circle(d),this.barrel=new p.Barrel(d),this.wipe=new p.Wipe(d),this.bokeh=new p.Bokeh(d);var v=[];v[h.GLOW]=this.onGlow,v[h.SHADOW]=this.onShadow,v[h.PIXELATE]=this.onPixelate,v[h.VIGNETTE]=this.onVignette,v[h.SHINE]=this.onShine,v[h.BLUR]=this.onBlur,v[h.GRADIENT]=this.onGradient,v[h.BLOOM]=this.onBloom,v[h.COLOR_MATRIX]=this.onColorMatrix,v[h.CIRCLE]=this.onCircle,v[h.BARREL]=this.onBarrel,v[h.DISPLACEMENT]=this.onDisplacement,v[h.WIPE]=this.onWipe,v[h.BOKEH]=this.onBokeh,this.fxHandlers=v,this.source,this.target,this.swap},onDraw:function(s,c,d){this.source=s,this.target=c,this.swap=d;var v=s.width,m=s.height,S=this.tempSprite,M=this.fxHandlers;if(S&&S.preFX)for(var A=S.preFX.list,C=0;C{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(31063),o=t(57516),l=t(61340),n=t(26099),u=t(29100),f=new r({Extends:o,initialize:function(c){var d=p(c,"fragShader",h);c.fragShader=d.replace("%LIGHT_COUNT%",c.game.renderer.config.maxLights),o.call(this,c),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.currentNormalMap,this.lightsActive=!0,this.tempVec2=new n,this._tempMatrix=new l,this._tempMatrix2=new l},boot:function(){u.prototype.boot.call(this)},onRender:function(s,c){var d=s.sys.lights;if(this.lightsActive=!1,!(!d||!d.active)){var v=d.getLights(c),m=v.length;this.lightsActive=!0;var S,M=this.renderer,A=M.height,C=c.matrix,w=this.tempVec2;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",c.x,c.y,c.rotation,c.zoom),this.set3f("uAmbientLightColor",d.ambientColor.r,d.ambientColor.g,d.ambientColor.b),this.set1i("uLightCount",m),S=0;S0&&this.flush();var c=this.inverseRotationMatrix;if(s){var d=-s,v=Math.cos(d),m=Math.sin(d);c[1]=m,c[3]=-m,c[0]=c[4]=v}else c[0]=c[4]=1,c[1]=c[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,c),this.currentNormalMapRotation=s}},setTexture2D:function(s,c){var d=this.renderer;s===void 0&&(s=d.whiteTexture);var v=this.getNormalMap(c);this.isNewNormalMap(s,v)&&(this.flush(),this.createBatch(s),this.addTextureToBatch(v),this.currentNormalMap=v);var m=0;if(c&&c.parentContainer){var S=c.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);m=S.rotationNormalized}else c&&(m=c.rotation);return this.setNormalMapRotation(m),0},setGameObject:function(s,c){c===void 0&&(c=s.frame);var d=c.glTexture,v=this.getNormalMap(s);if(this.isNewNormalMap(d,v)&&(this.flush(),this.createBatch(d),this.addTextureToBatch(v),this.currentNormalMap=v),s.parentContainer){var m=s.getWorldTransformMatrix(this._tempMatrix,this._tempMatrix2);this.setNormalMapRotation(m.rotationNormalized)}else this.setNormalMapRotation(s.rotation);return 0},isNewNormalMap:function(s,c){return this.currentTexture!==s||this.currentNormalMap!==c},getNormalMap:function(s){var c;if(s)s.displayTexture?c=s.displayTexture.dataSource[s.displayFrame.sourceIndex]:s.texture?c=s.texture.dataSource[s.frame.sourceIndex]:s.tileset&&(Array.isArray(s.tileset)?c=s.tileset[0].image.dataSource[0]:c=s.tileset.image.dataSource[0]);else return this.renderer.normalTexture;return c?c.glTexture:this.renderer.normalTexture},batchSprite:function(s,c,d){this.lightsActive&&o.prototype.batchSprite.call(this,s,c,d)},batchTexture:function(s,c,d,v,m,S,M,A,C,w,P,L,O,I,D,B,G,z,W,k,J,Q,Y,K,U,V,j,$,q,it,nt,et){this.lightsActive&&o.prototype.batchTexture.call(this,s,c,d,v,m,S,M,A,C,w,P,L,O,I,D,B,G,z,W,k,J,Q,Y,K,U,V,j,$,q,it,nt,et)},batchTextureFrame:function(s,c,d,v,m,S,M){this.lightsActive&&o.prototype.batchTextureFrame.call(this,s,c,d,v,m,S,M)}});a.exports=f},56527:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(57516),o=t(45561),l=t(60722),n=t(14500),u=t(29100),f=new r({Extends:h,initialize:function(c){c.fragShader=p(c,"fragShader",o),c.vertShader=p(c,"vertShader",l),c.attributes=p(c,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:n.UNSIGNED_BYTE,normalized:!0}]),c.forceZero=!0,c.resizeUniform="uResolution",h.call(this,c)},boot:function(){u.prototype.boot.call(this);var s=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",s.width,s.height),this.set1i("uRoundPixels",s.config.roundPixels)}});a.exports=f},57516:(a,y,t)=>{/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(94811),h=t(95540),o=t(98840),l=t(44667),n=t(61340),u=t(70554),f=t(14500),s=t(29100),c=new r({Extends:s,initialize:function(v){var m=v.game.renderer,S=h(v,"fragShader",o);v.fragShader=u.parseFragmentShaderMaxTextures(S,m.maxTextures),v.vertShader=h(v,"vertShader",l),v.attributes=h(v,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:f.UNSIGNED_BYTE,normalized:!0}]),v.resizeUniform="uResolution",s.call(this,v),this._tempMatrix1=new n,this._tempMatrix2=new n,this._tempMatrix3=new n,this.calcMatrix=new n,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 d=this.renderer;this.set1iv("uMainSampler",d.textureIndexes),this.set2f("uResolution",d.width,d.height),this.set1i("uRoundPixels",d.config.roundPixels)},batchSprite:function(d,v,m){this.manager.set(this,d);var S=this._tempMatrix1,M=this._tempMatrix2,A=this._tempMatrix3,C=d.frame,w=C.glTexture,P=C.u0,L=C.v0,O=C.u1,I=C.v1,D=C.x,B=C.y,G=C.cutWidth,z=C.cutHeight,W=C.customPivot,k=d.displayOriginX,J=d.displayOriginY,Q=-k+D,Y=-J+B;if(d.isCropped){var K=d._crop;(K.flipX!==d.flipX||K.flipY!==d.flipY)&&C.updateCropUVs(K,d.flipX,d.flipY),P=K.u0,L=K.v0,O=K.u1,I=K.v1,G=K.width,z=K.height,D=K.x,B=K.y,Q=-k+D,Y=-J+B}var U=1,V=1;d.flipX&&(W||(Q+=-C.realWidth+k*2),U=-1),d.flipY&&(W||(Y+=-C.realHeight+J*2),V=-1);var j=d.x,$=d.y;M.applyITRS(j,$,d.rotation,d.scaleX*U,d.scaleY*V),S.copyFrom(v.matrix),m?(S.multiplyWithOffset(m,-v.scrollX*d.scrollFactorX,-v.scrollY*d.scrollFactorY),M.e=j,M.f=$):(M.e-=v.scrollX*d.scrollFactorX,M.f-=v.scrollY*d.scrollFactorY),S.multiply(M,A);var q=A.setQuad(Q,Y,Q+G,Y+z),it=u.getTintAppendFloatAlpha,nt=v.alpha,et=it(d.tintTopLeft,nt*d._alphaTL),ht=it(d.tintTopRight,nt*d._alphaTR),ut=it(d.tintBottomLeft,nt*d._alphaBL),dt=it(d.tintBottomRight,nt*d._alphaBR);this.shouldFlush(6)&&this.flush();var mt=this.setGameObject(d,C);this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",v.roundPixels),this.batchQuad(d,q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],P,L,O,I,et,ht,ut,dt,d.tintFill,w,mt),this.manager.postBatch(d)},batchTexture:function(d,v,m,S,M,A,C,w,P,L,O,I,D,B,G,z,W,k,J,Q,Y,K,U,V,j,$,q,it,nt,et,ht,ut,dt){dt===void 0&&(dt=!1),this.manager.set(this,d);var mt=this._tempMatrix1,gt=this._tempMatrix2,At=this._tempMatrix3,ot=k/m+q,st=J/S+it,yt=(k+Q)/m+q,Tt=(J+Y)/S+it,wt=C,Et=w,Gt=-z,Wt=-W;if(d.isCropped){var Jt=d._crop,$t=Jt.width,ee=Jt.height;wt=$t,Et=ee,C=$t,w=ee,k=Jt.x,J=Jt.y;var Nt=k,Te=J;I&&(Nt=Q-Jt.x-$t),D&&(Te=Y-Jt.y-ee),ot=Nt/m+q,st=Te/S+it,yt=(Nt+$t)/m+q,Tt=(Te+ee)/S+it,Gt=-z+k,Wt=-W+J}D=D^(!ht&&v.isRenderTexture?1:0),I&&(wt*=-1,Gt+=C),D&&(Et*=-1,Wt+=w),gt.applyITRS(M,A,O,P,L),mt.copyFrom(nt.matrix),et?(mt.multiplyWithOffset(et,-nt.scrollX*B,-nt.scrollY*G),gt.e=M,gt.f=A):(gt.e-=nt.scrollX*B,gt.f-=nt.scrollY*G),mt.multiply(gt,At);var le=At.setQuad(Gt,Wt,Gt+wt,Wt+Et);ut==null&&(ut=this.setTexture2D(v)),d&&!dt&&this.manager.preBatch(d),this.currentShader.set1i("uRoundPixels",nt.roundPixels),this.batchQuad(d,le[0],le[1],le[2],le[3],le[4],le[5],le[6],le[7],ot,st,yt,Tt,K,U,V,j,$,v,ut),d&&!dt&&this.manager.postBatch(d)},batchTextureFrame:function(d,v,m,S,M,A,C){this.manager.set(this);var w=this._tempMatrix1.copyFrom(A),P=this._tempMatrix2;C?w.multiply(C,P):P=w;var L=P.setQuad(v,m,v+d.width,m+d.height),O=this.setTexture2D(d.source.glTexture);S=u.getTintAppendFloatAlpha(S,M),this.batchQuad(null,L[0],L[1],L[2],L[3],L[4],L[5],L[6],L[7],d.u0,d.v0,d.u1,d.v1,S,S,S,S,0,d.glTexture,O)},batchFillRect:function(d,v,m,S,M,A){this.renderer.pipelines.set(this);var C=this.calcMatrix;A&&A.multiply(M,C);var w=C.setQuad(d,v,d+m,v+S),P=this.fillTint;this.batchQuad(null,w[0],w[1],w[2],w[3],w[4],w[5],w[6],w[7],0,0,1,1,P.TL,P.TR,P.BL,P.BR,2)},batchFillTriangle:function(d,v,m,S,M,A,C,w){this.renderer.pipelines.set(this);var P=this.calcMatrix;w&&w.multiply(C,P);var L=P.getX(d,v),O=P.getY(d,v),I=P.getX(m,S),D=P.getY(m,S),B=P.getX(M,A),G=P.getY(M,A),z=this.fillTint;this.currentShader.set1i("uRoundPixels",!1),this.batchTri(null,L,O,I,D,B,G,0,0,1,1,z.TL,z.TR,z.BL,2)},batchStrokeTriangle:function(d,v,m,S,M,A,C,w,P){var L=this.tempTriangle;L[0].x=d,L[0].y=v,L[0].width=C,L[1].x=m,L[1].y=S,L[1].width=C,L[2].x=M,L[2].y=A,L[2].width=C,L[3].x=d,L[3].y=v,L[3].width=C,this.batchStrokePath(L,C,!1,w,P)},batchFillPath:function(d,v,m){this.renderer.pipelines.set(this);var S=this.calcMatrix;m&&m.multiply(v,S);for(var M=d.length,A=this.polygonCache,C,w,P=this.fillTint.TL,L=this.fillTint.TR,O=this.fillTint.BL,I=0;I0&&wt[4]?this.batchQuad(null,mt,gt,et,ht,wt[0],wt[1],wt[2],wt[3],0,0,1,1,ot,st,yt,Tt,2):(Et[0]=mt,Et[1]=gt,Et[2]=et,Et[3]=ht,Et[4]=1),P&&Et[4]?this.batchQuad(null,it,nt,ut,dt,Et[0],Et[1],Et[2],Et[3],0,0,1,1,ot,st,yt,Tt,2):(wt[0]=it,wt[1]=nt,wt[2]=ut,wt[3]=dt,wt[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}});a.exports=c},43439:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(4127),o=t(89924),l=t(29100),n=new r({Extends:l,initialize:function(f){f.vertShader=p(f,"vertShader",o),f.fragShader=p(f,"fragShader",h),f.attributes=p(f,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),l.call(this,f)},onRender:function(u,f){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",f.zoom)},batchPointLight:function(u,f,s,c,d,v,m,S,M,A,C,w){var P=u.color,L=u.intensity,O=u.radius,I=u.attenuation,D=P.r*L,B=P.g*L,G=P.b*L,z=f.alpha*u.alpha;this.shouldFlush(6)&&this.flush(),this.currentBatch||this.setTexture2D(),this.batchLightVert(s,c,C,w,O,I,D,B,G,z),this.batchLightVert(d,v,C,w,O,I,D,B,G,z),this.batchLightVert(m,S,C,w,O,I,D,B,G,z),this.batchLightVert(s,c,C,w,O,I,D,B,G,z),this.batchLightVert(m,S,C,w,O,I,D,B,G,z),this.batchLightVert(M,A,C,w,O,I,D,B,G,z),this.currentBatch.count=this.vertexCount-this.currentBatch.start},batchLightVert:function(u,f,s,c,d,v,m,S,M,A){var C=this.vertexViewF32,w=this.vertexCount*this.currentShader.vertexComponentCount-1;C[++w]=u,C[++w]=f,C[++w]=s,C[++w]=c,C[++w]=d,C[++w]=v,C[++w]=m,C[++w]=S,C[++w]=M,C[++w]=A,this.vertexCount++}});a.exports=n},84057:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(89422),h=t(95540),o=t(27681),l=t(49627),n=t(29100),u=new r({Extends:n,initialize:function(s){s.renderTarget=h(s,"renderTarget",1),s.fragShader=h(s,"fragShader",o),s.vertShader=h(s,"vertShader",l),s.attributes=h(s,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),s.batchSize=1,s.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],n.call(this,s),this.isPostFX=!0,this.gameObject,this.controller,this.colorMatrix=new p,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines)},bootFX:function(){n.prototype.boot.call(this);var f=this.manager.UTILITY_PIPELINE;this.fullFrame1=f.fullFrame1,this.fullFrame2=f.fullFrame2,this.halfFrame1=f.halfFrame1,this.halfFrame2=f.halfFrame2;var s=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",s.width,s.height),this.set1i("uRoundPixels",s.config.roundPixels);for(var c=this.renderTargets,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(67502),h=t(83419),o=t(96293),l=t(95540),n=t(57516),u=t(27681),f=t(87841),s=t(32302),c=t(45561),d=t(60722),v=t(29100),m=new h({Extends:n,initialize:function(M){var A=l(M,"fragShader",u),C=l(M,"vertShader",d),w=l(M,"drawShader",u),P=[{name:"DrawSprite",fragShader:c,vertShader:d},{name:"CopySprite",fragShader:A,vertShader:C},{name:"DrawGame",fragShader:w,vertShader:d},{name:"ColorMatrix",fragShader:o}],L=l(M,"shaders",[]);M.shaders=P.concat(L),M.vertShader||(M.vertShader=C),M.batchSize=1,n.call(this,M),this.isPreFX=!0,this.customMainSampler=null,this.drawSpriteShader,this.copyShader,this.gameShader,this.colorMatrixShader,this.quadVertexData,this.quadVertexBuffer,this.quadVertexViewF32,this.spriteBounds=new f,this.targetBounds=new f,this.fsTarget,this.tempSprite,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){v.prototype.boot.call(this);var S=this.shaders,M=this.renderer;this.drawSpriteShader=S[0],this.copyShader=S[1],this.gameShader=S[2],this.colorMatrixShader=S[3],this.fsTarget=new s(M,M.width,M.height,1,0,!0,!0),this.renderTargets=this.manager.renderTargets.concat(this.fsTarget);var A=new ArrayBuffer(168);this.quadVertexData=A,this.quadVertexViewF32=new Float32Array(A),this.quadVertexBuffer=M.createVertexBuffer(A,this.gl.STATIC_DRAW),this.onResize(M.width,M.height),this.currentShader=this.copyShader,this.set2f("uResolution",M.width,M.height),this.set1i("uRoundPixels",M.config.roundPixels)},onResize:function(S,M){var A=this.quadVertexViewF32;A[1]=M,A[22]=M,A[14]=S,A[28]=S,A[35]=S,A[36]=M},batchQuad:function(S,M,A,C,w,P,L,O,I,D,B,G,z,W,k,J,Q,Y,K){var U=Math.min(M,C,P,O),V=Math.min(A,w,L,I),j=Math.max(M,C,P,O),$=Math.max(A,w,L,I),q=j-U,it=$-V,nt=this.spriteBounds.setTo(U,V,q,it),et=S?S.preFX.padding:0,ht=q+et*2,ut=it+et*2,dt=Math.abs(Math.max(ht,ut)),mt=this.manager.getRenderTarget(dt),gt=this.targetBounds.setTo(0,0,mt.width,mt.height);p(gt,nt.centerX,nt.centerY),this.tempSprite=S;var At=this.gl,ot=this.renderer;ot.clearStencilMask(),this.setShader(this.drawSpriteShader),this.set1i("uMainSampler",0),this.set2f("uResolution",ot.width,ot.height),this.set1i("uRoundPixels",ot.config.roundPixels),this.flipProjectionMatrix(!0),S&&(this.onDrawSprite(S,mt),S.preFX.onFX(this));var st=this.fsTarget;return this.flush(),At.viewport(0,0,ot.width,ot.height),At.bindFramebuffer(At.FRAMEBUFFER,st.framebuffer.webGLFramebuffer),At.framebufferTexture2D(At.FRAMEBUFFER,At.COLOR_ATTACHMENT0,At.TEXTURE_2D,st.texture.webGLTexture,0),At.clearColor(0,0,0,0),At.clear(At.COLOR_BUFFER_BIT),this.setTexture2D(K),this.batchVert(M,A,D,B,0,Y,W),this.batchVert(C,w,D,z,0,Y,J),this.batchVert(P,L,G,z,0,Y,Q),this.batchVert(M,A,D,B,0,Y,W),this.batchVert(P,L,G,z,0,Y,Q),this.batchVert(O,I,G,B,0,Y,k),this.flush(),this.flipProjectionMatrix(!1),At.activeTexture(At.TEXTURE0),At.bindTexture(At.TEXTURE_2D,mt.texture.webGLTexture),At.copyTexSubImage2D(At.TEXTURE_2D,0,0,0,gt.x,gt.y,gt.width,gt.height),At.bindFramebuffer(At.FRAMEBUFFER,null),At.bindTexture(At.TEXTURE_2D,null),this.onBatch(S),this.currentShader=this.copyShader,this.onDraw(mt,this.manager.getSwapRenderTarget(),this.manager.getAltSwapRenderTarget()),!0},onDrawSprite:function(){},onCopySprite:function(){},copySprite:function(S,M,A,C,w,P,L){A===void 0&&(A=!0),C===void 0&&(C=!0),w===void 0&&(w=!1),L===void 0&&(L=this.copyShader);var O=this.gl,I=this.tempSprite;P&&(L=this.colorMatrixShader),this.currentShader=L;var D=this.setVertexBuffer(this.quadVertexBuffer);L.bind(D,!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(S,M,I),P&&(this.set1fv("uColorMatrix",P.getData()),this.set1f("uAlpha",P.alpha)),O.activeTexture(O.TEXTURE0),O.bindTexture(O.TEXTURE_2D,S.texture.webGLTexture),S.height>M.height)O.viewport(0,0,S.width,S.height),this.setTargetUVs(S,M);else{var G=M.height-S.height;O.viewport(0,G,S.width,S.height),this.resetUVs()}if(O.bindFramebuffer(O.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),O.framebufferTexture2D(O.FRAMEBUFFER,O.COLOR_ATTACHMENT0,O.TEXTURE_2D,M.texture.webGLTexture,0),A&&(O.clearColor(0,0,0,+!C),O.clear(O.COLOR_BUFFER_BIT)),w){var z=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}O.bufferData(O.ARRAY_BUFFER,this.quadVertexData,O.STATIC_DRAW),O.drawArrays(O.TRIANGLES,0,6),w&&this.renderer.setBlendMode(z),O.bindFramebuffer(O.FRAMEBUFFER,null)},copy:function(S,M){var A=this.gl;this.set1i("uMainSampler",0),A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,S.texture.webGLTexture),A.viewport(0,0,S.width,S.height),this.setUVs(0,0,0,1,1,1,1,0),A.bindFramebuffer(A.FRAMEBUFFER,M.framebuffer.webGLFramebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,M.texture.webGLTexture,0),A.clearColor(0,0,0,0),A.clear(A.COLOR_BUFFER_BIT),A.bufferData(A.ARRAY_BUFFER,this.quadVertexData,A.STATIC_DRAW),A.drawArrays(A.TRIANGLES,0,6),A.bindFramebuffer(A.FRAMEBUFFER,null)},blendFrames:function(S,M,A,C,w){this.manager.blendFrames(S,M,A,C,w)},blendFramesAdditive:function(S,M,A,C,w){this.manager.blendFramesAdditive(S,M,A,C,w)},drawToGame:function(S){this.currentShader=null,this.setShader(this.copyShader),this.bindAndDraw(S)},copyToGame:function(S){this.currentShader=null,this.setShader(this.gameShader),this.bindAndDraw(S)},bindAndDraw:function(S){var M=this.gl,A=this.renderer;this.set1i("uMainSampler",0),this.customMainSampler?this.setTexture2D(this.customMainSampler):this.setTexture2D(S.texture);var C=this._tempMatrix1.loadIdentity(),w=this.targetBounds.x,P=this.targetBounds.y,L=w+S.width,O=P+S.height,I=C.getX(w,P),D=C.getX(w,O),B=C.getX(L,O),G=C.getX(L,P),z=C.getY(w,P),W=C.getY(w,O),k=C.getY(L,O),J=C.getY(L,P),Q=16777215;this.batchVert(I,z,0,0,0,0,Q),this.batchVert(D,W,0,1,0,0,Q),this.batchVert(B,k,1,1,0,0,Q),this.batchVert(I,z,0,0,0,0,Q),this.batchVert(B,k,1,1,0,0,Q),this.batchVert(G,J,1,0,0,0,Q),A.restoreFramebuffer(!1,!0),A.currentFramebuffer||M.viewport(0,0,A.width,A.height),A.restoreStencilMask(),this.flush(),this.tempSprite=null},onDraw:function(S){this.drawToGame(S)},setUVs:function(S,M,A,C,w,P,L,O){var I=this.quadVertexViewF32;I[2]=S,I[3]=M,I[9]=A,I[10]=C,I[16]=w,I[17]=P,I[23]=S,I[24]=M,I[30]=w,I[31]=P,I[37]=L,I[38]=O},setTargetUVs:function(S,M){var A=M.height/S.height;A>.5?A=.5-(A-.5):A=.5+(.5-A),this.setUVs(0,A,0,1+A,1,1+A,1,A)},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,n.prototype.destroy.call(this),this}});a.exports=m},81041:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(57516),o=new r({Extends:h,initialize:function(n){n.topology=5,n.batchSize=p(n,"batchSize",256),h.call(this,n)}});a.exports=o},12385:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(57516),o=t(45561),l=t(60722),n=t(29100),u=new r({Extends:h,initialize:function(s){s.fragShader=p(s,"fragShader",o),s.vertShader=p(s,"vertShader",l),s.forceZero=!0,h.call(this,s)},boot:function(){n.prototype.boot.call(this);var f=this.renderer;this.set1i("uMainSampler",0),this.set2f("uResolution",f.width,f.height),this.set1i("uRoundPixels",f.config.roundPixels)}});a.exports=u},7589:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35407),p=t(10312),h=t(83419),o=t(89422),l=t(96293),n=t(36682),u=t(95540),f=t(48247),s=t(49627),c=t(29100),d=new h({Extends:c,initialize:function(m){m.renderTarget=u(m,"renderTarget",[{scale:1,autoResize:!0},{scale:1,autoResize:!0},{scale:.5,autoResize:!0},{scale:.5,autoResize:!0}]),m.vertShader=u(m,"vertShader",s),m.shaders=u(m,"shaders",[{name:"Copy",fragShader:n},{name:"AddBlend",fragShader:r},{name:"LinearBlend",fragShader:f},{name:"ColorMatrix",fragShader:l}]),m.attributes=u(m,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),m.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],m.batchSize=1,c.call(this,m),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){c.prototype.boot.call(this);var v=this.shaders,m=this.renderTargets;this.copyShader=v[0],this.addShader=v[1],this.linearShader=v[2],this.colorMatrixShader=v[3],this.fullFrame1=m[0],this.fullFrame2=m[1],this.halfFrame1=m[2],this.halfFrame2=m[3]},copyFrame:function(v,m,S,M,A){S===void 0&&(S=1),M===void 0&&(M=!0),A===void 0&&(A=!0);var C=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),C.activeTexture(C.TEXTURE0),C.bindTexture(C.TEXTURE_2D,v.texture.webGLTexture),m?(C.viewport(0,0,m.width,m.height),C.bindFramebuffer(C.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),C.framebufferTexture2D(C.FRAMEBUFFER,C.COLOR_ATTACHMENT0,C.TEXTURE_2D,m.texture.webGLTexture,0)):C.viewport(0,0,v.width,v.height),M&&(A?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)},blitFrame:function(v,m,S,M,A,C,w){S===void 0&&(S=1),M===void 0&&(M=!0),A===void 0&&(A=!0),C===void 0&&(C=!1),w===void 0&&(w=!1);var P=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",S),P.activeTexture(P.TEXTURE0),P.bindTexture(P.TEXTURE_2D,v.texture.webGLTexture),v.height>m.height)P.viewport(0,0,v.width,v.height),this.setTargetUVs(v,m);else{var L=m.height-v.height;P.viewport(0,L,v.width,v.height)}if(P.bindFramebuffer(P.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,m.texture.webGLTexture,0),M&&(A?P.clearColor(0,0,0,0):P.clearColor(0,0,0,1),P.clear(P.COLOR_BUFFER_BIT)),C){var O=this.renderer.currentBlendMode;this.renderer.setBlendMode(p.ERASE)}w&&this.flipY(),P.bufferData(P.ARRAY_BUFFER,this.vertexData,P.STATIC_DRAW),P.drawArrays(P.TRIANGLES,0,6),C&&this.renderer.setBlendMode(O),P.bindFramebuffer(P.FRAMEBUFFER,null),P.bindTexture(P.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(v,m,S,M,A,C,w,P){w===void 0&&(w=!0),P===void 0&&(P=!0);var L=this.gl;L.bindFramebuffer(L.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),L.framebufferTexture2D(L.FRAMEBUFFER,L.COLOR_ATTACHMENT0,L.TEXTURE_2D,v.texture.webGLTexture,0),w&&(P?L.clearColor(0,0,0,0):L.clearColor(0,0,0,1),L.clear(L.COLOR_BUFFER_BIT)),L.activeTexture(L.TEXTURE0),L.bindTexture(L.TEXTURE_2D,m.texture.webGLTexture),L.copyTexSubImage2D(L.TEXTURE_2D,0,0,0,S,M,A,C),L.bindFramebuffer(L.FRAMEBUFFER,null),L.bindTexture(L.TEXTURE_2D,null)},copyToGame:function(v){var m=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),m.activeTexture(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,v.texture.webGLTexture),m.bufferData(m.ARRAY_BUFFER,this.vertexData,m.STATIC_DRAW),m.drawArrays(m.TRIANGLES,0,6)},drawFrame:function(v,m,S,M){S===void 0&&(S=!0),M===void 0&&(M=this.colorMatrix);var A=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",M.getData()),this.set1f("uAlpha",M.alpha),A.activeTexture(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,v.texture.webGLTexture),m?(A.viewport(0,0,m.width,m.height),A.bindFramebuffer(A.FRAMEBUFFER,m.framebuffer.webGLFramebuffer),A.framebufferTexture2D(A.FRAMEBUFFER,A.COLOR_ATTACHMENT0,A.TEXTURE_2D,m.texture.webGLTexture,0)):A.viewport(0,0,v.width,v.height),S?A.clearColor(0,0,0,0):A.clearColor(0,0,0,1),A.clear(A.COLOR_BUFFER_BIT),A.bufferData(A.ARRAY_BUFFER,this.vertexData,A.STATIC_DRAW),A.drawArrays(A.TRIANGLES,0,6),A.bindFramebuffer(A.FRAMEBUFFER,null),A.bindTexture(A.TEXTURE_2D,null)},blendFrames:function(v,m,S,M,A,C){M===void 0&&(M=1),A===void 0&&(A=!0),C===void 0&&(C=this.linearShader);var w=this.gl;this.setShader(C),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",M),w.activeTexture(w.TEXTURE0),w.bindTexture(w.TEXTURE_2D,v.texture.webGLTexture),w.activeTexture(w.TEXTURE1),w.bindTexture(w.TEXTURE_2D,m.texture.webGLTexture),S?(w.bindFramebuffer(w.FRAMEBUFFER,S.framebuffer.webGLFramebuffer),w.framebufferTexture2D(w.FRAMEBUFFER,w.COLOR_ATTACHMENT0,w.TEXTURE_2D,S.texture.webGLTexture,0),w.viewport(0,0,S.width,S.height)):w.viewport(0,0,v.width,v.height),A?w.clearColor(0,0,0,0):w.clearColor(0,0,0,1),w.clear(w.COLOR_BUFFER_BIT),w.bufferData(w.ARRAY_BUFFER,this.vertexData,w.STATIC_DRAW),w.drawArrays(w.TRIANGLES,0,6),w.bindFramebuffer(w.FRAMEBUFFER,null),w.bindTexture(w.TEXTURE_2D,null)},blendFramesAdditive:function(v,m,S,M,A){this.blendFrames(v,m,S,M,A,this.addShader)},clearFrame:function(v,m){m===void 0&&(m=!0);var S=this.gl;S.viewport(0,0,v.width,v.height),S.bindFramebuffer(S.FRAMEBUFFER,v.framebuffer.webGLFramebuffer),m?S.clearColor(0,0,0,0):S.clearColor(0,0,0,1),S.clear(S.COLOR_BUFFER_BIT);var M=this.renderer.currentFramebuffer;S.bindFramebuffer(S.FRAMEBUFFER,M.webGLFramebuffer)},setUVs:function(v,m,S,M,A,C,w,P){var L=this.vertexViewF32;L[2]=v,L[3]=m,L[6]=S,L[7]=M,L[10]=A,L[11]=C,L[14]=v,L[15]=m,L[18]=A,L[19]=C,L[22]=w,L[23]=P},setTargetUVs:function(v,m){var S=m.height/v.height;S>.5?S=.5-(S-.5):S=.5+(.5-S),this.setUVs(0,S,0,1+S,1,1+S,1,S)},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)}});a.exports=d},36060:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline",MOBILE_PIPELINE:"MobilePipeline",FX_PIPELINE:"FxPipeline"};a.exports=y},84817:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelineafterflush"},36712:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelinebeforeflush"},40285:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelinebind"},65918:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelineboot"},92852:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelinedestroy"},56072:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelinerebind"},57566:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pipelineresize"},77085:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AFTER_FLUSH:t(84817),BEFORE_FLUSH:t(36712),BIND:t(40285),BOOT:t(65918),DESTROY:t(92852),REBIND:t(56072),RESIZE:t(57566)}},54812:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(99155),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n){l=this.getController(l),this.set1f("amount",l.amount,n)}});a.exports=o},67329:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(24400),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.steps=4,this.offsetX=1,this.offsetY=1,this.blurStrength=1,this.strength=1,this.glcolor=[1,1,1]},onPreRender:function(l){l=this.getController(l),this.set1f("strength",l.blurStrength),this.set3fv("color",l.glcolor)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1,f=this.fullFrame2;this.copyFrame(l,f);for(var s=2/l.width*n.offsetX,c=2/l.height*n.offsetY,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(41514),h=t(51078),o=t(94328),l=t(84057),n=new r({Extends:l,initialize:function(f){l.call(this,{game:f,shaders:[{name:"Gaussian5",fragShader:p},{name:"Gaussian9",fragShader:h},{name:"Gaussian13",fragShader:o}]}),this.activeShader=this.shaders[0],this.x=2,this.y=2,this.steps=4,this.strength=1,this.glcolor=[1,1,1]},setQualityLow:function(){return this.activeShader=this.shaders[0],this},setQualityMedium:function(){return this.activeShader=this.shaders[1],this},setQualityHigh:function(){return this.activeShader=this.shaders[2],this},onDraw:function(u){var f=this.getController(),s=this.gl,c=this.fullFrame1,d=s.getParameter(s.FRAMEBUFFER_BINDING);this.bind(this.shaders[f.quality]),s.activeTexture(s.TEXTURE0),s.viewport(0,0,u.width,u.height),this.set1i("uMainSampler",0),this.set2f("resolution",u.width,u.height),this.set1f("strength",f.strength),this.set3fv("color",f.glcolor);for(var v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(90610),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.isTiltShift=!1,this.strength=1,this.blurX=1,this.blurY=1,this.radius=.5,this.amount=1,this.contrast=.2},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("amount",l.amount,n),this.set1f("contrast",l.contrast,n),this.set1f("strength",l.strength,n),this.set2f("blur",l.blurX,l.blurY,n),this.setBoolean("isTiltShift",l.isTiltShift,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});a.exports=o},89428:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(91899),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.scale=1,this.feather=.005,this.thickness=8,this.glcolor=[1,.2,.7],this.glcolor2=[1,0,0,.4]},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("scale",l.scale,n),this.set1f("feather",l.feather,n),this.set1f("thickness",l.thickness,n),this.set3fv("color",l.glcolor,n),this.set4fv("backgroundColor",l.glcolor2,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});a.exports=o},88904:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(84057),h=new r({Extends:p,initialize:function(l){p.call(this,{game:l})},onDraw:function(o){var l=this.fullFrame1;this.controller?this.manager.drawFrame(o,l,!0,this.controller):this.drawFrame(o,l),this.copyToGame(l)}});a.exports=h},63563:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(47838),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.005,this.y=.005,this.glTexture},onBoot:function(){this.setTexture("__WHITE")},setTexture:function(l){var n=this.game.textures.getFrame(l);n&&(this.glTexture=n.glTexture)},onDraw:function(l){var n=this.getController(),u=this.fullFrame1;this.bind(),this.set1i("uMainSampler",0),this.set1i("uDisplacementSampler",1),this.set2f("amount",n.x,n.y),this.bindTexture(n.glTexture,1),this.copySprite(l,u),this.copyToGame(u)}});a.exports=o},94045:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=t(98656),o=t(84057),l=t(70554),n=new r({Extends:o,initialize:function(f,s){var c=p(s,"quality",.1),d=p(s,"distance",10);o.call(this,{game:f,fragShader:l.setGlowQuality(h,f,c,d)}),this.outerStrength=4,this.innerStrength=0,this.knockout=!1,this.glcolor=[1,1,1,1]},onPreRender:function(u,f,s,c){u=this.getController(u),this.set1f("outerStrength",u.outerStrength,f),this.set1f("innerStrength",u.innerStrength,f),this.set4fv("glowColor",u.glcolor,f),this.setBoolean("knockout",u.knockout,f),s&&c&&this.set2f("resolution",s,c,f)},onDraw:function(u){this.set2f("resolution",u.width,u.height),this.bindAndDraw(u)}});a.exports=n},74088:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(70463),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.alpha=.2,this.size=0,this.fromX=0,this.fromY=0,this.toX=0,this.toY=1,this.glcolor1=[255,0,0],this.glcolor2=[0,255,0]},onPreRender:function(l,n){l=this.getController(l),this.set1f("alpha",l.alpha,n),this.set1i("size",l.size,n),this.set3fv("color1",l.glcolor1,n),this.set3fv("color2",l.glcolor2,n),this.set2f("positionFrom",l.fromX,l.fromY,n),this.set2f("positionTo",l.toX,l.toY,n)}});a.exports=o},99636:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50831),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.amount=1},onPreRender:function(l,n,u,f){l=this.getController(l),this.set1f("amount",l.amount,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});a.exports=o},34700:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(92595),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=0,this.y=0,this.decay=.1,this.power=1,this.glcolor=[0,0,0,1],this.samples=6,this.intensity=1},onPreRender:function(l,n){l=this.getController(l);var u=l.samples;this.set1i("samples",u,n),this.set1f("intensity",l.intensity,n),this.set1f("decay",l.decay,n),this.set1f("power",l.power/u,n),this.set2f("lightPosition",l.x,l.y,n),this.set4fv("color",l.glcolor,n)}});a.exports=o},91157:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(72464),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.speed=.5,this.lineWidth=.5,this.gradient=3,this.reveal=!1},onPreRender:function(l,n,u,f){l=this.getController(l),this.setTime("time",n),this.set1f("speed",l.speed,n),this.set1f("lineWidth",l.lineWidth,n),this.set1f("gradient",l.gradient,n),this.setBoolean("reveal",l.reveal,n),u&&f&&this.set2f("resolution",u,f,n)},onDraw:function(l){this.set2f("resolution",l.width,l.height),this.bindAndDraw(l)}});a.exports=o},27797:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(39249),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.x=.5,this.y=.5,this.radius=.5,this.strength=.5},onPreRender:function(l,n){l=this.getController(l),this.set1f("radius",l.radius,n),this.set1f("strength",l.strength,n),this.set2f("position",l.x,l.y,n)}});a.exports=o},67603:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(2878),h=t(84057),o=new r({Extends:h,initialize:function(n){h.call(this,{game:n,fragShader:p}),this.progress=0,this.wipeWidth=.1,this.direction=0,this.axis=0,this.reveal=!1},onPreRender:function(l,n){l=this.getController(l);var u=l.progress,f=l.wipeWidth,s=l.direction,c=l.axis;this.set4f("config",u,f,s,c,n),this.setBoolean("reveal",l.reveal,n)}});a.exports=o},58918:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={Barrel:t(54812),Bloom:t(67329),Blur:t(8861),Bokeh:t(51051),Circle:t(89428),ColorMatrix:t(88904),Displacement:t(63563),Glow:t(94045),Gradient:t(74088),Pixelate:t(99636),Shadow:t(34700),Shine:t(91157),Vignette:t(27797),Wipe:t(67603)};a.exports=r},96615:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(36060),p=t(79291),h={FX:t(58918),BitmapMaskPipeline:t(31302),Events:t(77085),FXPipeline:t(92651),LightPipeline:t(96569),MobilePipeline:t(56527),MultiPipeline:t(57516),PointLightPipeline:t(43439),PostFXPipeline:t(84057),PreFXPipeline:t(43558),RopePipeline:t(81041),SinglePipeline:t(12385),UtilityPipeline:t(7589)};h=p(!1,h,r),a.exports=h},35407:a=>{a.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = frame1 + frame2 * uStrength;","}"].join(` -`)},78908:a=>{a.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","precision mediump float;","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," if (!uInvertMaskAlpha)"," {"," mainColor *= maskColor.a;"," }"," else"," {"," mainColor *= (1.0 - maskColor.a);"," }"," gl_FragColor = mainColor;","}"].join(` -`)},85191:a=>{a.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","precision mediump float;","attribute vec2 inPosition;","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}"].join(` -`)},96293:a=>{a.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","varying vec2 outTexCoord;","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);"," if (uAlpha == 0.0)"," {"," gl_FragColor = c;"," return;"," }"," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }"," vec4 result;"," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];"," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);"," rgb *= result.a;"," gl_FragColor = vec4(rgb, result.a);","}"].join(` -`)},36682:a=>{a.exports=["#define SHADER_NAME PHASER_COPY_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float uBrightness;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}"].join(` -`)},99155:a=>{a.exports=["#define SHADER_NAME BARREL_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float amount;","varying vec2 outTexCoord;","vec2 Distort(vec2 p)","{"," float theta = atan(p.y, p.x);"," float radius = length(p);"," radius = pow(radius, amount);"," p.x = radius * cos(theta);"," p.y = radius * sin(theta);"," return 0.5 * (p + 1.0);","}","void main()","{"," vec2 xy = 2.0 * outTexCoord - 1.0;"," vec2 texCoord = outTexCoord;"," if (length(xy) < 1.0)"," {"," texCoord = Distort(xy);"," }"," gl_FragColor = texture2D(uMainSampler, texCoord);","}"].join(` -`)},24400:a=>{a.exports=["#define SHADER_NAME BLOOM_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec4 sum = texture2D(uMainSampler, outTexCoord) * 0.204164 * strength;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord - offset * 1.407333) * 0.304005;"," sum = sum + texture2D(uMainSampler, outTexCoord + offset * 3.294215) * 0.093913;"," gl_FragColor = (sum + texture2D(uMainSampler, outTexCoord - offset * 3.294215) * 0.093913) * vec4(color, 1);","}"].join(` -`)},94328:a=>{a.exports=["#define SHADER_NAME BLUR_HIGH_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.411764705882353) * offset * strength;"," vec2 off2 = vec2(3.2941176470588234) * offset * strength;"," vec2 off3 = vec2(5.176470588235294) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.1964825501511404;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.2969069646728344;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.09447039785044732;"," col += texture2D(uMainSampler, uv + (off3 / resolution)) * 0.010381362401148057;"," col += texture2D(uMainSampler, uv - (off3 / resolution)) * 0.010381362401148057;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` -`)},41514:a=>{a.exports=["#define SHADER_NAME BLUR_LOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 offset = vec2(1.333) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.29411764705882354;"," col += texture2D(uMainSampler, uv + (offset / resolution)) * 0.35294117647058826;"," col += texture2D(uMainSampler, uv - (offset / resolution)) * 0.35294117647058826;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` -`)},51078:a=>{a.exports=["#define SHADER_NAME BLUR_MED_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec2 offset;","uniform float strength;","uniform vec3 color;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 col = vec4(0.0);"," vec2 off1 = vec2(1.3846153846) * offset * strength;"," vec2 off2 = vec2(3.2307692308) * offset * strength;"," col += texture2D(uMainSampler, uv) * 0.2270270270;"," col += texture2D(uMainSampler, uv + (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv - (off1 / resolution)) * 0.3162162162;"," col += texture2D(uMainSampler, uv + (off2 / resolution)) * 0.0702702703;"," col += texture2D(uMainSampler, uv - (off2 / resolution)) * 0.0702702703;"," gl_FragColor = col * vec4(color, 1.0);","}"].join(` -`)},90610:a=>{a.exports=["#define SHADER_NAME BOKEH_FS","precision mediump float;","#define ITERATIONS 100.0","#define ONEOVER_ITR 1.0 / ITERATIONS","#define PI 3.141596","#define GOLDEN_ANGLE 2.39996323","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float radius;","uniform float amount;","uniform float contrast;","uniform bool isTiltShift;","uniform float strength;","uniform vec2 blur;","varying vec2 outTexCoord;","vec2 Sample (in float theta, inout float r)","{"," r += 1.0 / r;"," return (r - 1.0) * vec2(cos(theta), sin(theta)) * 0.06;","}","vec3 Bokeh (sampler2D tex, vec2 uv, float radius)","{"," vec3 acc = vec3(0.0);"," vec3 div = vec3(0.0);"," vec2 pixel = vec2(resolution.y / resolution.x, 1.0) * radius * .025;"," float r = 1.0;"," for (float j = 0.0; j < GOLDEN_ANGLE * ITERATIONS; j += GOLDEN_ANGLE)"," {"," vec3 col = texture2D(tex, uv + pixel * Sample(j, r)).xyz;"," col = contrast > 0.0 ? col * col * (1.0 + contrast) : col;"," vec3 bokeh = vec3(0.5) + pow(col, vec3(10.0)) * amount;"," acc += col * bokeh;"," div += bokeh;"," }"," return acc / div;","}","void main ()","{"," float shift = 1.0;"," if (isTiltShift)"," {"," vec2 uv = vec2(gl_FragCoord.xy / resolution + vec2(-0.5, -0.5)) * 2.0;"," float centerStrength = 1.0;"," shift = length(uv * blur * strength) * centerStrength;"," }"," gl_FragColor = vec4(Bokeh(uMainSampler, outTexCoord * vec2(1.0, 1.0), radius * shift), 0.0);","}"].join(` -`)},91899:a=>{a.exports=["#define SHADER_NAME CIRCLE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform vec3 color;","uniform vec4 backgroundColor;","uniform float thickness;","uniform float scale;","uniform float feather;","varying vec2 outTexCoord;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 position = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;"," float aspectRatio = resolution.x / resolution.y;"," position.x *= aspectRatio;"," float grad = length(position);"," float outer = aspectRatio;"," float inner = outer - (thickness * 2.0 / resolution.y);"," if (aspectRatio >= 1.0)"," {"," float f = 2.0 + (resolution.y / resolution.x);"," outer = 1.0;"," inner = 1.0 - (thickness * f / resolution.x);"," }"," outer *= scale;"," inner *= scale;"," float circle = smoothstep(outer, outer - 0.01, grad);"," float ring = circle - smoothstep(inner, inner - feather, grad);"," texture = mix(backgroundColor * backgroundColor.a, texture, texture.a);"," texture = (texture * (circle - ring));"," gl_FragColor = vec4(texture.rgb + (ring * color), texture.a);","}"].join(` -`)},47838:a=>{a.exports=["#define SHADER_NAME DISPLACEMENT_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform sampler2D uDisplacementSampler;","uniform vec2 amount;","varying vec2 outTexCoord;","void main ()","{"," vec2 disp = (-vec2(0.5, 0.5) + texture2D(uDisplacementSampler, outTexCoord).rr) * amount;"," gl_FragColor = texture2D(uMainSampler, outTexCoord + disp).rgba;","}"].join(` -`)},98656:a=>{a.exports=["#define SHADER_NAME GLOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform float outerStrength;","uniform float innerStrength;","uniform vec2 resolution;","uniform vec4 glowColor;","uniform bool knockout;","const float PI = 3.14159265358979323846264;","const float DIST = __DIST__;","const float SIZE = min(__SIZE__, PI * 2.0);","const float STEP = ceil(PI * 2.0 / SIZE);","const float MAX_ALPHA = STEP * DIST * (DIST + 1.0) / 2.0;","void main ()","{"," vec2 px = vec2(1.0 / resolution.x, 1.0 / resolution.y);"," float totalAlpha = 0.0;"," vec2 direction;"," vec2 displaced;"," vec4 color;"," for (float angle = 0.0; angle < PI * 2.0; angle += SIZE)"," {"," direction = vec2(cos(angle), sin(angle)) * px;"," for (float curDistance = 0.0; curDistance < DIST; curDistance++)"," {"," displaced = outTexCoord + direction * (curDistance + 1.0);"," color = texture2D(uMainSampler, displaced);"," totalAlpha += (DIST - curDistance) * color.a;"," }"," }"," color = texture2D(uMainSampler, outTexCoord);"," float alphaRatio = (totalAlpha / MAX_ALPHA);"," float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * color.a;"," float innerGlowStrength = min(1.0, innerGlowAlpha);"," vec4 innerColor = mix(color, glowColor, innerGlowStrength);"," float outerGlowAlpha = alphaRatio * outerStrength * (1.0 - color.a);"," float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);"," vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;"," if (knockout)"," {"," float resultAlpha = outerGlowAlpha + innerGlowAlpha;"," gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);"," }"," else"," {"," gl_FragColor = innerColor + outerGlowColor;"," }","}"].join(` -`)},70463:a=>{a.exports=["#define SHADER_NAME GRADIENT_FS","#define SRGB_TO_LINEAR(c) pow((c), vec3(2.2))","#define LINEAR_TO_SRGB(c) pow((c), vec3(1.0 / 2.2))","#define SRGB(r, g, b) SRGB_TO_LINEAR(vec3(float(r), float(g), float(b)) / 255.0)","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 positionFrom;","uniform vec2 positionTo;","uniform vec3 color1;","uniform vec3 color2;","uniform float alpha;","uniform int size;","varying vec2 outTexCoord;","float gradientNoise(in vec2 uv)","{"," const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);"," return fract(magic.z * fract(dot(uv, magic.xy)));","}","float stepped (in float s, in float scale, in int steps)","{"," return steps > 0 ? floor( s / ((1.0 * scale) / float(steps))) * 1.0 / float(steps - 1) : s;","}","void main ()","{"," vec2 a = positionFrom;"," vec2 b = positionTo;"," vec2 ba = b - a;"," float d = dot(outTexCoord - a, ba) / dot(ba, ba);"," float t = size > 0 ? stepped(d, 1.0, size) : d;"," t = smoothstep(0.0, 1.0, clamp(t, 0.0, 1.0));"," vec3 color = mix(SRGB(color1.r, color1.g, color1.b), SRGB(color2.r, color2.g, color2.b), t);"," color = LINEAR_TO_SRGB(color);"," color += (1.0 / 255.0) * gradientNoise(outTexCoord) - (0.5 / 255.0);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = vec4(mix(color.rgb, texture.rgb, alpha), 1.0) * texture.a;","}"].join(` -`)},50831:a=>{a.exports=["#define SHADER_NAME PIXELATE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform float amount;","varying vec2 outTexCoord;","void main ()","{"," float pixelSize = floor(2.0 + amount);"," vec2 center = pixelSize * floor(outTexCoord * resolution / pixelSize) + pixelSize * vec2(0.5, 0.5);"," vec2 corner1 = center + pixelSize * vec2(-0.5, -0.5);"," vec2 corner2 = center + pixelSize * vec2(+0.5, -0.5);"," vec2 corner3 = center + pixelSize * vec2(+0.5, +0.5);"," vec2 corner4 = center + pixelSize * vec2(-0.5, +0.5);"," vec4 pixel = 0.4 * texture2D(uMainSampler, center / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner1 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner2 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner3 / resolution);"," pixel += 0.15 * texture2D(uMainSampler, corner4 / resolution);"," gl_FragColor = pixel;","}"].join(` -`)},92595:a=>{a.exports=["#define SHADER_NAME SHADOW_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","uniform vec2 lightPosition;","uniform vec4 color;","uniform float decay;","uniform float power;","uniform float intensity;","uniform int samples;","const int MAX = 12;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec2 pc = (lightPosition - outTexCoord) * intensity;"," float shadow = 0.0;"," float limit = max(float(MAX), float(samples));"," for (int i = 0; i < MAX; ++i)"," {"," if (i >= samples)"," {"," break;"," }"," shadow += texture2D(uMainSampler, outTexCoord + float(i) * decay / limit * pc).a * power;"," }"," float mask = 1.0 - texture.a;"," gl_FragColor = mix(texture, color, shadow * mask);","}"].join(` -`)},72464:a=>{a.exports=["#define SHADER_NAME SHINE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec2 resolution;","uniform bool reveal;","uniform float speed;","uniform float time;","uniform float lineWidth;","uniform float gradient;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = gl_FragCoord.xy / resolution.xy;"," vec4 tex = texture2D(uMainSampler, outTexCoord);"," vec4 col1 = vec4(0.3, 0.0, 0.0, 1.0);"," vec4 col2 = vec4(0.85, 0.85, 0.85, 1.0);"," uv.x = uv.x - mod(time * speed, 2.0) + 0.5;"," float y = uv.x * gradient;"," float s = smoothstep(y - lineWidth, y, uv.y) - smoothstep(y, y + lineWidth, uv.y);"," gl_FragColor = (((s * col1) + (s * col2)) * tex);"," if (!reveal)"," {"," gl_FragColor += tex;"," }","}"].join(` -`)},39249:a=>{a.exports=["#define SHADER_NAME VIGNETTE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform float radius;","uniform float strength;","uniform vec2 position;","varying vec2 outTexCoord;","void main ()","{"," vec4 col = vec4(1.0);"," float d = length(outTexCoord - position);"," if (d <= radius)"," {"," float g = d / radius;"," g = sin(g * 3.14 * strength);"," col = vec4(g * g * g);"," }"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," gl_FragColor = texture * (1.0 - col);","}"].join(` -`)},2878:a=>{a.exports=["#define SHADER_NAME WIPE_FS","precision mediump float;","uniform sampler2D uMainSampler;","uniform vec4 config;","uniform bool reveal;","varying vec2 outTexCoord;","void main ()","{"," vec2 uv = outTexCoord;"," vec4 color0;"," vec4 color1;"," if (reveal)"," {"," color0 = vec4(0);"," color1 = texture2D(uMainSampler, uv);"," }"," else"," {"," color0 = texture2D(uMainSampler, uv);"," color1 = vec4(0);"," }"," float distance = config.x;"," float width = config.y;"," float direction = config.z;"," float axis = uv.x;"," if (config.w == 1.0)"," {"," axis = uv.y;"," }"," float adjust = mix(width, -width, distance);"," float value = smoothstep(distance - width, distance + width, abs(direction - axis) + adjust);"," gl_FragColor = mix(color1, color0, value);","}"].join(` -`)},31063:a=>{a.exports=["#define SHADER_NAME PHASER_LIGHT_FS","precision mediump float;","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","const int kMaxLights = %LIGHT_COUNT%;","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","uniform int uLightCount;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;"," for (int index = 0; index < kMaxLights; ++index)"," {"," if (index < uLightCount)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }"," }"," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}"].join(` -`)},48247:a=>{a.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","precision mediump float;","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","varying vec2 outTexCoord;","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);"," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}"].join(` -`)},41214:a=>{a.exports=["#define SHADER_NAME PHASER_MESH_FS","precision mediump float;","uniform vec3 uLightPosition;","uniform vec3 uLightAmbient;","uniform vec3 uLightDiffuse;","uniform vec3 uLightSpecular;","uniform vec3 uFogColor;","uniform float uFogNear;","uniform float uFogFar;","uniform vec3 uMaterialAmbient;","uniform vec3 uMaterialDiffuse;","uniform vec3 uMaterialSpecular;","uniform float uMaterialShine;","uniform vec3 uCameraPosition;","uniform sampler2D uTexture;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main (void)","{"," vec4 color = texture2D(uTexture, vTextureCoord);"," vec3 ambient = uLightAmbient * uMaterialAmbient;"," vec3 norm = normalize(vNormal);"," vec3 lightDir = normalize(uLightPosition - vPosition);"," float diff = max(dot(norm, lightDir), 0.0);"," vec3 diffuse = uLightDiffuse * (diff * uMaterialDiffuse);"," vec3 viewDir = normalize(uCameraPosition - vPosition);"," vec3 reflectDir = reflect(-lightDir, norm);"," float spec = pow(max(dot(viewDir, reflectDir), 0.0), uMaterialShine);"," vec3 specular = uLightSpecular * (spec * uMaterialSpecular);"," vec3 result = (ambient + diffuse + specular) * color.rgb;"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," float fogFactor = smoothstep(uFogNear, uFogFar, depth);"," gl_FragColor.rgb = mix(result.rgb, uFogColor, fogFactor);"," gl_FragColor.a = color.a;","}"].join(` -`)},39653:a=>{a.exports=["#define SHADER_NAME PHASER_MESH_VS","precision mediump float;","attribute vec3 aVertexPosition;","attribute vec3 aVertexNormal;","attribute vec2 aTextureCoord;","uniform mat4 uViewProjectionMatrix;","uniform mat4 uModelMatrix;","uniform mat4 uNormalMatrix;","varying vec2 vTextureCoord;","varying vec3 vNormal;","varying vec3 vPosition;","void main ()","{"," vTextureCoord = aTextureCoord;"," vPosition = vec3(uModelMatrix * vec4(aVertexPosition, 1.0));"," vNormal = vec3(uNormalMatrix * vec4(aVertexNormal, 1.0));"," gl_Position = uViewProjectionMatrix * uModelMatrix * vec4(aVertexPosition, 1.0);","}"].join(` -`)},62143:a=>{a.exports=["#define SHADER_NAME PHASER_MOBILE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` -`)},47940:a=>{a.exports=["#define SHADER_NAME PHASER_MOBILE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` -`)},98840:a=>{a.exports=["#define SHADER_NAME PHASER_MULTI_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler[%count%];","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture;"," %forloop%"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` -`)},44667:a=>{a.exports=["#define SHADER_NAME PHASER_MULTI_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` -`)},4127:a=>{a.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","precision mediump float;","uniform vec2 uResolution;","uniform float uCameraZoom;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);"," float distToSurf = length(center - gl_FragCoord.xy);"," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);"," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);"," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;"," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}"].join(` -`)},89924:a=>{a.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}"].join(` -`)},27681:a=>{a.exports=["#define SHADER_NAME PHASER_POSTFX_FS","precision mediump float;","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}"].join(` -`)},49627:a=>{a.exports=["#define SHADER_NAME PHASER_QUAD_VS","precision mediump float;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","varying vec2 outFragCoord;","varying vec2 outTexCoord;","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;"," gl_Position = vec4(inPosition, 0, 1);","}"].join(` -`)},45561:a=>{a.exports=["#define SHADER_NAME PHASER_SINGLE_FS","#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","uniform sampler2D uMainSampler;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);"," vec4 color = texture * texel;"," if (outTintEffect == 1.0)"," {"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," color = texel;"," }"," gl_FragColor = color;","}"].join(` -`)},60722:a=>{a.exports=["#define SHADER_NAME PHASER_SINGLE_VS","precision mediump float;","uniform mat4 uProjectionMatrix;","uniform int uRoundPixels;","uniform vec2 uResolution;","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);"," if (uRoundPixels == 1)"," {"," gl_Position.xy = floor(((gl_Position.xy + 1.0) * 0.5 * uResolution) + 0.5) / uResolution * 2.0 - 1.0;"," }"," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}"].join(` -`)},89350:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AddBlendFrag:t(35407),BitmapMaskFrag:t(78908),BitmapMaskVert:t(85191),ColorMatrixFrag:t(96293),CopyFrag:t(36682),FXBarrelFrag:t(99155),FXBloomFrag:t(24400),FXBlurHighFrag:t(94328),FXBlurLowFrag:t(41514),FXBlurMedFrag:t(51078),FXBokehFrag:t(90610),FXCircleFrag:t(91899),FXDisplacementFrag:t(47838),FXGlowFrag:t(98656),FXGradientFrag:t(70463),FXPixelateFrag:t(50831),FXShadowFrag:t(92595),FXShineFrag:t(72464),FXVignetteFrag:t(39249),FXWipeFrag:t(2878),LightFrag:t(31063),LinearBlendFrag:t(48247),MeshFrag:t(41214),MeshVert:t(39653),MobileFrag:t(62143),MobileVert:t(47940),MultiFrag:t(98840),MultiVert:t(44667),PointLightFrag:t(4127),PointLightVert:t(89924),PostFXFrag:t(27681),QuadVert:t(49627),SingleFrag:t(45561),SingleVert:t(60722)}},93567:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n){this.webGLAttribLocation=-1,this.gl=o,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLAttribLocation=-1;return}var h=this.gl;h.isContextLost()||(this.webGLAttribLocation=h.getAttribLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLAttribLocation=-1}});a.exports=p},26128:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u){this.webGLBuffer=null,this.gl=o,this.initialDataOrSize=l,this.bufferType=n,this.bufferUsage=u,this.createResource()},createResource:function(){if(this.initialDataOrSize!==null){var h=this.gl;if(!h.isContextLost()){var o=this.bufferType,l=h.createBuffer();this.webGLBuffer=l,h.bindBuffer(o,this.webGLBuffer),h.bufferData(o,this.initialDataOrSize,this.bufferUsage),h.bindBuffer(o,null)}}},destroy:function(){var h=this.gl;h.isContextLost()||h.deleteBuffer(this.webGLBuffer),this.webGLBuffer=null,this.initialDataOrSize=null,this.gl=null}});a.exports=p},84387:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p={36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"},h=new r({initialize:function(l,n,u,f,s){this.webGLFramebuffer=null,this.gl=l,this.width=n,this.height=u,this.renderTexture=f,this.addDepthStencilBuffer=!!s,this.createResource()},createResource:function(){var o=this.gl;if(!o.isContextLost()){var l=this.renderTexture,n=0,u=o.createFramebuffer();if(this.webGLFramebuffer=u,o.bindFramebuffer(o.FRAMEBUFFER,u),l.isRenderTexture=!0,l.isAlphaPremultiplied=!1,o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,l.webGLTexture,0),n=o.checkFramebufferStatus(o.FRAMEBUFFER),n!==o.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+(p[n]||n));if(this.addDepthStencilBuffer){var f=o.createRenderbuffer();o.bindRenderbuffer(o.RENDERBUFFER,f),o.renderbufferStorage(o.RENDERBUFFER,o.DEPTH_STENCIL,this.width,this.height),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,f)}o.bindFramebuffer(o.FRAMEBUFFER,null)}},destroy:function(){if(this.webGLFramebuffer!==null){var o=this.gl;if(!o.isContextLost()){o.bindFramebuffer(o.FRAMEBUFFER,this.webGLFramebuffer);var l=o.getFramebufferAttachmentParameter(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);l!==null&&(o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,null,0),o.deleteTexture(l));var n=o.getFramebufferAttachmentParameter(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);n!==null&&o.deleteRenderbuffer(n),o.bindFramebuffer(o.FRAMEBUFFER,null),o.deleteFramebuffer(this.webGLFramebuffer)}this.renderTexture=null,this.webGLFramebuffer=null,this.gl=null}}});a.exports=h},1482:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n){this.webGLProgram=null,this.gl=o,this.vertexSource=l,this.fragmentSource=n,this.createResource()},createResource:function(){var h=this.gl;if(!h.isContextLost()){var o=h.createProgram(),l=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(l,this.vertexSource),h.shaderSource(n,this.fragmentSource),h.compileShader(l),h.compileShader(n);var u=`Shader failed: -`;if(!h.getShaderParameter(l,h.COMPILE_STATUS))throw new Error("Vertex "+u+h.getShaderInfoLog(l));if(!h.getShaderParameter(n,h.COMPILE_STATUS))throw new Error("Fragment "+u+h.getShaderInfoLog(n));if(h.attachShader(o,l),h.attachShader(o,n),h.linkProgram(o),!h.getProgramParameter(o,h.LINK_STATUS))throw new Error("Link "+u+h.getProgramInfoLog(o));h.useProgram(o),this.webGLProgram=o}},destroy:function(){this.webGLProgram&&(this.gl.isContextLost()||this.gl.deleteProgram(this.webGLProgram),this.webGLProgram=null,this.gl=null)}});a.exports=p},82751:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50030),h=new r({initialize:function(l,n,u,f,s,c,d,v,m,S,M,A,C){this.webGLTexture=null,this.isRenderTexture=!1,this.gl=l,this.mipLevel=n,this.minFilter=u,this.magFilter=f,this.wrapT=s,this.wrapS=c,this.format=d,this.pixels=v,this.width=m,this.height=S,this.pma=M??!0,this.forceSize=!!A,this.flipY=!!C,this.__SPECTOR_Metadata={},this.createResource()},createResource:function(){var o=this.gl;if(!o.isContextLost()){if(this.pixels instanceof h){this.webGLTexture=this.pixels.webGLTexture;return}var l=o.createTexture();l.__SPECTOR_Metadata=this.__SPECTOR_Metadata,this.webGLTexture=l,this._processTexture()}},update:function(o,l,n,u,f,s,c,d,v){if(!(l===0||n===0)){this.pixels=o,this.width=l,this.height=n,this.flipY=u,this.wrapS=f,this.wrapT=s,this.minFilter=c,this.magFilter=d,this.format=v;var m=this.gl;m.isContextLost()||this._processTexture()}},_processTexture:function(){var o=this.gl;o.activeTexture(o.TEXTURE0);var l=o.getParameter(o.TEXTURE_BINDING_2D);o.bindTexture(o.TEXTURE_2D,this.webGLTexture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.minFilter),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,this.magFilter),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,this.wrapS),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,this.wrapT),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.pma),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,this.flipY);var n=this.pixels,u=this.mipLevel,f=this.width,s=this.height,c=this.format,d=!1;if(n==null)o.texImage2D(o.TEXTURE_2D,u,c,f,s,0,c,o.UNSIGNED_BYTE,null),d=p(f,s);else if(n.compressed){f=n.width,s=n.height,d=n.generateMipmap;for(var v=0;v{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n){this.webGLUniformLocation=null,this.gl=o,this.program=l,this.name=n,this.createResource()},createResource:function(){if(this.program.webGLProgram===null){this.webGLUniformLocation=null;return}var h=this.gl;h.isContextLost()||(this.webGLUniformLocation=h.getUniformLocation(this.program.webGLProgram,this.name))},destroy:function(){this.gl=null,this.program=null,this.name=null,this.webGLUniformLocation=null}});a.exports=p},9503:(a,y,t)=>{/** - * @author Benjamin D. Richards - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={WebGLAttribLocationWrapper:t(93567),WebGLBufferWrapper:t(26128),WebGLProgramWrapper:t(1482),WebGLTextureWrapper:t(82751),WebGLFramebufferWrapper:t(84387),WebGLUniformLocationWrapper:t(57183)};a.exports=r},76531:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(13560),p=t(83419),h=t(50792),o=t(97480),l=t(8443),n=t(57811),u=t(74403),f=t(45818),s=t(29747),c=t(87841),d=t(86555),v=t(56583),m=t(26099),S=t(38058),M=new p({Extends:h,initialize:function(C){h.call(this),this.game=C,this.canvas,this.canvasBounds=new c,this.parent=null,this.parentIsWindow=!1,this.parentSize=new d,this.gameSize=new d,this.baseSize=new d,this.displaySize=new d,this.scaleMode=r.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=r.CENTER.NO_CENTER,this.orientation=r.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(l.BOOT,this.boot,this)},boot:function(){var A=this.game;this.canvas=A.canvas,this.fullscreen=A.device.fullscreen,this.scaleMode!==r.SCALE_MODE.RESIZE&&this.scaleMode!==r.SCALE_MODE.EXPAND&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===r.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()),A.events.on(l.PRE_STEP,this.step,this),A.events.once(l.READY,this.refresh,this),A.events.once(l.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(A){this.getParent(A),this.getParentBounds();var C=A.width,w=A.height,P=A.scaleMode,L=A.zoom,O=A.autoRound;if(typeof C=="string")if(C.substr(-1)!=="%")C=parseInt(C,10);else{var I=this.parentSize.width;I===0&&(I=window.innerWidth);var D=parseInt(C,10)/100;C=Math.floor(I*D)}if(typeof w=="string")if(w.substr(-1)!=="%")w=parseInt(w,10);else{var B=this.parentSize.height;B===0&&(B=window.innerHeight);var G=parseInt(w,10)/100;w=Math.floor(B*G)}this.scaleMode=P,this.autoRound=O,this.autoCenter=A.autoCenter,this.resizeInterval=A.resizeInterval,O&&(C=Math.floor(C),w=Math.floor(w)),this.gameSize.setSize(C,w),L===r.ZOOM.MAX_ZOOM&&(L=this.getMaxZoom()),this.zoom=L,L!==1&&(this._resetZoom=!0),this.baseSize.setSize(C,w),O&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),A.minWidth>0&&this.displaySize.setMin(A.minWidth*L,A.minHeight*L),A.maxWidth>0&&this.displaySize.setMax(A.maxWidth*L,A.maxHeight*L),this.displaySize.setSize(C,w),(A.snapWidth>0||A.snapHeight>0)&&this.displaySize.setSnap(A.snapWidth,A.snapHeight),this.orientation=f(C,w)},getParent:function(A){var C=A.parent;if(C!==null){if(this.parent=u(C),this.parentIsWindow=this.parent===document.body,A.expandParent&&A.scaleMode!==r.SCALE_MODE.NONE){var w=this.parent.getBoundingClientRect();(this.parentIsWindow||w.height===0)&&(document.documentElement.style.height="100%",document.body.style.height="100%",w=this.parent.getBoundingClientRect(),!this.parentIsWindow&&w.height===0&&(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}A.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=u(A.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var A=this.parentSize,C=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(C.height=n(!0));var w=C.width,P=C.height;if(A.width!==w||A.height!==P)return A.setSize(w,P),!0;if(this.canvas){var L=this.canvasBounds,O=this.canvas.getBoundingClientRect();if(O.x!==L.x||O.y!==L.y)return!0}return!1},lockOrientation:function(A){var C=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return C?C.call(screen,A):!1},setParentSize:function(A,C){return this.parentSize.setSize(A,C),this.refresh()},setGameSize:function(A,C){var w=this.autoRound;w&&(A=Math.floor(A),C=Math.floor(C));var P=this.width,L=this.height;return this.gameSize.resize(A,C),this.baseSize.resize(A,C),w&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(A/C),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(P,L)},resize:function(A,C){var w=this.zoom,P=this.autoRound;P&&(A=Math.floor(A),C=Math.floor(C));var L=this.width,O=this.height;this.gameSize.resize(A,C),this.baseSize.resize(A,C),P&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(A*w,C*w),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var I=this.canvas.style,D=A*w,B=C*w;return P&&(D=Math.floor(D),B=Math.floor(B)),(D!==A||B!==C)&&(I.width=D+"px",I.height=B+"px"),this.refresh(L,O)},setZoom:function(A){return this.zoom=A,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},setSnap:function(A,C){return A===void 0&&(A=0),C===void 0&&(C=A),this.displaySize.setSnap(A,C),this.refresh()},refresh:function(A,C){A===void 0&&(A=this.width),C===void 0&&(C=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var w=this.game.domContainer;if(w){this.baseSize.setCSS(w);var P=this.canvas.style,L=w.style;L.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",L.marginLeft=P.marginLeft,L.marginTop=P.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,A,C),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var A=f(this.width,this.height);A!==this.orientation&&(this.orientation=A,this.emit(o.ORIENTATION_CHANGE,A))}},updateScale:function(){var A=this.canvas.style,C=this.gameSize.width,w=this.gameSize.height,P,L,O=this.zoom,I=this.autoRound;if(this.scaleMode===r.SCALE_MODE.NONE)this.displaySize.setSize(C*O,w*O),P=this.displaySize.width,L=this.displaySize.height,I&&(P=Math.floor(P),L=Math.floor(L)),this._resetZoom&&(A.width=P+"px",A.height=L+"px",this._resetZoom=!1);else if(this.scaleMode===r.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,L=this.displaySize.height,I&&(P=Math.floor(P),L=Math.floor(L)),this.canvas.width=P,this.canvas.height=L;else if(this.scaleMode===r.SCALE_MODE.EXPAND){this.displaySize.setSize(this.parentSize.width,this.parentSize.height),P=this.displaySize.width,L=this.displaySize.height,I&&(P=Math.floor(P),L=Math.floor(L)),A.width=P+"px",A.height=L+"px";var D=this.parentSize.width/this.gameSize.width,B=this.parentSize.height/this.gameSize.height;D=0?0:-(L.x*O.x),D=L.y>=0?0:-(L.y*O.y),B;P.width>=L.width?B=w.width:B=w.width-(L.width-P.width)*O.x;var G;return P.height>=L.height?G=w.height:G=w.height-(L.height-P.height)*O.y,C.setTo(I,D,B,G),A&&(C.width/=A.zoomX,C.height/=A.zoomY,C.centerX=A.centerX+A.scrollX,C.centerY=A.centerY+A.scrollY),C},step:function(A,C){this.parent&&(this._lastCheck+=C,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var A=this.domlisteners;window.removeEventListener("orientationchange",A.orientationChange,!1),window.removeEventListener("resize",A.windowResize,!1);var C=["webkit","moz",""];C.forEach(function(w){document.removeEventListener(w+"fullscreenchange",A.fullScreenChange,!1),document.removeEventListener(w+"fullscreenerror",A.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",A.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",A.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===r.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===r.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});a.exports=M},64743:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},39218:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},81050:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5,EXPAND:6}},80805:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},13560:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={CENTER:t(64743),ORIENTATION:t(39218),SCALE_MODE:t(81050),ZOOM:t(80805)};a.exports=r},56139:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="enterfullscreen"},2336:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="fullscreenfailed"},47412:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="fullscreenunsupported"},51452:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="leavefullscreen"},20666:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="orientationchange"},47945:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resize"},97480:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ENTER_FULLSCREEN:t(56139),FULLSCREEN_FAILED:t(2336),FULLSCREEN_UNSUPPORTED:t(47412),LEAVE_FULLSCREEN:t(51452),ORIENTATION_CHANGE:t(20666),RESIZE:t(47945)}},93364:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79291),p=t(13560),h={Center:t(64743),Events:t(97480),Orientation:t(39218),ScaleManager:t(76531),ScaleModes:t(81050),Zoom:t(80805)};h=r(!1,h,p.CENTER),h=r(!1,h,p.ORIENTATION),h=r(!1,h,p.SCALE_MODE),h=r(!1,h,p.ZOOM),a.exports=h},27397:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=t(35355),h=function(o){var l=o.game.config.defaultPhysicsSystem,n=r(o.settings,"physics",!1);if(!(!l&&!n)){var u=[];if(l&&u.push(p(l+"Physics")),n)for(var f in n)f=p(f.concat("Physics")),u.indexOf(f)===-1&&u.push(f);return u}};a.exports=h},52106:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=function(h){var o=h.plugins.getDefaultScenePlugins(),l=r(h.settings,"plugins",!1);return Array.isArray(l)?l:o||[]};a.exports=p},87033:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"};a.exports=y},97482:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(2368),h=new r({initialize:function(l){this.sys=new p(this,l),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});a.exports=h},60903:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(89993),h=t(44594),o=t(8443),l=t(35154),n=t(54899),u=t(29747),f=t(97482),s=t(2368),c=new r({initialize:function(v,m){if(this.game=v,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,this.systemScene,m){Array.isArray(m)||(m=[m]);for(var S=0;S-1&&(delete this.keys[S],this.scenes.splice(m,1),this._start.indexOf(S)>-1&&(m=this._start.indexOf(S),this._start.splice(m,1)),v.sys.destroy())}return this},bootScene:function(d){var v=d.sys,m=v.settings;v.sceneUpdate=u,d.init&&(d.init.call(d,m.data),m.status=p.INIT,m.isTransition&&v.events.emit(h.TRANSITION_INIT,m.transitionFrom,m.transitionDuration));var S;v.load&&(S=v.load,S.reset()),S&&d.preload?(d.preload.call(d),m.status=p.LOADING,S.once(n.COMPLETE,this.loadComplete,this),S.start()):this.create(d)},loadComplete:function(d){this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(d.scene)},payloadComplete:function(d){this.bootScene(d.scene)},update:function(d,v){this.processQueue(),this.isProcessing=!0;for(var m=this.scenes.length-1;m>=0;m--){var S=this.scenes[m].sys;S.settings.status>p.START&&S.settings.status<=p.RUNNING&&S.step(d,v),S.scenePlugin&&S.scenePlugin._target&&S.scenePlugin.step(d,v)}},render:function(d){for(var v=0;v=p.LOADING&&m.settings.status=p.START&&M<=p.CREATING)return this;if(M>=p.RUNNING&&M<=p.SLEEPING)S.shutdown(),S.sceneUpdate=u,S.start(v);else{S.sceneUpdate=u,S.start(v);var A;if(S.load&&(A=S.load),A&&S.settings.hasOwnProperty("pack")&&(A.reset(),A.addPack({payload:S.settings.pack})))return S.settings.status=p.LOADING,A.once(n.COMPLETE,this.payloadComplete,this),A.start(),this}return this.bootScene(m),this},stop:function(d,v){var m=this.getScene(d);if(m&&!m.sys.isTransitioning()&&m.sys.settings.status!==p.SHUTDOWN){var S=m.sys.load;S&&(S.off(n.COMPLETE,this.loadComplete,this),S.off(n.COMPLETE,this.payloadComplete,this)),m.sys.shutdown(v)}return this},switch:function(d,v){var m=this.getScene(d),S=this.getScene(v);return m&&S&&m!==S&&(this.sleep(d),this.isSleeping(v)?this.wake(v):this.start(v)),this},getAt:function(d){return this.scenes[d]},getIndex:function(d){var v=this.getScene(d);return this.scenes.indexOf(v)},bringToTop:function(d){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v!==-1&&v0){var m=this.getScene(d);this.scenes.splice(v,1),this.scenes.unshift(m)}}return this},moveDown:function(d){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:d,keyB:null});else{var v=this.getIndex(d);if(v>0){var m=v-1,S=this.getScene(d),M=this.getAt(m);this.scenes[v]=M,this.scenes[m]=S}}return this},moveUp:function(d){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:d,keyB:null});else{var v=this.getIndex(d);if(vm),0,M)}}return this},moveBelow:function(d,v){if(d===v)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:d,keyB:v});else{var m=this.getIndex(d),S=this.getIndex(v);if(m!==-1&&S!==-1&&S>m){var M=this.getAt(S);this.scenes.splice(S,1),m===0?this.scenes.unshift(M):this.scenes.splice(m-(S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(44594),o=t(95540),l=t(37277),n=new p({initialize:function(f){this.scene=f,this.systems=f.sys,this.settings=f.sys.settings,this.key=f.sys.settings.key,this.manager=f.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.pluginStart,this)},boot:function(){this.systems.events.once(h.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(h.SHUTDOWN,this.shutdown,this)},start:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",u,f),this},restart:function(u){var f=this.key;return this.manager.queueOp("stop",f),this.manager.queueOp("start",f,u),this},transition:function(u){u===void 0&&(u={});var f=o(u,"target",!1),s=this.manager.getScene(f);if(!f||!this.checkValidTransition(s))return!1;var c=o(u,"duration",1e3);this._elapsed=0,this._target=s,this._duration=c,this._willSleep=o(u,"sleep",!1),this._willRemove=o(u,"remove",!1);var d=o(u,"onUpdate",null);d&&(this._onUpdate=d,this._onUpdateScope=o(u,"onUpdateScope",this.scene));var v=o(u,"allowInput",!1);this.settings.transitionAllowInput=v;var m=s.sys.settings;m.isTransition=!0,m.transitionFrom=this.scene,m.transitionDuration=c,m.transitionAllowInput=v,o(u,"moveAbove",!1)?this.manager.moveAbove(this.key,f):o(u,"moveBelow",!1)&&this.manager.moveBelow(this.key,f),s.sys.isSleeping()?s.sys.wake(o(u,"data")):this.manager.start(f,o(u,"data"));var S=o(u,"onStart",null),M=o(u,"onStartScope",this.scene);return S&&S.call(M,this.scene,s,c),this.systems.events.emit(h.TRANSITION_OUT,s,c),!0},checkValidTransition:function(u){return!(!u||u.sys.isActive()||u.sys.isTransitioning()||u===this.scene||this.systems.isTransitioning())},step:function(u,f){this._elapsed+=f,this.transitionProgress=r(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var u=this._target.sys,f=this._target.sys.settings;u.events.emit(h.TRANSITION_COMPLETE,this.scene),f.isTransition=!1,f.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(u,f,s,c){return this.manager.add(u,f,s,c)},launch:function(u,f){return u&&u!==this.key&&this.manager.queueOp("start",u,f),this},run:function(u,f){return u&&u!==this.key&&this.manager.queueOp("run",u,f),this},pause:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("pause",u,f),this},resume:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("resume",u,f),this},sleep:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("sleep",u,f),this},wake:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("wake",u,f),this},switch:function(u){return u!==this.key&&this.manager.queueOp("switch",this.key,u),this},stop:function(u,f){return u===void 0&&(u=this.key),this.manager.queueOp("stop",u,f),this},setActive:function(u,f,s){f===void 0&&(f=this.key);var c=this.manager.getScene(f);return c&&c.sys.setActive(u,s),this},setVisible:function(u,f){f===void 0&&(f=this.key);var s=this.manager.getScene(f);return s&&s.sys.setVisible(u),this},isSleeping:function(u){return u===void 0&&(u=this.key),this.manager.isSleeping(u)},isActive:function(u){return u===void 0&&(u=this.key),this.manager.isActive(u)},isPaused:function(u){return u===void 0&&(u=this.key),this.manager.isPaused(u)},isVisible:function(u){return u===void 0&&(u=this.key),this.manager.isVisible(u)},swapPosition:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.swapPosition(u,f),this},moveAbove:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveAbove(u,f),this},moveBelow:function(u,f){return f===void 0&&(f=this.key),u!==f&&this.manager.moveBelow(u,f),this},remove:function(u){return u===void 0&&(u=this.key),this.manager.remove(u),this},moveUp:function(u){return u===void 0&&(u=this.key),this.manager.moveUp(u),this},moveDown:function(u){return u===void 0&&(u=this.key),this.manager.moveDown(u),this},bringToTop:function(u){return u===void 0&&(u=this.key),this.manager.bringToTop(u),this},sendToBack:function(u){return u===void 0&&(u=this.key),this.manager.sendToBack(u),this},get:function(u){return this.manager.getScene(u)},getStatus:function(u){var f=this.manager.getScene(u);if(f)return f.sys.getStatus()},getIndex:function(u){return u===void 0&&(u=this.key),this.manager.getIndex(u)},shutdown:function(){var u=this.systems.events;u.off(h.SHUTDOWN,this.shutdown,this),u.off(h.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(h.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});l.register("ScenePlugin",n,"scenePlugin"),a.exports=n},55681:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(89993),p=t(35154),h=t(46975),o=t(87033),l={create:function(n){return typeof n=="string"?n={key:n}:n===void 0&&(n={}),{status:r.PENDING,key:p(n,"key",""),active:p(n,"active",!1),visible:p(n,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:p(n,"pack",!1),cameras:p(n,"cameras",null),map:p(n,"map",h(o,p(n,"mapAdd",{}))),physics:p(n,"physics",{}),loader:p(n,"loader",{}),plugins:p(n,"plugins",!1),input:p(n,"input",{})}}};a.exports=l},2368:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(89993),h=t(42363),o=t(44594),l=t(27397),n=t(52106),u=t(29747),f=t(55681),s=new r({initialize:function(d,v){this.scene=d,this.game,this.renderer,this.config=v,this.settings=f.create(v),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=u},init:function(c){this.settings.status=p.INIT,this.sceneUpdate=u,this.game=c,this.renderer=c.renderer,this.canvas=c.canvas,this.context=c.context;var d=c.plugins;this.plugins=d,d.addToScene(this,h.Global,[h.CoreScene,n(this),l(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},step:function(c,d){var v=this.events;v.emit(o.PRE_UPDATE,c,d),v.emit(o.UPDATE,c,d),this.sceneUpdate.call(this.scene,c,d),v.emit(o.POST_UPDATE,c,d)},render:function(c){var d=this.displayList;d.depthSort(),this.events.emit(o.PRE_RENDER,c),this.cameras.render(c,d),this.events.emit(o.RENDER,c)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot pause non-running Scene",d.key):this.settings.active&&(d.status=p.PAUSED,d.active=!1,this.events.emit(o.PAUSE,this,c)),this},resume:function(c){var d=this.events,v=this.settings;return this.settings.active||(v.status=p.RUNNING,v.active=!0,d.emit(o.RESUME,this,c)),this},sleep:function(c){var d=this.settings,v=this.getStatus();return v!==p.CREATING&&v!==p.RUNNING?console.warn("Cannot sleep non-running Scene",d.key):(d.status=p.SLEEPING,d.active=!1,d.visible=!1,this.events.emit(o.SLEEP,this,c)),this},wake:function(c){var d=this.events,v=this.settings;return v.status=p.RUNNING,v.active=!0,v.visible=!0,d.emit(o.WAKE,this,c),v.isTransition&&d.emit(o.TRANSITION_WAKE,v.transitionFrom,v.transitionDuration),this},getData:function(){return this.settings.data},getStatus:function(){return this.settings.status},canInput:function(){var c=this.settings.status;return c>p.PENDING&&c<=p.RUNNING},isSleeping:function(){return this.settings.status===p.SLEEPING},isActive:function(){return this.settings.status===p.RUNNING},isPaused:function(){return this.settings.status===p.PAUSED},isTransitioning:function(){return this.settings.isTransition||this.scenePlugin._target!==null},isTransitionOut:function(){return this.scenePlugin._target!==null&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(c){return this.settings.visible=c,this},setActive:function(c,d){return c?this.resume(d):this.pause(d)},start:function(c){var d=this.events,v=this.settings;c&&(v.data=c),v.status=p.START,v.active=!0,v.visible=!0,d.emit(o.START,this),d.emit(o.READY,this,c)},shutdown:function(c){var d=this.events,v=this.settings;d.off(o.TRANSITION_INIT),d.off(o.TRANSITION_START),d.off(o.TRANSITION_COMPLETE),d.off(o.TRANSITION_OUT),v.status=p.SHUTDOWN,v.active=!1,v.visible=!1,d.emit(o.SHUTDOWN,this,c)},destroy:function(){var c=this.events,d=this.settings;d.status=p.DESTROYED,d.active=!1,d.visible=!1,c.emit(o.DESTROY,this),c.removeAllListeners();for(var v=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],m=0;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9};a.exports=y},69830:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="addedtoscene"},7919:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="boot"},46763:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="create"},11763:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},71555:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},36735:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="postupdate"},3809:a=>{/** - * @author samme - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="prerender"},90716:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="preupdate"},58262:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="ready"},91633:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="removedfromscene"},10319:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="render"},87132:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},81961:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="shutdown"},90194:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="sleep"},6265:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="start"},33178:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="transitioncomplete"},43063:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="transitioninit"},11259:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="transitionout"},61611:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="transitionstart"},45209:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="transitionwake"},22966:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="update"},21747:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="wake"},44594:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADDED_TO_SCENE:t(69830),BOOT:t(7919),CREATE:t(46763),DESTROY:t(11763),PAUSE:t(71555),POST_UPDATE:t(36735),PRE_RENDER:t(3809),PRE_UPDATE:t(90716),READY:t(58262),REMOVED_FROM_SCENE:t(91633),RENDER:t(10319),RESUME:t(87132),SHUTDOWN:t(81961),SLEEP:t(90194),START:t(6265),TRANSITION_COMPLETE:t(33178),TRANSITION_INIT:t(43063),TRANSITION_OUT:t(11259),TRANSITION_START:t(61611),TRANSITION_WAKE:t(45209),UPDATE:t(22966),WAKE:t(21747)}},62194:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(89993),p=t(79291),h={Events:t(44594),GetPhysicsPlugins:t(27397),GetScenePlugins:t(52106),SceneManager:t(60903),ScenePlugin:t(52209),Settings:t(55681),Systems:t(2368)};h=p(!1,h,r),a.exports=h},30341:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(14463),o=t(79291),l=t(29747),n=new r({Extends:p,initialize:function(f,s,c){p.call(this),this.manager=f,this.key=s,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,c),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(console.error("addMarker "+u.name+" already exists in Sound"),!1):(u=o(!0,{name:"",start:0,duration:this.totalDuration-(u.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},u),this.markers[u.name]=u,!0)},updateMarker:function(u){return!u||!u.name||typeof u.name!="string"?!1:this.markers[u.name]?(this.markers[u.name]=o(!0,this.markers[u.name],u),!0):(console.warn("Audio Marker: "+u.name+" missing in Sound: "+this.key),!1)},removeMarker:function(u){var f=this.markers[u];return f?(this.markers[u]=null,f):null},play:function(u,f){if(u===void 0&&(u=""),typeof u=="object"&&(f=u,u=""),typeof u!="string")return!1;if(!u)this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;else{if(!this.markers[u])return console.warn("Marker: "+u+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[u],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}return this.resetConfig(),this.currentConfig=o(this.currentConfig,f),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return this.isPaused||!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!this.isPaused||this.isPlaying?!1:(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!this.isPaused&&!this.isPlaying?!1:(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:l,calculateRate:function(){var u=1.0005777895065548,f=this.currentConfig.detune+this.manager.detune,s=Math.pow(u,f);this.totalRate=this.currentConfig.rate*this.manager.rate*s},destroy:function(){this.pendingRemove||(this.stop(),this.emit(h.DESTROY,this),this.removeAllListeners(),this.pendingRemove=!0,this.manager=null,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});a.exports=n},85034:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(41786),h=t(50792),o=t(14463),l=t(8443),n=t(46710),u=t(58731),f=t(29747),s=t(26099),c=new r({Extends:h,initialize:function(v){h.call(this),this.game=v,this.jsonCache=v.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,v.events.on(l.BLUR,this.onGameBlur,this),v.events.on(l.FOCUS,this.onGameFocus,this),v.events.on(l.PRE_STEP,this.update,this),v.events.once(l.DESTROY,this.destroy,this)},add:f,addAudioSprite:function(d,v){v===void 0&&(v={});var m=this.add(d,v);m.spritemap=this.jsonCache.get(d).spritemap;for(var S in m.spritemap)if(m.spritemap.hasOwnProperty(S)){var M=p(v),A=m.spritemap[S];M.loop=A.hasOwnProperty("loop")?A.loop:!1,m.addMarker({name:S,start:A.start,duration:A.end-A.start,config:M})}return m},get:function(d){return u(this.sounds,"key",d)},getAll:function(d){return d?n(this.sounds,"key",d):n(this.sounds)},getAllPlaying:function(){return n(this.sounds,"isPlaying",!0)},play:function(d,v){var m=this.add(d);return m.once(o.COMPLETE,m.destroy,m),v?v.name?(m.addMarker(v),m.play(v.name)):m.play(v):m.play()},playAudioSprite:function(d,v,m){var S=this.addAudioSprite(d);return S.once(o.COMPLETE,S.destroy,S),S.play(v,m)},remove:function(d){var v=this.sounds.indexOf(d);return v!==-1?(d.destroy(),this.sounds.splice(v,1),!0):!1},removeAll:function(){this.sounds.forEach(function(d){d.destroy()}),this.sounds.length=0},removeByKey:function(d){for(var v=0,m=this.sounds.length-1;m>=0;m--){var S=this.sounds[m];S.key===d&&(S.destroy(),this.sounds.splice(m,1),v++)}return v},pauseAll:function(){this.forEachActiveSound(function(d){d.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(d){d.resume()}),this.emit(o.RESUME_ALL,this)},setListenerPosition:f,stopAll:function(){this.forEachActiveSound(function(d){d.stop()}),this.emit(o.STOP_ALL,this)},stopByKey:function(d){var v=0;return this.getAll(d).forEach(function(m){m.stop()&&v++}),v},unlock:f,onBlur:f,onFocus:f,onGameBlur:function(){this.gameLostFocus=!0,this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.gameLostFocus=!1,this.pauseOnBlur&&this.onFocus()},update:function(d,v){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var m=this.sounds.length-1;m>=0;m--)this.sounds[m].pendingRemove&&this.sounds.splice(m,1);this.sounds.forEach(function(S){S.update(d,v)})},destroy:function(){this.game.events.off(l.BLUR,this.onGameBlur,this),this.game.events.off(l.FOCUS,this.onGameFocus,this),this.game.events.off(l.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.listenerPosition=null,this.game=null},forEachActiveSound:function(d,v){var m=this;this.sounds.forEach(function(S,M){S&&!S.pendingRemove&&d.call(v||m,S,M,m.sounds)})},setRate:function(d){return this.rate=d,this},rate:{get:function(){return this._rate},set:function(d){this._rate=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(o.GLOBAL_RATE,this,d)}},setDetune:function(d){return this.detune=d,this},detune:{get:function(){return this._detune},set:function(d){this._detune=d,this.forEachActiveSound(function(v){v.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,d)}}});a.exports=c},14747:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33684),p=t(25960),h=t(57490),o={create:function(l){var n=l.config.audio,u=l.device.audio;return n.noAudio||!u.webAudio&&!u.audioData?new p(l):u.webAudio&&!n.disableWebAudio?new h(l):new r(l)}};a.exports=o},19723:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},98882:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="decodedall"},57506:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="decoded"},73146:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="destroy"},11305:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="detune"},40577:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="detune"},30333:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="mute"},20394:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="rate"},21802:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="volume"},1299:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="looped"},99190:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="loop"},97125:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="mute"},89259:a=>{/** - * @author pi-kei - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pan"},79986:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pauseall"},17586:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},19618:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="play"},42306:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="rate"},10387:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resumeall"},48959:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},9960:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="seek"},19180:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stopall"},98328:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stop"},50401:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="unlocked"},52498:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="volume"},14463:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={COMPLETE:t(19723),DECODED:t(57506),DECODED_ALL:t(98882),DESTROY:t(73146),DETUNE:t(11305),GLOBAL_DETUNE:t(40577),GLOBAL_MUTE:t(30333),GLOBAL_RATE:t(20394),GLOBAL_VOLUME:t(21802),LOOP:t(99190),LOOPED:t(1299),MUTE:t(97125),PAN:t(89259),PAUSE_ALL:t(79986),PAUSE:t(17586),PLAY:t(19618),RATE:t(42306),RESUME_ALL:t(10387),RESUME:t(48959),SEEK:t(9960),STOP_ALL:t(19180),STOP:t(98328),UNLOCKED:t(50401),VOLUME:t(52498)}},64895:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30341),p=t(83419),h=t(14463),o=t(45319),l=new p({Extends:r,initialize:function(u,f,s){if(s===void 0&&(s={}),this.tags=u.game.cache.audio.get(f),!this.tags)throw new Error('No cached audio asset with key "'+f);this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,r.call(this,u,f,s)},play:function(n,u){return this.manager.isLocked(this,"play",[n,u])||!r.prototype.play.call(this,n,u)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.PLAY,this),!0)},pause:function(){return this.manager.isLocked(this,"pause")||this.startTime>0||!r.prototype.pause.call(this)?!1:(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(h.PAUSE,this),!0)},resume:function(){return this.manager.isLocked(this,"resume")||this.startTime>0||!r.prototype.resume.call(this)||!this.pickAndPlayAudioTag()?!1:(this.emit(h.RESUME,this),!0)},stop:function(){return this.manager.isLocked(this,"stop")||!r.prototype.stop.call(this)?!1:(this.stopAndReleaseAudioTag(),this.emit(h.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var n=this.currentConfig.seek,u=this.currentConfig.delay,f=(this.currentMarker?this.currentMarker.start:0)+n;return this.previousTime=f,this.audio.currentTime=f,this.applyConfig(),u===0?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+u*1e3,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var n=0;n0){this.startTime=f-this.manager.loopEndOffset?(this.audio.currentTime=u+Math.max(0,s-f),s=this.audio.currentTime):s=f){this.reset(),this.stopAndReleaseAudioTag(),this.emit(h.COMPLETE,this);return}this.previousTime=s}},destroy:function(){r.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){r.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(n){this.currentConfig.mute=n,!this.manager.isLocked(this,"mute",n)&&(this.updateMute(),this.emit(h.MUTE,this,n))}},setMute:function(n){return this.mute=n,this},volume:{get:function(){return this.currentConfig.volume},set:function(n){this.currentConfig.volume=n,!this.manager.isLocked(this,"volume",n)&&(this.updateVolume(),this.emit(h.VOLUME,this,n))}},setVolume:function(n){return this.volume=n,this},rate:{get:function(){return this.currentConfig.rate},set:function(n){this.currentConfig.rate=n,!this.manager.isLocked(this,h.RATE,n)&&(this.calculateRate(),this.emit(h.RATE,this,n))}},setRate:function(n){return this.rate=n,this},detune:{get:function(){return this.currentConfig.detune},set:function(n){this.currentConfig.detune=n,!this.manager.isLocked(this,h.DETUNE,n)&&(this.calculateRate(),this.emit(h.DETUNE,this,n))}},setDetune:function(n){return this.detune=n,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(n){this.manager.isLocked(this,"seek",n)||this.startTime>0||(this.isPlaying||this.isPaused)&&(n=Math.min(Math.max(0,n),this.duration),this.isPlaying?(this.previousTime=n,this.audio.currentTime=n):this.isPaused&&(this.currentConfig.seek=n),this.emit(h.SEEK,this,n))}},setSeek:function(n){return this.seek=n,this},loop:{get:function(){return this.currentConfig.loop},set:function(n){this.currentConfig.loop=n,!this.manager.isLocked(this,"loop",n)&&(this.audio&&(this.audio.loop=n),this.emit(h.LOOP,this,n))}},setLoop:function(n){return this.loop=n,this},pan:{get:function(){return this.currentConfig.pan},set:function(n){this.currentConfig.pan=n,this.emit(h.PAN,this,n)}},setPan:function(n){return this.pan=n,this}});a.exports=l},33684:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85034),p=t(83419),h=t(14463),o=t(64895),l=new p({Extends:r,initialize:function(u){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,r.call(this,u)},add:function(n,u){var f=new o(this,n,u);return this.sounds.push(f),f},unlock:function(){this.locked=!1;var n=this;if(this.game.cache.audio.entries.each(function(c,d){for(var v=0;v{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={SoundManagerCreator:t(14747),Events:t(14463),BaseSound:t(30341),BaseSoundManager:t(85034),WebAudioSound:t(71741),WebAudioSoundManager:t(57490),HTML5AudioSound:t(64895),HTML5AudioSoundManager:t(33684),NoAudioSound:t(4603),NoAudioSoundManager:t(25960)}},4603:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30341),p=t(83419),h=t(50792),o=t(79291),l=t(29747),n=function(){return!1},u=function(){return null},f=function(){return this},s=new p({Extends:h,initialize:function(d,v,m){m===void 0&&(m={}),h.call(this),this.manager=d,this.key=v,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},m),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:n,updateMarker:n,removeMarker:u,play:n,pause:n,resume:n,stop:n,setMute:f,setVolume:f,setRate:f,setDetune:f,setSeek:f,setLoop:f,setPan:f,applyConfig:u,resetConfig:u,update:l,calculateRate:u,destroy:function(){r.prototype.destroy.call(this)}});a.exports=s},25960:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85034),p=t(83419),h=t(50792),o=t(4603),l=t(29747),n=new p({Extends:h,initialize:function(f){h.call(this),this.game=f,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(u,f){var s=new o(this,u,f);return this.sounds.push(s),s},addAudioSprite:function(u,f){var s=this.add(u,f);return s.spritemap={},s},get:function(u){return r.prototype.get.call(this,u)},getAll:function(u){return r.prototype.getAll.call(this,u)},play:function(u,f){return!1},playAudioSprite:function(u,f,s){return!1},remove:function(u){return r.prototype.remove.call(this,u)},removeAll:function(){return r.prototype.removeAll.call(this)},removeByKey:function(u){return r.prototype.removeByKey.call(this,u)},stopByKey:function(u){return r.prototype.stopByKey.call(this,u)},onBlur:l,onFocus:l,onGameBlur:l,onGameFocus:l,pauseAll:l,resumeAll:l,stopAll:l,update:l,setRate:l,setDetune:l,setMute:l,setVolume:l,unlock:l,forEachActiveSound:function(u,f){r.prototype.forEachActiveSound.call(this,u,f)},destroy:function(){r.prototype.destroy.call(this)}});a.exports=n},71741:(a,y,t)=>{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30341),p=t(83419),h=t(14463),o=t(95540),l=new p({Extends:r,initialize:function(u,f,s){if(s===void 0&&(s={}),this.audioBuffer=u.game.cache.audio.get(f),!this.audioBuffer)throw new Error('Audio key "'+f+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=u.context.createGain(),this.volumeNode=u.context.createGain(),this.pannerNode=null,this.spatialNode=null,this.spatialSource=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),u.context.createPanner&&(this.spatialNode=u.context.createPanner(),this.volumeNode.connect(this.spatialNode)),u.context.createStereoPanner?(this.pannerNode=u.context.createStereoPanner(),u.context.createPanner?this.spatialNode.connect(this.pannerNode):this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(u.destination)):u.context.createPanner?this.spatialNode.connect(u.destination):this.volumeNode.connect(u.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,r.call(this,u,f,s)},play:function(n,u){return r.prototype.play.call(this,n,u)?(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(h.PLAY,this),!0):!1},pause:function(){return this.manager.context.currentTime{/** - * @author Richard Davey - * @author Pavle Goloskokovic (http://prunegames.com) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(53134),p=t(85034),h=t(83419),o=t(14463),l=t(8443),n=t(71741),u=t(95540),f=new h({Extends:p,initialize:function(c){this.context=this.createAudioContext(c),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),p.call(this,c),this.locked&&c.isBooted?this.unlock():c.events.once(l.BOOT,this.unlock,this)},createAudioContext:function(s){var c=s.config.audio;if(c.context)return c.context.resume(),c.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,c){var d=new n(this,s,c);return this.sounds.push(d),d},decodeAudio:function(s,c){var d;Array.isArray(s)?d=s:d=[{key:s,data:c}];for(var v=this.game.cache.audio,m=d.length,S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37105),p=t(83419),h=t(29747),o=t(19186),l=new p({initialize:function(u){this.parent=u,this.list=[],this.position=0,this.addCallback=h,this.removeCallback=h,this._sortKey=""},add:function(n,u){return u?r.Add(this.list,n):r.Add(this.list,n,0,this.addCallback,this)},addAt:function(n,u,f){return f?r.AddAt(this.list,n,u):r.AddAt(this.list,n,u,0,this.addCallback,this)},getAt:function(n){return this.list[n]},getIndex:function(n){return this.list.indexOf(n)},sort:function(n,u){return n?(u===void 0&&(u=function(f,s){return f[n]-s[n]}),o(this.list,u),this):this},getByName:function(n){return r.GetFirst(this.list,"name",n)},getRandom:function(n,u){return r.GetRandom(this.list,n,u)},getFirst:function(n,u,f,s){return r.GetFirst(this.list,n,u,f,s)},getAll:function(n,u,f,s){return r.GetAll(this.list,n,u,f,s)},count:function(n,u){return r.CountAllMatching(this.list,n,u)},swap:function(n,u){r.Swap(this.list,n,u)},moveTo:function(n,u){return r.MoveTo(this.list,n,u)},moveAbove:function(n,u){return r.MoveAbove(this.list,n,u)},moveBelow:function(n,u){return r.MoveBelow(this.list,n,u)},remove:function(n,u){return u?r.Remove(this.list,n):r.Remove(this.list,n,this.removeCallback,this)},removeAt:function(n,u){return u?r.RemoveAt(this.list,n):r.RemoveAt(this.list,n,this.removeCallback,this)},removeBetween:function(n,u,f){return f?r.RemoveBetween(this.list,n,u):r.RemoveBetween(this.list,n,u,this.removeCallback,this)},removeAll:function(n){for(var u=this.list.length;u--;)this.remove(this.list[u],n);return this},bringToTop:function(n){return r.BringToTop(this.list,n)},sendToBack:function(n){return r.SendToBack(this.list,n)},moveUp:function(n){return r.MoveUp(this.list,n),n},moveDown:function(n){return r.MoveDown(this.list,n),n},reverse:function(){return this.list.reverse(),this},shuffle:function(){return r.Shuffle(this.list),this},replace:function(n,u){return r.Replace(this.list,n,u)},exists:function(n){return this.list.indexOf(n)>-1},setAll:function(n,u,f,s){return r.SetAll(this.list,n,u,f,s),this},each:function(n,u){for(var f=[null],s=2;s0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});a.exports=l},90330:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o){this.entries={},this.size=0,this.setAll(o)},setAll:function(h){if(Array.isArray(h))for(var o=0;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(82348),o=new r({Extends:p,initialize:function(){p.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},isActive:function(l){return this._active.indexOf(l)>-1},isPending:function(l){return this._toProcess>0&&this._pending.indexOf(l)>-1},isDestroying:function(l){return this._destroy.indexOf(l)>-1},add:function(l){return this.checkQueue&&this.isActive(l)&&!this.isDestroying(l)||this.isPending(l)||(this._pending.push(l),this._toProcess++),l},remove:function(l){if(this.isPending(l)){var n=this._pending,u=n.indexOf(l);u!==-1&&n.splice(u,1)}else this.isActive(l)&&(this._destroy.push(l),this._toProcess++);return l},removeAll:function(){for(var l=this._active,n=this._destroy,u=l.length;u--;)n.push(l[u]),this._toProcess++;return this},update:function(){if(this._toProcess===0)return this._active;var l=this._destroy,n=this._active,u,f;for(u=0;u{/** - * @author Vladimir Agafonkin - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(43886);function p(C){if(!(this instanceof p))return new p(C);this._maxEntries=Math.max(4,C||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}p.prototype={all:function(){return this._all(this.data,[])},search:function(C){var w=this.data,P=[],L=this.toBBox;if(!S(C,w))return P;for(var O=[],I,D,B,G;w;){for(I=0,D=w.children.length;I=0&&I[w].children.length>this._maxEntries;)this._split(I,w),w--;this._adjustParentBBoxes(O,I,w)},_split:function(C,w){var P=C[w],L=P.children.length,O=this._minEntries;this._chooseSplitAxis(P,O,L);var I=this._chooseSplitIndex(P,O,L),D=M(P.children.splice(I,P.children.length-I));D.height=P.height,D.leaf=P.leaf,o(P,this.toBBox),o(D,this.toBBox),w?C[w-1].children.push(D):this._splitRoot(P,D)},_splitRoot:function(C,w){this.data=M([C,w]),this.data.height=C.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(C,w,P){var L,O,I,D,B,G,z,W;for(G=z=1/0,L=w;L<=P-w;L++)O=l(C,0,L,this.toBBox),I=l(C,L,P,this.toBBox),D=v(O,I),B=s(O)+s(I),D=w;G--)z=C.children[G],n(D,C.leaf?O(z):z),B+=c(D);return B},_adjustParentBBoxes:function(C,w,P){for(var L=P;L>=0;L--)n(w[L],C)},_condense:function(C){for(var w=C.length-1,P;w>=0;w--)C[w].children.length===0?w>0?(P=C[w-1].children,P.splice(P.indexOf(C[w]),1)):this.clear():o(C[w],this.toBBox)},compareMinX:function(C,w){return C.left-w.left},compareMinY:function(C,w){return C.top-w.top},toBBox:function(C){return{minX:C.left,minY:C.top,maxX:C.right,maxY:C.bottom}}};function h(C,w,P){if(!P)return w.indexOf(C);for(var L=0;L=C.minX&&w.maxY>=C.minY}function M(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(C,w,P,L,O){for(var I=[w,P],D;I.length;)P=I.pop(),w=I.pop(),!(P-w<=L)&&(D=w+Math.ceil((P-w)/L/2)*L,r(C,D,w,P,O),I.push(w,D,D,P))}a.exports=p},35072:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o){if(this.entries=[],Array.isArray(o))for(var l=0;l-1&&this.entries.splice(o,1),this},dump:function(){console.group("Set");for(var h=0;h-1},union:function(h){var o=new p;return h.entries.forEach(function(l){o.set(l)}),this.entries.forEach(function(l){o.set(l)}),o},intersect:function(h){var o=new p;return this.entries.forEach(function(l){h.contains(l)&&o.set(l)}),o},difference:function(h){var o=new p;return this.entries.forEach(function(l){h.contains(l)||o.set(l)}),o},size:{get:function(){return this.entries.length},set:function(h){return h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45319),p=t(83419),h=t(56583),o=t(26099),l=new p({initialize:function(u,f,s,c){u===void 0&&(u=0),f===void 0&&(f=u),s===void 0&&(s=0),c===void 0&&(c=null),this._width=u,this._height=f,this._parent=c,this.aspectMode=s,this.aspectRatio=f===0?1:u/f,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(n){return n===void 0&&(n=0),this.aspectMode=n,this.setSize(this._width,this._height)},setSnap:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.snapTo.set(n,u),this.setSize(this._width,this._height)},setParent:function(n){return this._parent=n,this.setSize(this._width,this._height)},setMin:function(n,u){return n===void 0&&(n=0),u===void 0&&(u=n),this.minWidth=r(n,0,this.maxWidth),this.minHeight=r(u,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(n,u){return n===void 0&&(n=Number.MAX_VALUE),u===void 0&&(u=n),this.maxWidth=r(n,this.minWidth,Number.MAX_VALUE),this.maxHeight=r(u,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(n,u){switch(n===void 0&&(n=0),u===void 0&&(u=n),this.aspectMode){case l.NONE:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height;break;case l.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case l.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(h(u,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case l.FIT:this.constrain(n,u,!0);break;case l.ENVELOP:this.constrain(n,u,!1);break}return this},setAspectRatio:function(n){return this.aspectRatio=n,this.setSize(this._width,this._height)},resize:function(n,u){return this._width=this.getNewWidth(h(n,this.snapTo.x)),this._height=this.getNewHeight(h(u,this.snapTo.y)),this.aspectRatio=this._height===0?1:this._width/this._height,this},getNewWidth:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minWidth,this.maxWidth),u&&this._parent&&n>this._parent.width&&(n=Math.max(this.minWidth,this._parent.width)),n},getNewHeight:function(n,u){return u===void 0&&(u=!0),n=r(n,this.minHeight,this.maxHeight),u&&this._parent&&n>this._parent.height&&(n=Math.max(this.minHeight,this._parent.height)),n},constrain:function(n,u,f){n===void 0&&(n=0),u===void 0&&(u=n),f===void 0&&(f=!0),n=this.getNewWidth(n),u=this.getNewHeight(u);var s=this.snapTo,c=u===0?1:n/u;return f&&this.aspectRatio>c||!f&&this.aspectRatio0&&(u=h(u,s.y),n=u*this.aspectRatio)):(f&&this.aspectRatioc)&&(u=h(u,s.y),n=u*this.aspectRatio,s.x>0&&(n=h(n,s.x),u=n*(1/this.aspectRatio))),this._width=n,this._height=u,this},fitTo:function(n,u){return this.constrain(n,u,!0)},envelop:function(n,u){return this.constrain(n,u,!1)},setWidth:function(n){return this.setSize(n,this._height)},setHeight:function(n){return this.setSize(this._width,n)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(n){n&&n.style&&(n.style.width=this._width+"px",n.style.height=this._height+"px")},copy:function(n){return n.setAspectMode(this.aspectMode),n.aspectRatio=this.aspectRatio,n.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(n){this.setSize(n,this._height)}},height:{get:function(){return this._height},set:function(n){this.setSize(this._width,n)}}});l.NONE=0,l.WIDTH_CONTROLS_HEIGHT=1,l.HEIGHT_CONTROLS_WIDTH=2,l.FIT=3,l.ENVELOP=4,a.exports=l},15238:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="add"},56187:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="remove"},82348:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={PROCESS_QUEUE_ADD:t(15238),PROCESS_QUEUE_REMOVE:t(56187)}},41392:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Events:t(82348),List:t(73162),Map:t(90330),ProcessQueue:t(25774),RTree:t(59542),Set:t(35072),Size:t(86555)}},57382:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(45319),h=t(40987),o=t(8054),l=t(50030),n=t(79237),u=new r({Extends:n,initialize:function(s,c,d,v,m){n.call(this,s,c,d,v,m),this.add("__BASE",0,0,0,v,m),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d",{willReadFrequently:!0}),this.width=v,this.height=m,this.imageData=this.context.getImageData(0,0,v,m),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(f,s,c,d){return d===void 0&&(d=!0),this.context.drawImage(c,f,s),d&&this.update(),this},drawFrame:function(f,s,c,d,v){c===void 0&&(c=0),d===void 0&&(d=0),v===void 0&&(v=!0);var m=this.manager.getFrame(f,s);if(m){var S=m.canvasData,M=m.cutWidth,A=m.cutHeight,C=m.source.resolution;this.context.drawImage(m.source.image,S.x,S.y,M,A,c,d,M/C,A/C),v&&this.update()}return this},setPixel:function(f,s,c,d,v,m){m===void 0&&(m=255),f=Math.abs(Math.floor(f)),s=Math.abs(Math.floor(s));var S=this.getIndex(f,s);if(S>-1){var M=this.context.getImageData(f,s,1,1);M.data[0]=c,M.data[1]=d,M.data[2]=v,M.data[3]=m,this.context.putImageData(M,f,s)}return this},putData:function(f,s,c,d,v,m,S){return d===void 0&&(d=0),v===void 0&&(v=0),m===void 0&&(m=f.width),S===void 0&&(S=f.height),this.context.putImageData(f,s,c,d,v,m,S),this},getData:function(f,s,c,d){f=p(Math.floor(f),0,this.width-1),s=p(Math.floor(s),0,this.height-1),c=p(c,1,this.width-f),d=p(d,1,this.height-s);var v=this.context.getImageData(f,s,c,d);return v},getPixel:function(f,s,c){c||(c=new h);var d=this.getIndex(f,s);if(d>-1){var v=this.data,m=v[d+0],S=v[d+1],M=v[d+2],A=v[d+3];c.setTo(m,S,M,A)}return c},getPixels:function(f,s,c,d){f===void 0&&(f=0),s===void 0&&(s=0),c===void 0&&(c=this.width),d===void 0&&(d=c),f=Math.abs(Math.round(f)),s=Math.abs(Math.round(s));for(var v=p(f,0,this.width),m=p(f+c,0,this.width),S=p(s,0,this.height),M=p(s+d,0,this.height),A=new h,C=[],w=S;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(10312),p=t(71911),h=t(27919),o=t(83419),l=t(8054),n=t(4327),u=t(95540),f=t(36060),s=t(32302),c=t(79237),d=t(70554),v=new o({Extends:c,initialize:function(S,M,A,C){A===void 0&&(A=256),C===void 0&&(C=256),this.type="DynamicTexture";var w=S.game.renderer,P=w&&w.type===l.CANVAS,L=P?h.create2D(this,A,C):[this];c.call(this,S,M,L,A,C),this.add("__BASE",0,0,0,A,C),this.renderer=w,this.width=-1,this.height=-1,this.isDrawing=!1,this.canvas=P?L:null,this.context=P?L.getContext("2d",{willReadFrequently:!0}):null,this.dirty=!1,this.isSpriteTexture=!0,this._eraseMode=!1,this.camera=new p(0,0,A,C).setScene(S.game.scene.systemScene,!1),this.renderTarget=P?null:new s(w,A,C,1,0,!1,!0,!0,!1),this.pipeline=P?null:w.pipelines.get(f.SINGLE_PIPELINE),this.setSize(A,C)},setSize:function(m,S){S===void 0&&(S=m);var M=this.get(),A=M.source;if(m!==this.width||S!==this.height){this.canvas&&(this.canvas.width=m,this.canvas.height=S);var C=this.renderTarget;C&&(C.willResize(m,S)&&C.resize(m,S),C.texture!==A.glTexture&&this.renderer.deleteTexture(A.glTexture),this.setFromRenderTarget()),this.camera.setSize(m,S),A.width=m,A.height=S,M.setSize(m,S),this.width=m,this.height=S}else{var w=this.getSourceImage();M.cutX+m>w.width&&(m=w.width-M.cutX),M.cutY+S>w.height&&(S=w.height-M.cutY),M.setSize(m,S,M.cutX,M.cutY)}return this},setFromRenderTarget:function(){var m=this.get(),S=m.source,M=this.renderTarget;return S.isRenderTexture=!0,S.isGLTexture=!0,S.glTexture=M.texture,this},setIsSpriteTexture:function(m){return this.isSpriteTexture=m,this},fill:function(m,S,M,A,C,w){var P=this.camera,L=this.renderer;S===void 0&&(S=1),M===void 0&&(M=0),A===void 0&&(A=0),C===void 0&&(C=this.width),w===void 0&&(w=this.height);var O=m>>16&255,I=m>>8&255,D=m&255,B=this.renderTarget;if(P.preRender(),B){B.bind(!0);var G=this.pipeline.manager.set(this.pipeline),z=L.width/B.width,W=L.height/B.height,k=B.height-(A+w);G.drawFillRect(M*z,k*W,C*z,w*W,d.getTintFromFloats(D/255,I/255,O/255,1),S),B.unbind(!0)}else{var J=this.context;L.setContext(J),J.globalCompositeOperation="source-over",J.fillStyle="rgba("+O+","+I+","+D+","+S+")",J.fillRect(M,A,C,w),L.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var m=this.context,S=this.renderTarget;S?S.clear():m&&(m.save(),m.setTransform(1,0,0,1,0,0),m.clearRect(0,0,this.width,this.height),m.restore()),this.dirty=!1}return this},stamp:function(m,S,M,A,C){M===void 0&&(M=0),A===void 0&&(A=0);var w=u(C,"alpha",1),P=u(C,"tint",16777215),L=u(C,"angle",0),O=u(C,"rotation",0),I=u(C,"scale",1),D=u(C,"scaleX",I),B=u(C,"scaleY",I),G=u(C,"originX",.5),z=u(C,"originY",.5),W=u(C,"blendMode",0),k=u(C,"erase",!1),J=u(C,"skipBatch",!1),Q=this.manager.resetStamp(w,P);return Q.setAngle(0),L!==0?Q.setAngle(L):O!==0&&Q.setRotation(O),Q.setScale(D,B),Q.setTexture(m,S),Q.setOrigin(G,z),Q.setBlendMode(W),k&&(this._eraseMode=!0),J?this.batchGameObject(Q,M,A):this.draw(Q,M,A),k&&(this._eraseMode=!1),this},erase:function(m,S,M){return this._eraseMode=!0,this.draw(m,S,M),this._eraseMode=!1,this},draw:function(m,S,M,A,C){return this.beginDraw(),this.batchDraw(m,S,M,A,C),this.endDraw(),this},drawFrame:function(m,S,M,A,C,w){return this.beginDraw(),this.batchDrawFrame(m,S,M,A,C,w),this.endDraw(),this},repeat:function(m,S,M,A,C,w,P,L,O){if(M===void 0&&(M=0),A===void 0&&(A=0),C===void 0&&(C=this.width),w===void 0&&(w=this.height),P===void 0&&(P=1),L===void 0&&(L=16777215),O===void 0&&(O=!1),m instanceof n?S=m:S=this.manager.getFrame(m,S),!S)return this;var I=this.manager.resetStamp(P,L);I.setFrame(S),I.setOrigin(0);var D=S.width,B=S.height;C=Math.floor(C),w=Math.floor(w);var G=Math.ceil(C/D),z=Math.ceil(w/B),W=G*D-C,k=z*B-w;W>0&&(W=D-W),k>0&&(k=B-k),M<0&&(G+=Math.ceil(Math.abs(M)/D)),A<0&&(z+=Math.ceil(Math.abs(A)/B));var J=M,Q=A,Y=!1,K=this.manager.stampCrop.setTo(0,0,D,B);O||this.beginDraw();for(var U=0;U0&&V===G-1&&(Y=!0,K.width=W),k>0&&U===z-1&&(Y=!0,K.height=k),Y&&I.setCrop(K),this.batchGameObject(I,J,Q),I.isCropped=!1,K.setTo(0,0,D,B),J+=D}J=M,Q+=B}return O||this.endDraw(),this},beginDraw:function(){if(!this.isDrawing){var m=this.camera,S=this.renderer,M=this.renderTarget;m.preRender(),M?S.beginCapture(M.width,M.height):S.setContext(this.context),this.isDrawing=!0}return this},batchDraw:function(m,S,M,A,C){return Array.isArray(m)||(m=[m]),this.batchList(m,S,M,A,C),this},batchDrawFrame:function(m,S,M,A,C,w){M===void 0&&(M=0),A===void 0&&(A=0),C===void 0&&(C=1),w===void 0&&(w=16777215);var P=this.manager.getFrame(m,S);return P&&(this.renderTarget?this.pipeline.batchTextureFrame(P,M,A,w,C,this.camera.matrix,null):this.batchTextureFrame(P,M,A,C,w)),this},endDraw:function(m){if(m===void 0&&(m=this._eraseMode),this.isDrawing){var S=this.renderer,M=this.renderTarget;if(M){var A=S.endCapture(),C=S.pipelines.setUtility();C.blitFrame(A,M,1,!1,!1,m,this.isSpriteTexture),S.resetScissor(),S.resetViewport()}else S.setContext();this.dirty=!0,this.isDrawing=!1}return this},batchList:function(m,S,M,A,C){var w=m.length;if(w!==0)for(var P=0;P0&&O.height>0&&L.drawImage(I,O.x,O.y,O.width,O.height,S,M,O.width,O.height),L.restore()}},snapshotArea:function(m,S,M,A,C,w,P){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,C,!1,m,S,M,A,w,P):this.renderer.snapshotCanvas(this.canvas,C,!1,m,S,M,A,w,P),this},snapshot:function(m,S,M){return this.snapshotArea(0,0,this.width,this.height,m,S,M)},snapshotPixel:function(m,S,M){return this.snapshotArea(m,S,1,1,M,"pixel")},getWebGLTexture:function(){if(this.renderTarget)return this.renderTarget.texture},renderWebGL:function(m,S,M,A){var C=this.manager.resetStamp();C.setTexture(this),C.setOrigin(0),C.renderWebGL(m,C,M,A)},renderCanvas:function(){},destroy:function(){var m=this.manager.stamp;m&&m.texture===this&&this.manager.resetStamp(),c.prototype.destroy.call(this),h.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.renderer=null}});a.exports=v},4327:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(45319),h=t(79291),o=new r({initialize:function(n,u,f,s,c,d,v){this.texture=n,this.name=u,this.source=n.source[f],this.sourceIndex=f,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(d,v,s,c)},setSize:function(l,n,u,f){u===void 0&&(u=0),f===void 0&&(f=0),this.cutX=u,this.cutY=f,this.cutWidth=l,this.cutHeight=n,this.width=l,this.height=n,this.halfWidth=Math.floor(l*.5),this.halfHeight=Math.floor(n*.5),this.centerX=Math.floor(l/2),this.centerY=Math.floor(n/2);var s=this.data,c=s.cut;c.x=u,c.y=f,c.w=l,c.h=n,c.r=u+l,c.b=f+n,s.sourceSize.w=l,s.sourceSize.h=n,s.spriteSourceSize.w=l,s.spriteSourceSize.h=n,s.radius=.5*Math.sqrt(l*l+n*n);var d=s.drawImage;return d.x=u,d.y=f,d.width=l,d.height=n,this.updateUVs()},setTrim:function(l,n,u,f,s,c){var d=this.data,v=d.spriteSourceSize;return d.trim=!0,d.sourceSize.w=l,d.sourceSize.h=n,v.x=u,v.y=f,v.w=s,v.h=c,v.r=u+s,v.b=f+c,this.x=u,this.y=f,this.width=s,this.height=c,this.halfWidth=s*.5,this.halfHeight=c*.5,this.centerX=Math.floor(s/2),this.centerY=Math.floor(c/2),this.updateUVs()},setScale9:function(l,n,u,f){var s=this.data;return s.scale9=!0,s.is3Slice=n===0&&f===this.height,s.scale9Borders.x=l,s.scale9Borders.y=n,s.scale9Borders.w=u,s.scale9Borders.h=f,this},setCropUVs:function(l,n,u,f,s,c,d){var v=this.cutX,m=this.cutY,S=this.cutWidth,M=this.cutHeight,A=this.realWidth,C=this.realHeight;n=p(n,0,A),u=p(u,0,C),f=p(f,0,A-n),s=p(s,0,C-u);var w=v+n,P=m+u,L=f,O=s,I=this.data;if(I.trim){var D=I.spriteSourceSize;f=p(f,0,S-n),s=p(s,0,M-u);var B=n+f,G=u+s,z=!(D.rB||D.y>G);if(z){var W=Math.max(D.x,n),k=Math.max(D.y,u),J=Math.min(D.r,B)-W,Q=Math.min(D.b,G)-k;L=J,O=Q,c?w=v+(S-(W-D.x)-J):w=v+(W-D.x),d?P=m+(M-(k-D.y)-Q):P=m+(k-D.y),n=W,u=k,f=J,s=Q}else w=0,P=0,L=0,O=0}else c&&(w=v+(S-n-f)),d&&(P=m+(M-u-s));var Y=this.source.width,K=this.source.height;return l.u0=Math.max(0,w/Y),l.v0=Math.max(0,P/K),l.u1=Math.min(1,(w+L)/Y),l.v1=Math.min(1,(P+O)/K),l.x=n,l.y=u,l.cx=w,l.cy=P,l.cw=L,l.ch=O,l.width=f,l.height=s,l.flipX=c,l.flipY=d,l},updateCropUVs:function(l,n,u){return this.setCropUVs(l,l.x,l.y,l.width,l.height,n,u)},setUVs:function(l,n,u,f,s,c){var d=this.data.drawImage;return d.width=l,d.height=n,this.u0=u,this.v0=f,this.u1=s,this.v1=c,this},updateUVs:function(){var l=this.cutX,n=this.cutY,u=this.cutWidth,f=this.cutHeight,s=this.data.drawImage;s.width=u,s.height=f;var c=this.source.width,d=this.source.height;return this.u0=l/c,this.v0=n/d,this.u1=(l+u)/c,this.v1=(n+f)/d,this},updateUVsInverted:function(){var l=this.source.width,n=this.source.height;return this.u0=(this.cutX+this.cutHeight)/l,this.v0=this.cutY/n,this.u1=this.cutX/l,this.v1=(this.cutY+this.cutWidth)/n,this},clone:function(){var l=new o(this.texture,this.name,this.sourceIndex);return l.cutX=this.cutX,l.cutY=this.cutY,l.cutWidth=this.cutWidth,l.cutHeight=this.cutHeight,l.x=this.x,l.y=this.y,l.width=this.width,l.height=this.height,l.halfWidth=this.halfWidth,l.halfHeight=this.halfHeight,l.centerX=this.centerX,l.centerY=this.centerY,l.rotated=this.rotated,l.data=h(!0,l.data,this.data),l.updateUVs(),l},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}}});a.exports=o},79237:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(4327),h=t(11876),o='Texture "%s" has no frame "%s"',l=new r({initialize:function(u,f,s,c,d){Array.isArray(s)||(s=[s]),this.manager=u,this.key=f,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var v=0;vc&&(c=m.cutX+m.cutWidth),m.cutY+m.cutHeight>d&&(d=m.cutY+m.cutHeight)}return{x:f,y:s,width:c-f,height:d-s}},getFrameNames:function(n){n===void 0&&(n=!1);var u=Object.keys(this.frames);if(!n){var f=u.indexOf("__BASE");f!==-1&&u.splice(f,1)}return u},getSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n];return u?u.source.image:(console.warn(o,this.key,n),this.frames.__BASE.source.image)},getDataSourceImage:function(n){(n==null||this.frameTotal===1)&&(n="__BASE");var u=this.frames[n],f;return u?f=u.sourceIndex:(console.warn(o,this.key,n),f=this.frames.__BASE.sourceIndex),this.dataSource[f].image},setDataSource:function(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=t(57382),h=t(83419),o=t(40987),l=t(8054),n=t(81320),u=t(50792),f=t(69442),s=t(4327),c=t(8443),d=t(99584),v=t(35154),m=t(88571),S=t(41212),M=t(61309),A=t(87841),C=t(79237),w=new h({Extends:u,initialize:function(L){u.call(this),this.game=L,this.name="TextureManager",this.list={},this._tempCanvas=r.create2D(this),this._tempContext=this._tempCanvas.getContext("2d",{willReadFrequently:!0}),this._pending=0,this.stamp,this.stampCrop=new A,this.silentWarnings=!1,L.events.once(c.BOOT,this.boot,this)},boot:function(){this._pending=3,this.on(f.LOAD,this.updatePending,this),this.on(f.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(c.DESTROY,this.destroy,this),this.game.events.once(c.SYSTEM_READY,function(L){this.stamp=new m(L).setOrigin(0)},this)},updatePending:function(){this._pending--,this._pending===0&&(this.off(f.LOAD),this.off(f.ERROR),this.emit(f.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 L=P.key;return this.list.hasOwnProperty(L)&&(P.destroy(),this.emit(f.REMOVE,L),this.emit(f.REMOVE_KEY+L)),this},removeKey:function(P){return this.list.hasOwnProperty(P)&&delete this.list[P],this},addBase64:function(P,L){if(this.checkKey(P)){var O=this,I=new Image;I.onerror=function(){O.emit(f.ERROR,P)},I.onload=function(){var D=O.create(P,I);M.Image(D,0),O.emit(f.ADD,P,D),O.emit(f.ADD_KEY+P,D),O.emit(f.LOAD,P,D)},I.src=L}return this},getBase64:function(P,L,O,I){O===void 0&&(O="image/png"),I===void 0&&(I=.92);var D="",B=this.getFrame(P,L);if(B&&(B.source.isRenderTexture||B.source.isGLTexture))this.silentWarnings||console.warn("Cannot getBase64 from WebGL Texture");else if(B){var G=B.canvasData,z=r.create2D(this,G.width,G.height),W=z.getContext("2d",{willReadFrequently:!0});G.width>0&&G.height>0&&W.drawImage(B.source.image,G.x,G.y,G.width,G.height,0,0,G.width,G.height),D=z.toDataURL(O,I),r.remove(z)}return D},addImage:function(P,L,O){var I=null;return this.checkKey(P)&&(I=this.create(P,L),M.Image(I,0),O&&I.setDataSource(O),this.emit(f.ADD,P,I),this.emit(f.ADD_KEY+P,I)),I},addGLTexture:function(P,L){var O=null;if(this.checkKey(P)){var I=L.width,D=L.height;O=this.create(P,L,I,D),O.add("__BASE",0,0,0,I,D),this.emit(f.ADD,P,O),this.emit(f.ADD_KEY+P,O)}return O},addCompressedTexture:function(P,L,O){var I=null;if(this.checkKey(P)){if(I=this.create(P,L),I.add("__BASE",0,0,0,L.width,L.height),O){var D=function(G,z,W){Array.isArray(W.textures)||Array.isArray(W.frames)?M.JSONArray(G,z,W):M.JSONHash(G,z,W)};if(Array.isArray(O))for(var B=0;B=B.x&&P=B.y&&L=B.x&&P=B.y&&L{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(27919),p=t(83419),h=t(50030),o=t(29795),l=t(82751),n=new p({initialize:function(f,s,c,d,v){v===void 0&&(v=!1);var m=f.manager.game;this.renderer=m.renderer,this.texture=f,this.source=s,this.image=s.compressed?null:s,this.compressionAlgorithm=s.compressed?s.format:null,this.resolution=1,this.width=c||s.naturalWidth||s.videoWidth||s.width||0,this.height=d||s.naturalHeight||s.videoHeight||s.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=s instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&s instanceof HTMLVideoElement,this.isRenderTexture=s.type==="RenderTexture"||s.type==="DynamicTexture",this.isGLTexture=s instanceof l,this.isPowerOf2=h(this.width,this.height),this.glTexture=null,this.flipY=v,this.init(m)},init:function(u){var f=this.renderer;if(f){var s=this.source;if(f.gl){var c=this.image,d=this.flipY,v=this.width,m=this.height,S=this.scaleMode;this.isCanvas?this.glTexture=f.createCanvasTexture(c,!1,d):this.isVideo?this.glTexture=f.createVideoTexture(c,!1,d):this.isRenderTexture?this.glTexture=f.createTextureFromSource(null,v,m,S):this.isGLTexture?this.glTexture=s:this.compressionAlgorithm?this.glTexture=f.createTextureFromSource(s,void 0,void 0,S):s instanceof Uint8Array?this.glTexture=f.createUint8ArrayTexture(s,v,m,S):this.glTexture=f.createTextureFromSource(c,v,m,S)}else this.isRenderTexture&&(this.image=s.canvas)}u.config.antialias||this.setFilter(1)},setFilter:function(u){this.renderer&&this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,u),this.scaleMode=u},setFlipY:function(u){return u===void 0&&(u=!0),u===this.flipY?this:(this.flipY=u,this.update(),this)},update:function(){var u=this.renderer,f=this.image,s=this.flipY,c=u.gl;c&&this.isCanvas?u.updateCanvasTexture(f,this.glTexture,s):c&&this.isVideo&&u.updateVideoTexture(f,this.glTexture,s)},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture),this.isCanvas&&r.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});a.exports=n},19673:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={LINEAR:0,NEAREST:1};a.exports=y},44538:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="addtexture"},63486:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="addtexture-"},94851:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="onerror"},29099:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="onload"},8678:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="ready"},86415:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="removetexture"},30879:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="removetexture-"},69442:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ADD:t(44538),ADD_KEY:t(63486),ERROR:t(94851),LOAD:t(29099),READY:t(8678),REMOVE:t(86415),REMOVE_KEY:t(30879)}},27458:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79291),p=t(19673),h={CanvasTexture:t(57382),DynamicTexture:t(81320),Events:t(69442),FilterMode:p,Frame:t(4327),Parsers:t(61309),Texture:t(79237),TextureManager:t(17130),TextureSource:t(11876)};h=r(!1,h,p),a.exports=h},89905:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(!p.getElementsByTagName("TextureAtlas")){console.warn("Invalid Texture Atlas XML given");return}var h=t.source[r];t.add("__BASE",r,0,0,h.width,h.height);for(var o=p.getElementsByTagName("SubTexture"),l,n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.source[r];return t.add("__BASE",r,0,0,p.width,p.height),t};a.exports=y},4832:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.source[r];return t.add("__BASE",r,0,0,p.width,p.height),t};a.exports=y},78566:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41786),p=function(h,o,l){if(!l.frames&&!l.textures){console.warn("Invalid Texture Atlas JSON Array");return}var n=h.source[o];h.add("__BASE",o,0,0,n.width,n.height);for(var u=Array.isArray(l.textures)?l.textures[o].frames:l.frames,f,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41786),p=function(h,o,l){if(!l.frames){console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object");return}var n=h.source[o];h.add("__BASE",o,0,0,n.width,n.height);var u=l.frames,f;for(var s in u)if(u.hasOwnProperty(s)){var c=u[s];if(f=h.add(s,o,c.frame.x,c.frame.y,c.frame.w,c.frame.h),!f){console.warn("Invalid atlas json, frame already exists: "+s);continue}c.trimmed&&f.setTrim(c.sourceSize.w,c.sourceSize.h,c.spriteSourceSize.x,c.spriteSourceSize.y,c.spriteSourceSize.w,c.spriteSourceSize.h),c.rotated&&(f.rotated=!0,f.updateUVsInverted());var d=c.anchor||c.pivot;d&&(f.customPivot=!0,f.pivotX=d.x,f.pivotY=d.y),c.scale9Borders&&f.setScale9(c.scale9Borders.x,c.scale9Borders.y,c.scale9Borders.w,c.scale9Borders.h),f.customData=r(c)}for(var v in l)v!=="frames"&&(Array.isArray(l[v])?h.customData[v]=l[v].slice(0):h.customData[v]=l[v]);return h};a.exports=p},31403:a=>{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=[171,75,84,88,32,49,49,187,13,10,26,10],p,h=new Uint8Array(t,0,12);for(p=0;p>1),A=Math.max(1,A>>1),S+=C}return{mipmaps:m,width:s,height:c,internalFormat:f,compressed:!0,generateMipmap:!1}};a.exports=y},82038:a=>{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(L,O,I,D,B,G,z){return z===void 0&&(z=16),Math.floor((L+I)/B)*Math.floor((O+D)/G)*z}function t(L,O){return L=Math.max(L,16),O=Math.max(O,8),L*O/4}function r(L,O){return L=Math.max(L,8),O=Math.max(O,8),L*O/2}function p(L,O){return Math.ceil(L/4)*Math.ceil(O/4)*16}function h(L,O){return y(L,O,3,3,4,4,8)}function o(L,O){return y(L,O,3,3,4,4)}function l(L,O){return y(L,O,4,3,5,4)}function n(L,O){return y(L,O,4,4,5,5)}function u(L,O){return y(L,O,5,4,6,5)}function f(L,O){return y(L,O,5,5,6,6)}function s(L,O){return y(L,O,7,4,8,5)}function c(L,O){return y(L,O,7,5,8,6)}function d(L,O){return y(L,O,7,7,8,8)}function v(L,O){return y(L,O,9,4,10,5)}function m(L,O){return y(L,O,9,5,10,6)}function S(L,O){return y(L,O,9,7,10,8)}function M(L,O){return y(L,O,9,9,10,10)}function A(L,O){return y(L,O,11,9,12,10)}function C(L,O){return y(L,O,11,11,12,12)}var w={0:{sizeFunc:t,glFormat:[35841]},1:{sizeFunc:t,glFormat:[35843]},2:{sizeFunc:r,glFormat:[35840]},3:{sizeFunc:r,glFormat:[35842]},6:{sizeFunc:h,glFormat:[36196]},7:{sizeFunc:h,glFormat:[33776,35916]},8:{sizeFunc:o,glFormat:[33777,35917]},9:{sizeFunc:o,glFormat:[33778,35918]},11:{sizeFunc:o,glFormat:[33779,35919]},14:{sizeFunc:p,glFormat:[36494,36495]},15:{sizeFunc:p,glFormat:[36492,36493]},22:{sizeFunc:h,glFormat:[37492,37493]},23:{sizeFunc:o,glFormat:[37496,37497]},24:{sizeFunc:h,glFormat:[37494,37495]},25:{sizeFunc:h,glFormat:[37488]},26:{sizeFunc:o,glFormat:[37490]},27:{sizeFunc:o,glFormat:[37808,37840]},28:{sizeFunc:l,glFormat:[37809,37841]},29:{sizeFunc:n,glFormat:[37810,37842]},30:{sizeFunc:u,glFormat:[37811,37843]},31:{sizeFunc:f,glFormat:[37812,37844]},32:{sizeFunc:s,glFormat:[37813,37845]},33:{sizeFunc:c,glFormat:[37814,37846]},34:{sizeFunc:d,glFormat:[37815,37847]},35:{sizeFunc:v,glFormat:[37816,37848]},36:{sizeFunc:m,glFormat:[37817,37849]},37:{sizeFunc:S,glFormat:[37818,37850]},38:{sizeFunc:M,glFormat:[37819,37851]},39:{sizeFunc:A,glFormat:[37820,37852]},40:{sizeFunc:C,glFormat:[37821,37853]}},P=function(L){for(var O=new Uint32Array(L,0,13),I=O[0],D=I===55727696,B=D?O[2]:O[3],G=O[4],z=w[B].glFormat[G],W=w[B].sizeFunc,k=O[11],J=O[7],Q=O[6],Y=52+O[12],K=new Uint8Array(L,Y),U=new Array(k),V=0,j=J,$=Q,q=0;q>1),$=Math.max(1,$>>1),V+=it}return{mipmaps:U,width:J,height:Q,internalFormat:z,compressed:!0,generateMipmap:!1}};a.exports=P},75549:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=function(h,o,l,n,u,f,s){var c=r(s,"frameWidth",null),d=r(s,"frameHeight",c);if(c===null)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var v=h.source[o];h.add("__BASE",o,0,0,v.width,v.height);var m=r(s,"startFrame",0),S=r(s,"endFrame",-1),M=r(s,"margin",0),A=r(s,"spacing",0),C=Math.floor((u-M+A)/(c+A)),w=Math.floor((f-M+A)/(d+A)),P=C*w;P===0&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",h.key),(m>P||m<-P)&&(m=0),m<0&&(m=P+m),(S===-1||S>P||Su&&(I=z-u),W>f&&(D=W-f),G>=m&&G<=S&&(h.add(B,o,l+L,n+O,c-I,d-D),B++),L+=c+A,L+c>u&&(L=M,O+=d+A)}return h};a.exports=p},47534:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=function(h,o,l){var n=r(l,"frameWidth",null),u=r(l,"frameHeight",n);if(!n)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var f=h.source[0];h.add("__BASE",0,0,0,f.width,f.height),r(l,"startFrame",0),r(l,"endFrame",-1);for(var s=r(l,"margin",0),c=r(l,"spacing",0),d=o.cutX,v=o.cutY,m=o.cutWidth,S=o.cutHeight,M=o.realWidth,A=o.realHeight,C=Math.floor((M-s+c)/(n+c)),w=Math.floor((A-s+c)/(u+c)),P=o.x,L=n-P,O=n-(M-m-P),I=o.y,D=u-I,B=u-(A-S-I),G,z=s,W=s,k=0,J=0,Q=0;Q{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=0,t=function(p,h,o,l){var n=y-l.y-l.height;p.add(o,h,l.x,n,l.width,l.height)},r=function(p,h,o){var l=p.source[h];p.add("__BASE",h,0,0,l.width,l.height),y=l.height;for(var n=o.split(` -`),u=/^[ ]*(- )*(\w+)+[: ]+(.*)/,f="",s="",c={x:0,y:0,width:0,height:0},d=0;d{/** - * @author Ben Richards - * @copyright 2024 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(50030),p=function(f){for(var s=f.mipmaps,c=1;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AtlasXML:t(89905),Canvas:t(72893),Image:t(4832),JSONArray:t(78566),JSONHash:t(39711),KTXParser:t(31403),PVRParser:t(82038),SpriteSheet:t(75549),SpriteSheetFromAtlas:t(47534),UnityYAML:t(86147)}},80341:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},16536:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o,l,n,u,f,s,c){(n===void 0||n<=0)&&(n=32),(u===void 0||u<=0)&&(u=32),f===void 0&&(f=0),s===void 0&&(s=0),this.name=o,this.firstgid=l|0,this.imageWidth=n|0,this.imageHeight=u|0,this.imageMargin=f|0,this.imageSpacing=s|0,this.properties=c||{},this.images=[],this.total=0},containsImageIndex:function(h){return h>=this.firstgid&&h{/** - * @author Richard Davey - * @copyright 2021 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=new r({initialize:function(o){if(this.gids=[],o!==void 0)for(var l=0;l{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80341),p=t(87010),h=t(46177),o=t(49075),l=function(n,u,f,s,c,d,v,m){f===void 0&&(f=32),s===void 0&&(s=32),c===void 0&&(c=10),d===void 0&&(d=10),m===void 0&&(m=!1);var S=null;if(Array.isArray(v)){var M=u!==void 0?u:"map";S=h(M,r.ARRAY_2D,v,f,s,m)}else if(u!==void 0){var A=n.cache.tilemap.get(u);A?S=h(u,A.format,A.data,f,s,m):console.warn("No map data found for key "+u)}return S===null&&(S=new p({tileWidth:f,tileHeight:s,width:c,height:d})),new o(n,S)};a.exports=l},23029:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(31401),h=t(91907),o=t(62644),l=t(93232),n=new r({Mixins:[p.AlphaSingle,p.Flip,p.Visible],initialize:function(f,s,c,d,v,m,S,M){this.layer=f,this.index=s,this.x=c,this.y=d,this.width=v,this.height=m,this.right,this.bottom,this.baseWidth=S!==void 0?S:v,this.baseHeight=M!==void 0?M:m,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.tintFill=!1,this.physics={}},containsPoint:function(u,f){return!(uthis.right||f>this.bottom)},copy:function(u){return this.index=u.index,this.alpha=u.alpha,this.properties=o(u.properties),this.visible=u.visible,this.setFlip(u.flipX,u.flipY),this.tint=u.tint,this.rotation=u.rotation,this.collideUp=u.collideUp,this.collideDown=u.collideDown,this.collideLeft=u.collideLeft,this.collideRight=u.collideRight,this.collisionCallback=u.collisionCallback,this.collisionCallbackContext=u.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(u){var f=this.tilemapLayer;if(f){var s=f.tileToWorldXY(this.x,this.y,void 0,u);return s.x}return this.x*this.baseWidth},getRight:function(u){var f=this.tilemapLayer;return f?this.getLeft(u)+this.width*f.scaleX:this.getLeft(u)+this.width},getTop:function(u){var f=this.tilemapLayer;if(f){var s=f.tileToWorldXY(this.x,this.y,void 0,u);return s.y}return this.y*this.baseWidth-(this.height-this.baseHeight)},getBottom:function(u){var f=this.tilemapLayer;return f?this.getTop(u)+this.height*f.scaleY:this.getTop(u)+this.height},getBounds:function(u,f){return f===void 0&&(f=new l),f.x=this.getLeft(u),f.y=this.getTop(u),f.width=this.getRight(u)-f.x,f.height=this.getBottom(u)-f.y,f},getCenterX:function(u){return(this.getLeft(u)+this.getRight(u))/2},getCenterY:function(u){return(this.getTop(u)+this.getBottom(u))/2},intersects:function(u,f,s,c){return!(s<=this.pixelX||c<=this.pixelY||u>=this.right||f>=this.bottom)},isInteresting:function(u,f){return u&&f?this.canCollide||this.hasInterestingFace:u?this.collides:f?this.hasInterestingFace:!1},resetCollision:function(u){if(u===void 0&&(u=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,u){var f=this.tilemapLayer;f&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(u,f,s,c,d){if(f===void 0&&(f=u),s===void 0&&(s=u),c===void 0&&(c=u),d===void 0&&(d=!0),this.collideLeft=u,this.collideRight=f,this.collideUp=s,this.collideDown=c,this.faceLeft=u,this.faceRight=f,this.faceTop=s,this.faceBottom=c,d){var v=this.tilemapLayer;v&&this.tilemapLayer.calculateFacesAt(this.x,this.y)}return this},setCollisionCallback:function(u,f){return u===null?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=u,this.collisionCallbackContext=f),this},setSize:function(u,f,s,c){return u!==void 0&&(this.width=u),f!==void 0&&(this.height=f),s!==void 0&&(this.baseWidth=s),c!==void 0&&(this.baseHeight=c),this.updatePixelXY(),this},updatePixelXY:function(){var u=this.layer.orientation;if(u===h.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(u===h.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(u===h.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(u===h.HEXAGONAL){var f=this.layer.staggerAxis,s=this.layer.staggerIndex,c=this.layer.hexSideLength,d,v;f==="y"?(v=(this.baseHeight-c)/2+c,s==="odd"?this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2):this.pixelX=this.x*this.baseWidth-this.y%2*(this.baseWidth/2),this.pixelY=this.y*v):f==="x"&&(d=(this.baseWidth-c)/2+c,this.pixelX=this.x*d,s==="odd"?this.pixelY=this.y*this.baseHeight+this.x%2*(this.baseHeight/2):this.pixelY=this.y*this.baseHeight-this.x%2*(this.baseHeight/2))}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback!==void 0}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var u=this.layer.tilemapLayer;if(u){var f=u.gidMap[this.index];if(f)return f}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var u=this.tilemapLayer;return u?u.tilemap:null}}});a.exports=n},49075:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(84101),p=t(83419),h=t(39506),o=t(80341),l=t(95540),n=t(14977),u=t(27462),f=t(91907),s=t(36305),c=t(19133),d=t(68287),v=t(23029),m=t(81086),S=t(20442),M=t(33629),A=new p({initialize:function(w,P){this.scene=w,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 L=this.orientation;this._convert={WorldToTileXY:m.GetWorldToTileXYFunction(L),WorldToTileX:m.GetWorldToTileXFunction(L),WorldToTileY:m.GetWorldToTileYFunction(L),TileToWorldXY:m.GetTileToWorldXYFunction(L),TileToWorldX:m.GetTileToWorldXFunction(L),TileToWorldY:m.GetTileToWorldYFunction(L),GetTileCorners:m.GetTileCornersFunction(L)}},setRenderOrder:function(C){var w=["right-down","left-down","right-up","left-up"];return typeof C=="number"&&(C=w[C]),w.indexOf(C)>-1&&(this.renderOrder=C),this},addTilesetImage:function(C,w,P,L,O,I,D,B){if(C===void 0)return null;w==null&&(w=C);var G=this.scene.sys.textures;if(!G.exists(w))return console.warn('Texture key "%s" not found',w),null;var z=G.get(w),W=this.getTilesetIndex(C);if(W===null&&this.format===o.TILED_JSON)return console.warn('Tilemap has no tileset "%s". Its tilesets are %o',C,this.tilesets),null;var k=this.tilesets[W];return k?(k.setTileSize(P,L),k.setSpacing(O,I),k.setImage(z),k):(P===void 0&&(P=this.tileWidth),L===void 0&&(L=this.tileHeight),O===void 0&&(O=0),I===void 0&&(I=0),D===void 0&&(D=0),B===void 0&&(B={x:0,y:0}),k=new M(C,D,P,L,O,I,void 0,void 0,B),k.setImage(z),this.tilesets.push(k),this.tiles=r(this),k)},copy:function(C,w,P,L,O,I,D,B){return B=this.getLayer(B),B!==null?(m.Copy(C,w,P,L,O,I,D,B),this):null},createBlankLayer:function(C,w,P,L,O,I,D,B){P===void 0&&(P=0),L===void 0&&(L=0),O===void 0&&(O=this.width),I===void 0&&(I=this.height),D===void 0&&(D=this.tileWidth),B===void 0&&(B=this.tileHeight);var G=this.getLayerIndex(C);if(G!==null)return console.warn("Invalid Tilemap Layer ID: "+C),null;for(var z=new n({name:C,tileWidth:D,tileHeight:B,width:O,height:I,orientation:this.orientation}),W,k=0;k-1&&this.putTileAt(w,I.x,I.y,P,I.tilemapLayer)}return L},removeTileAt:function(C,w,P,L,O){return P===void 0&&(P=!0),L===void 0&&(L=!0),O=this.getLayer(O),O===null?null:m.RemoveTileAt(C,w,P,L,O)},removeTileAtWorldXY:function(C,w,P,L,O,I){return P===void 0&&(P=!0),L===void 0&&(L=!0),I=this.getLayer(I),I===null?null:m.RemoveTileAtWorldXY(C,w,P,L,O,I)},renderDebug:function(C,w,P){return P=this.getLayer(P),P===null?null:(this.orientation===f.ORTHOGONAL&&m.RenderDebug(C,w,P),this)},renderDebugFull:function(C,w){for(var P=this.layers,L=0;L{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(44603),p=t(31989);r.register("tilemap",function(h){var o=h!==void 0?h:{};return p(this.scene,o.key,o.tileWidth,o.tileHeight,o.width,o.height,o.data,o.insertNull)})},46029:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(39429),p=t(31989);r.register("tilemap",function(h,o,l,n,u,f,s){return h===null&&(h=void 0),o===null&&(o=void 0),l===null&&(l=void 0),n===null&&(n=void 0),u===null&&(u=void 0),p(this.scene,h,o,l,n,u,f,s)})},20442:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(78389),h=t(31401),o=t(95643),l=t(81086),n=t(19218),u=t(26099),f=new r({Extends:o,Mixins:[h.Alpha,h.BlendMode,h.ComputedSize,h.Depth,h.Flip,h.GetBounds,h.Mask,h.Origin,h.Pipeline,h.PostPipeline,h.Transform,h.Visible,h.ScrollFactor,p,n],initialize:function(c,d,v,m,S,M){o.call(this,c,"TilemapLayer"),this.isTilemap=!0,this.tilemap=d,this.layerIndex=v,this.layer=d.layers[v],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=l.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.tempVec=new u,this.collisionCategory=1,this.collisionMask=1,this.setTilesets(m),this.setAlpha(this.layer.alpha),this.setPosition(S,M),this.setOrigin(0,0),this.setSize(d.tileWidth*this.layer.width,d.tileHeight*this.layer.height),this.initPipeline(),this.initPostPipeline(!1)},setTilesets:function(s){var c=[],d=[],v=this.tilemap;Array.isArray(s)||(s=[s]);for(var m=0;m=0&&s<4&&(this._renderOrder=s),this},calculateFacesAt:function(s,c){return l.CalculateFacesAt(s,c,this.layer),this},calculateFacesWithin:function(s,c,d,v){return l.CalculateFacesWithin(s,c,d,v,this.layer),this},createFromTiles:function(s,c,d,v,m){return l.CreateFromTiles(s,c,d,v,m,this.layer)},cull:function(s){return this.cullCallback(this.layer,s,this.culledTiles,this._renderOrder)},copy:function(s,c,d,v,m,S,M){return l.Copy(s,c,d,v,m,S,M,this.layer),this},fill:function(s,c,d,v,m,S){return l.Fill(s,c,d,v,m,S,this.layer),this},filterTiles:function(s,c,d,v,m,S,M){return l.FilterTiles(s,c,d,v,m,S,M,this.layer)},findByIndex:function(s,c,d){return l.FindByIndex(s,c,d,this.layer)},findTile:function(s,c,d,v,m,S,M){return l.FindTile(s,c,d,v,m,S,M,this.layer)},forEachTile:function(s,c,d,v,m,S,M){return l.ForEachTile(s,c,d,v,m,S,M,this.layer),this},setTint:function(s,c,d,v,m,S){s===void 0&&(s=16777215);var M=function(A){A.tint=s,A.tintFill=!1};return this.forEachTile(M,this,c,d,v,m,S)},setTintFill:function(s,c,d,v,m,S){s===void 0&&(s=16777215);var M=function(A){A.tint=s,A.tintFill=!0};return this.forEachTile(M,this,c,d,v,m,S)},getTileAt:function(s,c,d){return l.GetTileAt(s,c,d,this.layer)},getTileAtWorldXY:function(s,c,d,v){return l.GetTileAtWorldXY(s,c,d,v,this.layer)},getIsoTileAtWorldXY:function(s,c,d,v,m){d===void 0&&(d=!0);var S=this.tempVec;return l.IsometricWorldToTileXY(s,c,!0,S,m,this.layer,d),this.getTileAt(S.x,S.y,v)},getTilesWithin:function(s,c,d,v,m){return l.GetTilesWithin(s,c,d,v,m,this.layer)},getTilesWithinShape:function(s,c,d){return l.GetTilesWithinShape(s,c,d,this.layer)},getTilesWithinWorldXY:function(s,c,d,v,m,S){return l.GetTilesWithinWorldXY(s,c,d,v,m,S,this.layer)},hasTileAt:function(s,c){return l.HasTileAt(s,c,this.layer)},hasTileAtWorldXY:function(s,c,d){return l.HasTileAtWorldXY(s,c,d,this.layer)},putTileAt:function(s,c,d,v){return l.PutTileAt(s,c,d,v,this.layer)},putTileAtWorldXY:function(s,c,d,v,m){return l.PutTileAtWorldXY(s,c,d,v,m,this.layer)},putTilesAt:function(s,c,d,v){return l.PutTilesAt(s,c,d,v,this.layer),this},randomize:function(s,c,d,v,m){return l.Randomize(s,c,d,v,m,this.layer),this},removeTileAt:function(s,c,d,v){return l.RemoveTileAt(s,c,d,v,this.layer)},removeTileAtWorldXY:function(s,c,d,v,m){return l.RemoveTileAtWorldXY(s,c,d,v,m,this.layer)},renderDebug:function(s,c){return l.RenderDebug(s,c,this.layer),this},replaceByIndex:function(s,c,d,v,m,S){return l.ReplaceByIndex(s,c,d,v,m,S,this.layer),this},setSkipCull:function(s){return s===void 0&&(s=!0),this.skipCull=s,this},setCullPadding:function(s,c){return s===void 0&&(s=1),c===void 0&&(c=1),this.cullPaddingX=s,this.cullPaddingY=c,this},setCollision:function(s,c,d,v){return l.SetCollision(s,c,d,this.layer,v),this},setCollisionBetween:function(s,c,d,v){return l.SetCollisionBetween(s,c,d,v,this.layer),this},setCollisionByProperty:function(s,c,d){return l.SetCollisionByProperty(s,c,d,this.layer),this},setCollisionByExclusion:function(s,c,d){return l.SetCollisionByExclusion(s,c,d,this.layer),this},setCollisionFromCollisionGroup:function(s,c){return l.SetCollisionFromCollisionGroup(s,c,this.layer),this},setTileIndexCallback:function(s,c,d){return l.SetTileIndexCallback(s,c,d,this.layer),this},setTileLocationCallback:function(s,c,d,v,m,S){return l.SetTileLocationCallback(s,c,d,v,m,S,this.layer),this},shuffle:function(s,c,d,v){return l.Shuffle(s,c,d,v,this.layer),this},swapByIndex:function(s,c,d,v,m,S){return l.SwapByIndex(s,c,d,v,m,S,this.layer),this},tileToWorldX:function(s,c){return this.tilemap.tileToWorldX(s,c,this)},tileToWorldY:function(s,c){return this.tilemap.tileToWorldY(s,c,this)},tileToWorldXY:function(s,c,d,v){return this.tilemap.tileToWorldXY(s,c,d,v,this)},getTileCorners:function(s,c,d){return this.tilemap.getTileCorners(s,c,d,this)},weightedRandomize:function(s,c,d,v,m){return l.WeightedRandomize(c,d,v,m,s,this.layer),this},worldToTileX:function(s,c,d){return this.tilemap.worldToTileX(s,c,d,this)},worldToTileY:function(s,c,d){return this.tilemap.worldToTileY(s,c,d,this)},worldToTileXY:function(s,c,d,v,m){return this.tilemap.worldToTileXY(s,c,d,v,m,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=[],o.prototype.destroy.call(this))}});a.exports=f},16153:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61340),p=new r,h=new r,o=new r,l=function(n,u,f,s){var c=u.cull(f),d=c.length,v=f.alpha*u.alpha;if(!(d===0||v<=0)){var m=p,S=h,M=o;S.applyITRS(u.x,u.y,u.rotation,u.scaleX,u.scaleY),m.copyFrom(f.matrix);var A=n.currentContext,C=u.gidMap;A.save(),s?(m.multiplyWithOffset(s,-f.scrollX*u.scrollFactorX,-f.scrollY*u.scrollFactorY),S.e=u.x,S.f=u.y,m.multiply(S,M),M.copyToContext(A)):(S.e-=f.scrollX*u.scrollFactorX,S.f-=f.scrollY*u.scrollFactorY,S.copyToContext(A)),(!n.antialias||u.scaleX>1||u.scaleY>1)&&(A.imageSmoothingEnabled=!1);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(29747),p=r,h=r;p=t(99558),h=t(16153),a.exports={renderWebGL:p,renderCanvas:h}},99558:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70554),p=function(h,o,l){var n=o.cull(l),u=n.length,f=l.alpha*o.alpha;if(!(u===0||f<=0)){var s=o.gidMap,c=h.pipelines.set(o.pipeline,o),d=r.getTintAppendFloatAlpha,v=o.scrollFactorX,m=o.scrollFactorY,S=o.x,M=o.y,A=o.scaleX,C=o.scaleY;h.pipelines.preBatch(o);for(var w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(26099),h=new r({initialize:function(l,n,u,f,s,c,d,v,m){(u===void 0||u<=0)&&(u=32),(f===void 0||f<=0)&&(f=32),s===void 0&&(s=0),c===void 0&&(c=0),d===void 0&&(d={}),v===void 0&&(v={}),this.name=l,this.firstgid=n,this.tileWidth=u,this.tileHeight=f,this.tileMargin=s,this.tileSpacing=c,this.tileProperties=d,this.tileData=v,this.tileOffset=new p,m!==void 0&&this.tileOffset.set(m.x,m.y),this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(o){return this.containsTileIndex(o)?this.tileProperties[o-this.firstgid]:null},getTileData:function(o){return this.containsTileIndex(o)?this.tileData[o-this.firstgid]:null},getTileCollisionGroup:function(o){var l=this.getTileData(o);return l&&l.objectgroup?l.objectgroup:null},containsTileIndex:function(o){return o>=this.firstgid&&on.width||l.height>n.height?this.updateTileData(l.width,l.height):this.updateTileData(n.width,n.height,n.x,n.y),this},setTileSize:function(o,l){return o!==void 0&&(this.tileWidth=o),l!==void 0&&(this.tileHeight=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(o,l){return o!==void 0&&(this.tileMargin=o),l!==void 0&&(this.tileSpacing=l),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(o,l,n,u){n===void 0&&(n=0),u===void 0&&(u=0);var f=(l-this.tileMargin*2+this.tileSpacing)/(this.tileHeight+this.tileSpacing),s=(o-this.tileMargin*2+this.tileSpacing)/(this.tileWidth+this.tileSpacing);(f%1!==0||s%1!==0)&&console.warn("Image tile area not tile size multiple in: "+this.name),f=Math.floor(f),s=Math.floor(s),this.rows=f,this.columns=s,this.total=f*s,this.texCoordinates.length=0;for(var c=this.tileMargin+n,d=this.tileMargin+u,v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7423),p=function(h,o,l){var n=r(h,o,!0,l),u=r(h,o-1,!0,l),f=r(h,o+1,!0,l),s=r(h-1,o,!0,l),c=r(h+1,o,!0,l),d=n&&n.collides;return d&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),u&&u.collides&&(d&&(n.faceTop=!1),u.faceBottom=!d),f&&f.collides&&(d&&(n.faceBottom=!1),f.faceTop=!d),s&&s.collides&&(d&&(n.faceLeft=!1),s.faceRight=!d),c&&c.collides&&(d&&(n.faceRight=!1),c.faceLeft=!d),n&&!n.collides&&n.resetFaces(),n};a.exports=p},42573:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7423),p=t(7386),h=function(o,l,n,u,f){for(var s=null,c=null,d=null,v=null,m=p(o,l,n,u,null,f),S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=new r,h=function(o,l,n,u){var f=n.tilemapLayer,s=f.cullPaddingX,c=f.cullPaddingY,d=f.tilemap.tileToWorldXY(o,l,p,u,f);return d.x>u.worldView.x+f.scaleX*n.tileWidth*(-s-.5)&&d.xu.worldView.y+f.scaleY*n.tileHeight*(-c-1)&&d.y{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(42573),p=t(7386),h=t(62991),o=t(23029),l=function(n,u,f,s,c,d,v,m){v===void 0&&(v=!0);var S=p(n,u,f,s,null,m),M=[];S.forEach(function(I){var D=new o(I.layer,I.index,I.x,I.y,I.width,I.height,I.baseWidth,I.baseHeight);D.copy(I),M.push(D)});for(var A=c-n,C=d-u,w=0;w{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62644),p=t(7386),h=t(27987),o=function(l,n,u,f,s,c){u||(u={}),Array.isArray(l)||(l=[l]);var d=c.tilemapLayer;f||(f=d.scene),s||(s=f.cameras.main);var v=c.width,m=c.height,S=p(0,0,v,m,null,c),M=[],A,C=function(O,I,D){for(var B=0;B{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(87841),p=t(63448),h=t(56583),o=new r,l=function(n,u){var f=n.tilemapLayer.tilemap,s=n.tilemapLayer,c=Math.floor(f.tileWidth*s.scaleX),d=Math.floor(f.tileHeight*s.scaleY),v=h(u.worldView.x-s.x,c,0,!0)-s.cullPaddingX,m=p(u.worldView.right-s.x,c,0,!0)+s.cullPaddingX,S=h(u.worldView.y-s.y,d,0,!0)-s.cullPaddingY,M=p(u.worldView.bottom-s.y,d,0,!0)+s.cullPaddingY;return o.setTo(v,S,m-v,M-S)};a.exports=l},30003:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19545),p=t(32483),h=function(o,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=o.tilemapLayer,s=r(o,l);return(f.skipCull||f.scrollFactorX!==1||f.scrollFactorY!==1)&&(s.left=0,s.right=o.width,s.top=0,s.bottom=o.height),p(o,s,u,n),n};a.exports=h},35137:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(42573),h=t(20576),o=function(l,n,u,f,s,c,d){for(var v=d.collideIndexes.indexOf(l)!==-1,m=r(n,u,f,s,null,d),S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s,c){var d=r(l,n,u,f,s,c);return d.filter(h,o)};a.exports=p},52692:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r===void 0&&(r=0),p===void 0&&(p=!1);var o=0,l,n,u;if(p){for(n=h.height-1;n>=0;n--)for(l=h.width-1;l>=0;l--)if(u=h.data[n][l],u&&u.index===t){if(o===r)return u;o+=1}}else for(n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s,c){var d=r(l,n,u,f,s,c);return d.find(h,o)||null};a.exports=p},97560:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s,c){var d=r(l,n,u,f,s,c);d.forEach(h,o)};a.exports=p},43305:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(30003),h=t(9474),o=t(14018),l=t(29747),n=t(54503),u=function(f){return f===r.ORTHOGONAL?p:f===r.HEXAGONAL?h:f===r.STAGGERED?n:f===r.ISOMETRIC?o:l};a.exports=u},7423:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62991),p=function(h,o,l,n){if(l===void 0&&(l=!1),r(h,o,n)){var u=n.data[o][h]||null;return u?u.index===-1?l?u:null:u:null}else return null};a.exports=p},60540:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7423),p=t(26099),h=new p,o=function(l,n,u,f,s){return s.tilemapLayer.worldToTileXY(l,n,!0,h,f),r(h.x,h.y,u,s)};a.exports=o},55826:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n){var u=n.baseTileWidth,f=n.baseTileHeight,s=n.tilemapLayer,c=0,d=0;s&&(l||(l=s.scene.cameras.main),c=s.x+l.scrollX*(1-s.scrollFactorX),d=s.y+l.scrollY*(1-s.scrollFactorY),u*=s.scaleX,f*=s.scaleY);var v=c+h*u,m=d+o*f;return[new r(v,m),new r(v+u,m),new r(v+u,m+f),new r(v,m+f)]};a.exports=p},11758:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(27229),h=t(29747),o=t(55826),l=function(n){return n===r.ORTHOGONAL?o:n===r.ISOMETRIC?h:n===r.HEXAGONAL?p:(n===r.STAGGERED,h)};a.exports=l},39167:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(29747),h=t(97281),o=function(l){return l===r.ORTHOGONAL?h:p};a.exports=o},62e3:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(19951),h=t(14127),o=t(29747),l=t(97202),n=t(70326),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:o};a.exports=u},5984:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(29747),h=t(28054),o=t(29650),l=function(n){return n===r.ORTHOGONAL?o:n===r.STAGGERED?h:p};a.exports=l},7386:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=function(h,o,l,n,u,f){h===void 0&&(h=0),o===void 0&&(o=0),l===void 0&&(l=f.width),n===void 0&&(n=f.height),u||(u={});var s=r(u,"isNotEmpty",!1),c=r(u,"isColliding",!1),d=r(u,"hasInterestingFace",!1);h<0&&(l+=h,h=0),o<0&&(n+=o,o=0),h+l>f.width&&(l=Math.max(f.width-h,0)),o+n>f.height&&(n=Math.max(f.height-o,0));for(var v=[],m=o;m{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(55738),p=t(7386),h=t(91865),o=t(29747),l=t(26099),n=function(d,v){return h.RectangleToTriangle(v,d)},u=new l,f=new l,s=new l,c=function(d,v,m,S){if(d===void 0)return[];var M=o;d instanceof r.Circle?M=h.CircleToRectangle:d instanceof r.Rectangle?M=h.RectangleToRectangle:d instanceof r.Triangle?M=n:d instanceof r.Line&&(M=h.LineToRectangle),S.tilemapLayer.worldToTileXY(d.left,d.top,!0,f,m);var A=f.x,C=f.y;S.tilemapLayer.worldToTileXY(d.right,d.bottom,!1,s,m);var w=Math.ceil(s.x),P=Math.ceil(s.y),L=Math.max(w-A,1),O=Math.max(P-C,1),I=p(A,C,L,O,v,S),D=S.tileWidth,B=S.tileHeight;S.tilemapLayer&&(D*=S.tilemapLayer.scaleX,B*=S.tilemapLayer.scaleY);for(var G=[],z=new r.Rectangle(0,0,D,B),W=0;W{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(26099),h=new p,o=new p,l=function(n,u,f,s,c,d,v){var m=v.tilemapLayer.tilemap._convert.WorldToTileXY;m(n,u,!0,h,d,v);var S=h.x,M=h.y;m(n+f,u+s,!1,o,d,v);var A=Math.ceil(o.x),C=Math.ceil(o.y);return r(S,M,A-S,C-M,c,v)};a.exports=l},96113:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(20242),h=t(10095),o=function(l){return l===r.ORTHOGONAL?h:p};a.exports=o},16926:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(86625),h=t(96897),o=t(29747),l=t(15108),n=t(85896),u=function(f){return f===r.ORTHOGONAL?n:f===r.ISOMETRIC?h:f===r.HEXAGONAL?p:f===r.STAGGERED?l:o};a.exports=u},55762:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=t(20242),h=t(51900),o=t(63288),l=function(n){return n===r.ORTHOGONAL?o:n===r.STAGGERED?h:p};a.exports=l},45091:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62991),p=function(h,o,l){if(r(h,o,l)){var n=l.data[o][h];return n!==null&&n.index>-1}else return!1};a.exports=p},24152:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(45091),p=t(26099),h=new p,o=function(l,n,u,f){f.tilemapLayer.worldToTileXY(l,n,!0,h,u);var s=h.x,c=h.y;return r(s,c,f)};a.exports=o},90454:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(63448),p=t(56583),h=function(o,l){var n=o.tilemapLayer.tilemap,u=o.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),s=Math.floor(n.tileHeight*u.scaleY),c=o.hexSideLength,d,v,m,S;if(o.staggerAxis==="y"){var M=(s-c)/2+c;d=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,M,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,M,0,!0)+u.cullPaddingY}else{var A=(f-c)/2+c;d=p(l.worldView.x-u.x,A,0,!0)-u.cullPaddingX,v=r(l.worldView.right-u.x,A,0,!0)+u.cullPaddingX,m=p(l.worldView.y-u.y,s,0,!0)-u.cullPaddingY,S=r(l.worldView.bottom-u.y,s,0,!0)+u.cullPaddingY}return{left:d,right:v,top:m,bottom:S}};a.exports=h},9474:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(90454),p=t(32483),h=function(o,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=o.tilemapLayer,s=r(o,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(s.left=0,s.right=o.width,s.top=0,s.bottom=o.height),p(o,s,u,n),n};a.exports=h},27229:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19951),p=t(26099),h=new p,o=function(l,n,u,f){var s=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(s*=d.scaleX,c*=d.scaleY);var v=r(l,n,h,u,f),m=[],S=.5773502691896257,M,A;f.staggerAxis==="y"?(M=S*s,A=c/2):(M=s/2,A=S*c);for(var C=0;C<6;C++){var w=2*Math.PI*(.5-C)/6;m.push(new p(v.x+M*Math.cos(w),v.y+A*Math.sin(w)))}return m};a.exports=o},19951:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u){l||(l=new r);var f=u.baseTileWidth,s=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),v=c.y+n.scrollY*(1-c.scrollFactorY),f*=c.scaleX,s*=c.scaleY);var m=f/2,S=s/2,M,A;return u.staggerAxis==="y"?(M=d+f*h+f,A=v+1.5*o*S+S,o%2===0&&(this.staggerIndex==="odd"?M-=m:M+=m)):this.staggerAxis==="x"&&this.staggerIndex==="odd"&&(M=d+1.5*h*m+m,A=v+s*h+s,h%2===0&&(this.staggerIndex==="odd"?A-=S:A+=S)),l.set(M,A)};a.exports=p},86625:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u,f){n||(n=new r);var s=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),o=o-(d.y+u.scrollY*(1-d.scrollFactorY)),s*=d.scaleX,c*=d.scaleY);var v=.5773502691896257,m=-.3333333333333333,S=0,M=.6666666666666666,A=s/2,C=c/2,w,P,L,O,I;f.staggerAxis==="y"?(w=(h-A)/(v*s),P=(o-C)/C,L=v*w+m*P,O=S*w+M*P):(w=(h-A)/A,P=(o-C)/(v*c),L=m*w+v*P,O=M*w+S*P),I=-L-O;var D=Math.round(L),B=Math.round(O),G=Math.round(I),z=Math.abs(D-L),W=Math.abs(B-O),k=Math.abs(G-I);z>W&&z>k?D=-B-G:W>k&&(B=-D-G);var J,Q=B;return f.staggerIndex==="odd"?J=Q%2===0?B/2+D:B/2+D-.5:J=Q%2===0?B/2+D:B/2+D+.5,n.set(J,Q)};a.exports=p},62991:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t>=0&&t=0&&r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33528),p=function(h,o,l,n){l===void 0&&(l=[]),n===void 0&&(n=0),l.length=0;var u=h.tilemapLayer,f=h.data,s=h.width,c=h.height,d=u.skipCull,v=0,m=s,S=0,M=c,A,C,w;if(n===0)for(C=S;C=v;A--)w=f[C][A],!(!w||w.index===-1||!w.visible||w.alpha===0)&&(!d&&!r(A,C,h,o)||l.push(w));else if(n===2)for(C=M;C>=S;C--)for(A=v;A=S;C--)for(A=m;A>=v;A--)w=f[C][A],!(!w||w.index===-1||!w.visible||w.alpha===0)&&(!d&&!r(A,C,h,o)||l.push(w));return u.tilesDrawn=l.length,u.tilesTotal=s*c,l};a.exports=p},14127:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u){l||(l=new r);var f=u.baseTileWidth,s=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var m=d+(h-o)*(f/2),S=v+(h+o)*(s/2);return l.set(m,S)};a.exports=p},96897:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u,f,s){n||(n=new r);var c=f.baseTileWidth,d=f.baseTileHeight,v=f.tilemapLayer;v&&(u||(u=v.scene.cameras.main),o=o-(v.y+u.scrollY*(1-v.scrollFactorY)),d*=v.scaleY,h=h-(v.x+u.scrollX*(1-v.scrollFactorX)),c*=v.scaleX);var m=c/2,S=d/2;h=h-m,s||(o=o-d);var M=.5*(h/m+o/S),A=.5*(-h/m+o/S);return l&&(M=Math.floor(M),A=Math.floor(A)),n.set(M,A)};a.exports=p},71558:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23029),p=t(62991),h=t(72023),o=t(20576),l=function(n,u,f,s,c){if(s===void 0&&(s=!0),!p(u,f,c))return null;var d,v=c.data[f][u],m=v&&v.collides;n instanceof r?(c.data[f][u]===null&&(c.data[f][u]=new r(c,n.index,u,f,c.tileWidth,c.tileHeight)),c.data[f][u].copy(n)):(d=n,c.data[f][u]===null?c.data[f][u]=new r(c,d,u,f,c.tileWidth,c.tileHeight):c.data[f][u].index=d);var S=c.data[f][u],M=c.collideIndexes.indexOf(S.index)!==-1;if(d=n instanceof r?n.index:n,d===-1)S.width=c.tileWidth,S.height=c.tileHeight;else{var A=c.tilemapLayer.tilemap,C=A.tiles,w=C[d][2],P=A.tilesets[w];S.width=P.tileWidth,S.height=P.tileHeight}return o(S,M),s&&m!==S.collides&&h(u,f,c),S};a.exports=l},26303:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(71558),p=t(26099),h=new p,o=function(l,n,u,f,s,c){return c.tilemapLayer.worldToTileXY(n,u,!0,h,s,c),r(l,h.x,h.y,f,c)};a.exports=o},14051:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(42573),p=t(71558),h=function(o,l,n,u,f){if(u===void 0&&(u=!0),!Array.isArray(o))return null;Array.isArray(o[0])||(o=[o]);for(var s=o.length,c=o[0].length,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(26546),h=function(o,l,n,u,f,s){var c,d=r(o,l,n,u,{},s);if(!f)for(f=[],c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(23029),p=t(62991),h=t(72023),o=function(l,n,u,f,s){if(u===void 0&&(u=!0),f===void 0&&(f=!0),!p(l,n,s))return null;var c=s.data[n][l];if(c)s.data[n][l]=u?null:new r(s,-1,l,n,s.tileWidth,s.tileHeight);else return null;return f&&c&&c.collides&&h(l,n,s),c};a.exports=o},94178:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(63557),p=t(26099),h=new p,o=function(l,n,u,f,s,c){return c.tilemapLayer.worldToTileXY(l,n,!0,h,s,c),r(h.x,h.y,u,f,c)};a.exports=o},15533:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(3956),h=new p(105,210,231,150),o=new p(243,134,48,200),l=new p(40,39,37,150),n=function(u,f,s){f===void 0&&(f={});var c=f.tileColor!==void 0?f.tileColor:h,d=f.collidingTileColor!==void 0?f.collidingTileColor:o,v=f.faceColor!==void 0?f.faceColor:l,m=r(0,0,s.width,s.height,null,s);u.translateCanvas(s.tilemapLayer.x,s.tilemapLayer.y),u.scaleCanvas(s.tilemapLayer.scaleX,s.tilemapLayer.scaleY);for(var S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s){for(var c=r(l,n,u,f,null,s),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=t.data,l=t.width,n=t.height,u=t.tilemapLayer,f=Math.max(0,r.left),s=Math.min(l,r.right),c=Math.max(0,r.top),d=Math.min(n,r.bottom),v,m,S;if(p===0)for(m=c;m=f;v--)S=o[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);else if(p===2)for(m=d;m>=c;m--)for(v=f;o[m]&&v=c;m--)for(v=s;o[m]&&v>=f;v--)S=o[m][v],!(!S||S.index===-1||!S.visible||S.alpha===0)&&h.push(S);return u.tilesDrawn=h.length,u.tilesTotal=l*n,h};a.exports=y},57068:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20576),p=t(42573),h=t(9589),o=function(l,n,u,f,s){n===void 0&&(n=!0),u===void 0&&(u=!0),s===void 0&&(s=!0),Array.isArray(l)||(l=[l]);for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20576),p=t(42573),h=t(9589),o=function(l,n,u,f,s,c){if(u===void 0&&(u=!0),f===void 0&&(f=!0),c===void 0&&(c=!0),!(l>n)){for(var d=l;d<=n;d++)h(d,u,s);if(c)for(var v=0;v=l&&S.index<=n&&r(S,u)}f&&p(0,0,s.width,s.height,s)}};a.exports=o},75661:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20576),p=t(42573),h=t(9589),o=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0),Array.isArray(l)||(l=[l]);for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20576),p=t(42573),h=t(97022),o=function(l,n,u,f){n===void 0&&(n=!0),u===void 0&&(u=!0);for(var s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(20576),p=t(42573),h=function(o,l,n){o===void 0&&(o=!0),l===void 0&&(l=!0);for(var u=0;u0&&r(s,o)}}l&&p(0,0,n.width,n.height,n)};a.exports=h},9589:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=p.collideIndexes.indexOf(t);r&&h===-1?p.collideIndexes.push(t):!r&&h!==-1&&p.collideIndexes.splice(h,1)};a.exports=y},20576:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)};a.exports=y},79583:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){if(typeof t=="number")h.callbacks[t]=r!==null?{callback:r,callbackContext:p}:void 0;else for(var o=0,l=t.length;o{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s){for(var c=r(h,o,l,n,null,s),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(33680),h=function(o,l,n,u,f){var s=r(o,l,n,u,null,f),c=s.map(function(v){return v.index});p(c);for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(63448),p=t(56583),h=function(o,l){var n=o.tilemapLayer.tilemap,u=o.tilemapLayer,f=Math.floor(n.tileWidth*u.scaleX),s=Math.floor(n.tileHeight*u.scaleY),c=p(l.worldView.x-u.x,f,0,!0)-u.cullPaddingX,d=r(l.worldView.right-u.x,f,0,!0)+u.cullPaddingX,v=p(l.worldView.y-u.y,s/2,0,!0)-u.cullPaddingY,m=r(l.worldView.bottom-u.y,s/2,0,!0)+u.cullPaddingY;return{left:c,right:d,top:v,bottom:m}};a.exports=h},54503:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(61325),p=t(32483),h=function(o,l,n,u){n===void 0&&(n=[]),u===void 0&&(u=0),n.length=0;var f=o.tilemapLayer,s=r(o,l);return f.skipCull&&f.scrollFactorX===1&&f.scrollFactorY===1&&(s.left=0,s.right=o.width,s.top=0,s.bottom=o.height),p(o,s,u,n),n};a.exports=h},97202:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u){l||(l=new r);var f=u.baseTileWidth,s=u.baseTileHeight,c=u.tilemapLayer,d=0,v=0;c&&(n||(n=c.scene.cameras.main),d=c.x+n.scrollX*(1-c.scrollFactorX),f*=c.scaleX,v=c.y+n.scrollY*(1-c.scrollFactorY),s*=c.scaleY);var m=d+h*f+o%2*(f/2),S=v+o*(s/2);return l.set(m,S)};a.exports=p},28054:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=p.baseTileHeight,o=p.tilemapLayer,l=0;return o&&(r===void 0&&(r=o.scene.cameras.main),l=o.y+r.scrollY*(1-o.scrollFactorY),h*=o.scaleY),l+t*(h/2)+h};a.exports=y},15108:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u,f){n||(n=new r);var s=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),o=o-(d.y+u.scrollY*(1-d.scrollFactorY)),c*=d.scaleY,h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),s*=d.scaleX);var v=l?Math.floor(o/(c/2)):o/(c/2),m=l?Math.floor((h+v%2*.5*s)/s):(h+v%2*.5*s)/s;return n.set(m,v)};a.exports=p},51900:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=h.baseTileHeight,l=h.tilemapLayer;return l&&(p||(p=l.scene.cameras.main),t=t-(l.y+p.scrollY*(1-l.scrollFactorY)),o*=l.scaleY),r?Math.floor(t/(o/2)):t/(o/2)};a.exports=y},86560:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=function(h,o,l,n,u,f,s){for(var c=r(l,n,u,f,null,s),d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=p.baseTileWidth,o=p.tilemapLayer,l=0;return o&&(r||(r=o.scene.cameras.main),l=o.x+r.scrollX*(1-o.scrollFactorX),h*=o.scaleX),l+t*h};a.exports=y},70326:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(97281),p=t(29650),h=t(26099),o=function(l,n,u,f,s){return u||(u=new h(0,0)),u.x=r(l,f,s),u.y=p(n,f,s),u};a.exports=o},29650:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=p.baseTileHeight,o=p.tilemapLayer,l=0;return o&&(r||(r=o.scene.cameras.main),l=o.y+r.scrollY*(1-o.scrollFactorY),h*=o.scaleY),l+t*h};a.exports=y},77366:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(7386),p=t(75508),h=function(o,l,n,u,f,s){if(f){var c,d=r(o,l,n,u,null,s),v=0;for(c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85896),p=t(26099),h=new p,o=function(l,n,u,f){return r(l,0,n,h,u,f),h.x};a.exports=o},85896:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(26099),p=function(h,o,l,n,u,f){l===void 0&&(l=!0),n||(n=new r);var s=f.baseTileWidth,c=f.baseTileHeight,d=f.tilemapLayer;d&&(u||(u=d.scene.cameras.main),h=h-(d.x+u.scrollX*(1-d.scrollFactorX)),o=o-(d.y+u.scrollY*(1-d.scrollFactorY)),s*=d.scaleX,c*=d.scaleY);var v=h/s,m=o/c;return l&&(v=Math.floor(v),m=Math.floor(m)),n.set(v,m)};a.exports=p},63288:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(85896),p=t(26099),h=new p,o=function(l,n,u,f){return r(0,l,n,h,u,f),h.y};a.exports=o},81086:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CalculateFacesAt:t(72023),CalculateFacesWithin:t(42573),CheckIsoBounds:t(33528),Copy:t(1785),CreateFromTiles:t(78419),CullBounds:t(19545),CullTiles:t(30003),Fill:t(35137),FilterTiles:t(40253),FindByIndex:t(52692),FindTile:t(66151),ForEachTile:t(97560),GetCullTilesFunction:t(43305),GetTileAt:t(7423),GetTileAtWorldXY:t(60540),GetTileCorners:t(55826),GetTileCornersFunction:t(11758),GetTilesWithin:t(7386),GetTilesWithinShape:t(91141),GetTilesWithinWorldXY:t(96523),GetTileToWorldXFunction:t(39167),GetTileToWorldXYFunction:t(62e3),GetTileToWorldYFunction:t(5984),GetWorldToTileXFunction:t(96113),GetWorldToTileXYFunction:t(16926),GetWorldToTileYFunction:t(55762),HasTileAt:t(45091),HasTileAtWorldXY:t(24152),HexagonalCullBounds:t(90454),HexagonalCullTiles:t(9474),HexagonalGetTileCorners:t(27229),HexagonalTileToWorldXY:t(19951),HexagonalWorldToTileXY:t(86625),IsInLayerBounds:t(62991),IsometricCullTiles:t(14018),IsometricTileToWorldXY:t(14127),IsometricWorldToTileXY:t(96897),PutTileAt:t(71558),PutTileAtWorldXY:t(26303),PutTilesAt:t(14051),Randomize:t(77389),RemoveTileAt:t(63557),RemoveTileAtWorldXY:t(94178),RenderDebug:t(15533),ReplaceByIndex:t(27987),RunCull:t(32483),SetCollision:t(57068),SetCollisionBetween:t(37266),SetCollisionByExclusion:t(75661),SetCollisionByProperty:t(64740),SetCollisionFromCollisionGroup:t(63307),SetLayerCollisionIndex:t(9589),SetTileCollision:t(20576),SetTileIndexCallback:t(79583),SetTileLocationCallback:t(93254),Shuffle:t(32903),StaggeredCullBounds:t(61325),StaggeredCullTiles:t(54503),StaggeredTileToWorldXY:t(97202),StaggeredTileToWorldY:t(28054),StaggeredWorldToTileXY:t(15108),StaggeredWorldToTileY:t(51900),SwapByIndex:t(86560),TileToWorldX:t(97281),TileToWorldXY:t(70326),TileToWorldY:t(29650),WeightedRandomize:t(77366),WorldToTileX:t(10095),WorldToTileXY:t(85896),WorldToTileY:t(63288)}},91907:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},21829:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={ORIENTATION:t(91907)};a.exports=r},62501:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79291),p=t(21829),h={Components:t(81086),Parsers:t(57442),Formats:t(80341),ImageCollection:t(16536),ParseToTilemap:t(31989),Tile:t(23029),Tilemap:t(49075),TilemapCreator:t(45939),TilemapFactory:t(46029),Tileset:t(33629),TilemapLayer:t(20442),Orientation:t(91907),LayerData:t(14977),MapData:t(87010),ObjectLayer:t(48700)};h=r(!1,h,p.ORIENTATION),a.exports=h},14977:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(91907),h=t(95540),o=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","layer"),this.id=h(n,"id",0),this.x=h(n,"x",0),this.y=h(n,"y",0),this.width=h(n,"width",0),this.height=h(n,"height",0),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.baseTileWidth=h(n,"baseTileWidth",this.tileWidth),this.baseTileHeight=h(n,"baseTileHeight",this.tileHeight),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.widthInPixels=h(n,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.baseTileHeight),this.alpha=h(n,"alpha",1),this.visible=h(n,"visible",!0),this.properties=h(n,"properties",[]),this.indexes=h(n,"indexes",[]),this.collideIndexes=h(n,"collideIndexes",[]),this.callbacks=h(n,"callbacks",[]),this.bodies=h(n,"bodies",[]),this.data=h(n,"data",[]),this.tilemapLayer=h(n,"tilemapLayer",null),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});a.exports=o},87010:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(91907),h=t(95540),o=new r({initialize:function(n){n===void 0&&(n={}),this.name=h(n,"name","map"),this.width=h(n,"width",0),this.height=h(n,"height",0),this.infinite=h(n,"infinite",!1),this.tileWidth=h(n,"tileWidth",0),this.tileHeight=h(n,"tileHeight",0),this.widthInPixels=h(n,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=h(n,"heightInPixels",this.height*this.tileHeight),this.format=h(n,"format",null),this.orientation=h(n,"orientation",p.ORTHOGONAL),this.renderOrder=h(n,"renderOrder","right-down"),this.version=h(n,"version","1"),this.properties=h(n,"properties",{}),this.layers=h(n,"layers",[]),this.images=h(n,"images",[]),this.objects=h(n,"objects",[]),Array.isArray(this.objects)||(this.objects=[]),this.collision=h(n,"collision",{}),this.tilesets=h(n,"tilesets",[]),this.imageCollections=h(n,"imageCollections",[]),this.tiles=h(n,"tiles",[]),this.hexSideLength=h(n,"hexSideLength",0),this.staggerAxis=h(n,"staggerAxis","y"),this.staggerIndex=h(n,"staggerIndex","odd")}});a.exports=o},48700:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=new r({initialize:function(l){l===void 0&&(l={}),this.name=p(l,"name","object layer"),this.id=p(l,"id",0),this.opacity=p(l,"opacity",1),this.properties=p(l,"properties",{}),this.propertyTypes=p(l,"propertytypes",{}),this.type=p(l,"type","objectgroup"),this.visible=p(l,"visible",!0),this.objects=p(l,"objects",[]),Array.isArray(this.objects)||(this.objects=[])}});a.exports=h},6641:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(91907),p=function(h){return h=h.toLowerCase(),h==="isometric"?r.ISOMETRIC:h==="staggered"?r.STAGGERED:h==="hexagonal"?r.HEXAGONAL:r.ORTHOGONAL};a.exports=p},46177:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80341),p=t(2342),h=t(82593),o=t(46594),l=t(87021),n=function(u,f,s,c,d,v){var m;switch(f){case r.ARRAY_2D:m=p(u,s,c,d,v);break;case r.CSV:m=h(u,s,c,d,v);break;case r.TILED_JSON:m=o(u,s,v);break;case r.WELTMEISTER:m=l(u,s,v);break;default:console.warn("Unrecognized tilemap data format: "+f),m=null}return m};a.exports=n},2342:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80341),p=t(14977),h=t(87010),o=t(23029),l=function(n,u,f,s,c){for(var d=new p({tileWidth:f,tileHeight:s}),v=new h({name:n,tileWidth:f,tileHeight:s,format:r.ARRAY_2D,layers:[d]}),m=[],S=u.length,M=0,A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80341),p=t(2342),h=function(o,l,n,u,f){var s=l.trim().split(` -`).map(function(d){return d.split(",")}),c=p(o,s,n,u,f);return c.format=r.CSV,c};a.exports=h},6656:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(14977),p=t(23029),h=function(o,l){for(var n=[],u=0;u-1?M=new p(s,S,m,v,f.tilesize,f.tilesize):M=l?null:new p(s,-1,m,v,f.tilesize,f.tilesize),c.push(M)}d.push(c),c=[]}s.data=d,n.push(s)}return n};a.exports=h},96483:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33629),p=function(h){for(var o=[],l=[],n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(80341),p=t(87010),h=t(6656),o=t(96483),l=function(n,u,f){if(u.layer.length===0)return console.warn("No layers found in the Weltmeister map: "+n),null;for(var s=0,c=0,d=0;ds&&(s=u.layer[d].width),u.layer[d].height>c&&(c=u.layer[d].height);var v=new p({width:s,height:c,name:n,tileWidth:u.layer[0].tilesize,tileHeight:u.layer[0].tilesize,format:r.WELTMEISTER});return v.layers=h(u,f),v.tilesets=o(u),v};a.exports=l},52833:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ParseTileLayers:t(6656),ParseTilesets:t(96483),ParseWeltmeister:t(87021)}},57442:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={FromOrientationString:t(6641),Parse:t(46177),Parse2DArray:t(2342),ParseCSV:t(82593),Impact:t(52833),Tiled:t(96761)}},51233:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(79291),p=function(h){for(var o,l,n,u,f,s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=window.atob(t),p=r.length,h=new Array(p/4),o=0;o>>0;return h};a.exports=y},84101:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33629),p=function(h){var o,l,n=[];for(o=0;o{/** - * @author Seth Berrier - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=function(h,o,l){if(!o)return{i:0,layers:h.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=o.x+r(o,"startx",0)*h.tilewidth+r(o,"offsetx",0),u=o.y+r(o,"starty",0)*h.tileheight+r(o,"offsety",0);return{i:0,layers:o.layers,name:l.name+o.name+"/",opacity:l.opacity*o.opacity,visible:l.visible&&o.visible,x:l.x+n,y:l.y+u}};a.exports=p},29920:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=2147483648,t=1073741824,r=536870912,p=function(h){var o=!!(h&y),l=!!(h&t),n=!!(h&r);h=h&~(y|t|r);var u=0,f=!1;return o&&l&&n?(u=Math.PI/2,f=!0):o&&l&&!n?(u=Math.PI,f=!1):o&&!l&&n?(u=Math.PI/2,f=!1):o&&!l&&!n?(u=0,f=!0):!o&&l&&n?(u=3*Math.PI/2,f=!1):!o&&l&&!n?(u=Math.PI,f=!0):!o&&!l&&n?(u=3*Math.PI/2,f=!0):!o&&!l&&!n&&(u=0,f=!1),{gid:h,flippedHorizontal:o,flippedVertical:l,flippedAntiDiagonal:n,rotation:u,flipped:f}};a.exports=p},12635:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=t(79677),h=function(o){for(var l=[],n=[],u=p(o);u.i0;){if(u.i>=u.layers.length){if(n.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}u=n.pop();continue}var f=u.layers[u.i];if(u.i++,f.type!=="imagelayer"){if(f.type==="group"){var s=p(o,f,u);n.push(u),u=s}continue}var c=r(f,"offsetx",0)+r(f,"startx",0),d=r(f,"offsety",0)+r(f,"starty",0);l.push({name:u.name+f.name,image:f.image,x:u.x+c+f.x,y:u.y+d+f.y,alpha:u.opacity*f.opacity,visible:u.visible&&f.visible,properties:r(f,"properties",{})})}return l};a.exports=h},46594:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(51233),p=t(84101),h=t(91907),o=t(62644),l=t(80341),n=t(6641),u=t(87010),f=t(12635),s=t(22611),c=t(28200),d=t(24619),v=function(m,S,M){var A=o(S),C=new u({width:A.width,height:A.height,name:m,tileWidth:A.tilewidth,tileHeight:A.tileheight,orientation:n(A.orientation),format:l.TILED_JSON,version:A.version,properties:A.properties,renderOrder:A.renderorder,infinite:A.infinite});C.orientation===h.HEXAGONAL&&(C.hexSideLength=A.hexsidelength,C.staggerAxis=A.staggeraxis,C.staggerIndex=A.staggerindex),C.layers=c(A,M),C.images=f(A);var w=d(A);return C.tilesets=w.tilesets,C.imageCollections=w.imageCollections,C.objects=s(A),C.tiles=p(C),r(C),C};a.exports=v},52205:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(18254),p=t(29920),h=function(n){return{x:n.x,y:n.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"],l=function(n,u,f){u===void 0&&(u=0),f===void 0&&(f=0);var s=r(n,o);if(s.x+=u,s.y+=f,n.gid){var c=p(n.gid);s.gid=c.gid,s.flippedHorizontal=c.flippedHorizontal,s.flippedVertical=c.flippedVertical,s.flippedAntiDiagonal=c.flippedAntiDiagonal}else n.polyline?s.polyline=n.polyline.map(h):n.polygon?s.polygon=n.polygon.map(h):n.ellipse?s.ellipse=n.ellipse:n.text?s.text=n.text:n.point?s.point=!0:s.rectangle=!0;return s};a.exports=l},22611:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95540),p=t(52205),h=t(48700),o=t(79677),l=function(n){for(var u=[],f=[],s=o(n);s.i0;){if(s.i>=s.layers.length){if(f.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=f.pop();continue}var c=s.layers[s.i];if(s.i++,c.opacity*=s.opacity,c.visible=s.visible&&c.visible,c.type!=="objectgroup"){if(c.type==="group"){var d=o(n,c,s);f.push(s),s=d}continue}c.name=s.name+c.name;for(var v=s.x+r(c,"startx",0)+r(c,"offsetx",0),m=s.y+r(c,"starty",0)+r(c,"offsety",0),S=[],M=0;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41868),p=t(91907),h=t(79677),o=t(6641),l=t(95540),n=t(14977),u=t(29920),f=t(23029),s=function(c,d){for(var v=l(c,"infinite",!1),m=[],S=[],M=h(c);M.i0;){if(M.i>=M.layers.length){if(S.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}M=S.pop();continue}var A=M.layers[M.i];if(M.i++,A.type!=="tilelayer"){if(A.type==="group"){var C=h(c,A,M);S.push(M),M=C}continue}if(A.compression){console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+A.name+"'");continue}else if(A.encoding&&A.encoding==="base64"){if(A.chunks)for(var w=0;w0?(O=new f(P,L.gid,j,$,c.tilewidth,c.tileheight),O.rotation=L.rotation,O.flipX=L.flipped,D[$][j]=O):(I=d?null:new f(P,-1,j,$,c.tilewidth,c.tileheight),D[$][j]=I),B++,B===J.width&&(K++,B=0)}}else{P=new n({name:M.name+A.name,id:A.id,x:M.x+l(A,"offsetx",0)+A.x,y:M.y+l(A,"offsety",0)+A.y,width:A.width,height:A.height,tileWidth:c.tilewidth,tileHeight:c.tileheight,alpha:M.opacity*A.opacity,visible:M.visible&&A.visible,properties:l(A,"properties",[]),orientation:o(c.orientation)}),P.orientation===p.HEXAGONAL&&(P.hexSideLength=c.hexsidelength,P.staggerAxis=c.staggeraxis,P.staggerIndex=c.staggerindex);for(var q=[],it=0,nt=A.data.length;it0?(O=new f(P,L.gid,B,D.length,c.tilewidth,c.tileheight),O.rotation=L.rotation,O.flipX=L.flipped,q.push(O)):(I=d?null:new f(P,-1,B,D.length,c.tilewidth,c.tileheight),q.push(I)),B++,B===A.width&&(D.push(q),B=0,q=[])}P.data=D,m.push(P)}return m};a.exports=s},24619:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(33629),p=t(16536),h=t(52205),o=t(57880),l=function(n){for(var u=[],f=[],s=null,c,d=0;d1){var S=void 0,M=void 0;if(Array.isArray(v.tiles)){S=S||{},M=M||{};for(var A=0;A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){for(var p=0;p0){var l={},n={},u,f,s;if(Array.isArray(h.edgecolors))for(u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={AssignTileProperties:t(51233),Base64Decode:t(41868),BuildTilesetIndex:t(84101),CreateGroupLayer:t(79677),ParseGID:t(29920),ParseImageLayers:t(12635),ParseJSONTiled:t(46594),ParseObject:t(52205),ParseObjectLayers:t(22611),ParseTileLayers:t(28200),ParseTilesets:t(24619)}},33385:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(37277),h=t(44594),o=t(94880),l=t(72905),n=new r({initialize:function(f){this.scene=f,this.systems=f.sys,this.now=0,this.startTime=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],f.sys.events.once(h.BOOT,this.boot,this),f.sys.events.on(h.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(h.DESTROY,this.destroy,this)},start:function(){this.startTime=this.systems.game.loop.time;var u=this.systems.events;u.on(h.PRE_UPDATE,this.preUpdate,this),u.on(h.UPDATE,this.update,this),u.once(h.SHUTDOWN,this.shutdown,this)},addEvent:function(u){var f;return u instanceof o?(f=u,this.removeEvent(f),f.elapsed=f.startAt,f.hasDispatched=!1,f.repeatCount=f.repeat===-1||f.loop?999999999999:f.repeat):f=new o(u),this._pendingInsertion.push(f),f},delayedCall:function(u,f,s,c){return this.addEvent({delay:u,callback:f,args:s,callbackScope:c})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(u){Array.isArray(u)||(u=[u]);for(var f=0;f-1&&this._active.splice(d,1),c.destroy()}for(s=0;s=c.delay)){var d=c.elapsed-c.delay;if(c.elapsed=c.delay,!c.hasDispatched&&c.callback&&(c.hasDispatched=!0,c.callback.apply(c.callbackScope,c.args)),c.repeatCount>0){if(c.repeatCount--,d>=c.delay)for(;d>=c.delay&&c.repeatCount>0;)c.callback&&c.callback.apply(c.callbackScope,c.args),d-=c.delay,c.repeatCount--;c.elapsed=d,c.hasDispatched=!1}else c.hasDispatched&&this._pendingRemoval.push(c)}}}},shutdown:function(){var u;for(u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(39429),o=t(95540),l=t(44594),n=t(89809),u=new r({Extends:p,initialize:function(s,c){p.call(this),this.scene=s,this.systems=s.sys,this.elapsed=0,this.paused=!0,this.complete=!1,this.totalComplete=0,this.loop=0,this.iteration=0,this.events=[];var d=this.systems.events;d.on(l.PRE_UPDATE,this.preUpdate,this),d.on(l.UPDATE,this.update,this),d.once(l.SHUTDOWN,this.destroy,this),c&&this.add(c)},preUpdate:function(f,s){this.paused||(this.elapsed+=s)},update:function(){if(!(this.paused||this.complete)){var f,s=this.events,c=!1,d=this.systems,v;for(f=0;f=s.length&&(this.loop!==0&&(this.loop===-1||this.loop>this.iteration)?(this.iteration++,this.reset(!0)):this.complete=!0),this.complete&&this.emit(n.COMPLETE,this)}},play:function(f){return f===void 0&&(f=!0),this.paused=!1,this.complete=!1,this.totalComplete=0,f&&this.reset(),this},pause:function(){return this.paused=!0,this},repeat:function(f){return(f===void 0||f===!0)&&(f=-1),f===!1&&(f=0),this.loop=f,this},resume:function(){return this.paused=!1,this},stop:function(){return this.paused=!0,this.complete=!0,this},reset:function(f){f===void 0&&(f=!1),this.elapsed=0,f||(this.iteration=0);for(var s=0;s0&&(c=s[s.length-1].time);for(var d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(95540),h=new r({initialize:function(l){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(l)},reset:function(o){if(this.delay=p(o,"delay",0),this.repeat=p(o,"repeat",0),this.loop=p(o,"loop",!1),this.callback=p(o,"callback",void 0),this.callbackScope=p(o,"callbackScope",this),this.args=p(o,"args",[]),this.timeScale=p(o,"timeScale",1),this.startAt=p(o,"startAt",0),this.paused=p(o,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=this.repeat===-1||this.loop?999999999999:this.repeat,this.delay===0&&(this.repeat>0||this.loop))throw new Error("TimerEvent infinite loop created via zero delay");return this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var o=this.delay+this.delay*this.repeat,l=this.elapsed+this.delay*(this.repeat-this.repeatCount);return l/o}else return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return this.elapsed*.001},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return this.getRemaining()*.001},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return this.getOverallRemaining()*.001},remove:function(o){o===void 0&&(o=!1),this.elapsed=this.delay,this.hasDispatched=!o,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});a.exports=h},35945:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},89809:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={COMPLETE:t(35945)}},90291:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Clock:t(33385),Events:t(89809),Timeline:t(96120),TimerEvent:t(94880)}},40382:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(72905),p=t(83419),h=t(43491),o=t(88032),l=t(37277),n=t(44594),u=t(93109),f=t(86081),s=t(8357),c=t(43960),d=t(26012),v=new p({initialize:function(S){this.scene=S,this.events=S.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(n.BOOT,this.boot,this),this.events.on(n.START,this.start,this)},boot:function(){this.events.once(n.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(n.UPDATE,this.update,this),this.events.once(n.SHUTDOWN,this.shutdown,this)},create:function(m){Array.isArray(m)||(m=[m]);for(var S=[],M=0;M-1},existing:function(m){return this.has(m)||this.tweens.push(m.reset()),this},addCounter:function(m){var S=o(this,m);return this.tweens.push(S.reset()),S},stagger:function(m,S){return u(m,S)},setLagSmooth:function(m,S){return m===void 0&&(m=1/1e-8),S===void 0&&(S=0),this.maxLag=m,this.lagSkip=Math.min(S,this.maxLag),this},setFps:function(m){return m===void 0&&(m=240),this.gap=1e3/m,this.nextTime=this.time*1e3+this.gap,this},getDelta:function(m){var S=Date.now()-this.prevTime;S>this.maxLag&&(this.startTime+=S-this.lagSkip),this.prevTime+=S;var M=this.prevTime-this.startTime,A=M-this.nextTime,C=M-this.time*1e3;return A>0||m?(M/=1e3,this.time=M,this.nextTime+=A+(A>=this.gap?4:this.gap-A)):C=0,C},tick:function(){return this.step(!0),this},update:function(){this.paused||this.step(!1)},step:function(m){m===void 0&&(m=!1);var S=this.getDelta(m);if(!(S<=0)){this.processing=!0;var M,A,C=[],w=this.tweens;for(M=0;M0){for(M=0;M-1&&(A.isPendingRemove()||A.isDestroyed())&&(w.splice(L,1),A.destroy())}C.length=0}this.processing=!1}},remove:function(m){return this.processing?m.setPendingRemoveState():(r(this.tweens,m),m.setRemovedState()),this},reset:function(m){return this.existing(m),m.seek(),m.setActiveState(),this},makeActive:function(m){return this.existing(m),m.setActiveState(),this},each:function(m,S){var M,A=[null];for(M=1;M{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){return t&&t.hasOwnProperty(r)?t[r]:p};a.exports=y},6113:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(62640),p=t(35355),h=function(o,l){var n=r.Power0;if(typeof o=="string")if(r.hasOwnProperty(o))n=r[o];else{var u="";if(o.indexOf(".")){u=o.substring(o.indexOf(".")+1);var f=u.toLowerCase();f==="in"?u="easeIn":f==="out"?u="easeOut":f==="inout"&&(u="easeInOut")}o=p(o.substring(0,o.indexOf(".")+1)+u),r.hasOwnProperty(o)&&(n=r[o])}else typeof o=="function"&&(n=o);if(!l)return n;var s=l.slice(0);return s.unshift(0),function(c){return s[0]=c,n.apply(this,s)}};a.exports=h},91389:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(89318),p=t(77259),h=t(28392),o={bezier:r,catmull:p,catmullrom:p,linear:h},l=function(n){if(n===null)return null;var u=o.linear;return typeof n=="string"?o.hasOwnProperty(n)&&(u=o[n]):typeof n=="function"&&(u=n),u};a.exports=l},55292:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h;if(t.hasOwnProperty(r)){var o=typeof t[r];o==="function"?h=function(l,n,u,f,s,c){return t[r](l,n,u,f,s,c)}:h=function(){return t[r]}}else typeof p=="function"?h=p:h=function(){return p};return h};a.exports=y},82985:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(81076),p=function(h){var o,l=[];if(h.hasOwnProperty("props"))for(o in h.props)o.substring(0,1)!=="_"&&l.push({key:o,value:h.props[o]});else for(o in h)r.indexOf(o)===-1&&o.substring(0,1)!=="_"&&l.push({key:o,value:h[o]});return l};a.exports=p},62329:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35154),p=function(h){var o=r(h,"targets",null);return o===null||(typeof o=="function"&&(o=o.call()),Array.isArray(o)||(o=[o])),o};a.exports=p},17777:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(30976),p=t(99472);function h(f){return!!f.getActive&&typeof f.getActive=="function"}function o(f){return!!f.getStart&&typeof f.getStart=="function"}function l(f){return!!f.getEnd&&typeof f.getEnd=="function"}function n(f){return o(f)||l(f)||h(f)}var u=function(f,s){var c,d=function(J,Q,Y){return Y},v=function(J,Q,Y){return Y},m=null,S=typeof s;if(S==="number")d=function(){return s};else if(Array.isArray(s))v=function(){return s[0]},d=function(){return s[s.length-1]};else if(S==="string"){var M=s.toLowerCase(),A=M.substring(0,6)==="random",C=M.substring(0,3)==="int";if(A||C){var w=M.indexOf("("),P=M.indexOf(")"),L=M.indexOf(",");if(w&&P&&L){var O=parseFloat(M.substring(w+1,L)),I=parseFloat(M.substring(L+1,P));A?d=function(){return p(O,I)}:d=function(){return r(O,I)}}else throw new Error("invalid random() format")}else{M=M[0];var D=parseFloat(s.substr(2));switch(M){case"+":d=function(J,Q,Y){return Y+D};break;case"-":d=function(J,Q,Y){return Y-D};break;case"*":d=function(J,Q,Y){return Y*D};break;case"/":d=function(J,Q,Y){return Y/D};break;default:d=function(){return parseFloat(s)}}}}else if(S==="function")d=s;else if(S==="object")if(n(s))h(s)&&(m=s.getActive),l(s)&&(d=s.getEnd),o(s)&&(v=s.getStart);else if(s.hasOwnProperty("value"))c=u(f,s.value);else{var B=s.hasOwnProperty("to"),G=s.hasOwnProperty("from"),z=s.hasOwnProperty("start");if(B&&(G||z)){if(c=u(f,s.to),z){var W=u(f,s.start);c.getActive=W.getEnd}if(G){var k=u(f,s.from);c.getStart=k.getEnd}}}return c||(c={getActive:m,getEnd:d,getStart:v}),c};a.exports=u},88032:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70402),p=t(69902),h=t(23568),o=t(57355),l=t(6113),n=t(55292),u=t(35154),f=t(17777),s=t(269),c=t(86081),d=function(v,m,S){if(m instanceof c)return m.parent=v,m;S===void 0?S=p:S=s(p,S);var M=u(m,"from",0),A=u(m,"to",1),C=[{value:M}],w=u(m,"delay",S.delay),P=u(m,"easeParams",S.easeParams),L=u(m,"ease",S.ease),O=f("value",A),I=new c(v,C),D=I.add(0,"value",O.getEnd,O.getStart,O.getActive,l(u(m,"ease",L),u(m,"easeParams",P)),n(m,"delay",w),u(m,"duration",S.duration),o(m,"yoyo",S.yoyo),u(m,"hold",S.hold),u(m,"repeat",S.repeat),u(m,"repeatDelay",S.repeatDelay),!1,!1);D.start=M,D.current=M,I.completeDelay=h(m,"completeDelay",0),I.loop=Math.round(h(m,"loop",0)),I.loopDelay=Math.round(h(m,"loopDelay",0)),I.paused=o(m,"paused",!1),I.persist=o(m,"persist",!1),I.callbackScope=u(m,"callbackScope",I);for(var B=r.TYPES,G=0;G{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(6113),p=t(35154),h=t(36383),o=function(l,n){n===void 0&&(n={});var u,f=p(n,"start",0),s=p(n,"ease",null),c=p(n,"grid",null),d=p(n,"from",0),v=d==="first",m=d==="center",S=d==="last",M=typeof d=="number",A=Array.isArray(l),C=parseFloat(A?l[0]:l),w=A?parseFloat(l[1]):0,P=Math.max(C,w);if(A&&(f+=C),c){var L=c[0],O=c[1],I=0,D=0,B=0,G=0,z=[];S?(I=L-1,D=O-1):M?(I=d%L,D=Math.floor(d/L)):m&&(I=(L-1)/2,D=(O-1)/2);for(var W=h.MIN_SAFE_INTEGER,k=0;kW&&(W=Q),z[k][J]=Q}}}var Y=s?r(s):null;return c?u=function(K,U,V,j){var $=0,q=j%L,it=Math.floor(j/L);q>=0&&q=0&&it{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70402),p=t(69902),h=t(23568),o=t(57355),l=t(6113),n=t(91389),u=t(55292),f=t(82985),s=t(62329),c=t(35154),d=t(17777),v=t(269),m=t(86081),S=function(M,A,C){if(A instanceof m)return A.parent=M,A;C===void 0?C=p:C=v(p,C);var w=s(A);!w&&C.targets&&(w=C.targets);for(var P=f(A),L=c(A,"delay",C.delay),O=c(A,"duration",C.duration),I=c(A,"easeParams",C.easeParams),D=c(A,"ease",C.ease),B=c(A,"hold",C.hold),G=c(A,"repeat",C.repeat),z=c(A,"repeatDelay",C.repeatDelay),W=o(A,"yoyo",C.yoyo),k=o(A,"flipX",C.flipX),J=o(A,"flipY",C.flipY),Q=c(A,"interpolation",C.interpolation),Y=function(ut,dt,mt,gt){if(mt==="texture"){var At=gt,ot=void 0;Array.isArray(gt)?(At=gt[0],ot=gt[1]):gt.hasOwnProperty("value")?(At=gt.value,Array.isArray(gt.value)?(At=gt.value[0],ot=gt.value[1]):typeof gt.value=="string"&&(At=gt.value)):typeof gt=="string"&&(At=gt),ut.addFrame(dt,At,ot,u(gt,"delay",L),c(gt,"duration",O),c(gt,"hold",B),c(gt,"repeat",G),c(gt,"repeatDelay",z),o(gt,"flipX",k),o(gt,"flipY",J))}else{var st=d(mt,gt),yt=n(c(gt,"interpolation",Q));ut.add(dt,mt,st.getEnd,st.getStart,st.getActive,l(c(gt,"ease",D),c(gt,"easeParams",I)),u(gt,"delay",L),c(gt,"duration",O),o(gt,"yoyo",W),c(gt,"hold",B),c(gt,"repeat",G),c(gt,"repeatDelay",z),o(gt,"flipX",k),o(gt,"flipY",J),yt,yt?gt:null)}},K=new m(M,w),U=0;U{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70402),p=t(23568),h=t(57355),o=t(62329),l=t(35154),n=t(8357),u=t(43960),f=function(s,c){if(c instanceof u)return c.parent=s,c;var d=new u(s);d.startDelay=l(c,"delay",0),d.completeDelay=p(c,"completeDelay",0),d.loop=Math.round(p(c,"loop",l(c,"repeat",0))),d.loopDelay=Math.round(p(c,"loopDelay",l(c,"repeatDelay",0))),d.paused=h(c,"paused",!1),d.persist=h(c,"persist",!1),d.callbackScope=l(c,"callbackScope",d);var v,m=r.TYPES;for(v=0;v{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={GetBoolean:t(57355),GetEaseFunction:t(6113),GetInterpolationFunction:t(91389),GetNewValue:t(55292),GetProps:t(82985),GetTargets:t(62329),GetValueOp:t(17777),NumberTweenBuilder:t(88032),StaggerBuilder:t(93109),TweenBuilder:t(8357)}},73685:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="active"},98540:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="complete"},67233:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="loop"},2859:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="pause"},98336:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="repeat"},25764:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="resume"},32193:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="start"},84371:a=>{/** - * @author samme - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="stop"},70766:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="update"},55659:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports="yoyo"},842:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={TWEEN_ACTIVE:t(73685),TWEEN_COMPLETE:t(98540),TWEEN_LOOP:t(67233),TWEEN_PAUSE:t(2859),TWEEN_RESUME:t(25764),TWEEN_REPEAT:t(98336),TWEEN_START:t(32193),TWEEN_STOP:t(84371),TWEEN_UPDATE:t(70766),TWEEN_YOYO:t(55659)}},43066:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r={States:t(86353),Builders:t(30231),Events:t(842),TweenManager:t(40382),Tween:t(86081),TweenData:t(48177),TweenFrameData:t(42220),BaseTween:t(70402),TweenChain:t(43960)};a.exports=r},70402:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(50792),h=t(842),o=t(86353),l=new r({Extends:p,initialize:function(u){p.call(this),this.parent=u,this.data=[],this.totalData=0,this.startDelay=0,this.hasStarted=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=o.PENDING,this.paused=!1,this.callbacks={onActive:null,onComplete:null,onLoop:null,onPause:null,onRepeat:null,onResume:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope,this.persist=!1},setTimeScale:function(n){return this.timeScale=n,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return!this.paused&&this.isActive()},isPaused:function(){return this.paused},pause:function(){return this.paused||(this.paused=!0,this.dispatchEvent(h.TWEEN_PAUSE,"onPause")),this},resume:function(){return this.paused&&(this.paused=!1,this.dispatchEvent(h.TWEEN_RESUME,"onResume")),this},makeActive:function(){this.parent.makeActive(this),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")},onCompleteHandler:function(){this.setPendingRemoveState(),this.dispatchEvent(h.TWEEN_COMPLETE,"onComplete")},complete:function(n){return n===void 0&&(n=0),n?(this.setCompleteDelayState(),this.countdown=n):this.onCompleteHandler(),this},completeAfterLoop:function(n){return n===void 0&&(n=0),this.loopCounter>n&&(this.loopCounter=n),this},remove:function(){return this.parent&&this.parent.remove(this),this},stop:function(){return this.parent&&!this.isRemoved()&&!this.isPendingRemove()&&!this.isDestroyed()&&(this.dispatchEvent(h.TWEEN_STOP,"onStop"),this.setPendingRemoveState()),this},updateLoopCountdown:function(n){this.countdown-=n,this.countdown<=0&&(this.setActiveState(),this.dispatchEvent(h.TWEEN_LOOP,"onLoop"))},updateStartCountdown:function(n){return this.countdown-=n,this.countdown<=0&&(this.hasStarted=!0,this.setActiveState(),this.dispatchEvent(h.TWEEN_START,"onStart"),n=0),n},updateCompleteDelay:function(n){this.countdown-=n,this.countdown<=0&&this.onCompleteHandler()},setCallback:function(n,u,f){return f===void 0&&(f=[]),this.callbacks.hasOwnProperty(n)&&(this.callbacks[n]={func:u,params:f}),this},setPendingState:function(){this.state=o.PENDING},setActiveState:function(){this.state=o.ACTIVE},setLoopDelayState:function(){this.state=o.LOOP_DELAY},setCompleteDelayState:function(){this.state=o.COMPLETE_DELAY},setStartDelayState:function(){this.state=o.START_DELAY,this.countdown=this.startDelay,this.hasStarted=!1},setPendingRemoveState:function(){this.state=o.PENDING_REMOVE},setRemovedState:function(){this.state=o.REMOVED},setFinishedState:function(){this.state=o.FINISHED},setDestroyedState:function(){this.state=o.DESTROYED},isPending:function(){return this.state===o.PENDING},isActive:function(){return this.state===o.ACTIVE},isLoopDelayed:function(){return this.state===o.LOOP_DELAY},isCompleteDelayed:function(){return this.state===o.COMPLETE_DELAY},isStartDelayed:function(){return this.state===o.START_DELAY},isPendingRemove:function(){return this.state===o.PENDING_REMOVE},isRemoved:function(){return this.state===o.REMOVED},isFinished:function(){return this.state===o.FINISHED},isDestroyed:function(){return this.state===o.DESTROYED},destroy:function(){this.data&&this.data.forEach(function(n){n.destroy()}),this.removeAllListeners(),this.callbacks=null,this.data=null,this.parent=null,this.setDestroyedState()}});l.TYPES=["onActive","onComplete","onLoop","onPause","onRepeat","onResume","onStart","onStop","onUpdate","onYoyo"],a.exports=l},95042:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(83419),p=t(842),h=t(86353),o=new r({initialize:function(n,u,f,s,c,d,v,m,S,M){this.tween=n,this.targetIndex=u,this.duration=s,this.totalDuration=0,this.delay=0,this.getDelay=f,this.yoyo=c,this.hold=d,this.repeat=v,this.repeatDelay=m,this.repeatCounter=0,this.flipX=S,this.flipY=M,this.progress=0,this.elapsed=0,this.state=0,this.isCountdown=!1},getTarget:function(){return this.tween.targets[this.targetIndex]},setTargetValue:function(l){l===void 0&&(l=this.current),this.tween.targets[this.targetIndex][this.key]=l},setCreatedState:function(){this.state=h.CREATED,this.isCountdown=!1},setDelayState:function(){this.state=h.DELAY,this.isCountdown=!0},setPendingRenderState:function(){this.state=h.PENDING_RENDER,this.isCountdown=!1},setPlayingForwardState:function(){this.state=h.PLAYING_FORWARD,this.isCountdown=!1},setPlayingBackwardState:function(){this.state=h.PLAYING_BACKWARD,this.isCountdown=!1},setHoldState:function(){this.state=h.HOLD_DELAY,this.isCountdown=!0},setRepeatState:function(){this.state=h.REPEAT_DELAY,this.isCountdown=!0},setCompleteState:function(){this.state=h.COMPLETE,this.isCountdown=!1},isCreated:function(){return this.state===h.CREATED},isDelayed:function(){return this.state===h.DELAY},isPendingRender:function(){return this.state===h.PENDING_RENDER},isPlayingForward:function(){return this.state===h.PLAYING_FORWARD},isPlayingBackward:function(){return this.state===h.PLAYING_BACKWARD},isHolding:function(){return this.state===h.HOLD_DELAY},isRepeating:function(){return this.state===h.REPEAT_DELAY},isComplete:function(){return this.state===h.COMPLETE},setStateFromEnd:function(l){this.yoyo?this.onRepeat(l,!0,!0):this.repeatCounter>0?this.onRepeat(l,!0,!1):this.setCompleteState()},setStateFromStart:function(l){this.repeatCounter>0?this.onRepeat(l,!1):this.setCompleteState()},reset:function(){var l=this.tween,n=l.totalTargets,u=this.targetIndex,f=l.targets[u],s=this.key;this.progress=0,this.elapsed=0,this.delay=this.getDelay(f,s,0,u,n,l),this.repeatCounter=this.repeat===-1?h.MAX:this.repeat,this.setPendingRenderState();var c=this.duration+this.hold;this.yoyo&&(c+=this.duration);var d=c+this.repeatDelay;this.totalDuration=this.delay+c,this.repeat===-1?(this.totalDuration+=d*h.MAX,l.isInfinite=!0):this.repeat>0&&(this.totalDuration+=d*this.repeat),this.totalDuration>l.duration&&(l.duration=this.totalDuration),this.delay0&&(this.elapsed=this.delay,this.setDelayState())},onRepeat:function(l,n,u){var f=this.tween,s=f.totalTargets,c=this.targetIndex,d=f.targets[c],v=this.key,m=v!=="texture";if(this.elapsed=l,this.progress=l/this.duration,this.flipX&&d.toggleFlipX(),this.flipY&&d.toggleFlipY(),m&&(n||u)&&(this.start=this.getStartValue(d,v,this.start,c,s,f)),u){this.setPlayingBackwardState(),this.dispatchEvent(p.TWEEN_YOYO,"onYoyo");return}this.repeatCounter--,m&&(this.end=this.getEndValue(d,v,this.start,c,s,f)),this.repeatDelay>0?(this.elapsed=this.repeatDelay-l,m&&(this.current=this.start,d[v]=this.current),this.setRepeatState()):(this.setPlayingForwardState(),this.dispatchEvent(p.TWEEN_REPEAT,"onRepeat"))},destroy:function(){this.tween=null,this.getDelay=null,this.setCompleteState()}});a.exports=o},69902:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1,persist:!1,interpolation:null};a.exports=y},81076:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","interpolation","loop","loopDelay","onActive","onActiveParams","onComplete","onCompleteParams","onLoop","onLoopParams","onPause","onPauseParams","onRepeat","onRepeatParams","onResume","onResumeParams","onStart","onStartParams","onStop","onStopParams","onUpdate","onUpdateParams","onYoyo","onYoyoParams","paused","persist","props","repeat","repeatDelay","targets","yoyo"]},86081:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(70402),p=t(83419),h=t(842),o=t(44603),l=t(39429),n=t(36383),u=t(86353),f=t(48177),s=t(42220),c=new p({Extends:r,initialize:function(v,m){r.call(this,v),this.targets=m,this.totalTargets=m.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(d,v,m,S,M,A,C,w,P,L,O,I,D,B,G,z){var W=new f(this,d,v,m,S,M,A,C,w,P,L,O,I,D,B,G,z);return this.totalData=this.data.push(W),W},addFrame:function(d,v,m,S,M,A,C,w,P,L){var O=new s(this,d,v,m,S,M,A,C,w,P,L);return this.totalData=this.data.push(O),O},getValue:function(d){d===void 0&&(d=0);var v=null;return this.data&&(v=this.data[d].current),v},hasTarget:function(d){return this.targets&&this.targets.indexOf(d)!==-1},updateTo:function(d,v,m){if(m===void 0&&(m=!1),d!=="texture")for(var S=0;S0)this.elapsed=0,this.progress=0,this.loopCounter--,this.initTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(h.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,r.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(d,v,m){if(d===void 0&&(d=0),v===void 0&&(v=16.6),m===void 0&&(m=!1),this.isDestroyed())return console.warn("Cannot seek destroyed Tween",this),this;m||(this.isSeeking=!0),this.reset(!0),this.initTweenData(!0),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive");var S=this.paused;if(this.paused=!1,d>0){for(var M=Math.floor(d/v),A=d-M*v,C=0;C0&&this.update(A)}return this.paused=S,this.isSeeking=!1,this},initTweenData:function(d){d===void 0&&(d=!1),this.duration=0,this.startDelay=n.MAX_SAFE_INTEGER;for(var v=this.data,m=0;m0?this.totalDuration=S+M+(S+C)*A:this.totalDuration=S+M},reset:function(d){return d===void 0&&(d=!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=u.MAX),d||(this.initTweenData(),this.setActiveState(),this.dispatchEvent(h.TWEEN_ACTIVE,"onActive")),this},update:function(d){if(this.isPendingRemove()||this.isDestroyed())return!0;if(this.paused||this.isFinished())return!1;if(d*=this.timeScale*this.parent.timeScale,this.isLoopDelayed())return this.updateLoopCountdown(d),!1;if(this.isCompleteDelayed())return this.updateCompleteDelay(d),!1;this.hasStarted||(this.startDelay-=d,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchEvent(h.TWEEN_START,"onStart"),d=0));var v=!1;if(this.isActive())for(var m=this.data,S=0;S{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(72905),p=t(70402),h=t(83419),o=t(842),l=t(44603),n=t(39429),u=t(86353),f=new h({Extends:p,initialize:function(c){p.call(this,c),this.currentTween=null,this.currentIndex=0},init:function(){return this.loopCounter=this.loop===-1?u.MAX:this.loop,this.setCurrentTween(0),this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this.dispatchEvent(o.TWEEN_ACTIVE,"onActive"),this},add:function(s){var c=this.parent.create(s);Array.isArray(c)||(c=[c]);for(var d=this.data,v=0;v0)this.loopCounter--,this.resetTweens(),this.loopDelay>0?(this.countdown=this.loopDelay,this.setLoopDelayState()):(this.setActiveState(),this.dispatchEvent(o.TWEEN_LOOP,"onLoop"));else if(this.completeDelay>0)this.countdown=this.completeDelay,this.setCompleteDelayState();else return this.onCompleteHandler(),!0;return!1},play:function(){return this.isDestroyed()?(console.warn("Cannot play destroyed TweenChain",this),this):((this.isPendingRemove()||this.isPending())&&this.resetTweens(),this.paused=!1,this.startDelay>0&&!this.isStartDelayed()?this.setStartDelayState():this.setActiveState(),this)},resetTweens:function(){for(var s=this.data,c=this.totalData,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95042),p=t(45319),h=t(83419),o=t(842),l=new h({Extends:r,initialize:function(u,f,s,c,d,v,m,S,M,A,C,w,P,L,O,I,D){r.call(this,u,f,S,M,A,C,w,P,L,O),this.key=s,this.getActiveValue=v,this.getEndValue=c,this.getStartValue=d,this.ease=m,this.start=0,this.previous=0,this.current=0,this.end=0,this.interpolation=I,this.interpolationData=D},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex],f=this.key;n&&(u[f]=this.start),this.start=0,this.previous=0,this.current=0,this.end=0,this.getActiveValue&&(u[f]=this.getActiveValue(u,f,0))},update:function(n){var u=this.tween,f=u.totalTargets,s=this.targetIndex,c=u.targets[s],d=this.key;if(!c)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.start=this.getStartValue(c,d,c[d],s,f,u),this.end=this.getEndValue(c,d,this.start,s,f,u),this.current=this.start,c[d]=this.start,this.setPlayingForwardState(),!0;var v=this.isPlayingForward(),m=this.isPlayingBackward();if(v||m){var S=this.elapsed,M=this.duration,A=0,C=!1;S+=n,S>=M?(A=S-M,S=M,C=!0):S<0&&(S=0);var w=p(S/M,0,1);if(this.elapsed=S,this.progress=w,this.previous=this.current,C)v?(this.current=this.end,c[d]=this.end,this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(A)):(this.current=this.start,c[d]=this.start,this.setStateFromStart(A));else{v||(w=1-w);var P=this.ease(w);this.interpolation?this.current=this.interpolation(this.interpolationData,P):this.current=this.start+(this.end-this.start)*P,c[d]=this.current}this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var s=f.targets[this.targetIndex],c=this.key,d=this.current,v=this.previous;f.emit(n,f,c,s,d,v);var m=f.callbacks[u];m&&m.func.apply(f.callbackScope,[f,s,c,d,v].concat(m.params))}},destroy:function(){r.prototype.destroy.call(this),this.getActiveValue=null,this.getEndValue=null,this.getStartValue=null,this.ease=null}});a.exports=l},42220:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(95042),p=t(45319),h=t(83419),o=t(842),l=new h({Extends:r,initialize:function(u,f,s,c,d,v,m,S,M,A,C){r.call(this,u,f,d,v,!1,m,S,M,A,C),this.key="texture",this.startTexture=null,this.endTexture=s,this.startFrame=null,this.endFrame=c,this.yoyo=S!==0},reset:function(n){r.prototype.reset.call(this);var u=this.tween.targets[this.targetIndex];this.startTexture||(this.startTexture=u.texture.key,this.startFrame=u.frame.name),n&&u.setTexture(this.startTexture,this.startFrame)},update:function(n){var u=this.tween,f=this.targetIndex,s=u.targets[f];if(!s)return this.setCompleteState(),!1;if(this.isCountdown&&(this.elapsed-=n,this.elapsed<=0&&(this.elapsed=0,n=0,this.isDelayed()?this.setPendingRenderState():this.isRepeating()?(this.setPlayingForwardState(),this.dispatchEvent(o.TWEEN_REPEAT,"onRepeat")):this.isHolding()&&this.setStateFromEnd(0))),this.isPendingRender())return this.startTexture&&s.setTexture(this.startTexture,this.startFrame),this.setPlayingForwardState(),!0;var c=this.isPlayingForward(),d=this.isPlayingBackward();if(c||d){var v=this.elapsed,m=this.duration,S=0,M=!1;v+=n,v>=m?(S=v-m,v=m,M=!0):v<0&&(v=0);var A=p(v/m,0,1);this.elapsed=v,this.progress=A,M&&(c?(s.setTexture(this.endTexture,this.endFrame),this.hold>0?(this.elapsed=this.hold,this.setHoldState()):this.setStateFromEnd(S)):(s.setTexture(this.startTexture,this.startFrame),this.setStateFromStart(S))),this.dispatchEvent(o.TWEEN_UPDATE,"onUpdate")}return!this.isComplete()},dispatchEvent:function(n,u){var f=this.tween;if(!f.isSeeking){var s=f.targets[this.targetIndex],c=this.key;f.emit(n,f,c,s);var d=f.callbacks[u];d&&d.func.apply(f.callbackScope,[f,s,c].concat(d.params))}},destroy:function(){r.prototype.destroy.call(this),this.startTexture=null,this.endTexture=null,this.startFrame=null,this.endFrame=null}});a.exports=l},86353:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y={CREATED:0,DELAY:2,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING:20,ACTIVE:21,LOOP_DELAY:22,COMPLETE_DELAY:23,START_DELAY:24,PENDING_REMOVE:25,REMOVED:26,FINISHED:27,DESTROYED:28,MAX:999999999999};a.exports=y},83419:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(l){return!!l.get&&typeof l.get=="function"||!!l.set&&typeof l.set=="function"}function t(l,n,u){var f=u?l[n]:Object.getOwnPropertyDescriptor(l,n);return!u&&f.value&&typeof f.value=="object"&&(f=f.value),f&&y(f)?(typeof f.enumerable>"u"&&(f.enumerable=!0),typeof f.configurable>"u"&&(f.configurable=!0),f):!1}function r(l,n){var u=Object.getOwnPropertyDescriptor(l,n);return u?(u.value&&typeof u.value=="object"&&(u=u.value),u.configurable===!1):!1}function p(l,n,u,f){for(var s in n)if(n.hasOwnProperty(s)){var c=t(n,s,u);if(c!==!1){var d=f||l;if(r(d.prototype,s)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(l.prototype,s,c)}else l.prototype[s]=n[s]}}function h(l,n){if(n){Array.isArray(n)||(n=[n]);for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){};a.exports=y},20242:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){return null};a.exports=y},71146:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o){if(o===void 0&&(o=t),p>0){var l=p-t.length;if(l<=0)return null}if(!Array.isArray(r))return t.indexOf(r)===-1?(t.push(r),h&&h.call(o,r),r):null;for(var n=r.length-1;n>=0;)t.indexOf(r[n])!==-1&&r.splice(n,1),n--;if(n=r.length,n===0)return null;p>0&&n>l&&(r.splice(l),n=l);for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h,o,l){if(p===void 0&&(p=0),l===void 0&&(l=t),h>0){var n=h-t.length;if(n<=0)return null}if(!Array.isArray(r))return t.indexOf(r)===-1?(t.splice(p,0,r),o&&o.call(l,r),r):null;for(var u=r.length-1;u>=0;)t.indexOf(r[u])!==-1&&r.pop(),u--;if(u=r.length,u===0)return null;h>0&&u>n&&(r.splice(n),u=n);for(var f=u-1;f>=0;f--){var s=r[f];t.splice(p,0,s),o&&o.call(l,s)}return r};a.exports=y},66905:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.indexOf(r);return p!==-1&&p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=0;if(r(h,n,u))for(var s=n;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h,o=[null];for(h=3;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u)){var f,s=[null];for(f=5;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r.length){if(r.length===1)return r[0]}else return NaN;var h=1,o,l;if(p){if(tr.length&&(h=r.length),p?(o=r[h-1][p],l=r[h][p],l-t<=t-o?r[h]:r[h-1]):(o=r[h-1],l=r[h],l-t<=t-o?l:o)};a.exports=y},43491:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=[]);for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){n===void 0&&(n=0),u===void 0&&(u=h.length);var f=[];if(r(h,n,u))for(var s=n;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){r===void 0&&(r=0),p===void 0&&(p=t.length);var h=r+Math.floor(Math.random()*p);return t[h]===void 0?null:t[h]};a.exports=y},85835:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===p)return t;var h=t.indexOf(r),o=t.indexOf(p);if(h<0||o<0)throw new Error("Supplied items must be elements of the same array");return h>o||(t.splice(h,1),o===t.length-1?t.push(r):t.splice(o,0,r)),t};a.exports=y},83371:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===p)return t;var h=t.indexOf(r),o=t.indexOf(p);if(h<0||o<0)throw new Error("Supplied items must be elements of the same array");return h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.indexOf(r);if(p>0){var h=t[p-1],o=t.indexOf(h);t[p]=h,t[o]=r}return t};a.exports=y},69693:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=t.indexOf(r);if(h===-1||p<0||p>=t.length)throw new Error("Supplied index out of bounds");return h!==p&&(t.splice(h,1),t.splice(p,0,r)),r};a.exports=y},40853:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.indexOf(r);if(p!==-1&&p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=[],l,n=!1;if((p||h)&&(n=!0,p||(p=""),h||(h="")),r=r;l--)n?o.push(p+l.toString()+h):o.push(l);else for(l=t;l<=r;l++)n?o.push(p+l.toString()+h):o.push(l);return o};a.exports=y},593:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(2284),p=function(h,o,l){h===void 0&&(h=0),o===void 0&&(o=null),l===void 0&&(l=1),o===null&&(o=h,h=0);for(var n=[],u=Math.max(r((o-h)/(l||1)),0),f=0;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */function y(p,h,o){var l=p[h];p[h]=p[o],p[o]=l}function t(p,h){return ph?1:0}var r=function(p,h,o,l,n){for(o===void 0&&(o=0),l===void 0&&(l=p.length-1),n===void 0&&(n=t);l>o;){if(l-o>600){var u=l-o+1,f=h-o+1,s=Math.log(u),c=.5*Math.exp(2*s/3),d=.5*Math.sqrt(s*c*(u-c)/u)*(f-u/2<0?-1:1),v=Math.max(o,Math.floor(h-f*c/u+d)),m=Math.min(l,Math.floor(h+(u-f)*c/u+d));r(p,h,v,m,n)}var S=p[h],M=o,A=l;for(y(p,o,h),n(p[l],S)>0&&y(p,o,l);M0;)A--}n(p[o],S)===0?y(p,o,A):(A++,y(p,A,l)),A<=h&&(o=A+1),h<=A&&(l=A-1)}};a.exports=r},88492:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35154),p=t(33680),h=function(l,n,u){for(var f=[],s=0;s{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19133),p=function(h,o,l,n){n===void 0&&(n=h);var u;if(!Array.isArray(o))return u=h.indexOf(o),u!==-1?(r(h,u),l&&l.call(n,o),o):null;for(var f=o.length-1,s=[];f>=0;){var c=o[f];u=h.indexOf(c),u!==-1&&(r(h,u),s.push(c),l&&l.call(n,c)),f--}return s};a.exports=p},60248:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19133),p=function(h,o,l,n){if(n===void 0&&(n=h),o<0||o>h.length-1)throw new Error("Index out of bounds");var u=r(h,o);return l&&l.call(n,u),u};a.exports=p},81409:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){if(o===void 0&&(o=0),l===void 0&&(l=h.length),u===void 0&&(u=h),r(h,o,l)){var f=l-o,s=h.splice(o,f);if(n)for(var c=0;c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(19133),p=function(h,o,l){o===void 0&&(o=0),l===void 0&&(l=h.length);var n=o+Math.floor(Math.random()*l);return r(h,n)};a.exports=p},42169:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=t.indexOf(r),o=t.indexOf(p);return h!==-1&&o===-1?(t[h]=p,!0):!1};a.exports=y},86003:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){r===void 0&&(r=1);for(var p=null,h=0;h{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){var o=t.length;if(r<0||r>o||r>=p||p>o){if(h)throw new Error("Range Error: Values outside acceptable range");return!1}else return!0};a.exports=y},89545:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){var p=t.indexOf(r);return p!==-1&&p>0&&(t.splice(p,1),t.unshift(r)),r};a.exports=y},17810:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82011),p=function(h,o,l,n,u){if(n===void 0&&(n=0),u===void 0&&(u=h.length),r(h,n,u))for(var f=n;f{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=t.length-1;r>0;r--){var p=Math.floor(Math.random()*(r+1)),h=t[r];t[r]=t[p],t[p]=h}return t};a.exports=y},90126:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r=/\D/g;return t.sort(function(p,h){return parseInt(p.replace(r,""),10)-parseInt(h.replace(r,""),10)}),t};a.exports=y},19133:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){if(!(r>=t.length)){for(var p=t.length-1,h=t[r],o=r;o{/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(82264);function p(n,u){return String(n).localeCompare(u)}function h(n,u){var f=n.length;if(f<=1)return n;for(var s=new Array(f),c=1;cc&&(S=c),M>c&&(M=c),A=m,C=S;;)if(A{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(r===p)return t;var h=t.indexOf(r),o=t.indexOf(p);if(h<0||o<0)throw new Error("Supplied items must be elements of the same array");return t[h]=p,t[o]=r,t};a.exports=y},37105:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Matrix:t(54915),Add:t(71146),AddAt:t(51067),BringToTop:t(66905),CountAllMatching:t(21612),Each:t(95428),EachInRange:t(36914),FindClosestInSorted:t(81957),Flatten:t(43491),GetAll:t(46710),GetFirst:t(58731),GetRandom:t(26546),MoveDown:t(70864),MoveTo:t(69693),MoveUp:t(40853),MoveAbove:t(85835),MoveBelow:t(83371),NumberArray:t(20283),NumberArrayStep:t(593),QuickSelect:t(43886),Range:t(88492),Remove:t(72905),RemoveAt:t(60248),RemoveBetween:t(81409),RemoveRandomElement:t(31856),Replace:t(42169),RotateLeft:t(86003),RotateRight:t(49498),SafeRange:t(82011),SendToBack:t(89545),SetAll:t(17810),Shuffle:t(33680),SortByDigits:t(90126),SpliceOne:t(19133),StableSort:t(19186),Swap:t(25630)}},86922:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){if(!Array.isArray(t)||!Array.isArray(t[0]))return!1;for(var r=t[0].length,p=1;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41836),p=t(86922),h=function(o){var l="";if(!p(o))return l;for(var n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.reverse()};a.exports=y},21224:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=0;r{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37829),p=function(h){return r(h,180)};a.exports=p},44657:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37829),p=function(h,o){o===void 0&&(o=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 r=t(86922),p=t(2429),h=function(o,l){if(l===void 0&&(l=90),!r(o))return null;if(typeof l!="string"&&(l=(l%360+360)%360),l===90||l===-270||l==="rotateLeft")o=p(o),o.reverse();else if(l===-90||l===270||l==="rotateRight")o.reverse(),o=p(o);else if(Math.abs(l)===180||l==="rotate180"){for(var n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(37829),p=function(h,o){o===void 0&&(o=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 r=t(86003),p=t(49498),h=function(o,l,n){if(l===void 0&&(l=0),n===void 0&&(n=0),n!==0&&(n<0?r(o,Math.abs(n)):p(o,n)),l!==0)for(var u=0;u{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){for(var r=t.length,p=t[0].length,h=new Array(p),o=0;o-1;l--)h[o][l]=t[l][o]}return h};a.exports=y},54915:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={CheckMatrix:t(86922),MatrixToString:t(63362),ReverseColumns:t(92598),ReverseRows:t(21224),Rotate180:t(98717),RotateLeft:t(44657),RotateMatrix:t(37829),RotateRight:t(92632),Translate:t(69512),TransposeMatrix:t(2429)}},71334:a=>{/** - * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=function(r,p){for(var h=new Uint8Array(r),o=h.length,l=p?"data:"+p+";base64,":"",n=0;n>2],l+=y[(h[n]&3)<<4|h[n+1]>>4],l+=y[(h[n+1]&15)<<2|h[n+2]>>6],l+=y[h[n+2]&63];return o%3===2?l=l.substring(0,l.length-1)+"=":o%3===1&&(l=l.substring(0,l.length-2)+"=="),l};a.exports=t},53134:a=>{/** - * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */for(var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r>4,v[n++]=(f&15)<<4|s>>2,v[n++]=(s&3)<<6|c&63;return d};a.exports=p},65839:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={ArrayBufferToBase64:t(71334),Base64ToArrayBuffer:t(53134)}},91799:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Array:t(37105),Base64:t(65839),Objects:t(1183),String:t(31749),NOOP:t(29747),NULL:t(20242)}},41786:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r={};for(var p in t)Array.isArray(t[p])?r[p]=t[p].slice(0):r[p]=t[p];return r};a.exports=y},62644:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){var r,p,h;if(typeof t!="object"||t===null)return t;r=Array.isArray(t)?[]:{};for(h in t)p=t[h],r[h]=y(p);return r};a.exports=y},79291:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41212),p=function(){var h,o,l,n,u,f,s=arguments[0]||{},c=1,d=arguments.length,v=!1;for(typeof s=="boolean"&&(v=s,s=arguments[1]||{},c=2),d===c&&(s=this,--c);c{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(75508),p=t(35154),h=function(o,l,n){var u=p(o,l,null);if(u===null)return n;if(Array.isArray(u))return r.RND.pick(u);if(typeof u=="object"){if(u.hasOwnProperty("randInt"))return r.RND.integerInRange(u.randInt[0],u.randInt[1]);if(u.hasOwnProperty("randFloat"))return r.RND.realInRange(u.randFloat[0],u.randFloat[1])}else if(typeof u=="function")return u(l);return u};a.exports=h},95540:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){var h=typeof t;return!t||h==="number"||h==="string"?p:t.hasOwnProperty(r)&&t[r]!==void 0?t[r]:p};a.exports=y},82840:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(35154),p=t(45319),h=function(o,l,n,u,f){f===void 0&&(f=n);var s=r(o,l,f);return p(s,n,u)};a.exports=h},35154:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){if(!t&&!h||typeof t=="number")return p;if(t&&t.hasOwnProperty(r))return t[r];if(h&&h.hasOwnProperty(r))return h[r];if(r.indexOf(".")!==-1){for(var o=r.split("."),l=t,n=h,u=p,f=p,s=!0,c=!0,d=0;d{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){for(var p=0;p{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.hasOwnProperty(r)};a.exports=y},41212:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){if(!t||typeof t!="object"||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}return!0};a.exports=y},46975:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41786),p=function(h,o){var l=r(h);for(var n in o)l.hasOwnProperty(n)||(l[n]=o[n]);return l};a.exports=p},269:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(41786),p=function(h,o){var l=r(h);for(var n in o)l.hasOwnProperty(n)&&(l[n]=o[n]);return l};a.exports=p},18254:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var r=t(97022),p=function(h,o){for(var l={},n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p){if(!t||typeof t=="number")return!1;if(t.hasOwnProperty(r))return t[r]=p,!0;if(r.indexOf(".")!==-1){for(var h=r.split("."),o=t,l=t,n=0;n{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Clone:t(41786),DeepCopy:t(62644),Extend:t(79291),GetAdvancedValue:t(23568),GetFastValue:t(95540),GetMinMaxValue:t(82840),GetValue:t(35154),HasAll:t(69036),HasAny:t(1985),HasValue:t(97022),IsPlainObject:t(41212),Merge:t(46975),MergeRight:t(269),Pick:t(18254),SetValue:t(61622)}},27902:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return t.replace(/%([0-9]+)/g,function(p,h){return r[Number(h)-1]})};a.exports=y},41836:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r,p,h){r===void 0&&(r=0),p===void 0&&(p=" "),h===void 0&&(h=3),t=t.toString();var o=0;if(r+1>=t.length)switch(h){case 1:t=new Array(r+1-t.length).join(p)+t;break;case 3:var l=Math.ceil((o=r-t.length)/2),n=o-l;t=new Array(n+1).join(p)+t+new Array(l+1).join(p);break;default:t=t+new Array(r+1-t.length).join(p);break}return t};a.exports=y},33628:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t,r){return r===0?t.slice(1):t.slice(0,r-1)+t.slice(r)};a.exports=y},27671:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t.split("").reverse().join("")};a.exports=y},45650:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var r=Math.random()*16|0,p=t==="x"?r:r&3|8;return p.toString(16)})};a.exports=y},35355:a=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */var y=function(t){return t&&t[0].toUpperCase()+t.slice(1)};a.exports=y},31749:(a,y,t)=>{/** - * @author Richard Davey - * @copyright 2013-2024 Phaser Studio Inc. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */a.exports={Format:t(27902),Pad:t(41836),RemoveAt:t(33628),Reverse:t(27671),UppercaseFirst:t(35355),UUID:t(45650)}}},x={};function T(a){var y=x[a];if(y!==void 0)return y.exports;var t=x[a]={exports:{}};return i[a](t,t.exports,T),t.exports}T.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}();var E=T(85454);return E})())})(FM);var Gm=FM.exports;const Bc=gm(Gm);var EF=Object.create,Nx=Object.defineProperty,MF=Object.defineProperties,CF=Object.getOwnPropertyDescriptor,AF=Object.getOwnPropertyDescriptors,wF=Object.getOwnPropertyNames,YS=Object.getOwnPropertySymbols,PF=Object.getPrototypeOf,OM=Object.prototype.hasOwnProperty,RF=Object.prototype.propertyIsEnumerable,kS=(g,e,i)=>e in g?Nx(g,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[e]=i,Gi=(g,e)=>{for(var i in e||(e={}))OM.call(e,i)&&kS(g,i,e[i]);if(YS)for(var i of YS(e))RF.call(e,i)&&kS(g,i,e[i]);return g},al=(g,e)=>MF(g,AF(e)),Le=(g,e)=>()=>(e||g((e={exports:{}}).exports,e),e.exports),LF=(g,e,i,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let T of wF(e))!OM.call(g,T)&&T!==i&&Nx(g,T,{get:()=>e[T],enumerable:!(x=CF(e,T))||x.enumerable});return g},DM=(g,e,i)=>(i=g!=null?EF(PF(g)):{},LF(e||!g||!g.__esModule?Nx(i,"default",{value:g,enumerable:!0}):i,g)),Vm=Le(g=>{var e=function(E,a){return Ea?1:0},i=function(E,a){return Ea?-1:0};function x(E){return function(a,y){return E(y,a)}}function T(E){return E===2?function(a,y){return a[0]y[0]?1:a[1]y[1]?1:0}:function(a,y){for(var t=0;ty[t])return 1;t++}return 0}}g.DEFAULT_COMPARATOR=e,g.DEFAULT_REVERSE_COMPARATOR=i,g.reverseComparator=x,g.createTupleComparator=T}),bF=Le(g=>{g.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",g.SYMBOL_SUPPORT=typeof Symbol<"u"}),Ji=Le((g,e)=>{var i=bF(),x=i.ARRAY_BUFFER_SUPPORT,T=i.SYMBOL_SUPPORT;e.exports=function(E,a){var y,t,r,p,h;if(!E)throw new Error("obliterator/forEach: invalid iterable.");if(typeof a!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(E)||x&&ArrayBuffer.isView(E)||typeof E=="string"||E.toString()==="[object Arguments]"){for(r=0,p=E.length;r{var i=Vm(),x=Ji(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function a(u){if(this.clear(),this.comparator=u||T,typeof this.comparator!="function")throw new Error("mnemonist/FibonacciHeap.constructor: given comparator should be a function.")}a.prototype.clear=function(){this.root=null,this.min=null,this.size=0};function y(u){return{item:u,degree:0}}function t(u,f){u.root?(f.right=u.root.right,f.left=u.root,u.root.right.left=f,u.root.right=f):u.root=f}a.prototype.push=function(u){var f=y(u);return f.left=f,f.right=f,t(this,f),(!this.min||this.comparator(f.item,this.min.item)<=0)&&(this.min=f),++this.size},a.prototype.peek=function(){return this.min?this.min.item:void 0};function r(u){for(var f=[],s=u,c=!1;!(s===u&&c);)s===u&&(c=!0),f.push(s),s=s.right;return f}function p(u,f){u.root===f&&(u.root=f.right),f.left.right=f.right,f.right.left=f.left}function h(u,f){u.child?(f.right=u.child.right,f.left=u.child,u.child.right.left=f,u.child.right=f):u.child=f}function o(u,f,s){p(u,f),f.left=f,f.right=f,h(s,f),s.degree++,f.parent=s}function l(u){var f=new Array(u.size),s=r(u.root),c,d,v,m,S,M;for(c=0,d=s.length;c0&&(M=v,v=m,m=M),o(u,m,v),f[S]=null,S++;f[S]=v}for(c=0;c{var e=Math.pow(2,8)-1,i=Math.pow(2,16)-1,x=Math.pow(2,32)-1,T=Math.pow(2,7)-1,E=Math.pow(2,15)-1,a=Math.pow(2,31)-1;g.getPointerArray=function(t){var r=t-1;if(r<=e)return Uint8Array;if(r<=i)return Uint16Array;if(r<=x)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},g.getSignedPointerArray=function(t){var r=t-1;return r<=T?Int8Array:r<=E?Int16Array:r<=a?Int32Array:Float64Array},g.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 y={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};g.getMinimalRepresentation=function(t,r){var p=null,h=0,o,l,n,u,f;for(u=0,f=t.length;uh&&(h=o,p=l);return p},g.isTypedArray=function(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(t)},g.concat=function(){var t=0,r,p,h;for(r=0,h=arguments.length;r{var e=Ji(),i=zr();function x(y){return Array.isArray(y)||i.isTypedArray(y)}function T(y){if(typeof y.length=="number")return y.length;if(typeof y.size=="number")return y.size}function E(y){var t=T(y),r=typeof t=="number"?new Array(t):[],p=0;return e(y,function(h){r[p++]=h}),r}function a(y){var t=T(y),r=typeof t=="number"?i.getPointerArray(t):Array,p=typeof t=="number"?new Array(t):[],h=typeof t=="number"?new r(t):[],o=0;return e(y,function(l){p[o]=l,h[o]=o++}),[p,h]}g.isArrayLike=x,g.guessLength=T,g.toArray=E,g.toArrayWithIndices=a}),Ux=Le((g,e)=>{var i=Ji(),x=Vm(),T=ls(),E=x.DEFAULT_COMPARATOR,a=x.reverseComparator;function y(d,v,m,S){for(var M=v[S],A,C;S>m;){if(A=S-1>>1,C=v[A],d(M,C)<0){v[S]=C,S=A;continue}break}v[S]=M}function t(d,v,m){for(var S=v.length,M=m,A=v[m],C=2*m+1,w;C=0&&(C=w),v[m]=v[C],m=C,C=2*m+1;v[m]=A,y(d,v,M,m)}function r(d,v,m){v.push(m),y(d,v,0,v.length-1)}function p(d,v){var m=v.pop();if(v.length!==0){var S=v[0];return v[0]=m,t(d,v,0),S}return m}function h(d,v,m){if(v.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var S=v[0];return v[0]=m,t(d,v,0),S}function o(d,v,m){var S;return v.length!==0&&d(v[0],m)<0&&(S=v[0],v[0]=m,m=S,t(d,v,0)),m}function l(d,v){for(var m=v.length,S=m>>1,M=S;--M>=0;)t(d,v,M)}function n(d,v){for(var m=v.length,S=0,M=new Array(m);S=m.length)return m.slice().sort(d);for(P=m.slice(0,v),l(S,P),M=v,A=m.length;M0&&h(S,P,m[M]);return P.sort(d)}var L=T.guessLength(m);return L!==null&&L0&&h(S,P,O)),M++}),P.length>M&&(P.length=M),P.sort(d)}function f(d,v,m){arguments.length===2&&(m=v,v=d,d=E);var S=a(d),M,A,C,w=-1/0,P;if(v===1){if(T.isArrayLike(m)){for(M=0,A=m.length;M0)&&(w=C);return P=new m.constructor(1),P[0]=w,P}return i(m,function(O){(w===-1/0||d(O,w)>0)&&(w=O)}),[w]}if(T.isArrayLike(m)){if(v>=m.length)return m.slice().sort(S);for(P=m.slice(0,v),l(d,P),M=v,A=m.length;M0&&h(d,P,m[M]);return P.sort(S)}var L=T.guessLength(m);return L!==null&&L0&&h(d,P,O)),M++}),P.length>M&&(P.length=M),P.sort(S)}function s(d){if(this.clear(),this.comparator=d||E,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(d){return r(this.comparator,this.items,d),++this.size},s.prototype.peek=function(){return this.items[0]},s.prototype.pop=function(){return this.size!==0&&this.size--,p(this.comparator,this.items)},s.prototype.replace=function(d){return h(this.comparator,this.items,d)},s.prototype.pushpop=function(d){return o(this.comparator,this.items,d)},s.prototype.consume=function(){return this.size=0,n(this.comparator,this.items)},s.prototype.toArray=function(){return n(this.comparator,this.items.slice())},s.prototype.inspect=function(){var d=this.toArray();return Object.defineProperty(d,"constructor",{value:s,enumerable:!1}),d},typeof Symbol<"u"&&(s.prototype[Symbol.for("nodejs.util.inspect.custom")]=s.prototype.inspect);function c(d){if(this.clear(),this.comparator=d||E,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=a(this.comparator)}c.prototype=s.prototype,s.from=function(d,v){var m=new s(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},c.from=function(d,v){var m=new c(v),S;return T.isArrayLike(d)?S=d.slice():S=T.toArray(d),l(m.comparator,S),m.items=S,m.size=S.length,m},s.siftUp=t,s.siftDown=y,s.push=r,s.pop=p,s.replace=h,s.pushpop=o,s.heapify=l,s.consume=n,s.nsmallest=u,s.nlargest=f,s.MinHeap=s,s.MaxHeap=c,e.exports=s}),FF=Le((g,e)=>{var i="";function x(r,p,h){for(var o=p.length,l=[],n=o,u=-1,f,s=0,c;n--;)u=Math.max(r[p[n]+h],u);for(c=u>>24&&32||u>>16&&24||u>>8&&16||8;s>s&15].push(p[n]);for(f=0;f<16;f++)for(u=l[f].length;u--;)p[++n]=l[f][u]}}function T(r,p,h,o){return r[h]-r[o]||(h%3===2?r[h+1]-r[o+1]||p[h+2]-p[o+2]:p[h+1]-p[o+1])}function E(r,p){var h=[],o=[],l=2*p/3|0,n=p-l,u=l+1>>1,f=l,s=0,c,d=[],v=[];if(p===1)return[0];for(;f--;)h[f]=(f*3>>1)+1;for(f=3;f--;)x(r,h,f);for(s=o[(h[0]/3|0)+(h[0]%3===1?0:u)]=1,f=1;fthis.firstLength&&n>this.firstLength)){for(p=Math.min(this.length-l,this.length-n),o=0;or.length&&(r=this.text.slice(l,l+p))}return r},t.prototype.toString=function(){return this.array.join(",")},t.prototype.toJSON=function(){return this.array},t.prototype.inspect=function(){for(var r=new Array(this.length),p=0;p{var i=Ji();function x(r){this.size=0,this.items=new Map,this.inverse=r}function T(){this.size=0,this.items=new Map,this.inverse=new x(this)}function E(){this.size=0,this.items.clear(),this.inverse.items.clear()}T.prototype.clear=E,x.prototype.clear=E;function a(r,p){if(this.items.has(r)){var h=this.items.get(r);if(h===p)return this;this.inverse.items.delete(h)}if(this.inverse.items.has(p)){var o=this.inverse.items.get(p);if(o===r)return this;this.items.delete(o)}return this.items.set(r,p),this.inverse.items.set(p,r),this.size=this.items.size,this.inverse.size=this.inverse.items.size,this}T.prototype.set=a,x.prototype.set=a;function y(r){if(this.items.has(r)){var p=this.items.get(r);return this.items.delete(r),this.inverse.items.delete(p),this.size=this.items.size,this.inverse.size=this.inverse.items.size,!0}return!1}T.prototype.delete=y,x.prototype.delete=y;var t=["has","get","forEach","keys","values","entries"];t.forEach(function(r){T.prototype[r]=x.prototype[r]=function(){return Map.prototype[r].apply(this.items,arguments)}}),typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries,x.prototype[Symbol.iterator]=x.prototype.entries),T.prototype.inspect=function(){var r={left:this.items,right:this.inverse.items};return Object.defineProperty(r,"constructor",{value:T,enumerable:!1}),r},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),x.prototype.inspect=function(){var r={left:this.inverse.items,right:this.items};return Object.defineProperty(r,"constructor",{value:x,enumerable:!1}),r},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),T.from=function(r){var p=new T;return i(r,function(h,o){p.set(o,h)}),p},e.exports=T}),Qn=Le((g,e)=>{function i(x){if(typeof x!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=x}typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=function(){return this}),i.of=function(){var x=arguments,T=x.length,E=0;return new i(function(){return E>=T?{done:!0}:{done:!1,value:x[E++]}})},i.empty=function(){var x=new i(function(){return{done:!0}});return x},i.fromSequence=function(x){var T=0,E=x.length;return new i(function(){return T>=E?{done:!0}:{done:!1,value:x[T++]}})},i.is=function(x){return x instanceof i?!0:typeof x=="object"&&x!==null&&typeof x.next=="function"},e.exports=i}),IM=Le(g=>{function e(a){return a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a&~(a>>1)}g.msb32=e;function i(a){return a|=a>>1,a|=a>>2,a|=a>>4,a&~(a>>1)}g.msb8=i,g.test=function(a,y){return a>>y&1},g.criticalBit8=function(a,y){return i(a^y)},g.criticalBit8Mask=function(a,y){return~i(a^y)>>>0&255},g.testCriticalBit8=function(a,y){return 1+(a|y)>>8},g.criticalBit32Mask=function(a,y){return~e(a^y)>>>0&4294967295},g.popcount=function(a){return a-=a>>1&1431655765,a=(a&858993459)+(a>>2&858993459),a=a+(a>>4)&252645135,a+=a>>8,a+=a>>16,a&127};var x=new Uint8Array(Math.pow(2,8));for(T=0,E=x.length;T>8&255]+x[a>>16&255]+x[a>>24&255]}}),DF=Le((g,e)=>{var i=Qn(),x=IM();function T(E){this.length=E,this.clear()}T.prototype.clear=function(){this.size=0,this.array=new Uint32Array(Math.ceil(this.length/32))},T.prototype.set=function(E,a){var y=E>>5,t=E&31,r=this.array[y],p;return a===0||a===!1?p=this.array[y]&=~(1<>>0,p>r?this.size++:p>5,y=E&31,t=this.array[a],r;return r=this.array[a]&=~(1<>5,y=E&31,t=this.array[a],r=this.array[a]^=1<>>0,r>t?this.size++:r>5,y=E&31;return this.array[a]>>y&1},T.prototype.test=function(E){return!!this.get(E)},T.prototype.rank=function(E){if(this.size===0)return 0;for(var a=E>>5,y=E&31,t=0,r=0;r=this.length)return-1;for(var a,y=32,t=0,r=0,p=0,h=this.array.length;p>o&1,r===E)return t}},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=this.length,t,r,p=32,h=0,o=this.array.length;h>l&1,E.call(a,r,h*32+l)}},T.prototype.values=function(){var E=this.length,a=!1,y,t,r=this.array,p=r.length,h=0,o=-1,l=32;return new i(function n(){if(!a){if(h>=p)return{done:!0};h===p-1&&(l=E%32||32),y=r[h++],a=!0,o=-1}return o++,o>=l?(a=!1,n()):(t=y>>o&1,{value:t})})},T.prototype.entries=function(){var E=this.length,a=!1,y,t,r=this.array,p,h=r.length,o=0,l=-1,n=32;return new i(function u(){if(!a){if(o>=h)return{done:!0};o===h-1&&(n=E%32||32),y=r[o++],a=!0,l=-1}return l++,p=~-o*32+l,l>=n?(a=!1,u()):(t=y>>l&1,{value:[p,t]})})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=new Uint8Array(this.length);return this.forEach(function(a,y){E[y]=a}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return Array.from(this.array)},e.exports=T}),IF=Le((g,e)=>{var i=Qn(),x=IM(),T=function(y){return Math.max(1,Math.ceil(y*1.5))};function E(y){return new Uint32Array(Math.ceil(y/32))}function a(y){var t=y||0,r=T;typeof y=="object"&&(t=y.initialLength||y.initialCapacity||0,r=y.policy||r),this.size=0,this.length=t,this.capacity=Math.ceil(this.length/32)*32,this.policy=r,this.array=E(this.capacity)}a.prototype.set=function(y,t){if(this.length>5,p=y&31,h=this.array[r],o;return t===0||t===!1?o=this.array[r]&=~(1<>>0,o>h?this.size++:o>5,r=y&31,p=this.array[t],h;return h=this.array[t]&=~(1<>5,r=y&31,p=this.array[t],h=this.array[t]^=1<>>0,h>p?this.size++:hthis.array.length?(this.array=new Uint32Array(p),this.array.set(r,0)):this.array=r.slice(0,p),this.capacity=y,this)},a.prototype.grow=function(y){var t;if(typeof y=="number"){if(this.capacity>=y)return this;for(t=this.capacity;t>5,p=t&31;return this.array[r]|=1<>5,r=y&31;return this.array[t]>>r&1}},a.prototype.get=function(y){if(!(this.length>5,r=y&31;return this.array[t]>>r&1}},a.prototype.test=function(y){return this.length>5,r=y&31,p=0,h=0;h=this.length)return-1;for(var t,r=32,p=0,h=0,o=0,l=this.array.length;o>n&1,h===y)return p}},a.prototype.forEach=function(y,t){t=arguments.length>1?t:this;for(var r=this.length,p,h,o=32,l=0,n=this.array.length;l>u&1,y.call(t,h,l*32+u)}},a.prototype.values=function(){var y=this.length,t=!1,r,p,h=this.array,o=h.length,l=0,n=-1,u=32;return new i(function f(){if(!t){if(l>=o)return{done:!0};l===o-1&&(u=y%32||32),r=h[l++],t=!0,n=-1}return n++,n>=u?(t=!1,f()):(p=r>>n&1,{value:p})})},a.prototype.entries=function(){var y=this.length,t=!1,r,p,h=this.array,o,l=h.length,n=0,u=-1,f=32;return new i(function s(){if(!t){if(n>=l)return{done:!0};n===l-1&&(f=y%32||32),r=h[n++],t=!0,u=-1}return u++,o=~-n*32+u,u>=f?(t=!1,s()):(p=r>>u&1,{value:[o,p]})})},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.inspect=function(){var y=new Uint8Array(this.length);return this.forEach(function(t,r){y[r]=t}),Object.defineProperty(y,"constructor",{value:a,enumerable:!1}),y},typeof Symbol<"u"&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.prototype.toJSON=function(){return Array.from(this.array.slice(0,(this.length>>5)+1))},e.exports=a}),NF=Le((g,e)=>{function i(E,a){return(E&65535)*a+(((E>>>16)*a&65535)<<16)&4294967295}function x(E,a){return(E&65535)+(a>>>16)+(((E>>>16)+a&65535)<<16)&4294967295}function T(E,a){return E<>>32-a}e.exports=function(E,a){var y=3432918353,t=461845907,r=15,p=13,h=5,o=1801774676,l=E,n,u,f;for(u=0,f=a.length-4;u<=f;u+=4)n=a[u]|a[u+1]<<8|a[u+2]<<16|a[u+3]<<24,n=i(n,y),n=T(n,r),n=i(n,t),l^=n,l=T(l,p),l=i(l,h),l=x(l,o);switch(n=0,a.length&3){case 3:n^=a[u+2]<<16;case 2:n^=a[u+1]<<8;case 1:n^=a[u],n=i(n,y),n=T(n,r),n=i(n,t),l^=n}return l^=a.length,l^=l>>>16,l=i(l,2246822507),l^=l>>>13,l=i(l,3266489909),l^=l>>>16,l>>>0}}),BF=Le((g,e)=>{var i=NF(),x=Ji(),T=Math.LN2*Math.LN2,E={errorRate:.005};function a(r){var p=new Uint16Array(r.length),h,o;for(h=0,o=r.length;h>3]|=n}return this},t.prototype.test=function(r){for(var p=a(r),h=0,o=this.hashFunctions;h>3]&1<<(7&l)))return!1}return!0},t.prototype.toJSON=function(){return this.data},t.from=function(r,p){if(!p&&(p=r.length||r.size,typeof p!="number"))throw new Error("BloomFilter.from: could not infer the filter's capacity. Try passing it as second argument.");var h=new t(p);return x(r,function(o){h.add(o)}),h},e.exports=t}),UF=Le((g,e)=>{var i=Ji();function x(T){if(typeof T!="function")throw new Error("mnemonist/BKTree.constructor: given `distance` should be a function.");this.distance=T,this.clear()}x.prototype.add=function(T){if(!this.root)return this.root={item:T,children:{}},this.size++,this;for(var E=this.root,a;a=this.distance(T,E.item),!!E.children[a];)E=E.children[a];return E.children[a]={item:T,children:{}},this.size++,this},x.prototype.search=function(T,E){if(!this.root)return[];for(var a=[],y=[this.root],t,r,p,h,o;y.length;)for(t=y.pop(),p=this.distance(E,t.item),p<=T&&a.push({item:t.item,distance:p}),h=p-T,o=p+T+1;h{var i=ls(),x=Qn();function T(E,a){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof a!="number"||a<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=E,this.capacity=a,this.items=new E(this.capacity),this.clear()}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var a=this.start+this.size;return a>=this.capacity&&(a-=this.capacity),this.items[a]=E,++this.size},T.prototype.unshift=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var a=this.start-1;return this.start===0&&(a=this.capacity-1),this.items[a]=E,this.start=a,++this.size},T.prototype.pop=function(){if(this.size!==0){this.size--;var E=this.start+this.size;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.shift=function(){if(this.size!==0){var E=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[E]}},T.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},T.prototype.peekLast=function(){if(this.size!==0){var E=this.start+this.size-1;return E>=this.capacity&&(E-=this.capacity),this.items[E]}},T.prototype.get=function(E){if(!(this.size===0||E>=this.capacity))return E=this.start+E,E>=this.capacity&&(E-=this.capacity),this.items[E]},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=this.capacity,t=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[t];return t++,r++,t===a&&(t=0),{value:p,done:!1}})},T.prototype.entries=function(){var E=this.items,a=this.capacity,y=this.size,t=this.start,r=0;return new x(function(){if(r>=y)return{done:!0};var p=E[t];return t++,t===a&&(t=0),{value:[r++,p],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,a,y){if(arguments.length<3&&(y=i.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new T(a,y);if(i.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=ls(),x=NM();function T(a,y){if(arguments.length<2)throw new Error("mnemonist/circular-buffer: expecting an Array class and a capacity.");if(typeof y!="number"||y<=0)throw new Error("mnemonist/circular-buffer: `capacity` should be a positive number.");this.ArrayClass=a,this.capacity=y,this.items=new a(this.capacity),this.clear()}function E(a){T.prototype[a]=x.prototype[a]}Object.keys(x.prototype).forEach(E),typeof Symbol<"u"&&Object.getOwnPropertySymbols(x.prototype).forEach(E),T.prototype.push=function(a){var y=this.start+this.size;return y>=this.capacity&&(y-=this.capacity),this.items[y]=a,this.size===this.capacity?(y++,y>=this.capacity?this.start=0:this.start=y,this.size):++this.size},T.prototype.unshift=function(a){var y=this.start-1;return this.start===0&&(y=this.capacity-1),this.items[y]=a,this.size===this.capacity?(this.start=y,this.size):(this.start=y,++this.size)},T.from=function(a,y,t){if(arguments.length<3&&(t=i.guessLength(a),typeof t!="number"))throw new Error("mnemonist/circular-buffer.from: could not guess iterable length. Please provide desired capacity as last argument.");var r=new T(y,t);if(i.isArrayLike(a)){var p,h;for(p=0,h=a.length;p{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=x,this.size=0}i.prototype.clear=function(){this.items.clear(),this.size=0},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x,this.size),this.items.set(x,T),this.size++),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this.size=this.items.size,this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){var T=this.items.delete(x);return this.size=this.items.size,T},i.prototype.forEach=function(x,T){T=arguments.length>1?T:this,this.items.forEach(x,T)},i.prototype.entries=function(){return this.items.entries()},i.prototype.keys=function(){return this.items.keys()},i.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(i.prototype[Symbol.iterator]=i.prototype.entries),i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),i.autoIncrement=function(){var x=0;return function(){return x++}},e.exports=i}),VF=Le((g,e)=>{function i(x){if(typeof x!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=x}i.prototype.clear=function(){this.items=new WeakMap},i.prototype.get=function(x){var T=this.items.get(x);return typeof T>"u"&&(T=this.factory(x),this.items.set(x,T)),T},i.prototype.peek=function(x){return this.items.get(x)},i.prototype.set=function(x,T){return this.items.set(x,T),this},i.prototype.has=function(x){return this.items.has(x)},i.prototype.delete=function(x){return this.items.delete(x)},i.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(i.prototype[Symbol.for("nodejs.util.inspect.custom")]=i.prototype.inspect),e.exports=i}),HF=Le((g,e)=>{var i=zr();function x(T){var E=i.getPointerArray(T),a=i.getPointerArray(Math.log2(T));this.size=T,this.dimension=T,this.parents=new E(T),this.ranks=new a(T);for(var y=0;yr?this.parents[y]=a:(this.parents[y]=a,this.ranks[a]++),this},x.prototype.connected=function(T,E){var a=this.find(T);return a===this.find(E)},x.prototype.mapping=function(){for(var T=i.getPointerArray(this.dimension),E={},a=new T(this.size),y=0,t,r=0,p=this.parents.length;r"u"?(a[r]=y,E[t]=y++):a[r]=E[t];return a},x.prototype.compile=function(){for(var T={},E=new Array(this.dimension),a=0,y,t=0,r=this.parents.length;t"u"?(E[a]=[t],T[y]=a++):E[T[y]].push(t);return E},x.prototype.inspect=function(){var T=this.compile();return Object.defineProperty(T,"constructor",{value:x,enumerable:!1}),T},typeof Symbol<"u"&&(x.prototype[Symbol.for("nodejs.util.inspect.custom")]=x.prototype.inspect),e.exports=x}),zx=Le((g,e)=>{var i=Vm(),x=Ux(),T=i.DEFAULT_COMPARATOR,E=i.reverseComparator;function a(r,p,h,o){for(var l=h,n=o,u=p[o],f=2*o+1,s;f=0&&(f=s),p[o]=p[f],o=f,f=2*o+1;p[o]=u,x.siftDown(r,p,n,o)}function y(r,p,h,o){for(var l=o,n=l,u=new r(o),f,s;n>0;)f=h[--n],n!==0&&(s=h[0],h[0]=f,a(p,h,--o,0),f=s),u[n]=f;return u}function t(r,p,h){if(arguments.length===2&&(h=p,p=null),this.ArrayClass=r,this.capacity=h,this.items=new r(h),this.clear(),this.comparator=p||T,typeof h!="number"&&h<=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=E(this.comparator)}t.prototype.clear=function(){this.size=0},t.prototype.push=function(r){return this.size0&&x.replace(this.comparator,this.items,r),this.size},t.prototype.peek=function(){return this.items[0]},t.prototype.consume=function(){var r=y(this.ArrayClass,this.comparator,this.items,this.size);return this.size=0,r},t.prototype.toArray=function(){return y(this.ArrayClass,this.comparator,this.items.slice(0,this.size),this.size)},t.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),e.exports=t}),WF=Le((g,e)=>{var i=Ji(),x=function(E){return E};function T(E){if(this.items=new Map,this.clear(),Array.isArray(E)?(this.writeHashFunction=E[0],this.readHashFunction=E[1]):(this.writeHashFunction=E,this.readHashFunction=E),this.writeHashFunction||(this.writeHashFunction=x),this.readHashFunction||(this.readHashFunction=x),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.")}T.prototype.clear=function(){this.items.clear(),this.size=0},T.prototype.add=function(E){var a=this.writeHashFunction(E);return this.items.set(a,E),this.size=this.items.size,this},T.prototype.set=function(E,a){return E=this.writeHashFunction(E),this.items.set(E,a),this.size=this.items.size,this},T.prototype.get=function(E){return E=this.readHashFunction(E),this.items.get(E)},T.prototype.has=function(E){return E=this.readHashFunction(E),this.items.has(E)},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this,this.items.forEach(function(y){E.call(a,y,y)})},T.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=Array.from(this.items.values());return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,a,y){var t=new T(a);return i(E,function(r,p){y?t.set(p,r):t.add(r)}),t},e.exports=T}),BM=Le((g,e)=>{var i=Qn(),x=Ji();function T(E){this.Container=E||Array,this.items=new Map,this.clear(),Object.defineProperty(this.items,"constructor",{value:T,enumerable:!1})}T.prototype.clear=function(){this.size=0,this.dimension=0,this.items.clear()},T.prototype.set=function(E,a){var y=this.items.get(E),t;return y||(this.dimension++,y=new this.Container,this.items.set(E,y)),this.Container===Set?(t=y.size,y.add(a),t"u"?0:this.Container===Set?a.size:a.length},T.prototype.count=T.prototype.multiplicity,T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;var y;function t(r){E.call(a,r,y)}this.items.forEach(function(r,p){y=p,r.forEach(t)})},T.prototype.forEachAssociation=function(E,a){a=arguments.length>1?a:this,this.items.forEach(E,a)},T.prototype.keys=function(){return this.items.keys()},T.prototype.values=function(){var E=this.items.values(),a=!1,y,t,r,p;return this.Container===Set?new i(function h(){if(!a){if(t=E.next(),t.done)return{done:!0};a=!0,y=t.value.values()}return t=y.next(),t.done?(a=!1,h()):{done:!1,value:t.value}}):new i(function h(){if(!a){if(t=E.next(),t.done)return{done:!0};a=!0,y=t.value,r=0,p=y.length}return r>=p?(a=!1,h()):{done:!1,value:y[r++]}})},T.prototype.entries=function(){var E=this.items.entries(),a=!1,y,t,r,p,h;return this.Container===Set?new i(function o(){if(!a){if(t=E.next(),t.done)return{done:!0};a=!0,r=t.value[0],y=t.value[1].values()}return t=y.next(),t.done?(a=!1,o()):{done:!1,value:[r,t.value]}}):new i(function o(){if(!a){if(t=E.next(),t.done)return{done:!0};a=!0,r=t.value[0],y=t.value[1],p=0,h=y.length}return p>=h?(a=!1,o()):{done:!1,value:[r,y[p++]]}})},T.prototype.containers=function(){return this.items.values()},T.prototype.associations=function(){return this.items.entries()},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.entries),T.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.prototype.toJSON=function(){return this.items},T.from=function(E,a){var y=new T(a);return x(E,function(t,r){y.set(r,t)}),y},e.exports=T}),XF=Le((g,e)=>{var i=BM(),x=Ji(),T=function(a){return a};function E(a,y){if(this.items=new i(y),this.clear(),Array.isArray(a)?(this.writeHashFunction=a[0],this.readHashFunction=a[1]):(this.writeHashFunction=a,this.readHashFunction=a),this.writeHashFunction||(this.writeHashFunction=T),this.readHashFunction||(this.readHashFunction=T),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.")}E.prototype.clear=function(){this.items.clear(),this.size=0,this.dimension=0},E.prototype.add=function(a){var y=this.writeHashFunction(a);return this.items.set(y,a),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.set=function(a,y){return a=this.writeHashFunction(a),this.items.set(a,y),this.size=this.items.size,this.dimension=this.items.dimension,this},E.prototype.get=function(a){return a=this.readHashFunction(a),this.items.get(a)},E.prototype.has=function(a){return a=this.readHashFunction(a),this.items.has(a)},E.prototype.forEach=function(a,y){y=arguments.length>1?y:this,this.items.forEach(function(t){a.call(y,t,t)})},E.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.values),E.prototype.inspect=function(){var a=Array.from(this);return Object.defineProperty(a,"constructor",{value:E,enumerable:!1}),a},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.from=function(a,y,t,r){arguments.length===3&&typeof t=="boolean"&&(r=t,t=Array);var p=new E(y,t);return x(a,function(h,o){r?p.set(o,h):p.add(h)}),p},e.exports=E}),YF=Le((g,e)=>{var i=1024;function x(E){return(E&E-1)===0}function T(E,a){if(arguments.length<1)throw new Error("mnemonist/hashed-array-tree: expecting at least a byte array constructor.");var y=a||0,t=i,r=0;if(typeof a=="object"&&(y=a.initialCapacity||0,r=a.initialLength||0,t=a.blockSize||i),!t||!x(t))throw new Error("mnemonist/hashed-array-tree: block size should be a power of two.");var p=Math.max(r,y),h=Math.ceil(p/t);this.ArrayClass=E,this.length=r,this.capacity=h*t,this.blockSize=t,this.offsetMask=t-1,this.blockMask=Math.log2(t),this.blocks=new Array(h);for(var o=0;o>this.blockMask,t=E&this.offsetMask;return this.blocks[y][t]=a,this},T.prototype.get=function(E){if(!(this.length>this.blockMask,y=E&this.offsetMask;return this.blocks[a][y]}},T.prototype.grow=function(E){if(typeof E!="number"&&(E=this.capacity+this.blockSize),this.capacity>=E)return this;for(;this.capacity>this.blockMask,t=a&this.offsetMask;return this.blocks[y][t]=E,++this.length},T.prototype.pop=function(){if(this.length!==0){var E=this.blocks[this.blocks.length-1],a=--this.length&this.offsetMask;return E[a]}},T.prototype.inspect=function(){for(var E=new this.ArrayClass(this.length),a,y=0,t=this.length;y>this.blockMask,E[y]=this.blocks[a][y&this.offsetMask];return E.type=this.ArrayClass.name,E.items=this.length,E.capacity=this.capacity,E.blockSize=this.blockSize,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),e.exports=T}),UM=Le((g,e)=>{var i=Qn(),x=ls();function T(E,a){if(arguments.length<2)throw new Error("mnemonist/fixed-stack: expecting an Array class and a capacity.");if(typeof a!="number"||a<=0)throw new Error("mnemonist/fixed-stack: `capacity` should be a positive number.");this.capacity=a,this.ArrayClass=E,this.items=new this.ArrayClass(this.capacity),this.clear()}T.prototype.clear=function(){this.size=0},T.prototype.push=function(E){if(this.size===this.capacity)throw new Error("mnemonist/fixed-stack.push: stack capacity ("+this.capacity+") exceeded!");return this.items[this.size++]=E,this.size},T.prototype.pop=function(){if(this.size!==0)return this.items[--this.size]},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=0,t=this.items.length;y=a)return{done:!0};var t=E[a-y-1];return y++,{value:t,done:!1}})},T.prototype.entries=function(){var E=this.items,a=this.size,y=0;return new i(function(){if(y>=a)return{done:!0};var t=E[a-y-1];return{value:[y++,t],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return E.type=this.ArrayClass.name,E.capacity=this.capacity,Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E,a,y){if(arguments.length<3&&(y=x.guessLength(E),typeof y!="number"))throw new Error("mnemonist/fixed-stack.from: could not guess iterable length. Please provide desired capacity as last argument.");var t=new T(a,y);if(x.isArrayLike(E)){var r,p;for(r=0,p=E.length;r{var i=ls(),x=zr(),T=UM();function E(y,t,r,p,h,o,l,n){var u=l+(n-l)/2|0,f=~-u,s=-~u,c=r[u];p[o]=c+1;var d=t?t(y[c]):y[c][1],v=o*2+1,m=o*2+2,S=-1/0,M=-1/0;l<=f&&(S=E(y,t,r,p,h,v,l,f)),s<=n&&(M=E(y,t,r,p,h,m,s,n));var A=Math.max(d,S,M),C=c;return A===S?C=h[p[v]-1]:A===M&&(C=h[p[m]-1]),h[c]=C,A}function a(y,t){this.size=y.length,this.intervals=y;var r=null,p=null;Array.isArray(t)&&(r=t[0],p=t[1]);var h=y.length,o=x.getPointerArray(h+1),l=new o(h),n;for(n=1;nv?1:0});var u=Math.ceil(Math.log2(h+1)),f=Math.pow(2,u)-1,s=new o(f),c=new o(h);E(y,p,l,s,c,0,0,h-1),l=null,this.height=u,this.tree=s,this.augmentations=c,this.startGetter=r,this.endGetter=p,this.stack=new T(o,this.height)}a.prototype.intervalsContainingPoint=function(y){var t=[],r=this.stack;r.clear(),r.push(0);for(var p=this.tree.length,h,o,l,n,u,f,s,c,d;r.size;)h=r.pop(),o=this.tree[h]-1,l=this.intervals[o],n=this.intervals[this.augmentations[o]],s=this.endGetter?this.endGetter(n):n[1],!(y>s)&&(c=h*2+1,c=u&&y<=f&&t.push(l),!(yd)&&(v=l*2+1,v=s&&t<=c&&p.push(u),!(r{g.search=function(e,i,x,T){var E=0;x=typeof x<"u"?x:0,T=typeof T<"u"?T:e.length,T--;for(var a;x<=T;)if(E=x+T>>>1,a=e[E],a>i)T=~-E;else if(a>>1,y=e(i[T],x),y>0)a=~-T;else if(y<0)E=-~T;else return T;return-1},g.lowerBound=function(e,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:e.length;x>>1,i<=e[E]?T=E:x=-~E;return x},g.lowerBoundWithComparator=function(e,i,x){for(var T=0,E=0,a=i.length;E>>1,e(x,i[T])<=0?a=T:E=-~T;return E},g.lowerBoundIndices=function(e,i,x,T,E){var a=0;for(T=typeof T<"u"?T:0,E=typeof E<"u"?E:e.length;T>>1,x<=e[i[a]]?E=a:T=-~a;return T},g.upperBound=function(e,i,x,T){var E=0;for(x=typeof x<"u"?x:0,T=typeof T<"u"?T:e.length;x>>1,i>=e[E]?x=-~E:T=E;return x},g.upperBoundWithComparator=function(e,i,x){for(var T=0,E=0,a=i.length;E>>1,e(x,i[T])>=0?E=-~T:a=T;return E}}),KF=Le(g=>{var e=zr(),i=ls().isArrayLike,x=zM(),T=Bx();function E(r,p){if(r.length===0)return p.slice();if(p.length===0)return r.slice();var h;r[0]>p[0]&&(h=r,r=p,p=h);var o=r[r.length-1],l=p[0];if(o<=l)return e.isTypedArray(r)?e.concat(r,p):r.concat(p);var n=new r.constructor(r.length+p.length),u,f,s;for(u=0,f=r.length;up[0]&&(h=r,r=p,p=h);var o=r[r.length-1],l=p[0];if(op[0]&&(h=r,r=p,p=h);var o=r[r.length-1],l=p[0];if(ov?s=x.lowerBound(p,d,s+1):(n.push(d),u++,s++);return n};function y(r){var p=0,h=-1/0,o,l,n,u=[];for(l=0,n=r.length;lh&&(h=o));if(u.length===0)return new r[0].constructor(0);if(u.length===1)return u[0].slice();if(u.length===2)return E(u[0],u[1]);r=u;var f=new r[0].constructor(p),s=e.getPointerArray(h),c=new s(r.length),d=new T(function(S,M){return S=r[S][c[S]],M=r[M][c[M]],SM?1:0});for(l=0;lp&&(p=h));if(n.length===0)return new r[0].constructor(0);if(n.length===1)return n[0].slice();if(n.length===2)return a(n[0],n[1]);r=n;var u=new r[0].constructor,f=e.getPointerArray(p),s=new f(r.length),c=new T(function(m,S){return m=r[m][s[m]],S=r[S][s[S]],mS?1:0});for(o=0;op&&(p=o),lh)return[];if(p===h)return[p];var s,c,d=r[0],v,m,S,M,A,C,w=p;for(u=1;uC?m=x.lowerBound(c,A,m+1):(d.push(A),v++,m++);if(d.length===0)return d;w=d[0]}return d},g.merge=function(){if(arguments.length===2){if(i(arguments[0]))return E(arguments[0],arguments[1])}else if(i(arguments[0]))return y(arguments);return null},g.unionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return a(arguments[0],arguments[1])}else if(i(arguments[0]))return t(arguments);return null},g.intersectionUnique=function(){if(arguments.length===2){if(i(arguments[0]))return g.intersectionUniqueArrays(arguments[0],arguments[1])}else if(i(arguments[0]))return g.kWayIntersectionUniqueArrays(arguments);return null}}),jF=Le((g,e)=>{var i=Qn(),x=Ji(),T=KF();function E(y){return y}function a(y){if(this.clear(),Array.isArray(y)?(this.documentTokenizer=y[0],this.queryTokenizer=y[1]):(this.documentTokenizer=y,this.queryTokenizer=y),this.documentTokenizer||(this.documentTokenizer=E),this.queryTokenizer||(this.queryTokenizer=E),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.")}a.prototype.clear=function(){this.items=[],this.mapping=new Map,this.size=0,this.dimension=0},a.prototype.add=function(y){this.size++;var t=this.items.length;this.items.push(y);var r=this.documentTokenizer(y);if(!Array.isArray(r))throw new Error("mnemonist/InvertedIndex.add: tokenizer function should return an array of tokens.");for(var p=new Set,h,o,l=0,n=r.length;l"u"||r.length===0)return[];if(t.length>1)for(h=1,o=t.length;h"u"||p.length===0)return[];r=T.intersectionUniqueArrays(r,p)}var l=new Array(r.length);for(h=0,o=l.length;h1?t:this;for(var r=0,p=this.documents.length;r=t)return{done:!0};var p=y[r++];return{value:p,done:!1}})},a.prototype.tokens=function(){return this.mapping.keys()},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.documents),a.prototype.inspect=function(){var y=this.items.slice();return Object.defineProperty(y,"constructor",{value:a,enumerable:!1}),y},typeof Symbol<"u"&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(y,t){var r=new a(t);return x(y,function(p){r.add(p)}),r},e.exports=a}),GM=Le(g=>{var e=new Float64Array(64),i=new Float64Array(64);function x(E,a,y){var t,r,p,h,o;for(e[0]=a,i[0]=y,r=0;r>=0;)if(p=e[r],h=i[r]-1,p=t&&pi[r-1]-e[r-1]&&(o=e[r],e[r]=e[r-1],e[r-1]=o,o=i[r],i[r]=i[r-1],i[r-1]=o)}else r--;return E}g.inplaceQuickSort=x;function T(E,a,y,t){var r,p,h,o,l,n;for(e[0]=y,i[0]=t,p=0;p>=0;)if(h=e[p],o=i[p]-1,h=r&&hi[p-1]-e[p-1]&&(n=e[p],e[p]=e[p-1],e[p-1]=n,n=i[p],i[p]=i[p-1],i[p-1]=n)}else p--;return a}g.inplaceQuickSortIndices=T}),ZF=Le((g,e)=>{var i=ls(),x=zr(),T=Vm().createTupleComparator,E=zx(),a=GM().inplaceQuickSortIndices;function y(l,n,u,f){var s,c=0,d;for(s=0;s>>1),P=u[w],d[D]=P,A>-1&&(C===0?v[A]=D+1:m[A]=D+1),I=(I+1)%l,w!==L&&w!==O-1&&S.push([I,w+1,O,D,1]),w!==L&&S.push([I,L,w,D,0]),D++;return{axes:n,labels:f,pivots:d,lefts:v,rights:m}}function p(l,n){this.dimensions=l,this.visited=0,this.axes=n.axes,this.labels=n.labels,this.pivots=n.pivots,this.lefts=n.lefts,this.rights=n.rights,this.size=this.labels.length}p.prototype.nearestNeighbor=function(l){var n=1/0,u=null,f=this.dimensions,s=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(M,A){m++;var C=d[A],w=v[A],P=c[A],L=y(f,s,P,l);if(!(L0?C!==0&&S(M,C-1):w!==0&&S(M,w-1),O*O0?w!==0&&S(M,w-1):C!==0&&S(M,C-1))}}return S(0,0),this.visited=m,this.labels[u]};var h=T(3),o=T(2);p.prototype.kNearestNeighbors=function(l,n){if(l<=0)throw new Error("mnemonist/kd-tree.kNearestNeighbors: k should be a positive number.");if(l=Math.min(l,this.size),l===1)return[this.nearestNeighbor(n)];var u=new E(Array,h,l),f=this.dimensions,s=this.axes,c=this.pivots,d=this.lefts,v=this.rights,m=0;function S(C,w){var P=d[w],L=v[w],O=c[w],I=y(f,s,O,n);u.push([I,m++,O]);var D=n[C],B=s[C][O],G=D-B;C=(C+1)%f,D{var i=Qn(),x=Ji();function T(){this.clear()}T.prototype.clear=function(){this.head=null,this.tail=null,this.size=0},T.prototype.first=function(){return this.head?this.head.item:void 0},T.prototype.peek=T.prototype.first,T.prototype.last=function(){return this.tail?this.tail.item:void 0},T.prototype.push=function(E){var a={item:E,next:null};return this.head?(this.tail.next=a,this.tail=a):(this.head=a,this.tail=a),this.size++,this.size},T.prototype.unshift=function(E){var a={item:E,next:null};return this.head?(this.head.next||(this.tail=this.head),a.next=this.head,this.head=a):(this.head=a,this.tail=a),this.size++,this.size},T.prototype.shift=function(){if(this.size){var E=this.head;return this.head=E.next,this.size--,E.item}},T.prototype.forEach=function(E,a){if(this.size){a=arguments.length>1?a:this;for(var y=this.head,t=0;y;)E.call(a,y.item,t,this),y=y.next,t++}},T.prototype.toArray=function(){if(!this.size)return[];for(var E=new Array(this.size),a=0,y=this.size,t=this.head;a{var i=Qn(),x=Ji(),T=zr(),E=ls();function a(y,t,r){if(arguments.length<2&&(r=y,y=null,t=null),this.capacity=r,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 p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof t=="function"?new t(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items={}}a.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},a.prototype.splayOnTop=function(y){var t=this.head;if(this.head===y)return this;var r=this.backward[y],p=this.forward[y];return this.tail===y?this.tail=r:this.backward[p]=r,this.forward[r]=p,this.backward[t]=y,this.head=y,this.forward[y]=t,this},a.prototype.set=function(y,t){var r=this.items[y];if(typeof r<"u"){this.splayOnTop(r),this.V[r]=t;return}this.size1?t:this;for(var r=0,p=this.size,h=this.head,o=this.K,l=this.V,n=this.forward;r=t)return{done:!0};var o=p[r];return y++,y=t)return{done:!0};var o=p[r];return y++,y=t)return{done:!0};var l=p[r],n=h[r];return y++,y{var i=Gx(),x=Ji(),T=zr(),E=ls();function a(t,r,p){arguments.length<2?i.call(this,t):i.call(this,t,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)a.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),a.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},a.prototype.set=function(t,r){var p=this.items[t];if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],delete this.items[this.K[p]]),this.items[t]=p,this.K[p]=t,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},a.prototype.setpop=function(t,r){var p=null,h=null,o=this.items[t];return typeof o<"u"?(this.splayOnTop(o),p=this.V[o],this.V[o]=r,{evicted:!1,key:t,value:p}):(this.size0?o=this.deleted[--this.deletedSize]:o=this.size,this.size++):(o=this.tail,this.tail=this.backward[o],p=this.V[o],h=this.K[o],delete this.items[h]),this.items[t]=o,this.K[o]=t,this.V[o]=r,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,h?{evicted:!0,key:h,value:p}:null)},a.prototype.delete=function(t){var r=this.items[t];if(typeof r>"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 p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},a.prototype.remove=function(t,r=void 0){var p=this.items[t];if(typeof p>"u")return r;var h=this.V[p];if(delete this.items[t],this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var o=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=o),this.forward[o]=l,this.backward[l]=o,this.size--,this.deleted[this.deletedSize++]=p,h},a.from=function(t,r,p,h){if(arguments.length<2){if(h=E.guessLength(t),typeof h!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var o=new a(r,p,h);return x(t,function(l,n){o.set(n,l)}),o},e.exports=a}),VM=Le((g,e)=>{var i=Gx(),x=Ji(),T=zr(),E=ls();function a(y,t,r){if(arguments.length<2&&(r=y,y=null,t=null),this.capacity=r,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 p=T.getPointerArray(r);this.forward=new p(r),this.backward=new p(r),this.K=typeof y=="function"?new y(r):new Array(r),this.V=typeof t=="function"?new t(r):new Array(r),this.size=0,this.head=0,this.tail=0,this.items=new Map}a.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},a.prototype.set=function(y,t){var r=this.items.get(y);if(typeof r<"u"){this.splayOnTop(r),this.V[r]=t;return}this.size{var i=VM(),x=Ji(),T=zr(),E=ls();function a(t,r,p){arguments.length<2?i.call(this,t):i.call(this,t,r,p);var h=T.getPointerArray(this.capacity);this.deleted=new h(this.capacity),this.deletedSize=0}for(y in i.prototype)a.prototype[y]=i.prototype[y];var y;typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),a.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},a.prototype.set=function(t,r){var p=this.items.get(t);if(typeof p<"u"){this.splayOnTop(p),this.V[p]=r;return}this.size0?p=this.deleted[--this.deletedSize]:p=this.size,this.size++):(p=this.tail,this.tail=this.backward[p],this.items.delete(this.K[p])),this.items.set(t,p),this.K[p]=t,this.V[p]=r,this.forward[p]=this.head,this.backward[this.head]=p,this.head=p},a.prototype.setpop=function(t,r){var p=null,h=null,o=this.items.get(t);return typeof o<"u"?(this.splayOnTop(o),p=this.V[o],this.V[o]=r,{evicted:!1,key:t,value:p}):(this.size0?o=this.deleted[--this.deletedSize]:o=this.size,this.size++):(o=this.tail,this.tail=this.backward[o],p=this.V[o],h=this.K[o],this.items.delete(h)),this.items.set(t,o),this.K[o]=t,this.V[o]=r,this.forward[o]=this.head,this.backward[this.head]=o,this.head=o,h?{evicted:!0,key:h,value:p}:null)},a.prototype.delete=function(t){var r=this.items.get(t);if(typeof r>"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 p=this.backward[r],h=this.forward[r];return this.head===r&&(this.head=h),this.tail===r&&(this.tail=p),this.forward[p]=h,this.backward[h]=p,this.size--,this.deleted[this.deletedSize++]=r,!0},a.prototype.remove=function(t,r=void 0){var p=this.items.get(t);if(typeof p>"u")return r;var h=this.V[p];if(this.items.delete(t),this.size===1)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,h;var o=this.backward[p],l=this.forward[p];return this.head===p&&(this.head=l),this.tail===p&&(this.tail=o),this.forward[o]=l,this.backward[l]=o,this.size--,this.deleted[this.deletedSize++]=p,h},a.from=function(t,r,p,h){if(arguments.length<2){if(h=E.guessLength(t),typeof h!="number")throw new Error("mnemonist/lru-map.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(h=r,r=null,p=null);var o=new a(r,p,h);return x(t,function(l,n){o.set(n,l)}),o},e.exports=a}),_F=Le((g,e)=>{var i=Qn(),x=Ji(),T=zx(),E=function(y,t){return y[1]>t[1]?-1:y[1]"u"?0:t},a.prototype.get=a.prototype.multiplicity,a.prototype.count=a.prototype.multiplicity,a.prototype.frequency=function(y){if(this.size===0)return 0;var t=this.multiplicity(y);return t/this.size},a.prototype.top=function(y){if(typeof y!="number"||y<=0)throw new Error("mnemonist/multi-set.top: n must be a number > 0.");for(var t=new T(Array,E,y),r=this.items.entries(),p;p=r.next(),!p.done;)t.push(p.value);return t.consume()},a.prototype.forEach=function(y,t){t=arguments.length>1?t:this;var r;this.items.forEach(function(p,h){for(r=0;r1?t:this,this.items.forEach(y,t)},a.prototype.keys=function(){return this.items.keys()},a.prototype.values=function(){var y=this.items.entries(),t=!1,r,p,h,o;return new i(function l(){if(!t){if(r=y.next(),r.done)return{done:!0};t=!0,p=r.value[0],h=r.value[1],o=0}return o>=h?(t=!1,l()):(o++,{done:!1,value:p})})},a.prototype.multiplicities=function(){return this.items.entries()},typeof Symbol<"u"&&(a.prototype[Symbol.iterator]=a.prototype.values),a.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.prototype.toJSON=function(){return this.items},a.from=function(y){var t=new a;return x(y,function(r){t.add(r)}),t},a.isSubset=function(y,t){var r=y.multiplicities(),p,h,o;if(y===t)return!0;if(y.dimension>t.dimension)return!1;for(;p=r.next(),!p.done;)if(h=p.value[0],o=p.value[1],t.multiplicity(h){var i=Qn(),x=Ji();function T(l,n,u){return((Math.pow(l,2)-Math.pow(Math.abs(n-u),2))/2|0)+l+1}function E(l,n){for(var u=0,f=0,s=n+1;fn.length?-1:l.lengthn?1:0}function y(l,n){var u=l+1,f=n/u|0,s=f+1,c,d,v=n-f*u,m=u-v,S=new Array(l+1);for(c=0;c 0");this.levenshtein=l,this.k=n,this.clear()}o.prototype.clear=function(){this.size=0,this.strings=[],this.invertedIndices={}},o.prototype.add=function(l){var n=l.length,u=this.size;this.strings.push(l),this.size++;var f=t(this.k,l),s=this.invertedIndices[n];typeof s>"u"&&(s={},this.invertedIndices[n]=s);var c,d,v,m,S;for(m=0,S=f.length;m"u"?(d=[u],s[v]=d):d.push(u);return this},o.prototype.search=function(l){var n=l.length,u=this.k,f=new Set,s,c,d,v,m,S,M,A,C,w,P,L,O,I,D;for(A=Math.max(0,n-u),C=n+u+1;A1?n:this;for(var u=0,f=this.strings.length;u=n)return{done:!0};var f=l[u];return u++,{value:f,done:!1}})},typeof Symbol<"u"&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.inspect=function(){var l=this.strings.slice();return Object.defineProperty(l,"constructor",{value:o,enumerable:!1}),l},typeof Symbol<"u"&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(l,n,u){var f=new o(n,u);return x(l,function(s){f.add(s)}),f},o.countKeys=E,o.comparator=a,o.partition=y,o.segments=t,o.segmentPos=r,o.multiMatchAwareInterval=p,o.multiMatchAwareSubstrings=h,e.exports=o}),t4=Le((g,e)=>{var i=Qn(),x=Ji();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.offset=0,this.size=0},T.prototype.enqueue=function(E){return this.items.push(E),++this.size},T.prototype.dequeue=function(){if(this.size){var E=this.items[this.offset];return++this.offset*2>=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,E}},T.prototype.peek=function(){if(this.size)return this.items[this.offset]},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=this.offset,t=0,r=this.items.length;y=E.length)return{done:!0};var y=E[a];return a++,{value:y,done:!1}})},T.prototype.entries=function(){var E=this.items,a=this.offset,y=0;return new i(function(){if(a>=E.length)return{done:!0};var t=E[a];return a++,{value:[y++,t],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var a=new T;return x(E,function(y){a.enqueue(y)}),a},T.of=function(){return T.from(arguments)},e.exports=T}),e4=Le((g,e)=>{var i=Qn(),x=Ji();function T(){this.clear()}T.prototype.clear=function(){this.items=[],this.size=0},T.prototype.push=function(E){return this.items.push(E),++this.size},T.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},T.prototype.peek=function(){return this.items[this.size-1]},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=0,t=this.items.length;y=a)return{done:!0};var t=E[a-y-1];return y++,{value:t,done:!1}})},T.prototype.entries=function(){var E=this.items,a=E.length,y=0;return new i(function(){if(y>=a)return{done:!0};var t=E[a-y-1];return{value:[y++,t],done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.toString=function(){return this.toArray().join(",")},T.prototype.toJSON=function(){return this.toArray()},T.prototype.inspect=function(){var E=this.toArray();return Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),T.from=function(E){var a=new T;return x(E,function(y){a.push(y)}),a},T.of=function(){return T.from(arguments)},e.exports=T}),i4=Le(g=>{g.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var e=new Set,i=1/0,x=null,T,E,a=arguments.length;for(E=0;Ei.size)return!1;for(;T=x.next(),!T.done;)if(!i.has(T.value))return!1;return!0},g.isSuperset=function(e,i){return g.isSubset(i,e)},g.add=function(e,i){for(var x=i.values(),T;T=x.next(),!T.done;)e.add(T.value)},g.subtract=function(e,i){for(var x=i.values(),T;T=x.next(),!T.done;)e.delete(T.value)},g.intersect=function(e,i){for(var x=e.values(),T;T=x.next(),!T.done;)i.has(T.value)||e.delete(T.value)},g.disjunct=function(e,i){for(var x=e.values(),T,E=[];T=x.next(),!T.done;)i.has(T.value)&&E.push(T.value);for(x=i.values();T=x.next(),!T.done;)e.has(T.value)||e.add(T.value);for(var a=0,y=E.length;ai.size&&(x=e,e=i,i=x),e.size===0)return 0;if(e===i)return e.size;for(var T=e.values(),E,a=0;E=T.next(),!E.done;)i.has(E.value)&&a++;return a},g.unionSize=function(e,i){var x=g.intersectionSize(e,i);return e.size+i.size-x},g.jaccard=function(e,i){var x=g.intersectionSize(e,i);if(x===0)return 0;var T=e.size+i.size-x;return x/T},g.overlap=function(e,i){var x=g.intersectionSize(e,i);return x===0?0:x/Math.min(e.size,i.size)}}),n4=Le((g,e)=>{var i=Qn(),x=zr().getPointerArray;function T(E){var a=x(E);this.start=0,this.size=0,this.capacity=E,this.dense=new a(E),this.sparse=new a(E)}T.prototype.clear=function(){this.start=0,this.size=0},T.prototype.has=function(E){if(this.size===0)return!1;var a=this.sparse[E],y=a=this.start&&a=this.start&&a1?a:this;for(var y=this.capacity,t=this.size,r=this.start,p=0;p=y)return{done:!0};var p=E[t];return t++,r++,t===a&&(t=0),{value:p,done:!1}})},typeof Symbol<"u"&&(T.prototype[Symbol.iterator]=T.prototype.values),T.prototype.inspect=function(){var E=[];return this.forEach(function(a){E.push(a)}),Object.defineProperty(E,"constructor",{value:T,enumerable:!1}),E.capacity=this.capacity,E},typeof Symbol<"u"&&(T.prototype[Symbol.for("nodejs.util.inspect.custom")]=T.prototype.inspect),e.exports=T}),r4=Le((g,e)=>{var i=Qn(),x=zr().getPointerArray;function T(E,a){arguments.length<2&&(a=E,E=Array);var y=x(a);this.size=0,this.length=a,this.dense=new y(a),this.sparse=new y(a),this.vals=new E(a)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var a=this.sparse[E];return a=this.size||this.dense[a]!==E?!1:(a=this.dense[this.size-1],this.dense[this.sparse[E]]=a,this.sparse[a]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y=0;y{var i=Qn(),x=zr().getPointerArray;function T(E){var a=x(E);this.size=0,this.length=E,this.dense=new a(E),this.sparse=new a(E)}T.prototype.clear=function(){this.size=0},T.prototype.has=function(E){var a=this.sparse[E];return a=this.size||this.dense[a]!==E?!1:(a=this.dense[this.size-1],this.dense[this.sparse[E]]=a,this.sparse[a]=this.sparse[E],this.size--,!0)},T.prototype.forEach=function(E,a){a=arguments.length>1?a:this;for(var y,t=0;t{var i=Ji(),x=2,T=2,E=new Set([0,1,2]),a={0:"Returns only the top suggestion",1:"Returns suggestions with the smallest edit distance",2:"Returns every suggestion (no early termination)"};function y(n){var u=new Set;return typeof n=="number"&&u.add(n),{suggestions:u,count:0}}function t(n,u,f){return{term:n||"",distance:u||0,count:f||0}}function r(n,u,f,s){s=s||new Set,u++;var c,d=n.length,v;if(d>1)for(v=0;v0&&n[v].length-d.length>s.length-d.length&&(f.suggestions=new Set,f.count=0),(u===2||!f.suggestions.size||n[v].length-d.length>=s.length-d.length)&&f.suggestions.add(c)}function h(n,u){var f=n.length,s=u.length,c=[[]],d=f+s,v=new Map,m,S,M;for(c[0][0]=d,m=0;m<=f;m++)c[m+1]||(c[m+1]=[]),c[m+1][1]=m,c[m+1][0]=d;for(M=0;M<=s;M++)c[1][M+1]=M,c[0][M+1]=d;var A=n+u,C;for(m=0,S=A.length;mc)return[];for(var m=[d],S=new Set,M=new Set,A=[],C,w;m.length>0&&(C=m.shift(),!(f<2&&A.length>0&&v-C.length>A[0].distance));){if(w=n[C],w!==void 0){if(typeof w=="number"&&(w=y(w)),w.count>0&&!M.has(C)){M.add(C);var P=t(C,v-C.length,w.count);if(A.push(P),f<2&&v-C.length===0)break}w.suggestions.forEach(D=>{var B=u[D];if(!M.has(B)){M.add(B);var G=0;if(d!==B)if(B.length===C.length)G=v-C.length;else if(v===C.length)G=B.length-C.length;else{for(var z=0,W=0,k=B.length;z0||W>0?G=h(B.substr(z,k-z-W),d.substr(z,v-z-W)):G=h(B,d)}if(f<2&&A.length>0&&A[0].distance>G&&(A=[]),!(f<2&&A.length>0&&G>A[0].distance)&&G<=s){var J=n[B];J!==void 0&&A.push(t(B,G,J.count))}}})}if(v-C.length0&&v-C.length>=A[0].distance)continue;for(var L=0,O=C.length;Lthis.maxLength&&(this.maxLength=n.length)),u.count===1){var f=this.words.length;this.words.push(n);var s=r(n,0,this.maxDistance);s.forEach(c=>{var d=this.dictionary[c];d!==void 0?(typeof d=="number"&&(d=y(d),this.dictionary[c]=d),d.suggestions.has(f)||p(this.words,this.verbosity,d,n,f,c)):this.dictionary[c]=f})}return this.size++,this},l.prototype.search=function(n){return o(this.dictionary,this.words,this.verbosity,this.maxDistance,this.maxLength,n)},l.prototype.inspect=function(){var n=[];n.size=this.size,n.maxDistance=this.maxDistance,n.verbosity=this.verbosity,n.behavior=a[this.verbosity];for(var u in this.dictionary)typeof this.dictionary[u]=="object"&&this.dictionary[u].count&&n.push([u,this.dictionary[u].count]);return Object.defineProperty(n,"constructor",{value:l,enumerable:!1}),n},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(n,u){var f=new l(u);return i(n,function(s){f.add(s)}),f},e.exports=l}),HM=Le((g,e)=>{var i=Ji(),x=Qn(),T="\0";function E(a){this.mode=a===Array?"array":"string",this.clear()}E.prototype.clear=function(){this.root={},this.size=0},E.prototype.set=function(a,y){for(var t=this.root,r,p=0,h=a.length;p"u")return;if(T in y)return y[T]},E.prototype.delete=function(a){var y=this.root,t=null,r=null,p,h,o,l;for(o=0,l=a.length;o"u")return!1;t!==null?Object.keys(y).length>1&&(t=null,r=null):Object.keys(y).length<2&&(t=p,r=h)}return T in y?(this.size--,t?delete t[r]:delete y[T],!0):!1},E.prototype.has=function(a){for(var y=this.root,t,r=0,p=a.length;r"u")return!1;return T in y},E.prototype.find=function(a){var y=typeof a=="string",t=this.root,r=[],p,h,o;for(h=0,o=a.length;h"u")return r;for(var l=[t],n=[a],u;l.length;){a=n.pop(),t=l.pop();for(u in t){if(u===T){r.push([a,t[T]]);continue}l.push(t[u]),n.push(y?a+u:a.concat(u))}}return r},E.prototype.values=function(a){var y=this.root,t=[],r,p,h;if(a){for(p=0,h=a.length;p"u")return x.empty()}return t.push(y),new x(function(){for(var o,l=!1,n;t.length;){o=t.pop();for(n in o){if(n===T){l=!0;continue}t.push(o[n])}if(l)return{done:!1,value:o[T]}}return{done:!0}})},E.prototype.prefixes=function(a){var y=this.root,t=[],r=[],p,h,o,l=this.mode==="string";if(a){for(h=0,o=a.length;h"u")return x.empty()}else a=l?"":[];return t.push(y),r.push(a),new x(function(){for(var n,u,f=!1,s;t.length;){n=t.pop(),u=r.pop();for(s in n){if(s===T){f=!0;continue}t.push(n[s]),r.push(l?u+s:u.concat(s))}if(f)return{done:!1,value:u}}return{done:!0}})},E.prototype.keys=E.prototype.prefixes,E.prototype.entries=function(a){var y=this.root,t=[],r=[],p,h,o,l=this.mode==="string";if(a){for(h=0,o=a.length;h"u")return x.empty()}else a=l?"":[];return t.push(y),r.push(a),new x(function(){for(var n,u,f=!1,s;t.length;){n=t.pop(),u=r.pop();for(s in n){if(s===T){f=!0;continue}t.push(n[s]),r.push(l?u+s:u.concat(s))}if(f)return{done:!1,value:[u,n[T]]}}return{done:!0}})},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.entries),E.prototype.inspect=function(){for(var a=new Array(this.size),y=this.entries(),t,r=0;t=y.next(),!t.done;)a[r++]=t.value;return Object.defineProperty(a,"constructor",{value:E,enumerable:!1}),a},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(a){var y=new E;return i(a,function(t,r){y.set(r,t)}),y},E.SENTINEL=T,e.exports=E}),o4=Le((g,e)=>{var i=Ji(),x=HM(),T="\0";function E(y){this.mode=y===Array?"array":"string",this.clear()}for(a in x.prototype)E.prototype[a]=x.prototype[a];var a;delete E.prototype.set,delete E.prototype.get,delete E.prototype.values,delete E.prototype.entries,E.prototype.add=function(y){for(var t=this.root,r,p=0,h=y.length;p"u")return p;for(var n=[r],u=[y],f;n.length;){y=u.pop(),r=n.pop();for(f in r){if(f===T){p.push(y);continue}n.push(r[f]),u.push(t?y+f:y.concat(f))}}return p},typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=E.prototype.keys),E.prototype.inspect=function(){for(var y=new Set,t=this.keys(),r;r=t.next(),!r.done;)y.add(r.value);return Object.defineProperty(y,"constructor",{value:E,enumerable:!1}),y},typeof Symbol<"u"&&(E.prototype[Symbol.for("nodejs.util.inspect.custom")]=E.prototype.inspect),E.prototype.toJSON=function(){return this.root},E.from=function(y){var t=new E;return i(y,function(r){t.add(r)}),t},E.SENTINEL=T,e.exports=E}),l4=Le((g,e)=>{var i=Qn(),x=Ji(),T=ls(),E=zr(),a=function(p){return Math.max(1,Math.ceil(p*1.5))},y=function(p){var h=E.getPointerArray(p);return new h(p)};function t(p,h){if(arguments.length<1)throw new Error("mnemonist/vector: expecting at least a byte array constructor.");var o=h||0,l=a,n=0,u=!1;typeof h=="object"&&(o=h.initialCapacity||0,n=h.initialLength||0,l=h.policy||l,u=h.factory===!0),this.factory=u?p:null,this.ArrayClass=p,this.length=n,this.capacity=Math.max(n,o),this.policy=l,this.array=new p(this.capacity)}t.prototype.set=function(p,h){if(this.lengththis.capacity)if(this.factory===null?this.array=new this.ArrayClass(p):this.array=this.factory(p),E.isTypedArray(this.array))this.array.set(h,0);else for(var o=0,l=this.length;o=p)return this;for(h=this.capacity;h=h)return{done:!0};var l=p[o];return o++,{value:l,done:!1}})},t.prototype.entries=function(){var p=this.array,h=this.length,o=0;return new i(function(){if(o>=h)return{done:!0};var l=p[o];return{value:[o++,l],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var p=this.array.slice(0,this.length);return p.type=this.array.constructor.name,p.items=this.length,p.capacity=this.capacity,Object.defineProperty(p,"constructor",{value:t,enumerable:!1}),p},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(p,h,o){if(arguments.length<3&&(o=T.guessLength(p),typeof o!="number"))throw new Error("mnemonist/vector.from: could not guess iterable length. Please provide desired capacity as last argument.");var l=new t(h,o);return x(p,function(n){l.push(n)}),l};function r(p){var h=function(l){t.call(this,p,l)};for(var o in t.prototype)t.prototype.hasOwnProperty(o)&&(h.prototype[o]=t.prototype[o]);return h.from=function(l,n){return t.from(l,p,n)},typeof Symbol<"u"&&(h.prototype[Symbol.iterator]=h.prototype.values),h}t.Int8Vector=r(Int8Array),t.Uint8Vector=r(Uint8Array),t.Uint8ClampedVector=r(Uint8ClampedArray),t.Int16Vector=r(Int16Array),t.Uint16Vector=r(Uint16Array),t.Int32Vector=r(Int32Array),t.Uint32Vector=r(Uint32Array),t.Float32Vector=r(Float32Array),t.Float64Vector=r(Float64Array),t.PointerVector=r(y),e.exports=t}),h4=Le((g,e)=>{var i=ls(),x=zr(),T=GM().inplaceQuickSortIndices,E=zM().lowerBoundIndices,a=Ux(),y=x.getPointerArray;function t(h,o){return h.distanceo.distance?-1:0}function r(h,o,l){for(var n=l.length,u=y(n),f=0,s=new u(n),c=new u(n),d=new u(n),v=new Float64Array(n),m=[0,0,n],S=new Float64Array(n),M,A,C,w,P,L,O,I,D;m.length;)if(P=m.pop(),w=m.pop(),M=m.pop(),A=l[P-1],P--,D=P-w,s[M]=A,D!==0){if(D===1){O=h(o[A],o[l[w]]),v[M]=O,f++,d[M]=f,s[f]=l[w];continue}for(I=w;I0&&(f++,d[M]=f,m.push(f,L,P)),L-w>0&&(f++,c[M]=f,m.push(f,w,L))}return{nodes:s,lefts:c,rights:d,mus:v}}function p(h,o){if(typeof h!="function")throw new Error("mnemonist/VPTree.constructor: given `distance` must be a function.");if(!o)throw new Error("mnemonist/VPTree.constructor: you must provide items to the tree. A VPTree cannot be updated after its creation.");this.distance=h,this.heap=new a(t),this.D=0;var l=i.toArrayWithIndices(o);this.items=l[0];var n=l[1];this.size=n.length;var u=r(h,this.items,n);this.nodes=u.nodes,this.lefts=u.lefts,this.rights=u.rights,this.mus=u.mus}p.prototype.nearestNeighbors=function(h,o){var l=this.heap,n=[0],u=1/0,f,s,c,d,v,m,S;for(this.D=0;n.length;)f=n.pop(),s=this.nodes[f],c=this.items[s],S=this.distance(c,o),this.D++,Sh&&l.pop(),l.size>=h&&(u=l.peek().distance)),d=this.lefts[f],v=this.rights[f],!(!d&&!v)&&(m=this.mus[f],S=m-u&&n.push(v)):(v&&S>=m-u&&n.push(v),d&&S=0;A--)M[A]=l.pop();return M},p.prototype.neighbors=function(h,o){var l=[],n=[0],u,f,s,c,d,v,m;for(this.D=0;n.length;)u=n.pop(),f=this.nodes[u],s=this.items[f],m=this.distance(s,o),this.D++,m<=h&&l.push({distance:m,item:s}),c=this.lefts[u],d=this.rights[u],!(!c&&!d)&&(v=this.mus[u],m=v-h&&n.push(d)):(d&&m>=v-h&&n.push(d),c&&m{var i=Ux(),x=Bx(),T=FF();e.exports={BiMap:OF(),BitSet:DF(),BitVector:IF(),BloomFilter:BF(),BKTree:UF(),CircularBuffer:zF(),DefaultMap:GF(),DefaultWeakMap:VF(),FixedDeque:NM(),StaticDisjointSet:HF(),FibonacciHeap:x,MinFibonacciHeap:x.MinFibonacciHeap,MaxFibonacciHeap:x.MaxFibonacciHeap,FixedReverseHeap:zx(),FuzzyMap:WF(),FuzzyMultiMap:XF(),HashedArrayTree:YF(),Heap:i,MinHeap:i.MinHeap,MaxHeap:i.MaxHeap,StaticIntervalTree:kF(),InvertedIndex:jF(),KDTree:ZF(),LinkedList:JF(),LRUCache:Gx(),LRUCacheWithDelete:$F(),LRUMap:VM(),LRUMapWithDelete:QF(),MultiMap:BM(),MultiSet:_F(),PassjoinIndex:qF(),Queue:t4(),FixedStack:UM(),Stack:e4(),SuffixArray:T,GeneralizedSuffixArray:T.GeneralizedSuffixArray,Set:i4(),SparseQueueSet:n4(),SparseMap:r4(),SparseSet:s4(),SymSpell:a4(),Trie:o4(),TrieMap:HM(),Vector:l4(),VPTree:h4()}}),Ot=class Tn{static get ZERO(){return new Tn(0,0)}static get ONE(){return new Tn(1,1)}static get UP(){return new Tn(0,-1)}static get DOWN(){return new Tn(0,1)}static get LEFT(){return new Tn(-1,0)}static get RIGHT(){return new Tn(1,0)}static get UP_LEFT(){return new Tn(-1,-1)}static get UP_RIGHT(){return new Tn(1,-1)}static get DOWN_RIGHT(){return new Tn(1,1)}static get DOWN_LEFT(){return new Tn(-1,1)}constructor(e,i){typeof e=="number"?(this.x=e,this.y=i||0):(this.x=e.x,this.y=e.y)}clone(){return new Tn(this.x,this.y)}add(e){return new Tn(this.x+e.x,this.y+e.y)}multiply(e){return new Tn(this.x*e.x,this.y*e.y)}divide(e){return new Tn(this.x/e.x,this.y/e.y)}subtract(e){return new Tn(this.x-e.x,this.y-e.y)}equals(e){return this.x===e.x&&this.y===e.y}abs(){return new Tn(Math.abs(this.x),Math.abs(this.y))}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}modulo(e){return new Tn(this.x%e.x,this.y%e.y)}scalarModulo(e){return new Tn(this.x%e,this.y%e)}scalarMult(e){return new Tn(this.x*e,this.y*e)}toPosition(){return{x:this.x,y:this.y}}toString(){return`${this.x}#${this.y}`}},Qe=class{static equal(g,e){return g.position.x===e.position.x&&g.position.y===e.position.y&&g.layer===e.layer}static copyOver(g,e){e.position.x=g.position.x,e.position.y=g.position.y,e.layer=g.layer}static clone(g){return{position:g.position.clone(),layer:g.layer}}static toString(g){return`${g.position.toString()}#${g.layer}`}static toInternal(g){return{position:new Ot(g.position.x,g.position.y),layer:g.charLayer}}static fromInternal(g){return{position:g.position.toPosition(),charLayer:g.layer}}},f4=(g=>(g.NONE="none",g.LEFT="left",g.UP_LEFT="up-left",g.UP="up",g.UP_RIGHT="up-right",g.RIGHT="right",g.DOWN_RIGHT="down-right",g.DOWN="down",g.DOWN_LEFT="down-left",g))(f4||{}),c4={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"},d4={up:Ot.UP,down:Ot.DOWN,left:Ot.LEFT,right:Ot.RIGHT,none:Ot.ZERO,"up-left":Ot.UP_LEFT,"up-right":Ot.UP_RIGHT,"down-right":Ot.DOWN_RIGHT,"down-left":Ot.DOWN_LEFT},rm={up:0,"up-right":1,right:2,"down-right":3,down:4,"down-left":5,left:6,"up-left":7,none:NaN},WM=["up","up-right","right","down-right","down","down-left","left","up-left"],p4=["down-left","down-right","up-right","up-left"];function Vx(){return["up","down","left","right","none","up-left","up-right","down-right","down-left"]}function Uc(g){return p4.includes(g)}function v4(g,e=1){return g==="none"?"none":WM[(rm[g]+8-Math.abs(e)%8)%8]}function XM(g,e=1){return g==="none"?"none":WM[(rm[g]+e)%8]}function wh(g){return d4[g]}function m4(g){return c4[g]}function Rs(g,e){if(g.x===e.x){if(g.y>e.y)return"up";if(g.ye.x)return"left";if(g.xe.x){if(g.ye.y)return"up-left"}else if(g.xe.y)return"up-right"}return"none"}var g4=(g=>(g[g.FOUR=4]="FOUR",g[g.EIGHT=8]="EIGHT",g))(g4||{});function $u(g){return typeof g=="string"&&Vx().includes(g)}var yy=function(g,e){return yy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,x){i.__proto__=x}||function(i,x){for(var T in x)Object.prototype.hasOwnProperty.call(x,T)&&(i[T]=x[T])},yy(g,e)};function Sd(g,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yy(g,e);function i(){this.constructor=g}g.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}function y4(g,e,i,x){function T(E){return E instanceof i?E:new i(function(a){a(E)})}return new(i||(i=Promise))(function(E,a){function y(p){try{r(x.next(p))}catch(h){a(h)}}function t(p){try{r(x.throw(p))}catch(h){a(h)}}function r(p){p.done?E(p.value):T(p.value).then(y,t)}r((x=x.apply(g,e||[])).next())})}function YM(g,e){var i={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},x,T,E,a;return a={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function y(r){return function(p){return t([r,p])}}function t(r){if(x)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(i=0)),i;)try{if(x=1,T&&(E=r[0]&2?T.return:r[0]?T.throw||((E=T.return)&&E.call(T),0):T.next)&&!(E=E.call(T,r[1])).done)return E;switch(T=0,E&&(r=[r[0]&2,E.value]),r[0]){case 0:case 1:E=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,T=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(E=i.trys,!(E=E.length>0&&E[E.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!E||r[1]>E[0]&&r[1]=g.length&&(g=void 0),{value:g&&g[x++],done:!g}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Kc(g,e){var i=typeof Symbol=="function"&&g[Symbol.iterator];if(!i)return g;var x=i.call(g),T,E=[],a;try{for(;(e===void 0||e-- >0)&&!(T=x.next()).done;)E.push(T.value)}catch(y){a={error:y}}finally{try{T&&!T.done&&(i=x.return)&&i.call(x)}finally{if(a)throw a.error}}return E}function jc(g,e,i){if(i||arguments.length===2)for(var x=0,T=e.length,E;x1||y(o,l)})})}function y(o,l){try{t(x[o](l))}catch(n){h(E[0][3],n)}}function t(o){o.value instanceof sf?Promise.resolve(o.value.v).then(r,p):h(E[0][2],o)}function r(o){y("next",o)}function p(o){y("throw",o)}function h(o,l){o(l),E.shift(),E.length&&y(E[0][0],E[0][1])}}function S4(g){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=g[Symbol.asyncIterator],i;return e?e.call(g):(g=typeof hf=="function"?hf(g):g[Symbol.iterator](),i={},x("next"),x("throw"),x("return"),i[Symbol.asyncIterator]=function(){return this},i);function x(E){i[E]=g[E]&&function(a){return new Promise(function(y,t){a=g[E](a),T(y,t,a.done,a.value)})}}function T(E,a,y,t){Promise.resolve(t).then(function(r){E({value:r,done:y})},a)}}function bn(g){return typeof g=="function"}function kM(g){var e=function(x){Error.call(x),x.stack=new Error().stack},i=g(e);return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}var u0=kM(function(g){return function(e){g(this),this.message=e?e.length+` errors occurred during unsubscription: -`+e.map(function(i,x){return x+1+") "+i.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=e}});function xy(g,e){if(g){var i=g.indexOf(e);0<=i&&g.splice(i,1)}}var Hm=function(){function g(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return g.prototype.unsubscribe=function(){var e,i,x,T,E;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var y=hf(a),t=y.next();!t.done;t=y.next()){var r=t.value;r.remove(this)}}catch(u){e={error:u}}finally{try{t&&!t.done&&(i=y.return)&&i.call(y)}finally{if(e)throw e.error}}else a.remove(this);var p=this.initialTeardown;if(bn(p))try{p()}catch(u){E=u instanceof u0?u.errors:[u]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var o=hf(h),l=o.next();!l.done;l=o.next()){var n=l.value;try{KS(n)}catch(u){E=E??[],u instanceof u0?E=jc(jc([],Kc(E)),Kc(u.errors)):E.push(u)}}}catch(u){x={error:u}}finally{try{l&&!l.done&&(T=o.return)&&T.call(o)}finally{if(x)throw x.error}}}if(E)throw new u0(E)}},g.prototype.add=function(e){var i;if(e&&e!==this)if(this.closed)KS(e);else{if(e instanceof g){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(i=this._finalizers)!==null&&i!==void 0?i:[]).push(e)}},g.prototype._hasParent=function(e){var i=this._parentage;return i===e||Array.isArray(i)&&i.includes(e)},g.prototype._addParent=function(e){var i=this._parentage;this._parentage=Array.isArray(i)?(i.push(e),i):i?[i,e]:e},g.prototype._removeParent=function(e){var i=this._parentage;i===e?this._parentage=null:Array.isArray(i)&&xy(i,e)},g.prototype.remove=function(e){var i=this._finalizers;i&&xy(i,e),e instanceof g&&e._removeParent(this)},g.EMPTY=function(){var e=new g;return e.closed=!0,e}(),g}(),KM=Hm.EMPTY;function jM(g){return g instanceof Hm||g&&"closed"in g&&bn(g.remove)&&bn(g.add)&&bn(g.unsubscribe)}function KS(g){bn(g)?g():g.unsubscribe()}var ZM={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},T4={setTimeout:function(g,e){for(var i=[],x=2;x0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(i){return this._throwIfClosed(),g.prototype._trySubscribe.call(this,i)},e.prototype._subscribe=function(i){return this._throwIfClosed(),this._checkFinalizedStatuses(i),this._innerSubscribe(i)},e.prototype._innerSubscribe=function(i){var x=this,T=this,E=T.hasError,a=T.isStopped,y=T.observers;return E||a?KM:(this.currentObservers=null,y.push(i),new Hm(function(){x.currentObservers=null,xy(y,i)}))},e.prototype._checkFinalizedStatuses=function(i){var x=this,T=x.hasError,E=x.thrownError,a=x.isStopped;T?i.error(E):a&&i.complete()},e.prototype.asObservable=function(){var i=new bs;return i.source=this,i},e.create=function(i,x){return new ZS(i,x)},e}(bs),ZS=function(g){Sd(e,g);function e(i,x){var T=g.call(this)||this;return T.destination=i,T.source=x,T}return e.prototype.next=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.next)===null||T===void 0||T.call(x,i)},e.prototype.error=function(i){var x,T;(T=(x=this.destination)===null||x===void 0?void 0:x.error)===null||T===void 0||T.call(x,i)},e.prototype.complete=function(){var i,x;(x=(i=this.destination)===null||i===void 0?void 0:i.complete)===null||x===void 0||x.call(i)},e.prototype._subscribe=function(i){var x,T;return(T=(x=this.source)===null||x===void 0?void 0:x.subscribe(i))!==null&&T!==void 0?T:KM},e}(ki),_M=new bs(function(g){return g.complete()});function O4(g){return g&&bn(g.schedule)}function qM(g){return g[g.length-1]}function t2(g){return O4(qM(g))?g.pop():void 0}function e2(g,e){return typeof qM(g)=="number"?g.pop():e}var i2=function(g){return g&&typeof g.length=="number"&&typeof g!="function"};function n2(g){return bn(g?.then)}function r2(g){return bn(g[Wx])}function s2(g){return Symbol.asyncIterator&&bn(g?.[Symbol.asyncIterator])}function a2(g){return new TypeError("You provided "+(g!==null&&typeof g=="object"?"an invalid object":"'"+g+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function D4(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var o2=D4();function l2(g){return bn(g?.[o2])}function h2(g){return x4(this,arguments,function(){var e,i,x,T;return YM(this,function(E){switch(E.label){case 0:e=g.getReader(),E.label=1;case 1:E.trys.push([1,,9,10]),E.label=2;case 2:return[4,sf(e.read())];case 3:return i=E.sent(),x=i.value,T=i.done,T?[4,sf(void 0)]:[3,5];case 4:return[2,E.sent()];case 5:return[4,sf(x)];case 6:return[4,E.sent()];case 7:return E.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function u2(g){return bn(g?.getReader)}function Oh(g){if(g instanceof bs)return g;if(g!=null){if(r2(g))return I4(g);if(i2(g))return N4(g);if(n2(g))return B4(g);if(s2(g))return f2(g);if(l2(g))return U4(g);if(u2(g))return z4(g)}throw a2(g)}function I4(g){return new bs(function(e){var i=g[Wx]();if(bn(i.subscribe))return i.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function N4(g){return new bs(function(e){for(var i=0;i{let T=this.tilePosInDirection(new Ot(i,x),g);return this.tilemap.hasBlockingTile(T,e,m4(g),this.ignoreMissingTiles)})}isCharBlocking(g,e){return this.someCharTile((i,x)=>{let T=this.tilePosInDirection(new Ot(i,x),g);return this.tilemap.hasBlockingChar(T,e,this.getCollisionGroups(),new Set([this.getId()]),this.ignoreCollisionGroups)})}isMoving(){return this.movementDirection!="none"}turnTowards(g){this.isMoving()||g!="none"&&this.changeFacingDirection(g)}changeFacingDirection(g){this.facingDirection!==g&&(this.facingDirection=g,this.directionChanged$.next(g))}getFacingDirection(){return this.facingDirection}getFacingPosition(){return this._tilePos.position.add(wh(this.facingDirection))}addCollisionGroup(g){this.collisionGroups.add(g)}setCollisionGroups(g){this.collisionGroups=new Set(g)}setIgnoreCollisionGroups(g){this.ignoreCollisionGroups=new Set(g)}getCollisionGroups(){return Array.from(this.collisionGroups)}getIgnoreCollisionGroups(){return Array.from(this.ignoreCollisionGroups)}hasCollisionGroup(g){return this.collisionGroups.has(g)}removeCollisionGroup(g){this.collisionGroups.delete(g)}removeAllCollisionGroups(){this.collisionGroups.clear()}addLabels(g){for(let e of g)this.labels.add(e)}getLabels(){return[...this.labels.values()]}hasLabel(g){return this.labels.has(g)}clearLabels(){this.labels.clear()}removeLabels(g){for(let e of g)this.labels.delete(e)}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(g){let e=Math.max(0,Math.min(lh,g));this.movementProgress=e}hasWalkedHalfATile(){return this.movementProgress>lh/2}willCrossTileBorderThisUpdate(g){return this.movementProgress+this.maxProgressForDelta(g)>=lh}updateCharacterPosition(g){let e=this.willCrossTileBorderThisUpdate(g),i=1-(e?lh-this.movementProgress:this.maxProgressForDelta(g))/this.maxProgressForDelta(g);this.movementProgress=Math.min(this.movementProgress+this.maxProgressForDelta(g),lh),e&&(this.movementProgress=0,this.shouldContinueMoving()?(this.fire(this.positionChangeFinished$,this.tilePos,this.getNextTilePos()),this.tilePos=this.getNextTilePos(),this.startMoving(this.lastMovementImpulse),i>0&&this.updateCharacterPosition(g*i)):this.stopMoving())}maxProgressForDelta(g){let e=g/1e3;return Math.floor(e*this.speed*lh)}get tilePos(){return Qe.clone(this._tilePos)}set tilePos(g){Qe.copyOver(g,this._tilePos)}startMoving(g){g!=="none"&&(g!=this.movementDirection&&this.movementStarted$.next(g),this.movementDirection=g,this.facingDirection=g,this.fire(this.positionChangeStarted$,this.tilePos,this.getNextTilePos()))}tilePosInDirection(g,e){return g.add(wh(this.tilemap.toMapDirection(e)))}shouldContinueMoving(){return this.lastMovementImpulse!=="none"&&!this.isBlockingDirection(this.lastMovementImpulse)}stopMoving(){if(this.movementDirection==="none")return;let g=this.tilePos,e=this.getNextTilePos(),i=this.movementDirection;this.tilePos=this.getNextTilePos(),this.movementDirection="none",this.movementStopped$.next(i),this.fire(this.positionChangeFinished$,g,e)}fire(g,{position:e,layer:i},{position:x,layer:T}){g.next({exitTile:e,enterTile:x,exitLayer:i,enterLayer:T})}someCharTile(g){let e=this.getNextTilePos().position;for(let i=e.x;ithis.isLayerAlwaysOnTop(T));this.tilemap.layers.filter(T=>!this.isLayerAlwaysOnTop(T)).forEach(T=>{this.hasLayerProp(T,hh.HEIGHT_SHIFT_PROP_NAME)?(this.createHeightShiftLayers(T,i),e.push(T.tilemapLayer)):this.setDepth(T,++i)}),this.charLayerDepths.set(void 0,i),x.forEach((T,E)=>{T.tilemapLayer.setDepth(E+1+i)}),e.forEach(T=>T.destroy())}setDepth(e,i){e.tilemapLayer.setDepth(i),this.isCharLayer(e)&&this.charLayerDepths.set(this.getLayerProp(e,hh.CHAR_LAYER_PROP_NAME),i)}createHeightShiftLayers(e,i){let x=this.getLayerProp(e,hh.HEIGHT_SHIFT_PROP_NAME);isNaN(x)&&(x=0);let T=1;for(let E=0;ET.name==i);return x?.value}hasLayerProp(e,i){return this.getLayerProp(e,i)!=null}copyLayer(e,i){let x=`${e.name}#${i}`,T=this.tilemap.createBlankLayer(x,e.tilemapLayer.tileset);if(T){if(T.name=x,this.isIsometric())for(let E=i;E>=0;E--){let a=i-E;T.putTileAt(e.data[E][a],a,E)}else for(let E=0;Ey===this.charData.id)).subscribe(({direction:y})=>{var t;(t=this.animation)==null||t.setStandingFrame(y)}),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(g){g?(this.sprite&&(g.x=this.sprite.x,g.y=this.sprite.y),this.sprite=g,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(g){var e;this.container=g,this.cachedContainerHeight=(e=g?.getBounds().height)!=null?e:0}getContainer(){return this.container}getOffsetX(){return this.customOffset.x}setOffsetX(g){this.customOffset.x=g}getOffsetY(){return this.customOffset.y}setOffsetY(g){this.customOffset.y=g}getWalkingAnimationMapping(){return this.walkingAnimationMapping}turnTowards(g){var e;this.geHeadless.isMoving(this.charData.id)||g!="none"&&(this.geHeadless.turnTowards(this.charData.id,g),(e=this.animation)==null||e.setStandingFrame(g))}getAnimation(){return this.animation}setAnimation(g){this.animation=g}update(g){this.updateGridChar()}getEngineOffset(){var g,e,i,x;if(!this.sprite)return Ot.ZERO;let T=this.tilemap.getTileWidth()/2-Math.floor(((e=(g=this.sprite)==null?void 0:g.displayWidth)!=null?e:0)/2),E=-((x=(i=this.sprite)==null?void 0:i.displayHeight)!=null?x:0)+this.tilemap.getTileHeight();return new Ot(T,E)}updatePixelPos(){let g=new Ot(this.geHeadless.getPosition(this.charData.id)),e=this.geHeadless.getMovementProgress(this.charData.id)/1e3,i=this.tilemap.tilePosToPixelPos(g).add(this.getEngineOffset()).add(this.customOffset).add(wh(this.geHeadless.getFacingDirection(this.charData.id)).multiply(this.tilemap.getTileDistance(this.geHeadless.getFacingDirection(this.charData.id)).scalarMult(e))),x=this.getGameObj();x&&(x.x=Math.floor(i.x),x.y=Math.floor(i.y))}getGameObj(){return this.container||this.sprite}updateGridChar(){var g;if(this.updatePixelPos(),this.sprite&&this.geHeadless.isMoving(this.charData.id)){let e=this.geHeadless.getMovementProgress(this.charData.id)>lh/2;(g=this.getAnimation())==null||g.updateCharacterFrame(this.geHeadless.getFacingDirection(this.charData.id),e,Number(this.sprite.frame.name))}this.updateDepth()}resetAnimation(g){let e=new JS(this.walkingAnimationMapping,g.texture.source[0].width/g.width/JS.FRAMES_CHAR_ROW);this.setAnimation(e),e.frameChange().pipe(ws(this.newSpriteSet$)).subscribe(i=>{g?.setFrame(i)}),e.setIsEnabled(this.walkingAnimationMapping!==void 0),e.setStandingFrame(this.geHeadless.getFacingDirection(this.charData.id))}updateOverlaySprite(){if(!this.layerOverlaySprite||!this.sprite)return;this.layerOverlaySprite.scale=this.sprite.scale;let g=this.tilemap.getTileHeight()/this.layerOverlaySprite.scale;this.layerOverlaySprite.setCrop(0,0,this.layerOverlaySprite.displayWidth,this.sprite.height-g),this.layerOverlaySprite.setOrigin(0,0)}updateDepth(){if(!this.getGameObj())return;let g=new Ot(this.geHeadless.getPosition(this.charData.id)),e=this.geHeadless.getCharLayer(this.charData.id);this.container?this.setContainerDepth(this.container,{position:g,layer:e}):this.sprite&&this.setSpriteDepth(this.sprite,{position:g,layer:e});let i=this.getLayerOverlaySprite();if(i){let x=new Ot(al(Gi({},g),{y:g.y-1}));this.setSpriteDepth(i,{position:x,layer:e})}}setSpriteDepth(g,e){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(e))+this.getPaddedPixelDepthSprite(g))}setContainerDepth(g,e){g.setDepth(this.tilemap.getDepthOfCharLayer(this.getTransitionLayer(e))+this.getPaddedPixelDepthContainer(g))}getPaddedPixelDepthContainer(g){return My.shiftPad(g.y+this.cachedContainerHeight,Ay.Z_INDEX_PADDING)}getPaddedPixelDepthSprite(g){return My.shiftPad(g.y+g.displayHeight,Ay.Z_INDEX_PADDING)}getTransitionLayer(g){if(g.layer)return this.geHeadless.getTransition(g.position,g.layer)||g.layer}},tO=(g=>(g.DONT_BLOCK="DONT_BLOCK",g.BLOCK_TWO_TILES="BLOCK_TWO_TILES",g.BLOCK_ONE_TILE_AHEAD="BLOCK_ONE_TILE_AHEAD",g.BLOCK_ONE_TILE_BEHIND="BLOCK_ONE_TILE_BEHIND",g))(tO||{}),y2=(g=>(g.STOP="STOP",g.CLOSEST_REACHABLE="CLOSEST_REACHABLE",g.RETRY="RETRY",g.ALTERNATIVE_TARGETS="ALTERNATIVE_TARGETS",g))(y2||{}),eO=class{distance(g,e){return Zs.manhattanDistance(g,e)}direction(g,e){if(Zs.equal(g,e))return"none";let i=g.clone().subtract(e);return Math.abs(i.x)>Math.abs(i.y)?i.x>0?"left":"right":i.y>0?"up":"down"}neighbors(g){return[new Ot(g.x,g.y+1),new Ot(g.x+1,g.y),new Ot(g.x-1,g.y),new Ot(g.x,g.y-1)]}getDirections(){return["up","right","down","left"]}},iO=class{distance(g,e){return Zs.chebyshevDistance(g,e)}neighbors(g){let e=[new Ot(g.x,g.y+1),new Ot(g.x+1,g.y),new Ot(g.x-1,g.y),new Ot(g.x,g.y-1)],i=[new Ot(g.x+1,g.y+1),new Ot(g.x+1,g.y-1),new Ot(g.x-1,g.y+1),new Ot(g.x-1,g.y-1)];return[...e,...i]}direction(g,e){return e.x>g.x?e.y>g.y?"down-right":e.yg.y?"down-left":e.yg.y?"down":"none"}getDirections(){return["up","right","down","left","down-left","down-right","up-right","up-left"]}},Zc=class{static create(g){switch(g){case 4:return new eO;case 8:return new iO}}},$S=class{constructor(g,e,i){this.backoffMs=g,this.maxRetries=e,this.onFinished=i,this.retries=0,this.elapsed=0}retry(g,e){this.shouldRetry()?(this.elapsed+=g,this.elapsed>=this.backoffMs&&(this.elapsed=0,this.retries++,e())):this.onFinished()}reset(){this.retries=0,this.elapsed=0}getMaxRetries(){return this.maxRetries}getBackoffMs(){return this.backoffMs}shouldRetry(){return this.maxRetries===-1||this.retries(g.WAIT="WAIT",g.RETRY="RETRY",g.STOP="STOP",g))(x2||{}),Wm=class{constructor(g,{shortestPathAlgorithm:e="BFS",pathWidth:i=1,pathHeight:x=1,numberOfDirections:T=4,isPositionAllowed:E=(u,f)=>!0,collisionGroups:a=[],ignoredChars:y=[],ignoreTiles:t=!1,ignoreMapBounds:r=!1,ignoreBlockedTarget:p=!1,maxPathLength:h=1/0,ignoreLayers:o=!1,considerCosts:l=!1,calculateClosestToTarget:n=!0}={}){this.gridTilemap=g,this.options={shortestPathAlgorithm:e,pathWidth:i,pathHeight:x,numberOfDirections:T,isPositionAllowed:E,collisionGroups:a,ignoredChars:y,ignoreTiles:t,ignoreMapBounds:r,ignoreBlockedTarget:p,maxPathLength:h,ignoreLayers:o,considerCosts:l,calculateClosestToTarget:n},this.ignoredCharsSet=new Set(y)}findShortestPath(g,e){this.options.ignoreLayers&&(this.gridTilemap.fixCacheLayer(g.layer),e.layer=g.layer);let i=this.findShortestPathImpl(g,e);return this.gridTilemap.unfixCacheLayers(),i}getNeighbors(g,e){var i;return Zc.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position).map(x=>{let T=g.layer;return this.options.ignoreLayers||(T=this.gridTilemap.getTransition(x,g.layer)),{position:x,layer:T||g.layer}}).filter(x=>!this.isBlocking(g,x)||this.options.ignoreBlockedTarget&&Qe.equal(x,e))}getTransition(g,e){if(!this.options.ignoreLayers)return this.gridTilemap.getTransition(g,e)}getCosts(g,e){if(!this.options.considerCosts)return 1;let i=Rs(e.position,g);return this.gridTilemap.getTileCosts(e,i)}isBlocking(g,e){return!(this.options.ignoreMapBounds||this.gridTilemap.isInRange(e.position))||!this.options.isPositionAllowed(e.position,e.layer)||!this.options.ignoreTiles&&this.hasBlockingTileFrom(g,e,this.options.pathWidth,this.options.pathHeight,this.options.ignoreMapBounds,this.gridTilemap)?!0:this.hasBlockingCharFrom(g,e,this.options.pathWidth,this.options.pathHeight,this.options.collisionGroups,this.ignoredCharsSet,this.gridTilemap)}distance(g,e){return(this.options.numberOfDirections===4?Zs.manhattanDistance:Zs.chebyshevDistance)(g,e)}getTilePosInDir(g,e){return this.options.ignoreLayers?{position:g.position.add(wh(this.gridTilemap.toMapDirection(e))),layer:g.layer}:this.gridTilemap.getTilePosInDirection(g,e)}getReverseNeighbors(g,e){var i;let x=Zc.create((i=this.options.numberOfDirections)!=null?i:4).neighbors(g.position),T;if(!this.options.ignoreLayers){let E=this.gridTilemap.getReverseTransitions(g.position,g.layer);T=E?[...E]:void 0}return x.map(E=>T?T.map(a=>({position:E,layer:a||g.layer})):[{position:E,layer:g.layer}]).flat().filter(E=>!this.isBlocking(E,g)||this.options.ignoreBlockedTarget&&Qe.equal(g,e))}hasBlockingCharFrom(g,e,i,x,T,E,a){if(i===1&&x===1)return a.hasBlockingChar(e.position,e.layer,T,E);let y=r=>a.hasBlockingChar(r,e.layer,T,E),t=Rs(g.position,e.position);return this.isBlockingMultiTile(g,t,i,x,y)}hasBlockingTileFrom(g,e,i,x,T,E){if(i===1&&x===1)return E.hasBlockingTile(e.position,e.layer,Rs(e.position,g.position),T);let a=Rs(g.position,e.position),y=t=>E.hasBlockingTile(t,e.layer,a,T);return this.isBlockingMultiTile(g,a,i,x,y)}isBlockingMultiTile(g,e,i,x,T){let E={src:new Ot(g.position.x+i,g.position.y),dest:new Ot(g.position.x+i,g.position.y+x-1)},a={src:new Ot(g.position.x-1,g.position.y),dest:new Ot(g.position.x-1,g.position.y+x-1)},y={src:new Ot(g.position.x,g.position.y-1),dest:new Ot(g.position.x+i-1,g.position.y-1)},t={src:new Ot(g.position.x,g.position.y+x),dest:new Ot(g.position.x+i-1,g.position.y+x)};switch(e){case"right":return this.checkLine(E,T);case"left":return this.checkLine(a,T);case"up":return this.checkLine(y,T);case"down":return this.checkLine(t,T);case"up-left":return this.checkLine({src:y.src,dest:new Ot(y.dest.x-1,y.dest.y)},T)||this.checkLine({src:new Ot(a.src.x,a.src.y-1),dest:new Ot(a.dest.x,a.dest.y-1)},T);case"up-right":return this.checkLine({src:new Ot(y.src.x+1,y.src.y),dest:y.dest},T)||this.checkLine({src:new Ot(E.src.x,E.src.y-1),dest:new Ot(E.dest.x,E.dest.y-1)},T);case"down-left":return this.checkLine({src:new Ot(a.src.x,a.src.y+1),dest:new Ot(a.dest.x,a.dest.y+1)},T)||this.checkLine({src:t.src,dest:new Ot(t.dest.x-1,t.dest.y)},T);case"down-right":return this.checkLine({src:new Ot(t.src.x+1,t.src.y),dest:t.dest},T)||this.checkLine({src:new Ot(E.src.x,E.src.y+1),dest:new Ot(E.dest.x,E.dest.y+1)},T)}return!1}checkLine(g,e){for(let i=g.src.x;i<=g.dest.x;i++)for(let x=g.src.y;x<=g.dest.y;x++)if(e(new Ot(i,x)))return!0;return!1}},nO=DM(Bx(),1),rO=class extends Wm{findShortestPathImpl(g,e){let i=this.shortestPathBfs(g,e);return{path:this.returnPath(i.previous,g,e),closestToTarget:i.closestToTarget,steps:i.steps,maxPathLengthReached:i.maxPathLengthReached,algorithmUsed:"A_STAR"}}shortestPathBfs(g,e){let i=new Map,x=new Map,T=new Map,E=new nO.MinFibonacciHeap((r,p)=>mc(T,r)-mc(T,p)),a=g,y=this.distance(g.position,e.position),t=0;for(E.push(g),x.set(Qe.toString(g),0),T.set(Qe.toString(g),this.distance(g.position,e.position));E.size>0;){let r=E.pop();if(!r)break;t++;let p=this.distance(r.position,e.position);if(pthis.options.maxPathLength)return{previous:new Map,closestToTarget:a,steps:t,maxPathLengthReached:!0};for(let h of this.getNeighbors(r,e)){let o=mc(x,r)+this.getCosts(r.position,h),l=Qe.toString(h);(!x.has(l)||o0;){let t=T.dequeue();if(y++,!t)break;let{node:r,dist:p}=t;if(p>this.options.maxPathLength)return{previous:new Map,closestToTarget:E,steps:y,maxPathLengthReached:!0};let h=this.distance(r.position,e.position);if(hthis.lastDist)}step(g,e,i){var x;this.lastDist=i;for(let T of g){let E=Qe.toString(T);if(!this.visited.has(E)){this.previous.set(E,e),this.queue.enqueue({node:T,dist:i+1}),this.visited.set(E,i+1);let a=(x=this.otherBfs)==null?void 0:x.visited.get(E);a!==void 0&&a0,T.queue.size()>0);){let t=x.queue.dequeue();if(!t)break;let{node:r,dist:p}=t;if(p+1+(((i=T.queue.peek())==null?void 0:i.dist)||0)>this.options.maxPathLength)return{previous:x.previous,previous2:T.previous,closestToTarget:this.maybeClosestToTarget(a),steps:E,maxPathLengthReached:!0};let h=this.distance(r.position,e.position);if(hgc(this.f,T)-gc(this.f,E)),this.openSet.push(g);let x=Qe.toString(g);for(this.g.set(x,0),this.f.set(x,this.distance(g.position,e.position)),this.maxFrontierSize=Math.max(this.maxFrontierSize,this.openSet.size);this.openSet.size>0;){let T=this.openSet.pop();if(!T)break;if(this.steps++,Qe.equal(T,e))return{previous:i,closestToTarget:e,steps:this.steps,maxPathLengthReached:!1};if(gc(this.g,T)+1>this.options.maxPathLength)return{previous:new Map,closestToTarget:this.closestToTarget,steps:this.steps,maxPathLengthReached:!0};this.updateClosestToTarget(T,e);for(let E of this.getNeighborsInternal(T,i.get(Qe.toString(T)),e)){let a=Qe.toString(E.p),y=gc(this.g,T)+E.dist;(!this.g.has(a)||y({p:E,dist:1}));let x=this.prune(e,g).filter(E=>!this.isBlockingIgnoreTarget(g,E,i)).map(E=>{let a=this.getTransition(E.position,g.layer);return{position:E.position,layer:a||g.layer}}),T=[];for(let E of x)if(this.isHorizontal(g.position,E.position))T.push({p:E,dist:1});else{let a=this.jump(g,E,i,1,Rs(g.position,E.position));a&&T.push(a)}return T}isBlockingIgnoreTarget(g,e,i){return this.isBlocking(g,e)&&!(this.options.ignoreBlockedTarget&&Qe.equal(e,i))}jump(g,e,i,x,T){if(!this.isBlockingIgnoreTarget(g,e,i))return Qe.equal(e,i)?{p:e,dist:x}:x>=this.maxJumpSize?{p:e,dist:x}:this.getTransition(e.position,g.layer)!==void 0?{p:e,dist:x}:this.hasForced(g,e)?{p:e,dist:x}:(this.updateClosestToTarget(e,i),this.jump(e,this.getTilePosInDir(e,T),i,x+1,T))}isHorizontal(g,e){return g.y===e.y}getForced(g,e,i,x,T,E){let a=[],y=g;return(this.blockOrTrans(y,i)||this.blockOrTrans(i,x))&&this.addIfNotBlocked(a,e,x),(this.blockOrTrans(y,T)||this.blockOrTrans(T,E))&&this.addIfNotBlocked(a,e,E),a}hasForced(g,e){let{topLeft:i,downLeft:x,top:T,bottom:E}=this.normalizedPositions(g,e);return!!((this.blockOrTrans(g,x)||this.blockOrTrans(x,E))&&!this.blockOrTrans(e,E)||(this.blockOrTrans(g,i)||this.blockOrTrans(i,T))&&!this.blockOrTrans(e,T))}prune(g,e){let{right:i,top:x,bottom:T,downLeft:E,topLeft:a}=this.normalizedPositions(g,e);return this.isHorizontal(g.position,e.position)?[i,x,T]:[i,...this.getForced(g,e,E,T,a,x)]}normalizedPositions(g,e){return g.position.xe.position.x?{topLeft:{position:new Ot(e.position.x+1,e.position.y+1),layer:e.layer},downLeft:{position:new Ot(e.position.x+1,e.position.y-1),layer:e.layer},top:{position:new Ot(e.position.x,e.position.y+1),layer:e.layer},bottom:{position:new Ot(e.position.x,e.position.y-1),layer:e.layer},right:{position:new Ot(e.position.x-1,e.position.y),layer:e.layer}}:g.position.y1?this.fillPath(T,E,x):x.push(E),T=E}return x.reverse()}fillPath(g,e,i){let x=g;do{let T=Rs(x.position,e.position);x=this.getTilePosInDir(x,T),i.push(x)}while(!Zs.equal(x.position,e.position))}};function gc(g,e){var i;return(i=g.get(Qe.toString(e)))!=null?i:Number.MAX_VALUE}var aO=class{constructor(g,e,i,x={}){this.character=g,this.gridTilemap=e,this.charToFollow=i;let T={distance:0,noPathFoundStrategy:"STOP",maxPathLength:1/0,shortestPathAlgorithm:"BIDIRECTIONAL_SEARCH",ignoreLayers:!1,considerCosts:x.considerCosts||!1,facingDirection:"none"};this.options=Gi(Gi({},T),x),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=g,this.updateTarget(this.charToFollow.getTilePos().position,this.charToFollow.getTilePos().layer),this.charToFollow.positionChangeStarted().pipe(ws(this.character.autoMovementSet().pipe(ol(E=>E!==this),mf(1)))).subscribe(({enterTile:E,enterLayer:a})=>{this.updateTarget(E,a)})}update(g){var e;(e=this.targetMovement)==null||e.update(g)}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 g=rm[this.options.facingDirection]+rm[this.charToFollow.getFacingDirection()],e=XM("up",g),i={x:this.charToFollow.getTilePos().position.x,y:this.charToFollow.getTilePos().position.y};return e==="right"?i.x+=this.charToFollow.getTileWidth()-1:e==="down"?i.y+=this.charToFollow.getTileWidth()-1:e==="down-left"?i.y+=this.charToFollow.getTileWidth()-1:e==="down-right"?(i.y+=this.charToFollow.getTileWidth()-1,i.x+=this.charToFollow.getTileWidth()-1):e==="up-right"&&(i.x+=this.charToFollow.getTileWidth()-1),this.gridTilemap.getTilePosInDirection({position:new Ot(i),layer:this.charToFollow.getTilePos().layer},e).position}updateTarget(g,e){let i=this.options.facingDirection!=="none"&&this.options.distance===0;i&&(g=this.getFacingPos()),this.targetMovement=new w2(this.character,this.gridTilemap,{position:new Ot(g),layer:e},{distance:i?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()]}})}},eT=class{static getRandomInt(g){return Math.floor(Math.random()*Math.floor(g))}},oO=class{constructor(g,e=0,i=-1){this.character=g,this.delay=e,this.radius=i,this.stepSize=0,this.delayLeft=this.delay,this.initialRow=g.getNextTilePos().position.y,this.initialCol=g.getNextTilePos().position.x,this.randomizeStepSize(),this.stepsWalked=0,this.currentMovementDirection="none",this.character.positionChangeStarted().pipe(ws(this.character.autoMovementSet().pipe(ol(x=>x!==this),mf(1)))).subscribe(()=>{this.stepsWalked++}),this.distanceUtils=Zc.create(g.getNumberOfDirections())}update(g){if(this.shouldContinueWalkingCurrentDirection())this.character.move(this.currentMovementDirection);else if(this.delayLeft-=g,this.delayLeft<=0){this.delayLeft=this.delay;let e=this.getFreeRandomDirection();this.stepsWalked=0,this.character.move(e),this.currentMovementDirection=e,this.randomizeStepSize()}}getInfo(){return{type:"Random",config:{delay:this.delay,radius:this.radius}}}shouldContinueWalkingCurrentDirection(){return this.stepsWalked!this.character.isBlockingDirection(g)).filter(g=>this.isWithinRadius(g))}isWithinRadius(g){return this.radius==-1?!0:this.getDist(g)<=this.radius}getDist(g){return this.distanceUtils.distance(this.character.getNextTilePos().position.add(wh(g)),new Ot(this.initialCol,this.initialRow))}getFreeRandomDirection(){let g=this.getFreeDirections();return g.length==0?"none":g[eT.getRandomInt(g.length)]}randomizeStepSize(){this.stepSize=eT.getRandomInt(this.radius)+1}};function lO(g,e){return g.filter(i=>{var x,T,E,a,y,t;return(x=e.labels)!=null&&x.withAllLabels?(T=e.labels)==null?void 0:T.withAllLabels.every(r=>i.hasLabel(r)):(E=e.labels)!=null&&E.withOneOfLabels?(a=e.labels)==null?void 0:a.withOneOfLabels.some(r=>i.hasLabel(r)):(y=e.labels)!=null&&y.withNoneLabels?!((t=e.labels)!=null&&t.withNoneLabels.some(r=>i.hasLabel(r))):!0})}var E2="2.44.6",hO=class{constructor(g,e){this.collistionStrategy=g,this.collisionGroupRelation=e,this.tilePosToCharacters=new uO,this.charRemoved$=new ki}isCharBlockingAt(g,e,i,x=new Set,T=new Set){if(i.length===0)return!1;let E=this.tilePosToCharacters.get(g,e);return!!(E&&E.size>0&&[...E].filter(a=>!x.has(a.getId())).filter(a=>!this.doIntersect(a.getCollisionGroups(),T)).some(a=>i.some(y=>a.getCollisionGroups().some(t=>this.collidesWith(y,t)))))}doIntersect(g,e){for(let i of g)if(e.has(i))return!0;return!1}collidesWith(g,e){return this.collisionGroupRelation?(this.collisionGroupRelation.get(g)||new Set).has(e):g===e}getCharactersAt(g,e){return this.tilePosToCharacters.get(g,e)||new Set}addCharacter(g){this.addTilePositions(g.getTilePos(),g),this.addTilePositions(g.getNextTilePos(),g),this.addPositionChangeSub(g),this.addPositionChangeFinishedSub(g),this.addTilePosSetSub(g)}removeCharacter(g){let e=g.getId();this.charRemoved$.next(e),this.deleteTilePositions(g.getTilePos(),g),this.deleteTilePositions(g.getNextTilePos(),g)}add(g,e,i){let x=this.tilePosToCharacters.get(g,e);x||this.tilePosToCharacters.set(g,e,new Set([i])),x?.add(i)}addTilePosSetSub(g){g.tilePositionSet().pipe(ws(this.charRemoved(g.getId()))).subscribe(e=>{this.deleteTilePositions(g.getNextTilePos(),g),this.addTilePositions(e,g)})}charRemoved(g){var e;return(e=this.charRemoved$)==null?void 0:e.pipe(mf(1),ol(i=>i==g))}addPositionChangeSub(g){g.positionChangeStarted().pipe(ws(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(e=>{this.collistionStrategy==="BLOCK_ONE_TILE_AHEAD"&&this.deleteTilePositions(e.exit,g),this.addTilePositions(e.enter,g)})}addPositionChangeFinishedSub(g){g.positionChangeFinished().pipe(ws(this.charRemoved(g.getId())),this.posChangeToLayerPos()).subscribe(e=>{this.deleteTilePositions(e.exit,g),this.addTilePositions(e.enter,g)})}addTilePositions(g,e){this.forEachCharTile(g,e,(i,x)=>{this.add(new Ot(i,x),g.layer,e)})}deleteTilePositions(g,e){this.forEachCharTile(g,e,(i,x)=>{var T;(T=this.tilePosToCharacters.get(new Ot(i,x),g.layer))==null||T.delete(e)})}forEachCharTile(g,e,i){let x=g.position;for(let T=x.x;T({enter:{position:new Ot(g.enterTile),layer:g.enterLayer},exit:{position:new Ot(g.exitTile),layer:g.exitLayer}})))}posToString(g,e){return`${g.x}#${g.y}#${e}`}},uO=class{constructor(){this.memo=new Map}set(g,e,i){let x=this.memo.get(g.x);x||(x=new Map,this.memo.set(g.x,x));let T=x.get(g.y);T||(T=new Map,x.set(g.y,T)),T.set(e,i)}get(g,e){let i=this.memo.get(g.x);if(!i)return;let x=i.get(g.y);if(x)return x.get(e)}},Xx=class{constructor(g,e,i,x){this.x=g,this.y=e,this.width=i,this.height=x}getX(){return this.x}getY(){return this.y}getWidth(){return this.width}getHeight(){return this.height}isInRange(g){return g.x>=this.x&&g.x=this.y&&g.yi.isCharLayer());for(let i of[...e,void 0]){let x=this.tileCollisionCache.get(i?.getName());if(x===void 0){x=new Array(this.tilemap.getWidth());for(let T=0;T>e&1)==1}var nT="ge_cost",M2=class C2{constructor(e,i,x,T=void 0,E=!1){this.tilemap=e,this.collisionTilePropertyName=i,this.useTileCollisionCache=E,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 hO(x,T);for(let a of Vx())this.collidesPropNames.set(a,C2.ONE_WAY_COLLIDE_PROP_PREFIX+a),this.tileCostPropNames.set(a,`${nT}_${a}`);this.useTileCollisionCache&&(this.tileCollisionCache=new cO(e,this),this.tileCollisionCache.rebuild())}fixCacheLayer(e){var i;(i=this.tileCollisionCache)==null||i.fixLayer(e)}unfixCacheLayers(){var e;(e=this.tileCollisionCache)==null||e.unfixLayers()}addCharacter(e){this.characters.set(e.getId(),e);let i=e.getNextTilePos().layer;i===void 0?e.setTilePosition(al(Gi({},e.getNextTilePos()),{layer:this.getLowestCharLayer()})):this.getCharLayerNames().includes(i)||console.warn(`Char layer '${i}' of character '${e.getId()}' is unknown.`),this.charBlockCache.addCharacter(e)}removeCharacter(e){let i=this.characters.get(e);i&&(this.charBlockCache.removeCharacter(i),this.characters.delete(e))}getCharacters(){return[...this.characters.values()]}getCharactersAt(e,i){return this.charBlockCache.getCharactersAt(e,i)}rebuildTileCollisionCache(e){var i;(i=this.tileCollisionCache)==null||i.rebuild(e)}hasBlockingTileUncached(e,i,x,T){if(!T&&this.hasNoTileUncached(e,i))return!0;let E=this.getCollisionRelevantLayers(i);for(let a of E)if(this.isLayerBlockingAt(a.getName(),e,x))return!0;return!1}hasBlockingTile(e,i,x,T){var E;let a=(E=this.tileCollisionCache)==null?void 0:E.isBlockingFrom(e.x,e.y,i,x,T);return a!==void 0?a:this.hasBlockingTileUncached(e,i,x,T)}getTransition(e,i){let x=this.transitions.get(e.toString());if(x)return x.get(i)}getReverseTransitions(e,i){let x=this.reverseTransitions.get(e.toString());if(x)return x.get(i)}setTransition(e,i,x){var T,E,a,y,t;this.transitions.has(e.toString())||this.transitions.set(e.toString(),new Map),this.reverseTransitions.has(e.toString())||this.reverseTransitions.set(e.toString(),new Map),(T=this.transitions.get(e.toString()))==null||T.set(i,x),(E=this.reverseTransitions.get(e.toString()))!=null&&E.has(x)||(a=this.reverseTransitions.get(e.toString()))==null||a.set(x,new Set),(t=(y=this.reverseTransitions.get(e.toString()))==null?void 0:y.get(x))==null||t.add(i)}getTransitions(){return new Map([...this.transitions].map(([e,i])=>[e,new Map(i)]))}getTileCosts(e,i){let x=this.getCollisionRelevantLayers(e.layer),T=1;for(let E of x)T=Math.max(T,this.getTileCostsForLayer(al(Gi({},e),{layer:E.getName()}),i));return T}getTileCostsForLayer(e,i){let x=this.tilemap.getTileAt(e.position.x,e.position.y,e.layer);return i&&x?.getProperty(this.tileCostPropNames.get(i)||"")||x?.getProperty(nT)||1}hasNoTileUncached(e,i){return!this.getCollisionRelevantLayers(i).some(x=>this.tilemap.hasTileAt(e.x,e.y,x.getName()))}hasNoTile(e,i){var x;let T=(x=this.tileCollisionCache)==null?void 0:x.hasTileAt(e.x,e.y,i);return T!==void 0?T:this.hasNoTileUncached(e,i)}hasBlockingChar(e,i,x,T=new Set,E=new Set){return this.charBlockCache.isCharBlockingAt(e,i,x,T,E)}isInRange(e){return new Xx(0,0,this.tilemap.getWidth(),this.tilemap.getHeight()).isInRange(e)}toMapDirection(e){return this.isIsometric()?v4(e):e}fromMapDirection(e){return this.isIsometric()?XM(e):e}isIsometric(){return this.tilemap.getOrientation()==="isometric"}getTilePosInDirection(e,i){let x=e.position.add(wh(this.toMapDirection(i))),T=this.getTransition(x,e.layer)||e.layer;return{position:x,layer:T}}invalidateFrameCache(){this.collisionRelevantLayersFrameCache.clear()}isLayerBlockingAt(e,i,x){let T=this.tilemap.getTileAt(i.x,i.y,e);return T?!!(T.getProperty(this.collisionTilePropertyName)||x&&T.getProperty(this.collidesPropNames.get(x)||"")):!1}getCharLayerIndexes(){return this.tilemap.getLayers().map((e,i)=>({layer:e,index:i})).filter(({layer:e})=>e.isCharLayer()).map(({index:e})=>e)}findPrevAndCharLayer(e){let i=this.getCharLayerIndexes(),x=this.tilemap.getLayers(),T=i.findIndex(E=>x[E].getProperty(Wv)==e);return T==0?{prevIndex:-1,charLayerIndex:i[T]}:{prevIndex:i[T-1],charLayerIndex:i[T]}}getCollisionRelevantLayers(e){if(!e)return this.tilemap.getLayers();let i=this.collisionRelevantLayersFrameCache.get(e);if(i)return i;let{prevIndex:x,charLayerIndex:T}=this.findPrevAndCharLayer(e),E=this.tilemap.getLayers().slice(x+1,T+1);return this.collisionRelevantLayersFrameCache.set(e,E),E}getLowestCharLayer(){for(let e of this.tilemap.getLayers())if(e.isCharLayer())return e.getProperty(Wv)}getCharLayerNames(){return this.tilemap.getLayers().filter(e=>e.isCharLayer()).map(e=>e.getProperty(Wv)).filter(pO)}};M2.ONE_WAY_COLLIDE_PROP_PREFIX="ge_collide_";var dO=M2;function pO(g){return g!=null}var vO=(g=>(g.REMOVED="REMOVED",g.ADDED="ADDED",g))(vO||{}),mO=(g=>(g.WAIT="WAIT",g.SKIP="SKIP",g.STOP="STOP",g))(mO||{}),gO=class{constructor(g,e){this.character=g,this.tilemap=e,this.queue=new sm,this.finished$=new ki,this.pathBlockedWaitElapsed=0,this.distanceUtils=Zc.create(g.getNumberOfDirections()),this.character.autoMovementSet().pipe(ol(i=>i!==this),mf(1)).subscribe(()=>{this.queue.size()>0&&this.finishMovementTerminated(),this.finished$.complete()})}update(g){(!this.character.isMoving()||this.character.willCrossTileBorderThisUpdate(g))&&this.queue.size()>0&&this.moveCharOnPath(g)}getInfo(){return{type:"Queue"}}enqueue(g,e={}){var i,x,T;let E={pathBlockedStrategy:(i=e.pathBlockedStrategy)!=null?i:"STOP",pathBlockedWaitTimeoutMs:e?.pathBlockedWaitTimeoutMs||-1,ignoreInvalidPositions:(x=e.ignoreInvalidPositions)!=null?x:!1,skipInvalidPositions:(T=e.skipInvalidPositions)!=null?T:!1};for(let a of g){let y={command:a,config:E};if($u(a)){this.queue.enqueue(y);continue}let t=this.queue.peekEnd(),r=t?.command;if(r||(r=this.character.getNextTilePos()),$u(r)){this.queue.enqueue(y);continue}let p=this.distanceUtils.distance(r.position,a.position)===1;(!e.ignoreInvalidPositions||p)&&this.queue.enqueue(y)}}peekAll(){return this.queue.peekAll()}size(){return this.queue.size()}finished(){return this.finished$}clear(){this.queue.clear()}moveCharOnPath(g){let e=this.queue.peek();if(!e)return;let i=e.command,x=e.config;if($u(i)&&(i=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),i)),x.skipInvalidPositions){if(i=this.getNextValidPosition(),!i){this.finishInvalidNextPos(i);return}}else if(!this.isNeighborPos(i)){this.finishInvalidNextPos(i);return}if(this.character.isBlockingDirection(Rs(this.character.getNextTilePos().position,i.position))){if(x.pathBlockedStrategy==="STOP")this.finishPathBlocked(i);else if(x.pathBlockedStrategy==="SKIP"){this.queue.dequeue(),this.moveCharOnPath(g);return}else x.pathBlockedStrategy==="WAIT"&&x.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=g,this.pathBlockedWaitElapsed>=x.pathBlockedWaitTimeoutMs&&this.finishBlockedWaitTimeout(i,x.pathBlockedWaitTimeoutMs));return}this.pathBlockedWaitElapsed=0,this.queue.dequeue(),this.character.move(this.getDir(this.character.getNextTilePos().position,i.position)),this.isLastMovement()&&this.finish("SUCCESS","",i)}getNextValidPosition(){for(var g;this.queue.size()>0;){let e=(g=this.queue.peek())==null?void 0:g.command;if($u(e)&&(e=this.tilemap.getTilePosInDirection(this.character.getNextTilePos(),e)),e&&this.isNeighborPos(e))return e;this.queue.dequeue()}}isLastMovement(){return this.queue.size()===0}isNeighborPos(g){let e=this.distanceUtils.distance(this.character.getNextTilePos().position,g.position)===1,i=this.tilemap.getTransition(g.position,this.character.getNextTilePos().layer);if(this.character.getNextTilePos().layer!==g.layer)return e&&i===g.layer;let x=i!==void 0&&i!==g.layer;return e&&!x}finishMovementTerminated(){this.finish("MOVEMENT_TERMINATED","New automatic movement has been set to character.")}finishInvalidNextPos(g){g?this.finish("INVALID_NEXT_POS",`Position ${this.posToStr(g)} 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(g){this.finish("PATH_BLOCKED",`Position ${this.posToStr(g)} is blocked.`)}finishBlockedWaitTimeout(g,e){this.finish("PATH_BLOCKED_WAIT_TIMEOUT",`Position ${this.posToStr(g)} is blocked and the wait timeout of ${e} ms has been exceeded.`)}finish(g,e="",i=this.character.getNextTilePos()){this.queue=new sm,this.finished$.next({position:i.position,result:g,description:e,layer:i.layer})}getDir(g,e){return this.tilemap.fromMapDirection(Rs(g,e))}posToStr(g){return`(${g.position.x}, ${g.position.y}, ${g.layer})`}},yO=class{constructor(g=!0){this.isCreatedInternal=!1,g&&console.log(`Using GridEngine v${E2}`)}getCharLayer(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().layer}getTransition(g,e){var i;return this.initGuard(),(i=this.gridTilemap)==null?void 0:i.getTransition(new Ot(g),e)}setTransition(g,e,i){var x;return this.initGuard(),(x=this.gridTilemap)==null?void 0:x.setTransition(new Ot(g),e,i)}create(g,e){this.isCreatedInternal=!0,this.gridCharacters=new Map;let i=this.setConfigDefaults(e);this.config=i,this.movementStopped$=new ki,this.movementStarted$=new ki,this.directionChanged$=new ki,this.positionChangeStarted$=new ki,this.positionChangeFinished$=new ki,this.queueMovementFinished$=new ki,this.charRemoved$=new ki,this.charAdded$=new ki,this.gridTilemap=new dO(g,this.config.collisionTilePropertyName,this.config.characterCollisionStrategy,this.recordToMap(this.config.collisionGroupRelation),this.config.cacheTileCollisions),this.addCharacters()}recordToMap(g){return g?new Map(Object.entries(g).map(([e,i])=>[e,new Set(i)])):void 0}getPosition(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getTilePos().position}move(g,e){this.moveChar(g,e)}moveRandomly(g,e=0,i=-1){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);let E=new oO(T,e,i);T.setMovement(E)}getMovement(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getMovement();return x?x.getInfo():{type:"None"}}moveTo(g,e,i){var x;let T=this.assembleMoveToConfig(i);this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let a=new w2(E,this.gridTilemap,{position:new Ot(e),layer:i?.targetLayer||E.getNextTilePos().layer},{distance:0,config:T});return E.setMovement(a),a.finishedObs().pipe(zc(y=>({charId:g,position:y.position,result:y.result,description:y.description,layer:y.layer})))}stopMovement(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);i.setMovement(void 0)}setSpeed(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setSpeed(e)}getSpeed(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getSpeed()}collidesWithTiles(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.collidesWithTiles()}update(g,e){var i;if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(e);(i=this.gridTilemap)==null||i.invalidateFrameCache()}addCharacter(g){var e,i,x,T,E;if(!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let a={speed:g.speed||4,tilemap:this.gridTilemap,collidesWithTiles:!0,collisionGroups:["geDefault"],ignoreCollisionGroups:[],charLayer:g.charLayer,facingDirection:g.facingDirection,labels:g.labels,numberOfDirections:(e=g.numberOfDirections)!=null?e:this.config.numberOfDirections,tileWidth:g.tileWidth,tileHeight:g.tileHeight};typeof g.collides=="boolean"?g.collides===!1&&(a.collidesWithTiles=!1,a.collisionGroups=[]):g.collides!==void 0&&(g.collides.collidesWithTiles===!1&&(a.collidesWithTiles=!1),g.collides.collisionGroups&&(a.collisionGroups=g.collides.collisionGroups),g.collides.ignoreCollisionGroups&&(a.ignoreCollisionGroups=g.collides.ignoreCollisionGroups),a.ignoreMissingTiles=(x=(i=g.collides)==null?void 0:i.ignoreMissingTiles)!=null?x:!1);let y=new _4(g.id,a);g.startPosition&&y.setTilePosition({position:new Ot(g.startPosition),layer:y.getTilePos().layer}),(T=this.gridCharacters)==null||T.set(g.id,y),this.gridTilemap.addCharacter(y);let t=y.getId();y.movementStopped().pipe(ws(this.charRemoved(t))).subscribe(r=>{var p;(p=this.movementStopped$)==null||p.next({charId:t,direction:r})}),y.movementStarted().pipe(ws(this.charRemoved(t))).subscribe(r=>{var p;(p=this.movementStarted$)==null||p.next({charId:t,direction:r})}),y.directionChanged().pipe(ws(this.charRemoved(t))).subscribe(r=>{var p;(p=this.directionChanged$)==null||p.next({charId:t,direction:r})}),y.positionChangeStarted().pipe(ws(this.charRemoved(t))).subscribe(r=>{var p;(p=this.positionChangeStarted$)==null||p.next(Gi({charId:t},r))}),y.positionChangeFinished().pipe(ws(this.charRemoved(t))).subscribe(r=>{var p;(p=this.positionChangeFinished$)==null||p.next(Gi({charId:t},r))}),(E=this.charAdded$)==null||E.next(t)}hasCharacter(g){var e;return this.initGuard(),!!((e=this.gridCharacters)!=null&&e.has(g))}removeCharacter(g){var e,i,x,T;if(this.initGuard(),!((e=this.gridCharacters)!=null&&e.get(g)))throw this.createCharUnknownErr(g);(i=this.gridTilemap)==null||i.removeCharacter(g),(x=this.gridCharacters)==null||x.delete(g),(T=this.charRemoved$)==null||T.next(g)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters)for(let g of this.gridCharacters.keys())this.removeCharacter(g)}getAllCharacters(g){if(this.initGuard(),!this.gridCharacters)return[];let e=[...this.gridCharacters.values()];return(g?lO(e,g):e).map(i=>i.getId())}getLabels(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getLabels()}addLabels(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.addLabels(e)}removeLabels(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.removeLabels(e)}clearLabels(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);i.clearLabels()}follow(g,e,i,x){var T,E,a,y,t,r;let p;i===void 0?p={distance:0,closestPointIfBlocked:!1}:typeof i=="number"?(p={distance:i,closestPointIfBlocked:!1},x&&(p.closestPointIfBlocked=!0)):p=i,this.initGuard();let h=(T=this.gridCharacters)==null?void 0:T.get(g),o=(E=this.gridCharacters)==null?void 0:E.get(e);if(!h)throw this.createCharUnknownErr(g);if(!o)throw this.createCharUnknownErr(e);if(!this.gridTilemap)throw this.createUninitializedErr();let l=new aO(h,this.gridTilemap,o,{distance:(a=p.distance)!=null?a:0,noPathFoundStrategy:p.closestPointIfBlocked?"CLOSEST_REACHABLE":"STOP",maxPathLength:(y=p.maxPathLength)!=null?y:1/0,shortestPathAlgorithm:(t=p.algorithm)!=null?t:"BIDIRECTIONAL_SEARCH",ignoreLayers:!!p.ignoreLayers,facingDirection:(r=p.facingDirection)!=null?r:"none"});h.setMovement(l)}isMoving(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.isMoving()}getFacingDirection(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getFacingDirection()}getFacingPosition(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);let x=i.getFacingPosition();return{x:x.x,y:x.y}}turnTowards(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);return x.turnTowards(e)}getCharactersAt(g,e){if(this.initGuard(),!this.gridTilemap)return[];let i=this.gridTilemap.getCharactersAt(new Ot(g),e);return Array.from(i).map(x=>x.getId())}setPosition(g,e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(g);if(!T)throw this.createCharUnknownErr(g);i||T.setTilePosition({position:new Ot(e),layer:T.getTilePos().layer}),T.setTilePosition({position:new Ot(e),layer:i})}isBlocked(g,e,i=["geDefault"]){var x,T;this.initGuard();let E=new Ot(g);return!!((x=this.gridTilemap)!=null&&x.hasBlockingTile(E,e)||(T=this.gridTilemap)!=null&&T.hasBlockingChar(E,e,i))}isTileBlocked(g,e){var i;return this.initGuard(),!!((i=this.gridTilemap)!=null&&i.hasBlockingTile(new Ot(g),e))}getCollisionGroups(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getCollisionGroups()||[]}setCollisionGroups(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setCollisionGroups(e)}getIgnoreCollisionGroups(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getIgnoreCollisionGroups()||[]}setIgnoreCollisionGroups(g,e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(g);if(!x)throw this.createCharUnknownErr(g);x.setIgnoreCollisionGroups(e)}getTilePosInDirection(g,e,i){if(!this.gridTilemap)throw this.createUninitializedErr();let x=this.gridTilemap.getTilePosInDirection({position:new Ot(g),layer:e},i);return{position:x.position.toPosition(),charLayer:x.layer}}findShortestPath(g,e,i={}){if(!this.gridTilemap)throw this.createUninitializedErr();let x=i.shortestPathAlgorithm||"BFS";i.considerCosts&&x!=="A_STAR"&&console.warn(`GridEngine: Pathfinding option 'considerCosts' cannot be used with algorithm '${x}'. It can only be used with A* algorithm.`);let T=i.pathWidth!==void 0&&i.pathWidth!==1,E=i.pathHeight!==void 0&&i.pathHeight!==1;(T||E)&&x==="JPS"&&console.warn("GridEngine: Pathfinding options 'pathWidth' and 'pathHeight' > 1 cannot be used with algorithm 'JPS'.");let a=new A2(this.gridTilemap).findShortestPath(Qe.toInternal(g),Qe.toInternal(e),al(Gi({},i),{shortestPathAlgorithm:x}));return{path:a.path.map(Qe.fromInternal),closestToTarget:a.closestToTarget?Qe.fromInternal(a.closestToTarget):void 0,reachedMaxPathLength:!1,steps:a.steps}}steppedOn(g,e,i){return this.positionChangeFinished().pipe(ol(x=>g.includes(x.charId)&&e.some(T=>T.x===x.enterTile.x&&T.y===x.enterTile.y)&&(i===void 0||i.includes(x.enterLayer))))}characterShifted(){if(!this.charAdded$||!this.charRemoved$)throw this.createUninitializedErr();return this.charAdded$.pipe(zc(g=>({charId:g,action:"ADDED"})),Q4(this.charRemoved$.pipe(zc(g=>({charId:g,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(g){var e;this.initGuard();let i=(e=this.gridCharacters)==null?void 0:e.get(g);if(!i)throw this.createCharUnknownErr(g);return i.getMovementProgress()}rebuildTileCollisionCache(g,e,i,x){var T;(T=this.gridTilemap)==null||T.rebuildTileCollisionCache(new Xx(g,e,i,x))}addQueueMovements(g,e,i){var x,T;this.initGuard();let E=(x=this.gridCharacters)==null?void 0:x.get(g);if(!E)throw this.createCharUnknownErr(g);if(!this.gridTilemap)throw this.createUninitializedErr();let a;((T=E?.getMovement())==null?void 0:T.getInfo().type)==="Queue"?a=E.getMovement():(a=new gO(E,this.gridTilemap),E.setMovement(a),a.finished().pipe(ws(j4(this.charRemoved(g),E.autoMovementSet()))).subscribe(y=>{var t;(t=this.queueMovementFinished$)==null||t.next(Gi({charId:g},y))})),a.enqueue(e.map(y=>$u(y)?y:{position:new Ot(y.position),layer:y.charLayer}),i)}queueMovementFinished(){if(!this.queueMovementFinished$)throw this.createUninitializedErr();return this.queueMovementFinished$}getEnqueuedMovements(g){var e,i;this.initGuard();let x=(e=this.gridCharacters)==null?void 0:e.get(g);if(!x)throw this.createCharUnknownErr(g);return((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"?x.getMovement().peekAll().map(T=>({command:$u(T.command)?T.command:Qe.fromInternal(T.command),config:T.config})):[]}clearEnqueuedMovements(g){var e,i;this.initGuard();let x=(e=this.gridCharacters)==null?void 0:e.get(g);if(!x)throw this.createCharUnknownErr(g);((i=x.getMovement())==null?void 0:i.getInfo().type)==="Queue"&&x.getMovement().clear()}getTileCost(g,e,i){var x,T;return this.initGuard(),(T=(x=this.gridTilemap)==null?void 0:x.getTileCosts({position:new Ot(g),layer:e},i))!=null?T:1}getState(){let g=[];if(this.gridCharacters)for(let[e,i]of this.gridCharacters.entries())g.push({id:e,position:Qe.fromInternal(i.getTilePos()),facingDirection:i.getFacingDirection(),speed:i.getSpeed(),labels:i.getLabels(),movementProgress:i.getMovementProgress(),collisionConfig:{collisionGroups:i.getCollisionGroups(),ignoreCollisionGroups:i.getIgnoreCollisionGroups(),collidesWithTiles:i.collidesWithTiles(),ignoreMissingTiles:i.getIgnoreMissingTiles()}});return{characters:g}}setState(g){if(this.gridCharacters)for(let e of g.characters){let i=this.gridCharacters.get(e.id);if(i){let x=i.getTilePos();Qe.equal(x,Qe.toInternal(e.position))||i.setTilePosition(Qe.toInternal(e.position)),i.setSpeed(e.speed),i.turnTowards(e.facingDirection),e.collisionConfig.collisionGroups&&i.setCollisionGroups(e.collisionConfig.collisionGroups),e.collisionConfig.collidesWithTiles!==void 0&&i.setCollidesWithTiles(e.collisionConfig.collidesWithTiles),e.collisionConfig.ignoreMissingTiles!==void 0&&i.setIgnoreMissingTiles(e.collisionConfig.ignoreMissingTiles),i.setMovementProgress(e.movementProgress),i.clearLabels(),i.addLabels(e.labels)}}}charRemoved(g){var e;if(!this.charRemoved$)throw this.createUninitializedErr();return(e=this.charRemoved$)==null?void 0:e.pipe(mf(1),ol(i=>i==g))}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var g;(g=this.config)==null||g.characters.forEach(e=>this.addCharacter(e))}moveChar(g,e){var i,x,T;this.initGuard();let E=(i=this.gridCharacters)==null?void 0:i.get(g);if(!E)throw this.createCharUnknownErr(g);if(E.getNumberOfDirections()===4){if(!((x=this.gridTilemap)!=null&&x.isIsometric())&&Uc(e)){console.warn(`GridEngine: Character '${g}' can't be moved '${e}' in 4 direction mode.`);return}else if((T=this.gridTilemap)!=null&&T.isIsometric()&&!Uc(e)){console.warn(`GridEngine: Character '${g}' can't be moved '${e}' in 4 direction isometric mode.`);return}}E.move(e)}createCharUnknownErr(g){return new Error(`Character unknown: ${g}`)}assembleMoveToConfig(g={}){let e=al(Gi({},g),{noPathFoundStrategy:"STOP",pathBlockedStrategy:"WAIT"});return g!=null&&g.noPathFoundStrategy&&(Object.values(y2).includes(g.noPathFoundStrategy)?e.noPathFoundStrategy=g.noPathFoundStrategy:console.warn(`GridEngine: Unknown NoPathFoundStrategy '${g.noPathFoundStrategy}'. Falling back to 'STOP'`)),g!=null&&g.pathBlockedStrategy&&(Object.values(x2).includes(g.pathBlockedStrategy)?e.pathBlockedStrategy=g.pathBlockedStrategy:console.warn(`GridEngine: Unknown PathBlockedStrategy '${g.pathBlockedStrategy}'. Falling back to 'WAIT'`)),e}setConfigDefaults(g){return Gi({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",cacheTileCollisions:!1},g)}},xO=class extends T2{constructor(g,e={}){super(g,e),this.jumpCache=new rT}findShortestPathImpl(g,e){return this.jumpCache=new rT,super.findShortestPathImpl(g,e)}getNeighborsInternal(g,e,i){if(!e||g.layer!==e.layer)return this.getNeighbors(g,i).map(E=>({p:E,dist:1}));let x=this.prune(e,g).map(E=>{let a=this.getTransition(E.position,g.layer);return{position:E.position,layer:a||g.layer}}),T=[];for(let E of x){let a=this.jump(g,E,i,1,Rs(g.position,E.position));a&&(a.dist=this.distance(g.position,a.p.position),T.push(a))}return T}getForced(g,e){let i=[],{topLeft:x,downLeft:T,top:E,bottom:a,topRight:y,downRight:t}=this.normalizedPositions(g,e),r=Rs(g.position,e.position);return Uc(r)?(this.blockOrTrans(g,x)&&(this.addIfNotBlocked(i,e,E),this.addIfNotBlocked(i,e,y),this.blockOrTrans(T,x)&&this.addIfNotBlocked(i,e,x)),this.blockOrTrans(g,T)&&(this.addIfNotBlocked(i,e,a),this.addIfNotBlocked(i,e,t),this.blockOrTrans(x,T)&&this.addIfNotBlocked(i,e,T)),this.blockOrTrans(x,E)&&this.addIfNotBlocked(i,e,E),this.blockOrTrans(T,a)&&this.addIfNotBlocked(i,e,a),this.blockOrTrans(x,y)&&this.addIfNotBlocked(i,e,y),this.blockOrTrans(T,t)&&this.addIfNotBlocked(i,e,t)):((this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&this.addIfNotBlocked(i,e,y),(this.blockOrTrans(g,a)||this.blockOrTrans(a,t))&&this.addIfNotBlocked(i,e,t),this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(this.addIfNotBlocked(i,e,E),this.addIfNotBlocked(i,e,x)),this.blockOrTrans(g,T)&&this.blockOrTrans(g,a)&&(this.addIfNotBlocked(i,e,a),this.addIfNotBlocked(i,e,T)),this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&this.addIfNotBlocked(i,e,E),this.blockOrTrans(T,a)&&this.blockOrTrans(g,a)&&this.addIfNotBlocked(i,e,a)),i}hasForced(g,e){let{topLeft:i,downLeft:x,top:T,bottom:E,topRight:a,downRight:y}=this.normalizedPositions(g,e),t=Rs(g.position,e.position);if(Uc(t)){if(this.blockOrTrans(g,i)&&(!this.blockOrTrans(e,T)||!this.blockOrTrans(e,a)||this.blockOrTrans(x,i)&&!this.blockOrTrans(e,i))||this.blockOrTrans(g,x)&&(!this.blockOrTrans(e,E)||!this.blockOrTrans(e,y)||this.blockOrTrans(i,x)&&!this.blockOrTrans(e,x))||this.blockOrTrans(i,T)&&!this.blockOrTrans(e,T)||this.blockOrTrans(x,E)&&!this.blockOrTrans(e,E)||this.blockOrTrans(i,a)&&!this.blockOrTrans(e,a)||this.blockOrTrans(x,y)&&!this.blockOrTrans(e,y))return!0}else if((this.blockOrTrans(g,T)||this.blockOrTrans(T,a))&&!this.blockOrTrans(e,a)||(this.blockOrTrans(g,E)||this.blockOrTrans(E,y))&&!this.blockOrTrans(e,y)||this.blockOrTrans(g,i)&&this.blockOrTrans(g,T)&&(!this.blockOrTrans(e,T)||!this.blockOrTrans(e,i))||this.blockOrTrans(g,x)&&this.blockOrTrans(g,E)&&(!this.blockOrTrans(e,E)||!this.blockOrTrans(e,x))||this.blockOrTrans(i,T)&&this.blockOrTrans(g,T)&&!this.blockOrTrans(e,T)||this.blockOrTrans(x,E)&&this.blockOrTrans(g,E)&&!this.blockOrTrans(e,E))return!0;return!1}prune(g,e){let{top:i,right:x,topRight:T,downRight:E,bottom:a}=this.normalizedPositions(g,e),y=this.getForced(g,e),t=Rs(g.position,e.position);return Uc(t)?[i,x,T,E,a,...y]:[x,...y]}jump(g,e,i,x,T){let E=this.jumpCache.get(g,e);if(E!==null)return E;if(this.isBlocking(g,e)&&!(Qe.equal(e,i)&&this.options.ignoreBlockedTarget)){this.jumpCache.set(g,e,void 0);return}if(Qe.equal(e,i))return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(x>=this.maxJumpSize)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.getTransition(e.position,g.layer)!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.hasForced(g,e))return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.updateClosestToTarget(e,i),T==="up-left"){if(this.jump(e,this.getTilePosInDir(e,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.jump(e,this.getTilePosInDir(e,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0}}else if(T==="down-left"){if(this.jump(e,this.getTilePosInDir(e,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.jump(e,this.getTilePosInDir(e,"left"),i,x+1,"left")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0}}else if(T==="up-right"){if(this.jump(e,this.getTilePosInDir(e,"up"),i,x+1,"up")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.jump(e,this.getTilePosInDir(e,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0}}else if(T==="down-right"){if(this.jump(e,this.getTilePosInDir(e,"down"),i,x+1,"down")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0};if(this.jump(e,this.getTilePosInDir(e,"right"),i,x+1,"right")!==void 0)return this.jumpCache.set(g,e,{p:e,dist:0}),{p:e,dist:0}}let a=this.jump(e,this.getTilePosInDir(e,T),i,x+1,T);return this.jumpCache.set(g,e,a),a}normalizedPositions(g,e){return g.position.xe.position.x&&g.position.y===e.position.y?{topLeft:{position:new Ot(e.position.x+1,e.position.y+1),layer:e.layer},downLeft:{position:new Ot(e.position.x+1,e.position.y-1),layer:e.layer},top:{position:new Ot(e.position.x,e.position.y+1),layer:e.layer},bottom:{position:new Ot(e.position.x,e.position.y-1),layer:e.layer},right:{position:new Ot(e.position.x-1,e.position.y),layer:e.layer},topRight:{position:new Ot(e.position.x-1,e.position.y+1),layer:e.layer},downRight:{position:new Ot(e.position.x-1,e.position.y-1),layer:e.layer}}:g.position.ye.position.y&&g.position.x===e.position.x?{topLeft:{position:new Ot(e.position.x-1,e.position.y+1),layer:e.layer},downLeft:{position:new Ot(e.position.x+1,e.position.y+1),layer:e.layer},top:{position:new Ot(e.position.x-1,e.position.y),layer:e.layer},bottom:{position:new Ot(e.position.x+1,e.position.y),layer:e.layer},right:{position:new Ot(e.position.x,e.position.y-1),layer:e.layer},topRight:{position:new Ot(e.position.x-1,e.position.y-1),layer:e.layer},downRight:{position:new Ot(e.position.x+1,e.position.y-1),layer:e.layer}}:g.position.ye.position.x?{topLeft:{position:new Ot(e.position.x+1,e.position.y),layer:e.layer},downLeft:{position:new Ot(e.position.x,e.position.y-1),layer:e.layer},top:{position:new Ot(e.position.x+1,e.position.y+1),layer:e.layer},bottom:{position:new Ot(e.position.x-1,e.position.y-1),layer:e.layer},right:{position:new Ot(e.position.x-1,e.position.y+1),layer:e.layer},topRight:{position:new Ot(e.position.x,e.position.y+1),layer:e.layer},downRight:{position:new Ot(e.position.x-1,e.position.y),layer:e.layer}}:g.position.y>e.position.y&&g.position.x(g.SUCCESS="SUCCESS",g.NO_PATH_FOUND_MAX_RETRIES_EXCEEDED="NO_PATH_FOUND_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED_MAX_RETRIES_EXCEEDED="PATH_BLOCKED_MAX_RETRIES_EXCEEDED",g.PATH_BLOCKED="PATH_BLOCKED",g.NO_PATH_FOUND="NO_PATH_FOUND",g.PATH_BLOCKED_WAIT_TIMEOUT="PATH_BLOCKED_WAIT_TIMEOUT",g.MOVEMENT_TERMINATED="MOVEMENT_TERMINATED",g.MAX_PATH_LENGTH_REACHED="MAX_PATH_LENGTH_REACHED",g))(TO||{}),w2=class{constructor(g,e,i,{config:x,ignoreBlockedTarget:T=!1,distance:E=0}={}){this.character=g,this.tilemap=e,this.targetPos=i,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,r)=>t?new S2(this.tilemap,this.getPathfindingOptions()).isBlocking(this.character.getTilePos(),{position:t,layer:r}):!0;var a,y;this.shortestPathAlgorithm=(a=x?.algorithm)!=null?a:this.shortestPathAlgorithm,this.ignoreBlockedTarget=T,this.distance=E,this.noPathFoundStrategy=x?.noPathFoundStrategy||"STOP",this.pathBlockedStrategy=x?.pathBlockedStrategy||"WAIT",this.noPathFoundRetryable=new $S(x?.noPathFoundRetryBackoffMs||200,x?.noPathFoundMaxRetries||-1,()=>{this.stop("NO_PATH_FOUND_MAX_RETRIES_EXCEEDED")}),this.pathBlockedRetryable=new $S(x?.pathBlockedRetryBackoffMs||200,x?.pathBlockedMaxRetries||-1,()=>{this.stop("PATH_BLOCKED_MAX_RETRIES_EXCEEDED")}),x!=null&&x.isPositionAllowedFn&&(this.isPositionAllowed=x.isPositionAllowedFn),x!=null&&x.maxPathLength&&(this.maxPathLength=x.maxPathLength),this.alternativeTargets=x?.alternativeTargets,this.noPathFoundAlternativeTargetsFallbackStrategy=x?.noPathFoundAlternativeTargetsFallbackStrategy,x!=null&&x.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=x?.considerCosts||!1,this.ignoreLayers=!!(x!=null&&x.ignoreLayers),this.distanceUtils=Zc.create(g.getNumberOfDirections()),this.pathBlockedWaitTimeoutMs=x?.pathBlockedWaitTimeoutMs||-1,this.ignoredChars=(y=x?.ignoredChars)!=null?y:[],this.finished$=new ki,this.setCharacter(g)}setPathBlockedStrategy(g){this.pathBlockedStrategy=g}getPathBlockedStrategy(){return this.pathBlockedStrategy}setCharacter(g){this.character=g,this.noPathFoundRetryable.reset(),this.pathBlockedRetryable.reset(),this.pathBlockedWaitElapsed=0,this.calcShortestPath(),this.character.autoMovementSet().pipe(ol(e=>e!==this),mf(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(g){var e,i,x,T;this.stopped||(this.noPathFound()&&(this.noPathFoundStrategy==="RETRY"?this.noPathFoundRetryable.retry(g,()=>this.calcShortestPath()):this.noPathFoundStrategy==="STOP"&&this.stop("NO_PATH_FOUND")),this.updatePosOnPath(),this.isBlocking((e=this.nextTileOnPath())==null?void 0:e.position,(i=this.character)==null?void 0:i.getNextTilePos().layer)?this.applyPathBlockedStrategy(g):this.pathBlockedWaitElapsed=0,this.hasArrived()?(this.stop("SUCCESS"),this.existsDistToTarget()&&this.turnTowardsTarget()):this.isBlocking((x=this.nextTileOnPath())==null?void 0:x.position,(T=this.character)==null?void 0:T.getNextTilePos().layer)||this.moveCharOnPath())}finishedObs(){return this.finished$}getInfo(){return{type:"Target",state:{pathAhead:this.shortestPath.slice(this.posOnPath).map(g=>Qe.fromInternal(g))},config:{algorithm:this.shortestPathAlgorithm,ignoreBlockedTarget:this.ignoreBlockedTarget,distance:this.distance,targetPos:Qe.fromInternal(this.targetPos),noPathFoundStrategy:this.noPathFoundStrategy,pathBlockedStrategy:this.pathBlockedStrategy,noPathFoundRetryBackoffMs:this.noPathFoundRetryable.getBackoffMs(),noPathFoundMaxRetries:this.noPathFoundRetryable.getMaxRetries()}}}resultToReason(g){switch(g){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(g){this.pathBlockedStrategy==="RETRY"?this.pathBlockedRetryable.retry(g,()=>{let e=this.getShortestPath();e.path.length>0&&this.calcShortestPath(e)}):this.pathBlockedStrategy==="STOP"?this.stop("PATH_BLOCKED"):this.pathBlockedStrategy==="WAIT"&&this.pathBlockedWaitTimeoutMs>-1&&(this.pathBlockedWaitElapsed+=g,this.pathBlockedWaitElapsed>=this.pathBlockedWaitTimeoutMs&&this.stop("PATH_BLOCKED_WAIT_TIMEOUT"))}moveCharOnPath(){let g=this.nextTileOnPath();if(!g)return;let e=this.getDir(this.character.getNextTilePos().position,g.position);this.character.move(e)}nextTileOnPath(){return this.shortestPath[this.posOnPath+1]}stop(g){this.finished$.next({position:this.character.getTilePos().position,result:g,description:this.resultToReason(g),layer:this.character.getTilePos().layer}),this.finished$.complete(),this.stopped=!0}turnTowardsTarget(){let g=this.shortestPath[this.posOnPath+1],e=this.getDir(this.character.getNextTilePos().position,g.position);this.character.turnTowards(e)}existsDistToTarget(){return this.posOnPath=this.shortestPath.length-1}updatePosOnPath(){let g=this.shortestPath[this.posOnPath];for(;this.posOnPath0)return{path:E,distOffset:a}}return this.noPathFoundStrategy=this.noPathFoundAlternativeTargetsFallbackStrategy||"STOP",this.getShortestPath()}}return{path:i,distOffset:0}}pathToAlternativeTarget(g,e){let i=e.findShortestPath(this.character.getNextTilePos(),g,this.getPathfindingOptions()).path,x=this.distanceUtils.distance(g.position,this.targetPos.position);return{path:i,distOffset:x}}getDir(g,e){return this.tilemap.fromMapDirection(this.distanceUtils.direction(g,e))}},EO=Object.create,P2=Object.defineProperty,MO=Object.getOwnPropertyDescriptor,CO=Object.getOwnPropertyNames,AO=Object.getPrototypeOf,wO=Object.prototype.hasOwnProperty,PO=(g,e)=>()=>(e||g((e={exports:{}}).exports,e),e.exports),RO=(g,e,i,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let T of CO(e))!wO.call(g,T)&&T!==i&&P2(g,T,{get:()=>e[T],enumerable:!(x=MO(e,T))||x.enumerable});return g},Yx=(g,e,i)=>(i=g!=null?EO(AO(g)):{},RO(e||!g||!g.__esModule?P2(i,"default",{value:g,enumerable:!0}):i,g)),kx=PO((g,e)=>{(function(){var i,x="4.17.21",T=200,E="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",y="Invalid `variable` option passed into `_.template`",t="__lodash_hash_undefined__",r=500,p="__lodash_placeholder__",h=1,o=2,l=4,n=1,u=2,f=1,s=2,c=4,d=8,v=16,m=32,S=64,M=128,A=256,C=512,w=30,P="...",L=800,O=16,I=1,D=2,B=3,G=1/0,z=9007199254740991,W=17976931348623157e292,k=NaN,J=4294967295,Q=J-1,Y=J>>>1,K=[["ary",M],["bind",f],["bindKey",s],["curry",d],["curryRight",v],["flip",C],["partial",m],["partialRight",S],["rearg",A]],U="[object Arguments]",V="[object Array]",j="[object AsyncFunction]",$="[object Boolean]",q="[object Date]",it="[object DOMException]",nt="[object Error]",et="[object Function]",ht="[object GeneratorFunction]",ut="[object Map]",dt="[object Number]",mt="[object Null]",gt="[object Object]",At="[object Promise]",ot="[object Proxy]",st="[object RegExp]",yt="[object Set]",Tt="[object String]",wt="[object Symbol]",Et="[object Undefined]",Gt="[object WeakMap]",Wt="[object WeakSet]",Jt="[object ArrayBuffer]",$t="[object DataView]",ee="[object Float32Array]",Nt="[object Float64Array]",Te="[object Int8Array]",le="[object Int16Array]",ce="[object Int32Array]",se="[object Uint8Array]",ie="[object Uint8ClampedArray]",Ce="[object Uint16Array]",Xe="[object Uint32Array]",si=/\b__p \+= '';/g,Be=/\b(__p \+=) '' \+/g,ri=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xt=/&(?:amp|lt|gt|quot|#39);/g,_t=/[&<>"']/g,qt=RegExp(xt.source),ve=RegExp(_t.source),Me=/<%-([\s\S]+?)%>/g,fi=/<%([\s\S]+?)%>/g,pi=/<%=([\s\S]+?)%>/g,$i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jn=/^\w*$/,mi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,Pr=RegExp(rn.source),wa=/^\s+/,vl=/\s/,uo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qs=/\{\n\/\* \[wrapped with (.+)\] \*/,fo=/,? & /,zh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Gh=/[()=,{}\[\]\/\s]/,Cf=/\\(\\)?/g,Af=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Vh=/\w*$/,ct=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,Bt=/^\[object .+?Constructor\]$/,zt=/^0o[0-7]+$/i,Dt=/^(?:0|[1-9]\d*)$/,he=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,me=/($^)/,Re=/['\n\r\u2028\u2029\\]/g,Ae="\\ud800-\\udfff",ze="\\u0300-\\u036f",Ue="\\ufe20-\\ufe2f",Ge="\\u20d0-\\u20ff",bi=ze+Ue+Ge,dn="\\u2700-\\u27bf",Ci="a-z\\xdf-\\xf6\\xf8-\\xff",pn="\\xac\\xb1\\xd7\\xf7",be="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",de="\\u2000-\\u206f",Rr=" \\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",Ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Ii="\\ufe0e\\ufe0f",Vr=pn+be+de+Rr,qn="['’]",vn="["+Ae+"]",Bi="["+Vr+"]",ur="["+bi+"]",Pa="\\d+",Cn="["+dn+"]",Ra="["+Ci+"]",tr="[^"+Ae+Vr+Pa+dn+Ci+Ke+"]",co="\\ud83c[\\udffb-\\udfff]",Eg="(?:"+ur+"|"+co+")",Nd="[^"+Ae+"]",po="(?:\\ud83c[\\udde6-\\uddff]){2}",vo="[\\ud800-\\udbff][\\udc00-\\udfff]",hs="["+Ke+"]",ml="\\u200d",Bd="(?:"+Ra+"|"+tr+")",Mg="(?:"+hs+"|"+tr+")",Hh="(?:"+qn+"(?:d|ll|m|re|s|t|ve))?",Wh="(?:"+qn+"(?:D|LL|M|RE|S|T|VE))?",mo=Eg+"?",Ud="["+Ii+"]?",wf="(?:"+ml+"(?:"+[Nd,po,vo].join("|")+")"+Ud+mo+")*",hi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Xh=Ud+mo+wf,Gd="(?:"+[Cn,po,vo].join("|")+")"+Xh,Cg="(?:"+[Nd+ur+"?",ur,po,vo,vn].join("|")+")",Ag=RegExp(qn,"g"),mn=RegExp(ur,"g"),gl=RegExp(co+"(?="+co+")|"+Cg+Xh,"g"),wg=RegExp([hs+"?"+Ra+"+"+Hh+"(?="+[Bi,hs,"$"].join("|")+")",Mg+"+"+Wh+"(?="+[Bi,hs+Bd,"$"].join("|")+")",hs+"?"+Bd+"+"+Hh,hs+"+"+Wh,zd,hi,Pa,Gd].join("|"),"g"),Pf=RegExp("["+ml+Ae+bi+Ii+"]"),Pg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yh=["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"],us=-1,wi={};wi[ee]=wi[Nt]=wi[Te]=wi[le]=wi[ce]=wi[se]=wi[ie]=wi[Ce]=wi[Xe]=!0,wi[U]=wi[V]=wi[Jt]=wi[$]=wi[$t]=wi[q]=wi[nt]=wi[et]=wi[ut]=wi[dt]=wi[gt]=wi[st]=wi[yt]=wi[Tt]=wi[Gt]=!1;var Ai={};Ai[U]=Ai[V]=Ai[Jt]=Ai[$t]=Ai[$]=Ai[q]=Ai[ee]=Ai[Nt]=Ai[Te]=Ai[le]=Ai[ce]=Ai[ut]=Ai[dt]=Ai[gt]=Ai[st]=Ai[yt]=Ai[Tt]=Ai[wt]=Ai[se]=Ai[ie]=Ai[Ce]=Ai[Xe]=!0,Ai[nt]=Ai[et]=Ai[Gt]=!1;var fs={À:"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"},Os={"&":"&","<":"<",">":">",'"':""","'":"'"},kh={"&":"&","<":"<",">":">",""":'"',"'":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vd=parseFloat,Rg=parseInt,Hr=typeof global=="object"&&global&&global.Object===Object&&global,Lg=typeof self=="object"&&self&&self.Object===Object&&self,Vi=Hr||Lg||Function("return this")(),Lf=typeof g=="object"&&g&&!g.nodeType&&g,An=Lf&&typeof e=="object"&&e&&!e.nodeType&&e,yl=An&&An.exports===Lf,go=yl&&Hr.process,wn=function(){try{var Ct=An&&An.require&&An.require("util").types;return Ct||go&&go.binding&&go.binding("util")}catch{}}(),Kh=wn&&wn.isArrayBuffer,jh=wn&&wn.isDate,bf=wn&&wn.isMap,Zh=wn&&wn.isRegExp,Jh=wn&&wn.isSet,La=wn&&wn.isTypedArray;function Fi(Ct,Ht,It){switch(It.length){case 0:return Ct.call(Ht);case 1:return Ct.call(Ht,It[0]);case 2:return Ct.call(Ht,It[0],It[1]);case 3:return Ct.call(Ht,It[0],It[1],It[2])}return Ct.apply(Ht,It)}function cs(Ct,Ht,It,ue){for(var Ne=-1,Ye=Ct==null?0:Ct.length;++Ne-1}function yo(Ct,Ht,It){for(var ue=-1,Ne=Ct==null?0:Ct.length;++ue-1;);return It}function To(Ct,Ht){for(var It=Ct.length;It--&&Yr(Ht,Ct[It],0)>-1;);return It}function Kr(Ct,Ht){for(var It=Ct.length,ue=0;It--;)Ct[It]===Ht&&++ue;return ue}var kd=ir(fs),Kd=ir(Os);function If(Ct){return"\\"+Rf[Ct]}function Nf(Ct,Ht){return Ct==null?i:Ct[Ht]}function ba(Ct){return Pf.test(Ct)}function El(Ct){return Pg.test(Ct)}function Eo(Ct){for(var Ht,It=[];!(Ht=Ct.next()).done;)It.push(Ht.value);return It}function Ml(Ct){var Ht=-1,It=Array(Ct.size);return Ct.forEach(function(ue,Ne){It[++Ht]=[Ne,ue]}),It}function Mo(Ct,Ht){return function(It){return Ct(Ht(It))}}function jr(Ct,Ht){for(var It=-1,ue=Ct.length,Ne=0,Ye=[];++It-1}function nu(R,N){var X=this.__data__,tt=sa(X,R);return tt<0?(++this.size,X.push([R,N])):X[tt][1]=N,this}Zr.prototype.clear=cp,Zr.prototype.delete=Yf,Zr.prototype.get=dp,Zr.prototype.has=pp,Zr.prototype.set=nu;function Lr(R){var N=-1,X=R==null?0:R.length;for(this.clear();++N=N?R:N)),R}function dr(R,N,X,tt,at,ft){var St,Mt=N&h,Lt=N&o,Yt=N&l;if(X&&(St=at?X(R,tt,at,ft):X(R)),St!==i)return St;if(!Yi(R))return R;var kt=ke(R);if(kt){if(St=jw(R),!Mt)return Vn(R,St)}else{var Zt=nr(R),ae=Zt==et||Zt==ht;if(Xo(R))return uc(R,Mt);if(Zt==gt||Zt==U||ae&&!at){if(St=Lt||ae?{}:X1(R),!Mt)return Lt?bp(R,Sp(St,R)):Gg(R,$f(St,R))}else{if(!Ai[Zt])return at?R:{};St=Zw(R,Zt,Mt)}}ft||(ft=new ln);var Se=ft.get(R);if(Se)return Se;ft.set(R,St),yS(R)?R.forEach(function(Ie){St.add(dr(Ie,N,X,Ie,R,ft))}):mS(R)&&R.forEach(function(Ie,ai){St.set(ai,dr(Ie,N,X,ai,R,ft))});var De=Yt?Lt?oi:qi:Lt?Ir:Wn,ii=kt?i:De(R);return sn(ii||R,function(Ie,ai){ii&&(ai=Ie,Ie=R[ai]),Jr(St,ai,dr(Ie,N,X,ai,R,ft))}),St}function Qf(R){var N=Wn(R);return function(X){return ou(X,R,N)}}function ou(R,N,X){var tt=X.length;if(R==null)return!tt;for(R=Oe(R);tt--;){var at=X[tt],ft=N[at],St=R[at];if(St===i&&!(at in R)||!ft(St))return!1}return!0}function _f(R,N,X){if(typeof R!="function")throw new $n(a);return pc(function(){R.apply(i,X)},N)}function Ba(R,N,X,tt){var at=-1,ft=Wr,St=!0,Mt=R.length,Lt=[],Yt=N.length;if(!Mt)return Lt;X&&(N=Pi(N,Zn(X))),tt?(ft=yo,St=!1):N.length>=T&&(ft=Pn,St=!1,N=new ra(N));t:for(;++atat?0:at+X),tt=tt===i||tt>at?at:qe(tt),tt<0&&(tt+=at),tt=X>tt?0:SS(tt);X0&&X(Mt)?N>1?xn(Mt,N-1,X,tt,at):Xr(at,Mt):tt||(at[at.length]=Mt)}return at}var Io=xu(),zl=xu(!0);function pr(R,N){return R&&Io(R,N,Wn)}function No(R,N){return R&&zl(R,N,Wn)}function Ua(R,N){return Dn(N,function(X){return Wa(R[X])})}function Qr(R,N){N=fa(N,R);for(var X=0,tt=N.length;R!=null&&XN}function Mp(R,N){return R!=null&&ci.call(R,N)}function tc(R,N){return R!=null&&N in Oe(R)}function Ug(R,N,X){return R>=In(N,X)&&R=120&&kt.length>=120)?new ra(St&&kt):i}kt=R[0];var Zt=-1,ae=Mt[0];t:for(;++Zt-1;)Mt!==R&&ia.call(Mt,Lt,1),ia.call(R,Lt,1);return R}function Un(R,N){for(var X=R?N.length:0,tt=X-1;X--;){var at=N[X];if(X==tt||at!==ft){var ft=at;Ha(at)?ia.call(R,at,1):oc(R,at)}}return R}function Ss(R,N){return R+Fl(Wf()*(N-R+1))}function br(R,N,X,tt){for(var at=-1,ft=on(bl((N-R)/(X||1)),0),St=It(ft);ft--;)St[tt?ft:++at]=R,R+=X;return St}function Wo(R,N){var X="";if(!R||N<1||N>z)return X;do N%2&&(X+=R),N=Fl(N/2),N&&(R+=R);while(N);return X}function we(R,N){return Kg(K1(R,N,Nr),R+"")}function Cp(R){return Bl(Mu(R))}function rc(R,N){var X=Mu(R);return Dp(X,aa(N,0,X.length))}function Ga(R,N,X,tt){if(!Yi(R))return R;N=fa(N,R);for(var at=-1,ft=N.length,St=ft-1,Mt=R;Mt!=null&&++atat?0:at+N),X=X>at?at:X,X<0&&(X+=at),at=N>X?0:X-N>>>0,N>>>=0;for(var ft=It(at);++tt>>1,St=R[ft];St!==null&&!qr(St)&&(X?St<=N:St=T){var Yt=N?null:Hn(R);if(Yt)return Cl(Yt);St=!1,at=Pn,Lt=new ra}else Lt=N?[]:Mt;t:for(;++tt=tt?R:mr(R,N,X)}var Rp=Ll||function(R){return Vi.clearTimeout(R)};function uc(R,N){if(N)return R.slice();var X=R.length,tt=zf?zf(X):new R.constructor(X);return R.copy(tt),tt}function gu(R){var N=new R.constructor(R.byteLength);return new Pl(N).set(new Pl(R)),N}function zg(R,N){var X=N?gu(R.buffer):R.buffer;return new R.constructor(X,R.byteOffset,R.byteLength)}function Fr(R){var N=new R.constructor(R.source,Vh.exec(R));return N.lastIndex=R.lastIndex,N}function fc(R){return Bs?Oe(Bs.call(R)):{}}function Lp(R,N){var X=N?gu(R.buffer):R.buffer;return new R.constructor(X,R.byteOffset,R.length)}function Gs(R,N){if(R!==N){var X=R!==i,tt=R===null,at=R===R,ft=qr(R),St=N!==i,Mt=N===null,Lt=N===N,Yt=qr(N);if(!Mt&&!Yt&&!ft&&R>N||ft&&St&&Lt&&!Mt&&!Yt||tt&&St&&Lt||!X&&Lt||!at)return 1;if(!tt&&!ft&&!Yt&&R=Mt)return Lt;var Yt=X[tt];return Lt*(Yt=="desc"?-1:1)}}return R.index-N.index}function da(R,N,X,tt){for(var at=-1,ft=R.length,St=X.length,Mt=-1,Lt=N.length,Yt=on(ft-St,0),kt=It(Lt+Yt),Zt=!tt;++Mt1?X[at-1]:i,St=at>2?X[2]:i;for(ft=R.length>3&&typeof ft=="function"?(at--,ft):i,St&&yr(X[0],X[1],St)&&(ft=at<3?i:ft,at=1),N=Oe(N);++tt-1?at[ft?N[St]:St]:i}}function _(R){return Je(function(N){var X=N.length,tt=X,at=Nn.prototype.thru;for(R&&N.reverse();tt--;){var ft=N[tt];if(typeof ft!="function")throw new $n(a);if(at&&!St&&Su(ft)=="wrapper")var St=new Nn([],!0)}for(tt=St?tt:X;++tt1&&li.reverse(),kt&&LtMt))return!1;var Yt=ft.get(R),kt=ft.get(N);if(Yt&&kt)return Yt==N&&kt==R;var Zt=-1,ae=!0,Se=X&u?new ra:i;for(ft.set(R,N),ft.set(N,R);++Zt1?"& ":"")+N[tt],N=N.join(X>2?", ":" "),R.replace(uo,`{ -/* [wrapped with `+N+`] */ -`)}function $w(R){return ke(R)||Jl(R)||!!(Vf&&R&&R[Vf])}function Ha(R,N){var X=typeof R;return N=N??z,!!N&&(X=="number"||X!="symbol"&&Dt.test(R))&&R>-1&&R%1==0&&R0){if(++N>=L)return arguments[0]}else N=0;return R.apply(i,arguments)}}function Dp(R,N){var X=-1,tt=R.length,at=tt-1;for(N=N===i?tt:N;++X1?R[N-1]:i;return X=typeof X=="function"?(R.pop(),X):i,rS(R,X)});function sS(R){var N=lt(R);return N.__chain__=!0,N}function o3(R,N){return N(R),R}function Ip(R,N){return N(R)}var l3=Je(function(R){var N=R.length,X=N?R[0]:0,tt=this.__wrapped__,at=function(ft){return au(ft,R)};return N>1||this.__actions__.length||!(tt instanceof Pe)||!Ha(X)?this.thru(at):(tt=tt.slice(X,+X+(N?1:0)),tt.__actions__.push({func:Ip,args:[at],thisArg:i}),new Nn(tt,this.__chain__).thru(function(ft){return N&&!ft.length&&ft.push(i),ft}))});function h3(){return sS(this)}function u3(){return new Nn(this.value(),this.__chain__)}function f3(){this.__values__===i&&(this.__values__=xS(this.value()));var R=this.__index__>=this.__values__.length,N=R?i:this.__values__[this.__index__++];return{done:R,value:N}}function c3(){return this}function d3(R){for(var N,X=this;X instanceof Nl;){var tt=_1(X);tt.__index__=0,tt.__values__=i,N?at.__wrapped__=tt:N=tt;var at=tt;X=X.__wrapped__}return at.__wrapped__=R,N}function p3(){var R=this.__wrapped__;if(R instanceof Pe){var N=R;return this.__actions__.length&&(N=new Pe(this)),N=N.reverse(),N.__actions__.push({func:Ip,args:[jg],thisArg:i}),new Nn(N,this.__chain__)}return this.thru(jg)}function v3(){return ha(this.__wrapped__,this.__actions__)}var m3=Kl(function(R,N,X){ci.call(R,X)?++R[X]:xs(R,X,1)});function g3(R,N,X){var tt=ke(R)?Of:Bg;return X&&yr(R,N,X)&&(N=i),tt(R,Fe(N,3))}function y3(R,N){var X=ke(R)?Dn:qf;return X(R,Fe(N,3))}var x3=Z(q1),S3=Z(tS);function T3(R,N){return xn(Np(R,N),1)}function E3(R,N){return xn(Np(R,N),G)}function M3(R,N,X){return X=X===i?1:qe(X),xn(Np(R,N),X)}function aS(R,N){var X=ke(R)?sn:$r;return X(R,Fe(N,3))}function oS(R,N){var X=ke(R)?Ff:Tp;return X(R,Fe(N,3))}var C3=Kl(function(R,N,X){ci.call(R,X)?R[X].push(N):xs(R,X,[N])});function A3(R,N,X,tt){R=Dr(R)?R:Mu(R),X=X&&!tt?qe(X):0;var at=R.length;return X<0&&(X=on(at+X,0)),Vp(R)?X<=at&&R.indexOf(N,X)>-1:!!at&&Yr(R,N,X)>-1}var w3=we(function(R,N,X){var tt=-1,at=typeof N=="function",ft=Dr(R)?It(R.length):[];return $r(R,function(St){ft[++tt]=at?Fi(N,St,X):Li(St,N,X)}),ft}),P3=Kl(function(R,N,X){xs(R,X,N)});function Np(R,N){var X=ke(R)?Pi:za;return X(R,Fe(N,3))}function R3(R,N,X,tt){return R==null?[]:(ke(N)||(N=N==null?[]:[N]),X=tt?i:X,ke(X)||(X=X==null?[]:[X]),Wl(R,N,X))}var L3=Kl(function(R,N,X){R[X?0:1].push(N)},function(){return[[],[]]});function b3(R,N,X){var tt=ke(R)?$h:ta,at=arguments.length<3;return tt(R,Fe(N,4),X,at,$r)}function F3(R,N,X){var tt=ke(R)?Hd:ta,at=arguments.length<3;return tt(R,Fe(N,4),X,at,Tp)}function O3(R,N){var X=ke(R)?Dn:qf;return X(R,zp(Fe(N,3)))}function D3(R){var N=ke(R)?Bl:Cp;return N(R)}function I3(R,N,X){(X?yr(R,N,X):N===i)?N=1:N=qe(N);var tt=ke(R)?jf:rc;return tt(R,N)}function N3(R){var N=ke(R)?xp:wp;return N(R)}function B3(R){if(R==null)return 0;if(Dr(R))return Vp(R)?ds(R):R.length;var N=nr(R);return N==ut||N==yt?R.size:Bn(R).length}function U3(R,N,X){var tt=ke(R)?xl:sc;return X&&yr(R,N,X)&&(N=i),tt(R,Fe(N,3))}var z3=we(function(R,N){if(R==null)return[];var X=N.length;return X>1&&yr(R,N[0],N[1])?N=[]:X>2&&yr(N[0],N[1],N[2])&&(N=[N[0]]),Wl(R,xn(N,1),[])}),Bp=$d||function(){return Vi.Date.now()};function G3(R,N){if(typeof N!="function")throw new $n(a);return R=qe(R),function(){if(--R<1)return N.apply(this,arguments)}}function lS(R,N,X){return N=X?i:N,N=R&&N==null?R.length:N,Ft(R,M,i,i,i,i,N)}function hS(R,N){var X;if(typeof N!="function")throw new $n(a);return R=qe(R),function(){return--R>0&&(X=N.apply(this,arguments)),R<=1&&(N=i),X}}var Jg=we(function(R,N,X){var tt=f;if(X.length){var at=jr(X,Tu(Jg));tt|=m}return Ft(R,tt,N,X,at)}),uS=we(function(R,N,X){var tt=f|s;if(X.length){var at=jr(X,Tu(uS));tt|=m}return Ft(N,tt,R,X,at)});function fS(R,N,X){N=X?i:N;var tt=Ft(R,d,i,i,i,i,i,N);return tt.placeholder=fS.placeholder,tt}function cS(R,N,X){N=X?i:N;var tt=Ft(R,v,i,i,i,i,i,N);return tt.placeholder=cS.placeholder,tt}function dS(R,N,X){var tt,at,ft,St,Mt,Lt,Yt=0,kt=!1,Zt=!1,ae=!0;if(typeof R!="function")throw new $n(a);N=Cs(N)||0,Yi(X)&&(kt=!!X.leading,Zt="maxWait"in X,ft=Zt?on(Cs(X.maxWait)||0,N):ft,ae="trailing"in X?!!X.trailing:ae);function Se(un){var Hs=tt,Ya=at;return tt=at=i,Yt=un,St=R.apply(Ya,Hs),St}function De(un){return Yt=un,Mt=pc(ai,N),kt?Se(un):St}function ii(un){var Hs=un-Lt,Ya=un-Yt,OS=N-Hs;return Zt?In(OS,ft-Ya):OS}function Ie(un){var Hs=un-Lt,Ya=un-Yt;return Lt===i||Hs>=N||Hs<0||Zt&&Ya>=ft}function ai(){var un=Bp();if(Ie(un))return li(un);Mt=pc(ai,ii(un))}function li(un){return Mt=i,ae&&tt?Se(un):(tt=at=i,St)}function ts(){Mt!==i&&Rp(Mt),Yt=0,tt=Lt=at=Mt=i}function xr(){return Mt===i?St:li(Bp())}function es(){var un=Bp(),Hs=Ie(un);if(tt=arguments,at=this,Lt=un,Hs){if(Mt===i)return De(Lt);if(Zt)return Rp(Mt),Mt=pc(ai,N),Se(Lt)}return Mt===i&&(Mt=pc(ai,N)),St}return es.cancel=ts,es.flush=xr,es}var V3=we(function(R,N){return _f(R,1,N)}),H3=we(function(R,N,X){return _f(R,Cs(N)||0,X)});function W3(R){return Ft(R,C)}function Up(R,N){if(typeof R!="function"||N!=null&&typeof N!="function")throw new $n(a);var X=function(){var tt=arguments,at=N?N.apply(this,tt):tt[0],ft=X.cache;if(ft.has(at))return ft.get(at);var St=R.apply(this,tt);return X.cache=ft.set(at,St)||ft,St};return X.cache=new(Up.Cache||Lr),X}Up.Cache=Lr;function zp(R){if(typeof R!="function")throw new $n(a);return function(){var N=arguments;switch(N.length){case 0:return!R.call(this);case 1:return!R.call(this,N[0]);case 2:return!R.call(this,N[0],N[1]);case 3:return!R.call(this,N[0],N[1],N[2])}return!R.apply(this,N)}}function X3(R){return hS(2,R)}var Y3=Pp(function(R,N){N=N.length==1&&ke(N[0])?Pi(N[0],Zn(Fe())):Pi(xn(N,1),Zn(Fe()));var X=N.length;return we(function(tt){for(var at=-1,ft=In(tt.length,X);++at=N}),Jl=je(function(){return arguments}())?je:function(R){return tn(R)&&ci.call(R,"callee")&&!eu.call(R,"callee")},ke=It.isArray,sR=Kh?Zn(Kh):Qi;function Dr(R){return R!=null&&Gp(R.length)&&!Wa(R)}function hn(R){return tn(R)&&Dr(R)}function aR(R){return R===!0||R===!1||tn(R)&&Rn(R)==$}var Xo=_d||o0,oR=jh?Zn(jh):_i;function lR(R){return tn(R)&&R.nodeType===1&&!vc(R)}function hR(R){if(R==null)return!0;if(Dr(R)&&(ke(R)||typeof R=="string"||typeof R.splice=="function"||Xo(R)||Eu(R)||Jl(R)))return!R.length;var N=nr(R);if(N==ut||N==yt)return!R.size;if(dc(R))return!Bn(R).length;for(var X in R)if(ci.call(R,X))return!1;return!0}function uR(R,N){return Wi(R,N)}function fR(R,N,X){X=typeof X=="function"?X:i;var tt=X?X(R,N):i;return tt===i?Wi(R,N,i,X):!!tt}function Qg(R){if(!tn(R))return!1;var N=Rn(R);return N==nt||N==it||typeof R.message=="string"&&typeof R.name=="string"&&!vc(R)}function cR(R){return typeof R=="number"&&Hf(R)}function Wa(R){if(!Yi(R))return!1;var N=Rn(R);return N==et||N==ht||N==j||N==ot}function vS(R){return typeof R=="number"&&R==qe(R)}function Gp(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=z}function Yi(R){var N=typeof R;return R!=null&&(N=="object"||N=="function")}function tn(R){return R!=null&&typeof R=="object"}var mS=bf?Zn(bf):Uo;function dR(R,N){return R===N||Xi(R,N,Hg(N))}function pR(R,N,X){return X=typeof X=="function"?X:i,Xi(R,N,Hg(N),X)}function vR(R){return gS(R)&&R!=+R}function mR(R){if(qw(R))throw new Ne(E);return zo(R)}function gR(R){return R===null}function yR(R){return R==null}function gS(R){return typeof R=="number"||tn(R)&&Rn(R)==dt}function vc(R){if(!tn(R)||Rn(R)!=gt)return!1;var N=Rl(R);if(N===null)return!0;var X=ci.call(N,"constructor")&&N.constructor;return typeof X=="function"&&X instanceof X&&Lo.call(X)==Fa}var _g=Zh?Zn(Zh):Go;function xR(R){return vS(R)&&R>=-z&&R<=z}var yS=Jh?Zn(Jh):hu;function Vp(R){return typeof R=="string"||!ke(R)&&tn(R)&&Rn(R)==Tt}function qr(R){return typeof R=="symbol"||tn(R)&&Rn(R)==wt}var Eu=La?Zn(La):ic;function SR(R){return R===i}function TR(R){return tn(R)&&nr(R)==Gt}function ER(R){return tn(R)&&Rn(R)==Wt}var MR=Ee(Vl),CR=Ee(function(R,N){return R<=N});function xS(R){if(!R)return[];if(Dr(R))return Vp(R)?Ui(R):Vn(R);if(na&&R[na])return Eo(R[na]());var N=nr(R),X=N==ut?Ml:N==yt?Cl:Mu;return X(R)}function Xa(R){if(!R)return R===0?R:0;if(R=Cs(R),R===G||R===-G){var N=R<0?-1:1;return N*W}return R===R?R:0}function qe(R){var N=Xa(R),X=N%1;return N===N?X?N-X:N:0}function SS(R){return R?aa(qe(R),0,J):0}function Cs(R){if(typeof R=="number")return R;if(qr(R))return k;if(Yi(R)){var N=typeof R.valueOf=="function"?R.valueOf():R;R=Yi(N)?N+"":N}if(typeof R!="string")return R===0?R:+R;R=_h(R);var X=bt.test(R);return X||zt.test(R)?Rg(R.slice(2),X?2:8):ct.test(R)?k:+R}function TS(R){return Or(R,Ir(R))}function AR(R){return R?aa(qe(R),-z,z):R===0?R:0}function yi(R){return R==null?"":zn(R)}var wR=Va(function(R,N){if(dc(N)||Dr(N)){Or(N,Wn(N),R);return}for(var X in N)ci.call(N,X)&&Jr(R,X,N[X])}),ES=Va(function(R,N){Or(N,Ir(N),R)}),Hp=Va(function(R,N,X,tt){Or(N,Ir(N),R,tt)}),PR=Va(function(R,N,X,tt){Or(N,Wn(N),R,tt)}),RR=Je(au);function LR(R,N){var X=Us(R);return N==null?X:$f(X,N)}var bR=we(function(R,N){R=Oe(R);var X=-1,tt=N.length,at=tt>2?N[2]:i;for(at&&yr(N[0],N[1],at)&&(tt=1);++X1),ft}),Or(R,oi(R),X),tt&&(X=dr(X,h|o|l,oe));for(var at=N.length;at--;)oc(X,N[at]);return X});function ZR(R,N){return CS(R,zp(Fe(N)))}var JR=Je(function(R,N){return R==null?{}:Xl(R,N)});function CS(R,N){if(R==null)return{};var X=Pi(oi(R),function(tt){return[tt]});return N=Fe(N),cu(R,X,function(tt,at){return N(tt,at[0])})}function $R(R,N,X){N=fa(N,R);var tt=-1,at=N.length;for(at||(at=1,R=i);++ttN){var tt=R;R=N,N=tt}if(X||R%1||N%1){var at=Wf();return In(R+at*(N-R+Vd("1e-"+((at+"").length-1))),N)}return Ss(R,N)}var oL=b(function(R,N,X){return N=N.toLowerCase(),R+(X?PS(N):N)});function PS(R){return e0(yi(R).toLowerCase())}function RS(R){return R=yi(R),R&&R.replace(he,kd).replace(mn,"")}function lL(R,N,X){R=yi(R),N=zn(N);var tt=R.length;X=X===i?tt:aa(qe(X),0,tt);var at=X;return X-=N.length,X>=0&&R.slice(X,at)==N}function hL(R){return R=yi(R),R&&ve.test(R)?R.replace(_t,Kd):R}function uL(R){return R=yi(R),R&&Pr.test(R)?R.replace(rn,"\\$&"):R}var fL=b(function(R,N,X){return R+(X?"-":"")+N.toLowerCase()}),cL=b(function(R,N,X){return R+(X?" ":"")+N.toLowerCase()}),dL=Fp("toLowerCase");function pL(R,N,X){R=yi(R),N=qe(N);var tt=N?ds(R):0;if(!N||tt>=N)return R;var at=(N-tt)/2;return Qt(Fl(at),X)+R+Qt(bl(at),X)}function vL(R,N,X){R=yi(R),N=qe(N);var tt=N?ds(R):0;return N&&tt>>0,X?(R=yi(R),R&&(typeof N=="string"||N!=null&&!_g(N))&&(N=zn(N),!N&&ba(R))?ca(Ui(R),0,X):R.split(N,X)):[]}var EL=b(function(R,N,X){return R+(X?" ":"")+e0(N)});function ML(R,N,X){return R=yi(R),X=X==null?0:aa(qe(X),0,R.length),N=zn(N),R.slice(X,X+N.length)==N}function CL(R,N,X){var tt=lt.templateSettings;X&&yr(R,N,X)&&(N=i),R=yi(R),N=Hp({},N,tt,Rt);var at=Hp({},N.imports,tt.imports,Rt),ft=Wn(at),St=Jn(at,ft),Mt,Lt,Yt=0,kt=N.interpolate||me,Zt="__p += '",ae=gn((N.escape||me).source+"|"+kt.source+"|"+(kt===pi?Af:me).source+"|"+(N.evaluate||me).source+"|$","g"),Se="//# sourceURL="+(ci.call(N,"sourceURL")?(N.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++us+"]")+` -`;R.replace(ae,function(Ie,ai,li,ts,xr,es){return li||(li=ts),Zt+=R.slice(Yt,es).replace(Re,If),ai&&(Mt=!0,Zt+=`' + -__e(`+ai+`) + -'`),xr&&(Lt=!0,Zt+=`'; -`+xr+`; -__p += '`),li&&(Zt+=`' + -((__t = (`+li+`)) == null ? '' : __t) + -'`),Yt=es+Ie.length,Ie}),Zt+=`'; -`;var De=ci.call(N,"variable")&&N.variable;if(!De)Zt=`with (obj) { -`+Zt+` -} -`;else if(Gh.test(De))throw new Ne(y);Zt=(Lt?Zt.replace(si,""):Zt).replace(Be,"$1").replace(ri,"$1;"),Zt="function("+(De||"obj")+`) { -`+(De?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Mt?", __e = _.escape":"")+(Lt?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+Zt+`return __p -}`;var ii=bS(function(){return Ye(ft,Se+"return "+Zt).apply(i,St)});if(ii.source=Zt,Qg(ii))throw ii;return ii}function AL(R){return yi(R).toLowerCase()}function wL(R){return yi(R).toUpperCase()}function PL(R,N,X){if(R=yi(R),R&&(X||N===i))return _h(R);if(!R||!(N=zn(N)))return R;var tt=Ui(R),at=Ui(N),ft=Ri(tt,at),St=To(tt,at)+1;return ca(tt,ft,St).join("")}function RL(R,N,X){if(R=yi(R),R&&(X||N===i))return R.slice(0,Ao(R)+1);if(!R||!(N=zn(N)))return R;var tt=Ui(R),at=To(tt,Ui(N))+1;return ca(tt,0,at).join("")}function LL(R,N,X){if(R=yi(R),R&&(X||N===i))return R.replace(wa,"");if(!R||!(N=zn(N)))return R;var tt=Ui(R),at=Ri(tt,Ui(N));return ca(tt,at).join("")}function bL(R,N){var X=w,tt=P;if(Yi(N)){var at="separator"in N?N.separator:at;X="length"in N?qe(N.length):X,tt="omission"in N?zn(N.omission):tt}R=yi(R);var ft=R.length;if(ba(R)){var St=Ui(R);ft=St.length}if(X>=ft)return R;var Mt=X-ds(tt);if(Mt<1)return tt;var Lt=St?ca(St,0,Mt).join(""):R.slice(0,Mt);if(at===i)return Lt+tt;if(St&&(Mt+=Lt.length-Mt),_g(at)){if(R.slice(Mt).search(at)){var Yt,kt=Lt;for(at.global||(at=gn(at.source,yi(Vh.exec(at))+"g")),at.lastIndex=0;Yt=at.exec(kt);)var Zt=Yt.index;Lt=Lt.slice(0,Zt===i?Mt:Zt)}}else if(R.indexOf(zn(at),Mt)!=Mt){var ae=Lt.lastIndexOf(at);ae>-1&&(Lt=Lt.slice(0,ae))}return Lt+tt}function FL(R){return R=yi(R),R&&qt.test(R)?R.replace(xt,wo):R}var OL=b(function(R,N,X){return R+(X?" ":"")+N.toUpperCase()}),e0=Fp("toUpperCase");function LS(R,N,X){return R=yi(R),N=X?i:N,N===i?El(R)?Po(R):Xd(R):R.match(N)||[]}var bS=we(function(R,N){try{return Fi(R,i,N)}catch(X){return Qg(X)?X:new Ne(X)}}),DL=Je(function(R,N){return sn(N,function(X){X=pa(X),xs(R,X,Jg(R[X],R))}),R});function IL(R){var N=R==null?0:R.length,X=Fe();return R=N?Pi(R,function(tt){if(typeof tt[1]!="function")throw new $n(a);return[X(tt[0]),tt[1]]}):[],we(function(tt){for(var at=-1;++atz)return[];var X=J,tt=In(R,J);N=Fe(N),R-=J;for(var at=Is(tt,N);++X0||N<0)?new Pe(X):(R<0?X=X.takeRight(-R):R&&(X=X.drop(R)),N!==i&&(N=qe(N),X=N<0?X.dropRight(-N):X.take(N-R)),X)},Pe.prototype.takeRightWhile=function(R){return this.reverse().takeWhile(R).reverse()},Pe.prototype.toArray=function(){return this.take(J)},pr(Pe.prototype,function(R,N){var X=/^(?:filter|find|map|reject)|While$/.test(N),tt=/^(?:head|last)$/.test(N),at=lt[tt?"take"+(N=="last"?"Right":""):N],ft=tt||/^find/.test(N);at&&(lt.prototype[N]=function(){var St=this.__wrapped__,Mt=tt?[1]:arguments,Lt=St instanceof Pe,Yt=Mt[0],kt=Lt||ke(St),Zt=function(ai){var li=at.apply(lt,Xr([ai],Mt));return tt&&ae?li[0]:li};kt&&X&&typeof Yt=="function"&&Yt.length!=1&&(Lt=kt=!1);var ae=this.__chain__,Se=!!this.__actions__.length,De=ft&&!ae,ii=Lt&&!Se;if(!ft&&kt){St=ii?St:new Pe(this);var Ie=R.apply(St,Mt);return Ie.__actions__.push({func:Ip,args:[Zt],thisArg:i}),new Nn(Ie,ae)}return De&&ii?R.apply(this,Mt):(Ie=this.thru(Zt),De?tt?Ie.value()[0]:Ie.value():Ie)})}),sn(["pop","push","shift","sort","splice","unshift"],function(R){var N=ea[R],X=/^(?:push|sort|unshift)$/.test(R)?"tap":"thru",tt=/^(?:pop|shift)$/.test(R);lt.prototype[R]=function(){var at=arguments;if(tt&&!this.__chain__){var ft=this.value();return N.apply(ke(ft)?ft:[],at)}return this[X](function(St){return N.apply(ke(St)?St:[],at)})}}),pr(Pe.prototype,function(R,N){var X=lt[N];if(X){var tt=X.name+"";ci.call(Ia,tt)||(Ia[tt]=[]),Ia[tt].push({name:N,func:X})}}),Ia[rt(i,s).name]=[{name:"wrapper",func:i}],Pe.prototype.clone=Fg,Pe.prototype.reverse=Og,Pe.prototype.value=cr,lt.prototype.at=l3,lt.prototype.chain=h3,lt.prototype.commit=u3,lt.prototype.next=f3,lt.prototype.plant=d3,lt.prototype.reverse=p3,lt.prototype.toJSON=lt.prototype.valueOf=lt.prototype.value=v3,lt.prototype.first=lt.prototype.head,na&&(lt.prototype[na]=c3),lt},vs=Jd();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Vi._=vs,define(function(){return vs})):An?((An.exports=vs)._=vs,Lf._=vs):Vi._=vs}).call(g)}),R2=class extends Set{constructor(g,e=!1){super(g),this.valuesAsFlags=e}};function Gc(g){if(g instanceof Map)return Object.fromEntries([...g.entries()].map(([e,i])=>[e,Gc(i)]));if(g instanceof Set)return Array.from(g.values()).map(Gc);if(g instanceof R2)return{values:[...g.values()],valuesAsFlags:g.valuesAsFlags};if(typeof g=="object"){let e={};return Object.entries(g).forEach(([i,x])=>{e[i]=Gc(x)}),e}else return g}Yx(kx(),1);var LO=Yx(kx(),1);function uh(g,e){if(typeof g!="object")throw new Error(`Cannot merge into non-object objectToMergeWith. Received: ${JSON.stringify(g)}`);if(typeof e!="object")throw new Error(`Cannot merge using non-object objectToMergeWith. Received: ${JSON.stringify(e)}`);let i=(0,LO.cloneDeep)(g);for(let[x,T]of Object.entries(e))typeof T!="object"||T instanceof Set||i[x]===void 0?i[x]=T:i[x]=uh(i[x],T);return i}function L2(g,e){if(!(g===void 0||typeof g!="object"))for(let i of Object.keys(g)){if(i===e)return g[i];let x=g[i];if(typeof x=="object"){let T=L2(x,e);if(T!==void 0)return T}}}var p0="@composite:",bO="@inherit:",FO=class{constructor(g,e,i){this.tiledClassToMembersMap=g,this.enumNameToValuesMap=e,this.parserOptions=i,this.memoiser=new Map}flattenMembers(g,e){return this.memoiser.has(g)?{[g]:this.memoiser.get(g)}:(this.memoiser.set(g,e.reduce((i,x)=>Gi(Gi({},i),this.flattenMemberProperty(x)),{})),{[g]:this.memoiser.get(g)})}flattenMemberProperty(g){var e;let i=(e=g.propertyType)!=null?e:g.propertytype;if(g.type==="class"){if(!this.memoiser.has(i)){let E=this.tiledClassToMembersMap.get(i).reduce((a,y)=>uh(this.flattenMemberProperty(y),a),{});this.memoiser.set(i,E)}let x=this.memoiser.get(i),T=uh(x,this.flattenValue(g.value,x));return this.checkIfShouldFlatten(g.name)?T:{[g.name.replace(p0,"")]:T}}else return this.enumNameToValuesMap.has(i)?this.enumNameToValuesMap.get(i).valuesAsFlags?{[g.name]:new Set(g.value.split(",").filter(x=>x!==""))}:{[g.name]:g.value}:{[g.name]:g.value}}get memoisedFlattenedProperties(){return this.memoiser}flattenValue(g,e){return Object.entries(g).reduce((i,[x,T])=>{if(typeof T!="object")return L2(e,x)instanceof Set?uh({[x]:new Set(T.split(",").filter(E=>E!==""))},i):uh({[x]:T},i);if(this.checkIfShouldFlatten(x))return uh(this.flattenValue(T,e),i);{let E=x.replace(p0,"");return uh({[E]:this.flattenValue(T,e)},i)}},{})}checkIfShouldFlatten(g){var e;return((e=this.parserOptions)==null?void 0:e.defaultComposite)===!0?g.startsWith(bO):!g.startsWith(p0)}},sT=Yx(kx(),1),OO=class{constructor(g){this.flattener=g}flattenPropertiesOnObject(g){var e,i,x,T;return al(Gi(Gi({},this.flattener.memoisedFlattenedProperties.get((e=g.class)!=null?e:g.type)),(i=g.properties)==null?void 0:i.reduce((E,a)=>Gi(Gi({},E),this.flattener.flattenMemberProperty(a)),{})),{name:g.name,id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null,x:g.x,y:g.y})}flattenPropertiesOnTile(g){var e,i,x,T;return al(Gi(Gi({},this.flattener.memoisedFlattenedProperties.get((e=g.class)!=null?e:g.type)),(i=g.properties)==null?void 0:i.reduce((E,a)=>Gi(Gi({},E),this.flattener.flattenMemberProperty(a)),{})),{id:g.id,class:(T=(x=g.class)!=null?x:g.type)!=null?T:null})}getCustomTypesMap(){return new Map([...this.flattener.memoisedFlattenedProperties.entries()].map(([g,e])=>[g,(0,sT.cloneDeep)(e)]))}getEnumsMap(){return new Map([...this.flattener.enumNameToValuesMap.entries()].map(([g,e])=>[g,(0,sT.cloneDeep)(e)]))}toJSON(){return JSON.stringify({customTypes:Gc(this.getCustomTypesMap()),enums:Gc(this.getEnumsMap())},null,4)}};function DO(g,e){let i=new Map(g.propertyTypes.filter(E=>E.type==="enum").map(E=>[E.name,new R2(E.values,E.valuesAsFlags)])),x=new Map(g.propertyTypes.filter(E=>E.type==="class").map(E=>[E.name,E.members])),T=new FO(x,i,e);return x.forEach((E,a)=>{T.flattenMembers(a,E)}),new OO(T)}var IO={parse:DO},b2=class{constructor(g,e){this.phaserTile=g,this.tiledProject=e}getProperty(g){var e,i;let x={};if(this.tiledProject){let T=IO.parse(this.tiledProject),E=this.getType();if(E){let a=(e=T.getCustomTypesMap())==null?void 0:e.get(E);if(a)for(let[y,t]of Object.entries(a))x[y]=t}}return(i=this.phaserTile.properties[g])!=null?i:x[g]}hasProperty(g){return this.getProperty(g)!=null}getType(){var g,e;return(e=(g=this.phaserTile.tileset)==null?void 0:g.tileData[this.phaserTile.index-1])==null?void 0:e.type}},NO=class{constructor(g,e){this.phaserTilemapLayer=g,this.tiledProject=e}getName(){return this.phaserTilemapLayer.layer.name}getProperty(g){let e=this.phaserTilemapLayer.layer.properties,i=e?.find(x=>x.name==g);return i?.value}hasProperty(g){return this.getProperty(g)!=null}isCharLayer(){return this.hasProperty(Wv)}getData(){return this.phaserTilemapLayer.layer.data.map(g=>g.map(e=>new b2(e,this.tiledProject)))}},BO=class{constructor(g,e){this.phaserTilemap=g,this.tiledProject=e;for(let i of this.phaserTilemap.layers)if(i.tilemapLayer==null)throw new Error(`Error initializing tilemap. Layer '${i.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(g=>new NO(g.tilemapLayer,this.tiledProject))}hasTileAt(g,e,i){return!!this.phaserTilemap.hasTileAt(g,e,i)}getTileAt(g,e,i){let x=this.phaserTilemap.getTileAt(g,e,!1,i);if(x)return new b2(x,this.tiledProject)}},F2=class wy{constructor(e){this.scene=e,this.geHeadless=new yO(!1),this.isCreatedInternal=!1,wy.welcomeMessagePrinted||(console.log(`Using GridEngine Phaser Plugin v${E2}`),wy.welcomeMessagePrinted=!0),this.scene.sys.events.once("boot",this.boot,this)}boot(){this.scene.sys.events.on("update",this.update,this)}getCharLayer(e){return this.geHeadless.getCharLayer(e)}getTransition(e,i){return this.geHeadless.getTransition(e,i)}setTransition(e,i,x){this.geHeadless.setTransition(e,i,x)}create(e,i){this.geHeadless.create(new BO(e,i.tiledProject),i),this.isCreatedInternal=!0,this.gridCharacters=new Map;let x=this.setConfigDefaults(i);this.config=x,this.gridTilemap=new Ay(e),this.addCharacters()}getPosition(e){return this.geHeadless.getPosition(e)}move(e,i){this.geHeadless.move(e,i)}moveRandomly(e,i=0,x=-1){this.geHeadless.moveRandomly(e,i,x)}getMovement(e){return this.geHeadless.getMovement(e)}moveTo(e,i,x){return this.geHeadless.moveTo(e,i,x)}stopMovement(e){this.geHeadless.stopMovement(e)}setSpeed(e,i){this.geHeadless.setSpeed(e,i)}getSpeed(e){return this.geHeadless.getSpeed(e)}setContainer(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);T.setContainer(i)}getContainer(e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(e);if(!x)throw this.createCharUnknownErr(e);return x.getContainer()}getOffsetX(e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(e);if(!x)throw this.createCharUnknownErr(e);return x.getOffsetX()}setOffsetX(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);T.setOffsetX(i)}getOffsetY(e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(e);if(!x)throw this.createCharUnknownErr(e);return x.getOffsetY()}setOffsetY(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);T.setOffsetY(i)}collidesWithTiles(e){return this.geHeadless.collidesWithTiles(e)}getWalkingAnimationMapping(e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(e);if(!x)throw this.createCharUnknownErr(e);let T=x.getAnimation();return T?.getWalkingAnimationMapping()}hasLayerOverlay(){var e;return this.initGuard(),!!((e=this.config)!=null&&e.layerOverlay)}setWalkingAnimationMapping(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);let E=T.getAnimation();E?.setWalkingAnimationMapping(i)}update(e,i){if(this.isCreatedInternal&&this.gridCharacters)for(let[x,T]of this.gridCharacters)T.update(i);this.geHeadless.update(e,i)}addCharacter(e){this.geHeadless.addCharacter(e),this.addCharacterInternal(e)}hasCharacter(e){return this.geHeadless.hasCharacter(e)}removeCharacter(e){var i,x;this.initGuard();let T=(i=this.gridCharacters)==null?void 0:i.get(e);if(!T)throw this.createCharUnknownErr(e);T.destroy(),(x=this.gridCharacters)==null||x.delete(e),this.geHeadless.removeCharacter(e)}removeAllCharacters(){if(this.initGuard(),!!this.gridCharacters){for(let e of this.gridCharacters.keys())this.removeCharacter(e);this.geHeadless.removeAllCharacters()}}getAllCharacters(e){return this.geHeadless.getAllCharacters(e)}getLabels(e){return this.geHeadless.getLabels(e)}addLabels(e,i){this.geHeadless.addLabels(e,i)}removeLabels(e,i){this.geHeadless.removeLabels(e,i)}clearLabels(e){this.geHeadless.clearLabels(e)}follow(e,i,x,T){let E;x===void 0?E={distance:0,closestPointIfBlocked:!1}:typeof x=="number"?(E={distance:x,closestPointIfBlocked:!1},T&&(E.closestPointIfBlocked=!0)):E=x,this.geHeadless.follow(e,i,E)}isMoving(e){return this.geHeadless.isMoving(e)}getFacingDirection(e){return this.geHeadless.getFacingDirection(e)}getFacingPosition(e){return this.geHeadless.getFacingPosition(e)}turnTowards(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);T.turnTowards(i),this.geHeadless.turnTowards(e,i)}getCharactersAt(e,i){return this.geHeadless.getCharactersAt(e,i)}setPosition(e,i,x){this.geHeadless.setPosition(e,i,x)}getSprite(e){var i;this.initGuard();let x=(i=this.gridCharacters)==null?void 0:i.get(e);if(!x)throw this.createCharUnknownErr(e);return x.getSprite()}setSprite(e,i){var x;this.initGuard();let T=(x=this.gridCharacters)==null?void 0:x.get(e);if(!T)throw this.createCharUnknownErr(e);i.setOrigin(0,0),T.setSprite(i)}isBlocked(e,i,x=["geDefault"]){return this.geHeadless.isBlocked(e,i,x)}isTileBlocked(e,i){return this.geHeadless.isTileBlocked(e,i)}getCollisionGroups(e){return this.geHeadless.getCollisionGroups(e)}setCollisionGroups(e,i){this.geHeadless.setCollisionGroups(e,i)}getIgnoreCollisionGroups(e){return this.geHeadless.getIgnoreCollisionGroups(e)}setIgnoreCollisionGroups(e,i){this.geHeadless.setIgnoreCollisionGroups(e,i)}getTilePosInDirection(e,i,x){return this.geHeadless.getTilePosInDirection(e,i,x)}findShortestPath(e,i,x={}){return this.geHeadless.findShortestPath(e,i,x)}steppedOn(e,i,x){return this.geHeadless.steppedOn(e,i,x)}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(e){return this.geHeadless.getMovementProgress(e)}rebuildTileCollisionCache(e,i,x,T){this.geHeadless.rebuildTileCollisionCache(e,i,x,T)}addQueueMovements(e,i,x){this.geHeadless.addQueueMovements(e,i,x)}getEnqueuedMovements(e){return this.geHeadless.getEnqueuedMovements(e)}queueMovementFinished(){return this.geHeadless.queueMovementFinished()}clearEnqueuedMovements(e){return this.geHeadless.clearEnqueuedMovements(e)}getState(){return{characters:this.geHeadless.getState().characters.map(e=>al(Gi({},e),{offsetX:this.getOffsetX(e.id),offsetY:this.getOffsetY(e.id)}))}}setState(e){if(this.geHeadless.setState(e),this.gridCharacters)for(let i of e.characters){let x=this.gridCharacters.get(i.id);x&&(x.setOffsetX(i.offsetX),x.setOffsetY(i.offsetY))}}getTileCost(e,i,x){return this.initGuard(),this.geHeadless.getTileCost(e,i,x)}setConfigDefaults(e){return Gi({collisionTilePropertyName:"ge_collide",numberOfDirections:4,characterCollisionStrategy:"BLOCK_TWO_TILES",layerOverlay:!1,cacheTileCollisions:!1},e)}initGuard(){if(!this.isCreatedInternal)throw this.createUninitializedErr()}createUninitializedErr(){throw new Error("GridEngine not initialized. You need to call create() first.")}addCharacters(){var e;(e=this.config)==null||e.characters.forEach(i=>this.addCharacterInternal(i))}createCharUnknownErr(e){return new Error(`Character unknown: ${e}`)}addCharacterInternal(e){var i;if(this.initGuard(),!this.gridTilemap)throw this.createUninitializedErr();if(!this.config)throw this.createUninitializedErr();let x=new q4(e,this.scene,this.gridTilemap,this.config.layerOverlay,this.geHeadless);(i=this.gridCharacters)==null||i.set(e.id,x)}};F2.welcomeMessagePrinted=!1;var UO=F2,zO=UO;/*! Bundled license information: - -tiled-property-flattener/dist/tiled_property_flattener.min.js: - (*! Bundled license information: - - lodash/lodash.js: - (** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - *) - *) -*/function aT(g){return g.type==="ROLL_DICE"}class vh{constructor(e,i=4){this.bounds=e,this.capacity=i,this.points=[],this.divided=!1,this.cache=new Map}subdivide(){const{xMin:e,yMin:i,xMax:x,yMax:T}=this.bounds,E=(x-e)/2,a=(T-i)/2,y=e,t=i;this.northeast=new vh({xMin:y+E,xMax:y+2*E,yMin:i,yMax:t+a},this.capacity),this.northwest=new vh({xMin:e,xMax:y+E,yMin:i,yMax:t+a},this.capacity),this.southeast=new vh({xMin:y+E,xMax:y+2*E,yMin:t+a,yMax:t+2*a},this.capacity),this.southwest=new vh({xMin:e,xMax:y+E,yMin:t+a,yMax:t+2*a},this.capacity),this.divided=!0}insert(e){return this.contains(e.bounds)?this.points.length=i&&e.xMax<=T&&e.yMin>=x&&e.yMax<=E}generateCacheKey(e){const{xMin:i,xMax:x,yMin:T,yMax:E}=e;return`${i},${x},${T},${E}`}queryRange(e,i=[]){if(!this.intersects(e))return i;for(const x of this.points)this.isWithinBounds(x.bounds,e)&&i.push(x);return this.divided&&(this.northwest?.queryRange(e,i),this.northeast?.queryRange(e,i),this.southwest?.queryRange(e,i),this.southeast?.queryRange(e,i)),i}query(e,i=[]){const x=`${e.x},${e.y}`,T=this.cache.get(x);if(T)return T;if(!this.intersects({xMin:e.x,xMax:e.x,yMin:e.y,yMax:e.y}))return i;for(const E of this.points)this.isWithinRange(e,E.bounds)&&i.push(E);return this.divided&&(this.northwest?.query(e,i),this.northeast?.query(e,i),this.southwest?.query(e,i),this.southeast?.query(e,i)),this.cache.set(x,i),i}intersects(e){const{xMin:i,yMin:x,xMax:T,yMax:E}=this.bounds;return!(e.xMin>T||e.xMaxE||e.yMax=i.xMin&&e.xMin<=i.xMax&&e.yMax>=i.yMin&&e.yMin<=i.yMax}isWithinRange(e,i){return e.x>=i.xMin&&e.x<=i.xMax&&e.y>=i.yMin&&e.y<=i.yMax}}class GO{constructor(){this.events={},this.lastEmitted=new Map}on(e,i){this.events[e]||(this.events[e]=[]),this.events[e]?.push(i)}off(e,i){this.events[e]&&(this.events[e]=this.events[e]?.filter(x=>x!==i))}emit(e,i,x=0){const T=Date.now(),E=this.lastEmitted.get(e)||0;if(T-E>=x){if(!this.events[e])return;this.events[e]?.forEach(a=>a(i)),this.lastEmitted.set(e,T)}}}const _e=new GO;function VO(g,e,i){let x=new Set([...e,void 0]);return g.listen((T,E)=>{x.has(E)&&i(T,E)})}function O2(g,e){return function(){return g.apply(e,arguments)}}const{toString:HO}=Object.prototype,{getPrototypeOf:Kx}=Object,Xm=(g=>e=>{const i=HO.call(e);return g[i]||(g[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ca=g=>(g=g.toLowerCase(),e=>Xm(e)===g),Ym=g=>e=>typeof e===g,{isArray:gf}=Array,Jc=Ym("undefined");function WO(g){return g!==null&&!Jc(g)&&g.constructor!==null&&!Jc(g.constructor)&&Ls(g.constructor.isBuffer)&&g.constructor.isBuffer(g)}const D2=Ca("ArrayBuffer");function XO(g){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(g):e=g&&g.buffer&&D2(g.buffer),e}const YO=Ym("string"),Ls=Ym("function"),I2=Ym("number"),km=g=>g!==null&&typeof g=="object",kO=g=>g===!0||g===!1,Xv=g=>{if(Xm(g)!=="object")return!1;const e=Kx(g);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in g)&&!(Symbol.iterator in g)},KO=Ca("Date"),jO=Ca("File"),ZO=Ca("Blob"),JO=Ca("FileList"),$O=g=>km(g)&&Ls(g.pipe),QO=g=>{let e;return g&&(typeof FormData=="function"&&g instanceof FormData||Ls(g.append)&&((e=Xm(g))==="formdata"||e==="object"&&Ls(g.toString)&&g.toString()==="[object FormData]"))},_O=Ca("URLSearchParams"),qO=g=>g.trim?g.trim():g.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Td(g,e,{allOwnKeys:i=!1}={}){if(g===null||typeof g>"u")return;let x,T;if(typeof g!="object"&&(g=[g]),gf(g))for(x=0,T=g.length;x0;)if(T=i[x],e===T.toLowerCase())return T;return null}const B2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,U2=g=>!Jc(g)&&g!==B2;function Py(){const{caseless:g}=U2(this)&&this||{},e={},i=(x,T)=>{const E=g&&N2(e,T)||T;Xv(e[E])&&Xv(x)?e[E]=Py(e[E],x):Xv(x)?e[E]=Py({},x):gf(x)?e[E]=x.slice():e[E]=x};for(let x=0,T=arguments.length;x(Td(e,(T,E)=>{i&&Ls(T)?g[E]=O2(T,i):g[E]=T},{allOwnKeys:x}),g),eD=g=>(g.charCodeAt(0)===65279&&(g=g.slice(1)),g),iD=(g,e,i,x)=>{g.prototype=Object.create(e.prototype,x),g.prototype.constructor=g,Object.defineProperty(g,"super",{value:e.prototype}),i&&Object.assign(g.prototype,i)},nD=(g,e,i,x)=>{let T,E,a;const y={};if(e=e||{},g==null)return e;do{for(T=Object.getOwnPropertyNames(g),E=T.length;E-- >0;)a=T[E],(!x||x(a,g,e))&&!y[a]&&(e[a]=g[a],y[a]=!0);g=i!==!1&&Kx(g)}while(g&&(!i||i(g,e))&&g!==Object.prototype);return e},rD=(g,e,i)=>{g=String(g),(i===void 0||i>g.length)&&(i=g.length),i-=e.length;const x=g.indexOf(e,i);return x!==-1&&x===i},sD=g=>{if(!g)return null;if(gf(g))return g;let e=g.length;if(!I2(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=g[e];return i},aD=(g=>e=>g&&e instanceof g)(typeof Uint8Array<"u"&&Kx(Uint8Array)),oD=(g,e)=>{const x=(g&&g[Symbol.iterator]).call(g);let T;for(;(T=x.next())&&!T.done;){const E=T.value;e.call(g,E[0],E[1])}},lD=(g,e)=>{let i;const x=[];for(;(i=g.exec(e))!==null;)x.push(i);return x},hD=Ca("HTMLFormElement"),uD=g=>g.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,x,T){return x.toUpperCase()+T}),oT=(({hasOwnProperty:g})=>(e,i)=>g.call(e,i))(Object.prototype),fD=Ca("RegExp"),z2=(g,e)=>{const i=Object.getOwnPropertyDescriptors(g),x={};Td(i,(T,E)=>{let a;(a=e(T,E,g))!==!1&&(x[E]=a||T)}),Object.defineProperties(g,x)},cD=g=>{z2(g,(e,i)=>{if(Ls(g)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const x=g[i];if(Ls(x)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},dD=(g,e)=>{const i={},x=T=>{T.forEach(E=>{i[E]=!0})};return gf(g)?x(g):x(String(g).split(e)),i},pD=()=>{},vD=(g,e)=>(g=+g,Number.isFinite(g)?g:e),v0="abcdefghijklmnopqrstuvwxyz",lT="0123456789",G2={DIGIT:lT,ALPHA:v0,ALPHA_DIGIT:v0+v0.toUpperCase()+lT},mD=(g=16,e=G2.ALPHA_DIGIT)=>{let i="";const{length:x}=e;for(;g--;)i+=e[Math.random()*x|0];return i};function gD(g){return!!(g&&Ls(g.append)&&g[Symbol.toStringTag]==="FormData"&&g[Symbol.iterator])}const yD=g=>{const e=new Array(10),i=(x,T)=>{if(km(x)){if(e.indexOf(x)>=0)return;if(!("toJSON"in x)){e[T]=x;const E=gf(x)?[]:{};return Td(x,(a,y)=>{const t=i(a,T+1);!Jc(t)&&(E[y]=t)}),e[T]=void 0,E}}return x};return i(g,0)},xD=Ca("AsyncFunction"),SD=g=>g&&(km(g)||Ls(g))&&Ls(g.then)&&Ls(g.catch),Kt={isArray:gf,isArrayBuffer:D2,isBuffer:WO,isFormData:QO,isArrayBufferView:XO,isString:YO,isNumber:I2,isBoolean:kO,isObject:km,isPlainObject:Xv,isUndefined:Jc,isDate:KO,isFile:jO,isBlob:ZO,isRegExp:fD,isFunction:Ls,isStream:$O,isURLSearchParams:_O,isTypedArray:aD,isFileList:JO,forEach:Td,merge:Py,extend:tD,trim:qO,stripBOM:eD,inherits:iD,toFlatObject:nD,kindOf:Xm,kindOfTest:Ca,endsWith:rD,toArray:sD,forEachEntry:oD,matchAll:lD,isHTMLForm:hD,hasOwnProperty:oT,hasOwnProp:oT,reduceDescriptors:z2,freezeMethods:cD,toObjectSet:dD,toCamelCase:uD,noop:pD,toFiniteNumber:vD,findKey:N2,global:B2,isContextDefined:U2,ALPHABET:G2,generateString:mD,isSpecCompliantForm:gD,toJSONObject:yD,isAsyncFn:xD,isThenable:SD};function ui(g,e,i,x,T){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=g,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),x&&(this.request=x),T&&(this.response=T)}Kt.inherits(ui,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:Kt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const V2=ui.prototype,H2={};["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(g=>{H2[g]={value:g}});Object.defineProperties(ui,H2);Object.defineProperty(V2,"isAxiosError",{value:!0});ui.from=(g,e,i,x,T,E)=>{const a=Object.create(V2);return Kt.toFlatObject(g,a,function(t){return t!==Error.prototype},y=>y!=="isAxiosError"),ui.call(a,g.message,e,i,x,T),a.cause=g,a.name=g.name,E&&Object.assign(a,E),a};const TD=null;function Ry(g){return Kt.isPlainObject(g)||Kt.isArray(g)}function W2(g){return Kt.endsWith(g,"[]")?g.slice(0,-2):g}function hT(g,e,i){return g?g.concat(e).map(function(T,E){return T=W2(T),!i&&E?"["+T+"]":T}).join(i?".":""):e}function ED(g){return Kt.isArray(g)&&!g.some(Ry)}const MD=Kt.toFlatObject(Kt,{},null,function(e){return/^is[A-Z]/.test(e)});function Km(g,e,i){if(!Kt.isObject(g))throw new TypeError("target must be an object");e=e||new FormData,i=Kt.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(u,f){return!Kt.isUndefined(f[u])});const x=i.metaTokens,T=i.visitor||p,E=i.dots,a=i.indexes,t=(i.Blob||typeof Blob<"u"&&Blob)&&Kt.isSpecCompliantForm(e);if(!Kt.isFunction(T))throw new TypeError("visitor must be a function");function r(n){if(n===null)return"";if(Kt.isDate(n))return n.toISOString();if(!t&&Kt.isBlob(n))throw new ui("Blob is not supported. Use a Buffer instead.");return Kt.isArrayBuffer(n)||Kt.isTypedArray(n)?t&&typeof Blob=="function"?new Blob([n]):Buffer.from(n):n}function p(n,u,f){let s=n;if(n&&!f&&typeof n=="object"){if(Kt.endsWith(u,"{}"))u=x?u:u.slice(0,-2),n=JSON.stringify(n);else if(Kt.isArray(n)&&ED(n)||(Kt.isFileList(n)||Kt.endsWith(u,"[]"))&&(s=Kt.toArray(n)))return u=W2(u),s.forEach(function(d,v){!(Kt.isUndefined(d)||d===null)&&e.append(a===!0?hT([u],v,E):a===null?u:u+"[]",r(d))}),!1}return Ry(n)?!0:(e.append(hT(f,u,E),r(n)),!1)}const h=[],o=Object.assign(MD,{defaultVisitor:p,convertValue:r,isVisitable:Ry});function l(n,u){if(!Kt.isUndefined(n)){if(h.indexOf(n)!==-1)throw Error("Circular reference detected in "+u.join("."));h.push(n),Kt.forEach(n,function(s,c){(!(Kt.isUndefined(s)||s===null)&&T.call(e,s,Kt.isString(c)?c.trim():c,u,o))===!0&&l(s,u?u.concat(c):[c])}),h.pop()}}if(!Kt.isObject(g))throw new TypeError("data must be an object");return l(g),e}function uT(g){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(g).replace(/[!'()~]|%20|%00/g,function(x){return e[x]})}function jx(g,e){this._pairs=[],g&&Km(g,this,e)}const X2=jx.prototype;X2.append=function(e,i){this._pairs.push([e,i])};X2.toString=function(e){const i=e?function(x){return e.call(this,x,uT)}:uT;return this._pairs.map(function(T){return i(T[0])+"="+i(T[1])},"").join("&")};function CD(g){return encodeURIComponent(g).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y2(g,e,i){if(!e)return g;const x=i&&i.encode||CD,T=i&&i.serialize;let E;if(T?E=T(e,i):E=Kt.isURLSearchParams(e)?e.toString():new jx(e,i).toString(x),E){const a=g.indexOf("#");a!==-1&&(g=g.slice(0,a)),g+=(g.indexOf("?")===-1?"?":"&")+E}return g}class fT{constructor(){this.handlers=[]}use(e,i,x){return this.handlers.push({fulfilled:e,rejected:i,synchronous:x?x.synchronous:!1,runWhen:x?x.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Kt.forEach(this.handlers,function(x){x!==null&&e(x)})}}const k2={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},AD=typeof URLSearchParams<"u"?URLSearchParams:jx,wD=typeof FormData<"u"?FormData:null,PD=typeof Blob<"u"?Blob:null,RD={isBrowser:!0,classes:{URLSearchParams:AD,FormData:wD,Blob:PD},protocols:["http","https","file","blob","url","data"]},K2=typeof window<"u"&&typeof document<"u",LD=(g=>K2&&["ReactNative","NativeScript","NS"].indexOf(g)<0)(typeof navigator<"u"&&navigator.product),bD=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",FD=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:K2,hasStandardBrowserEnv:LD,hasStandardBrowserWebWorkerEnv:bD},Symbol.toStringTag,{value:"Module"})),ga={...FD,...RD};function OD(g,e){return Km(g,new ga.classes.URLSearchParams,Object.assign({visitor:function(i,x,T,E){return ga.isNode&&Kt.isBuffer(i)?(this.append(x,i.toString("base64")),!1):E.defaultVisitor.apply(this,arguments)}},e))}function DD(g){return Kt.matchAll(/\w+|\[(\w*)]/g,g).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ID(g){const e={},i=Object.keys(g);let x;const T=i.length;let E;for(x=0;x=i.length;return a=!a&&Kt.isArray(T)?T.length:a,t?(Kt.hasOwnProp(T,a)?T[a]=[T[a],x]:T[a]=x,!y):((!T[a]||!Kt.isObject(T[a]))&&(T[a]=[]),e(i,x,T[a],E)&&Kt.isArray(T[a])&&(T[a]=ID(T[a])),!y)}if(Kt.isFormData(g)&&Kt.isFunction(g.entries)){const i={};return Kt.forEachEntry(g,(x,T)=>{e(DD(x),T,i,0)}),i}return null}function ND(g,e,i){if(Kt.isString(g))try{return(e||JSON.parse)(g),Kt.trim(g)}catch(x){if(x.name!=="SyntaxError")throw x}return(i||JSON.stringify)(g)}const Zx={transitional:k2,adapter:["xhr","http"],transformRequest:[function(e,i){const x=i.getContentType()||"",T=x.indexOf("application/json")>-1,E=Kt.isObject(e);if(E&&Kt.isHTMLForm(e)&&(e=new FormData(e)),Kt.isFormData(e))return T?JSON.stringify(j2(e)):e;if(Kt.isArrayBuffer(e)||Kt.isBuffer(e)||Kt.isStream(e)||Kt.isFile(e)||Kt.isBlob(e))return e;if(Kt.isArrayBufferView(e))return e.buffer;if(Kt.isURLSearchParams(e))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let y;if(E){if(x.indexOf("application/x-www-form-urlencoded")>-1)return OD(e,this.formSerializer).toString();if((y=Kt.isFileList(e))||x.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Km(y?{"files[]":e}:e,t&&new t,this.formSerializer)}}return E||T?(i.setContentType("application/json",!1),ND(e)):e}],transformResponse:[function(e){const i=this.transitional||Zx.transitional,x=i&&i.forcedJSONParsing,T=this.responseType==="json";if(e&&Kt.isString(e)&&(x&&!this.responseType||T)){const a=!(i&&i.silentJSONParsing)&&T;try{return JSON.parse(e)}catch(y){if(a)throw y.name==="SyntaxError"?ui.from(y,ui.ERR_BAD_RESPONSE,this,null,this.response):y}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ga.classes.FormData,Blob:ga.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kt.forEach(["delete","get","head","post","put","patch"],g=>{Zx.headers[g]={}});const Jx=Zx,BD=Kt.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"]),UD=g=>{const e={};let i,x,T;return g&&g.split(` -`).forEach(function(a){T=a.indexOf(":"),i=a.substring(0,T).trim().toLowerCase(),x=a.substring(T+1).trim(),!(!i||e[i]&&BD[i])&&(i==="set-cookie"?e[i]?e[i].push(x):e[i]=[x]:e[i]=e[i]?e[i]+", "+x:x)}),e},cT=Symbol("internals");function yc(g){return g&&String(g).trim().toLowerCase()}function Yv(g){return g===!1||g==null?g:Kt.isArray(g)?g.map(Yv):String(g)}function zD(g){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let x;for(;x=i.exec(g);)e[x[1]]=x[2];return e}const GD=g=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(g.trim());function m0(g,e,i,x,T){if(Kt.isFunction(x))return x.call(this,e,i);if(T&&(e=i),!!Kt.isString(e)){if(Kt.isString(x))return e.indexOf(x)!==-1;if(Kt.isRegExp(x))return x.test(e)}}function VD(g){return g.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,i,x)=>i.toUpperCase()+x)}function HD(g,e){const i=Kt.toCamelCase(" "+e);["get","set","has"].forEach(x=>{Object.defineProperty(g,x+i,{value:function(T,E,a){return this[x].call(this,e,T,E,a)},configurable:!0})})}class jm{constructor(e){e&&this.set(e)}set(e,i,x){const T=this;function E(y,t,r){const p=yc(t);if(!p)throw new Error("header name must be a non-empty string");const h=Kt.findKey(T,p);(!h||T[h]===void 0||r===!0||r===void 0&&T[h]!==!1)&&(T[h||t]=Yv(y))}const a=(y,t)=>Kt.forEach(y,(r,p)=>E(r,p,t));return Kt.isPlainObject(e)||e instanceof this.constructor?a(e,i):Kt.isString(e)&&(e=e.trim())&&!GD(e)?a(UD(e),i):e!=null&&E(i,e,x),this}get(e,i){if(e=yc(e),e){const x=Kt.findKey(this,e);if(x){const T=this[x];if(!i)return T;if(i===!0)return zD(T);if(Kt.isFunction(i))return i.call(this,T,x);if(Kt.isRegExp(i))return i.exec(T);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,i){if(e=yc(e),e){const x=Kt.findKey(this,e);return!!(x&&this[x]!==void 0&&(!i||m0(this,this[x],x,i)))}return!1}delete(e,i){const x=this;let T=!1;function E(a){if(a=yc(a),a){const y=Kt.findKey(x,a);y&&(!i||m0(x,x[y],y,i))&&(delete x[y],T=!0)}}return Kt.isArray(e)?e.forEach(E):E(e),T}clear(e){const i=Object.keys(this);let x=i.length,T=!1;for(;x--;){const E=i[x];(!e||m0(this,this[E],E,e,!0))&&(delete this[E],T=!0)}return T}normalize(e){const i=this,x={};return Kt.forEach(this,(T,E)=>{const a=Kt.findKey(x,E);if(a){i[a]=Yv(T),delete i[E];return}const y=e?VD(E):String(E).trim();y!==E&&delete i[E],i[y]=Yv(T),x[y]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const i=Object.create(null);return Kt.forEach(this,(x,T)=>{x!=null&&x!==!1&&(i[T]=e&&Kt.isArray(x)?x.join(", "):x)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,i])=>e+": "+i).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...i){const x=new this(e);return i.forEach(T=>x.set(T)),x}static accessor(e){const x=(this[cT]=this[cT]={accessors:{}}).accessors,T=this.prototype;function E(a){const y=yc(a);x[y]||(HD(T,a),x[y]=!0)}return Kt.isArray(e)?e.forEach(E):E(e),this}}jm.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Kt.reduceDescriptors(jm.prototype,({value:g},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>g,set(x){this[i]=x}}});Kt.freezeMethods(jm);const ro=jm;function g0(g,e){const i=this||Jx,x=e||i,T=ro.from(x.headers);let E=x.data;return Kt.forEach(g,function(y){E=y.call(i,E,T.normalize(),e?e.status:void 0)}),T.normalize(),E}function Z2(g){return!!(g&&g.__CANCEL__)}function Ed(g,e,i){ui.call(this,g??"canceled",ui.ERR_CANCELED,e,i),this.name="CanceledError"}Kt.inherits(Ed,ui,{__CANCEL__:!0});function WD(g,e,i){const x=i.config.validateStatus;!i.status||!x||x(i.status)?g(i):e(new ui("Request failed with status code "+i.status,[ui.ERR_BAD_REQUEST,ui.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}const XD=ga.hasStandardBrowserEnv?{write(g,e,i,x,T,E){const a=[g+"="+encodeURIComponent(e)];Kt.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),Kt.isString(x)&&a.push("path="+x),Kt.isString(T)&&a.push("domain="+T),E===!0&&a.push("secure"),document.cookie=a.join("; ")},read(g){const e=document.cookie.match(new RegExp("(^|;\\s*)("+g+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(g){this.write(g,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YD(g){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(g)}function kD(g,e){return e?g.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):g}function J2(g,e){return g&&!YD(e)?kD(g,e):e}const KD=ga.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let x;function T(E){let a=E;return e&&(i.setAttribute("href",a),a=i.href),i.setAttribute("href",a),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return x=T(window.location.href),function(a){const y=Kt.isString(a)?T(a):a;return y.protocol===x.protocol&&y.host===x.host}}():function(){return function(){return!0}}();function jD(g){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(g);return e&&e[1]||""}function ZD(g,e){g=g||10;const i=new Array(g),x=new Array(g);let T=0,E=0,a;return e=e!==void 0?e:1e3,function(t){const r=Date.now(),p=x[E];a||(a=r),i[T]=t,x[T]=r;let h=E,o=0;for(;h!==T;)o+=i[h++],h=h%g;if(T=(T+1)%g,T===E&&(E=(E+1)%g),r-a{const E=T.loaded,a=T.lengthComputable?T.total:void 0,y=E-i,t=x(y),r=E<=a;i=E;const p={loaded:E,total:a,progress:a?E/a:void 0,bytes:y,rate:t||void 0,estimated:t&&a&&r?(a-E)/t:void 0,event:T};p[e?"download":"upload"]=!0,g(p)}}const JD=typeof XMLHttpRequest<"u",$D=JD&&function(g){return new Promise(function(i,x){let T=g.data;const E=ro.from(g.headers).normalize();let{responseType:a,withXSRFToken:y}=g,t;function r(){g.cancelToken&&g.cancelToken.unsubscribe(t),g.signal&&g.signal.removeEventListener("abort",t)}let p;if(Kt.isFormData(T)){if(ga.hasStandardBrowserEnv||ga.hasStandardBrowserWebWorkerEnv)E.setContentType(!1);else if((p=E.getContentType())!==!1){const[u,...f]=p?p.split(";").map(s=>s.trim()).filter(Boolean):[];E.setContentType([u||"multipart/form-data",...f].join("; "))}}let h=new XMLHttpRequest;if(g.auth){const u=g.auth.username||"",f=g.auth.password?unescape(encodeURIComponent(g.auth.password)):"";E.set("Authorization","Basic "+btoa(u+":"+f))}const o=J2(g.baseURL,g.url);h.open(g.method.toUpperCase(),Y2(o,g.params,g.paramsSerializer),!0),h.timeout=g.timeout;function l(){if(!h)return;const u=ro.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),s={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:u,config:g,request:h};WD(function(d){i(d),r()},function(d){x(d),r()},s),h=null}if("onloadend"in h?h.onloadend=l:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(l)},h.onabort=function(){h&&(x(new ui("Request aborted",ui.ECONNABORTED,g,h)),h=null)},h.onerror=function(){x(new ui("Network Error",ui.ERR_NETWORK,g,h)),h=null},h.ontimeout=function(){let f=g.timeout?"timeout of "+g.timeout+"ms exceeded":"timeout exceeded";const s=g.transitional||k2;g.timeoutErrorMessage&&(f=g.timeoutErrorMessage),x(new ui(f,s.clarifyTimeoutError?ui.ETIMEDOUT:ui.ECONNABORTED,g,h)),h=null},ga.hasStandardBrowserEnv&&(y&&Kt.isFunction(y)&&(y=y(g)),y||y!==!1&&KD(o))){const u=g.xsrfHeaderName&&g.xsrfCookieName&&XD.read(g.xsrfCookieName);u&&E.set(g.xsrfHeaderName,u)}T===void 0&&E.setContentType(null),"setRequestHeader"in h&&Kt.forEach(E.toJSON(),function(f,s){h.setRequestHeader(s,f)}),Kt.isUndefined(g.withCredentials)||(h.withCredentials=!!g.withCredentials),a&&a!=="json"&&(h.responseType=g.responseType),typeof g.onDownloadProgress=="function"&&h.addEventListener("progress",dT(g.onDownloadProgress,!0)),typeof g.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",dT(g.onUploadProgress)),(g.cancelToken||g.signal)&&(t=u=>{h&&(x(!u||u.type?new Ed(null,g,h):u),h.abort(),h=null)},g.cancelToken&&g.cancelToken.subscribe(t),g.signal&&(g.signal.aborted?t():g.signal.addEventListener("abort",t)));const n=jD(o);if(n&&ga.protocols.indexOf(n)===-1){x(new ui("Unsupported protocol "+n+":",ui.ERR_BAD_REQUEST,g));return}h.send(T||null)})},Ly={http:TD,xhr:$D};Kt.forEach(Ly,(g,e)=>{if(g){try{Object.defineProperty(g,"name",{value:e})}catch{}Object.defineProperty(g,"adapterName",{value:e})}});const pT=g=>`- ${g}`,QD=g=>Kt.isFunction(g)||g===null||g===!1,$2={getAdapter:g=>{g=Kt.isArray(g)?g:[g];const{length:e}=g;let i,x;const T={};for(let E=0;E`adapter ${y} `+(t===!1?"is not supported by the environment":"is not available in the build"));let a=e?E.length>1?`since : -`+E.map(pT).join(` -`):" "+pT(E[0]):"as no adapter specified";throw new ui("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return x},adapters:Ly};function y0(g){if(g.cancelToken&&g.cancelToken.throwIfRequested(),g.signal&&g.signal.aborted)throw new Ed(null,g)}function vT(g){return y0(g),g.headers=ro.from(g.headers),g.data=g0.call(g,g.transformRequest),["post","put","patch"].indexOf(g.method)!==-1&&g.headers.setContentType("application/x-www-form-urlencoded",!1),$2.getAdapter(g.adapter||Jx.adapter)(g).then(function(x){return y0(g),x.data=g0.call(g,g.transformResponse,x),x.headers=ro.from(x.headers),x},function(x){return Z2(x)||(y0(g),x&&x.response&&(x.response.data=g0.call(g,g.transformResponse,x.response),x.response.headers=ro.from(x.response.headers))),Promise.reject(x)})}const mT=g=>g instanceof ro?g.toJSON():g;function uf(g,e){e=e||{};const i={};function x(r,p,h){return Kt.isPlainObject(r)&&Kt.isPlainObject(p)?Kt.merge.call({caseless:h},r,p):Kt.isPlainObject(p)?Kt.merge({},p):Kt.isArray(p)?p.slice():p}function T(r,p,h){if(Kt.isUndefined(p)){if(!Kt.isUndefined(r))return x(void 0,r,h)}else return x(r,p,h)}function E(r,p){if(!Kt.isUndefined(p))return x(void 0,p)}function a(r,p){if(Kt.isUndefined(p)){if(!Kt.isUndefined(r))return x(void 0,r)}else return x(void 0,p)}function y(r,p,h){if(h in e)return x(r,p);if(h in g)return x(void 0,r)}const t={url:E,method:E,data:E,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:y,headers:(r,p)=>T(mT(r),mT(p),!0)};return Kt.forEach(Object.keys(Object.assign({},g,e)),function(p){const h=t[p]||T,o=h(g[p],e[p],p);Kt.isUndefined(o)&&h!==y||(i[p]=o)}),i}const Q2="1.6.7",$x={};["object","boolean","number","function","string","symbol"].forEach((g,e)=>{$x[g]=function(x){return typeof x===g||"a"+(e<1?"n ":" ")+g}});const gT={};$x.transitional=function(e,i,x){function T(E,a){return"[Axios v"+Q2+"] Transitional option '"+E+"'"+a+(x?". "+x:"")}return(E,a,y)=>{if(e===!1)throw new ui(T(a," has been removed"+(i?" in "+i:"")),ui.ERR_DEPRECATED);return i&&!gT[a]&&(gT[a]=!0,console.warn(T(a," has been deprecated since v"+i+" and will be removed in the near future"))),e?e(E,a,y):!0}};function _D(g,e,i){if(typeof g!="object")throw new ui("options must be an object",ui.ERR_BAD_OPTION_VALUE);const x=Object.keys(g);let T=x.length;for(;T-- >0;){const E=x[T],a=e[E];if(a){const y=g[E],t=y===void 0||a(y,E,g);if(t!==!0)throw new ui("option "+E+" must be "+t,ui.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new ui("Unknown option "+E,ui.ERR_BAD_OPTION)}}const by={assertOptions:_D,validators:$x},Yo=by.validators;class am{constructor(e){this.defaults=e,this.interceptors={request:new fT,response:new fT}}async request(e,i){try{return await this._request(e,i)}catch(x){if(x instanceof Error){let T;Error.captureStackTrace?Error.captureStackTrace(T={}):T=new Error;const E=T.stack?T.stack.replace(/^.+\n/,""):"";x.stack?E&&!String(x.stack).endsWith(E.replace(/^.+\n.+\n/,""))&&(x.stack+=` -`+E):x.stack=E}throw x}}_request(e,i){typeof e=="string"?(i=i||{},i.url=e):i=e||{},i=uf(this.defaults,i);const{transitional:x,paramsSerializer:T,headers:E}=i;x!==void 0&&by.assertOptions(x,{silentJSONParsing:Yo.transitional(Yo.boolean),forcedJSONParsing:Yo.transitional(Yo.boolean),clarifyTimeoutError:Yo.transitional(Yo.boolean)},!1),T!=null&&(Kt.isFunction(T)?i.paramsSerializer={serialize:T}:by.assertOptions(T,{encode:Yo.function,serialize:Yo.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let a=E&&Kt.merge(E.common,E[i.method]);E&&Kt.forEach(["delete","get","head","post","put","patch","common"],n=>{delete E[n]}),i.headers=ro.concat(a,E);const y=[];let t=!0;this.interceptors.request.forEach(function(u){typeof u.runWhen=="function"&&u.runWhen(i)===!1||(t=t&&u.synchronous,y.unshift(u.fulfilled,u.rejected))});const r=[];this.interceptors.response.forEach(function(u){r.push(u.fulfilled,u.rejected)});let p,h=0,o;if(!t){const n=[vT.bind(this),void 0];for(n.unshift.apply(n,y),n.push.apply(n,r),o=n.length,p=Promise.resolve(i);h{if(!x._listeners)return;let E=x._listeners.length;for(;E-- >0;)x._listeners[E](T);x._listeners=null}),this.promise.then=T=>{let E;const a=new Promise(y=>{x.subscribe(y),E=y}).then(T);return a.cancel=function(){x.unsubscribe(E)},a},e(function(E,a,y){x.reason||(x.reason=new Ed(E,a,y),i(x.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const i=this._listeners.indexOf(e);i!==-1&&this._listeners.splice(i,1)}static source(){let e;return{token:new Qx(function(T){e=T}),cancel:e}}}const qD=Qx;function tI(g){return function(i){return g.apply(null,i)}}function eI(g){return Kt.isObject(g)&&g.isAxiosError===!0}const Fy={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(Fy).forEach(([g,e])=>{Fy[e]=g});const iI=Fy;function _2(g){const e=new kv(g),i=O2(kv.prototype.request,e);return Kt.extend(i,kv.prototype,e,{allOwnKeys:!0}),Kt.extend(i,e,null,{allOwnKeys:!0}),i.create=function(T){return _2(uf(g,T))},i}const Mn=_2(Jx);Mn.Axios=kv;Mn.CanceledError=Ed;Mn.CancelToken=qD;Mn.isCancel=Z2;Mn.VERSION=Q2;Mn.toFormData=Km;Mn.AxiosError=ui;Mn.Cancel=Mn.CanceledError;Mn.all=function(e){return Promise.all(e)};Mn.spread=tI;Mn.isAxiosError=eI;Mn.mergeConfig=uf;Mn.AxiosHeaders=ro;Mn.formToJSON=g=>j2(Kt.isHTMLForm(g)?new FormData(g):g);Mn.getAdapter=$2.getAdapter;Mn.HttpStatusCode=iI;Mn.default=Mn;const Qu="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function nI(g,e,i){for(;g.length=0;x--){const T=g%Qu.length;i=Qu.charAt(T)+i,g=Math.floor(g/Qu.length)}return nI(i,e,Qu[0])}function _x(){const g=Date.now(),e=aI(g,10),i=sI(16);return e+i}const oI={id:"",title:"",description:"",journals:[],isComplete:!1,reward:""},lI={backpack:[],equipment:{head:null,body:null,legs:null,feet:null,hands:null,weapon:null,shield:null,accessory:null}},q2={},hI={inCombat:!1,isDead:!1,isResting:!1,activeBoosts:{}},uI={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"},fI={stats:uI,inventory:lI,state:hI},cI={tooltipItem:{id:null,position:{x:0,y:0}},submenuItem:{id:null,position:{x:0,y:0}},tooltipNPC:{id:null,position:{x:0,y:0}},isStatsMenuCollapsed:!1},dI={gamemode:"Idle",action:{type:"ROLL_DICE",diceValues:[],isRolling:!1},textures:{side1:"",side2:"",side3:"",side4:"",side5:"",side6:""}},pI=g=>{kn(async()=>{or.set({...or.get(),[g.id]:g})})},vI=g=>{kn(async()=>{const e=or.get(),{[g]:i,...x}=e;or.set(x)})};function Dh(g,e){return xb(g,e,{encode(i){return JSON.stringify(i)},decode(i){try{return JSON.parse(i)}catch{return e}}})}const Ni=Dh("playerData",fI),mI=Dh("quest",oI),or=Dh("items",q2),$l=Dh("notifications",[]),tC=Dh("itemDB",q2),om=Dh("settings",cI),$c=Dh("minigameState",dI),Ql=g=>om.get()[g],xc=(g,e)=>{kn(async()=>{const i=om.get();om.set({...i,[g]:e})})},gI=()=>{kn(async()=>{try{const e=(await Mn.get("https://kbve.com/api/itemdb.json")).data,i={};Object.keys(e.key).forEach(x=>{const T=e.key[x];i[T.id]=T,i[T.name]=T}),tC.set(i)}catch(g){console.error("Failed to reload item database:",g)}})},yI=g=>tC.get()[g],xI=g=>{kn(async()=>{const e=Ni.get();e.inventory.backpack.push(g),Ni.set({...e})})},to=g=>{const i=or.get()[g];if(i)return i;console.warn(`Item with ID ${g} not found.`)},SI=g=>{kn(async()=>{const e=_x(),i={...g,id:e};pI(i),xI(i.id),_e.emit("notification",{title:"Success",message:`You got a ${i.name}, verified by E Corp ID ${i.id}`,notificationType:Rh.success})})},TI=(g,e)=>{kn(async()=>{const i=Ni.get(),x=or.get()[e];if(x){const T=i.inventory.equipment[g];if(T){const E=or.get()[T];E.equipped=!1,or.set({...or.get(),[E.id]:E})}x.equipped=!0,or.set({...or.get(),[x.id]:x}),i.inventory.equipment[g]=e,Ni.set({...i})}})},EI=g=>{kn(async()=>{const e=Ni.get(),i=e.inventory.equipment[g];if(i){const x=or.get()[i];x&&(x.equipped=!1,or.set({...or.get(),[x.id]:x}),e.inventory.equipment[g]=null,Ni.set({...e}))}})},yT=g=>{kn(async()=>{const e=Ni.get(),i=or.get()[g];i&&!i.equipped?(e.inventory.backpack=e.inventory.backpack.filter(x=>x!==g),Ni.set({...e}),vI(g)):_e.emit("notification",{title:"Warning",message:"Cannot remove item that is currently equipped.",notificationType:Rh.warning})})},eC=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.health,10),x=Math.max(i-g,0);e.stats={...e.stats,health:x.toString()},Ni.set({...e})})},MI=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.health,10),x=parseInt(e.stats.maxHealth,10),T=Math.min(i+g,x);e.stats={...e.stats,health:T.toString()},Ni.set({...e})})},CI=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.mana,10),x=Math.max(i-g,0);e.stats={...e.stats,mana:x.toString()},Ni.set({...e})})},AI=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.mana,10),x=parseInt(e.stats.maxMana,10),T=Math.min(i+g,x);e.stats={...e.stats,mana:T.toString()},Ni.set({...e})})},wI=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.energy,10),x=Math.max(i-g,0);e.stats={...e.stats,energy:x.toString()},Ni.set({...e})})},PI=g=>{kn(async()=>{const e=Ni.get(),i=parseInt(e.stats.energy,10),x=parseInt(e.stats.maxEnergy,10),T=Math.min(i+g,x);e.stats={...e.stats,energy:T.toString()},Ni.set({...e})})},RI=g=>{if(g.health!==void 0){const e=parseInt(g.health,10);e>0?MI(e):eC(Math.abs(e))}if(g.mana!==void 0){const e=parseInt(g.mana,10);e>0?AI(e):CI(Math.abs(e))}if(g.energy!==void 0){const e=parseInt(g.energy,10);e>0?PI(e):wI(Math.abs(e))}},LI=async g=>{const e=_x();kn(async()=>{const i=Ni.get();i.state.activeBoosts[e]={...g,expiry:Date.now()+g.duration*1e3},Ni.set({...i})})},bI=g=>{kn(async()=>{const e=Ni.get(),i=g.bonuses,x={health:i?.health!==void 0?i.health.toString():void 0,mana:i?.mana!==void 0?i.mana.toString():void 0,energy:i?.energy!==void 0?i.energy.toString():void 0};RI(x),g.boost&&LI(g.boost),g.action&&console.log(`Action: ${g.action}`),Ni.set({...e})})},FI=g=>{const e=to(g);if(!e)return[];const i=["view","discard"];return e.consumable&&i.push("consume"),e.equipped?i.push("unequip"):e.consumable||i.push("equip"),i},Rh={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"}};function Md(g){try{kn(async()=>{const e=$c.get();$c.set({...e,...g})})}catch(e){console.error("Error updating minigame state:",e)}}function OI(g){Md({gamemode:g})}function DI(g){Md({action:g})}function II(g){Md({textures:g})}function iC(g){const e=$c.get();e.gamemode==="Dice"&&e.action.type==="ROLL_DICE"&&Md({action:{...e.action,diceValues:g}})}function xT(g){const e=$c.get();e.gamemode==="Dice"&&e.action.type==="ROLL_DICE"&&Md({action:{...e.action,isRolling:g}})}const NI=({styleClass:g,size:e=32,color:i="#000",onClick:x,...T})=>Xt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",width:e,height:e,className:g,onClick:x,...T,children:Xt.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11.493 8.757L8.039 5.304 5.374 7.969l3.454 3.453-2.59 2.59 7.797.004-.017-7.784-2.525 2.525zm11.679 2.665l3.454-3.453-2.665-2.665-3.454 3.453-2.525-2.525-.017 7.784 7.797-.004-2.59-2.59zM8.828 20.578l-3.454 3.453 2.665 2.665 3.454-3.453 2.526 2.525.017-7.784-7.797.004 2.589 2.59zm16.934-2.59l-7.797-.004.017 7.784 2.525-2.525 3.454 3.453 2.665-2.665-3.454-3.453 2.59-2.59z"})}),BI=({styleClass:g,size:e=24,color:i="#000",onClick:x,...T})=>Xt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:e,height:e,className:g,onClick:x,...T,children:Xt.jsx("path",{stroke:i,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8.5V4m0 0h4.5M4 4l5.5 5.5m10.5-1V4m0 0h-4.5M20 4l-5.5 5.5M4 15.5V20m0 0h4.5M4 20l5.5-5.5m10.5 1V20m0 0h-4.5m4.5 0l-5.5-5.5"})});/** - * @license - * Copyright 2010-2023 Three.js Authors - * SPDX-License-Identifier: MIT - */const Zm="161",UI={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},zI={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nC=0,Oy=1,rC=2,GI=3,sC=0,Jm=1,Vc=2,ks=3,ao=0,Cr=1,ma=2,so=0,Sh=1,Dy=2,Iy=3,Ny=4,aC=5,tl=100,oC=101,lC=102,By=103,Uy=104,hC=200,uC=201,fC=202,cC=203,lm=204,hm=205,dC=206,pC=207,vC=208,mC=209,gC=210,yC=211,xC=212,SC=213,TC=214,EC=0,MC=1,CC=2,Qc=3,AC=4,wC=5,PC=6,RC=7,Cd=0,LC=1,bC=2,Sa=0,FC=1,OC=2,DC=3,qx=4,IC=5,NC=6,zy="attached",BC="detached",$m=300,oo=301,ll=302,_c=303,qc=304,yf=306,td=1e3,lr=1001,ed=1002,cn=1003,um=1004,VI=1004,dh=1005,HI=1005,Ki=1006,Hc=1007,WI=1007,ya=1008,XI=1008,Ta=1009,UC=1010,zC=1011,Qm=1012,t1=1013,eo=1014,Ps=1015,ff=1016,e1=1017,i1=1018,nl=1020,GC=1021,Er=1023,VC=1024,HC=1025,rl=1026,Lh=1027,WC=1028,n1=1029,XC=1030,r1=1031,s1=1033,Kv=33776,jv=33777,Zv=33778,Jv=33779,Gy=35840,Vy=35841,Hy=35842,Wy=35843,a1=36196,Xy=37492,Yy=37496,ky=37808,Ky=37809,jy=37810,Zy=37811,Jy=37812,$y=37813,Qy=37814,_y=37815,qy=37816,tx=37817,ex=37818,ix=37819,nx=37820,rx=37821,$v=36492,sx=36494,ax=36495,YC=36283,ox=36284,lx=36285,hx=36286,kC=2200,KC=2201,jC=2202,id=2300,nd=2301,Qv=2302,mh=2400,gh=2401,rd=2402,_m=2500,o1=2501,YI=0,kI=1,KI=2,l1=3e3,sl=3001,ZC=3200,JC=3201,fl=0,$C=1,rs="",Ln="srgb",Ma="srgb-linear",qm="display-p3",Ad="display-p3-linear",sd="linear",Di="srgb",ad="rec709",od="p3",jI=0,fh=7680,ZI=7681,JI=7682,$I=7683,QI=34055,_I=34056,qI=5386,t5=512,e5=513,i5=514,n5=515,r5=516,s5=517,a5=518,ux=519,QC=512,_C=513,qC=514,h1=515,tA=516,eA=517,iA=518,nA=519,ld=35044,o5=35048,l5=35040,h5=35045,u5=35049,f5=35041,c5=35046,d5=35050,p5=35042,v5="100",fx="300 es",fm=1035,xa=2e3,hd=2001;class ho{addEventListener(e,i){this._listeners===void 0&&(this._listeners={});const x=this._listeners;x[e]===void 0&&(x[e]=[]),x[e].indexOf(i)===-1&&x[e].push(i)}hasEventListener(e,i){if(this._listeners===void 0)return!1;const x=this._listeners;return x[e]!==void 0&&x[e].indexOf(i)!==-1}removeEventListener(e,i){if(this._listeners===void 0)return;const T=this._listeners[e];if(T!==void 0){const E=T.indexOf(i);E!==-1&&T.splice(E,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const x=this._listeners[e.type];if(x!==void 0){e.target=this;const T=x.slice(0);for(let E=0,a=T.length;E>8&255]+rr[g>>16&255]+rr[g>>24&255]+"-"+rr[e&255]+rr[e>>8&255]+"-"+rr[e>>16&15|64]+rr[e>>24&255]+"-"+rr[i&63|128]+rr[i>>8&255]+"-"+rr[i>>16&255]+rr[i>>24&255]+rr[x&255]+rr[x>>8&255]+rr[x>>16&255]+rr[x>>24&255]).toLowerCase()}function nn(g,e,i){return Math.max(e,Math.min(i,g))}function u1(g,e){return(g%e+e)%e}function m5(g,e,i,x,T){return x+(g-e)*(T-x)/(i-e)}function g5(g,e,i){return g!==e?(i-g)/(e-g):0}function Wc(g,e,i){return(1-i)*g+i*e}function y5(g,e,i,x){return Wc(g,e,1-Math.exp(-i*x))}function x5(g,e=1){return e-Math.abs(u1(g,e*2)-e)}function S5(g,e,i){return g<=e?0:g>=i?1:(g=(g-e)/(i-e),g*g*(3-2*g))}function T5(g,e,i){return g<=e?0:g>=i?1:(g=(g-e)/(i-e),g*g*g*(g*(g*6-15)+10))}function E5(g,e){return g+Math.floor(Math.random()*(e-g+1))}function M5(g,e){return g+Math.random()*(e-g)}function C5(g){return g*(.5-Math.random())}function A5(g){g!==void 0&&(ST=g);let e=ST+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function w5(g){return g*Th}function P5(g){return g*cf}function cx(g){return(g&g-1)===0&&g!==0}function R5(g){return Math.pow(2,Math.ceil(Math.log(g)/Math.LN2))}function cm(g){return Math.pow(2,Math.floor(Math.log(g)/Math.LN2))}function L5(g,e,i,x,T){const E=Math.cos,a=Math.sin,y=E(i/2),t=a(i/2),r=E((e+x)/2),p=a((e+x)/2),h=E((e-x)/2),o=a((e-x)/2),l=E((x-e)/2),n=a((x-e)/2);switch(T){case"XYX":g.set(y*p,t*h,t*o,y*r);break;case"YZY":g.set(t*o,y*p,t*h,y*r);break;case"ZXZ":g.set(t*h,t*o,y*p,y*r);break;case"XZX":g.set(y*p,t*n,t*l,y*r);break;case"YXY":g.set(t*l,y*p,t*n,y*r);break;case"ZYZ":g.set(t*n,t*l,y*p,y*r);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+T)}}function Mr(g,e){switch(e.constructor){case Float32Array:return g;case Uint32Array:return g/4294967295;case Uint16Array:return g/65535;case Uint8Array:return g/255;case Int32Array:return Math.max(g/2147483647,-1);case Int16Array:return Math.max(g/32767,-1);case Int8Array:return Math.max(g/127,-1);default:throw new Error("Invalid component type.")}}function $e(g,e){switch(e.constructor){case Float32Array:return g;case Uint32Array:return Math.round(g*4294967295);case Uint16Array:return Math.round(g*65535);case Uint8Array:return Math.round(g*255);case Int32Array:return Math.round(g*2147483647);case Int16Array:return Math.round(g*32767);case Int8Array:return Math.round(g*127);default:throw new Error("Invalid component type.")}}const _v={DEG2RAD:Th,RAD2DEG:cf,generateUUID:as,clamp:nn,euclideanModulo:u1,mapLinear:m5,inverseLerp:g5,lerp:Wc,damp:y5,pingpong:x5,smoothstep:S5,smootherstep:T5,randInt:E5,randFloat:M5,randFloatSpread:C5,seededRandom:A5,degToRad:w5,radToDeg:P5,isPowerOfTwo:cx,ceilPowerOfTwo:R5,floorPowerOfTwo:cm,setQuaternionFromProperEuler:L5,normalize:$e,denormalize:Mr};class jt{constructor(e=0,i=0){jt.prototype.isVector2=!0,this.x=e,this.y=i}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,i){return this.x=e,this.y=i,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const i=this.x,x=this.y,T=e.elements;return this.x=T[0]*i+T[3]*x+T[6],this.y=T[1]*i+T[4]*x+T[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,i){return this.x=Math.max(e.x,Math.min(i.x,this.x)),this.y=Math.max(e.y,Math.min(i.y,this.y)),this}clampScalar(e,i){return this.x=Math.max(e,Math.min(i,this.x)),this.y=Math.max(e,Math.min(i,this.y)),this}clampLength(e,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(e,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const i=Math.sqrt(this.lengthSq()*e.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(e)/i;return Math.acos(nn(x,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,x=this.y-e.y;return i*i+x*x}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this}lerpVectors(e,i,x){return this.x=e.x+(i.x-e.x)*x,this.y=e.y+(i.y-e.y)*x,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this}rotateAround(e,i){const x=Math.cos(i),T=Math.sin(i),E=this.x-e.x,a=this.y-e.y;return this.x=E*x-a*T+e.x,this.y=E*T+a*x+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class ni{constructor(e,i,x,T,E,a,y,t,r){ni.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,i,x,T,E,a,y,t,r)}set(e,i,x,T,E,a,y,t,r){const p=this.elements;return p[0]=e,p[1]=T,p[2]=y,p[3]=i,p[4]=E,p[5]=t,p[6]=x,p[7]=a,p[8]=r,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const i=this.elements,x=e.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],this}extractBasis(e,i,x){return e.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),x.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const i=e.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,i){const x=e.elements,T=i.elements,E=this.elements,a=x[0],y=x[3],t=x[6],r=x[1],p=x[4],h=x[7],o=x[2],l=x[5],n=x[8],u=T[0],f=T[3],s=T[6],c=T[1],d=T[4],v=T[7],m=T[2],S=T[5],M=T[8];return E[0]=a*u+y*c+t*m,E[3]=a*f+y*d+t*S,E[6]=a*s+y*v+t*M,E[1]=r*u+p*c+h*m,E[4]=r*f+p*d+h*S,E[7]=r*s+p*v+h*M,E[2]=o*u+l*c+n*m,E[5]=o*f+l*d+n*S,E[8]=o*s+l*v+n*M,this}multiplyScalar(e){const i=this.elements;return i[0]*=e,i[3]*=e,i[6]*=e,i[1]*=e,i[4]*=e,i[7]*=e,i[2]*=e,i[5]*=e,i[8]*=e,this}determinant(){const e=this.elements,i=e[0],x=e[1],T=e[2],E=e[3],a=e[4],y=e[5],t=e[6],r=e[7],p=e[8];return i*a*p-i*y*r-x*E*p+x*y*t+T*E*r-T*a*t}invert(){const e=this.elements,i=e[0],x=e[1],T=e[2],E=e[3],a=e[4],y=e[5],t=e[6],r=e[7],p=e[8],h=p*a-y*r,o=y*t-p*E,l=r*E-a*t,n=i*h+x*o+T*l;if(n===0)return this.set(0,0,0,0,0,0,0,0,0);const u=1/n;return e[0]=h*u,e[1]=(T*r-p*x)*u,e[2]=(y*x-T*a)*u,e[3]=o*u,e[4]=(p*i-T*t)*u,e[5]=(T*E-y*i)*u,e[6]=l*u,e[7]=(x*t-r*i)*u,e[8]=(a*i-x*E)*u,this}transpose(){let e;const i=this.elements;return e=i[1],i[1]=i[3],i[3]=e,e=i[2],i[2]=i[6],i[6]=e,e=i[5],i[5]=i[7],i[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const i=this.elements;return e[0]=i[0],e[1]=i[3],e[2]=i[6],e[3]=i[1],e[4]=i[4],e[5]=i[7],e[6]=i[2],e[7]=i[5],e[8]=i[8],this}setUvTransform(e,i,x,T,E,a,y){const t=Math.cos(E),r=Math.sin(E);return this.set(x*t,x*r,-x*(t*a+r*y)+a+e,-T*r,T*t,-T*(-r*a+t*y)+y+i,0,0,1),this}scale(e,i){return this.premultiply(x0.makeScale(e,i)),this}rotate(e){return this.premultiply(x0.makeRotation(-e)),this}translate(e,i){return this.premultiply(x0.makeTranslation(e,i)),this}makeTranslation(e,i){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,i,0,0,1),this}makeRotation(e){const i=Math.cos(e),x=Math.sin(e);return this.set(i,-x,0,x,i,0,0,0,1),this}makeScale(e,i){return this.set(e,0,0,0,i,0,0,0,1),this}equals(e){const i=this.elements,x=e.elements;for(let T=0;T<9;T++)if(i[T]!==x[T])return!1;return!0}fromArray(e,i=0){for(let x=0;x<9;x++)this.elements[x]=e[x+i];return this}toArray(e=[],i=0){const x=this.elements;return e[i]=x[0],e[i+1]=x[1],e[i+2]=x[2],e[i+3]=x[3],e[i+4]=x[4],e[i+5]=x[5],e[i+6]=x[6],e[i+7]=x[7],e[i+8]=x[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const x0=new ni;function rA(g){for(let e=g.length-1;e>=0;--e)if(g[e]>=65535)return!0;return!1}const b5={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function _u(g,e){return new b5[g](e)}function ud(g){return document.createElementNS("http://www.w3.org/1999/xhtml",g)}function sA(){const g=ud("canvas");return g.style.display="block",g}const TT={};function Eh(g){g in TT||(TT[g]=!0,console.warn(g))}const ET=new ni().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),MT=new ni().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),Kp={[Ma]:{transfer:sd,primaries:ad,toReference:g=>g,fromReference:g=>g},[Ln]:{transfer:Di,primaries:ad,toReference:g=>g.convertSRGBToLinear(),fromReference:g=>g.convertLinearToSRGB()},[Ad]:{transfer:sd,primaries:od,toReference:g=>g.applyMatrix3(MT),fromReference:g=>g.applyMatrix3(ET)},[qm]:{transfer:Di,primaries:od,toReference:g=>g.convertSRGBToLinear().applyMatrix3(MT),fromReference:g=>g.applyMatrix3(ET).convertLinearToSRGB()}},F5=new Set([Ma,Ad]),xi={enabled:!0,_workingColorSpace:Ma,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(g){if(!F5.has(g))throw new Error(`Unsupported working color space, "${g}".`);this._workingColorSpace=g},convert:function(g,e,i){if(this.enabled===!1||e===i||!e||!i)return g;const x=Kp[e].toReference,T=Kp[i].fromReference;return T(x(g))},fromWorkingColorSpace:function(g,e){return this.convert(g,this._workingColorSpace,e)},toWorkingColorSpace:function(g,e){return this.convert(g,e,this._workingColorSpace)},getPrimaries:function(g){return Kp[g].primaries},getTransfer:function(g){return g===rs?sd:Kp[g].transfer}};function af(g){return g<.04045?g*.0773993808:Math.pow(g*.9478672986+.0521327014,2.4)}function S0(g){return g<.0031308?g*12.92:1.055*Math.pow(g,.41666)-.055}let Cu;class f1{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{Cu===void 0&&(Cu=ud("canvas")),Cu.width=e.width,Cu.height=e.height;const x=Cu.getContext("2d");e instanceof ImageData?x.putImageData(e,0,0):x.drawImage(e,0,0,e.width,e.height),i=Cu}return i.width>2048||i.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),i.toDataURL("image/jpeg",.6)):i.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const i=ud("canvas");i.width=e.width,i.height=e.height;const x=i.getContext("2d");x.drawImage(e,0,0,e.width,e.height);const T=x.getImageData(0,0,e.width,e.height),E=T.data;for(let a=0;a0&&(x.userData=this.userData),i||(e.textures[this.uuid]=x),x}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$m)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case td:e.x=e.x-Math.floor(e.x);break;case lr:e.x=e.x<0?0:1;break;case ed:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case td:e.y=e.y-Math.floor(e.y);break;case lr:e.y=e.y<0?0:1;break;case ed:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Eh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Ln?sl:l1}set encoding(e){Eh("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===sl?Ln:rs}}Zi.DEFAULT_IMAGE=null;Zi.DEFAULT_MAPPING=$m;Zi.DEFAULT_ANISOTROPY=1;class Si{constructor(e=0,i=0,x=0,T=1){Si.prototype.isVector4=!0,this.x=e,this.y=i,this.z=x,this.w=T}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,i,x,T){return this.x=e,this.y=i,this.z=x,this.w=T,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this.z=e.z+i.z,this.w=e.w+i.w,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this.z+=e.z*i,this.w+=e.w*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this.z=e.z-i.z,this.w=e.w-i.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const i=this.x,x=this.y,T=this.z,E=this.w,a=e.elements;return this.x=a[0]*i+a[4]*x+a[8]*T+a[12]*E,this.y=a[1]*i+a[5]*x+a[9]*T+a[13]*E,this.z=a[2]*i+a[6]*x+a[10]*T+a[14]*E,this.w=a[3]*i+a[7]*x+a[11]*T+a[15]*E,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const i=Math.sqrt(1-e.w*e.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/i,this.y=e.y/i,this.z=e.z/i),this}setAxisAngleFromRotationMatrix(e){let i,x,T,E;const t=e.elements,r=t[0],p=t[4],h=t[8],o=t[1],l=t[5],n=t[9],u=t[2],f=t[6],s=t[10];if(Math.abs(p-o)<.01&&Math.abs(h-u)<.01&&Math.abs(n-f)<.01){if(Math.abs(p+o)<.1&&Math.abs(h+u)<.1&&Math.abs(n+f)<.1&&Math.abs(r+l+s-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;const d=(r+1)/2,v=(l+1)/2,m=(s+1)/2,S=(p+o)/4,M=(h+u)/4,A=(n+f)/4;return d>v&&d>m?d<.01?(x=0,T=.707106781,E=.707106781):(x=Math.sqrt(d),T=S/x,E=M/x):v>m?v<.01?(x=.707106781,T=0,E=.707106781):(T=Math.sqrt(v),x=S/T,E=A/T):m<.01?(x=.707106781,T=.707106781,E=0):(E=Math.sqrt(m),x=M/E,T=A/E),this.set(x,T,E,i),this}let c=Math.sqrt((f-n)*(f-n)+(h-u)*(h-u)+(o-p)*(o-p));return Math.abs(c)<.001&&(c=1),this.x=(f-n)/c,this.y=(h-u)/c,this.z=(o-p)/c,this.w=Math.acos((r+l+s-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,i){return this.x=Math.max(e.x,Math.min(i.x,this.x)),this.y=Math.max(e.y,Math.min(i.y,this.y)),this.z=Math.max(e.z,Math.min(i.z,this.z)),this.w=Math.max(e.w,Math.min(i.w,this.w)),this}clampScalar(e,i){return this.x=Math.max(e,Math.min(i,this.x)),this.y=Math.max(e,Math.min(i,this.y)),this.z=Math.max(e,Math.min(i,this.z)),this.w=Math.max(e,Math.min(i,this.w)),this}clampLength(e,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(e,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this.z+=(e.z-this.z)*i,this.w+=(e.w-this.w)*i,this}lerpVectors(e,i,x){return this.x=e.x+(i.x-e.x)*x,this.y=e.y+(i.y-e.y)*x,this.z=e.z+(i.z-e.z)*x,this.w=e.w+(i.w-e.w)*x,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this.w=e[i+3],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e[i+3]=this.w,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this.z=e.getZ(i),this.w=e.getW(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class aA extends ho{constructor(e=1,i=1,x={}){super(),this.isRenderTarget=!0,this.width=e,this.height=i,this.depth=1,this.scissor=new Si(0,0,e,i),this.scissorTest=!1,this.viewport=new Si(0,0,e,i);const T={width:e,height:i,depth:1};x.encoding!==void 0&&(Eh("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),x.colorSpace=x.encoding===sl?Ln:rs),x=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Ki,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},x),this.texture=new Zi(T,x.mapping,x.wrapS,x.wrapT,x.magFilter,x.minFilter,x.format,x.type,x.anisotropy,x.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=x.generateMipmaps,this.texture.internalFormat=x.internalFormat,this.depthBuffer=x.depthBuffer,this.stencilBuffer=x.stencilBuffer,this.depthTexture=x.depthTexture,this.samples=x.samples}setSize(e,i,x=1){(this.width!==e||this.height!==i||this.depth!==x)&&(this.width=e,this.height=i,this.depth=x,this.texture.image.width=e,this.texture.image.height=i,this.texture.image.depth=x,this.dispose()),this.viewport.set(0,0,e,i),this.scissor.set(0,0,e,i)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const i=Object.assign({},e.texture.image);return this.texture.source=new yh(i),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Js extends aA{constructor(e=1,i=1,x={}){super(e,i,x),this.isWebGLRenderTarget=!0}}class tg extends Zi{constructor(e=null,i=1,x=1,T=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:i,height:x,depth:T},this.magFilter=cn,this.minFilter=cn,this.wrapR=lr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class I5 extends Js{constructor(e=1,i=1,x=1,T={}){super(e,i,T),this.isWebGLArrayRenderTarget=!0,this.depth=x,this.texture=new tg(null,e,i,x),this.texture.isRenderTargetTexture=!0}}class c1 extends Zi{constructor(e=null,i=1,x=1,T=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:i,height:x,depth:T},this.magFilter=cn,this.minFilter=cn,this.wrapR=lr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class N5 extends Js{constructor(e=1,i=1,x=1,T={}){super(e,i,T),this.isWebGL3DRenderTarget=!0,this.depth=x,this.texture=new c1(null,e,i,x),this.texture.isRenderTargetTexture=!0}}class B5 extends Js{constructor(e=1,i=1,x=1,T={}){super(e,i,T),this.isWebGLMultipleRenderTargets=!0;const E=this.texture;this.texture=[];for(let a=0;a=0?1:-1,d=1-s*s;if(d>Number.EPSILON){const m=Math.sqrt(d),S=Math.atan2(m,s*c);f=Math.sin(f*S)/m,y=Math.sin(y*S)/m}const v=y*c;if(t=t*f+o*v,r=r*f+l*v,p=p*f+n*v,h=h*f+u*v,f===1-y){const m=1/Math.sqrt(t*t+r*r+p*p+h*h);t*=m,r*=m,p*=m,h*=m}}e[i]=t,e[i+1]=r,e[i+2]=p,e[i+3]=h}static multiplyQuaternionsFlat(e,i,x,T,E,a){const y=x[T],t=x[T+1],r=x[T+2],p=x[T+3],h=E[a],o=E[a+1],l=E[a+2],n=E[a+3];return e[i]=y*n+p*h+t*l-r*o,e[i+1]=t*n+p*o+r*h-y*l,e[i+2]=r*n+p*l+y*o-t*h,e[i+3]=p*n-y*h-t*o-r*l,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,i,x,T){return this._x=e,this._y=i,this._z=x,this._w=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,i=!0){const x=e._x,T=e._y,E=e._z,a=e._order,y=Math.cos,t=Math.sin,r=y(x/2),p=y(T/2),h=y(E/2),o=t(x/2),l=t(T/2),n=t(E/2);switch(a){case"XYZ":this._x=o*p*h+r*l*n,this._y=r*l*h-o*p*n,this._z=r*p*n+o*l*h,this._w=r*p*h-o*l*n;break;case"YXZ":this._x=o*p*h+r*l*n,this._y=r*l*h-o*p*n,this._z=r*p*n-o*l*h,this._w=r*p*h+o*l*n;break;case"ZXY":this._x=o*p*h-r*l*n,this._y=r*l*h+o*p*n,this._z=r*p*n+o*l*h,this._w=r*p*h-o*l*n;break;case"ZYX":this._x=o*p*h-r*l*n,this._y=r*l*h+o*p*n,this._z=r*p*n-o*l*h,this._w=r*p*h+o*l*n;break;case"YZX":this._x=o*p*h+r*l*n,this._y=r*l*h+o*p*n,this._z=r*p*n-o*l*h,this._w=r*p*h-o*l*n;break;case"XZY":this._x=o*p*h-r*l*n,this._y=r*l*h-o*p*n,this._z=r*p*n+o*l*h,this._w=r*p*h+o*l*n;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return i===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,i){const x=i/2,T=Math.sin(x);return this._x=e.x*T,this._y=e.y*T,this._z=e.z*T,this._w=Math.cos(x),this._onChangeCallback(),this}setFromRotationMatrix(e){const i=e.elements,x=i[0],T=i[4],E=i[8],a=i[1],y=i[5],t=i[9],r=i[2],p=i[6],h=i[10],o=x+y+h;if(o>0){const l=.5/Math.sqrt(o+1);this._w=.25/l,this._x=(p-t)*l,this._y=(E-r)*l,this._z=(a-T)*l}else if(x>y&&x>h){const l=2*Math.sqrt(1+x-y-h);this._w=(p-t)/l,this._x=.25*l,this._y=(T+a)/l,this._z=(E+r)/l}else if(y>h){const l=2*Math.sqrt(1+y-x-h);this._w=(E-r)/l,this._x=(T+a)/l,this._y=.25*l,this._z=(t+p)/l}else{const l=2*Math.sqrt(1+h-x-y);this._w=(a-T)/l,this._x=(E+r)/l,this._y=(t+p)/l,this._z=.25*l}return this._onChangeCallback(),this}setFromUnitVectors(e,i){let x=e.dot(i)+1;return xMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=x):(this._x=0,this._y=-e.z,this._z=e.y,this._w=x)):(this._x=e.y*i.z-e.z*i.y,this._y=e.z*i.x-e.x*i.z,this._z=e.x*i.y-e.y*i.x,this._w=x),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(nn(this.dot(e),-1,1)))}rotateTowards(e,i){const x=this.angleTo(e);if(x===0)return this;const T=Math.min(1,i/x);return this.slerp(e,T),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,i){const x=e._x,T=e._y,E=e._z,a=e._w,y=i._x,t=i._y,r=i._z,p=i._w;return this._x=x*p+a*y+T*r-E*t,this._y=T*p+a*t+E*y-x*r,this._z=E*p+a*r+x*t-T*y,this._w=a*p-x*y-T*t-E*r,this._onChangeCallback(),this}slerp(e,i){if(i===0)return this;if(i===1)return this.copy(e);const x=this._x,T=this._y,E=this._z,a=this._w;let y=a*e._w+x*e._x+T*e._y+E*e._z;if(y<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,y=-y):this.copy(e),y>=1)return this._w=a,this._x=x,this._y=T,this._z=E,this;const t=1-y*y;if(t<=Number.EPSILON){const l=1-i;return this._w=l*a+i*this._w,this._x=l*x+i*this._x,this._y=l*T+i*this._y,this._z=l*E+i*this._z,this.normalize(),this}const r=Math.sqrt(t),p=Math.atan2(r,y),h=Math.sin((1-i)*p)/r,o=Math.sin(i*p)/r;return this._w=a*h+this._w*o,this._x=x*h+this._x*o,this._y=T*h+this._y*o,this._z=E*h+this._z*o,this._onChangeCallback(),this}slerpQuaternions(e,i,x){return this.copy(e).slerp(i,x)}random(){const e=Math.random(),i=Math.sqrt(1-e),x=Math.sqrt(e),T=2*Math.PI*Math.random(),E=2*Math.PI*Math.random();return this.set(i*Math.cos(T),x*Math.sin(E),x*Math.cos(E),i*Math.sin(T))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,i=0){return this._x=e[i],this._y=e[i+1],this._z=e[i+2],this._w=e[i+3],this._onChangeCallback(),this}toArray(e=[],i=0){return e[i]=this._x,e[i+1]=this._y,e[i+2]=this._z,e[i+3]=this._w,e}fromBufferAttribute(e,i){return this._x=e.getX(i),this._y=e.getY(i),this._z=e.getZ(i),this._w=e.getW(i),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class pt{constructor(e=0,i=0,x=0){pt.prototype.isVector3=!0,this.x=e,this.y=i,this.z=x}set(e,i,x){return x===void 0&&(x=this.z),this.x=e,this.y=i,this.z=x,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,i){switch(e){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,i){return this.x=e.x+i.x,this.y=e.y+i.y,this.z=e.z+i.z,this}addScaledVector(e,i){return this.x+=e.x*i,this.y+=e.y*i,this.z+=e.z*i,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,i){return this.x=e.x-i.x,this.y=e.y-i.y,this.z=e.z-i.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,i){return this.x=e.x*i.x,this.y=e.y*i.y,this.z=e.z*i.z,this}applyEuler(e){return this.applyQuaternion(CT.setFromEuler(e))}applyAxisAngle(e,i){return this.applyQuaternion(CT.setFromAxisAngle(e,i))}applyMatrix3(e){const i=this.x,x=this.y,T=this.z,E=e.elements;return this.x=E[0]*i+E[3]*x+E[6]*T,this.y=E[1]*i+E[4]*x+E[7]*T,this.z=E[2]*i+E[5]*x+E[8]*T,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const i=this.x,x=this.y,T=this.z,E=e.elements,a=1/(E[3]*i+E[7]*x+E[11]*T+E[15]);return this.x=(E[0]*i+E[4]*x+E[8]*T+E[12])*a,this.y=(E[1]*i+E[5]*x+E[9]*T+E[13])*a,this.z=(E[2]*i+E[6]*x+E[10]*T+E[14])*a,this}applyQuaternion(e){const i=this.x,x=this.y,T=this.z,E=e.x,a=e.y,y=e.z,t=e.w,r=2*(a*T-y*x),p=2*(y*i-E*T),h=2*(E*x-a*i);return this.x=i+t*r+a*h-y*p,this.y=x+t*p+y*r-E*h,this.z=T+t*h+E*p-a*r,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const i=this.x,x=this.y,T=this.z,E=e.elements;return this.x=E[0]*i+E[4]*x+E[8]*T,this.y=E[1]*i+E[5]*x+E[9]*T,this.z=E[2]*i+E[6]*x+E[10]*T,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,i){return this.x=Math.max(e.x,Math.min(i.x,this.x)),this.y=Math.max(e.y,Math.min(i.y,this.y)),this.z=Math.max(e.z,Math.min(i.z,this.z)),this}clampScalar(e,i){return this.x=Math.max(e,Math.min(i,this.x)),this.y=Math.max(e,Math.min(i,this.y)),this.z=Math.max(e,Math.min(i,this.z)),this}clampLength(e,i){const x=this.length();return this.divideScalar(x||1).multiplyScalar(Math.max(e,Math.min(i,x)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,i){return this.x+=(e.x-this.x)*i,this.y+=(e.y-this.y)*i,this.z+=(e.z-this.z)*i,this}lerpVectors(e,i,x){return this.x=e.x+(i.x-e.x)*x,this.y=e.y+(i.y-e.y)*x,this.z=e.z+(i.z-e.z)*x,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,i){const x=e.x,T=e.y,E=e.z,a=i.x,y=i.y,t=i.z;return this.x=T*t-E*y,this.y=E*a-x*t,this.z=x*y-T*a,this}projectOnVector(e){const i=e.lengthSq();if(i===0)return this.set(0,0,0);const x=e.dot(this)/i;return this.copy(e).multiplyScalar(x)}projectOnPlane(e){return E0.copy(this).projectOnVector(e),this.sub(E0)}reflect(e){return this.sub(E0.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const i=Math.sqrt(this.lengthSq()*e.lengthSq());if(i===0)return Math.PI/2;const x=this.dot(e)/i;return Math.acos(nn(x,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const i=this.x-e.x,x=this.y-e.y,T=this.z-e.z;return i*i+x*x+T*T}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,i,x){const T=Math.sin(i)*e;return this.x=T*Math.sin(x),this.y=Math.cos(i)*e,this.z=T*Math.cos(x),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,i,x){return this.x=e*Math.sin(i),this.y=x,this.z=e*Math.cos(i),this}setFromMatrixPosition(e){const i=e.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(e){const i=this.setFromMatrixColumn(e,0).length(),x=this.setFromMatrixColumn(e,1).length(),T=this.setFromMatrixColumn(e,2).length();return this.x=i,this.y=x,this.z=T,this}setFromMatrixColumn(e,i){return this.fromArray(e.elements,i*4)}setFromMatrix3Column(e,i){return this.fromArray(e.elements,i*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,i=0){return this.x=e[i],this.y=e[i+1],this.z=e[i+2],this}toArray(e=[],i=0){return e[i]=this.x,e[i+1]=this.y,e[i+2]=this.z,e}fromBufferAttribute(e,i){return this.x=e.getX(i),this.y=e.getY(i),this.z=e.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,i=Math.random()*Math.PI*2,x=Math.sqrt(1-e**2);return this.x=x*Math.cos(i),this.y=x*Math.sin(i),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const E0=new pt,CT=new Ur;class Ar{constructor(e=new pt(1/0,1/0,1/0),i=new pt(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=i}set(e,i){return this.min.copy(e),this.max.copy(i),this}setFromArray(e){this.makeEmpty();for(let i=0,x=e.length;ithis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,i){return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Ws),Ws.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let i,x;return e.normal.x>0?(i=e.normal.x*this.min.x,x=e.normal.x*this.max.x):(i=e.normal.x*this.max.x,x=e.normal.x*this.min.x),e.normal.y>0?(i+=e.normal.y*this.min.y,x+=e.normal.y*this.max.y):(i+=e.normal.y*this.max.y,x+=e.normal.y*this.min.y),e.normal.z>0?(i+=e.normal.z*this.min.z,x+=e.normal.z*this.max.z):(i+=e.normal.z*this.max.z,x+=e.normal.z*this.min.z),i<=-e.constant&&x>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Sc),Zp.subVectors(this.max,Sc),Au.subVectors(e.a,Sc),wu.subVectors(e.b,Sc),Pu.subVectors(e.c,Sc),ko.subVectors(wu,Au),Ko.subVectors(Pu,wu),_l.subVectors(Au,Pu);let i=[0,-ko.z,ko.y,0,-Ko.z,Ko.y,0,-_l.z,_l.y,ko.z,0,-ko.x,Ko.z,0,-Ko.x,_l.z,0,-_l.x,-ko.y,ko.x,0,-Ko.y,Ko.x,0,-_l.y,_l.x,0];return!M0(i,Au,wu,Pu,Zp)||(i=[1,0,0,0,1,0,0,0,1],!M0(i,Au,wu,Pu,Zp))?!1:(Jp.crossVectors(ko,Ko),i=[Jp.x,Jp.y,Jp.z],M0(i,Au,wu,Pu,Zp))}clampPoint(e,i){return i.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Ws).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Ws).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(ka[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),ka[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),ka[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),ka[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),ka[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),ka[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),ka[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),ka[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(ka),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const ka=[new pt,new pt,new pt,new pt,new pt,new pt,new pt,new pt],Ws=new pt,jp=new Ar,Au=new pt,wu=new pt,Pu=new pt,ko=new pt,Ko=new pt,_l=new pt,Sc=new pt,Zp=new pt,Jp=new pt,ql=new pt;function M0(g,e,i,x,T){for(let E=0,a=g.length-3;E<=a;E+=3){ql.fromArray(g,E);const y=T.x*Math.abs(ql.x)+T.y*Math.abs(ql.y)+T.z*Math.abs(ql.z),t=e.dot(ql),r=i.dot(ql),p=x.dot(ql);if(Math.max(-Math.max(t,r,p),Math.min(t,r,p))>y)return!1}return!0}const U5=new Ar,Tc=new pt,C0=new pt;class hr{constructor(e=new pt,i=-1){this.isSphere=!0,this.center=e,this.radius=i}set(e,i){return this.center.copy(e),this.radius=i,this}setFromPoints(e,i){const x=this.center;i!==void 0?x.copy(i):U5.setFromPoints(e).getCenter(x);let T=0;for(let E=0,a=e.length;Ethis.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Tc.subVectors(e,this.center);const i=Tc.lengthSq();if(i>this.radius*this.radius){const x=Math.sqrt(i),T=(x-this.radius)*.5;this.center.addScaledVector(Tc,T/x),this.radius+=T}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(C0.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Tc.copy(e.center).add(C0)),this.expandByPoint(Tc.copy(e.center).sub(C0))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const Ka=new pt,A0=new pt,$p=new pt,jo=new pt,w0=new pt,Qp=new pt,P0=new pt;class xf{constructor(e=new pt,i=new pt(0,0,-1)){this.origin=e,this.direction=i}set(e,i){return this.origin.copy(e),this.direction.copy(i),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,i){return i.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ka)),this}closestPointToPoint(e,i){i.subVectors(e,this.origin);const x=i.dot(this.direction);return x<0?i.copy(this.origin):i.copy(this.origin).addScaledVector(this.direction,x)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const i=Ka.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(Ka.copy(this.origin).addScaledVector(this.direction,i),Ka.distanceToSquared(e))}distanceSqToSegment(e,i,x,T){A0.copy(e).add(i).multiplyScalar(.5),$p.copy(i).sub(e).normalize(),jo.copy(this.origin).sub(A0);const E=e.distanceTo(i)*.5,a=-this.direction.dot($p),y=jo.dot(this.direction),t=-jo.dot($p),r=jo.lengthSq(),p=Math.abs(1-a*a);let h,o,l,n;if(p>0)if(h=a*t-y,o=a*y-t,n=E*p,h>=0)if(o>=-n)if(o<=n){const u=1/p;h*=u,o*=u,l=h*(h+a*o+2*y)+o*(a*h+o+2*t)+r}else o=E,h=Math.max(0,-(a*o+y)),l=-h*h+o*(o+2*t)+r;else o=-E,h=Math.max(0,-(a*o+y)),l=-h*h+o*(o+2*t)+r;else o<=-n?(h=Math.max(0,-(-a*E+y)),o=h>0?-E:Math.min(Math.max(-E,-t),E),l=-h*h+o*(o+2*t)+r):o<=n?(h=0,o=Math.min(Math.max(-E,-t),E),l=o*(o+2*t)+r):(h=Math.max(0,-(a*E+y)),o=h>0?E:Math.min(Math.max(-E,-t),E),l=-h*h+o*(o+2*t)+r);else o=a>0?-E:E,h=Math.max(0,-(a*o+y)),l=-h*h+o*(o+2*t)+r;return x&&x.copy(this.origin).addScaledVector(this.direction,h),T&&T.copy(A0).addScaledVector($p,o),l}intersectSphere(e,i){Ka.subVectors(e.center,this.origin);const x=Ka.dot(this.direction),T=Ka.dot(Ka)-x*x,E=e.radius*e.radius;if(T>E)return null;const a=Math.sqrt(E-T),y=x-a,t=x+a;return t<0?null:y<0?this.at(t,i):this.at(y,i)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const i=e.normal.dot(this.direction);if(i===0)return e.distanceToPoint(this.origin)===0?0:null;const x=-(this.origin.dot(e.normal)+e.constant)/i;return x>=0?x:null}intersectPlane(e,i){const x=this.distanceToPlane(e);return x===null?null:this.at(x,i)}intersectsPlane(e){const i=e.distanceToPoint(this.origin);return i===0||e.normal.dot(this.direction)*i<0}intersectBox(e,i){let x,T,E,a,y,t;const r=1/this.direction.x,p=1/this.direction.y,h=1/this.direction.z,o=this.origin;return r>=0?(x=(e.min.x-o.x)*r,T=(e.max.x-o.x)*r):(x=(e.max.x-o.x)*r,T=(e.min.x-o.x)*r),p>=0?(E=(e.min.y-o.y)*p,a=(e.max.y-o.y)*p):(E=(e.max.y-o.y)*p,a=(e.min.y-o.y)*p),x>a||E>T||((E>x||isNaN(x))&&(x=E),(a=0?(y=(e.min.z-o.z)*h,t=(e.max.z-o.z)*h):(y=(e.max.z-o.z)*h,t=(e.min.z-o.z)*h),x>t||y>T)||((y>x||x!==x)&&(x=y),(t=0?x:T,i)}intersectsBox(e){return this.intersectBox(e,Ka)!==null}intersectTriangle(e,i,x,T,E){w0.subVectors(i,e),Qp.subVectors(x,e),P0.crossVectors(w0,Qp);let a=this.direction.dot(P0),y;if(a>0){if(T)return null;y=1}else if(a<0)y=-1,a=-a;else return null;jo.subVectors(this.origin,e);const t=y*this.direction.dot(Qp.crossVectors(jo,Qp));if(t<0)return null;const r=y*this.direction.dot(w0.cross(jo));if(r<0||t+r>a)return null;const p=-y*jo.dot(P0);return p<0?null:this.at(p/a,E)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Ve{constructor(e,i,x,T,E,a,y,t,r,p,h,o,l,n,u,f){Ve.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,i,x,T,E,a,y,t,r,p,h,o,l,n,u,f)}set(e,i,x,T,E,a,y,t,r,p,h,o,l,n,u,f){const s=this.elements;return s[0]=e,s[4]=i,s[8]=x,s[12]=T,s[1]=E,s[5]=a,s[9]=y,s[13]=t,s[2]=r,s[6]=p,s[10]=h,s[14]=o,s[3]=l,s[7]=n,s[11]=u,s[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new Ve().fromArray(this.elements)}copy(e){const i=this.elements,x=e.elements;return i[0]=x[0],i[1]=x[1],i[2]=x[2],i[3]=x[3],i[4]=x[4],i[5]=x[5],i[6]=x[6],i[7]=x[7],i[8]=x[8],i[9]=x[9],i[10]=x[10],i[11]=x[11],i[12]=x[12],i[13]=x[13],i[14]=x[14],i[15]=x[15],this}copyPosition(e){const i=this.elements,x=e.elements;return i[12]=x[12],i[13]=x[13],i[14]=x[14],this}setFromMatrix3(e){const i=e.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(e,i,x){return e.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),x.setFromMatrixColumn(this,2),this}makeBasis(e,i,x){return this.set(e.x,i.x,x.x,0,e.y,i.y,x.y,0,e.z,i.z,x.z,0,0,0,0,1),this}extractRotation(e){const i=this.elements,x=e.elements,T=1/Ru.setFromMatrixColumn(e,0).length(),E=1/Ru.setFromMatrixColumn(e,1).length(),a=1/Ru.setFromMatrixColumn(e,2).length();return i[0]=x[0]*T,i[1]=x[1]*T,i[2]=x[2]*T,i[3]=0,i[4]=x[4]*E,i[5]=x[5]*E,i[6]=x[6]*E,i[7]=0,i[8]=x[8]*a,i[9]=x[9]*a,i[10]=x[10]*a,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(e){const i=this.elements,x=e.x,T=e.y,E=e.z,a=Math.cos(x),y=Math.sin(x),t=Math.cos(T),r=Math.sin(T),p=Math.cos(E),h=Math.sin(E);if(e.order==="XYZ"){const o=a*p,l=a*h,n=y*p,u=y*h;i[0]=t*p,i[4]=-t*h,i[8]=r,i[1]=l+n*r,i[5]=o-u*r,i[9]=-y*t,i[2]=u-o*r,i[6]=n+l*r,i[10]=a*t}else if(e.order==="YXZ"){const o=t*p,l=t*h,n=r*p,u=r*h;i[0]=o+u*y,i[4]=n*y-l,i[8]=a*r,i[1]=a*h,i[5]=a*p,i[9]=-y,i[2]=l*y-n,i[6]=u+o*y,i[10]=a*t}else if(e.order==="ZXY"){const o=t*p,l=t*h,n=r*p,u=r*h;i[0]=o-u*y,i[4]=-a*h,i[8]=n+l*y,i[1]=l+n*y,i[5]=a*p,i[9]=u-o*y,i[2]=-a*r,i[6]=y,i[10]=a*t}else if(e.order==="ZYX"){const o=a*p,l=a*h,n=y*p,u=y*h;i[0]=t*p,i[4]=n*r-l,i[8]=o*r+u,i[1]=t*h,i[5]=u*r+o,i[9]=l*r-n,i[2]=-r,i[6]=y*t,i[10]=a*t}else if(e.order==="YZX"){const o=a*t,l=a*r,n=y*t,u=y*r;i[0]=t*p,i[4]=u-o*h,i[8]=n*h+l,i[1]=h,i[5]=a*p,i[9]=-y*p,i[2]=-r*p,i[6]=l*h+n,i[10]=o-u*h}else if(e.order==="XZY"){const o=a*t,l=a*r,n=y*t,u=y*r;i[0]=t*p,i[4]=-h,i[8]=r*p,i[1]=o*h+u,i[5]=a*p,i[9]=l*h-n,i[2]=n*h-l,i[6]=y*p,i[10]=u*h+o}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(e){return this.compose(z5,e,G5)}lookAt(e,i,x){const T=this.elements;return is.subVectors(e,i),is.lengthSq()===0&&(is.z=1),is.normalize(),Zo.crossVectors(x,is),Zo.lengthSq()===0&&(Math.abs(x.z)===1?is.x+=1e-4:is.z+=1e-4,is.normalize(),Zo.crossVectors(x,is)),Zo.normalize(),_p.crossVectors(is,Zo),T[0]=Zo.x,T[4]=_p.x,T[8]=is.x,T[1]=Zo.y,T[5]=_p.y,T[9]=is.y,T[2]=Zo.z,T[6]=_p.z,T[10]=is.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,i){const x=e.elements,T=i.elements,E=this.elements,a=x[0],y=x[4],t=x[8],r=x[12],p=x[1],h=x[5],o=x[9],l=x[13],n=x[2],u=x[6],f=x[10],s=x[14],c=x[3],d=x[7],v=x[11],m=x[15],S=T[0],M=T[4],A=T[8],C=T[12],w=T[1],P=T[5],L=T[9],O=T[13],I=T[2],D=T[6],B=T[10],G=T[14],z=T[3],W=T[7],k=T[11],J=T[15];return E[0]=a*S+y*w+t*I+r*z,E[4]=a*M+y*P+t*D+r*W,E[8]=a*A+y*L+t*B+r*k,E[12]=a*C+y*O+t*G+r*J,E[1]=p*S+h*w+o*I+l*z,E[5]=p*M+h*P+o*D+l*W,E[9]=p*A+h*L+o*B+l*k,E[13]=p*C+h*O+o*G+l*J,E[2]=n*S+u*w+f*I+s*z,E[6]=n*M+u*P+f*D+s*W,E[10]=n*A+u*L+f*B+s*k,E[14]=n*C+u*O+f*G+s*J,E[3]=c*S+d*w+v*I+m*z,E[7]=c*M+d*P+v*D+m*W,E[11]=c*A+d*L+v*B+m*k,E[15]=c*C+d*O+v*G+m*J,this}multiplyScalar(e){const i=this.elements;return i[0]*=e,i[4]*=e,i[8]*=e,i[12]*=e,i[1]*=e,i[5]*=e,i[9]*=e,i[13]*=e,i[2]*=e,i[6]*=e,i[10]*=e,i[14]*=e,i[3]*=e,i[7]*=e,i[11]*=e,i[15]*=e,this}determinant(){const e=this.elements,i=e[0],x=e[4],T=e[8],E=e[12],a=e[1],y=e[5],t=e[9],r=e[13],p=e[2],h=e[6],o=e[10],l=e[14],n=e[3],u=e[7],f=e[11],s=e[15];return n*(+E*t*h-T*r*h-E*y*o+x*r*o+T*y*l-x*t*l)+u*(+i*t*l-i*r*o+E*a*o-T*a*l+T*r*p-E*t*p)+f*(+i*r*h-i*y*l-E*a*h+x*a*l+E*y*p-x*r*p)+s*(-T*y*p-i*t*h+i*y*o+T*a*h-x*a*o+x*t*p)}transpose(){const e=this.elements;let i;return i=e[1],e[1]=e[4],e[4]=i,i=e[2],e[2]=e[8],e[8]=i,i=e[6],e[6]=e[9],e[9]=i,i=e[3],e[3]=e[12],e[12]=i,i=e[7],e[7]=e[13],e[13]=i,i=e[11],e[11]=e[14],e[14]=i,this}setPosition(e,i,x){const T=this.elements;return e.isVector3?(T[12]=e.x,T[13]=e.y,T[14]=e.z):(T[12]=e,T[13]=i,T[14]=x),this}invert(){const e=this.elements,i=e[0],x=e[1],T=e[2],E=e[3],a=e[4],y=e[5],t=e[6],r=e[7],p=e[8],h=e[9],o=e[10],l=e[11],n=e[12],u=e[13],f=e[14],s=e[15],c=h*f*r-u*o*r+u*t*l-y*f*l-h*t*s+y*o*s,d=n*o*r-p*f*r-n*t*l+a*f*l+p*t*s-a*o*s,v=p*u*r-n*h*r+n*y*l-a*u*l-p*y*s+a*h*s,m=n*h*t-p*u*t-n*y*o+a*u*o+p*y*f-a*h*f,S=i*c+x*d+T*v+E*m;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/S;return e[0]=c*M,e[1]=(u*o*E-h*f*E-u*T*l+x*f*l+h*T*s-x*o*s)*M,e[2]=(y*f*E-u*t*E+u*T*r-x*f*r-y*T*s+x*t*s)*M,e[3]=(h*t*E-y*o*E-h*T*r+x*o*r+y*T*l-x*t*l)*M,e[4]=d*M,e[5]=(p*f*E-n*o*E+n*T*l-i*f*l-p*T*s+i*o*s)*M,e[6]=(n*t*E-a*f*E-n*T*r+i*f*r+a*T*s-i*t*s)*M,e[7]=(a*o*E-p*t*E+p*T*r-i*o*r-a*T*l+i*t*l)*M,e[8]=v*M,e[9]=(n*h*E-p*u*E-n*x*l+i*u*l+p*x*s-i*h*s)*M,e[10]=(a*u*E-n*y*E+n*x*r-i*u*r-a*x*s+i*y*s)*M,e[11]=(p*y*E-a*h*E-p*x*r+i*h*r+a*x*l-i*y*l)*M,e[12]=m*M,e[13]=(p*u*T-n*h*T+n*x*o-i*u*o-p*x*f+i*h*f)*M,e[14]=(n*y*T-a*u*T-n*x*t+i*u*t+a*x*f-i*y*f)*M,e[15]=(a*h*T-p*y*T+p*x*t-i*h*t-a*x*o+i*y*o)*M,this}scale(e){const i=this.elements,x=e.x,T=e.y,E=e.z;return i[0]*=x,i[4]*=T,i[8]*=E,i[1]*=x,i[5]*=T,i[9]*=E,i[2]*=x,i[6]*=T,i[10]*=E,i[3]*=x,i[7]*=T,i[11]*=E,this}getMaxScaleOnAxis(){const e=this.elements,i=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],x=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],T=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(i,x,T))}makeTranslation(e,i,x){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,i,0,0,1,x,0,0,0,1),this}makeRotationX(e){const i=Math.cos(e),x=Math.sin(e);return this.set(1,0,0,0,0,i,-x,0,0,x,i,0,0,0,0,1),this}makeRotationY(e){const i=Math.cos(e),x=Math.sin(e);return this.set(i,0,x,0,0,1,0,0,-x,0,i,0,0,0,0,1),this}makeRotationZ(e){const i=Math.cos(e),x=Math.sin(e);return this.set(i,-x,0,0,x,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,i){const x=Math.cos(i),T=Math.sin(i),E=1-x,a=e.x,y=e.y,t=e.z,r=E*a,p=E*y;return this.set(r*a+x,r*y-T*t,r*t+T*y,0,r*y+T*t,p*y+x,p*t-T*a,0,r*t-T*y,p*t+T*a,E*t*t+x,0,0,0,0,1),this}makeScale(e,i,x){return this.set(e,0,0,0,0,i,0,0,0,0,x,0,0,0,0,1),this}makeShear(e,i,x,T,E,a){return this.set(1,x,E,0,e,1,a,0,i,T,1,0,0,0,0,1),this}compose(e,i,x){const T=this.elements,E=i._x,a=i._y,y=i._z,t=i._w,r=E+E,p=a+a,h=y+y,o=E*r,l=E*p,n=E*h,u=a*p,f=a*h,s=y*h,c=t*r,d=t*p,v=t*h,m=x.x,S=x.y,M=x.z;return T[0]=(1-(u+s))*m,T[1]=(l+v)*m,T[2]=(n-d)*m,T[3]=0,T[4]=(l-v)*S,T[5]=(1-(o+s))*S,T[6]=(f+c)*S,T[7]=0,T[8]=(n+d)*M,T[9]=(f-c)*M,T[10]=(1-(o+u))*M,T[11]=0,T[12]=e.x,T[13]=e.y,T[14]=e.z,T[15]=1,this}decompose(e,i,x){const T=this.elements;let E=Ru.set(T[0],T[1],T[2]).length();const a=Ru.set(T[4],T[5],T[6]).length(),y=Ru.set(T[8],T[9],T[10]).length();this.determinant()<0&&(E=-E),e.x=T[12],e.y=T[13],e.z=T[14],Xs.copy(this);const r=1/E,p=1/a,h=1/y;return Xs.elements[0]*=r,Xs.elements[1]*=r,Xs.elements[2]*=r,Xs.elements[4]*=p,Xs.elements[5]*=p,Xs.elements[6]*=p,Xs.elements[8]*=h,Xs.elements[9]*=h,Xs.elements[10]*=h,i.setFromRotationMatrix(Xs),x.x=E,x.y=a,x.z=y,this}makePerspective(e,i,x,T,E,a,y=xa){const t=this.elements,r=2*E/(i-e),p=2*E/(x-T),h=(i+e)/(i-e),o=(x+T)/(x-T);let l,n;if(y===xa)l=-(a+E)/(a-E),n=-2*a*E/(a-E);else if(y===hd)l=-a/(a-E),n=-a*E/(a-E);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+y);return t[0]=r,t[4]=0,t[8]=h,t[12]=0,t[1]=0,t[5]=p,t[9]=o,t[13]=0,t[2]=0,t[6]=0,t[10]=l,t[14]=n,t[3]=0,t[7]=0,t[11]=-1,t[15]=0,this}makeOrthographic(e,i,x,T,E,a,y=xa){const t=this.elements,r=1/(i-e),p=1/(x-T),h=1/(a-E),o=(i+e)*r,l=(x+T)*p;let n,u;if(y===xa)n=(a+E)*h,u=-2*h;else if(y===hd)n=E*h,u=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+y);return t[0]=2*r,t[4]=0,t[8]=0,t[12]=-o,t[1]=0,t[5]=2*p,t[9]=0,t[13]=-l,t[2]=0,t[6]=0,t[10]=u,t[14]=-n,t[3]=0,t[7]=0,t[11]=0,t[15]=1,this}equals(e){const i=this.elements,x=e.elements;for(let T=0;T<16;T++)if(i[T]!==x[T])return!1;return!0}fromArray(e,i=0){for(let x=0;x<16;x++)this.elements[x]=e[x+i];return this}toArray(e=[],i=0){const x=this.elements;return e[i]=x[0],e[i+1]=x[1],e[i+2]=x[2],e[i+3]=x[3],e[i+4]=x[4],e[i+5]=x[5],e[i+6]=x[6],e[i+7]=x[7],e[i+8]=x[8],e[i+9]=x[9],e[i+10]=x[10],e[i+11]=x[11],e[i+12]=x[12],e[i+13]=x[13],e[i+14]=x[14],e[i+15]=x[15],e}}const Ru=new pt,Xs=new Ve,z5=new pt(0,0,0),G5=new pt(1,1,1),Zo=new pt,_p=new pt,is=new pt,AT=new Ve,wT=new Ur;class Ks{constructor(e=0,i=0,x=0,T=Ks.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=i,this._z=x,this._order=T}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,i,x,T=this._order){return this._x=e,this._y=i,this._z=x,this._order=T,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,i=this._order,x=!0){const T=e.elements,E=T[0],a=T[4],y=T[8],t=T[1],r=T[5],p=T[9],h=T[2],o=T[6],l=T[10];switch(i){case"XYZ":this._y=Math.asin(nn(y,-1,1)),Math.abs(y)<.9999999?(this._x=Math.atan2(-p,l),this._z=Math.atan2(-a,E)):(this._x=Math.atan2(o,r),this._z=0);break;case"YXZ":this._x=Math.asin(-nn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(y,l),this._z=Math.atan2(t,r)):(this._y=Math.atan2(-h,E),this._z=0);break;case"ZXY":this._x=Math.asin(nn(o,-1,1)),Math.abs(o)<.9999999?(this._y=Math.atan2(-h,l),this._z=Math.atan2(-a,r)):(this._y=0,this._z=Math.atan2(t,E));break;case"ZYX":this._y=Math.asin(-nn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(o,l),this._z=Math.atan2(t,E)):(this._x=0,this._z=Math.atan2(-a,r));break;case"YZX":this._z=Math.asin(nn(t,-1,1)),Math.abs(t)<.9999999?(this._x=Math.atan2(-p,r),this._y=Math.atan2(-h,E)):(this._x=0,this._y=Math.atan2(y,l));break;case"XZY":this._z=Math.asin(-nn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(o,r),this._y=Math.atan2(y,E)):(this._x=Math.atan2(-p,l),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,x===!0&&this._onChangeCallback(),this}setFromQuaternion(e,i,x){return AT.makeRotationFromQuaternion(e),this.setFromRotationMatrix(AT,i,x)}setFromVector3(e,i=this._order){return this.set(e.x,e.y,e.z,i)}reorder(e){return wT.setFromEuler(this),this.setFromQuaternion(wT,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],i=0){return e[i]=this._x,e[i+1]=this._y,e[i+2]=this._z,e[i+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ks.DEFAULT_ORDER="XYZ";class Mh{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let i=0;i1){for(let x=0;x0&&(T.userData=this.userData),T.layers=this.layers.mask,T.matrix=this.matrix.toArray(),T.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(T.matrixAutoUpdate=!1),this.isInstancedMesh&&(T.type="InstancedMesh",T.count=this.count,T.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(T.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(T.type="BatchedMesh",T.perObjectFrustumCulled=this.perObjectFrustumCulled,T.sortObjects=this.sortObjects,T.drawRanges=this._drawRanges,T.reservedRanges=this._reservedRanges,T.visibility=this._visibility,T.active=this._active,T.bounds=this._bounds.map(y=>({boxInitialized:y.boxInitialized,boxMin:y.box.min.toArray(),boxMax:y.box.max.toArray(),sphereInitialized:y.sphereInitialized,sphereRadius:y.sphere.radius,sphereCenter:y.sphere.center.toArray()})),T.maxGeometryCount=this._maxGeometryCount,T.maxVertexCount=this._maxVertexCount,T.maxIndexCount=this._maxIndexCount,T.geometryInitialized=this._geometryInitialized,T.geometryCount=this._geometryCount,T.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(T.boundingSphere={center:T.boundingSphere.center.toArray(),radius:T.boundingSphere.radius}),this.boundingBox!==null&&(T.boundingBox={min:T.boundingBox.min.toArray(),max:T.boundingBox.max.toArray()}));function E(y,t){return y[t.uuid]===void 0&&(y[t.uuid]=t.toJSON(e)),t.uuid}if(this.isScene)this.background&&(this.background.isColor?T.background=this.background.toJSON():this.background.isTexture&&(T.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(T.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){T.geometry=E(e.geometries,this.geometry);const y=this.geometry.parameters;if(y!==void 0&&y.shapes!==void 0){const t=y.shapes;if(Array.isArray(t))for(let r=0,p=t.length;r0){T.children=[];for(let y=0;y0){T.animations=[];for(let y=0;y0&&(x.geometries=y),t.length>0&&(x.materials=t),r.length>0&&(x.textures=r),p.length>0&&(x.images=p),h.length>0&&(x.shapes=h),o.length>0&&(x.skeletons=o),l.length>0&&(x.animations=l),n.length>0&&(x.nodes=n)}return x.object=T,x;function a(y){const t=[];for(const r in y){const p=y[r];delete p.metadata,t.push(p)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,i=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),i===!0)for(let x=0;x0?T.multiplyScalar(1/Math.sqrt(E)):T.set(0,0,0)}static getBarycoord(e,i,x,T,E){Ys.subVectors(T,i),Za.subVectors(x,i),R0.subVectors(e,i);const a=Ys.dot(Ys),y=Ys.dot(Za),t=Ys.dot(R0),r=Za.dot(Za),p=Za.dot(R0),h=a*r-y*y;if(h===0)return E.set(0,0,0),null;const o=1/h,l=(r*t-y*p)*o,n=(a*p-y*t)*o;return E.set(1-l-n,n,l)}static containsPoint(e,i,x,T){return this.getBarycoord(e,i,x,T,Ja)===null?!1:Ja.x>=0&&Ja.y>=0&&Ja.x+Ja.y<=1}static getInterpolation(e,i,x,T,E,a,y,t){return this.getBarycoord(e,i,x,T,Ja)===null?(t.x=0,t.y=0,"z"in t&&(t.z=0),"w"in t&&(t.w=0),null):(t.setScalar(0),t.addScaledVector(E,Ja.x),t.addScaledVector(a,Ja.y),t.addScaledVector(y,Ja.z),t)}static isFrontFacing(e,i,x,T){return Ys.subVectors(x,i),Za.subVectors(e,i),Ys.cross(Za).dot(T)<0}set(e,i,x){return this.a.copy(e),this.b.copy(i),this.c.copy(x),this}setFromPointsAndIndices(e,i,x,T){return this.a.copy(e[i]),this.b.copy(e[x]),this.c.copy(e[T]),this}setFromAttributeAndIndices(e,i,x,T){return this.a.fromBufferAttribute(e,i),this.b.fromBufferAttribute(e,x),this.c.fromBufferAttribute(e,T),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ys.subVectors(this.c,this.b),Za.subVectors(this.a,this.b),Ys.cross(Za).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return ss.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,i){return ss.getBarycoord(e,this.a,this.b,this.c,i)}getInterpolation(e,i,x,T,E){return ss.getInterpolation(e,this.a,this.b,this.c,i,x,T,E)}containsPoint(e){return ss.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return ss.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,i){const x=this.a,T=this.b,E=this.c;let a,y;bu.subVectors(T,x),Fu.subVectors(E,x),L0.subVectors(e,x);const t=bu.dot(L0),r=Fu.dot(L0);if(t<=0&&r<=0)return i.copy(x);b0.subVectors(e,T);const p=bu.dot(b0),h=Fu.dot(b0);if(p>=0&&h<=p)return i.copy(T);const o=t*h-p*r;if(o<=0&&t>=0&&p<=0)return a=t/(t-p),i.copy(x).addScaledVector(bu,a);F0.subVectors(e,E);const l=bu.dot(F0),n=Fu.dot(F0);if(n>=0&&l<=n)return i.copy(E);const u=l*r-t*n;if(u<=0&&r>=0&&n<=0)return y=r/(r-n),i.copy(x).addScaledVector(Fu,y);const f=p*n-l*h;if(f<=0&&h-p>=0&&l-n>=0)return FT.subVectors(E,T),y=(h-p)/(h-p+(l-n)),i.copy(T).addScaledVector(FT,y);const s=1/(f+u+o);return a=u*s,y=o*s,i.copy(x).addScaledVector(bu,a).addScaledVector(Fu,y)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const oA={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Jo={h:0,s:0,l:0},tv={h:0,s:0,l:0};function O0(g,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?g+(e-g)*6*i:i<1/2?e:i<2/3?g+(e-g)*6*(2/3-i):g}class fe{constructor(e,i,x){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,i,x)}set(e,i,x){if(i===void 0&&x===void 0){const T=e;T&&T.isColor?this.copy(T):typeof T=="number"?this.setHex(T):typeof T=="string"&&this.setStyle(T)}else this.setRGB(e,i,x);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,i=Ln){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,xi.toWorkingColorSpace(this,i),this}setRGB(e,i,x,T=xi.workingColorSpace){return this.r=e,this.g=i,this.b=x,xi.toWorkingColorSpace(this,T),this}setHSL(e,i,x,T=xi.workingColorSpace){if(e=u1(e,1),i=nn(i,0,1),x=nn(x,0,1),i===0)this.r=this.g=this.b=x;else{const E=x<=.5?x*(1+i):x+i-x*i,a=2*x-E;this.r=O0(a,E,e+1/3),this.g=O0(a,E,e),this.b=O0(a,E,e-1/3)}return xi.toWorkingColorSpace(this,T),this}setStyle(e,i=Ln){function x(E){E!==void 0&&parseFloat(E)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let T;if(T=/^(\w+)\(([^\)]*)\)/.exec(e)){let E;const a=T[1],y=T[2];switch(a){case"rgb":case"rgba":if(E=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(255,parseInt(E[1],10))/255,Math.min(255,parseInt(E[2],10))/255,Math.min(255,parseInt(E[3],10))/255,i);if(E=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setRGB(Math.min(100,parseInt(E[1],10))/100,Math.min(100,parseInt(E[2],10))/100,Math.min(100,parseInt(E[3],10))/100,i);break;case"hsl":case"hsla":if(E=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(y))return x(E[4]),this.setHSL(parseFloat(E[1])/360,parseFloat(E[2])/100,parseFloat(E[3])/100,i);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(T=/^\#([A-Fa-f\d]+)$/.exec(e)){const E=T[1],a=E.length;if(a===3)return this.setRGB(parseInt(E.charAt(0),16)/15,parseInt(E.charAt(1),16)/15,parseInt(E.charAt(2),16)/15,i);if(a===6)return this.setHex(parseInt(E,16),i);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,i);return this}setColorName(e,i=Ln){const x=oA[e.toLowerCase()];return x!==void 0?this.setHex(x,i):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=af(e.r),this.g=af(e.g),this.b=af(e.b),this}copyLinearToSRGB(e){return this.r=S0(e.r),this.g=S0(e.g),this.b=S0(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Ln){return xi.fromWorkingColorSpace(sr.copy(this),e),Math.round(nn(sr.r*255,0,255))*65536+Math.round(nn(sr.g*255,0,255))*256+Math.round(nn(sr.b*255,0,255))}getHexString(e=Ln){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,i=xi.workingColorSpace){xi.fromWorkingColorSpace(sr.copy(this),i);const x=sr.r,T=sr.g,E=sr.b,a=Math.max(x,T,E),y=Math.min(x,T,E);let t,r;const p=(y+a)/2;if(y===a)t=0,r=0;else{const h=a-y;switch(r=p<=.5?h/(a+y):h/(2-a-y),a){case x:t=(T-E)/h+(T0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const i in e){const x=e[i];if(x===void 0){console.warn(`THREE.Material: parameter '${i}' has value of undefined.`);continue}const T=this[i];if(T===void 0){console.warn(`THREE.Material: '${i}' is not a property of THREE.${this.type}.`);continue}T&&T.isColor?T.set(x):T&&T.isVector3&&x&&x.isVector3?T.copy(x):this[i]=x}}toJSON(e){const i=e===void 0||typeof e=="string";i&&(e={textures:{},images:{}});const x={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};x.uuid=this.uuid,x.type=this.type,this.name!==""&&(x.name=this.name),this.color&&this.color.isColor&&(x.color=this.color.getHex()),this.roughness!==void 0&&(x.roughness=this.roughness),this.metalness!==void 0&&(x.metalness=this.metalness),this.sheen!==void 0&&(x.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(x.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(x.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(x.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(x.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(x.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(x.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(x.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(x.shininess=this.shininess),this.clearcoat!==void 0&&(x.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(x.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(x.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(x.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(x.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,x.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(x.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(x.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(x.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(x.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(x.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(x.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(x.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(x.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(x.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(x.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(x.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(x.lightMap=this.lightMap.toJSON(e).uuid,x.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(x.aoMap=this.aoMap.toJSON(e).uuid,x.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(x.bumpMap=this.bumpMap.toJSON(e).uuid,x.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(x.normalMap=this.normalMap.toJSON(e).uuid,x.normalMapType=this.normalMapType,x.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(x.displacementMap=this.displacementMap.toJSON(e).uuid,x.displacementScale=this.displacementScale,x.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(x.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(x.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(x.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(x.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(x.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(x.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(x.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(x.combine=this.combine)),this.envMapIntensity!==void 0&&(x.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(x.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(x.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(x.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(x.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(x.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(x.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(x.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(x.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(x.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(x.size=this.size),this.shadowSide!==null&&(x.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(x.sizeAttenuation=this.sizeAttenuation),this.blending!==Sh&&(x.blending=this.blending),this.side!==ao&&(x.side=this.side),this.vertexColors===!0&&(x.vertexColors=!0),this.opacity<1&&(x.opacity=this.opacity),this.transparent===!0&&(x.transparent=!0),this.blendSrc!==lm&&(x.blendSrc=this.blendSrc),this.blendDst!==hm&&(x.blendDst=this.blendDst),this.blendEquation!==tl&&(x.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(x.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(x.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(x.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(x.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(x.blendAlpha=this.blendAlpha),this.depthFunc!==Qc&&(x.depthFunc=this.depthFunc),this.depthTest===!1&&(x.depthTest=this.depthTest),this.depthWrite===!1&&(x.depthWrite=this.depthWrite),this.colorWrite===!1&&(x.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(x.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==ux&&(x.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(x.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(x.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==fh&&(x.stencilFail=this.stencilFail),this.stencilZFail!==fh&&(x.stencilZFail=this.stencilZFail),this.stencilZPass!==fh&&(x.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(x.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(x.rotation=this.rotation),this.polygonOffset===!0&&(x.polygonOffset=!0),this.polygonOffsetFactor!==0&&(x.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(x.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(x.linewidth=this.linewidth),this.dashSize!==void 0&&(x.dashSize=this.dashSize),this.gapSize!==void 0&&(x.gapSize=this.gapSize),this.scale!==void 0&&(x.scale=this.scale),this.dithering===!0&&(x.dithering=!0),this.alphaTest>0&&(x.alphaTest=this.alphaTest),this.alphaHash===!0&&(x.alphaHash=!0),this.alphaToCoverage===!0&&(x.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(x.premultipliedAlpha=!0),this.forceSinglePass===!0&&(x.forceSinglePass=!0),this.wireframe===!0&&(x.wireframe=!0),this.wireframeLinewidth>1&&(x.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(x.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(x.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(x.flatShading=!0),this.visible===!1&&(x.visible=!1),this.toneMapped===!1&&(x.toneMapped=!1),this.fog===!1&&(x.fog=!1),Object.keys(this.userData).length>0&&(x.userData=this.userData);function T(E){const a=[];for(const y in E){const t=E[y];delete t.metadata,a.push(t)}return a}if(i){const E=T(e.textures),a=T(e.images);E.length>0&&(x.textures=E),a.length>0&&(x.images=a)}return x}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const i=e.clippingPlanes;let x=null;if(i!==null){const T=i.length;x=new Array(T);for(let E=0;E!==T;++E)x[E]=i[E].clone()}return this.clippingPlanes=x,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class cl extends _n{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Cd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const _a=K5();function K5(){const g=new ArrayBuffer(4),e=new Float32Array(g),i=new Uint32Array(g),x=new Uint32Array(512),T=new Uint32Array(512);for(let t=0;t<256;++t){const r=t-127;r<-27?(x[t]=0,x[t|256]=32768,T[t]=24,T[t|256]=24):r<-14?(x[t]=1024>>-r-14,x[t|256]=1024>>-r-14|32768,T[t]=-r-1,T[t|256]=-r-1):r<=15?(x[t]=r+15<<10,x[t|256]=r+15<<10|32768,T[t]=13,T[t|256]=13):r<128?(x[t]=31744,x[t|256]=64512,T[t]=24,T[t|256]=24):(x[t]=31744,x[t|256]=64512,T[t]=13,T[t|256]=13)}const E=new Uint32Array(2048),a=new Uint32Array(64),y=new Uint32Array(64);for(let t=1;t<1024;++t){let r=t<<13,p=0;for(;!(r&8388608);)r<<=1,p-=8388608;r&=-8388609,p+=947912704,E[t]=r|p}for(let t=1024;t<2048;++t)E[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)a[t]=t<<23;a[31]=1199570944,a[32]=2147483648;for(let t=33;t<63;++t)a[t]=2147483648+(t-32<<23);a[63]=3347054592;for(let t=1;t<64;++t)t!==32&&(y[t]=1024);return{floatView:e,uint32View:i,baseTable:x,shiftTable:T,mantissaTable:E,exponentTable:a,offsetTable:y}}function Br(g){Math.abs(g)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),g=nn(g,-65504,65504),_a.floatView[0]=g;const e=_a.uint32View[0],i=e>>23&511;return _a.baseTable[i]+((e&8388607)>>_a.shiftTable[i])}function Ic(g){const e=g>>10;return _a.uint32View[0]=_a.mantissaTable[_a.offsetTable[e]+(g&1023)]+_a.exponentTable[e],_a.floatView[0]}const j5={toHalfFloat:Br,fromHalfFloat:Ic},Sn=new pt,ev=new jt;class Ti{constructor(e,i,x=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=i,this.count=e!==void 0?e.length/i:0,this.normalized=x,this.usage=ld,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Ps,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Eh("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,i){this.updateRanges.push({start:e,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,i,x){e*=this.itemSize,x*=i.itemSize;for(let T=0,E=this.itemSize;T0&&(e.userData=this.userData),this.parameters!==void 0){const t=this.parameters;for(const r in t)t[r]!==void 0&&(e[r]=t[r]);return e}e.data={attributes:{}};const i=this.index;i!==null&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});const x=this.attributes;for(const t in x){const r=x[t];e.data.attributes[t]=r.toJSON(e.data)}const T={};let E=!1;for(const t in this.morphAttributes){const r=this.morphAttributes[t],p=[];for(let h=0,o=r.length;h0&&(T[t]=p,E=!0)}E&&(e.data.morphAttributes=T,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const y=this.boundingSphere;return y!==null&&(e.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const i={};this.name=e.name;const x=e.index;x!==null&&this.setIndex(x.clone(i));const T=e.attributes;for(const r in T){const p=T[r];this.setAttribute(r,p.clone(i))}const E=e.morphAttributes;for(const r in E){const p=[],h=E[r];for(let o=0,l=h.length;o0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,a=T.length;E(e.far-e.near)**2))&&(OT.copy(E).invert(),th.copy(e.ray).applyMatrix4(OT),!(x.boundingBox!==null&&th.intersectsBox(x.boundingBox)===!1)&&this._computeIntersections(e,i,th)))}_computeIntersections(e,i,x){let T;const E=this.geometry,a=this.material,y=E.index,t=E.attributes.position,r=E.attributes.uv,p=E.attributes.uv1,h=E.attributes.normal,o=E.groups,l=E.drawRange;if(y!==null)if(Array.isArray(a))for(let n=0,u=o.length;ni.far?null:{distance:r,point:lv.clone(),object:g}}function hv(g,e,i,x,T,E,a,y,t,r){g.getVertexPosition(y,Du),g.getVertexPosition(t,Iu),g.getVertexPosition(r,Nu);const p=i9(g,e,i,x,Du,Iu,Nu,ov);if(p){T&&(rv.fromBufferAttribute(T,y),sv.fromBufferAttribute(T,t),av.fromBufferAttribute(T,r),p.uv=ss.getInterpolation(ov,Du,Iu,Nu,rv,sv,av,new jt)),E&&(rv.fromBufferAttribute(E,y),sv.fromBufferAttribute(E,t),av.fromBufferAttribute(E,r),p.uv1=ss.getInterpolation(ov,Du,Iu,Nu,rv,sv,av,new jt),p.uv2=p.uv1),a&&(IT.fromBufferAttribute(a,y),NT.fromBufferAttribute(a,t),BT.fromBufferAttribute(a,r),p.normal=ss.getInterpolation(ov,Du,Iu,Nu,IT,NT,BT,new pt),p.normal.dot(x.direction)>0&&p.normal.multiplyScalar(-1));const h={a:y,b:t,c:r,normal:new pt,materialIndex:0};ss.getNormal(Du,Iu,Nu,h.normal),p.face=h}return p}class Ih extends ei{constructor(e=1,i=1,x=1,T=1,E=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:i,depth:x,widthSegments:T,heightSegments:E,depthSegments:a};const y=this;T=Math.floor(T),E=Math.floor(E),a=Math.floor(a);const t=[],r=[],p=[],h=[];let o=0,l=0;n("z","y","x",-1,-1,x,i,e,a,E,0),n("z","y","x",1,-1,x,i,-e,a,E,1),n("x","z","y",1,1,e,x,i,T,a,2),n("x","z","y",1,-1,e,x,-i,T,a,3),n("x","y","z",1,-1,e,i,x,T,E,4),n("x","y","z",-1,-1,e,i,-x,T,E,5),this.setIndex(t),this.setAttribute("position",new xe(r,3)),this.setAttribute("normal",new xe(p,3)),this.setAttribute("uv",new xe(h,2));function n(u,f,s,c,d,v,m,S,M,A,C){const w=v/M,P=m/A,L=v/2,O=m/2,I=S/2,D=M+1,B=A+1;let G=0,z=0;const W=new pt;for(let k=0;k0?1:-1,p.push(W.x,W.y,W.z),h.push(Q/M),h.push(1-k/A),G+=1}}for(let k=0;k0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader,i.lights=this.lights,i.clipping=this.clipping;const x={};for(const T in this.extensions)this.extensions[T]===!0&&(x[T]=!0);return Object.keys(x).length>0&&(i.extensions=x),i}}class wd extends vi{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Ve,this.projectionMatrix=new Ve,this.projectionMatrixInverse=new Ve,this.coordinateSystem=xa}copy(e,i){return super.copy(e,i),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,i){super.updateWorldMatrix(e,i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const $o=new pt,UT=new jt,zT=new jt;class Yn extends wd{constructor(e=50,i=1,x=.1,T=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=x,this.far=T,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,i){return super.copy(e,i),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const i=.5*this.getFilmHeight()/e;this.fov=cf*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Th*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return cf*2*Math.atan(Math.tan(Th*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,i,x){$o.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),i.set($o.x,$o.y).multiplyScalar(-e/$o.z),$o.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),x.set($o.x,$o.y).multiplyScalar(-e/$o.z)}getViewSize(e,i){return this.getViewBounds(e,UT,zT),i.subVectors(zT,UT)}setViewOffset(e,i,x,T,E,a){this.aspect=e/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let i=e*Math.tan(Th*.5*this.fov)/this.zoom,x=2*i,T=this.aspect*x,E=-.5*T;const a=this.view;if(this.view!==null&&this.view.enabled){const t=a.fullWidth,r=a.fullHeight;E+=a.offsetX*T/t,i-=a.offsetY*x/r,T*=a.width/t,x*=a.height/r}const y=this.filmOffset;y!==0&&(E+=e*y/this.getFilmWidth()),this.projectionMatrix.makePerspective(E,E+T,i,i-x,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const i=super.toJSON(e);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}}const Bu=-90,Uu=1;class uA extends vi{constructor(e,i,x){super(),this.type="CubeCamera",this.renderTarget=x,this.coordinateSystem=null,this.activeMipmapLevel=0;const T=new Yn(Bu,Uu,e,i);T.layers=this.layers,this.add(T);const E=new Yn(Bu,Uu,e,i);E.layers=this.layers,this.add(E);const a=new Yn(Bu,Uu,e,i);a.layers=this.layers,this.add(a);const y=new Yn(Bu,Uu,e,i);y.layers=this.layers,this.add(y);const t=new Yn(Bu,Uu,e,i);t.layers=this.layers,this.add(t);const r=new Yn(Bu,Uu,e,i);r.layers=this.layers,this.add(r)}updateCoordinateSystem(){const e=this.coordinateSystem,i=this.children.concat(),[x,T,E,a,y,t]=i;for(const r of i)this.remove(r);if(e===xa)x.up.set(0,1,0),x.lookAt(1,0,0),T.up.set(0,1,0),T.lookAt(-1,0,0),E.up.set(0,0,-1),E.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),y.up.set(0,1,0),y.lookAt(0,0,1),t.up.set(0,1,0),t.lookAt(0,0,-1);else if(e===hd)x.up.set(0,-1,0),x.lookAt(-1,0,0),T.up.set(0,-1,0),T.lookAt(1,0,0),E.up.set(0,0,1),E.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),y.up.set(0,-1,0),y.lookAt(0,0,1),t.up.set(0,-1,0),t.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const r of i)this.add(r),r.updateMatrixWorld()}update(e,i){this.parent===null&&this.updateMatrixWorld();const{renderTarget:x,activeMipmapLevel:T}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[E,a,y,t,r,p]=this.children,h=e.getRenderTarget(),o=e.getActiveCubeFace(),l=e.getActiveMipmapLevel(),n=e.xr.enabled;e.xr.enabled=!1;const u=x.texture.generateMipmaps;x.texture.generateMipmaps=!1,e.setRenderTarget(x,0,T),e.render(i,E),e.setRenderTarget(x,1,T),e.render(i,a),e.setRenderTarget(x,2,T),e.render(i,y),e.setRenderTarget(x,3,T),e.render(i,t),e.setRenderTarget(x,4,T),e.render(i,r),x.texture.generateMipmaps=u,e.setRenderTarget(x,5,T),e.render(i,p),e.setRenderTarget(h,o,l),e.xr.enabled=n,x.texture.needsPMREMUpdate=!0}}class Pd extends Zi{constructor(e,i,x,T,E,a,y,t,r,p){e=e!==void 0?e:[],i=i!==void 0?i:oo,super(e,i,x,T,E,a,y,t,r,p),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class fA extends Js{constructor(e=1,i={}){super(e,e,i),this.isWebGLCubeRenderTarget=!0;const x={width:e,height:e,depth:1},T=[x,x,x,x,x,x];i.encoding!==void 0&&(Eh("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),i.colorSpace=i.encoding===sl?Ln:rs),this.texture=new Pd(T,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Ki}fromEquirectangularTexture(e,i){this.texture.type=i.type,this.texture.colorSpace=i.colorSpace,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;const x={uniforms:{tEquirect:{value:null}},vertexShader:` - - varying vec3 vWorldDirection; - - vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); - - } - - void main() { - - vWorldDirection = transformDirection( position, modelMatrix ); - - #include - #include - - } - `,fragmentShader:` - - uniform sampler2D tEquirect; - - varying vec3 vWorldDirection; - - #include - - void main() { - - vec3 direction = normalize( vWorldDirection ); - - vec2 sampleUV = equirectUv( direction ); - - gl_FragColor = texture2D( tEquirect, sampleUV ); - - } - `},T=new Ih(5,5,5),E=new $s({name:"CubemapFromEquirect",uniforms:df(x.uniforms),vertexShader:x.vertexShader,fragmentShader:x.fragmentShader,side:Cr,blending:so});E.uniforms.tEquirect.value=i;const a=new En(T,E),y=i.minFilter;return i.minFilter===ya&&(i.minFilter=Ki),new uA(1,10,this).update(e,a),i.minFilter=y,a.geometry.dispose(),a.material.dispose(),this}clear(e,i,x,T){const E=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(i,x,T);e.setRenderTarget(E)}}const N0=new pt,a9=new pt,o9=new ni;class qo{constructor(e=new pt(1,0,0),i=0){this.isPlane=!0,this.normal=e,this.constant=i}set(e,i){return this.normal.copy(e),this.constant=i,this}setComponents(e,i,x,T){return this.normal.set(e,i,x),this.constant=T,this}setFromNormalAndCoplanarPoint(e,i){return this.normal.copy(e),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(e,i,x){const T=N0.subVectors(x,i).cross(a9.subVectors(e,i)).normalize();return this.setFromNormalAndCoplanarPoint(T,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,i){return i.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,i){const x=e.delta(N0),T=this.normal.dot(x);if(T===0)return this.distanceToPoint(e.start)===0?i.copy(e.start):null;const E=-(e.start.dot(this.normal)+this.constant)/T;return E<0||E>1?null:i.copy(e.start).addScaledVector(x,E)}intersectsLine(e){const i=this.distanceToPoint(e.start),x=this.distanceToPoint(e.end);return i<0&&x>0||x<0&&i>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,i){const x=i||o9.getNormalMatrix(e),T=this.coplanarPoint(N0).applyMatrix4(e),E=this.normal.applyMatrix3(x).normalize();return this.constant=-T.dot(E),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const eh=new hr,uv=new pt;class Rd{constructor(e=new qo,i=new qo,x=new qo,T=new qo,E=new qo,a=new qo){this.planes=[e,i,x,T,E,a]}set(e,i,x,T,E,a){const y=this.planes;return y[0].copy(e),y[1].copy(i),y[2].copy(x),y[3].copy(T),y[4].copy(E),y[5].copy(a),this}copy(e){const i=this.planes;for(let x=0;x<6;x++)i[x].copy(e.planes[x]);return this}setFromProjectionMatrix(e,i=xa){const x=this.planes,T=e.elements,E=T[0],a=T[1],y=T[2],t=T[3],r=T[4],p=T[5],h=T[6],o=T[7],l=T[8],n=T[9],u=T[10],f=T[11],s=T[12],c=T[13],d=T[14],v=T[15];if(x[0].setComponents(t-E,o-r,f-l,v-s).normalize(),x[1].setComponents(t+E,o+r,f+l,v+s).normalize(),x[2].setComponents(t+a,o+p,f+n,v+c).normalize(),x[3].setComponents(t-a,o-p,f-n,v-c).normalize(),x[4].setComponents(t-y,o-h,f-u,v-d).normalize(),i===xa)x[5].setComponents(t+y,o+h,f+u,v+d).normalize();else if(i===hd)x[5].setComponents(y,h,u,d).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+i);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),eh.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const i=e.geometry;i.boundingSphere===null&&i.computeBoundingSphere(),eh.copy(i.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(eh)}intersectsSprite(e){return eh.center.set(0,0,0),eh.radius=.7071067811865476,eh.applyMatrix4(e.matrixWorld),this.intersectsSphere(eh)}intersectsSphere(e){const i=this.planes,x=e.center,T=-e.radius;for(let E=0;E<6;E++)if(i[E].distanceToPoint(x)0?e.max.x:e.min.x,uv.y=T.normal.y>0?e.max.y:e.min.y,uv.z=T.normal.z>0?e.max.z:e.min.z,T.distanceToPoint(uv)<0)return!1}return!0}containsPoint(e){const i=this.planes;for(let x=0;x<6;x++)if(i[x].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function cA(){let g=null,e=!1,i=null,x=null;function T(E,a){i(E,a),x=g.requestAnimationFrame(T)}return{start:function(){e!==!0&&i!==null&&(x=g.requestAnimationFrame(T),e=!0)},stop:function(){g.cancelAnimationFrame(x),e=!1},setAnimationLoop:function(E){i=E},setContext:function(E){g=E}}}function l9(g,e){const i=e.isWebGL2,x=new WeakMap;function T(r,p){const h=r.array,o=r.usage,l=h.byteLength,n=g.createBuffer();g.bindBuffer(p,n),g.bufferData(p,h,o),r.onUploadCallback();let u;if(h instanceof Float32Array)u=g.FLOAT;else if(h instanceof Uint16Array)if(r.isFloat16BufferAttribute)if(i)u=g.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else u=g.UNSIGNED_SHORT;else if(h instanceof Int16Array)u=g.SHORT;else if(h instanceof Uint32Array)u=g.UNSIGNED_INT;else if(h instanceof Int32Array)u=g.INT;else if(h instanceof Int8Array)u=g.BYTE;else if(h instanceof Uint8Array)u=g.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)u=g.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:n,type:u,bytesPerElement:h.BYTES_PER_ELEMENT,version:r.version,size:l}}function E(r,p,h){const o=p.array,l=p._updateRange,n=p.updateRanges;if(g.bindBuffer(h,r),l.count===-1&&n.length===0&&g.bufferSubData(h,0,o),n.length!==0){for(let u=0,f=n.length;u 0 - vec4 plane; - #ifdef ALPHA_TO_COVERAGE - float distanceToPlane, distanceGradient; - float clipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - if ( clipOpacity == 0.0 ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - float unionClipOpacity = 1.0; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; - distanceGradient = fwidth( distanceToPlane ) / 2.0; - unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); - } - #pragma unroll_loop_end - clipOpacity *= 1.0 - unionClipOpacity; - #endif - diffuseColor.a *= clipOpacity; - if ( diffuseColor.a == 0.0 ) discard; - #else - #pragma unroll_loop_start - for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; - } - #pragma unroll_loop_end - #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES - bool clipped = true; - #pragma unroll_loop_start - for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { - plane = clippingPlanes[ i ]; - clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; - } - #pragma unroll_loop_end - if ( clipped ) discard; - #endif - #endif -#endif`,A9=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; - uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; -#endif`,w9=`#if NUM_CLIPPING_PLANES > 0 - varying vec3 vClipPosition; -#endif`,P9=`#if NUM_CLIPPING_PLANES > 0 - vClipPosition = - mvPosition.xyz; -#endif`,R9=`#if defined( USE_COLOR_ALPHA ) - diffuseColor *= vColor; -#elif defined( USE_COLOR ) - diffuseColor.rgb *= vColor; -#endif`,L9=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) - varying vec3 vColor; -#endif`,b9=`#if defined( USE_COLOR_ALPHA ) - varying vec4 vColor; -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - varying vec3 vColor; -#endif`,F9=`#if defined( USE_COLOR_ALPHA ) - vColor = vec4( 1.0 ); -#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) - vColor = vec3( 1.0 ); -#endif -#ifdef USE_COLOR - vColor *= color; -#endif -#ifdef USE_INSTANCING_COLOR - vColor.xyz *= instanceColor.xyz; -#endif`,O9=`#define PI 3.141592653589793 -#define PI2 6.283185307179586 -#define PI_HALF 1.5707963267948966 -#define RECIPROCAL_PI 0.3183098861837907 -#define RECIPROCAL_PI2 0.15915494309189535 -#define EPSILON 1e-6 -#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -#define whiteComplement( a ) ( 1.0 - saturate( a ) ) -float pow2( const in float x ) { return x*x; } -vec3 pow2( const in vec3 x ) { return x*x; } -float pow3( const in float x ) { return x*x*x; } -float pow4( const in float x ) { float x2 = x*x; return x2*x2; } -float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } -float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } -highp float rand( const in vec2 uv ) { - const highp float a = 12.9898, b = 78.233, c = 43758.5453; - highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); - return fract( sin( sn ) * c ); -} -#ifdef HIGH_PRECISION - float precisionSafeLength( vec3 v ) { return length( v ); } -#else - float precisionSafeLength( vec3 v ) { - float maxComponent = max3( abs( v ) ); - return length( v / maxComponent ) * maxComponent; - } -#endif -struct IncidentLight { - vec3 color; - vec3 direction; - bool visible; -}; -struct ReflectedLight { - vec3 directDiffuse; - vec3 directSpecular; - vec3 indirectDiffuse; - vec3 indirectSpecular; -}; -#ifdef USE_ALPHAHASH - varying vec3 vPosition; -#endif -vec3 transformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); -} -vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { - return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); -} -mat3 transposeMat3( const in mat3 m ) { - mat3 tmp; - tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); - tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); - tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); - return tmp; -} -float luminance( const in vec3 rgb ) { - const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); - return dot( weights, rgb ); -} -bool isPerspectiveMatrix( mat4 m ) { - return m[ 2 ][ 3 ] == - 1.0; -} -vec2 equirectUv( in vec3 dir ) { - float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; - float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; - return vec2( u, v ); -} -vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; -} -vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} -float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { - float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); - return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); -} // validated`,D9=`#ifdef ENVMAP_TYPE_CUBE_UV - #define cubeUV_minMipLevel 4.0 - #define cubeUV_minTileSize 16.0 - float getFace( vec3 direction ) { - vec3 absDirection = abs( direction ); - float face = - 1.0; - if ( absDirection.x > absDirection.z ) { - if ( absDirection.x > absDirection.y ) - face = direction.x > 0.0 ? 0.0 : 3.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } else { - if ( absDirection.z > absDirection.y ) - face = direction.z > 0.0 ? 2.0 : 5.0; - else - face = direction.y > 0.0 ? 1.0 : 4.0; - } - return face; - } - vec2 getUV( vec3 direction, float face ) { - vec2 uv; - if ( face == 0.0 ) { - uv = vec2( direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 1.0 ) { - uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); - } else if ( face == 2.0 ) { - uv = vec2( - direction.x, direction.y ) / abs( direction.z ); - } else if ( face == 3.0 ) { - uv = vec2( - direction.z, direction.y ) / abs( direction.x ); - } else if ( face == 4.0 ) { - uv = vec2( - direction.x, direction.z ) / abs( direction.y ); - } else { - uv = vec2( direction.x, direction.y ) / abs( direction.z ); - } - return 0.5 * ( uv + 1.0 ); - } - vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { - float face = getFace( direction ); - float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); - mipInt = max( mipInt, cubeUV_minMipLevel ); - float faceSize = exp2( mipInt ); - highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; - if ( face > 2.0 ) { - uv.y += faceSize; - face -= 3.0; - } - uv.x += face * faceSize; - uv.x += filterInt * 3.0 * cubeUV_minTileSize; - uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); - uv.x *= CUBEUV_TEXEL_WIDTH; - uv.y *= CUBEUV_TEXEL_HEIGHT; - #ifdef texture2DGradEXT - return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; - #else - return texture2D( envMap, uv ).rgb; - #endif - } - #define cubeUV_r0 1.0 - #define cubeUV_m0 - 2.0 - #define cubeUV_r1 0.8 - #define cubeUV_m1 - 1.0 - #define cubeUV_r4 0.4 - #define cubeUV_m4 2.0 - #define cubeUV_r5 0.305 - #define cubeUV_m5 3.0 - #define cubeUV_r6 0.21 - #define cubeUV_m6 4.0 - float roughnessToMip( float roughness ) { - float mip = 0.0; - if ( roughness >= cubeUV_r1 ) { - mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; - } else if ( roughness >= cubeUV_r4 ) { - mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; - } else if ( roughness >= cubeUV_r5 ) { - mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; - } else if ( roughness >= cubeUV_r6 ) { - mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; - } else { - mip = - 2.0 * log2( 1.16 * roughness ); } - return mip; - } - vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { - float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); - float mipF = fract( mip ); - float mipInt = floor( mip ); - vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); - if ( mipF == 0.0 ) { - return vec4( color0, 1.0 ); - } else { - vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); - return vec4( mix( color0, color1, mipF ), 1.0 ); - } - } -#endif`,I9=`vec3 transformedNormal = objectNormal; -#ifdef USE_TANGENT - vec3 transformedTangent = objectTangent; -#endif -#ifdef USE_BATCHING - mat3 bm = mat3( batchingMatrix ); - transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); - transformedNormal = bm * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = bm * transformedTangent; - #endif -#endif -#ifdef USE_INSTANCING - mat3 im = mat3( instanceMatrix ); - transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); - transformedNormal = im * transformedNormal; - #ifdef USE_TANGENT - transformedTangent = im * transformedTangent; - #endif -#endif -transformedNormal = normalMatrix * transformedNormal; -#ifdef FLIP_SIDED - transformedNormal = - transformedNormal; -#endif -#ifdef USE_TANGENT - transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; - #ifdef FLIP_SIDED - transformedTangent = - transformedTangent; - #endif -#endif`,N9=`#ifdef USE_DISPLACEMENTMAP - uniform sampler2D displacementMap; - uniform float displacementScale; - uniform float displacementBias; -#endif`,B9=`#ifdef USE_DISPLACEMENTMAP - transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); -#endif`,U9=`#ifdef USE_EMISSIVEMAP - vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); - totalEmissiveRadiance *= emissiveColor.rgb; -#endif`,z9=`#ifdef USE_EMISSIVEMAP - uniform sampler2D emissiveMap; -#endif`,G9="gl_FragColor = linearToOutputTexel( gl_FragColor );",V9=` -const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( - vec3( 0.8224621, 0.177538, 0.0 ), - vec3( 0.0331941, 0.9668058, 0.0 ), - vec3( 0.0170827, 0.0723974, 0.9105199 ) -); -const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( - vec3( 1.2249401, - 0.2249404, 0.0 ), - vec3( - 0.0420569, 1.0420571, 0.0 ), - vec3( - 0.0196376, - 0.0786361, 1.0982735 ) -); -vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { - return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); -} -vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { - return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); -} -vec4 LinearTransferOETF( in vec4 value ) { - return value; -} -vec4 sRGBTransferOETF( in vec4 value ) { - return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); -} -vec4 LinearToLinear( in vec4 value ) { - return value; -} -vec4 LinearTosRGB( in vec4 value ) { - return sRGBTransferOETF( value ); -}`,H9=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vec3 cameraToFrag; - if ( isOrthographic ) { - cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToFrag = normalize( vWorldPosition - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vec3 reflectVec = reflect( cameraToFrag, worldNormal ); - #else - vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); - #endif - #else - vec3 reflectVec = vReflect; - #endif - #ifdef ENVMAP_TYPE_CUBE - vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); - #else - vec4 envColor = vec4( 0.0 ); - #endif - #ifdef ENVMAP_BLENDING_MULTIPLY - outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_MIX ) - outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); - #elif defined( ENVMAP_BLENDING_ADD ) - outgoingLight += envColor.xyz * specularStrength * reflectivity; - #endif -#endif`,W9=`#ifdef USE_ENVMAP - uniform float envMapIntensity; - uniform float flipEnvMap; - #ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; - #else - uniform sampler2D envMap; - #endif - -#endif`,X9=`#ifdef USE_ENVMAP - uniform float reflectivity; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - varying vec3 vWorldPosition; - uniform float refractionRatio; - #else - varying vec3 vReflect; - #endif -#endif`,Y9=`#ifdef USE_ENVMAP - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) - #define ENV_WORLDPOS - #endif - #ifdef ENV_WORLDPOS - - varying vec3 vWorldPosition; - #else - varying vec3 vReflect; - uniform float refractionRatio; - #endif -#endif`,k9=`#ifdef USE_ENVMAP - #ifdef ENV_WORLDPOS - vWorldPosition = worldPosition.xyz; - #else - vec3 cameraToVertex; - if ( isOrthographic ) { - cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); - } else { - cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); - } - vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - #ifdef ENVMAP_MODE_REFLECTION - vReflect = reflect( cameraToVertex, worldNormal ); - #else - vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); - #endif - #endif -#endif`,K9=`#ifdef USE_FOG - vFogDepth = - mvPosition.z; -#endif`,j9=`#ifdef USE_FOG - varying float vFogDepth; -#endif`,Z9=`#ifdef USE_FOG - #ifdef FOG_EXP2 - float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); - #else - float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); - #endif - gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); -#endif`,J9=`#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif -#endif`,$9=`#ifdef USE_GRADIENTMAP - uniform sampler2D gradientMap; -#endif -vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { - float dotNL = dot( normal, lightDirection ); - vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); - #ifdef USE_GRADIENTMAP - return vec3( texture2D( gradientMap, coord ).r ); - #else - vec2 fw = fwidth( coord ) * 0.5; - return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); - #endif -}`,Q9=`#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - reflectedLight.indirectDiffuse += lightMapIrradiance; -#endif`,_9=`#ifdef USE_LIGHTMAP - uniform sampler2D lightMap; - uniform float lightMapIntensity; -#endif`,q9=`LambertMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularStrength = specularStrength;`,tN=`varying vec3 vViewPosition; -struct LambertMaterial { - vec3 diffuseColor; - float specularStrength; -}; -void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Lambert -#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,eN=`uniform bool receiveShadow; -uniform vec3 ambientLightColor; -#if defined( USE_LIGHT_PROBES ) - uniform vec3 lightProbe[ 9 ]; -#endif -vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { - float x = normal.x, y = normal.y, z = normal.z; - vec3 result = shCoefficients[ 0 ] * 0.886227; - result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; - result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; - result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; - result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; - result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; - result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); - result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; - result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); - return result; -} -vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); - return irradiance; -} -vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { - vec3 irradiance = ambientLightColor; - return irradiance; -} -float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { - #if defined ( LEGACY_LIGHTS ) - if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { - return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); - } - return 1.0; - #else - float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); - if ( cutoffDistance > 0.0 ) { - distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); - } - return distanceFalloff; - #endif -} -float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { - return smoothstep( coneCosine, penumbraCosine, angleCosine ); -} -#if NUM_DIR_LIGHTS > 0 - struct DirectionalLight { - vec3 direction; - vec3 color; - }; - uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; - void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { - light.color = directionalLight.color; - light.direction = directionalLight.direction; - light.visible = true; - } -#endif -#if NUM_POINT_LIGHTS > 0 - struct PointLight { - vec3 position; - vec3 color; - float distance; - float decay; - }; - uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; - void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = pointLight.position - geometryPosition; - light.direction = normalize( lVector ); - float lightDistance = length( lVector ); - light.color = pointLight.color; - light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } -#endif -#if NUM_SPOT_LIGHTS > 0 - struct SpotLight { - vec3 position; - vec3 direction; - vec3 color; - float distance; - float decay; - float coneCos; - float penumbraCos; - }; - uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; - void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { - vec3 lVector = spotLight.position - geometryPosition; - light.direction = normalize( lVector ); - float angleCos = dot( light.direction, spotLight.direction ); - float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); - if ( spotAttenuation > 0.0 ) { - float lightDistance = length( lVector ); - light.color = spotLight.color * spotAttenuation; - light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); - light.visible = ( light.color != vec3( 0.0 ) ); - } else { - light.color = vec3( 0.0 ); - light.visible = false; - } - } -#endif -#if NUM_RECT_AREA_LIGHTS > 0 - struct RectAreaLight { - vec3 color; - vec3 position; - vec3 halfWidth; - vec3 halfHeight; - }; - uniform sampler2D ltc_1; uniform sampler2D ltc_2; - uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; -#endif -#if NUM_HEMI_LIGHTS > 0 - struct HemisphereLight { - vec3 direction; - vec3 skyColor; - vec3 groundColor; - }; - uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; - vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { - float dotNL = dot( normal, hemiLight.direction ); - float hemiDiffuseWeight = 0.5 * dotNL + 0.5; - vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); - return irradiance; - } -#endif`,iN=`#ifdef USE_ENVMAP - vec3 getIBLIrradiance( const in vec3 normal ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); - return PI * envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 reflectVec = reflect( - viewDir, normal ); - reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); - reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); - vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); - return envMapColor.rgb * envMapIntensity; - #else - return vec3( 0.0 ); - #endif - } - #ifdef USE_ANISOTROPY - vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { - #ifdef ENVMAP_TYPE_CUBE_UV - vec3 bentNormal = cross( bitangent, viewDir ); - bentNormal = normalize( cross( bentNormal, bitangent ) ); - bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); - return getIBLRadiance( viewDir, bentNormal, roughness ); - #else - return vec3( 0.0 ); - #endif - } - #endif -#endif`,nN=`ToonMaterial material; -material.diffuseColor = diffuseColor.rgb;`,rN=`varying vec3 vViewPosition; -struct ToonMaterial { - vec3 diffuseColor; -}; -void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_Toon -#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,sN=`BlinnPhongMaterial material; -material.diffuseColor = diffuseColor.rgb; -material.specularColor = specular; -material.specularShininess = shininess; -material.specularStrength = specularStrength;`,aN=`varying vec3 vViewPosition; -struct BlinnPhongMaterial { - vec3 diffuseColor; - vec3 specularColor; - float specularShininess; - float specularStrength; -}; -void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; -} -void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -#define RE_Direct RE_Direct_BlinnPhong -#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,oN=`PhysicalMaterial material; -material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); -vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); -float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); -material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; -material.roughness = min( material.roughness, 1.0 ); -#ifdef IOR - material.ior = ior; - #ifdef USE_SPECULAR - float specularIntensityFactor = specularIntensity; - vec3 specularColorFactor = specularColor; - #ifdef USE_SPECULAR_COLORMAP - specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; - #endif - material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); - #else - float specularIntensityFactor = 1.0; - vec3 specularColorFactor = vec3( 1.0 ); - material.specularF90 = 1.0; - #endif - material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); -#else - material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); - material.specularF90 = 1.0; -#endif -#ifdef USE_CLEARCOAT - material.clearcoat = clearcoat; - material.clearcoatRoughness = clearcoatRoughness; - material.clearcoatF0 = vec3( 0.04 ); - material.clearcoatF90 = 1.0; - #ifdef USE_CLEARCOATMAP - material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; - #endif - #ifdef USE_CLEARCOAT_ROUGHNESSMAP - material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; - #endif - material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); - material.clearcoatRoughness += geometryRoughness; - material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); -#endif -#ifdef USE_IRIDESCENCE - material.iridescence = iridescence; - material.iridescenceIOR = iridescenceIOR; - #ifdef USE_IRIDESCENCEMAP - material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; - #endif - #ifdef USE_IRIDESCENCE_THICKNESSMAP - material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; - #else - material.iridescenceThickness = iridescenceThicknessMaximum; - #endif -#endif -#ifdef USE_SHEEN - material.sheenColor = sheenColor; - #ifdef USE_SHEEN_COLORMAP - material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; - #endif - material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); - #ifdef USE_SHEEN_ROUGHNESSMAP - material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; - #endif -#endif -#ifdef USE_ANISOTROPY - #ifdef USE_ANISOTROPYMAP - mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); - vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; - vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; - #else - vec2 anisotropyV = anisotropyVector; - #endif - material.anisotropy = length( anisotropyV ); - if( material.anisotropy == 0.0 ) { - anisotropyV = vec2( 1.0, 0.0 ); - } else { - anisotropyV /= material.anisotropy; - material.anisotropy = saturate( material.anisotropy ); - } - material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); - material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; - material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; -#endif`,lN=`struct PhysicalMaterial { - vec3 diffuseColor; - float roughness; - vec3 specularColor; - float specularF90; - #ifdef USE_CLEARCOAT - float clearcoat; - float clearcoatRoughness; - vec3 clearcoatF0; - float clearcoatF90; - #endif - #ifdef USE_IRIDESCENCE - float iridescence; - float iridescenceIOR; - float iridescenceThickness; - vec3 iridescenceFresnel; - vec3 iridescenceF0; - #endif - #ifdef USE_SHEEN - vec3 sheenColor; - float sheenRoughness; - #endif - #ifdef IOR - float ior; - #endif - #ifdef USE_TRANSMISSION - float transmission; - float transmissionAlpha; - float thickness; - float attenuationDistance; - vec3 attenuationColor; - #endif - #ifdef USE_ANISOTROPY - float anisotropy; - float alphaT; - vec3 anisotropyT; - vec3 anisotropyB; - #endif -}; -vec3 clearcoatSpecularDirect = vec3( 0.0 ); -vec3 clearcoatSpecularIndirect = vec3( 0.0 ); -vec3 sheenSpecularDirect = vec3( 0.0 ); -vec3 sheenSpecularIndirect = vec3(0.0 ); -vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { - float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); - float x2 = x * x; - float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); - return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); -} -float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { - float a2 = pow2( alpha ); - float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); - float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); - return 0.5 / max( gv + gl, EPSILON ); -} -float D_GGX( const in float alpha, const in float dotNH ) { - float a2 = pow2( alpha ); - float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; - return RECIPROCAL_PI * a2 / pow2( denom ); -} -#ifdef USE_ANISOTROPY - float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { - float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); - float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); - float v = 0.5 / ( gv + gl ); - return saturate(v); - } - float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { - float a2 = alphaT * alphaB; - highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); - highp float v2 = dot( v, v ); - float w2 = a2 / v2; - return RECIPROCAL_PI * a2 * pow2 ( w2 ); - } -#endif -#ifdef USE_CLEARCOAT - vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { - vec3 f0 = material.clearcoatF0; - float f90 = material.clearcoatF90; - float roughness = material.clearcoatRoughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - return F * ( V * D ); - } -#endif -vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { - vec3 f0 = material.specularColor; - float f90 = material.specularF90; - float roughness = material.roughness; - float alpha = pow2( roughness ); - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float dotVH = saturate( dot( viewDir, halfDir ) ); - vec3 F = F_Schlick( f0, f90, dotVH ); - #ifdef USE_IRIDESCENCE - F = mix( F, material.iridescenceFresnel, material.iridescence ); - #endif - #ifdef USE_ANISOTROPY - float dotTL = dot( material.anisotropyT, lightDir ); - float dotTV = dot( material.anisotropyT, viewDir ); - float dotTH = dot( material.anisotropyT, halfDir ); - float dotBL = dot( material.anisotropyB, lightDir ); - float dotBV = dot( material.anisotropyB, viewDir ); - float dotBH = dot( material.anisotropyB, halfDir ); - float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); - float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); - #else - float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); - float D = D_GGX( alpha, dotNH ); - #endif - return F * ( V * D ); -} -vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { - const float LUT_SIZE = 64.0; - const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; - const float LUT_BIAS = 0.5 / LUT_SIZE; - float dotNV = saturate( dot( N, V ) ); - vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); - uv = uv * LUT_SCALE + LUT_BIAS; - return uv; -} -float LTC_ClippedSphereFormFactor( const in vec3 f ) { - float l = length( f ); - return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); -} -vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { - float x = dot( v1, v2 ); - float y = abs( x ); - float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; - float b = 3.4175940 + ( 4.1616724 + y ) * y; - float v = a / b; - float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; - return cross( v1, v2 ) * theta_sintheta; -} -vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { - vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; - vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; - vec3 lightNormal = cross( v1, v2 ); - if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); - vec3 T1, T2; - T1 = normalize( V - N * dot( V, N ) ); - T2 = - cross( N, T1 ); - mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); - vec3 coords[ 4 ]; - coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); - coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); - coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); - coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); - coords[ 0 ] = normalize( coords[ 0 ] ); - coords[ 1 ] = normalize( coords[ 1 ] ); - coords[ 2 ] = normalize( coords[ 2 ] ); - coords[ 3 ] = normalize( coords[ 3 ] ); - vec3 vectorFormFactor = vec3( 0.0 ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); - vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); - float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); - return vec3( result ); -} -#if defined( USE_SHEEN ) -float D_Charlie( float roughness, float dotNH ) { - float alpha = pow2( roughness ); - float invAlpha = 1.0 / alpha; - float cos2h = dotNH * dotNH; - float sin2h = max( 1.0 - cos2h, 0.0078125 ); - return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); -} -float V_Neubelt( float dotNV, float dotNL ) { - return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); -} -vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { - vec3 halfDir = normalize( lightDir + viewDir ); - float dotNL = saturate( dot( normal, lightDir ) ); - float dotNV = saturate( dot( normal, viewDir ) ); - float dotNH = saturate( dot( normal, halfDir ) ); - float D = D_Charlie( sheenRoughness, dotNH ); - float V = V_Neubelt( dotNV, dotNL ); - return sheenColor * ( D * V ); -} -#endif -float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - float r2 = roughness * roughness; - float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; - float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; - float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); - return saturate( DG * RECIPROCAL_PI ); -} -vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { - float dotNV = saturate( dot( normal, viewDir ) ); - const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); - const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); - vec4 r = roughness * c0 + c1; - float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; - vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; - return fab; -} -vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { - vec2 fab = DFGApprox( normal, viewDir, roughness ); - return specularColor * fab.x + specularF90 * fab.y; -} -#ifdef USE_IRIDESCENCE -void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#else -void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { -#endif - vec2 fab = DFGApprox( normal, viewDir, roughness ); - #ifdef USE_IRIDESCENCE - vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); - #else - vec3 Fr = specularColor; - #endif - vec3 FssEss = Fr * fab.x + specularF90 * fab.y; - float Ess = fab.x + fab.y; - float Ems = 1.0 - Ess; - vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); - singleScatter += FssEss; - multiScatter += Fms * Ems; -} -#if NUM_RECT_AREA_LIGHTS > 0 - void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - vec3 normal = geometryNormal; - vec3 viewDir = geometryViewDir; - vec3 position = geometryPosition; - vec3 lightPos = rectAreaLight.position; - vec3 halfWidth = rectAreaLight.halfWidth; - vec3 halfHeight = rectAreaLight.halfHeight; - vec3 lightColor = rectAreaLight.color; - float roughness = material.roughness; - vec3 rectCoords[ 4 ]; - rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; - rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; - rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; - vec2 uv = LTC_Uv( normal, viewDir, roughness ); - vec4 t1 = texture2D( ltc_1, uv ); - vec4 t2 = texture2D( ltc_2, uv ); - mat3 mInv = mat3( - vec3( t1.x, 0, t1.y ), - vec3( 0, 1, 0 ), - vec3( t1.z, 0, t1.w ) - ); - vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); - reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); - reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); - } -#endif -void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); - vec3 irradiance = dotNL * directLight.color; - #ifdef USE_CLEARCOAT - float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); - vec3 ccIrradiance = dotNLcc * directLight.color; - clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); - #endif - #ifdef USE_SHEEN - sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); - #endif - reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); - reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); -} -void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { - #ifdef USE_CLEARCOAT - clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); - #endif - #ifdef USE_SHEEN - sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); - #endif - vec3 singleScattering = vec3( 0.0 ); - vec3 multiScattering = vec3( 0.0 ); - vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; - #ifdef USE_IRIDESCENCE - computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); - #else - computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); - #endif - vec3 totalScattering = singleScattering + multiScattering; - vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); - reflectedLight.indirectSpecular += radiance * singleScattering; - reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; - reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; -} -#define RE_Direct RE_Direct_Physical -#define RE_Direct_RectArea RE_Direct_RectArea_Physical -#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical -#define RE_IndirectSpecular RE_IndirectSpecular_Physical -float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { - return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); -}`,hN=` -vec3 geometryPosition = - vViewPosition; -vec3 geometryNormal = normal; -vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); -vec3 geometryClearcoatNormal = vec3( 0.0 ); -#ifdef USE_CLEARCOAT - geometryClearcoatNormal = clearcoatNormal; -#endif -#ifdef USE_IRIDESCENCE - float dotNVi = saturate( dot( normal, geometryViewDir ) ); - if ( material.iridescenceThickness == 0.0 ) { - material.iridescence = 0.0; - } else { - material.iridescence = saturate( material.iridescence ); - } - if ( material.iridescence > 0.0 ) { - material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); - material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); - } -#endif -IncidentLight directLight; -#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) - PointLight pointLight; - #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { - pointLight = pointLights[ i ]; - getPointLightInfo( pointLight, geometryPosition, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - SpotLight spotLight; - vec4 spotColor; - vec3 spotLightCoord; - bool inSpotLightMap; - #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { - spotLight = spotLights[ i ]; - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX - #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS - #else - #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) - #endif - #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) - spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; - inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); - spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); - directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; - #endif - #undef SPOT_LIGHT_MAP_INDEX - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) - DirectionalLight directionalLight; - #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLightShadow; - #endif - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { - directionalLight = directionalLights[ i ]; - getDirectionalLightInfo( directionalLight, directLight ); - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) - RectAreaLight rectAreaLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { - rectAreaLight = rectAreaLights[ i ]; - RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); - } - #pragma unroll_loop_end -#endif -#if defined( RE_IndirectDiffuse ) - vec3 iblIrradiance = vec3( 0.0 ); - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #if ( NUM_HEMI_LIGHTS > 0 ) - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - } - #pragma unroll_loop_end - #endif -#endif -#if defined( RE_IndirectSpecular ) - vec3 radiance = vec3( 0.0 ); - vec3 clearcoatRadiance = vec3( 0.0 ); -#endif`,uN=`#if defined( RE_IndirectDiffuse ) - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; - irradiance += lightMapIrradiance; - #endif - #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) - iblIrradiance += getIBLIrradiance( geometryNormal ); - #endif -#endif -#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) - #ifdef USE_ANISOTROPY - radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); - #else - radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); - #endif - #ifdef USE_CLEARCOAT - clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); - #endif -#endif`,fN=`#if defined( RE_IndirectDiffuse ) - RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif -#if defined( RE_IndirectSpecular ) - RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); -#endif`,cN=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; -#endif`,dN=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) - uniform float logDepthBufFC; - varying float vFragDepth; - varying float vIsPerspective; -#endif`,pN=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - varying float vFragDepth; - varying float vIsPerspective; - #else - uniform float logDepthBufFC; - #endif -#endif`,vN=`#ifdef USE_LOGDEPTHBUF - #ifdef USE_LOGDEPTHBUF_EXT - vFragDepth = 1.0 + gl_Position.w; - vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); - #else - if ( isPerspectiveMatrix( projectionMatrix ) ) { - gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; - gl_Position.z *= gl_Position.w; - } - #endif -#endif`,mN=`#ifdef USE_MAP - vec4 sampledDiffuseColor = texture2D( map, vMapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - - #endif - diffuseColor *= sampledDiffuseColor; -#endif`,gN=`#ifdef USE_MAP - uniform sampler2D map; -#endif`,yN=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - #if defined( USE_POINTS_UV ) - vec2 uv = vUv; - #else - vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; - #endif -#endif -#ifdef USE_MAP - diffuseColor *= texture2D( map, uv ); -#endif -#ifdef USE_ALPHAMAP - diffuseColor.a *= texture2D( alphaMap, uv ).g; -#endif`,xN=`#if defined( USE_POINTS_UV ) - varying vec2 vUv; -#else - #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) - uniform mat3 uvTransform; - #endif -#endif -#ifdef USE_MAP - uniform sampler2D map; -#endif -#ifdef USE_ALPHAMAP - uniform sampler2D alphaMap; -#endif`,SN=`float metalnessFactor = metalness; -#ifdef USE_METALNESSMAP - vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); - metalnessFactor *= texelMetalness.b; -#endif`,TN=`#ifdef USE_METALNESSMAP - uniform sampler2D metalnessMap; -#endif`,EN=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) - vColor *= morphTargetBaseInfluence; - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - #if defined( USE_COLOR_ALPHA ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; - #elif defined( USE_COLOR ) - if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; - #endif - } -#endif`,MN=`#ifdef USE_MORPHNORMALS - objectNormal *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; - } - #else - objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; - objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; - objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; - objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; - #endif -#endif`,CN=`#ifdef USE_MORPHTARGETS - uniform float morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; - uniform sampler2DArray morphTargetsTexture; - uniform ivec2 morphTargetsTextureSize; - vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { - int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; - int y = texelIndex / morphTargetsTextureSize.x; - int x = texelIndex - y * morphTargetsTextureSize.x; - ivec3 morphUV = ivec3( x, y, morphTargetIndex ); - return texelFetch( morphTargetsTexture, morphUV, 0 ); - } - #else - #ifndef USE_MORPHNORMALS - uniform float morphTargetInfluences[ 8 ]; - #else - uniform float morphTargetInfluences[ 4 ]; - #endif - #endif -#endif`,AN=`#ifdef USE_MORPHTARGETS - transformed *= morphTargetBaseInfluence; - #ifdef MORPHTARGETS_TEXTURE - for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { - if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; - } - #else - transformed += morphTarget0 * morphTargetInfluences[ 0 ]; - transformed += morphTarget1 * morphTargetInfluences[ 1 ]; - transformed += morphTarget2 * morphTargetInfluences[ 2 ]; - transformed += morphTarget3 * morphTargetInfluences[ 3 ]; - #ifndef USE_MORPHNORMALS - transformed += morphTarget4 * morphTargetInfluences[ 4 ]; - transformed += morphTarget5 * morphTargetInfluences[ 5 ]; - transformed += morphTarget6 * morphTargetInfluences[ 6 ]; - transformed += morphTarget7 * morphTargetInfluences[ 7 ]; - #endif - #endif -#endif`,wN=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; -#ifdef FLAT_SHADED - vec3 fdx = dFdx( vViewPosition ); - vec3 fdy = dFdy( vViewPosition ); - vec3 normal = normalize( cross( fdx, fdy ) ); -#else - vec3 normal = normalize( vNormal ); - #ifdef DOUBLE_SIDED - normal *= faceDirection; - #endif -#endif -#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) - #ifdef USE_TANGENT - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn = getTangentFrame( - vViewPosition, normal, - #if defined( USE_NORMALMAP ) - vNormalMapUv - #elif defined( USE_CLEARCOAT_NORMALMAP ) - vClearcoatNormalMapUv - #else - vUv - #endif - ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn[0] *= faceDirection; - tbn[1] *= faceDirection; - #endif -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - #ifdef USE_TANGENT - mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - #else - mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); - #endif - #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) - tbn2[0] *= faceDirection; - tbn2[1] *= faceDirection; - #endif -#endif -vec3 nonPerturbedNormal = normal;`,PN=`#ifdef USE_NORMALMAP_OBJECTSPACE - normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - #ifdef FLIP_SIDED - normal = - normal; - #endif - #ifdef DOUBLE_SIDED - normal = normal * faceDirection; - #endif - normal = normalize( normalMatrix * normal ); -#elif defined( USE_NORMALMAP_TANGENTSPACE ) - vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - normal = normalize( tbn * mapN ); -#elif defined( USE_BUMPMAP ) - normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); -#endif`,RN=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,LN=`#ifndef FLAT_SHADED - varying vec3 vNormal; - #ifdef USE_TANGENT - varying vec3 vTangent; - varying vec3 vBitangent; - #endif -#endif`,bN=`#ifndef FLAT_SHADED - vNormal = normalize( transformedNormal ); - #ifdef USE_TANGENT - vTangent = normalize( transformedTangent ); - vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); - #endif -#endif`,FN=`#ifdef USE_NORMALMAP - uniform sampler2D normalMap; - uniform vec2 normalScale; -#endif -#ifdef USE_NORMALMAP_OBJECTSPACE - uniform mat3 normalMatrix; -#endif -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) - mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { - vec3 q0 = dFdx( eye_pos.xyz ); - vec3 q1 = dFdy( eye_pos.xyz ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - vec3 N = surf_norm; - vec3 q1perp = cross( q1, N ); - vec3 q0perp = cross( N, q0 ); - vec3 T = q1perp * st0.x + q0perp * st1.x; - vec3 B = q1perp * st0.y + q0perp * st1.y; - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); - return mat3( T * scale, B * scale, N ); - } -#endif`,ON=`#ifdef USE_CLEARCOAT - vec3 clearcoatNormal = nonPerturbedNormal; -#endif`,DN=`#ifdef USE_CLEARCOAT_NORMALMAP - vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; - clearcoatMapN.xy *= clearcoatNormalScale; - clearcoatNormal = normalize( tbn2 * clearcoatMapN ); -#endif`,IN=`#ifdef USE_CLEARCOATMAP - uniform sampler2D clearcoatMap; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform sampler2D clearcoatNormalMap; - uniform vec2 clearcoatNormalScale; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform sampler2D clearcoatRoughnessMap; -#endif`,NN=`#ifdef USE_IRIDESCENCEMAP - uniform sampler2D iridescenceMap; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform sampler2D iridescenceThicknessMap; -#endif`,BN=`#ifdef OPAQUE -diffuseColor.a = 1.0; -#endif -#ifdef USE_TRANSMISSION -diffuseColor.a *= material.transmissionAlpha; -#endif -gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,UN=`vec3 packNormalToRGB( const in vec3 normal ) { - return normalize( normal ) * 0.5 + 0.5; -} -vec3 unpackRGBToNormal( const in vec3 rgb ) { - return 2.0 * rgb.xyz - 1.0; -} -const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; -const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); -const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); -const float ShiftRight8 = 1. / 256.; -vec4 packDepthToRGBA( const in float v ) { - vec4 r = vec4( fract( v * PackFactors ), v ); - r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; -} -float unpackRGBAToDepth( const in vec4 v ) { - return dot( v, UnpackFactors ); -} -vec2 packDepthToRG( in highp float v ) { - return packDepthToRGBA( v ).yx; -} -float unpackRGToDepth( const in highp vec2 v ) { - return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); -} -vec4 pack2HalfToRGBA( vec2 v ) { - vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); - return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); -} -vec2 unpackRGBATo2Half( vec4 v ) { - return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); -} -float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { - return ( viewZ + near ) / ( near - far ); -} -float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { - return depth * ( near - far ) - near; -} -float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { - return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); -} -float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { - return ( near * far ) / ( ( far - near ) * depth - far ); -}`,zN=`#ifdef PREMULTIPLIED_ALPHA - gl_FragColor.rgb *= gl_FragColor.a; -#endif`,GN=`vec4 mvPosition = vec4( transformed, 1.0 ); -#ifdef USE_BATCHING - mvPosition = batchingMatrix * mvPosition; -#endif -#ifdef USE_INSTANCING - mvPosition = instanceMatrix * mvPosition; -#endif -mvPosition = modelViewMatrix * mvPosition; -gl_Position = projectionMatrix * mvPosition;`,VN=`#ifdef DITHERING - gl_FragColor.rgb = dithering( gl_FragColor.rgb ); -#endif`,HN=`#ifdef DITHERING - vec3 dithering( vec3 color ) { - float grid_position = rand( gl_FragCoord.xy ); - vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); - dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); - return color + dither_shift_RGB; - } -#endif`,WN=`float roughnessFactor = roughness; -#ifdef USE_ROUGHNESSMAP - vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); - roughnessFactor *= texelRoughness.g; -#endif`,XN=`#ifdef USE_ROUGHNESSMAP - uniform sampler2D roughnessMap; -#endif`,YN=`#if NUM_SPOT_LIGHT_COORDS > 0 - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#if NUM_SPOT_LIGHT_MAPS > 0 - uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif - float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { - return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); - } - vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { - return unpackRGBATo2Half( texture2D( shadow, uv ) ); - } - float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ - float occlusion = 1.0; - vec2 distribution = texture2DDistribution( shadow, uv ); - float hard_shadow = step( compare , distribution.x ); - if (hard_shadow != 1.0 ) { - float distance = compare - distribution.x ; - float variance = max( 0.00000, distribution.y * distribution.y ); - float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); - } - return occlusion; - } - float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { - float shadow = 1.0; - shadowCoord.xyz /= shadowCoord.w; - shadowCoord.z += shadowBias; - bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; - bool frustumTest = inFrustum && shadowCoord.z <= 1.0; - if ( frustumTest ) { - #if defined( SHADOWMAP_TYPE_PCF ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx0 = - texelSize.x * shadowRadius; - float dy0 = - texelSize.y * shadowRadius; - float dx1 = + texelSize.x * shadowRadius; - float dy1 = + texelSize.y * shadowRadius; - float dx2 = dx0 / 2.0; - float dy2 = dy0 / 2.0; - float dx3 = dx1 / 2.0; - float dy3 = dy1 / 2.0; - shadow = ( - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + - texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) - ) * ( 1.0 / 17.0 ); - #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) - vec2 texelSize = vec2( 1.0 ) / shadowMapSize; - float dx = texelSize.x; - float dy = texelSize.y; - vec2 uv = shadowCoord.xy; - vec2 f = fract( uv * shadowMapSize + 0.5 ); - uv -= f * texelSize; - shadow = ( - texture2DCompare( shadowMap, uv, shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + - texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), - f.x ) + - mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), - f.y ) + - mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), - f.x ), - mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), - texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), - f.x ), - f.y ) - ) * ( 1.0 / 9.0 ); - #elif defined( SHADOWMAP_TYPE_VSM ) - shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); - #else - shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); - #endif - } - return shadow; - } - vec2 cubeToUV( vec3 v, float texelSizeY ) { - vec3 absV = abs( v ); - float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); - absV *= scaleToCube; - v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); - vec2 planar = v.xy; - float almostATexel = 1.5 * texelSizeY; - float almostOne = 1.0 - almostATexel; - if ( absV.z >= almostOne ) { - if ( v.z > 0.0 ) - planar.x = 4.0 - v.x; - } else if ( absV.x >= almostOne ) { - float signX = sign( v.x ); - planar.x = v.z * signX + 2.0 * signX; - } else if ( absV.y >= almostOne ) { - float signY = sign( v.y ); - planar.x = v.x + 2.0 * signY + 2.0; - planar.y = v.z * signY - 2.0; - } - return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); - } - float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { - vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); - vec3 lightToPosition = shadowCoord.xyz; - float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; - vec3 bd3D = normalize( lightToPosition ); - #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) - vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; - return ( - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + - texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) - ) * ( 1.0 / 9.0 ); - #else - return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); - #endif - } -#endif`,kN=`#if NUM_SPOT_LIGHT_COORDS > 0 - uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; - varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; -#endif -#ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; - varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; - struct DirectionalLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - struct SpotLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - }; - uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; - varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; - struct PointLightShadow { - float shadowBias; - float shadowNormalBias; - float shadowRadius; - vec2 shadowMapSize; - float shadowCameraNear; - float shadowCameraFar; - }; - uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; - #endif -#endif`,KN=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) - vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); - vec4 shadowWorldPosition; -#endif -#if defined( USE_SHADOWMAP ) - #if NUM_DIR_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); - vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); - vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end - #endif -#endif -#if NUM_SPOT_LIGHT_COORDS > 0 - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { - shadowWorldPosition = worldPosition; - #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; - #endif - vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; - } - #pragma unroll_loop_end -#endif`,jN=`float getShadowMask() { - float shadow = 1.0; - #ifdef USE_SHADOWMAP - #if NUM_DIR_LIGHT_SHADOWS > 0 - DirectionalLightShadow directionalLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { - directionalLight = directionalLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_SPOT_LIGHT_SHADOWS > 0 - SpotLightShadow spotLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { - spotLight = spotLightShadows[ i ]; - shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; - } - #pragma unroll_loop_end - #endif - #if NUM_POINT_LIGHT_SHADOWS > 0 - PointLightShadow pointLight; - #pragma unroll_loop_start - for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { - pointLight = pointLightShadows[ i ]; - shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; - } - #pragma unroll_loop_end - #endif - #endif - return shadow; -}`,ZN=`#ifdef USE_SKINNING - mat4 boneMatX = getBoneMatrix( skinIndex.x ); - mat4 boneMatY = getBoneMatrix( skinIndex.y ); - mat4 boneMatZ = getBoneMatrix( skinIndex.z ); - mat4 boneMatW = getBoneMatrix( skinIndex.w ); -#endif`,JN=`#ifdef USE_SKINNING - uniform mat4 bindMatrix; - uniform mat4 bindMatrixInverse; - uniform highp sampler2D boneTexture; - mat4 getBoneMatrix( const in float i ) { - int size = textureSize( boneTexture, 0 ).x; - int j = int( i ) * 4; - int x = j % size; - int y = j / size; - vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); - vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); - vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); - vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); - return mat4( v1, v2, v3, v4 ); - } -#endif`,$N=`#ifdef USE_SKINNING - vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); - vec4 skinned = vec4( 0.0 ); - skinned += boneMatX * skinVertex * skinWeight.x; - skinned += boneMatY * skinVertex * skinWeight.y; - skinned += boneMatZ * skinVertex * skinWeight.z; - skinned += boneMatW * skinVertex * skinWeight.w; - transformed = ( bindMatrixInverse * skinned ).xyz; -#endif`,QN=`#ifdef USE_SKINNING - mat4 skinMatrix = mat4( 0.0 ); - skinMatrix += skinWeight.x * boneMatX; - skinMatrix += skinWeight.y * boneMatY; - skinMatrix += skinWeight.z * boneMatZ; - skinMatrix += skinWeight.w * boneMatW; - skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; - objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; - #ifdef USE_TANGENT - objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; - #endif -#endif`,_N=`float specularStrength; -#ifdef USE_SPECULARMAP - vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); - specularStrength = texelSpecular.r; -#else - specularStrength = 1.0; -#endif`,qN=`#ifdef USE_SPECULARMAP - uniform sampler2D specularMap; -#endif`,tB=`#if defined( TONE_MAPPING ) - gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); -#endif`,eB=`#ifndef saturate -#define saturate( a ) clamp( a, 0.0, 1.0 ) -#endif -uniform float toneMappingExposure; -vec3 LinearToneMapping( vec3 color ) { - return saturate( toneMappingExposure * color ); -} -vec3 ReinhardToneMapping( vec3 color ) { - color *= toneMappingExposure; - return saturate( color / ( vec3( 1.0 ) + color ) ); -} -vec3 OptimizedCineonToneMapping( vec3 color ) { - color *= toneMappingExposure; - color = max( vec3( 0.0 ), color - 0.004 ); - return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); -} -vec3 RRTAndODTFit( vec3 v ) { - vec3 a = v * ( v + 0.0245786 ) - 0.000090537; - vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; - return a / b; -} -vec3 ACESFilmicToneMapping( vec3 color ) { - const mat3 ACESInputMat = mat3( - vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), - vec3( 0.04823, 0.01566, 0.83777 ) - ); - const mat3 ACESOutputMat = mat3( - vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), - vec3( -0.07367, -0.00605, 1.07602 ) - ); - color *= toneMappingExposure / 0.6; - color = ACESInputMat * color; - color = RRTAndODTFit( color ); - color = ACESOutputMat * color; - return saturate( color ); -} -const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( - vec3( 1.6605, - 0.1246, - 0.0182 ), - vec3( - 0.5876, 1.1329, - 0.1006 ), - vec3( - 0.0728, - 0.0083, 1.1187 ) -); -const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( - vec3( 0.6274, 0.0691, 0.0164 ), - vec3( 0.3293, 0.9195, 0.0880 ), - vec3( 0.0433, 0.0113, 0.8956 ) -); -vec3 agxDefaultContrastApprox( vec3 x ) { - vec3 x2 = x * x; - vec3 x4 = x2 * x2; - return + 15.5 * x4 * x2 - - 40.14 * x4 * x - + 31.96 * x4 - - 6.868 * x2 * x - + 0.4298 * x2 - + 0.1191 * x - - 0.00232; -} -vec3 AgXToneMapping( vec3 color ) { - const mat3 AgXInsetMatrix = mat3( - vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), - vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), - vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) - ); - const mat3 AgXOutsetMatrix = mat3( - vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), - vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), - vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) - ); - const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; - color *= toneMappingExposure; - color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; - color = AgXInsetMatrix * color; - color = max( color, 1e-10 ); color = log2( color ); - color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); - color = clamp( color, 0.0, 1.0 ); - color = agxDefaultContrastApprox( color ); - color = AgXOutsetMatrix * color; - color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); - color = LINEAR_REC2020_TO_LINEAR_SRGB * color; - color = clamp( color, 0.0, 1.0 ); - return color; -} -vec3 CustomToneMapping( vec3 color ) { return color; }`,iB=`#ifdef USE_TRANSMISSION - material.transmission = transmission; - material.transmissionAlpha = 1.0; - material.thickness = thickness; - material.attenuationDistance = attenuationDistance; - material.attenuationColor = attenuationColor; - #ifdef USE_TRANSMISSIONMAP - material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; - #endif - #ifdef USE_THICKNESSMAP - material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; - #endif - vec3 pos = vWorldPosition; - vec3 v = normalize( cameraPosition - pos ); - vec3 n = inverseTransformDirection( normal, viewMatrix ); - vec4 transmitted = getIBLVolumeRefraction( - n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, - pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, - material.attenuationColor, material.attenuationDistance ); - material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); - totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); -#endif`,nB=`#ifdef USE_TRANSMISSION - uniform float transmission; - uniform float thickness; - uniform float attenuationDistance; - uniform vec3 attenuationColor; - #ifdef USE_TRANSMISSIONMAP - uniform sampler2D transmissionMap; - #endif - #ifdef USE_THICKNESSMAP - uniform sampler2D thicknessMap; - #endif - uniform vec2 transmissionSamplerSize; - uniform sampler2D transmissionSamplerMap; - uniform mat4 modelMatrix; - uniform mat4 projectionMatrix; - varying vec3 vWorldPosition; - float w0( float a ) { - return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); - } - float w1( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); - } - float w2( float a ){ - return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); - } - float w3( float a ) { - return ( 1.0 / 6.0 ) * ( a * a * a ); - } - float g0( float a ) { - return w0( a ) + w1( a ); - } - float g1( float a ) { - return w2( a ) + w3( a ); - } - float h0( float a ) { - return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); - } - float h1( float a ) { - return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); - } - vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { - uv = uv * texelSize.zw + 0.5; - vec2 iuv = floor( uv ); - vec2 fuv = fract( uv ); - float g0x = g0( fuv.x ); - float g1x = g1( fuv.x ); - float h0x = h0( fuv.x ); - float h1x = h1( fuv.x ); - float h0y = h0( fuv.y ); - float h1y = h1( fuv.y ); - vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; - vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; - return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + - g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); - } - vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { - vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); - vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); - vec2 fLodSizeInv = 1.0 / fLodSize; - vec2 cLodSizeInv = 1.0 / cLodSize; - vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); - vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); - return mix( fSample, cSample, fract( lod ) ); - } - vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { - vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); - vec3 modelScale; - modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); - modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); - modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); - return normalize( refractionVector ) * thickness * modelScale; - } - float applyIorToRoughness( const in float roughness, const in float ior ) { - return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); - } - vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { - float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); - return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); - } - vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { - if ( isinf( attenuationDistance ) ) { - return vec3( 1.0 ); - } else { - vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; - vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; - } - } - vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, - const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, - const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, - const in vec3 attenuationColor, const in float attenuationDistance ) { - vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); - vec3 refractedRayExit = position + transmissionRay; - vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); - vec2 refractionCoords = ndcPos.xy / ndcPos.w; - refractionCoords += 1.0; - refractionCoords /= 2.0; - vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); - vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); - vec3 attenuatedColor = transmittance * transmittedLight.rgb; - vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); - float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; - return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); - } -#endif`,rB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - varying vec2 vNormalMapUv; -#endif -#ifdef USE_EMISSIVEMAP - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_SPECULARMAP - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,sB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - varying vec2 vUv; -#endif -#ifdef USE_MAP - uniform mat3 mapTransform; - varying vec2 vMapUv; -#endif -#ifdef USE_ALPHAMAP - uniform mat3 alphaMapTransform; - varying vec2 vAlphaMapUv; -#endif -#ifdef USE_LIGHTMAP - uniform mat3 lightMapTransform; - varying vec2 vLightMapUv; -#endif -#ifdef USE_AOMAP - uniform mat3 aoMapTransform; - varying vec2 vAoMapUv; -#endif -#ifdef USE_BUMPMAP - uniform mat3 bumpMapTransform; - varying vec2 vBumpMapUv; -#endif -#ifdef USE_NORMALMAP - uniform mat3 normalMapTransform; - varying vec2 vNormalMapUv; -#endif -#ifdef USE_DISPLACEMENTMAP - uniform mat3 displacementMapTransform; - varying vec2 vDisplacementMapUv; -#endif -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapTransform; - varying vec2 vEmissiveMapUv; -#endif -#ifdef USE_METALNESSMAP - uniform mat3 metalnessMapTransform; - varying vec2 vMetalnessMapUv; -#endif -#ifdef USE_ROUGHNESSMAP - uniform mat3 roughnessMapTransform; - varying vec2 vRoughnessMapUv; -#endif -#ifdef USE_ANISOTROPYMAP - uniform mat3 anisotropyMapTransform; - varying vec2 vAnisotropyMapUv; -#endif -#ifdef USE_CLEARCOATMAP - uniform mat3 clearcoatMapTransform; - varying vec2 vClearcoatMapUv; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - uniform mat3 clearcoatNormalMapTransform; - varying vec2 vClearcoatNormalMapUv; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - uniform mat3 clearcoatRoughnessMapTransform; - varying vec2 vClearcoatRoughnessMapUv; -#endif -#ifdef USE_SHEEN_COLORMAP - uniform mat3 sheenColorMapTransform; - varying vec2 vSheenColorMapUv; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - uniform mat3 sheenRoughnessMapTransform; - varying vec2 vSheenRoughnessMapUv; -#endif -#ifdef USE_IRIDESCENCEMAP - uniform mat3 iridescenceMapTransform; - varying vec2 vIridescenceMapUv; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - uniform mat3 iridescenceThicknessMapTransform; - varying vec2 vIridescenceThicknessMapUv; -#endif -#ifdef USE_SPECULARMAP - uniform mat3 specularMapTransform; - varying vec2 vSpecularMapUv; -#endif -#ifdef USE_SPECULAR_COLORMAP - uniform mat3 specularColorMapTransform; - varying vec2 vSpecularColorMapUv; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - uniform mat3 specularIntensityMapTransform; - varying vec2 vSpecularIntensityMapUv; -#endif -#ifdef USE_TRANSMISSIONMAP - uniform mat3 transmissionMapTransform; - varying vec2 vTransmissionMapUv; -#endif -#ifdef USE_THICKNESSMAP - uniform mat3 thicknessMapTransform; - varying vec2 vThicknessMapUv; -#endif`,aB=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) - vUv = vec3( uv, 1 ).xy; -#endif -#ifdef USE_MAP - vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ALPHAMAP - vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_LIGHTMAP - vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_AOMAP - vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_BUMPMAP - vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_NORMALMAP - vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_DISPLACEMENTMAP - vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_EMISSIVEMAP - vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_METALNESSMAP - vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ROUGHNESSMAP - vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_ANISOTROPYMAP - vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOATMAP - vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_NORMALMAP - vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_CLEARCOAT_ROUGHNESSMAP - vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCEMAP - vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_IRIDESCENCE_THICKNESSMAP - vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_COLORMAP - vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SHEEN_ROUGHNESSMAP - vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULARMAP - vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_COLORMAP - vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_SPECULAR_INTENSITYMAP - vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_TRANSMISSIONMAP - vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; -#endif -#ifdef USE_THICKNESSMAP - vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; -#endif`,oB=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 - vec4 worldPosition = vec4( transformed, 1.0 ); - #ifdef USE_BATCHING - worldPosition = batchingMatrix * worldPosition; - #endif - #ifdef USE_INSTANCING - worldPosition = instanceMatrix * worldPosition; - #endif - worldPosition = modelMatrix * worldPosition; -#endif`;const lB=`varying vec2 vUv; -uniform mat3 uvTransform; -void main() { - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - gl_Position = vec4( position.xy, 1.0, 1.0 ); -}`,hB=`uniform sampler2D t2D; -uniform float backgroundIntensity; -varying vec2 vUv; -void main() { - vec4 texColor = texture2D( t2D, vUv ); - #ifdef DECODE_VIDEO_TEXTURE - texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,uB=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,fB=`#ifdef ENVMAP_TYPE_CUBE - uniform samplerCube envMap; -#elif defined( ENVMAP_TYPE_CUBE_UV ) - uniform sampler2D envMap; -#endif -uniform float flipEnvMap; -uniform float backgroundBlurriness; -uniform float backgroundIntensity; -varying vec3 vWorldDirection; -#include -void main() { - #ifdef ENVMAP_TYPE_CUBE - vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); - #elif defined( ENVMAP_TYPE_CUBE_UV ) - vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); - #else - vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #endif - texColor.rgb *= backgroundIntensity; - gl_FragColor = texColor; - #include - #include -}`,cB=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include - gl_Position.z = gl_Position.w; -}`,dB=`uniform samplerCube tCube; -uniform float tFlip; -uniform float opacity; -varying vec3 vWorldDirection; -void main() { - vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); - gl_FragColor = texColor; - gl_FragColor.a *= opacity; - #include - #include -}`,pB=`#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vHighPrecisionZW = gl_Position.zw; -}`,vB=`#if DEPTH_PACKING == 3200 - uniform float opacity; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -varying vec2 vHighPrecisionZW; -void main() { - vec4 diffuseColor = vec4( 1.0 ); - #include - #if DEPTH_PACKING == 3200 - diffuseColor.a = opacity; - #endif - #include - #include - #include - #include - #include - float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; - #if DEPTH_PACKING == 3200 - gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); - #elif DEPTH_PACKING == 3201 - gl_FragColor = packDepthToRGBA( fragCoordZ ); - #endif -}`,mB=`#define DISTANCE -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #ifdef USE_DISPLACEMENTMAP - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - vWorldPosition = worldPosition.xyz; -}`,gB=`#define DISTANCE -uniform vec3 referencePosition; -uniform float nearDistance; -uniform float farDistance; -varying vec3 vWorldPosition; -#include -#include -#include -#include -#include -#include -#include -#include -void main () { - vec4 diffuseColor = vec4( 1.0 ); - #include - #include - #include - #include - #include - float dist = length( vWorldPosition - referencePosition ); - dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); - dist = saturate( dist ); - gl_FragColor = packDepthToRGBA( dist ); -}`,yB=`varying vec3 vWorldDirection; -#include -void main() { - vWorldDirection = transformDirection( position, modelMatrix ); - #include - #include -}`,xB=`uniform sampler2D tEquirect; -varying vec3 vWorldDirection; -#include -void main() { - vec3 direction = normalize( vWorldDirection ); - vec2 sampleUV = equirectUv( direction ); - gl_FragColor = texture2D( tEquirect, sampleUV ); - #include - #include -}`,SB=`uniform float scale; -attribute float lineDistance; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vLineDistance = scale * lineDistance; - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,TB=`uniform vec3 diffuse; -uniform float opacity; -uniform float dashSize; -uniform float totalSize; -varying float vLineDistance; -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - if ( mod( vLineDistance, totalSize ) > dashSize ) { - discard; - } - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,EB=`#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,MB=`uniform vec3 diffuse; -uniform float opacity; -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - #ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); - reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; - #else - reflectedLight.indirectDiffuse += vec3( 1.0 ); - #endif - #include - reflectedLight.indirectDiffuse *= diffuseColor.rgb; - vec3 outgoingLight = reflectedLight.indirectDiffuse; - #include - #include - #include - #include - #include - #include - #include -}`,CB=`#define LAMBERT -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,AB=`#define LAMBERT -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,wB=`#define MATCAP -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; -}`,PB=`#define MATCAP -uniform vec3 diffuse; -uniform float opacity; -uniform sampler2D matcap; -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 viewDir = normalize( vViewPosition ); - vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); - vec3 y = cross( viewDir, x ); - vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; - #ifdef USE_MATCAP - vec4 matcapColor = texture2D( matcap, uv ); - #else - vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); - #endif - vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; - #include - #include - #include - #include - #include - #include -}`,RB=`#define NORMAL -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - vViewPosition = - mvPosition.xyz; -#endif -}`,LB=`#define NORMAL -uniform float opacity; -#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) - varying vec3 vViewPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); - #include - #include - #include - #include - gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a ); - #ifdef OPAQUE - gl_FragColor.a = 1.0; - #endif -}`,bB=`#define PHONG -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include - #include -}`,FB=`#define PHONG -uniform vec3 diffuse; -uniform vec3 emissive; -uniform vec3 specular; -uniform float shininess; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include - #include -}`,OB=`#define STANDARD -varying vec3 vViewPosition; -#ifdef USE_TRANSMISSION - varying vec3 vWorldPosition; -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -#ifdef USE_TRANSMISSION - vWorldPosition = worldPosition.xyz; -#endif -}`,DB=`#define STANDARD -#ifdef PHYSICAL - #define IOR - #define USE_SPECULAR -#endif -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float roughness; -uniform float metalness; -uniform float opacity; -#ifdef IOR - uniform float ior; -#endif -#ifdef USE_SPECULAR - uniform float specularIntensity; - uniform vec3 specularColor; - #ifdef USE_SPECULAR_COLORMAP - uniform sampler2D specularColorMap; - #endif - #ifdef USE_SPECULAR_INTENSITYMAP - uniform sampler2D specularIntensityMap; - #endif -#endif -#ifdef USE_CLEARCOAT - uniform float clearcoat; - uniform float clearcoatRoughness; -#endif -#ifdef USE_IRIDESCENCE - uniform float iridescence; - uniform float iridescenceIOR; - uniform float iridescenceThicknessMinimum; - uniform float iridescenceThicknessMaximum; -#endif -#ifdef USE_SHEEN - uniform vec3 sheenColor; - uniform float sheenRoughness; - #ifdef USE_SHEEN_COLORMAP - uniform sampler2D sheenColorMap; - #endif - #ifdef USE_SHEEN_ROUGHNESSMAP - uniform sampler2D sheenRoughnessMap; - #endif -#endif -#ifdef USE_ANISOTROPY - uniform vec2 anisotropyVector; - #ifdef USE_ANISOTROPYMAP - uniform sampler2D anisotropyMap; - #endif -#endif -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; - #include - vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; - #ifdef USE_SHEEN - float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); - outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; - #endif - #ifdef USE_CLEARCOAT - float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); - vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); - outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; - #endif - #include - #include - #include - #include - #include - #include -}`,IB=`#define TOON -varying vec3 vViewPosition; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vViewPosition = - mvPosition.xyz; - #include - #include - #include -}`,NB=`#define TOON -uniform vec3 diffuse; -uniform vec3 emissive; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive; - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; - #include - #include - #include - #include - #include - #include -}`,BB=`uniform float size; -uniform float scale; -#include -#include -#include -#include -#include -#include -#ifdef USE_POINTS_UV - varying vec2 vUv; - uniform mat3 uvTransform; -#endif -void main() { - #ifdef USE_POINTS_UV - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #include - #include - #include - #include - #include - gl_PointSize = size; - #ifdef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); - #endif - #include - #include - #include - #include -}`,UB=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include - #include -}`,zB=`#include -#include -#include -#include -#include -#include -#include -void main() { - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -}`,GB=`uniform vec3 color; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - #include - gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); - #include - #include - #include -}`,VB=`uniform float rotation; -uniform vec2 center; -#include -#include -#include -#include -#include -void main() { - #include - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - #ifndef USE_SIZEATTENUATION - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - #endif - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - gl_Position = projectionMatrix * mvPosition; - #include - #include - #include -}`,HB=`uniform vec3 diffuse; -uniform float opacity; -#include -#include -#include -#include -#include -#include -#include -#include -#include -void main() { - vec4 diffuseColor = vec4( diffuse, opacity ); - #include - vec3 outgoingLight = vec3( 0.0 ); - #include - #include - #include - #include - #include - outgoingLight = diffuseColor.rgb; - #include - #include - #include - #include -}`,ti={alphahash_fragment:h9,alphahash_pars_fragment:u9,alphamap_fragment:f9,alphamap_pars_fragment:c9,alphatest_fragment:d9,alphatest_pars_fragment:p9,aomap_fragment:v9,aomap_pars_fragment:m9,batching_pars_vertex:g9,batching_vertex:y9,begin_vertex:x9,beginnormal_vertex:S9,bsdfs:T9,iridescence_fragment:E9,bumpmap_pars_fragment:M9,clipping_planes_fragment:C9,clipping_planes_pars_fragment:A9,clipping_planes_pars_vertex:w9,clipping_planes_vertex:P9,color_fragment:R9,color_pars_fragment:L9,color_pars_vertex:b9,color_vertex:F9,common:O9,cube_uv_reflection_fragment:D9,defaultnormal_vertex:I9,displacementmap_pars_vertex:N9,displacementmap_vertex:B9,emissivemap_fragment:U9,emissivemap_pars_fragment:z9,colorspace_fragment:G9,colorspace_pars_fragment:V9,envmap_fragment:H9,envmap_common_pars_fragment:W9,envmap_pars_fragment:X9,envmap_pars_vertex:Y9,envmap_physical_pars_fragment:iN,envmap_vertex:k9,fog_vertex:K9,fog_pars_vertex:j9,fog_fragment:Z9,fog_pars_fragment:J9,gradientmap_pars_fragment:$9,lightmap_fragment:Q9,lightmap_pars_fragment:_9,lights_lambert_fragment:q9,lights_lambert_pars_fragment:tN,lights_pars_begin:eN,lights_toon_fragment:nN,lights_toon_pars_fragment:rN,lights_phong_fragment:sN,lights_phong_pars_fragment:aN,lights_physical_fragment:oN,lights_physical_pars_fragment:lN,lights_fragment_begin:hN,lights_fragment_maps:uN,lights_fragment_end:fN,logdepthbuf_fragment:cN,logdepthbuf_pars_fragment:dN,logdepthbuf_pars_vertex:pN,logdepthbuf_vertex:vN,map_fragment:mN,map_pars_fragment:gN,map_particle_fragment:yN,map_particle_pars_fragment:xN,metalnessmap_fragment:SN,metalnessmap_pars_fragment:TN,morphcolor_vertex:EN,morphnormal_vertex:MN,morphtarget_pars_vertex:CN,morphtarget_vertex:AN,normal_fragment_begin:wN,normal_fragment_maps:PN,normal_pars_fragment:RN,normal_pars_vertex:LN,normal_vertex:bN,normalmap_pars_fragment:FN,clearcoat_normal_fragment_begin:ON,clearcoat_normal_fragment_maps:DN,clearcoat_pars_fragment:IN,iridescence_pars_fragment:NN,opaque_fragment:BN,packing:UN,premultiplied_alpha_fragment:zN,project_vertex:GN,dithering_fragment:VN,dithering_pars_fragment:HN,roughnessmap_fragment:WN,roughnessmap_pars_fragment:XN,shadowmap_pars_fragment:YN,shadowmap_pars_vertex:kN,shadowmap_vertex:KN,shadowmask_pars_fragment:jN,skinbase_vertex:ZN,skinning_pars_vertex:JN,skinning_vertex:$N,skinnormal_vertex:QN,specularmap_fragment:_N,specularmap_pars_fragment:qN,tonemapping_fragment:tB,tonemapping_pars_fragment:eB,transmission_fragment:iB,transmission_pars_fragment:nB,uv_pars_fragment:rB,uv_pars_vertex:sB,uv_vertex:aB,worldpos_vertex:oB,background_vert:lB,background_frag:hB,backgroundCube_vert:uB,backgroundCube_frag:fB,cube_vert:cB,cube_frag:dB,depth_vert:pB,depth_frag:vB,distanceRGBA_vert:mB,distanceRGBA_frag:gB,equirect_vert:yB,equirect_frag:xB,linedashed_vert:SB,linedashed_frag:TB,meshbasic_vert:EB,meshbasic_frag:MB,meshlambert_vert:CB,meshlambert_frag:AB,meshmatcap_vert:wB,meshmatcap_frag:PB,meshnormal_vert:RB,meshnormal_frag:LB,meshphong_vert:bB,meshphong_frag:FB,meshphysical_vert:OB,meshphysical_frag:DB,meshtoon_vert:IB,meshtoon_frag:NB,points_vert:BB,points_frag:UB,shadow_vert:zB,shadow_frag:GB,sprite_vert:VB,sprite_frag:HB},ne={common:{diffuse:{value:new fe(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new ni},alphaMap:{value:null},alphaMapTransform:{value:new ni},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new ni}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new ni}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new ni}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new ni},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new ni},normalScale:{value:new jt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new ni},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new ni}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new ni}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new ni}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new fe(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new fe(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new ni},alphaTest:{value:0},uvTransform:{value:new ni}},sprite:{diffuse:{value:new fe(16777215)},opacity:{value:1},center:{value:new jt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new ni},alphaMap:{value:null},alphaMapTransform:{value:new ni},alphaTest:{value:0}}},js={basic:{uniforms:Tr([ne.common,ne.specularmap,ne.envmap,ne.aomap,ne.lightmap,ne.fog]),vertexShader:ti.meshbasic_vert,fragmentShader:ti.meshbasic_frag},lambert:{uniforms:Tr([ne.common,ne.specularmap,ne.envmap,ne.aomap,ne.lightmap,ne.emissivemap,ne.bumpmap,ne.normalmap,ne.displacementmap,ne.fog,ne.lights,{emissive:{value:new fe(0)}}]),vertexShader:ti.meshlambert_vert,fragmentShader:ti.meshlambert_frag},phong:{uniforms:Tr([ne.common,ne.specularmap,ne.envmap,ne.aomap,ne.lightmap,ne.emissivemap,ne.bumpmap,ne.normalmap,ne.displacementmap,ne.fog,ne.lights,{emissive:{value:new fe(0)},specular:{value:new fe(1118481)},shininess:{value:30}}]),vertexShader:ti.meshphong_vert,fragmentShader:ti.meshphong_frag},standard:{uniforms:Tr([ne.common,ne.envmap,ne.aomap,ne.lightmap,ne.emissivemap,ne.bumpmap,ne.normalmap,ne.displacementmap,ne.roughnessmap,ne.metalnessmap,ne.fog,ne.lights,{emissive:{value:new fe(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ti.meshphysical_vert,fragmentShader:ti.meshphysical_frag},toon:{uniforms:Tr([ne.common,ne.aomap,ne.lightmap,ne.emissivemap,ne.bumpmap,ne.normalmap,ne.displacementmap,ne.gradientmap,ne.fog,ne.lights,{emissive:{value:new fe(0)}}]),vertexShader:ti.meshtoon_vert,fragmentShader:ti.meshtoon_frag},matcap:{uniforms:Tr([ne.common,ne.bumpmap,ne.normalmap,ne.displacementmap,ne.fog,{matcap:{value:null}}]),vertexShader:ti.meshmatcap_vert,fragmentShader:ti.meshmatcap_frag},points:{uniforms:Tr([ne.points,ne.fog]),vertexShader:ti.points_vert,fragmentShader:ti.points_frag},dashed:{uniforms:Tr([ne.common,ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ti.linedashed_vert,fragmentShader:ti.linedashed_frag},depth:{uniforms:Tr([ne.common,ne.displacementmap]),vertexShader:ti.depth_vert,fragmentShader:ti.depth_frag},normal:{uniforms:Tr([ne.common,ne.bumpmap,ne.normalmap,ne.displacementmap,{opacity:{value:1}}]),vertexShader:ti.meshnormal_vert,fragmentShader:ti.meshnormal_frag},sprite:{uniforms:Tr([ne.sprite,ne.fog]),vertexShader:ti.sprite_vert,fragmentShader:ti.sprite_frag},background:{uniforms:{uvTransform:{value:new ni},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:ti.background_vert,fragmentShader:ti.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:ti.backgroundCube_vert,fragmentShader:ti.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ti.cube_vert,fragmentShader:ti.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ti.equirect_vert,fragmentShader:ti.equirect_frag},distanceRGBA:{uniforms:Tr([ne.common,ne.displacementmap,{referencePosition:{value:new pt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ti.distanceRGBA_vert,fragmentShader:ti.distanceRGBA_frag},shadow:{uniforms:Tr([ne.lights,ne.fog,{color:{value:new fe(0)},opacity:{value:1}}]),vertexShader:ti.shadow_vert,fragmentShader:ti.shadow_frag}};js.physical={uniforms:Tr([js.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new ni},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new ni},clearcoatNormalScale:{value:new jt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new ni},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new ni},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new ni},sheen:{value:0},sheenColor:{value:new fe(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new ni},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new ni},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new ni},transmissionSamplerSize:{value:new jt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new ni},attenuationDistance:{value:0},attenuationColor:{value:new fe(0)},specularColor:{value:new fe(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new ni},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new ni},anisotropyVector:{value:new jt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new ni}}]),vertexShader:ti.meshphysical_vert,fragmentShader:ti.meshphysical_frag};const fv={r:0,b:0,g:0};function WB(g,e,i,x,T,E,a){const y=new fe(0);let t=E===!0?0:1,r,p,h=null,o=0,l=null;function n(f,s){let c=!1,d=s.isScene===!0?s.background:null;d&&d.isTexture&&(d=(s.backgroundBlurriness>0?i:e).get(d)),d===null?u(y,t):d&&d.isColor&&(u(d,1),c=!0);const v=g.xr.getEnvironmentBlendMode();v==="additive"?x.buffers.color.setClear(0,0,0,1,a):v==="alpha-blend"&&x.buffers.color.setClear(0,0,0,0,a),(g.autoClear||c)&&g.clear(g.autoClearColor,g.autoClearDepth,g.autoClearStencil),d&&(d.isCubeTexture||d.mapping===yf)?(p===void 0&&(p=new En(new Ih(1,1,1),new $s({name:"BackgroundCubeMaterial",uniforms:df(js.backgroundCube.uniforms),vertexShader:js.backgroundCube.vertexShader,fragmentShader:js.backgroundCube.fragmentShader,side:Cr,depthTest:!1,depthWrite:!1,fog:!1})),p.geometry.deleteAttribute("normal"),p.geometry.deleteAttribute("uv"),p.onBeforeRender=function(m,S,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(p.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),T.update(p)),p.material.uniforms.envMap.value=d,p.material.uniforms.flipEnvMap.value=d.isCubeTexture&&d.isRenderTargetTexture===!1?-1:1,p.material.uniforms.backgroundBlurriness.value=s.backgroundBlurriness,p.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,p.material.toneMapped=xi.getTransfer(d.colorSpace)!==Di,(h!==d||o!==d.version||l!==g.toneMapping)&&(p.material.needsUpdate=!0,h=d,o=d.version,l=g.toneMapping),p.layers.enableAll(),f.unshift(p,p.geometry,p.material,0,0,null)):d&&d.isTexture&&(r===void 0&&(r=new En(new Sf(2,2),new $s({name:"BackgroundMaterial",uniforms:df(js.background.uniforms),vertexShader:js.background.vertexShader,fragmentShader:js.background.fragmentShader,side:ao,depthTest:!1,depthWrite:!1,fog:!1})),r.geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),T.update(r)),r.material.uniforms.t2D.value=d,r.material.uniforms.backgroundIntensity.value=s.backgroundIntensity,r.material.toneMapped=xi.getTransfer(d.colorSpace)!==Di,d.matrixAutoUpdate===!0&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),(h!==d||o!==d.version||l!==g.toneMapping)&&(r.material.needsUpdate=!0,h=d,o=d.version,l=g.toneMapping),r.layers.enableAll(),f.unshift(r,r.geometry,r.material,0,0,null))}function u(f,s){f.getRGB(fv,lA(g)),x.buffers.color.setClear(fv.r,fv.g,fv.b,s,a)}return{getClearColor:function(){return y},setClearColor:function(f,s=1){y.set(f),t=s,u(y,t)},getClearAlpha:function(){return t},setClearAlpha:function(f){t=f,u(y,t)},render:n}}function XB(g,e,i,x){const T=g.getParameter(g.MAX_VERTEX_ATTRIBS),E=x.isWebGL2?null:e.get("OES_vertex_array_object"),a=x.isWebGL2||E!==null,y={},t=f(null);let r=t,p=!1;function h(I,D,B,G,z){let W=!1;if(a){const k=u(G,B,D);r!==k&&(r=k,l(r.object)),W=s(I,G,B,z),W&&c(I,G,B,z)}else{const k=D.wireframe===!0;(r.geometry!==G.id||r.program!==B.id||r.wireframe!==k)&&(r.geometry=G.id,r.program=B.id,r.wireframe=k,W=!0)}z!==null&&i.update(z,g.ELEMENT_ARRAY_BUFFER),(W||p)&&(p=!1,A(I,D,B,G),z!==null&&g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,i.get(z).buffer))}function o(){return x.isWebGL2?g.createVertexArray():E.createVertexArrayOES()}function l(I){return x.isWebGL2?g.bindVertexArray(I):E.bindVertexArrayOES(I)}function n(I){return x.isWebGL2?g.deleteVertexArray(I):E.deleteVertexArrayOES(I)}function u(I,D,B){const G=B.wireframe===!0;let z=y[I.id];z===void 0&&(z={},y[I.id]=z);let W=z[D.id];W===void 0&&(W={},z[D.id]=W);let k=W[G];return k===void 0&&(k=f(o()),W[G]=k),k}function f(I){const D=[],B=[],G=[];for(let z=0;z=0){const K=z[Q];let U=W[Q];if(U===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(U=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(U=I.instanceColor)),K===void 0||K.attribute!==U||U&&K.data!==U.data)return!0;k++}return r.attributesNum!==k||r.index!==G}function c(I,D,B,G){const z={},W=D.attributes;let k=0;const J=B.getAttributes();for(const Q in J)if(J[Q].location>=0){let K=W[Q];K===void 0&&(Q==="instanceMatrix"&&I.instanceMatrix&&(K=I.instanceMatrix),Q==="instanceColor"&&I.instanceColor&&(K=I.instanceColor));const U={};U.attribute=K,K&&K.data&&(U.data=K.data),z[Q]=U,k++}r.attributes=z,r.attributesNum=k,r.index=G}function d(){const I=r.newAttributes;for(let D=0,B=I.length;D=0){let Y=z[J];if(Y===void 0&&(J==="instanceMatrix"&&I.instanceMatrix&&(Y=I.instanceMatrix),J==="instanceColor"&&I.instanceColor&&(Y=I.instanceColor)),Y!==void 0){const K=Y.normalized,U=Y.itemSize,V=i.get(Y);if(V===void 0)continue;const j=V.buffer,$=V.type,q=V.bytesPerElement,it=x.isWebGL2===!0&&($===g.INT||$===g.UNSIGNED_INT||Y.gpuType===t1);if(Y.isInterleavedBufferAttribute){const nt=Y.data,et=nt.stride,ht=Y.offset;if(nt.isInstancedInterleavedBuffer){for(let ut=0;ut0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&g.getShaderPrecisionFormat(g.VERTEX_SHADER,g.MEDIUM_FLOAT).precision>0&&g.getShaderPrecisionFormat(g.FRAGMENT_SHADER,g.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a=typeof WebGL2RenderingContext<"u"&&g.constructor.name==="WebGL2RenderingContext";let y=i.precision!==void 0?i.precision:"highp";const t=E(y);t!==y&&(console.warn("THREE.WebGLRenderer:",y,"not supported, using",t,"instead."),y=t);const r=a||e.has("WEBGL_draw_buffers"),p=i.logarithmicDepthBuffer===!0,h=g.getParameter(g.MAX_TEXTURE_IMAGE_UNITS),o=g.getParameter(g.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=g.getParameter(g.MAX_TEXTURE_SIZE),n=g.getParameter(g.MAX_CUBE_MAP_TEXTURE_SIZE),u=g.getParameter(g.MAX_VERTEX_ATTRIBS),f=g.getParameter(g.MAX_VERTEX_UNIFORM_VECTORS),s=g.getParameter(g.MAX_VARYING_VECTORS),c=g.getParameter(g.MAX_FRAGMENT_UNIFORM_VECTORS),d=o>0,v=a||e.has("OES_texture_float"),m=d&&v,S=a?g.getParameter(g.MAX_SAMPLES):0;return{isWebGL2:a,drawBuffers:r,getMaxAnisotropy:T,getMaxPrecision:E,precision:y,logarithmicDepthBuffer:p,maxTextures:h,maxVertexTextures:o,maxTextureSize:l,maxCubemapSize:n,maxAttributes:u,maxVertexUniforms:f,maxVaryings:s,maxFragmentUniforms:c,vertexTextures:d,floatFragmentTextures:v,floatVertexTextures:m,maxSamples:S}}function KB(g){const e=this;let i=null,x=0,T=!1,E=!1;const a=new qo,y=new ni,t={value:null,needsUpdate:!1};this.uniform=t,this.numPlanes=0,this.numIntersection=0,this.init=function(h,o){const l=h.length!==0||o||x!==0||T;return T=o,x=h.length,l},this.beginShadows=function(){E=!0,p(null)},this.endShadows=function(){E=!1},this.setGlobalState=function(h,o){i=p(h,o,0)},this.setState=function(h,o,l){const n=h.clippingPlanes,u=h.clipIntersection,f=h.clipShadows,s=g.get(h);if(!T||n===null||n.length===0||E&&!f)E?p(null):r();else{const c=E?0:x,d=c*4;let v=s.clippingState||null;t.value=v,v=p(n,o,d,l);for(let m=0;m!==d;++m)v[m]=i[m];s.clippingState=v,this.numIntersection=u?this.numPlanes:0,this.numPlanes+=c}};function r(){t.value!==i&&(t.value=i,t.needsUpdate=x>0),e.numPlanes=x,e.numIntersection=0}function p(h,o,l,n){const u=h!==null?h.length:0;let f=null;if(u!==0){if(f=t.value,n!==!0||f===null){const s=l+u*4,c=o.matrixWorldInverse;y.getNormalMatrix(c),(f===null||f.length0){const r=new fA(t.height);return r.fromEquirectangularTexture(g,a),e.set(a,r),a.addEventListener("dispose",T),i(r.texture,a.mapping)}else return null}}return a}function T(a){const y=a.target;y.removeEventListener("dispose",T);const t=e.get(y);t!==void 0&&(e.delete(y),t.dispose())}function E(){e=new WeakMap}return{get:x,dispose:E}}class Ld extends wd{constructor(e=-1,i=1,x=1,T=-1,E=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=i,this.top=x,this.bottom=T,this.near=E,this.far=a,this.updateProjectionMatrix()}copy(e,i){return super.copy(e,i),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,i,x,T,E,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=i,this.view.offsetX=x,this.view.offsetY=T,this.view.width=E,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),x=(this.right+this.left)/2,T=(this.top+this.bottom)/2;let E=x-e,a=x+e,y=T+i,t=T-i;if(this.view!==null&&this.view.enabled){const r=(this.right-this.left)/this.view.fullWidth/this.zoom,p=(this.top-this.bottom)/this.view.fullHeight/this.zoom;E+=r*this.view.offsetX,a=E+r*this.view.width,y-=p*this.view.offsetY,t=y-p*this.view.height}this.projectionMatrix.makeOrthographic(E,a,y,t,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const i=super.toJSON(e);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}}const qu=4,GT=[.125,.215,.35,.446,.526,.582],ph=20,B0=new Ld,VT=new fe;let U0=null,z0=0,G0=0;const ch=(1+Math.sqrt(5))/2,zu=1/ch,HT=[new pt(1,1,1),new pt(-1,1,1),new pt(1,1,-1),new pt(-1,1,-1),new pt(0,ch,zu),new pt(0,ch,-zu),new pt(zu,0,ch),new pt(-zu,0,ch),new pt(ch,zu,0),new pt(-ch,zu,0)];class dx{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,i=0,x=.1,T=100){U0=this._renderer.getRenderTarget(),z0=this._renderer.getActiveCubeFace(),G0=this._renderer.getActiveMipmapLevel(),this._setSize(256);const E=this._allocateTargets();return E.depthBuffer=!0,this._sceneToCubeUV(e,x,T,E),i>0&&this._blur(E,0,0,i),this._applyPMREM(E),this._cleanup(E),E}fromEquirectangular(e,i=null){return this._fromTexture(e,i)}fromCubemap(e,i=null){return this._fromTexture(e,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=YT(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=XT(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?d:0,d,d),p.setRenderTarget(T),u&&p.render(n,y),p.render(e,y)}n.geometry.dispose(),n.material.dispose(),p.toneMapping=o,p.autoClear=h,e.background=f}_textureToCubeUV(e,i){const x=this._renderer,T=e.mapping===oo||e.mapping===ll;T?(this._cubemapMaterial===null&&(this._cubemapMaterial=YT()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=XT());const E=T?this._cubemapMaterial:this._equirectMaterial,a=new En(this._lodPlanes[0],E),y=E.uniforms;y.envMap.value=e;const t=this._cubeSize;cv(i,0,0,3*t,2*t),x.setRenderTarget(i),x.render(a,B0)}_applyPMREM(e){const i=this._renderer,x=i.autoClear;i.autoClear=!1;for(let T=1;Tph&&console.warn(`sigmaRadians, ${E}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${ph}`);const s=[];let c=0;for(let M=0;Md-qu?T-d+qu:0),S=4*(this._cubeSize-v);cv(i,m,S,3*v,2*v),t.setRenderTarget(i),t.render(h,B0)}}function ZB(g){const e=[],i=[],x=[];let T=g;const E=g-qu+1+GT.length;for(let a=0;ag-qu?t=GT[a-g+qu-1]:a===0&&(t=0),x.push(t);const r=1/(y-2),p=-r,h=1+r,o=[p,p,h,p,h,h,p,p,h,h,p,h],l=6,n=6,u=3,f=2,s=1,c=new Float32Array(u*n*l),d=new Float32Array(f*n*l),v=new Float32Array(s*n*l);for(let S=0;S2?0:-1,C=[M,A,0,M+2/3,A,0,M+2/3,A+1,0,M,A,0,M+2/3,A+1,0,M,A+1,0];c.set(C,u*n*S),d.set(o,f*n*S);const w=[S,S,S,S,S,S];v.set(w,s*n*S)}const m=new ei;m.setAttribute("position",new Ti(c,u)),m.setAttribute("uv",new Ti(d,f)),m.setAttribute("faceIndex",new Ti(v,s)),e.push(m),T>qu&&T--}return{lodPlanes:e,sizeLods:i,sigmas:x}}function WT(g,e,i){const x=new Js(g,e,i);return x.texture.mapping=yf,x.texture.name="PMREM.cubeUv",x.scissorTest=!0,x}function cv(g,e,i,x,T){g.viewport.set(e,i,x,T),g.scissor.set(e,i,x,T)}function JB(g,e,i){const x=new Float32Array(ph),T=new pt(0,1,0);return new $s({name:"SphericalGaussianBlur",defines:{n:ph,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:`${g}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:x},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:T}},vertexShader:v1(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - uniform int samples; - uniform float weights[ n ]; - uniform bool latitudinal; - uniform float dTheta; - uniform float mipInt; - uniform vec3 poleAxis; - - #define ENVMAP_TYPE_CUBE_UV - #include - - vec3 getSample( float theta, vec3 axis ) { - - float cosTheta = cos( theta ); - // Rodrigues' axis-angle rotation - vec3 sampleDirection = vOutputDirection * cosTheta - + cross( axis, vOutputDirection ) * sin( theta ) - + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); - - return bilinearCubeUV( envMap, sampleDirection, mipInt ); - - } - - void main() { - - vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); - - if ( all( equal( axis, vec3( 0.0 ) ) ) ) { - - axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); - - } - - axis = normalize( axis ); - - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); - - for ( int i = 1; i < n; i++ ) { - - if ( i >= samples ) { - - break; - - } - - float theta = dTheta * float( i ); - gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); - gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); - - } - - } - `,blending:so,depthTest:!1,depthWrite:!1})}function XT(){return new $s({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:v1(),fragmentShader:` - - precision mediump float; - precision mediump int; - - varying vec3 vOutputDirection; - - uniform sampler2D envMap; - - #include - - void main() { - - vec3 outputDirection = normalize( vOutputDirection ); - vec2 uv = equirectUv( outputDirection ); - - gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); - - } - `,blending:so,depthTest:!1,depthWrite:!1})}function YT(){return new $s({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:v1(),fragmentShader:` - - precision mediump float; - precision mediump int; - - uniform float flipEnvMap; - - varying vec3 vOutputDirection; - - uniform samplerCube envMap; - - void main() { - - gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); - - } - `,blending:so,depthTest:!1,depthWrite:!1})}function v1(){return` - - precision mediump float; - precision mediump int; - - attribute float faceIndex; - - varying vec3 vOutputDirection; - - // RH coordinate system; PMREM face-indexing convention - vec3 getDirection( vec2 uv, float face ) { - - uv = 2.0 * uv - 1.0; - - vec3 direction = vec3( uv, 1.0 ); - - if ( face == 0.0 ) { - - direction = direction.zyx; // ( 1, v, u ) pos x - - } else if ( face == 1.0 ) { - - direction = direction.xzy; - direction.xz *= -1.0; // ( -u, 1, -v ) pos y - - } else if ( face == 2.0 ) { - - direction.x *= -1.0; // ( -u, v, 1 ) pos z - - } else if ( face == 3.0 ) { - - direction = direction.zyx; - direction.xz *= -1.0; // ( -1, v, -u ) neg x - - } else if ( face == 4.0 ) { - - direction = direction.xzy; - direction.xy *= -1.0; // ( -u, -1, v ) neg y - - } else if ( face == 5.0 ) { - - direction.z *= -1.0; // ( u, v, -1 ) neg z - - } - - return direction; - - } - - void main() { - - vOutputDirection = getDirection( uv, faceIndex ); - gl_Position = vec4( position, 1.0 ); - - } - `}function $B(g){let e=new WeakMap,i=null;function x(y){if(y&&y.isTexture){const t=y.mapping,r=t===_c||t===qc,p=t===oo||t===ll;if(r||p)if(y.isRenderTargetTexture&&y.needsPMREMUpdate===!0){y.needsPMREMUpdate=!1;let h=e.get(y);return i===null&&(i=new dx(g)),h=r?i.fromEquirectangular(y,h):i.fromCubemap(y,h),e.set(y,h),h.texture}else{if(e.has(y))return e.get(y).texture;{const h=y.image;if(r&&h&&h.height>0||p&&h&&T(h)){i===null&&(i=new dx(g));const o=r?i.fromEquirectangular(y):i.fromCubemap(y);return e.set(y,o),y.addEventListener("dispose",E),o.texture}else return null}}}return y}function T(y){let t=0;const r=6;for(let p=0;pe.maxTextureSize&&(w=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const P=new Float32Array(C*w*4*n),L=new tg(P,C,w,n);L.type=Ps,L.needsUpdate=!0;const O=A*4;for(let D=0;D0)return g;const T=e*i;let E=kT[T];if(E===void 0&&(E=new Float32Array(T),kT[T]=E),e!==0){x.toArray(E,0);for(let a=1,y=0;a!==e;++a)y+=i,g[a].toArray(E,y)}return E}function Fn(g,e){if(g.length!==e.length)return!1;for(let i=0,x=g.length;i":" "} ${y}: ${i[a]}`)}return x.join(` -`)}function _8(g){const e=xi.getPrimaries(xi.workingColorSpace),i=xi.getPrimaries(g);let x;switch(e===i?x="":e===od&&i===ad?x="LinearDisplayP3ToLinearSRGB":e===ad&&i===od&&(x="LinearSRGBToLinearDisplayP3"),g){case Ma:case Ad:return[x,"LinearTransferOETF"];case Ln:case qm:return[x,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",g),[x,"LinearTransferOETF"]}}function _T(g,e,i){const x=g.getShaderParameter(e,g.COMPILE_STATUS),T=g.getShaderInfoLog(e).trim();if(x&&T==="")return"";const E=/ERROR: 0:(\d+)/.exec(T);if(E){const a=parseInt(E[1]);return i.toUpperCase()+` - -`+T+` - -`+Q8(g.getShaderSource(e),a)}else return T}function q8(g,e){const i=_8(e);return`vec4 ${g}( vec4 value ) { return ${i[0]}( ${i[1]}( value ) ); }`}function t6(g,e){let i;switch(e){case FC:i="Linear";break;case OC:i="Reinhard";break;case DC:i="OptimizedCineon";break;case qx:i="ACESFilmic";break;case NC:i="AgX";break;case IC:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+g+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function e6(g){return[g.extensionDerivatives||g.envMapCubeUVHeight||g.bumpMap||g.normalMapTangentSpace||g.clearcoatNormalMap||g.flatShading||g.alphaToCoverage||g.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(g.extensionFragDepth||g.logarithmicDepthBuffer)&&g.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",g.extensionDrawBuffers&&g.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(g.extensionShaderTextureLOD||g.envMap||g.transmission)&&g.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(tf).join(` -`)}function i6(g){return[g.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",g.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(tf).join(` -`)}function n6(g){const e=[];for(const i in g){const x=g[i];x!==!1&&e.push("#define "+i+" "+x)}return e.join(` -`)}function r6(g,e){const i={},x=g.getProgramParameter(e,g.ACTIVE_ATTRIBUTES);for(let T=0;T/gm;function px(g){return g.replace(s6,o6)}const a6=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function o6(g,e){let i=ti[e];if(i===void 0){const x=a6.get(e);if(x!==void 0)i=ti[x],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,x);else throw new Error("Can not resolve #include <"+e+">")}return px(i)}const l6=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function eE(g){return g.replace(l6,h6)}function h6(g,e,i,x){let T="";for(let E=parseInt(e);E0&&(s+=` -`),c=[l,"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u].filter(tf).join(` -`),c.length>0&&(c+=` -`)):(s=[iE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",i.batching?"#define USE_BATCHING":"",i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+p:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.displacementMap?"#define USE_DISPLACEMENTMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.mapUv?"#define MAP_UV "+i.mapUv:"",i.alphaMapUv?"#define ALPHAMAP_UV "+i.alphaMapUv:"",i.lightMapUv?"#define LIGHTMAP_UV "+i.lightMapUv:"",i.aoMapUv?"#define AOMAP_UV "+i.aoMapUv:"",i.emissiveMapUv?"#define EMISSIVEMAP_UV "+i.emissiveMapUv:"",i.bumpMapUv?"#define BUMPMAP_UV "+i.bumpMapUv:"",i.normalMapUv?"#define NORMALMAP_UV "+i.normalMapUv:"",i.displacementMapUv?"#define DISPLACEMENTMAP_UV "+i.displacementMapUv:"",i.metalnessMapUv?"#define METALNESSMAP_UV "+i.metalnessMapUv:"",i.roughnessMapUv?"#define ROUGHNESSMAP_UV "+i.roughnessMapUv:"",i.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+i.anisotropyMapUv:"",i.clearcoatMapUv?"#define CLEARCOATMAP_UV "+i.clearcoatMapUv:"",i.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+i.clearcoatNormalMapUv:"",i.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+i.clearcoatRoughnessMapUv:"",i.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+i.iridescenceMapUv:"",i.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+i.iridescenceThicknessMapUv:"",i.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+i.sheenColorMapUv:"",i.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+i.sheenRoughnessMapUv:"",i.specularMapUv?"#define SPECULARMAP_UV "+i.specularMapUv:"",i.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+i.specularColorMapUv:"",i.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+i.specularIntensityMapUv:"",i.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+i.transmissionMapUv:"",i.thicknessMapUv?"#define THICKNESSMAP_UV "+i.thicknessMapUv:"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&i.flatShading===!1?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+t:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` -`].filter(tf).join(` -`),c=[l,iE(i),"#define SHADER_TYPE "+i.shaderType,"#define SHADER_NAME "+i.shaderName,u,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+r:"",i.envMap?"#define "+p:"",i.envMap?"#define "+h:"",o?"#define CUBEUV_TEXEL_WIDTH "+o.texelWidth:"",o?"#define CUBEUV_TEXEL_HEIGHT "+o.texelHeight:"",o?"#define CUBEUV_MAX_MIP "+o.maxMip+".0":"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",i.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.anisotropy?"#define USE_ANISOTROPY":"",i.anisotropyMap?"#define USE_ANISOTROPYMAP":"",i.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.iridescence?"#define USE_IRIDESCENCE":"",i.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",i.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",i.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.alphaHash?"#define USE_ALPHAHASH":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.vertexTangents&&i.flatShading===!1?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUv1s?"#define USE_UV1":"",i.vertexUv2s?"#define USE_UV2":"",i.vertexUv3s?"#define USE_UV3":"",i.pointsUvs?"#define USE_POINTS_UV":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+t:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.numLightProbes>0?"#define USE_LIGHT_PROBES":"",i.useLegacyLights?"#define LEGACY_LIGHTS":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Sa?"#define TONE_MAPPING":"",i.toneMapping!==Sa?ti.tonemapping_pars_fragment:"",i.toneMapping!==Sa?t6("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",ti.colorspace_pars_fragment,q8("linearToOutputTexel",i.outputColorSpace),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",` -`].filter(tf).join(` -`)),a=px(a),a=qT(a,i),a=tE(a,i),y=px(y),y=qT(y,i),y=tE(y,i),a=eE(a),y=eE(y),i.isWebGL2&&i.isRawShaderMaterial!==!0&&(d=`#version 300 es -`,s=[n,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` -`)+` -`+s,c=["precision mediump sampler2DArray;","#define varying in",i.glslVersion===fx?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===fx?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` -`)+` -`+c);const v=d+s+a,m=d+c+y,S=QT(T,T.VERTEX_SHADER,v),M=QT(T,T.FRAGMENT_SHADER,m);T.attachShader(f,S),T.attachShader(f,M),i.index0AttributeName!==void 0?T.bindAttribLocation(f,0,i.index0AttributeName):i.morphTargets===!0&&T.bindAttribLocation(f,0,"position"),T.linkProgram(f);function A(L){if(g.debug.checkShaderErrors){const O=T.getProgramInfoLog(f).trim(),I=T.getShaderInfoLog(S).trim(),D=T.getShaderInfoLog(M).trim();let B=!0,G=!0;if(T.getProgramParameter(f,T.LINK_STATUS)===!1)if(B=!1,typeof g.debug.onShaderError=="function")g.debug.onShaderError(T,f,S,M);else{const z=_T(T,S,"vertex"),W=_T(T,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+T.getError()+" - VALIDATE_STATUS "+T.getProgramParameter(f,T.VALIDATE_STATUS)+` - -Material Name: `+L.name+` -Material Type: `+L.type+` - -Program Info Log: `+O+` -`+z+` -`+W)}else O!==""?console.warn("THREE.WebGLProgram: Program Info Log:",O):(I===""||D==="")&&(G=!1);G&&(L.diagnostics={runnable:B,programLog:O,vertexShader:{log:I,prefix:s},fragmentShader:{log:D,prefix:c}})}T.deleteShader(S),T.deleteShader(M),C=new qv(T,f),w=r6(T,f)}let C;this.getUniforms=function(){return C===void 0&&A(this),C};let w;this.getAttributes=function(){return w===void 0&&A(this),w};let P=i.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return P===!1&&(P=T.getProgramParameter(f,J8)),P},this.destroy=function(){x.releaseStatesOfProgram(this),T.deleteProgram(f),this.program=void 0},this.type=i.shaderType,this.name=i.shaderName,this.id=$8++,this.cacheKey=e,this.usedTimes=1,this.program=f,this.vertexShader=S,this.fragmentShader=M,this}let m6=0;class g6{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const i=e.vertexShader,x=e.fragmentShader,T=this._getShaderStage(i),E=this._getShaderStage(x),a=this._getShaderCacheForMaterial(e);return a.has(T)===!1&&(a.add(T),T.usedTimes++),a.has(E)===!1&&(a.add(E),E.usedTimes++),this}remove(e){const i=this.materialCache.get(e);for(const x of i)x.usedTimes--,x.usedTimes===0&&this.shaderCache.delete(x.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const i=this.materialCache;let x=i.get(e);return x===void 0&&(x=new Set,i.set(e,x)),x}_getShaderStage(e){const i=this.shaderCache;let x=i.get(e);return x===void 0&&(x=new y6(e),i.set(e,x)),x}}class y6{constructor(e){this.id=m6++,this.code=e,this.usedTimes=0}}function x6(g,e,i,x,T,E,a){const y=new Mh,t=new g6,r=new Set,p=[],h=T.isWebGL2,o=T.logarithmicDepthBuffer,l=T.vertexTextures;let n=T.precision;const u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function f(w){return r.add(w),w===0?"uv":`uv${w}`}function s(w,P,L,O,I){const D=O.fog,B=I.geometry,G=w.isMeshStandardMaterial?O.environment:null,z=(w.isMeshStandardMaterial?i:e).get(w.envMap||G),W=z&&z.mapping===yf?z.image.height:null,k=u[w.type];w.precision!==null&&(n=T.getMaxPrecision(w.precision),n!==w.precision&&console.warn("THREE.WebGLProgram.getParameters:",w.precision,"not supported, using",n,"instead."));const J=B.morphAttributes.position||B.morphAttributes.normal||B.morphAttributes.color,Q=J!==void 0?J.length:0;let Y=0;B.morphAttributes.position!==void 0&&(Y=1),B.morphAttributes.normal!==void 0&&(Y=2),B.morphAttributes.color!==void 0&&(Y=3);let K,U,V,j;if(k){const pi=js[k];K=pi.vertexShader,U=pi.fragmentShader}else K=w.vertexShader,U=w.fragmentShader,t.update(w),V=t.getVertexShaderID(w),j=t.getFragmentShaderID(w);const $=g.getRenderTarget(),q=I.isInstancedMesh===!0,it=I.isBatchedMesh===!0,nt=!!w.map,et=!!w.matcap,ht=!!z,ut=!!w.aoMap,dt=!!w.lightMap,mt=!!w.bumpMap,gt=!!w.normalMap,At=!!w.displacementMap,ot=!!w.emissiveMap,st=!!w.metalnessMap,yt=!!w.roughnessMap,Tt=w.anisotropy>0,wt=w.clearcoat>0,Et=w.iridescence>0,Gt=w.sheen>0,Wt=w.transmission>0,Jt=Tt&&!!w.anisotropyMap,$t=wt&&!!w.clearcoatMap,ee=wt&&!!w.clearcoatNormalMap,Nt=wt&&!!w.clearcoatRoughnessMap,Te=Et&&!!w.iridescenceMap,le=Et&&!!w.iridescenceThicknessMap,ce=Gt&&!!w.sheenColorMap,se=Gt&&!!w.sheenRoughnessMap,ie=!!w.specularMap,Ce=!!w.specularColorMap,Xe=!!w.specularIntensityMap,si=Wt&&!!w.transmissionMap,Be=Wt&&!!w.thicknessMap,ri=!!w.gradientMap,xt=!!w.alphaMap,_t=w.alphaTest>0,qt=!!w.alphaHash,ve=!!w.extensions;let Me=Sa;w.toneMapped&&($===null||$.isXRRenderTarget===!0)&&(Me=g.toneMapping);const fi={isWebGL2:h,shaderID:k,shaderType:w.type,shaderName:w.name,vertexShader:K,fragmentShader:U,defines:w.defines,customVertexShaderID:V,customFragmentShaderID:j,isRawShaderMaterial:w.isRawShaderMaterial===!0,glslVersion:w.glslVersion,precision:n,batching:it,instancing:q,instancingColor:q&&I.instanceColor!==null,supportsVertexTextures:l,outputColorSpace:$===null?g.outputColorSpace:$.isXRRenderTarget===!0?$.texture.colorSpace:Ma,alphaToCoverage:!!w.alphaToCoverage,map:nt,matcap:et,envMap:ht,envMapMode:ht&&z.mapping,envMapCubeUVHeight:W,aoMap:ut,lightMap:dt,bumpMap:mt,normalMap:gt,displacementMap:l&&At,emissiveMap:ot,normalMapObjectSpace:gt&&w.normalMapType===$C,normalMapTangentSpace:gt&&w.normalMapType===fl,metalnessMap:st,roughnessMap:yt,anisotropy:Tt,anisotropyMap:Jt,clearcoat:wt,clearcoatMap:$t,clearcoatNormalMap:ee,clearcoatRoughnessMap:Nt,iridescence:Et,iridescenceMap:Te,iridescenceThicknessMap:le,sheen:Gt,sheenColorMap:ce,sheenRoughnessMap:se,specularMap:ie,specularColorMap:Ce,specularIntensityMap:Xe,transmission:Wt,transmissionMap:si,thicknessMap:Be,gradientMap:ri,opaque:w.transparent===!1&&w.blending===Sh&&w.alphaToCoverage===!1,alphaMap:xt,alphaTest:_t,alphaHash:qt,combine:w.combine,mapUv:nt&&f(w.map.channel),aoMapUv:ut&&f(w.aoMap.channel),lightMapUv:dt&&f(w.lightMap.channel),bumpMapUv:mt&&f(w.bumpMap.channel),normalMapUv:gt&&f(w.normalMap.channel),displacementMapUv:At&&f(w.displacementMap.channel),emissiveMapUv:ot&&f(w.emissiveMap.channel),metalnessMapUv:st&&f(w.metalnessMap.channel),roughnessMapUv:yt&&f(w.roughnessMap.channel),anisotropyMapUv:Jt&&f(w.anisotropyMap.channel),clearcoatMapUv:$t&&f(w.clearcoatMap.channel),clearcoatNormalMapUv:ee&&f(w.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Nt&&f(w.clearcoatRoughnessMap.channel),iridescenceMapUv:Te&&f(w.iridescenceMap.channel),iridescenceThicknessMapUv:le&&f(w.iridescenceThicknessMap.channel),sheenColorMapUv:ce&&f(w.sheenColorMap.channel),sheenRoughnessMapUv:se&&f(w.sheenRoughnessMap.channel),specularMapUv:ie&&f(w.specularMap.channel),specularColorMapUv:Ce&&f(w.specularColorMap.channel),specularIntensityMapUv:Xe&&f(w.specularIntensityMap.channel),transmissionMapUv:si&&f(w.transmissionMap.channel),thicknessMapUv:Be&&f(w.thicknessMap.channel),alphaMapUv:xt&&f(w.alphaMap.channel),vertexTangents:!!B.attributes.tangent&&(gt||Tt),vertexColors:w.vertexColors,vertexAlphas:w.vertexColors===!0&&!!B.attributes.color&&B.attributes.color.itemSize===4,pointsUvs:I.isPoints===!0&&!!B.attributes.uv&&(nt||xt),fog:!!D,useFog:w.fog===!0,fogExp2:!!D&&D.isFogExp2,flatShading:w.flatShading===!0,sizeAttenuation:w.sizeAttenuation===!0,logarithmicDepthBuffer:o,skinning:I.isSkinnedMesh===!0,morphTargets:B.morphAttributes.position!==void 0,morphNormals:B.morphAttributes.normal!==void 0,morphColors:B.morphAttributes.color!==void 0,morphTargetsCount:Q,morphTextureStride:Y,numDirLights:P.directional.length,numPointLights:P.point.length,numSpotLights:P.spot.length,numSpotLightMaps:P.spotLightMap.length,numRectAreaLights:P.rectArea.length,numHemiLights:P.hemi.length,numDirLightShadows:P.directionalShadowMap.length,numPointLightShadows:P.pointShadowMap.length,numSpotLightShadows:P.spotShadowMap.length,numSpotLightShadowsWithMaps:P.numSpotLightShadowsWithMaps,numLightProbes:P.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:w.dithering,shadowMapEnabled:g.shadowMap.enabled&&L.length>0,shadowMapType:g.shadowMap.type,toneMapping:Me,useLegacyLights:g._useLegacyLights,decodeVideoTexture:nt&&w.map.isVideoTexture===!0&&xi.getTransfer(w.map.colorSpace)===Di,premultipliedAlpha:w.premultipliedAlpha,doubleSided:w.side===ma,flipSided:w.side===Cr,useDepthPacking:w.depthPacking>=0,depthPacking:w.depthPacking||0,index0AttributeName:w.index0AttributeName,extensionDerivatives:ve&&w.extensions.derivatives===!0,extensionFragDepth:ve&&w.extensions.fragDepth===!0,extensionDrawBuffers:ve&&w.extensions.drawBuffers===!0,extensionShaderTextureLOD:ve&&w.extensions.shaderTextureLOD===!0,extensionClipCullDistance:ve&&w.extensions.clipCullDistance===!0&&x.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ve&&w.extensions.multiDraw===!0&&x.has("WEBGL_multi_draw"),rendererExtensionFragDepth:h||x.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||x.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||x.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:x.has("KHR_parallel_shader_compile"),customProgramCacheKey:w.customProgramCacheKey()};return fi.vertexUv1s=r.has(1),fi.vertexUv2s=r.has(2),fi.vertexUv3s=r.has(3),r.clear(),fi}function c(w){const P=[];if(w.shaderID?P.push(w.shaderID):(P.push(w.customVertexShaderID),P.push(w.customFragmentShaderID)),w.defines!==void 0)for(const L in w.defines)P.push(L),P.push(w.defines[L]);return w.isRawShaderMaterial===!1&&(d(P,w),v(P,w),P.push(g.outputColorSpace)),P.push(w.customProgramCacheKey),P.join()}function d(w,P){w.push(P.precision),w.push(P.outputColorSpace),w.push(P.envMapMode),w.push(P.envMapCubeUVHeight),w.push(P.mapUv),w.push(P.alphaMapUv),w.push(P.lightMapUv),w.push(P.aoMapUv),w.push(P.bumpMapUv),w.push(P.normalMapUv),w.push(P.displacementMapUv),w.push(P.emissiveMapUv),w.push(P.metalnessMapUv),w.push(P.roughnessMapUv),w.push(P.anisotropyMapUv),w.push(P.clearcoatMapUv),w.push(P.clearcoatNormalMapUv),w.push(P.clearcoatRoughnessMapUv),w.push(P.iridescenceMapUv),w.push(P.iridescenceThicknessMapUv),w.push(P.sheenColorMapUv),w.push(P.sheenRoughnessMapUv),w.push(P.specularMapUv),w.push(P.specularColorMapUv),w.push(P.specularIntensityMapUv),w.push(P.transmissionMapUv),w.push(P.thicknessMapUv),w.push(P.combine),w.push(P.fogExp2),w.push(P.sizeAttenuation),w.push(P.morphTargetsCount),w.push(P.morphAttributeCount),w.push(P.numDirLights),w.push(P.numPointLights),w.push(P.numSpotLights),w.push(P.numSpotLightMaps),w.push(P.numHemiLights),w.push(P.numRectAreaLights),w.push(P.numDirLightShadows),w.push(P.numPointLightShadows),w.push(P.numSpotLightShadows),w.push(P.numSpotLightShadowsWithMaps),w.push(P.numLightProbes),w.push(P.shadowMapType),w.push(P.toneMapping),w.push(P.numClippingPlanes),w.push(P.numClipIntersection),w.push(P.depthPacking)}function v(w,P){y.disableAll(),P.isWebGL2&&y.enable(0),P.supportsVertexTextures&&y.enable(1),P.instancing&&y.enable(2),P.instancingColor&&y.enable(3),P.matcap&&y.enable(4),P.envMap&&y.enable(5),P.normalMapObjectSpace&&y.enable(6),P.normalMapTangentSpace&&y.enable(7),P.clearcoat&&y.enable(8),P.iridescence&&y.enable(9),P.alphaTest&&y.enable(10),P.vertexColors&&y.enable(11),P.vertexAlphas&&y.enable(12),P.vertexUv1s&&y.enable(13),P.vertexUv2s&&y.enable(14),P.vertexUv3s&&y.enable(15),P.vertexTangents&&y.enable(16),P.anisotropy&&y.enable(17),P.alphaHash&&y.enable(18),P.batching&&y.enable(19),w.push(y.mask),y.disableAll(),P.fog&&y.enable(0),P.useFog&&y.enable(1),P.flatShading&&y.enable(2),P.logarithmicDepthBuffer&&y.enable(3),P.skinning&&y.enable(4),P.morphTargets&&y.enable(5),P.morphNormals&&y.enable(6),P.morphColors&&y.enable(7),P.premultipliedAlpha&&y.enable(8),P.shadowMapEnabled&&y.enable(9),P.useLegacyLights&&y.enable(10),P.doubleSided&&y.enable(11),P.flipSided&&y.enable(12),P.useDepthPacking&&y.enable(13),P.dithering&&y.enable(14),P.transmission&&y.enable(15),P.sheen&&y.enable(16),P.opaque&&y.enable(17),P.pointsUvs&&y.enable(18),P.decodeVideoTexture&&y.enable(19),P.alphaToCoverage&&y.enable(20),w.push(y.mask)}function m(w){const P=u[w.type];let L;if(P){const O=js[P];L=hA.clone(O.uniforms)}else L=w.uniforms;return L}function S(w,P){let L;for(let O=0,I=p.length;O0?x.push(s):l.transparent===!0?T.push(s):i.push(s)}function t(h,o,l,n,u,f){const s=a(h,o,l,n,u,f);l.transmission>0?x.unshift(s):l.transparent===!0?T.unshift(s):i.unshift(s)}function r(h,o){i.length>1&&i.sort(h||T6),x.length>1&&x.sort(o||nE),T.length>1&&T.sort(o||nE)}function p(){for(let h=e,o=g.length;h=E.length?(a=new rE,E.push(a)):a=E[T],a}function i(){g=new WeakMap}return{get:e,dispose:i}}function M6(){const g={};return{get:function(e){if(g[e.id]!==void 0)return g[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new pt,color:new fe};break;case"SpotLight":i={position:new pt,direction:new pt,color:new fe,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new pt,color:new fe,distance:0,decay:0};break;case"HemisphereLight":i={direction:new pt,skyColor:new fe,groundColor:new fe};break;case"RectAreaLight":i={color:new fe,position:new pt,halfWidth:new pt,halfHeight:new pt};break}return g[e.id]=i,i}}}function C6(){const g={};return{get:function(e){if(g[e.id]!==void 0)return g[e.id];let i;switch(e.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new jt,shadowCameraNear:1,shadowCameraFar:1e3};break}return g[e.id]=i,i}}}let A6=0;function w6(g,e){return(e.castShadow?2:0)-(g.castShadow?2:0)+(e.map?1:0)-(g.map?1:0)}function P6(g,e){const i=new M6,x=C6(),T={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)T.probe.push(new pt);const E=new pt,a=new Ve,y=new Ve;function t(p,h){let o=0,l=0,n=0;for(let L=0;L<9;L++)T.probe[L].set(0,0,0);let u=0,f=0,s=0,c=0,d=0,v=0,m=0,S=0,M=0,A=0,C=0;p.sort(w6);const w=h===!0?Math.PI:1;for(let L=0,O=p.length;L0&&(e.isWebGL2?g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=ne.LTC_FLOAT_1,T.rectAreaLTC2=ne.LTC_FLOAT_2):(T.rectAreaLTC1=ne.LTC_HALF_1,T.rectAreaLTC2=ne.LTC_HALF_2):g.has("OES_texture_float_linear")===!0?(T.rectAreaLTC1=ne.LTC_FLOAT_1,T.rectAreaLTC2=ne.LTC_FLOAT_2):g.has("OES_texture_half_float_linear")===!0?(T.rectAreaLTC1=ne.LTC_HALF_1,T.rectAreaLTC2=ne.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),T.ambient[0]=o,T.ambient[1]=l,T.ambient[2]=n;const P=T.hash;(P.directionalLength!==u||P.pointLength!==f||P.spotLength!==s||P.rectAreaLength!==c||P.hemiLength!==d||P.numDirectionalShadows!==v||P.numPointShadows!==m||P.numSpotShadows!==S||P.numSpotMaps!==M||P.numLightProbes!==C)&&(T.directional.length=u,T.spot.length=s,T.rectArea.length=c,T.point.length=f,T.hemi.length=d,T.directionalShadow.length=v,T.directionalShadowMap.length=v,T.pointShadow.length=m,T.pointShadowMap.length=m,T.spotShadow.length=S,T.spotShadowMap.length=S,T.directionalShadowMatrix.length=v,T.pointShadowMatrix.length=m,T.spotLightMatrix.length=S+M-A,T.spotLightMap.length=M,T.numSpotLightShadowsWithMaps=A,T.numLightProbes=C,P.directionalLength=u,P.pointLength=f,P.spotLength=s,P.rectAreaLength=c,P.hemiLength=d,P.numDirectionalShadows=v,P.numPointShadows=m,P.numSpotShadows=S,P.numSpotMaps=M,P.numLightProbes=C,T.version=A6++)}function r(p,h){let o=0,l=0,n=0,u=0,f=0;const s=h.matrixWorldInverse;for(let c=0,d=p.length;c=y.length?(t=new sE(g,e),y.push(t)):t=y[a],t}function T(){i=new WeakMap}return{get:x,dispose:T}}class g1 extends _n{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ZC,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class y1 extends _n{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const L6=`void main() { - gl_Position = vec4( position, 1.0 ); -}`,b6=`uniform sampler2D shadow_pass; -uniform vec2 resolution; -uniform float radius; -#include -void main() { - const float samples = float( VSM_SAMPLES ); - float mean = 0.0; - float squared_mean = 0.0; - float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); - float uvStart = samples <= 1.0 ? 0.0 : - 1.0; - for ( float i = 0.0; i < samples; i ++ ) { - float uvOffset = uvStart + i * uvStride; - #ifdef HORIZONTAL_PASS - vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); - mean += distribution.x; - squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; - #else - float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); - mean += depth; - squared_mean += depth * depth; - #endif - } - mean = mean / samples; - squared_mean = squared_mean / samples; - float std_dev = sqrt( squared_mean - mean * mean ); - gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); -}`;function F6(g,e,i){let x=new Rd;const T=new jt,E=new jt,a=new Si,y=new g1({depthPacking:JC}),t=new y1,r={},p=i.maxTextureSize,h={[ao]:Cr,[Cr]:ao,[ma]:ma},o=new $s({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new jt},radius:{value:4}},vertexShader:L6,fragmentShader:b6}),l=o.clone();l.defines.HORIZONTAL_PASS=1;const n=new ei;n.setAttribute("position",new Ti(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const u=new En(n,o),f=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Jm;let s=this.type;this.render=function(S,M,A){if(f.enabled===!1||f.autoUpdate===!1&&f.needsUpdate===!1||S.length===0)return;const C=g.getRenderTarget(),w=g.getActiveCubeFace(),P=g.getActiveMipmapLevel(),L=g.state;L.setBlending(so),L.buffers.color.setClear(1,1,1,1),L.buffers.depth.setTest(!0),L.setScissorTest(!1);const O=s!==ks&&this.type===ks,I=s===ks&&this.type!==ks;for(let D=0,B=S.length;Dp||T.y>p)&&(T.x>p&&(E.x=Math.floor(p/W.x),T.x=E.x*W.x,z.mapSize.x=E.x),T.y>p&&(E.y=Math.floor(p/W.y),T.y=E.y*W.y,z.mapSize.y=E.y)),z.map===null||O===!0||I===!0){const J=this.type!==ks?{minFilter:cn,magFilter:cn}:{};z.map!==null&&z.map.dispose(),z.map=new Js(T.x,T.y,J),z.map.texture.name=G.name+".shadowMap",z.camera.updateProjectionMatrix()}g.setRenderTarget(z.map),g.clear();const k=z.getViewportCount();for(let J=0;J0||M.map&&M.alphaTest>0){const L=w.uuid,O=M.uuid;let I=r[L];I===void 0&&(I={},r[L]=I);let D=I[O];D===void 0&&(D=w.clone(),I[O]=D,M.addEventListener("dispose",m)),w=D}if(w.visible=M.visible,w.wireframe=M.wireframe,C===ks?w.side=M.shadowSide!==null?M.shadowSide:M.side:w.side=M.shadowSide!==null?M.shadowSide:h[M.side],w.alphaMap=M.alphaMap,w.alphaTest=M.alphaTest,w.map=M.map,w.clipShadows=M.clipShadows,w.clippingPlanes=M.clippingPlanes,w.clipIntersection=M.clipIntersection,w.displacementMap=M.displacementMap,w.displacementScale=M.displacementScale,w.displacementBias=M.displacementBias,w.wireframeLinewidth=M.wireframeLinewidth,w.linewidth=M.linewidth,A.isPointLight===!0&&w.isMeshDistanceMaterial===!0){const L=g.properties.get(w);L.light=A}return w}function v(S,M,A,C,w){if(S.visible===!1)return;if(S.layers.test(M.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&w===ks)&&(!S.frustumCulled||x.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,S.matrixWorld);const O=e.update(S),I=S.material;if(Array.isArray(I)){const D=O.groups;for(let B=0,G=D.length;B=1):k.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),z=W>=2);let J=null,Q={};const Y=g.getParameter(g.SCISSOR_BOX),K=g.getParameter(g.VIEWPORT),U=new Si().fromArray(Y),V=new Si().fromArray(K);function j(xt,_t,qt,ve){const Me=new Uint8Array(4),fi=g.createTexture();g.bindTexture(xt,fi),g.texParameteri(xt,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(xt,g.TEXTURE_MAG_FILTER,g.NEAREST);for(let pi=0;pi"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let h;const o=new WeakMap;let l=!1;try{l=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function n(ot,st){return l?new OffscreenCanvas(ot,st):ud("canvas")}function u(ot,st,yt,Tt){let wt=1;if((ot.width>Tt||ot.height>Tt)&&(wt=Tt/Math.max(ot.width,ot.height)),wt<1||st===!0)if(typeof HTMLImageElement<"u"&&ot instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ot instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ot instanceof ImageBitmap){const Et=st?cm:Math.floor,Gt=Et(wt*ot.width),Wt=Et(wt*ot.height);h===void 0&&(h=n(Gt,Wt));const Jt=yt?n(Gt,Wt):h;return Jt.width=Gt,Jt.height=Wt,Jt.getContext("2d").drawImage(ot,0,0,Gt,Wt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+ot.width+"x"+ot.height+") to ("+Gt+"x"+Wt+")."),Jt}else return"data"in ot&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+ot.width+"x"+ot.height+")."),ot;return ot}function f(ot){return cx(ot.width)&&cx(ot.height)}function s(ot){return y?!1:ot.wrapS!==lr||ot.wrapT!==lr||ot.minFilter!==cn&&ot.minFilter!==Ki}function c(ot,st){return ot.generateMipmaps&&st&&ot.minFilter!==cn&&ot.minFilter!==Ki}function d(ot){g.generateMipmap(ot)}function v(ot,st,yt,Tt,wt=!1){if(y===!1)return st;if(ot!==null){if(g[ot]!==void 0)return g[ot];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ot+"'")}let Et=st;if(st===g.RED&&(yt===g.FLOAT&&(Et=g.R32F),yt===g.HALF_FLOAT&&(Et=g.R16F),yt===g.UNSIGNED_BYTE&&(Et=g.R8)),st===g.RED_INTEGER&&(yt===g.UNSIGNED_BYTE&&(Et=g.R8UI),yt===g.UNSIGNED_SHORT&&(Et=g.R16UI),yt===g.UNSIGNED_INT&&(Et=g.R32UI),yt===g.BYTE&&(Et=g.R8I),yt===g.SHORT&&(Et=g.R16I),yt===g.INT&&(Et=g.R32I)),st===g.RG&&(yt===g.FLOAT&&(Et=g.RG32F),yt===g.HALF_FLOAT&&(Et=g.RG16F),yt===g.UNSIGNED_BYTE&&(Et=g.RG8)),st===g.RGBA){const Gt=wt?sd:xi.getTransfer(Tt);yt===g.FLOAT&&(Et=g.RGBA32F),yt===g.HALF_FLOAT&&(Et=g.RGBA16F),yt===g.UNSIGNED_BYTE&&(Et=Gt===Di?g.SRGB8_ALPHA8:g.RGBA8),yt===g.UNSIGNED_SHORT_4_4_4_4&&(Et=g.RGBA4),yt===g.UNSIGNED_SHORT_5_5_5_1&&(Et=g.RGB5_A1)}return(Et===g.R16F||Et===g.R32F||Et===g.RG16F||Et===g.RG32F||Et===g.RGBA16F||Et===g.RGBA32F)&&e.get("EXT_color_buffer_float"),Et}function m(ot,st,yt){return c(ot,yt)===!0||ot.isFramebufferTexture&&ot.minFilter!==cn&&ot.minFilter!==Ki?Math.log2(Math.max(st.width,st.height))+1:ot.mipmaps!==void 0&&ot.mipmaps.length>0?ot.mipmaps.length:ot.isCompressedTexture&&Array.isArray(ot.image)?st.mipmaps.length:1}function S(ot){return ot===cn||ot===um||ot===dh?g.NEAREST:g.LINEAR}function M(ot){const st=ot.target;st.removeEventListener("dispose",M),C(st),st.isVideoTexture&&p.delete(st)}function A(ot){const st=ot.target;st.removeEventListener("dispose",A),P(st)}function C(ot){const st=x.get(ot);if(st.__webglInit===void 0)return;const yt=ot.source,Tt=o.get(yt);if(Tt){const wt=Tt[st.__cacheKey];wt.usedTimes--,wt.usedTimes===0&&w(ot),Object.keys(Tt).length===0&&o.delete(yt)}x.remove(ot)}function w(ot){const st=x.get(ot);g.deleteTexture(st.__webglTexture);const yt=ot.source,Tt=o.get(yt);delete Tt[st.__cacheKey],a.memory.textures--}function P(ot){const st=ot.texture,yt=x.get(ot),Tt=x.get(st);if(Tt.__webglTexture!==void 0&&(g.deleteTexture(Tt.__webglTexture),a.memory.textures--),ot.depthTexture&&ot.depthTexture.dispose(),ot.isWebGLCubeRenderTarget)for(let wt=0;wt<6;wt++){if(Array.isArray(yt.__webglFramebuffer[wt]))for(let Et=0;Et=T.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ot+" texture units while this GPU supports only "+T.maxTextures),L+=1,ot}function D(ot){const st=[];return st.push(ot.wrapS),st.push(ot.wrapT),st.push(ot.wrapR||0),st.push(ot.magFilter),st.push(ot.minFilter),st.push(ot.anisotropy),st.push(ot.internalFormat),st.push(ot.format),st.push(ot.type),st.push(ot.generateMipmaps),st.push(ot.premultiplyAlpha),st.push(ot.flipY),st.push(ot.unpackAlignment),st.push(ot.colorSpace),st.join()}function B(ot,st){const yt=x.get(ot);if(ot.isVideoTexture&>(ot),ot.isRenderTargetTexture===!1&&ot.version>0&&yt.__version!==ot.version){const Tt=ot.image;if(Tt===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Tt.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{U(yt,ot,st);return}}i.bindTexture(g.TEXTURE_2D,yt.__webglTexture,g.TEXTURE0+st)}function G(ot,st){const yt=x.get(ot);if(ot.version>0&&yt.__version!==ot.version){U(yt,ot,st);return}i.bindTexture(g.TEXTURE_2D_ARRAY,yt.__webglTexture,g.TEXTURE0+st)}function z(ot,st){const yt=x.get(ot);if(ot.version>0&&yt.__version!==ot.version){U(yt,ot,st);return}i.bindTexture(g.TEXTURE_3D,yt.__webglTexture,g.TEXTURE0+st)}function W(ot,st){const yt=x.get(ot);if(ot.version>0&&yt.__version!==ot.version){V(yt,ot,st);return}i.bindTexture(g.TEXTURE_CUBE_MAP,yt.__webglTexture,g.TEXTURE0+st)}const k={[td]:g.REPEAT,[lr]:g.CLAMP_TO_EDGE,[ed]:g.MIRRORED_REPEAT},J={[cn]:g.NEAREST,[um]:g.NEAREST_MIPMAP_NEAREST,[dh]:g.NEAREST_MIPMAP_LINEAR,[Ki]:g.LINEAR,[Hc]:g.LINEAR_MIPMAP_NEAREST,[ya]:g.LINEAR_MIPMAP_LINEAR},Q={[QC]:g.NEVER,[nA]:g.ALWAYS,[_C]:g.LESS,[h1]:g.LEQUAL,[qC]:g.EQUAL,[iA]:g.GEQUAL,[tA]:g.GREATER,[eA]:g.NOTEQUAL};function Y(ot,st,yt){if(st.type===Ps&&e.has("OES_texture_float_linear")===!1&&(st.magFilter===Ki||st.magFilter===Hc||st.magFilter===dh||st.magFilter===ya||st.minFilter===Ki||st.minFilter===Hc||st.minFilter===dh||st.minFilter===ya)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),yt?(g.texParameteri(ot,g.TEXTURE_WRAP_S,k[st.wrapS]),g.texParameteri(ot,g.TEXTURE_WRAP_T,k[st.wrapT]),(ot===g.TEXTURE_3D||ot===g.TEXTURE_2D_ARRAY)&&g.texParameteri(ot,g.TEXTURE_WRAP_R,k[st.wrapR]),g.texParameteri(ot,g.TEXTURE_MAG_FILTER,J[st.magFilter]),g.texParameteri(ot,g.TEXTURE_MIN_FILTER,J[st.minFilter])):(g.texParameteri(ot,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(ot,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),(ot===g.TEXTURE_3D||ot===g.TEXTURE_2D_ARRAY)&&g.texParameteri(ot,g.TEXTURE_WRAP_R,g.CLAMP_TO_EDGE),(st.wrapS!==lr||st.wrapT!==lr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),g.texParameteri(ot,g.TEXTURE_MAG_FILTER,S(st.magFilter)),g.texParameteri(ot,g.TEXTURE_MIN_FILTER,S(st.minFilter)),st.minFilter!==cn&&st.minFilter!==Ki&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),st.compareFunction&&(g.texParameteri(ot,g.TEXTURE_COMPARE_MODE,g.COMPARE_REF_TO_TEXTURE),g.texParameteri(ot,g.TEXTURE_COMPARE_FUNC,Q[st.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const Tt=e.get("EXT_texture_filter_anisotropic");if(st.magFilter===cn||st.minFilter!==dh&&st.minFilter!==ya||st.type===Ps&&e.has("OES_texture_float_linear")===!1||y===!1&&st.type===ff&&e.has("OES_texture_half_float_linear")===!1)return;(st.anisotropy>1||x.get(st).__currentAnisotropy)&&(g.texParameterf(ot,Tt.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(st.anisotropy,T.getMaxAnisotropy())),x.get(st).__currentAnisotropy=st.anisotropy)}}function K(ot,st){let yt=!1;ot.__webglInit===void 0&&(ot.__webglInit=!0,st.addEventListener("dispose",M));const Tt=st.source;let wt=o.get(Tt);wt===void 0&&(wt={},o.set(Tt,wt));const Et=D(st);if(Et!==ot.__cacheKey){wt[Et]===void 0&&(wt[Et]={texture:g.createTexture(),usedTimes:0},a.memory.textures++,yt=!0),wt[Et].usedTimes++;const Gt=wt[ot.__cacheKey];Gt!==void 0&&(wt[ot.__cacheKey].usedTimes--,Gt.usedTimes===0&&w(st)),ot.__cacheKey=Et,ot.__webglTexture=wt[Et].texture}return yt}function U(ot,st,yt){let Tt=g.TEXTURE_2D;(st.isDataArrayTexture||st.isCompressedArrayTexture)&&(Tt=g.TEXTURE_2D_ARRAY),st.isData3DTexture&&(Tt=g.TEXTURE_3D);const wt=K(ot,st),Et=st.source;i.bindTexture(Tt,ot.__webglTexture,g.TEXTURE0+yt);const Gt=x.get(Et);if(Et.version!==Gt.__version||wt===!0){i.activeTexture(g.TEXTURE0+yt);const Wt=xi.getPrimaries(xi.workingColorSpace),Jt=st.colorSpace===rs?null:xi.getPrimaries(st.colorSpace),$t=st.colorSpace===rs||Wt===Jt?g.NONE:g.BROWSER_DEFAULT_WEBGL;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,st.flipY),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,st.premultiplyAlpha),g.pixelStorei(g.UNPACK_ALIGNMENT,st.unpackAlignment),g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,$t);const ee=s(st)&&f(st.image)===!1;let Nt=u(st.image,ee,!1,T.maxTextureSize);Nt=At(st,Nt);const Te=f(Nt)||y,le=E.convert(st.format,st.colorSpace);let ce=E.convert(st.type),se=v(st.internalFormat,le,ce,st.colorSpace,st.isVideoTexture);Y(Tt,st,Te);let ie;const Ce=st.mipmaps,Xe=y&&st.isVideoTexture!==!0&&se!==a1,si=Gt.__version===void 0||wt===!0,Be=Et.dataReady,ri=m(st,Nt,Te);if(st.isDepthTexture)se=g.DEPTH_COMPONENT,y?st.type===Ps?se=g.DEPTH_COMPONENT32F:st.type===eo?se=g.DEPTH_COMPONENT24:st.type===nl?se=g.DEPTH24_STENCIL8:se=g.DEPTH_COMPONENT16:st.type===Ps&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),st.format===rl&&se===g.DEPTH_COMPONENT&&st.type!==Qm&&st.type!==eo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),st.type=eo,ce=E.convert(st.type)),st.format===Lh&&se===g.DEPTH_COMPONENT&&(se=g.DEPTH_STENCIL,st.type!==nl&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),st.type=nl,ce=E.convert(st.type))),si&&(Xe?i.texStorage2D(g.TEXTURE_2D,1,se,Nt.width,Nt.height):i.texImage2D(g.TEXTURE_2D,0,se,Nt.width,Nt.height,0,le,ce,null));else if(st.isDataTexture)if(Ce.length>0&&Te){Xe&&si&&i.texStorage2D(g.TEXTURE_2D,ri,se,Ce[0].width,Ce[0].height);for(let xt=0,_t=Ce.length;xt<_t;xt++)ie=Ce[xt],Xe?Be&&i.texSubImage2D(g.TEXTURE_2D,xt,0,0,ie.width,ie.height,le,ce,ie.data):i.texImage2D(g.TEXTURE_2D,xt,se,ie.width,ie.height,0,le,ce,ie.data);st.generateMipmaps=!1}else Xe?(si&&i.texStorage2D(g.TEXTURE_2D,ri,se,Nt.width,Nt.height),Be&&i.texSubImage2D(g.TEXTURE_2D,0,0,0,Nt.width,Nt.height,le,ce,Nt.data)):i.texImage2D(g.TEXTURE_2D,0,se,Nt.width,Nt.height,0,le,ce,Nt.data);else if(st.isCompressedTexture)if(st.isCompressedArrayTexture){Xe&&si&&i.texStorage3D(g.TEXTURE_2D_ARRAY,ri,se,Ce[0].width,Ce[0].height,Nt.depth);for(let xt=0,_t=Ce.length;xt<_t;xt++)ie=Ce[xt],st.format!==Er?le!==null?Xe?Be&&i.compressedTexSubImage3D(g.TEXTURE_2D_ARRAY,xt,0,0,0,ie.width,ie.height,Nt.depth,le,ie.data,0,0):i.compressedTexImage3D(g.TEXTURE_2D_ARRAY,xt,se,ie.width,ie.height,Nt.depth,0,ie.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Xe?Be&&i.texSubImage3D(g.TEXTURE_2D_ARRAY,xt,0,0,0,ie.width,ie.height,Nt.depth,le,ce,ie.data):i.texImage3D(g.TEXTURE_2D_ARRAY,xt,se,ie.width,ie.height,Nt.depth,0,le,ce,ie.data)}else{Xe&&si&&i.texStorage2D(g.TEXTURE_2D,ri,se,Ce[0].width,Ce[0].height);for(let xt=0,_t=Ce.length;xt<_t;xt++)ie=Ce[xt],st.format!==Er?le!==null?Xe?Be&&i.compressedTexSubImage2D(g.TEXTURE_2D,xt,0,0,ie.width,ie.height,le,ie.data):i.compressedTexImage2D(g.TEXTURE_2D,xt,se,ie.width,ie.height,0,ie.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Xe?Be&&i.texSubImage2D(g.TEXTURE_2D,xt,0,0,ie.width,ie.height,le,ce,ie.data):i.texImage2D(g.TEXTURE_2D,xt,se,ie.width,ie.height,0,le,ce,ie.data)}else if(st.isDataArrayTexture)Xe?(si&&i.texStorage3D(g.TEXTURE_2D_ARRAY,ri,se,Nt.width,Nt.height,Nt.depth),Be&&i.texSubImage3D(g.TEXTURE_2D_ARRAY,0,0,0,0,Nt.width,Nt.height,Nt.depth,le,ce,Nt.data)):i.texImage3D(g.TEXTURE_2D_ARRAY,0,se,Nt.width,Nt.height,Nt.depth,0,le,ce,Nt.data);else if(st.isData3DTexture)Xe?(si&&i.texStorage3D(g.TEXTURE_3D,ri,se,Nt.width,Nt.height,Nt.depth),Be&&i.texSubImage3D(g.TEXTURE_3D,0,0,0,0,Nt.width,Nt.height,Nt.depth,le,ce,Nt.data)):i.texImage3D(g.TEXTURE_3D,0,se,Nt.width,Nt.height,Nt.depth,0,le,ce,Nt.data);else if(st.isFramebufferTexture){if(si)if(Xe)i.texStorage2D(g.TEXTURE_2D,ri,se,Nt.width,Nt.height);else{let xt=Nt.width,_t=Nt.height;for(let qt=0;qt>=1,_t>>=1}}else if(Ce.length>0&&Te){Xe&&si&&i.texStorage2D(g.TEXTURE_2D,ri,se,Ce[0].width,Ce[0].height);for(let xt=0,_t=Ce.length;xt<_t;xt++)ie=Ce[xt],Xe?Be&&i.texSubImage2D(g.TEXTURE_2D,xt,0,0,le,ce,ie):i.texImage2D(g.TEXTURE_2D,xt,se,le,ce,ie);st.generateMipmaps=!1}else Xe?(si&&i.texStorage2D(g.TEXTURE_2D,ri,se,Nt.width,Nt.height),Be&&i.texSubImage2D(g.TEXTURE_2D,0,0,0,le,ce,Nt)):i.texImage2D(g.TEXTURE_2D,0,se,le,ce,Nt);c(st,Te)&&d(Tt),Gt.__version=Et.version,st.onUpdate&&st.onUpdate(st)}ot.__version=st.version}function V(ot,st,yt){if(st.image.length!==6)return;const Tt=K(ot,st),wt=st.source;i.bindTexture(g.TEXTURE_CUBE_MAP,ot.__webglTexture,g.TEXTURE0+yt);const Et=x.get(wt);if(wt.version!==Et.__version||Tt===!0){i.activeTexture(g.TEXTURE0+yt);const Gt=xi.getPrimaries(xi.workingColorSpace),Wt=st.colorSpace===rs?null:xi.getPrimaries(st.colorSpace),Jt=st.colorSpace===rs||Gt===Wt?g.NONE:g.BROWSER_DEFAULT_WEBGL;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,st.flipY),g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,st.premultiplyAlpha),g.pixelStorei(g.UNPACK_ALIGNMENT,st.unpackAlignment),g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,Jt);const $t=st.isCompressedTexture||st.image[0].isCompressedTexture,ee=st.image[0]&&st.image[0].isDataTexture,Nt=[];for(let xt=0;xt<6;xt++)!$t&&!ee?Nt[xt]=u(st.image[xt],!1,!0,T.maxCubemapSize):Nt[xt]=ee?st.image[xt].image:st.image[xt],Nt[xt]=At(st,Nt[xt]);const Te=Nt[0],le=f(Te)||y,ce=E.convert(st.format,st.colorSpace),se=E.convert(st.type),ie=v(st.internalFormat,ce,se,st.colorSpace),Ce=y&&st.isVideoTexture!==!0,Xe=Et.__version===void 0||Tt===!0,si=wt.dataReady;let Be=m(st,Te,le);Y(g.TEXTURE_CUBE_MAP,st,le);let ri;if($t){Ce&&Xe&&i.texStorage2D(g.TEXTURE_CUBE_MAP,Be,ie,Te.width,Te.height);for(let xt=0;xt<6;xt++){ri=Nt[xt].mipmaps;for(let _t=0;_t0&&Be++,i.texStorage2D(g.TEXTURE_CUBE_MAP,Be,ie,Nt[0].width,Nt[0].height));for(let xt=0;xt<6;xt++)if(ee){Ce?si&&i.texSubImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+xt,0,0,0,Nt[xt].width,Nt[xt].height,ce,se,Nt[xt].data):i.texImage2D(g.TEXTURE_CUBE_MAP_POSITIVE_X+xt,0,ie,Nt[xt].width,Nt[xt].height,0,ce,se,Nt[xt].data);for(let _t=0;_t>Et),Nt=Math.max(1,st.height>>Et);wt===g.TEXTURE_3D||wt===g.TEXTURE_2D_ARRAY?i.texImage3D(wt,Et,Jt,ee,Nt,st.depth,0,Gt,Wt,null):i.texImage2D(wt,Et,Jt,ee,Nt,0,Gt,Wt,null)}i.bindFramebuffer(g.FRAMEBUFFER,ot),mt(st)?t.framebufferTexture2DMultisampleEXT(g.FRAMEBUFFER,Tt,wt,x.get(yt).__webglTexture,0,dt(st)):(wt===g.TEXTURE_2D||wt>=g.TEXTURE_CUBE_MAP_POSITIVE_X&&wt<=g.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&g.framebufferTexture2D(g.FRAMEBUFFER,Tt,wt,x.get(yt).__webglTexture,Et),i.bindFramebuffer(g.FRAMEBUFFER,null)}function $(ot,st,yt){if(g.bindRenderbuffer(g.RENDERBUFFER,ot),st.depthBuffer&&!st.stencilBuffer){let Tt=y===!0?g.DEPTH_COMPONENT24:g.DEPTH_COMPONENT16;if(yt||mt(st)){const wt=st.depthTexture;wt&&wt.isDepthTexture&&(wt.type===Ps?Tt=g.DEPTH_COMPONENT32F:wt.type===eo&&(Tt=g.DEPTH_COMPONENT24));const Et=dt(st);mt(st)?t.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Et,Tt,st.width,st.height):g.renderbufferStorageMultisample(g.RENDERBUFFER,Et,Tt,st.width,st.height)}else g.renderbufferStorage(g.RENDERBUFFER,Tt,st.width,st.height);g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,ot)}else if(st.depthBuffer&&st.stencilBuffer){const Tt=dt(st);yt&&mt(st)===!1?g.renderbufferStorageMultisample(g.RENDERBUFFER,Tt,g.DEPTH24_STENCIL8,st.width,st.height):mt(st)?t.renderbufferStorageMultisampleEXT(g.RENDERBUFFER,Tt,g.DEPTH24_STENCIL8,st.width,st.height):g.renderbufferStorage(g.RENDERBUFFER,g.DEPTH_STENCIL,st.width,st.height),g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_STENCIL_ATTACHMENT,g.RENDERBUFFER,ot)}else{const Tt=st.isWebGLMultipleRenderTargets===!0?st.texture:[st.texture];for(let wt=0;wt0){yt.__webglFramebuffer[Wt]=[];for(let Jt=0;Jt0){yt.__webglFramebuffer=[];for(let Wt=0;Wt0&&mt(ot)===!1){const Wt=Et?st:[st];yt.__webglMultisampledFramebuffer=g.createFramebuffer(),yt.__webglColorRenderbuffer=[],i.bindFramebuffer(g.FRAMEBUFFER,yt.__webglMultisampledFramebuffer);for(let Jt=0;Jt0)for(let Jt=0;Jt0)for(let Jt=0;Jt0&&mt(ot)===!1){const st=ot.isWebGLMultipleRenderTargets?ot.texture:[ot.texture],yt=ot.width,Tt=ot.height;let wt=g.COLOR_BUFFER_BIT;const Et=[],Gt=ot.stencilBuffer?g.DEPTH_STENCIL_ATTACHMENT:g.DEPTH_ATTACHMENT,Wt=x.get(ot),Jt=ot.isWebGLMultipleRenderTargets===!0;if(Jt)for(let $t=0;$t0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&st.__useRenderToTexture!==!1}function gt(ot){const st=a.render.frame;p.get(ot)!==st&&(p.set(ot,st),ot.update())}function At(ot,st){const yt=ot.colorSpace,Tt=ot.format,wt=ot.type;return ot.isCompressedTexture===!0||ot.isVideoTexture===!0||ot.format===fm||yt!==Ma&&yt!==rs&&(xi.getTransfer(yt)===Di?y===!1?e.has("EXT_sRGB")===!0&&Tt===Er?(ot.format=fm,ot.minFilter=Ki,ot.generateMipmaps=!1):st=f1.sRGBToLinear(st):(Tt!==Er||wt!==Ta)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",yt)),st}this.allocateTextureUnit=I,this.resetTextureUnits=O,this.setTexture2D=B,this.setTexture2DArray=G,this.setTexture3D=z,this.setTextureCube=W,this.rebindTextures=nt,this.setupRenderTarget=et,this.updateRenderTargetMipmap=ht,this.updateMultisampleRenderTarget=ut,this.setupDepthRenderbuffer=it,this.setupFrameBufferTexture=j,this.useMultisampledRTT=mt}function yA(g,e,i){const x=i.isWebGL2;function T(E,a=rs){let y;const t=xi.getTransfer(a);if(E===Ta)return g.UNSIGNED_BYTE;if(E===e1)return g.UNSIGNED_SHORT_4_4_4_4;if(E===i1)return g.UNSIGNED_SHORT_5_5_5_1;if(E===UC)return g.BYTE;if(E===zC)return g.SHORT;if(E===Qm)return g.UNSIGNED_SHORT;if(E===t1)return g.INT;if(E===eo)return g.UNSIGNED_INT;if(E===Ps)return g.FLOAT;if(E===ff)return x?g.HALF_FLOAT:(y=e.get("OES_texture_half_float"),y!==null?y.HALF_FLOAT_OES:null);if(E===GC)return g.ALPHA;if(E===Er)return g.RGBA;if(E===VC)return g.LUMINANCE;if(E===HC)return g.LUMINANCE_ALPHA;if(E===rl)return g.DEPTH_COMPONENT;if(E===Lh)return g.DEPTH_STENCIL;if(E===fm)return y=e.get("EXT_sRGB"),y!==null?y.SRGB_ALPHA_EXT:null;if(E===WC)return g.RED;if(E===n1)return g.RED_INTEGER;if(E===XC)return g.RG;if(E===r1)return g.RG_INTEGER;if(E===s1)return g.RGBA_INTEGER;if(E===Kv||E===jv||E===Zv||E===Jv)if(t===Di)if(y=e.get("WEBGL_compressed_texture_s3tc_srgb"),y!==null){if(E===Kv)return y.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(E===jv)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(E===Zv)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(E===Jv)return y.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(y=e.get("WEBGL_compressed_texture_s3tc"),y!==null){if(E===Kv)return y.COMPRESSED_RGB_S3TC_DXT1_EXT;if(E===jv)return y.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(E===Zv)return y.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(E===Jv)return y.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(E===Gy||E===Vy||E===Hy||E===Wy)if(y=e.get("WEBGL_compressed_texture_pvrtc"),y!==null){if(E===Gy)return y.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(E===Vy)return y.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(E===Hy)return y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(E===Wy)return y.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(E===a1)return y=e.get("WEBGL_compressed_texture_etc1"),y!==null?y.COMPRESSED_RGB_ETC1_WEBGL:null;if(E===Xy||E===Yy)if(y=e.get("WEBGL_compressed_texture_etc"),y!==null){if(E===Xy)return t===Di?y.COMPRESSED_SRGB8_ETC2:y.COMPRESSED_RGB8_ETC2;if(E===Yy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:y.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(E===ky||E===Ky||E===jy||E===Zy||E===Jy||E===$y||E===Qy||E===_y||E===qy||E===tx||E===ex||E===ix||E===nx||E===rx)if(y=e.get("WEBGL_compressed_texture_astc"),y!==null){if(E===ky)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:y.COMPRESSED_RGBA_ASTC_4x4_KHR;if(E===Ky)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:y.COMPRESSED_RGBA_ASTC_5x4_KHR;if(E===jy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:y.COMPRESSED_RGBA_ASTC_5x5_KHR;if(E===Zy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:y.COMPRESSED_RGBA_ASTC_6x5_KHR;if(E===Jy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:y.COMPRESSED_RGBA_ASTC_6x6_KHR;if(E===$y)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:y.COMPRESSED_RGBA_ASTC_8x5_KHR;if(E===Qy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:y.COMPRESSED_RGBA_ASTC_8x6_KHR;if(E===_y)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:y.COMPRESSED_RGBA_ASTC_8x8_KHR;if(E===qy)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:y.COMPRESSED_RGBA_ASTC_10x5_KHR;if(E===tx)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:y.COMPRESSED_RGBA_ASTC_10x6_KHR;if(E===ex)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:y.COMPRESSED_RGBA_ASTC_10x8_KHR;if(E===ix)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:y.COMPRESSED_RGBA_ASTC_10x10_KHR;if(E===nx)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:y.COMPRESSED_RGBA_ASTC_12x10_KHR;if(E===rx)return t===Di?y.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:y.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(E===$v||E===sx||E===ax)if(y=e.get("EXT_texture_compression_bptc"),y!==null){if(E===$v)return t===Di?y.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:y.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(E===sx)return y.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(E===ax)return y.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(E===YC||E===ox||E===lx||E===hx)if(y=e.get("EXT_texture_compression_rgtc"),y!==null){if(E===$v)return y.COMPRESSED_RED_RGTC1_EXT;if(E===ox)return y.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(E===lx)return y.COMPRESSED_RED_GREEN_RGTC2_EXT;if(E===hx)return y.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return E===nl?x?g.UNSIGNED_INT_24_8:(y=e.get("WEBGL_depth_texture"),y!==null?y.UNSIGNED_INT_24_8_WEBGL:null):g[E]!==void 0?g[E]:null}return{convert:T}}class xA extends Yn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class ef extends vi{constructor(){super(),this.isGroup=!0,this.type="Group"}}const I6={type:"move"};class H0{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new ef,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new ef,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new pt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new pt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new ef,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new pt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new pt),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const i=this._hand;if(i)for(const x of e.hand.values())this._getHandJoint(i,x)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,i,x){let T=null,E=null,a=null;const y=this._targetRay,t=this._grip,r=this._hand;if(e&&i.session.visibilityState!=="visible-blurred"){if(r&&e.hand){a=!0;for(const u of e.hand.values()){const f=i.getJointPose(u,x),s=this._getHandJoint(r,u);f!==null&&(s.matrix.fromArray(f.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,s.jointRadius=f.radius),s.visible=f!==null}const p=r.joints["index-finger-tip"],h=r.joints["thumb-tip"],o=p.position.distanceTo(h.position),l=.02,n=.005;r.inputState.pinching&&o>l+n?(r.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!r.inputState.pinching&&o<=l-n&&(r.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else t!==null&&e.gripSpace&&(E=i.getPose(e.gripSpace,x),E!==null&&(t.matrix.fromArray(E.transform.matrix),t.matrix.decompose(t.position,t.rotation,t.scale),t.matrixWorldNeedsUpdate=!0,E.linearVelocity?(t.hasLinearVelocity=!0,t.linearVelocity.copy(E.linearVelocity)):t.hasLinearVelocity=!1,E.angularVelocity?(t.hasAngularVelocity=!0,t.angularVelocity.copy(E.angularVelocity)):t.hasAngularVelocity=!1));y!==null&&(T=i.getPose(e.targetRaySpace,x),T===null&&E!==null&&(T=E),T!==null&&(y.matrix.fromArray(T.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.matrixWorldNeedsUpdate=!0,T.linearVelocity?(y.hasLinearVelocity=!0,y.linearVelocity.copy(T.linearVelocity)):y.hasLinearVelocity=!1,T.angularVelocity?(y.hasAngularVelocity=!0,y.angularVelocity.copy(T.angularVelocity)):y.hasAngularVelocity=!1,this.dispatchEvent(I6)))}return y!==null&&(y.visible=T!==null),t!==null&&(t.visible=E!==null),r!==null&&(r.visible=a!==null),this}_getHandJoint(e,i){if(e.joints[i.jointName]===void 0){const x=new ef;x.matrixAutoUpdate=!1,x.visible=!1,e.joints[i.jointName]=x,e.add(x)}return e.joints[i.jointName]}}const N6=` -void main() { - - gl_Position = vec4( position, 1.0 ); - -}`,B6=` -uniform sampler2DArray depthColor; -uniform float depthWidth; -uniform float depthHeight; - -void main() { - - vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); - - if ( coord.x >= 1.0 ) { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; - - } else { - - gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; - - } - -}`;class U6{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,i,x){if(this.texture===null){const T=new Zi,E=e.properties.get(T);E.__webglTexture=i.texture,(i.depthNear!=x.depthNear||i.depthFar!=x.depthFar)&&(this.depthNear=i.depthNear,this.depthFar=i.depthFar),this.texture=T}}render(e,i){if(this.texture!==null){if(this.mesh===null){const x=i.cameras[0].viewport,T=new $s({extensions:{fragDepth:!0},vertexShader:N6,fragmentShader:B6,uniforms:{depthColor:{value:this.texture},depthWidth:{value:x.z},depthHeight:{value:x.w}}});this.mesh=new En(new Sf(20,20),T)}e.render(this.mesh,i)}}reset(){this.texture=null,this.mesh=null}}class z6 extends ho{constructor(e,i){super();const x=this;let T=null,E=1,a=null,y="local-floor",t=1,r=null,p=null,h=null,o=null,l=null,n=null;const u=new U6,f=i.getContextAttributes();let s=null,c=null;const d=[],v=[],m=new jt;let S=null;const M=new Yn;M.layers.enable(1),M.viewport=new Si;const A=new Yn;A.layers.enable(2),A.viewport=new Si;const C=[M,A],w=new xA;w.layers.enable(1),w.layers.enable(2);let P=null,L=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let U=d[K];return U===void 0&&(U=new H0,d[K]=U),U.getTargetRaySpace()},this.getControllerGrip=function(K){let U=d[K];return U===void 0&&(U=new H0,d[K]=U),U.getGripSpace()},this.getHand=function(K){let U=d[K];return U===void 0&&(U=new H0,d[K]=U),U.getHandSpace()};function O(K){const U=v.indexOf(K.inputSource);if(U===-1)return;const V=d[U];V!==void 0&&(V.update(K.inputSource,K.frame,r||a),V.dispatchEvent({type:K.type,data:K.inputSource}))}function I(){T.removeEventListener("select",O),T.removeEventListener("selectstart",O),T.removeEventListener("selectend",O),T.removeEventListener("squeeze",O),T.removeEventListener("squeezestart",O),T.removeEventListener("squeezeend",O),T.removeEventListener("end",I),T.removeEventListener("inputsourceschange",D);for(let K=0;K=0&&(v[j]=null,d[j].disconnect(V))}for(let U=0;U=v.length){v.push(V),j=q;break}else if(v[q]===null){v[q]=V,j=q;break}if(j===-1)break}const $=d[j];$&&$.connect(V)}}const B=new pt,G=new pt;function z(K,U,V){B.setFromMatrixPosition(U.matrixWorld),G.setFromMatrixPosition(V.matrixWorld);const j=B.distanceTo(G),$=U.projectionMatrix.elements,q=V.projectionMatrix.elements,it=$[14]/($[10]-1),nt=$[14]/($[10]+1),et=($[9]+1)/$[5],ht=($[9]-1)/$[5],ut=($[8]-1)/$[0],dt=(q[8]+1)/q[0],mt=it*ut,gt=it*dt,At=j/(-ut+dt),ot=At*-ut;U.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(ot),K.translateZ(At),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert();const st=it+At,yt=nt+At,Tt=mt-ot,wt=gt+(j-ot),Et=et*nt/yt*st,Gt=ht*nt/yt*st;K.projectionMatrix.makePerspective(Tt,wt,Et,Gt,st,yt),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}function W(K,U){U===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(U.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(T===null)return;u.texture!==null&&(K.near=u.depthNear,K.far=u.depthFar),w.near=A.near=M.near=K.near,w.far=A.far=M.far=K.far,(P!==w.near||L!==w.far)&&(T.updateRenderState({depthNear:w.near,depthFar:w.far}),P=w.near,L=w.far,M.near=P,M.far=L,A.near=P,A.far=L,M.updateProjectionMatrix(),A.updateProjectionMatrix(),K.updateProjectionMatrix());const U=K.parent,V=w.cameras;W(w,U);for(let j=0;j0&&(f.alphaTest.value=s.alphaTest);const c=e.get(s).envMap;if(c&&(f.envMap.value=c,f.flipEnvMap.value=c.isCubeTexture&&c.isRenderTargetTexture===!1?-1:1,f.reflectivity.value=s.reflectivity,f.ior.value=s.ior,f.refractionRatio.value=s.refractionRatio),s.lightMap){f.lightMap.value=s.lightMap;const d=g._useLegacyLights===!0?Math.PI:1;f.lightMapIntensity.value=s.lightMapIntensity*d,i(s.lightMap,f.lightMapTransform)}s.aoMap&&(f.aoMap.value=s.aoMap,f.aoMapIntensity.value=s.aoMapIntensity,i(s.aoMap,f.aoMapTransform))}function a(f,s){f.diffuse.value.copy(s.color),f.opacity.value=s.opacity,s.map&&(f.map.value=s.map,i(s.map,f.mapTransform))}function y(f,s){f.dashSize.value=s.dashSize,f.totalSize.value=s.dashSize+s.gapSize,f.scale.value=s.scale}function t(f,s,c,d){f.diffuse.value.copy(s.color),f.opacity.value=s.opacity,f.size.value=s.size*c,f.scale.value=d*.5,s.map&&(f.map.value=s.map,i(s.map,f.uvTransform)),s.alphaMap&&(f.alphaMap.value=s.alphaMap,i(s.alphaMap,f.alphaMapTransform)),s.alphaTest>0&&(f.alphaTest.value=s.alphaTest)}function r(f,s){f.diffuse.value.copy(s.color),f.opacity.value=s.opacity,f.rotation.value=s.rotation,s.map&&(f.map.value=s.map,i(s.map,f.mapTransform)),s.alphaMap&&(f.alphaMap.value=s.alphaMap,i(s.alphaMap,f.alphaMapTransform)),s.alphaTest>0&&(f.alphaTest.value=s.alphaTest)}function p(f,s){f.specular.value.copy(s.specular),f.shininess.value=Math.max(s.shininess,1e-4)}function h(f,s){s.gradientMap&&(f.gradientMap.value=s.gradientMap)}function o(f,s){f.metalness.value=s.metalness,s.metalnessMap&&(f.metalnessMap.value=s.metalnessMap,i(s.metalnessMap,f.metalnessMapTransform)),f.roughness.value=s.roughness,s.roughnessMap&&(f.roughnessMap.value=s.roughnessMap,i(s.roughnessMap,f.roughnessMapTransform)),e.get(s).envMap&&(f.envMapIntensity.value=s.envMapIntensity)}function l(f,s,c){f.ior.value=s.ior,s.sheen>0&&(f.sheenColor.value.copy(s.sheenColor).multiplyScalar(s.sheen),f.sheenRoughness.value=s.sheenRoughness,s.sheenColorMap&&(f.sheenColorMap.value=s.sheenColorMap,i(s.sheenColorMap,f.sheenColorMapTransform)),s.sheenRoughnessMap&&(f.sheenRoughnessMap.value=s.sheenRoughnessMap,i(s.sheenRoughnessMap,f.sheenRoughnessMapTransform))),s.clearcoat>0&&(f.clearcoat.value=s.clearcoat,f.clearcoatRoughness.value=s.clearcoatRoughness,s.clearcoatMap&&(f.clearcoatMap.value=s.clearcoatMap,i(s.clearcoatMap,f.clearcoatMapTransform)),s.clearcoatRoughnessMap&&(f.clearcoatRoughnessMap.value=s.clearcoatRoughnessMap,i(s.clearcoatRoughnessMap,f.clearcoatRoughnessMapTransform)),s.clearcoatNormalMap&&(f.clearcoatNormalMap.value=s.clearcoatNormalMap,i(s.clearcoatNormalMap,f.clearcoatNormalMapTransform),f.clearcoatNormalScale.value.copy(s.clearcoatNormalScale),s.side===Cr&&f.clearcoatNormalScale.value.negate())),s.iridescence>0&&(f.iridescence.value=s.iridescence,f.iridescenceIOR.value=s.iridescenceIOR,f.iridescenceThicknessMinimum.value=s.iridescenceThicknessRange[0],f.iridescenceThicknessMaximum.value=s.iridescenceThicknessRange[1],s.iridescenceMap&&(f.iridescenceMap.value=s.iridescenceMap,i(s.iridescenceMap,f.iridescenceMapTransform)),s.iridescenceThicknessMap&&(f.iridescenceThicknessMap.value=s.iridescenceThicknessMap,i(s.iridescenceThicknessMap,f.iridescenceThicknessMapTransform))),s.transmission>0&&(f.transmission.value=s.transmission,f.transmissionSamplerMap.value=c.texture,f.transmissionSamplerSize.value.set(c.width,c.height),s.transmissionMap&&(f.transmissionMap.value=s.transmissionMap,i(s.transmissionMap,f.transmissionMapTransform)),f.thickness.value=s.thickness,s.thicknessMap&&(f.thicknessMap.value=s.thicknessMap,i(s.thicknessMap,f.thicknessMapTransform)),f.attenuationDistance.value=s.attenuationDistance,f.attenuationColor.value.copy(s.attenuationColor)),s.anisotropy>0&&(f.anisotropyVector.value.set(s.anisotropy*Math.cos(s.anisotropyRotation),s.anisotropy*Math.sin(s.anisotropyRotation)),s.anisotropyMap&&(f.anisotropyMap.value=s.anisotropyMap,i(s.anisotropyMap,f.anisotropyMapTransform))),f.specularIntensity.value=s.specularIntensity,f.specularColor.value.copy(s.specularColor),s.specularColorMap&&(f.specularColorMap.value=s.specularColorMap,i(s.specularColorMap,f.specularColorMapTransform)),s.specularIntensityMap&&(f.specularIntensityMap.value=s.specularIntensityMap,i(s.specularIntensityMap,f.specularIntensityMapTransform))}function n(f,s){s.matcap&&(f.matcap.value=s.matcap)}function u(f,s){const c=e.get(s).light;f.referencePosition.value.setFromMatrixPosition(c.matrixWorld),f.nearDistance.value=c.shadow.camera.near,f.farDistance.value=c.shadow.camera.far}return{refreshFogUniforms:x,refreshMaterialUniforms:T}}function V6(g,e,i,x){let T={},E={},a=[];const y=i.isWebGL2?g.getParameter(g.MAX_UNIFORM_BUFFER_BINDINGS):0;function t(c,d){const v=d.program;x.uniformBlockBinding(c,v)}function r(c,d){let v=T[c.id];v===void 0&&(n(c),v=p(c),T[c.id]=v,c.addEventListener("dispose",f));const m=d.program;x.updateUBOMapping(c,m);const S=e.render.frame;E[c.id]!==S&&(o(c),E[c.id]=S)}function p(c){const d=h();c.__bindingPointIndex=d;const v=g.createBuffer(),m=c.__size,S=c.usage;return g.bindBuffer(g.UNIFORM_BUFFER,v),g.bufferData(g.UNIFORM_BUFFER,m,S),g.bindBuffer(g.UNIFORM_BUFFER,null),g.bindBufferBase(g.UNIFORM_BUFFER,d,v),v}function h(){for(let c=0;c0&&(v+=m-S),c.__size=v,c.__cache={},this}function u(c){const d={boundary:0,storage:0};return typeof c=="number"||typeof c=="boolean"?(d.boundary=4,d.storage=4):c.isVector2?(d.boundary=8,d.storage=8):c.isVector3||c.isColor?(d.boundary=16,d.storage=12):c.isVector4?(d.boundary=16,d.storage=16):c.isMatrix3?(d.boundary=48,d.storage=48):c.isMatrix4?(d.boundary=64,d.storage=64):c.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",c),d}function f(c){const d=c.target;d.removeEventListener("dispose",f);const v=a.indexOf(d.__bindingPointIndex);a.splice(v,1),g.deleteBuffer(T[d.id]),delete T[d.id],delete E[d.id]}function s(){for(const c in T)g.deleteBuffer(T[c]);a=[],T={},E={}}return{bind:t,update:r,dispose:s}}class x1{constructor(e={}){const{canvas:i=sA(),context:x=null,depth:T=!0,stencil:E=!0,alpha:a=!1,antialias:y=!1,premultipliedAlpha:t=!0,preserveDrawingBuffer:r=!1,powerPreference:p="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let o;x!==null?o=x.getContextAttributes().alpha:o=a;const l=new Uint32Array(4),n=new Int32Array(4);let u=null,f=null;const s=[],c=[];this.domElement=i,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Ln,this._useLegacyLights=!1,this.toneMapping=Sa,this.toneMappingExposure=1;const d=this;let v=!1,m=0,S=0,M=null,A=-1,C=null;const w=new Si,P=new Si;let L=null;const O=new fe(0);let I=0,D=i.width,B=i.height,G=1,z=null,W=null;const k=new Si(0,0,D,B),J=new Si(0,0,D,B);let Q=!1;const Y=new Rd;let K=!1,U=!1,V=null;const j=new Ve,$=new jt,q=new pt,it={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function nt(){return M===null?G:1}let et=x;function ht(ct,bt){for(let Bt=0;Bt{function he(){if(zt.forEach(function(me){At.get(me).currentProgram.isReady()&&zt.delete(me)}),zt.size===0){Dt(ct);return}setTimeout(he,10)}ut.get("KHR_parallel_shader_compile")!==null?he():setTimeout(he,10)})};let pi=null;function $i(ct){pi&&pi(ct)}function jn(){rn.stop()}function mi(){rn.start()}const rn=new cA;rn.setAnimationLoop($i),typeof self<"u"&&rn.setContext(self),this.setAnimationLoop=function(ct){pi=ct,Be.setAnimationLoop(ct),ct===null?rn.stop():rn.start()},Be.addEventListener("sessionstart",jn),Be.addEventListener("sessionend",mi),this.render=function(ct,bt){if(bt!==void 0&&bt.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(v===!0)return;ct.matrixWorldAutoUpdate===!0&&ct.updateMatrixWorld(),bt.parent===null&&bt.matrixWorldAutoUpdate===!0&&bt.updateMatrixWorld(),Be.enabled===!0&&Be.isPresenting===!0&&(Be.cameraAutoUpdate===!0&&Be.updateCamera(bt),bt=Be.getCamera()),ct.isScene===!0&&ct.onBeforeRender(d,ct,bt,M),f=$t.get(ct,c.length),f.init(),c.push(f),j.multiplyMatrices(bt.projectionMatrix,bt.matrixWorldInverse),Y.setFromProjectionMatrix(j),U=this.localClippingEnabled,K=ee.init(this.clippingPlanes,U),u=Jt.get(ct,s.length),u.init(),s.push(u),Pr(ct,bt,0,d.sortObjects),u.finish(),d.sortObjects===!0&&u.sort(z,W),this.info.render.frame++,K===!0&&ee.beginShadows();const Bt=f.state.shadowsArray;if(Nt.render(Bt,ct,bt),K===!0&&ee.endShadows(),this.info.autoReset===!0&&this.info.reset(),(Be.enabled===!1||Be.isPresenting===!1||Be.hasDepthSensing()===!1)&&Te.render(u,ct),f.setupLights(d._useLegacyLights),bt.isArrayCamera){const zt=bt.cameras;for(let Dt=0,he=zt.length;Dt0?f=c[c.length-1]:f=null,s.pop(),s.length>0?u=s[s.length-1]:u=null};function Pr(ct,bt,Bt,zt){if(ct.visible===!1)return;if(ct.layers.test(bt.layers)){if(ct.isGroup)Bt=ct.renderOrder;else if(ct.isLOD)ct.autoUpdate===!0&&ct.update(bt);else if(ct.isLight)f.pushLight(ct),ct.castShadow&&f.pushShadow(ct);else if(ct.isSprite){if(!ct.frustumCulled||Y.intersectsSprite(ct)){zt&&q.setFromMatrixPosition(ct.matrixWorld).applyMatrix4(j);const me=Et.update(ct),Re=ct.material;Re.visible&&u.push(ct,me,Re,Bt,q.z,null)}}else if((ct.isMesh||ct.isLine||ct.isPoints)&&(!ct.frustumCulled||Y.intersectsObject(ct))){const me=Et.update(ct),Re=ct.material;if(zt&&(ct.boundingSphere!==void 0?(ct.boundingSphere===null&&ct.computeBoundingSphere(),q.copy(ct.boundingSphere.center)):(me.boundingSphere===null&&me.computeBoundingSphere(),q.copy(me.boundingSphere.center)),q.applyMatrix4(ct.matrixWorld).applyMatrix4(j)),Array.isArray(Re)){const Ae=me.groups;for(let ze=0,Ue=Ae.length;ze0&&vl(Dt,he,bt,Bt),zt&&mt.viewport(w.copy(zt)),Dt.length>0&&uo(Dt,bt,Bt),he.length>0&&uo(he,bt,Bt),me.length>0&&uo(me,bt,Bt),mt.buffers.depth.setTest(!0),mt.buffers.depth.setMask(!0),mt.buffers.color.setMask(!0),mt.setPolygonOffset(!1)}function vl(ct,bt,Bt,zt){if((Bt.isScene===!0?Bt.overrideMaterial:null)!==null)return;const he=dt.isWebGL2;V===null&&(V=new Js(1,1,{generateMipmaps:!0,type:ut.has("EXT_color_buffer_half_float")?ff:Ta,minFilter:ya,samples:he?4:0})),d.getDrawingBufferSize($),he?V.setSize($.x,$.y):V.setSize(cm($.x),cm($.y));const me=d.getRenderTarget();d.setRenderTarget(V),d.getClearColor(O),I=d.getClearAlpha(),I<1&&d.setClearColor(16777215,.5),d.clear();const Re=d.toneMapping;d.toneMapping=Sa,uo(ct,Bt,zt),ot.updateMultisampleRenderTarget(V),ot.updateRenderTargetMipmap(V);let Ae=!1;for(let ze=0,Ue=bt.length;ze0),Ge=!!Bt.morphAttributes.position,bi=!!Bt.morphAttributes.normal,dn=!!Bt.morphAttributes.color;let Ci=Sa;zt.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(Ci=d.toneMapping);const pn=Bt.morphAttributes.position||Bt.morphAttributes.normal||Bt.morphAttributes.color,be=pn!==void 0?pn.length:0,de=At.get(zt),Rr=f.state.lights;if(K===!0&&(U===!0||ct!==C)){const Cn=ct===C&&zt.id===A;ee.setState(zt,ct,Cn)}let Ke=!1;zt.version===de.__version?(de.needsLights&&de.lightsStateVersion!==Rr.state.version||de.outputColorSpace!==Re||Dt.isBatchedMesh&&de.batching===!1||!Dt.isBatchedMesh&&de.batching===!0||Dt.isInstancedMesh&&de.instancing===!1||!Dt.isInstancedMesh&&de.instancing===!0||Dt.isSkinnedMesh&&de.skinning===!1||!Dt.isSkinnedMesh&&de.skinning===!0||Dt.isInstancedMesh&&de.instancingColor===!0&&Dt.instanceColor===null||Dt.isInstancedMesh&&de.instancingColor===!1&&Dt.instanceColor!==null||de.envMap!==Ae||zt.fog===!0&&de.fog!==he||de.numClippingPlanes!==void 0&&(de.numClippingPlanes!==ee.numPlanes||de.numIntersection!==ee.numIntersection)||de.vertexAlphas!==ze||de.vertexTangents!==Ue||de.morphTargets!==Ge||de.morphNormals!==bi||de.morphColors!==dn||de.toneMapping!==Ci||dt.isWebGL2===!0&&de.morphTargetsCount!==be)&&(Ke=!0):(Ke=!0,de.__version=zt.version);let Ii=de.currentProgram;Ke===!0&&(Ii=fo(zt,bt,Dt));let Vr=!1,qn=!1,vn=!1;const Bi=Ii.getUniforms(),ur=de.uniforms;if(mt.useProgram(Ii.program)&&(Vr=!0,qn=!0,vn=!0),zt.id!==A&&(A=zt.id,qn=!0),Vr||C!==ct){Bi.setValue(et,"projectionMatrix",ct.projectionMatrix),Bi.setValue(et,"viewMatrix",ct.matrixWorldInverse);const Cn=Bi.map.cameraPosition;Cn!==void 0&&Cn.setValue(et,q.setFromMatrixPosition(ct.matrixWorld)),dt.logarithmicDepthBuffer&&Bi.setValue(et,"logDepthBufFC",2/(Math.log(ct.far+1)/Math.LN2)),(zt.isMeshPhongMaterial||zt.isMeshToonMaterial||zt.isMeshLambertMaterial||zt.isMeshBasicMaterial||zt.isMeshStandardMaterial||zt.isShaderMaterial)&&Bi.setValue(et,"isOrthographic",ct.isOrthographicCamera===!0),C!==ct&&(C=ct,qn=!0,vn=!0)}if(Dt.isSkinnedMesh){Bi.setOptional(et,Dt,"bindMatrix"),Bi.setOptional(et,Dt,"bindMatrixInverse");const Cn=Dt.skeleton;Cn&&(dt.floatVertexTextures?(Cn.boneTexture===null&&Cn.computeBoneTexture(),Bi.setValue(et,"boneTexture",Cn.boneTexture,ot)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}Dt.isBatchedMesh&&(Bi.setOptional(et,Dt,"batchingTexture"),Bi.setValue(et,"batchingTexture",Dt._matricesTexture,ot));const Pa=Bt.morphAttributes;if((Pa.position!==void 0||Pa.normal!==void 0||Pa.color!==void 0&&dt.isWebGL2===!0)&&le.update(Dt,Bt,Ii),(qn||de.receiveShadow!==Dt.receiveShadow)&&(de.receiveShadow=Dt.receiveShadow,Bi.setValue(et,"receiveShadow",Dt.receiveShadow)),zt.isMeshGouraudMaterial&&zt.envMap!==null&&(ur.envMap.value=Ae,ur.flipEnvMap.value=Ae.isCubeTexture&&Ae.isRenderTargetTexture===!1?-1:1),qn&&(Bi.setValue(et,"toneMappingExposure",d.toneMappingExposure),de.needsLights&&Af(ur,vn),he&&zt.fog===!0&&Wt.refreshFogUniforms(ur,he),Wt.refreshMaterialUniforms(ur,zt,G,B,V),qv.upload(et,zh(de),ur,ot)),zt.isShaderMaterial&&zt.uniformsNeedUpdate===!0&&(qv.upload(et,zh(de),ur,ot),zt.uniformsNeedUpdate=!1),zt.isSpriteMaterial&&Bi.setValue(et,"center",Dt.center),Bi.setValue(et,"modelViewMatrix",Dt.modelViewMatrix),Bi.setValue(et,"normalMatrix",Dt.normalMatrix),Bi.setValue(et,"modelMatrix",Dt.matrixWorld),zt.isShaderMaterial||zt.isRawShaderMaterial){const Cn=zt.uniformsGroups;for(let Ra=0,tr=Cn.length;Ra0&&ot.useMultisampledRTT(ct)===!1?Dt=At.get(ct).__webglMultisampledFramebuffer:Array.isArray(Ue)?Dt=Ue[Bt]:Dt=Ue,w.copy(ct.viewport),P.copy(ct.scissor),L=ct.scissorTest}else w.copy(k).multiplyScalar(G).floor(),P.copy(J).multiplyScalar(G).floor(),L=Q;if(mt.bindFramebuffer(et.FRAMEBUFFER,Dt)&&dt.drawBuffers&&zt&&mt.drawBuffers(ct,Dt),mt.viewport(w),mt.scissor(P),mt.setScissorTest(L),he){const Ae=At.get(ct.texture);et.framebufferTexture2D(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,et.TEXTURE_CUBE_MAP_POSITIVE_X+bt,Ae.__webglTexture,Bt)}else if(me){const Ae=At.get(ct.texture),ze=bt||0;et.framebufferTextureLayer(et.FRAMEBUFFER,et.COLOR_ATTACHMENT0,Ae.__webglTexture,Bt||0,ze)}A=-1},this.readRenderTargetPixels=function(ct,bt,Bt,zt,Dt,he,me){if(!(ct&&ct.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Re=At.get(ct).__webglFramebuffer;if(ct.isWebGLCubeRenderTarget&&me!==void 0&&(Re=Re[me]),Re){mt.bindFramebuffer(et.FRAMEBUFFER,Re);try{const Ae=ct.texture,ze=Ae.format,Ue=Ae.type;if(ze!==Er&&ie.convert(ze)!==et.getParameter(et.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const Ge=Ue===ff&&(ut.has("EXT_color_buffer_half_float")||dt.isWebGL2&&ut.has("EXT_color_buffer_float"));if(Ue!==Ta&&ie.convert(Ue)!==et.getParameter(et.IMPLEMENTATION_COLOR_READ_TYPE)&&!(Ue===Ps&&(dt.isWebGL2||ut.has("OES_texture_float")||ut.has("WEBGL_color_buffer_float")))&&!Ge){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}bt>=0&&bt<=ct.width-zt&&Bt>=0&&Bt<=ct.height-Dt&&et.readPixels(bt,Bt,zt,Dt,ie.convert(ze),ie.convert(Ue),he)}finally{const Ae=M!==null?At.get(M).__webglFramebuffer:null;mt.bindFramebuffer(et.FRAMEBUFFER,Ae)}}},this.copyFramebufferToTexture=function(ct,bt,Bt=0){const zt=Math.pow(2,-Bt),Dt=Math.floor(bt.image.width*zt),he=Math.floor(bt.image.height*zt);ot.setTexture2D(bt,0),et.copyTexSubImage2D(et.TEXTURE_2D,Bt,0,0,ct.x,ct.y,Dt,he),mt.unbindTexture()},this.copyTextureToTexture=function(ct,bt,Bt,zt=0){const Dt=bt.image.width,he=bt.image.height,me=ie.convert(Bt.format),Re=ie.convert(Bt.type);ot.setTexture2D(Bt,0),et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,Bt.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Bt.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,Bt.unpackAlignment),bt.isDataTexture?et.texSubImage2D(et.TEXTURE_2D,zt,ct.x,ct.y,Dt,he,me,Re,bt.image.data):bt.isCompressedTexture?et.compressedTexSubImage2D(et.TEXTURE_2D,zt,ct.x,ct.y,bt.mipmaps[0].width,bt.mipmaps[0].height,me,bt.mipmaps[0].data):et.texSubImage2D(et.TEXTURE_2D,zt,ct.x,ct.y,me,Re,bt.image),zt===0&&Bt.generateMipmaps&&et.generateMipmap(et.TEXTURE_2D),mt.unbindTexture()},this.copyTextureToTexture3D=function(ct,bt,Bt,zt,Dt=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const he=ct.max.x-ct.min.x+1,me=ct.max.y-ct.min.y+1,Re=ct.max.z-ct.min.z+1,Ae=ie.convert(zt.format),ze=ie.convert(zt.type);let Ue;if(zt.isData3DTexture)ot.setTexture3D(zt,0),Ue=et.TEXTURE_3D;else if(zt.isDataArrayTexture||zt.isCompressedArrayTexture)ot.setTexture2DArray(zt,0),Ue=et.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}et.pixelStorei(et.UNPACK_FLIP_Y_WEBGL,zt.flipY),et.pixelStorei(et.UNPACK_PREMULTIPLY_ALPHA_WEBGL,zt.premultiplyAlpha),et.pixelStorei(et.UNPACK_ALIGNMENT,zt.unpackAlignment);const Ge=et.getParameter(et.UNPACK_ROW_LENGTH),bi=et.getParameter(et.UNPACK_IMAGE_HEIGHT),dn=et.getParameter(et.UNPACK_SKIP_PIXELS),Ci=et.getParameter(et.UNPACK_SKIP_ROWS),pn=et.getParameter(et.UNPACK_SKIP_IMAGES),be=Bt.isCompressedTexture?Bt.mipmaps[Dt]:Bt.image;et.pixelStorei(et.UNPACK_ROW_LENGTH,be.width),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,be.height),et.pixelStorei(et.UNPACK_SKIP_PIXELS,ct.min.x),et.pixelStorei(et.UNPACK_SKIP_ROWS,ct.min.y),et.pixelStorei(et.UNPACK_SKIP_IMAGES,ct.min.z),Bt.isDataTexture||Bt.isData3DTexture?et.texSubImage3D(Ue,Dt,bt.x,bt.y,bt.z,he,me,Re,Ae,ze,be.data):Bt.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),et.compressedTexSubImage3D(Ue,Dt,bt.x,bt.y,bt.z,he,me,Re,Ae,be.data)):et.texSubImage3D(Ue,Dt,bt.x,bt.y,bt.z,he,me,Re,Ae,ze,be),et.pixelStorei(et.UNPACK_ROW_LENGTH,Ge),et.pixelStorei(et.UNPACK_IMAGE_HEIGHT,bi),et.pixelStorei(et.UNPACK_SKIP_PIXELS,dn),et.pixelStorei(et.UNPACK_SKIP_ROWS,Ci),et.pixelStorei(et.UNPACK_SKIP_IMAGES,pn),Dt===0&&zt.generateMipmaps&&et.generateMipmap(Ue),mt.unbindTexture()},this.initTexture=function(ct){ct.isCubeTexture?ot.setTextureCube(ct,0):ct.isData3DTexture?ot.setTexture3D(ct,0):ct.isDataArrayTexture||ct.isCompressedArrayTexture?ot.setTexture2DArray(ct,0):ot.setTexture2D(ct,0),mt.unbindTexture()},this.resetState=function(){m=0,S=0,M=null,mt.reset(),Ce.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return xa}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const i=this.getContext();i.drawingBufferColorSpace=e===qm?"display-p3":"srgb",i.unpackColorSpace=xi.workingColorSpace===Ad?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Ln?sl:l1}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===sl?Ln:Ma}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class SA extends x1{}SA.prototype.isWebGL1Renderer=!0;class ig{constructor(e,i=25e-5){this.isFogExp2=!0,this.name="",this.color=new fe(e),this.density=i}clone(){return new ig(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class ng{constructor(e,i=1,x=1e3){this.isFog=!0,this.name="",this.color=new fe(e),this.near=i,this.far=x}clone(){return new ng(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class dm extends vi{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,i){return super.copy(e,i),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const i=super.toJSON(e);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i}}class rg{constructor(e,i){this.isInterleavedBuffer=!0,this.array=e,this.stride=i,this.count=e!==void 0?e.length/i:0,this.usage=ld,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=as()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return Eh("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,i){this.updateRanges.push({start:e,count:i})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,i,x){e*=this.stride,x*=i.stride;for(let T=0,E=this.stride;Te.far||i.push({distance:t,point:Cc.clone(),uv:ss.getInterpolation(Cc,dv,wc,pv,aE,W0,oE,new jt),face:null,object:this})}copy(e,i){return super.copy(e,i),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function vv(g,e,i,x,T,E){Wu.subVectors(g,i).addScalar(.5).multiply(x),T!==void 0?(Ac.x=E*Wu.x-T*Wu.y,Ac.y=T*Wu.x+E*Wu.y):Ac.copy(Wu),g.copy(e),g.x+=Ac.x,g.y+=Ac.y,g.applyMatrix4(TA)}const mv=new pt,lE=new pt;class MA extends vi{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const i=e.levels;for(let x=0,T=i.length;x0){let x,T;for(x=1,T=i.length;x0){mv.setFromMatrixPosition(this.matrixWorld);const T=e.ray.origin.distanceTo(mv);this.getObjectForDistance(T).raycast(e,i)}}update(e){const i=this.levels;if(i.length>1){mv.setFromMatrixPosition(e.matrixWorld),lE.setFromMatrixPosition(this.matrixWorld);const x=mv.distanceTo(lE)/e.zoom;i[0].object.visible=!0;let T,E;for(T=1,E=i.length;T=a)i[T-1].object.visible=!1,i[T].object.visible=!0;else break}for(this._currentLevel=T-1;T=x.length&&x.push({start:-1,count:-1,z:-1});const E=x[this.index];T.push(E),this.index++,E.start=e.start,E.count=e.count,E.z=i}reset(){this.list.length=0,this.index=0}}const Yu="batchId",Qo=new Ve,gE=new Ve,j6=new Ve,yE=new Ve,k0=new Rd,xv=new Ar,ih=new hr,Lc=new pt,K0=new K6,ar=new En,Sv=[];function Z6(g,e,i=0){const x=e.itemSize;if(g.isInterleavedBufferAttribute||g.array.constructor!==e.array.constructor){const T=g.count;for(let E=0;E65536?new Uint32Array(E):new Uint16Array(E);i.setIndex(new Ti(y,1))}const a=T>65536?new Uint32Array(x):new Uint16Array(x);i.setAttribute(Yu,new Ti(a,1)),this._geometryInitialized=!0}}_validateGeometry(e){if(e.getAttribute(Yu))throw new Error(`BatchedMesh: Geometry cannot use attribute "${Yu}"`);const i=this.geometry;if(!!e.getIndex()!=!!i.getIndex())throw new Error('BatchedMesh: All geometries must consistently have "index".');for(const x in i.attributes){if(x===Yu)continue;if(!e.hasAttribute(x))throw new Error(`BatchedMesh: Added geometry missing "${x}". All geometries must have consistent attributes.`);const T=e.getAttribute(x),E=i.getAttribute(x);if(T.itemSize!==E.itemSize||T.normalized!==E.normalized)throw new Error("BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Ar);const e=this._geometryCount,i=this.boundingBox,x=this._active;i.makeEmpty();for(let T=0;T=this._maxGeometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");const T={vertexStart:-1,vertexCount:-1,indexStart:-1,indexCount:-1};let E=null;const a=this._reservedRanges,y=this._drawRanges,t=this._bounds;this._geometryCount!==0&&(E=a[a.length-1]),i===-1?T.vertexCount=e.getAttribute("position").count:T.vertexCount=i,E===null?T.vertexStart=0:T.vertexStart=E.vertexStart+E.vertexCount;const r=e.getIndex(),p=r!==null;if(p&&(x===-1?T.indexCount=r.count:T.indexCount=x,E===null?T.indexStart=0:T.indexStart=E.indexStart+E.indexCount),T.indexStart!==-1&&T.indexStart+T.indexCount>this._maxIndexCount||T.vertexStart+T.vertexCount>this._maxVertexCount)throw new Error("BatchedMesh: Reserved space request exceeds the maximum buffer size.");const h=this._visibility,o=this._active,l=this._matricesTexture,n=this._matricesTexture.image.data;h.push(!0),o.push(!0);const u=this._geometryCount;this._geometryCount++,j6.toArray(n,u*16),l.needsUpdate=!0,a.push(T),y.push({start:p?T.indexStart:T.vertexStart,count:-1}),t.push({boxInitialized:!1,box:new Ar,sphereInitialized:!1,sphere:new hr});const f=this.geometry.getAttribute(Yu);for(let s=0;s=this._geometryCount)throw new Error("BatchedMesh: Maximum geometry count reached.");this._validateGeometry(i);const x=this.geometry,T=x.getIndex()!==null,E=x.getIndex(),a=i.getIndex(),y=this._reservedRanges[e];if(T&&a.count>y.indexCount||i.attributes.position.count>y.vertexCount)throw new Error("BatchedMesh: Reserved space not large enough for provided geometry.");const t=y.vertexStart,r=y.vertexCount;for(const l in x.attributes){if(l===Yu)continue;const n=i.getAttribute(l),u=x.getAttribute(l);Z6(n,u,t);const f=n.itemSize;for(let s=n.count,c=r;s=i.length||i[e]===!1?this:(i[e]=!1,this._visibilityChanged=!0,this)}getBoundingBoxAt(e,i){if(this._active[e]===!1)return null;const T=this._bounds[e],E=T.box,a=this.geometry;if(T.boxInitialized===!1){E.makeEmpty();const y=a.index,t=a.attributes.position,r=this._drawRanges[e];for(let p=r.start,h=r.start+r.count;p=a||x[e]===!1?this:(i.toArray(E,e*16),T.needsUpdate=!0,this)}getMatrixAt(e,i){const x=this._active,T=this._matricesTexture.image.data,E=this._geometryCount;return e>=E||x[e]===!1?null:i.fromArray(T,e*16)}setVisibleAt(e,i){const x=this._visibility,T=this._active,E=this._geometryCount;return e>=E||T[e]===!1||x[e]===i?this:(x[e]=i,this._visibilityChanged=!0,this)}getVisibleAt(e){const i=this._visibility,x=this._active,T=this._geometryCount;return e>=T||x[e]===!1?!1:i[e]}raycast(e,i){const x=this._visibility,T=this._active,E=this._drawRanges,a=this._geometryCount,y=this.matrixWorld,t=this.geometry;ar.material=this.material,ar.geometry.index=t.index,ar.geometry.attributes=t.attributes,ar.geometry.boundingBox===null&&(ar.geometry.boundingBox=new Ar),ar.geometry.boundingSphere===null&&(ar.geometry.boundingSphere=new hr);for(let r=0;r({...i})),this._reservedRanges=e._reservedRanges.map(i=>({...i})),this._visibility=e._visibility.slice(),this._active=e._active.slice(),this._bounds=e._bounds.map(i=>({boxInitialized:i.boxInitialized,box:i.box.clone(),sphereInitialized:i.sphereInitialized,sphere:i.sphere.clone()})),this._maxGeometryCount=e._maxGeometryCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.slice(),this}dispose(){return this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this}onBeforeRender(e,i,x,T,E){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=T.getIndex(),y=a===null?1:a.array.BYTES_PER_ELEMENT,t=this._active,r=this._visibility,p=this._multiDrawStarts,h=this._multiDrawCounts,o=this._drawRanges,l=this.perObjectFrustumCulled;l&&(yE.multiplyMatrices(x.projectionMatrix,x.matrixWorldInverse).multiply(this.matrixWorld),k0.setFromProjectionMatrix(yE,e.coordinateSystem));let n=0;if(this.sortObjects){gE.copy(this.matrixWorld).invert(),Lc.setFromMatrixPosition(x.matrixWorld).applyMatrix4(gE);for(let s=0,c=r.length;st)continue;o.applyMatrix4(this.matrixWorld);const A=e.ray.origin.distanceTo(o);Ae.far||i.push({distance:A,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}else{const s=Math.max(0,a.start),c=Math.min(f.count,a.start+a.count);for(let d=s,v=c-1;dt)continue;o.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(o);Se.far||i.push({distance:S,point:h.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const i=this.geometry.morphAttributes,x=Object.keys(i);if(x.length>0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,a=T.length;E0){const T=i[x[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let E=0,a=T.length;ET.far)return;E.push({distance:r,distanceToRay:Math.sqrt(y),point:t,index:e,face:null,object:a})}}class J6 extends Zi{constructor(e,i,x,T,E,a,y,t,r){super(e,i,x,T,E,a,y,t,r),this.isVideoTexture=!0,this.minFilter=a!==void 0?a:Ki,this.magFilter=E!==void 0?E:Ki,this.generateMipmaps=!1;const p=this;function h(){p.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class $6 extends Zi{constructor(e,i){super({width:e,height:i}),this.isFramebufferTexture=!0,this.magFilter=cn,this.minFilter=cn,this.generateMipmaps=!1,this.needsUpdate=!0}}class ag extends Zi{constructor(e,i,x,T,E,a,y,t,r,p,h,o){super(null,a,y,t,r,p,T,E,h,o),this.isCompressedTexture=!0,this.image={width:i,height:x},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Q6 extends ag{constructor(e,i,x,T,E,a){super(e,i,x,E,a),this.isCompressedArrayTexture=!0,this.image.depth=T,this.wrapR=lr}}class _6 extends ag{constructor(e,i,x){super(void 0,e[0].width,e[0].height,i,x,oo),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class q6 extends Zi{constructor(e,i,x,T,E,a,y,t,r){super(e,i,x,T,E,a,y,t,r),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Qs{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,i){const x=this.getUtoTmapping(e);return this.getPoint(x,i)}getPoints(e=5){const i=[];for(let x=0;x<=e;x++)i.push(this.getPoint(x/e));return i}getSpacedPoints(e=5){const i=[];for(let x=0;x<=e;x++)i.push(this.getPointAt(x/e));return i}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const i=[];let x,T=this.getPoint(0),E=0;i.push(0);for(let a=1;a<=e;a++)x=this.getPoint(a/e),E+=x.distanceTo(T),i.push(E),T=x;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,i){const x=this.getLengths();let T=0;const E=x.length;let a;i?a=i:a=e*x[E-1];let y=0,t=E-1,r;for(;y<=t;)if(T=Math.floor(y+(t-y)/2),r=x[T]-a,r<0)y=T+1;else if(r>0)t=T-1;else{t=T;break}if(T=t,x[T]===a)return T/(E-1);const p=x[T],o=x[T+1]-p,l=(a-p)/o;return(T+l)/(E-1)}getTangent(e,i){let T=e-1e-4,E=e+1e-4;T<0&&(T=0),E>1&&(E=1);const a=this.getPoint(T),y=this.getPoint(E),t=i||(a.isVector2?new jt:new pt);return t.copy(y).sub(a).normalize(),t}getTangentAt(e,i){const x=this.getUtoTmapping(e);return this.getTangent(x,i)}computeFrenetFrames(e,i){const x=new pt,T=[],E=[],a=[],y=new pt,t=new Ve;for(let l=0;l<=e;l++){const n=l/e;T[l]=this.getTangentAt(n,new pt)}E[0]=new pt,a[0]=new pt;let r=Number.MAX_VALUE;const p=Math.abs(T[0].x),h=Math.abs(T[0].y),o=Math.abs(T[0].z);p<=r&&(r=p,x.set(1,0,0)),h<=r&&(r=h,x.set(0,1,0)),o<=r&&x.set(0,0,1),y.crossVectors(T[0],x).normalize(),E[0].crossVectors(T[0],y),a[0].crossVectors(T[0],E[0]);for(let l=1;l<=e;l++){if(E[l]=E[l-1].clone(),a[l]=a[l-1].clone(),y.crossVectors(T[l-1],T[l]),y.length()>Number.EPSILON){y.normalize();const n=Math.acos(nn(T[l-1].dot(T[l]),-1,1));E[l].applyMatrix4(t.makeRotationAxis(y,n))}a[l].crossVectors(T[l],E[l])}if(i===!0){let l=Math.acos(nn(E[0].dot(E[e]),-1,1));l/=e,T[0].dot(y.crossVectors(E[0],E[e]))>0&&(l=-l);for(let n=1;n<=e;n++)E[n].applyMatrix4(t.makeRotationAxis(T[n],l*n)),a[n].crossVectors(T[n],E[n])}return{tangents:T,normals:E,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class og extends Qs{constructor(e=0,i=0,x=1,T=1,E=0,a=Math.PI*2,y=!1,t=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=i,this.xRadius=x,this.yRadius=T,this.aStartAngle=E,this.aEndAngle=a,this.aClockwise=y,this.aRotation=t}getPoint(e,i){const x=i||new jt,T=Math.PI*2;let E=this.aEndAngle-this.aStartAngle;const a=Math.abs(E)T;)E-=T;E0?0:(Math.floor(Math.abs(y)/E)+1)*E:t===0&&y===E-1&&(y=E-2,t=1);let r,p;this.closed||y>0?r=T[(y-1)%E]:(Cv.subVectors(T[0],T[1]).add(T[0]),r=Cv);const h=T[y%E],o=T[(y+1)%E];if(this.closed||y+2T.length-2?T.length-1:a+1],h=T[a>T.length-3?T.length-1:a+2];return x.set(wE(y,t.x,r.x,p.x,h.x),wE(y,t.y,r.y,p.y,h.y)),x}copy(e){super.copy(e),this.points=[];for(let i=0,x=e.points.length;i=x){const a=T[E]-x,y=this.curves[E],t=y.getLength(),r=t===0?0:1-a/t;return y.getPointAt(r,i)}E++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let i=0;for(let x=0,T=this.curves.length;x1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(e){super.copy(e),this.curves=[];for(let i=0,x=e.curves.length;i0){const h=r.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(r);const p=r.getPoint(1);return this.currentPoint.copy(p),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class bd extends ei{constructor(e=[new jt(0,-.5),new jt(.5,0),new jt(0,.5)],i=12,x=0,T=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:i,phiStart:x,phiLength:T},i=Math.floor(i),T=nn(T,0,Math.PI*2);const E=[],a=[],y=[],t=[],r=[],p=1/i,h=new pt,o=new jt,l=new pt,n=new pt,u=new pt;let f=0,s=0;for(let c=0;c<=e.length-1;c++)switch(c){case 0:f=e[c+1].x-e[c].x,s=e[c+1].y-e[c].y,l.x=s*1,l.y=-f,l.z=s*0,u.copy(l),l.normalize(),t.push(l.x,l.y,l.z);break;case e.length-1:t.push(u.x,u.y,u.z);break;default:f=e[c+1].x-e[c].x,s=e[c+1].y-e[c].y,l.x=s*1,l.y=-f,l.z=s*0,n.copy(l),l.x+=u.x,l.y+=u.y,l.z+=u.z,l.normalize(),t.push(l.x,l.y,l.z),u.copy(n)}for(let c=0;c<=i;c++){const d=x+c*p*T,v=Math.sin(d),m=Math.cos(d);for(let S=0;S<=e.length-1;S++){h.x=e[S].x*v,h.y=e[S].y,h.z=e[S].x*m,a.push(h.x,h.y,h.z),o.x=c/i,o.y=S/(e.length-1),y.push(o.x,o.y);const M=t[3*S+0]*v,A=t[3*S+1],C=t[3*S+0]*m;r.push(M,A,C)}}for(let c=0;c0&&d(!0),i>0&&d(!1)),this.setIndex(p),this.setAttribute("position",new xe(h,3)),this.setAttribute("normal",new xe(o,3)),this.setAttribute("uv",new xe(l,2));function c(){const v=new pt,m=new pt;let S=0;const M=(i-e)/x;for(let A=0;A<=E;A++){const C=[],w=A/E,P=w*(i-e)+e;for(let L=0;L<=T;L++){const O=L/T,I=O*t+y,D=Math.sin(I),B=Math.cos(I);m.x=P*D,m.y=-w*x+f,m.z=P*B,h.push(m.x,m.y,m.z),v.set(D,M,B).normalize(),o.push(v.x,v.y,v.z),l.push(O,1-w),C.push(n++)}u.push(C)}for(let A=0;A.9&&M<.1&&(d<.2&&(a[c+0]+=1),v<.2&&(a[c+2]+=1),m<.2&&(a[c+4]+=1))}}function o(c){E.push(c.x,c.y,c.z)}function l(c,d){const v=c*3;d.x=e[v+0],d.y=e[v+1],d.z=e[v+2]}function n(){const c=new pt,d=new pt,v=new pt,m=new pt,S=new jt,M=new jt,A=new jt;for(let C=0,w=0;C80*i){y=r=g[0],t=p=g[1];for(let n=i;nr&&(r=h),o>p&&(p=o);l=Math.max(r-y,p-t),l=l!==0?32767/l:0}return cd(E,a,i,y,t,l,0),a}};function NA(g,e,i,x,T){let E,a;if(T===MU(g,e,i,x)>0)for(E=e;E=e;E-=x)a=PE(E,g[E],g[E+1],a);return a&&cg(a,a.next)&&(pd(a),a=a.next),a}function Fh(g,e){if(!g)return g;e||(e=g);let i=g,x;do if(x=!1,!i.steiner&&(cg(i,i.next)||ji(i.prev,i,i.next)===0)){if(pd(i),i=e=i.prev,i===i.next)break;x=!0}else i=i.next;while(x||i!==e);return e}function cd(g,e,i,x,T,E,a){if(!g)return;!a&&E&&gU(g,x,T,E);let y=g,t,r;for(;g.prev!==g.next;){if(t=g.prev,r=g.next,E?hU(g,x,T,E):lU(g)){e.push(t.i/i|0),e.push(g.i/i|0),e.push(r.i/i|0),pd(g),g=r.next,y=r.next;continue}if(g=r,g===y){a?a===1?(g=uU(Fh(g),e,i),cd(g,e,i,x,T,E,2)):a===2&&fU(g,e,i,x,T,E):cd(Fh(g),e,i,x,T,E,1);break}}}function lU(g){const e=g.prev,i=g,x=g.next;if(ji(e,i,x)>=0)return!1;const T=e.x,E=i.x,a=x.x,y=e.y,t=i.y,r=x.y,p=TE?T>a?T:a:E>a?E:a,l=y>t?y>r?y:r:t>r?t:r;let n=x.next;for(;n!==e;){if(n.x>=p&&n.x<=o&&n.y>=h&&n.y<=l&&nf(T,y,E,t,a,r,n.x,n.y)&&ji(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function hU(g,e,i,x){const T=g.prev,E=g,a=g.next;if(ji(T,E,a)>=0)return!1;const y=T.x,t=E.x,r=a.x,p=T.y,h=E.y,o=a.y,l=yt?y>r?y:r:t>r?t:r,f=p>h?p>o?p:o:h>o?h:o,s=mx(l,n,e,i,x),c=mx(u,f,e,i,x);let d=g.prevZ,v=g.nextZ;for(;d&&d.z>=s&&v&&v.z<=c;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==a&&nf(y,p,t,h,r,o,d.x,d.y)&&ji(d.prev,d,d.next)>=0||(d=d.prevZ,v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==a&&nf(y,p,t,h,r,o,v.x,v.y)&&ji(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;d&&d.z>=s;){if(d.x>=l&&d.x<=u&&d.y>=n&&d.y<=f&&d!==T&&d!==a&&nf(y,p,t,h,r,o,d.x,d.y)&&ji(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;v&&v.z<=c;){if(v.x>=l&&v.x<=u&&v.y>=n&&v.y<=f&&v!==T&&v!==a&&nf(y,p,t,h,r,o,v.x,v.y)&&ji(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function uU(g,e,i){let x=g;do{const T=x.prev,E=x.next.next;!cg(T,E)&&BA(T,x,x.next,E)&&dd(T,E)&&dd(E,T)&&(e.push(T.i/i|0),e.push(x.i/i|0),e.push(E.i/i|0),pd(x),pd(x.next),x=g=E),x=x.next}while(x!==g);return Fh(x)}function fU(g,e,i,x,T,E){let a=g;do{let y=a.next.next;for(;y!==a.prev;){if(a.i!==y.i&&SU(a,y)){let t=UA(a,y);a=Fh(a,a.next),t=Fh(t,t.next),cd(a,e,i,x,T,E,0),cd(t,e,i,x,T,E,0);return}y=y.next}a=a.next}while(a!==g)}function cU(g,e,i,x){const T=[];let E,a,y,t,r;for(E=0,a=e.length;E=i.next.y&&i.next.y!==i.y){const o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=E&&o>x&&(x=o,T=i.x=i.x&&i.x>=t&&E!==i.x&&nf(aT.x||i.x===T.x&&mU(T,i)))&&(T=i,p=h)),i=i.next;while(i!==y);return T}function mU(g,e){return ji(g.prev,g,e.prev)<0&&ji(e.next,g,g.next)<0}function gU(g,e,i,x){let T=g;do T.z===0&&(T.z=mx(T.x,T.y,e,i,x)),T.prevZ=T.prev,T.nextZ=T.next,T=T.next;while(T!==g);T.prevZ.nextZ=null,T.prevZ=null,yU(T)}function yU(g){let e,i,x,T,E,a,y,t,r=1;do{for(i=g,g=null,E=null,a=0;i;){for(a++,x=i,y=0,e=0;e0||t>0&&x;)y!==0&&(t===0||!x||i.z<=x.z)?(T=i,i=i.nextZ,y--):(T=x,x=x.nextZ,t--),E?E.nextZ=T:g=T,T.prevZ=E,E=T;i=x}E.nextZ=null,r*=2}while(a>1);return g}function mx(g,e,i,x,T){return g=(g-i)*T|0,e=(e-x)*T|0,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,g|e<<1}function xU(g){let e=g,i=g;do(e.x=(g-a)*(E-y)&&(g-a)*(x-y)>=(i-a)*(e-y)&&(i-a)*(E-y)>=(T-a)*(x-y)}function SU(g,e){return g.next.i!==e.i&&g.prev.i!==e.i&&!TU(g,e)&&(dd(g,e)&&dd(e,g)&&EU(g,e)&&(ji(g.prev,g,e.prev)||ji(g,e.prev,e))||cg(g,e)&&ji(g.prev,g,g.next)>0&&ji(e.prev,e,e.next)>0)}function ji(g,e,i){return(e.y-g.y)*(i.x-e.x)-(e.x-g.x)*(i.y-e.y)}function cg(g,e){return g.x===e.x&&g.y===e.y}function BA(g,e,i,x){const T=Lv(ji(g,e,i)),E=Lv(ji(g,e,x)),a=Lv(ji(i,x,g)),y=Lv(ji(i,x,e));return!!(T!==E&&a!==y||T===0&&Rv(g,i,e)||E===0&&Rv(g,x,e)||a===0&&Rv(i,g,x)||y===0&&Rv(i,e,x))}function Rv(g,e,i){return e.x<=Math.max(g.x,i.x)&&e.x>=Math.min(g.x,i.x)&&e.y<=Math.max(g.y,i.y)&&e.y>=Math.min(g.y,i.y)}function Lv(g){return g>0?1:g<0?-1:0}function TU(g,e){let i=g;do{if(i.i!==g.i&&i.next.i!==g.i&&i.i!==e.i&&i.next.i!==e.i&&BA(i,i.next,g,e))return!0;i=i.next}while(i!==g);return!1}function dd(g,e){return ji(g.prev,g,g.next)<0?ji(g,e,g.next)>=0&&ji(g,g.prev,e)>=0:ji(g,e,g.prev)<0||ji(g,g.next,e)<0}function EU(g,e){let i=g,x=!1;const T=(g.x+e.x)/2,E=(g.y+e.y)/2;do i.y>E!=i.next.y>E&&i.next.y!==i.y&&T<(i.next.x-i.x)*(E-i.y)/(i.next.y-i.y)+i.x&&(x=!x),i=i.next;while(i!==g);return x}function UA(g,e){const i=new gx(g.i,g.x,g.y),x=new gx(e.i,e.x,e.y),T=g.next,E=e.prev;return g.next=e,e.prev=g,i.next=T,T.prev=i,x.next=i,i.prev=x,E.next=x,x.prev=E,x}function PE(g,e,i,x){const T=new gx(g,e,i);return x?(T.next=x.next,T.prev=x,x.next.prev=T,x.next=T):(T.prev=T,T.next=T),T}function pd(g){g.next.prev=g.prev,g.prev.next=g.next,g.prevZ&&(g.prevZ.nextZ=g.nextZ),g.nextZ&&(g.nextZ.prevZ=g.prevZ)}function gx(g,e,i){this.i=g,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function MU(g,e,i,x){let T=0;for(let E=e,a=i-x;E2&&g[e-1].equals(g[0])&&g.pop()}function LE(g,e){for(let i=0;iNumber.EPSILON){const Et=Math.sqrt(Tt),Gt=Math.sqrt(st*st+yt*yt),Wt=ht.x-ot/Et,Jt=ht.y+At/Et,$t=ut.x-yt/Gt,ee=ut.y+st/Gt,Nt=(($t-Wt)*yt-(ee-Jt)*st)/(At*yt-ot*st);dt=Wt+At*Nt-et.x,mt=Jt+ot*Nt-et.y;const Te=dt*dt+mt*mt;if(Te<=2)return new jt(dt,mt);gt=Math.sqrt(Te/2)}else{let Et=!1;At>Number.EPSILON?st>Number.EPSILON&&(Et=!0):At<-Number.EPSILON?st<-Number.EPSILON&&(Et=!0):Math.sign(ot)===Math.sign(yt)&&(Et=!0),Et?(dt=-ot,mt=At,gt=Math.sqrt(Tt)):(dt=At,mt=ot,gt=Math.sqrt(Tt/2))}return new jt(dt/gt,mt/gt)}const W=[];for(let et=0,ht=I.length,ut=ht-1,dt=et+1;et=0;et--){const ht=et/f,ut=l*Math.cos(ht*Math.PI/2),dt=n*Math.sin(ht*Math.PI/2)+u;for(let mt=0,gt=I.length;mt=0;){const dt=ut;let mt=ut-1;mt<0&&(mt=et.length-1);for(let gt=0,At=p+f*2;gt0)&&l.push(d,v,S),(s!==x-1||t0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class WA extends _n{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new fe(16777215),this.specular=new fe(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Cd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class XA extends _n{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new fe(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class YA extends _n{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class kA extends _n{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new fe(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new fe(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Cd,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class KA extends _n{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new fe(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=fl,this.normalScale=new jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class jA extends wr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function xh(g,e,i){return!g||!i&&g.constructor===e?g:typeof e.BYTES_PER_ELEMENT=="number"?new e(g):Array.prototype.slice.call(g)}function ZA(g){return ArrayBuffer.isView(g)&&!(g instanceof DataView)}function JA(g){function e(T,E){return g[T]-g[E]}const i=g.length,x=new Array(i);for(let T=0;T!==i;++T)x[T]=T;return x.sort(e),x}function yx(g,e,i){const x=g.length,T=new g.constructor(x);for(let E=0,a=0;a!==x;++E){const y=i[E]*e;for(let t=0;t!==e;++t)T[a++]=g[y+t]}return T}function L1(g,e,i,x){let T=1,E=g[0];for(;E!==void 0&&E[x]===void 0;)E=g[T++];if(E===void 0)return;let a=E[x];if(a!==void 0)if(Array.isArray(a))do a=E[x],a!==void 0&&(e.push(E.time),i.push.apply(i,a)),E=g[T++];while(E!==void 0);else if(a.toArray!==void 0)do a=E[x],a!==void 0&&(e.push(E.time),a.toArray(i,i.length)),E=g[T++];while(E!==void 0);else do a=E[x],a!==void 0&&(e.push(E.time),i.push(a)),E=g[T++];while(E!==void 0)}function PU(g,e,i,x,T=30){const E=g.clone();E.name=e;const a=[];for(let t=0;t=x)){h.push(r.times[l]);for(let u=0;uE.tracks[t].times[0]&&(y=E.tracks[t].times[0]);for(let t=0;t=y.times[n]){const s=n*h+p,c=s+h-p;u=y.values.slice(s,c)}else{const s=y.createInterpolant(),c=p,d=h-p;s.evaluate(E),u=s.resultBuffer.slice(c,d)}t==="quaternion"&&new Ur().fromArray(u).normalize().conjugate().toArray(u);const f=r.times.length;for(let s=0;s=E)){const y=i[1];e=E)break e}a=x,x=0;break i}break t}for(;x>>1;ei;)--a;if(++a,E!==0||a!==T){E>=a&&(a=Math.max(a,1),E=a-1);const y=this.getValueSize();this.times=x.slice(E,a),this.values=this.values.slice(E*y,a*y)}return this}validate(){let e=!0;const i=this.getValueSize();i-Math.floor(i)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const x=this.times,T=this.values,E=x.length;E===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let y=0;y!==E;y++){const t=x[y];if(typeof t=="number"&&isNaN(t)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,y,t),e=!1;break}if(a!==null&&a>t){console.error("THREE.KeyframeTrack: Out of order keys.",this,y,t,a),e=!1;break}a=t}if(T!==void 0&&ZA(T))for(let y=0,t=T.length;y!==t;++y){const r=T[y];if(isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,y,r),e=!1;break}}return e}optimize(){const e=this.times.slice(),i=this.values.slice(),x=this.getValueSize(),T=this.getInterpolation()===Qv,E=e.length-1;let a=1;for(let y=1;y0){e[a]=e[E];for(let y=E*x,t=a*x,r=0;r!==x;++r)i[t+r]=i[y+r];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=i.slice(0,a*x)):(this.times=e,this.values=i),this}clone(){const e=this.times.slice(),i=this.values.slice(),x=this.constructor,T=new x(this.name,e,i);return T.createInterpolant=this.createInterpolant,T}}_s.prototype.TimeBufferType=Float32Array;_s.prototype.ValueBufferType=Float32Array;_s.prototype.DefaultInterpolation=nd;class Nh extends _s{}Nh.prototype.ValueTypeName="bool";Nh.prototype.ValueBufferType=Array;Nh.prototype.DefaultInterpolation=id;Nh.prototype.InterpolantFactoryMethodLinear=void 0;Nh.prototype.InterpolantFactoryMethodSmooth=void 0;class F1 extends _s{}F1.prototype.ValueTypeName="color";class vd extends _s{}vd.prototype.ValueTypeName="number";class _A extends Dd{constructor(e,i,x,T){super(e,i,x,T)}interpolate_(e,i,x,T){const E=this.resultBuffer,a=this.sampleValues,y=this.valueSize,t=(x-i)/(T-i);let r=e*y;for(let p=r+y;r!==p;r+=4)Ur.slerpFlat(E,0,a,r-y,a,r,t);return E}}class Mf extends _s{InterpolantFactoryMethodLinear(e){return new _A(this.times,this.values,this.getValueSize(),e)}}Mf.prototype.ValueTypeName="quaternion";Mf.prototype.DefaultInterpolation=nd;Mf.prototype.InterpolantFactoryMethodSmooth=void 0;class Bh extends _s{}Bh.prototype.ValueTypeName="string";Bh.prototype.ValueBufferType=Array;Bh.prototype.DefaultInterpolation=id;Bh.prototype.InterpolantFactoryMethodLinear=void 0;Bh.prototype.InterpolantFactoryMethodSmooth=void 0;class md extends _s{}md.prototype.ValueTypeName="vector";class gd{constructor(e,i=-1,x,T=_m){this.name=e,this.tracks=x,this.duration=i,this.blendMode=T,this.uuid=as(),this.duration<0&&this.resetDuration()}static parse(e){const i=[],x=e.tracks,T=1/(e.fps||1);for(let a=0,y=x.length;a!==y;++a)i.push(FU(x[a]).scale(T));const E=new this(e.name,e.duration,i,e.blendMode);return E.uuid=e.uuid,E}static toJSON(e){const i=[],x=e.tracks,T={name:e.name,duration:e.duration,tracks:i,uuid:e.uuid,blendMode:e.blendMode};for(let E=0,a=x.length;E!==a;++E)i.push(_s.toJSON(x[E]));return T}static CreateFromMorphTargetSequence(e,i,x,T){const E=i.length,a=[];for(let y=0;y1){const h=p[1];let o=T[h];o||(T[h]=o=[]),o.push(r)}}const a=[];for(const y in T)a.push(this.CreateFromMorphTargetSequence(y,T[y],i,x));return a}static parseAnimation(e,i){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const x=function(h,o,l,n,u){if(l.length!==0){const f=[],s=[];L1(l,f,s,n),f.length!==0&&u.push(new h(o,f,s))}},T=[],E=e.name||"default",a=e.fps||30,y=e.blendMode;let t=e.length||-1;const r=e.hierarchy||[];for(let h=0;h{i&&i(E),this.manager.itemEnd(e)},0),E;if($a[e]!==void 0){$a[e].push({onLoad:i,onProgress:x,onError:T});return}$a[e]=[],$a[e].push({onLoad:i,onProgress:x,onError:T});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),y=this.mimeType,t=this.responseType;fetch(a).then(r=>{if(r.status===200||r.status===0){if(r.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||r.body===void 0||r.body.getReader===void 0)return r;const p=$a[e],h=r.body.getReader(),o=r.headers.get("Content-Length")||r.headers.get("X-File-Size"),l=o?parseInt(o):0,n=l!==0;let u=0;const f=new ReadableStream({start(s){c();function c(){h.read().then(({done:d,value:v})=>{if(d)s.close();else{u+=v.byteLength;const m=new ProgressEvent("progress",{lengthComputable:n,loaded:u,total:l});for(let S=0,M=p.length;S{switch(t){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"document":return r.text().then(p=>new DOMParser().parseFromString(p,y));case"json":return r.json();default:if(y===void 0)return r.text();{const h=/charset="?([^;"\s]*)"?/i.exec(y),o=h&&h[1]?h[1].toLowerCase():void 0,l=new TextDecoder(o);return r.arrayBuffer().then(n=>l.decode(n))}}}).then(r=>{io.add(e,r);const p=$a[e];delete $a[e];for(let h=0,o=p.length;h{const p=$a[e];if(p===void 0)throw this.manager.itemError(e),r;delete $a[e];for(let h=0,o=p.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class DU extends Gr{constructor(e){super(e)}load(e,i,x,T){const E=this,a=new lo(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(y){try{i(E.parse(JSON.parse(y)))}catch(t){T?T(t):console.error(t),E.manager.itemError(e)}},x,T)}parse(e){const i=[];for(let x=0;x0:T.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const E in e.uniforms){const a=e.uniforms[E];switch(T.uniforms[E]={},a.type){case"t":T.uniforms[E].value=x(a.value);break;case"c":T.uniforms[E].value=new fe().setHex(a.value);break;case"v2":T.uniforms[E].value=new jt().fromArray(a.value);break;case"v3":T.uniforms[E].value=new pt().fromArray(a.value);break;case"v4":T.uniforms[E].value=new Si().fromArray(a.value);break;case"m3":T.uniforms[E].value=new ni().fromArray(a.value);break;case"m4":T.uniforms[E].value=new Ve().fromArray(a.value);break;default:T.uniforms[E].value=a.value}}if(e.defines!==void 0&&(T.defines=e.defines),e.vertexShader!==void 0&&(T.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(T.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(T.glslVersion=e.glslVersion),e.extensions!==void 0)for(const E in e.extensions)T.extensions[E]=e.extensions[E];if(e.lights!==void 0&&(T.lights=e.lights),e.clipping!==void 0&&(T.clipping=e.clipping),e.size!==void 0&&(T.size=e.size),e.sizeAttenuation!==void 0&&(T.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(T.map=x(e.map)),e.matcap!==void 0&&(T.matcap=x(e.matcap)),e.alphaMap!==void 0&&(T.alphaMap=x(e.alphaMap)),e.bumpMap!==void 0&&(T.bumpMap=x(e.bumpMap)),e.bumpScale!==void 0&&(T.bumpScale=e.bumpScale),e.normalMap!==void 0&&(T.normalMap=x(e.normalMap)),e.normalMapType!==void 0&&(T.normalMapType=e.normalMapType),e.normalScale!==void 0){let E=e.normalScale;Array.isArray(E)===!1&&(E=[E,E]),T.normalScale=new jt().fromArray(E)}return e.displacementMap!==void 0&&(T.displacementMap=x(e.displacementMap)),e.displacementScale!==void 0&&(T.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(T.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(T.roughnessMap=x(e.roughnessMap)),e.metalnessMap!==void 0&&(T.metalnessMap=x(e.metalnessMap)),e.emissiveMap!==void 0&&(T.emissiveMap=x(e.emissiveMap)),e.emissiveIntensity!==void 0&&(T.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(T.specularMap=x(e.specularMap)),e.specularIntensityMap!==void 0&&(T.specularIntensityMap=x(e.specularIntensityMap)),e.specularColorMap!==void 0&&(T.specularColorMap=x(e.specularColorMap)),e.envMap!==void 0&&(T.envMap=x(e.envMap)),e.envMapIntensity!==void 0&&(T.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(T.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(T.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(T.lightMap=x(e.lightMap)),e.lightMapIntensity!==void 0&&(T.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(T.aoMap=x(e.aoMap)),e.aoMapIntensity!==void 0&&(T.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(T.gradientMap=x(e.gradientMap)),e.clearcoatMap!==void 0&&(T.clearcoatMap=x(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(T.clearcoatRoughnessMap=x(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(T.clearcoatNormalMap=x(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(T.clearcoatNormalScale=new jt().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(T.iridescenceMap=x(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(T.iridescenceThicknessMap=x(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(T.transmissionMap=x(e.transmissionMap)),e.thicknessMap!==void 0&&(T.thicknessMap=x(e.thicknessMap)),e.anisotropyMap!==void 0&&(T.anisotropyMap=x(e.anisotropyMap)),e.sheenColorMap!==void 0&&(T.sheenColorMap=x(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(T.sheenRoughnessMap=x(e.sheenRoughnessMap)),T}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const i={ShadowMaterial:GA,SpriteMaterial:S1,RawShaderMaterial:VA,ShaderMaterial:$s,PointsMaterial:E1,MeshPhysicalMaterial:HA,MeshStandardMaterial:Qa,MeshPhongMaterial:WA,MeshToonMaterial:XA,MeshNormalMaterial:YA,MeshLambertMaterial:kA,MeshDepthMaterial:g1,MeshDistanceMaterial:y1,MeshBasicMaterial:cl,MeshMatcapMaterial:KA,LineDashedMaterial:jA,LineBasicMaterial:wr,Material:_n};return new i[e]}}class xx{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let i="";for(let x=0,T=e.length;x0){const t=new O1(i);E=new yd(t),E.setCrossOrigin(this.crossOrigin);for(let r=0,p=e.length;r0){T=new yd(this.manager),T.setCrossOrigin(this.crossOrigin);for(let a=0,y=e.length;a{const f=new Ar;f.min.fromArray(u.boxMin),f.max.fromArray(u.boxMax);const s=new hr;return s.radius=u.sphereRadius,s.center.fromArray(u.sphereCenter),{boxInitialized:u.boxInitialized,box:f,sphereInitialized:u.sphereInitialized,sphere:s}}),a._maxGeometryCount=e.maxGeometryCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._geometryCount=e.geometryCount,a._matricesTexture=r(e.matricesTexture.uuid);break;case"LOD":a=new MA;break;case"Line":a=new hl(y(e.geometry),t(e.material));break;case"LineLoop":a=new PA(y(e.geometry),t(e.material));break;case"LineSegments":a=new Aa(y(e.geometry),t(e.material));break;case"PointCloud":case"Points":a=new RA(y(e.geometry),t(e.material));break;case"Sprite":a=new EA(t(e.material));break;case"Group":a=new ef;break;case"Bone":a=new T1;break;default:a=new vi}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix!==void 0?(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){const o=e.children;for(let l=0;l"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,i,x,T){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const E=this,a=io.get(e);if(a!==void 0){if(E.manager.itemStart(e),a.then){a.then(r=>{i&&i(r),E.manager.itemEnd(e)}).catch(r=>{T&&T(r)});return}return setTimeout(function(){i&&i(a),E.manager.itemEnd(e)},0),a}const y={};y.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",y.headers=this.requestHeader;const t=fetch(e,y).then(function(r){return r.blob()}).then(function(r){return createImageBitmap(r,Object.assign(E.options,{colorSpaceConversion:"none"}))}).then(function(r){return io.add(e,r),i&&i(r),E.manager.itemEnd(e),r}).catch(function(r){T&&T(r),io.remove(e),E.manager.itemError(e),E.manager.itemEnd(e)});io.add(e,t),E.manager.itemStart(e)}}let bv,I1=class{static getContext(){return bv===void 0&&(bv=new(window.AudioContext||window.webkitAudioContext)),bv}static setContext(e){bv=e}};class XU extends Gr{constructor(e){super(e)}load(e,i,x,T){const E=this,a=new lo(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(t){try{const r=t.slice(0);I1.getContext().decodeAudioData(r,function(h){i(h)}).catch(y)}catch(r){y(r)}},x,T);function y(t){T?T(t):console.error(t),E.manager.itemError(e)}}}const UE=new Ve,zE=new Ve,nh=new Ve;class YU{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Yn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Yn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const i=this._cache;if(i.focus!==e.focus||i.fov!==e.fov||i.aspect!==e.aspect*this.aspect||i.near!==e.near||i.far!==e.far||i.zoom!==e.zoom||i.eyeSep!==this.eyeSep){i.focus=e.focus,i.fov=e.fov,i.aspect=e.aspect*this.aspect,i.near=e.near,i.far=e.far,i.zoom=e.zoom,i.eyeSep=this.eyeSep,nh.copy(e.projectionMatrix);const T=i.eyeSep/2,E=T*i.near/i.focus,a=i.near*Math.tan(Th*i.fov*.5)/i.zoom;let y,t;zE.elements[12]=-T,UE.elements[12]=T,y=-a*i.aspect+E,t=a*i.aspect+E,nh.elements[0]=2*i.near/(t-y),nh.elements[8]=(t+y)/(t-y),this.cameraL.projectionMatrix.copy(nh),y=-a*i.aspect-E,t=a*i.aspect-E,nh.elements[0]=2*i.near/(t-y),nh.elements[8]=(t+y)/(t-y),this.cameraR.projectionMatrix.copy(nh)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(zE),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(UE)}}class N1{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=GE(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const i=GE();e=(i-this.oldTime)/1e3,this.oldTime=i,this.elapsedTime+=e}return e}}function GE(){return(typeof performance>"u"?Date:performance).now()}const rh=new pt,VE=new Ur,kU=new pt,sh=new pt;class KU extends vi{constructor(){super(),this.type="AudioListener",this.context=I1.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new N1}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const i=this.context.listener,x=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(rh,VE,kU),sh.set(0,0,-1).applyQuaternion(VE),i.positionX){const T=this.context.currentTime+this.timeDelta;i.positionX.linearRampToValueAtTime(rh.x,T),i.positionY.linearRampToValueAtTime(rh.y,T),i.positionZ.linearRampToValueAtTime(rh.z,T),i.forwardX.linearRampToValueAtTime(sh.x,T),i.forwardY.linearRampToValueAtTime(sh.y,T),i.forwardZ.linearRampToValueAtTime(sh.z,T),i.upX.linearRampToValueAtTime(x.x,T),i.upY.linearRampToValueAtTime(x.y,T),i.upZ.linearRampToValueAtTime(x.z,T)}else i.setPosition(rh.x,rh.y,rh.z),i.setOrientation(sh.x,sh.y,sh.z,x.x,x.y,x.z)}}let fw=class extends vi{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const i=this.context.createBufferSource();return i.buffer=this.buffer,i.loop=this.loop,i.loopStart=this.loopStart,i.loopEnd=this.loopEnd,i.onended=this.onEnded.bind(this),i.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=i,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,i=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,i=this.filters.length;e0&&this._mixBufferRegionAdditive(x,T,this._addIndex*i,1,i);for(let t=i,r=i+i;t!==r;++t)if(x[t]!==x[t+i]){y.setValue(x,T);break}}saveOriginalState(){const e=this.binding,i=this.buffer,x=this.valueSize,T=x*this._origIndex;e.getValue(i,T);for(let E=x,a=T;E!==a;++E)i[E]=i[T+E%x];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,i=e+this.valueSize;for(let x=e;x=.5)for(let a=0;a!==E;++a)e[i+a]=e[x+a]}_slerp(e,i,x,T){Ur.slerpFlat(e,i,e,i,e,x,T)}_slerpAdditive(e,i,x,T,E){const a=this._workIndex*E;Ur.multiplyQuaternionsFlat(e,a,e,i,e,x),Ur.slerpFlat(e,i,e,i,e,a,T)}_lerp(e,i,x,T,E){const a=1-T;for(let y=0;y!==E;++y){const t=i+y;e[t]=e[t]*a+e[x+y]*T}}_lerpAdditive(e,i,x,T,E){for(let a=0;a!==E;++a){const y=i+a;e[y]=e[y]+e[x+a]*T}}}const B1="\\[\\]\\.:\\/",$U=new RegExp("["+B1+"]","g"),U1="[^"+B1+"]",QU="[^"+B1.replace("\\.","")+"]",_U=/((?:WC+[\/:])*)/.source.replace("WC",U1),qU=/(WCOD+)?/.source.replace("WCOD",QU),t7=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",U1),e7=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",U1),i7=new RegExp("^"+_U+qU+t7+e7+"$"),n7=["material","materials","bones","map"];class r7{constructor(e,i,x){const T=x||di.parseTrackName(i);this._targetGroup=e,this._bindings=e.subscribe_(i,T)}getValue(e,i){this.bind();const x=this._targetGroup.nCachedObjects_,T=this._bindings[x];T!==void 0&&T.getValue(e,i)}setValue(e,i){const x=this._bindings;for(let T=this._targetGroup.nCachedObjects_,E=x.length;T!==E;++T)x[T].setValue(e,i)}bind(){const e=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=e.length;i!==x;++i)e[i].bind()}unbind(){const e=this._bindings;for(let i=this._targetGroup.nCachedObjects_,x=e.length;i!==x;++i)e[i].unbind()}}class di{constructor(e,i,x){this.path=i,this.parsedPath=x||di.parseTrackName(i),this.node=di.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,i,x){return e&&e.isAnimationObjectGroup?new di.Composite(e,i,x):new di(e,i,x)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace($U,"")}static parseTrackName(e){const i=i7.exec(e);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const x={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},T=x.nodeName&&x.nodeName.lastIndexOf(".");if(T!==void 0&&T!==-1){const E=x.nodeName.substring(T+1);n7.indexOf(E)!==-1&&(x.nodeName=x.nodeName.substring(0,T),x.objectName=E)}if(x.propertyName===null||x.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return x}static findNode(e,i){if(i===void 0||i===""||i==="."||i===-1||i===e.name||i===e.uuid)return e;if(e.skeleton){const x=e.skeleton.getBoneByName(i);if(x!==void 0)return x}if(e.children){const x=function(E){for(let a=0;a=E){const h=E++,o=e[h];i[o.uuid]=p,e[p]=o,i[r]=h,e[h]=t;for(let l=0,n=T;l!==n;++l){const u=x[l],f=u[h],s=u[p];u[p]=f,u[h]=s}}}this.nCachedObjects_=E}uncache(){const e=this._objects,i=this._indicesByUUID,x=this._bindings,T=x.length;let E=this.nCachedObjects_,a=e.length;for(let y=0,t=arguments.length;y!==t;++y){const r=arguments[y],p=r.uuid,h=i[p];if(h!==void 0)if(delete i[p],h0&&(i[l.uuid]=h),e[h]=l,e.pop();for(let n=0,u=T;n!==u;++n){const f=x[n];f[h]=f[o],f.pop()}}}this.nCachedObjects_=E}subscribe_(e,i){const x=this._bindingsIndicesByPath;let T=x[e];const E=this._bindings;if(T!==void 0)return E[T];const a=this._paths,y=this._parsedPaths,t=this._objects,r=t.length,p=this.nCachedObjects_,h=new Array(r);T=E.length,x[e]=T,a.push(e),y.push(i),E.push(h);for(let o=p,l=t.length;o!==l;++o){const n=t[o];h[o]=new di(n,e,i)}return h}unsubscribe_(e){const i=this._bindingsIndicesByPath,x=i[e];if(x!==void 0){const T=this._paths,E=this._parsedPaths,a=this._bindings,y=a.length-1,t=a[y],r=e[y];i[r]=x,a[x]=t,a.pop(),E[x]=E[y],E.pop(),T[x]=T[y],T.pop()}}}class dw{constructor(e,i,x=null,T=i.blendMode){this._mixer=e,this._clip=i,this._localRoot=x,this.blendMode=T;const E=i.tracks,a=E.length,y=new Array(a),t={endingStart:mh,endingEnd:mh};for(let r=0;r!==a;++r){const p=E[r].createInterpolant(null);y[r]=p,p.settings=t}this._interpolantSettings=t,this._interpolants=y,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=KC,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,i){return this.loop=e,this.repetitions=i,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,i,x){if(e.fadeOut(i),this.fadeIn(i),x){const T=this._clip.duration,E=e._clip.duration,a=E/T,y=T/E;e.warp(1,a,i),this.warp(y,1,i)}return this}crossFadeTo(e,i,x){return e.crossFadeFrom(this,i,x)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,i,x){const T=this._mixer,E=T.time,a=this.timeScale;let y=this._timeScaleInterpolant;y===null&&(y=T._lendControlInterpolant(),this._timeScaleInterpolant=y);const t=y.parameterPositions,r=y.sampleValues;return t[0]=E,t[1]=E+x,r[0]=e/a,r[1]=i/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,i,x,T){if(!this.enabled){this._updateWeight(e);return}const E=this._startTime;if(E!==null){const t=(e-E)*x;t<0||x===0?i=0:(this._startTime=null,i=x*t)}i*=this._updateTimeScale(e);const a=this._updateTime(i),y=this._updateWeight(e);if(y>0){const t=this._interpolants,r=this._propertyBindings;switch(this.blendMode){case o1:for(let p=0,h=t.length;p!==h;++p)t[p].evaluate(a),r[p].accumulateAdditive(y);break;case _m:default:for(let p=0,h=t.length;p!==h;++p)t[p].evaluate(a),r[p].accumulate(T,y)}}}_updateWeight(e){let i=0;if(this.enabled){i=this.weight;const x=this._weightInterpolant;if(x!==null){const T=x.evaluate(e)[0];i*=T,e>x.parameterPositions[1]&&(this.stopFading(),T===0&&(this.enabled=!1))}}return this._effectiveWeight=i,i}_updateTimeScale(e){let i=0;if(!this.paused){i=this.timeScale;const x=this._timeScaleInterpolant;if(x!==null){const T=x.evaluate(e)[0];i*=T,e>x.parameterPositions[1]&&(this.stopWarping(),i===0?this.paused=!0:this.timeScale=i)}}return this._effectiveTimeScale=i,i}_updateTime(e){const i=this._clip.duration,x=this.loop;let T=this.time+e,E=this._loopCount;const a=x===jC;if(e===0)return E===-1?T:a&&(E&1)===1?i-T:T;if(x===kC){E===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(T>=i)T=i;else if(T<0)T=0;else{this.time=T;break t}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(E===-1&&(e>=0?(E=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),T>=i||T<0){const y=Math.floor(T/i);T-=i*y,E+=Math.abs(y);const t=this.repetitions-E;if(t<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,T=e>0?i:0,this.time=T,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(t===1){const r=e<0;this._setEndings(r,!r,a)}else this._setEndings(!1,!1,a);this._loopCount=E,this.time=T,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:y})}}else this.time=T;if(a&&(E&1)===1)return i-T}return T}_setEndings(e,i,x){const T=this._interpolantSettings;x?(T.endingStart=gh,T.endingEnd=gh):(e?T.endingStart=this.zeroSlopeAtStart?gh:mh:T.endingStart=rd,i?T.endingEnd=this.zeroSlopeAtEnd?gh:mh:T.endingEnd=rd)}_scheduleFading(e,i,x){const T=this._mixer,E=T.time;let a=this._weightInterpolant;a===null&&(a=T._lendControlInterpolant(),this._weightInterpolant=a);const y=a.parameterPositions,t=a.sampleValues;return y[0]=E,t[0]=i,y[1]=E+e,t[1]=x,this}}const a7=new Float32Array(1);class o7 extends ho{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,i){const x=e._localRoot||this._root,T=e._clip.tracks,E=T.length,a=e._propertyBindings,y=e._interpolants,t=x.uuid,r=this._bindingsByRootAndName;let p=r[t];p===void 0&&(p={},r[t]=p);for(let h=0;h!==E;++h){const o=T[h],l=o.name;let n=p[l];if(n!==void 0)++n.referenceCount,a[h]=n;else{if(n=a[h],n!==void 0){n._cacheIndex===null&&(++n.referenceCount,this._addInactiveBinding(n,t,l));continue}const u=i&&i._propertyBindings[h].binding.parsedPath;n=new cw(di.create(x,l,u),o.ValueTypeName,o.getValueSize()),++n.referenceCount,this._addInactiveBinding(n,t,l),a[h]=n}y[h].resultBuffer=n.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const x=(e._localRoot||this._root).uuid,T=e._clip.uuid,E=this._actionsByClip[T];this._bindAction(e,E&&E.knownActions[0]),this._addInactiveAction(e,T,x)}const i=e._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];E.useCount++===0&&(this._lendBinding(E),E.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const i=e._propertyBindings;for(let x=0,T=i.length;x!==T;++x){const E=i[x];--E.useCount===0&&(E.restoreOriginalState(),this._takeBackBinding(E))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const i=e._cacheIndex;return i!==null&&i=0;--x)e[x].stop();return this}update(e){e*=this.timeScale;const i=this._actions,x=this._nActiveActions,T=this.time+=e,E=Math.sign(e),a=this._accuIndex^=1;for(let r=0;r!==x;++r)i[r]._update(T,e,E,a);const y=this._bindings,t=this._nActiveBindings;for(let r=0;r!==t;++r)y[r].apply(a);return this}setTime(e){this.time=0;for(let i=0;ithis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,i){return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,i){return i.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,XE).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const YE=new pt,Fv=new pt;class v7{constructor(e=new pt,i=new pt){this.start=e,this.end=i}set(e,i){return this.start.copy(e),this.end.copy(i),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,i){return this.delta(i).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,i){YE.subVectors(e,this.start),Fv.subVectors(this.end,this.start);const x=Fv.dot(Fv);let E=Fv.dot(YE)/x;return i&&(E=nn(E,0,1)),E}closestPointToPoint(e,i,x){const T=this.closestPointToPointParameter(e,i);return this.delta(x).multiplyScalar(T).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const kE=new pt;class m7 extends vi{constructor(e,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="SpotLightHelper";const x=new ei,T=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,y=1,t=32;a1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{$E.set(e.z,0,-e.x).normalize();const i=Math.acos(e.y);this.quaternion.setFromAxisAngle($E,i)}}setLength(e,i=e*.2,x=i*.2){this.line.scale.set(1,Math.max(1e-4,e-i),1),this.line.updateMatrix(),this.cone.scale.set(x,i,x),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class L7 extends Aa{constructor(e=1){const i=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],x=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],T=new ei;T.setAttribute("position",new xe(i,3)),T.setAttribute("color",new xe(x,3));const E=new wr({vertexColors:!0,toneMapped:!1});super(T,E),this.type="AxesHelper"}setColors(e,i,x){const T=new fe,E=this.geometry.attributes.color.array;return T.set(e),T.toArray(E,0),T.toArray(E,3),T.set(i),T.toArray(E,6),T.toArray(E,9),T.set(x),T.toArray(E,12),T.toArray(E,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class b7{constructor(){this.type="ShapePath",this.color=new fe,this.subPaths=[],this.currentPath=null}moveTo(e,i){return this.currentPath=new fd,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,i),this}lineTo(e,i){return this.currentPath.lineTo(e,i),this}quadraticCurveTo(e,i,x,T){return this.currentPath.quadraticCurveTo(e,i,x,T),this}bezierCurveTo(e,i,x,T,E,a){return this.currentPath.bezierCurveTo(e,i,x,T,E,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function i(s){const c=[];for(let d=0,v=s.length;dNumber.EPSILON){if(w<0&&(M=c[S],C=-C,A=c[m],w=-w),s.yA.y)continue;if(s.y===M.y){if(s.x===M.x)return!0}else{const P=w*(s.x-M.x)-C*(s.y-M.y);if(P===0)return!0;if(P<0)continue;v=!v}}else{if(s.y!==M.y)continue;if(A.x<=s.x&&s.x<=M.x||M.x<=s.x&&s.x<=A.x)return!0}}return v}const T=Ea.isClockWise,E=this.subPaths;if(E.length===0)return[];let a,y,t;const r=[];if(E.length===1)return y=E[0],t=new Ah,t.curves=y.curves,r.push(t),r;let p=!T(E[0].getPoints());p=e?!p:p;const h=[],o=[];let l=[],n=0,u;o[n]=void 0,l[n]=[];for(let s=0,c=E.length;s1){let s=!1,c=0;for(let d=0,v=o.length;d0&&s===!1&&(l=h)}let f;for(let s=0,c=o.length;s{const h=typeof r=="function"?r(e):r;if(h!==e){const o=e;e=p?h:Object.assign({},e,h),i.forEach(l=>l(e,o))}},T=()=>e,E=(r,p=T,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let o=p(e);function l(){const n=p(e);if(!h(o,n)){const u=o;r(o=n,u)}}return i.add(l),()=>i.delete(l)},t={setState:x,getState:T,subscribe:(r,p,h)=>p||h?E(r,p,h):(i.add(r),()=>i.delete(r)),destroy:()=>i.clear()};return e=g(x,T,t),t}const D7=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),QE=D7?te.useEffect:te.useLayoutEffect;function I7(g){const e=typeof g=="function"?O7(g):g,i=(x=e.getState,T=Object.is)=>{const[,E]=te.useReducer(f=>f+1,0),a=e.getState(),y=te.useRef(a),t=te.useRef(x),r=te.useRef(T),p=te.useRef(!1),h=te.useRef();h.current===void 0&&(h.current=x(a));let o,l=!1;(y.current!==a||t.current!==x||r.current!==T||p.current)&&(o=x(a),l=!T(h.current,o)),QE(()=>{l&&(h.current=o),y.current=a,t.current=x,r.current=T,p.current=!1});const n=te.useRef(a);QE(()=>{const f=()=>{try{const c=e.getState(),d=t.current(c);r.current(h.current,d)||(y.current=c,h.current=d,E())}catch{p.current=!0,E()}},s=e.subscribe(f);return e.getState()!==n.current&&f(),s},[]);const u=l?o:h.current;return te.useDebugValue(u),u};return Object.assign(i,e),i[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const x=[i,e];return{next(){const T=x.length<=0;return{value:x.shift(),done:T}}}},i}var gw={exports:{}},iy={exports:{}},ny={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var _E;function N7(){return _E||(_E=1,function(g){function e(z,W){var k=z.length;z.push(W);t:for(;0>>1,Q=z[J];if(0>>1;JT(U,k))VT(j,U)?(z[J]=j,z[V]=k,J=V):(z[J]=U,z[K]=k,J=K);else if(VT(j,k))z[J]=j,z[V]=k,J=V;else break t}}return W}function T(z,W){var k=z.sortIndex-W.sortIndex;return k!==0?k:z.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var a=Date,y=a.now();g.unstable_now=function(){return a.now()-y}}var t=[],r=[],p=1,h=null,o=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var W=i(r);W!==null;){if(W.callback===null)x(r);else if(W.startTime<=z)x(r),W.sortIndex=W.expirationTime,e(t,W);else break;W=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(t)!==null)n=!0,B(m);else{var W=i(r);W!==null&&G(v,W.startTime-z)}}function m(z,W){n=!1,u&&(u=!1,s(A),A=-1),l=!0;var k=o;try{for(d(W),h=i(t);h!==null&&(!(h.expirationTime>W)||z&&!P());){var J=h.callback;if(typeof J=="function"){h.callback=null,o=h.priorityLevel;var Q=J(h.expirationTime<=W);W=g.unstable_now(),typeof Q=="function"?h.callback=Q:h===i(t)&&x(t),d(W)}else x(t);h=i(t)}if(h!==null)var Y=!0;else{var K=i(r);K!==null&&G(v,K.startTime-W),Y=!1}return Y}finally{h=null,o=k,l=!1}}var S=!1,M=null,A=-1,C=5,w=-1;function P(){return!(g.unstable_now()-wz||125J?(z.sortIndex=k,e(r,z),i(t)===null&&z===i(r)&&(u?(s(A),A=-1):u=!0,G(v,k-J))):(z.sortIndex=Q,e(t,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var W=o;return function(){var k=o;o=W;try{return z.apply(this,arguments)}finally{o=k}}}}(ny)),ny}var qE;function B7(){return qE||(qE=1,iy.exports=N7()),iy.exports}/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var U7=function(e){var i={},x=te,T=B7(),E=Object.assign;function a(b){for(var F="https://reactjs.org/docs/error-decoder.html?invariant="+b,H=1;HPt||_[vt]!==rt[Pt]){var Vt=` -`+_[vt].replace(" at new "," at ");return b.displayName&&Vt.includes("")&&(Vt=Vt.replace("",b.displayName)),Vt}while(1<=vt&&0<=Pt);break}}}finally{Ue=!1,Error.prepareStackTrace=H}return(b=b?b.displayName||b.name:"")?ze(b):""}var bi=Object.prototype.hasOwnProperty,dn=[],Ci=-1;function pn(b){return{current:b}}function be(b){0>Ci||(b.current=dn[Ci],dn[Ci]=null,Ci--)}function de(b,F){Ci++,dn[Ci]=b.current,b.current=F}var Rr={},Ke=pn(Rr),Ii=pn(!1),Vr=Rr;function qn(b,F){var H=b.type.contextTypes;if(!H)return Rr;var Z=b.stateNode;if(Z&&Z.__reactInternalMemoizedUnmaskedChildContext===F)return Z.__reactInternalMemoizedMaskedChildContext;var _={},rt;for(rt in H)_[rt]=F[rt];return Z&&(b=b.stateNode,b.__reactInternalMemoizedUnmaskedChildContext=F,b.__reactInternalMemoizedMaskedChildContext=_),_}function vn(b){return b=b.childContextTypes,b!=null}function Bi(){be(Ii),be(Ke)}function ur(b,F,H){if(Ke.current!==Rr)throw Error(a(168));de(Ke,F),de(Ii,H)}function Pa(b,F,H){var Z=b.stateNode;if(F=F.childContextTypes,typeof Z.getChildContext!="function")return H;Z=Z.getChildContext();for(var _ in Z)if(!(_ in F))throw Error(a(108,A(b)||"Unknown",_));return E({},H,Z)}function Cn(b){return b=(b=b.stateNode)&&b.__reactInternalMemoizedMergedChildContext||Rr,Vr=Ke.current,de(Ke,b),de(Ii,Ii.current),!0}function Ra(b,F,H){var Z=b.stateNode;if(!Z)throw Error(a(169));H?(b=Pa(b,F,Vr),Z.__reactInternalMemoizedMergedChildContext=b,be(Ii),be(Ke),de(Ke,b)):be(Ii),de(Ii,H)}var tr=Math.clz32?Math.clz32:Nd,co=Math.log,Eg=Math.LN2;function Nd(b){return b>>>=0,b===0?32:31-(co(b)/Eg|0)|0}var po=64,vo=4194304;function hs(b){switch(b&-b){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return b&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return b&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return b}}function ml(b,F){var H=b.pendingLanes;if(H===0)return 0;var Z=0,_=b.suspendedLanes,rt=b.pingedLanes,vt=H&268435455;if(vt!==0){var Pt=vt&~_;Pt!==0?Z=hs(Pt):(rt&=vt,rt!==0&&(Z=hs(rt)))}else vt=H&~_,vt!==0?Z=hs(vt):rt!==0&&(Z=hs(rt));if(Z===0)return 0;if(F!==0&&F!==Z&&!(F&_)&&(_=Z&-Z,rt=F&-F,_>=rt||_===16&&(rt&4194240)!==0))return F;if(Z&4&&(Z|=H&16),F=b.entangledLanes,F!==0)for(b=b.entanglements,F&=Z;0H;H++)F.push(b);return F}function mo(b,F,H){b.pendingLanes|=F,F!==536870912&&(b.suspendedLanes=0,b.pingedLanes=0),b=b.eventTimes,F=31-tr(F),b[F]=H}function Ud(b,F){var H=b.pendingLanes&~F;b.pendingLanes=F,b.suspendedLanes=0,b.pingedLanes=0,b.expiredLanes&=F,b.mutableReadLanes&=F,b.entangledLanes&=F,F=b.entanglements;var Z=b.eventTimes;for(b=b.expirationTimes;0>=vt,_-=vt,Ds=1<<32-tr(F)+_|H<<_|Z,kr=rt+b}else Ds=1<Je?(qi=We,We=null):qi=We.sibling;var oi=Ee(Ft,We,Ut[Je],oe);if(oi===null){We===null&&(We=qi);break}b&&We&&oi.alternate===null&&F(Ft,We),Rt=rt(oi,Rt,Je),Ze===null?ye=oi:Ze.sibling=oi,Ze=oi,We=qi}if(Je===Ut.length)return H(Ft,We),Ri&&Is(Ft,Je),ye;if(We===null){for(;JeJe?(qi=We,We=null):qi=We.sibling;var Es=Ee(Ft,We,oi.value,oe);if(Es===null){We===null&&(We=qi);break}b&&We&&Es.alternate===null&&F(Ft,We),Rt=rt(Es,Rt,Je),Ze===null?ye=Es:Ze.sibling=Es,Ze=Es,We=qi}if(oi.done)return H(Ft,We),Ri&&Is(Ft,Je),ye;if(We===null){for(;!oi.done;Je++,oi=Ut.next())oi=He(Ft,oi.value,oe),oi!==null&&(Rt=rt(oi,Rt,Je),Ze===null?ye=oi:Ze.sibling=oi,Ze=oi);return Ri&&Is(Ft,Je),ye}for(We=Z(Ft,We);!oi.done;Je++,oi=Ut.next())oi=gi(We,Ft,Je,oi.value,oe),oi!==null&&(b&&oi.alternate!==null&&We.delete(oi.key===null?Je:oi.key),Rt=rt(oi,Rt,Je),Ze===null?ye=oi:Ze.sibling=oi,Ze=oi);return b&&We.forEach(function(Su){return F(Ft,Su)}),Ri&&Is(Ft,Je),ye}function gr(Ft,Rt,Ut,oe){if(typeof Ut=="object"&&Ut!==null&&Ut.type===p&&Ut.key===null&&(Ut=Ut.props.children),typeof Ut=="object"&&Ut!==null){switch(Ut.$$typeof){case t:t:{for(var ye=Ut.key,Ze=Rt;Ze!==null;){if(Ze.key===ye){if(ye=Ut.type,ye===p){if(Ze.tag===7){H(Ft,Ze.sibling),Rt=_(Ze,Ut.props.children),Rt.return=Ft,Ft=Rt;break t}}else if(Ze.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===d&&Cl(ye)===Ze.type){H(Ft,Ze.sibling),Rt=_(Ze,Ut.props),Rt.ref=Mo(Ft,Ze,Ut),Rt.return=Ft,Ft=Rt;break t}H(Ft,Ze);break}else F(Ft,Ze);Ze=Ze.sibling}Ut.type===p?(Rt=da(Ut.props.children,Ft.mode,oe,Ut.key),Rt.return=Ft,Ft=Rt):(oe=yu(Ut.type,Ut.key,Ut.props,null,Ft.mode,oe),oe.ref=Mo(Ft,Rt,Ut),oe.return=Ft,Ft=oe)}return vt(Ft);case r:t:{for(Ze=Ut.key;Rt!==null;){if(Rt.key===Ze)if(Rt.tag===4&&Rt.stateNode.containerInfo===Ut.containerInfo&&Rt.stateNode.implementation===Ut.implementation){H(Ft,Rt.sibling),Rt=_(Rt,Ut.children||[]),Rt.return=Ft,Ft=Rt;break t}else{H(Ft,Rt);break}else F(Ft,Rt);Rt=Rt.sibling}Rt=Or(Ut,Ft.mode,oe),Rt.return=Ft,Ft=Rt}return vt(Ft);case d:return Ze=Ut._init,gr(Ft,Rt,Ze(Ut._payload),oe)}if(D(Ut))return ge(Ft,Rt,Ut,oe);if(S(Ut))return Hn(Ft,Rt,Ut,oe);jr(Ft,Ut)}return typeof Ut=="string"&&Ut!==""||typeof Ut=="number"?(Ut=""+Ut,Rt!==null&&Rt.tag===6?(H(Ft,Rt.sibling),Rt=_(Rt,Ut),Rt.return=Ft,Ft=Rt):(H(Ft,Rt),Rt=Vn(Ut,Ft.mode,oe),Rt.return=Ft,Ft=Rt),vt(Ft)):H(Ft,Rt)}return gr}var Co=jd(!0),Zd=jd(!1),ds={},Ui=pn(ds),Ao=pn(ds),wo=pn(ds);function ps(b){if(b===ds)throw Error(a(174));return b}function Bf(b,F){de(wo,F),de(Ao,b),de(Ui,ds),b=G(F),be(Ui),de(Ui,b)}function Po(){be(Ui),be(Ao),be(wo)}function Jd(b){var F=ps(wo.current),H=ps(Ui.current);F=z(H,b.type,F),H!==F&&(de(Ao,b),de(Ui,F))}function vs(b){Ao.current===b&&(be(Ui),be(Ao))}var Ct=pn(0);function Ht(b){for(var F=b;F!==null;){if(F.tag===13){var H=F.memoizedState;if(H!==null&&(H=H.dehydrated,H===null||wa(H)||vl(H)))return F}else if(F.tag===19&&F.memoizedProps.revealOrder!==void 0){if(F.flags&128)return F}else if(F.child!==null){F.child.return=F,F=F.child;continue}if(F===b)break;for(;F.sibling===null;){if(F.return===null||F.return===b)return null;F=F.return}F.sibling.return=F.return,F=F.sibling}return null}var It=[];function ue(){for(var b=0;bH?H:4,b(!0);var Z=Ye.transition;Ye.transition={};try{b(!1),F()}finally{hi=H,Ye.transition=Z}}function qd(){return fr().memoizedState}function on(b,F,H){var Z=Ss(b);H={lane:Z,action:H,hasEagerState:!1,eagerState:null,next:null},tp(b)?ep(F,H):(Wf(b,F,H),H=Un(),b=br(b,Z,H),b!==null&&ip(b,F,Z))}function In(b,F,H){var Z=Ss(b),_={lane:Z,action:H,hasEagerState:!1,eagerState:null,next:null};if(tp(b))ep(F,_);else{Wf(b,F,_);var rt=b.alternate;if(b.lanes===0&&(rt===null||rt.lanes===0)&&(rt=F.lastRenderedReducer,rt!==null))try{var vt=F.lastRenderedState,Pt=rt(vt,H);if(_.hasEagerState=!0,_.eagerState=Pt,fs(Pt,vt))return}catch{}finally{}H=Un(),b=br(b,Z,H),b!==null&&ip(b,F,Z)}}function tp(b){var F=b.alternate;return b===Oe||F!==null&&F===Oe}function ep(b,F){ea=$n=!0;var H=b.pending;H===null?F.next=F:(F.next=H.next,H.next=F),b.pending=F}function Wf(b,F,H){Qi!==null&&b.mode&1&&!(je&2)?(b=F.interleaved,b===null?(H.next=H,cs===null?cs=[F]:cs.push(F)):(H.next=b.next,b.next=H),F.interleaved=H):(b=F.pending,b===null?H.next=H:(H.next=b.next,b.next=H),F.pending=H)}function ip(b,F,H){if(H&4194240){var Z=F.lanes;Z&=b.pendingLanes,H|=Z,F.lanes=H,wf(b,H)}}var Fo={readContext:Fi,useCallback:an,useContext:an,useEffect:an,useImperativeHandle:an,useInsertionEffect:an,useLayoutEffect:an,useMemo:an,useReducer:an,useRef:an,useState:an,useDebugValue:an,useDeferredValue:an,useTransition:an,useMutableSource:an,useSyncExternalStore:an,useId:an,unstable_isNewReconciler:!1},Dl={readContext:Fi,useCallback:function(b,F){return ms().memoizedState=[b,F===void 0?null:F],b},useContext:Fi,useEffect:bo,useImperativeHandle:function(b,F,H){return H=H!=null?H.concat([b]):null,na(4194308,4,bl.bind(null,F,b),H)},useLayoutEffect:function(b,F){return na(4194308,4,b,F)},useInsertionEffect:function(b,F){return na(4,2,b,F)},useMemo:function(b,F){var H=ms();return F=F===void 0?null:F,b=b(),H.memoizedState=[b,F],b},useReducer:function(b,F,H){var Z=ms();return F=H!==void 0?H(F):F,Z.memoizedState=Z.baseState=F,b={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:b,lastRenderedState:F},Z.queue=b,b=b.dispatch=on.bind(null,Oe,b),[Z.memoizedState,b]},useRef:function(b){var F=ms();return b={current:b},F.memoizedState=b},useState:eu,useDebugValue:Ol,useDeferredValue:function(b){var F=eu(b),H=F[0],Z=F[1];return bo(function(){var _=Ye.transition;Ye.transition={};try{Z(b)}finally{Ye.transition=_}},[b]),H},useTransition:function(){var b=eu(!1),F=b[0];return b=bg.bind(null,b[1]),ms().memoizedState=b,[F,b]},useMutableSource:function(){},useSyncExternalStore:function(b,F,H){var Z=Oe,_=ms();if(Ri){if(H===void 0)throw Error(a(407));H=H()}else{if(H=F(),Qi===null)throw Error(a(349));Oi&30||Pl(Z,F,H)}_.memoizedState=H;var rt={value:H,getSnapshot:F};return _.queue=rt,bo(Rl.bind(null,Z,rt,b),[b]),Z.flags|=2048,ia(9,zf.bind(null,Z,rt,H,F),void 0,null),H},useId:function(){var b=ms(),F=Qi.identifierPrefix;if(Ri){var H=kr,Z=Ds;H=(Z&~(1<<32-tr(Z)-1)).toString(32)+H,F=":"+F+"R"+H,H=Al++,0Vl&&(F.flags|=128,Z=!0,Nn(_,!1),F.lanes=4194304)}else{if(!Z)if(b=Ht(rt),b!==null){if(F.flags|=128,Z=!0,b=b.updateQueue,b!==null&&(F.updateQueue=b,F.flags|=4),Nn(_,!0),_.tail===null&&_.tailMode==="hidden"&&!rt.alternate&&!Ri)return Pe(F),null}else 2*mn()-_.renderingStartTime>Vl&&H!==1073741824&&(F.flags|=128,Z=!0,Nn(_,!1),F.lanes=4194304);_.isBackwards?(rt.sibling=F.child,F.child=rt):(b=_.last,b!==null?b.sibling=rt:F.child=rt,_.last=rt)}return _.tail!==null?(F=_.tail,_.rendering=F,_.tail=F.sibling,_.renderingStartTime=mn(),F.sibling=null,b=Ct.current,de(Ct,Z?b&1|2:b&1),F):(Pe(F),null);case 22:case 23:return sc(),Z=F.memoizedState!==null,b!==null&&b.memoizedState!==null!==Z&&(F.flags|=8192),Z&&F.mode&1?vr&1073741824&&(Pe(F),nt&&F.subtreeFlags&6&&(F.flags|=8192)):Pe(F),null;case 24:return null;case 25:return null}throw Error(a(156,F.tag))}var Og=y.ReactCurrentOwner,cr=!1;function Hi(b,F,H,Z){F.child=b===null?Zd(F,null,H,Z):Co(F,b.child,H,Z)}function op(b,F,H,Z,_){H=H.render;var rt=F.ref;return La(F,_),Z=ci(b,F,H,Z,rt,_),H=Uf(),b!==null&&!cr?(F.updateQueue=b.updateQueue,F.flags&=-2053,b.lanes&=~_,ln(b,F,_)):(Ri&&H&&_h(F),F.flags|=1,Hi(b,F,Z,_),F.child)}function lp(b,F,H,Z,_){if(b===null){var rt=H.type;return typeof rt=="function"&&!fc(rt)&&rt.defaultProps===void 0&&H.compare===null&&H.defaultProps===void 0?(F.tag=15,F.type=rt,hp(b,F,rt,Z,_)):(b=yu(H.type,null,Z,F,F.mode,_),b.ref=F.ref,b.return=F,F.child=b)}if(rt=b.child,!(b.lanes&_)){var vt=rt.memoizedProps;if(H=H.compare,H=H!==null?H:Vi,H(vt,Z)&&b.ref===F.ref)return ln(b,F,_)}return F.flags|=1,b=Gs(rt,Z),b.ref=F.ref,b.return=F,F.child=b}function hp(b,F,H,Z,_){if(b!==null&&Vi(b.memoizedProps,Z)&&b.ref===F.ref)if(cr=!1,(b.lanes&_)!==0)b.flags&131072&&(cr=!0);else return F.lanes=b.lanes,ln(b,F,_);return Zr(b,F,H,Z,_)}function up(b,F,H){var Z=F.pendingProps,_=Z.children,rt=b!==null?b.memoizedState:null;if(Z.mode==="hidden")if(!(F.mode&1))F.memoizedState={baseLanes:0,cachePool:null},de(Uo,vr),vr|=H;else if(H&1073741824)F.memoizedState={baseLanes:0,cachePool:null},Z=rt!==null?rt.baseLanes:H,de(Uo,vr),vr|=Z;else return b=rt!==null?rt.baseLanes|H:H,F.lanes=F.childLanes=1073741824,F.memoizedState={baseLanes:b,cachePool:null},F.updateQueue=null,de(Uo,vr),vr|=b,null;else rt!==null?(Z=rt.baseLanes|H,F.memoizedState=null):Z=H,de(Uo,vr),vr|=Z;return Hi(b,F,_,H),F.child}function fp(b,F){var H=F.ref;(b===null&&H!==null||b!==null&&b.ref!==H)&&(F.flags|=512,F.flags|=2097152)}function Zr(b,F,H,Z,_){var rt=vn(H)?Vr:Ke.current;return rt=qn(F,rt),La(F,_),H=ci(b,F,H,Z,rt,_),Z=Uf(),b!==null&&!cr?(F.updateQueue=b.updateQueue,F.flags&=-2053,b.lanes&=~_,ln(b,F,_)):(Ri&&Z&&_h(F),F.flags|=1,Hi(b,F,H,_),F.child)}function cp(b,F,H,Z,_){if(vn(H)){var rt=!0;Cn(F)}else rt=!1;if(La(F,_),F.stateNode===null)b!==null&&(b.alternate=null,F.alternate=null,F.flags|=2),Xd(F,H,Z),xo(F,H,Z,_),Z=!0;else if(b===null){var vt=F.stateNode,Pt=F.memoizedProps;vt.props=Pt;var Vt=vt.context,Qt=H.contextType;typeof Qt=="object"&&Qt!==null?Qt=Fi(Qt):(Qt=vn(H)?Vr:Ke.current,Qt=qn(F,Qt));var pe=H.getDerivedStateFromProps,He=typeof pe=="function"||typeof vt.getSnapshotBeforeUpdate=="function";He||typeof vt.UNSAFE_componentWillReceiveProps!="function"&&typeof vt.componentWillReceiveProps!="function"||(Pt!==Z||Vt!==Qt)&&Df(F,vt,Z,Qt),sn=!1;var Ee=F.memoizedState;vt.state=Ee,Xr(F,Z,vt,_),Vt=F.memoizedState,Pt!==Z||Ee!==Vt||Ii.current||sn?(typeof pe=="function"&&(xl(F,H,pe,Z),Vt=F.memoizedState),(Pt=sn||Wd(F,H,Pt,Z,Ee,Vt,Qt))?(He||typeof vt.UNSAFE_componentWillMount!="function"&&typeof vt.componentWillMount!="function"||(typeof vt.componentWillMount=="function"&&vt.componentWillMount(),typeof vt.UNSAFE_componentWillMount=="function"&&vt.UNSAFE_componentWillMount()),typeof vt.componentDidMount=="function"&&(F.flags|=4194308)):(typeof vt.componentDidMount=="function"&&(F.flags|=4194308),F.memoizedProps=Z,F.memoizedState=Vt),vt.props=Z,vt.state=Vt,vt.context=Qt,Z=Pt):(typeof vt.componentDidMount=="function"&&(F.flags|=4194308),Z=!1)}else{vt=F.stateNode,Of(b,F),Pt=F.memoizedProps,Qt=F.type===F.elementType?Pt:An(F.type,Pt),vt.props=Qt,He=F.pendingProps,Ee=vt.context,Vt=H.contextType,typeof Vt=="object"&&Vt!==null?Vt=Fi(Vt):(Vt=vn(H)?Vr:Ke.current,Vt=qn(F,Vt));var gi=H.getDerivedStateFromProps;(pe=typeof gi=="function"||typeof vt.getSnapshotBeforeUpdate=="function")||typeof vt.UNSAFE_componentWillReceiveProps!="function"&&typeof vt.componentWillReceiveProps!="function"||(Pt!==He||Ee!==Vt)&&Df(F,vt,Z,Vt),sn=!1,Ee=F.memoizedState,vt.state=Ee,Xr(F,Z,vt,_);var ge=F.memoizedState;Pt!==He||Ee!==ge||Ii.current||sn?(typeof gi=="function"&&(xl(F,H,gi,Z),ge=F.memoizedState),(Qt=sn||Wd(F,H,Qt,Z,Ee,ge,Vt)||!1)?(pe||typeof vt.UNSAFE_componentWillUpdate!="function"&&typeof vt.componentWillUpdate!="function"||(typeof vt.componentWillUpdate=="function"&&vt.componentWillUpdate(Z,ge,Vt),typeof vt.UNSAFE_componentWillUpdate=="function"&&vt.UNSAFE_componentWillUpdate(Z,ge,Vt)),typeof vt.componentDidUpdate=="function"&&(F.flags|=4),typeof vt.getSnapshotBeforeUpdate=="function"&&(F.flags|=1024)):(typeof vt.componentDidUpdate!="function"||Pt===b.memoizedProps&&Ee===b.memoizedState||(F.flags|=4),typeof vt.getSnapshotBeforeUpdate!="function"||Pt===b.memoizedProps&&Ee===b.memoizedState||(F.flags|=1024),F.memoizedProps=Z,F.memoizedState=ge),vt.props=Z,vt.state=ge,vt.context=Vt,Z=Qt):(typeof vt.componentDidUpdate!="function"||Pt===b.memoizedProps&&Ee===b.memoizedState||(F.flags|=4),typeof vt.getSnapshotBeforeUpdate!="function"||Pt===b.memoizedProps&&Ee===b.memoizedState||(F.flags|=1024),Z=!1)}return Yf(b,F,H,Z,rt,_)}function Yf(b,F,H,Z,_,rt){fp(b,F);var vt=(F.flags&128)!==0;if(!Z&&!vt)return _&&Ra(F,H,!1),ln(b,F,rt);Z=F.stateNode,Og.current=F;var Pt=vt&&typeof H.getDerivedStateFromError!="function"?null:Z.render();return F.flags|=1,b!==null&&vt?(F.child=Co(F,b.child,null,rt),F.child=Co(F,null,Pt,rt)):Hi(b,F,Pt,rt),F.memoizedState=Z.state,_&&Ra(F,H,!0),F.child}function dp(b){var F=b.stateNode;F.pendingContext?ur(b,F.pendingContext,F.pendingContext!==F.context):F.context&&ur(b,F.context,!1),Bf(b,F.containerInfo)}function pp(b,F,H,Z,_){return Eo(),Ml(_),F.flags|=256,Hi(b,F,H,Z),F.child}var nu={dehydrated:null,treeContext:null,retryLane:0};function Lr(b){return{baseLanes:b,cachePool:null}}function vp(b,F,H){var Z=F.pendingProps,_=Ct.current,rt=!1,vt=(F.flags&128)!==0,Pt;if((Pt=vt)||(Pt=b!==null&&b.memoizedState===null?!1:(_&2)!==0),Pt?(rt=!0,F.flags&=-129):(b===null||b.memoizedState!==null)&&(_|=1),de(Ct,_&1),b===null)return Nf(F),b=F.memoizedState,b!==null&&(b=b.dehydrated,b!==null)?(F.mode&1?vl(b)?F.lanes=8:F.lanes=1073741824:F.lanes=1,null):(_=Z.children,b=Z.fallback,rt?(Z=F.mode,rt=F.child,_={mode:"hidden",children:_},!(Z&1)&&rt!==null?(rt.childLanes=0,rt.pendingProps=_):rt=kl(_,Z,0,null),b=da(b,Z,H,null),rt.return=F,b.return=F,rt.sibling=b,F.child=rt,F.child.memoizedState=Lr(H),F.memoizedState=nu,b):kf(F,_));if(_=b.memoizedState,_!==null){if(Pt=_.dehydrated,Pt!==null){if(vt)return F.flags&256?(F.flags&=-257,ru(b,F,H,Error(a(422)))):F.memoizedState!==null?(F.child=b.child,F.flags|=128,null):(rt=Z.fallback,_=F.mode,Z=kl({mode:"visible",children:Z.children},_,0,null),rt=da(rt,_,H,null),rt.flags|=2,Z.return=F,rt.return=F,Z.sibling=rt,F.child=Z,F.mode&1&&Co(F,b.child,null,H),F.child.memoizedState=Lr(H),F.memoizedState=nu,rt);if(!(F.mode&1))F=ru(b,F,H,null);else if(vl(Pt))F=ru(b,F,H,Error(a(419)));else if(Z=(H&b.childLanes)!==0,cr||Z){if(Z=Qi,Z!==null){switch(H&-H){case 4:rt=2;break;case 16:rt=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:rt=32;break;case 536870912:rt=268435456;break;default:rt=0}Z=rt&(Z.suspendedLanes|H)?0:rt,Z!==0&&Z!==_.retryLane&&(_.retryLane=Z,br(b,Z,-1))}vu(),F=ru(b,F,H,Error(a(421)))}else wa(Pt)?(F.flags|=128,F.child=b.child,F=ca.bind(null,b),uo(Pt,F),F=null):(H=_.treeContext,ht&&(Pn=Gh(Pt),Jn=F,Ri=!0,Kr=null,To=!1,H!==null&&(er[ir++]=Ds,er[ir++]=kr,er[ir++]=ta,Ds=H.id,kr=H.overflow,ta=F)),F=kf(F,F.pendingProps.children),F.flags|=4096);return F}return rt?(Z=gp(b,F,Z.children,Z.fallback,H),rt=F.child,_=b.child.memoizedState,rt.memoizedState=_===null?Lr(H):{baseLanes:_.baseLanes|H,cachePool:null},rt.childLanes=b.childLanes&~H,F.memoizedState=nu,Z):(H=mp(b,F,Z.children,H),F.memoizedState=null,H)}return rt?(Z=gp(b,F,Z.children,Z.fallback,H),rt=F.child,_=b.child.memoizedState,rt.memoizedState=_===null?Lr(H):{baseLanes:_.baseLanes|H,cachePool:null},rt.childLanes=b.childLanes&~H,F.memoizedState=nu,Z):(H=mp(b,F,Z.children,H),F.memoizedState=null,H)}function kf(b,F){return F=kl({mode:"visible",children:F},b.mode,0,null),F.return=b,b.child=F}function mp(b,F,H,Z){var _=b.child;return b=_.sibling,H=Gs(_,{mode:"visible",children:H}),!(F.mode&1)&&(H.lanes=Z),H.return=F,H.sibling=null,b!==null&&(Z=F.deletions,Z===null?(F.deletions=[b],F.flags|=16):Z.push(b)),F.child=H}function gp(b,F,H,Z,_){var rt=F.mode;b=b.child;var vt=b.sibling,Pt={mode:"hidden",children:H};return!(rt&1)&&F.child!==b?(H=F.child,H.childLanes=0,H.pendingProps=Pt,F.deletions=null):(H=Gs(b,Pt),H.subtreeFlags=b.subtreeFlags&14680064),vt!==null?Z=Gs(vt,Z):(Z=da(Z,rt,_,null),Z.flags|=2),Z.return=F,H.return=F,H.sibling=Z,F.child=H,Z}function ru(b,F,H,Z){return Z!==null&&Ml(Z),Co(F,b.child,null,H),b=kf(F,F.pendingProps.children),b.flags|=2,F.memoizedState=null,b}function ra(b,F,H){b.lanes|=F;var Z=b.alternate;Z!==null&&(Z.lanes|=F),Jh(b.return,F,H)}function Kf(b,F,H,Z,_){var rt=b.memoizedState;rt===null?b.memoizedState={isBackwards:F,rendering:null,renderingStartTime:0,last:Z,tail:H,tailMode:_}:(rt.isBackwards=F,rt.rendering=null,rt.renderingStartTime=0,rt.last=Z,rt.tail=H,rt.tailMode=_)}function yp(b,F,H){var Z=F.pendingProps,_=Z.revealOrder,rt=Z.tail;if(Hi(b,F,Z.children,H),Z=Ct.current,Z&2)Z=Z&1|2,F.flags|=128;else{if(b!==null&&b.flags&128)t:for(b=F.child;b!==null;){if(b.tag===13)b.memoizedState!==null&&ra(b,H,F);else if(b.tag===19)ra(b,H,F);else if(b.child!==null){b.child.return=b,b=b.child;continue}if(b===F)break t;for(;b.sibling===null;){if(b.return===null||b.return===F)break t;b=b.return}b.sibling.return=b.return,b=b.sibling}Z&=1}if(de(Ct,Z),!(F.mode&1))F.memoizedState=null;else switch(_){case"forwards":for(H=F.child,_=null;H!==null;)b=H.alternate,b!==null&&Ht(b)===null&&(_=H),H=H.sibling;H=_,H===null?(_=F.child,F.child=null):(_=H.sibling,H.sibling=null),Kf(F,!1,_,H,rt);break;case"backwards":for(H=null,_=F.child,F.child=null;_!==null;){if(b=_.alternate,b!==null&&Ht(b)===null){F.child=_;break}b=_.sibling,_.sibling=H,H=_,_=b}Kf(F,!0,H,null,rt);break;case"together":Kf(F,!1,null,null,void 0);break;default:F.memoizedState=null}return F.child}function ln(b,F,H){if(b!==null&&(F.dependencies=b.dependencies),Go|=F.lanes,!(H&F.childLanes))return null;if(b!==null&&F.child!==b.child)throw Error(a(153));if(F.child!==null){for(b=F.child,H=Gs(b,b.pendingProps),F.child=H,H.return=F;b.sibling!==null;)b=b.sibling,H=H.sibling=Gs(b,b.pendingProps),H.return=F;H.sibling=null}return F.child}function Dg(b,F,H){switch(F.tag){case 3:dp(F),Eo();break;case 5:Jd(F);break;case 1:vn(F.type)&&Cn(F);break;case 4:Bf(F,F.stateNode.containerInfo);break;case 10:bf(F,F.type._context,F.memoizedProps.value);break;case 13:var Z=F.memoizedState;if(Z!==null)return Z.dehydrated!==null?(de(Ct,Ct.current&1),F.flags|=128,null):H&F.child.childLanes?vp(b,F,H):(de(Ct,Ct.current&1),b=ln(b,F,H),b!==null?b.sibling:null);de(Ct,Ct.current&1);break;case 19:if(Z=(H&F.childLanes)!==0,b.flags&128){if(Z)return yp(b,F,H);F.flags|=128}var _=F.memoizedState;if(_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),de(Ct,Ct.current),Z)break;return null;case 22:case 23:return F.lanes=0,up(b,F,H)}return ln(b,F,H)}function Ig(b,F){switch(Zn(F),F.tag){case 1:return vn(F.type)&&Bi(),b=F.flags,b&65536?(F.flags=b&-65537|128,F):null;case 3:return Po(),be(Ii),be(Ke),ue(),b=F.flags,b&65536&&!(b&128)?(F.flags=b&-65537|128,F):null;case 5:return vs(F),null;case 13:if(be(Ct),b=F.memoizedState,b!==null&&b.dehydrated!==null){if(F.alternate===null)throw Error(a(340));Eo()}return b=F.flags,b&65536?(F.flags=b&-65537|128,F):null;case 19:return be(Ct),null;case 4:return Po(),null;case 10:return Zh(F.type._context),null;case 22:case 23:return sc(),null;case 24:return null;default:return null}}var su=!1,Na=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,re=null;function Bl(b,F){var H=b.ref;if(H!==null)if(typeof H=="function")try{H(null)}catch(Z){Gn(b,F,Z)}else H.current=null}function jf(b,F,H){try{H()}catch(Z){Gn(b,F,Z)}}var xp=!1;function Zf(b,F){for(W(b.containerInfo),re=F;re!==null;)if(b=re,F=b.child,(b.subtreeFlags&1028)!==0&&F!==null)F.return=b,re=F;else for(;re!==null;){b=re;try{var H=b.alternate;if(b.flags&1024)switch(b.tag){case 0:case 11:case 15:break;case 1:if(H!==null){var Z=H.memoizedProps,_=H.memoizedState,rt=b.stateNode,vt=rt.getSnapshotBeforeUpdate(b.elementType===b.type?Z:An(b.type,Z),_);rt.__reactInternalSnapshotBeforeUpdate=vt}break;case 3:nt&&_t(b.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Pt){Gn(b,b.return,Pt)}if(F=b.sibling,F!==null){F.return=b.return,re=F;break}re=b.return}return H=xp,xp=!1,H}function Jr(b,F,H){var Z=F.updateQueue;if(Z=Z!==null?Z.lastEffect:null,Z!==null){var _=Z=Z.next;do{if((_.tag&b)===b){var rt=_.destroy;_.destroy=void 0,rt!==void 0&&jf(F,H,rt)}_=_.next}while(_!==Z)}}function sa(b,F){if(F=F.updateQueue,F=F!==null?F.lastEffect:null,F!==null){var H=F=F.next;do{if((H.tag&b)===b){var Z=H.create;H.destroy=Z()}H=H.next}while(H!==F)}}function Jf(b){var F=b.ref;if(F!==null){var H=b.stateNode;switch(b.tag){case 5:b=B(H);break;default:b=H}typeof F=="function"?F(b):F.current=b}}function $f(b,F,H){if(us&&typeof us.onCommitFiberUnmount=="function")try{us.onCommitFiberUnmount(Yh,F)}catch{}switch(F.tag){case 0:case 11:case 14:case 15:if(b=F.updateQueue,b!==null&&(b=b.lastEffect,b!==null)){var Z=b=b.next;do{var _=Z,rt=_.destroy;_=_.tag,rt!==void 0&&(_&2||_&4)&&jf(F,H,rt),Z=Z.next}while(Z!==b)}break;case 1:if(Bl(F,H),b=F.stateNode,typeof b.componentWillUnmount=="function")try{b.props=F.memoizedProps,b.state=F.memoizedState,b.componentWillUnmount()}catch(vt){Gn(F,H,vt)}break;case 5:Bl(F,H);break;case 4:nt?_f(b,F,H):et&&et&&(F=F.stateNode.containerInfo,H=ve(F),pi(F,H))}}function Sp(b,F,H){for(var Z=F;;)if($f(b,Z,H),Z.child===null||nt&&Z.tag===4){if(Z===F)break;for(;Z.sibling===null;){if(Z.return===null||Z.return===F)return;Z=Z.return}Z.sibling.return=Z.return,Z=Z.sibling}else Z.child.return=Z,Z=Z.child}function xs(b){var F=b.alternate;F!==null&&(b.alternate=null,xs(F)),b.child=null,b.deletions=null,b.sibling=null,b.tag===5&&(F=b.stateNode,F!==null&>(F)),b.stateNode=null,b.return=null,b.dependencies=null,b.memoizedProps=null,b.memoizedState=null,b.pendingProps=null,b.stateNode=null,b.updateQueue=null}function au(b){return b.tag===5||b.tag===3||b.tag===4}function aa(b){t:for(;;){for(;b.sibling===null;){if(b.return===null||au(b.return))return null;b=b.return}for(b.sibling.return=b.return,b=b.sibling;b.tag!==5&&b.tag!==6&&b.tag!==18;){if(b.flags&2||b.child===null||b.tag===4)continue t;b.child.return=b,b=b.child}if(!(b.flags&2))return b.stateNode}}function dr(b){if(nt){t:{for(var F=b.return;F!==null;){if(au(F))break t;F=F.return}throw Error(a(160))}var H=F;switch(H.tag){case 5:F=H.stateNode,H.flags&32&&(Xe(F),H.flags&=-33),H=aa(b),ou(b,H,F);break;case 3:case 4:F=H.stateNode.containerInfo,H=aa(b),Qf(b,H,F);break;default:throw Error(a(161))}}}function Qf(b,F,H){var Z=b.tag;if(Z===5||Z===6)b=b.stateNode,F?se(H,b,F):ee(H,b);else if(Z!==4&&(b=b.child,b!==null))for(Qf(b,F,H),b=b.sibling;b!==null;)Qf(b,F,H),b=b.sibling}function ou(b,F,H){var Z=b.tag;if(Z===5||Z===6)b=b.stateNode,F?ce(H,b,F):$t(H,b);else if(Z!==4&&(b=b.child,b!==null))for(ou(b,F,H),b=b.sibling;b!==null;)ou(b,F,H),b=b.sibling}function _f(b,F,H){for(var Z=F,_=!1,rt,vt;;){if(!_){_=Z.return;t:for(;;){if(_===null)throw Error(a(160));switch(rt=_.stateNode,_.tag){case 5:vt=!1;break t;case 3:rt=rt.containerInfo,vt=!0;break t;case 4:rt=rt.containerInfo,vt=!0;break t}_=_.return}_=!0}if(Z.tag===5||Z.tag===6)Sp(b,Z,H),vt?Ce(rt,Z.stateNode):ie(rt,Z.stateNode);else if(Z.tag===18)vt?Dt(rt,Z.stateNode):zt(rt,Z.stateNode);else if(Z.tag===4){if(Z.child!==null){rt=Z.stateNode.containerInfo,vt=!0,Z.child.return=Z,Z=Z.child;continue}}else if($f(b,Z,H),Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===F)break;for(;Z.sibling===null;){if(Z.return===null||Z.return===F)return;Z=Z.return,Z.tag===4&&(_=!1)}Z.sibling.return=Z.return,Z=Z.sibling}}function Ba(b,F){if(nt){switch(F.tag){case 0:case 11:case 14:case 15:Jr(3,F,F.return),sa(3,F),Jr(5,F,F.return);return;case 1:return;case 5:var H=F.stateNode;if(H!=null){var Z=F.memoizedProps;b=b!==null?b.memoizedProps:Z;var _=F.type,rt=F.updateQueue;F.updateQueue=null,rt!==null&&le(H,rt,_,b,Z,F)}return;case 6:if(F.stateNode===null)throw Error(a(162));H=F.memoizedProps,Nt(F.stateNode,b!==null?b.memoizedProps:H,H);return;case 3:ht&&b!==null&&b.memoizedState.isDehydrated&&bt(F.stateNode.containerInfo);return;case 12:return;case 13:$r(F);return;case 19:$r(F);return;case 17:return}throw Error(a(163))}switch(F.tag){case 0:case 11:case 14:case 15:Jr(3,F,F.return),sa(3,F),Jr(5,F,F.return);return;case 12:return;case 13:$r(F);return;case 19:$r(F);return;case 3:ht&&b!==null&&b.memoizedState.isDehydrated&&bt(F.stateNode.containerInfo);break;case 22:case 23:return}t:if(et){switch(F.tag){case 1:case 5:case 6:break t;case 3:case 4:F=F.stateNode,pi(F.containerInfo,F.pendingChildren);break t}throw Error(a(163))}}function $r(b){var F=b.updateQueue;if(F!==null){b.updateQueue=null;var H=b.stateNode;H===null&&(H=b.stateNode=new Ng),F.forEach(function(Z){var _=Rp.bind(null,b,Z);H.has(Z)||(H.add(Z),Z.then(_,_))})}}function Tp(b,F){for(re=F;re!==null;){F=re;var H=F.deletions;if(H!==null)for(var Z=0;Z";case zl:return":has("+(Gl(b)||"")+")";case pr:return'[role="'+b.value+'"]';case Ua:return'"'+b.value+'"';case No:return'[data-testname="'+b.value+'"]';default:throw Error(a(365))}}function Mp(b,F){var H=[];b=[b,0];for(var Z=0;Z_&&(_=vt),Z&=~rt}if(Z=_,Z=mn()-Z,Z=(120>Z?120:480>Z?480:1080>Z?1080:1920>Z?1920:3e3>Z?3e3:4320>Z?4320:1960*Ug(Z/1960))-Z,10b?16:b,zs===null)var Z=!1;else{if(b=zs,zs=null,Wl=0,je&6)throw Error(a(331));var _=je;for(je|=4,re=b.current;re!==null;){var rt=re,vt=rt.child;if(re.flags&16){var Pt=rt.deletions;if(Pt!==null){for(var Vt=0;Vtmn()-nc?Ts(b,0):ic|=H),we(b,F)}function Pp(b,F){F===0&&(b.mode&1?(F=vo,vo<<=1,!(vo&130023424)&&(vo=4194304)):F=1);var H=Un();b=Wo(b,F),b!==null&&(mo(b,F,H),we(b,H))}function ca(b){var F=b.memoizedState,H=0;F!==null&&(H=F.retryLane),Pp(b,H)}function Rp(b,F){var H=0;switch(b.tag){case 13:var Z=b.stateNode,_=b.memoizedState;_!==null&&(H=_.retryLane);break;case 19:Z=b.stateNode;break;default:throw Error(a(314))}Z!==null&&Z.delete(F),Pp(b,H)}var uc;uc=function(b,F,H){if(b!==null)if(b.memoizedProps!==F.pendingProps||Ii.current)cr=!0;else{if(!(b.lanes&H)&&!(F.flags&128))return cr=!1,Dg(b,F,H);cr=!!(b.flags&131072)}else cr=!1,Ri&&F.flags&1048576&&Yd(F,Tl,F.index);switch(F.lanes=0,F.tag){case 2:var Z=F.type;b!==null&&(b.alternate=null,F.alternate=null,F.flags|=2),b=F.pendingProps;var _=qn(F,Ke.current);La(F,H),_=ci(null,F,Z,b,_,H);var rt=Uf();return F.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(F.tag=1,F.memoizedState=null,F.updateQueue=null,vn(Z)?(rt=!0,Cn(F)):rt=!1,F.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Ff(F),_.updater=Qh,F.stateNode=_,_._reactInternals=F,xo(F,Z,b,H),F=Yf(null,F,Z,!0,rt,H)):(F.tag=0,Ri&&rt&&_h(F),Hi(null,F,_,H),F=F.child),F;case 16:Z=F.elementType;t:{switch(b!==null&&(b.alternate=null,F.alternate=null,F.flags|=2),b=F.pendingProps,_=Z._init,Z=_(Z._payload),F.type=Z,_=F.tag=Lp(Z),b=An(Z,b),_){case 0:F=Zr(null,F,Z,b,H);break t;case 1:F=cp(null,F,Z,b,H);break t;case 11:F=op(null,F,Z,b,H);break t;case 14:F=lp(null,F,Z,An(Z.type,b),H);break t}throw Error(a(306,Z,""))}return F;case 0:return Z=F.type,_=F.pendingProps,_=F.elementType===Z?_:An(Z,_),Zr(b,F,Z,_,H);case 1:return Z=F.type,_=F.pendingProps,_=F.elementType===Z?_:An(Z,_),cp(b,F,Z,_,H);case 3:t:{if(dp(F),b===null)throw Error(a(387));Z=F.pendingProps,rt=F.memoizedState,_=rt.element,Of(b,F),Xr(F,Z,null,H);var vt=F.memoizedState;if(Z=vt.element,ht&&rt.isDehydrated)if(rt={element:Z,isDehydrated:!1,cache:vt.cache,transitions:vt.transitions},F.updateQueue.baseState=rt,F.memoizedState=rt,F.flags&256){_=Error(a(423)),F=pp(b,F,Z,H,_);break t}else if(Z!==_){_=Error(a(424)),F=pp(b,F,Z,H,_);break t}else for(ht&&(Pn=zh(F.stateNode.containerInfo),Jn=F,Ri=!0,Kr=null,To=!1),H=Zd(F,null,Z,H),F.child=H;H;)H.flags=H.flags&-3|4096,H=H.sibling;else{if(Eo(),Z===_){F=ln(b,F,H);break t}Hi(b,F,Z,H)}F=F.child}return F;case 5:return Jd(F),b===null&&Nf(F),Z=F.type,_=F.pendingProps,rt=b!==null?b.memoizedProps:null,vt=_.children,U(Z,_)?vt=null:rt!==null&&U(Z,rt)&&(F.flags|=32),fp(b,F),Hi(b,F,vt,H),F.child;case 6:return b===null&&Nf(F),null;case 13:return vp(b,F,H);case 4:return Bf(F,F.stateNode.containerInfo),Z=F.pendingProps,b===null?F.child=Co(F,null,Z,H):Hi(b,F,Z,H),F.child;case 11:return Z=F.type,_=F.pendingProps,_=F.elementType===Z?_:An(Z,_),op(b,F,Z,_,H);case 7:return Hi(b,F,F.pendingProps,H),F.child;case 8:return Hi(b,F,F.pendingProps.children,H),F.child;case 12:return Hi(b,F,F.pendingProps.children,H),F.child;case 10:t:{if(Z=F.type._context,_=F.pendingProps,rt=F.memoizedProps,vt=_.value,bf(F,Z,vt),rt!==null)if(fs(rt.value,vt)){if(rt.children===_.children&&!Ii.current){F=ln(b,F,H);break t}}else for(rt=F.child,rt!==null&&(rt.return=F);rt!==null;){var Pt=rt.dependencies;if(Pt!==null){vt=rt.child;for(var Vt=Pt.firstContext;Vt!==null;){if(Vt.context===Z){if(rt.tag===1){Vt=Dn(-1,H&-H),Vt.tag=2;var Qt=rt.updateQueue;if(Qt!==null){Qt=Qt.shared;var pe=Qt.pending;pe===null?Vt.next=Vt:(Vt.next=pe.next,pe.next=Vt),Qt.pending=Vt}}rt.lanes|=H,Vt=rt.alternate,Vt!==null&&(Vt.lanes|=H),Jh(rt.return,H,F),Pt.lanes|=H;break}Vt=Vt.next}}else if(rt.tag===10)vt=rt.type===F.type?null:rt.child;else if(rt.tag===18){if(vt=rt.return,vt===null)throw Error(a(341));vt.lanes|=H,Pt=vt.alternate,Pt!==null&&(Pt.lanes|=H),Jh(vt,H,F),vt=rt.sibling}else vt=rt.child;if(vt!==null)vt.return=rt;else for(vt=rt;vt!==null;){if(vt===F){vt=null;break}if(rt=vt.sibling,rt!==null){rt.return=vt.return,vt=rt;break}vt=vt.return}rt=vt}Hi(b,F,_.children,H),F=F.child}return F;case 9:return _=F.type,Z=F.pendingProps.children,La(F,H),_=Fi(_),Z=Z(_),F.flags|=1,Hi(b,F,Z,H),F.child;case 14:return Z=F.type,_=An(Z,F.pendingProps),_=An(Z.type,_),lp(b,F,Z,_,H);case 15:return hp(b,F,F.type,F.pendingProps,H);case 17:return Z=F.type,_=F.pendingProps,_=F.elementType===Z?_:An(Z,_),b!==null&&(b.alternate=null,F.alternate=null,F.flags|=2),F.tag=1,vn(Z)?(b=!0,Cn(F)):b=!1,La(F,H),Xd(F,Z,_),xo(F,Z,_,H),Yf(null,F,Z,!0,b,H);case 19:return yp(b,F,H);case 22:return up(b,F,H)}throw Error(a(156,F.tag))};function gu(b,F){return Xh(b,F)}function zg(b,F,H,Z){this.tag=b,this.key=H,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=F,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Z,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(b,F,H,Z){return new zg(b,F,H,Z)}function fc(b){return b=b.prototype,!(!b||!b.isReactComponent)}function Lp(b){if(typeof b=="function")return fc(b)?1:0;if(b!=null){if(b=b.$$typeof,b===u)return 11;if(b===c)return 14}return 2}function Gs(b,F){var H=b.alternate;return H===null?(H=Fr(b.tag,F,b.key,b.mode),H.elementType=b.elementType,H.type=b.type,H.stateNode=b.stateNode,H.alternate=b,b.alternate=H):(H.pendingProps=F,H.type=b.type,H.flags=0,H.subtreeFlags=0,H.deletions=null),H.flags=b.flags&14680064,H.childLanes=b.childLanes,H.lanes=b.lanes,H.child=b.child,H.memoizedProps=b.memoizedProps,H.memoizedState=b.memoizedState,H.updateQueue=b.updateQueue,F=b.dependencies,H.dependencies=F===null?null:{lanes:F.lanes,firstContext:F.firstContext},H.sibling=b.sibling,H.index=b.index,H.ref=b.ref,H}function yu(b,F,H,Z,_,rt){var vt=2;if(Z=b,typeof b=="function")fc(b)&&(vt=1);else if(typeof b=="string")vt=5;else t:switch(b){case p:return da(H.children,_,rt,F);case h:vt=8,_|=8;break;case o:return b=Fr(12,H,F,_|2),b.elementType=o,b.lanes=rt,b;case f:return b=Fr(13,H,F,_),b.elementType=f,b.lanes=rt,b;case s:return b=Fr(19,H,F,_),b.elementType=s,b.lanes=rt,b;case v:return kl(H,_,rt,F);default:if(typeof b=="object"&&b!==null)switch(b.$$typeof){case l:vt=10;break t;case n:vt=9;break t;case u:vt=11;break t;case c:vt=14;break t;case d:vt=16,Z=null;break t}throw Error(a(130,b==null?b:typeof b,""))}return F=Fr(vt,H,F,_),F.elementType=b,F.type=Z,F.lanes=rt,F}function da(b,F,H,Z){return b=Fr(7,b,Z,F),b.lanes=H,b}function kl(b,F,H,Z){return b=Fr(22,b,Z,F),b.elementType=v,b.lanes=H,b.stateNode={},b}function Vn(b,F,H){return b=Fr(6,b,null,F),b.lanes=H,b}function Or(b,F,H){return F=Fr(4,b.children!==null?b.children:[],b.key,F),F.lanes=H,F.stateNode={containerInfo:b.containerInfo,pendingChildren:null,implementation:b.implementation},F}function Gg(b,F,H,Z,_){this.tag=F,this.containerInfo=b,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=q,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wh(0),this.expirationTimes=Wh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wh(0),this.identifierPrefix=Z,this.onRecoverableError=_,ht&&(this.mutableSourceEagerHydrationData=null)}function bp(b,F,H,Z,_,rt,vt,Pt,Vt){return b=new Gg(b,F,H,Pt,Vt),F===1?(F=1,rt===!0&&(F|=8)):F=0,rt=Fr(3,null,null,F),b.current=rt,rt.stateNode=b,rt.memoizedState={element:Z,isDehydrated:H,cache:null,transitions:null},Ff(rt),b}function Kl(b){if(!b)return Rr;b=b._reactInternals;t:{if(C(b)!==b||b.tag!==1)throw Error(a(170));var F=b;do{switch(F.tag){case 3:F=F.stateNode.context;break t;case 1:if(vn(F.type)){F=F.stateNode.__reactInternalMemoizedMergedChildContext;break t}}F=F.return}while(F!==null);throw Error(a(171))}if(b.tag===1){var H=b.type;if(vn(H))return Pa(b,H,F)}return F}function Va(b){var F=b._reactInternals;if(F===void 0)throw typeof b.render=="function"?Error(a(188)):(b=Object.keys(b).join(","),Error(a(268,b)));return b=L(F),b===null?null:b.stateNode}function cc(b,F){if(b=b.memoizedState,b!==null&&b.dehydrated!==null){var H=b.retryLane;b.retryLane=H!==0&&H=Qt&&rt>=He&&_<=pe&&vt<=Ee){b.splice(F,1);break}else if(Z!==Qt||H.width!==Vt.width||Eevt){if(!(rt!==He||H.height!==Vt.height||pe_)){Qt>Z&&(Vt.width+=Qt-Z,Vt.x=Z),pe<_&&(Vt.width=_-Qt),b.splice(F,1);break}}else{He>rt&&(Vt.height+=He-rt,Vt.y=rt),EeH&&(H=vt)),vt ")+` - -No matching component was found for: - `)+b.join(" > ")}return null},i.getPublicRootInstance=function(b){if(b=b.current,!b.child)return null;switch(b.child.tag){case 5:return B(b.child.stateNode);default:return b.child.stateNode}},i.injectIntoDevTools=function(b){if(b={bundleType:b.bundleType,version:b.version,rendererPackageName:b.rendererPackageName,rendererConfig:b.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:Vg,findFiberByHostInstance:b.findFiberByHostInstance||Fp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")b=!1;else{var F=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(F.isDisabled||!F.supportsFiber)b=!0;else{try{Yh=F.inject(b),us=F}catch{}b=!!F.checkDCE}}return b},i.isAlreadyRendering=function(){return!1},i.observeVisibleRects=function(b,F,H,Z){if(!st)throw Error(a(363));b=tc(b,F);var _=Jt(b,H,Z).disconnect;return{disconnect:function(){_()}}},i.registerMutableSourceForHydration=function(b,F){var H=F._getVersion;H=H(F._source),b.mutableSourceEagerHydrationData==null?b.mutableSourceEagerHydrationData=[F,H]:b.mutableSourceEagerHydrationData.push(F,H)},i.runWithPriority=function(b,F){var H=hi;try{return hi=b,F()}finally{hi=H}},i.shouldError=function(){return null},i.shouldSuspend=function(){return!1},i.updateContainer=function(b,F,H,Z){var _=F.current,rt=Un(),vt=Ss(_);return H=Kl(H),F.context===null?F.context=H:F.pendingContext=H,F=Dn(rt,vt),F.payload={element:b},Z=Z===void 0?null:Z,Z!==null&&(F.callback=Z),Wr(_,F),b=br(_,vt,rt),b!==null&&yo(b,_,vt),vt},i};gw.exports=U7;var z7=gw.exports;const G7=gm(z7);var yw={exports:{}},xw={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(g){function e(z,W){var k=z.length;z.push(W);t:for(;0>>1,Q=z[J];if(0>>1;JT(U,k))VT(j,U)?(z[J]=j,z[V]=k,J=V):(z[J]=U,z[K]=k,J=K);else if(VT(j,k))z[J]=j,z[V]=k,J=V;else break t}}return W}function T(z,W){var k=z.sortIndex-W.sortIndex;return k!==0?k:z.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var E=performance;g.unstable_now=function(){return E.now()}}else{var a=Date,y=a.now();g.unstable_now=function(){return a.now()-y}}var t=[],r=[],p=1,h=null,o=3,l=!1,n=!1,u=!1,f=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(z){for(var W=i(r);W!==null;){if(W.callback===null)x(r);else if(W.startTime<=z)x(r),W.sortIndex=W.expirationTime,e(t,W);else break;W=i(r)}}function v(z){if(u=!1,d(z),!n)if(i(t)!==null)n=!0,B(m);else{var W=i(r);W!==null&&G(v,W.startTime-z)}}function m(z,W){n=!1,u&&(u=!1,s(A),A=-1),l=!0;var k=o;try{for(d(W),h=i(t);h!==null&&(!(h.expirationTime>W)||z&&!P());){var J=h.callback;if(typeof J=="function"){h.callback=null,o=h.priorityLevel;var Q=J(h.expirationTime<=W);W=g.unstable_now(),typeof Q=="function"?h.callback=Q:h===i(t)&&x(t),d(W)}else x(t);h=i(t)}if(h!==null)var Y=!0;else{var K=i(r);K!==null&&G(v,K.startTime-W),Y=!1}return Y}finally{h=null,o=k,l=!1}}var S=!1,M=null,A=-1,C=5,w=-1;function P(){return!(g.unstable_now()-wz||125J?(z.sortIndex=k,e(r,z),i(t)===null&&z===i(r)&&(u?(s(A),A=-1):u=!0,G(v,k-J))):(z.sortIndex=Q,e(t,z),n||l||(n=!0,B(m))),z},g.unstable_shouldYield=P,g.unstable_wrapCallback=function(z){var W=o;return function(){var k=o;o=W;try{return z.apply(this,arguments)}finally{o=k}}}})(xw);yw.exports=xw;var tM=yw.exports;const G1={},V7=g=>void Object.assign(G1,g);function H7(g,e){function i(p,{args:h=[],attach:o,...l},n){let u=`${p[0].toUpperCase()}${p.slice(1)}`,f;if(p==="primitive"){if(l.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const s=l.object;f=ju(s,{type:p,root:n,attach:o,primitive:!0})}else{const s=G1[u];if(!s)throw new Error(`R3F: ${u} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");f=ju(new s(...h),{type:p,root:n,attach:o,memoizedProps:{args:h}})}return f.__r3f.attach===void 0&&(f instanceof ei?f.__r3f.attach="geometry":f instanceof _n&&(f.__r3f.attach="material")),u!=="inject"&&ay(f,l),f}function x(p,h){let o=!1;if(h){var l,n;(l=h.__r3f)!=null&&l.attach?sy(p,h,h.__r3f.attach):h.isObject3D&&p.isObject3D&&(p.add(h),o=!0),o||(n=p.__r3f)==null||n.objects.push(h),h.__r3f||ju(h,{}),h.__r3f.parent=p,Ex(h),Zu(h)}}function T(p,h,o){let l=!1;if(h){var n,u;if((n=h.__r3f)!=null&&n.attach)sy(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){h.parent=p,h.dispatchEvent({type:"added"}),p.dispatchEvent({type:"childadded",child:h});const f=p.children.filter(c=>c!==h),s=f.indexOf(o);p.children=[...f.slice(0,s),h,...f.slice(s)],l=!0}l||(u=p.__r3f)==null||u.objects.push(h),h.__r3f||ju(h,{}),h.__r3f.parent=p,Ex(h),Zu(h)}}function E(p,h,o=!1){p&&[...p].forEach(l=>a(h,l,o))}function a(p,h,o){if(h){var l,n,u;if(h.__r3f&&(h.__r3f.parent=null),(l=p.__r3f)!=null&&l.objects&&(p.__r3f.objects=p.__r3f.objects.filter(v=>v!==h)),(n=h.__r3f)!=null&&n.attach)sM(p,h,h.__r3f.attach);else if(h.isObject3D&&p.isObject3D){var f;p.remove(h),(f=h.__r3f)!=null&&f.root&&J7(tm(h),h)}const c=(u=h.__r3f)==null?void 0:u.primitive,d=!c&&(o===void 0?h.dispose!==null:o);if(!c){var s;E((s=h.__r3f)==null?void 0:s.objects,h,d),E(h.children,h,d)}if(delete h.__r3f,d&&h.dispose&&h.type!=="Scene"){const v=()=>{try{h.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?tM.unstable_scheduleCallback(tM.unstable_IdlePriority,v):v()}Zu(p)}}function y(p,h,o,l){var n;const u=(n=p.__r3f)==null?void 0:n.parent;if(!u)return;const f=i(h,o,p.__r3f.root);if(p.children){for(const s of p.children)s.__r3f&&x(f,s);p.children=p.children.filter(s=>!s.__r3f)}p.__r3f.objects.forEach(s=>x(f,s)),p.__r3f.objects=[],p.__r3f.autoRemovedBeforeAppend||a(u,p),f.parent&&(f.__r3f.autoRemovedBeforeAppend=!0),x(u,f),f.raycast&&f.__r3f.eventCount&&tm(f).getState().internal.interaction.push(f),[l,l.alternate].forEach(s=>{s!==null&&(s.stateNode=f,s.ref&&(typeof s.ref=="function"?s.ref(f):s.ref.current=f))})}const t=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:G7({createInstance:i,removeChild:a,appendChild:x,appendInitialChild:x,insertBefore:T,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(p,h)=>{if(!h)return;const o=p.getState().scene;o.__r3f&&(o.__r3f.root=p,x(o,h))},removeChildFromContainer:(p,h)=>{h&&a(p.getState().scene,h)},insertInContainerBefore:(p,h,o)=>{if(!h||!o)return;const l=p.getState().scene;l.__r3f&&T(l,h,o)},getRootHostContext:()=>null,getChildHostContext:p=>p,finalizeInitialChildren(p){var h;return!!((h=p?.__r3f)!=null?h:{}).handlers},prepareUpdate(p,h,o,l){var n;if(((n=p?.__r3f)!=null?n:{}).primitive&&l.object&&l.object!==p)return[!0];{const{args:f=[],children:s,...c}=l,{args:d=[],children:v,...m}=o;if(!Array.isArray(f))throw new Error("R3F: the args prop must be an array!");if(f.some((M,A)=>M!==d[A]))return[!0];const S=ww(p,c,m,!0);return S.changes.length?[!1,S]:null}},commitUpdate(p,[h,o],l,n,u,f){h?y(p,l,u,f):ay(p,o)},commitMount(p,h,o,l){var n;const u=(n=p.__r3f)!=null?n:{};p.raycast&&u.handlers&&u.eventCount&&tm(p).getState().internal.interaction.push(p)},getPublicInstance:p=>p,prepareForCommit:()=>null,preparePortalMount:p=>ju(p.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(p){var h;const{attach:o,parent:l}=(h=p.__r3f)!=null?h:{};o&&l&&sM(l,p,o),p.isObject3D&&(p.visible=!1),Zu(p)},unhideInstance(p,h){var o;const{attach:l,parent:n}=(o=p.__r3f)!=null?o:{};l&&n&&sy(n,p,l),(p.isObject3D&&h.visible==null||h.visible)&&(p.visible=!0),Zu(p)},createTextInstance:t,hideTextInstance:t,unhideTextInstance:t,getCurrentEventPriority:()=>e?e():rf.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&zi.fun(performance.now)?performance.now:zi.fun(Date.now)?Date.now:()=>0,scheduleTimeout:zi.fun(setTimeout)?setTimeout:void 0,cancelTimeout:zi.fun(clearTimeout)?clearTimeout:void 0}),applyProps:ay}}var eM,iM;const ry=g=>"colorSpace"in g||"outputColorSpace"in g,Sw=()=>{var g;return(g=G1.ColorManagement)!=null?g:null},Tw=g=>g&&g.isOrthographicCamera,W7=g=>g&&g.hasOwnProperty("current"),Id=typeof window<"u"&&((eM=window.document)!=null&&eM.createElement||((iM=window.navigator)==null?void 0:iM.product)==="ReactNative")?te.useLayoutEffect:te.useEffect;function Ew(g){const e=te.useRef(g);return Id(()=>void(e.current=g),[g]),e}function X7({set:g}){return Id(()=>(g(new Promise(()=>null)),()=>g(!1)),[g]),null}class Mw extends te.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}Mw.getDerivedStateFromError=()=>({error:!0});const Cw="__default",nM=new Map,Y7=g=>g&&!!g.memoized&&!!g.changes;function Aw(g){var e;const i=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(g)?Math.min(Math.max(g[0],i),g[1]):g}const Fc=g=>{var e;return(e=g.__r3f)==null?void 0:e.root.getState()};function tm(g){let e=g.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const zi={obj:g=>g===Object(g)&&!zi.arr(g)&&typeof g!="function",fun:g=>typeof g=="function",str:g=>typeof g=="string",num:g=>typeof g=="number",boo:g=>typeof g=="boolean",und:g=>g===void 0,arr:g=>Array.isArray(g),equ(g,e,{arrays:i="shallow",objects:x="reference",strict:T=!0}={}){if(typeof g!=typeof e||!!g!=!!e)return!1;if(zi.str(g)||zi.num(g))return g===e;const E=zi.obj(g);if(E&&x==="reference")return g===e;const a=zi.arr(g);if(a&&i==="reference")return g===e;if((a||E)&&g===e)return!0;let y;for(y in g)if(!(y in e))return!1;if(E&&i==="shallow"&&x==="shallow"){for(y in T?e:g)if(!zi.equ(g[y],e[y],{strict:T,objects:"reference"}))return!1}else for(y in T?e:g)if(g[y]!==e[y])return!1;if(zi.und(y)){if(a&&g.length===0&&e.length===0||E&&Object.keys(g).length===0&&Object.keys(e).length===0)return!0;if(g!==e)return!1}return!0}};function k7(g){g.dispose&&g.type!=="Scene"&&g.dispose();for(const e in g)e.dispose==null||e.dispose(),delete g[e]}function ju(g,e){const i=g;return i.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},g}function Tx(g,e){let i=g;if(e.includes("-")){const x=e.split("-"),T=x.pop();return i=x.reduce((E,a)=>E[a],g),{target:i,key:T}}else return{target:i,key:e}}const rM=/-\d+$/;function sy(g,e,i){if(zi.str(i)){if(rM.test(i)){const E=i.replace(rM,""),{target:a,key:y}=Tx(g,E);Array.isArray(a[y])||(a[y]=[])}const{target:x,key:T}=Tx(g,i);e.__r3f.previousAttach=x[T],x[T]=e}else e.__r3f.previousAttach=i(g,e)}function sM(g,e,i){var x,T;if(zi.str(i)){const{target:E,key:a}=Tx(g,i),y=e.__r3f.previousAttach;y===void 0?delete E[a]:E[a]=y}else(x=e.__r3f)==null||x.previousAttach==null||x.previousAttach(g,e);(T=e.__r3f)==null||delete T.previousAttach}function ww(g,{children:e,key:i,ref:x,...T},{children:E,key:a,ref:y,...t}={},r=!1){var p;const h=(p=g?.__r3f)!=null?p:{},o=Object.entries(T),l=[];if(r){const u=Object.keys(t);for(let f=0;f{var s;if((s=g.__r3f)!=null&&s.primitive&&u==="object"||zi.equ(f,t[u]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(u))return l.push([u,f,!0,[]]);let c=[];u.includes("-")&&(c=u.split("-")),l.push([u,f,!1,c]);for(const d in T){const v=T[d];d.startsWith(`${u}-`)&&l.push([d,v,!1,d.split("-")])}});const n={...T};return h.memoizedProps&&h.memoizedProps.args&&(n.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(n.attach=h.memoizedProps.attach),{memoized:n,changes:l}}const K7=typeof process<"u"&&!1;function ay(g,e){var i,x,T;const E=(i=g.__r3f)!=null?i:{},a=E.root,y=(x=a==null||a.getState==null?void 0:a.getState())!=null?x:{},{memoized:t,changes:r}=Y7(e)?e:ww(g,e),p=E.eventCount;g.__r3f&&(g.__r3f.memoizedProps=t);for(let o=0;od[v],g),!(c&&c.set))){const[d,...v]=f.reverse();s=v.reverse().reduce((m,S)=>m[S],g),l=d}if(n===Cw+"remove")if(s.constructor){let d=nM.get(s.constructor);d||(d=new s.constructor,nM.set(s.constructor,d)),n=d[l]}else n=0;if(u)n?E.handlers[l]=n:delete E.handlers[l],E.eventCount=Object.keys(E.handlers).length;else if(c&&c.set&&(c.copy||c instanceof Mh)){if(Array.isArray(n))c.fromArray?c.fromArray(n):c.set(...n);else if(c.copy&&n&&n.constructor&&(K7?c.constructor.name===n.constructor.name:c.constructor===n.constructor))c.copy(n);else if(n!==void 0){const d=c instanceof fe;!d&&c.setScalar?c.setScalar(n):c instanceof Mh&&n instanceof Mh?c.mask=n.mask:c.set(n),!Sw()&&!y.linear&&d&&c.convertSRGBToLinear()}}else if(s[l]=n,s[l]instanceof Zi&&s[l].format===Er&&s[l].type===Ta){const d=s[l];ry(d)&&ry(y.gl)?d.colorSpace=y.gl.outputColorSpace:d.encoding=y.gl.outputEncoding}Zu(g)}if(E.parent&&g.raycast&&p!==E.eventCount){const o=tm(g).getState().internal,l=o.interaction.indexOf(g);l>-1&&o.interaction.splice(l,1),E.eventCount&&o.interaction.push(g)}return!(r.length===1&&r[0][0]==="onUpdate")&&r.length&&(T=g.__r3f)!=null&&T.parent&&Ex(g),g}function Zu(g){var e,i;const x=(e=g.__r3f)==null||(i=e.root)==null||i.getState==null?void 0:i.getState();x&&x.internal.frames===0&&x.invalidate()}function Ex(g){g.onUpdate==null||g.onUpdate(g)}function j7(g,e){g.manual||(Tw(g)?(g.left=e.width/-2,g.right=e.width/2,g.top=e.height/2,g.bottom=e.height/-2):g.aspect=e.width/e.height,g.updateProjectionMatrix(),g.updateMatrixWorld())}function Uv(g){return(g.eventObject||g.object).uuid+"/"+g.index+g.instanceId}function Z7(){var g;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return rf.DefaultEventPriority;switch((g=e.event)==null?void 0:g.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return rf.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rf.ContinuousEventPriority;default:return rf.DefaultEventPriority}}function Pw(g,e,i,x){const T=i.get(e);T&&(i.delete(e),i.size===0&&(g.delete(x),T.target.releasePointerCapture(x)))}function J7(g,e){const{internal:i}=g.getState();i.interaction=i.interaction.filter(x=>x!==e),i.initialHits=i.initialHits.filter(x=>x!==e),i.hovered.forEach((x,T)=>{(x.eventObject===e||x.object===e)&&i.hovered.delete(T)}),i.capturedMap.forEach((x,T)=>{Pw(i.capturedMap,e,x,T)})}function $7(g){function e(t){const{internal:r}=g.getState(),p=t.offsetX-r.initialClick[0],h=t.offsetY-r.initialClick[1];return Math.round(Math.sqrt(p*p+h*h))}function i(t){return t.filter(r=>["Move","Over","Enter","Out","Leave"].some(p=>{var h;return(h=r.__r3f)==null?void 0:h.handlers["onPointer"+p]}))}function x(t,r){const p=g.getState(),h=new Set,o=[],l=r?r(p.internal.interaction):p.internal.interaction;for(let s=0;s{const d=Fc(s.object),v=Fc(c.object);return!d||!v?s.distance-c.distance:v.events.priority-d.events.priority||s.distance-c.distance}).filter(s=>{const c=Uv(s);return h.has(c)?!1:(h.add(c),!0)});p.events.filter&&(u=p.events.filter(u,p));for(const s of u){let c=s.object;for(;c;){var f;(f=c.__r3f)!=null&&f.eventCount&&o.push({...s,eventObject:c}),c=c.parent}}if("pointerId"in t&&p.internal.capturedMap.has(t.pointerId))for(let s of p.internal.capturedMap.get(t.pointerId).values())h.has(Uv(s.intersection))||o.push(s.intersection);return o}function T(t,r,p,h){const o=g.getState();if(t.length){const l={stopped:!1};for(const n of t){const u=Fc(n.object)||o,{raycaster:f,pointer:s,camera:c,internal:d}=u,v=new pt(s.x,s.y,0).unproject(c),m=w=>{var P,L;return(P=(L=d.capturedMap.get(w))==null?void 0:L.has(n.eventObject))!=null?P:!1},S=w=>{const P={intersection:n,target:r.target};d.capturedMap.has(w)?d.capturedMap.get(w).set(n.eventObject,P):d.capturedMap.set(w,new Map([[n.eventObject,P]])),r.target.setPointerCapture(w)},M=w=>{const P=d.capturedMap.get(w);P&&Pw(d.capturedMap,n.eventObject,P,w)};let A={};for(let w in r){let P=r[w];typeof P!="function"&&(A[w]=P)}let C={...n,...A,pointer:s,intersections:t,stopped:l.stopped,delta:p,unprojectedPoint:v,ray:f.ray,camera:c,stopPropagation(){const w="pointerId"in r&&d.capturedMap.get(r.pointerId);if((!w||w.has(n.eventObject))&&(C.stopped=l.stopped=!0,d.hovered.size&&Array.from(d.hovered.values()).find(P=>P.eventObject===n.eventObject))){const P=t.slice(0,t.indexOf(n));E([...P,n])}},target:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},currentTarget:{hasPointerCapture:m,setPointerCapture:S,releasePointerCapture:M},nativeEvent:r};if(h(C),l.stopped===!0)break}}return t}function E(t){const{internal:r}=g.getState();for(const p of r.hovered.values())if(!t.length||!t.find(h=>h.object===p.object&&h.index===p.index&&h.instanceId===p.instanceId)){const o=p.eventObject.__r3f,l=o?.handlers;if(r.hovered.delete(Uv(p)),o!=null&&o.eventCount){const n={...p,intersections:t};l.onPointerOut==null||l.onPointerOut(n),l.onPointerLeave==null||l.onPointerLeave(n)}}}function a(t,r){for(let p=0;pE([]);case"onLostPointerCapture":return r=>{const{internal:p}=g.getState();"pointerId"in r&&p.capturedMap.has(r.pointerId)&&requestAnimationFrame(()=>{p.capturedMap.has(r.pointerId)&&(p.capturedMap.delete(r.pointerId),E([]))})}}return function(p){const{onPointerMissed:h,internal:o}=g.getState();o.lastEvent.current=p;const l=t==="onPointerMove",n=t==="onClick"||t==="onContextMenu"||t==="onDoubleClick",f=x(p,l?i:void 0),s=n?e(p):0;t==="onPointerDown"&&(o.initialClick=[p.offsetX,p.offsetY],o.initialHits=f.map(d=>d.eventObject)),n&&!f.length&&s<=2&&(a(p,o.interaction),h&&h(p)),l&&E(f);function c(d){const v=d.eventObject,m=v.__r3f,S=m?.handlers;if(m!=null&&m.eventCount)if(l){if(S.onPointerOver||S.onPointerEnter||S.onPointerOut||S.onPointerLeave){const M=Uv(d),A=o.hovered.get(M);A?A.stopped&&d.stopPropagation():(o.hovered.set(M,d),S.onPointerOver==null||S.onPointerOver(d),S.onPointerEnter==null||S.onPointerEnter(d))}S.onPointerMove==null||S.onPointerMove(d)}else{const M=S[t];M?(!n||o.initialHits.includes(v))&&(a(p,o.interaction.filter(A=>!o.initialHits.includes(A))),M(d)):n&&o.initialHits.includes(v)&&a(p,o.interaction.filter(A=>!o.initialHits.includes(A)))}}T(f,p,s,c)}}return{handlePointer:y}}const Rw=g=>!!(g!=null&&g.render),Lw=te.createContext(null),Q7=(g,e)=>{const i=I7((y,t)=>{const r=new pt,p=new pt,h=new pt;function o(s=t().camera,c=p,d=t().size){const{width:v,height:m,top:S,left:M}=d,A=v/m;c instanceof pt?h.copy(c):h.set(...c);const C=s.getWorldPosition(r).distanceTo(h);if(Tw(s))return{width:v/s.zoom,height:m/s.zoom,top:S,left:M,factor:1,distance:C,aspect:A};{const w=s.fov*Math.PI/180,P=2*Math.tan(w/2)*C,L=P*(v/m);return{width:L,height:P,top:S,left:M,factor:v/L,distance:C,aspect:A}}}let l;const n=s=>y(c=>({performance:{...c.performance,current:s}})),u=new jt;return{set:y,get:t,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(s=1)=>g(t(),s),advance:(s,c)=>e(s,c,t()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new N1,pointer:u,mouse:u,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const s=t();l&&clearTimeout(l),s.performance.current!==s.performance.min&&n(s.performance.min),l=setTimeout(()=>n(t().performance.max),s.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:o},setEvents:s=>y(c=>({...c,events:{...c.events,...s}})),setSize:(s,c,d,v,m)=>{const S=t().camera,M={width:s,height:c,top:v||0,left:m||0,updateStyle:d};y(A=>({size:M,viewport:{...A.viewport,...o(S,p,M)}}))},setDpr:s=>y(c=>{const d=Aw(s);return{viewport:{...c.viewport,dpr:d,initialDpr:c.viewport.initialDpr||d}}}),setFrameloop:(s="always")=>{const c=t().clock;c.stop(),c.elapsedTime=0,s!=="never"&&(c.start(),c.elapsedTime=0),y(()=>({frameloop:s}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:te.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(s,c,d)=>{const v=t().internal;return v.priority=v.priority+(c>0?1:0),v.subscribers.push({ref:s,priority:c,store:d}),v.subscribers=v.subscribers.sort((m,S)=>m.priority-S.priority),()=>{const m=t().internal;m!=null&&m.subscribers&&(m.priority=m.priority-(c>0?1:0),m.subscribers=m.subscribers.filter(S=>S.ref!==s))}}}}}),x=i.getState();let T=x.size,E=x.viewport.dpr,a=x.camera;return i.subscribe(()=>{const{camera:y,size:t,viewport:r,gl:p,set:h}=i.getState();if(t.width!==T.width||t.height!==T.height||r.dpr!==E){var o;T=t,E=r.dpr,j7(y,t),p.setPixelRatio(r.dpr);const l=(o=t.updateStyle)!=null?o:typeof HTMLCanvasElement<"u"&&p.domElement instanceof HTMLCanvasElement;p.setSize(t.width,t.height,l)}y!==a&&(a=y,h(l=>({viewport:{...l.viewport,...l.viewport.getCurrentViewport(y)}})))}),i.subscribe(y=>g(y)),i};let zv,_7=new Set,q7=new Set,tz=new Set;function oy(g,e){if(g.size)for(const{callback:i}of g.values())i(e)}function Oc(g,e){switch(g){case"before":return oy(_7,e);case"after":return oy(q7,e);case"tail":return oy(tz,e)}}let ly,hy;function uy(g,e,i){let x=e.clock.getDelta();for(e.frameloop==="never"&&typeof g=="number"&&(x=g-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=g),ly=e.internal.subscribers,zv=0;zv0)&&!((p=E.gl.xr)!=null&&p.isPresenting)&&(x+=uy(r,E))}if(i=!1,Oc("after",r),x===0)return Oc("tail",r),e=!1,cancelAnimationFrame(T)}function y(r,p=1){var h;if(!r)return g.forEach(o=>y(o.store.getState(),p));(h=r.gl.xr)!=null&&h.isPresenting||!r.internal.active||r.frameloop==="never"||(p>1?r.internal.frames=Math.min(60,r.internal.frames+p):i?r.internal.frames=2:r.internal.frames=1,e||(e=!0,requestAnimationFrame(a)))}function t(r,p=!0,h,o){if(p&&Oc("before",r),h)uy(r,h,o);else for(const l of g.values())uy(r,l.store.getState());p&&Oc("after",r)}return{loop:a,invalidate:y,advance:t}}function iz(){const g=te.useContext(Lw);if(!g)throw new Error("R3F: Hooks can only be used within the Canvas component!");return g}function nz(g,e=0){const i=iz(),x=i.getState().internal.subscribe,T=Ew(g);return Id(()=>x(T,e,i),[e,x,i]),null}const vf=new Map,{invalidate:aM,advance:oM}=ez(vf),{reconciler:vm,applyProps:ku}=H7(vf,Z7),Ku={objects:"shallow",strict:!1},rz=(g,e)=>{const i=typeof g=="function"?g(e):g;return Rw(i)?i:new x1({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...g})};function sz(g,e){const i=typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement;if(e){const{width:x,height:T,top:E,left:a,updateStyle:y=i}=e;return{width:x,height:T,top:E,left:a,updateStyle:y}}else if(typeof HTMLCanvasElement<"u"&&g instanceof HTMLCanvasElement&&g.parentElement){const{width:x,height:T,top:E,left:a}=g.parentElement.getBoundingClientRect();return{width:x,height:T,top:E,left:a,updateStyle:i}}else if(typeof OffscreenCanvas<"u"&&g instanceof OffscreenCanvas)return{width:g.width,height:g.height,top:0,left:0,updateStyle:i};return{width:0,height:0,top:0,left:0}}function az(g){const e=vf.get(g),i=e?.fiber,x=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const T=typeof reportError=="function"?reportError:console.error,E=x||Q7(aM,oM),a=i||vm.createContainer(E,rf.ConcurrentRoot,null,!1,null,"",T,null);e||vf.set(g,{fiber:a,store:E});let y,t=!1,r;return{configure(p={}){let{gl:h,size:o,scene:l,events:n,onCreated:u,shadows:f=!1,linear:s=!1,flat:c=!1,legacy:d=!1,orthographic:v=!1,frameloop:m="always",dpr:S=[1,2],performance:M,raycaster:A,camera:C,onPointerMissed:w}=p,P=E.getState(),L=P.gl;P.gl||P.set({gl:L=rz(h,g)});let O=P.raycaster;O||P.set({raycaster:O=new pw});const{params:I,...D}=A||{};if(zi.equ(D,O,Ku)||ku(O,{...D}),zi.equ(I,O.params,Ku)||ku(O,{params:{...O.params,...I}}),!P.camera||P.camera===r&&!zi.equ(r,C,Ku)){r=C;const k=C instanceof wd,J=k?C:v?new Ld(0,0,0,0,.1,1e3):new Yn(75,0,.1,1e3);k||(J.position.z=5,C&&ku(J,C),!P.camera&&!(C!=null&&C.rotation)&&J.lookAt(0,0,0)),P.set({camera:J}),O.camera=J}if(!P.scene){let k;l instanceof dm?k=l:(k=new dm,l&&ku(k,l)),P.set({scene:ju(k)})}if(!P.xr){var B;const k=(Y,K)=>{const U=E.getState();U.frameloop!=="never"&&oM(Y,!0,U,K)},J=()=>{const Y=E.getState();Y.gl.xr.enabled=Y.gl.xr.isPresenting,Y.gl.xr.setAnimationLoop(Y.gl.xr.isPresenting?k:null),Y.gl.xr.isPresenting||aM(Y)},Q={connect(){const Y=E.getState().gl;Y.xr.addEventListener("sessionstart",J),Y.xr.addEventListener("sessionend",J)},disconnect(){const Y=E.getState().gl;Y.xr.removeEventListener("sessionstart",J),Y.xr.removeEventListener("sessionend",J)}};typeof((B=L.xr)==null?void 0:B.addEventListener)=="function"&&Q.connect(),P.set({xr:Q})}if(L.shadowMap){const k=L.shadowMap.enabled,J=L.shadowMap.type;if(L.shadowMap.enabled=!!f,zi.boo(f))L.shadowMap.type=Vc;else if(zi.str(f)){var G;const Q={basic:sC,percentage:Jm,soft:Vc,variance:ks};L.shadowMap.type=(G=Q[f])!=null?G:Vc}else zi.obj(f)&&Object.assign(L.shadowMap,f);(k!==L.shadowMap.enabled||J!==L.shadowMap.type)&&(L.shadowMap.needsUpdate=!0)}const z=Sw();z&&("enabled"in z?z.enabled=!d:"legacyMode"in z&&(z.legacyMode=d)),t||ku(L,{outputEncoding:s?3e3:3001,toneMapping:c?Sa:qx}),P.legacy!==d&&P.set(()=>({legacy:d})),P.linear!==s&&P.set(()=>({linear:s})),P.flat!==c&&P.set(()=>({flat:c})),h&&!zi.fun(h)&&!Rw(h)&&!zi.equ(h,L,Ku)&&ku(L,h),n&&!P.events.handlers&&P.set({events:n(E)});const W=sz(g,o);return zi.equ(W,P.size,Ku)||P.setSize(W.width,W.height,W.updateStyle,W.top,W.left),S&&P.viewport.dpr!==Aw(S)&&P.setDpr(S),P.frameloop!==m&&P.setFrameloop(m),P.onPointerMissed||P.set({onPointerMissed:w}),M&&!zi.equ(M,P.performance,Ku)&&P.set(k=>({performance:{...k.performance,...M}})),y=u,t=!0,this},render(p){return t||this.configure(),vm.updateContainer(te.createElement(oz,{store:E,children:p,onCreated:y,rootElement:g}),a,null,()=>{}),E},unmount(){bw(g)}}}function oz({store:g,children:e,onCreated:i,rootElement:x}){return Id(()=>{const T=g.getState();T.set(E=>({internal:{...E.internal,active:!0}})),i&&i(T),g.getState().events.connected||T.events.connect==null||T.events.connect(x)},[]),te.createElement(Lw.Provider,{value:g},e)}function bw(g,e){const i=vf.get(g),x=i?.fiber;if(x){const T=i?.store.getState();T&&(T.internal.active=!1),vm.updateContainer(null,x,null,()=>{T&&setTimeout(()=>{try{var E,a,y,t;T.events.disconnect==null||T.events.disconnect(),(E=T.gl)==null||(a=E.renderLists)==null||a.dispose==null||a.dispose(),(y=T.gl)==null||y.forceContextLoss==null||y.forceContextLoss(),(t=T.gl)!=null&&t.xr&&T.xr.disconnect(),k7(T),vf.delete(g),e&&e(g)}catch{}},500)})}}vm.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:te.version});function mm(){return mm=Object.assign?Object.assign.bind():function(g){for(var e=1;e=0?x=setTimeout(t,e-p):(x=null,i||(y=g.apply(E,T),E=T=null))}var r=function(){E=this,T=arguments,a=Date.now();var p=i&&!x;return x||(x=setTimeout(t,e)),p&&(y=g.apply(E,T),E=T=null),y};return r.clear=function(){x&&(clearTimeout(x),x=null)},r.flush=function(){x&&(y=g.apply(E,T),E=T=null,clearTimeout(x),x=null)},r}Mx.debounce=Mx;var lz=Mx;const lM=gm(lz);function hz(g){let{debounce:e,scroll:i,polyfill:x,offsetSize:T}=g===void 0?{debounce:0,scroll:!1,offsetSize:!1}:g;const E=x||(typeof window>"u"?class{}:window.ResizeObserver);if(!E)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,y]=te.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),t=te.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a}),r=e?typeof e=="number"?e:e.scroll:null,p=e?typeof e=="number"?e:e.resize:null,h=te.useRef(!1);te.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[o,l,n]=te.useMemo(()=>{const c=()=>{if(!t.current.element)return;const{left:d,top:v,width:m,height:S,bottom:M,right:A,x:C,y:w}=t.current.element.getBoundingClientRect(),P={left:d,top:v,width:m,height:S,bottom:M,right:A,x:C,y:w};t.current.element instanceof HTMLElement&&T&&(P.height=t.current.element.offsetHeight,P.width=t.current.element.offsetWidth),Object.freeze(P),h.current&&!dz(t.current.lastBounds,P)&&y(t.current.lastBounds=P)};return[c,p?lM(c,p):c,r?lM(c,r):c]},[y,T,r,p]);function u(){t.current.scrollContainers&&(t.current.scrollContainers.forEach(c=>c.removeEventListener("scroll",n,!0)),t.current.scrollContainers=null),t.current.resizeObserver&&(t.current.resizeObserver.disconnect(),t.current.resizeObserver=null)}function f(){t.current.element&&(t.current.resizeObserver=new E(n),t.current.resizeObserver.observe(t.current.element),i&&t.current.scrollContainers&&t.current.scrollContainers.forEach(c=>c.addEventListener("scroll",n,{capture:!0,passive:!0})))}const s=c=>{!c||c===t.current.element||(u(),t.current.element=c,t.current.scrollContainers=Fw(c),f())};return fz(n,!!i),uz(l),te.useEffect(()=>{u(),f()},[i,n,l]),te.useEffect(()=>u,[]),[s,a,o]}function uz(g){te.useEffect(()=>{const e=g;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[g])}function fz(g,e){te.useEffect(()=>{if(e){const i=g;return window.addEventListener("scroll",i,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",i,!0)}},[g,e])}function Fw(g){const e=[];if(!g||g===document.body)return e;const{overflow:i,overflowX:x,overflowY:T}=window.getComputedStyle(g);return[i,x,T].some(E=>E==="auto"||E==="scroll")&&e.push(g),[...e,...Fw(g.parentElement)]}const cz=["x","y","top","bottom","left","right","width","height"],dz=(g,e)=>cz.every(i=>g[i]===e[i]);var pz=Object.defineProperty,vz=Object.defineProperties,mz=Object.getOwnPropertyDescriptors,hM=Object.getOwnPropertySymbols,gz=Object.prototype.hasOwnProperty,yz=Object.prototype.propertyIsEnumerable,uM=(g,e,i)=>e in g?pz(g,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):g[e]=i,fM=(g,e)=>{for(var i in e||(e={}))gz.call(e,i)&&uM(g,i,e[i]);if(hM)for(var i of hM(e))yz.call(e,i)&&uM(g,i,e[i]);return g},xz=(g,e)=>vz(g,mz(e)),cM,dM;typeof window<"u"&&((cM=window.document)!=null&&cM.createElement||((dM=window.navigator)==null?void 0:dM.product)==="ReactNative")?te.useLayoutEffect:te.useEffect;function Ow(g,e,i){if(!g)return;if(i(g)===!0)return g;let x=e?g.return:g.child;for(;x;){const T=Ow(x,e,i);if(T)return T;x=e?null:x.sibling}}function Dw(g){try{return Object.defineProperties(g,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return g}}const pM=console.error;console.error=function(){const g=[...arguments].join("");if(g?.startsWith("Warning:")&&g.includes("useContext")){console.error=pM;return}return pM.apply(this,arguments)};const V1=Dw(te.createContext(null));class Iw extends te.Component{render(){return te.createElement(V1.Provider,{value:this._reactInternals},this.props.children)}}function Sz(){const g=te.useContext(V1);if(g===null)throw new Error("its-fine: useFiber must be called within a !");const e=te.useId();return te.useMemo(()=>{for(const x of[g,g?.alternate]){if(!x)continue;const T=Ow(x,!1,E=>{let a=E.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(T)return T}},[g,e])}function Tz(){const g=Sz(),[e]=te.useState(()=>new Map);e.clear();let i=g;for(;i;){if(i.type&&typeof i.type=="object"){const T=i.type._context===void 0&&i.type.Provider===i.type?i.type:i.type._context;T&&T!==V1&&!e.has(T)&&e.set(T,te.useContext(Dw(T)))}i=i.return}return e}function Ez(){const g=Tz();return te.useMemo(()=>Array.from(g.keys()).reduce((e,i)=>x=>te.createElement(e,null,te.createElement(i.Provider,xz(fM({},x),{value:g.get(i)}))),e=>te.createElement(Iw,fM({},e))),[g])}const fy={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Mz(g){const{handlePointer:e}=$7(g);return{priority:1,enabled:!0,compute(i,x,T){x.pointer.set(i.offsetX/x.size.width*2-1,-(i.offsetY/x.size.height)*2+1),x.raycaster.setFromCamera(x.pointer,x.camera)},connected:void 0,handlers:Object.keys(fy).reduce((i,x)=>({...i,[x]:e(x)}),{}),update:()=>{var i;const{events:x,internal:T}=g.getState();(i=T.lastEvent)!=null&&i.current&&x.handlers&&x.handlers.onPointerMove(T.lastEvent.current)},connect:i=>{var x;const{set:T,events:E}=g.getState();E.disconnect==null||E.disconnect(),T(a=>({events:{...a.events,connected:i}})),Object.entries((x=E.handlers)!=null?x:[]).forEach(([a,y])=>{const[t,r]=fy[a];i.addEventListener(t,y,{passive:r})})},disconnect:()=>{const{set:i,events:x}=g.getState();if(x.connected){var T;Object.entries((T=x.handlers)!=null?T:[]).forEach(([E,a])=>{if(x&&x.connected instanceof HTMLElement){const[y]=fy[E];x.connected.removeEventListener(y,a)}}),i(E=>({events:{...E.events,connected:void 0}}))}}}}const Cz=te.forwardRef(function({children:e,fallback:i,resize:x,style:T,gl:E,events:a=Mz,eventSource:y,eventPrefix:t,shadows:r,linear:p,flat:h,legacy:o,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:s,camera:c,scene:d,onPointerMissed:v,onCreated:m,...S},M){te.useMemo(()=>V7(F7),[]);const A=Ez(),[C,w]=hz({scroll:!0,debounce:{scroll:50,resize:0},...x}),P=te.useRef(null),L=te.useRef(null);te.useImperativeHandle(M,()=>P.current);const O=Ew(v),[I,D]=te.useState(!1),[B,G]=te.useState(!1);if(I)throw I;if(B)throw B;const z=te.useRef(null);Id(()=>{const k=P.current;w.width>0&&w.height>0&&k&&(z.current||(z.current=az(k)),z.current.configure({gl:E,events:a,shadows:r,linear:p,flat:h,legacy:o,orthographic:l,frameloop:n,dpr:u,performance:f,raycaster:s,camera:c,scene:d,size:w,onPointerMissed:(...J)=>O.current==null?void 0:O.current(...J),onCreated:J=>{J.events.connect==null||J.events.connect(y?W7(y)?y.current:y:L.current),t&&J.setEvents({compute:(Q,Y)=>{const K=Q[t+"X"],U=Q[t+"Y"];Y.pointer.set(K/Y.size.width*2-1,-(U/Y.size.height)*2+1),Y.raycaster.setFromCamera(Y.pointer,Y.camera)}}),m?.(J)}}),z.current.render(te.createElement(A,null,te.createElement(Mw,{set:G},te.createElement(te.Suspense,{fallback:te.createElement(X7,{set:D})},e)))))}),te.useEffect(()=>{const k=P.current;if(k)return()=>bw(k)},[]);const W=y?"none":"auto";return te.createElement("div",mm({ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:W,...T}},S),te.createElement("div",{ref:C,style:{width:"100%",height:"100%"}},te.createElement("canvas",{ref:P,style:{display:"block"}},i)))}),Az=te.forwardRef(function(e,i){return te.createElement(Iw,null,te.createElement(Cz,mm({},e,{ref:i})))});function no(g,e={}){let i=te.useCallback(T=>e.keys?VO(g,e.keys,T):g.listen(T),[e.keys,g]),x=g.get.bind(g);return te.useSyncExternalStore(i,x,x)}const wz=[new Ks(-Math.PI/2,-Math.PI/2,-Math.PI/2),new Ks(0,Math.PI/2,0),new Ks(0,-Math.PI/2,-Math.PI/2),new Ks(Math.PI/2,Math.PI,Math.PI),new Ks(0,0,-Math.PI/2),new Ks(Math.PI,0,0)],Pz=({diceValues:g,isRolling:e,textures:i})=>{const x=te.useRef([]),T=te.useRef([]);return te.useEffect(()=>{const E=new tw,a=new fe(16776960);T.current=[new Qa({map:E.load(i.side1),color:a}),new Qa({map:E.load(i.side2),color:a}),new Qa({map:E.load(i.side3),color:a}),new Qa({map:E.load(i.side4),color:a}),new Qa({map:E.load(i.side5),color:a}),new Qa({map:E.load(i.side6),color:a})],x.current.forEach(y=>{y&&(y.material=T.current)})},[i]),nz(()=>{x.current.forEach((E,a)=>{if(E)if(e)E.rotation.x+=.2,E.rotation.y+=.2;else{const y=wz[g[a]-1];E.rotation.x=_v.lerp(E.rotation.x,y.x,.1),E.rotation.y=_v.lerp(E.rotation.y,y.y,.1),E.rotation.z=_v.lerp(E.rotation.z,y.z,.1)}})}),Xt.jsx(Xt.Fragment,{children:g.map((E,a)=>Xt.jsxs("mesh",{ref:y=>x.current[a]=y,position:[a*2-(g.length-1),0,0],children:[Xt.jsx("boxGeometry",{args:[1,1,1]}),T.current.length===6&&T.current.map((y,t)=>Xt.jsx("meshStandardMaterial",{attach:`material-${t}`,map:y.map},t))]},a))})},Rz=({styleClass:g,textures:e,diceCount:i})=>{const x=no($c);te.useEffect(()=>{OI("Dice"),II(e),DI({type:"ROLL_DICE",diceValues:Array(i).fill(1),isRolling:!1})},[e,i]);const T=()=>{xT(!0),setTimeout(()=>{const E=Array.from({length:i},()=>Math.floor(Math.random()*6)+1);console.log("New dice values:",E),iC(E),xT(!1);const a={diceValues:E};_e.emit("diceRollResult",a)},2e3)};return Xt.jsxs("div",{className:`flex flex-col items-center justify-center p-4 ${g}`,children:[Xt.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Dice Roller"}),Xt.jsxs(Az,{className:"w-full h-full",camera:{position:[0,0,5]},children:[Xt.jsx("ambientLight",{intensity:2.5}),Xt.jsx("pointLight",{position:[10,10,10]}),aT(x.action)&&Xt.jsx(Pz,{diceValues:x.action.diceValues,isRolling:x.action.isRolling,textures:x.textures})]}),aT(x.action)&&Xt.jsx("button",{onClick:T,className:`mt-4 p-2 border border-yellow-300 rounded text-yellow-400 ${x.action.isRolling?"opacity-50":""}`,disabled:x.action.isRolling,children:"Roll Dice"})]})};class Nw{constructor(e,i,x){this.scene=e,this.gridEngine=i,this.quadtree=x,this.cursor=this.scene.input.keyboard?.createCursorKeys(),this.initializeWASDKeys(),this.registerEventHandlers(),this.tooltip=this.scene.add.text(0,0,"Press [F]",{font:"16px Arial",backgroundColor:"#000000"}).setDepth(4).setPadding(3,2,2,3).setVisible(!1)}initializeWASDKeys(){const e=this.scene.input.keyboard;e&&(this.wasdKeys={W:e.addKey(Phaser.Input.Keyboard.KeyCodes.W),A:e.addKey(Phaser.Input.Keyboard.KeyCodes.A),S:e.addKey(Phaser.Input.Keyboard.KeyCodes.S),D:e.addKey(Phaser.Input.Keyboard.KeyCodes.D)})}handleConsume(e){const i=to(e);i&&i.consumable?(console.log(`Consuming item: ${i.name}`),bI(i),yT(i.id)):console.log(`Item ${e} is not consumable`)}handleEquip(e){const i=to(e);i&&(console.log(`Equipping item: ${i.name}`),TI("weapon",i.id))}handleUnequip(e){const i=to(e);i&&(console.log(`Unequipping item: ${i.name}`),EI("weapon"))}handleDiscard(e){console.log(`Discarding item: ${e}`),yT(e)}handleView(e){const i=to(e);if(i&&(console.log(`Viewing item: ${i.name} with ${i.slug}`),i.slug)){const x=`https://kbve.com/${i.slug}#${i.name.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")}`;window.open(x,"_blank")}}registerEventHandlers(){_e.on("itemAction",this.handleItemAction.bind(this));//! Broken -_e.on("playerMove",this.handlePlayerMove.bind(this)),_e.on("playerReward",this.handlePlayerReward.bind(this)),_e.on("playerDamage",this.handlePlayerCombatDamage.bind(this))}handleItemAction(e){if(e)switch(console.log(`Preparing Action: ${e.itemId} with ${e.action}`),e.action){case"consume":this.handleConsume(e.itemId);break;case"equip":this.handleEquip(e.itemId);break;case"unequip":this.handleUnequip(e.itemId);break;case"discard":this.handleDiscard(e.itemId);break;case"view":this.handleView(e.itemId);break;default:console.log(`Unknown action: ${e.action}`)}}handlePlayerReward(e){console.log("Rewarding the player"),e&&(_e.emit("notification",{title:"Success",message:e.message,notificationType:Rh.success}),SI(e.item))}handlePlayerCombatDamage(e){e&&(eC(parseInt(e.damage)),_e.emit("notification",{title:"Danger",message:`You taken ${e.damage} points of damage!`,notificationType:Rh.danger}))}handlePlayerMove(e){e&&this.gridEngine.moveTo("player",{x:e.x,y:e.y})}checkForNearbyObjects(){const i=this.gridEngine.getPosition("player"),x=i.x*48,T=i.y*48;this.quadtree.query(i).length>0?this.tooltip.setPosition(x,T-60).setVisible(!0):this.tooltip.setVisible(!1)}handleMovement(){if(!this.cursor)return;const e=this.cursor,i=this.wasdKeys;if(this.scene.input.keyboard?.addKey("F").isDown){const x=this.gridEngine.getPosition("player"),T=this.quadtree.query(x);for(const E of T)E.action()}(e.left.isDown||i.A.isDown)&&(e.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-left"):(e.left.isDown||i.A.isDown)&&(e.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-left"):(e.right.isDown||i.D.isDown)&&(e.up.isDown||i.W.isDown)?this.gridEngine.move("player","up-right"):(e.right.isDown||i.D.isDown)&&(e.down.isDown||i.S.isDown)?this.gridEngine.move("player","down-right"):e.left.isDown||i.A.isDown?this.gridEngine.move("player","left"):e.right.isDown||i.D.isDown?this.gridEngine.move("player","right"):e.up.isDown||i.W.isDown?this.gridEngine.move("player","up"):(e.down.isDown||i.S.isDown)&&this.gridEngine.move("player","down"),this.checkForNearbyObjects()}}class Bw extends Phaser.GameObjects.Container{constructor(e,i,x,T){const E=i.x,a=i.y-i.height+10;super(e,E,a),this.sprite=i;const y=150,t=40+T.length*20;this.background=e.add.rectangle(0,0,y,t,0,.7),this.text=e.add.text(0,-t/2+10,x,{fontSize:"12px",color:"#ffffff"}).setOrigin(.5),this.buttons=T.map((r,p)=>{const h=e.add.text(0,-t/2+30+p*20,r.label,{fontSize:"12px",color:"#00ff00"}).setOrigin(.5);return h.setInteractive({useHandCursor:!0}),h.on("pointerdown",r.callback),h}),this.add(this.background),this.add(this.text),this.buttons.forEach(r=>this.add(r)),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(e,i,x,T){i.setInteractive(),i.on("pointerover",E=>{const a={npcId:i.name,npcName:x,actions:T.map(t=>t.label),coords:{x:E.x,y:E.y}};if(_e.emit("npcInteraction",a),!i.getData("tooltipMenu")){const t=new Bw(e,i,x,T);i.setData("tooltipMenu",t)}const y=i.getData("tooltipMenu");y.setVisible(!0),y.updatePosition()}),i.on("pointerout",()=>{const E=i.getData("tooltipMenu");E&&E.setVisible(!1)})}static updateAllTooltipPositions(e){e.children.list.forEach(i=>{if(i instanceof Phaser.GameObjects.Sprite){const x=i.getData("tooltipMenu");x&&x.updatePosition()}})}}let sG=class extends Phaser.GameObjects.Sprite{};function Lz(g,e,i,x){const y=g.add.graphics();y.fillStyle(16777215,1),y.fillRoundedRect(0,0,200,60,16),y.setDepth(99);const t=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});t.setOrigin(.5),t.setWordWrapWidth(200-10*2),t.setDepth(100);const r=g.add.container(0,0,[y,t]);return r.setDepth(100),e.messageBubble=r,Fz(e),g.time.addEvent({delay:x,callback:()=>{r.destroy(),e.messageBubble===r&&(e.messageBubble=void 0)},callbackScope:g}),r}function bz(g,e,i){const a=g.add.graphics();a.fillStyle(16777215,1),a.fillRoundedRect(0,0,200,60,16),a.setDepth(99);const y=g.add.text(100,30,i,{fontFamily:"Arial",fontSize:16,color:"#000000"});y.setOrigin(.5),y.setWordWrapWidth(200-10*2),y.setDepth(100);const t=g.add.container(0,0,[a,y]);return t.setDepth(100),e.textBubble=t,Cx(e),t}function Cx(g){const e=g.textBubble;e&&(e.x=g.x,e.y=g.y-g.height-e.height/2)}function Fz(g){const e=g.messageBubble;e&&(e.x=g.x,e.y=g.y-g.height-e.height/2)}class Oz{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(e){return this.actionHandlers[e]}talkToNPC(e){console.log(`Talking to NPC with ID: ${e.npcId}`)}tradeWithNPC(e){console.log(`Trading with NPC with ID: ${e.npcId}`)}moveToNPC(e){const x=e.data?.coords||{x:10,y:15};_e.emit("playerMove",x)}stealFromNPC(e){console.log(`Attempting to steal from NPC with ID: ${e.npcId}`);const i={npcId:e.npcId,npcName:e.npcName,data:e.data};_e.emit("playerSteal",i)}startCombat(e){console.log(`Starting combat with NPC with ID: ${e.npcId}`)}checkFish(e){console.log(`Checking fish for NPC with ID: ${e.npcId}`)}attachNPCEvent(e,i,x,T){e.setInteractive(),e.on("pointerover",E=>{const a={npcId:e.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};_e.emit("npcInteraction",a)}),e.on("pointerout",()=>{}),e.on("pointerdown",E=>{const a={npcId:e.name||"",npcName:i,actions:x.map(y=>y.label),data:T||{},coords:{x:E.x,y:E.y}};console.log(`Click Registered at X: ${a.coords.x} Y: ${a.coords.y}`),_e.emit("npcInteractionClick",a,1e3)})}}const Uw=new Oz;function zw(g){return+g[g.length-1]}function Gw(g){return g.startsWith("monster_bird_")&&!g.startsWith("monster_bird_shadow")}function Vw(g,e,i,x,T){const E=[];for(let a=0;a<10;a++){const y=g.add.sprite(0,0,"monster_bird");y.setCrop(e,i,x,T),y.scale=3,E.push(y)}return E}function Hw(g){return Vw(g,0,0,61,47)}function Ww(g){return Vw(g,22,47,16,10)}function Xw(g){g.anims.create({key:"bird",frames:g.anims.generateFrameNumbers("monster_bird",{start:0,end:2}),frameRate:10,repeat:-1,yoyo:!0})}class Dz extends Gm.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}),gI()}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 oG=class extends Bc.GameObjects.Sprite{textBubble;tooltip};class Iz extends Gm.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"SandCity"});const e={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new vh(e)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57}),_e.emit("notification",{title:"Success",message:`You arrived safely to SandCity Passport: ${_x()}`,notificationType:Rh.success})}create(){const e=this.make.tilemap({key:"cloud-city-map"});e.addTilesetImage("Cloud City","tiles");for(let E=0;E({id:"monster_bird_"+a,sprite:E,startPosition:{x:7,y:7+a},speed:5,collides:!1})),...this.monsterBirdShadows.map((E,a)=>({id:"monster_bird_shadow_"+a,sprite:E,startPosition:{x:7,y:7+a},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(e,x),this.loadRanges(),this.playerController=new Nw(this,this.gridEngine,this.quadtree),Lz(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 E=0;E<10;E++)this.gridEngine.moveRandomly("monster_bird_"+E,1e3,10);this.gridEngine.positionChangeStarted().subscribe(({charId:E,exitTile:a,enterTile:y})=>{Gw(E)&&this.gridEngine.moveTo("monster_bird_shadow_"+zw(E),{x:y.x,y:y.y})});const T=(E,a,y)=>{const t=this.gridEngine.getPosition(E.name);Uw.attachNPCEvent(E,a,y,{coords:t})};T(this.npcSprite,"FisherMan",[{label:"Talk"},{label:"Trade"},{label:"Move to"},{label:"Steal"},{label:"Combat"}]),T(this.fishNpcSprite,"Fish NPC Actions",[{label:"Check Fish"},{label:"Move to"}]),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const e=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};_e.emit("charEvent",i)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:()=>{const i={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"};_e.emit("charEvent",i)}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};_e.emit("charEvent",i)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={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"};_e.emit("charEvent",i)}}];for(const i of e)this.quadtree.insert(i)}update(){this.playerController?.handleMovement()}}class hG extends Bc.GameObjects.Sprite{textBubble}class Nz extends Gm.Scene{npcSprite;fishNpcSprite;monsterBirdSprites=[];monsterBirdShadows=[];cursor;gridEngine;quadtree;playerController;constructor(){super({key:"CloudCity"});const e={xMin:0,xMax:20,yMin:0,yMax:20};this.quadtree=new vh(e)}preload(){this.load.spritesheet("monster_bird","/assets/monster/bird_original.png",{frameWidth:61,frameHeight:57})}create(){const e=this.make.tilemap({key:"cloud-city-map-large"});e.addTilesetImage("cloud_tileset","cloud-city-tiles");for(let T=0;T({id:"monster_bird_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1})),...this.monsterBirdShadows.map((T,E)=>({id:"monster_bird_shadow_"+E,sprite:T,startPosition:{x:7,y:7+E},speed:5,collides:!1}))],numberOfDirections:8};this.gridEngine.create(e,x),this.loadRanges(),this.playerController=new Nw(this,this.gridEngine,this.quadtree),bz(this,this.npcSprite,"Enter the sand pit to start fishing! Go near it and press F!"),this.gridEngine.moveRandomly("npc",1500,3);for(let T=0;T<10;T++)this.gridEngine.moveRandomly("monster_bird_"+T,1e3,20);this.gridEngine.positionChangeStarted().subscribe(({charId:T,exitTile:E,enterTile:a})=>{Gw(T)&&this.gridEngine.moveTo("monster_bird_shadow_"+zw(T),{x:a.x,y:a.y})}),window.__GRID_ENGINE__=this.gridEngine}loadRanges(){const e=[{name:"well",bounds:{xMin:2,xMax:5,yMin:10,yMax:14},action:()=>{const i={message:"Seems like there are no fish in the sand pits. You know null, this area could be fixed up a bit too."};_e.emit("charEvent",i)}},{name:"sign",bounds:{xMin:2,xMax:5,yMin:2,yMax:5},action:async()=>{try{const T={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"};_e.emit("charEvent",T)}catch(i){console.error("Error fetching data:",i);const x={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"};_e.emit("charEvent",x)}}},{name:"building",bounds:{xMin:13,xMax:13,yMin:6,yMax:7},action:()=>{const i={message:"Sorry, we are closed!",character_name:"Evee The BarKeep",character_image:"/assets/npc/barkeep.webp",background_image:"/assets/background/animebar.webp"};_e.emit("charEvent",i)}},{name:"tombstone",bounds:{xMin:7,xMax:10,yMin:9,yMax:10},action:()=>{const i={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"};_e.emit("charEvent",i)}}];for(const i of e)this.quadtree.insert(i)}update(){this.playerController?.handleMovement(),this.npcSprite&&this.npcSprite.textBubble&&Cx(this.npcSprite),this.fishNpcSprite&&this.fishNpcSprite.textBubble&&Cx(this.fishNpcSprite)}}const Bz=nm.div` - // Your style here -`;function Uz(){const g=te.useRef(null);return te.useEffect(()=>{if(g.current){const e=g.current,x={...{title:"CryptoThrone",render:{antialias:!1},scale:{mode:Bc.Scale.RESIZE,min:{width:1024,height:768},max:{width:1600,height:1200},zoom:1},type:Bc.AUTO,transparent:!0,width:800,height:600,physics:{default:"arcade",arcade:{gravity:{x:0,y:0},debug:!1}},plugins:{scene:[{key:"gridEngine",plugin:zO,mapping:"gridEngine"}]},scene:[Dz,Iz,Nz],input:{mouse:{preventDefaultWheel:!1},touch:{capture:!1}}},parent:e},T=new Bc.Game(x);return()=>{T.destroy(!0)}}},[]),Xt.jsx(Bz,{children:Xt.jsx("div",{ref:g})})}const vM=Ax({message:""}),zz=()=>{const g=no(vM);te.useEffect(()=>{const i=x=>{if(x){vM.set(x);const T=document.querySelector("#hs-stacked-overlays");T&&(T.classList.remove("hidden"),T.classList.add("open"))}};return _e.on("charEvent",i),()=>{_e.off("charEvent",i)}},[]);const e=()=>{const i=document.querySelector("#hs-stacked-overlays");i&&(i.classList.add("hidden"),i.classList.remove("open"))};return Xt.jsx(Xt.Fragment,{children:Xt.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:Xt.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:Xt.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(${g.background_image||"https://kbve.com/assets/img/curved-images/wave.jpg"})`},children:[Xt.jsxs("div",{className:"w-full lg:w-1/3 p-4 rounded-l-xl flex flex-col items-center justify-center",children:[Xt.jsx("h3",{className:"font-bold text-yellow-400 bg-zinc-950/80 rounded-2xl text-center mb-4",children:`${g.character_name||"NPC"}`}),Xt.jsx("img",{src:g.character_image||"/assets/npc/barkeep.webp",alt:"Character",className:"w-full h-auto rounded-md"})]}),Xt.jsxs("div",{className:"w-full lg:w-2/3 p-4 bg-cover bg-center rounded-r-xl",children:[Xt.jsxs("div",{className:"flex justify-between items-center pb-3 border-b",children:[Xt.jsx("h3",{className:"font-bold text-yellow-400",children:""}),Xt.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:e,children:[Xt.jsx("span",{className:"sr-only",children:"Close"}),Xt.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:[Xt.jsx("path",{d:"M18 6 6 18"}),Xt.jsx("path",{d:"m6 6 12 12"})]})]})]}),Xt.jsx("div",{className:"p-4 overflow-y-auto",children:Xt.jsx("p",{className:"mt-1 mb-2 text-yellow-400 bg-zinc-950/80 rounded-xl p-4",children:g.message||"No Message"})}),Xt.jsx("div",{className:"flex justify-end items-center gap-x-2 py-3 px-4 border-t",children:Xt.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:e,children:[Xt.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"}),Xt.jsx("span",{className:"relative",children:"Okay."})]})})]})]})})})})},Gz=(g,e)=>{const i=to(g);return i?Xt.jsxs("div",{style:{top:e.y,left:e.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[Xt.jsx("p",{className:"text-sm font-semibold",children:i.name}),Xt.jsxs("p",{className:"text-xs",children:["Type: ",i.type]}),Xt.jsxs("p",{className:"text-xs",children:["Bonuses: ",JSON.stringify(i.bonuses)]}),Xt.jsxs("p",{className:"text-xs",children:["Durability: ",i.durability]}),Xt.jsxs("p",{className:"text-xs",children:["Weight: ",i.weight]})]}):null},Vz=(g,e,i,x)=>Xt.jsx("ul",{className:"grid grid-cols-8 gap-2",children:Object.keys(g).map(T=>{const E=g[T];return Hz(E,e,i,x)})}),Hz=(g,e,i,x)=>{if(!g)return Xt.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 T=to(g);return T?Xt.jsxs("li",{className:"text-sm relative",onMouseEnter:E=>e(T.id,E),onMouseLeave:i,onClick:E=>x(T.id,E),children:[T.name," (",T.type,") - Bonuses: ",JSON.stringify(T.bonuses)," - Durability: ",T.durability," - Weight: ",T.weight]},T.id):null},Wz=(g,e,i,x)=>Xt.jsx("ul",{className:"grid grid-cols-8 gap-1",children:g.map((T,E)=>{const a=to(T);return a?Xt.jsx("li",{className:"text-sm relative hover:scale-[1.3] transition ease-in-out duration-100",onMouseEnter:y=>e(a.id,y),onMouseLeave:i,onClick:y=>x(a.id,y),children:Xt.jsx("img",{src:a.img,alt:a.name,style:{width:"32px",height:"32px"},className:"inline-block border border-yellow-400/50"})},E):null})}),Xz=()=>{const g=no(Ni);no(om),no(mI),no(or),te.useEffect(()=>{const r=p=>{};return _e.on("playerEvent",r),()=>{_e.off("playerEvent",r)}},[]);const e=(r,p)=>{xc("tooltipItem",{id:r,position:{x:p.clientX+10,y:p.clientY-150}})},i=()=>{xc("tooltipItem",{...Ql("tooltipItem"),id:null})},x=(r,p)=>{xc("submenuItem",{id:r,position:{x:p.clientX,y:p.clientY-150}})},T=()=>{xc("submenuItem",{...Ql("submenuItem"),id:null})},E=(r,p)=>{const h=to(r);if(h){const o={itemId:h.id,action:p};_e.emit("itemAction",o),T()}};if(!g||!g.stats)return null;const a=Ql("submenuItem"),y=a.id?FI(a.id):[],t=Ql("tooltipItem");return Xt.jsxs("div",{className:"fixed top-24 left-3 w-[350px] p-4 bg-zinc-800 text-yellow-400 border border-yellow-300 rounded-lg z-20 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",children:[Xt.jsx("button",{onClick:()=>xc("isStatsMenuCollapsed",!Ql("isStatsMenuCollapsed")),className:"bg-yellow-500 text-white p-2 rounded",children:Ql("isStatsMenuCollapsed")?Xt.jsx(BI,{styleClass:"w-8"}):Xt.jsx(NI,{styleClass:"w-8"})}),Xt.jsxs("div",{className:`transition transform duration-1000 ease-in-out ${Ql("isStatsMenuCollapsed")?"max-h-0 overflow-hidden":"max-h-screen"}`,children:[Xt.jsxs("div",{className:"mb-4",children:[Xt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Stats"}),Xt.jsx("p",{className:"text-sm text-green-400",children:`HP: ${g.stats.health||"0"} / ${g.stats.maxHealth}`}),Xt.jsx("p",{className:"text-sm text-blue-400",children:`MP: ${g.stats.mana||"0"} / ${g.stats.maxMana}`}),Xt.jsx("p",{className:"text-sm text-yellow-400",children:`EP: ${g.stats.energy||"0"} / ${g.stats.maxEnergy}`})]}),Xt.jsxs("div",{className:"mb-4",children:[Xt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"User Information"}),Xt.jsx("p",{className:"text-sm",children:g.stats.username||"Guest"})]}),Xt.jsxs("div",{className:"mb-4",children:[Xt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"General Information"}),Xt.jsx("p",{className:"text-sm",children:""})]}),Xt.jsxs("div",{className:"mb-4",children:[Xt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Inventory"}),Wz(g.inventory.backpack,e,i,x)]}),Xt.jsxs("div",{className:"mb-4",children:[Xt.jsx("h2",{className:"text-lg font-semibold mb-2",children:"Equipment"}),Vz(g.inventory.equipment,e,i,x)]}),t.id&&Gz(t.id,t.position),a.id&&Xt.jsxs("div",{style:{top:a.position.y,left:a.position.x},className:"absolute bg-gray-700 text-white p-2 rounded shadow-lg z-50",children:[Xt.jsx("button",{onClick:T,className:"absolute top-1 right-1 translate-x-6 bg-yellow-400 p-1 text-white hover:text-gray-400",children:"X"}),Xt.jsx("p",{className:"text-sm strong",children:"Actions:"}),Xt.jsxs("ul",{className:"text-xs",children:[y.map(r=>Xt.jsx("li",{onClick:()=>a.id&&E(a.id,r),className:"cursor-pointer hover:bg-gray-600",children:r.charAt(0).toUpperCase()+r.slice(1)},r)),Xt.jsx("li",{onClick:T,className:"cursor-pointer hover:bg-gray-600",children:"Close"})]})]})]})]})},cy=Ax(null),dy=Ax(null),Yz=()=>{const g=no(cy),[e,i]=te.useState({x:0,y:0});te.useEffect(()=>{const y=t=>{t&&(cy.set(t),i(x(t.coords.x,t.coords.y)))};return _e.on("npcInteractionClick",y),()=>{_e.off("npcInteractionClick",y)}},[]);const x=(y,t)=>{let n=y+250,u=t+250;return n+200>window.innerWidth-10&&(n=window.innerWidth-200-10),u+200>window.innerHeight-10&&(u=window.innerHeight-200-10),n<10&&(n=10),u<10&&(u=10),{x:n,y:u}},T=y=>{if(g){const t=Uw.getActionHandler(y);t&&(t(g),E())}},E=()=>{cy.set(null)},a=()=>{if(!g)return null;const{npcName:y,actions:t,npcId:r}=g,{x:p,y:h}=e;return Xt.jsxs("div",{className:"absolute bg-zinc-900 border border-yellow-300 rounded-md p-2 z-50 transition transform ease-in-out duration-500 opacity-50 hover:opacity-100",style:{left:`${p}px`,top:`${h}px`,transform:"translate(-50%, -100%)"},children:[Xt.jsxs("div",{className:"flex justify-between items-center mb-2",children:[Xt.jsx("h3",{className:"font-bold text-sm",children:y}),Xt.jsx("button",{onClick:E,className:"text-xs font-bold m-1 text-yellow-300 hover:text-yellow-500",children:"X"})]}),t.map((o,l)=>Xt.jsx("button",{onClick:()=>T(o),className:"block w-full text-xs py-1 px-2 mb-1 bg-yellow-500 hover:bg-yellow-400 rounded",children:o},l)),Xt.jsx("button",{onClick:E,className:"block w-full text-xs py-1 px-2 mt-2 bg-red-500 hover:bg-red-600 rounded text-white",children:"Close"})]},r)};return Xt.jsx("div",{children:a()})},kz=()=>{const g=no($l);te.useEffect(()=>{const i=x=>{if(x){const T=Date.now()+Math.random();$l.set([...$l.get(),{id:T,...x}]),setTimeout(()=>{$l.set($l.get().filter(E=>E.id!==T))},5e3)}};return _e.on("notification",i),()=>{_e.off("notification",i)}},[]);const e=i=>{$l.set($l.get().filter(x=>x.id!==i))};return Xt.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 m-4 space-y-2",children:Array.isArray(g)&&g.map(i=>Xt.jsx("div",{className:`hs-removing:translate-x-5 hs-removing:opacity-0 transition duration-300 max-w-xs border rounded-xl shadow-lg ${i.notificationType.color}`,role:"alert",children:Xt.jsxs("div",{className:"flex p-4",children:[Xt.jsx("img",{src:i.notificationType.imgUrl,alt:i.notificationType.type,className:"flex-shrink-0 size-4"}),Xt.jsxs("div",{className:"ms-2",children:[Xt.jsx("h3",{className:"text-sm font-bold",children:i.title}),Xt.jsx("p",{className:"text-sm",children:i.message})]}),Xt.jsx("div",{className:"ms-auto",children:Xt.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:()=>e(i.id),children:[Xt.jsx("span",{className:"sr-only",children:"Close"}),Xt.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:[Xt.jsx("path",{d:"M18 6 6 18"}),Xt.jsx("path",{d:"m6 6 12 12"})]})]})})]})},i.id))})},Kz=()=>{const g=no(dy),[e,i]=te.useState([]),[x,T]=te.useState(null);te.useEffect(()=>{const y=r=>{r&&dy.set(r)},t=r=>{r&&i(r.diceValues)};return _e.on("playerSteal",y),_e.on("diceRollResult",t),()=>{_e.off("playerSteal",y),_e.off("diceRollResult",t)}},[]),te.useEffect(()=>{e.length>0&&E(e)},[e]);const E=y=>{const t=y.reduce((o,l)=>o+l,0);if(T(t),!g)return;let r="",p="";switch(!0){case t===12:r="01J27QABD2GPFNRVK69S51HSGB",p=`You successfully stole a ${r}!`;break;case t===11:r="01J27QN2KZG1RDZW4CE9Q9Z3YQ",p=`You successfully stole a ${r}!`;break;case t===10:r="01J269PK47V1DWX2S1251DEASD",p=`You successfully stole a ${r}!`;break;case t===9:r="Blue Shark",p=`You successfully stole a ${r}!`;break;case t>=7:r="Salmon",p=`You successfully stole a ${r}!`;break;case t===2:_e.emit("notification",{title:"Danger",message:`You crit failed to steal from ${g.npcName}!`,notificationType:Rh.danger}),_e.emit("playerDamage",{damage:"5"});break;default:_e.emit("notification",{title:"Danger",message:`You failed to steal from ${g.npcName}!`,notificationType:Rh.danger}),_e.emit("playerDamage",{damage:"1"});return}const h=yI(r);h?_e.emit("playerReward",{message:p,item:h}):console.warn("Item not found in ItemDB")},a=()=>{iC([]),i([]),T(null),dy.set(null)};return g?Xt.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 bg-zinc-800 bg-opacity-50",children:Xt.jsxs("div",{className:"bg-zinc-800 p-4 rounded-lg shadow-lg max-w-xs w-full",children:[Xt.jsx(jz,{npcName:g.npcName,roll:x}),Xt.jsx(Jz,{}),Xt.jsx($z,{handleClose:a})]})}):null},jz=({npcName:g,roll:e})=>Xt.jsxs("div",{children:[Xt.jsx("h2",{className:"text-lg text-yellow-400 font-bold mb-4",children:"Steal Attempt"}),Xt.jsxs("p",{className:"mb-4",children:["Roll the dice to steal from ",g,". You need a total of 7 or higher to succeed."]}),e!==null&&Xt.jsxs("p",{className:"mb-4",children:["Your roll: ",e]})]}),Zz=()=>Xt.jsx(Rz,{textures:{side1:"/assets/items/set/dice/dice1.png",side2:"/assets/items/set/dice/dice2.png",side3:"/assets/items/set/dice/dice3.png",side4:"/assets/items/set/dice/dice4.png",side5:"/assets/items/set/dice/dice5.png",side6:"/assets/items/set/dice/dice6.png"},styleClass:"h-96",diceCount:2}),Jz=te.memo(Zz),$z=({handleClose:g})=>Xt.jsx("button",{onClick:g,className:"block w-full py-2 bg-red-500 text-white rounded hover:bg-red-700 mt-2",children:"Close"}),Qz=nm.div` - // Your style here -`;function uG(){return Xt.jsxs(Qz,{children:[Xt.jsx(Xz,{}),Xt.jsx("div",{className:"flex justify-center items-center h-screen",children:Xt.jsxs("div",{className:"border-4 border-yellow-500 rounded-xl",children:[Xt.jsx(Kz,{}),Xt.jsx(Uz,{}),Xt.jsx(kz,{})]})}),Xt.jsx(Yz,{}),Xt.jsx(zz,{})]})}export{uG as default}; diff --git a/docs/index.html b/docs/index.html index d928592..6160520 100644 --- a/docs/index.html +++ b/docs/index.html @@ -21,7 +21,7 @@ Blog Account GitHub Discord Log in -